query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns whether the stack is empty.
public boolean empty() { return data.size() == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean emptyStack() {\n return (expStack.size() == 0);\n }", "public boolean isEmpty()\n {\n return stack.size() == 0;\n }", "public boolean isEmpty() {\n \treturn stack.size() == 0;\n }", "public boolean isEmpty()\n {\n return stack.isEmpty();\n }", "public boolean isEmpty() {\n return stackImpl.isEmpty();\n }", "public boolean empty() {\r\n return this.stack.isEmpty();\r\n }", "public boolean empty() {\r\n return stack.isEmpty();\r\n }", "public boolean empty() {\n return stack.isEmpty();\n }", "public boolean empty() {\n return stack.isEmpty();\n }", "public boolean empty() {\n System.out.println(stack.isEmpty());\n return stack.isEmpty();\n }", "public boolean isEmpty() {\n\t\treturn (stackSize == 0 ? true : false);\n\t}", "public boolean empty() {\r\n return stack.isEmpty();\r\n }", "public boolean empty() {\n return stack.isEmpty();\n }", "public boolean empty() {\n return popStack.empty() && pushStack.empty();\n }", "public boolean empty() {\n return stack.empty();\n }", "public boolean isEmpty(){\r\n\t\treturn stackData.isEmpty();\r\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn stack.isEmpty();\r\n\t}", "public boolean isEmpty(){\n return this.stack.isEmpty();\n\n }", "public final boolean isEmpty() {\n\t\treturn !(opstack.size() > 0);\n\t}", "public boolean empty() {\n return popStack.isEmpty();\n }", "public boolean empty() {\n\t\tif(stackTmp.isEmpty() && stack.isEmpty()){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isEmpty() {return stackList.isEmpty();}", "public boolean isEmpty() {\n return stack.isListEmpty();\n }", "public boolean empty() {\n return this.stack1.empty() && this.stack2.empty();\n }", "public boolean empty() {\n return this.stack2.size() == 0 && this.stack1.size() == 0;\n }", "public boolean stackEmpty() {\r\n\t\treturn (top == -1) ? true : false;\r\n\t }", "public boolean isEmpty() {\n if (opStack.size() == 0) {\n return true;\n }\n return false;\n }", "public boolean empty() {\n return rearStack.isEmpty() && frontStack.isEmpty();\n }", "public boolean empty() {\n /**\n * 当两个栈中都没有元素时,说明队列中也没有元素\n */\n return stack.isEmpty() && otherStack.isEmpty();\n }", "public boolean empty() {\r\n return inStack.empty() && outStack.empty();\r\n }", "public boolean empty() {\n if (stackIn.empty() && stackOut.empty()) {\n return true;\n }\n return false;\n }", "public boolean isCarStackEmpty() {\n boolean carStackEmpty = false;\n if(top < 0) {\n carStackEmpty = true;\n }\n return carStackEmpty;\n }", "public boolean isEmpty() {\n return downStack.isEmpty();\n }", "public boolean isEmpty(){\r\n \treturn stack1.isEmpty();\r\n }", "public boolean empty() {\n return stack1.empty();\n }", "public boolean empty() {\n return stack1.isEmpty() && stack2.isEmpty();\n }", "public boolean empty() {\n return mStack1.isEmpty() && mStack2.isEmpty();\n }", "public boolean isEmpty() \n {\n return stack1.isEmpty() && stack2.isEmpty();\n }", "@Override\r\n\tpublic boolean isFull() {\r\n\t\treturn stack.size() == size;\r\n\t}", "private static boolean isStackEmpty(SessionState state)\n\t{\n\t\tStack operations_stack = (Stack) state.getAttribute(STATE_SUSPENDED_OPERATIONS_STACK);\n\t\tif(operations_stack == null)\n\t\t{\n\t\t\toperations_stack = new Stack();\n\t\t\tstate.setAttribute(STATE_SUSPENDED_OPERATIONS_STACK, operations_stack);\n\t\t}\n\t\treturn operations_stack.isEmpty();\n\t}", "public boolean isEmpty() {\n\n return (top == null);\n }", "public boolean empty() {\n return storeStack.isEmpty();\n }", "public boolean empty() {\n return storeStack.isEmpty();\n }", "public boolean empty() {\n return storeStack.isEmpty();\n }", "public boolean isEmpty() {\r\n return (top == null);\r\n }", "public boolean isEmpty() {\n return (this.top == 0);\n }", "public boolean isEmpty() {\n\t\treturn (top == null) ? true : false;\n\t}", "public boolean isEmpty()\n\t{\n\t\treturn top == null;\n\t}", "public boolean isEmpty() {\n\t\t\n\t\treturn top == null;\n\t}", "public boolean isFull() {\n return (this.top == this.stack.length);\n }", "public boolean isEmpty() {\n return top == null;\n }", "public boolean isEmpty() {\n return top == null;\n }", "public boolean isEmpty()\r\n\t{\r\n\t\treturn top<=0;\r\n\t}", "public boolean isEmpty() {\n\t\treturn heap.size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn heap.size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn heap.isEmpty();\n\t}", "public boolean empty() {\n return push.isEmpty();\n }", "public boolean is_empty() {\n\t\tif (queue.size() <= 0) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\r\n\tpublic boolean isFull() {\r\n\t\tif(topIndex == stack.length -1) {\r\n\t\t\treturn true;\r\n\t\t}else {\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t}", "public boolean isEmpty(){\n return (top == 0);\n }", "public boolean isEmpty()\r\n {\n return this.top == null;\r\n }", "public boolean isEmpty() {\n return this.top == null;\n }", "public boolean isEmpty() {\n if(this.top== -1) {\n return true;\n }\n return false;\n }", "public void testIsEmpty() {\n assertTrue(this.empty.isEmpty());\n assertFalse(this.stack.isEmpty());\n }", "public boolean isEmpty() {\n\t\treturn front == null;\n\t}", "public boolean empty() { \n if (top == -1) {\n return true;\n }\n else {\n return false;\n }\n }", "public boolean isEmpty() {\n return (fifoEmpty.getBoolean());\n }", "public boolean empty() {\n\t\treturn (size() <= 0);\n\t}", "public boolean isEmpty() {\n return top==-1;\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn top==null;\r\n\t}", "public boolean isFull(){\n return (top == employeeStack.length);\n }", "public boolean isEmpty()\n {\n return heapSize == 0;\n }", "public static boolean isEmpty()\n { return currentSize==0; }", "public boolean isEmpty() {\n return topIndex < 0;\n }", "public final boolean isEmpty() {\r\n\t\treturn this.size == 0;\r\n\t}", "public boolean isEmpty() {\n\t\treturn queue.isEmpty();\n\t}", "public boolean isEmpty() {\n\t\treturn queue.isEmpty();\n\t}", "public boolean isEmpty() {\n\t\treturn (size == 0);\n\t}", "public boolean empty() {\n return stk1.isEmpty() && stk2.isEmpty();\n }", "public synchronized boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn currentSize == 0;\n\t}", "public boolean isEmpty(){\n if(top == null)return true;\n return false;\n }", "public boolean isEmpty() {\n\t\treturn mSentinel == mRoot;// if the root is equal to the sentinel(empty\n\t\t\t\t\t\t\t\t\t// node) then the tree is empty otherwise it\n\t\t\t\t\t\t\t\t\t// is not\n\t}", "public boolean isEmpty()\n\t{\n\t\treturn (head == null);\n\t}", "public boolean isHeapEmpty() {\n\t\treturn this.head == null;\n\t}", "public boolean isSet() {\n return !this.stack.isEmpty();\n }", "public boolean isEmpty() {\r\n\t\t\r\n\t\treturn topNode == null; // Checks if topNode is null;\r\n\t\t\r\n\t}", "public final boolean isEmpty() {\n return mSize == 0;\n }", "public boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean empty() {\n return size <= 0;\n }", "public boolean isEmpty() {\n return (size == 0);\n }", "public boolean isEmpty() {\n\t\treturn size == 0;\r\n\t}", "public boolean isEmpty() {\n return doIsEmpty();\n }", "public boolean empty() {\n return size == 0;\n }", "public boolean isEmpty() {\n return this.queue.size() == 0;\n }", "public boolean isEmpty() {\r\n return (size == 0);\r\n }", "public boolean isEmpty() {\r\n\t\treturn size == 0;\r\n\t}", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}" ]
[ "0.9056825", "0.89871675", "0.89270204", "0.89137876", "0.88953143", "0.8862492", "0.881352", "0.8804085", "0.8804085", "0.8802169", "0.8761835", "0.8756231", "0.87347007", "0.87344116", "0.8714369", "0.87058264", "0.8695712", "0.8680448", "0.8662702", "0.863666", "0.8620814", "0.8590292", "0.8536041", "0.85202885", "0.84936136", "0.84548974", "0.84050393", "0.8387681", "0.8364577", "0.83544964", "0.83170897", "0.83042306", "0.8283051", "0.82790375", "0.8276599", "0.82362294", "0.8206897", "0.81942767", "0.8156695", "0.8026406", "0.80128783", "0.7958021", "0.7958021", "0.7958021", "0.7939165", "0.79273045", "0.7913121", "0.7879263", "0.78698885", "0.78670245", "0.781039", "0.781039", "0.77880466", "0.77261925", "0.77261925", "0.7722835", "0.7722833", "0.77215236", "0.7702043", "0.77018005", "0.769895", "0.7675423", "0.76143014", "0.7592153", "0.7582409", "0.7563792", "0.75413835", "0.7533127", "0.75158125", "0.7509667", "0.7507217", "0.75050116", "0.74972826", "0.74966437", "0.7492269", "0.7486575", "0.7486575", "0.7472114", "0.7462987", "0.7455354", "0.7447542", "0.7443833", "0.7425991", "0.74256235", "0.742533", "0.74214625", "0.7414964", "0.7400749", "0.7398509", "0.7398509", "0.7398509", "0.73952186", "0.73941374", "0.7393943", "0.7393743", "0.73895943", "0.7387257", "0.7386999", "0.73867625", "0.7383484", "0.7383484" ]
0.0
-1
add an element at a specific index.
public static void main(String[] args) { List<String> s = new ArrayList<String>(); s.add("SONALI");// 0 index s.add("SUNITA");// 1 index s.add(1, "SUHANI");// SUNITA WIL BE MOVED TO 2 index System.out.println(s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void add(int index, T element);", "void add(int index, T element);", "void add(int index, Object element);", "public void add(int index, E element);", "public abstract void add(T element, int index);", "public void add(int index, Object element) {\r\n addBefore(element, (index == size ? header : entry(index)));\r\n }", "@Override\n\tpublic void add(int index, Object e) throws IndexOutOfBoundsException\n\t{\n\t\t//just to check if the index is valid\n\t\tif ( index < 0 || index > size )\n \t\tthrow new IndexOutOfBoundsException();\n\t\t//check arraylist size\n\t\tif (size == myArray.length)\n\t\t\tresizeUp();\n\t\t//move all the proceeding elements to make room for the desired element\n\t\tfor ( int i = size; i > index; i-- )\n \t\tmyArray[i] = myArray[i-1];\n \t//plug the element\n\t\tmyArray[index] = e;\n \t++this.size;\n\n\t\t\n\t}", "@Override\n public void add(int index, T element) {\n Object[] newArray = new Object[size + 1];\n for (int i = 0; i < index; i++) {\n newArray[i] = data[i];\n }\n newArray[index] = element;\n for (int i = index + 1; i < newArray.length; i++) {\n newArray[i] = data[i - 1];\n }\n data = newArray;\n size++;\n }", "public abstract void add(int index, E e);", "public void add(T element, int pos);", "public void add(int index, E x) {\n\t\tif (index < 0 || index > mSize) // == mSize allowed\n\t\t\tthrow new IndexOutOfBoundsException();\n\n\t\tif (size() == 0)\n\t\t\taddFirst(x);\n\t\telse {\n\t\t\taddBefore(getNode(index, 0, size()), x);\n\t\t\tmSize++;\n\t\t\tmodCount++;\n\t\t}\n\t}", "public @Override void add(int index, E element) {\n \tNode n = index == size ? sentinel : getNode(index);\n \tnew Node(n.pred, element);\n }", "public void add(int index, Type t);", "public void add(int index, Object item)\n {\n items[index] = item;\n numItems++;\n }", "public void add (int index, E item)\n {\n if (index < 0 || index > size) {\n throw new\n IndexOutOfBoundsException(Integer.toString(index));\n }\n if (index == 0)\n addFirst(item);\n else {\n Node<E> node = getNode(index - 1);\n addAfter(node, item);\n }\n }", "@Override\n\tpublic void add(int idx, E element) {\n\t\tif (element == null)\n\t\t\tthrow new NullPointerException();\n\t\tif (idx < 0 || idx > size())\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (element.equals(list[i]))\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t// Element is added to the end of the list\n\t\tif (idx == size)\n\t\t\tlist[idx] = element;\n\n\t\t// Element is added at the beginning or middle\n\t\telse {\n\t\t\tfor (int i = size; i > idx; i--) {\n\t\t\t\tlist[i] = list[i - 1];\n\t\t\t}\n\t\t\tlist[idx] = element;\n\t\t}\n\n\t\tsize++;\n\t\tif (size == list.length)\n\t\t\tgrowArray();\n\n\t}", "@Override\n public void add(final int index, final T element) {\n this.checkIndexToAdd(index);\n\n if (this.size > this.data.length - 1) {\n this.doubleArraySizeBy(2);\n }\n\n for (int i = this.size; i > index; i--) {\n this.data[i] = this.data[i - 1];\n }\n\n this.data[index] = element;\n this.size++;\n }", "public void add(int index, int value) {\n\t\t\tif(index < 0 || index > size) {\n\t\t\t\tthrow new IndexOutOfBoundsException(\"index\" + index);\n\t\t\t}\n\t\t\tensureCapacity(size + 1);\n\t\t\tfor(int i = size; i > index; i--) {\n\t\t\t\telementData[size] = elementData[i - 1];\n\t\t\t}\n\t\t\telementData[index] = value;\n\t\t\tsize++;\n\t\t}", "public void add(int index, E e) {\n resize();\n for(int i = size-1; i >= index; i--) {\n list[i+1] = list[i];\n }\n list[index] = e;\n size++;\n }", "public void add(E s,int index) {\t//O(n)\r\n\t\t//checks if the index is valid\r\n\t\tif(index>=0 && index<=size) {\t//index is valid\r\n\t\t\t//checks if there is any space left in the array\r\n\t\t\tif(size>=capacity)\r\n\t\t\t\tresize(this.capacity*2);\t//increases size of the array\r\n\t\t\tfor (int k=size-1; k>=index;k--) {\t//shifting element\r\n\t\t\t\tlist[k+1]=list[k];\r\n\t\t\t}\r\n\t\t\tlist[index]=s;\t//add element to the index\r\n\t\t\tsize++;\t//increases size\r\n\t\t} else {\t//index is not valid\r\n\t\t\tSystem.out.println(\"index \"+index+\" is out or range!\");\r\n\t\t}\r\n\t}", "public void insert(int index, T element);", "void add(int i, E e) throws IndexOutOfBoundsException;", "@Override\r\n public void add(int index, E element) {\r\n if (index < 0 || index > size) {\r\n throw new IndexOutOfBoundsException();\r\n\r\n }\r\n for (int i = 0; i < size; i++) {\r\n if (get(i).equals(element)) {\r\n throw new IllegalArgumentException();\r\n }\r\n }\r\n\r\n LinkedListIterator it = new LinkedListIterator(index);\r\n it.add(element);\r\n\r\n }", "public void add(int index, E obj)\r\n {\r\n listIterator(index).add(obj);\r\n }", "void add(int i , E e) throws IndexOutOfBoundsException;", "public void addElement(int index, TLProperty element);", "public void add(int index, T value) throws IndexOutOfBoundsException {\n checkException(index);\n if (size == arr.length) {\n final int newSize = arr.length * 3 / 2 + 1;\n T[] newArr = (T[]) new Object[newSize];\n System.arraycopy(arr, 0, newArr, 0, size);\n this.arr = newArr;\n }\n System.arraycopy(arr, index, arr, index + 1, size - index);\n arr[index] = value;\n size++;\n }", "public void insertElementAt(Object obj, int index);", "public void add(int index, T element) {\n\t\tif (index < 0 || index > size)\n\t\t\tthrow new ArrayIndexOutOfBoundsException();\n\t\tif (index == 0) {\n\t\t\tinsertHead(element);\n\t\t\treturn;\n\t\t}\n\t\tif (index == size) {\n\t\t\tinsertTail(element);\n\t\t}\n\t\tNode<T> curNode = head;\n\t\twhile (index != 1) {\n\t\t\tcurNode = curNode.next;\n\t\t\tindex--;\n\t\t}\n\t\tNode<T> temp = curNode.next;\n\t\tcurNode.next = new Node<>(element);\n\t\tcurNode.next.next = temp;\n\t\tsize++;\n\t}", "@Override\n public void add(int index, T t) {\n checkIfArrayFull();\n\n if(index >= arrayList.length) {\n System.out.println(\"The index is out of bounds for this list\");\n System.exit(-1);\n }\n\n Object ob = arrayList[index];\n arrayList[index] = t;\n\n Object ob2;\n\n /*The loop cycles through the array starting at index. ob2 is given the value of arrayList at i+1 position.\n The arrayList at i+1 position is assigned the value of ob. Then the ob variable is assigned the value of ob2. */\n for(int i = index; i < arrayList.length - 1; i++) {\n ob2 = arrayList[i+1];\n arrayList[i+1] = ob;\n ob = ob2;\n }\n\n elementsInArray++;\n }", "@Override\n public void add(int index, E value) {\n this.rangeCheck(index);\n if (this.values.length == this.index) {\n this.grow();\n }\n this.modCount++;\n System.arraycopy(this.values, index, this.values, index + 1, this.size() - index);\n this.values[index] = value;\n this.index++;\n }", "@Override\n public void add(int index, int element) {\n Entry newElement = new Entry(element);\n Entry tmp = getEntry(index);\n newElement.next = tmp;\n newElement.previous = tmp.previous;\n tmp.previous.next = newElement;\n tmp.previous = newElement;\n size++;\n }", "public void add(int index, E anEntry){\n if (index < 0 || index > size){\n throw new ArrayIndexOutOfBoundsException(index);\n }\n if (size == capacity){\n reallocate();\n }\n // Shift data in elements from index to size ‐ 1\n for (int i = size; i > index; i--){\n theData[i] = theData[i - 1];\n }\n // Insert the new item.\n theData[index] = anEntry;\n size++;\n }", "void add(int idx, float incr);", "public void insertElementAt(Object obj, int index)\n {\n try {element.insertElementAt(obj, index);}\n catch (Exception e) {\n throw new IllegalArgumentException\n (\"VectorLinearList.insertElementAt: \" +\n \"index must be between 0 and size\");\n }\n }", "public void add(int element);", "private void testAddAtIndex(){\n System.out.println(\"------ TESTING : add(int index, int element) ------\");\n try{\n // The insertion will add values to the front\n // the sequence should be iSize-1....,1,0\n for(int i = 0; i < iSize ; i++){\n if(!iTestList.add(0,i))\n throw new RuntimeException(\"FAILED -> add(index,element) not working correctly\");\n }\n // we should test the out of edge cases\n // if we try the following code and the return value is true or if the\n // program crashes then there is a problem\n if(iTestList.add(iSize+10, 999 )){\n throw new RuntimeException(\"FAILED -> index should not be > SIZE\");\n }\n if(iTestList.add(-2,999 )){\n throw new RuntimeException(\"FAILED -> index should not be < 0\");\n }\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n }", "public void add(T data, int index) {\n\t\tif (index < 0 || index > this.size) {\n\t\t\tthrow new ArrayIndexOutOfBoundsException();\n\t\t} else if (index == size) {\n\t\t\tthis.add(data);\n\t\t} else if (index == 0) {\n\t\t\tthis.addFirst(data);\n\t\t} else {\n\t\t\tListNode<T> previousElement = goToIndex(index - 1);\n\t\t\tListNode<T> currentElement = goToIndex(index);\n\t\t\tListNode<T> newElement = new ListNode<T>(data, currentElement);\n\t\t\tpreviousElement.setNext(newElement);\n\t\t\tthis.size++;\n\t\t}\n\t}", "public final void add(final int index, final TokenStatement element) {\r\n\t\tif (index > this.size || index < 0) {\r\n\t\t\tthrow new IndexOutOfBoundsException( \"Index: \" + index + \", Size: \" + this.size );\r\n\t\t}\r\n\t\tthis.ensureCapacity( this.size + 1 ); // Increments modCount!!\r\n\t\tSystem.arraycopy( this.elementData, index, this.elementData, index + 1, this.size - index );\r\n\t\tthis.elementData[index] = element;\r\n\t\tthis.size++;\r\n\t}", "public void add(int index, E obj) {\n\t\tif (obj == null) {\n\t\t\tthrow new NullPointerException(\"Object to add cannot be null\");\n\t\t}\n\t\tif (index < 0 || index > this.size()) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Index is out of bounds\");\n\t\t}\n\t\t// Check for dupes\n\t\tfor (int i = 0; i < size(); i++) {\n\t\t\tif (obj.equals(get(i))) {\n\t\t\t\tthrow new IllegalArgumentException(\"Object to add cannot be a duplicate\");\n\t\t\t}\n\t\t}\n\t\t// Check if capacity needs to be increased\n\t\tif (this.size() == size) {\n\t\t\tthis.growArray();\n\t\t}\n\t\t// Add element to end\n\t\tif (index == size()) {\n\t\t\tlist[index] = obj;\n\t\t}\n\t\t// Add element to front or middle\n\t\telse if (index < size()) {\n\t\t\t// Shift elements after index to the right\n\t\t\tfor (int i = size(); i > index; i--) {\n\t\t\t\tlist[i] = list[i - 1];\n\t\t\t}\n\t\t\tset(index, obj);\n\t\t}\n\t}", "public void add(int index, Object element) {\n\n\t\tif (element == null) {\n\t\t\tthrow new IllegalArgumentException(\"ArrayList cannot contain null.\");\n\t\t}\n\t\tif (index < 0 || index > this.size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"the index [\" + index\n\t\t\t\t\t+ \"] is not valid for this list with the size [\"\n\t\t\t\t\t+ this.size + \"].\");\n\t\t}\n\t\tif (this.size >= this.storedObjects.length) {\n\t\t\tincreaseCapacity();\n\t\t}\n\t\t// shift all following elements one position to the back:\n\t\tfor (int i = this.size; i > index; i--) {\n\t\t\tthis.storedObjects[i] = this.storedObjects[i - 1];\n\t\t}\n\t\t// insert the given element:\n\t\tthis.storedObjects[index] = element;\n\t\tthis.size++;\n\t}", "public void add(final T data, final int index) {\n if (index < 0 || index > numElement + 1) {\n throw new IndexOutOfBoundsException();\n }\n Node<T> newNode = new Node<>(data);\n if (index == 0) {\n prepend(data);\n } else if (index == numElement) {\n append(data);\n }\n Node<T> iterator = head;\n for (int currentIndex = 0; currentIndex < index - 1; currentIndex++) {\n iterator = iterator.getNext();\n }\n newNode.setNext(iterator.getNext());\n iterator.setNext(newNode);\n numElement++;\n }", "public void add(T element, int index) {\n int counter = 0;\n Node<T> newNode = new Node(element);\n Node<T> current = itsFirstNode;\n\t\tif (current == null) {\n\t\t\tthrow new NoSuchElementException(\"Beyond size of list or list empty\");\n\t\t}\n\t\twhile (current.getNextNode() != null ) {\n\t\t\tif ((counter == index - 1) || (index == 0)) {\n\t\t\t\tbreak;\n\t\t\t}\t\n\t\t\tcurrent = current.getNextNode();\n\t\t\tcounter++;\n\t\t}\n\t\ttry {\n\t\t\tif (index == 0) {\n\t\t\t\taddAsFirst(newNode);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewNode.setNextNode(current.getNextNode());\n\t\t\t\t(newNode.getNextNode()).setPriorNode(newNode);\n\t\t\t\tcurrent.setNextNode(newNode);\n\t\t\t\tnewNode.setPriorNode(current);\n\t\t\t}\n\t\t}\n\t\tcatch (NullPointerException e) {\n\t\t\t// NullPointer is fine\n\t\t}\n size++;\n }", "@Override\n public void add(int index, T element){\n if(index < 0 || index > size()){\n throw new NullPointerException();\n }else if(isEmpty() || index == size()){\n add(element);\n } else if(index == 0){\n prepend(element);\n } else{\n DLLNode<T> newNode = new DLLNode<T>(element);\n DLLNode<T> rightNode = getCurrentNode(index);\n DLLNode<T> leftNode = rightNode.previous;\n leftNode.successor = newNode;\n newNode.previous = leftNode;\n newNode.successor = rightNode;\n rightNode.previous = newNode;\n }\n }", "@Override\n public void add(int index, E value) {\n // todo: Students must code\n ensureCapacity();\n int pos = calculate(index); // True position in array\n\n // if there are no elements, set head to the position (index 0, position ??)\n // *protects against divide by zero in modulus*\n if(size() == 0) {\n data[pos] = value;\n head = pos;\n tail = pos;\n // tail = (pos+1)%data.length;\n }\n // if the logical position is the head, then insert right before head and reassign head-variable\n // *tail stays the same*\n else if(index == 0) {\n int i = (head-1);\n if (i < 0) i = data.length-1;\n head = i;\n data[head] = value;\n }\n else{\n // shift all array contents after pos right 1\n for(int i = (pos + size() - index); i > pos; i--)\n data[i % data.length] = data[(i-1) % data.length];\n data[pos] = value;\n tail = (tail + 1) % data.length;\n }\n curSize++;\n }", "private void addAtIndex(int index, FoodItem item) {\n // store the \"pushed\" forward item\n FoodItem toMoveNext = this._stock[index];\n // and set the new item in index\n this._stock[index] = new FoodItem(item);\n\n // \"push\" forward in the array each item, until no more items to push.\n for (int i = index+1; i < _noOfItems+1; i++) {\n FoodItem tempToMoveNext = _stock[i];\n _stock[i] = toMoveNext;\n toMoveNext = tempToMoveNext;\n }\n\n // we added a new item for _stock, so now increase the noOfItem:\n this._noOfItems++;\n }", "void add(int index, int value) {\n int[] newItems = new int[size++];\n\n System.arraycopy(items, 0, newItems, 0, index);\n\n newItems[index] = value;\n\n System.arraycopy(items, index, newItems, index + 1, items.length - index);\n\n items = newItems;\n }", "public void add(int index, CoreResourceHandle e) {\n if (index < 0 || index > doSize()) {\n throw new IndexOutOfBoundsException();\n } else if (e != null) {\n doAdd(index, e);\n } else {\n throw new NullPointerException();\n }\n }", "public void add(int index, String value){\n\tadd(value);\n }", "@Override\n\tpublic void add(int index, E element) {\n\t\trangeCheckForAdd(index);\n\t\tif (index==size) {\n\t\t\tNode<E> oldLast = last;\n\t\t\tlast = new Node<E>(oldLast, element, first);\n\t\t\t//这是链表添加的第一个元素\n\t\t\tif (oldLast == null) {\n\t\t\t\tfirst = last;\n\t\t\t\tfirst.next = first;\n\t\t\t\tfirst.prev = first;\n\t\t\t}else {\n\t\t\t\toldLast.next = last;\n\t\t\t\tfirst.prev = last;\n\t\t\t}\n\t\t}else {\n\t\t\tNode<E> next = node(index);\n\t\t\tNode<E> prev = next.prev;\n\t\t\tNode<E> node = new Node<E>(prev, element, next);\n\t\t\tnext.prev = node;\n\t\t\tprev.next = node;\n\t\t\tif (next == first) { // index == 0\n\t\t\t\tfirst = node;\n\t\t\t}\n\t\t}\n\t\tsize ++;\n\t}", "public void add(int index, T element)\r\n {\r\n Node<T> newNode = new Node<T>(element);\r\n Node<T> walker; // needed for traversing the list\r\n \r\n if ((index < 0) || (index > numElements))\r\n throw new IndexOutOfBoundsException(\r\n \"Illegal index \" + index + \" passed to add method.\\n\");\r\n\r\n if (front == null) // add to empty list\r\n { \r\n front = newNode;\r\n rear = newNode;\r\n }\r\n else if (index == 0) // add to front\r\n {\r\n newNode.next = front;\r\n front = newNode;\r\n }\r\n else if (index == size()) // add to rear\r\n {\r\n rear.next = newNode;\r\n rear = newNode;\r\n }\r\n else // add to interior part of list\r\n {\r\n walker = front; \r\n for (int i=0; i<(index-1); i++)\r\n {\r\n walker = walker.next;\r\n }\r\n newNode.next = walker.next;\r\n walker.next = newNode;\r\n }\r\n numElements++;\r\n }", "public void add(Object x, int index) {\n\tint counter = 0;\n\twhile (counter < _size) {\n\t if (get(counter) == x) {\n\t\thelpAdd( x, index);\n\t }\n\t counter +=1;\n\t}\n\tadd(x);\n\t\n }", "@Override\n public boolean add(int index, T object) {\n T[] newArray;\n if (array[array.length - 1] != null) {\n newArray = (T[]) new Object[array.length * 2];\n } else {\n newArray = (T[]) new Object[array.length];\n }\n for (int i = 0; i < index; i++) {\n newArray[i] = array[i];\n\n }\n newArray[index] = object;\n for (int i = index + 1; i < array.length; i++) {\n newArray[i] = array[i - 1];\n }\n this.size++;\n this.array = newArray;\n return true;\n }", "@Override\r\n\tpublic boolean add(T obj, int index) {\n\t\tif (index < 0 || index > size) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (size >= array.length)\r\n\t\t\tallocate();\r\n\t\tSystem.arraycopy(array, index, array, index + 1, size - index);\r\n\t\tarray[index] = obj;\r\n\t\tsize++;\r\n\t\treturn true;\r\n\t}", "public void insertElementAt(Replicated obj, int index)\r\n\t{\n\t\tinsert(obj, index);\r\n\t}", "public void add( int index, Comparable newVal ) { \n \t//checks if there is a meaningful value at index\n \tif (index> _lastPos){\n\t System.out.println(\"No meaningful int at index\");\n \t} else {\n\t //If _data is full, increase length of _data\n\t if (_size == _data.length) {\n\t\texpand();\n\t }\t\t\n\t //copies everything before index from _data to temp \n\t for (int i = _lastPos; i >= index; i--) {\n\t\t_data[i+1]= _data[i];\n\t }\n\t _data[index]= newVal;\n\t _size++;\n\t _lastPos++;\n\t}//end else\n\t \n }", "public void add(int index, E element) {\n\t\tcheckBounds(index);\r\n\t\tif(index == size) {\r\n\t\t\tadd(element);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tNode<E> node = new Node<E>(element);\r\n\t\tif(index == 0) {\r\n\t\t\thead.setPrevious(node);\r\n\t\t\tnode.setNext(head);\r\n\t\t\thead = node;\r\n\t\t} else {\r\n\t\t\tnode.setNext(getNode(index));\r\n\t\t\tnode.setPrevious(getNode(index-1));\r\n\t\t\tgetNode(index-1).setNext(node);\r\n\t\t\tgetNode(index).setPrevious(node);\r\n\t\t}\r\n\t\tsize++;\r\n\t}", "public void addAtIndex(int index, int data)\n {\n Node newNode = new Node(data);\n Node oldNode = head;\n\n for (int i=1;i<size;i++)\n {\n if (i == index)\n {\n Node myNode = oldNode.next;\n oldNode.next = newNode;\n newNode.next = myNode;\n break;\n }\n oldNode = oldNode.next;\n }\n size++ ;\n }", "public void add(int index, String value){\n add(value);\n }", "public void addAtIndex(int idx, T v) {\n addAtIndex(idx, new Node(v));\n }", "public void add(int index, Object element) {\r\n refs.add(index, new WeakReference(element));\r\n }", "public synchronized void insertElementAt(WModelObject object, int index)\n\t{\n\t\tm_elements.insertElementAt(object, index);\n\t}", "public void add(int index, Object value) {\n if (index > _size) {\n throw new ListIndexOutOfBoundsException(\"Error\");\n }\n ListNode node = new ListNode(value);\n if (index == 0) {\n node.next = start;\n start = node;\n } else {\n ListNode prev = start;\n for (int i = 0; i<index - 1; i++ ) {\n prev = prev.next;\n }\n ListNode temp = prev.next;\n prev.next = node;\n node.next = temp;\n } \n _size++;\n }", "public void add(int index, double value) {\n\t\t\n\t}", "@Override\n\t\tpublic void add(int index, Community element) {\n\t\t\t\n\t\t}", "public boolean add(int index, E elem) {\r\n\t\tif (index < 0 || index > size) {\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\t} else {\r\n\t\t\tNode<E> adding;\r\n\t\t\tif (size == 0) {\r\n\t\t\t\tadding = new Node<E>(elem, null, null);\r\n\t\t\t\thead = adding;\r\n\t\t\t\ttail = adding;\r\n\t\t\t} else {\r\n\t\t\t\tif (index <= size - 1) { // adding between nodes\r\n\t\t\t\t\tNode<E> oldItem = indices.get(index);\r\n\t\t\t\t\tadding = new Node<E>(elem, oldItem.prev, oldItem);\r\n\t\t\t\t\toldItem.prev = adding;\r\n\t\t\t\t\tif (index == 0) {\r\n\t\t\t\t\t\thead = adding;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else { // appending (index == size)\r\n\t\t\t\t\tappend(elem);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tindices.add(index, adding);\r\n\t\t\tsize++;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "@Override\n public void add(int index, T elem) {\n if(index < 0 || index >= size()) {//if the required index is not valid, give error\n throw new IndexOutOfBoundsException();\n }\n //if we want to add at the beginning of the list\n if(index == 0) {\n prepend(elem); //reuse prepend method when adding at the start of list\n return;\n }\n //if we want to add inside the list\n DLNode<T> predecessor = first; //create a reference, point it to the first node\n for(int i = 0; i < index - 1; i++) {//locate the preceeding index of the required index\n predecessor = predecessor.next;\n \n }\n DLNode<T> successor = predecessor.next; //another reference, now points to the index we want to add the new node to\n \n DLNode<T> middle = new DLNode(elem, predecessor, successor);//create new node, it's previous node is predecessor, the one after it is successor\n predecessor.next = middle; //new node is assigned to the required index, after predecessor, before successor\n \n if(successor == null) {//if there's no node after the new node\n last = middle; //new node is the last one \n }\n else{ //if there is a successor node exist\n successor.prev = middle; //new node preceeds it's successor\n } \n \n }", "public LinkedListElement add(int Index, T content) throws IndexOutOfBoundsException {\n if (Index == 0) {\n LinkedListElement element = new LinkedListElement(content);\n element.next = this;\n return element;\n } else {\n throw new IndexOutOfBoundsException(\"Methode add: Dieser Index existiert nicht!\");\n }\n }", "public void addAtIndex(int index, int val) {\n if (index < 0 || index > size) {\n return;\n }\n Node prev = dummyHead;\n for (int i = 0; i < index; i++) {\n prev = prev.next;\n }\n prev.next = new Node(val, prev.next);\n size++;\n }", "public void add(int index, AnyType t) throws IndexOutOfBoundsException, NullPointerException {\n \n if ( t == null ) throw new NullPointerException();\n \n addNode( index, new Node<AnyType>(t) );\n \n }", "public void addAtIndex(int index, T data) {\n Node<T> newNode = new Node<>();\n newNode.data = data;\n\n if (index == 0) {\n addAtStart(data);\n } else {\n Node<T> node = head;\n for (int i = 0; i < index - 1; i++) {\n node = node.next;\n }\n newNode.next = node.next;\n node.next = newNode;\n }\n }", "public void addAtIndex(int index, int val) {\n if (index > size) return;\n //Add at head\n if (index <= 0) {\n addAtHead(val);\n }\n //Add at end\n else if (index == size) {\n addAtTail(val);\n } else {\n ListNode newNode = new ListNode(val);\n ListNode curr = head;\n //Add somewhere in between\n for (int i = 0; i < index - 1; i++) {\n curr = curr.next;\n }\n newNode.next = curr.next;\n curr.next = newNode;\n size++;\n }\n }", "public void add(int index, T data) {\n\t\tif(index > size() || index < 0) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Illegal index: \" + index);\n\t\t}\n\t\t\n\t\tLinkedListNode<T> temp = head.getNext();\n\t\tint i = 0;\n\t\twhile(true) {\n\t\t\tif(temp == null) {\n\t\t\t\tthrow new InternalError(\"add(int index, T data) iterates past the end\");\n\t\t\t}\n\t\t\tif(index == i) {\n\t\t\t\tLinkedListNode<T> toAdd = new LinkedListNode<T>(temp, temp.getPrevious(), data);\n\t\t\t\ttemp.getPrevious().setNext(toAdd);\n\t\t\t\ttemp.setPrevious(toAdd);\n\t\t\t\tmodcount++;\n\t\t\t\tnodeCount++;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ti++;\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t}", "private void add(E e, int index) {\r\n\t\t\tif (hasRoom(index)) {\r\n\t\t\t\tshiftElements(data, index);\r\n\t\t\t\tdata[index] = e;\r\n\t\t\t} else {\r\n\t\t\t\tNode toAdd = new Node();\r\n\t\t\t\tthis.next.prev = toAdd;\r\n\t\t\t\ttoAdd.next = this.next;\r\n\t\t\t\ttoAdd.prev = this;\r\n\t\t\t\tthis.next = toAdd;\r\n\r\n\t\t\t\ttoAdd.data[0] = this.data[data.length - 1];\r\n\t\t\t\t// Shifts everything over one spot, the end element gets lost\r\n\t\t\t\tSystem.arraycopy(this.data, index, this.data, index + 1, data.length - index - 1);\r\n\t\t\t\tthis.data[index] = e;\r\n\t\t\t}\r\n\t\t}", "@Override\r\n public void add(int index, T b) {\r\n head = head.add(index, b);\r\n }", "public void add(int index, Object o) {\n try {\n Element element = (Element) o;\n if (element.type() == Element.CHUNK) {\n Chunk chunk = (Chunk) element;\n if (!font.isStandardFont()) {\n chunk.setFont(font.difference(chunk.font()));\n }\n super.add(index, chunk);\n }\n else if (element.type() == Element.PHRASE ||\n element.type() == Element.ANCHOR ||\n element.type() == Element.ANNOTATION ||\n element.type() == Element.TABLE || // line added by David Freels\n element.type() == Element.GRAPHIC) {\n super.add(index, element);\n }\n else {\n throw new ClassCastException(String.valueOf(element.type()));\n }\n }\n catch(ClassCastException cce) {\n throw new ClassCastException(\"Insertion of illegal Element: \" + cce.getMessage());\n }\n }", "public int add(int index, Path item) {\n // Gracefully handle items beyond end\n final int size = mItems.size();\n index = constrain(index, 0, size);\n\n mItems.add(index, item);\n return index;\n }", "public void add(int index){\n int i = 0;\n boolean isFound = false;\n for (Product product:inventory.getProducts().keySet())\n {\n i++;\n if (i == index && inventory.getProducts().get(product) > 0)\n {\n if (myBasket.containsKey(product))\n {\n System.out.println(\"One more of this product added.\");\n myBasket.replace(product , myBasket.get(product) + 1);\n }\n else {\n System.out.println(\"Product added to your basket.\");\n myBasket.put(product , 1);\n }\n totalCost = totalCost + product.getPrice();\n isFound = true;\n inventory.updateStock(product , '-');\n }\n }\n if (!isFound)\n System.out.println(\"Sorry. Invalid index or not enough product in stock!\");\n }", "public void addAt(int index, T data) {\n Node<T> newNode = new Node<T>();\n newNode.data = data;\n\n if (index == 0) {\n newNode.next = head;\n head = newNode;\n } else {\n Node<T> currentNode = head;\n Node<T> previousNode = null;\n\n for (int i = 0; i < index; i++) {\n previousNode = currentNode;\n currentNode = currentNode.next;\n }\n previousNode.next = newNode;\n newNode.next = currentNode;\n }\n size++;\n }", "void insert(int index, T value) throws ListException;", "public void add(int index, GPoint point) {\n\t\tpoints.add(index, new GPoint(point));\n\t}", "public void add(int index, double value) {\n\t\t_elements.put(index, value);\n\t\tif (index > _largestIndex) {\n\t\t\t_largestIndex = index;\n\t\t}\n\t}", "public void add(int i, T t) {\n if (size == elements.length) // checks potential overflow\n ensureCapacity(); // increase capacity\n size++; // increment size of list\n if (i < 0 || i >= size) // if there is no index i in list\n throw new IndexOutOfBoundsException(\"Treated index: \" + i + \" | Size of the Dynamic Array \" + size()); // cause IndexOutOfBoundException\n for (int j = size - 1; j > i; j--) { // treat elements of list with indexes in range [i+1, n]\n elements[j] = elements[j - 1]; // element shifts to right\n }\n elements[i] = t; // store element at index i\n }", "public void add(int index,Fraction x)\r\n\t{\r\n\t\tif(index<0 || index >=n)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Invalid index\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tif(n==a.length)\r\n\t\t\t{\r\n\t\t\t\tFraction b[]= new Fraction[a.length*2];\r\n\t\t\t\tfor(int i=0;i<n;i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tb[i]=a[i];\r\n\t\t\t\t}\r\n\t\t\t\ta=b;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tfor(int i= n;i>index;i--)\r\n\t\t\t\t{\r\n\t\t\t\t\ta[i]=a[i-1];\r\n\t\t\t\t}\r\n\t\ta[index]=x;\r\n\t\tn++;\r\n\t}", "public void addElement(int element) {\n \tif(element > 0) {\n \tarray[head++] = element;\n \t}else {\n \t\tthrow new RuntimeException(\"Invalid element to add\");\n \t}\n }", "public void addAtIndex(int index, T data) {\n if (data == null) {\n throw new IllegalArgumentException(\"You can't insert null \"\n + \"data in the structure.\");\n }\n if (index < 0 || index > size) {\n throw new IndexOutOfBoundsException(\"The data you are trying \"\n + \"to access is null\");\n }\n DoublyLinkedListNode<T> newnode = new DoublyLinkedListNode<T>(data);\n if (size == 0) {\n head = newnode;\n tail = head;\n size += 1;\n } else if (index == 0) {\n addToFront(data);\n } else if (size == index) {\n addToBack(data);\n } else {\n DoublyLinkedListNode<T> pointer = head;\n for (int i = 0; i < index - 1; i++) {\n pointer = pointer.getNext();\n }\n newnode.setNext(pointer.getNext());\n newnode.getNext().setPrevious(newnode);\n pointer.setNext(newnode);\n newnode.setPrevious(pointer);\n size += 1;\n }\n\n\n\n }", "public void addAtIndex(int index, int val) {\n if (index > this.size) {\n return;\n }\n\n if (index < 0) {\n index = 0;\n }\n\n ListNode pred = this.head;\n\n for (int i = 0; i < index; ++i) {\n pred = pred.next;\n }\n\n ListNode node = new ListNode(val);\n node.next = pred.next;\n pred.next = node;\n\n this.size++;\n }", "@Override\n public void add(int i, E e) throws IndexOutOfBoundsException {\n checkIndex(i, size + 1);\n if (size == data.length) // not enough capacity\n throw new IllegalStateException(\"Array is full\");\n for (int k = size - 1; k >= i; k--) // start by shifting rightmost\n data[k + 1] = data[k];\n data[i] = e; // ready to place the new element\n size++;\n }", "public void add(int index, E obj){\n Node n = head;\n Node foo = new Node<E>(obj);\n Node temp = new Node<E>(null);\n int count = 0;\n if(index >= size()){\n index = size(); \n }\n else if (index < 0){\n index = 0;\n }\n while(n.getNext() != null && count != index)\n {\n n = n.getNext();\n temp = n;\n count++;\n }\n temp = n.getNext();\n n.setNext(foo);\n foo.setNext(temp);\n }", "private int plusOne(int index) {\n if (index + 1 >= array.length) {\n return 0;\n } else {\n return index + 1;\n }\n }", "@Override\n public void add(T element) {\n add(size(), element);\n }", "public void insert(int index, T value) {\n extend();\n for (int i = this.list.length-1; i >index; i--) {\n this.list[i] = this.list[i-1];\n }\n this.list[index] = value;\n this.size++;\n }", "@Override\n public void add(int i, E e) throws IndexOutOfBoundsException,\n IllegalStateException {\n if (i == size){\n addLast(e);\n }\n else {\n validIndex(i);\n checkSize();\n for (int j = size - 1; j >= i; j--) {\n data[j + 1] = data[j];\n }\n data[i] = e;\n size++;\n }\n }", "public ReturnObject add(int index, Object item) {\n ReturnObjectImpl rtn = new ReturnObjectImpl();\n if (item == null) {\n rtn.setError(ErrorMessage.INVALID_ARGUMENT);\n } else if(index < 0 || index > size()) {\n rtn.setError(ErrorMessage.INDEX_OUT_OF_BOUNDS);\n } else {\n rtn.setObj(item);\n extendArray();\n for (int j = size()-1; j > index; j--) {\n AL[j] = AL[j-1];\n }\n AL[index] = item;\n }\n return rtn;\n }", "@Override\n\tpublic void add(int idx, T obj) throws IndexOutOfBoundsException {\n\t\tboolean found = false;\n\t\tint n = 0;\n\t\tListNode tmp = new ListNode(obj);\n\t\tListNode current = head;\n\t\t\n\t\tif (idx < 0 || idx > size()) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\telse if (idx == 0) {\n\t\t\ttmp.next = head;\n\t\t\thead = tmp;\n\t\t\tsize++;\n\t\t}\n\t\telse {\n\t\t\twhile (!found) {\n\t\t\t\tif (n == idx - 1) {\n\t\t\t\t\ttmp.next = current.next;\n\t\t\t\t\tcurrent.next = tmp;\n\t\t\t\t\tfound = true;\n\t\t\t\t\tsize++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void insertAtIndex(E toInsert, int atIndex) {\n\t\tfor(int x = numElements; x > atIndex; x--) {\n\t\t\telements[x] = elements[x-1];\n\t\t}\n\t\telements[atIndex] = toInsert;\n\t\tnumElements++;\n\t\tresize();\n\t}", "void insert(int idx, int val);", "public void add(T element) {\r\n if (element == null) {\r\n throw new IllegalArgumentException(); \r\n } \r\n if (size == elements.length) { \r\n resize(elements.length * 2); \r\n }\r\n elements[size()] = element; \r\n size++; \r\n }", "public void add(T element);", "public void add(T element);", "public void addAtIndex(int index, int val) {\n if(index==0) {\n addAtHead(val);\n return;\n }\n if(index==len) {\n addAtTail(val);\n return;\n }\n if(index>0 && index<len) {\n SingleNode cur = new SingleNode(val,null);\n SingleNode pre = head;\n for(int i=0; i<index-1; i++) {\n pre = pre.next;\n }\n cur.next = pre.next;\n pre.next = cur;\n len++;\n }\n }" ]
[ "0.8776814", "0.8776814", "0.8744577", "0.8694148", "0.8523414", "0.82142407", "0.7895779", "0.7874552", "0.78331935", "0.78182995", "0.7791892", "0.77714413", "0.76597047", "0.76439077", "0.7641874", "0.76406324", "0.76278305", "0.75954944", "0.75835043", "0.75808823", "0.7570902", "0.7559055", "0.7558308", "0.7555043", "0.7534294", "0.7482762", "0.74497175", "0.7449295", "0.74409795", "0.74395096", "0.7370077", "0.7360569", "0.7352247", "0.73424596", "0.73307735", "0.73270744", "0.7280821", "0.7269797", "0.72436684", "0.72280246", "0.72201073", "0.72107446", "0.72071695", "0.7189434", "0.717748", "0.71770865", "0.7157515", "0.71521854", "0.71374303", "0.7132469", "0.71304506", "0.7127835", "0.7086304", "0.7061723", "0.7053813", "0.70466727", "0.70374334", "0.7020896", "0.7012054", "0.7003033", "0.69655055", "0.69584525", "0.6955118", "0.6942876", "0.69339335", "0.6927975", "0.69232863", "0.6854096", "0.68533003", "0.68487805", "0.6837529", "0.67981905", "0.67913276", "0.67769545", "0.6773459", "0.67692995", "0.6754986", "0.674629", "0.6743575", "0.67432207", "0.6741714", "0.6725178", "0.6720978", "0.6714856", "0.66732925", "0.66611755", "0.6652576", "0.6641432", "0.6638775", "0.6633947", "0.6620357", "0.6599439", "0.6587191", "0.6586309", "0.6585566", "0.6583509", "0.6570009", "0.65601623", "0.6554933", "0.6554933", "0.655338" ]
0.0
-1
methods to be implemented
public int calculateVotes() { return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n public void perish() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public abstract void mo70713b();", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "protected void mo6255a() {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void verkaufen() {\n\t}", "@Override\r\n\tpublic void method() {\n\t\r\n\t}", "public abstract void mo56925d();", "public void mo38117a() {\n }", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n protected void init() {\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "protected abstract Set method_1559();", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "public abstract void mo27386d();", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void logic(){\r\n\r\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "public void mo55254a() {\n }", "@Override\r\n\tpublic void func01() {\n\t\t\r\n\t}", "@Override\n\tvoid methodabstract() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "public abstract void mo27385c();", "public void init() {\r\n\t\t// to override\r\n\t}", "public abstract void mo6549b();", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "Operations operations();", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public void mo9848a() {\n }", "public abstract void mo35054b();", "public void redibujarAlgoformers() {\n\t\t\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\r\n\tpublic void Method3() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "protected void init() {\n // to override and use this method\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}" ]
[ "0.7110757", "0.69562864", "0.69562864", "0.6896726", "0.6878356", "0.6804304", "0.67587715", "0.672219", "0.66528046", "0.6641446", "0.6635467", "0.6586215", "0.6577519", "0.6563472", "0.654419", "0.65440685", "0.65352213", "0.6515858", "0.6515858", "0.6511036", "0.65047824", "0.649628", "0.64536536", "0.6440448", "0.6423747", "0.6413318", "0.637537", "0.63728476", "0.6368785", "0.63665974", "0.63380337", "0.63222855", "0.62821025", "0.6273232", "0.6270657", "0.62687236", "0.6268417", "0.6253991", "0.6232761", "0.62255967", "0.6219827", "0.6193461", "0.6193461", "0.6190494", "0.6186519", "0.618411", "0.6167544", "0.6158214", "0.61505824", "0.61393166", "0.61393166", "0.6135754", "0.61290026", "0.6110617", "0.60996246", "0.60978746", "0.60870683", "0.60737854", "0.60521543", "0.6051851", "0.6044403", "0.6044403", "0.6044403", "0.6044403", "0.6044403", "0.6044403", "0.6044403", "0.6041635", "0.60301864", "0.6029209", "0.6025745", "0.6024635", "0.6018783", "0.6016084", "0.60152394", "0.6008073", "0.6007979", "0.6005222", "0.5998125", "0.5980676", "0.5980195", "0.59711695", "0.59663075", "0.5962639", "0.5962561", "0.59584963", "0.5945692", "0.59455955", "0.59426665", "0.59426665", "0.59426665", "0.59426665", "0.59426665", "0.59426665", "0.59421587", "0.59420186", "0.5940717", "0.5937946", "0.59345645", "0.5926309", "0.5926309" ]
0.0
-1
System.out.println("1,"+cGoodness); System.out.println("2,"+this.currentGoodness); System.out.println("getGoodnessDiff"+(cGoodness this.currentGoodness));
public double getGoodnessDiff(double cGoodness) { return (cGoodness - this.currentGoodness); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getDif()\n {\n return difficult;\n }", "public int getProS() {\n/* 60 */ return this.proS;\n/* */ }", "public int getGold(){\n return this.gold;\n }", "public int getWorth() { return 1; }", "public int getProT() {\n/* 78 */ return this.proT;\n/* */ }", "public long getHurtVal() {\n/* 133 */ return this.hurtVal;\n/* */ }", "public int getSecondL() {\n/* 54 */ return this.secondL;\n/* */ }", "public int getToughness();", "public int getProF() {\n/* 42 */ return this.proF;\n/* */ }", "int getGreen(){\n\n return this.green;\n }", "public double getTesting() {\r\n return testing;\r\n }", "public Float getSecondGprsSucc() {\r\n return secondGprsSucc;\r\n }", "public double getStrong(){return this.aStrong;}", "public int value(){ // no input , some output\n\t\t\tSystem.out.println(\"value method\");\n\n\t\t\tint a = 10;\n\t\t\tint b = 20;\n\t\t\tint c = a+b;\n\t\t\treturn c ;\n\t\t}", "public double getFlete(){\n return localFlete;\n }", "public int getThirdR() {\n/* 66 */ return this.thirdR;\n/* */ }", "@Test\n public void testGetPrice()\n {\n System.out.println(\"getPrice\");\n PipeTypeFour instance = new PipeTypeFour(1,39, PipeGrade.THREE, false);\n \n \n Double expResult = 0.35 * getVol(39,1);\n double temp = expResult;\n //Colour\n expResult += temp * 1.17;\n //Insulation\n expResult += temp * 1.14;\n System.out.println(\"Expecting: \" + expResult);\n Double result = instance.getPrice();\n assertEquals(expResult, result);\n\n }", "public int getGov();", "public float getStatusChange() {\n\t\treturn statusChance;\n\t}", "public double getFluctuation() { return fluctuation; }", "public double getSecond()\n {\n return second;\n }", "public boolean getVDD(){return this.vientDeDouble;}", "public double getDifference()\n {\n return first - second;\n }", "public int getCoeficienteBernua()\n {\n return potenciaCV;\n }", "public int getSecondR() {\n/* 48 */ return this.secondR;\n/* */ }", "public int getTempCoolDown() {\n return tempCoolDown;\n }", "public int getEstValue(){\r\n return this.estValue;\r\n }", "public double getC1() {\n return c1;\n }", "public double getDifferenceImportance() {\n return differenceImportance;\n }", "public void displayValueComparison()\n {\n System.out.println(\"Player card value \" + Card.valueOfCard(playerCard));\n System.out.println(\"Computer card value \" + Card.valueOfCard(computerCard));\n }", "public static void main(String[] args) {\n\tSession_Two obj = new Session_Two();\n\t Session_Two obj1 = new Session_Two();\n\t Session_Two obj2 = new Session_Two();\n\t \n\t \n\t System.out.println(\"========================================\");\n\t System.out.println(obj.my_var);\n\t System.out.println(obj1.my_var);\n\t System.out.println(obj2.my_var);\n\t\n\t obj2.my_var =\"New Test\";\n\n\t System.out.println(\"========================================\");\n\t System.out.println(obj.my_var);\n\t System.out.println(obj1.my_var);\n\t System.out.println(obj2.my_var);\n\t \n\t//primitive datatypes\n\t \n\t byte a = 127;\n\t long b = 1234343423424l;\n\t float x = 10.05f;\n\t double y = 213623425356566756.77588d;\n\t \n\t float c = 10f/6f;\n\t double d = 10d/6d;\n\t \n\t/* System.out.println(c);\n\t System.out.println(d);*/\n\t \n\t double i = 10d;\n\t \n\tint ab = (int)i;\n\t \t \n\t System.out.println(i);\n\t System.out.println(ab);\n\t\n\t \n\t \n}", "@Test\n public void getDefensiveModifierTest() {\n \n assertEquals(0.2, hawthorn1.getDefenseModifier(), 0.1);\n }", "private double classValue(){\n return m_ClassValue;\n }", "public int getVoltage ()\n {\n return _voltage;\n }", "public int getCost() {\n/* 69 */ return this.cost;\n/* */ }", "Myclass(){\n\t\tx+=1; //x=4 burada 4 olarak update edildi. Asagida 4 olarak kullanacagiz\n\t\tSystem.out.print(\"-x\" + x); //-x4\n\t}", "public int getThirdL() {\n/* 72 */ return this.thirdL;\n/* */ }", "int getBlue(){\n\n return this.blue;\n }", "@Test\n public void Test05() {\n component = new DamageEffectComponent(EffectEnum.DAMAGE_BUFF, 3, 40);\n component.setDamage(10);\n double currentDamage = component.getDamage();\n assertTrue(currentDamage == 10);\n }", "public int getSecond() { return this.second; }", "public int getGold();", "static void primitiveBoolean() {\n\n double coveragerByInsurance = 0.8;\n double billAmount = 1000.0;\n double amountPaidByInsurance = 0.0;\n double amountPaidByPatient = billAmount;\n if (isInsured) {\n amountPaidByInsurance = billAmount * coveragerByInsurance;\n amountPaidByPatient = billAmount - amountPaidByInsurance;\n }\n System.out.println(\"AmountPaidByInsurance=\" + amountPaidByInsurance);\n System.out.println(\"AmountPaidBypatient=\" + amountPaidByPatient);\n }", "int getGreen(){\n return getPercentageValue(\"green\");\n }", "public void method(){\n\t\t\n\t\tint a=3;//only for this method//local variable\n\t\tSystem.out.println(a);\n\t\tSystem.out.println(this.a);\n\t\tSystem.out.print(a+this.a);\n\t}", "public double getWage(){\r\n return wage; \r\n }", "double getside1(){\n\t\treturn side1;\n\t}", "public double getHealth() { return health; }", "public double getCurrent( )\n {\n // Implemented by student.\n }", "public float getGreen() {\n return green;\n }", "public String toString(){\r\n String result = \"The number of sides is: \" + myNumSides + \"The current face value is: \" + myFaceValue;\r\n return result;\r\n }", "public void currentPedalCadence()\n {\n \tSystem.out.println(\"The current pedal cadence is \"+ cadence);\n }", "public int getCurrentCoolDown()\n\t{\n\t\treturn CurrentCoolDown;\n\t}", "public int getlife(){\r\n return life;\r\n}", "public Object good() {\n\t\treturn \"hyo\";\n\t}", "public int getWalkSpeedInc()\n{\n return walkSpeedInc;\n}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"hello world\");\nhell clsk1 = new hell(30,40);\nhell clsk2 = new hell(30,40);\nhell clsk3 = new hell();\n\n\nfloat result = clsk1.add(clsk1.v,clsk1.r);\nSystem.out.println(\"add should print method overloading and construction overloding 2 variables \"+result);\nfloat result1 = clsk2.add(clsk2.v,clsk2.r,clsk2.o);\nSystem.out.println(\"add should print method overloading and construction chaining 3 variables with 2 variables \"+result1);\nfloat result2 = clsk3.add(12,14,50,80);\nSystem.out.println(\"hello world\"+result2);\n\n\t}", "public int getWorth()\n {\n return worth;\n }", "@Test\r\n\tpublic void test10(){\n \t\tC1.setGrossSales(200);\r\n \t C1.setCommissionRate(100);\r\n\t String actual = C1.toString();\r\n String expected = \"commission employee: null null\\nsocial security number: null\\ngross sales: $200.00; commission rate: 0.00\";\r\n assertEquals(actual,expected);\r\n }", "public double getCourseworkPercentage(){return courseworkPercentage;}", "public float d()\r\n/* 15: */ {\r\n/* 16:163 */ return this.b;\r\n/* 17: */ }", "int getBlue(){\n return getPercentageValue(\"blue\");\n }", "public double getIterate() {\n\treturn d1;\n }", "@Override\n\tpublic String toString() \n {\n\t\tString output_variable=super.toString()+\"\\nDISCOUNT PERCENTAGE : \"+discountRate+\"\\n\"+\n\t\t\t\"PRICE AFTER DISCOUNT : \"+getUnitPrice();\n\t\treturn output_variable;\n\t}", "public a c() {\n return this.f2078c;\n }", "public String getTest1() {\r\n return test1;\r\n }", "public void Test1(){//we can change the logic\n\t\tint x = 20;\n\t\tint y = 50;\n\t\tSystem.out.println(\"Addition of 2 values are :\" + (x+y));\n\t}", "public void math1(){\n\t\tSystem.out.println(\"The variable B has value \"+ i);\n\t}", "@Test\n public void getAttackModifierTest() {\n \n assertEquals(1.4, hawthorn1.getAttackModifier(), 0.1);\n }", "public double get_numCorrectAns(){return this._numCorrectAns;}", "@Test\n public void getAmountDescription_current_caloriesGoal() {\n Goal goal = new Goal(2, 49.57, GoalType.Walk, \"2018-09-28\", \"2017-01-12\",\n 400);\n // Create the real and expected currentAmount descriptions\n description = goal.getAmountDescription(\"current\");\n expectedDescription = \"198 calories\";\n\n // Check the 2 Strings are the same\n assertEquals(expectedDescription, description);\n }", "public String c()\r\n/* 30: */ {\r\n/* 31:175 */ return \"step.\" + this.a;\r\n/* 32: */ }", "@Test\n public void testVirement2() {\n\n //Arrange\n CompteBancaire cpt1 = new CompteBancaire(63000.0);\n CompteBancaire cpt2 = new CompteBancaire(43000.0);\n double montant_a_virer = 88000.0;\n double excepted_solde_cpt1 = 63000.0;\n double excepted_solde_cpt2 = 43000.0;\n\n //Act\n assertEquals(false, cpt1.virerArgent(cpt2, montant_a_virer));\n\n //Assert\n assertEquals(excepted_solde_cpt1, cpt1.getSolde(), 0);\n assertEquals(excepted_solde_cpt2, cpt2.getSolde(), 0);\n\n }", "public String toString()\r\n {\r\n return \"Die 1: \" + getFaceValue1() + \" Die 2: \" + getFaceValue2();\r\n }", "public int getHp(){\r\n return hp;\r\n }", "Diff() {\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tTest1 t = new Test1();\n\t\tTest1 t1 = new Test1();\n\t\t\n\t\t\n\t\tint a3 = t.plus(100, 200);\n\t\tint a4 = t.plus(100, 400);\n\t\t\n//\t\tSystem.out.println(a3 +\" \"+ a4);\n\t\t\n\t\tt.a = 100;\n\t\tint a5 = t.a;\n\t\t\n\t\tSystem.out.println(a5);\n\t\t\n\t\tt1.a= 300;\n\n\t\tt.a = 300;\n\t\t \n\t\ta5 = t.a;\n\t\t\n\t\tSystem.out.println(t.a +\" \"+ t1.a);\n\t\t\n\t}", "@Test\n public void testVirement1() {\n\n //Arrange\n CompteBancaire cpt1 = new CompteBancaire(63000.0);\n CompteBancaire cpt2 = new CompteBancaire(43000.0);\n double montant_a_virer = 28000.0;\n double excepted_solde_cpt1 = 35000.0;\n double excepted_solde_cpt2 = 71000.0;\n\n //Act\n assertEquals(true, cpt1.virerArgent(cpt2, montant_a_virer));\n\n //Assert\n assertEquals(excepted_solde_cpt1, cpt1.getSolde(), 0);\n assertEquals(excepted_solde_cpt2, cpt2.getSolde(), 0);\n\n }", "@Override\n\tdouble chuVi() {\n\t\treturn (canhA + canhB) * 2;\n\t}", "public int getLife(){\n return lifeTime;\n }", "@Test\n public void testGetPaymentCollected() {\n System.out.println(\"getPaymentCollected\");\n //CashRegister instance = new CashRegister();\n assertEquals(0, 0.0, instance.getPaymentCollected());\n instance.scanItem(0.55);\n instance.scanItem(1.27);\n double expResult = 1.82;\n double result = instance.getPaymentCollected();\n assertEquals(expResult, result, 1.82);\n }", "public double getTotalScore(){\n // System.out.print(\"\\nQUIZZ TOTAL \" + quizTotal);\n return quizTotal;\n}", "public String toString()\r\n {\r\n return \"Die one is \" + die1FaceValue +\r\n \" and die two is \" + die2FaceValue +\r\n \" and dice total is \" + diceTotal + \".\" ;\r\n }", "public String currStats(){\n\t\treturn String.format(\"Damage: %f\\nRange (in tiles): %f\\nFire\"\n\t\t\t\t+ \" speed (shots per second): %d\\nUpgrade cost: %d\", damage,\n\t\t\t\trange / MainFrame.TILE_SIZE, initCooldown, getCostToUpgrade());\n\t}", "public double method_886() {\n return this.field_666;\n }", "public int getGreen()\n\t{\n\t\treturn green;\n\t}", "public static void main(String[] args) {\n\n SmartLight s = new SmartLight();\n s.turnUp();\n System.out.println(s.getLightPercent());\n s.turnUp();\n System.out.println(s.getLightPercent());\n s.turnUp();\n System.out.println(s.getLightPercent());\n s.turnUp();\n System.out.println(s.getLightPercent());\n s.turnUp();\n System.out.println(s.getLightPercent());\n s.turnUp();\n System.out.println(s.getLightPercent());\n s.turnUp();\n System.out.println(s.getLightPercent());\n System.out.println(s.toString());\n\n }", "public double getHealth(){\r\n return health;\r\n }", "@Override \r\npublic double earnings() { \r\n\t return getWage() * getPieces(); \r\n}", "public int ger_nrLuggageCovBelt(){\r\n return this.nrLuggageConvBelt;\r\n }", "@Override //function was implemented as abstract in super class\n public double Display(){\n System.out.println(\"Toppings on Pizza:\");\n System.out.println(\"\\tAllergens: \" + this.Allergens);\n System.out.println(\"\\tNotes: \" + this.Notes);\n System.out.println(\"\\tDensity: \" + this.Density);\n System.out.println(\"\\tTopping: \" + this.Topping);\n System.out.println(\"\\tVegetarian: \" + this.Vegetarian);\n System.out.println();\n return this.Price;\n }", "public static void main(String[] args) {\n double strike = 1060.00;\n double price = 978.70;\n double timeToExp = (17.00/365.00);\n //double timeToExp = .383562;\n double stDev = 0.3172;\n double interest = 0.073521;\n char call = 'c';\n Boolean callOption = true;\n\n BlackScholes_abbreviated bsShort = new BlackScholes_abbreviated();\n Double price1 = bsShort.blackScholesCall(price, strike, stDev, timeToExp, interest);\n\n System.out.println(\" price3 = [\" + price1.toString() + \"]\");\n\n OptionDetails od = new OptionDetails(true,price,strike,interest,timeToExp,stDev);\n OptionGreeks og = BlackScholesGreeks.calculate(od);\n\n System.out.println(od.toString());\n System.out.println(og.toString());\n// System.out.println(\"Delta: \" + og.delta + \"Gamma: \" + og.gamma);\n//\n//\n// Black_76 bs76 = new Black_76();\n// Double price2 = bs76.Black76(call, price, strike, timeToExp, interest, stDev);\n// System.out.println(\" price2 = [\" + price2.toString() + \"]\");\n//\n// BlackScholesFormula bsFormula = new BlackScholesFormula();\n// Double price3 = bsFormula.calculate(callOption, price, strike, interest, timeToExp, stDev);\n// System.out.println(\" price3 = [\" + price3.toString() + \"]\");\n//\n// System.out.println();\n//\n// // TEST DATA -- trade 104335\n// strike = 18.25;\n// price = 13.10;\n// //timeToExp = 2.13035;\n// timeToExp = 2.134247;\n// stDev = 0.21;\n// interest = 0.002541;\n// call = 'c';\n// callOption = true;\n//\n// price1 = bsShort.blackScholesCall(price, strike, stDev, timeToExp, interest);\n// System.out.println(\" price1 = [\" + price1.toString() + \"]\");\n//\n// price2 = bs76.Black76(call, price, strike, timeToExp, interest, stDev);\n// System.out.println(\" price2 = [\" + price2.toString() + \"]\");\n//\n// price3 = bsFormula.calculate(callOption, price, strike, interest, timeToExp, stDev);\n// System.out.println(\" price3 = [\" + price3.toString() + \"]\");\n }", "public String c() {\n return ((b.b) this.b).d();\n }", "public int getRoll2()\r\n {\r\n return roll2;\r\n }", "double getside2(){\n\t\treturn side2;\n\t}", "public float getHightPrice()\r\n{\r\n\treturn this.hightPrice;\r\n}", "int getComparisons();", "@Test\n public void testCalculateScore() {\n System.out.println(\"calculateScore\");\n String input1 = \"8 0 3 1 6 5 -2 4 7 1 3 -2 6\";\n String input2 = \"8 0 3 1 6 5 -2 4 7 3 2 -2 6\";\n CCGeneticDrift instance = new CCGeneticDrift();\n int expResult1 = 2;\n int expResult2 = 4;\n int result1 = instance.calculateScore(input1);\n assertEquals(result1, expResult1);\n int result2 = instance.calculateScore(input2);\n assertEquals(result2, expResult2);\n }", "public BigDecimal getDiff() {\n return diff;\n }", "public int act1Cost()\r\n {\r\n return 1;\r\n }", "public static void main(String[] args) {\n Course AbstractAdvancedJavaSuperClass = new AdvancedJavaCourse(\"AdvancedJava\", \"-003\");\r\n Course AbstractJavaSuperClass = new IntroJavaCourse(\"IntroJava\", \"-002\");\r\n Course AbstractProgramClass = new IntroToProgrammingCourse(\"Intro\", \"-001\");\r\n\r\n AbstractAdvancedJavaSuperClass.setCredits(4);\r\n AbstractJavaSuperClass.setCredits(4.0);\r\n AbstractProgramClass.setCredits(4.0);\r\n \r\n //this is a test\r\n \r\n AbstractAdvancedJavaSuperClass.setPrerequisites(AbstractJavaSuperClass.getCourseNumber());\r\n AbstractJavaSuperClass.setPrerequisites(AbstractProgramClass.getCourseNumber());\r\n \r\n System.out.println(AbstractProgramClass.getCapitalizedCourseName()\r\n + \" \" + AbstractProgramClass.getCourseNumber() );\r\n \r\n System.out.println(AbstractJavaSuperClass.getCourseName()\r\n + \" \" + AbstractJavaSuperClass.getCourseNumber() \r\n + \" \" + AbstractJavaSuperClass.getPrerequisites());\r\n \r\n System.out.println(AbstractAdvancedJavaSuperClass.getCourseName()\r\n + \" \" + AbstractAdvancedJavaSuperClass.getCourseNumber() \r\n + AbstractAdvancedJavaSuperClass.getPrerequisites() );\r\n}" ]
[ "0.63599175", "0.6286766", "0.59905905", "0.59381205", "0.59325385", "0.58771783", "0.5866055", "0.5846731", "0.58016735", "0.57880634", "0.5767795", "0.57413936", "0.5718941", "0.57075495", "0.5699884", "0.5696965", "0.5690213", "0.56882775", "0.5683011", "0.5672302", "0.5670705", "0.56682", "0.56607", "0.5658566", "0.5642695", "0.5629123", "0.5619411", "0.56166804", "0.5587395", "0.55866706", "0.55856234", "0.5573536", "0.5571212", "0.55687743", "0.55584484", "0.5557022", "0.5556537", "0.555346", "0.5550312", "0.5547453", "0.55416083", "0.55340904", "0.5531228", "0.5529187", "0.5518962", "0.55104667", "0.5509983", "0.549778", "0.5497322", "0.5495528", "0.5490188", "0.54892606", "0.5487641", "0.54623497", "0.54496783", "0.5426039", "0.5421284", "0.5420775", "0.5418748", "0.54167354", "0.54160005", "0.5407551", "0.54045254", "0.54006696", "0.5398992", "0.5398523", "0.53942394", "0.5393915", "0.5393032", "0.53901714", "0.5388642", "0.5388234", "0.5386075", "0.5381323", "0.5380442", "0.5379735", "0.5379437", "0.5379334", "0.5374509", "0.53740525", "0.53713465", "0.5370387", "0.5369679", "0.5368423", "0.536154", "0.5360115", "0.5358167", "0.5353586", "0.5352885", "0.53517926", "0.5349797", "0.53453904", "0.53435767", "0.5342778", "0.534238", "0.5340989", "0.53396434", "0.53380495", "0.53348726", "0.53317267" ]
0.6884634
0
Instantiates a new New document request dto.
public NewDocumentRequestDto() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SingleRequest<?> create() {\n return new SingleRequest<>();\n }", "public CreateDocumentController() {\n }", "@POST\r\n public DocumentoDTO crearDocumento(DocumentoDTO documento){\r\n return new DocumentoDTO(logic.crearDocumento(documento.toEntity()));\r\n }", "public Document() {\n }", "public CreateDocumentRequest withDocumentType(DocumentType documentType) {\n this.documentType = documentType.toString();\n return this;\n }", "Documento createDocumento();", "public DocumentBuilder() {\n this.document = new Document();\n }", "public static TemplatePushRequest newRequest() {\n return new TemplatePushRequest();\n }", "public NewMemberRequest build() {\r\n return newMemberRequest;\r\n }", "public Request() {\n }", "private CreateRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public CalccustoRequest()\r\n\t{\r\n\t}", "CreateResponse create(@NonNull CreateRequest request);", "public Request() {\n\n }", "public MyDocument() {\r\n }", "public CreateDocumentRequest withTargetType(String targetType) {\n setTargetType(targetType);\n return this;\n }", "public SmsSendRequestDto() {\n super();\n }", "public CreateDocumentRequest withDocumentType(String documentType) {\n setDocumentType(documentType);\n return this;\n }", "@PostMapping(\"/document-entities\")\n public ResponseEntity<DocumentEntityDTO> createDocumentEntity(@Valid @RequestBody DocumentEntityDTO documentEntityDTO) throws URISyntaxException {\n log.debug(\"REST request to save DocumentEntity : {}\", documentEntityDTO);\n if (documentEntityDTO.getId() != null) {\n throw new BadRequestAlertException(\"A new documentEntity cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n DocumentEntityDTO result = documentEntityService.save(documentEntityDTO);\n return ResponseEntity.created(new URI(\"/api/document-entities/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "public NewMemberRequestBuilder() {\r\n newMemberRequest = new NewMemberRequest();\r\n }", "public RequestMessage() {\r\n\t\tsuper();\r\n\t\tthis.criteria = new PersonSearchCriteria();\r\n\t\tthis.setSourceSystemID(SOURCE_SYSTEM_ID);\r\n\t\tthis.setSourceUserID(SOURCE_USER_ID);\r\n\t}", "public PurchaseDto() {}", "public DocumentBase() {\n \n }", "@Nonnull\n public static UBL23WriterBuilder <DocumentStatusRequestType> documentStatusRequest ()\n {\n return UBL23WriterBuilder.create (DocumentStatusRequestType.class);\n }", "public MessageRequest() {\n\t}", "public final CompletableFuture<CreateResponse> create(\n\t\t\tFunction<CreateRequest.Builder, ObjectBuilder<CreateRequest>> fn) throws IOException {\n\t\treturn create(fn.apply(new CreateRequest.Builder()).build());\n\t}", "@Deprecated\n CreatePdvDto(){}", "public Documento() {\n\n\t}", "public CouchDoc() {\n super();\n docType = getClass().getSimpleName();\n }", "public PersonaDTO(){}", "@Override\n protected Professional generateCreateRequest() {\n return new Professional().withId(FIRST_ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME)\n .withCompanyName(COMPANY_NAME);\n }", "public DocumentDto(final String name, final String url) {\n super();\n this.name = name;\n this.url = url;\n }", "public Request(){\n\t\tthis(null, null, null);\n\t}", "public static Packet12EntityDefRequest create(final int defID) {\n\t\tPacket12EntityDefRequest r =\n\t\t\t\tnew Packet12EntityDefRequest();\n\t\tr.defID = defID;\n\t\treturn r;\n\t}", "public CreateDocumentRequest withName(String name) {\n setName(name);\n return this;\n }", "public void newDocument();", "protected Document createDefaultModel() {\n return new PlainDocument();\n }", "@PostMapping(\"/docentes\")\n public ResponseEntity<DocenteDTO> createDocente(@Valid @RequestBody DocenteDTO docenteDTO) throws URISyntaxException {\n log.debug(\"REST request to save Docente : {}\", docenteDTO);\n if (docenteDTO.getId() != null) {\n throw new BadRequestAlertException(\"A new docente cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n DocenteDTO result = docenteService.save(docenteDTO);\n return ResponseEntity.created(new URI(\"/api/docentes/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "TypedRequest createTypedRequest();", "public JestResult createNewDocument(GTData data) throws IOException {\n Gson gson = new Gson();\n String json = gson.toJson(data);\n Index request = new Index.Builder(json)\n .index(INDEX_NAME)\n .type(data.getClass().toString())\n .id(data.getObjectID())\n .build();\n\n JestResult result = client.execute(request);\n return result;\n }", "springfox.documentation.schema.Model create(ModelContext context);", "public TravelAuthorizationDocument() {\n super();\n }", "private Request() {}", "private Request() {}", "@BearerAuth\n @HttpRequestHandler(paths = \"/api/v2/service/create\", methods = \"POST\")\n private void handleCreateRequest(@NonNull HttpContext context, @NonNull @RequestBody Document body) {\n var configuration = body.readObject(\"serviceConfiguration\", ServiceConfiguration.class);\n if (configuration == null) {\n // check for a provided service task\n var serviceTask = body.readObject(\"task\", ServiceTask.class);\n if (serviceTask != null) {\n configuration = ServiceConfiguration.builder(serviceTask).build();\n } else {\n // fallback to a service task name which has to exist\n var serviceTaskName = body.getString(\"serviceTaskName\");\n if (serviceTaskName != null) {\n var task = this.serviceTaskProvider.serviceTask(serviceTaskName);\n if (task != null) {\n configuration = ServiceConfiguration.builder(task).build();\n } else {\n // we got a task but it does not exist\n this.badRequest(context)\n .body(this.failure().append(\"reason\", \"Provided task is unknown\").toString())\n .context()\n .closeAfter(true)\n .cancelNext(true);\n return;\n }\n } else {\n this.sendInvalidServiceConfigurationResponse(context);\n return;\n }\n }\n }\n\n var createResult = this.serviceFactory.createCloudService(configuration);\n var start = body.getBoolean(\"start\", false);\n if (start && createResult.state() == ServiceCreateResult.State.CREATED) {\n createResult.serviceInfo().provider().start();\n }\n\n this.ok(context)\n .body(this.success().append(\"result\", createResult).toString())\n .context()\n .closeAfter(true)\n .cancelNext(true);\n }", "private Request() {\n initFields();\n }", "@PostMapping(\"/creaPerfil\")\n public void creaPerfil(@RequestBody PerfilDto request){\n\n log.info(\"Creando Perfil: {}\",request);\n\n Perfil perfil = new Perfil();\n BeanUtils.copyProperties(request,perfil);\n\n perfilService.savePefil(perfil);\n\n }", "public TboFlightSearchRequest() {\n}", "public RequestedDocument addRequestedDocument(AddRequestedDocumentCommand aCommand);", "public CreateDocumentRequest withDocumentFormat(DocumentFormat documentFormat) {\n this.documentFormat = documentFormat.toString();\n return this;\n }", "ProductDto createProduct(ProductDto productDto);", "public void doNew() {\n\n if (!canChangeDocuments()) {\n return;\n }\n \n setDocument(fApplication.createNewDocument());\n }", "public Mapping createInstance(Document xbrlDocument) {\n List<Document> docList = new ArrayList<>();\n docList.add(xbrlDocument);\n return createInstance(docList);\n }", "public Doc() {\n\n }", "Request(Request otherRequest) {\n this.reqNum = otherRequest.reqNum;\n this.reqText = otherRequest.reqText;\n this.reqExampleDocs = new ArrayList<ExampleDocument>(otherRequest.reqExampleDocs);\n }", "public UserDto() {\n }", "public UBERequest() {\r\n }", "public Request() {\n this.setRequestId(newRequestId());\n this.setRequestValue(0.0);\n this.date = new Date();\n }", "public XMLMessage(Document document) {\n setDocument(document);\n }", "private CreateCatalogRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public NewDeviceRequest(String deviceId) {\n super();\n setId(deviceId);\n }", "private SignRequestDocument(final String id, final String name, final int size, final String mimeType, final String signFormat, final String messageDigestAlgorithm, final String params, final String cryptoOperation) {\r\n\t\tthis.id = id;\r\n\t\tthis.name = name;\r\n\t\tthis.size = size;\r\n\t\tthis.mimeType = mimeType;\r\n\t\tthis.signFormat = signFormat;\r\n\t\tthis.messageDigestAlgorithm = messageDigestAlgorithm;\r\n\t\tthis.params = params;\r\n\t\tthis.cryptoOperation = cryptoOperation;\r\n\t}", "ShippingDocument createShippingDocument();", "OrderDTO create(OrderDTO orderDTO);", "public ProdutoDTO()\n {\n super();\n }", "public PropertySellerDetailDTO() {\n\n\t}", "@SuppressWarnings(\"unchecked\")\n @Override\n protected void buildPdfDocument(Map<String, Object> model, Document document, PdfWriter writer,\n HttpServletRequest request, HttpServletResponse response) throws Exception {\n createNewPdfByTemplate(model,document,writer,request,response);\n\n }", "public ProductoDTO(){\r\n\t\t\r\n\t}", "public CreateOrderRequest() {\n\t\t_pcs = new PropertyChangeSupport(this);\n\t}", "public BaseDto() {\n }", "@Override\n\t\tpublic NewDoc createFromParcel(Parcel source) {\n\t\t\treturn new NewDoc(source);\n\t\t}", "@Nonnull\n private Observable<String> doCreate(@Nonnull String collection, @Nonnull JsonObject document) {\n Objects.requireNonNull(collection, \"missing collection name\");\n Objects.requireNonNull(document, \"missing document\");\n\n ObservableFuture<String> future = RxHelper.observableFuture();\n mongo.insert(collection, document, future.toHandler());\n return future;\n }", "public static DocumentBuilder createDocumentBuilder() {\n\t\treturn createDocumentBuilder(DefaultEntityResolver.getInstance());\n\t}", "com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest addNewEvSORequest();", "private Document createMapping() {\n return getIndexOperations().createMapping();\n }", "@POST\n\t@Path(\"{projectId}\")\n\t@Consumes({ \"application/json+nxentity\", \"application/json\" })\n\tpublic Response doPost(DocumentModel inputDoc, @PathParam(\"projectId\") String projectId) {\n\t\tCoreSession session = ctx.getCoreSession();\n\n\t\tif (StringUtils.isBlank(inputDoc.getType()) || StringUtils.isBlank(inputDoc.getName())) {\n\t\t\treturn Response.status(Status.BAD_REQUEST).entity(\"type or name property is missing\").build();\n\t\t}\n\n\t\tDocumentModel parent = getProjectContainer(projectId);\n\n\t\tString parentPath = parent.getPathAsString();\n\n\t\tif (\"AI_Model\".equals(inputDoc.getType())) {\n\t\t\tparentPath = parent.getPath().append(\"models\").toString();\n\t\t} else if (\"AI_Corpus\".equals(inputDoc.getType())) {\n\t\t\tparentPath = parent.getPath().append(\"datasets\").toString();\n\t\t} else if (\"AI_Training\".equals(inputDoc.getType())) {\n\t\t\tparentPath = parent.getPath().append(\"trainings\").toString();\n\t\t} else {\n\t\t\treturn Response.status(Status.BAD_REQUEST).entity(\"Unexpected Document Type\").build();\n\t\t}\n\n\t\tDocumentModel createdDoc = session.createDocumentModel(parentPath, inputDoc.getName(), inputDoc.getType());\n\t\tDocumentModelJsonReader.applyPropertyValues(inputDoc, createdDoc);\n\t\tcreatedDoc = session.createDocument(createdDoc);\n\t\tsession.save();\n\t\treturn Response.ok(createdDoc).status(Status.CREATED).build();\n\t}", "public PickUpCasualtyRequest() {\n\n // empty\n }", "public WMS100MapRequest() {\n\n }", "FlowDto createRequestFlowDto(String name, Integer portNo, Integer bandWidth, Integer latency) {\n\t\tString nodeNameSuffix = \"\";\n\t\tif(!ClientConfigConstants.CLIENT_TYPE_OTHER.equals(clientConfig.getSrcComponentName())){\n\t\t\tnodeNameSuffix = \"123\";\n\t\t}\n\t\tString sPortNo = String.format(\"%08d\", portNo);\n\t\tFlowDto reqFlowDto = new FlowDto();\n\t\treqFlowDto.name = name;\n\t\treqFlowDto.srcCENodeName = \"tokyo\" + nodeNameSuffix;\n\t\treqFlowDto.srcCEPortNo = sPortNo;\n\t\treqFlowDto.dstCENodeName = \"osaka\" + nodeNameSuffix;\n\t\treqFlowDto.dstCEPortNo = sPortNo;\n\t\tif (bandWidth != null) {\n\t\t\treqFlowDto.reqBandWidth = bandWidth;\n\t\t} else {\n\t\t\treqFlowDto.reqBandWidth = REQ_BAND_WIDTH;\n\t\t}\n\t\tif (latency != null) {\n\t\t\treqFlowDto.reqDelay = latency;\n\t\t} else {\n\t\t\treqFlowDto.reqDelay = random.nextBoolean() ? LARGE_REQ_DELAY : SMALL_REQ_DELAY;\n\t\t}\n\t\treqFlowDto.protectionLevel = \"0\";\n\t\treturn reqFlowDto;\n\t}", "public Client create() {\n RequestProvider provider = RequestProviders.lookup();\n return provider.newClient(this);\n }", "public PaperDTO() {\n }", "public GetContactRequest()\r\n {\r\n }", "public void create(){}", "public SellerDTO() {\n\t\t\n\t}", "Documentable createDocumentable();", "public QBXMLRequest() {\n }", "public PartyFeedbackDTO() {\n\t}", "public CustomerNew () {\n\t\tsuper();\n\t}", "public static RoomDTO newDTO() {\n\n RoomDTO roomDTO = new RoomDTO();\n return roomDTO;\n }", "public SystemCommandRequest()\r\n\t{\r\n\t}", "@Override\n public DocumentServiceEntry getNewDocument() {\n UserService userService = UserServiceFactory.getUserService();\n DocumentServiceEntry doc = new DocumentServiceEntry();\n doc.setTitle(\"Untitled Document\");\n doc.setIdentifier(doc.getTitle().replaceAll(\"[^a-zA-Z0-9_\\\\-\\\\.]\", \"\"));\n doc.setAuthor(userService.getCurrentUser().getEmail());\n doc.setEditor(userService.getCurrentUser().getNickname());\n return doc;\n }", "@BodyParser.Of(play.mvc.BodyParser.Json.class)\n public static Result create() throws JsonParseException, JsonMappingException, IOException {\n JsonNode json = request().body().asJson();\n Thing thing = mapper.treeToValue(json, Thing.class);\n thing.save();\n return ok(mapper.valueToTree(thing));\n }", "public SchemaDto() {\n }", "com.soa.SolicitarServicioDocument.SolicitarServicio addNewSolicitarServicio();", "public ChatRequest()\r\n\t{\r\n\t}", "public BoletoPaymentRequest() {\n\n }", "@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = \"application/hal+json\")\n @ApiOperation(value = \"Creates a new request topic.\", produces = \"application/hal+json\")\n @ApiResponses({@ApiResponse(code = 200, message = \"Success!\"), @ApiResponse(code = 400, message = \"Request topic is invalid.\")})\n public ResponseEntity<EntityModel<RequestTopic>> create(@RequestBody RequestTopic requestTopic) throws EntityNotFoundException {\n RequestTopic createdRequestTopic = userEntityService.create(requestTopicRepository, requestTopic);\n\n //Return created request topic\n return ResponseEntity.ok(userEntityService.entityToEntityModel(createdRequestTopic));\n }", "@PostMapping(\"/post\")\n PostDTO newPost(@RequestBody PostDTO postDTO);", "private DTOFactory() {\r\n \t}", "public ODocument create(@Generic(\"T\") final Class<?> type) {\n dbProvider.get();\n return new ODocument(type.getSimpleName());\n }" ]
[ "0.60371625", "0.5978692", "0.59632385", "0.5930882", "0.58771753", "0.57472676", "0.5711239", "0.566643", "0.566382", "0.5654646", "0.56260896", "0.5605648", "0.56042993", "0.5592029", "0.5589057", "0.55715203", "0.5548892", "0.5529896", "0.5523293", "0.55048597", "0.5490047", "0.5481828", "0.5466885", "0.5422943", "0.54193175", "0.54071593", "0.53914076", "0.5357568", "0.5349552", "0.53436494", "0.53170663", "0.53165996", "0.5312519", "0.53101087", "0.53062814", "0.5290169", "0.52885604", "0.52837366", "0.5273147", "0.52574825", "0.525466", "0.52362984", "0.52205354", "0.52205354", "0.52197933", "0.52194804", "0.5219257", "0.5216593", "0.52110845", "0.5210347", "0.5207511", "0.52050734", "0.5197759", "0.5194725", "0.5185327", "0.5177153", "0.5173457", "0.51725036", "0.51725006", "0.51707786", "0.5165131", "0.5163279", "0.51625335", "0.5160841", "0.516025", "0.5154885", "0.51516885", "0.5140465", "0.5139622", "0.51344895", "0.5116159", "0.51159066", "0.51074666", "0.51058286", "0.50986683", "0.50820017", "0.50716096", "0.5060458", "0.5045208", "0.5045119", "0.50439113", "0.5037324", "0.50366986", "0.5033067", "0.5030043", "0.5029681", "0.50259084", "0.5021278", "0.5016661", "0.50099105", "0.5003419", "0.49986234", "0.49984398", "0.49938276", "0.49877298", "0.49855036", "0.49845618", "0.4983911", "0.49803263", "0.4967671" ]
0.7985217
0
Add an element. Extend the array, if necessary.
public void addElement(klasse o) { if (OLast >= OSize) extend(); O[OLast++] = o; ON++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void add(T element){\r\n if (element == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n \r\n // If array is full, double the size\r\n if (size == elements.length) {\r\n resize(elements.length * 2);\r\n }\r\n \r\n elements[size] = element;\r\n size++;\r\n }", "public void add(E element){\n if(size==capacity){\n capacity *=2;\n E[] array2 = (E[]) new Object[capacity];\n if (size >= 0) System.arraycopy(array, 0, array2, 0, size);\n array2[size]=element;\n array=array2;\n }else{\n array[size]=element;\n }\n size++;\n }", "@Override\n public void add(T t) {\n checkIfArrayFull();\n\n arrayList[elementsInArray] = t;\n elementsInArray++;\n }", "public void add(E element) {\n\t\tif (element == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\n\t\tif (size < elements.length) {\n\t\t\telements[size] = element;\n\t\t\tsize++;\n\t\t} else {\n\t\t\t// grow array\n\t\t\tint currentSize = elements.length;\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tE[] temp = (E[]) new Object[currentSize * 2];\n\t\t\tfor (int i = 0; i < size(); i++) {\n\t\t\t\ttemp[i] = elements[i];\n\t\t\t}\n\t\t\telements = temp;\n\t\t\telements[size] = element;\n\t\t\tsize++;\n\t\t}\n\n\t}", "@Override\n public boolean add(final T element) {\n if (this.size > this.data.length - 1) {\n this.doubleArraySizeBy(2);\n }\n\n this.data[this.size++] = element;\n return true;\n }", "@Override\n public synchronized void add(E element) {\n if (this.pointer == this.capacity) {\n int newCapacity = this.capacity + (this.capacity >> 1);\n Object[] arr = Arrays.copyOf(this.container, newCapacity);\n this.capacity = newCapacity;\n this.container = arr;\n }\n this.container[this.pointer++] = element;\n }", "public void add(T element) {\n if (size + 1 >= capacity) {\n if (capacity == 0) capacity = 1;\n else capacity *= 2; // double the array size\n T[] tempArrayList = (T[]) new Object[capacity];\n for (int i = 0; i < size; i++) tempArrayList[i] = genericArrayList[i];\n genericArrayList = tempArrayList; // genericArray has extra null at the end\n }\n genericArrayList[size++] = element;\n }", "@Override\n\tpublic boolean add(Object e)\n\t{\n\t\tif (size == myArray.length)\n\t\t\tresizeUp();\n\t\tmyArray[size] = e;\n\t\tsize++;\n\t\treturn false;\n\t}", "@Override\n public void add(T element) {\n add(size(), element);\n }", "@Override\n public void add(int index, T element) {\n Object[] newArray = new Object[size + 1];\n for (int i = 0; i < index; i++) {\n newArray[i] = data[i];\n }\n newArray[index] = element;\n for (int i = index + 1; i < newArray.length; i++) {\n newArray[i] = data[i - 1];\n }\n data = newArray;\n size++;\n }", "void add(byte[] element);", "@Override\n public final boolean add(final Integer element) {\n // First, check to see that the array can support another element\n ensureCapacity(size);\n // Add the element to the next available slot\n arrayList[size++] = element;\n return true;\n }", "public void add(T element) {\r\n if (element == null) {\r\n throw new IllegalArgumentException(); \r\n } \r\n if (size == elements.length) { \r\n resize(elements.length * 2); \r\n }\r\n elements[size()] = element; \r\n size++; \r\n }", "@Override\n public void addElement(T element) {\n // TODO. \n // Pseudocode: \n // Check if array is at capacity, if so expand it. \n // add element to the array\n // increment count\n // if this is not the first element, then call heapifyAdd to check if the newly added\n // element needs to be swapped up the heap\n if (count == heap.length) {\n expandCapacity();\n\n }\n heap[count] = element;\n count++;\n\n if (count > 1) {\n heapifyAdd();\n }\n\n }", "public synchronized void add(E value) {\n this.array.add(value);\n }", "public void add(Object e)\n {\n if(numElements == maxElements)\n doubleCapacity();\n \n // Add element\n if(!contains(e))\n elements[numElements++] = e;\n }", "@Override\n public boolean add(T object) {\n T[] newArray;\n if (array[array.length - 1] != null) {\n newArray = (T[]) new Object[array.length * 2];\n } else {\n newArray = (T[]) new Object[array.length];\n }\n for (int i = 0; i < array.length; i++) {\n newArray[i] = array[i];\n }\n newArray[size] = object;\n this.size++;\n this.array = newArray;\n return true;\n }", "public boolean add( T element )\n {\n // THIS IS AN APPEND TO THE LOGICAL END OF THE ARRAY AT INDEX count\n if (size() == theArray.length) upSize(); // DOUBLES PHYSICAL CAPACITY\n theArray[ count++] = element; // ADD IS THE \"setter\"\n return true; // success. it was added\n }", "private SignatureDTO[] add(SignatureDTO[] array, SignatureDTO element) {\n Class type = (array != null ? array.getClass() : (element != null ? element.getClass() : SignatureDTO.class));\n SignatureDTO[] newArray = (SignatureDTO[]) copyArrayGrow1(array, type);\n newArray[newArray.length - 1] = element;\n return newArray;\n }", "@Override\n public boolean add(E e) {\n notNull(e);\n if (size >= elementData.length) {\n int newCapacity = (elementData.length << 1);\n elementData = Arrays.copyOf(elementData, newCapacity);\n }\n elementData[size++] = e;\n return true;\n }", "public void add(E element) {\n\n\t\tif (size == capacity) {\n\t\t\tgrowArray();\n\t\t}\n\n\t\tlist[size] = element;\n\t\tsize++;\n\t}", "public @Override boolean add(E element) {\n \tappend(element);\n \treturn true;\n }", "public void add( Object value )\n\t{\n\t\tint n = size();\n\t\tif (addIndex >= n)\n\t\t{\n\t\t\tif (n == 0)\n\t\t\t\tn = 8;\n\t\t\telse\n\t\t\t\tn *= 2;\n\t\t\tObject narray = Array.newInstance( array.getClass().getComponentType(), n );\n\t\t\tSystem.arraycopy( array, 0, narray, 0, addIndex );\n\t\t\tarray = narray;\n\t\t}\n\t\tArray.set( array, addIndex++, value );\n\t}", "public boolean add(ElementType element){\n if(this.contains(element)){\n return false;\n }\n else{\n if(size==capacity){\n reallocate();\n }\n elements[size]=element;\n size++;\n }\n return true;\n }", "@Override\n public void add(T element) throws Exception\n {\n \n if (!(element instanceof Comparable))\n {\n throw new Exception(\"Bad things happened\");\n }\n \n Comparable comparableElement = (Comparable) element;\n \n //expand array if full\n \n if (tail == myArray.length)\n {\n expandArray();\n }\n \n //search for correct spot\n int insertPosition;\n for (insertPosition = 0; insertPosition < tail && comparableElement.compareTo(myArray[insertPosition]) > 0; insertPosition++)\n {\n //empty on purpose\n }\n \n //shift elements over\n \n for (int i = tail; i > insertPosition; i--)\n {\n myArray[i] = myArray[i - 1];\n }\n \n //place the element\n \n myArray[insertPosition] = element;\n tail++;\n }", "@Override\n // worst-case complexity: O(n), since it might need to resize itself\n // amortised average-case complexity: O(1), since resizing happens too\n // too infrequent to affect the actual complexity\n public void add(T item) {\n if (size >= arr.length)\n arr = resize(arr, EXPAND_FACTOR);\n // we add the item to the end and then increment the size\n arr[size++] = item;\n }", "@Override\n public boolean add(T e) {\n if (numElements == maxElements) {\n doubleCapacity();\n }\n\n // Add element\n elements[numElements++] = e;\n return true;\n }", "public void append(T element);", "public void append(T element);", "public void addElement(int element) {\n \tif(element > 0) {\n \tarray[head++] = element;\n \t}else {\n \t\tthrow new RuntimeException(\"Invalid element to add\");\n \t}\n }", "public void add(E a)\n {\n if (size == data.length) { // if the list is at capacity...\n // create a new, larger array\n E[] newData = (E[])(new Object[2*data.length]);\n \n // copy over all of the old elements\n for (int i = 0; i < size; i++)\n newData[i] = data[i];\n \n // redirect the old data reference\n data = newData;\n }\n\n // insert the new element\n data[size] = a;\n size++;\n }", "public void push(T element){\n\t\tarray[noOfElements] = element;\n\t\tnoOfElements ++;\t\t\n\t}", "public void extendArray() {\n int index = size();\n Object[] temp = new Object[index + 1];\n for (int i=0; i < index; i++) {\n temp[i] = AL[i];\n }\n AL = temp;\n }", "@Override\n public void add(E value) {\n if (value == null) {\n throw new NullPointerException();\n }\n if (size == capacity) {\n resize();\n }\n array[size] = value;\n siftUp(size);\n size++;\n\n\n }", "@Override\n public boolean add(int index, T object) {\n T[] newArray;\n if (array[array.length - 1] != null) {\n newArray = (T[]) new Object[array.length * 2];\n } else {\n newArray = (T[]) new Object[array.length];\n }\n for (int i = 0; i < index; i++) {\n newArray[i] = array[i];\n\n }\n newArray[index] = object;\n for (int i = index + 1; i < array.length; i++) {\n newArray[i] = array[i - 1];\n }\n this.size++;\n this.array = newArray;\n return true;\n }", "public void add(E value){\n if (maxIndex != array.length-1){\n array[++maxIndex] = value;\n }else {\n Object[] tmpArray = new Object[array.length+ capacity];\n for (int i = 0; i < array.length; i++) {\n tmpArray[i] = array[i];\n }\n array = tmpArray;\n array[++maxIndex] = value;\n }\n }", "@Override\n\tpublic void add(int idx, E element) {\n\t\tif (element == null)\n\t\t\tthrow new NullPointerException();\n\t\tif (idx < 0 || idx > size())\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (element.equals(list[i]))\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t// Element is added to the end of the list\n\t\tif (idx == size)\n\t\t\tlist[idx] = element;\n\n\t\t// Element is added at the beginning or middle\n\t\telse {\n\t\t\tfor (int i = size; i > idx; i--) {\n\t\t\t\tlist[i] = list[i - 1];\n\t\t\t}\n\t\t\tlist[idx] = element;\n\t\t}\n\n\t\tsize++;\n\t\tif (size == list.length)\n\t\t\tgrowArray();\n\n\t}", "public void add( Comparable newVal ) {\n \t//if _data is full, expand the array\n \tif (_size == _data.length){\n\t \texpand();\n \t}\n \t\n\tset(_lastPos + 1, newVal);\n \t//increases _lastPos and _size\n \t_lastPos++;\n \t_size++;\n }", "@Override\n public void add(final int index, final T element) {\n this.checkIndexToAdd(index);\n\n if (this.size > this.data.length - 1) {\n this.doubleArraySizeBy(2);\n }\n\n for (int i = this.size; i > index; i--) {\n this.data[i] = this.data[i - 1];\n }\n\n this.data[index] = element;\n this.size++;\n }", "@Override\n public void add(int i, E e) throws IndexOutOfBoundsException {\n checkIndex(i, size + 1);\n if (size == data.length) // not enough capacity\n throw new IllegalStateException(\"Array is full\");\n for (int k = size - 1; k >= i; k--) // start by shifting rightmost\n data[k + 1] = data[k];\n data[i] = e; // ready to place the new element\n size++;\n }", "void append(E[] elements, int off, int len);", "public void add(T e){\n ensureCapacity(size + 1);\n data[size++] = e;\n }", "@Override\n public void add(Object e) {\n if (currentSize == this.container.length - 1) {\n Object[] newArray = new Object[capacity * 2];\n capacity *= 2;\n System.arraycopy(this.container, 0, newArray, 0, currentSize);\n this.container = newArray;\n }\n container[currentSize++] = e;\n }", "void append(E[] elements);", "public void add(final Object value) {\n\t\tif (value == null) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tif (this.size == this.capacity) {\n\t\t\treallocate();\n\t\t}\n\t\telements[size] = value;\n\t\tsize++;\n\t}", "@Override\n\tpublic boolean add(T element) {\n\t\titemProbs_.put(element, 1d);\n\t\telementArray_ = null;\n\t\tklSize_ = 0;\n\t\treturn true;\n\t}", "public android.renderscript.Element.Builder add(android.renderscript.Element element, java.lang.String name, int arraySize) { throw new RuntimeException(\"Stub!\"); }", "public static int[] addElement(int[] a, int e) {\n\t a = Arrays.copyOf(a, a.length + 1);\n\t a[a.length - 1] = e;\n\t return a;\n\t}", "public abstract void add(T element, int index);", "public void add(E element){\n\t\tArrayQueue<E> temp = new ArrayQueue<E>();\n\t\ttemp.enqueue(element);\n\t\tQ.enqueue(temp);\n\t}", "public abstract void add(T element);", "public abstract void add(T element);", "public void add(T element, int pos);", "@Override\n public void add(E work) {\n if(isFull()) {\n throw new IllegalStateException();\n }\n array[end] = work;\n end = (end + 1) % capacity();\n size++;\n }", "@Override\n public void addFirst(T item) {\n if (size >= array.length) {\n resize(size * 2);\n array[nextFirst] = item;\n nextFirst = minusOne(nextFirst);\n } else {\n array[nextFirst] = item;\n nextFirst = minusOne(nextFirst);\n }\n size += 1;\n }", "@Override\n\tpublic void add(int index, Object e) throws IndexOutOfBoundsException\n\t{\n\t\t//just to check if the index is valid\n\t\tif ( index < 0 || index > size )\n \t\tthrow new IndexOutOfBoundsException();\n\t\t//check arraylist size\n\t\tif (size == myArray.length)\n\t\t\tresizeUp();\n\t\t//move all the proceeding elements to make room for the desired element\n\t\tfor ( int i = size; i > index; i-- )\n \t\tmyArray[i] = myArray[i-1];\n \t//plug the element\n\t\tmyArray[index] = e;\n \t++this.size;\n\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic void add(AnyType x) {\n\n\t\t// if the array is full, double its capacity\n\t\tif (currentSize == array.length) {\n\n\t\t\tAnyType[] tempArray = (AnyType[]) new Object[array.length * 2];\n\n\t\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\t\ttempArray[i] = array[i];\n\t\t\t}\n\t\t\tarray = tempArray;\n\t\t}\n\n\t\t// If the heap is empty, add the item to the first spot\n\t\tif (currentSize == 0) {\n\t\t\tarray[0] = x;\n\t\t\tcurrentSize++;\n\t\t\treturn;\n\t\t}\n\n\t\t// add the new item to the next available node in the tree, so that\n\t\t// complete tree structure is maintained\n\t\tarray[currentSize] = x;\n\n\t\t// update size\n\t\tcurrentSize++;\n\n\t\t// percolate the new item up the levels of the tree until heap order is restored\n\t\tpercolateUp(currentSize - 1);\n\n\t}", "public void add(int index, E element);", "public void add(T element);", "public void add(T element);", "@Override\r\n\tpublic boolean add(T obj, int index) {\n\t\tif (index < 0 || index > size) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (size >= array.length)\r\n\t\t\tallocate();\r\n\t\tSystem.arraycopy(array, index, array, index + 1, size - index);\r\n\t\tarray[index] = obj;\r\n\t\tsize++;\r\n\t\treturn true;\r\n\t}", "void append(E element);", "void add(int index, Object element);", "public void add (T element);", "public void add(E s) {\n expandCapacity();\n this.elements[this.size] = s;\n this.size += 1;\n }", "public void add(int element);", "public void add(int value) {\n\t \tensureCapacity(size+ 1);\n\t \telementData[size] = value;\n\t \tsize++;\n\t }", "public void push(Object element)\n\t{\n\t\tensureCapacity();\n\t\telements[size++] = element;\n\t}", "@Override\n public boolean add(T item) {\n // if the last spot in the array is unoccupied, item is simply added to the first empty spot\n if (arr[arr.length-1]!=null) {\n arr[size + 1] = item;\n size++;\n }\n // if array is full, number of spots is doubled and item is added\n if (arr[arr.length-1]== null){\n grow();\n arr[size+1] = item;\n size++;\n }\n return true;\n }", "@Override\n\tpublic boolean add(E item) {\n\t\tif (this.numberOfElements == this.size) {\n\t\t\tE[] newArrayList = (E[]) new Object[this.size * 2];\n\t\t\tint i = 0;\n\t\t\twhile (i < this.size) {\n\t\t\t\tnewArrayList[i] = this.arrayList[i];\n\t\t\t\ti += 1;\n\t\t\t}\n\t\t\tthis.arrayList = newArrayList;\n\t\t\tthis.size = this.size * 2;\n\t\t}\n\t\tthis.arrayList[this.numberOfElements] = item;\n\t\tthis.numberOfElements += 1;\n\t\treturn true;\n\t}", "@Override\n public boolean add(T t) {\n if (size >= 10) {\n data = new Object[(data.length * 3) / 2 + 1];\n data = Arrays.copyOfRange(data, 0, data.length);\n }\n data[size++] = t;\n return true;\n }", "public void add(Statement element) {\n ensureSize(size + 1);\n arr[size++] = element;\n }", "public void insert(T element)\r\n\t{\n\t\tif (size >= data.length - 1)\r\n\t\t{\r\n\t\t\tresize();\r\n\t\t}\r\n\t\t\r\n\t\t//add the new element\r\n\t\tsize++;\r\n\t\tdata[size] = element;\r\n\t\tswim(size);\r\n\t}", "@Override\n public boolean add(E e) {\n head++; //Increment the head by one\n if (head == ringArray.length)\n head = 0; //If we get to the end of the ring set the pointer to be 0 again to loop back round\n ringArray[head] = e; //Get the element\n if (elementCount < ringArray.length) //Increase the element count up until the length because at that point the number of elements cant change.\n elementCount++;\n return true;\n }", "void add(int index, T element);", "void add(int index, T element);", "public void add(X elem);", "final void add(int elt) {\n if (contents == null)\n return;\n if (n == contents.length) {\n int[] new_contents = new int[2*n+1];\n //@ assert n < new_contents.length;\n arraycopy(contents, 0, new_contents, 0, n);\n contents = new_contents;\n }\n if (n < 0 || n >= contents.length) \n return;\n contents[n]=elt;\n n++;\n }", "public void push(Object element) {\r\n\t\tal.add(element, al.listSize);\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic void add(T value) {\n\t\t// Append an element to the end of the storage.\n\t\t// Double the capacity if no space available.\n\t\t// Amortized O(1)\n\n\t\tif (size == capacity()) {\n\t\t\tT newData[] = (T[]) new Object[2 * capacity()];\n\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\tnewData[i] = data[i];\n\t\t\t}\n\t\t\tdata = newData;\n\t\t}\n\n\t\tdata[size] = value;\n\t\tsize++;\n\t}", "public boolean add(Object element);", "@Override\n public void add(int index, T t) {\n checkIfArrayFull();\n\n if(index >= arrayList.length) {\n System.out.println(\"The index is out of bounds for this list\");\n System.exit(-1);\n }\n\n Object ob = arrayList[index];\n arrayList[index] = t;\n\n Object ob2;\n\n /*The loop cycles through the array starting at index. ob2 is given the value of arrayList at i+1 position.\n The arrayList at i+1 position is assigned the value of ob. Then the ob variable is assigned the value of ob2. */\n for(int i = index; i < arrayList.length - 1; i++) {\n ob2 = arrayList[i+1];\n arrayList[i+1] = ob;\n ob = ob2;\n }\n\n elementsInArray++;\n }", "public void addElement(Object obj);", "void add(Object element);", "public boolean add( Object newVal )\n {\n\t//first expand if necessary\n\tif ( _size >= _data.length )\n\t expand();\n\n\t_data[_size] = newVal;\n\t_size++;\n\n\treturn true;\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic void push(Object element) {\n\t\tif(size == capacity) {\n\t\t\tthrow new IllegalArgumentException(\"Capacity has been reached.\");\n\t\t}\n\t\tlist.add(0, (E) element);\n\t\tsize++;\n\t\t\n\t}", "public void add(E e) {\n resize();\n list[size] = e;\n size++;\n }", "public void add(int num) {\n // if the array is not large enough, an array of twice\n // the capacity is created\n if (count + 1 > list.length) {\n int[] temp = new int[list.length * 2];\n for (int i = 0; i < list.length; i++) {\n temp[i] = list[i];\n }\n list = temp;\n temp = null;\n }\n \n // add the element to the array and increment the count\n list[count++] = num;\n }", "public void put(T element) {\n\t\tcheckCapacity(size + 1);\n\t\tdata[size++] = element;\n\t}", "public void add(Fraction element)\r\n\t{\n\t\tif(n==a.length)\r\n\t\t{\r\n\t\t\t// khai bao 1 mang Rectangle b\r\n\t\t\tFraction b[]= new Fraction[a.length*2];\r\n\t\t\tfor(int i=0;i<n;i++)\r\n\t\t\t{\r\n\t\t\t\tb[i]=a[i];\r\n\t\t\t}\r\n\t\t\t//gan dia chi b qua a\r\n\t\t\ta=b;\r\n\t\t}\r\n\t\ta[n]=element;\r\n\t\tn++;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic void add(T item){\n\t\t\n\n\t\tif(currentsize == data.length-1){\n\t\t\tgrow();\n\t\t}\n\n\t\t\n\t\tdata[currentsize] = item;\n\t\tcurrentsize++;\n\n\n\t}", "void add(T element);", "void add(T element);", "public void add(T value) {\n extend();\n this.list[size]=value;\n this.size++;\n }", "public void add(int toBeAdded) {\n\t\tif (this.myCount==this.myValues.length){\n\t\t\tSystem.err.println(\"No more space in array\");\n\t\t\tSystem.exit(1);\n\t\t}\n \tthis.myValues[this.myCount] = toBeAdded;\n this.myCount++;\n }", "public boolean add(T value) {\n if (size == arr.length) {\n final int newSize = arr.length * 3 / 2 + 1;\n T[] newArr = (T[]) new Object[newSize];\n System.arraycopy(arr, 0, newArr, 0, arr.length);\n this.arr = newArr;\n }\n arr[size++] = value;\n return true;\n }", "public void addToArray(JsonElement element){\n values.add(element);\n }", "public void append(Item value) {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not an array.\");\n }", "public boolean add(T element) {\n if (this.position >= this.container.length) {\n this.enlargeCapacity();\n }\n this.container[this.position++] = element;\n return true;\n }", "public void add(int index, E anEntry){\n if (index < 0 || index > size){\n throw new ArrayIndexOutOfBoundsException(index);\n }\n if (size == capacity){\n reallocate();\n }\n // Shift data in elements from index to size ‐ 1\n for (int i = size; i > index; i--){\n theData[i] = theData[i - 1];\n }\n // Insert the new item.\n theData[index] = anEntry;\n size++;\n }", "public void add(byte[] arrby) {\n ByteBuffer byteBuffer;\n ByteBuffer byteBuffer2 = byteBuffer = Blob.this.getByteBuffer();\n synchronized (byteBuffer2) {\n byteBuffer.position(Blob.this.getByteBufferPosition() + this.offset() + this.mCurrentDataSize);\n byteBuffer.put(arrby);\n this.mCurrentDataSize += arrby.length;\n return;\n }\n }" ]
[ "0.76686954", "0.74851155", "0.74687976", "0.7236848", "0.7234069", "0.72079545", "0.7191772", "0.71495", "0.71209073", "0.71136636", "0.7108366", "0.70951533", "0.7067297", "0.70622826", "0.7040269", "0.7035066", "0.703323", "0.70278144", "0.7021878", "0.69904786", "0.6930637", "0.68888485", "0.6846957", "0.68229365", "0.68200827", "0.680961", "0.6806561", "0.6773698", "0.6773698", "0.6762036", "0.67481655", "0.673488", "0.67257535", "0.6722685", "0.6707268", "0.66823184", "0.66496605", "0.664093", "0.66330063", "0.6598586", "0.6586407", "0.6583233", "0.6570905", "0.6555252", "0.653916", "0.6506856", "0.649941", "0.6496235", "0.6483793", "0.64786404", "0.6476939", "0.6476939", "0.64726627", "0.647159", "0.6467859", "0.6453994", "0.6441298", "0.6435872", "0.6433325", "0.6433325", "0.64209193", "0.64188844", "0.64132965", "0.6408472", "0.64084226", "0.6405206", "0.6400334", "0.6391002", "0.63735163", "0.6360337", "0.63591284", "0.6318561", "0.6317448", "0.63149637", "0.6311139", "0.6311139", "0.6306986", "0.6300141", "0.6291517", "0.62834924", "0.6254966", "0.6239439", "0.622885", "0.62279594", "0.622515", "0.6214845", "0.6202228", "0.6193998", "0.6189484", "0.61888814", "0.6183521", "0.61736274", "0.61736274", "0.6167145", "0.61591935", "0.61564714", "0.6147975", "0.613913", "0.6137911", "0.6125363", "0.6122491" ]
0.0
-1
Extend the array, or get space by compressing it.
public void extend() { if (ON < OLast / 2) { compress(); return; } klasse o[] = (klasse[]) (new Object[2 * OSize]); System.arraycopy(O, 0, o, 0, OLast); OSize *= 2; O = o; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void extendArray() {\n int index = size();\n Object[] temp = new Object[index + 1];\n for (int i=0; i < index; i++) {\n temp[i] = AL[i];\n }\n AL = temp;\n }", "private void grow() {\n int growSize = size + (size<<1);\n array = Arrays.copyOf(array, growSize);\n }", "private void expand() { \n\t\tComparable[] temp = new Comparable[ _data.length * 2 ];\n\t\tfor( int i = 0; i < _data.length; i++ )\n\t \ttemp[i] = _data[i];\n\t\t_data = temp;\n }", "private static char[] expand(char[] array, int neededSpace, int size)\r\n/* 108: */ {\r\n/* 109:125 */ int newCapacity = array.length;\r\n/* 110: */ do\r\n/* 111: */ {\r\n/* 112:128 */ newCapacity <<= 1;\r\n/* 113:130 */ if (newCapacity < 0) {\r\n/* 114:131 */ throw new IllegalStateException();\r\n/* 115: */ }\r\n/* 116:134 */ } while (neededSpace > newCapacity);\r\n/* 117:136 */ char[] newArray = new char[newCapacity];\r\n/* 118:137 */ System.arraycopy(array, 0, newArray, 0, size);\r\n/* 119: */ \r\n/* 120:139 */ return newArray;\r\n/* 121: */ }", "private void grow() {\n T[] arr_temp = (T[]) new Object[arr.length*2];\n for (int i=0; i<arr.length; i++){\n arr_temp[i] = arr[i];\n }\n arr = arr_temp;\n }", "private void addSizeArray() {\n int doubleSize = this.container.length * 2;\n Object[] newArray = new Object[doubleSize];\n System.arraycopy(this.container, 0, newArray, 0, this.container.length);\n this.container = new Object[doubleSize];\n System.arraycopy(newArray, 0, this.container, 0, doubleSize);\n }", "private void expand(){\n \n int newSize = size + expand;\n E[] tempArray = (E[]) new Object[newSize];\n for(int n = 0; n < size; n++){\n tempArray[n] = stackArray[n]; \n }\n stackArray = tempArray;\n size = newSize;\n }", "private void expandArray() {\r\n//\t\tSystem.out.println(\"Expanding: current capacity \" + capacity); //Used for debugging\r\n\t\tcapacity = 2 * capacity;\r\n\t\tE[] temp = (E[]) new Object[capacity];\r\n\t\tfor (int i = 0; i < t + 1; i++)\r\n\t\t\ttemp[i] = stack[i];\r\n\t\tstack = temp;\r\n\t}", "private void expandCapacity()\r\n {\r\n T[] larger = (T[])(new Object[stack.length*2]);\r\n \r\n for (int index=0; index < stack.length; index++)\r\n larger[index] = stack[index];\r\n \r\n stack = larger;\r\n }", "private void expandCapacity() {\n\t\tT[] larger = (T[]) (new Object[stack.length*2]);\t\t//double size of previous stack\n\t\t\n\t\tfor(int i = 0; i < stack.length; i++)\n\t\t\tlarger[i] = stack[i];\n\t\t\n\t\tstack = larger;\n\t}", "public void compact()\n\t{\n\t\tif (addIndex == size())\n\t\t\treturn;\n\t\t\n\t\tObject narray = Array.newInstance( array.getClass().getComponentType(), addIndex );\n\t\tSystem.arraycopy( array, 0, narray, 0, addIndex );\n\t\tarray = narray;\n\t}", "private Number[] arrayExtension(Number[] array) {\n int extendedLength = (int) (array.length * 1.3 + 2);\n Number[] extendedArray = new Number[extendedLength];\n for (int index = 0; index < array.length; index++) {\n extendedArray[index] = array[index];\n }\n return extendedArray;\n }", "@SuppressWarnings(\"unchecked\")\n private void upSize()\n {\n T[] newArray = (T[]) new Object [theArray.length * 2];\n for (int i =0; i < theArray.length; i++){\n newArray[i] = theArray[i];\n }\n theArray = newArray;\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void growArray() {\n\t\tObject[] newList = new Object[size * 2];\n\t\tfor (int i = 0; i < size(); i++) {\n\t\t\tnewList[i] = get(i);\n\t\t}\n\t\tlist = (E[]) newList;\n\t\tsize *= 2;\n\t}", "private void expandArray(int expandSize) {\n\t\tif(expandSize < 1) {\n\t\t\treturn;\n\t\t}\n\t\t// Save current array reference, and create new array size\n\t\tObject[] temp = array;\n\t\tthis.array = new Object[temp.length + expandSize]; // same as [this.array.length + expandSize]\n\n\t\t// If there is any 'wrap around' data, copy data up to the end of the array and copy the wrap around data\n\t\tif(index+length > temp.length) {\n\t\t\t// Copy everything up to the end of the old array\n\t\t\tSystem.arraycopy(temp, index, array, index, temp.length - index);\n\n\t\t\t// Calculate the remaining number of elements that need copying\n\t\t\tint remaining = (length - (temp.length - index));\n\t\t\t// Determine if all of the wrap around elements can fit in the remaining space at the end of the\n\t\t\t// expanded array\n\t\t\tint tailSize = 0;\n\t\t\tif(remaining < expandSize) { tailSize = remaining; }\n\t\t\telse { tailSize = expandSize; }\n\n\t\t\t// Copy the wrap around elements into the expanded array up to the end of the expanded array\n\t\t\tSystem.arraycopy(temp, 0, array, temp.length, tailSize);\n\t\t\t// Wrap around and copy any remaining wrap around elements\n\t\t\tif(remaining > tailSize) {\n\t\t\t\tSystem.arraycopy(temp, tailSize, array, 0, remaining-tailSize);\n\t\t\t}\n\t\t}\n\t\t// Else none of the data 'wraps around', so everything can be copied at once\n\t\telse {\n\t\t\tSystem.arraycopy(temp, index, array, index, length);\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n\t private boolean grow() {\n\n\t /* \n\t * Add code here \n\t * Expand capacity (double it) and copy old array contents to the\n\t * new one. \n\t */\n\t\t \n\t\t capacity = (capacity*2);\n\t\t E[] new_elements = elements;\n\t\t elements = (E[])new Object[capacity];\n\t\t for(int i=0; i<new_elements.length;i++){\n\t\t\t elements[i] = new_elements[i];\n\t\t }\n\t System.out.println(\"Capacity reached. Increasing storage...\");\n\t System.out.println(\"New capacity is \" + capacity + \" elements\");\n\n\t return true;\n\t }", "private void grow() {\n capacity *= 2;\n Object[] temp = new Object[capacity];\n for (int i = 0; i < values.length; i++) temp[i] = values[i];\n values = temp;\n }", "static public float[] expandArray(float[] f) {\n\t\tint newSize=f.length*2; \n\t\tfloat [] newf=new float[newSize];\n System.arraycopy(f, 0, newf, 0,\t\n Math.min(f.length, newSize));\n return newf;\n }", "private void expand() {\n\n intElements = copyIntArray(intElements, intElements.length * 2);\n doubleElements = copyDoubleArray(doubleElements, doubleElements.length * 2);\n stringElements = copyStringArray(stringElements, stringElements.length * 2);\n typeOfElements = copyIntArray(typeOfElements, typeOfElements.length * 2);\n }", "private void resizeUp() \n\t {\n\t\t int newSize = myArray.length * 2;\n\t\t myArray = Arrays.copyOf(myArray, newSize);\n\t }", "private void increaseSize() {\n data = Arrays.copyOf(data, size * 3 / 2);\n }", "private void enlargeCapacity() {\n Object[] tmp = this.container;\n this.container = new Object[this.container.length + this.capacity];\n System.arraycopy(tmp, 0, this.container, 0, tmp.length);\n }", "private void extendContainer() {\n int newLength = container.length * 2;\n newLength = (newLength % 2 != 0) ? newLength - 1 : newLength;\n Entry<K, V>[] t = new Entry[newLength];\n for (Entry<K, V> e : container) {\n if (e != null) {\n int index = indexFor(e.key);\n t[index] = e;\n }\n }\n container = t;\n }", "static public Object expandArray(Object[] list) {\n\t\tint newSize=list.length*2;\n Class type = list.getClass().getComponentType();\n Object temp = Array.newInstance(type, newSize);\n System.arraycopy(list, 0, temp, 0,\t\n Math.min(Array.getLength(list), newSize));\n return temp;\n }", "private void grow()\r\n\t{\r\n\t\tint [] temp = new int[count * 2]; // new array to hold the data\r\n\r\n\t\t// copy old data in new array\r\n\t\tfor (int i = 0; i < count; i++)\r\n\t\t\ttemp[i] = array[i];\r\n\r\n\t\tarray = temp; // update the new array\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprotected void grow(){\n\t\t// makes new arraylist\n\t\tT[] temp = (T[]) new Object[data.length *2];\n\t\tfor(int i = 0; i < data.length; i++ ){\n\t\t\ttemp[i] = data[i];\n\t\t}\n\t\tdata = temp;\n\t}", "synchronized protected void enlargeArrays() {\n \t\tenlargeArrays(5);\n \t}", "protected static Object[] expand(Object[] stack) {\n Object[] newStack = new Object[stack.length * 2];\n System.arraycopy(stack, 0, newStack, 0, stack.length);\n return newStack;\n }", "private List<FieldInfo> compressArrayList(DebuggerObject arrayObject)\n {\n // mimic the public length field that arrays possess\n // according to the java spec...\n indexToSlotList = new LinkedList<Integer>();\n indexToSlotList.add(0, new Integer(ARRAY_LENGTH_SLOT_VALUE));\n\n // the +1 here is due to the fact that if we do not have at least one\n // more than\n // the sum of start elements and tail elements, then there is no point\n // in displaying\n // the ... elements because there would be no elements for them to\n // reveal\n if (arrayObject.getElementCount() > (VISIBLE_ARRAY_START + VISIBLE_ARRAY_TAIL + 2)) {\n\n // the destination list\n List<FieldInfo> newArray = new ArrayList<FieldInfo>(2 + VISIBLE_ARRAY_START + VISIBLE_ARRAY_TAIL);\n newArray.add(0, new FieldInfo(\"int length\", \"\" + arrayObject.getElementCount()));\n for (int i = 0; i <= VISIBLE_ARRAY_START; i++) {\n // first 40 elements are displayed as per normal\n newArray.add(new FieldInfo(\"[\" + i + \"]\", arrayObject.getElementValueString(i)));\n indexToSlotList.add(i);\n }\n\n // now the first of our expansion slots\n newArray.add(new FieldInfo(\"[...]\", \"\"));\n indexToSlotList.add(new Integer(ARRAY_QUERY_SLOT_VALUE));\n\n for (int i = VISIBLE_ARRAY_TAIL; i > 0; i--) {\n // last 5 elements are displayed\n int elNum = arrayObject.getElementCount() - i;\n newArray.add(new FieldInfo(\"[\" + elNum + \"]\", arrayObject.getElementValueString(elNum)));\n indexToSlotList.add(arrayObject.getElementCount() - i);\n }\n return newArray;\n }\n else {\n List<FieldInfo> fullArrayFieldList = new ArrayList<FieldInfo>(arrayObject.getElementCount() + 1);\n fullArrayFieldList.add(0, new FieldInfo(\"int length\", \"\" + arrayObject.getElementCount()));\n \n for (int i = 0; i < arrayObject.getElementCount(); i++) {\n fullArrayFieldList.add(new FieldInfo(\"[\" + i + \"]\", arrayObject.getElementValueString(i)));\n indexToSlotList.add(i);\n }\n return fullArrayFieldList;\n }\n }", "private void grow() {\n int oldCapacity = this.values.length;\n int newCapacity = oldCapacity + (oldCapacity >> 1);\n Object[] newValues = new Object[newCapacity];\n System.arraycopy(this.values, 0, newValues, 0, oldCapacity);\n this.values = newValues;\n }", "private void shrink() {\n int shrinkSize = array.length>>1;\n array = Arrays.copyOf(array, shrinkSize);\n }", "private void doubleSize() {\n\t\tint[] arr2 = new int[2 * arr.length];\n\t\tfor (int i = 0; i < arr.length; ++i) {\n\t\t\tarr2[i] = arr[i];\n\t\t}\n\t\tarr = arr2;\n\t}", "private void grow()\n\t{\n\t\tint temp[] = new int[count * 2];\n\t\tfor(int index = 0; index < count; index = index + 1)\n\t\t\ttemp[index] = array1[index];\n\t\tarray1 = temp;\n\t}", "private void ensureCap(){\n T[] temp = (T[])new Object[arr.length * 2];\n for(int i = 0; i < numItems; i++){\n temp[i] = this.arr[i];\n }\n this.arr = temp;\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void growArray() {\n\t\tint tempSize = size * 2;\n\t\tE[] tempList = (E[]) new Object[tempSize];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\ttempList[i] = list[i];\n\t\t}\n\t\tlist = tempList;\n\t}", "private void increaseSize() {\r\n\t\tE[] biggerE = (E[]) new Object[this.capacity * 2];\r\n\t\tdouble[] biggerC = new double[this.capacity * 2];\r\n\t\tfor (int i = 0; i < this.size; i++) {\r\n\t\t\tbiggerE[i] = this.objectHeap[i];\r\n\t\t\tbiggerC[i] = this.costHeap[i];\r\n\t\t}\r\n\t\tthis.costHeap = biggerC;\r\n\t\tthis.objectHeap = biggerE;\r\n\t\tthis.capacity = this.capacity * 2;\r\n\t}", "private void shiftAndCopyIfNeeded(int newSize, int pos) {\n\t\tif (array.length < newSize) {\n\t\t\t// create new array of desired size, at least newSize big\n\t\t\tObject[] newArray = new Object[newSize + EXTRA_SPACE];\n\t\t\t// copy all elements from array into newArray\n\t\t\tSystem.arraycopy(array, 0, newArray, 0, size);\n\t\t\t// use the newArray instead of the old \n\t\t\tarray = newArray;\n\t\t}\n\t\t// if there are elements above pos\n\t\tif (pos < size) {\n\t\t\t// shift content from pos and above\n\t\t\t// if newSize is greater than size, makes room for (newSize - size) elements at pos\n\t\t\t// in this case, make sure to fill the gap with new elements\n\t\t\t// if newSize is less than size, overwrites (newSize - size) elements below pos\n\t\t\tSystem.arraycopy(array, pos, array, newSize - (size - pos), size - pos);\n\t\t}\n\t\t// finally, use the new size\n\t\tsize = newSize;\n\t}", "private String[] enlargeArray(String[] smallArray)\n\t{\n\t\tString[] tempArray = new String[(1 + smallArray.length)];\n\t\t\n\t\tfor(int i = 0; i < smallArray.length; ++i)\n\t\t{\n\t\t\ttempArray[i] = smallArray[i];\n\t\t}\n\t\t\n\t\treturn tempArray;\n\t}", "protected void grow()\r\n\t{\t\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Starting grow\");\r\n\t\t}\r\n\t\t\r\n\t\tint[] temp = new int[count*2];\r\n\t\t\r\n\t\tfor(int index = 0; index < count; index++)\r\n\t\t{\r\n\t\t\ttemp[index] = numArray[index];\r\n\t\t\t\r\n\t\t\tif(debug)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Debug - temp[index] = \" + temp[index]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tnumArray = temp;\r\n\t\t\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Ending grow\");\r\n\t\t}\r\n\t}", "public void insertToArray()\n {\n //if the bucket size is not empty, empty out the bucket\n if(zero.size() != 0)\n {\n a[c] = zero.get(0);\n zero.remove(0);\n c++; s++;\n return;\n }\n if(one.size() != 0)\n {\n a[c] = one.get(0);\n one.remove(0);\n c++; s++;\n return;\n }\n if(two.size() != 0)\n {\n a[c] = two.get(0);\n two.remove(0);\n c++; s++;\n return;\n }\n if(three.size() != 0)\n {\n a[c] = three.get(0);\n three.remove(0);\n c++; s++;\n return;\n }\n if(four.size() != 0)\n {\n a[c] = four.get(0);\n four.remove(0);\n c++; s++;\n return;\n }\n if(five.size() != 0)\n {\n a[c] = five.get(0);\n five.remove(0);\n c++; s++;\n return;\n }\n if(six.size() != 0)\n {\n a[c] = six.get(0);\n six.remove(0);\n c++; s++;\n return;\n }\n if(seven.size() != 0)\n {\n a[c] = seven.get(0);\n seven.remove(0);\n c++; s++;\n return;\n }\n if(eight.size() != 0)\n {\n a[c] = eight.get(0);\n eight.remove(0);\n c++; s++;\n return;\n }\n if(nine.size() != 0)\n {\n a[c] = nine.get(0);\n nine.remove(0);\n c++; s++;\n return;\n }\n }", "void extend(Dimension dimension)\n\t\t{\n\t\t\tsides = sides+1;\n\t\t\t\n\t Dimension[] dime1 = new Dimension[d.length+1];\n\t \n\t\t\tfor (int i =0; i< d.length; i++)\n\t\t\t{\n\t\t\t\tdime1[i] = d[i];\n\t\t\t}\n\t\t\t\n\t\t\tdime1[d.length]=dimension;\n\t\t\t\n\t\t\td = new Dimension[d.length + 1];\n\t\t\tfor(int i = 0; i< dime1.length; i++)\n\t\t\t{\n\t\t\t\td[i] = dime1[i];\n\t\t\t}\t\t\n\t\t}", "public int[] expand() {\r\n return expand(value);\r\n }", "private void expandCapacity() {\n heap = Arrays.copyOf(heap, heap.length * 2);\n }", "protected void compress(){\r\n\t\t\r\n \tmodCount++;\r\n\t\tArrayNode<T> current = beginMarker.next;\r\n\t\t\r\n\t\t//find non-full node\r\n\t\twhile (current != endMarker){\r\n\t\t\tif (current.getLength()== current.getArraySize()){\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tArrayNode<T> removing = current.next;\r\n\t\t\t\t//compression done\r\n\t\t\t\tif (removing==endMarker){\r\n\t\t\t\t\t//remove empty nodes\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//empty node\r\n\t\t\t\twhile (removing.getArraySize()==0){\r\n\t\t\t\t\tremoving = removing.next;\r\n\t\t\t\t\tif (removing==endMarker)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//not sure why this is needed\r\n\t\t\t\tif (removing==endMarker){\r\n\t\t\t\t\t//remove empty nodes\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//move elements from \"removing\" node to \"current\"\r\n\t\t\t\tT temp = removing.removeFirst();\r\n\t\t\t\tcurrent.insertSorted(temp);\r\n\t\t\t\t\r\n\t\t\t\t//check current length, go to next if full, otherwise redo loop\r\n\t\t\t\tif (current.getLength()==current.getArraySize()){\r\n\t\t\t\t\tcurrent = current.next;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//do another sweep at end to remove empty nodes\r\n\t\tcurrent = beginMarker.next;\r\n\t\twhile (current != endMarker){\r\n\t\t\tif (current.getArraySize()==0){\r\n\t\t\t\tcurrent.prev.next = current.next;\r\n\t\t\t\tcurrent.next.prev = current.prev;\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t\tsize--;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int[] extendInt(int[] original, int extend) {\r\n\t\tif (original == null)\r\n\t\t\toriginal = new int[0];\r\n\t\tint[] returnIntArray = new int[original.length + 1];\r\n\t\tfor (int i = 0; i < original.length; i++) {\r\n\t\t\treturnIntArray[i] = original[i];\r\n\t\t}\r\n\t\treturnIntArray[original.length] = extend;\r\n\t\treturn returnIntArray;\r\n\t}", "private void increase_capacity() {\r\n Object[] temp = new Object[capacity = capacity + capacity/2];\r\n for (int i = 0;i < stack.length ;i++) {\r\n temp[i] = stack[i];\r\n }\r\n stack = temp;\r\n }", "private void resize(int newSize){\n Item[] temp = (Item[]) new Object[newSize]; //newsize\n for(int i=0; i<itemCount; i++){\n temp[i] = array[i]; // fill temp with array's stuff\n }\n array = temp; // reset array to temp\n }", "private void grow(int minCapacity) {\n // overflow-conscious code\n int oldCapacity = buf.length;\n int newCapacity = oldCapacity << 1;\n if (newCapacity - minCapacity < 0) {\n newCapacity = minCapacity;\n }\n if (newCapacity - MAX_ARRAY_SIZE > 0) {\n newCapacity = hugeCapacity(minCapacity);\n }\n buf = Arrays.copyOf(buf, newCapacity);\n }", "public void resize(){\n Object[] old = myCustomStack;\n //resize array to be twice the size when the Stack is more than 3/4 full\n if(numElements > old.length * .75){\n Object[] resizedArr = new Object[old.length * 2];\n for(int i = 0; i < numElements; i++){\n resizedArr[i] = old[i];\n }\n myCustomStack = resizedArr;\n System.out.println(\"Array has been resized to twice the size. Array length: \" + myCustomStack.length);\n }\n //resize array to be half the size when the Stack is more than 1/4 empty\n else if(numElements < old.length * .25){\n Object[] resizedArr = new Object[old.length / 2];\n for(int i = 0; i < numElements; i++){\n resizedArr[i] = old[i];\n }\n myCustomStack = resizedArr;\n System.out.println(\"Array has been resized to half the size. Array length: \" + myCustomStack.length);\n }\n else{\n return;\n }\n }", "private void doubleArray()\n\t{\n\t\tT[] oldList = list;\n\t\tint oldSize = oldList.length;\n\t\t\n\t\tlist = (T[]) new Object[2 * oldSize];\n\t\t\n\t\t// copy entries from old array to new, bigger array\n\t\tfor (int index = 0; index < oldSize; index++)\n\t\t\tlist[index] = oldList[index];\n\t}", "public void reSize() {\n int newSize = arr.length * 2;\n arr = Arrays.copyOf(arr, newSize);\n }", "void resize() {\n capacity = array.size();\n }", "public SuperArray() { \n \t_data = new Comparable[10];\n \t_lastPos = -1; //flag to indicate no lastpos yet\n \t_size = 0;\t\n }", "private void resize(int newCapacity) {\n\n E[] temp = (E[]) new Object[newCapacity];\n for(int i = 0; i < size(); i++)\n temp[i] = data[calculate(i)];\n data = temp;\n head = 0;\n tail = size()-1;\n\n\n }", "public void doubleSize()\r\n\t{\r\n \t\tint newSize = Stack.length * 2;\r\n\t Stack = Arrays.copyOf(Stack, newSize);\r\n\t}", "private void resize(int capacity) {\n // create a new array, and copy the original array items to the new array\n T[] newArray = (T[]) new Object[capacity];\n int position = plusOne(nextFirst);\n for (int i = 0; i < size; i += 1) {\n newArray[i] = array[position];\n position = plusOne(position);\n }\n nextFirst = newArray.length - 1;\n nextLast = size;\n array = newArray;\n }", "public void compact()\n {\n array = toArray();\n }", "@SuppressWarnings({\"unchecked\"})\n private void expandStack() {\n T[] newStack;\n \n newStack = (T[]) new Object[Array.getLength(this.elements) + 1];\n for( int i = 0; i < Array.getLength(this.elements); i++ )\n newStack[i] = this.elements[i];\n this.elements = newStack;\n }", "public Object[] getArray() {\n compress();\n return O;\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void resize(int newSize){\n\t\tif(newSize > max){\n\t\t\tnewSize = max;\n\t\t}\n\t\tT[] newData = (T[])new Object[newSize];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tnewData[i] = data[i];\n\t\t}\n\t\tdata = newData;\n\t}", "stack() {\n arr = (E[]) new Object[size];\n }", "private void resizeDown()\n\t{\n\t\tint newSize = myArray.length/2;\n\t\tmyArray = Arrays.copyOf(myArray, newSize);\n\t}", "private Object[] resize(E[] elems, int newsize){\n if(newsize < 0){\n throw new IllegalArgumentException();\n // UP FOR CHANGE\n }\n E[] newelems = (E[])(new Comparable[newsize]);\n if (elems == null){\n return newelems;\n }\n // Add elements back in\n System.arraycopy(elems, 0, newelems, 0, Math.min(elems.length, newsize));\n\n return newelems;\n }", "protected static char[] expand(char[] stack) {\n char[] newStack = new char[stack.length * 2];\n System.arraycopy(stack, 0, newStack, 0, stack.length);\n return newStack;\n }", "private int[] appendArray(int[] array, int x) {\n int[] result = new int[array.length + 1];\n\n for (int i = 0; i < array.length; i++)\n result[i] = array[i];\n\n result[result.length - 1] = x;\n\n return result;\n }", "private void reallocate(){\n capacity = 2 * capacity;\n theData = Arrays.copyOf(theData, capacity);\n }", "public ListArrayBasedPlus(int size)\n {\n items = new Object[size];\n numItems = 0;\n }", "private void grow() { \r\n\t\tint capacity = accounts.length;\r\n\t\tAccount [] tempArray = new Account[capacity += INITIAL_SIZE]; //tempArray with new capacity\r\n\t\tfor ( int i = 0; i < accounts.length; i++ ) { // Transfer all accounts into new Accounts\r\n\t\t\ttempArray[i] = accounts[i];\r\n\t\t}\t\t\r\n\t\taccounts = tempArray;\t\r\n\t\treturn;\r\n\t}", "private void resizeArray() {\n stackArray = Arrays.copyOf(stackArray, stackArray.length * 2 + 1);\n }", "@Override\n public void addFirst(T item) {\n if (size >= array.length) {\n resize(size * 2);\n array[nextFirst] = item;\n nextFirst = minusOne(nextFirst);\n } else {\n array[nextFirst] = item;\n nextFirst = minusOne(nextFirst);\n }\n size += 1;\n }", "public void increaseSize() {\n Estimate[] newQueue = new Estimate[queue.length * 2];\n\n for (int i = 0; i < queue.length; i++) {\n newQueue[i] = queue[i];\n }\n\n queue = newQueue;\n }", "private static Object resizeArray(Object oldArray, int newSize) {\n\t\tint oldSize = java.lang.reflect.Array.getLength(oldArray);\n\t\tClass elementType = oldArray.getClass().getComponentType();\n\t\tObject newArray = java.lang.reflect.Array.newInstance(elementType,\n\t\t\t\tnewSize);\n\t\tint preserveLength = Math.min(oldSize, newSize);\n\t\tif (preserveLength > 0) {\n\t\t\tSystem.arraycopy(oldArray, 0, newArray, 0, preserveLength);\n\t\t}\n\t\treturn newArray;\n\t}", "public Object[] resize(int newSize){\n Object[] newArray = new Object[newSize];\n for( int i = 0 ; i < this.array.length ; i++ ){\n newArray[i] = this.array[i];\n }\n return newArray;\n }", "@Override\n public boolean add(T t) {\n if (size >= 10) {\n data = new Object[(data.length * 3) / 2 + 1];\n data = Arrays.copyOfRange(data, 0, data.length);\n }\n data[size++] = t;\n return true;\n }", "public int[] increaseBy2(int[] arr) {\n return null;\n }", "public void add( Comparable newVal ) {\n \t//if _data is full, expand the array\n \tif (_size == _data.length){\n\t \texpand();\n \t}\n \t\n\tset(_lastPos + 1, newVal);\n \t//increases _lastPos and _size\n \t_lastPos++;\n \t_size++;\n }", "@Override\n // worst-case complexity: O(n), since it might need to resize itself\n // amortised average-case complexity: O(1), since resizing happens too\n // too infrequent to affect the actual complexity\n public void add(T item) {\n if (size >= arr.length)\n arr = resize(arr, EXPAND_FACTOR);\n // we add the item to the end and then increment the size\n arr[size++] = item;\n }", "static public float[][] expandArray(float[][] f) {\n\t\tint newSize=f.length*2; \n\t\tfloat [][] newf=new float[newSize][];\n\t\tfor(int i=0; i<f.length; i++) newf[i]=f[i];\n return newf;\n }", "public void resize()\r\n\t{\r\n\t\tif(nItems >= arraySize/2)\t\t\t\t\t\t\t\t\t\t\t\t//If array is half full, the array becomes twice as large.\r\n\t\t{\t\t\t\r\n\t\t\tItem[] tempArray = (Item[]) new Object[2*arraySize];\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < nItems; i++)\r\n\t\t\t{\r\n\t\t\t\ttempArray[i] = q[i];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tq = tempArray;\t\t\t\t\t\t\t\t\t\t\t\t//Re-initialization of q array.\r\n\t\t\tarraySize = 2*arraySize;\t\t\t\t\t\t\t\t\t\t\t//Array size is doubled.\r\n\t\t}\r\n\t\telse if(nItems <= arraySize/4)\t\t\t\t\t\t\t\t\t\t\t//If array is a quarter full, the array size is halved.\r\n\t\t{\r\n\t\t\tItem[] tempArray = (Item[]) new Object[arraySize/2];\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < nItems; i++)\r\n\t\t\t{\r\n\t\t\t\ttempArray[i] = q[i];\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tq = tempArray;\t\t\t\t\t\t\t\t\t\t\t\t//Re-initialization of q array.\r\n\t\t\tarraySize = arraySize/2;\t\t\t\t\t\t\t\t\t\t\t//Array size is halved.\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn;\r\n\t}", "public void reallocate()\r\n\t{\r\n\t\tE[] newArray = (E[]) new Object[capacity * 2];\r\n\t\tint i = 0;\r\n\t\tfor(i = 0; i < this.size(); i++)\r\n\t\t{\r\n\t\t\tnewArray[i] = innerArray[(front + i) % capacity];\r\n\t\t\tSystem.out.println((front + i) % capacity);\r\n\t\t}\r\n\t\tfront = 0;\r\n\t\trear = this.size() - 1;\r\n\t\tcapacity = capacity * 2;\r\n\t\tinnerArray = newArray;\r\n\t}", "private T[] resize(T[] arr, double factor) {\n int nSize = (int) (arr.length * factor) + 1;\n // initialize the new array with a new size\n T[] nArr = (T[]) (new Object[nSize]);\n // always take the smallest length to make sure the index is in bound\n int size = Math.min(nArr.length, arr.length);\n // copy all values from the old array into the new array\n for (int i = 0; i < size; i++) {\n nArr[i] = arr[i];\n }\n return nArr;\n }", "private void resizeArray()\n {\n int[] temp = new int[integerList.length * 2];//Create new array with twice the size.\n for(int i = 0; i < integerList.length; i++)//Populate new array with data from old array\n {\n temp[i] = integerList[i];\n }\n integerList = temp;//Set the integerList to point to the new array.\n }", "public int capacity( )\n {\n return array.length;\n }", "@Override\n public boolean add(T object) {\n T[] newArray;\n if (array[array.length - 1] != null) {\n newArray = (T[]) new Object[array.length * 2];\n } else {\n newArray = (T[]) new Object[array.length];\n }\n for (int i = 0; i < array.length; i++) {\n newArray[i] = array[i];\n }\n newArray[size] = object;\n this.size++;\n this.array = newArray;\n return true;\n }", "@Override\n public void insertBack(Item x) {\n if (size == items.length) {\n //dynamic array\n //resize array\n resize(size * RFACTOR);\n }\n items[size] = x;\n size += 1;\n }", "private void extend() {\n for (Object o : table) {\n if (o == null)\n return;\n }\n\n TABLE_SIZE *= 2;\n Object[] entries = entrySet();\n this.table = new Object[TABLE_SIZE];\n\n rebuild(entries);\n }", "private void expand() {\n int capacity = newCapacity();\n IntIntMap h = new IntIntMap(capacity);\n for (int i = 0; i < entries.length; i += 2) {\n if (entries[i] != EMPTY) {\n h.put(entries[i], entries[i + 1]);\n }\n }\n this.entries = h.entries;\n this.threshold = h.threshold;\n this.modulo = h.modulo;\n this.modulo2 = h.modulo2;\n }", "private void expandCapacity() {\n T[] tempVertices = (T[])(new Object[vertices.length * 2]);\n int[][] tempEdges = new int[vertices.length * 2][vertices.length * 2];\n \n for (int i = 0; i < n; i++) {\n tempVertices[i] = vertices[i];\n for (int j = 0; j < n; j++) {\n tempEdges[i][j] = edges[i][j];\n }\n }\n \n vertices = tempVertices;\n edges = tempEdges;\n }", "private void reallocateDoubleCapacity() {\n\t\tObject oldElements[] = elements;\n\t\tcapacity *= reallocateFactor;\n\t\tsize = 0;\n\t\telements = new Object[capacity];\n\n\t\tfor (Object object : oldElements) {\n\t\t\tthis.add(object);\n\t\t}\n\t}", "public void addArrayDimension() {\r\n\t\ttheArrayDimension++;\r\n\t}", "private SignatureDTO[] add(SignatureDTO[] array, SignatureDTO element) {\n Class type = (array != null ? array.getClass() : (element != null ? element.getClass() : SignatureDTO.class));\n SignatureDTO[] newArray = (SignatureDTO[]) copyArrayGrow1(array, type);\n newArray[newArray.length - 1] = element;\n return newArray;\n }", "private void grow() {\n int oldCapacity = heap.length;\n // Double size if small; else grow by 50%\n int newCapacity = oldCapacity + ((oldCapacity < 64) ?\n (oldCapacity + 2) :\n (oldCapacity >> 1));\n Object[] newQueue = new Object[newCapacity];\n for (int i = 0; i < heap.length; i++) {\n newQueue[i] = heap[i];\n }\n heap = newQueue;\n }", "private IntPlus[] cloneArr(final IntPlus[] origArr) {\n return Arrays.copyOf(origArr, origArr.length);\n }", "void resize() {\n Comparable[] temp = new Comparable[size * 2];\n for (int i = 0; i < pq.length; i++) {\n temp[i] = pq[i];\n }\n pq = temp;\n }", "private void resize(int newSize) {\n Item[] resized = (Item[]) new Object[newSize];\n\n for (int i = 0; i < elements; i++)\n resized[i] = values[i];\n\n values = resized;\n }", "static public Object trimArray(Object[] list,int newSize) {\n Class type = list.getClass().getComponentType();\n Object temp = Array.newInstance(type, newSize);\n System.arraycopy(list, 0, temp, 0,\tnewSize); \n return temp;\n\t}", "public boolean offer (E e) throws NullPointerException\n {\n if(e == null)\n {\n throw new NullPointerException();\n }\n if(size() < cap)\n {\n arrayList.add(e);\n size++;\n bubbleUp(size() - 1);\n return true;\n }\n else //doubles the cap by creating a new array.\n {\n cap = cap*2;\n ArrayList<E> newArray = new ArrayList<E>(cap);\n for(int i = 0; i < size(); i++)\n {\n newArray.add(arrayList.get(i));\n }\n arrayList = newArray;\n offer(e);\n return true;\n }\n }", "private void grow() {\n Book[] temp = new Book[books.length + GROWTH_SIZE];\n for (int i = 0; i < books.length; i ++){\n temp[i] = books[i];\n }\n books = temp;\n }", "public int add(T newData) {\n\t\tint newLength = 1;\n\t\t// If there is more data to add then available space in the array\n\t\tif(newLength > (array.length - length)) {\n\t\t\t// Double the array size\n\t\t\texpandArray(array.length);\n\t\t}\n\n\t\t// If the new data will wrapping around, add the new data and wrap around to fit\n\t\tif((index + length) < array.length && newLength > (array.length - (index + length))) {\n\t\t\t// The number of elements available up to the end of the array before needing to wrap around\n\t\t\tint tailLength = array.length - (index + length);\n\t\t\t// Copy data up to the end of the array\n\t\t\tif(tailLength > 0) {\n\t\t\t\tarray[index+length] = newData;\n\t\t\t}\n\t\t\t// Copy rest of data 'wrapped around' to the beginning of the array\n\t\t\telse {\n\t\t\t\tarray[0] = newData;\n\t\t\t}\n\t\t}\n\t\t// Else if the data fits without wrapping around, add the new data\n\t\telse {\n\t\t\tarray[(index + length) % array.length] = newData;\n\t\t}\n\t\t// Adjust the length\n\t\tlength = length + newLength;\n\t\t// Return the number of elements successfully added\n\t\treturn newLength;\n\t}", "public int capacity()\n {\n return array.length;\n }" ]
[ "0.6834972", "0.63621175", "0.6227546", "0.61219835", "0.6109796", "0.6105929", "0.60907", "0.60828406", "0.6019074", "0.60187167", "0.5853225", "0.5841873", "0.58014613", "0.58008367", "0.578745", "0.5780825", "0.57501084", "0.5737114", "0.5723198", "0.57094306", "0.57087356", "0.5707295", "0.56986314", "0.56912845", "0.5613083", "0.5603301", "0.55843794", "0.557622", "0.5560158", "0.5554226", "0.5539018", "0.5529053", "0.55227697", "0.55206454", "0.55162185", "0.5506746", "0.548872", "0.54527354", "0.5448576", "0.5413323", "0.54116637", "0.54090214", "0.54082394", "0.5377811", "0.53635806", "0.53598917", "0.53404176", "0.5337543", "0.53282136", "0.53025305", "0.52927214", "0.528692", "0.52785635", "0.52727437", "0.52714497", "0.5269598", "0.5261618", "0.52292323", "0.5213835", "0.5182967", "0.51542217", "0.5149527", "0.51364094", "0.51279265", "0.5106525", "0.5099744", "0.5097707", "0.50963145", "0.50906205", "0.50903344", "0.50846195", "0.5078583", "0.5077023", "0.506376", "0.5057316", "0.50386477", "0.5023405", "0.5008106", "0.4997603", "0.49924147", "0.49877423", "0.49854594", "0.49797848", "0.4977216", "0.49771827", "0.49762082", "0.49655095", "0.49647182", "0.4964311", "0.49641058", "0.49619302", "0.49559993", "0.49449456", "0.49419937", "0.49283293", "0.4923146", "0.49151704", "0.49139106", "0.49135342", "0.49076158" ]
0.65378135
1
Get an enumeration of this array.
public Enumeration<klasse> elements() { compress(); EN = 0; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public E output(int i) {\n return EnumMultiset.this.enumConstants[i];\n }", "protected String getEnumeration()\n {\n return enumeration;\n }", "public com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum getImeModeArray(int i)\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(IMEMODE$0, i);\r\n if (target == null)\r\n {\r\n throw new IndexOutOfBoundsException();\r\n }\r\n return (com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum)target.getEnumValue();\r\n }\r\n }", "Enumeration createEnumeration();", "public Integer[] enumProperty() {\n return null;\n }", "public IotaEnum getIotaEnum() {\n return _iotaEnum ;\n }", "public String getElement()\n {\n return \"enum\";\n }", "public List<Object> getEnum() {\n\t\treturn enumField;\n\t}", "E[] getCachedEnumValues();", "public com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum[] getImeModeArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(IMEMODE$0, targetList);\r\n com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum[] result = new com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum[targetList.size()];\r\n for (int i = 0, len = targetList.size() ; i < len ; i++)\r\n result[i] = (com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum)((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getEnumValue();\r\n return result;\r\n }\r\n }", "public String getEnum() {\n if (model == null)\n return strEnum;\n return model.getEnum();\n }", "public Iterator<E> elementIterator() {\n return new EnumMultiset<E>.Itr<E>() {\n /* access modifiers changed from: package-private */\n public E output(int i) {\n return EnumMultiset.this.enumConstants[i];\n }\n };\n }", "public com.yahoo.xpathproto.TransformTestProtos.MessageEnum getEnumValue() {\n return enumValue_;\n }", "protected EnumSyntax[] getEnumValueTable() {\n/* 206 */ return (EnumSyntax[])myEnumValueTable;\n/* */ }", "public com.yahoo.xpathproto.TransformTestProtos.MessageEnum getEnumValue() {\n return enumValue_;\n }", "public static Enum forInt(int i)\r\n { return (Enum)table.forInt(i); }", "public static Enum forInt(int i)\n { return (Enum)table.forInt(i); }", "public BasicAttributesGrammarAccess.EnumerationElementElements getEnumerationElementAccess() {\n\t\treturn gaBasicAttributes.getEnumerationElementAccess();\n\t}", "public static Enum forInt(int i)\n { return (Enum)table.forInt(i); }", "public static Enum forInt(int i)\n { return (Enum)table.forInt(i); }", "public static Enum forInt(int i)\n { return (Enum)table.forInt(i); }", "public static Enum forInt(int i)\n { return (Enum)table.forInt(i); }", "Rule EnumValue() {\n return Sequence(\n Identifier(),\n Optional(EnumConst()),\n Optional(ListSeparator()),\n WhiteSpace(),\n actions.pushEnumValueNode());\n }", "public org.hl7.fhir.CodeableConcept getEventArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.CodeableConcept target = null;\n target = (org.hl7.fhir.CodeableConcept)get_store().find_element_user(EVENT$0, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return target;\n }\n }", "public EnumBase realResultEnum() {\n return realResultEnum;\r\n }", "EEnum createEEnum();", "public static java.util.Enumeration enumerate() {\n return _memberTable.elements();\n }", "public ArrayType getType() {\n\tif (this.arrayType == null) {\n\t // lazy init must be thread-safe for readers\n\t synchronized (this) {\n\t\tif (this.arrayType == null) {\n\t\t preLazyInit();\n\t\t this.arrayType = this.ast.newArrayType(this.ast.newPrimitiveType(PrimitiveType.INT));\n\t\t postLazyInit(this.arrayType, TYPE_PROPERTY);\n\t\t}\n\t }\n\t}\n\treturn this.arrayType;\n }", "gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type.Value.Enum getValue();", "public KeyEnum getKeyEnum() {\n return this.key;\n }", "public SideEnumElements getSideEnumAccess() {\r\n\t\treturn eSideEnum;\r\n\t}", "com.yahoo.xpathproto.TransformTestProtos.MessageEnum getEnumValue();", "public static EnumType func_176879_a(int p_176879_0_) {\n/* */ if (p_176879_0_ < 0 || p_176879_0_ >= field_176885_g.length) {\n/* */ p_176879_0_ = 0;\n/* */ }\n/* */ return field_176885_g[p_176879_0_];\n/* */ }", "Enumerator getDirection();", "EnumRef createEnumRef();", "public int[] getType() {\n return (type);\n }", "public static TasklistEnum enumOf(int i) {\n\t\t\tfor (TasklistEnum enumType : TasklistEnum.values()) {\n\t\t\t\tif (enumType.index == i) {\n\t\t\t\t\treturn enumType;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "public BoundCodeDt<DataTypeEnum> getCodeElement() { \n\t\tif (myCode == null) {\n\t\t\tmyCode = new BoundCodeDt<DataTypeEnum>(DataTypeEnum.VALUESET_BINDER);\n\t\t}\n\t\treturn myCode;\n\t}", "Enum getType();", "EEnumLiteral createEEnumLiteral();", "public E[] getArray() {\n return this.array;\n }", "IArray getArrayNext() throws InvalidRangeException;", "public Enumeration getElements() {\r\n return elements.elements();\r\n }", "public com.microsoft.schemas.xrm._2011.metadata.ImeMode xgetImeModeArray(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.microsoft.schemas.xrm._2011.metadata.ImeMode target = null;\r\n target = (com.microsoft.schemas.xrm._2011.metadata.ImeMode)get_store().find_element_user(IMEMODE$0, i);\r\n if (target == null)\r\n {\r\n throw new IndexOutOfBoundsException();\r\n }\r\n return target;\r\n }\r\n }", "private C getColumnEnum( final Class<C> enumClass, final int index ) { return enumClass.cast( fColumnEnums[ index ] ); }", "public org.ccsds.moims.mo.mal.structures.Element createElement()\n {\n return _ENUMERATIONS[0];\n }", "public static BendType toEnum(int val) {\r\n\t\t\ttry {\r\n\t\t\t\treturn values()[val - 1];\r\n\t\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}", "public List<VariableElement> getEnumConstants() {\n if (isEnum() == false) {\n throw new IllegalStateException();\n }\n TypeElement decl = (TypeElement) element;\n List<VariableElement> results = new ArrayList<>();\n for (Element member : decl.getEnclosedElements()) {\n if (isEnumConstant(member)) {\n results.add((VariableElement) member);\n }\n }\n return results;\n }", "public Enumeration elements();", "public Enum<?> asEnum() throws ClassNotFoundException {\n if (!isEnumConstant()) {\n throw new IllegalStateException(\"not an enum\");\n }\n @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n Enum<?> ret = Enum.valueOf(\n (Class<? extends Enum>) getDeclaringClass().asClass(), getName());\n return ret;\n }", "public com.walgreens.rxit.ch.cda.StrucDocTable.Frame.Enum getFrame()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(FRAME$24);\n if (target == null)\n {\n return null;\n }\n return (com.walgreens.rxit.ch.cda.StrucDocTable.Frame.Enum)target.getEnumValue();\n }\n }", "public TypeEnum getType() {\n return type;\n }", "public Enumeration elements() {\n return new MRUEnumeration(_hash.elements());\n }", "public static DynamicEnumerationMenu get() {\n if (instance == null) {\n instance = new DynamicEnumerationMenu();\n }\n return instance;\n }", "public Class<? extends Enum<?>> getEnumClass() {\n\t\treturn enumClass;\n\t}", "public Index getIndex() {\n return this.arr.getIndex();\n }", "public static Direction getEnum(int index) {\r\n\t\treturn directionIndexMap.get(index);\r\n\t}", "public List<Enum<?>> enums()\n/* */ {\n/* 92 */ return Arrays.asList(this._values);\n/* */ }", "public JType elementType() {\n throw new IllegalArgumentException(\"Not an array type\");\n }", "public org.hl7.fhir.CodeableConcept[] getEventArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(EVENT$0, targetList);\n org.hl7.fhir.CodeableConcept[] result = new org.hl7.fhir.CodeableConcept[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "public Cell getEnumCell() {\n\n\t\tString player = getNextPlayer();\n\n\t\tCell value;\n\n\t\tif(player.equals(\"X\"))\n\t\t\tvalue = Cell.X;\n\n\t\telse\n\t\t\tvalue = Cell.O;\n\n\t\treturn value;\n\t}", "public Object getValue()\n {\n Object[] a = (Object[]) getArray().getValue();\n int i = ((Number) getIndex().getValue()).intValue();\n\n return a[i];\n }", "public Multiset.Entry<E> output(final int i) {\n return new Multisets.AbstractEntry<E>() {\n public E getElement() {\n return EnumMultiset.this.enumConstants[i];\n }\n\n public int getCount() {\n return EnumMultiset.this.counts[i];\n }\n };\n }", "public Enum getType() {\n return type;\n }", "public Enumeration elements() {\n\t\treturn new ValuesEnumeration(values);\n\t}", "public static EnumDomain createEnumDomain() {\n\t\treturn new EnumDomain(new String[]{\"1\", \"2\", \"3\"});\n\t}", "@Nonnull\n public AnyType getArrayType() {\n return arrayType;\n }", "public static SheetTraitEnum get(String literal) {\r\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\r\n\t\t\tSheetTraitEnum result = VALUES_ARRAY[i];\r\n\t\t\tif (result.toString().equals(literal)) {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "int getValue() {\r\n switch (this) {\r\n case Boolean:\r\n return BOOLEAN;\r\n case Number:\r\n return NUMBER;\r\n case Array:\r\n return ARRAY;\r\n default:\r\n return STRING;\r\n }\r\n }", "public abstract Enumeration elements();", "@javax.annotation.Nullable\n public TypeEnum getType() {\n return type;\n }", "public net.opengis.gml.x32.CoordinateSystemAxisPropertyType getAxisArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n net.opengis.gml.x32.CoordinateSystemAxisPropertyType target = null;\n target = (net.opengis.gml.x32.CoordinateSystemAxisPropertyType)get_store().find_element_user(AXIS$1, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return target;\n }\n }", "Enumeration getIds();", "IArray getArrayCurrent() throws InvalidRangeException;", "public boolean isEnum() {\n return cut.isEnum();\n }", "public static SheetTraitEnum getByName(String name) {\r\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\r\n\t\t\tSheetTraitEnum result = VALUES_ARRAY[i];\r\n\t\t\tif (result.getName().equals(name)) {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "E get(int i) {\r\n @SuppressWarnings(\"unchecked\")\r\n final E e = (E)arr[i];\r\n return e;\r\n }", "public boolean isEnumerated() {\r\n return enumerated;\r\n }", "EnumValue createEnumValue();", "EnumValue createEnumValue();", "EnumValue createEnumValue();", "public Enumerated[] getNamedNumbers()\n {\n\treturn cNamedNumbers;\n }", "public boolean isEnumerated() {\n return enumerated;\n }", "public Iterator<T> iterator() {\r\n return new ArrayIterator(elements, size);\r\n }", "EnumConstant createEnumConstant();", "public abstract Enum<?> getType();", "public ArrayGetByte()\n {\n super(\"ArrayGetByte\");\n }", "public CWE[] getIndication() {\r\n \tCWE[] retVal = this.getTypedField(19, new CWE[0]);\r\n \treturn retVal;\r\n }", "com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType getArrayOfFaultTypeArray(int i);", "public ArrayIntListIterator iterator() {\n\t return new ArrayIntListIterator(this);\n\t }", "public Object getArray() {\n\t\treturn array;\n\t}", "public EnumTypeOperation getTypeOperation() {\r\n return TypeOperation;\r\n }", "public IClass getType() {\n IClass result = null;\n if (_javaMethod.getReturnType().isArray()) {\n result = new ArrayDef(new ExternalClass(_javaMethod.getReturnType().getComponentType()));\n }\n else {\n result = new ExternalClass(_javaMethod.getReturnType());\n }\n\n return result;\n }", "public XSSimpleType getItemType() {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 0: laload \n // 1: aastore \n // 2: dadd \n // 3: imul \n // 4: lsub \n // 5: ldiv \n // 6: ladd \n // 7: aastore \n // 8: lsub \n // 9: ineg \n // LocalVariableTable:\n // Start Length Slot Name Signature\n // ----- ------ ---- ---- ------------------------------------------\n // 0 10 0 this Lcom/sun/xml/xsom/impl/ListSimpleTypeImpl;\n // \n // The error that occurred was:\n // \n // java.lang.ArrayIndexOutOfBoundsException\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "public EnumPositioner getLensEnum() {\n\t\treturn lensEnum;\n\t}", "public int toInt() {\n return this.toIntArray()[0];\n }", "@Override\n\tpublic <T extends Enum<T>> T getAsEnum(final String key, final Class<T> eClass)\n\t{\n\t\treturn this.getEnumImpl(key, eClass, (T)null);\n\t}", "com.unitedtote.schema.totelink._2008._06.program.ExchangeWagers.Enum getExchange();", "EnumOperationType getOperationType();", "public org.openarchives.www.oai._2_0.OAIPMHerrorcodeType.Enum getCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CODE$0);\n if (target == null)\n {\n return null;\n }\n return (org.openarchives.www.oai._2_0.OAIPMHerrorcodeType.Enum)target.getEnumValue();\n }\n }" ]
[ "0.6522127", "0.63263184", "0.622976", "0.6189847", "0.6134288", "0.612602", "0.6106363", "0.60650164", "0.59970975", "0.5951702", "0.59332937", "0.5900151", "0.5886304", "0.58852834", "0.5882364", "0.583674", "0.5802216", "0.57978195", "0.57956284", "0.579186", "0.579186", "0.579186", "0.57690984", "0.5724253", "0.57107335", "0.569611", "0.556567", "0.55579954", "0.55560756", "0.55526334", "0.55466324", "0.55369586", "0.546996", "0.5409481", "0.54033655", "0.540014", "0.53879243", "0.53626263", "0.53492194", "0.5331752", "0.53263843", "0.5317592", "0.530492", "0.5288542", "0.5279522", "0.5268584", "0.52558964", "0.52529883", "0.5251595", "0.5248407", "0.52418345", "0.5229589", "0.52156967", "0.5211801", "0.5199397", "0.5190083", "0.5177583", "0.5177094", "0.5176214", "0.5175999", "0.5173614", "0.517121", "0.51697814", "0.51629114", "0.5148349", "0.51471454", "0.51399714", "0.5138593", "0.5135394", "0.5128743", "0.51181334", "0.5114406", "0.5089401", "0.5079782", "0.50783145", "0.5074445", "0.5072271", "0.50602627", "0.50575095", "0.50575095", "0.50575095", "0.50439906", "0.5041937", "0.50415856", "0.5037609", "0.50305736", "0.50289005", "0.50272065", "0.5026536", "0.5025263", "0.50221056", "0.50149477", "0.5009515", "0.5000839", "0.4991996", "0.49873134", "0.49788892", "0.49787992", "0.49773684", "0.49736094" ]
0.50606704
77
Clear this array, but keep its memory!
public void removeAllElements() { for (int i = 0; i < OLast; i++) O[i] = null; ON = OLast = 0; Gap = -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void clear() {\n array.reset();\n }", "@Override\n public void clear() {\n array = null;\n }", "public void clear()\n\t{\n\t\tarraySize = 0;\n\t}", "@Override\n public void clear() {\n for (int i = 0; i < this.size; i++) {\n this.data[i] = null;\n }\n\n this.size = 0;\n }", "public void clear() {\n\t \toccupied = 0;\n\t for (int i = 0; i < array.length; i++) {\n\t array[i] = null;\n\t }\n\t }", "@Override\n public void clear() {\n for (int i = 0; i < size; i++) {\n data[i] = null;\n }\n size = 0;\n }", "public final void clear() {\r\n\t\t// Let gc do its work\r\n\t\tfor (int i = this.size - 1; i >= 0; --i) {\r\n\t\t\tthis.elementData[i] = null;\r\n\t\t}\r\n\t\tthis.size = 0;\r\n\t}", "@Override\n public void Clear() {\n for (int i = 0; i < array.size(); i++) {\n array.remove(i);\n\n }//Fin del for\n }", "@Override\r\n public void clear() {\r\n \r\n this.array = new LinkedList[capacity];\r\n \r\n this.size = 0;\r\n \r\n }", "private void doClear( )\n {\n occupied = 0;\n for( int i = 0; i < array.length; i++ )\n array[ i ] = null;\n }", "@Override\n\tpublic void clear() \n\t{\n\t\twhile (size!=0)\n\t\t{\n\t\t\t//to check if need to resize\n\t\t\tif(size==myArray.length/4)\n\t\t\t\tresizeDown();\n\t\t\tmyArray[size-1] = null;\n\t\t\tsize--;\n\t\t}\n\t\tsize=0;\n\t}", "public void clear()\n\t{\n\t\tfor (int i = 0; i < data.length; i++)\n\t\t{\n\t\t\tdata[i] = 0;\n\t\t}\n\t}", "public void clear(){\r\n currentSize = 0;\r\n }", "public final void clear() {\n for (int i = 0; i < _length; i++) {\n _data[i * SIZE + VALUE_OFFSET] = null;\n _algorithmData[i] = null;\n }\n _length = 0;\n }", "public void clear() {\n\t\tcurrentSize = 0;\n\t}", "public void clear() {\n\t\tthis.size = 0;\n\t\tthis.elements = new Object[capacity];\n\t}", "public void clear() {\r\n\t\tsize = 0;\r\n\t}", "@Override\n @SuppressWarnings(\"unchecked\")\n public void clear() {\n @SuppressWarnings(\"Not Checked\")\n E[] newArray = (E[])new Comparable[super.capacity()];\n array = newArray;\n size = 0;\n front = 0;\n end = 0;\n }", "@Override\n public void clear() {\n capacity = 15;\n currentSize = 0;\n this.container = new Object[capacity];\n }", "@Override\n public boolean clear() {\n this.array = (T[]) new Object[10];\n this.length = 10;\n this.size = 0;\n return true;\n }", "@Override\n public void clear() {\n size = 0;\n first = null;\n last = null;\n }", "@Override\n public void clear() {\n wordsArray = new String[0];\n }", "public void clear() {\n size = 0;\n }", "@Override\n public void clear() {\n size = 0;\n storage = null;\n }", "public void clear() {\r\n items = Arrays.copyOf(new int[items.length], items.length);\r\n NumItems = 0;\r\n }", "public void clear()\n {\n current = null;\n size = 0;\n }", "public void clear() {\n size = 0;\n Arrays.fill(items, null);\n }", "@Override\n public void clear() {\n size = 0;\n }", "@Override\n public void clear() {\n size = 0;\n }", "@Override\n public void clear() {\n size = 0;\n }", "void clear(){\n this.queueArray = (T[]) new Object[0];\n this.tail = 0;\n }", "public void clear() {\r\n\t\tdata.clear();\r\n\r\n\t}", "@Override\n\tpublic void clear() {\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\telements[i] = null;\n\t\t}\n\n\t\tsize = 0;\n\t}", "public void clear() {\n this.data().clear();\n }", "public void clear()\n \t{\n \t\tint byteLength = getLengthInBytes();\n \t\tfor (int ix=0; ix < byteLength; ix++)\n value[ix] = 0;\n \t}", "@Override\n\tpublic void clear() {\n\t\tdata=(E[])new Object[DEFAULT_CAPACITY];\n\t\tsize=0;\n\t\trear=0;\n\t\tfront=0;\n\t}", "public void clear(){\n\t\tclear(0);\n\t}", "public void clear()\r\n {\r\n for (int i = 0; i < values.length; i++)\r\n keys[i] = null;\r\n size = 0;\r\n }", "public void clear() {\n\t\tbufferLast = 0;\n\t\tbufferIndex = 0;\n\t}", "public void removeAll() {\n this.arrayList = null;\n this.arrayList = new ArrayList<>();\n }", "public void clear() {\n\t\telements = 0;\n\t\tfor (int ix = 0; ix < keys.length; ix++) {\n\t\t\tkeys[ix] = null;\n\t\t\tvalues[ix] = null;\n\t\t}\n\t\tfreecells = values.length;\n\t\tmodCount++;\n\t}", "public void clear(){\n\t\tif(this.isUpgraded){\n\t\t\tthis.linkArray.clear();\n\t\t\tthis.isUpgraded = false;\n\t\t}\n\n\t\tthis.nativeArray.clear();\n\t}", "public synchronized void clear()\n {\n clear(false);\n }", "public final void clear()\n {\n this.pointer = 0;\n }", "public void clear() {\n\n\t\tdata = null;\n\t\tnumRows = 0;\n\t\tnumCols = 0;\n\t\tsize = 0L;\n\n\t}", "public void clear() {\n\t\tthis.sizeinbits = 0;\n\t\tthis.actualsizeinwords = 1;\n\t\tthis.rlw.position = 0;\n\t\t// buffer is not fully cleared but any new set operations should\n\t\t// overwrite stale data\n\t\tthis.buffer[0] = 0;\n\t}", "public void clean() {\n\t\tbufferSize = 0;\n\t\tbuffer = new Object[Consts.N_ELEMENTS_FACTORY];\n\t}", "public void clear() {\n this.first = null;\n this.last = null;\n this.nrOfElements = 0;\n }", "public void clear(){\n\t\tfor(int i = 0; i < keys.length; i++){\n\t\t\tkeys[i] = null;\n\t\t\telem[i] = null;\n\t\t}\n\t\thowMany = 0;\n\t\tnewestIndex = -1;\n\t}", "public final void clear() {\n clear(true);\n }", "public void clear() {\n\t\tthis.set.clear();\n\t\tthis.size = 0;\n\t}", "public void clear() {\n cache = new BigDecimal[cache.length];\n }", "public void clear() {\r\n\t\t//this method clears all the arrays and initiallizes them to 0.\r\n Arrays.fill(co,0);\r\n Arrays.fill(degree,0); \r\n Arrays.fill(sinc,0); \r\n Arrays.fill(sind,0); \r\n Arrays.fill(cosc,0); \r\n Arrays.fill(cosd,0); \r\n Arrays.fill(tanc,0); \r\n Arrays.fill(tand,0);\r\n cindex = 0;\r\n sinindex = 0;\r\n cosindex = 0;\r\n tanindex = 0; \r\n\t}", "public void clear()\n {\n this.buckets = new Object[this.capacity];\n this.size = 0;\n }", "public void clear ()\n {\n for (int index = 0; index <= lastIndex; index++)\n {\n vertices[index] = null;\n adjacencySequences[index] = null;\n }\n lastIndex = -1;\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void clear( )\r\n\t{\r\n\t\tfor (int i =0; i< this.tableSize; i++)\r\n\t\t\t{ ((LinkedArrays<T>) table[i]).clear(); }\r\n\t\tthis.size = 0; \r\n\t\t\r\n\t}", "public void clear() {\n this.init(buffer.length);\n }", "public void clear() {\n\t members = 0;\n\t dense[0] = -1;\n\t}", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear() {\n\t\tint index = 0;\r\n\t\tsize = 0;\r\n\t\twhile (index < K.length) {\r\n\t\t\tif (K[index] != null) {\r\n\t\t\t\tK[index].clear();\r\n\t\t\t\tV[index].clear();\r\n\t\t\t}\r\n\t\t\tindex++;\r\n\t\t}\r\n\t}", "public void clear() {\n list = new Object[MIN_CAPACITY];\n n = 0;\n }", "public void clear()\n\t{\n\t\t_totalMsgsPerSec = 0;\n\t\t_latencyMsgsPerSec = 0;\n\t\t_ticksPerSec = 0;\n\t\t_arrayCount = 0;\n\t}", "public void clearTagArray(){\n\t\t\n\t\ttagArray.clear();\n\t\t\n\t}", "private void clearData() {}", "public void clear()\n {\n Arrays.fill(data, clearColor);\n }", "public void clear() {\n for (int i = 0; i < size; i++) genericArrayList[i] = null;\n size = 0;\n }", "public void clear() {\n doClear( false );\n }", "@Override\n public void clear() {\n elements.clear();\n indexByElement.clear();\n }" ]
[ "0.85122997", "0.8298667", "0.82131964", "0.780934", "0.7797042", "0.7787704", "0.7693049", "0.7661516", "0.761083", "0.75804037", "0.7580362", "0.75784683", "0.75706446", "0.75382495", "0.7529827", "0.7504896", "0.7503417", "0.74871385", "0.7461587", "0.7442315", "0.7383601", "0.73810583", "0.7373247", "0.73712844", "0.7362893", "0.73570836", "0.73546404", "0.73484814", "0.73484814", "0.73484814", "0.73409605", "0.7323828", "0.72935635", "0.7286659", "0.72751796", "0.7254749", "0.72375864", "0.7204176", "0.72016585", "0.7187933", "0.717313", "0.71525997", "0.71388906", "0.71283585", "0.7106718", "0.70995843", "0.70961046", "0.70917875", "0.70812154", "0.70594084", "0.70517653", "0.70171225", "0.7006964", "0.69956905", "0.6955909", "0.69534165", "0.694309", "0.6928771", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.6922378", "0.69184005", "0.6916427", "0.6914285", "0.6909434", "0.6898873", "0.6897664", "0.6897013", "0.6891163", "0.68846333" ]
0.0
-1
Remove a single element. This will also compress the part below the element, or all, if it is not found.
public void removeElement(klasse o) { int i = indexOf(o); if (i < 0) return; O[i] = null; ON--; if (Gap < 0 || Gap > i) Gap = i; if (i == OLast - 1) OLast--; while (OLast > 0 && O[OLast - 1] == null) OLast--; if (Gap >= OLast) Gap = -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "E remove(E element) {\n\t\t\tshort index = (short)((element.hashCode() >> 24) & 0x000000FF);\n\t\t\tE obj = nodes[index].remove(this, element.hashCode(), (byte) 1);\n\t\t\tif (obj != null) {\n\t\t\t\tsize--;\n\t\t\t}\n\t\t\treturn obj;\n\t\t}", "public T remove (T element);", "public T remove(T element) throws EmptyCollectionException, ElementNotFoundException;", "public E removeFirst();", "Object removeFirst();", "public void remove(T element);", "public T removeFirst();", "@Override\n public Item removeFirst() {\n nextFirst = moveForward(nextFirst, 1);\n Item output = items[nextFirst];\n items[nextFirst] = null;\n size -= 1;\n return output;\n }", "public boolean remove(ElementType element){\n if(this.find(element)==-1){\n return false;\n }\n elements[this.find(element)]=elements[size-1];\n size--;\n return true;\n }", "public T removeFirst() {\n if (size == 0) {\n return null;\n }\n nextFirst = plusOne(nextFirst);\n size -= 1;\n T toRemove = items[nextFirst];\n items[nextFirst] = null;\n if (isSparse()) {\n resize(capacity / 2);\n }\n return toRemove;\n }", "public E removeFirst() {\n if(isEmpty()){\n return null;\n }else{\n return remove(header.getNext());\n }\n }", "public void removeElement(ThingNode element)\n\t{\n\t\tsuper.removeElement(element);\n\t\telements.remove(element);\n\t}", "public E remove () throws NoSuchElementException;", "boolean remove(String elementId);", "private void removeHiElement(Element p_element)\n {\n Element parent = p_element.getParent();\n int index = parent.indexOf(p_element);\n\n // We copy the current content, clear out the parent, and then\n // re-add the old content, inserting the <hi>'s content\n // instead of the <hi>.\n\n ArrayList newContent = new ArrayList();\n List content = parent.content();\n\n for (int i = content.size() - 1; i >= 0; --i)\n {\n Node node = (Node)content.get(i);\n\n newContent.add(node.detach());\n }\n\n Collections.reverse(newContent);\n parent.clearContent();\n\n for (int i = 0, max = newContent.size(); i < max; ++i)\n {\n Node node = (Node)newContent.get(i);\n\n if (i == index)\n {\n parent.appendContent(p_element);\n }\n else\n {\n parent.add(node);\n }\n }\n }", "private final void fastRemove(final int index) {\r\n\t\tfinal int numMoved = this.size - index - 1;\r\n\t\tif (numMoved > 0) {\r\n\t\t\tSystem.arraycopy( this.elementData, index + 1, this.elementData, index, numMoved );\r\n\t\t}\r\n\t\tthis.elementData[--this.size] = null; // Let gc do its work\r\n\t}", "@Override\n public T removeFirst() {\n if (size == 0) {\n return null;\n }\n\n int position = plusOne(nextFirst);\n T itemToReturn = array[position];\n array[position] = null;\n nextFirst = position;\n size -= 1;\n\n if ((double)size / array.length < 0.25 && array.length >= 16) {\n resize(array.length / 2);\n }\n return itemToReturn;\n }", "public final void removeFirst() {\n this.size--;\n setFirst((Node) ((Node) get()).get());\n }", "Object remove();", "@Override\r\n\tpublic E removeFirst() {\n\t\treturn null;\r\n\t}", "public T removeFirst( ){\r\n\t\t//calls remove onfirst\r\n\t\tT toRemove = getFirst();\r\n\t\treturn remove(toRemove);\r\n\t}", "public E removeLast() {\n\t\t// low-level methods should be efficient - don't call other rmv()\n\t\tif (mSize == 0)\n\t\t\tthrow new NoSuchElementException();\n\n\t\tE retVal = remove(getNode(size() - 1));\n\n\t\tmSize--;\n\t\tmodCount++;\n\n\t\treturn retVal;\n\t}", "public boolean remove(T element, Point2D pos);", "@Override\n public boolean remove(final Object element) {\n for (int i = 0; i < size; i++) {\n if (this.checkIfEqual(element, i)) {\n this.shiftRemove(i);\n return true;\n }\n }\n\n return false;\n }", "public E removeFirst() {\n return pop();\n }", "public static void borrarElement(Element element) throws Exception {\n\t\tEntityManager em = JPA.em();\n\t\tElementPK pk = new ElementPK();\n\t\tpk.setCodi(element.codi);\n\t\tpk.setComunitat(element.comunitat.nif);\n\t\tElement actorToBeRemoved = em.find(Element.class, pk);\n\n\t\ttry {\n\t\t\tem.remove(actorToBeRemoved);\n\t\t\tem.flush();\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t}\n\t}", "public E removeFirst() {\n\n\t\tif (mSize == 0)\n\t\t\tthrow new NoSuchElementException();\n\n\t\tE retVal = remove(mHead.next);\n\n\t\tmSize--;\n\t\tmodCount++;\n\n\t\treturn retVal;\n\t}", "@Override\n public E remove() {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n size--;\n array[0] = swap(array[size], array[size] = array[0]);\n siftDown(0);\n return (E) array[size];\n }", "public T removeFirst() {\n if (size == 0) {\n return null;\n }\n if (size == 1) {\n size--;\n return array[front];\n }\n this.checkReSizeDown();\n size--;\n front++;\n this.updatePointer();\n return array[Math.floorMod(front - 1, array.length)];\n }", "private static void deleteElement(RubyProjectElement element) {\r\n \t\tRubyProject projectInternal = element.getRubyProjectInternal();\r\n \t\tprojectInternal.getRubyElementsInternal().remove(element);\r\n \r\n deleteResource(element); \r\n \t}", "public synchronized Object removeFirstElement() {\n return _queue.remove(0);\n }", "@Override\n public E removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n E value = dequeue[head];\n dequeue[head] = null;\n head = ++head % dequeue.length;\n size--;\n if (size < dequeue.length / 2) {\n reduce();\n }\n return value;\n }", "public E remove(int index) {\n\t\t// Code from Project 3\n\t\tE removed;\n\t\tif (index < 0 || index >= size()) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\t// Last element of list or list contain only 1 element\n\t\tif (index == size - 1) {\n\t\t\tremoved = elements[size - 1];\n\t\t\telements[size - 1] = null;\n\t\t\tsize--;\n\t\t\treturn (E) removed;\n\t\t} else {\n\t\t\t// remove mid or first element\n\t\t\tremoved = elements[index];\n\t\t\tfor (int i = index; i < size; i++) {\n\t\t\t\telements[i] = elements[i + 1];\n\t\t\t}\n\t\t\telements[size - 1] = null;\n\t\t\tsize--;\n\t\t\treturn (E) removed;\n\t\t}\n\t}", "@Override\n\tpublic void remove(Element e) {\n\t\t\n\t}", "public void removeElement(SvgElement element) {\n Objects.requireNonNull(element);\n if (children.contains(element)) {\n children.remove(element);\n updateChildrenAttribute();\n }\n }", "public E removeFirst() {\n\t\t// Bitte fertig ausprogrammieren:\n\t\treturn null;\n\t}", "public Item removeFirst() {\n if (first == null)\n throw new NoSuchElementException();\n \n final Item element = first.item;\n final Node<Item> next = first.next;\n first.item = null;\n first.next = null; // help GC\n first = next;\n if (next == null)\n last = null;\n else\n next.prev = null;\n size--;\n \n return element;\n }", "public E remove(int i) {\n\t /*\n\t * Add code here.\n\t * Remember to compact the array so there are no spaces in between\n\t * if an element from the middle is removed or an element at the\n\t * beginning of the array is removed.\n\t */\n\t\t if(i<=num_elements){\n\t\t\t E removed_element= elements[i];\n\t\t for(int r=i;r<num_elements;r++){\n\t\t\t elements[r] = elements[r+1];\n\t\t }\n\t\t \tnum_elements --;\n\t\t return removed_element;\n\t\t }\n\t return null;\n\t }", "boolean remove(T element);", "public void remove(int index) {\n\t\t\tcheckIndex(index);\n\t\t\tfor(int i = index; i < size - 1; i++) {\n\t\t\t\telementData[i] = elementData[i + 1];\n\t\t\t}\n\t\t}", "public Object remove();", "private void removeSubElement(Element p_element)\n {\n Element parent = p_element.getParent();\n int index = parent.indexOf(p_element);\n\n // We copy the current content, clear out the parent, and then\n // re-add the old content, inserting the <sub>'s textual\n // content instead of the <sub> (this clears any embedded TMX\n // tags in the subflow).\n\n ArrayList newContent = new ArrayList();\n List content = parent.content();\n\n for (int i = content.size() - 1; i >= 0; --i)\n {\n Node node = (Node)content.get(i);\n\n newContent.add(node.detach());\n }\n\n Collections.reverse(newContent);\n parent.clearContent();\n\n for (int i = 0, max = newContent.size(); i < max; ++i)\n {\n Node node = (Node)newContent.get(i);\n\n if (i == index)\n {\n parent.addText(p_element.getText());\n }\n else\n {\n parent.add(node);\n }\n }\n }", "public E remove();", "public E remove();", "public void removeAll(Object element);", "public Object removeFirst() {\r\n Object first = header.next.element;\r\n remove(header.next);\r\n return first;\r\n }", "public T remove() {\r\n \r\n if (this.isEmpty()) {\r\n return null;\r\n }\r\n \r\n Random r = new Random();\r\n // Randomly selects element to remove and stores in rValue.\r\n int rValue = r.nextInt(size);\r\n // Store removed element in remove\r\n T remove = elements[rValue];\r\n elements[rValue] = null;\r\n \r\n // Move last element to replace \"remove\" if \"remove\" is not last element\r\n if (rValue != (size - 1)) {\r\n elements[rValue] = elements[size - 1];\r\n elements[size - 1] = null;\r\n }\r\n size--;\r\n // If array is less than 25% full, resize to 1/2 of current size.\r\n if (size > 0 && size < elements.length / 4) {\r\n resize(elements.length / 2);\r\n }\r\n return remove;\r\n }", "public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n Item item = first.item;\n first = first.next;\n if (first == null) {\n last = null;\n }\n else {\n first.pre = null;\n }\n len--;\n return item;\n }", "public T removeFirst() {\r\n \r\n if (size == 0) {\r\n return null;\r\n }\r\n \r\n T deleted = front.element;\r\n front = front.next;\r\n size--;\r\n \r\n return deleted;\r\n }", "public T removeFirst()\r\n {\r\n T removedData; // holds data from removed node\r\n\r\n if (numElements == 0)\r\n throw new NoSuchElementException(\r\n \"Remove attempted on empty list\\n\");\r\n removedData = front.data;\r\n front = front.next;\r\n if (numElements == 1)\r\n rear = null;\r\n \r\n numElements--;\r\n return removedData;\r\n }", "public T removeFirst() throws EmptyCollectionException;", "public void remove(T element) throws Exception {\r\n\tif(isEmpty()) throw new Exception(\"Remove attempted on empty list\");\r\n\tif(trailer.getInfo() == element) removeLast();\r\n\tboolean found = false;\r\n\tDLLNode<T> temp = header;\r\n\twhile(temp != null) {\r\n\t\tif (temp.getInfo().equals(element)) {\r\n\t\t\ttemp.getBack().setLink(temp.getLink());\r\n\t\t\t((DLLNode<T>) temp.getLink()).setBack(temp.getBack());\r\n\t\t\tfound = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\ttemp = temp.getBack();\r\n\t}\r\n\tif (!found) throw new Exception(\"Could not find element\");\r\n}", "void remove (int offset, int size);", "public void removeFirst() \r\n\t{\r\n\t\tint position = 1;\r\n\t\tif ( this.isEmpty() || position > numItems || position < 1 )\r\n\t\t{\r\n\t\t\tSystem.out.print(\"This delete can not be performed \"+ \"an element at position \" + position + \" does not exist \" );\r\n\t\t}\r\n\t\tfor (int i=position-1; i< numItems-1; i++)\r\n\t\t\tthis.bookArray[i] = this.bookArray[i+1];\r\n\t\t\tthis.bookArray[numItems-1] = null;\r\n\t\t\tnumItems--;\r\n\t\t\tSystem.out.println(\"DELETED first book from the Array \\n\");\r\n\t\t\r\n\t\t\treturn ;\r\n\t}", "public E remove(int index) {\n if(index > size) return null;\n E element = null;\n for(int i = index+1; i < size; i++) {\n list[i-1] = list[i];\n }\n list[size-1] = null;\n size--;\n return element;\n }", "@Override\n public synchronized E remove(int index) {\n E result = this.get(index);\n if (index < this.size() - 1) {\n System.arraycopy(this.container, index + 1, this.container, index, this.size() - (index + 1));\n }\n this.container[--this.pointer] = null;\n return result;\n }", "public void remove(int element) {\r\n\t\tint i = find(element);\r\n\t\tlist[i] = -1;\r\n\t\tinsertionSort(list);\r\n\t\tcurrentPosition = i;\r\n\t}", "public E remove(int index)\n {\n if (index >= 0 && index < size) {\n E temp = data[index]; // element to return\n\n // shift all elements to the right down by 1 index\n for (int i = index; i < size - 1; i++)\n data[i] = data[i+1];\n \n size--;\n return temp;\n } else\n throw new NoSuchElementException();\n }", "private static void deleteElement(ProjectElement element) {\r\n \t\tProject projectInternal = element.getProjectInternal();\r\n projectInternal.getElementsInternal().remove(element);\r\n \r\n deleteResource(element); \r\n \r\n projectInternal.eResource().setModified(true);\r\n \t}", "public U remove(U x){\r\n\t \tif (x==null)\r\n\t \t\tthrow new IllegalArgumentException(\"x cannot be null\");\r\n\t \t//find index\r\n\t \tint i = Arrays.binarySearch(array,0, getArraySize(), x);\r\n\t \t//x not found in array\r\n\t \tif (i<0)\r\n\t \t\treturn null;\r\n\t \t//store current element\r\n\t \t@SuppressWarnings(\"unchecked\")\r\n\t\t\tU data = (U) array[i];\r\n\t \t//enter loop\r\n\t \twhile(i<numElems-1){\r\n\t \t\t//move element left\r\n\t \t\tarray[i]= array[i+1];\r\n\t \t\ti++;\r\n\t \t}\r\n\r\n\t \t//Not sure if needed: set last element to null after shift\r\n\t \tarray[numElems-1] = null;\r\n\t \tnumElems--;\r\n\t \treturn data;\r\n\t \t\r\n\t }", "public Item removeFirst() {\n if (size == 0) {\n return null;\n } else if (size == 1) {\n StuffNode i = sentinel.next;\n sentinel.next = sentinel;\n sentinel.prev = sentinel;\n size -= 1;\n return i.item;\n } else {\n StuffNode i = sentinel.next;\n sentinel.next = i.next;\n i.next.prev = sentinel;\n size -= 1;\n return i.item;\n }\n }", "public void remove() {\n elements[index] = null;\n size--;\n next();\n }", "public E remove() {\n\t\tif (mSize == 0)\n\t\t\tthrow new NoSuchElementException();\n\n\t\tE retVal = remove(mHead.next);\n\n\t\tmSize--;\n\t\tmodCount++;\n\n\t\treturn retVal;\n\t}", "@Override\n public E remove() {\n if (size == 0){\n throw new NoSuchElementException();\n }\n E removed = heap[0];\n heap[0] = heap[--size];\n siftDown(0);\n return removed;\n }", "public Node removeFirst() {\r\n\t\treturn removeNode(0);\r\n\t}", "private E remove(){\n E tmp = array[0];\n swap(0,--lastPosition);\n array[lastPosition] = null;\n trickleDown(0);\n array = Arrays.copyOfRange(array,0,array.length);\n return tmp;\n }", "@Override\n public E remove(int index) {\n\t E first = _store[index];\n\t _store[index] = null;\n\t for( int i = index; i< _size-1;i++) {\n\t\t _store[i]=_store[i+1];\n\t }\n\t_store[_size-1]=null;\n\t _size -=1;\n\t \n\t\t \n\treturn first;\n }", "public T removeFirst(){\n\tT ret = _front.getCargo();\n\t_front = _front.getPrev();\n\t_front.setNext(null);\n\t_size--;\n\treturn ret;\n }", "public E removeFirst(){\r\n return null;\r\n }", "public E removeFirst() { // removes and returns the first element\n // TODO\n if (isEmpty( )) return null;\n Node<E> head = tail.getNext();\n if (head == tail) tail = null;\n else tail.setNext(head.getNext( ));\n size--;\n return head.getElement( );\n }", "public Item removeFirst(){\r\n\t\tif (isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\r\n\t\tItem tmp = list[first];\r\n\t\tlist[first++] = null;\r\n\t\tn--;\r\n\t\tprior=first-1;\r\n\t\tif(first==list.length){first=0;}\r\n\t\tif (n > 0 && n == list.length/4) resize(list.length/2); \r\n\t\treturn tmp;}", "public void remove();", "public void remove();", "public void remove();", "public void remove();", "public void remove();", "public HuffmanTreeNode<T> removeNext() {\r\n HuffmanTreeNode<T> deleted = super.removeElement();\r\n length--;\r\n return deleted;\r\n }", "private void removeStackElement(final StackElement elementToRemove)\n {\n // Get previous and next elements in the linked list\n final StackElement previousElement = elementToRemove.previous;\n final StackElement nextElement = elementToRemove.next;\n\n if (previousElement == null)\n {\n this.head = nextElement;\n }\n else\n {\n previousElement.next = nextElement;\n }\n\n if (nextElement == null)\n {\n this.tail = previousElement;\n }\n else\n {\n nextElement.previous = previousElement;\n }\n }", "public boolean removeElement(Object obj);", "T remove(int index);", "T remove(int index);", "private Element popElement() {\r\n return ((Element)this.elements.remove(this.elements.size() - 1));\r\n }", "public E remove(int index);", "@Override\n\t\t\tpublic void remove() {\n\t\t\t\tthrow new UnsupportedOperationException();\n//\t\t\t\tif (i == begin || removed)\n//\t\t\t\t\tthrow new IllegalStateException();\n//\t\t\t\telements.set(i-1, null);\n//\t\t\t\tremoved = true;\n\t\t\t}", "public abstract void removeElement(int id) throws PositionEX;", "public T remove (T element) throws EmptyCollectionException,\n NoSuchElementException{\n if(isEmpty()){\n throw new EmptyCollectionException(\"list\");\n }\n\n // does it exist?\n if(!contains(element)){\n throw new NoSuchElementException();\n }\n\n // is it front node?\n if(front.getElement().equals(element)){\n // remove front node\n return removeFirst();\n }\n\n // it must be in the list after the front node\n // invariables:\n // 1. we will find the node\n // 2. it must be after the front node\n // current points the node to remove\n // previous points to the node before it\n LinearNode<T> previous = front;\n LinearNode<T> current = front.getNext();\n while(current != null &&\n !current.getElement().equals(element)){\n previous = current;\n current = current.getNext();\n }\n previous.setNext(current.getNext());\n // is it the last node?\n if(rear == current){\n // update rear when removing the last node\n rear = previous;\n }\n count--;\n return current.getElement();\n }", "@Override\r\n public Object removeElement(Object key) throws ElementNotFoundException {\r\n Item item; // Item removed from tree\r\n\r\n // Find the node containing the key\r\n TFNode foundNode = findNode(key);\r\n \r\n // Check node\r\n if (foundNode == null) {\r\n throw new ElementNotFoundException(\"Key not found in tree\");\r\n }\r\n\r\n int index = FFGTE(foundNode, key);\r\n TFNode removeNode = foundNode;\r\n\r\n // If it is not a leaf\r\n if (foundNode.getChild(0) != null) {\r\n removeNode = findIoS(foundNode, key);\r\n // Replace the item to be removed with the IoS\r\n item = foundNode.replaceItem(index, removeNode.removeItem(0));\r\n } else {\r\n // Node is at a leaf, just remove the item\r\n item = foundNode.removeItem(index);\r\n }\r\n\r\n // Check and fix any underflow on removed node\r\n fixUnderflow(removeNode);\r\n\r\n // Decrement size\r\n --size;\r\n\r\n return item;\r\n }", "Form removeElement(Element element);", "public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"queue is empty\");\n }\n Item a;\n a = first.item;\n first = first.next;\n if (first == null) {\n last = null;\n }\n else first.prev = null;\n size--;\n return a;\n }", "public Item removeFirst(){\n\t\tif(isEmpty()){\n\t\t\tthrow new NoSuchElementException(\"Queue underflow\");\n\t\t}else{\n\t\t\t//save item to return\n\t\t\tItem returnItem = first.item;\n\t\t\t//delete first node\n\t\t\tfirst = first.next;\n\t\t\tn--;\n\t\t\tif(isEmpty()){\n\t\t\t\tlast = null; // to avoid loitering\n\t\t\t}else{\n\t\t\t\tfirst.prev = null;\n\t\t\t}\n\t\t\treturn returnItem;\n\t\t}\n\t}", "@Override\r\n\tpublic MorseCodeTree<String> delete(String element) throws UnsupportedOperationException {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn null;\r\n\t}", "public Item removeFirst() {\n if (!isEmpty()) {\n Item item = first.item;\n first = first.back;\n size--;\n if (size != 0)\n first.front = null;\n return item;\n } else throw new NoSuchElementException(\"?\");\n }", "public void removeElementAt(int index);", "public E removeRear() {\r\n if (elem[rear] == null) {\r\n throw new NoSuchElementException();\r\n } else {\r\n E temp = elem[rear];\r\n elem[rear] = null;\r\n rear--;\r\n return temp;\r\n }\r\n }", "public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n\n Node oldFirst = this.first;\n this.first = oldFirst.next;\n this.size--;\n\n if (this.size != 0) {\n this.first.prev = null;\n } else {\n this.last = null;\n }\n\n return oldFirst.item;\n }", "public static native boolean RemoveIt(long lpjFbxArrayVector2, long pElement);", "public AvlTree<E> remove(Comparable<E> element){\n root = remove(element, root);\n return this;\n }", "public int remove() {\n int result = peek();\n\n // move rightmost leaf to become new root\n elementData[1] = elementData[size];\n size--;\n \n // \"bubble down\" root as necessary to fix ordering\n int index = 1;\n boolean found = false; // have we found the proper place yet?\n while (!found && hasLeftChild(index)) {\n int left = leftChild(index);\n int right = rightChild(index);\n int child = left;\n if (hasRightChild(index) &&\n elementData[right] < elementData[left]) {\n child = right;\n }\n \n if (elementData[index] > elementData[child]) {\n swap(elementData, index, child);\n index = child;\n } else {\n found = true; // found proper location; stop the loop\n }\n }\n \n return result;\n }", "public void cleanRemove(Element element){\n\t\tfor(Element el : element.getElements()){\n\t\t\tnifty.removeElement(nifty.getScreen(\"hud\"),el);\n\t\t}\n\t\tnifty.removeElement(nifty.getScreen(\"hud\"), element);\n\t\tnifty.executeEndOfFrameElementActions();\n\t}", "public E remove(){\r\n if(isEmpty())\r\n return null;\r\n \r\n //since the array is ordered, the highest priority will always be at the end of the queue\r\n //--currentSize will find the last index (highest priority) and remove it\r\n return queue[--currentSize];\r\n }", "@Override\n public T remove(int index) {\n T removed = array[index];\n for (int i = index + 1; i < array.length; i++) {\n array[i] = array[i + 1];\n }\n this.size = size - 1;\n return removed;\n }" ]
[ "0.72035444", "0.71303105", "0.6938551", "0.68517476", "0.68379796", "0.68056977", "0.6694632", "0.65930486", "0.65473396", "0.65308857", "0.6494083", "0.63976854", "0.6364606", "0.62915874", "0.62693554", "0.62673587", "0.6264286", "0.62459", "0.6240767", "0.62216437", "0.620274", "0.6183674", "0.6178292", "0.6168448", "0.6164898", "0.61631215", "0.6158994", "0.6156983", "0.6155738", "0.61538136", "0.61469394", "0.61460745", "0.61404204", "0.6126673", "0.6115037", "0.61127234", "0.6112644", "0.6109379", "0.61004674", "0.6085732", "0.60727274", "0.60707587", "0.60584253", "0.60584253", "0.6055275", "0.60450214", "0.60390025", "0.6037449", "0.6033198", "0.6027167", "0.6023923", "0.6016359", "0.6015385", "0.6010764", "0.5998804", "0.5998286", "0.59976166", "0.59890515", "0.59818", "0.597963", "0.5979076", "0.5957004", "0.59554344", "0.59510106", "0.5948455", "0.5941508", "0.5938065", "0.5937615", "0.59343606", "0.59261596", "0.59247565", "0.5924677", "0.5924677", "0.5924677", "0.5924677", "0.5924677", "0.5921534", "0.59212565", "0.5918879", "0.5913682", "0.5913682", "0.5911812", "0.5910427", "0.59077084", "0.5903003", "0.5898493", "0.58953446", "0.58875704", "0.58862704", "0.5883981", "0.5877894", "0.5874973", "0.58733106", "0.5872505", "0.5871391", "0.58712524", "0.58710796", "0.5864684", "0.5864334", "0.5856017", "0.58516306" ]
0.0
-1
Find an element. Compress on the way. Check for the last element, returned by nextElement() first. Equality is checked with the equal() function.
public int indexOf(klasse o) { if (EN > 0 && EN <= OLast && O[EN - 1].equals(o)) return EN - 1; if (Gap < 0) { for (int i = 0; i < OLast; i++) { if (O[i].equals(o)) return i; } return -1; } for (int i = 0; i < Gap; i++) { if (O[i].equals(o)) return i; } int k = Gap; for (int i = Gap; i < OLast; i++) { if (O[i] == null) continue; if (O[i].equals(o)) { Gap = k; return i; } O[k++] = O[i]; O[i] = null; } ON = k; for (int i = k; i < OLast; i++) O[i] = null; Gap = -1; OLast = ON; return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int findNextElement() {\n\t\tif (hasNext()) {\n\t\t\tint value = this.index + 1;\n\t\t\treturn value;\n\n\t\t}\n\t\treturn -1;\n\t}", "Object getNextElement() throws NoSuchElementException;", "private void findNext() {\n \tthis.find(true);\n }", "public T getElement(T equalElement) {\n\t\tIterator<T> iter = iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tT element = iter.next();\n\t\t\tif (element.equals(equalElement))\n\t\t\t\treturn element;\n\t\t}\n\t\treturn null;\n\t}", "public Node<T> findSlow(T element);", "public E find(Comparable<E> element){\n comparisons = 0;\n AvlNode<E> node = find(element, root);\n return (node != null) ? (E)node.value : null;\n }", "public T find(T element);", "public SkipListNode<E> search(E element){\n\t\tboolean found = false;\n\t\tSkipListNode<E> p = null;\n\t\ttry {\n\t\t\tp = head.getDown();\n\t\t\tif(p.getNext().getNext()!=null)\n\t\t\t\tp = p.getNext();\n\t\t} catch (Exception e) {\n\t\t\tp = head;\n\t\t}\n\t\twhile(!found && p.element()!=null){\n\t\t\tif(comp.compare(p.element(), element)<0)\n\t\t\t{\n\t\t\t\tif(p.getNext().element()==null)\n\t\t\t\t{\n\t\t\t\t\tif(p.getDown()==null)\n\t\t\t\t\t\tfound=true;\n\t\t\t\t\telse\n\t\t\t\t\t\tp = p.getDown();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tp = p.getNext();\n\t\t\t}\n\t\t\telse if(comp.compare(p.element(), element)>0)\n\t\t\t{\n\t\t\t\tp = p.getPrevious();\n\t\t\t\tif(p.getDown()==null)\n\t\t\t\t\tfound=true;\n\t\t\t\telse\n\t\t\t\t\tp = p.getDown();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(p.getDown()==null)\n\t\t\t\t\tfound=true;\n\t\t\t\telse\n\t\t\t\t\tp = p.getDown();\n\t\t\t}\n\t\t}\n\t\treturn p;\n\t}", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public Node searchElement(Object el) {\n\t\n\t\tfor (Node elemento : this.set) {\n\t\t\tif(elemento.getElemento().equals(el)) {\n\t\t\t\treturn elemento;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@Override\r\n\tpublic T find(T element) {\n\t\treturn null;\r\n\t}", "public void findNext() {\n\t if (value != null) {\n\t findValue();\n\t } else {\n\t find();\n\t }\n\t}", "public Boolean searchElement(E element){\n HeapIterator<E> it = heapIterator();\n \n while(it.hasNext()){\n if(it.next().equals(element)) return true;\n }\n\n return false;\n }", "public E next() \n {\n \tfor(int i = 0; i < size; i++)\n \t\tif(tree[i].order == next) {\n \t\t\tnext++;\n \t\t\ttree[i].position = i;\n \t\t\treturn tree[i].element;\n \t\t}\n \treturn null;\n }", "private AvlNode<E> find(Comparable<E> element, AvlNode<E> node){\n if(node == null) {\n return null;\n } else {\n comparisons++;\n if(node.value.compareTo((E)element) > 0){\n return find(element, node.left);\n } else if(node.value.compareTo((E)element) < 0){\n return find(element, node.right);\n } else {\n return node;\n }\n }\n }", "Element nextElement () {\n\t\treturn stream.next();\n\t}", "@Override\n\tpublic T find(T targetElement) {\n\t\tif(contains(targetElement))\n\t\t return targetElement;\n\t\telse \n\t\t\treturn null;\n\t\t\n\t}", "int find(int element){\n if(parent[element]!=element)\n parent[element]=find(parent[element]);\n return parent[element];\n }", "@Override\r\n\tpublic void findElement() {\n\t\t\r\n\t}", "private int find(ElementType element){\n for(int i=0;i<size;i++){\n if(elements[i].equals(element)){\n return i;\n }\n }\n return -1;\n }", "public T getNextElement();", "public T getNext(T element);", "protected Tuple fetchNext() throws NoSuchElementException, TransactionAbortedException, DbException {\n\t\t// some code goes here\n\t\tTuple ret;\n\t\twhile (childOperator.hasNext()) {\n\t\t\tret = childOperator.next();\n\t\t\tif (pred.filter(ret))\n\t\t\t\treturn ret;\n\t\t}\n\t\treturn null;\n\t}", "public abstract Iter<Boolean> search(T element);", "public int searchElement (E targetElement){\n\r\n Node curr = head;\r\n int count = 0;\r\n\r\n while (curr != null){\r\n if(curr.getItem() == targetElement){\r\n count++;\r\n }\r\n curr = curr.getNext();\r\n }\r\n\r\n return count;\r\n }", "private void findNewNextInStack() {\n if (stack.empty()) {\n next = Chunk.NONE;\n return;\n }\n next = stack.pop();\n long valueReference = INVALID_VALUE_REFERENCE;\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n while (next != Chunk.NONE && valueReference == INVALID_VALUE_REFERENCE) {\n if (!stack.empty()) {\n next = stack.pop();\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n } else {\n next = Chunk.NONE;\n return;\n }\n }\n }" ]
[ "0.61543995", "0.60146236", "0.59800863", "0.5770165", "0.5736793", "0.5732932", "0.57000893", "0.56424254", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573344", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5573324", "0.5556344", "0.5539897", "0.54617965", "0.5436487", "0.5404427", "0.53682816", "0.53660405", "0.53337973", "0.53089154", "0.5279195", "0.5266683", "0.52352965", "0.52276284", "0.52090573", "0.5184202", "0.5167052", "0.5150521" ]
0.0
-1
Get the element at a given position. Second access will always be effective. First access compresses. Throws an exception, if the index is invalid.
public klasse elementAt(int n) { if (n < 0 || n >= ON) throw new ArrayIndexOutOfBoundsException(n); if (Gap < 0 || n < Gap) return O[n]; int k = Gap; for (int i = Gap; i < OLast; i++) { if (O[i] == null) continue; O[k] = O[i]; O[i] = null; if (k == n) { klasse ret = O[k]; k++; Gap = k; if (Gap >= ON) { for (int j = Gap; j < OLast; j++) O[j] = null; OLast = ON; Gap = -1; } return ret; } k++; } // never happens throw new ArrayIndexOutOfBoundsException(n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Object get(int pos) throws IndexOutOfBoundsException;", "public int get(int index);", "public T get(int index);", "public T get(int index);", "public T get(int index);", "E get(int i) throws IndexOutOfBoundsException;", "abstract int get(int index);", "E get( int index );", "T get(int index);", "T get(int index);", "T get(int index);", "T get(int index);", "T get(int index);", "Object get(int index);", "Object get(int index);", "public T get(int pos);", "T get(int position);", "public abstract T get(int index);", "public Object get(int index);", "public Object get(int index);", "public T get(int aIndex);", "int get(int idx);", "public E get(int index);", "@Override\n\tpublic E get(int idx) {\n\t\tE element = null;\n\t\tif (idx < 0 || idx >= size)\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\telement = list[idx];\n\t\treturn element;\n\t}", "public abstract E get(int index);", "@Override\n // worst-case complexity: O(1), it's basically just an array access\n public T get(int index) {\n if (index < size && index >= 0)\n return arr[index];\n // else throw an exception\n throw new IndexOutOfBoundsException();\n }", "@Override\n public T get(int index) {\n if (index < 0 || index >= size) {\n return null;\n }\n int position = index + plusOne(nextFirst);\n if (position >= array.length) {\n position -= array.length;\n return array[position];\n } else {\n return array[position];\n }\n }", "@Override\n @SuppressWarnings(\"unchecked\")\n public synchronized E get(int index) {\n if (index < 0 || index >= this.pointer) {\n throw new ArrayIndexOutOfBoundsException(\"Out of bound.\");\n }\n return (E) (this.container[index]);\n }", "public Object get(int index) {\n\tif(index > arr.length) return null;\n\treturn arr[index];\n}", "public E get(int index) {\n\t\tif (index < 0 || index >= size) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\treturn elements[index];\n\t}", "@Override\n\tpublic T get(int index) {\n\t\tif (index >= 0 && index < size) {\n\t\t\treturn data[index];\n\t\t}\n\t\treturn null;\n\t}", "public E get(int index)\n {\n if (index >= 0 && index < size)\n return data[index];\n else\n throw new NoSuchElementException();\n }", "@Override\n public E get(int index) {\n // todo: Students must code\n checkRange(index); // throws IndexOOB Exception if out of range\n return data[calculate(index)];\n }", "Object getElementAt(int index);", "public E getElement(int index) {\t//O(1)\r\n\t\t//checks if the index is valid\r\n\t\tif (index>=0 && index<size)\r\n\t\t\treturn (E) list[index];\t//returns element at particular index\r\n\t\treturn null;\r\n\t}", "public T get(int index) throws IndexOutOfBoundsException {\n checkException(index);\n return arr[index];\n }", "@Override\n public E get(int index) {\n if ((index < 0) || (index >= _size)) {\n throw new IndexOutOfBoundsException();\n }\n return _store[index];\n }", "public E get(int index) {\n\t\tresetIterator();\n\t\tif (index < 0 || index >= size) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (int i = 0; i < index; i++) {\n\t\t\tnext();\n\t\t}\n\t\treturn iterator.data;\n\t}", "@Override\n public E get(final int index) {\n ensureValidIndex(size, index);\n return super.get(index + lower);\n }", "public T get(int index) {\n return items[(nextFirst + 1 + index) % capacity];\n }", "T getElementFromIndex(int index) throws ListException;", "@SuppressWarnings(\"unchecked\")\n public E get(int index) {\n checkIndex(index);\n return (E) list[index];\n }", "public E get(int index) {\n\t\tif (index < 0 || index >= size()) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Index is out of bounds\");\n\t\t} else {\n\t\t\treturn list[index];\n\t\t}\n\t}", "public O get(int index)\r\n {\r\n if (index >= count || index < 0) return null;\r\n \r\n if (index > count/2)\r\n {\r\n //search from the end\r\n VectorItem<O> vi = last;\r\n for (int i=count-1;i>index;i--)\r\n {\r\n vi = vi.getPrevious();\r\n }\r\n return vi.getObject(); \r\n \r\n } else\r\n {\r\n //search from the beginning\r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<index;i++)\r\n {\r\n vi = vi.getNext();\r\n }\r\n return vi.getObject(); \r\n }\r\n }", "@Override\n public T get(final int index) {\n this.checkIndex(index);\n return this.data[index];\n }", "private E getElement(int index) {\n if (index >= contents.size()) {\n return null;\n } else {\n return contents.get(index);\n }\n }", "public Object get(int index) {\n int i;\n if (index < 0 || (i = index + start) >= size)\n throw new NoSuchKeyException(index, size - start);\n return array[i];\n }", "Object getArrayElement(int index);", "Object getArrayElement(int index);", "@Override\n public T get(int index) {\n return indexCheck(index) ? (T) data[index] : null;\n }", "@Override\n\tpublic Object retrieve(int index) throws IndexOutOfBoundsException {\n\n\n\t\t// Check for valid size\n\t\tif (index < 0 || index >= this.size()) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\n\t\t// set the position of the current node to the head\n\t\tNode current = head;\n\n\t\t// move through the list\n\t\tif (index == 0) {// head\n\t\t\treturn head.getElement();\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tif(i == index) {\n\t\t\t\treturn current.getElement();\n\t\t\t}\n\t\t\t\n\t\t\tcurrent = current.getNext(); // set the node to the next node\n\t\t}\n\n\t\t// return the element in the node\n\t\treturn null;\n\t}", "public E get(int index) {\n return this.elements[index];\n }", "public E get(int index){\n if (index < 0 || index >= size){\n throw new ArrayIndexOutOfBoundsException(index);\n }\n return theData[index];\n }", "@Override\n public T get(int position) {\n if (!validate(position)) {\n throw new ArrayIndexOutOfBoundsException(\"Bad position!\");\n }\n return (T) this.values[position];\n }", "byte get(int index);", "public Object get(int index) {\n\t\tif (index < 0 || index > (size - 1)) {\n\t\t\tthrow new IndexOutOfBoundsException(\n\t\t\t\t\t\"Cannot get the element with invalid index from the ArrayIndexedCollection.\");\n\t\t}\n\n\t\treturn elements[index];\n\t}", "public synchronized E get(int index) {\n return this.array.get(index);\n }", "public E get(int index)\n\t{\n\t\treturn contents[index];\n\t}", "public T get(int index){\n if(!rangeCheck(index)){\n return null;\n }\n return (T)data[index];\n }", "@Override\n public E get(final int index) {\n return array[index];\n }", "public T get(int index) {\n if (size == 0) {\n return null;\n }\n if (index < 0 || index > size - 1) {\n return null;\n }\n index = Math.floorMod(index + front, array.length);\n return array[index];\n }", "public E get(int index) {\n //make sure the index is valid\n if (this.array.length - 1 >= index) {\n //encapsulate\n Object element = this.array[index];\n return (E) element;\n } \n \n //if the index is invalid, return -1\n throw new IllegalArgumentException();\n }", "public Object get(int index) {\n\t\tif(index <= arr.length-1) return arr[index];\n\t\treturn null;\n\t}", "public Object elementAt(int index);", "public long getElem(int index) {\r\n return a[index];\r\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic T get(int pos){\n\t\tif(pos >= 0 && pos < currentsize ){\n\t\t\tthrow new NoSuchElementException();\n\t\t}\n\n\t\treturn (T) data[pos];\n\t}", "@Override\n public E get(int index) throws IndexOutOfBoundsException\n {\n if(index > size() - 1 || index < 0)\n {\n throw new IndexOutOfBoundsException();\n }\n Node currNode = getNth(index);\n return currNode.getElement(); \n }", "@Override\n\tpublic E get(int i) throws IndexOutOfBoundsException {\n\t\treturn null;\n\t}", "public E get(int idx) {\n assert idx >= 0;\n \n if(v == array[idx]){\n\t\tv = array[idx];\n\t}\n\t\n\tif(array[idx] == null){\n\t\tv = null;\n\t}\n\treturn v;\n }", "String get(int index);", "public E get(int index)\r\n {\r\n checkValidIndex(index);\r\n return listIterator(index).next();\r\n }", "public T get(int i);", "@Override\n public E get(int i) throws IndexOutOfBoundsException {\n validIndex(i);\n return data[i];\n }", "public Occ get( int index )\n {\n if ( index < 0 || index >= size ) throw new IndexOutOfBoundsException( \"\"+index+\" >= \"+size );\n return data[index];\n }", "@ZenCodeType.Operator(ZenCodeType.OperatorType.INDEXGET)\n default IData getAt(int index) {\n \n return notSupportedOperator(OperatorType.INDEXGET);\n }", "public T get(int index) {\n T result = null;\n if (index >= 0 && index < this.container.length) {\n result = (T) this.container[index];\n }\n return result;\n }", "public E get(int i) {\n\t\tif (size == 0) {\n\t\t\tthrow new IllegalArgumentException(\"List is empty, cannot retrieve item.\");\n\t\t}\n\n\t\tif (i < 0 || i >= size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Requested index is out of bounds.\");\n\t\t}\n\n\t\treturn list[i];\n\n\t}", "public int get(int index) {\n\t\treturn r[index];\n\t}", "@Override\n public E get(int index) {\n this.rangeCheck(index);\n return (E) this.values[index];\n }", "public int get(int index) {\n return array[index];\n }", "public Object get(int index) {\r\n return entry(index).element;\r\n }", "@Override\n public T get(int idx) {\n //if item is within the bounds of the array list, it is returned others null is returned\n if (idx >= 0 && idx<=size){\n return arr[idx+1];\n } else {\n return null;\n }\n\n }", "public Item get(int index) {\n int track = nextFirst; //It does not modify nextFirst\n track = moveForward(track, index + 1);\n return items[track];\n }", "public E get(int index) {\n\t\tif (index < 0 || index >= mSize)\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\treturn getNode(index).data;\n\t}", "private Element getElement(int index) {\n if (index < this._size / 2) {\n return this.getElementForwards(index);\n } else {\n return this.getElementBackwards(index);\n }\n }", "public E get(int index) { \n return (E)list[index];\n }", "protected abstract int readInternal(int index);", "@Override\n public final Integer get(final int index) {\n if (!checkRange(index)) {\n throw new IndexOutOfBoundsException();\n } else {\n return arrayList[index];\n }\n }", "public T get(int index) {\n if (index < length()) {\n return (T) list[startIndex + index];\n }\n return null;\n }", "@Override\n public T get(int index) {\n return list.get(index);\n }", "public E get(int index) {\r\n\t\tif (indices.get(index) == null) {\r\n\t\t\tthrow new NoSuchElementException();\r\n\t\t} else {\r\n\t\t\treturn indices.get(index).data;\t\t\r\n\t\t}\r\n\t}", "public E get(int index)\n { \n if(index >= size() || index < 0)\n {\n return null; \n }\n Node<E> n = getNode(index);\n return n.getValue();\n }", "public E get(int index) {\r\n return items.get(index);\r\n }", "public E peek() throws IndexOutOfBoundsException {\n return index(0);\n }", "public E get ( int index)\n {\n if (index < 0 || index >= size) {\n throw new\n IndexOutOfBoundsException(Integer.toString(index));\n }\n Node<E> node = getNode(index);\n return node.data;\n }", "public T get(int index) {\n\t\tint at = 1;\n\t\tfor (Node<T> current = start; current != null; current = current.next) {\n\t\t\tif (at == index) {\n\t\t\t\treturn current.value;\n\t\t\t}\n\t\t\tat++;\n\t\t}\n\t\t// We couldn't find it, throw an exception!\n\t\tthrow new IndexOutOfBoundsException();\n\t}", "@Override\n\tpublic int get(int index) throws IndexOutOfBoundsException {\n\t\tif(checkIndex(index, size)) { //check if index is valid\n\t\t\treturn values[index]; //return the value at index\n\t\t}else {\n\t\t\tthrow new IndexOutOfBoundsException(\"Highest index: \" + size);\n\t\t}\t\n\t}", "public String get(int index) {\n\t\t\n\t\tString result = null;\n\t\t\n\t\tif(Math.abs(index) >= 0 && Math.abs(index) < lenght)\n\t\t{\n\t\t\tif(index < 0)\n\t\t\t\tresult = this.elements.get(this.length() + index);\n\t\t\telse\n\t\t\t\tresult = this.elements.get(index);\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tpublic E get(int index) {\n\t\treturn null;\n\t}", "public T get(int index) {\n return this.list[index];\n }", "public T get(int position)\n {\n if (position >= size || position < 0)\n {\n throw new IndexOutOfBoundsException(\"Item is out of bounds of the list\");\n }\n\n return (T) list[position];\n }" ]
[ "0.7729813", "0.77137625", "0.7654991", "0.7654991", "0.7654991", "0.7632187", "0.7584717", "0.75785273", "0.7554718", "0.7554718", "0.7554718", "0.7554718", "0.7554718", "0.7521098", "0.7521098", "0.75179243", "0.74960274", "0.7444662", "0.7442194", "0.7442194", "0.73861283", "0.7332952", "0.7320121", "0.7234321", "0.72246724", "0.72244406", "0.7189403", "0.7163371", "0.7072478", "0.7056441", "0.7046615", "0.70422894", "0.7013913", "0.7007439", "0.69815445", "0.69805825", "0.6972579", "0.69653744", "0.6959494", "0.6923782", "0.69217664", "0.69094294", "0.6894901", "0.6894883", "0.68920594", "0.6885992", "0.68836063", "0.68648064", "0.68648064", "0.6862973", "0.6859645", "0.685792", "0.68492395", "0.6845755", "0.6841768", "0.68175215", "0.68174225", "0.6815907", "0.68154794", "0.68089783", "0.6802638", "0.67958206", "0.6783422", "0.6777881", "0.67774904", "0.67692935", "0.676606", "0.6751938", "0.6745846", "0.67240924", "0.6720717", "0.6708117", "0.6708069", "0.6695515", "0.669509", "0.66761106", "0.6658035", "0.66569054", "0.6654929", "0.66504604", "0.66436857", "0.66433454", "0.66429776", "0.66368324", "0.6622604", "0.6618438", "0.6617686", "0.65966463", "0.65957165", "0.65831697", "0.6582421", "0.6577086", "0.6557709", "0.65179145", "0.65165865", "0.6513578", "0.6501525", "0.6499361", "0.6498617", "0.64984894", "0.6487765" ]
0.0
-1
Get the array itself (compressed). Make sure, you also use size() to determine the true length of the array. Do not change objects beyond the size! Do not set objects to null!
public Object[] getArray() { compress(); return O; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public byte[] array()\r\n/* 127: */ {\r\n/* 128:156 */ ensureAccessible();\r\n/* 129:157 */ return this.array;\r\n/* 130: */ }", "@Override\n public Object[] toArray() {\n return Arrays.copyOf(data, size);\n }", "public Object[] backingArray()\n {\n return array;\n }", "public Array<T> compactClone()\n {\n Array<T> out = Array.fromUnsafe(new Object[next], next);\n System.arraycopy(array, 0, out.array, 0, next);\n return out;\n }", "protected Object[] getArray(){\r\n\t \treturn array;\r\n\t }", "public Object[] toArray() {\n\t\tObject[] ret = new Object[currentSize];\n\t\tfor (int i = 0; i < currentSize; i++)\n\t\t\tret[i] = array[i];\n\t\treturn ret;\n\t}", "T[] getObjects() {\n\t\treturn this.array;\n\t}", "public Object as() {\n Object[] objArr = this.aq;\n int i = this.ar + 1162984873;\n this.ar = i;\n return objArr[i * -285142937];\n }", "public Object getArray() {\n\t\treturn array;\n\t}", "@Override\n public Object[] toArray() {\n Object[] result = new Object[currentSize];\n System.arraycopy(container, 0, result, 0, currentSize);\n return result;\n }", "ArrayMixedObject getArray() {\n\t\treturn array;\n\t}", "@Override\n public Object[] toArray() {\n Object[] tempArray = new Object[size];\n Node n = this.head;\n int i = 0;\n while (i<size) {\n tempArray[i] = n.getData();\n i++;\n n = n.next;\n }\n return tempArray;\n }", "@Override\n\tpublic Object[] toArray() {\n\t\tObject[] result = copyArray(elements, size);\n\n\t\treturn result;\n\t}", "public Object[] toArray() {\n Object[] myarray = new Object[size];\n DoublyLinkedListNode<T> pointer = head;\n for (int i = 0; i < size; i++) {\n myarray[i] = pointer.getData();\n pointer = pointer.getNext();\n }\n return myarray;\n\n\n }", "stack() {\n arr = (E[]) new Object[size];\n }", "public O[] toArray()\r\n {\r\n\r\n @SuppressWarnings(\"unchecked\")\r\n O[] a = (O[]) new Object[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }", "public final Object[] getArray() {\n return array;\n }", "@Override\n public byte [] toArray()\n \n {\n final int size = size();\n final byte [] array = \n new byte [size]; \n \n\n int i = 0;\n for (ByteCursor c : this)\n {\n array[i++] = c.value;\n }\n return array;\n }", "public final byte[] serializeArray_copy() {\n final ByteBuffer b = this.serialize();\n return ByteBuffer.allocate(b.limit()).put(b).array();\n }", "default Object[] toArray() {\n return toArray(new Object[0]);\n }", "public Object[] toArray() {\n Object[] tmp = new Object[this.container.length];\n System.arraycopy(this.container, 0, tmp, 0, tmp.length);\n return tmp;\n }", "public Object[] toArray() {\n Object[] arr = new Object[size];\n for(int i = 0; i < this.size; i++) {\n arr[i] = this.get(i);\n }\n return arr;\n }", "@Override\n\tpublic Object[] toArray() {\n\t\tListNode<L> newHead=first;\n\t\tObject[] array=new Object[size];\n\t\tfor(int i =0;i<size;i++) {\n\t\t\tarray[i]=newHead.storage;\n\t\t\tnewHead=newHead.next;\n\t\t}\n\t\treturn array;\n\t}", "@Override\n public T[] toArray() {\n return this.copyArray(this.data, this.size);\n }", "public Object[] getBackingArray() {\n return backing;\n }", "Object[] toArray();", "Object[] toArray();", "Object[] toArray();", "public byte[] toArray()\r\n {\r\n return _stream.toByteArray();\r\n }", "public Object[] toArray() {\n\t\treturn null;\n\t}", "public Object[] getBackingArray() {\r\n return backingArray;\r\n }", "@Override\n public Object[] toArray() {\n Object[] result = new Object[size];\n int i = 0;\n for (E e : this) {\n result[i++] = e;\n }\n return result;\n }", "public final byte[] serializeArray() {\n if(this.b.arrayOffset() == 0) return this.b.array();\n return this.serializeArray_copy();\n }", "public SuperArray() { \n \t_data = new Comparable[10];\n \t_lastPos = -1; //flag to indicate no lastpos yet\n \t_size = 0;\t\n }", "@Override // java.util.Collection, java.util.Set\r\n public <T> T[] toArray(T[] array) {\r\n if (array.length < this.f513d) {\r\n array = (Object[]) Array.newInstance(array.getClass().getComponentType(), this.f513d);\r\n }\r\n System.arraycopy(this.f512c, 0, array, 0, this.f513d);\r\n int length = array.length;\r\n int i2 = this.f513d;\r\n if (length > i2) {\r\n array[i2] = null;\r\n }\r\n return array;\r\n }", "@Override\n public T[] toArray() {\n //create the return array\n T[] result = (T[])new Object[this.getSize()];\n //make a count variable to move through the array and a reference\n //to the first node\n int index = 0;\n Node n = first;\n //copy the node data to the array\n while(n != null){\n result[index++] = n.value;\n n = n.next;\n }\n return result;\n }", "public T[] getBackingArray() {\n return backingArray;\n }", "public ResizingArray() {\r\n super();\r\n this.aObjects = new Object[ResizingArray.DEFAULT_SIZE];\r\n this.aFreeElements = new int[ResizingArray.DEFAULT_SIZE];\r\n }", "void decodeObjectArray();", "public byte[] getObjectdata()\n {\n return null;\n }", "@SuppressWarnings(\"unchecked\")\n public final T[] obtainArrayCopy() {\n final T[] localArray = array;\n if (localArray == null) return (T[]) Array.newInstance(clazz, 0);\n\n return Arrays.copyOf(localArray, localArray.length);\n }", "public interface IPrimitiveArray extends IArray {\n /**\n * Primitive signatures.\n */\n public static final byte[] SIGNATURES = {\n -1, -1, -1, -1, (byte) 'Z', (byte) 'C', (byte) 'F', (byte) 'D', (byte) 'B', (byte) 'S',\n (byte) 'I', (byte) 'J'\n };\n\n /**\n * Element sizes inside the array.\n */\n public static final int[] ELEMENT_SIZE = { -1, -1, -1, -1, 1, 2, 4, 8, 1, 2, 4, 8 };\n\n /**\n * Display string of the type.\n */\n @SuppressWarnings(\"nls\") public static final String[] TYPE = {\n null, null, null, null, \"boolean[]\", \"char[]\", \"float[]\", \"double[]\", \"byte[]\", \"short[]\",\n \"int[]\", \"long[]\"\n };\n\n /**\n * Java component type of the primitive array.\n */\n public static final Class<?>[] COMPONENT_TYPE = {\n null, null, null, null, boolean.class, char.class, float.class, double.class, byte.class,\n short.class, int.class, long.class\n };\n\n /**\n * Returns the {@link Type} of the primitive array.\n */\n public int getType();\n\n /**\n * Returns the component type of the array.\n */\n public Class<?> getComponentType();\n\n /**\n * Returns the Object at a given index.\n */\n public Object getValueAt(int index);\n\n /**\n * Get the primitive Java array. The return value can be casted into the\n * correct component type, e.g.\n *\n * <pre>\n * if (char.class == array.getComponentType())\n * {\n * char[] content = (char[]) array.getValueArray();\n * System.out.println(content.length);\n * }\n * </pre>\n *\n * The return value must not be modified because it is cached by the heap\n * dump adapter. This method does not return a copy of the array for\n * performance reasons.\n */\n public Object getValueArray();\n\n /**\n * Get the primitive Java array, beginning at <code>offset</code> and\n * <code>length</code> number of elements.\n * <p>\n * The return value must not be modified because it is cached by the heap\n * dump adapter. This method does not return a copy of the array for\n * performance reasons.\n */\n public Object getValueArray(int offset, int length);\n}", "protected abstract Object[] getData();", "@Override\r\n\tpublic byte[] getBytes() {\n\t\treturn buffer.array();\r\n\t}", "public Object[] toArray() {\n return Arrays.copyOf(this.values, this.index);\n }", "public byte[] getData() {\n return ByteExtensions.clone(this.data);\n }", "@Override\n\t\tpublic Object[] toArray() {\n\t\t\treturn null;\n\t\t}", "private static byte[] get(byte[] array, int offset, int length) {\n byte[] result = new byte[length];\n System.arraycopy(array, offset, result, 0, length);\n return result;\n }", "Object createArray(int capacity);", "public Object[] toArray() {\n\t\tint k;\n\t\tNode p;\n\n\t\tObject[] retArray = new Object[mSize];\n\t\tfor (k = 0, p = mHead.next; k < mSize; k++, p = p.next)\n\t\t\tretArray[k] = p.data;\n\t\treturn retArray;\n\t}", "public bucket[] getData() {\n\t\treturn (bucket.clone());\n\t}", "public Object[] toArray() {\r\n Object[] arr = new Object[size];\r\n Node<T> current = head.next();\r\n for (int i = 0; i < size; i++) {\r\n arr[i] = current.getData();\r\n current = current.next();\r\n }\r\n return arr;\r\n }", "public T[] toArray() {\n return null;\n }", "@Override\n public Object[] toArray() {\n return queue;\n }", "public byte[] getByteArray() {\n try {\n byte[] ret = (byte[]) byteBuffers.dequeue();\n num++;\n //Thread.dumpStack();\n if(ZenBuildProperties.dbgDataStructures){\n System.out.write('b');\n System.out.write('a');\n System.out.write('_');\n System.out.write('c');\n System.out.write('a');\n System.out.write('c');\n System.out.write('h');\n System.out.write('e');\n edu.uci.ece.zen.utils.Logger.writeln(num);\n }\n\n if (ret == null) {\n return (byte[]) imm.newArray(byte.class, 1024);\n } else {\n return ret;\n }\n } catch (Exception e) {\n ZenProperties.logger.log(Logger.FATAL, getClass(), \"getByteArray\", e);\n System.exit(-1);\n }\n return null;\n }", "public Weet[] toArray() {\n /**\n * Used by getWeets() for returning a chronological array of weets.\n */\n\n /* If no insertions have been carried out, return the array of weets with no further operations */\n if (altered == false) {\n return WeetArray;\n }\n /**\n * Otherwise, define a new array dwArray (If M is the number of Date-Weet pairs, dwArray has size M),\n * make a call to an overloaded method with the generics of the B-Tree and dwArray as parameters,\n * set WeetArray equal to the new array and force WeetArray to return by setting 'altered' to false.\n */\n else {\n c = 0;\n altered = false;\n Weet[] dwArray = new Weet[size];\n toArray(root, height, dwArray);\n WeetArray = dwArray;\n return dwArray;\n }\n }", "public ByteArrayList getData() {\n return DataBuffer.this.getData();\n }", "public Object[] toArray() {\n\t\tObject[] arg = new Object[size];\r\n\t\t\r\n\t\tNode<E> current = head;\r\n\t\tint i = 0;\r\n\t\twhile(current != null) {\r\n\t\t\targ[i] = current.getData();\r\n\t\t\ti++;\r\n\t\t\tcurrent = current.getNext();;\r\n\t\t}\r\n\t\treturn arg;\r\n\t}", "public byte[] getData() {\r\n return Arrays.copyOf(data, data.length);\r\n }", "public byte[] getByteArray()\n \t{\n \t\t// In some cases the array is bigger than the actual number\n \t\t// of valid bytes.\n \t\tint realByteLength = getLengthInBytes();\n \n \t\t// Currently the case is that the return from this\n \t\t// call only includes the valid bytes.\n \t\tif (value.length != realByteLength) {\n \t\t\tbyte[] data = new byte[realByteLength];\n \t\t\tSystem.arraycopy(value, 0, data, 0, realByteLength);\n \n \t\t\tvalue = data;\n \t\t}\n \n \t\treturn value;\n \t}", "@Override\n\tpublic Object[] toArray() {\n\t\tif (isEmpty()) {\n\t return null;\n\t }\n\n\t\tObject[] data = new Object[size()];\n\n\t ListNode tmp = head;\n\t for (int i = 0; i < size(); i++) {\n\t data[i] = tmp.datum;\n\t tmp = tmp.next;\n\t }\n\n\t return data;\t\t\n\t}", "@Override\n\tpublic Object[] toArray() {\n\t\treturn null;\n\t}", "public ByteArray content (){\r\n\t\t\tif(isCompressed) {\r\n\t\t\t\tuncompress();\r\n\t\t\t}\r\n\t\t\treturn _content;\r\n\t\t}", "public final Object[] zze() {\n return this.zzc.zze();\n }", "private List<FieldInfo> compressArrayList(DebuggerObject arrayObject)\n {\n // mimic the public length field that arrays possess\n // according to the java spec...\n indexToSlotList = new LinkedList<Integer>();\n indexToSlotList.add(0, new Integer(ARRAY_LENGTH_SLOT_VALUE));\n\n // the +1 here is due to the fact that if we do not have at least one\n // more than\n // the sum of start elements and tail elements, then there is no point\n // in displaying\n // the ... elements because there would be no elements for them to\n // reveal\n if (arrayObject.getElementCount() > (VISIBLE_ARRAY_START + VISIBLE_ARRAY_TAIL + 2)) {\n\n // the destination list\n List<FieldInfo> newArray = new ArrayList<FieldInfo>(2 + VISIBLE_ARRAY_START + VISIBLE_ARRAY_TAIL);\n newArray.add(0, new FieldInfo(\"int length\", \"\" + arrayObject.getElementCount()));\n for (int i = 0; i <= VISIBLE_ARRAY_START; i++) {\n // first 40 elements are displayed as per normal\n newArray.add(new FieldInfo(\"[\" + i + \"]\", arrayObject.getElementValueString(i)));\n indexToSlotList.add(i);\n }\n\n // now the first of our expansion slots\n newArray.add(new FieldInfo(\"[...]\", \"\"));\n indexToSlotList.add(new Integer(ARRAY_QUERY_SLOT_VALUE));\n\n for (int i = VISIBLE_ARRAY_TAIL; i > 0; i--) {\n // last 5 elements are displayed\n int elNum = arrayObject.getElementCount() - i;\n newArray.add(new FieldInfo(\"[\" + elNum + \"]\", arrayObject.getElementValueString(elNum)));\n indexToSlotList.add(arrayObject.getElementCount() - i);\n }\n return newArray;\n }\n else {\n List<FieldInfo> fullArrayFieldList = new ArrayList<FieldInfo>(arrayObject.getElementCount() + 1);\n fullArrayFieldList.add(0, new FieldInfo(\"int length\", \"\" + arrayObject.getElementCount()));\n \n for (int i = 0; i < arrayObject.getElementCount(); i++) {\n fullArrayFieldList.add(new FieldInfo(\"[\" + i + \"]\", arrayObject.getElementValueString(i)));\n indexToSlotList.add(i);\n }\n return fullArrayFieldList;\n }\n }", "public Array()\n {\n assert DEFAULT_CAPACITY > 0;\n\n array = new Object[DEFAULT_CAPACITY];\n }", "public short[] get_data() {\n short[] tmp = new short[60];\n for (int index0 = 0; index0 < numElements_data(0); index0++) {\n tmp[index0] = getElement_data(index0);\n }\n return tmp;\n }", "public Object[] toArray() {\r\n \tObject[] resultForward = new Object[size];\r\n \tboolean closedForward = true;\r\n \tint iForward = 0;\r\n \tfor (Entry e = header.next; e != header && iForward < size; e = e.next) {\r\n \t\tif (e == null) {\r\n \t\t\tclosedForward = false;\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\tresultForward[iForward++] = e.element;\r\n \t}\r\n\r\n \tObject[] resultBackward = new Object[size];\r\n \tboolean closedBackward = true;\r\n \tint iBackward = size;\r\n \tfor (Entry e = header.previous; e != header && iBackward < size; e = e.previous) {\r\n \t\tif (e == null) {\r\n \t\t\tclosedBackward = false;\r\n \t\t\tbreak;\r\n \t\t}\r\n \t\tresultBackward[--iBackward] = e.element;\r\n \t}\r\n\r\n \tif (closedForward || (!closedForward && iBackward == size)) {\r\n \t\treturn resultForward;\r\n \t}\r\n \telse if (closedBackward || (!closedBackward && iForward == 0)) {\r\n \t\treturn resultBackward;\r\n \t}\r\n \telse {\r\n \t\tObject[] result = new Object[size];\r\n \t\tList<?> l = Arrays.asList(resultBackward);\r\n \t\tCollections.reverse(l);\r\n \t\tresultBackward = l.toArray();\r\n \t\tSystem.arraycopy(resultForward, 0, result, 0, iForward);\r\n \t\tif (iForward < size)\r\n \t\t\tSystem.arraycopy(resultBackward, 0, result, iForward, (size - iBackward));\r\n \t\treturn result;\r\n \t}\r\n }", "public long[] toArray() {\n/* 406 */ long[] array = new long[(int)(this.max - this.min + 1L)];\n/* 407 */ for (int i = 0; i < array.length; i++) {\n/* 408 */ array[i] = this.min + i;\n/* */ }\n/* 410 */ return array;\n/* */ }", "public byte[] getData() {\n if (this.length==0) {\n return new byte[0];\n }\n return data;\n }", "private Object[] getArray(int index) {\n if (index >= getTreeSize(totalSize)) {\n return tail;\n } else {\n return getArray(treeRoot, treeDepth, index);\n }\n }", "public byte[] toByteArray() \r\n {\r\n \tbyte newbuf[] = new byte[count];\r\n \tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \treturn newbuf;\r\n }", "public Object[] toArray() {\n\n return toArray(new Object[size()]);\n }", "public Object[] toArray() {\n Object[] arr = new Object[size];\n Node<E> cur = head;\n for(int i = 0; i < size; i++) {\n arr[i] = cur.item;\n cur = cur.next;\n }\n return arr;\n }", "public Object[] toRawArray();", "public Object[] toArray(){\n\t\t// allocate the array an an iterator\n\t\t\t\tObject[] arr = new Object[hashTableSize];\n\t\t\t\tIterator<T> iter = iterator();\n\t\t\t\tint i = 0;\n\n\t\t\t\t// iterate the hash table and assign its\n\t\t\t\t// values into the array\n\t\t\t\twhile (iter.hasNext()) {\n\t\t\t\t\tarr[i] = iter.next();\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\treturn arr;\n\t}", "Array() {\n\t\tarray = new int[0];\n\t}", "public byte[] getJ() {\n return j;\n }", "public byte[] getData()\n {\n if (m_data == null)\n {\n return null;\n }\n return (byte[]) m_data.clone();\n }", "public int[] toArray() {\n return Arrays.copyOf(buffer, elementsCount);\n }", "@Override\n public Movie[] toPrimitive()\n {\n int j = 0;\n Movie moviesArray[] = new Movie[this.movies.length];\n\n for(int i = 0; i < this.movies.length; i++)\n {\n if(this.movies.get(i) != null)\n {\n moviesArray[j] = this.movies.get(i);\n j++;\n }\n }\n\n return moviesArray;\n }", "public float[] toArray() {\r\n float[] result = new float[size];\r\n System.arraycopy(elementData, 0, result, 0, size);\r\n return result;\r\n }", "public void compact()\n {\n array = toArray();\n }", "public Object getData() {\n return dataArray;\n }", "public Object getObject() {\n\t\ttry {\n\t\t\tByteArrayInputStream istream = new ByteArrayInputStream(mStoredObjectArray);\n\t\t\tObjectInputStream p;\n\t\t\tObject toReturn = null;\n\t\t\tif (mIsJython) {\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\ttoReturn = null;\n\t\t\t}\n\t\t\tistream.close();\n\t\t\treturn toReturn;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public Object[] toArray() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "static public Object[] coerceJavaArray(JSObject arr) throws Exception {\r\n\t\t// actual arrays\r\n\t\tif (arr instanceof JSArray)\r\n\t\t\treturn ((JSArray) arr).toArray();\r\n\t\t// array-like objects\r\n\t\tint len = (int) JSUtils.asNumber(arr.get(\"length\"));\r\n\t\tObject[] out = new Object[len];\r\n\t\tfor (int j = 0; j < len; j++)\r\n\t\t\tout[j] = arr.get(j);\r\n\t\treturn out;\r\n\t}", "Array createArray();", "@Override\n public byte[] getByteArray()\n {\n if(firstTime)\n {\n return new byte[0];\n }\n ByteBuffer buffer = ByteBuffer.allocate(MolapCommonConstants.DOUBLE_SIZE_IN_BYTE);\n buffer.putDouble(aggVal);\n return buffer.array();\n }", "public E[] toArray() {\n return (E[]) Arrays.copyOfRange(queue, startPos, queue.length);\n }", "public PersistentArray<T> toPersistentArray() {\n return new PersistentArray<>(this.root, this.branchingFactor, this.depth, this.base,\n this.treeSize);\n }", "public E[] getArray() {\n return this.array;\n }", "private Object[] copyArray(Object[] source, int size) {\n\t\tObject[] destination = new Object[size];\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tdestination[i] = source[i];\n\t\t}\n\n\t\treturn destination;\n\t}", "public Object getValueArray(int offset, int length);", "public final int zza(Object[] objArr, int i) {\n System.arraycopy(this.zzb, 0, objArr, 0, this.zzc);\n return this.zzc + 0;\n }", "public static final <T> Object[] m28150b(@C6003d T[] tArr, boolean z) {\n Class<Object[]> cls = Object[].class;\n if (!z || !C14445h0.m62463a((Object) tArr.getClass(), (Object) cls)) {\n Object[] copyOf = Arrays.copyOf(tArr, tArr.length, cls);\n C14445h0.m62453a((Object) copyOf, \"java.util.Arrays.copyOf(… Array<Any?>::class.java)\");\n return copyOf;\n } else if (tArr != null) {\n return tArr;\n } else {\n throw new TypeCastException(\"null cannot be cast to non-null type kotlin.Array<kotlin.Any?>\");\n }\n }", "public default T[] toArray() {\n Object[] array = new Object[size()];\n int i = 0;\n for (T t : this) {\n array[i++] = t;\n }\n return (T[]) array;\n }", "public int readArray(Object o) throws IOException {\n\t\tprimitiveArrayCount = 0;\n\t\treturn primitiveArrayRecurse(o);\n\t}", "@Override\n\tpublic int[] toArray() {\n\t\treturn null;\n\t}", "public Object[] getHeap() {\n return getHeapArray();\n }" ]
[ "0.63537186", "0.63502115", "0.6341958", "0.6246997", "0.6228132", "0.6204955", "0.61233914", "0.6113753", "0.6109942", "0.61051977", "0.6003784", "0.5968867", "0.59618837", "0.59570205", "0.5950167", "0.59431976", "0.59317875", "0.5928844", "0.5910383", "0.59071213", "0.5884072", "0.5879764", "0.587963", "0.5866238", "0.58582765", "0.5853998", "0.5853998", "0.5853998", "0.5852674", "0.58521897", "0.58373165", "0.58173263", "0.5788164", "0.5777402", "0.5766531", "0.57621473", "0.5743783", "0.57252663", "0.57207525", "0.5716685", "0.5711071", "0.5703703", "0.5683656", "0.56534284", "0.56525296", "0.56513757", "0.56211555", "0.56180805", "0.5616649", "0.56118214", "0.5609314", "0.56086206", "0.5606073", "0.5597841", "0.55953693", "0.55720323", "0.5569727", "0.55643135", "0.5560233", "0.5539036", "0.55360323", "0.55333143", "0.55150247", "0.55113053", "0.55040896", "0.5502771", "0.5500351", "0.5498397", "0.5493911", "0.5493513", "0.5486264", "0.54804343", "0.5465163", "0.54634506", "0.5453677", "0.5439366", "0.54354453", "0.54328114", "0.5432524", "0.5431132", "0.54278433", "0.54261184", "0.54256433", "0.5420546", "0.5419965", "0.541729", "0.5407257", "0.54001725", "0.53955793", "0.5383545", "0.5374769", "0.53728974", "0.5368801", "0.5368593", "0.53654504", "0.5360466", "0.53590643", "0.535597", "0.5353907", "0.5348324" ]
0.74684197
0
Copy the array into an object array of at least the same size.
public void copyInto(Object o[]) { compress(); System.arraycopy(O, 0, o, 0, ON); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Object[] copyArray(Object[] source, int size) {\n\t\tObject[] destination = new Object[size];\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tdestination[i] = source[i];\n\t\t}\n\n\t\treturn destination;\n\t}", "public void copyInto(Object[] anArray);", "private Object copyArrayGrow1(Object array, Class newArrayComponentType) {\n if (array != null) {\n int arrayLength = Array.getLength(array);\n Object newArray = Array.newInstance(array.getClass().getComponentType(), arrayLength + 1);\n System.arraycopy(array, 0, newArray, 0, arrayLength);\n return newArray;\n } else {\n return Array.newInstance(newArrayComponentType, 1);\n }\n }", "private void copyArray(Object [] targetArray, Object [] sourceArray) {\n if (targetArray.length < sourceArray.length) {\n for (int i = 0; i < targetArray.length; i++) {\n targetArray[i] = sourceArray[i];\n }\n }\n else {\n for (int i = 0; i < sourceArray.length; i++) {\n targetArray[i] = sourceArray[i];\n }\n }\n }", "@Override\n public Object[] toArray() {\n return Arrays.copyOf(data, size);\n }", "@SuppressWarnings(\"unchecked\")\n public final T[] obtainArrayCopy() {\n final T[] localArray = array;\n if (localArray == null) return (T[]) Array.newInstance(clazz, 0);\n\n return Arrays.copyOf(localArray, localArray.length);\n }", "public T[] getClonedTrimmed(T[] ar) {\r\n for (int i = offset; i < offset + count; i++) {\r\n @SuppressWarnings(\"unchecked\")\r\n T v = (T)objects[i];\r\n ar[i] = v;\r\n }\r\n return ar;\r\n }", "public static <T> T[] copy(T[] array) {\n return copy(array, 0, array.length);\n }", "public Array<T> compactClone()\n {\n Array<T> out = Array.fromUnsafe(new Object[next], next);\n System.arraycopy(array, 0, out.array, 0, next);\n return out;\n }", "private Object[] deepCopy()\n {\n Object[] newList = new Object[size];\n\n int newListPosition = 0;\n for (int i =0; i < size; i++)\n {\n if (list[i] != null)\n {\n newList[newListPosition++] = list[i];\n }\n }\n\n return newList;\n }", "private void doubleArray()\n\t{\n\t\tT[] oldList = list;\n\t\tint oldSize = oldList.length;\n\t\t\n\t\tlist = (T[]) new Object[2 * oldSize];\n\t\t\n\t\t// copy entries from old array to new, bigger array\n\t\tfor (int index = 0; index < oldSize; index++)\n\t\t\tlist[index] = oldList[index];\n\t}", "public DynamicArray<E> copy(DynamicArray<E> array) {\n synchronized (this) {\n return this.array;\n }\n }", "@Override // java.util.Collection, java.util.Set\r\n public <T> T[] toArray(T[] array) {\r\n if (array.length < this.f513d) {\r\n array = (Object[]) Array.newInstance(array.getClass().getComponentType(), this.f513d);\r\n }\r\n System.arraycopy(this.f512c, 0, array, 0, this.f513d);\r\n int length = array.length;\r\n int i2 = this.f513d;\r\n if (length > i2) {\r\n array[i2] = null;\r\n }\r\n return array;\r\n }", "static public Object expandArray(Object[] list) {\n\t\tint newSize=list.length*2;\n Class type = list.getClass().getComponentType();\n Object temp = Array.newInstance(type, newSize);\n System.arraycopy(list, 0, temp, 0,\t\n Math.min(Array.getLength(list), newSize));\n return temp;\n }", "public UnorderedArray cloneArray(){\r\n UnorderedArray clone = new UnorderedArray(maxSize);\r\n clone.mArray = mArray.clone();\r\n clone.numItems = numItems;\r\n return clone;\r\n }", "public Object[] toArray() {\n\t\tObject[] ret = new Object[currentSize];\n\t\tfor (int i = 0; i < currentSize; i++)\n\t\t\tret[i] = array[i];\n\t\treturn ret;\n\t}", "public Object[] toArray(Object a[]) {\r\n if (a.length < size)\r\n//STUB BEGIN\r\n /*a = (Object[])java.lang.reflect.Array.newInstance(\r\n a.getClass().getComponentType(), size);*/\r\n \ta = new Object[size];\r\n//STUB END\r\n int i = 0;\r\n for (Entry e = header.next; e != header; e = e.next)\r\n a[i++] = e.element;\r\n\r\n if (a.length > size)\r\n a[size] = null;\r\n\r\n return a;\r\n }", "@SuppressWarnings(\"unchecked\")\r\n public static Object[] toObjectArray(Object source) {\r\n if (source instanceof Object[]) {\r\n return (Object[]) source;\r\n }\r\n if (source == null) {\r\n return new Object[0];\r\n }\r\n if (!source.getClass().isArray()) {\r\n throw new IllegalArgumentException(\"Source is not an array: \"\r\n + source);\r\n }\r\n int length = Array.getLength(source);\r\n if (length == 0) {\r\n return new Object[0];\r\n }\r\n Class wrapperType = Array.get(source, 0).getClass();\r\n Object[] newArray = (Object[]) Array.newInstance(wrapperType, length);\r\n for (int i = 0; i < length; i++) {\r\n newArray[i] = Array.get(source, i);\r\n }\r\n return newArray;\r\n }", "public void doubleArray() {\r\n\t\t\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tT[] temp=(T[]) new Object[item_count*2];\r\n\t\t\r\n\t\t// Copies elements from the initial array to a larger array\r\n\t\tfor(int i=0;i<item_count;i++) \r\n\t\t\ttemp[i]=arr[i];\r\n\t\tarr=temp;\r\n\t}", "public void extendArray() {\n int index = size();\n Object[] temp = new Object[index + 1];\n for (int i=0; i < index; i++) {\n temp[i] = AL[i];\n }\n AL = temp;\n }", "@Override\n\tpublic Object[] toArray() {\n\t\tObject[] result = copyArray(elements, size);\n\n\t\treturn result;\n\t}", "private static int[] copyArray(int[] array) {\n\t\tint[] copy = new int[array.length]; \n\t\tfor(int i = 0; i < array.length; i ++) {\n\t\t\tcopy[i] = array[i];\n\t\t}\n\t\treturn copy;\n\t}", "static public Object trimArray(Object[] list,int newSize) {\n Class type = list.getClass().getComponentType();\n Object temp = Array.newInstance(type, newSize);\n System.arraycopy(list, 0, temp, 0,\tnewSize); \n return temp;\n\t}", "@Override\n public <T> T[] toArray(final T[] array) {\n\n if (array.length < this.size) {\n return (T[]) this.copyArray(this.data, this.size);\n } else if (array.length > this.size) {\n array[this.size] = null;\n }\n\n for (int i = 0; i < this.size; i++) {\n array[i] = (T) this.data[i];\n }\n\n return array;\n }", "@Override\n public Object[] toArray() {\n Object[] result = new Object[currentSize];\n System.arraycopy(container, 0, result, 0, currentSize);\n return result;\n }", "Object[] toArray();", "Object[] toArray();", "Object[] toArray();", "public final byte[] serializeArray_copy() {\n final ByteBuffer b = this.serialize();\n return ByteBuffer.allocate(b.limit()).put(b).array();\n }", "private void ensureCap(){\n T[] temp = (T[])new Object[arr.length * 2];\n for(int i = 0; i < numItems; i++){\n temp[i] = this.arr[i];\n }\n this.arr = temp;\n }", "default Object[] toArray() {\n return toArray(new Object[0]);\n }", "public static Object naturalCast(Object[] array) {\r\n Class clazz = array[0].getClass();\r\n Object[] newArray = (Object[]) Array.newInstance(clazz, array.length);\r\n for (int i = 0; i < newArray.length; i++) {\r\n newArray[i] = array[i];\r\n }\r\n return newArray;\r\n }", "public static int[] ArrayCopy(int[] inputArray){\n int[] copy=new int[inputArray.length];\n for (int i=0;i<inputArray.length;i++){\n copy[i]=inputArray[i];\n }\n return copy;\n }", "private static Object resizeArray(Object oldArray, int newSize) {\n\t\tint oldSize = java.lang.reflect.Array.getLength(oldArray);\n\t\tClass elementType = oldArray.getClass().getComponentType();\n\t\tObject newArray = java.lang.reflect.Array.newInstance(elementType,\n\t\t\t\tnewSize);\n\t\tint preserveLength = Math.min(oldSize, newSize);\n\t\tif (preserveLength > 0) {\n\t\t\tSystem.arraycopy(oldArray, 0, newArray, 0, preserveLength);\n\t\t}\n\t\treturn newArray;\n\t}", "@Override\n public PrizeOrderObject[] newArray(int size) {\n return new PrizeOrderObject[size];\n }", "@Override\n public T[] toArray() {\n return this.copyArray(this.data, this.size);\n }", "public static void copyInto(CountedObject[] src, Object[] dst, boolean reverse) {\n int j = (reverse ? src.length - 1 : 0);\n for (int i = 0; i != src.length; i++) {\n dst[j] = src[i].object;\n if (reverse) {\n --j;\n }\n else {\n ++j;\n }\n }\n }", "private static Object[] m59444a(Iterable<?> iterable, Object[] objArr) {\n int i = 0;\n for (Object obj : iterable) {\n int i2 = i + 1;\n objArr[i] = obj;\n i = i2;\n }\n return objArr;\n }", "private void grow() {\n T[] arr_temp = (T[]) new Object[arr.length*2];\n for (int i=0; i<arr.length; i++){\n arr_temp[i] = arr[i];\n }\n arr = arr_temp;\n }", "protected static String[] copy (String[] array)\n {\n String[] copy = new String[array.length];\n System.arraycopy(array, 0, copy, 0, array.length);\n return copy;\n }", "@Override\n public T[] toArray() {\n return (T[]) array;\n }", "public static <T> Array<T> copyOf(T[] array, int n)\n {\n assert n <= array.length;\n\n Array<T> out = Array.ofSize(n);\n out.copyFrom(array, 0, 0, n);\n return out;\n }", "static public Object[] coerceJavaArray(JSObject arr) throws Exception {\r\n\t\t// actual arrays\r\n\t\tif (arr instanceof JSArray)\r\n\t\t\treturn ((JSArray) arr).toArray();\r\n\t\t// array-like objects\r\n\t\tint len = (int) JSUtils.asNumber(arr.get(\"length\"));\r\n\t\tObject[] out = new Object[len];\r\n\t\tfor (int j = 0; j < len; j++)\r\n\t\t\tout[j] = arr.get(j);\r\n\t\treturn out;\r\n\t}", "private Object[] cloneRow() {\n\t\t\treturn (Object[]) (row.clone());\n\t\t}", "public static <A, O extends A> A[] addObjectToArray(A[] array, O obj) {\r\n Class<?> compType = Object.class;\r\n if (array != null) {\r\n compType = array.getClass().getComponentType();\r\n } else if (obj != null) {\r\n compType = obj.getClass();\r\n }\r\n int newArrLength = (array != null ? array.length + 1 : 1);\r\n @SuppressWarnings(\"unchecked\")\r\n A[] newArr = (A[]) Array.newInstance(compType, newArrLength);\r\n if (array != null) {\r\n System.arraycopy(array, 0, newArr, 0, array.length);\r\n }\r\n newArr[newArr.length - 1] = obj;\r\n return newArr;\r\n }", "public static<T> T[] copyArray(T[] src, T[] dest){\n \t int i=0;\n \t while(i<=dest.length-1){\n \t\t if(dest[i]==null)\n \t\t\t break;\n \t\ti++; \n \t }\n \t \t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\tT[] res = (T[])(Array.newInstance(src[0].getClass(), src.length+i));\n \t \t\t\n \t System.arraycopy(dest, 0, res, 0, i);\n \t \t\n \t System.arraycopy(src, 0, res, i, src.length);\n \t return res;\n }", "public final T[] getArrayCopy() {\n final T[] localArray = array;\n if (localArray == null) {\n return null;\n }\n\n return Arrays.copyOf(localArray, localArray.length);\n }", "@SuppressWarnings(\"unchecked\")\n private void upSize()\n {\n T[] newArray = (T[]) new Object [theArray.length * 2];\n for (int i =0; i < theArray.length; i++){\n newArray[i] = theArray[i];\n }\n theArray = newArray;\n }", "@Override\n public <T> T[] toArray(T[] a) {\n if (a.length < size) {\n return (T[])toArray();\n }\n System.arraycopy(toArray(), 0, a, 0, size);\n if (a.length > size) {\n a[size] = null;\n }\n return a;\n }", "public static Object[] arrayCast2Objects(Object obj)\n\t\t\tthrows IllegalArgumentException {\n\t\t// TODO isArray, getType,Dim-Test refactor to MyArray?\n\t\tClass objClass = obj.getClass();\n\t\tif (!objClass.isArray()) {\n\t\t\tString errorMsg = \"Only Arrays allowed !\";\n\t\t\t// System.out.println(ToolBox.getCallerMethod(obj)+\": \"+errorMsg);\n\t\t\tthrow new IllegalArgumentException(errorMsg);\n\t\t}\n\n\t\tObject[] objArray = new Object[Array.getLength(obj)];\n\n\t\tfor (int i = 0; i < objArray.length; i++) {\n\t\t\tobjArray[i] = Array.get(obj, i);\n\t\t\t// System.out.println(objArray[i]);\n\t\t}\n\t\treturn objArray;\n\t}", "static public Object resizeArray(Object[] list, int newSize) {\n Class type = list.getClass().getComponentType();\n Object temp = Array.newInstance(type, newSize);\n System.arraycopy(list, 0, temp, 0,\t\n Math.min(Array.getLength(list), newSize));\n return temp;\n }", "public static int[] copy(int[] theArray) {\n\n return theArray.clone();\n }", "Object createArray(int capacity);", "private IntPlus[] cloneArr(final IntPlus[] origArr) {\n return Arrays.copyOf(origArr, origArr.length);\n }", "private int[] cloneArr(final int[] origArr) {\n return Arrays.copyOf(origArr, origArr.length);\n }", "public static final <T> Object[] m28150b(@C6003d T[] tArr, boolean z) {\n Class<Object[]> cls = Object[].class;\n if (!z || !C14445h0.m62463a((Object) tArr.getClass(), (Object) cls)) {\n Object[] copyOf = Arrays.copyOf(tArr, tArr.length, cls);\n C14445h0.m62453a((Object) copyOf, \"java.util.Arrays.copyOf(… Array<Any?>::class.java)\");\n return copyOf;\n } else if (tArr != null) {\n return tArr;\n } else {\n throw new TypeCastException(\"null cannot be cast to non-null type kotlin.Array<kotlin.Any?>\");\n }\n }", "public static void arraycopy(Object arg0, int arg1, Object arg2, int arg3, int arg4) {\n\t\tif (arg0 instanceof byte[]) {\n\t\t\tnew Exception().printStackTrace();\n\t\t\tSystem.out.println(\";ARRAY COPY: \" + arg4 +\n\t\t\t\t\" bytes (offset \" + arg1 + \" -> \" + arg3 + \")\");\n\t\t\tprinthex(\" SRC:\", (byte[])arg0, arg1, arg4);\n\t\t\tSystem.out.println(\"\");\n\t\t\tprinthex(\" DST:\", (byte[])arg2, arg3, arg4);\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\tSystem.arraycopy(arg0, arg1, arg2, arg3, arg4);\n\t}", "public static <T> Array<T> copyOf(T[] array, int from, int to)\n {\n Array<T> out = Array.ofSize(to - from);\n out.copyFrom(array, from, to, to - from);\n return out;\n }", "protected void setArray(Object[] array){\r\n\t \tthis.array = array;\r\n\t }", "@Override\n public Object[] toArray() {\n Object[] result = new Object[size];\n int i = 0;\n for (E e : this) {\n result[i++] = e;\n }\n return result;\n }", "JAVATYPE [] convertArray(JAVATYPE [] oldArray, final METATYPE meta);", "public void setArray(Object[] array)\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\tSanityManager.ASSERT(array != null, \n\t\t\t\t\t\"array input to setArray() is null, code can't handle this.\");\n\t\t}\n\n\t\tthis.array = ArrayUtil.copy( array );\n\t}", "@Override\n public T[] toArray() {\n T[] result = (T[])new Object[numItems];\n for(int i = 0; i < numItems; i++)\n result[i] = arr[i];\n return result;\n }", "public Item[] newArray(int size) {\n return new Item[size]; \n }", "public static Object deepUnbox(Object[] src) {\n Class<?> resultType = arrayBoxingType(src.getClass());\n return deepUnbox(resultType, src);\n }", "public Object[] toArray() {\n Object[] arr = new Object[size];\n for(int i = 0; i < this.size; i++) {\n arr[i] = this.get(i);\n }\n return arr;\n }", "@Override\n public BankAccount[] toArray() {\n BankAccount[] copy1 = bankArrays.clone();\n\n BankAccount[] copy2 = new BankAccount[copy1.length];\n System.arraycopy(this.bankArrays,0,copy2,0,this.numBanks);\n\n return copy1;\n }", "Prototype makeCopy();", "public Object[] getArray() {\n compress();\n return O;\n }", "@Test\n\tpublic void copy_test2() {\n\t\tSystem.out.println(\"copy前:\" + Arrays.toString(intArr));\t\n\t\tintArr = Arrays.copyOf(intArr, 20);\n//\t\tSystem.arraycopy(intArr, 0, intArr, 0, 20);\n\t\tSystem.out.println(\"copy后(前移):\" + Arrays.toString(intArr));\t\n\t}", "public Object[] toArray() {\n\n return toArray(new Object[size()]);\n }", "@Override\n\t\tpublic photo[] newArray(int size) {\n\t\t\treturn new photo[size];\n\t\t}", "public static <T> T[] copy(T[] array, int start, int finish) {\n return Arrays.copyOfRange(array, start, finish) ;\n }", "public Object[] resize(int newSize){\n Object[] newArray = new Object[newSize];\n for( int i = 0 ; i < this.array.length ; i++ ){\n newArray[i] = this.array[i];\n }\n return newArray;\n }", "public Object[] toArray() {\n Object[] tmp = new Object[this.container.length];\n System.arraycopy(this.container, 0, tmp, 0, tmp.length);\n return tmp;\n }", "public ResizingArray() {\r\n super();\r\n this.aObjects = new Object[ResizingArray.DEFAULT_SIZE];\r\n this.aFreeElements = new int[ResizingArray.DEFAULT_SIZE];\r\n }", "@Override\n public ImageData[] newArray(int size) {\n return new ImageData[size];\n }", "@Override\n BinaryArrayReadWrite clone();", "stack() {\n arr = (E[]) new Object[size];\n }", "public static void main(String[] args) {\n\t\t\tint[] a= {30,20,10};\n\t\t\t\n\t\t\tSystem.out.println(a);\n\t\t\t\n\t\t\t\n\t\t\tString arrayContents=Arrays.toString(a);\n\t\t\t\n\t\t\tSystem.out.println(arrayContents);\n\t\t\t\n\t\t\t\n\t\t\tint[][] a2= {{10,20},{30,40}};\n\n\t\t\tSystem.out.println(Arrays.deepToString(a2));\n\t\t\t\n\t\t\tArrayList al = new ArrayList();\n\t\t\t\n\t\t\tal.add(1);\n\t\t\tal.add(2);\n\t\t\t\n\t\t\tList l = Arrays.asList(1,2,3,\"dd\");\n\t\t\t\n\t\t\tSystem.out.println(l);\n\t\t\t\n\t\t\t\n\t\t\tObject[] o = {10,20,3.5f,\"dd\"};\n\t\t\t\n\t\t\t/* copying Array Elements */\n\t\t\t\n\t\t\t//int[] copy=Arrays.copyOf(a, a.length);\n\t\t\t\n\t\t\t//int[] a= {30,20,10};\n\t\t\t\n\t\t\tint[] copy=Arrays.copyOf(a, 5);\n\t\t\tint[] c=Arrays.copyOf(a, 6);\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Length of Original Array is \" + a.length);\n\t\t\tSystem.out.println(\"Length of new Array is \" + copy.length);\n\t\t\t\n\t\t\tfor(int i=0;i<copy.length;i++)\n\t\t\t{\n\t\t\t\tSystem.out.println(copy[i]);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tint[] newcopy=Arrays.copyOf(a, 2);\n\t\t\t\n\t\t\tSystem.out.println(\"Length of Original Array is \" + a.length);\n\t\t\tSystem.out.println(\"Length of new Array is \" + newcopy.length);\n\t\t\t\n\t\t\tfor(int i=0;i<newcopy.length;i++)\n\t\t\t{\n\t\t\t\tSystem.out.println(newcopy[i]);\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}", "public Object[] toArray(Object ao[])\n {\n Object[] aoAll = super.toArray(ao);\n int cAll = aoAll.length;\n\n int ofSrc = 0;\n int ofDest = 0;\n while (ofSrc < cAll)\n {\n Entry entry = (Entry) aoAll[ofSrc];\n if (entry == null)\n {\n // this happens when ao is passed in and is larger than\n // the number of entries\n break;\n }\n else if (entry.isExpired())\n {\n removeExpired(entry, true);\n }\n else\n {\n if (ofSrc > ofDest)\n {\n aoAll[ofDest] = aoAll[ofSrc];\n }\n ++ofDest;\n }\n ++ofSrc;\n }\n\n if (ofSrc == ofDest)\n {\n // no entries expired; return the original array\n return aoAll;\n }\n\n if (ao == aoAll)\n {\n // this is the same array as was passed in; per the toArray\n // contract, null the element past the end of the non-expired\n // entries (since we removed at least one entry) and return it\n ao[ofDest] = null;\n return ao;\n }\n\n // resize has to occur because we've removed some of the\n // entries because they were expired\n if (ao == null)\n {\n ao = new Object[ofDest];\n }\n else\n {\n ao = (Object[]) Array.newInstance(ao.getClass().getComponentType(), ofDest);\n }\n\n System.arraycopy(aoAll, 0, ao, 0, ofDest);\n return ao;\n }", "public void newArray() {\n\t\t\n\t\tE[] newArray= (E[]) new Object[list.length * 2]; //Holds the old elements from the list array while new list array is being made\n\t\t\n\t\tfor(int i = 0; i < list.length; i++) {\n\t\t\t\n\t\t\tnewArray[i] = list[i]; //Copy the old list array into the newArray\n\t\t}\n\t\t\n\t\tlist = newArray; //Point the old array at the newArray starting memory location\n\t\t\n\t}", "public void toArray(Object[] a) {\n int index = 0;\n int size = count;\n int i = (front + 1) % maxSize;\n while(size > 0){\n a[index++] = queue[i++];\n i %= maxSize;\n size--;\n }\n }", "public O[] toArray()\r\n {\r\n\r\n @SuppressWarnings(\"unchecked\")\r\n O[] a = (O[]) new Object[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }", "@SuppressWarnings(\"unchecked\")\n @Override\n public <T> T[] toArray(T[] out) {\n int size = array.length;\n if (out.length < size) {\n out = ArrayHelper.createFrom(out, size);\n }\n for (int i = 0; i < size; ++i) {\n out[i] = (T) array[i];\n }\n if (out.length > size) {\n out[size] = null;\n }\n return out;\n }", "public static Class<?>[] objectToTypeArray(final Object... array) {\n if (array.length == 0) return new Class<?>[0];\n List<Class<?>> list = new ArrayList<>(array.length);\n for (Object obj : array) {\n list.add(obj.getClass());\n }\n return list.toArray(new Class<?>[list.size()]);\n }", "static int[][] deepClone(int[][] ary) {\n int [][] res = new int[ary.length][];\n\n for(int j=0 ; j < ary.length; j++)\n res[j] = ary[j].clone();\n return res;\n }", "public ArrayValue( Object array )\n\t{\n\t\tthis( array, (byte) 0, null, 0 );\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void growArray() {\n\t\tint tempSize = size * 2;\n\t\tE[] tempList = (E[]) new Object[tempSize];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\ttempList[i] = list[i];\n\t\t}\n\t\tlist = tempList;\n\t}", "private RubyArray(Ruby runtime, RubyClass klass, int length) {\n super(runtime, klass);\n values = new IRubyObject[length];\n }", "public static <T> T[][] clone2DArray(T[][] array) {\r\n\t int rows = array.length ;\r\n\r\n\t //clone the 'shallow' structure of array\r\n\t T[][] newArray = array.clone();\r\n\r\n\t //clone the 'deep' structure of array\r\n\t for(int row = 0 ; row < rows; row++){\r\n\t newArray[row] = array[row].clone();\r\n\t }\r\n\r\n\t return newArray;\r\n\t}", "@Override\n\t\tpublic Info[] newArray(int size) {\n\t\t\treturn new Info[size];\n\t\t}", "@Override\n\t\tpublic <T> T[] toArray(T[] a) {\n\t\t\treturn null;\n\t\t}", "public final Piece[] copyOf(Piece[] b) {\n Piece[] c = new Piece[16];\n// for (int i = 0; i < c.length; i++) {\n// System.arraycopy(b[i], 0, c[i], 0, b[i].length);\n// }\n System.arraycopy(b, 0, c, 0, b.length);\n return c;\n }", "public int[] clone()\n\t{\t\n\t\tint[] newArray = new int[array.length];\n\t\tfor (int index = 0; index < arraySize; index++)\n\t\t{\n\t\t\tnewArray[index] = array[index];\n\t\t}\n\t\treturn newArray;\n\t}", "@Override\n\tpublic Instance copy(final double[] values) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic <T> T[] toArray(T[] a) {\n\t\treturn null;\r\n\t}", "@Override\n public Element[] newArray(int size) {\n return new Element[size];\n }", "public Object[] toArray() {\n\t\treturn null;\n\t}", "default <T> T[] toArray(T[] a) {\n int size = size();\n\n // It is more efficient to call this method with an empty array of the correct type.\n // See also: https://stackoverflow.com/a/29444594/146622 and https://shipilev.net/blog/2016/arrays-wisdom-ancients/\n @SuppressWarnings(\"unchecked\")\n T[] array = a.length != size ? (T[])java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), size) : a;\n\n // This implementation allocates the iterator object,\n // since collections, in general, do not have random access.\n\n Iterator<E> iterator = this.iterator();\n int i = 0;\n // Copy all the elements from the iterator to the array we allocated\n while (iterator.hasNext() && i < size) {\n @SuppressWarnings(\"unchecked\")\n T element = (T)iterator.next();\n array[i] = element;\n i += 1;\n }\n if (i < size) {\n // Somehow we got less elements from the iterator than expected.\n // Null-terminate the array (seems to be good practice).\n array[i] = null;\n // Copy the interesting part of the array and return it.\n return Arrays.copyOf(array, i);\n }\n else if (iterator.hasNext()) {\n // Somehow there are more elements in the iterator than expected.\n // We'll use an ArrayList for the rest.\n List<T> list = Arrays.asList(array);\n while (iterator.hasNext()) {\n @SuppressWarnings(\"unchecked\")\n T element = (T)iterator.next();\n list.add(element);\n }\n // Here we know the array was too small, so it doesn't matter what we pass.\n return list.toArray(a);\n } else {\n // Happy path: the array's size was just right to get all the elements from the iterator.\n return array;\n }\n }" ]
[ "0.7569432", "0.75068843", "0.701532", "0.6976176", "0.67187667", "0.6689796", "0.660737", "0.65425444", "0.6483618", "0.64540243", "0.6413014", "0.6397238", "0.6290462", "0.6234219", "0.62251854", "0.6215991", "0.62082684", "0.61793995", "0.6127407", "0.611628", "0.61017424", "0.6100941", "0.6095741", "0.6088594", "0.6087471", "0.60467666", "0.60467666", "0.60467666", "0.6016339", "0.6014954", "0.5961901", "0.5904254", "0.58851874", "0.5876194", "0.58663267", "0.58572924", "0.5850928", "0.5846001", "0.5837426", "0.58282214", "0.58096826", "0.5792922", "0.57877016", "0.5784787", "0.57775736", "0.5767787", "0.5765935", "0.57631356", "0.5762898", "0.57547176", "0.57502043", "0.5743347", "0.57333875", "0.5715204", "0.5707948", "0.57064784", "0.5701412", "0.56967145", "0.5668644", "0.5662568", "0.5657168", "0.56453085", "0.5644454", "0.56340516", "0.5633053", "0.56314766", "0.56141", "0.5614077", "0.56103563", "0.56048286", "0.5593236", "0.5593233", "0.55870056", "0.5585447", "0.55813295", "0.5573573", "0.5570144", "0.55665094", "0.55444676", "0.55383307", "0.55314183", "0.55307484", "0.5528299", "0.5515434", "0.55123776", "0.5512148", "0.5500696", "0.5498845", "0.54855675", "0.54816777", "0.5470214", "0.5459133", "0.5457087", "0.544873", "0.544706", "0.54425544", "0.54423356", "0.54387295", "0.54360044", "0.54321104" ]
0.6411379
11
Test for equality with another vector, using equals.
public boolean equals(MyVector V) { if (V.ON != ON) return false; V.compress(); compress(); for (int i = 0; i < ON; i++) { if (!V.O[i].equals(O[i])) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean equals(Vector other){\n\t\treturn x == other.x && y == other.y && z == other.z;\n\t}", "public static boolean equal(VectorIntf x, VectorIntf y) {\r\n if (x==null && y==null) \r\n\t\t\tthrow new IllegalArgumentException(\"both args null\");\r\n if (x==null || y==null) return false;\r\n if (x.getNumCoords()!=y.getNumCoords()) return false;\r\n // short-cut for specific sparse vectors\r\n if (x instanceof DblArray1SparseVector && \r\n\t\t\t y instanceof DblArray1SparseVector)\r\n return ((DblArray1SparseVector) x).equals((DblArray1SparseVector) y);\r\n for (int i=0; i<x.getNumCoords(); i++) {\r\n if (Double.compare(x.getCoord(i),y.getCoord(i))!=0) return false;\r\n }\r\n return true;\r\n }", "public static boolean vectorEquals(int[] v, int[] w) { return Arrays.equals(v, w); }", "@Test//test equal\n public void testEqual() {\n MyVector vD1 = new MyVector(ORIGINALDOUBLEARRAY);\n MyVector vD2 = new MyVector(ORIGINALDOUBLEARRAY);\n double[] doubleArray = new double[]{3.0, 2.3, 1.0, 0.0, -1.1};\n MyVector diffVD3 = new MyVector(doubleArray);\n assertEquals(true, vD1.equal(vD2));\n assertEquals(false, vD1.equal(diffVD3));\n MyVector vI1 = new MyVector(ORIGINALINTARRAY);\n MyVector vI2 = new MyVector(ORIGINALINTARRAY);\n int[] intArray = new int[]{1, 2, 3, 4};\n MyVector vI3 = new MyVector(intArray);\n assertEquals(true, vI1.equal(vI2));\n assertEquals(false, vI1.equal(vI3));\n }", "@Test\n public void equals() {\n float[] a = new float[] {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}; \n float[] b = new float[] {2.0f, 1.0f, 6.0f, 3.0f, 4.0f, 5.0f, 6.0f}; \n assertTrue(Vec4f.equals(a, 2, b, 3));\n assertTrue(! Vec4f.equals(a, 0, b, 0));\n \n float[] a4 = new float[] {1.0f, 2.0f, 3.0f, 4.0f}; \n \n float[] b4 = new float[] {1.0f, 2.0f, 3.0f, 4.0f};\n float[] c4 = new float[] {2.0f, 2.0f, 3.0f, 4.0f};\n float[] d4 = new float[] {1.0f, 4.0f, 3.0f, 4.0f};\n float[] e4 = new float[] {1.0f, 2.0f, 6.0f, 4.0f};\n float[] f4 = new float[] {1.0f, 2.0f, 3.0f, 5.0f};\n assertTrue(Vec4f.equals(a4,b4));\n assertTrue(!Vec4f.equals(a4,c4));\n assertTrue(!Vec4f.equals(a4,d4));\n assertTrue(!Vec4f.equals(a4,e4));\n assertTrue(!Vec4f.equals(a4,f4)); \n }", "public boolean equals(AttributeVector o) {\n\t\tif (o == null) return false;\n\t\tif (this == o) return true;\n\t\tif (getClass() != o.getClass()) return false;\n\t\treturn compareTo((AttributeVector) o) == 0;\n\t}", "@Override\n public boolean equals(Object o) {\n if (o instanceof Vector2) {\n boolean value = false;\n if (o.hashCode() == this.hashCode()) {\n value = true;\n }\n return value;\n } else {\n return false;\n }\n }", "public static boolean Match(Vector a, Vector b){\n return a.axis.length == b.axis.length;\n }", "public boolean equalsIdentical(MyVector V) {\n if (V.ON != ON) return false;\n V.compress();\n compress();\n for (int i = 0; i < ON; i++) {\n if (V.O[i] != O[i]) return false;\n }\n return true;\n }", "public void setEqualTo(Vector v){ components = v.getVectorAsArray(); }", "@Override\n public boolean equals(Object obj) {\n if (this == obj) return true;\n if (obj == null) return false;\n if (!(obj instanceof Vector)) return false;\n Vector oth = (Vector) obj;\n return head.equals(oth.head);\n }", "@Test\r\n\tpublic void newVectorTest() {\r\n\t\tfor (int x = -10; x<10; x++) {\r\n\t\t\tfor (int y = -10; y<10; y++) {\r\n\t\t\t\tVector v = new Vector(x,y);\r\n\t\t\t\tVector v2 = new Vector(v);\r\n\t\t\t\tv2.add(v);\r\n\t\t\t\tv2 = v2.add(v);\r\n\t\t\t\tv2 = v2.add(v2);\r\n\t\t\t\tassertTrue(v.equals(new Vector(x,y)));\r\n\t\t\t\tassertTrue(v2.equals(v.add(v).add(v).add(v)));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "boolean hasIsEquivalent();", "public boolean\n\tequals( Vector3 other ) \n\t{\n\t\treturn( data[0] == other.data[0]\n\t\t\t&& data[1] == other.data[1]\n\t\t\t&& data[2] == other.data[2] );\n\t}", "@Override\n public boolean equals(Object o){\n if(!(o instanceof DoubleVector2)) return false;\n DoubleVector2 dv = (DoubleVector2) o;\n return dv.getVectorOne().equals(dv.getVectorTwo());\n }", "boolean equals(IVec3 v);", "@Override\n\tpublic boolean\n\tequals( Object other ) \n\t{\n\t\tVector3 v;\n\n\t\tif( ! ( other instanceof Vector3 ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tv = (Vector3) other;\n\t\n\t\treturn( data[0] == v.data[0]\n\t\t\t&& data[1] == v.data[1]\n\t\t\t&& data[2] == v.data[2] );\n\t}", "@Override\n public VectorEquality compareTo(PredicateVector vectorCmp) {\n try {\n PredicateVector vectorLarge;\n PredicateVector vectorSmall;\n VectorEquality cmpResult;\n \n if (flagged || vectorCmp.flagged) {\n return VectorEquality.UNIQUE;\n }\n \n // TODO: add size check\n \n if (this.size() > vectorCmp.size() && !this.values().iterator().next().isEmpty()) {\n vectorLarge = this;\n vectorSmall = vectorCmp;\n cmpResult = VectorEquality.SUPERSET;\n } else {\n vectorLarge = vectorCmp;\n vectorSmall = this;\n cmpResult = VectorEquality.SUBSET;\n }\n \n int largeVectorIter = 0;\n int numEq = 0;\n \n List<Integer> vectorSmallKeys = new ArrayList<Integer>(vectorSmall.keySet());\n Collections.sort(vectorSmallKeys);\n \n List<Integer> vectorLargeKeys = new ArrayList<Integer>(vectorLarge.keySet());\n Collections.sort(vectorLargeKeys);\n\n int i = 0;\n\n for (Integer smallVectorKey: vectorSmallKeys) {\n StateVector smallVectorState = vectorSmall.get(smallVectorKey);\n // Check if we have not iterated over all large vector states\n if (largeVectorIter >= vectorLargeKeys.size() && !smallVectorState.isEmpty()) {\n cmpResult = VectorEquality.UNIQUE;\n break;\n }\n \n \n for (i = largeVectorIter; i < vectorLargeKeys.size(); i++) {\n StateVector largeVectorState = vectorLarge.get(vectorLargeKeys.get(i));\n VectorEquality cmpVectorResult = smallVectorState.compareTo(largeVectorState); \n if (cmpVectorResult == VectorEquality.EQUAL) {\n numEq += 1;\n break;\n }\n \n if (cmpVectorResult == VectorEquality.SUPERSET || cmpVectorResult == VectorEquality.SUBSET) {\n cmpResult = cmpVectorResult;\n numEq += 1;\n break;\n }\n }\n \n largeVectorIter = i + 1; // TODO: double check i+1\n }\n \n if (numEq < vectorSmall.size() && !vectorSmall.values().iterator().next().isEmpty())\n cmpResult = VectorEquality.UNIQUE;\n \n return cmpResult;\n } catch (ArrayIndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n \n return VectorEquality.UNIQUE;\n }", "@Override\r\n\tpublic boolean equals(Object vec) {\r\n\t\tif (vec == null)\r\n\t\t\treturn false;\r\n\t\ttry {\r\n\t\t\treturn (Util.fuzzyEquals(this.getX(),\r\n\t\t\t\t\t((Vector) vec).getX()) && Util.fuzzyEquals(\r\n\t\t\t\t\tthis.getY(), ((Vector) vec).getY()));\r\n\t\t} catch (ClassCastException ex) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean eq(int[] a,int[] b){\n\t\tboolean eq = true;\n\t\tif(a.length != b.length) return false;\n\t\tfor(int i=0;i<a.length;i++){\n\t\t\tif( a[i] != b[i] ){\n\t\t\t\teq = false;\n\t\t\t\tbreak;\n\t\t\t}else{\n\n\t\t\t}\n\t\t}\n\t\treturn eq;\n\t}", "@org.junit.Test\n public void inverser_vector() throws Exception {\n //voici un commentaire\n Vector<Integer> inppuut = new Vector<Integer>();\n inppuut.add(1);\n inppuut.add(2);\n inppuut.add(3);\n inppuut.add(4);\n\n Vector<Integer> expec = new Vector<Integer>();\n expec.add(4);\n expec.add(3);\n expec.add(2);\n expec.add(1);\n\n VectorHelper.inverser_vector(inppuut);\n assertEquals(expec, inppuut);\n\n }", "public boolean equals(Vector2F v) {\n\t\treturn (this.xPos == v.xPos && this.yPos == v.yPos);\n\t}", "private boolean isEqual(int[] x, int[] y) {\n for (int i = 0; i < 3; i++) {\n if (x[i] != y[i]) {\n return false;\n }\n }\n return true;\n }", "public static boolean equalsUnordered( Collection<?> collection1, Collection<?> collection2 )\r\n {\r\n //\r\n boolean retval = collection1.size() == collection2.size();\r\n \r\n //\r\n for ( Object iObject : collection1 )\r\n {\r\n retval &= collection2.contains( iObject );\r\n }\r\n \r\n //\r\n return retval;\r\n }", "public boolean equals(Object other) {\n //first make sure that the object is an arraylist\n //and also make sure that it isnt null\n if (other == null || !(other instanceof ArrayList)) {\n return false;\n }\n \n //type cast the argument into an array, now that we know that it is one\n ArrayList<E> that = (ArrayList<E>) other;\n \n //check to see if the lengths are the same\n if (this.array.length == that.array.length) {\n //if the lengths are the same, check each value to see if they are the same\n //loop through the array only once\n for (int i = 0; i < this.array.length; i++) {\n //compare the elements of each index\n if (this.array[i] == that.array[i]) {\n //continue to check all elements\n continue;\n } else {\n //if one of the elements aren't the same, return false\n return false;\n }\n }\n } else {\n //return false if the lengths are not the same\n return false;\n }\n \n //if it gets through the loop, then all of the elements are equal \n return true;\n }", "public boolean equals(Vector330Class v){\n return (Math.abs(this.x-v.x) <= EPS || Math.abs(this.y-v.y) <= EPS);\n }", "public static void main(String[] args) {\n\t\tList l=new ArrayList();\r\n\t\tl.add(12);\r\n\t\tl.add(45);\r\n\t\tl.add(15);\r\n\t\tl.add(78);\r\n\t\t\r\n\t\tList l2=new ArrayList();\r\n\t\tl2.add(12);\r\n\t\tl2.add(45);\r\n\t\tl2.add(10);\r\n\t\tl2.add(78);\r\n\t\t\r\n\t\tBoolean m=l.containsAll(l2);\r\n\t\t\r\n\t\tif(m)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Elements are same\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Not equal\");\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "@Test\n public void testGetValues(){\n assertTrue(vector.x == 1 && vector.z == 1);\n }", "public void testEquals()\n {\n // test passing null to equals returns false\n // (as specified in the JDK docs for Object)\n EthernetAddress x =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"equals(null) didn't return false\",\n x.equals((Object)null));\n \n // test passing an object which is not a EthernetAddress returns false\n assertFalse(\"x.equals(non_EthernetAddress_object) didn't return false\",\n x.equals(new Object()));\n \n // test a case where two EthernetAddresss are definitly not equal\n EthernetAddress w =\n new EthernetAddress(ANOTHER_VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == w didn't return false\",\n x == w);\n assertFalse(\"x.equals(w) didn't return false\",\n x.equals(w));\n\n // test refelexivity\n assertTrue(\"x.equals(x) didn't return true\",\n x.equals(x));\n \n // test symmetry\n EthernetAddress y =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertTrue(\"y.equals(x) didn't return true\",\n y.equals(x));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n \n // now we'll test transitivity\n EthernetAddress z =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertFalse(\"x == y didn't return false\",\n y == z);\n assertFalse(\"x == y didn't return false\",\n x == z);\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"y.equals(z) didn't return true\",\n y.equals(z));\n assertTrue(\"x.equals(z) didn't return true\",\n x.equals(z));\n \n // test consistancy (this test is just calling equals multiple times)\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n }", "public boolean equals( Object other ){\r\n\t\t if (!(other instanceof ChainedArrays))\r\n\t\t\t return false;\r\n\t\t Iterator<T> it1 = this.iterator();\r\n\t\t @SuppressWarnings(\"unchecked\")\r\n\t\t ChainedArrays<T> other_casted = (ChainedArrays<T>) other;\r\n\t\t Iterator<T> it2 = other_casted.iterator();\r\n\t\t boolean ans = true;\r\n\t\t while(it1.hasNext()&&it2.hasNext()){\r\n\t\t\t ans &= isEqual( it1.next( ), it2.next( ) );\r\n\t\t }\r\n\t\t return ans;\r\n\t}", "public boolean equalsQ(Vector comparison){\n\t\tfor (Object o1 : comparison.getClock().entrySet()) {\n\t\t\tHashMap.Entry pair = (HashMap.Entry) o1;\n\n\t\t\tif(this.clock.containsKey(pair.getKey())){\n\t\t\t\tif(!((Long)pair.getValue()).equals((Long)this.clock.get(pair.getKey()))){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tfor (Object o1 : this.clock.entrySet()) {\n\t\t\tHashMap.Entry pair = (HashMap.Entry) o1;\n\n\t\t\tif(comparison.getClock().containsKey(pair.getKey())){\n\t\t\t\tif(!((Long)pair.getValue()).equals((Long)comparison.getClock().get(pair.getKey()))){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isEqualSet(Collection set1, Collection set2) {\n/* 99 */ if (set1 == set2) {\n/* 100 */ return true;\n/* */ }\n/* 102 */ if (set1 == null || set2 == null || set1.size() != set2.size()) {\n/* 103 */ return false;\n/* */ }\n/* */ \n/* 106 */ return set1.containsAll(set2);\n/* */ }", "public static boolean equals(int[] list1, int[] list2) {\n boolean verdict = false;\n \n // use bubbleSort to sort each list\n list1 = bubbleSort(list1);\n list2 = bubbleSort(list2);\n \n if (list1.length == list2.length) {\n verdict = true;\n for (int i = 0; i < list1.length; i++) {\n if (list1[i] != list2[i]) {\n verdict = false;\n break;\n }\n }\n }\n return verdict;\n }", "public boolean abstractEqualTo(AbstractData that)\n {\n\treturn equalTo((FullPositionVector)that);\n }", "public final boolean equals (Object obj) {\n if (obj instanceof IntVector) {\n IntVector v = (IntVector)obj;\n if (isEmpty())\n return v.isEmpty();\n else\n return !v.isEmpty() &&\n head == v.head() &&\n tail.equals(tail);\n } else\n return false;\n }", "boolean equivalent(Concept x, Concept y);", "@Override // com.google.common.base.Equivalence\n public boolean doEquivalent(Object a, Object b) {\n return a.equals(b);\n }", "@Override\n boolean equals(Object other);", "public abstract boolean equals(Object other);", "@Test\n public void equalsTest() {\n prepareEntitiesForEqualityTest();\n\n assertEquals(entity0, entity1);\n }", "private final boolean indicesEqual(Collection<TableName> list1, Collection<TableName> list2)\n {\n logger.info(\"indicesEqual - Enter - Index1: {}, Index2: {}\", list1, list2);\n\n // lists must have the same number of indices.\n if (list1.size() != list2.size()) {\n logger.warn(\"Indices lists are different sizes!\");\n return false;\n }\n\n // lists must have the same indices (irrespective of internal ordering).\n Iterator<TableName> iter = list1.iterator();\n while (iter.hasNext()) {\n if (!list2.contains(iter.next())) {\n logger.warn(\"Indices mismatch in list!\");\n return false;\n }\n }\n\n return true;\n }", "public boolean equals(Object o);", "public void testEquals() {\n XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n XIntervalDataItem item2 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);\n item2 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);\n item2 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);\n item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);\n item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);\n }", "@Override\n public boolean equals(Object other) {\n return this == other;\n }", "@Test\n\tpublic void testEqualsVerdadeiro() {\n\t\t\n\t\tassertTrue(contato1.equals(contato3));\n\t}", "private boolean rangeEquals(Object [] b1, Object [] b2, int length)\n /*! #end !*/\n {\n for (int i = 0; i < length; i++)\n {\n if (!Intrinsics.equalsKType(b1[i], b2[i]))\n {\n return false;\n }\n }\n\n return true;\n }", "private final static boolean equivalent(Automaton automaton,\n\t\t\tBinaryMatrix equivs, Automaton.Bag b1, Automaton.Bag b2) {\n\t\tint b1_size = b1.size();\n\t\tint b2_size = b2.size();\n\n\t\tif (b1_size != b2_size) {\n\t\t\t// Observe that, unlike a set, the size of a bag will never be\n\t\t\t// changed by the identification of equivalent states. Therefore,\n\t\t\t// the size of both collection must be identical, otherwise they can\n\t\t\t// never be equivalent.\n\t\t\treturn false;\n\t\t}\n\n\t\tint[] b1_children = b1.children;\n\t\tint[] b2_children = b2.children;\n\t\t// maps vertices in b2 to those they are matched against in b1\n\t\tint[] matches = new int[b1_size];\n\t\tArrays.fill(matches, -1);\n\t\t// Used to ensure no vertex is explored more than once during\n\t\t// reconfiguration.\n\t\tboolean[] visited = new boolean[b1_size];\n\t\t\n\t\t// For every state in s1\n\t\tfor (int i = 0; i != b1_size; ++i) {\n\t\t\tint b1_child = b1_children[i];\n\t\t\tif(b1_child < 0) {\n\t\t\t\t// In this case, we have to do something different.\n\t\t\t\tif(!findNegativeMatch(i,b1_children,b2_children,equivs,matches)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tArrays.fill(visited,false);\n\t\t\t\tif(!findMatch(i,b1_children,b2_children,equivs,matches,visited)) {\n\t\t\t\t\t// If we can't find a match, then it's game over and we know for\n\t\t\t\t\t// sure these two states are not equivalent.\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public boolean equals (SetADT<T> set);", "public abstract boolean doEquivalent(T t, T t2);", "@Override\n public boolean equals(Object v) {\n if (this == v) return true;\n if (v == null || getClass() != v.getClass()) return false;\n Vet vet = (Vet) v;\n return id == vet.id;\n }", "boolean equals(IVec3 v, float epsilon);", "@org.testng.annotations.Test\n public void test_equals_Symmetric()\n throws Exception {\n CategorieClient categorieClient = new CategorieClient(\"denis\", 1000, 10.2, 1.1, 1.2, false);\n Client x = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Client y = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Assert.assertTrue(x.equals(y) && y.equals(x));\n Assert.assertTrue(x.hashCode() == y.hashCode());\n }", "static public <T> boolean bagEquals(Collection<T> source, Collection<T> arg) {\n\t\t/* make copy of arguments in order to manipulate the collection*/\n\t\tif ( source.size() != arg.size() ) {\n\t\t\treturn false;\n\t\t}\n\t\tCollection<T> myArg = new ArrayList<T>( arg );\n\t\tfor ( T elem : source ) {\n\t\t\tif ( myArg.contains(elem) ) {\n\t\t\t\tmyArg.remove(elem);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn myArg.isEmpty();\n\t}", "@Override // com.google.common.base.Equivalence\n public boolean doEquivalent(Object a, Object b) {\n return false;\n }", "@Test\n\tpublic void testEqualityCheck() {\n\t\tadd(\"f(x)=x^3\");\n\t\tadd(\"g(x)=-x^3\");\n\t\tt(\"f==g\", \"false\");\n\t\tt(\"f!=g\", \"true\");\n\t\tt(\"f==-g\", \"true\");\n\t\tt(\"f!=-g\", \"false\");\n\t}", "Equality createEquality();", "@Test\n public void testEquals_sameParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are equivalent\n assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr);\n }", "@Override\n\tpublic abstract boolean equals(Object other);", "public boolean _is_equivalent(Object that) {\n return equals(that) ;\n }", "public boolean equals(Object object);", "private void testEquals() {\n init();\n assertTrue(\"l0.equals(l0)\", l0.equals(l0));\n assertTrue(\"l3.equals(l5)\", l3.equals(l5));\n }", "boolean _is_equivalent(org.omg.CORBA.Object other);", "public abstract boolean equals(Object o);", "@Override\n public abstract boolean equals(Object other);", "@Override\n public abstract boolean equals(Object other);", "@Override public boolean equals(Object object);", "@Test\n @DisplayName(\"Test should detect equality between equal states.\")\n public void testShouldResultInEquality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Hi\");\n\n Assertions.assertThat(os1).isEqualTo(os2);\n }", "@Override\n boolean equals(Object o);", "public boolean equals( Object obj );", "public boolean equals(CFun other);", "private final static boolean equivalent(Automaton automaton,\n\t\t\tBinaryMatrix equivs, Automaton.Set ic, Automaton.Set jc) {\n\t\tint ic_size = ic.size();\n\t\tint jc_size = jc.size();\n\n\t\t// NOTE: the size of two equivalent sets may differ at this stage. This\n\t\t// is because we may two states which are identical and which will\n\t\t// subsequently reduced to a state. Thus, the current size of a set may\n\t\t// not be its final size.\n\n\t\tint[] ic_children = ic.children;\n\t\tint[] jc_children = jc.children;\n\n\t\t// First, check every node in s1 has equivalent in s2\n\t\tfor (int k = 0; k != ic_size; ++k) {\n\t\t\tint ic_child = ic_children[k];\n\t\t\tboolean matched = false;\n\t\t\tfor (int l = 0; l != jc_size; ++l) {\n\t\t\t\tint jc_child = jc_children[l];\n\t\t\t\tif (ic_child == jc_child\n\t\t\t\t\t\t|| (ic_child >= 0 && jc_child >= 0 && equivs.get(\n\t\t\t\t\t\t\t\tic_child, jc_child))) {\n\t\t\t\t\tmatched = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!matched) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Second, check every node in s2 has equivalent in s1\n\t\tfor (int k = 0; k != jc_size; ++k) {\n\t\t\tint jc_child = jc_children[k];\n\t\t\tboolean matched = false;\n\t\t\tfor (int l = 0; l != ic_size; ++l) {\n\t\t\t\tint ic_child = ic_children[l];\n\t\t\t\tif (ic_child == jc_child\n\t\t\t\t\t\t|| (ic_child >= 0 && jc_child >= 0 && equivs.get(\n\t\t\t\t\t\t\t\tic_child, jc_child))) {\n\t\t\t\t\tmatched = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!matched) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "public void equals() {\r\n // todo Implement this java.lang.Object method\r\n throw new UnsupportedOperationException(\"Method equals() not yet implemented.\");\r\n }", "public boolean equals(LinkedList list){\n if (this.size() == list.size()){\n for (int i = 0; i < this.size(); i++){\n if(this.get(i) != list.get(i)){\n return false;\n }\n }\n return true;\n }else{ \n return false;\n } \n }", "@Override\n public boolean equals(Object o) {\n return o instanceof LuaInteger ? ((LuaInteger) o).v == v : false;\n }", "private static boolean isEqual(int[] nums1, int[] nums2){\n \tfor(int i=0; i<nums1.length; i++){\n \t\tif(nums1[i]!=nums2[i]){\n \t\t\treturn false;\n \t\t}\n \t}\n \treturn true;\n }", "@Test\n public void testEquals() {\n System.out.println(\"Animal.equals\");\n Animal newAnimal = new Animal(252, \"Candid Chandelier\", 10, \"Cheetah\", 202);\n assertTrue(animal1.equals(newAnimal));\n assertFalse(animal2.equals(newAnimal));\n }", "private static boolean areEqual (byte[] a, byte[] b) {\r\n int aLength = a.length;\r\n if (aLength != b.length)\r\n return false;\r\n for (int i = 0; i < aLength; i++)\r\n if (a[i] != b[i])\r\n return false;\r\n return true;\r\n }", "public boolean equals(Object x){\n if(this==x) {\n return true;\n }\n Matrix L=(Matrix) x;\n for(int i=1;i<L.newsize;i++) {\n List first=L.row[i];\n List second=this.row[i];\n if(first.equals(second)==false)\n return false;\n }\n return true;\n }", "@Test\n public void equals_trulyEqual() {\n SiteInfo si1 = new SiteInfo(\n Amount.valueOf(12000, SiteInfo.CUBIC_FOOT),\n Amount.valueOf(76, NonSI.FAHRENHEIT),\n Amount.valueOf(92, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n 56,\n Damage.CLASS2,\n Country.USA,\n \"Default Site\"\n );\n SiteInfo si2 = new SiteInfo(\n Amount.valueOf(12000, SiteInfo.CUBIC_FOOT),\n Amount.valueOf(76, NonSI.FAHRENHEIT),\n Amount.valueOf(92, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n 56,\n Damage.CLASS2,\n Country.USA,\n \"Default Site\"\n );\n\n Assert.assertEquals(si1, si2);\n }", "@Test\r\n\tpublic void testEquality(){\n\t\t assertEquals(object1, object2);\r\n\t}", "public boolean equal (Bag u) {\n return u.cardinality() == this.cardinality();\n }", "public static void main(String[] args) {\n int[] a = {4, 6, 3};\n int[] b = {6, 4, 3};\n System.out.println(areSimilar(a, b));\n\n }", "private static <F> /*@ pure @*/ boolean elem_equals(F item1,\n F item2) {\n return (item1 != null && item1.equals(item2))\n\t || (item1 == null && item2 == null);\n }", "public boolean equals(Object obj);", "public boolean equals(Vector3D v, Vector3D w) {\n double epsilon = 1e-9;\n return (Math.abs(v.xCoord - w.xCoord) < epsilon\n && Math.abs(v.yCoord - w.yCoord) < epsilon\n && Math.abs(v.zCoord - w.zCoord) < epsilon);\n }", "public static void equalsDemo() {\n\n//\t\tSystem.out.printf(\"demo1 == demo2 = %s%n\", demo1 == demo2);\n//\t\tSystem.out.printf(\"demo2 == demo3 = %s%n\", demo2 == demo3);\n//\t\tSystem.out.printf(\"demo2.equals(demo3) = %s%n\", demo2.equals(demo3));\n//\t\tSystem.out.printf(\"%n\");\n\t}", "@Test\r\n public void test0IsEqual_ThreeElements() {\r\n Tour tourA = new Tour(new int[][]{{0, 0}, {1, 1}, {2, 2}});\r\n Tour tourB = new Tour(new int[][]{{0, 0}, {1, 1}, {2, 2}});\r\n assertTrue(tourA.isEqual(tourB));\r\n }", "@Test\n public void testEquals() {\n Term t1 = structure(\"abc\", atom(\"a\"), atom(\"b\"), atom(\"c\"));\n Term t2 = structure(\"abc\", integerNumber(), decimalFraction(), variable());\n PredicateKey k1 = PredicateKey.createForTerm(t1);\n PredicateKey k2 = PredicateKey.createForTerm(t2);\n testEquals(k1, k2);\n }", "static public boolean sequenceEquals(List source, List arg) {\n\t\tif ( source.size() != arg.size() ) {\n\t\t\treturn false;\n\t\t}\n\t\tIterator it1 = source.iterator();\n\t\tIterator it2 = arg.iterator();\n\t\twhile ( it1.hasNext() ) {\n\t\t\tObject elem1 = it1.next();\n\t\t\tObject elem2 = it2.next();\n\t\t\tif ( elem1 instanceof Integer ) {\n\t\t\t\tif ( ((Integer)elem1).intValue() != ((Integer)elem2).intValue() ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( elem1 instanceof Float ) {\n\t\t\t\t\tif ( ((Float)elem1).floatValue() != ((Float)elem2).floatValue() ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( elem1 instanceof Boolean ) {\n\t\t\t\t\t\tif ( ((Boolean)elem1).booleanValue() != ((Boolean)elem2).booleanValue() ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( !elem1.equals(elem2) ) {\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\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n\tpublic void test_equals1() {\n\tTvShow t1 = new TvShow(\"Sherlock\",\"BBC\");\n\tTvShow t2 = new TvShow(\"Sherlock\",\"BBC\");\n\tassertTrue(t1.equals(t2));\n }", "@Test\n public void set() {\n float[] a = new float[] {1.001f, 2.002f, 3.003f, 4.004f, 5.005f, 6.006f}; \n float[] b = new float[] {2.0f, 1.0f, 6.0f, 3.0f, 4.0f, 5.0f};\n float[] expect = new float[] {1.0f, 6.0f, 3.0f, 4.0f};\n Vec4f.set(a, 2, b, 1);\n assertTrue(Vec4f.equals(a, 2, expect, 0));\n \n float[] expect2 = new float[] {2.0f, 1.0f, 6.0f, 3.0f};\n Vec4f.set(a, b);\n assertTrue(Vec4f.equals(a, expect2));\n \n \n float[] a3 = new float[] {1.001f, 2.002f, 3.003f, 4.004f, 5.005f, 6.006f}; \n float[] expect3 = new float[] {2.0f, 1.0f, 6.0f, 4.0f};\n Vec4f.set(a3,2, 2.0f, 1.0f, 6.0f, 4.0f );\n assertTrue(Vec4f.equals(a3, 2, expect3, 0));\n \n float[] a4 = new float[4]; \n float[] expect4 = new float[] {2.0f, 1.0f, 6.0f, 4.0f};\n Vec4f.set(a4, 2.0f, 1.0f, 6.0f, 4.0f );\n assertTrue(Vec4f.equals(a4, expect4));\n }", "public boolean RepVec(String []a){\n boolean rep=false;\n String aux1=\"\",aux2=\"\";\n for (int i = 0; i < a.length; i++) {\n aux1=a[i];\n for (int j = 0; j < a.length; j++) {\n aux2=a[j];\n if( i!=j ){ \n if(aux1==aux2){\n rep=true;\n return rep;\n } \n } \n }\n }\n return rep;\n \n }", "@Override \n boolean equals(Object obj);", "protected abstract boolean equalityTest(Object key, Object key2);", "public static boolean checkValues (Iterable<Versioned<byte[]>> values, Versioned<byte[]> expected) {\n\t\tIterator<Versioned<byte[]>> itValue = values.iterator();\n\t\twhile (itValue.hasNext()) {\n\t\t\tVersioned<byte[]> curr = itValue.next();\n\t\t\tif ( ! Arrays.equals(expected.getValue(), curr.getValue()) ) {\n\t\t\t\tSystem.err.println(\"Expected value is different!!\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.7307093", "0.6998161", "0.6728373", "0.6714511", "0.6581016", "0.6491747", "0.64475745", "0.636415", "0.6352992", "0.6344585", "0.6294116", "0.62173635", "0.6179345", "0.6151063", "0.61348146", "0.6118833", "0.6071692", "0.60617304", "0.6060764", "0.59827465", "0.5977996", "0.5905256", "0.5888685", "0.58590937", "0.58264166", "0.5817684", "0.58038116", "0.58018607", "0.5784547", "0.575971", "0.5736058", "0.5726768", "0.5722678", "0.57125497", "0.5706335", "0.56866854", "0.5681882", "0.5674399", "0.5670911", "0.5664309", "0.5631442", "0.5622343", "0.56028545", "0.55764925", "0.5545683", "0.55433637", "0.55386424", "0.55357665", "0.5526013", "0.55255777", "0.5523326", "0.55184627", "0.55153304", "0.5507407", "0.55069566", "0.5505124", "0.5504703", "0.5492737", "0.5471948", "0.5457189", "0.5455733", "0.54528403", "0.5452695", "0.5452501", "0.5452501", "0.54393965", "0.5437568", "0.5431421", "0.5418229", "0.54172254", "0.5415934", "0.5410831", "0.5410831", "0.5410831", "0.5410831", "0.5410831", "0.54061", "0.5401169", "0.5395409", "0.5393728", "0.5379547", "0.53773427", "0.5374136", "0.5371057", "0.5370827", "0.5369889", "0.53678364", "0.5360815", "0.53565276", "0.5349081", "0.53441083", "0.5331598", "0.5325532", "0.53249466", "0.53157395", "0.5312063", "0.5310618", "0.53091264", "0.5304615", "0.52942014" ]
0.64076406
7
Test for equality with another vector, using object equality.
public boolean equalsIdentical(MyVector V) { if (V.ON != ON) return false; V.compress(); compress(); for (int i = 0; i < ON; i++) { if (V.O[i] != O[i]) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test//test equal\n public void testEqual() {\n MyVector vD1 = new MyVector(ORIGINALDOUBLEARRAY);\n MyVector vD2 = new MyVector(ORIGINALDOUBLEARRAY);\n double[] doubleArray = new double[]{3.0, 2.3, 1.0, 0.0, -1.1};\n MyVector diffVD3 = new MyVector(doubleArray);\n assertEquals(true, vD1.equal(vD2));\n assertEquals(false, vD1.equal(diffVD3));\n MyVector vI1 = new MyVector(ORIGINALINTARRAY);\n MyVector vI2 = new MyVector(ORIGINALINTARRAY);\n int[] intArray = new int[]{1, 2, 3, 4};\n MyVector vI3 = new MyVector(intArray);\n assertEquals(true, vI1.equal(vI2));\n assertEquals(false, vI1.equal(vI3));\n }", "public boolean equals(Vector other){\n\t\treturn x == other.x && y == other.y && z == other.z;\n\t}", "public static boolean equal(VectorIntf x, VectorIntf y) {\r\n if (x==null && y==null) \r\n\t\t\tthrow new IllegalArgumentException(\"both args null\");\r\n if (x==null || y==null) return false;\r\n if (x.getNumCoords()!=y.getNumCoords()) return false;\r\n // short-cut for specific sparse vectors\r\n if (x instanceof DblArray1SparseVector && \r\n\t\t\t y instanceof DblArray1SparseVector)\r\n return ((DblArray1SparseVector) x).equals((DblArray1SparseVector) y);\r\n for (int i=0; i<x.getNumCoords(); i++) {\r\n if (Double.compare(x.getCoord(i),y.getCoord(i))!=0) return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object o) {\n if (o instanceof Vector2) {\n boolean value = false;\n if (o.hashCode() == this.hashCode()) {\n value = true;\n }\n return value;\n } else {\n return false;\n }\n }", "public boolean equals(AttributeVector o) {\n\t\tif (o == null) return false;\n\t\tif (this == o) return true;\n\t\tif (getClass() != o.getClass()) return false;\n\t\treturn compareTo((AttributeVector) o) == 0;\n\t}", "@Test\r\n\tpublic void newVectorTest() {\r\n\t\tfor (int x = -10; x<10; x++) {\r\n\t\t\tfor (int y = -10; y<10; y++) {\r\n\t\t\t\tVector v = new Vector(x,y);\r\n\t\t\t\tVector v2 = new Vector(v);\r\n\t\t\t\tv2.add(v);\r\n\t\t\t\tv2 = v2.add(v);\r\n\t\t\t\tv2 = v2.add(v2);\r\n\t\t\t\tassertTrue(v.equals(new Vector(x,y)));\r\n\t\t\t\tassertTrue(v2.equals(v.add(v).add(v).add(v)));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n public void equals() {\n float[] a = new float[] {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}; \n float[] b = new float[] {2.0f, 1.0f, 6.0f, 3.0f, 4.0f, 5.0f, 6.0f}; \n assertTrue(Vec4f.equals(a, 2, b, 3));\n assertTrue(! Vec4f.equals(a, 0, b, 0));\n \n float[] a4 = new float[] {1.0f, 2.0f, 3.0f, 4.0f}; \n \n float[] b4 = new float[] {1.0f, 2.0f, 3.0f, 4.0f};\n float[] c4 = new float[] {2.0f, 2.0f, 3.0f, 4.0f};\n float[] d4 = new float[] {1.0f, 4.0f, 3.0f, 4.0f};\n float[] e4 = new float[] {1.0f, 2.0f, 6.0f, 4.0f};\n float[] f4 = new float[] {1.0f, 2.0f, 3.0f, 5.0f};\n assertTrue(Vec4f.equals(a4,b4));\n assertTrue(!Vec4f.equals(a4,c4));\n assertTrue(!Vec4f.equals(a4,d4));\n assertTrue(!Vec4f.equals(a4,e4));\n assertTrue(!Vec4f.equals(a4,f4)); \n }", "@Test\r\n\tpublic void testEquality(){\n\t\t assertEquals(object1, object2);\r\n\t}", "@Override\n public boolean equals(Object o){\n if(!(o instanceof DoubleVector2)) return false;\n DoubleVector2 dv = (DoubleVector2) o;\n return dv.getVectorOne().equals(dv.getVectorTwo());\n }", "@Override\n public boolean equals(Object obj) {\n if (this == obj) return true;\n if (obj == null) return false;\n if (!(obj instanceof Vector)) return false;\n Vector oth = (Vector) obj;\n return head.equals(oth.head);\n }", "boolean equals(IVec3 v);", "public void setEqualTo(Vector v){ components = v.getVectorAsArray(); }", "@Override\n\tpublic boolean\n\tequals( Object other ) \n\t{\n\t\tVector3 v;\n\n\t\tif( ! ( other instanceof Vector3 ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tv = (Vector3) other;\n\t\n\t\treturn( data[0] == v.data[0]\n\t\t\t&& data[1] == v.data[1]\n\t\t\t&& data[2] == v.data[2] );\n\t}", "boolean hasIsEquivalent();", "Equality createEquality();", "public static boolean vectorEquals(int[] v, int[] w) { return Arrays.equals(v, w); }", "@Test\n @DisplayName(\"Test should detect equality between equal states.\")\n public void testShouldResultInEquality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Hi\");\n\n Assertions.assertThat(os1).isEqualTo(os2);\n }", "public void testEquals()\n {\n // test passing null to equals returns false\n // (as specified in the JDK docs for Object)\n EthernetAddress x =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"equals(null) didn't return false\",\n x.equals((Object)null));\n \n // test passing an object which is not a EthernetAddress returns false\n assertFalse(\"x.equals(non_EthernetAddress_object) didn't return false\",\n x.equals(new Object()));\n \n // test a case where two EthernetAddresss are definitly not equal\n EthernetAddress w =\n new EthernetAddress(ANOTHER_VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == w didn't return false\",\n x == w);\n assertFalse(\"x.equals(w) didn't return false\",\n x.equals(w));\n\n // test refelexivity\n assertTrue(\"x.equals(x) didn't return true\",\n x.equals(x));\n \n // test symmetry\n EthernetAddress y =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertTrue(\"y.equals(x) didn't return true\",\n y.equals(x));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n \n // now we'll test transitivity\n EthernetAddress z =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertFalse(\"x == y didn't return false\",\n y == z);\n assertFalse(\"x == y didn't return false\",\n x == z);\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"y.equals(z) didn't return true\",\n y.equals(z));\n assertTrue(\"x.equals(z) didn't return true\",\n x.equals(z));\n \n // test consistancy (this test is just calling equals multiple times)\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n }", "boolean _is_equivalent(org.omg.CORBA.Object other);", "@Override\r\n\tpublic boolean equals(Object vec) {\r\n\t\tif (vec == null)\r\n\t\t\treturn false;\r\n\t\ttry {\r\n\t\t\treturn (Util.fuzzyEquals(this.getX(),\r\n\t\t\t\t\t((Vector) vec).getX()) && Util.fuzzyEquals(\r\n\t\t\t\t\tthis.getY(), ((Vector) vec).getY()));\r\n\t\t} catch (ClassCastException ex) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void testEquals() {\n XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n XIntervalDataItem item2 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);\n item2 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);\n item2 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);\n item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);\n item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);\n }", "@org.junit.Test\n public void inverser_vector() throws Exception {\n //voici un commentaire\n Vector<Integer> inppuut = new Vector<Integer>();\n inppuut.add(1);\n inppuut.add(2);\n inppuut.add(3);\n inppuut.add(4);\n\n Vector<Integer> expec = new Vector<Integer>();\n expec.add(4);\n expec.add(3);\n expec.add(2);\n expec.add(1);\n\n VectorHelper.inverser_vector(inppuut);\n assertEquals(expec, inppuut);\n\n }", "public boolean equals(MyVector V) {\n if (V.ON != ON) return false;\n V.compress();\n compress();\n for (int i = 0; i < ON; i++) {\n if (!V.O[i].equals(O[i])) return false;\n }\n return true;\n }", "public boolean equals(Object o);", "public boolean\n\tequals( Vector3 other ) \n\t{\n\t\treturn( data[0] == other.data[0]\n\t\t\t&& data[1] == other.data[1]\n\t\t\t&& data[2] == other.data[2] );\n\t}", "@org.testng.annotations.Test\n public void test_equals_Symmetric()\n throws Exception {\n CategorieClient categorieClient = new CategorieClient(\"denis\", 1000, 10.2, 1.1, 1.2, false);\n Client x = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Client y = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Assert.assertTrue(x.equals(y) && y.equals(x));\n Assert.assertTrue(x.hashCode() == y.hashCode());\n }", "@Override // com.google.common.base.Equivalence\n public boolean doEquivalent(Object a, Object b) {\n return a.equals(b);\n }", "public boolean equals(Object object);", "@Override // com.google.common.base.Equivalence\n public boolean doEquivalent(Object a, Object b) {\n return false;\n }", "public static boolean Match(Vector a, Vector b){\n return a.axis.length == b.axis.length;\n }", "public abstract boolean equals(Object other);", "boolean equivalent(Concept x, Concept y);", "public boolean equals( Object obj );", "@Override public boolean equals(Object object);", "@Test\n @DisplayName(\"Test should detect inequality between unequal states.\")\n public void testShouldResultInInequality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Goodbye\");\n\n Assertions.assertThat(os1).isNotEqualTo(os2);\n }", "@Test\n public void equalsTest() {\n prepareEntitiesForEqualityTest();\n\n assertEquals(entity0, entity1);\n }", "@Test\n public void testEquals() {\n Coctail c1 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n Coctail c2 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n assertEquals(c1, c2);\n }", "@Override\n boolean equals(Object other);", "public abstract boolean equals(Object o);", "boolean canEqual(Object obj);", "@Test\n public void testEquals_sameParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are equivalent\n assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr);\n }", "public boolean equals(Object obj);", "@Test\n public void testEquals() {\n System.out.println(\"Animal.equals\");\n Animal newAnimal = new Animal(252, \"Candid Chandelier\", 10, \"Cheetah\", 202);\n assertTrue(animal1.equals(newAnimal));\n assertFalse(animal2.equals(newAnimal));\n }", "public static boolean operator ==(LocalValueEnumerator obj1, LocalValueEnumerator obj2)\r\n { \r\n return obj1.Equals(obj2); \r\n }", "boolean equalTo(ObjectPassDemo o) {\n return (o.a == a && o.b == b);\n }", "@Override\n boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "@Test\n\tpublic void test_TCM__boolean_equals_Object() {\n\t\tfinal Attribute attribute = new Attribute(\"test\", \"value\");\n\n assertFalse(\"attribute equal to null\", attribute.equals(null));\n\n final Object object = attribute;\n assertTrue(\"object not equal to attribute\", attribute.equals(object));\n assertTrue(\"attribute not equal to object\", object.equals(attribute));\n\n // current implementation checks only for identity\n// final Attribute clonedAttribute = (Attribute) attribute.clone();\n// assertTrue(\"attribute not equal to its clone\", attribute.equals(clonedAttribute));\n// assertTrue(\"clone not equal to attribute\", clonedAttribute.equals(attribute));\n\t}", "public abstract boolean doEquivalent(T t, T t2);", "boolean equals(Object object);", "public final boolean equals (Object obj) {\n if (obj instanceof IntVector) {\n IntVector v = (IntVector)obj;\n if (isEmpty())\n return v.isEmpty();\n else\n return !v.isEmpty() &&\n head == v.head() &&\n tail.equals(tail);\n } else\n return false;\n }", "@Test\n\tpublic void objectEqualsTest() {\n\t\tAssert.assertEquals(service1, service2);\n\t\tAssert.assertSame(service1, service2);\n\t}", "@Override\n public boolean equals(Object other) {\n return this == other;\n }", "@Override \n boolean equals(Object obj);", "private static boolean equiv(VObject src, VObject dst)\n {\n return ((src.getId() != null && src.getId().equals(dst.getId()))\n || (src.getSid() != null && src.getSid().equals(dst.getSid())) \n || (src.getName() != null && src.getName().equals(dst.getName())));\n }", "@Override\n public VectorEquality compareTo(PredicateVector vectorCmp) {\n try {\n PredicateVector vectorLarge;\n PredicateVector vectorSmall;\n VectorEquality cmpResult;\n \n if (flagged || vectorCmp.flagged) {\n return VectorEquality.UNIQUE;\n }\n \n // TODO: add size check\n \n if (this.size() > vectorCmp.size() && !this.values().iterator().next().isEmpty()) {\n vectorLarge = this;\n vectorSmall = vectorCmp;\n cmpResult = VectorEquality.SUPERSET;\n } else {\n vectorLarge = vectorCmp;\n vectorSmall = this;\n cmpResult = VectorEquality.SUBSET;\n }\n \n int largeVectorIter = 0;\n int numEq = 0;\n \n List<Integer> vectorSmallKeys = new ArrayList<Integer>(vectorSmall.keySet());\n Collections.sort(vectorSmallKeys);\n \n List<Integer> vectorLargeKeys = new ArrayList<Integer>(vectorLarge.keySet());\n Collections.sort(vectorLargeKeys);\n\n int i = 0;\n\n for (Integer smallVectorKey: vectorSmallKeys) {\n StateVector smallVectorState = vectorSmall.get(smallVectorKey);\n // Check if we have not iterated over all large vector states\n if (largeVectorIter >= vectorLargeKeys.size() && !smallVectorState.isEmpty()) {\n cmpResult = VectorEquality.UNIQUE;\n break;\n }\n \n \n for (i = largeVectorIter; i < vectorLargeKeys.size(); i++) {\n StateVector largeVectorState = vectorLarge.get(vectorLargeKeys.get(i));\n VectorEquality cmpVectorResult = smallVectorState.compareTo(largeVectorState); \n if (cmpVectorResult == VectorEquality.EQUAL) {\n numEq += 1;\n break;\n }\n \n if (cmpVectorResult == VectorEquality.SUPERSET || cmpVectorResult == VectorEquality.SUBSET) {\n cmpResult = cmpVectorResult;\n numEq += 1;\n break;\n }\n }\n \n largeVectorIter = i + 1; // TODO: double check i+1\n }\n \n if (numEq < vectorSmall.size() && !vectorSmall.values().iterator().next().isEmpty())\n cmpResult = VectorEquality.UNIQUE;\n \n return cmpResult;\n } catch (ArrayIndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n \n return VectorEquality.UNIQUE;\n }", "@Test\n public void testEqualsMethodEqualObjects() {\n String name = \"A modifier\";\n int cost = 12;\n\n Modifier m1 = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n Modifier m2 = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n\n assertTrue(m1.equals(m2));\n }", "@Test\n\tpublic void testEqualsVerdadeiro() {\n\t\t\n\t\tassertTrue(contato1.equals(contato3));\n\t}", "public void testEqualsObject()\n {\n // Null check\n assertFalse(b1.equals(null));\n // Type mismatch\n assertFalse(b1.equals(\"a\"));\n\n // Reflexive\n assertTrue(b1.equals(b1));\n\n // In general, two empty boards\n assertTrue(b1.equals(b2));\n\n // Different contents\n b1.setCell(0, 0, Cell.RED1);\n assertFalse(b1.equals(b2));\n\n // Same Contents\n b2.setCell(0, 0, Cell.RED1);\n assertTrue(b1.equals(b2));\n\n // Some more complex cases\n b1.fromString(\"RRRBEEBBE\");\n assertFalse(b1.equals(b2));\n b2.fromString(\"RRRBEEBBE\");\n assertTrue(b1.equals(b2));\n\n }", "@Test\n public void testGetValues(){\n assertTrue(vector.x == 1 && vector.z == 1);\n }", "@Override\n\tpublic abstract boolean equals(Object other);", "@Test\n\tpublic void test_equals1() {\n\tTvShow t1 = new TvShow(\"Sherlock\",\"BBC\");\n\tTvShow t2 = new TvShow(\"Sherlock\",\"BBC\");\n\tassertTrue(t1.equals(t2));\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Receta instance = new Receta();\n instance.setNombre(\"nom1\");\n Receta instance2 = new Receta();\n instance.setNombre(\"nom2\");\n boolean expResult = false;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }", "@Test\n public void testEquals04() {\n System.out.println(\"equals\");\n\n Set<City> cities = new HashSet<>();\n cities.add(new City(new Pair(41.243345, -8.674084), \"city0\", 28));\n cities.add(new City(new Pair(41.237364, -8.846746), \"city1\", 72));\n cities.add(new City(new Pair(40.519841, -8.085113), \"city2\", 81));\n cities.add(new City(new Pair(41.118700, -8.589700), \"city3\", 42));\n cities.add(new City(new Pair(41.467407, -8.964340), \"city4\", 64));\n cities.add(new City(new Pair(41.337408, -8.291943), \"city5\", 74));\n cities.add(new City(new Pair(41.314965, -8.423371), \"city6\", 80));\n cities.add(new City(new Pair(40.822244, -8.794953), \"city7\", 11));\n cities.add(new City(new Pair(40.781886, -8.697502), \"city8\", 7));\n cities.add(new City(new Pair(40.851360, -8.136585), \"city9\", 65));\n\n Object otherObject = new SocialNetwork(new HashSet(), cities);\n boolean result = sn10.equals(otherObject);\n assertFalse(result);\n }", "public void equals() {\r\n // todo Implement this java.lang.Object method\r\n throw new UnsupportedOperationException(\"Method equals() not yet implemented.\");\r\n }", "@Override\n public boolean equals(Object o) {\n return o instanceof LuaInteger ? ((LuaInteger) o).v == v : false;\n }", "@Override\n public abstract boolean equals(Object other);", "@Override\n public abstract boolean equals(Object other);", "@Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n final Vector3 other = (Vector3) obj;\n if (Double.doubleToLongBits(this.x) != Double.doubleToLongBits(other.x)) {\n return false;\n }\n if (Double.doubleToLongBits(this.y) != Double.doubleToLongBits(other.y)) {\n return false;\n }\n if (Double.doubleToLongBits(this.z) != Double.doubleToLongBits(other.z)) {\n return false;\n }\n if (Double.doubleToLongBits(this.magnitude) != Double.doubleToLongBits(other.magnitude)) {\n return false;\n }\n return true;\n }", "@Override\n boolean equals(Object obj);", "public boolean _is_equivalent(Object that) {\n return equals(that) ;\n }", "public boolean equals(CFun other);", "public boolean isEqual(Object objectname1, Object objectname2, Class<?> voClass) {\n\t\treturn false;\n\t}", "@Test\n public void testEquals_differentParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI + 1,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are different\n assertThat(cellIdentityNr).isNotEqualTo(anotherCellIdentityNr);\n }", "protected abstract boolean equalityTest(Object key, Object key2);", "public boolean abstractEqualTo(AbstractData that)\n {\n\treturn equalTo((FullPositionVector)that);\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Commissioner instance = new Commissioner();\n Commissioner instance2 = new Commissioner();\n instance.setLogin(\"genie\");\n instance2.setLogin(\"genie\");\n boolean expResult = true;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }", "public boolean equals( Object other ){\r\n\t\t if (!(other instanceof ChainedArrays))\r\n\t\t\t return false;\r\n\t\t Iterator<T> it1 = this.iterator();\r\n\t\t @SuppressWarnings(\"unchecked\")\r\n\t\t ChainedArrays<T> other_casted = (ChainedArrays<T>) other;\r\n\t\t Iterator<T> it2 = other_casted.iterator();\r\n\t\t boolean ans = true;\r\n\t\t while(it1.hasNext()&&it2.hasNext()){\r\n\t\t\t ans &= isEqual( it1.next( ), it2.next( ) );\r\n\t\t }\r\n\t\t return ans;\r\n\t}", "public static void assertInEqualStrict( Object expected, Object actual ){\r\n\t\tassertInEqual( expected, actual );\r\n\t\tassertTrue( \r\n\t\t\tString.format(\"%s.hashcode() is expected to be inequal to %s.hashcode()\", expected, actual), \r\n\t\t\t!expected.equals(actual) );\t\r\n\t}", "public boolean equivalentInteractions(InteractionObject first, InteractionObject second) {\n\t\tboolean result = \n\t\t\tfirst.getType() == second.getType() &&\n\t\t\tfirst.getIndex() == second.getIndex();\n\t\treturn result;\n\t}", "public boolean equals(Object other) {\n //first make sure that the object is an arraylist\n //and also make sure that it isnt null\n if (other == null || !(other instanceof ArrayList)) {\n return false;\n }\n \n //type cast the argument into an array, now that we know that it is one\n ArrayList<E> that = (ArrayList<E>) other;\n \n //check to see if the lengths are the same\n if (this.array.length == that.array.length) {\n //if the lengths are the same, check each value to see if they are the same\n //loop through the array only once\n for (int i = 0; i < this.array.length; i++) {\n //compare the elements of each index\n if (this.array[i] == that.array[i]) {\n //continue to check all elements\n continue;\n } else {\n //if one of the elements aren't the same, return false\n return false;\n }\n }\n } else {\n //return false if the lengths are not the same\n return false;\n }\n \n //if it gets through the loop, then all of the elements are equal \n return true;\n }", "boolean equals(Object obj);", "boolean equals(Object obj);", "@Override\n public abstract boolean equals(Object obj);", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object object = null;\n Reserva instance = new Reserva();\n boolean expResult = false;\n boolean result = instance.equals(object);\n assertEquals(expResult, result);\n \n }", "public boolean isIdentical(Remote obj1, Remote obj2)\n {\n\torg.omg.CORBA.Object corbaObj1 = (org.omg.CORBA.Object)obj1;\n\torg.omg.CORBA.Object corbaObj2 = (org.omg.CORBA.Object)obj2;\n\n\treturn corbaObj1._is_equivalent(corbaObj2);\n }", "@Override\n public boolean equals(Object o) {\n return this == o;\n }", "@Test\r\n\tpublic void testEqualsEU() {\r\n\t\tExternUnit externu2 = externu1.clone();\r\n\t\tassertTrue(externu1.equals(externu2));\r\n\t}", "public void testEqualsObject() {\n\t\t\tTipoNodoLeisure tipo1 = new TipoNodoLeisure(Messages.getString(\"TipoNodoLeisureTest.0\")); //$NON-NLS-1$\n\t\t\tTipoNodoLeisure tipo2= new TipoNodoLeisure(Messages.getString(\"TipoNodoLeisureTest.1\")); //$NON-NLS-1$\n\t\t\tTipoNodoLeisure tipo3= new TipoNodoLeisure(Messages.getString(\"TipoNodoLeisureTest.2\")); //$NON-NLS-1$\n\t\t\tif (tipo1 != tipo1)\n\t\t\t\tfail(Messages.getString(\"TipoNodoLeisureTest.3\")); //$NON-NLS-1$\n\t\t\tif (!tipo1.equals(tipo2))\n\t\t\t\tfail(Messages.getString(\"TipoNodoLeisureTest.4\"));\t\t\t //$NON-NLS-1$\n\t\t\tif (tipo1.equals(tipo3))\n\t\t\t\tfail(Messages.getString(\"TipoNodoLeisureTest.5\"));\t //$NON-NLS-1$\n\t\t}", "@Test\n public void testEqualsMethodDifferentObjects() {\n String name = \"A modifier\";\n int cost = 12;\n\n Modifier m1 = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n\n assertFalse(m1.equals(new Object()));\n }", "public static boolean equalsUnordered( Collection<?> collection1, Collection<?> collection2 )\r\n {\r\n //\r\n boolean retval = collection1.size() == collection2.size();\r\n \r\n //\r\n for ( Object iObject : collection1 )\r\n {\r\n retval &= collection2.contains( iObject );\r\n }\r\n \r\n //\r\n return retval;\r\n }", "public boolean realEquals(Object o){\n\t\treturn keywords.equals(o);\n\t}", "public boolean equals(Vector2F v) {\n\t\treturn (this.xPos == v.xPos && this.yPos == v.yPos);\n\t}", "@Override\n public boolean equals(Object v) {\n if (this == v) return true;\n if (v == null || getClass() != v.getClass()) return false;\n Vet vet = (Vet) v;\n return id == vet.id;\n }", "private boolean rangeEquals(Object [] b1, Object [] b2, int length)\n /*! #end !*/\n {\n for (int i = 0; i < length; i++)\n {\n if (!Intrinsics.equalsKType(b1[i], b2[i]))\n {\n return false;\n }\n }\n\n return true;\n }", "@Test\n public void testEquals() throws Exception {\n\n File file = File.createTempFile(\"oasis-collection-test-persistence\", \"\");\n file.mkdirs();\n file.deleteOnExit();\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1);\n instance.addAll(c);\n\n SegmentedOasisList<Integer> readInstance;\n\n try (ObjectOutputStream outObjStream = new ObjectOutputStream(new FileOutputStream(file))) {\n outObjStream.writeObject(instance);\n }\n\n try (ObjectInputStream inObjStream = new ObjectInputStream(new FileInputStream(file))) {\n readInstance = (SegmentedOasisList<Integer>) inObjStream.readObject();\n }\n\n assertEquals(instance, readInstance);\n\n }" ]
[ "0.6972197", "0.691968", "0.67698556", "0.67203367", "0.66702485", "0.6518693", "0.63830745", "0.63781255", "0.6371607", "0.6358009", "0.6341278", "0.6316928", "0.62413335", "0.6156901", "0.6151393", "0.6130774", "0.6105292", "0.61026716", "0.60958534", "0.6062969", "0.6054043", "0.60530853", "0.6037177", "0.59807646", "0.5969798", "0.59656864", "0.5961675", "0.5959221", "0.59536946", "0.59523934", "0.59418243", "0.5935289", "0.59019935", "0.589033", "0.5878571", "0.5866733", "0.5858789", "0.5843282", "0.5840831", "0.58355993", "0.58350825", "0.58278656", "0.5824604", "0.5786458", "0.57815313", "0.5769801", "0.5768613", "0.5768613", "0.5768613", "0.5768613", "0.5768613", "0.57572013", "0.5756541", "0.5748763", "0.5747055", "0.5740751", "0.5731098", "0.57245964", "0.5720553", "0.5714052", "0.5710939", "0.57060695", "0.5680774", "0.5674474", "0.5672008", "0.5667471", "0.5660476", "0.5650682", "0.56475896", "0.5643207", "0.5642396", "0.5642396", "0.5632812", "0.56165177", "0.5616282", "0.5616274", "0.56084585", "0.56006515", "0.5583936", "0.55805373", "0.5568803", "0.5568715", "0.5565987", "0.5555977", "0.5555422", "0.55539995", "0.55539995", "0.5552069", "0.5550926", "0.5548349", "0.5547986", "0.5544417", "0.5535442", "0.5528728", "0.5525604", "0.5522138", "0.5521106", "0.55210155", "0.55159295", "0.5515628" ]
0.60203004
23
Truncate the vector to n elements, if it has more.
public void truncate(int n) { if (n >= ON) return; compress(); for (int i = n; i < OLast; i++) O[i] = null; OLast = ON = n; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void truncate(int limit);", "public void truncate() {\n if (this.size > this.limit) {\n removeFirst();\n }\n }", "private static void trim( List<?> list, int n ) {\n \twhile (list.size() > n) {\n \t\tlist.remove(list.size() - 1);\n \t}\n }", "public void trimToSize() {\r\n for (int i=size(); i-->0;)\r\n if (get(i)==null)\r\n remove(i);\r\n }", "public void truncate(long len)\n\t{\n\t\tthrow new UnsupportedOperationException();\n\t}", "private void resize(int capacity) {\r\n assert capacity >= n;\r\n Item[] temp = (Item[]) new Object[capacity];\r\n for (int i = 0; i < n; i++) {\r\n temp[i] = list[(first + i) % list.length];\r\n }\r\n list = temp;\r\n first = 0;prior=list.length-1;\r\n last = n-1;latter=n;}", "public void trimToSize();", "private static byte[] leftTruncateOrPadByteArray(byte[] b, int n) {\n if (b.length > n) {\n return Arrays.copyOfRange(b, Math.max(b.length - n, 0), b.length);\n } else if (b.length < n) {\n byte[] bPadded = new byte[n];\n System.arraycopy(b, 0, bPadded, Math.max(0, n - b.length), b.length);\n return bPadded;\n }\n return b;\n }", "private void resize(int capacity)\r\n {\r\n assert capacity >= n;\r\n Item[] temp = (Item[]) new Object[capacity];\r\n for (int i = 0; i < n; i++)\r\n temp[i] = a[i];\r\n a = temp;\r\n }", "private void grow(int n) {\n\t\tint newSize = length + n;\n\t\tif (newSize > limit) {\n\t\t\t// find smallest power of 2 greater than newSize\n\t\t\tlimit = (int) Math.pow(2, Math.ceil(Math.log(newSize) / LN2));\n\t\t\tfloat[] newBuffer = new float[limit];\n\t\t\tSystem.arraycopy(data, 0, newBuffer, 0, length);\n\t\t\tdata = newBuffer;\n\t\t}\n\t}", "private void resize(int capacity) {\n assert capacity >= n;\n\n Item[] temp = (Item[]) new Object[capacity];\n for (int i = 0; i < n; i++) {\n temp[i] = a[i];\n }\n a = temp;\n }", "@SuppressWarnings(\"unchecked\")\n /* #end */\n public void trimToSize()\n {\n\t\tthrow new UnsupportedOperationException(lengthChangeError);\n }", "@Test\n public void testRemove_int_Size_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n Collection c = Arrays.asList(1, 1, 7, 1, 1, 1, 1);\n instance.addAll(c);\n\n instance.remove(2);\n\n Integer expResult = 6;\n Integer result = instance.size();\n\n assertEquals(expResult, result);\n\n }", "@Override\n public void splice(ThreadContext tc, SixModelObject from, long offset, long count) {\n long elems0 = elems;\n long elems1 = from.elems(tc);\n long start;\n long tail;\n double[] slots = null;\n\n /* start from end? */\n if (offset < 0) {\n offset += elems0;\n\n if (offset < 0)\n throw ExceptionHandling.dieInternal(tc, \"VMArray: Illegal splice offset\");\n }\n\n /* When offset == 0, then we may be able to reduce the memmove\n * calls and reallocs by adjusting SELF's start, elems0, and\n * count to better match the incoming splice. In particular,\n * we're seeking to adjust C<count> to as close to C<elems1>\n * as we can. */\n if (offset == 0) {\n long n = elems1 - count;\n start = this.start;\n if (n > start)\n n = start;\n if (n <= -elems0) {\n elems0 = 0;\n count = 0;\n this.start = 0;\n this.elems = (int)elems0;\n }\n else if (n != 0) {\n elems0 += n;\n count += n;\n this.start = (int)(start - n);\n this.elems = (int)elems0;\n }\n }\n\n /* if count == 0 and elems1 == 0, there's nothing left\n * to copy or remove, so the splice is done! */\n if (count == 0 && elems1 == 0)\n return;\n\n /* number of elements to right of splice (the \"tail\") */\n tail = elems0 - offset - count;\n if (tail < 0)\n tail = 0;\n\n else if (tail > 0 && count > elems1) {\n /* We're shrinking the array, so first move the tail left */\n slots = this.slots;\n start = this.start;\n memmove(slots, start + offset + elems1, start + offset + count, tail);\n }\n\n /* now resize the array */\n set_size_internal(tc, offset + elems1 + tail);\n\n slots = this.slots;\n start = this.start;\n if (tail > 0 && count < elems1) {\n /* The array grew, so move the tail to the right */\n memmove(slots, start + offset + elems1, start + offset + count, tail);\n }\n\n /* now copy C<from>'s elements into SELF */\n if (elems1 > 0) {\n int i;\n int from_pos = (int)(start + offset);\n for (i = 0; i < elems1; i++) {\n from.at_pos_native(tc, i);\n slots[from_pos + i] = tc.native_n;\n }\n }\n }", "private int cap(long n) {\n\t\t\treturn (int) Math.min(RandomAccessDataFile.this.length - this.position, n);\n\t\t}", "private void resize() {\n Point[] temp = new Point[2*N+1];\n for (int i = 0; i <= N; i++) temp[i] = a[i];\n a = temp;\n }", "public void trimToSize() {\n }", "private static Vector emptyVector (int size)\n\t{\n\t\tVector v = new Vector ();\n\t\tfor (int i=0; i <= size; i++)\n\t\t{\n\t\t\tv.add (i, \"\");\n\t\t}\n\t\treturn v;\n\n\t}", "public static <T> List<T> take(int n, Collection<T> c) {\r\n List<T> res = new ArrayList<>(n);\r\n\r\n int counter = 0;\r\n for (T item : c) {\r\n res.add(item);\r\n counter++;\r\n\r\n if (counter >= n) {\r\n break;\r\n }\r\n }\r\n\r\n return res;\r\n }", "@Test\n public void testRemove_Contains_Size_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(1);\n instance.add(1);\n instance.add(1);\n instance.add(1);\n instance.add(1);\n\n instance.remove(new Integer(1));\n\n int expResult = 5;\n int result = instance.size();\n assertEquals(expResult, result);\n }", "@Test\n public void testRemoveAll_Size_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n instance.removeAll(c);\n\n int expectedResult = 0;\n assertEquals(expectedResult, instance.size());\n\n }", "void truncateFile() throws Exception {\n\n long fileSize = outChannel.position(0).size();\n\n long step = fileSize / N;\n\n try {\n\n for (int i = 0; i <= N + 1; ++i) {\n\n outChannel.truncate(fileSize - step * i);\n\n }\n\n } catch (IllegalArgumentException iae) {\n\n // System.out.println(\"IAE\");\n\n // this is just in case to check nothing but exception happens \n // in case of negative size\n }\n\n }", "public void removeItem(int n)\n {\n items.remove(n);\n }", "@Override\n public T removeLast() {\n if (size == 0) {\n return null;\n }\n\n int position = minusOne(nextLast);\n T itemToReturn = array[position];\n array[position] = null;\n nextLast = position;\n size -= 1;\n\n if ((double)size / array.length < 0.25 && array.length >= 16) {\n resize(array.length / 2);\n }\n return itemToReturn;\n }", "public abstract void truncate();", "public void remove(int n) { // not being used\n\t\tcollection.remove(n); \n\t}", "private void resize() {\n if (ifFull() || ifTooEmpty()) {\n int capacity = items.length;\n if (ifFull()) {\n capacity *= 2;\n } else if (ifTooEmpty()) {\n capacity /= 2;\n }\n Item[] newArray = (Item[]) new Object[capacity];\n int lastIndex = moveBack(nextLast, 1);\n int firstIndex = moveForward(nextFirst, 1);\n System.arraycopy(items, 0, newArray, 0, lastIndex + 1);\n int numOfReminder = size - (lastIndex + 1);\n int newFirstIndex = newArray.length - numOfReminder;\n System.arraycopy(items, firstIndex, newArray, newFirstIndex, numOfReminder);\n items = newArray;\n nextFirst = moveBack(newFirstIndex, 1);\n nextLast = moveForward(lastIndex, 1);\n return;\n }\n return;\n }", "@Override\n\tpublic int remove(int n) {\n\t\treturn 0;\n\t}", "public DeleteCollectionInfrastructure limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "private void resize(int max) {\n Item[] temp = (Item[]) new Object[max];\n for (int i = 0; i < N; i++)\n temp[i] = s[i+first];\n first = 0;\n s = temp;\n }", "public void initVector(int n) {\n\t\tvector = new ArrayList<Integer>(n);\n\t\tfor(int i=0;i<n;i++)\n\t\tvector.add(0);\n\t}", "public boolean trim() {\n final int l = arraySize(size, f);\n if (l >= n || size > maxFill(l, f)) return true;\n try {\n rehash(l);\n } catch (Error cantDoIt) {\n return false;\n }\n return true;\n }", "@Override\n // average-case complexity: O(n), since it always needs to shift n-amount\n // of element, where n is propotional to the list/input size\n public void remove(int index) {\n if (arr.length * SHRINK_THRESHOLD > size)\n arr = resize(arr, SHRINK_FACTOR);\n \n // remove the item at the specified index and shift everything right of\n // the given index 1 step to the left\n for (int i = index; i < size-1; i++) {\n arr[i] = arr[i+1];\n }\n // remove the previous last item and then decrement the size\n arr[--size] = null;\n }", "public DeleteCollectionNamespacedComponent limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public void remove(int n) {\n\tif(!contains(n)){\n\t\treturn; //Check\n\t}\t\n\telse{\n\t\tint index = 0;\n\t\tfor(int i = 0; i < size; i++){\n \t\tif(elements[i] == n){\n \t\t\tindex = i;\n \t\t}\n \t\t}\n\t\tfor(int c = 0;c < (size - index) - 1; c++){\n\t\t\telements[index+c] = elements[index+c+1];\n\t\t}\n\t\tsize--;\n\t}\n\n System.out.println(\"Removing \" + n + \"...\");\n }", "private byte[] truncate(ByteBuffer buffer, int length) {\n assert length < buffer.remaining();\n byte[] array = new byte[length];\n buffer.get(array);\n return array;\n }", "public long removeLeft() {\n long temporary = Array[start++];\n if ( start == max ) {\n start = 0;\n }\n nItems--;\n return temporary;\n }", "private void ensureCapacity(int index) {\n\t\t\tint overflow = index - list.size();\n\t\t\twhile (overflow-- >= 0) {\n\t\t\t\tlist.add(null);\n\t\t\t}\n\t\t}", "@Override\n public T removeFirst() {\n if (size == 0) {\n return null;\n }\n\n int position = plusOne(nextFirst);\n T itemToReturn = array[position];\n array[position] = null;\n nextFirst = position;\n size -= 1;\n\n if ((double)size / array.length < 0.25 && array.length >= 16) {\n resize(array.length / 2);\n }\n return itemToReturn;\n }", "public void remove(int index) {\r\n\t\t//checks if the index is valid\r\n\t\tif(index>=0 && index<=size) {\r\n\t\t\tfor (int k=index;k<size;k++) {\t//shifting element\r\n\t\t\t\tlist[k]=list[k+1];\r\n\t\t\t}\r\n\t\t\tsize--;\t\t//decreases size\r\n\t\t\t//checks if the size of array is not 0 and less than 25% of the capacity of the array\r\n\t\t\tif (size!=0 && capacity/size >=4)\r\n\t\t\t\tresize(this.capacity/2);\t//decreasing size of array\r\n\t\t} else {\t//index is not valid\r\n\t\t\tSystem.out.println(\"index \"+index+\" is out or range!\");\r\n\t\t}\r\n\t}", "private void computeRemainingLength() {\n remainingLength = totalLength - nextStepLength;\n // Save the current location in the element list\n int oldIndex = knuthIter.nextIndex();\n KnuthElement el;\n while (knuthIter.hasNext() && !(el = (KnuthElement) knuthIter.next()).isBox()) {\n if (el.isGlue()) {\n remainingLength -= el.getW();\n }\n }\n // Reset the iterator to the current location\n while (knuthIter.nextIndex() > oldIndex) {\n knuthIter.previous();\n }\n }", "static boolean fullyTruncatable(int n, boolean[] composite) {\n if(n == 2 || n == 3 || n == 5 || n == 7) return false;\n return truncLeftToRight(n, composite) && truncRightToLeft(n, composite);\n }", "@Override\n\tpublic IVector nSub(IVector vector) throws OperationNotSupportedException{\n\t\treturn this.copy().sub(vector);\n\t}", "public Vector normalized(){\r\n\t\tfloat len = this.length();\r\n\t\tif( len != 0.0f && len != 1.0f ){\r\n\t\t\treturn new Vector( this.x / len, this.y / len, this.z / len );\r\n\t\t}\r\n\t\treturn this;\r\n\t}", "public long removeRight() {\n long temporary = Array[end--];\n if ( end == -1 ) {\n end = max-1;\n }\n nItems--;\n return temporary;\n }", "public T remove() {\r\n \r\n if (this.isEmpty()) {\r\n return null;\r\n }\r\n \r\n Random r = new Random();\r\n // Randomly selects element to remove and stores in rValue.\r\n int rValue = r.nextInt(size);\r\n // Store removed element in remove\r\n T remove = elements[rValue];\r\n elements[rValue] = null;\r\n \r\n // Move last element to replace \"remove\" if \"remove\" is not last element\r\n if (rValue != (size - 1)) {\r\n elements[rValue] = elements[size - 1];\r\n elements[size - 1] = null;\r\n }\r\n size--;\r\n // If array is less than 25% full, resize to 1/2 of current size.\r\n if (size > 0 && size < elements.length / 4) {\r\n resize(elements.length / 2);\r\n }\r\n return remove;\r\n }", "public void trim(long position);", "public DeleteCollectionIngress limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "private final void fastRemove(final int index) {\r\n\t\tfinal int numMoved = this.size - index - 1;\r\n\t\tif (numMoved > 0) {\r\n\t\t\tSystem.arraycopy( this.elementData, index + 1, this.elementData, index, numMoved );\r\n\t\t}\r\n\t\tthis.elementData[--this.size] = null; // Let gc do its work\r\n\t}", "public void setExtent(int n) {\r\n\r\n int newExtent = Math.max(0, n);\r\n int value = getValue();\r\n if (value + newExtent > max) {\r\n\r\n newExtent = max - value;\r\n\r\n }\r\n setRangeProperties(value, newExtent, min, max, isAdjusting);\r\n }", "public void removeLast( ) {\r\n\t\tremove(size);\r\n\t}", "static int noValueSize() {\r\n return itemSize(false) * 2;\r\n }", "public DeleteCollectionNamespacedSubscription limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public DeleteCollectionProxy limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "private boolean outOfBounds(long n) {\n return n < 0 || n >= getSize();\n }", "private void resizeDown()\n\t{\n\t\tint newSize = myArray.length/2;\n\t\tmyArray = Arrays.copyOf(myArray, newSize);\n\t}", "public DeleteCollectionFeatureGate limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public boolean trimToSize() {\n if(data.length > size) {\n Arrays.copyOf(data, size);\n return true;\n }\n return false;\n }", "private void truncatePosition()\r\n {\n setTranslateX(getTranslateX() - Constants.inchesToPixels(getXInches() % 0.25));\r\n setTranslateY(getTranslateY() + Constants.inchesToPixels(getFlippedYInches() % 0.25));\r\n }", "protected abstract boolean reachedContractLimit(int size);", "private void removeLargeValues(ArrayList<Integer> myList)\n {\n // sort list to make removing values easy\n Collections.sort(myList);\n\n while (myList.size() > 1)\n {\n if (myList.get(myList.size() - 1) > 21)\n myList.remove(myList.size() - 1);\n else\n break;\n }\n }", "public DeleteCollectionBuild limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "private LinkedList<Integer> pollN(LinkedList<Integer> list, int n){\n return new LinkedList<>(list).stream().limit(n).collect(Collectors.toCollection(LinkedList::new));\n }", "public DeleteCollectionAPIServer limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "@Test\n public void testRemoveAll_Not_Empty_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(1);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n instance.removeAll(c);\n\n int expectedResult = 1;\n assertEquals(expectedResult, instance.size());\n\n }", "public void unsetGUVectorLimitValue() throws JNCException {\n delete(\"g-u-vector-limit\");\n }", "public Item removeLast(){\r\n\t\tif (isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\r\n\t\tItem tmp = list[last--];\r\n\t\tn--;\r\n\t\tlatter=last+1;\r\n\t\tif(last==-1){last=list.length-1;}\r\n\t\tif (n > 0 && n == list.length/4) resize(list.length/2); \r\n\t\treturn tmp;}", "public void remove(int index)\r\n\t{\r\n\t\tif(index<0 || index >=n)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Invalid index\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(int i=index;i<n;i++)\r\n\t\t\t{\r\n\t\t\t\ta[i]=a[i+1];\r\n\t\t\t}\r\n\t\t\tn--;\r\n\t\t}\t\t\r\n\t}", "public void truncate() {\n final long firstPage = getPageAddress(0);\n final long pageSize = getMapPageSize();\n Vect.memset(firstPage, pageSize, 0);\n for (int i = 1, n = pages.size(); i < n; i++) {\n release(i, pages.getQuick(i));\n pages.setQuick(i, 0);\n }\n jumpTo(0);\n long fileSize = ff.length(fd);\n if (fileSize > pageSize) {\n if (ff.truncate(fd, pageSize)) {\n return;\n }\n\n // we could not truncate the file; we have to clear it via memory mapping\n long mem = ff.mmap(fd, fileSize, 0, Files.MAP_RW);\n Vect.memset(mem + pageSize, fileSize - pageSize, 0);\n ff.munmap(mem, fileSize);\n LOG.debug().$(\"could not truncate, zeroed [fd=\").$(fd).$(']').$();\n }\n }", "private void overflow(TFNode node) {\r\n if (node.getNumItems() > node.getMaxItems()) {\r\n split(node);\r\n }\r\n }", "public DeleteCollectionDNS limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public ListNode removeNthFromEnd(ListNode head, int n) {\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode slowPointer = dummy;\n ListNode fastPointer = dummy;\n for(int i = 0; i <= n; i ++){\n fastPointer = fastPointer.next;\n }\n \n while(fastPointer != null){\n fastPointer = fastPointer.next;\n slowPointer = slowPointer.next;\n }\n slowPointer.next = slowPointer.next.next;\n return dummy.next;\n }", "public void setNPoints(int nPoints) {\n\t\tpoints.subList(nPoints, points.size()).clear();\n\t}", "@Test\n public void testRemoveAtIndexNoResize() {\n //No Resize\n for (int i = 0; i < 9; i++) {\n String input = String.format(\"b0%d\", i);\n list.addToBack(input);\n }\n list.removeAtIndex(4);\n int actualCapacity = ((Object[]) (list.getBackingArray())).length;\n Assert.assertEquals(\"The list resized when removing an element from a list while at capacity\",\n ArrayList.INITIAL_CAPACITY, actualCapacity);\n\n //With Resize\n list.addToBack(\"Filler1\");\n list.addToBack(\"Filler2\");\n list.addToBack(\"Filler3\");\n list.removeAtIndex(0);\n list.removeAtIndex(3);\n list.removeAtIndex(8);\n int newActualCapacity = ((Object[]) (list.getBackingArray())).length;\n Assert.assertEquals(\"The list resized when moving from above to below initial capacity.\",\n ArrayList.INITIAL_CAPACITY * 2, newActualCapacity);\n }", "public int size(){return n;}", "void remove (int offset, int size);", "public void grow(int n) {\r\n\t\t// implementation not shown\r\n\t}", "public void sizeDecrease1() {\n\t\t _size--;\n\t}", "public static CharSequence truncate(CharSequence orig, int maxLength, CharSequence ellipsis) {\n int len = orig.length();\n if (len <= Checks.greaterThanZero(\"maxLength\", maxLength)) {\n return orig;\n }\n int end = Math.min(maxLength, len);\n int maxFudge = Math.max(2, Math.max(end - (maxLength / 3), end - MAX_ELLIPSIS_SKEW));\n while (end > maxFudge && Character.isWhitespace(orig.charAt(end - 1))) {\n end--;\n }\n if (end >= len - 1 || !Character.isWhitespace(orig.charAt(end + 1))) {\n for (int i = Math.min(len - 1, end); i >= maxFudge; i--) {\n if (Character.isWhitespace(orig.charAt(i))) {\n end = i;\n break;\n }\n }\n }\n if (ellipsis == null || ellipsis.length() == 0) {\n return orig.subSequence(0, end);\n }\n return new AppendableCharSequence(orig.subSequence(0, end), ellipsis);\n }", "private void ensureCapacity() {\n\t\n\t\tif (elements.length == size) {\n\t\t\tT[] oldElements = elements;\n\t\t\t\n\t\t\telements = (T[]) new Object[2 * elements.length + 1];\n\t\t\t\n\t\t\tSystem.arraycopy(oldElements, 0, elements, 0, size);\n\t\t\n\t\t}\n\t\n\t}", "private void ensureCapacity()\n\t{\n\t\tif (elements.length == size)\n\t\t\telements = Arrays.copyOf(elements, 2 * size + 1);\n\t}", "public void truncateFinal() {\n trimHead();\n }", "public void setMaxSize(int size) {\n maxSize = size;\n while (size() > maxSize) {\n remove(0);\n }\n }", "@SuppressWarnings(\"unchecked\")\n private void resize() {\n int newCap = Math.max(capacity*2, DEFAULT_CAP);\n if(size < list.length) return;\n \n Object[] temp = new Object[newCap];\n for(int i = 0; i < list.length; i++) {\n temp[i] = list[i];\n }\n list = (E[])temp;\n capacity = newCap;\n }", "private boolean ifTooEmpty() {\n if (items.length <= 8) {\n return false;\n }\n float efficiency = (float) size / (float) items.length;\n return efficiency < 0.25;\n }", "public Vector normalize() {\n double num=1/length();\n head = scale(num).head;\n return this;\n }", "public ListNode removeNthFromEnd(ListNode head, int n) {\n // want deep to probe to end, with nBack lagging behind\n ListNode deep = head, nBack = head;\n // put deep n ahead\n for (int i = 0; i < n; i++) {\n deep = deep.next;\n }\n\n // if deep has gone through whole list, then we're just removing first element\n if (deep == null) {\n return head.next;\n }\n\n // move them both down together until deep gets to end\n while (deep.next != null) {\n deep = deep.next;\n nBack = nBack.next;\n }\n\n // cut node out of list\n nBack.next = nBack.next.next;\n return head;\n }", "public abstract void eraseRange(int index, int count, int validSize);", "public DeleteCollectionClusterVersion limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public void fillVector(){\n int n = min.length;\n for (int i = 0; i < n; i++) {\n this.x[i] = min.x[i] + (max.x[i] - min.x[i])*rn.uniformDeviate();\n }\n }", "private void ensureCapacity() {\n if(size() >= (0.75 * data.length)) // size() == curSize\n resize(2 * size());\n }", "public final ByteIterator limitedTo(final int size) {\n if (size <= 0 || ! hasNext()) {\n return EMPTY;\n }\n return new LimitedByteIterator(this, size);\n }", "protected void trimToSize() {\n\tnodeList.trimToSize();\n\tedgeList.trimToSize();\n }", "public int removeItem(Item item, int n)\r\n {\r\n if(n < VALID_VALUE)\r\n {\r\n System.out.println(\"Error: Your request cannot be completed at this time. Problem: cannot \" +\r\n \"remove a negative number of items of type \" + item.getType());\r\n return INVALID_VALUE;\r\n }\r\n if(this.getItemCount(item.getType()) < n)\r\n {\r\n System.out.println(\"Error: Your request cannot be completed at this time. Problem: the locker \" +\r\n \"does not contain \" + n + \" items of type \" + item.getType());\r\n return INVALID_VALUE;\r\n }\r\n this.getInventory().replace(item.getType(), this.getItemCount(item.getType()) - n);\r\n this.setCurOccupiedCapacity(this.getCurOccupiedCapacity() - n * item.getVolume());\r\n return VALID_VALUE;\r\n }", "private void shrink() {\n int shrinkSize = array.length>>1;\n array = Arrays.copyOf(array, shrinkSize);\n }", "@Override\n public void ensureCapacity(int index) {\n\n }", "@Test\n public void testRemove_int_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n Collection c = Arrays.asList(1, 1, 7, 1, 1, 1, 1);\n instance.addAll(c);\n\n Integer expResult = 7;\n Integer result = instance.remove(2);\n\n assertEquals(expResult, result);\n\n }", "@Override\n public Builder limitVocabularySize(int limit) {\n super.limitVocabularySize(limit);\n return this;\n }", "void resize(int newSize);", "public DeleteCollectionConsole limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }" ]
[ "0.6411758", "0.61537164", "0.5974539", "0.5559987", "0.53897136", "0.53222346", "0.5218205", "0.51302254", "0.5023491", "0.50189716", "0.501174", "0.5001852", "0.4977843", "0.4965593", "0.4953537", "0.49307498", "0.49222496", "0.49067786", "0.4900655", "0.48620975", "0.48457453", "0.48273426", "0.48233277", "0.4816924", "0.48065716", "0.4803783", "0.47934175", "0.47930372", "0.475469", "0.47127625", "0.47029924", "0.46819815", "0.4677936", "0.4657709", "0.46481192", "0.4637242", "0.46323964", "0.4623893", "0.46124393", "0.45917988", "0.45785046", "0.45659554", "0.45507038", "0.45478326", "0.4547002", "0.454222", "0.4517332", "0.45103002", "0.45051774", "0.45024902", "0.44936255", "0.44893825", "0.4488094", "0.44819954", "0.44784015", "0.44673505", "0.44581097", "0.4458073", "0.44553617", "0.44518542", "0.44508705", "0.44482997", "0.44463646", "0.44451287", "0.44423026", "0.4429047", "0.4419895", "0.4413746", "0.4410808", "0.4407305", "0.44070196", "0.4406364", "0.4403197", "0.43996498", "0.43992266", "0.4398775", "0.4397893", "0.43978184", "0.43963328", "0.43955687", "0.4395058", "0.4395014", "0.43930057", "0.43898496", "0.43828863", "0.43826622", "0.43781307", "0.4376552", "0.4374443", "0.43654454", "0.4363607", "0.43615124", "0.43601787", "0.43501446", "0.43493727", "0.43432024", "0.43417314", "0.43386295", "0.43371454", "0.43329227" ]
0.64103174
1
Gets a map that contains attributes that aren't bound to any typed property on this class. the map is keyed by the name of the attribute and the value is the string value of the attribute. the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.
public Map<QName, String> getOtherAttributes() { return otherAttributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map<String,Object> getAttributeMap() {\r\n return Maps.newHashMap(attributeMap);\r\n }", "BidiMap<String, DictionarySimpleAttribute> getUnmodifiableAttributes() {\n\t\treturn UnmodifiableBidiMap.unmodifiableBidiMap(this.attributes);\n\t}", "@Override\n\tpublic Map<String, Object> getAttributeMap() {\n\t\treturn null;\n\t}", "public Map<String, String> getAttributes() {\n return Collections.unmodifiableMap(attributes);\n }", "public final Map<String, DomAttr> getAttributesMap() {\n return attributes_;\n }", "java.util.Map<java.lang.String, java.lang.String> getAttributesMap();", "@Override\r\n\tpublic Map<String, Object> getAttributes() {\n\t\treturn null;\r\n\t}", "public Map<TextAttribute,?> getAttributes(){\n return (Map<TextAttribute,?>)getRequestedAttributes().clone();\n }", "public Map<String, String> getAttributes();", "public Map<String, Object> getAttributes();", "public Map<String, Object> getAttributes();", "public abstract Map<String, Object> getAttributes();", "public abstract Map getAttributes();", "public Map<String, Object> getAttributesMap() {\n\t\treturn this.staticAttributes;\n\t}", "Map<String, String> getAttributes();", "@Override\n\tpublic Attributes getAttributes() {\n\t\treturn (Attributes)map.get(ATTRIBUTES);\n\t}", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "public Map<String, Set<String>> getAttributes() {\n return attributes;\n }", "@Override\r\n\tpublic Map<String, String> getAttributes() {\r\n\t\treturn this.attributes;\r\n\t}", "public Map<String, String> getAttributes() {\n\t\treturn attributes;\n\t}", "public Map getAttributeValueMap() {\n return m_attributeValueMap;\n }", "public Map<String, String> getAttributes() {\n\t\treturn atts;\n\t}", "public Map<String, Object> getAttrs();", "protected Map<String, String> getElementAttributes() {\n // Preserve order of attributes\n Map<String, String> attrs = new HashMap<>();\n\n if (this.getName() != null) {\n attrs.put(\"name\", this.getName());\n }\n if (this.getValue() != null) {\n attrs.put(\"value\", this.getValue());\n }\n\n return attrs;\n }", "public Set<String> getAttributes() {\r\n return attributeMap.keySet();\r\n }", "public Map<String, Object> attributes() {\n Map<String, Object> attributes = new HashMap<String, Object>();\n for (Column column : getColumns()) {\n String name = Strings.camelize(column.getName(), true);\n attributes.put(name, attribute(name));\n }\n return attributes;\n }", "public Map<String, Set<String>> getMapAttrValue() {\n\t\treturn mapAttrValue;\n\t}", "public Map<String, Object> getAttributeValues()\n\t{\n\t\tMap<String, Object> retval = new TreeMap<>();\n\t\t\n\t\tfor (ClassAttribute attribute : attributes.keySet())\n\t\t{\n\t\t\tretval.put(attribute.shortName, attributes.get(attribute));\n\t\t}\n\t\t\n\t\treturn retval;\n\t}", "public HashMap<String, String> GetRawAttributes();", "@Nullable\n public Map<String, Object> getCustomAttributes() {\n return mCustomAttributes;\n }", "public Map getAttributes() {\n Map common = channel.getAttributes();\n \n if(map == null) {\n map = new HashMap(common);\n }\n return map;\n }", "@Override\n\tpublic AttributeMap getAttributes() {\n\t\treturn defaultEdgle.getAttributes();\n\t}", "public Map<QName, String> getOtherAttributes() {\r\n return otherAttributes;\r\n }", "@Override\n public synchronized Set<AttributeType> getAttributes() {\n return attributes = nonNullSet(attributes, AttributeType.class);\n }", "Map getPassThroughAttributes();", "Map getGenAttributes();", "public PropertyMap createAttributeMap(XMLName attributeName)\n {\n checkState();\n return super.createAttributeMap(attributeName);\n }", "Map<String, ?> attributesWithQuotes() {\n return attributesWithQuotes(true);\n }", "private static Map<String, String> createPropertiesAttrib() {\r\n Map<String, String> map = new HashMap<String, String>();\r\n map.put(\"Property1\", \"Value1SA\");\r\n map.put(\"Property3\", \"Value3SA\");\r\n return map;\r\n }", "public Map<QName, String> getOtherAttributes() {\n return otherAttributes;\n }", "public java.util.Collection getAttributes();", "public Map<QName, String> getOtherAttributes() {\n\t\treturn otherAttributes;\n\t}", "public Map<QName, String> getOtherAttributes() {\n\t\treturn otherAttributes;\n\t}", "public Map<QName, String> getOtherAttributes() {\n\t\treturn otherAttributes;\n\t}", "public List<Attribute> getAttributes() {\n return Collections.unmodifiableList(attributes);\n }", "public Map<QName, String> getOtherAttributes() {\n\t\t\treturn otherAttributes;\n\t\t}", "public Map<QName, String> getOtherAttributes() {\n\t\t\treturn otherAttributes;\n\t\t}", "public Map<String, ZAttrHandler> getVarMap() {\r\n if (attrMap==null) attrMap = new ZAttrHandlerMapper(this).map();\r\n return attrMap;\r\n }", "public Map<QName, String> getOtherAttributes() {\n\t\t\t\treturn otherAttributes;\n\t\t\t}", "public List<Attribute<?>> getAttributes() {\r\n\t\treturn Collections.unmodifiableList(attributes);\r\n\t}", "public Attributes getAttributes() {\n\t\treturn null;\r\n\t}", "public HashMap getClassWithAttr() {\n return storingClassWithAttr;\n }", "private Map<String, String> toMap(final Attributes atts) {\r\n\t\tfinal Map<String, String> values = Maps.newLinkedHashMap();\r\n\t\t\r\n\t\tfor (int index = 0; index < atts.getLength(); index++) {\r\n\t\t\tvalues.put(atts.getLocalName(index), atts.getValue(index));\r\n\t\t}\r\n\t\t\r\n\t\treturn values;\r\n\t}", "public void removeAllAttributeMaps()\n {\n checkState();\n super.removeAllAttributeMaps();\n }", "public List<Pair<String, String>> getAttributes() {\n\t\treturn attributes;\n\t}", "public AttributeMap()\r\n\t{\r\n\t\tsuper();\r\n\t}", "public String getAttributes() {\n return attributes;\n }", "public String getAttributes() {\n return attributes;\n }", "public Collection<HbAttributeInternal> attributes();", "public Object[] getAttributes() {\n\t\treturn new Object[] {true}; //true for re-init... \n\t}", "@Override\n\tpublic Map<String, Object> getAttributeMap(int arg0) {\n\t\treturn null;\n\t}", "@Override\n public List<MappedField<?>> getAttributes() {\n return attributes;\n }", "private Attribute createAttribute() {\n\t\t\tAttribute att = AttributeFactory.createAttribute(getName(), getValueType());\n\t\t\tatt.getAnnotations().clear();\n\t\t\tatt.getAnnotations().putAll(getAnnotations());\n\t\t\tattribute = att;\n\t\t\treturn att;\n\t\t}", "Attributes getAttributes();", "public Value removeAttributes() {\n checkNotUnknown();\n Value r = new Value(this);\n r.flags &= ~ATTR;\n r.flags |= ATTR_NOTDONTDELETE | ATTR_NOTDONTENUM | ATTR_NOTREADONLY;\n return canonicalize(r);\n }", "public String getAttributes() {\n\t\treturn getProperty(\"attributes\");\n\t}", "IAttributes getAttributes();", "public Map<String, MongoDbKeyAttributeMapper> getKeyAttributeMap() {\n return keyAttributeMap;\n }", "public Attributes getAttributes() { return this.attributes; }", "public ConcurrentHashMap<String, Attribute> getAttributes() {\n\t\treturn list;\n\t}", "public final String[] getAttributes() {\n return this.attributes;\n }", "private Attributes getAttributes()\r\n\t{\r\n\t return attributes;\r\n\t}", "public interface AttributeMap{\n\n /**\n * List of attribute names\n *\n * @return\n */\n public Set<String> getAttributeNames();\n\n /**\n * Does it contain the attributes of the specified name\n *\n * @param name\n * @return\n */\n public boolean containAttribute(String name);\n\n /**\n * Return the attribute value of the specified name\n *\n * @param name\n * @return\n */\n public String getAttribute(String name);\n\n}", "public List<String> attributes() {\n return this.attributes;\n }", "public static Map<String, String> getAllAttributes(Node aNode) throws BaseException\r\n\t{\r\n\t\tMap<String, String> attributesMap = new HashMap<String, String>();\r\n\t\tif (aNode.hasAttributes())\r\n\t\t{\r\n\t\t\tNamedNodeMap attrList = aNode.getAttributes();\r\n\t\t\tint numAttr = attrList.getLength();\r\n\t\t\tfor (int counter = 0; counter < numAttr; counter++)\r\n\t\t\t{\r\n\t\t\t\tattributesMap.put(attrList.item(counter).getNodeName(), attrList.item(counter).getNodeValue());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn attributesMap;\r\n\t}", "public List<GenericAttribute> getAttributes() {\n return attributes;\n }", "public Map<String, Map<String, String>> getUserAttributes() {\n return m_userAttributes;\n }", "protected Map createPropertiesMap() {\n return new HashMap();\n }", "@Override\n public void removeAttributes()\n {\n attributes.clear();\n }", "public List<Attribute> getAttributes() {\r\n return attributes;\r\n }", "public Set<String> attributeKeys()\r\n\t{\r\n\t\treturn this.attributes.stringPropertyNames();\r\n\t}", "public PropertyMap createAttributeMap(String uri, String localName)\n {\n checkState();\n return super.createAttributeMap(uri, localName);\n }", "public void setAttributes(Map<String, String> attributes){\r\n\t\t\tif (attributes == null){\r\n\t\t\t\tthis.attributes = Collections.emptyMap();\r\n\t\t\t}\r\n\t\t\tthis.attributes = Collections.unmodifiableMap(attributes);\r\n\t\t}", "List<Attribute<T, ?>> getAttributes();", "@Override\r\n\t\tpublic NamedNodeMap getAttributes()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public NamedNodeMapImpl cloneMap(NodeImpl ownerNode) {\n \tAttributeMap newmap =\n new AttributeMap((ElementImpl) ownerNode, null);\n newmap.hasDefaults(hasDefaults());\n newmap.cloneContent(this);\n \treturn newmap;\n }", "@Override\n public synchronized Set<AttributeType> getAttributeInstances() {\n return attributeInstances = nonNullSet(attributeInstances, AttributeType.class);\n }" ]
[ "0.7770249", "0.768716", "0.7652428", "0.7615729", "0.75460434", "0.7474774", "0.7440128", "0.73869896", "0.7327739", "0.73243856", "0.73243856", "0.7301104", "0.7224136", "0.72090006", "0.71638", "0.7125818", "0.7122004", "0.7122004", "0.7122004", "0.70704186", "0.7054213", "0.70430166", "0.6982735", "0.6951768", "0.68973905", "0.68211347", "0.6751458", "0.673532", "0.67320484", "0.6671257", "0.6659019", "0.66289735", "0.6520961", "0.6483217", "0.6429151", "0.64213884", "0.63886505", "0.63875794", "0.637162", "0.63646346", "0.63626504", "0.63457906", "0.63334197", "0.63324827", "0.63324827", "0.63324827", "0.62813073", "0.62730414", "0.62730414", "0.62509847", "0.62500846", "0.6227713", "0.6220336", "0.6202741", "0.617269", "0.61444", "0.61414206", "0.6119977", "0.6107505", "0.6107505", "0.6097585", "0.6094347", "0.60852724", "0.60842544", "0.60430384", "0.603165", "0.6031081", "0.6019001", "0.60111374", "0.59860736", "0.5983883", "0.5961511", "0.594814", "0.5924339", "0.5915256", "0.59110326", "0.5901708", "0.58920425", "0.58820546", "0.58819205", "0.5874395", "0.5873331", "0.58503884", "0.58476347", "0.5819117", "0.5814814", "0.58054227", "0.5804176", "0.58005816" ]
0.6412912
43
Constructor for GameObject given position rotation and sprite
public PickupWeaponBase(Vec2 position, WeaponBase weaponBarrel) { super(position, Vec2.ZERO, new Sprite("items/weaponBody")); setSize(new Vec2(0.7, 0.7)); setRenderLayer(RenderLayer.RenderLayerName.HIGH_BLOCKS); this.cli = weaponBarrel; collider = new CircleCollider(this, 30); collider.setTag("Item"); collider.addInteractionLayer("Walk"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "GameObject(int x, int y){\n loadSprite();\n this.x = x;\n this.y = y;\n }", "public GameObject(GameObjectDefinition definition, Location location,\n\t\t\tint type, int rotation) {\n\t\tthis.definition = definition;\n\t\tthis.location = location;\n\t\tthis.type = type;\n\t\tthis.rotation = rotation;\n\t}", "Sprite(Sprite s) {\n _img = s._img;\n _x = s._x;\n _y = s._y;\n _w = s._w;\n _h = s._h;\n _rotVector = new PVector(s._rotVector.x, s._rotVector.y, 0);\n _front = s._front;\n _hitboxCenter = new PVector(s._hitboxCenter.x, s._hitboxCenter.y);\n _hitbox = new PVector[s._hitbox.length];\n for (int i = 0; i < _hitbox.length; i++) {\n _hitbox[i] = new PVector(s._hitbox[i].x, s._hitbox[i].y);\n }\n _flipped = s._flipped;\n }", "public Sprite() {}", "Sprite(float x, float y, float w, float h) {\n _img = createImage(1, 1, RGB);\n _x = x;\n _y = y;\n _w = w;\n _h = h;\n _rotVector = new PVector(1, 0, 0);\n resetRectHitbox();\n }", "public Ufo(int x, int y, int width, int height, int speed, String sprite) {\r\n\t\tsuper();\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.speed = speed;\r\n\t\tthis.sprite = sprite;\r\n\t}", "public Warrior(Point3D position, int speed) {\r\n super(\"img/Ants/warrior.png\", position, speed);\r\n currentBehaviour = WarriorBehaviour.PATROL;\r\n }", "public Sprite(float centerX, float centerY, float z, int width, int height) {\n \t_center = new Coordinates(centerX, centerY, z);\n \t_dimensions = new Coordinates(width, height, 0f);\n }", "public GameObject(int x, int y, int width, int height, int[] velocity){\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.velocity= velocity;\n }", "public GameObject(int id, Position position, int type, int orientation) {\n\t\tthis.position = position.getHeight() << 30 | position.getX() << 15 | position.getZ();\n\t\tthis.config = (id << 8) + (type << 2) + orientation;\n\t}", "public Player(Position position) {\n this.position = position;\n this.image = new Image(\"O\");\n }", "public GameObject(Game game, String ref, int x, int y) {\n this.game = game;\n sprite = SpriteStore.get().getSprite(ref);\n this.x = x;\n this.y = y;\n }", "Sprite(String url, float x, float y, float w, float h) {\n _img = loadImage(url);\n _x = x;\n _y = y;\n _w = w;\n _h = h;\n _rotVector = new PVector(1, 0, 0);\n resetRectHitbox();\n }", "public GameObject(String name, int x, int y) {\n this.image = GameObject.processing.loadImage(\"images\" + File.separator + name + \".png\");\n this.xPosition = x;\n this.yPosition = y;\n this.active = true;\n }", "public GameObject(int x, int y, int speed, ID id){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tinitX = x;\r\n\t\tinitY = y;\r\n\t\tthis.id = id;\r\n\t\tthis.speed = speed;\r\n\t}", "public Asteroid(String textureFileName, float x, float y, int sizeX, int sizeY){\r\n super(textureFileName, x, y, sizeX, sizeY);\r\n rotationNumber = randomRotation();\r\n setRotation(rotationNumber);\r\n getSprite().setOriginCenter();\r\n }", "public PlayerObject(Vector r, Vector v, double mass) {\n super(r, v, mass);\n this.cam = new Camera(this, DEFAULT_FOV);\n this.rot = 0;\n }", "public GameObject(int id, Position position) {\n\t\tsuper(position);\n\t\tthis.id = id;\n\t\tdefinition = GameObjectDefinition.forId(id);\n\t}", "public Player(Orientation orientation){\n this.health = 9;\n this.orientation = orientation;\n evaluateSprite();\n\n }", "public AbstractGameObject(Level linksTo, int atX, int atY) {\n level = linksTo;\n xPosition = atX;\n yPosition = atY;\n }", "public ComplexSprite(double x, double y, double width, double height) {\r\n\t\tthis.factory = SpriteFactory.getInstance();\r\n\t\tthis.dx = factory.getDX();\r\n\t\tthis.dy = factory.getDY();\r\n\t\tthis.sprites = new ArrayList<>();\r\n\t}", "public Hero(int x, int y) {\r\n this.centerX = x;\r\n this.centerY = y;\r\n this.currentHealth = 100;\r\n rect1 = new FloatRect (100,630,80,110);\r\n imgTexture = new Texture ();\r\n try {\r\n imgTexture.loadFromFile (Paths.get (ImageFile));\r\n } catch (IOException ex) {\r\n ex.printStackTrace ();\r\n }\r\n imgTexture.setSmooth (true);\r\n\r\n img = new Sprite (imgTexture);\r\n img.setOrigin (Vector2f.div (new Vector2f (imgTexture.getSize ()), 2));\r\n img.setPosition (x, y);\r\n // Store references to object and key methods\r\n obj = img;\r\n setPosition = img::setPosition;\r\n\r\n background = new Sprite (bg.loadTextures ());\r\n background.setOrigin(Vector2f.div(new Vector2f(bg.getTexture1 ()), 1000000));\r\n background.setPosition (0,0);\r\n }", "public GameObject(PImage img, int x, int y, int width, int height, int[] velocity){\n this.img = img;\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.velocity= velocity;\n health = 1; //Default value for health\n }", "public Character(final Vec2d position) {\n super(position);\n\n movement = new CharacterMovement(this);\n shield = new Shield(this);\n gun = new Gun<>(this, Vine.class);\n this.setScale(SCALE);\n getLevel().addEntity(shield);\n getLevel().addEntity(gun);\n\n setShape(new Rectangle(BOUNDING_BOX));\n setPhysicsBehaviour(new GravityBehaviour(this));\n }", "public Position(Position position) {\n this.x = position.x;\n this.y = position.y;\n this.xVelocity = position.xVelocity;\n this.yVelocity = position.yVelocity;\n this.xAcceleration = position.xAcceleration;\n this.yAcceleration = position.yAcceleration;\n }", "public AlienShip(Point[] inShape, Point inPosition, double inRotation) {\r\n\t\tsuper(inShape, inPosition, inRotation);\r\n\t}", "public void evaluateSprite(){\n if(this.orientation == Orientation.FACING_NORTH) {\n texture = new Texture(Gdx.files.internal(\"/assets/gameObjects/playerFacingNorth.png\"));\n }\n if(this.orientation == Orientation.FACING_WEST){\n texture = new Texture(Gdx.files.internal(\"/assets/gameObjects/playerFacingWest.png\"));\n }\n if(this.orientation == Orientation.FACING_SOUTH){\n texture = new Texture(Gdx.files.internal(\"/assets/gameObjects/playerFacingSouth.png\"));\n }\n if(this.orientation == Orientation.FACING_EAST){\n texture = new Texture(Gdx.files.internal(\"/assets/gameObjects/playerFacingEast.png\"));\n }\n\n this.sprite = new Sprite(texture);\n }", "public GameObject(int id, Position position, int type) {\n\t\tsuper(position);\n\t\tthis.id = id;\n\t\tthis.type = type;\n\t\tdefinition = GameObjectDefinition.forId(id);\n\t}", "public Sprite(String newSpriteLocation){\n\t\timages = new Texture[1];\n\t\timages[0] = new Texture(newSpriteLocation);\n\t}", "public PlaceableImpl() {\n \n this.position = new Point3f();\n this.rotation = new Matrix3f();\n this.rotation.setIdentity();\n \n }", "public AbstractGameObject(Level linksTo, Point at) {\n level = linksTo;\n xPosition = at.x;\n yPosition = at.y;\n }", "public Base(int posX, int posY, Animacion animacion) {\n this.posX = posX;\n this.posY = posY;\n this.animacion = animacion;\n }", "public Sprite(Image img){\n\t\tsuper();\n\t\t_img = img;\n\t\tsetOrigin(_img.getWidth()/2,_img.getHeight()/2);\n\t\ttranslate(0, 0);\n\t}", "public GameObject instantiate(int gdID, Point2D pos, Rotation rot) {\n return instantiate(gdID, new Transform(pos, rot));\n }", "public MobSpawner(Vector2D position, Game game)\n {\n super(position, new Vector2D(0,0), RADIUS);\n ships = new ArrayList<>();\n double maximumAngle = Math.toRadians(360/ENEMIES_CAN_SPAWN);\n for (double i = 0; i < Math.toRadians(360); i+= maximumAngle)\n {\n double randomAngle = Math.random() * maximumAngle;\n Vector2D newPos = Vector2D.polar(i + randomAngle, SPAWN_RADIUS).add(position);\n ships.add(new EnemyShip(new HlAiController(game, this), newPos));\n }\n }", "@Override\n\tpublic void render(Vector2 position, float rotation, Vector2 scale) {\n glPushMatrix();\n // bind to the appropriate texture for this sprite\n texture.bind();\n \n // translate to the right location and prepare to draw\n renderFullScale.set(scale).mul(internalScale);\n renderOffset.set(halfSize).mul(renderFullScale);\n \n glTranslatef(position.x - topLeft.x * renderFullScale.x - renderOffset.x, position.y + topLeft.y * renderFullScale.y + renderOffset.y, 0);\n glScalef(renderFullScale.x, -renderFullScale.y, 1.0f);\n glRotatef(rotation, 0, 0, 1.0f);\n \n // draw a quad textured to match the sprite\n glBegin(GL_QUADS);\n {\n glTexCoord2f(topLeft.x, topLeft.y);\n glVertex2f(topLeft.x, topLeft.y);\n \n glTexCoord2f(topLeft.x, botRight.y);\n glVertex2f(topLeft.x, botRight.y);\n \n glTexCoord2f(botRight.x, botRight.y);\n glVertex2f(botRight.x, botRight.y);\n \n glTexCoord2f(botRight.x, topLeft.y);\n glVertex2f(botRight.x, topLeft.y); \n }\n glEnd();\n \n // restore the model view matrix to prevent contamination\n glPopMatrix();\n\t}", "public Vector3 () {\n }", "public Player(){\n this.health = 9;\n this.orientation = Orientation.FACING_NORTH;\n evaluateSprite();\n }", "public Actor(double topLeftX, double topLeftY, double width, double height,\n double mass, boolean grav, Image texture, int hp) {\n this.addComponent(new PhysicsComponent(topLeftX, topLeftY, width, height, mass, grav)); //physics\n this.addComponent(new VisualTextureComponent(texture, new Rectangle(0, 0, 1, 1))); //texture\n this.addComponent(new HpComponent(hp)); //hp\n }", "public MovingObj(float posX, String type, int lane, boolean rotate)\n\t{\n\t\tsuper(posX, 0, 0, 0, type);\n\t\tthis.lane = lane;\n\t\tthis.rotate = rotate;\n\t\t\n\t\tif (lane == 0)\n\t\t\tspdX = Constants.LANESPD0;\n\t\tif (lane == 1)\n\t\t\tspdX = Constants.LANESPD1;\n\t\tif (lane == 2)\n\t\t\tspdX = Constants.LANESPD2;\n\t\tif (lane == 3)\n\t\t\tspdX = Constants.LANESPD3;\n\t\tif (lane == 4)\n\t\t\tspdX = Constants.LANESPD4;\n\t\tif (lane == 6)\n\t\t\tspdX = Constants.LANESPD6;\n\t\tif (lane == 7)\n\t\t\tspdX = Constants.LANESPD7;\n\t\tif (lane == 8)\n\t\t\tspdX = Constants.LANESPD8;\n\t\tif (lane == 9)\n\t\t\tspdX = Constants.LANESPD9;\n\t\tif (lane == 10)\n\t\t\tspdX = Constants.LANESPD10;\n\t}", "public VideoSprite( int width, int height, int attributes, GameShell gs )\n\t{\n\t\tsuper();\n\t\t\n\t\tgameShell = gs;\n\t\t\n\t\tvideoImageList = new Vector<VideoImage>();\n\t\tanimation = new Script();\n\t\t\n\t\tsetRealDimensions( width, height );\n\t\tsetDimensions( width, height );\n\t\tthis.attributes = attributes;\n\t\t\n\t\t// Set default state and specified attributes of sprite\n\t\tstate\t\t= SPRITE_STATE_ALIVE;\n\t\tthis.attributes\t= attributes;\n\t\n\t\t// Set attributes of the animation\n\t\tif( ( attributes & SPRITE_ATTR_SINGLE_FRAME ) > 0 )\n\t\t{\n\t\t\tanimation.setAttributes( Script.SCRIPT_ATTR_SINGLE_FRAME );\n\t\t}\n\t\telse\n\t\tif( ( attributes & SPRITE_ATTR_MULTI_FRAME ) > 0 )\n\t\t{\n\t\t\tanimation.setAttributes( Script.SCRIPT_ATTR_MULTI_FRAME );\n\t\t}\n\t\telse\n\t\tif( ( attributes & SPRITE_ATTR_MULTI_ANIM ) > 0 )\n\t\t{\n\t\t\tif( ( attributes & SPRITE_ATTR_ANIM_ONE_SHOT ) > 0 )\n\t\t\t{\n\t\t\t\tanimation.setAttributes( Script.SCRIPT_ATTR_MULTI_SEQUENCE & Script.SCRIPT_ATTR_ONE_SHOT );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tanimation.setAttributes( Script.SCRIPT_ATTR_MULTI_SEQUENCE );\n\t\t\t}\n\t\t}\n\t\t\n\t\tanimation.setNumberOfFrames( 0 );\n\t\t\n\t\t// Set default color and alpha levels;\n\t\tcolorWeight = new float[] {1.0f, 1.0f, 1.0f, 1.0f};// This must be called before any color/alpha changes.\n\t\tsetColor( colorWeight );\n\t\tsetAlpha( 1.0f );\n\n rotationAxis = new Point();\n setRotationAxis( width / 2, height / 2 ); // Default center rotation axis.\n\t}", "public static NewMovement create(PosRotScale originLoc, float ex, float ey,float ez, int duration) {\n\n/*\n\t\tVector3 posO = new Vector3();\n\t\toriginObject.transform.getTranslation(posO);\n\t\t\n\t\tQuaternion orotation = new Quaternion();\n\t\toriginObject.transform.getRotation(orotation,true); //existing rotation\n\t\t\n\t\t//first we create a matrix for the destination location reusing the same rotation\n\t\t Vector3 destination_loc = new Vector3(ex,ey,ez);\n\t\t Vector3 destination_scale = new Vector3(1,1,1);\n\t\t// Matrix4 destination = new Matrix4(destination_loc,orotation,destination_scale);\n\t\t \n\t\t //the difference is the new movement\n\t\tMatrix4 oldloc = originObject.transform.cpy();\n\t\t\n\t\t Gdx.app.log(logstag, \"_____________________________________________destination_loc:\"+destination_loc.x+\",\"+destination_loc.y+\",\"+destination_loc.z);\n\t\t\t\n\t\t Vector3 destination_loc2 = destination_loc.mul(oldloc);\n\t\t \n\t\t Gdx.app.log(logstag, \"________________________=______destination_loc:\"+destination_loc2.x+\",\"+destination_loc2.y+\",\"+destination_loc2.z);\n\t\t\t\n\t\t\t\n\t\tMatrix4 destinationmatrix = new Matrix4().setTranslation(destination_loc2);\n\t\t\n\t\t*/\n\t\t Vector3 destination_loc = new Vector3(ex,ey,ez);\n\t\t \n\t\treturn create( originLoc, destination_loc, duration);\n\t\t\n\t}", "public Player(World world, float x, float y) {\n super(new Texture(\"Player/Player1_sg.png\"));\n\n\n //Centra el personaje este\n this.world = world;\n setPosition(x - this.getWidth() / 2,\n y - this.getHeight() / 2);\n createBody();\n }", "PositionedObject(){\n float x = DrawingHelper.getGameViewWidth()/2;\n float y = DrawingHelper.getGameViewHeight()/2;\n _position.set(x,y);\n }", "Actor(int x, int y, Texture image) {\n this.setX(x);\n this.setY(y);\n setImage(image);\n }", "public Vector3(float rotationYaw, float rotationPitch)\n {\n this(Math.cos(Math.toRadians(rotationYaw + 90)), Math.sin(Math.toRadians(-rotationPitch)), Math.sin(Math.toRadians(rotationYaw + 90)));\n }", "public Player(int x, int y, int X, int Y){\n\t\tx1 = x;\n\t\ty1 = y;\n\t\tx2 = X;\n\t\ty2 = Y;\n\t\titemsInInventory = 0;\n\t\tfor (int i = 0; i < 10; i++){\n\t\t\tinventorySpaces[i] = false;\n\t\t}\n\t\tint k = 0;\n\t\tfor (int i = 0; i < 3; i++){\n\t\t\tfor (int j = 1; j < 4; j++){\n\t\t\t\tcharAnimation[k] = new TextureRegion(charTexture, i * TILE_SIZE, j * TILE_SIZE, TILE_SIZE, TILE_SIZE);\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\t\tcharacter = new Sprite (charAnimation[0]);\n\t\tcharacter.setPosition(x1,y1); \n\t}", "public Asteroid(){\n\t\t\n\t\t//call Sprite constructor\n\t\tsuper();\n for(int i =0;i<arrowAmount;i++)\n {\n arrows.add(new Arrow(Game.R.nextInt(4),Game.R.nextBoolean()));\n }\n\t\tinitialize();\n\t\tint nDY = Game.R.nextInt(speedLevel);\n\t\tsetDeltaY((double)nDY*0.03*CommandCenter.getLevel()+1);\n\n\n\t\t\n\n\t}", "public Armor(String _name){\n super();\n // sets owner = _owner\n // sets posX = _posX\n // sets posY = _posY\n // sets itemIntValue = _itemIntValue\n name = _name; \n }", "public Player(float x, float y) throws SlickException {\n sprite = new Image(\"assets/scout.png\");\n this.x = x;\n this.y = y;\n }", "public Texture() {\n }", "public interface SpriteInterface {\n\n\n void start();\n\n\n void update(double timeChange);\n\n\n void draw();\n\n void changeLocation(float xPos, float yPos, float rotation, float scaleX, float scaleY);\n\n\n}", "public Weapon(MainPlayer p, ArrayList<MainPlayer> enemies, ArrayList<StaticObjects> s,\r\n\t\t\tArrayList<ReactiveObjects> r, boolean l, double velocity,\r\n\t\t\tdouble angle) {\r\n\t\ttrajectoryIncrements = calculateTrajectory(velocity, angle);\r\n\t\tvisible = true;\r\n\t\tstaticobjects = s;\r\n\t\treactiveobjects = r;\r\n\t\tthis.enemies = enemies;\r\n\t\tthis.velocity = velocity;\r\n\t\tthis.angle = angle;\r\n\r\n\t\tloadAnnimationImages();\r\n\t\tloadDestructionImages();\r\n\t\tthis.player = p;\r\n\t\tthis.player.setGrenadesAvailable(player.getGrenadesAvailable() - 1);\t\t\r\n\t\tif (l == true) {\r\n\t\t\tx = p.x + p.playerImage.getWidth(null);\r\n\t\t\ty = p.y;\r\n\t\t} else {\r\n\t\t\tx = p.x;\r\n\t\t\ty = p.y;\r\n\t\t}\r\n\r\n\t\tlaunchDirectionRight = l;\r\n\t\trectangle = new Rectangle(x, y, currentImage.getWidth(null),\r\n\t\t\t\tcurrentImage.getHeight(null));\r\n\t\timageHeight = currentImage.getHeight(null);\r\n\t\timageWidth = currentImage.getWidth(null);\r\n\t\ttimer = new Timer(20, this);\r\n\t\ttimer.start();\r\n\t}", "public Spaeti(int pos_x, int pos_y, Enums.Direction direction) {\n super(pos_x, pos_y);\n this.direction = direction;\n this.rechargeDuration = 15;\n try {\n this.image_on = new Image(\"/res/img/objects/spaeti_on.png\");\n this.image_off = new Image(\"/res/img/objects/spaeti_off.png\");\n this.image_on.rotate(GameUtils.getImageRotationFromDirection(direction));\n this.image_off.rotate(GameUtils.getImageRotationFromDirection(direction));\n this.image = image_on;\n } catch (SlickException e) {\n e.printStackTrace();\n }\n }", "public Projectile(Vec2 position, Vec2 direction, Sprite sprite) {\n super(position, direction, sprite);\n allProjectilse.add(this);\n startPosition = transform.getGlobalPosition();\n setCollider(new CircleCollider(this, 30));\n setRenderLayer(RenderLayer.RenderLayerName.HIGH_BLOCKS);\n\n\n collider.setName(\"Bullet\");\n collider.setTag(\"DMG\");\n\n startTime = System.currentTimeMillis();\n startSize = new Vec2(1, 1);\n squareHeightStart = 1;\n squareWithStart = 1;\n }", "public Ship() {\n rotation = Rotation.VERTICAL;\n }", "BasicObject(){\n posX = -1;\n posY = -1;\n velX = 0;\n velY = 0;\n accX = 0;\n accY = 0;\n classOfObejct = 0;\n }", "public Rotation2D()\n {\n this.x = 0.0f;\n this.y = 0.0f;\n }", "protected void init(Rectangle2D.Float collider) {\r\n this.collider = collider;\r\n this.width = this.collider.width;\r\n this.height = this.collider.height;\r\n this.sprite = new BufferedImage((int) this.width, (int) this.height, BufferedImage.TYPE_INT_ARGB);\r\n }", "public Player(Level level, double x, double y){\n\t\tsuper(level ,x, y);\n\t\tsprite = sprite.player;\n\t\twidth = sprite.getWidth();\n\t\theight = sprite.getHeight();\n\t\tspeed = 1.5;\n\t}", "public Objects(double startx, double starty, double speed, String image, int xsize, int ysize, String name, double Xvelocity, double Yvelocity, double life){\n\t\tthis.face = new Image(\"file:res/\" + image);\n\t\tthis.x = startx;\n\t\tthis.y = starty;\n\t\tthis.MoveSpeed = speed;\n\t\tthis.staticMoveSpeed = speed;\n\t\tthis.sizeX = xsize;\n\t\tthis.sizeY = ysize;\n\t\tthis.name = name;\n\t\tthis.Xvelocity = Xvelocity;\n\t\tthis.Yvelocity = Yvelocity;\n\t\tthis.HP = (int)life;\n\t\tthis.hpLimit = (int)life;\n\t\tobjectlist.add(this);\n\t}", "public Cannon(int x, Space s) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = s.getSize() - 1;\r\n\t\tthis.space = s;\r\n\t}", "public SaboWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1);\n addObject(counter, 100, 380); //Add the scoreboard\n addObject(healthBar, 300, 370); //Add the health bar\n addObject(turret, getWidth()/2-5, getHeight()-turret.getImage().getWidth()); \n }", "protected PersonajeGrafico(int v, int x, int y){\r\n\t\tthis.velocidad=v;\r\n\t\tpos = new Point(ancho * x, alto * y);\r\n\t\tsprites = new Vector<Vector<Icon>>();\r\n\t\t\t\t\r\n\t}", "protected GameObject(double x, double y, Sprite[] images, double axi, double vxi, double vxmax, Program program) {\n\t\tassert(isValidX(x));\n\t\tassert(isValidX(y));\n\t\tassert((program == null) || !(this instanceof Mazub) || (this instanceof Buzam));\n\t\t\n\t\tsetX(x);\n\t\tsetY(y);\n\t\tthis.images = images;\n\t\tthis.axi = axi;\n\t\tthis.vxi = vxi;\n\t\tsetVxmax(vxmax);\n\t\tthis.program = program;\n\t\t\n\t\tsetVx(0);\n\t\tsetVy(0);\n\t\tsetAx(0);\n\t\tsetAy(0);\n\t\tsetHitpoints(100);\n\t}", "public Position() {\n xCoord = 0;\n yCoord = 0;\n zCoord = 0;\n }", "public ObjetoJuegoMovimiento(int xPosition, int yPosition, int xVelocity, int yVelocity, Color color)\r\n {\r\n super(xPosition, yPosition, color);\r\n this.xVel = xVelocity;\r\n this.yVel = yVelocity;\r\n \r\n }", "public InanimateObject(Vector position, World world) throws IllegalArgumentException {\r\n\t\tsuper(position, world);\r\n\t\tthis.setWeight(new Random().nextInt(41) + 10);\r\n\t}", "public Asteroid()\r\n\t{\r\n\t\tsuper.setDirection(rn.nextInt(360));\r\n\t\tsuper.setSpeed(rn.nextInt(100));\r\n\t\tsuper.setLocalX(rn.nextFloat() * 1024);\r\n\t\tsuper.setLocalY(rn.nextFloat() * 786);\r\n\t\tsuper.setColor(250);\r\n\t\tsize = rn.nextInt(10);\r\n\t\t\r\n\t}", "public SpriteSheet(BufferedImage sheet){\n this.sheet = sheet;\n }", "Turtle(int x, int y, String image){super(x, y, \"turtle.png\");}", "public GameObject(String tag, Bitmap res, int x, int y, int columns, int rows)\n {\n super(GamePanel.sContext);\n //spritesheet = res;\n this.tag = tag;\n setX(x);\n setY(y);\n this.WIDTH = res.getWidth()/rows;\n this.HEIGHT = res.getHeight()/columns;\n bounds = new Rect(x, y, WIDTH, HEIGHT);\n int numframes = columns*rows;\n int sheet_index = 0;\n\n Bitmap[] image = new Bitmap[numframes];\n\n for (int col = 0; col < columns; col++)\n {\n for(int r = 0; r < rows; r++)\n {\n image[sheet_index] = Bitmap.createBitmap(res, r*WIDTH, col*HEIGHT, WIDTH, HEIGHT);\n\n System.out.println(image[sheet_index] + \",\" + image.length);\n sheet_index++;\n }\n }\n\n if(animate) {\n animation.setFrames(image);\n animation.setDelay(10);\n }\n startTime = System.nanoTime();\n }", "@Override\r\n public void init(GLAutoDrawable drawable) {\n glu = new GLU();\r\n //Estabelece as coordenadas do SRU (Sistema de Referencia do Universo)\r\n xMin = yMin = zMin = -1;\r\n xMax = yMax = zMax = 1;\r\n tx = ty = rot = 0;\r\n sx = 1;\r\n }", "public ObstacleSprite(int left, int top, int right, int bottom, OBSTACLE_SPEED obstacleSpeed, Game game)\n {\n super(left, top, right, bottom, game);\n speed = (int) Math.round(DEFAULT_OBSTACLE_SPEED * (obstacleSpeed.value / 2.0));\n wasTouched = false;\n\n if(obstacleSpriteImage == null)\n {\n Bitmap settingsBitmap = BitmapFactory.decodeResource(resources, R.drawable.missile);\n obstacleSpriteImage = new AndroidImage(settingsBitmap, AndroidGraphics.ImageFormat.ARGB4444);\n }\n\n if(obstacleExplosionImage == null)\n {\n Bitmap settingsBitmap = BitmapFactory.decodeResource(resources, R.drawable.explosion);\n obstacleExplosionImage = new AndroidImage(settingsBitmap, AndroidGraphics.ImageFormat.ARGB4444);\n }\n }", "protected GameObject(double x, double y, double xSize, double ySize, ID id) {\n\t\tthis.pos = new Point2D(x, y);\n\t\tthis.body = new Rectangle2D.Double(pos.getX(), pos.getY(), xSize, ySize);\n\t\tthis.id = id;\n\t}", "public Monstruo(int posX, int posY ,Image image) {\n\t\tsuper(posX, posY, image);\n\t\torientacion = 3;\n\t\tvida = 10;\n\t\tdinero = 0;\n\t\tspeed = 1;\n\t\tstrength = 1;\n\t\tdefense = 1;\n\t\tweapon = 1;\n\t\tarmor = 1;\n\t}", "public Player(PImage img) {\r\n\t\tx_ = startX;\r\n\t\ty_ = startY;\r\n\t\tinvincible = false;\r\n\t\tinvinceFrames = 200;\r\n\t\thealth_ = 50;\r\n\t\tshots = new ArrayList();\r\n\t\tisAlive = true;\r\n\t\tsprite = img;\r\n\t\tvy_ = 0.0f;\r\n\t\tmoving = 0;\r\n\t}", "public CourtMovement() {\r\n\t\tsuper();\r\n\t\tstart = 0;\r\n\t\tend = 0;\r\n\t}", "public PowerUp(Sprite sprite, int x, int y) {\n super(x, y);\n newSprite(sprite);\n setNewDimensions();\n name = sprite.name();\n }", "public Hero(Position position) {\n this.position = position;\n hp = PV_BASE;\n atk = 1;\n status = Status.STANDING;\n buffs = new ArrayList<>();\n orientation = Orientation.DOWN;\n }", "Entity(Vector3f position) {\n this.position = position;\n }", "private void buildSprites() {\n\t\tSpriteRotatable sprite = new SpriteRotatable(new Vec2f(0, 0), 1);\n\t\tsprite.setCentered(true);\n\t\tspriteManager.addSprite(sprite, \"avenger.png\");\n\t\tsprite.setVisible(true);\n\t\ttarget = new SpriteRotatable(new Vec2f(2, 2), 1);\n\t\ttarget.setCentered(true);\n\t\tspriteManager.addSprite(target, \"fighter.png\");\n\t\ttarget.setVisible(true);\n\n\t}", "public GameObject(int id, Position position, int type, int face) {\n\t\tsuper(position);\n\t\tthis.id = id;\n\t\tthis.type = type;\n\t\tthis.face = face;\n\t\tdefinition = GameObjectDefinition.forId(id);\n\t}", "public Space_Object(int xPos, int yPos, int xVel, int yVel, int objectDiameter, Color objectColor, Universe theUniverse)\n {\n xPosition = xPos;\n yPosition = yPos;\n xSpeed = xVel;\n ySpeed = yVel;\n color = objectColor;\n diameter = objectDiameter;\n universe = theUniverse;\n groundPosition = universe.getGround();\n lifeTime = 1000000;\n destroyed = false;\n //degrees = 1;\n \n }", "public Position() {\n\n\t}", "public Actor(PhysicsComponent physics, VisualComponent visuals, HpComponent health) {\n this.addComponent(physics); //add physics\n this.addComponent(visuals); //add texture\n this.addComponent(health); //add hp\n }", "public Jugador(float x, float y, Colisiones colision, Main main,float wReescalado,float hReescalado) {\n this.x = x;\n this.y = y;\n this.colisiones=colision;\n this.main=main;\n this.wReescalado=wReescalado;\n this.hReescalado=hReescalado;\n rectangles=colisiones.getRect();//Obtengo el array de rectangulo en colisiones\n texture = new Texture(Gdx.files.internal(\"recursos/character.png\"));//Asigno a texture el archivo png de mi personaje\n jugadorVista = \"\";//Agigno comillas a jugador vista\n rectangle=new Rectangle(x,y,texture.getWidth(),texture.getHeight());//Creo el rectangulo de mi jugador con las propiedades de texture\n tmp = TextureRegion.split(texture, texture.getWidth() / 4, texture.getHeight() / 4);//Divido mi texture region en las partes indicadas para asignarlas a la matria\n //Los valores de la division de tpm equivalen al numero de filas y numero de columnas de mi png(En mi caso tengo 4 filas que son los diferentes movimientos y 4 columnas una para cada movimiento)\n //Ejemplo:Fila 1-->Movimiento a la derecha: Columna 1-->Quieto Columna -->Mueve un pie: Columna 3 --->Muevo el otro pie: Columna 4-->Vuelvo a estar quieto\n regions = new TextureRegion[4];//Asigno al array regions la longuitud por la que haya dividido en ancho my imagen\n for (int b = 0; b < regions.length; b++) {//Con este bucle voy cargando las imagenes y da la ilusion de que anda\n regions[b] = tmp[0][0];\n animation = new Animation((float) 0.2, regions);//Inicializamos el constructor pasandole por parametros el tiempo que dura y el array\n tiempo = 0f;\n }\n }", "public Quaternion()\n {\n this.x = 0.0f;\n this.y = 0.0f;\n this.z = 0.0f;\n this.w = 0.0f;\n }", "public Stage1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1200, 900, 1);\n \n GreenfootImage image = getBackground();\n image.setColor(Color.BLACK);\n image.fill();\n star();\n \n \n \n //TurretBase turretBase = new TurretBase();\n playerShip = new PlayerShip();\n scoreDisplay = new ScoreDisplay();\n addObject(scoreDisplay, 100, 50);\n addObject(playerShip, 100, 450);\n \n }", "public Cargo(){\n super(\"Cargo\");\n intake = new WPI_TalonSRX(RobotMap.cargoIntake);\n shoot = new WPI_TalonSRX(RobotMap.cargoShoot);\n }", "public Item(AnimatedImage sprite, double posX, double posY, double width, double height, double offsetX,\n\t\t\tdouble offsetY, Movement movement, Attack attack) {\n\t\tsuper(sprite, posX, posY, width, height, offsetX, offsetY, movement, attack);\n\t}", "private Animation(int length, int x, int y, int spriteWidth, int frameDist) {\n this.length = length;\n this.rightX = x;\n this.leftX = x;\n this.y = y;\n this.spriteWidth = spriteWidth;\n this.spriteHeight = spriteWidth;\n this.frameDist = frameDist;\n }", "public static NewRotateLeft create(AnimatableModelInstance originObject, float ex, float ey, int duration) {\n\n\t\tVector3 posO = originObject.transState.position.cpy();\t\n\t\t//Vector3 posO = new Vector3();\n\t\t//originObject.transform.getTranslation(posO);\n\t\t\n\t\tQuaternion rotation = originObject.transState.rotation.cpy();\t\n\t\t//Quaternion rotation = new Quaternion();\n\t\t//originObject.transform.getRotation(rotation,true); //existing rotation\n\t\t\n\t\t Vector3 axisVec = new Vector3();\n\t float existingangle = (float) (rotation.getAxisAngle(axisVec) * axisVec.nor().z);\n\t existingangle = existingangle < 0 ? existingangle + 360 : existingangle; //convert <0 values\n\t\t\n\t\tGdx.app.log(logstag,\"_____________________________________existing angle=\"+existingangle); //relative to x axis pointing left anticlockwise\n\t\n\t\t//float scalex = originObject.transform.getScaleX(); //get how much the object has been scaled\n\t\t//float scaley = originObject.transform.getScaleY();\n\t\t\n\t\tVector2 fromPoint = new Vector2(posO.x,posO.y); //we need to scale them down due to how the positions might have been scaled up if the matrix is scaled (I hate how matrixs work :-/ Just cant get it in my head)\n\t\tVector2 tooPoint = new Vector2(ex,ey);\n\n\t\tfromPoint.sub(tooPoint); \n\n\t\t//Log.info(\"length=\"+corner2.len());\n\n\t\tfloat angle = 180+fromPoint.angle(); //absolute angle between the two objects\n\t\tGdx.app.log(logstag,\"________target angle=\"+angle); //should point towards ex/ey \n\t\t\n\t//\tfloat distance = fromPoint.len();\n\n\t\t\n\t\t//difference between this angle and existing one\n\t\tangle = angle - existingangle;\n\t\t\n\t\tNewRotateLeft rot = new NewRotateLeft(angle,500);\n\t\t//NewForward forward = new NewForward(distance,duration-500);\n\t\t\t\t\n\t\treturn rot;\n\t}", "public Asteroid(int x, int y) {\r\n super(x, y);\r\n speed = 1;\r\n initialY = y;\r\n initAsteroid();\r\n }", "public MovableObject(int x, int y, Game game) {\n\t\tsuper(x, y, game);\n\t\thp=100;\n\t\txTemp=this.x;\n\t\tyTemp=this.y;\n\t\ttargetX=xGridNearest;\n\t\ttargetY=yGridNearest;\n\t\tfinishingMove=false;\n\t\tmoving=false;\n\t\tnextLocationSet=false;\n\t\tsequence=new Animation(this);\n\t}", "Explosion(Point2D.Float position) {\r\n super(position);\r\n this.sprites = ResourceCollection.SpriteMaps.EXPLOSION_SPRITEMAP.getSprites();\r\n\r\n this.centerOffset = 0;\r\n this.spriteIndex = 0;\r\n this.spriteTimer = 0;\r\n }", "Item(int x, int y) {\n this.posX = x;\n this.posY = y;\n }", "public Shot(int damage, Point position, String imageFile) {\n this(damage, 0, 0, position, imageFile);\n }", "public void init(){\n\t\n\t\t//background init\n\t\tthis.background = new Sprite(this.scene, \"space-backdrop.png\", 1280 * 5, 800 * 5);\n\t\tthis.background.setBoundAction(\"background\");\n\t\tthis.background.setSpeedScale(0.2);\n\t\tthis.background.setSpeed(0);\n\t\tthis.sprites.add(this.background);\n\t\t\n\t\t//compass init\n\t\tthis.compass = new Sprite(this.scene, \"compass.png\", 100, 100);\n\t\tthis.compass.setSpeed(0);\n\t\tthis.compass.setPosition(this.compass.getWidth() / 2, this.scene.getHeight() - this.compass.getHeight() / 2);\n\t\t\n\t\t//earth init\n\t\tthis.earth = new Planet(this.scene, \"earth.png\", 4800, 4800);\n\t\tthis.earth.setSpeed(0);\n\t\tthis.earth.setPosition(0, 7000);\n\t\tthis.earth.setBoundAction(\"continue\");\n\t\tthis.sprites.add(this.earth);\n\t\t\n\t\t//ship init\n\t\tthis.mainSprite = new Ship(this.scene, \"cannon.png\", 50, 50, this.k);\n\t\tthis.mainSprite.keyListen = true;\n\t\tthis.mainSprite.setSpeed(0);\n\t\tthis.mainSprite.setPosition(this.scene.getWidth() / 2, this.scene.getHeight() / 2);\n\t\t\n\t\t//asteroids init\n\t\tthis.asteroids.add(new Body(this.scene, \"asteroid.png\", 250, 250, this));\n\t\tthis.asteroids.get(0).setBoundAction(\"continue\");\n\t\tthis.asteroids.get(0).setSpeed(0);\n\t\tthis.asteroids.get(0).setPosition(0, 0);\n\t\tthis.sprites.add(this.asteroids.get(0));\n\t\t\n\t\tfor(int i = 1; i < 200; i++){\n\t\t\t\n\t\t\tint size = (int) Math.round(Math.random() * 400 + 50);\n\t\t\tlong x = Math.round(Math.random() * this.background.getWidth() - (this.background.getWidth() / 2));\n\t\t\tlong y = Math.round(Math.random() * this.background.getHeight() - (this.background.getHeight() / 2));\n\t\t\t\n\t\t\twhile(x > 0 && x < this.scene.getWidth()){\n\t\t\t\tx = Math.round(Math.random() * this.background.getWidth() - (this.background.getWidth() / 2));\n\t\t\t}\n\t\t\t\n\t\t\twhile(y > 0 && y < this.scene.getHeight()){\n\t\t\t\ty = Math.round(Math.random() * this.background.getHeight() - (this.background.getHeight() / 2));\n\t\t\t}\n\t\t\t\n\t\t\tthis.asteroids.add(new Body(this.scene, \"asteroid.png\", size, size, this));\n\t\t\tthis.asteroids.get(i).setBoundAction(\"continue\");\n\t\t\tthis.asteroids.get(i).setSpeed(0);\n\t\t\tthis.asteroids.get(i).setPosition(x, y);\n\t\t\t\n\t\t\tthis.sprites.add(this.asteroids.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t//chest init\n\t\tthis.chests.add(new Chest(this.scene, \"chest.png\", 100, 50));\n\t\tthis.chests.get(0).setBoundAction(\"continue\");\n\t\tthis.chests.get(0).setSpeed(0);\n\t\tthis.chests.get(0).setPosition(500, 500);\n\t\tthis.sprites.add(this.chests.get(0));\n\t\t\n\t\tfor(int i = 1; i < this.numChests; i++){\n\t\t\t\n\t\t\tthis.chests.add(new Chest(this.scene, \"chest.png\", 100, 50));\n\t\t\tthis.chests.get(i).setBoundAction(\"continue\");\n\t\t\tthis.chests.get(i).setSpeed(0);\n\t\t\t\n\t\t\tboolean keepGoing = true;\n\t\t\tdo{\n\t\t\t\t\n\t\t\t\tlong x = Math.round(Math.random() * this.background.getWidth() - (this.background.getWidth() / 2));\n\t\t\t\tlong y = Math.round(Math.random() * this.background.getHeight() - (this.background.getHeight() / 2));\n\t\t\t\t\n\t\t\t\twhile(x > 0 && x < this.scene.getWidth()){\n\t\t\t\t\tx = Math.round(Math.random() * this.background.getWidth() - (this.background.getWidth() / 2));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twhile(y > 0 && y < this.scene.getHeight()){\n\t\t\t\t\ty = Math.round(Math.random() * this.background.getHeight() - (this.background.getHeight() / 2));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.chests.get(i).setPosition(x, y);\n\t\t\t\t\n\t\t\t\t//check for collisions with asteroids\n\t\t\t\tboolean colliding = false;\n\t\t\t\tfor(int j = 0; j < this.asteroids.size() && colliding == false; j++){\n\t\t\t\t\tif(this.asteroids.get(j).collidesWith(this.chests.get(i))){\n\t\t\t\t\t\tcolliding = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkeepGoing = colliding;\n\t\t\t\t\n\t\t\t}while(keepGoing);\n\t\t\t\n\t\t\tthis.sprites.add(this.chests.get(i));\n\t\t\t\n\t\t}//end for\n\t\n\t\tthis.scene.start();\n\t\t\n\t\tSystem.out.println(\"==== Welcome to Space Smuggler! ====\");\n\t\tSystem.out.println(\"(WASD to move)\");\n\t\tSystem.out.println(\"Follow your compass in the bottom left corner to find treasure.\");\n\t\tSystem.out.println(\"Collect all of the treasure, then follow your compass to Earth!\");\n\t\tSystem.out.println(\"Watch out for the asteroids though, their gravitational pull is strong!\");\n\t\tSystem.out.println(\"Crashing into one will certainly kill you! D:\");\n\t\tSystem.out.println(\"Good Luck!\");\n\t\t\n\t}", "public Vec3(){\n\t\tthis(0,0,0);\n\t}", "public Ant(){ // The position and direction of the ant is completely randomizated in it's creation\n this.position[0] = (int)Math.floor(Math.random() * 20); \n this.position[1] = (int)Math.floor(Math.random() * 20);\n this.image = (int)Math.floor(Math.random() * 4);\n }" ]
[ "0.67743075", "0.65390664", "0.65011644", "0.6478393", "0.64424556", "0.63244694", "0.6162789", "0.61271566", "0.6122893", "0.61025965", "0.60162276", "0.60037357", "0.5979885", "0.5956375", "0.58601713", "0.5851385", "0.58163166", "0.5723811", "0.5712145", "0.5690284", "0.56827366", "0.5677659", "0.5659237", "0.56567556", "0.56443244", "0.5587261", "0.5552269", "0.5533537", "0.55333394", "0.55268246", "0.55220205", "0.5520262", "0.5516893", "0.55026406", "0.54868656", "0.54808116", "0.5478286", "0.5478011", "0.545599", "0.54268837", "0.5423389", "0.54109067", "0.54007035", "0.5397598", "0.5389319", "0.53529924", "0.53502923", "0.5346758", "0.5338063", "0.5334432", "0.53336924", "0.53290904", "0.53212315", "0.53161734", "0.53031385", "0.5302612", "0.5292389", "0.5285406", "0.5281531", "0.52404827", "0.52304137", "0.52130926", "0.5205994", "0.5205948", "0.5200678", "0.5200066", "0.51801306", "0.5172292", "0.5167291", "0.5158183", "0.5157537", "0.51409763", "0.51280826", "0.512766", "0.51209015", "0.51193154", "0.5117381", "0.51152575", "0.51128554", "0.51108104", "0.51089394", "0.51061535", "0.50965255", "0.5091758", "0.5087614", "0.50860983", "0.50857556", "0.50769866", "0.5076969", "0.50628835", "0.5061944", "0.50598264", "0.5057883", "0.50555694", "0.5053854", "0.5053259", "0.5050445", "0.5040797", "0.50383323", "0.503065", "0.5025499" ]
0.0
-1
Must be implemented with Describable. Prints a message to the screen when PickUpWeaponBase is picked up by player.
@Override public void showMessage() { MessageHandler.getInstance() .writeMessage("This Base is different! \n Behold!"); Player p = ((RomInntrenger) GameApplication.getInstance()).getClosestPlayer(transform.getGlobalPosition()); p.getCurrentWeapon().setWeaponBase(cli); collider.destroy(); destroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void toSelectingWeapon() {\n }", "public void equipSelectedWeapon() {\n }", "public void pickUp(Item item) {\n this.curItem = item;\n this.curItem.setNonDamagablePlayer(this);\n if (item instanceof PickupableWeaponHolder) {\n this.weapon = ((PickupableWeaponHolder)(item)).getWeapon();\n }\n }", "public void weaponInformation() {\n System.out.println(\"Weapon Name: \" + super.name() );\r\n System.out.println(\"Desc:\" + super.description() );\r\n System.out.println(\"Mobility: \" + super.mobility() ); \r\n }", "public void pickUpWeapon(CardWeapon weapon, CardWeapon weaponToWaste, List<CardPower> powerUp) throws InsufficientAmmoException, NoCardWeaponSpaceException {\n List <Color> tmp = new ArrayList<>(weapon.getPrice());\n List <CardPower> tmpPU = new ArrayList<>();\n if(this.weapons.size()== 3)\n if(weaponToWaste==null)\n throw new NoCardWeaponSpaceException();\n if(tmp.size() > 1)\n {\n tmp = tmp.subList(1, tmp.size());\n pay(tmp, powerUp);\n }\n if (weapons.size() == 3){\n this.position.getWeapons().add(weaponToWaste);\n this.weapons.remove(weaponToWaste);\n }\n this.weapons.add(weapon);\n weapon.setShooter(this);\n this.position.getWeapons().remove(weapon);\n if(game != null)\n game.notifyGrabWeapon(this,weapon, weaponToWaste);\n\n }", "public ShotgunWeapon() {\n description = \" Weapon: Shotgun has\";\n }", "@Override // see item.java\n\tpublic void pickUp() {\n\n\t}", "public void updateActiveWeapon() {\n activeWeaponText.setText(\"Weapon: \" + game.getPlayerComponent().getActiveWeapon().getWeaponType().getName());\n }", "public String getEquippedWeaponName() {\n return \"\";\n }", "static void weapon(char item)\r\n {\r\n \tString pClass = MainApp.playerClass;\r\n \tif(MainApp.alreadyEquipped == false)\r\n\t\t{\r\n\t\t\tif(pClass == \"Warrior\")\r\n\t\t\t{\r\n\t \t\tif(item == '0')\r\n\t \t\t{\r\n\t \t\t\tMainApp.playerStats[0] += 5;\r\n\t \t\t\tMainApp.alreadyEquipped = true;\r\n\t \t\t\t//System.out.print(\"Warrior Equipped!\");\r\n\t \t\t}\r\n\t \t\t//System.out.print(\"Post Equip Warrior\");\r\n\t\t\t}\r\n\t\t\tif(pClass == \"Archer\")\r\n\t\t\t{\r\n\t\t\t\tif(item == '&')\r\n\t \t\t{\r\n\t \t\t\tMainApp.playerStats[0] += 5;\r\n\t \t\t\tMainApp.alreadyEquipped = true;\r\n\t \t\t\t//System.out.print(\"Archer Equipped!\");\r\n\t \t\t}\r\n\t\t\t\t//System.out.print(\"Post Equip Archer\");\r\n\t\t\t}\r\n\t\t\tif(pClass == \"Rogue\")\r\n\t\t\t{\r\n\t\t\t\tif(item == '!')\r\n\t \t\t{\r\n\t \t\t\tMainApp.playerStats[0] += 5;\r\n\t \t\t\tMainApp.alreadyEquipped = true;\r\n\t \t\t\t//System.out.print(\"Rogue Equipped!\");\r\n\t \t\t}\r\n\t\t\t\t//System.out.print(\"Post Equip Rogue\");\r\n\t\t\t}\r\n\t }\r\n }", "public PickupWeaponBase(Vec2 position, WeaponBase weaponBarrel) {\n super(position, Vec2.ZERO, new Sprite(\"items/weaponBody\"));\n setSize(new Vec2(0.7, 0.7));\n setRenderLayer(RenderLayer.RenderLayerName.HIGH_BLOCKS);\n\n this.cli = weaponBarrel;\n\n collider = new CircleCollider(this, 30);\n collider.setTag(\"Item\");\n collider.addInteractionLayer(\"Walk\");\n\n }", "private Card murderWeapon(UI ui, Player currentPlayer) {\n CardPanel cardPanel = new CardPanel(ui.getBoard(), ui.getCmd(), \"weapons\");\n ui.getLayers().add(cardPanel, Integer.valueOf(6));\n cardPanel.showPanel();\n ui.getInfo().addText(\"Enter the weapon you think \" + murderer.getName() + \" killed Gunther in \" + location.getName() + \". Listed Below\"); // prompt\n\n // display all the characters to the player that they can select\n for (int i = 0; i < WEAPON_NAMES.length; i++) {\n ui.getInfo().addText(WEAPON_NAMES[i].toString().substring(0,1) + WEAPON_NAMES[i].toString().substring(1).toLowerCase());\n }\n\n WeaponTypes murderWeapon = null;\n String weapon;\n\n // check the input from the user whether it is a weapon, help command, notes command or the wrong input\n do {\n weapon = ui.getCmd().getCommand().toLowerCase();\n switch (weapon) {\n case \"rope\":\n murderWeapon = WeaponTypes.ROPE;\n break;\n case \"dagger\":\n murderWeapon = WeaponTypes.DAGGER;\n break;\n case \"wrench\":\n murderWeapon = WeaponTypes.WRENCH;\n break;\n case \"pistol\":\n murderWeapon = WeaponTypes.PISTOL;\n break;\n case \"candlestick\":\n murderWeapon = WeaponTypes.CANDLESTICK;\n break;\n case \"pipe\":\n murderWeapon = WeaponTypes.PIPE;\n break;\n case \"notes\":\n currentPlayer.getPlayerNotes().showNotes(currentPlayer);\n break;\n case \"help\":\n ui.getInfo().addText(\"Select a weapon from the list above for the questioning!\");\n break;\n default:\n ui.getInfo().addText(\"That was an invalid entry, enter a weapon from the list above for the questioning!\");\n break;\n }\n } while (murderWeapon == null); // while the player input was not a weapon\n\n cardPanel.removePanel();\n ui.getLayers().remove(cardPanel);\n return new Card(murderWeapon.toString()); // return a card with the murder weapon selected by the user\n }", "@Test\n\tpublic void testPickUpItem() {\n\t\tSquare square = new Square();\n\t\tItem item = new LightGrenade();\n\t\t\n\t\tsquare.addItem(item);\n\t\t\n\t\tPlayer player = new Player(square, 0);\n\t\tassertEquals(0, player.getAllItems().size());\n\t\tassertFalse(player.hasItem(item));\n\t\t\n\t\tplayer.pickUp(item);\n\t\tassertTrue(player.hasItem(item));\n\t}", "@Override\n\tpublic WeaponSelection shoot(List<Weapon> loaded) {\n\t\tJSONObject message = new JSONObject();\n\t\tmessage.put(\"function\", \"select\");\n\t\tmessage.put(\"type\", \"shoot\");\n\t\treturn getWeaponSelection(loaded, message);\n\t}", "public String getSelectedWeaponName() {\n return \"\";\n }", "@Override\n public void useWeapon(ResponseInput responseMessage)\n {\n basicMode(((ResponseRocketLauncher) responseMessage).getTargetPlayerBasicMode(), ((ResponseRocketLauncher) responseMessage).getTargetSquareCoordinatesAsStringPlayerToMove(), ((ResponseRocketLauncher) responseMessage).getTargetSquareCoordinatesAsStringTargetToMove(), ((ResponseRocketLauncher) responseMessage).isWithFragWarhead() ) ;\n }", "@Override\n public void doPickupItem(final GameObject object) {\n if (!object.isItem()) {\n _log.warn(\"trying to pickup wrong target.\" + getTarget());\n return;\n }\n\n sendActionFailed();\n stopMove();\n\n final ItemInstance item = (ItemInstance) object;\n\n synchronized (item) {\n if (!item.isVisible()) {\n return;\n }\n\n // Check if me not owner of item and, if in party, not in owner party and nonowner pickup delay still active\n if (!ItemFunctions.checkIfCanPickup(this, item)) {\n final SystemMessage sm;\n if (item.getItemId() == ItemTemplate.ITEM_ID_ADENA) {\n sm = new SystemMessage(SystemMsg.YOU_HAVE_FAILED_TO_PICK_UP_S1_ADENA);\n sm.addNumber(item.getCount());\n } else {\n sm = new SystemMessage(SystemMsg.YOU_HAVE_FAILED_TO_PICK_UP_S1);\n sm.addItemName(item.getItemId());\n }\n sendPacket(sm);\n return;\n }\n\n // Herbs\n if (item.isHerb()) {\n final SkillEntry[] skills = item.getTemplate().getAttachedSkills();\n if (skills.length > 0) {\n for (final SkillEntry skill : skills) {\n altUseSkill(skill, this);\n if (getServitor() != null && getServitor().isSummon() && !getServitor().isDead()) {\n getServitor().altUseSkill(skill, getServitor());\n }\n }\n }\n\n broadcastPacket(new GetItem(item, getObjectId()));\n item.deleteMe();\n return;\n }\n\n final FlagItemAttachment attachment = item.getAttachment() instanceof FlagItemAttachment ? (FlagItemAttachment) item.getAttachment() : null;\n\n if (!isInParty() || attachment != null) {\n if (pickupItem(item, Log.Pickup)) {\n broadcastPacket(new GetItem(item, getObjectId()));\n broadcastPickUpMsg(item);\n item.pickupMe();\n }\n } else {\n getParty().distributeItem(this, item, null);\n }\n }\n }", "public void pickUp(Context context)\n {\n pickUpImplementation.pickUp(context, this);\n //TODO: play pickup sound\n }", "public boolean isSelectingWeapon() {\n return false;\n }", "@Override\n\tprotected void on_object_picked_up(GfxObject object) {\n\n\t}", "@Override\n public Type getItemType() {\n return Type.WEAPON;\n }", "@Override\n public String getDescription() {\n\t\treturn this.getName() + \"\\nDamage: \" + this.getWeaponDamage() + \"\\nSpeed: \" + this.getWeaponSpeed() + \"\\nRange: \" + this.getWeaponRange();\n \t\n }", "@Override\n public void equip(@NotNull IWeapon weapon) {\n weapon.equipToMage(this);\n }", "public String getWeaponName()\r\n\t{\r\n\t\treturn this.weaponName;\r\n\t}", "public void weaponAbility() {\n \tlogger.info(\"weapon abilities aren't implemented yet. Using slash ability\");\n \t//ability(map.getCurrentTurnHero().getWeaponAbility());\n \tability(new Slash());\n }", "public static void genWeaponList() {\r\n int i;\r\n\r\n auxItemVector.clear();\r\n \r\n if(currentChar == null) return;\r\n\r\n for (i = 0; i < currentChar.getItemsNumber(); i++) {\r\n if(currentChar.getItem(i).getType() == weapon)\r\n auxItemVector.add(currentChar.getItem(i));\r\n }\r\n }", "public void shoot() {\n\t\tgetWeapon().triggerMain();\n\t\tsetShooting(true);\n\t}", "public void pickUpHerd() {\n rounds.get(currentRound).currentPlayerPickUpHerd();\n }", "@Override\r\n public void paintWeapon(Graphics g, Player p, ArrayList <Enemies> e) {\r\n\r\n paintProjectile(e, g, p);\r\n deleteProjectiles();\r\n }", "public WeaponComponent() {\n weaponName = \"none\";\n owned = false;\n damagePower = 1;\n }", "@Override\n\tpublic WeaponSelection chooseWeapon(List<Weapon> selectable) {\n\t\tJSONObject message = new JSONObject();\n\t\tmessage.put(\"function\", \"select\");\n\t\tmessage.put(\"type\", \"weapon\");\n\t\tJSONArray jArray = new JSONArray();\n\t\tselectable.forEach(s->jArray.add(s.getName()));\n\t\tmessage.put(\"list\", jArray);\n\t\tthis.sendInstruction(message);\n\t\tJSONObject selected = (JSONObject) JSONValue.parse(this.getResponse());\n\n\t\treturn parseWeaponSelection(selected);\n\t}", "public abstract void pickUp();", "static void printGeneralOptions(){\n System.out.println(GeneralInfo.PREFIX_COMMAND_DESCRIPTION + \"NameWeapon/Powerup: read the description of that weapon/powerup\");\n }", "public void giveWeapon(Weapon weapon) throws RuntimeException {\n if (weaponList.size() > 2)\n throw new RuntimeException(\"This player can't receive any more weapons\");\n weaponList.add(weapon);\n }", "public static void getBattleChoice() {\n \t\tMainGame.display.disp(\"What do you want to do?:\");\r\n \t\tMainGame.display.Enable(MainGame.display.attack, MainGame.display.defend, MainGame.display.heal);\r\n \t}", "@Test\r\n public void test_weapon() {\r\n Weapon weapon1 = new Weapon(\"gun\", \"that a weapon for sure\", 7);\r\n assertEquals(\"gun\", weapon1.getInformation().getName());\r\n assertEquals(\"that a weapon for sure\", weapon1.getInformation().getDescription());\r\n assertEquals(7, weapon1.getDamage());\r\n }", "public String getEquippedWeapon()\n\t{\n\t\treturn strEquippedWeapon;\n\t\t\n\t}", "public String getWeapon() {\n return weapon1;\n }", "@Override\n public String toString() {\n return super.toString() + \"Subtype- X-wing fighter\\n\";\n }", "public void equipWeaponToCharacter (IPlayerCharacter character) {\n if (lenInventory > 1){\n character.equip(this.weaponsInventory.get(this.pointInventory));\n }\n }", "public void isPickingUpPowerup(Player player) {\n if (player.getActivePowerup() == null) {\n for (Powerup powerup : powerups) {\n if (powerup.getBoundsInParent().intersects(player.getBoundsInParent())) {\n player.setActivePowerup(powerup);\n fieldPane.getChildren().remove(powerup);\n cleanup.add(powerup);\n }\n }\n }\n }", "@Override\r\n\tpublic void equipArmor() {\n\t\tSystem.out.println(\"아머 장착\");\r\n\t}", "public Weapon(){\n \n name = \"Claw\"; // will be treated as a sword\n type = 'R';\n advType = 'G';\n disType = 'B';\n mt = 4;\n hit = 85;\n crit = 0;\n wt = 1;\n isMagic = true;\n \n }", "public abstract void fire(Player holder);", "public void setEquippedWeapon(String w)\n\t{\n\t\tstrEquippedWeapon = w;\n\t\t\n\t}", "public boolean mayPickup(Player debug1) {\n/* 112 */ return true;\n/* */ }", "public void paint() {\r\n\t\tBufferStrategy bf = base.frame.getBufferStrategy();\r\n\t\ttry {\r\n\t\t\tg = bf.getDrawGraphics();\r\n\t\t\tg.clearRect(0, 0, 1024, 768);\r\n\t\t\tg.setFont(normal);\r\n\t\t\tif (gameState == 1) {\r\n\t\t\t\tg.drawImage(playButton, playButtonXM, playButtonYM, playButtonWidthM, playButtonHeightM, this);\t\t\t\t\r\n\t\t\t}else if (gameState == 3){\r\n\t\t\t\tint weaponPosX = ((arrow2X-arrowX) /2) + arrowX - 20;\r\n\t\t\t\tint weaponPosY = arrowY - 15;\r\n\t\t\t\tg.drawImage(Arrow, arrowX, arrowY, arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrow2X, arrowY, -arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrowX, arrowY2ndRow, arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrow2X, arrowY2ndRow, -arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrowX, arrowY3rdRow, arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrow2X, arrowY3rdRow, -arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrowX, arrowY4thRow, arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(Arrow, arrow2X, arrowY4thRow, -arrowWidth, arrowHeight, this);\r\n\t\t\t\tg.drawImage(playButton, playButtonX, playButtonY, playButtonWidth, playButtonHeight, this);\r\n\r\n\t\t\t\t//text boxes above choices\r\n\t\t\t\tg.setColor(Color.black);\r\n\t\t\t\tg.drawString(\"Weapon\", weaponPosX, weaponPosY);\r\n\t\t\t\tg.drawString(\"Difficulty\", weaponPosX, (arrowY2ndRow - 15));\r\n\t\t\t\tg.drawString(\"Number of AI\", weaponPosX - 12, (arrowY3rdRow - 15));\r\n\t\t\t\tg.drawString(\"Number of players\", weaponPosX - 20, (arrowY4thRow - 15));\r\n\r\n\t\t\t\tif (getDifficulty() == 1){\r\n\t\t\t\t\tg.drawImage(Easy, difficultyXPos, arrowY2ndRow, difficultyWidth , arrowHeight, this);\r\n\t\t\t\t}else if (getDifficulty() == 2) {\r\n\t\t\t\t\tg.drawImage(Normal, difficultyXPos, arrowY2ndRow, difficultyWidth, arrowHeight, this);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tg.drawImage(Hard, difficultyXPos, arrowY2ndRow, difficultyWidth, arrowHeight, this);\r\n\t\t\t\t}\r\n\t\t\t\tif (getAttackStyle() == 2) {\r\n\t\t\t\t\tg.drawImage(Arrowr, weaponPosX -85, weaponPosY + 15, (arrow2X - arrowX) - 280, arrowHeight, this);\r\n\t\t\t\t}else {\r\n\t\t\t\t\t//due to the sword using all of the x positions the width is slightly different\r\n\t\t\t\t\tg.drawImage(SwordL, weaponPosX -85, weaponPosY + 15, (arrow2X - arrowX) - 300, arrowHeight, this);\r\n\t\t\t\t}\r\n\t\t\t\tint AIXPos = weaponPosX;\r\n\t\t\t\tif (AINum >= 10 && AINum<100) {\r\n\t\t\t\t\tAIXPos -=25;\r\n\t\t\t\t} else if (AINum >= 100 && AINum < 1000) {\r\n\t\t\t\t\t//the reason why this grows by 40 instead of an additional 20 is because we are not storing the variable\r\n\t\t\t\t\t//of current position anywhere so we just add another 20 onto the decrease\r\n\t\t\t\t\tAIXPos-=50;\r\n\t\t\t\t} else if (AINum >= 1000) {\r\n\t\t\t\t\tAIXPos-=75;\r\n\t\t\t\t}\r\n\t\t\t\tg.setFont(numbers);\r\n\t\t\t\tString currentNum = Integer.toString(AINum);\r\n\t\t\t\tString currentPlayerString = Integer.toString(currentPlayer);\r\n\t\t\t\tg.drawString(currentNum, AIXPos, arrowY3rdRow + 72);\r\n\t\t\t\tg.drawString(currentPlayerString, weaponPosX, arrowY4thRow + 72);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif ((!escape) && (!dead) &&(!allAIDead)) {\r\n\t\t\t\t\tg.drawImage(picture, 0, 0, base.frame.getWidth(), base.frame.getHeight(), this);\r\n\t\t\t\t\tfor (int i = 0; i < playerObject.length; i++) {\r\n\t\t\t\t\t\tint playerX = (int) playerObject[i].getX();\r\n\t\t\t\t\t\tint playerY = (int) playerObject[i].getY();\r\n\t\t\t\t\t\tg.setColor(Color.darkGray);\r\n\t\t\t\t\t\t// health bar\r\n\t\t\t\t\t\tg.fillRect(playerX, playerY - 30, 100, healthY);\r\n\t\t\t\t\t\tg.setColor(Color.red);\r\n\t\t\t\t\t\tg.fillOval(playerX, playerY, 20, 20);\r\n\t\t\t\t\t\tg.fillRect(playerX, playerY - 30, (int) (playerObject[i].getHealth()/2) , healthY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//AI\r\n\t\t\t\t\tfor (int i = 0; i < AIObject.length; i++) {\r\n\t\t\t\t\t\tif (!AIObject[i].isDead()) {\r\n\t\t\t\t\t\t\tint AIRoundedX = (int) AIObject[i].getAIX();\r\n\t\t\t\t\t\t\tint AIRoundedY = (int) AIObject[i].getAIY();\r\n\t\t\t\t\t\t\tif (AIObject[i].getColor() == null) {\r\n\t\t\t\t\t\t\t\tint red = generator.nextInt(256);\r\n\t\t\t\t\t\t\t\tint green = generator.nextInt(256);\r\n\t\t\t\t\t\t\t\tint blue = generator.nextInt(256);\r\n\t\t\t\t\t\t\t\tColor newColor = new Color(red,green,blue);\r\n\t\t\t\t\t\t\t\tg.setColor(newColor);\r\n\t\t\t\t\t\t\t\tAIObject[i].setColor(newColor);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tg.setColor(AIObject[i].getColor());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tg.fillOval(AIRoundedX, AIRoundedY, 20, 20);\r\n\t\t\t\t\t\t\tAIDeadCount = 0;\r\n\t\t\t\t\t\t\tg.setColor(Color.darkGray);\r\n\t\t\t\t\t\t\tg.fillRect(AIRoundedX, AIRoundedY - 40, AI_ORIG_HEALTH/AI_HEALTH_WIDTH_SCALE, healthY);\r\n\t\t\t\t\t\t\tg.setColor(AIObject[i].getColor());\r\n\t\t\t\t\t\t\tg.fillRect(AIRoundedX, AIRoundedY - 40, (int) AIObject[i].getAIHealth()/AI_HEALTH_WIDTH_SCALE, healthY);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tAIDeadCount++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// early access banner\r\n\t\t\t\t\tg.drawImage(earlyAccess, 0, 24, this);\r\n\r\n\t\t\t\t\tif (attackStyle == 2) {\r\n\t\t\t\t\t\tif (drawArrow == true) {\r\n\t\t\t\t\t\t\tinFlight = true;\r\n\t\t\t\t\t\t\tshouldPlaySound = true;\r\n\t\t\t\t\t\t\tif ((fireLeft) && (currentlyDrawingArrow != 2)) {\r\n\t\t\t\t\t\t\t\tgoingLeft = true;\r\n\t\t\t\t\t\t\t\tgoingRight = false;\r\n\t\t\t\t\t\t\t\tcurrentlyDrawingArrow = 1;\r\n\t\t\t\t\t\t\t\tg.drawImage(Arrowl, Math.round(aX), Math.round(aY), this);\r\n\r\n\t\t\t\t\t\t\t} else if ((fireRight) && (currentlyDrawingArrow != 1)) {\r\n\t\t\t\t\t\t\t\tgoingRight = true;\r\n\t\t\t\t\t\t\t\tgoingLeft = false;\r\n\t\t\t\t\t\t\t\tcurrentlyDrawingArrow = 2;\r\n\t\t\t\t\t\t\t\tg.drawImage(Arrowr, Math.round(aX), Math.round(aY), this);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((aX >= 1024) || (!drawArrow) || (aX <= 0)) {\r\n\t\t\t\t\t\t\tinFlight = false;\r\n\t\t\t\t\t\t\taX = playerObject[0].getX();\r\n\t\t\t\t\t\t\taY = playerObject[0].getY();\r\n\t\t\t\t\t\t\tcurrentlyDrawingArrow = 0;\r\n\t\t\t\t\t\t\tdrawArrow = false;\r\n\t\t\t\t\t\t\tshouldPlaySound = false;\r\n\t\t\t\t\t\t\tnotPlayingSound = false;\r\n\t\t\t\t\t\t\talreadyShot = false;\r\n\t\t\t\t\t\t\tif (wasReleased) {\r\n\t\t\t\t\t\t\t\tlClick = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tint roundedX = Math.round(playerObject[0].getX());\r\n\t\t\t\t\t\tint roundedY = Math.round(playerObject[0].getY());\r\n\t\t\t\t\t\tif (drawSword) {\r\n\t\t\t\t\t\t\tswordCount++;\r\n\t\t\t\t\t\t\tif (mouseLeft) {\r\n\t\t\t\t\t\t\t\tif (swordCount < 5) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX - 2, roundedY - 45, this);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (swordCount > 5 && swordCount <=15) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(Sword45L, roundedX - 45, roundedY - 30, this);\r\n\t\t\t\t\t\t\t\t}else if (swordCount >15 && swordCount<30) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordL, roundedX - 63, roundedY, this);\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (swordCount >30 || !drawSword){\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX - 2, roundedY - 45, this);\r\n\t\t\t\t\t\t\t\t\tswordCount = 0;\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\tif (swordCount < 5) {\r\n\t\t\t\t\t\t\t\t\t//image flip g.drawImage(SwordHorizontalL, Math.round(x) - 2, Math.round(y) - 45, -SwordHorizontalL.getWidth(this),SwordHorizontalL.getHeight(this),this);\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX + 20, roundedY - 45,\r\n\t\t\t\t\t\t\t\t\t\t\t-swordHorizontalLWidth,swordHorizontalLWidth,this);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (swordCount > 5 && swordCount <=15) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(Sword45L, roundedX + 80, roundedY - 30,\r\n\t\t\t\t\t\t\t\t\t\t\t-sword45LWidth, sword45LHeight, this);\r\n\t\t\t\t\t\t\t\t}else if (swordCount >15 && swordCount<30) {\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordL, roundedX +90, roundedY, -swordLWidth, swordLHeight, this);\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if (swordCount >30 || !drawSword){\r\n\t\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX + 20, roundedY - 45,\r\n\t\t\t\t\t\t\t\t\t\t\t-swordHorizontalLWidth, swordHorizontalLHeight, this);\r\n\t\t\t\t\t\t\t\t\tswordCount = 0;\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (shield) {\r\n\t\t\t\t\t\t\tif (mouseLeft) {\r\n\t\t\t\t\t\t\t\tg.drawImage(shieldImage, roundedX - 5, roundedY - 5, shieldWidth, scaledShieldHeight, this);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tg.drawImage(shieldImage, roundedX + 5, roundedY - 5, shieldWidth, scaledShieldHeight, this);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif(mouseLeft) {\r\n\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX - 2, roundedY - 45, this);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tg.drawImage(SwordHorizontalL, roundedX + 20, roundedY - 45,\r\n\t\t\t\t\t\t\t\t\t\t-SwordHorizontalL.getWidth(this), SwordHorizontalL.getHeight(this), this);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tswordCount = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (wasReleased) {\r\n\t\t\t\t\t\t\tlClick = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if (escape) {\r\n\t\t\t\t\tg.setColor(Color.white);\r\n\t\t\t\t\tg.drawRect(0, 0, 1024, 768);\r\n\t\t\t\t\tg.setColor(Color.black);\r\n\t\t\t\t\tg.drawString(\"PAUSED\", 512, 389);\r\n\t\t\t\t}\r\n\t\t\t\telse if (dead) {\r\n\t\t\t\t\tg.setColor(Color.black);\r\n\t\t\t\t\tg.drawRect(0, 0, 1024, 768);\r\n\t\t\t\t\tg.drawString(\"Dead\", 512, 389);\r\n\t\t\t\t} else if(allAIDead) {\r\n\t\t\t\t\tg.setColor(Color.black);\r\n\t\t\t\t\tg.drawRect(0, 0, 1024, 768);\r\n\t\t\t\t\tg.drawString(\"You win\", 512, 389);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tg.dispose();\r\n\t\t}\r\n\t\t// Shows the contents of the backbuffer on the screen.\r\n\t\tbf.show();\r\n\t}", "public Weapon ()\r\n\t{\r\n\t\t//no default values for Weapon attributes are set here as the specific weapon type unspecified at super level\r\n\t}", "public Weapon()\n {\n name = \"None\";\n speed = 2;\n damage = 1;\n range = 1;\n }", "public void triggerPickedUp(boolean b);", "public String randWeapon() {\n\n\t\t// Generates a random number.\n\t\tRandom rand = new Random();\n\n\t\t// A random number between 0 and 2 is generated, and the value at that index in\n\t\t// the Choice array is then saved to the variable compChoice\n\t\tString compChoice = weapArray[rand.nextInt(3)];\n\n\t\t// Makes the users weapon equal to whichever weapon they inputed\n\t\tswitch (compChoice) {\n\n\t\tcase \"Rock\":\n\t\t\tweapon = new Rock();\n\t\t\tbreak;\n\t\tcase \"Paper\":\n\t\t\tweapon = new Paper();\n\t\t\tbreak;\n\t\tcase \"Scissors\":\n\t\t\tweapon = new Scissors();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn compChoice;\n\t}", "@Test\n void doEffectshotgun() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"shotgun\");\n Weapon w9 = new Weapon(\"shotgun\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w9);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w9.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(0));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n try{\n p.getPh().getWeaponDeck().getWeapon(w9.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && victim.getPlayerPosition() == Board.getSquare(0));\n\n s.add(Board.getSquare(1));\n try{\n p.getPh().getWeaponDeck().getWeapon(w9.getName()).doEffect(\"base\", null, null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 6 && victim.getPlayerPosition() == Board.getSquare(1));\n\n s.clear();\n s.add(Board.getSpawnpoint('b'));\n try {\n p.getPh().getWeaponDeck().getWeapon(w9.getName()).doEffect(\"base\", null, null, p, players, s); //A choice of yours is yours\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(1));\n players.clear();\n players.add(victim);\n s.clear();\n try {\n p.getPh().getWeaponDeck().getWeapon(w9.getName()).doEffect(\"alt\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('b'));\n players.clear();\n players.add(victim);\n s.clear();\n try{\n p.getPh().getWeaponDeck().getWeapon(w9.getName()).doEffect(\"alt\", null, null, p, players, null); //A choice of yours is wrong\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n }", "public void selectWeaponFromInventory(int weaponIndex) {\n }", "@Override\n\tpublic void onPicked() {\n\n\t}", "@Override\n\tpublic void addEquipment(Weapon w) {\n\t\tif (nbWeapons() > 0)\n\t\t\tthrow new BreakingRuleException();\n\t\tsuper.addEquipment(w);\n\t}", "private void tryEquipItem() {\n if (fakePlayer.get().getHeldItem(EnumHand.MAIN_HAND).isEmpty()) {\n ItemStack unbreakingPickaxe = new ItemStack(Items.DIAMOND_PICKAXE, 1);\n unbreakingPickaxe.addEnchantment(Enchantments.EFFICIENCY, 3);\n unbreakingPickaxe.setTagCompound(new NBTTagCompound());\n unbreakingPickaxe.getTagCompound().setBoolean(\"Unbreakable\", true);\n fakePlayer.get().setItemStackToSlot(EntityEquipmentSlot.MAINHAND, unbreakingPickaxe);\n }\n }", "@Test\n void doEffectheatseeker() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"heatseeker\");\n Weapon w4 = new Weapon(\"heatseeker\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w4);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w4);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w4.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(10));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n try{\n p.getPh().getWeaponDeck().getWeapon(w4.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3);\n }", "public PowerUp()\n {\n powerUp = new Rectangle();\n Random gen = new Random();\n int x = gen.nextInt(9);\n switch(x){\n case 0: type = \"Life\"; break;\n case 1: type = \"Laser\"; break;\n case 2: type = \"Gun\"; break;\n case 3: type = \"Long\"; break;\n case 4: type = \"Multi\"; break;\n case 5: type = \"Catch\"; break;\n case 6: type = \"Slow\"; break;\n case 7: type = \"Flip\"; break;\n case 8: type = \"Bomb\"; break;\n }\n text = new Rectangle();\n }", "public Weapon getWeapon(){\n return this.weaponPos;\n }", "public static void showCombatInterface(Player player, int weapon) {\n\t\tString itemName = ItemAssistant.getItemName(weapon);\n\t\tfor (int i = 0; i < unarmedItemNames.length; i++) {\n\t\t\tif (itemName.toLowerCase().equals(unarmedItemNames[i])) {\n\t\t\t\tplayer.playerAssistant.setSidebarInterface(0, 5855); // punch, kick, block\n\t\t\t\tplayer.getPA().sendFrame126(itemName, 5857);\n\t\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\t\tCombatInterface.updateClickedCombatStyle(player);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tboolean doNotChange = false;\n\t\tif ((GameType.isPreEoc() && weapon == 19780)) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 4705);\n\t\t\tplayer.getPA().sendFrame246(426, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 4708);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"whip\")\n\t\t\t\t|| itemName.toLowerCase().contains(\"abyssal tentacle\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 12290); // flick, lash, deflect\n\t\t\tplayer.getPA().sendFrame246(12291, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 12293);\n\t\t\treAdjustCombatStyle(player, \"AGGRESSIVE\", ServerConstants.CONTROLLED);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"chinchompa\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 27500); // first param\n\t\t\tplayer.getPA().sendFrame126(itemName, 27503); // first param + 2\n\t\t\treAdjustCombatStyle(player, \"DEFENSIVE\", ServerConstants.CONTROLLED);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"dagger\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 2276); // stab, lunge, slash, block\n\t\t\tplayer.getPA().sendFrame246(2277, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 2279);\n\t\t}\n\t\telse if (itemName.toLowerCase().contains(\"bow\") || itemName.toLowerCase().contains(\"ballista\") || itemName.toLowerCase().contains(\"cannon\") || itemName.toLowerCase().contains(\"javelin\") || itemName.toLowerCase().contains(\"throwing\") || itemName.toLowerCase().contains(\"dragon thrownaxe\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 1764); // accurate, rapid, longrange\n\t\t\tplayer.getPA().sendFrame246(1765, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 1767);\n\t\t\treAdjustCombatStyle(player, \"DEFENSIVE\", ServerConstants.CONTROLLED);\n\t\t} else if (!itemName.toLowerCase().contains(\"saradomin sword\") && !itemName.toLowerCase().contains(\"blessed sword\") && !itemName.toLowerCase().contains(\"2h\") && (\n\t\t\t\titemName.toLowerCase().contains(\"rapier\") || itemName.toLowerCase().contains(\"sword\") && !itemName.toLowerCase().contains(\"godsword\") && !itemName.toLowerCase()\n\t\t\t\t .contains(\n\t\t\t\t\t\t \"longsword\"))\n\t\t\t\t|| itemName.toLowerCase().contains(\"toktz-xil-ek\") || itemName.toLowerCase().contains(\"toktz-xil-ak\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 2276); // stab, lunge, slash, block\n\t\t\tplayer.getPA().sendFrame246(2277, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 2279);\n\t\t} else if (itemName.toLowerCase().contains(\"staff\") || itemName.toLowerCase().contains(\"wand\") || itemName.toLowerCase().contains(\"staff of light\")\n\t\t\t\t|| itemName.toLowerCase().contains(\"trident\") || itemName.toLowerCase().contains(\"thammaron's sceptre\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 328); // bash, pound, focus.\n\t\t\tplayer.getPA().sendFrame246(329, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 331);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t}\n\t\telse if (itemName.toLowerCase().contains(\"dart\") || itemName.toLowerCase().contains(\"knife\") || itemName.toLowerCase().contains(\"blowpipe\") || itemName.toLowerCase()\n\t\t .contains(\n\t\t\t\t \"toktz-xil-ul\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 4446); // accurate, rapid, longrange\n\t\t\tplayer.getPA().sendFrame246(4447, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 4449);\n\t\t\treAdjustCombatStyle(player, \"DEFENSIVE\", ServerConstants.CONTROLLED);\n\t\t} else if (itemName.toLowerCase().contains(\"pickaxe\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 5570); // spike, impale, smash, block\n\t\t\tplayer.getPA().sendFrame246(5571, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 5573);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"axe\") || itemName.toLowerCase().contains(\"hatchet\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 1698); // chop, hack, smash, block\n\t\t\tplayer.getPA().sendFrame246(1699, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 1701);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"claws\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 7762);\n\t\t\tplayer.getPA().sendFrame246(7763, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 7765);\n\t\t} else if (itemName.toLowerCase().contains(\"halberd\") || itemName.toLowerCase().contains(\"scythe\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 8460); // jab, swipe, fend\n\t\t\tplayer.getPA().sendFrame246(8461, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 8463);\n\t\t\treAdjustCombatStyle(player, \"ACCURATE\", ServerConstants.AGGRESSIVE);\n\t\t} else if (itemName.toLowerCase().contains(\"spear\") || itemName.toLowerCase().contains(\"hasta\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 4679); // lunge, swipe, pound, block\n\t\t\tplayer.getPA().sendFrame246(4680, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 4682);\n\t\t\treAdjustCombatStyle(player, \"AGGRESSIVE ACCURATE\", ServerConstants.CONTROLLED);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"mace\") || itemName.toLowerCase().contains(\"barrelchest\") || itemName.toLowerCase().contains(\"flail\") || itemName.toLowerCase()\n\t\t .contains(\n\t\t\t\t \"cane\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 3796);\n\t\t\tplayer.getPA().sendFrame246(3797, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 3799);\n\t\t} else if (itemName.toLowerCase().contains(\"maul\") || itemName.toLowerCase().contains(\"hammer\") || itemName.toLowerCase().contains(\"tzhaar-ket-om\")\n\t\t || itemName.toLowerCase().contains(\"dinh's\") || itemName.contains(\"spade\") || itemName.contains(\"club\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 425); // war hamer equip.\n\t\t\tplayer.getPA().sendFrame246(426, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 428);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"godsword\") || itemName.toLowerCase().contains(\"2h\") || itemName.toLowerCase().contains(\"saradomin sword\")\n\t\t\t\t|| itemName.toLowerCase().contains(\"sara's blessed sword\")\n\t\t\t\t|| (GameType.isPreEoc() && weapon == 19780)) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 4705); // Godsword.\n\t\t\tplayer.getPA().sendFrame246(426, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 4708);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 2423); // chop, slash, lunge, block\n\t\t\tplayer.getPA().sendFrame246(2424, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 2426);\n\t\t}\n\t\tswitch (weapon) {\n\t\t\tcase 20779:\n\t\t\t\tplayer.playerAssistant.setSidebarInterface(0, 425); // war hamer equip.\n\t\t\t\tplayer.getPA().sendFrame246(426, 200, weapon);\n\t\t\t\tplayer.getPA().sendFrame126(itemName, 428);\n\t\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\t\tdoNotChange = true;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Whip is the only main weapon where the aggressive option is controlled, so make it easier by if i use whip and switch to another weapon, it puts the other weapon\n\t\t//on aggressive instead of longrange/lunge.\n\t\tif (player.wasWearingAggressiveSharedXpWeapon && !doNotChange) {\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t}\n\t\tplayer.wasWearingAggressiveSharedXpWeapon = false;\n\t\tCombatInterface.updateClickedCombatStyle(player);\n\t}", "public void drawUserWeapons(Graphics g) {\r\n\t\tlevelManager.drawUserWeapons(g);\r\n\t}", "public void addPreferedWeapon() {\n\t\tfor(int i = 0; i < killers.size(); i++) {\n\t\t\t\n\t\t\tList<String> list = new ArrayList<>();\n\t\t\t\n\t\t\tfor(String key : killers.get(i).getWeapons().keySet()) {\n\t\t\t\tlist.add(killers.get(i).getWeapons().get(key) + \";\" + key);\n\t\t\t}\n\t\t\t\n\t\t\tComparator<String> comp = (s1, s2) -> {\n\t\t\t\treturn s1.compareTo(s2);\n\t\t\t};\n\t\t\t\n\t\t\tCollections.sort(list, Collections.reverseOrder(comp));\n\t\t\tList<String> list2 = new ArrayList<>();\n\t\t\t\n\t\t\tif(!list.isEmpty()) {\n\t\t\t\tint control = extractNumberFromText(list.get(0));\n\t\t\t\t\n\t\t\t\tlist.forEach(s -> {\n\t\t\t\t\tif(extractNumberFromText(s) == control)\n\t\t\t\t\t\tlist2.add(s);\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tkillers.get(i).setWeaponMoreUsed(list2);\n\t\t}\n\t}", "@Test\n public void collectWeaponEventTest() {\n match.getGameBoard().weaponCardsSetup(new WeaponsDeck());\n List<Coordinates> path = new ArrayList<>();\n path.add(new Coordinates(1,2));\n List<WeaponCardClient> weaponCards = new ArrayList<>();\n weaponCards = match.getGameBoard().getWeaponCardsOnMap().get(new Coordinates(2,2));\n\n try {\n PowerUpsDeck powerUpsDeck = new PowerUpsDeck();\n List<PowerUpCardClient> powerUpCardClients = new ArrayList<>();\n for(int i = 0; i < 3; i++) {\n powerUpCardClients.add(new PowerUpCardClient(powerUpsDeck.drawCard()));\n }\n WeaponCollectionEvent collectPlayEvent = new WeaponCollectionEvent(0, \"tony\", path, weaponCards.get(0), null, powerUpCardClients);\n turnController.handleEvent(collectPlayEvent);\n } catch(URISyntaxException e) {\n e.printStackTrace();\n } catch(HandlerNotImplementedException e) {\n e.printStackTrace();\n }\n assertFalse(match.getGameBoard().getWeaponCardsOnMap().get(new Coordinates(2,2)).contains(weaponCards.get(0)));\n assertEquals(new Coordinates(1,2), match.getGameBoard().getPlayerPosition(first).getCoordinates());\n }", "public void getPowerUp(PowerUp powerUp) \n\t{\n\t\tswitch(powerUp.getType())\n\t\t{\n\t\t\tcase 0:\n\t\t\t\t\n\t\t\t\tif(weapon != PROTON_WEAPON)\n\t\t\t\t\tbulletPool.clear(weapon);\n\t\t\t\t\n\t\t\t\tweapon = PROTON_WEAPON;\n\t\t\t\tfireRate = 5;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1:\n\t\t\t\t\n\t\t\t\tif(weapon != VULCAN_WEAPON)\n\t\t\t\t\tbulletPool.clear(weapon);\n\t\t\t\t\n\t\t\t\tweapon = VULCAN_WEAPON;\n\t\t\t\tfireRate = 3;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 2:\n\t\t\t\t\n\t\t\t\tif(weapon != GAMMA_WEAPON)\n\t\t\t\t\tbulletPool.clear(weapon);\n\t\t\t\t\n\t\t\t\tweapon = GAMMA_WEAPON;\n\t\t\t\tfireRate = 8;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 3:\n\t\t\t\thealth += (health+20>100)?0: 20;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 4:\n\t\t\t\t\n\t\t\t\tif(speedBoost == 0)\n\t\t\t\t\tspeedBoost = 3;\n\t\t\t\t\n\t\t\t\tspeedBoostCounter =0;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n\t\tSoundManager.getInstance().playSound(\"powerup\", false);\n\t}", "public boolean pickedup(Player player) {\n\t\treturn false;\n\t}", "private void Management_Player(){\n\t\t\n\t\t// render the Player\n\t\tswitch(ThisGameRound){\n\t\tcase EndRound:\n\t\t\treturn;\t\t\t\n\t\tcase GameOver:\n\t\t\t// do nothing\n\t\t\tbreak;\n\t\tcase Running:\n\t\t\tif (PauseGame==false){\n\t\t\t\tplayerUser.PlayerMovement();\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse if (PauseGame==true){\n\t\t\t\t// do not update gravity\n\t\t\t}\n\t\t\tbreak;\t\t\n\t\t}\n\t\n\t\tbatch.draw(playerUser.getframe(PauseGame), playerUser.getPosition().x , playerUser.getPosition().y,\n\t \t\tplayerUser.getBounds().width, playerUser.getBounds().height);\n\t\t\n\t\t\n\t\t\n\t\tswitch (playerUser.EquipedToolCycle)\n\t\t{\t\n\t\tcase 0:\n\t\t\tstartTimeTool = System.currentTimeMillis(); \n\t\t\tbreak;\n\t\t\t\n\t\tcase 1: \n\t\t\t\n\t\t\tif (PauseGame==true){\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// tool is grabbed\n\t\t\testimatedTimeEffect = System.currentTimeMillis() - startTimeTool;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\tplayerUser.pe_grab.setPosition(playerUser.getPosition().x + playerUser.getBounds().width/2,\n\t\t\t\t\tplayerUser.getPosition().y + playerUser.getBounds().height/2);\t\n \t\t\n\t\t\t\tplayerUser.pe_grab.update(Gdx.graphics.getDeltaTime());\n\t\t\t\tplayerUser.pe_grab.draw(batch,Gdx.graphics.getDeltaTime()); \t\t\t\t\t\t\t\n\t\t\t\n\t\t\tif (estimatedTimeEffect >= Conf.SYSTIME_MS){\n\t\t\t\testimatedTimeEffect = 0;\n\t\t\t\tplayerUser.ToolEquiped();\n\t\t\t\tstartTimeTool = System.currentTimeMillis(); \n\t\t\t\tplayerUser.EquipedToolCycle++;\n\t\t\t}else{\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\t\t\n\t\tcase 2:\n\t\t\t\n\t\t\tif (PauseGame==true){\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\testimatedTimeEffect = (System.currentTimeMillis() - startTimeTool) / 1000;\t\t\t\t\n\t\t\tplayerUser.pe_equip.setPosition(playerUser.getPosition().x + playerUser.getBounds().width/2,\n\t\t\tplayerUser.getPosition().y + playerUser.getBounds().height/2);\t\n\t\t\tplayerUser.pe_equip.update(Gdx.graphics.getDeltaTime());\n\t\t\tplayerUser.pe_equip.draw(batch,Gdx.graphics.getDeltaTime()); \t\t\t\t\n\t\t\tif (estimatedTimeEffect>=Conf.TOOL_TIME_USAGE_LIMIT){\n\t\t\t\tplayerUser.EquipedToolCycle=0;\t\t\n\t\t\t\tplayerUser.color = Color.NONE;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (estimatedTimeEffect>=Conf.TOOL_TIME_USAGE_MUSIC_LIMIT){\n\t\t\t\tPhoneDevice.Settings.setMusicValue(true);\n\t\t\t}\n\t\t}\t\t\t\t\n\t}", "public void addWeapon(Weapon x){\n\t\tplayerWeapon=new Weapon(x);\n\t\tHealth+=x.gethealthStat();\n\t\tAttackForce+=x.getafStat();\n\t\tDefense+=x.getdefenseStat();\n\t}", "public void pickUp(String itemName, World world) {\n\t\tItem item = world.dbItems().get(itemName);\n\t\tRoom room = super.getRoom();\n\t\tList<Item> roomItems = room.getItems();\n\n\t\tif (roomItems.contains(item)) {\n\t\t\tif (checkCapacity(item)) {\n\t\t\t\tsuper.addItem(item);\n\t\t\t\troom.removeItem(item);\n\t\t\t\tSystem.out.println(\"Picked up \" + item);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Not enough capacity.\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"No item '\" + itemName + \"' in the room.\");\n\t\t}\n\t}", "public void attack() {\n if (activeWeapon == null) {\n return;\n }\n attacking = true;\n }", "public WeaponInterface getWeaponTab() {\r\n return player.getExtension(WeaponInterface.class);\r\n }", "@Override\r\n public String speak(){\r\n System.out.println(\"Breed: \" + this.Breed + \"\\nName: \"+ super.name + \"\\nPrimary Color: \" +this.PrimaryColor + \"\\nSize: \" + this.Size);\r\n return \"Bork Bark\";\r\n\r\n }", "private void functionalInterface1() {\n\t\tcharmander.heal();\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\n\t\tguilherme.powerUp(charmander, new BigDecimal(\"-10\"), psMinimalDamage); // -10\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\n\t\tguilherme.powerUp(charmander, new BigDecimal(\"-10\"), psHugeDamage); // -20\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\t}", "public Weapon (Player player) {\n\t\tthis.player = player;\n\t}", "public void addWeapon(Pair<Byte,Short> weapon){\n //Total number of weapons player can carry is 5 (inc. default weapon)\n //If player has <3 weapons, simply add weapon.\n //Otherwise, first remove oldest weapon in inventory then add at that\n //position.\n //oldest weapon tracked by linked list of weapon entries.\n if(this.weapons.size() < 3) {\n this.weapons.add(weapon);\n this.weaponEntryTracker.add((byte) this.weapons.indexOf(weapon));\n }else{\n //Checks for duplicates, if duplicate weapons\n //found, new weapons ammo is just added to the current\n //weapon already in inventory\n for(Pair<Byte,Short> w : this.weapons){\n if(Objects.equals(w.getKey(), weapon.getKey())){\n if(weaponEntryTracker.size() == 1){\n weaponEntryTracker = new LinkedList<>();\n }\n else{\n for(int tracker : weaponEntryTracker){\n if(tracker == this.weapons.indexOf(w)){\n weaponEntryTracker.remove((Integer) tracker);\n }\n }\n }\n Pair<Byte,Short> newWeapon = new Pair<>(weapon.getKey(), (short) (w.getValue()+weapon.getValue()));\n if(this.currentWeapon == w){\n this.setCurrentWeapon(newWeapon);\n }\n this.weapons.set(this.weapons.indexOf(w),newWeapon);\n weaponEntryTracker.add((byte) this.weapons.indexOf(newWeapon));\n return;\n }\n }\n //check for any no weapon entries - indicates\n //player dropped weapon.\n for(Pair<Byte,Short> w : this.weapons){\n if(w.getKey() == NO_WEAPON_ID){\n this.weapons.set(this.weapons.indexOf(w),weapon);\n this.weaponEntryTracker.add((byte) this.weapons.indexOf(weapon));\n return;\n }\n }\n //If no null entries are found, remove oldest weapon\n int oldestWeapon = this.weaponEntryTracker.poll();\n byte oldestWeaponKey = this.weapons.get(oldestWeapon).getKey();\n this.weapons.set(oldestWeapon, weapon);\n this.weaponEntryTracker.add((byte) this.weapons.indexOf(weapon));\n if(oldestWeaponKey == currentWeapon.getKey()){\n setCurrentWeapon(weapon);\n }\n\n }\n }", "@Override\r\n public void playGame() {\r\n printInvalidCommandMessage();\r\n }", "@Test\n void doEffectPlasmaGun() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"plasma gun\");\n Weapon w17 = new Weapon(\"plasma gun\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w17);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w17.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2);\n\n p.setPlayerPosition(Board.getSpawnpoint(2));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(6));\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"opt1\", \"base\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && p.getPlayerPosition() == Board.getSquare(6));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(1));\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"base\", \"opt1\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && p.getPlayerPosition() == Board.getSquare(1));\n\n p.setPlayerPosition(Board.getSpawnpoint(2));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(6));\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"opt1\", \"base\", \"opt2\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && p.getPlayerPosition() == Board.getSquare(6));\n\n p.setPlayerPosition(Board.getSquare(6));\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSpawnpoint('b'));\n try {\n p.getPh().getWeaponDeck().getWeapon(w17.getName()).doEffect(\"base\", \"opt2\", \"opt1\", p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3 && p.getPlayerPosition() == Board.getSpawnpoint('b'));\n }", "public Weapon getWeapon() {\n\t\treturn weapon;\n\t}", "public WeaponTest() {\r\n\r\n }", "public void equip();", "@Override\n public void poll() {\n if( state == State.attacking ) {\n if( !ctx.movement.running() && ctx.movement.energyLevel() >= 75) {\n stateText = \"Setting running\";\n ctx.movement.running(true);\n }\n stateText = \"\";\n if( isAttacking() ) {\n stateText = \"Attacking\";\n Item ammo = inventory.getFirst(ammoUsed);\n if( ammo != null && ammo.valid() ){\n inventory.clickItem(ammo);\n sleep(100);\n }\n } else {//TODO find out why it stops picking up arrows after some time\n if (!inventory.full() && (targetBone == null || !targetBone.valid() || !misc.pointOnScreen(targetBone.centerPoint())) ) {\n targetBone = getNextGroundBone();\n clickedGroundItem = false;\n }\n if (!inventory.full() && targetBone != null && targetBone.valid() && misc.pointOnScreen(targetBone.centerPoint())) {\n stateText = \"Picking up bones\";\n if( !ctx.players.local().inMotion() )\n clickedGroundItem = false;\n if (!clickedGroundItem ) {\n clickedGroundItem = groundItems.pickup(targetBone);\n }\n } else if( inventory.full() && inventory.contains(bones) ) {\n state = State.burying;\n } else {\n if( !clickedMonster || !target.valid() || target.health() <= 0 || target.interacting() != ctx.players.local() ) {\n target = getNextTarget();\n clickedMonster = false;\n }\n if (!misc.pointOnScreen(target.centerPoint())) {\n if (target.tile().matrix(ctx).onMap()) {\n stateText = \"Walking to monster\";\n movement.walkTile(target.tile());\n }\n } else {\n stateText = \"Attacking monster\";\n if( !clickedMonster ) {\n clickedMonster = npcs.attackMonster(target);\n }\n }\n }\n }\n }else if( state == State.burying){\n Item invBones = inventory.getFirst(bones);\n if( invBones!= null && invBones.valid()) {\n stateText = \"Clicking bones\";\n inventory.clickItem(invBones);\n }else {\n state = State.attacking;\n }\n }\n checkIfBeingAttacked();\n }", "protected void notifyLevelUp(Player player, SavedHorse savedHorse, AbstractHorse horse, Ability ability) {\n player.sendMessage(ChatColor.GOLD + savedHorse.getMessageName() +\n \" is now Level \" + ability.getLevel(savedHorse) +\n \" in \" + ability.getDisplayName() + \".\");\n Location loc = horse.getLocation().add(0, 1, 0);\n loc.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, loc, 100, 2.0f, 1.0f, 2.0f);\n loc.getWorld().playSound(loc, Sound.ENTITY_PLAYER_LEVELUP, SoundCategory.NEUTRAL, 2.0f, 1.0f);\n }", "@Override\n public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) \n {\n if (item.itemID == mod_TFmaterials.RubyPickaxe.itemID)\n {\n \t//player.addStat(mod_TFmaterials.RubyPickAchieve, 1);\n \tplayer.addStat(mod_TFmaterials.RubyPickAchieve, 1);\n }\n }", "public interface IPickupItem extends WrapperItem {\n\n void onPlayerPickupItem(Kit kit, PlayerPickupItemEvent event);\n\n}", "public WeaponType getSelectedWeaponType() {\n return WeaponType.NULL;\n }", "@Test\n void doEffectwhisper() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"whisper\");\n Weapon w6 = new Weapon(\"whisper\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w6);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setPlayerPosition(Board.getSpawnpoint(2));\n p.getPh().drawWeapon(wd, w6.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n\n try{\n p.getPh().getWeaponDeck().getWeapon(w6.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().getMarkedDamages('b') == 1 && victim.getPb().countDamages() == 3);\n\n players.get(0).setPlayerPosition(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w6.getName()).doEffect(\"base\", null, null, p, players, null); //\"A choice of yours is wrong\"\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n }", "public abstract void activatedBy(Player player);", "public void printVictoryMessage() { //main playing method\r\n System.out.println(\"Congrats \" + name + \" you won!!!\");\r\n }", "public void printInventory()\n { \n System.out.println();\n\n // Checks if the player has items.\n if(!(getPerson(PLAYER).getInventory().getItems().isEmpty())){\n System.out.println(\"In your backpack, you have:\");\n\n // Gets each item in the player's inventory.\n for(Item item: getPerson(PLAYER).getInventory().getItems()){\n System.out.print(item.getName() + \",\");\n }\n System.out.println();\n System.out.println(\"You are carrying \"+ getPerson(PLAYER).getWeight() + \"kg.\");\n }\n else{\n System.out.println(\"There are currently no items in your backpack.\");\n }\n System.out.println();\n }", "static void feedPet() {\r\n\t\tJOptionPane.showMessageDialog(null, \"Your \" + pet + \" is happy and full.\");\r\n\t\thappinessLevel+=3;\r\n\t}", "@Override\r\n\tprotected String play() \r\n\t{\r\n\t\treturn \"The \" + this.getClass().getSimpleName() + \" Class.\" + \"\\n\" + this.getName() + \" is up!\";\r\n//\t\tSystem.out.println( \"The \" + this.getClass().getSimpleName() + \" Class.\");\r\n//\t\tSystem.out.println( this.getName() + \" is up!\" );\t\r\n\t}", "@Override\n public void chew() {\n MessageUtility.logSound(name,\"Bleats and Stomps its legs, then chews\");\n }", "public void selectWeapon( final int weaponIndex ) throws RemoteException {\r\n if ( weaponIndex < weapons.length ) {\r\n playerState.weaponIndex = weaponIndex;\r\n playerState.weapon = weapons[ playerState.weaponIndex ];\r\n }\r\n }", "public abstract void performPurchase(Player player);", "private void functionalInterface2() {\n\t\tPokedex.printData(Arrays.asList(charmander));\n\n\t\tguilherme.powerUp(charmander, new BigDecimal(\"-10\"), psRestoreHp // 100\n\t\t\t\t.and(psMinimalDamage) // -10\n\t\t\t\t.and(psIncreaseHp) // +25\n\t\t\t\t.and(psMinimalDamage) // -10\n\t\t\t\t.and(psHugeDamage) // -20\n\t\t);\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\t}", "private void bust() {\n //Dialog box pop-up\n JOptionPane.showMessageDialog(this, this.getPlayerName() + \" busted with a value of: \" + this.getValue(), \"BUSTED!\", JOptionPane.INFORMATION_MESSAGE);\n busted = true; //Hand busted\n }", "static void pickup(Player player, String what) {\n if (player.getLocation().contains(what)) {\n Thing thing = player.pickup(what);\n if (thing != null) {\n System.out.println(\"You now have \" + thing);\n }\n else {\n System.out.println(\"You can't carry that. You may need to drop something first.\");\n }\n }\n else {\n System.out.println(\"I don't see a \" + what);\n }\n }", "public void addSpawnpointWeapon(Weapon w) {\n this.weaponSpawnpoint.addWeapon(w);\n }", "@Override\n\tpublic int buy(Weapon item) {\n\t\treturn 0;\n\t}", "@Override\n public Event performAction(RemoteView remoteView) {\n\n return remoteView.weaponDiscardChoice(getWeapons());\n }", "public int getSelectedWeaponDamage() {\n return 0;\n }" ]
[ "0.6825087", "0.6813447", "0.6724722", "0.6575566", "0.62215394", "0.62032247", "0.6175368", "0.61686593", "0.6093377", "0.60658777", "0.6033952", "0.5998935", "0.599208", "0.59615004", "0.5946119", "0.5916033", "0.5862785", "0.58211535", "0.58182234", "0.5788129", "0.5771971", "0.57500315", "0.5702857", "0.5697992", "0.56893927", "0.5685643", "0.56841373", "0.568057", "0.56697804", "0.56616694", "0.5655146", "0.56494", "0.5632946", "0.56161386", "0.55924726", "0.5586493", "0.55221945", "0.5519607", "0.5517715", "0.55032116", "0.54847264", "0.5483743", "0.5482782", "0.5468904", "0.54667866", "0.54665613", "0.5451291", "0.5444117", "0.5421086", "0.5417706", "0.5415796", "0.5409998", "0.53998184", "0.5396173", "0.53876626", "0.5386244", "0.53670794", "0.5360246", "0.5349573", "0.53479105", "0.5342701", "0.5338782", "0.53336734", "0.53268987", "0.53240633", "0.5315969", "0.53156143", "0.53131974", "0.53088325", "0.5301114", "0.5294608", "0.529079", "0.52892977", "0.5283891", "0.5270909", "0.52685124", "0.5263976", "0.5263933", "0.526271", "0.52574265", "0.52561456", "0.5254559", "0.5250718", "0.5249137", "0.5248696", "0.5248394", "0.524667", "0.5244841", "0.52398336", "0.5239628", "0.52390003", "0.5238586", "0.52325493", "0.5231968", "0.5230188", "0.5224765", "0.5222842", "0.5212921", "0.52097994", "0.52032965" ]
0.5967809
13
not used right now
private void addStudents() { SimpleDateFormat sdf = new SimpleDateFormat("u"); String className = SchoolClassHandler.getTimetable().getClassName(new Integer(sdf.format(new Date())), new Date()); addButton(className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "private void strin() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private void kk12() {\n\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "public void mo4359a() {\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "private void poetries() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "protected void mo6255a() {\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "private void getStatus() {\n\t\t\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "public void method_4270() {}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "private void m50366E() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo6081a() {\n }", "@Override\n\tprotected void logic() {\n\n\t}", "public void mo12628c() {\n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "public void baocun() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public void smell() {\n\t\t\n\t}", "public void skystonePos4() {\n }", "public abstract void mo70713b();", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n protected void prot() {\n }", "public abstract void mo56925d();", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "private void init() {\n\n\n\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void mo21877s() {\n }", "private void init() {\n\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "public void skystonePos6() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "private void parseData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}" ]
[ "0.6185394", "0.61726886", "0.6104661", "0.6006777", "0.5998131", "0.59694767", "0.5904649", "0.5904649", "0.5857314", "0.58547324", "0.58429813", "0.58190024", "0.5817078", "0.5808394", "0.5766198", "0.5761523", "0.57545733", "0.5729107", "0.5725973", "0.5718025", "0.568516", "0.5682365", "0.5680576", "0.5677391", "0.5673703", "0.5672351", "0.56701475", "0.5666481", "0.5658808", "0.56560427", "0.56559986", "0.56435615", "0.563731", "0.56345296", "0.56345296", "0.56206787", "0.5620126", "0.5617568", "0.5612207", "0.5603977", "0.55934983", "0.55934983", "0.55934983", "0.55934983", "0.55934983", "0.55934983", "0.55934983", "0.5588815", "0.55701995", "0.55579144", "0.55579144", "0.5557084", "0.55501795", "0.55406195", "0.55272925", "0.55037993", "0.54931396", "0.5488917", "0.5487737", "0.5483446", "0.54821867", "0.5470386", "0.5467875", "0.5465632", "0.5465179", "0.54595774", "0.54529935", "0.5451845", "0.54488087", "0.5446801", "0.5437802", "0.5430254", "0.5419952", "0.5417652", "0.54089075", "0.5403828", "0.53999424", "0.5386838", "0.5383841", "0.5383841", "0.5383841", "0.5383841", "0.5383841", "0.53773844", "0.53724355", "0.5366838", "0.5363324", "0.5362707", "0.5362596", "0.53619206", "0.53619206", "0.53619206", "0.5355656", "0.5349622", "0.5346569", "0.53431433", "0.5336356", "0.5336356", "0.5336356", "0.5336356", "0.5336356" ]
0.0
-1
Compiles an Archive using Shrinkwrap, containing those external dependencies necessary to run the tests. Note: This code will be needed at the start of each Arquillian test, but should not need to be edited, except to pass .class values to .addClasses(...) which are appropriate to the functionality you are trying to test.
@Deployment public static Archive<?> createTestArchive() { File[] libs = Maven.resolver().loadPomFromFile("pom.xml").resolve("io.swagger:swagger-jaxrs:1.5.15") .withTransitivity().asFile(); return ShrinkWrap.create(WebArchive.class, "test.war") .addPackages(true, "uk.ac.ncl.tongzhou.enterprisemiddleware") .addPackages(true, "org.jboss.quickstarts.wfk").addAsLibraries(libs) .addAsResource("META-INF/test-persistence.xml", "META-INF/persistence.xml") .addAsWebInfResource("arquillian-ds.xml").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Deployment\n public static Archive<?> createTestArchive() {\n //HttpComponents and org.JSON are required by CustomerService\n File[] libs = Maven.resolver().loadPomFromFile(\"pom.xml\").resolve(\n \"org.apache.httpcomponents:httpclient:4.3.2\",\n \"org.json:json:20140107\"\n ).withTransitivity().asFile();\n\n Archive<?> archive = ShrinkWrap\n .create(WebArchive.class, \"test.war\")\n .addClasses(Customer.class, \n CustomerRestService.class, \n CustomerRepository.class, \n CustomerValidator.class, \n CustomerService.class, \n Resources.class)\n .addAsLibraries(libs)\n .addAsResource(\"META-INF/test-persistence.xml\", \"META-INF/persistence.xml\")\n .addAsWebInfResource(\"arquillian-ds.xml\")\n .addAsWebInfResource(EmptyAsset.INSTANCE, \"beans.xml\");\n \n return archive;\n }", "@Deployment\n public static Archive<?> createTestArchive() {\n File[] libs = Maven.resolver()\n .loadPomFromFile(\"pom.xml\")\n .resolve(\"io.swagger:swagger-jaxrs:1.5.16\")\n .withTransitivity()\n .asFile();\n\n return ShrinkWrap\n .create(WebArchive.class, \"test.war\")\n .addPackages(true, \"org.jboss.quickstarts.wfk\")\n .addAsLibraries(libs)\n .addAsResource(\"META-INF/test-persistence.xml\", \"META-INF/persistence.xml\")\n .addAsWebInfResource(\"arquillian-ds.xml\")\n .addAsWebInfResource(EmptyAsset.INSTANCE, \"beans.xml\");\n }", "public static JARArchive createDefaultJar(Class<?> aClass) {\n JARArchive archive = ShrinkWrap.create(JARArchive.class);\n ClassLoader cl = aClass.getClassLoader();\n\n Set<CodeSource> codeSources = new HashSet<>();\n\n URLPackageScanner.Callback callback = (className, asset) -> {\n ArchivePath classNamePath = AssetUtil.getFullPathForClassResource(className);\n ArchivePath location = new BasicPath(\"\", classNamePath);\n archive.add(asset, location);\n\n try {\n Class<?> cls = cl.loadClass(className);\n codeSources.add(cls.getProtectionDomain().getCodeSource());\n } catch (ClassNotFoundException | NoClassDefFoundError e) {\n e.printStackTrace();\n }\n };\n\n URLPackageScanner scanner = URLPackageScanner.newInstance(\n true,\n cl,\n callback,\n aClass.getPackage().getName());\n\n scanner.scanPackage();\n\n Set<String> prefixes = codeSources.stream().map(e -> e.getLocation().toExternalForm()).collect(Collectors.toSet());\n\n try {\n List<URL> resources = Collections.list(cl.getResources(\"\"));\n\n resources.stream()\n .filter(e -> {\n for (String prefix : prefixes) {\n if (e.toExternalForm().startsWith(prefix)) {\n return true;\n }\n }\n return false;\n })\n .filter(e -> e.getProtocol().equals(\"file\"))\n .map(e -> getPlatformPath(e.getPath()))\n .map(e -> Paths.get(e))\n .filter(e -> Files.isDirectory(e))\n .forEach(e -> {\n try {\n Files.walkFileTree(e, new SimpleFileVisitor<Path>() {\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (!file.toString().endsWith(\".class\")) {\n Path location = e.relativize(file);\n archive.add(new FileAsset(file.toFile()), javaSlashize(location));\n }\n return super.visitFile(file, attrs);\n }\n });\n } catch (IOException e1) {\n }\n });\n\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n return archive;\n }", "@Deployment\n public static WebArchive deploy() {\n final File[] dependencies = Maven\n .resolver()\n .loadPomFromFile(\"pom.xml\")\n .resolve(\"mysql:mysql-connector-java\",\n \"org.assertj:assertj-core\").withoutTransitivity()\n .asFile();\n\n // The webArchive is the special packaging of your project\n // so that only the test cases run on the server or embedded\n // container\n final WebArchive webArchive = ShrinkWrap.create(WebArchive.class)\n .setWebXML(new File(\"src/main/webapp/WEB-INF/web.xml\"))\n .addPackage(Books.class.getPackage())\n .addPackage(BooksAction.class.getPackage())\n .addPackage(BooksController.class.getPackage())\n .addPackage(JsfUtil.class.getPackage())\n .addAsWebInfResource(EmptyAsset.INSTANCE, \"beans.xml\")\n .addAsWebInfResource(new File(\"src/main/webapp/WEB-INF/glassfish-resources.xml\"), \"glassfish-resources.xml\")\n .addAsResource(new File(\"src/main/resources/META-INF/persistence.xml\"), \"META-INF/persistence.xml\")\n .addAsResource(\"pacmabooks.sql\")\n .addAsLibraries(dependencies);\n\n return webArchive;\n }", "@Deployment(order = 1)\n public static ResourceAdapterArchive createArchive() throws Exception\n {\n return ArquillianJCATestUtils.buildShrinkwrapJdbcLocal();\n }", "@Deployment(testable = false)\n public static WebArchive createDeployment() {\n\n // Import Maven runtime dependencies\n File[] files = Maven.resolver().loadPomFromFile(\"pom.xml\")\n .importRuntimeDependencies().resolve().withTransitivity().asFile();\n\n return ShrinkWrap.create(WebArchive.class)\n .addPackage(Session.class.getPackage())\n .addClasses(SessionEndpoint.class, SessionRepository.class, Application.class)\n .addAsResource(\"META-INF/persistence-test.xml\", \"META-INF/persistence.xml\")\n .addAsWebInfResource(EmptyAsset.INSTANCE, \"beans.xml\")\n .addAsLibraries(files);\n }", "@Deployment\n\tpublic static Archive<?> createTestArchive() {\n\t\treturn ShrinkWrap.create(WebArchive.class, \"test.war\").addPackage(Persona.class.getPackage())\n\t\t\t\t.addAsResource(\"persistenceForTest.xml\", \"META-INF/persistence.xml\")\n\t\t\t\t.addAsWebInfResource(EmptyAsset.INSTANCE, \"beans.xml\");\n\n\t}", "public void testChangeZIPArchive1() throws Exception {\n String externalLib = Util.getOutputDirectory() + File.separator + \"externalLib.abc\";\n IPath projectPath = env.addProject(\"Project\");\n try {\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \" public void foo() {\\n\" + \" }\\n\" + \"}\" }, externalLib, \"1.4\");\n env.addExternalJars(projectPath, Util.getJavaClassLibs());\n env.addExternalJars(projectPath, new String[] { externalLib });\n //$NON-NLS-1$\n IPath root = env.getPackageFragmentRootPath(projectPath, \"\");\n env.setOutputFolder(projectPath, \"\");\n IPath classY = env.addClass(root, \"q\", \"Y\", \"package q;\\n\" + \"public class Y {\\n\" + \" void bar(p.X x) {\\n\" + \" x.foo();\\n\" + \" }\\n\" + \"}\");\n fullBuild(projectPath);\n expectingNoProblems();\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \"}\" }, externalLib, \"1.4\");\n IJavaProject p = env.getJavaProject(projectPath);\n p.getJavaModel().refreshExternalArchives(new IJavaElement[] { p }, null);\n incrementalBuild(projectPath);\n expectingProblemsFor(classY, \"Problem : The method foo() is undefined for the type X [ resource : </Project/q/Y.java> range : <54,57> category : <50> severity : <2>]\");\n } finally {\n new File(externalLib).delete();\n env.removeProject(projectPath);\n }\n }", "@Deployment\n public static WebArchive createDeployment() {\n File[] libs = Maven.resolver()\n .offline(false)\n .loadPomFromFile(\"pom.xml\")\n .importRuntimeAndTestDependencies().resolve().withTransitivity().asFile();\n\n return ShrinkWrap\n .create(WebArchive.class, \"fulltext-tasklist.war\")\n // add needed dependencies\n .addAsLibraries(libs)\n // prepare as process application archive for camunda BPM Platform\n .addAsResource(\"META-INF/processes.xml\", \"META-INF/processes.xml\")\n // enable CDI\n .addAsWebInfResource(EmptyAsset.INSTANCE, \"beans.xml\")\n // boot JPA persistence unit\n .addAsResource(\"META-INF/persistence.xml\", \"META-INF/persistence.xml\")\n // add your own classes (could be done one by one as well)\n .addPackages(false, \"com.camunda.consulting.tasklist.fulltext\") // not recursive to skip package 'nonarquillian'\n .addPackages(false, \"com.camunda.consulting.tasklist.fulltext.entity\")\n .addPackages(false, \"com.camunda.consulting.tasklist.fulltext.resource\")\n // add process definition\n .addAsResource(\"process.bpmn\")\n .addAsResource(\"incidentProcess.bpmn\")\n // add process image for visualizations\n .addAsResource(\"process.png\")\n .addAsResource(\"incidentProcess.png\")\n // now you can add additional stuff required for your test case\n ;\n }", "@Test\n public void aarContents() throws Exception {\n project.executor().run(\"clean\", \"library:assembleDebug\");\n\n project.getSubproject(\"library\")\n .getAar(\n \"debug\",\n aar -> {\n try {\n Path javaResource =\n aar.getJavaResource(\"META-INF/library_debug.kotlin_module\");\n assertThat(javaResource != null).isTrue();\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n });\n }", "@BeforeClass\n public static void setup() throws Exception{\n byte[] jar = JarBuilder.buildJarForMainClassAndExplicitClassNamesAndBytecode(TestResource.class, Collections.emptyMap());\n ABICompiler compiler = ABICompiler.compileJarBytes(jar);\n byte[] optimizedDappBytes = new JarOptimizer(true).optimize(compiler.getJarFileBytes());\n optimizedDappBytes = UnreachableMethodRemover.optimize(optimizedDappBytes);\n byte[] data = new CodeAndArguments(optimizedDappBytes, null).encodeToBytes();\n AvmRule.ResultWrapper deployResult = avmRule.deploy(sender, value, data);\n assertTrue(deployResult.getTransactionResult().transactionStatus.isSuccess());\n contract = deployResult.getDappAddress();\n }", "public void testChangeZIPArchive2() throws Exception {\n IPath projectPath = env.addProject(\"Project\");\n env.addExternalJars(projectPath, Util.getJavaClassLibs());\n String internalLib = env.getProject(\"Project\").getLocation().toOSString() + File.separator + \"internalLib.abc\";\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \" public void foo() {\\n\" + \" }\\n\" + \"}\" }, internalLib, \"1.4\");\n env.getProject(projectPath).refreshLocal(IResource.DEPTH_INFINITE, null);\n env.addEntry(projectPath, JavaCore.newLibraryEntry(new Path(\"/Project/internalLib.abc\"), null, null));\n //$NON-NLS-1$\n IPath root = env.getPackageFragmentRootPath(projectPath, \"\");\n env.setOutputFolder(projectPath, \"\");\n IPath classY = env.addClass(root, \"q\", \"Y\", \"package q;\\n\" + \"public class Y {\\n\" + \" void bar(p.X x) {\\n\" + \" x.foo();\\n\" + \" }\\n\" + \"}\");\n fullBuild(projectPath);\n expectingNoProblems();\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \"}\" }, internalLib, \"1.4\");\n env.getProject(projectPath).refreshLocal(IResource.DEPTH_INFINITE, null);\n incrementalBuild(projectPath);\n expectingProblemsFor(classY, \"Problem : The method foo() is undefined for the type X [ resource : </Project/q/Y.java> range : <54,57> category : <50> severity : <2>]\");\n env.removeProject(projectPath);\n }", "public static ResourceAdapterArchive createAnnotationDeployment(Class classRA)\n {\n String name = classRA.toString();\n name = name.substring(name.lastIndexOf(\".\") + 1);\n\n ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, name + \".rar\");\n\n JavaArchive ja = ShrinkWrap.create(JavaArchive.class, \"work.jar\");\n ja.addClasses(ContextConnection.class, ContextConnectionFactory.class, ContextConnectionFactoryImpl.class,\n ContextConnectionImpl.class, ContextManagedConnection.class, ContextManagedConnectionFactory.class,\n ContextManagedConnectionMetaData.class, ContextRaMetaData.class, classRA, HintsContextCustom.class,\n TransactionContextCustom.class, UnsupportedContext.class, SecurityContext.class, TransactionContext.class);\n\n raa.addAsLibrary(ja);\n\n return raa;\n }", "@Test\n public void buildFromDeployJar() throws Exception {\n File tempFolder = temp.newFolder();\n File app1Zip = new File(tempFolder, \"app1.zip\");\n File app2Zip = new File(tempFolder, \"app2.zip\");\n AndroidApp app1 =\n buildFromDeployJar(\n CompilerUnderTest.R8,\n CompilationMode.RELEASE,\n GMSCoreCompilationTestBase.GMSCORE_V10_DIR,\n false,\n options ->\n options.proguardMapConsumer =\n ToolHelper.consumeString(proguardMap -> this.proguardMap1 = proguardMap),\n () -> new ArchiveConsumer(app1Zip.toPath(), true));\n AndroidApp app2 =\n buildFromDeployJar(\n CompilerUnderTest.R8,\n CompilationMode.RELEASE,\n GMSCoreCompilationTestBase.GMSCORE_V10_DIR,\n false,\n options ->\n options.proguardMapConsumer =\n ToolHelper.consumeString(proguardMap -> this.proguardMap2 = proguardMap),\n () -> new ArchiveConsumer(app2Zip.toPath(), true));\n\n // Verify that the result of the two compilations was the same.\n assertIdenticalApplications(app1, app2);\n assertIdenticalZipFiles(app1Zip, app2Zip);\n assertEquals(proguardMap1, proguardMap2);\n }", "public static void addToDeployment(WebArchive deployment) {\n\t\tdeployment.addPackages(true, \"edu.hm.cs.fwp.jeedemo.jpa.common.persistence\") //\n\t\t\t\t.addClass(GenericRepository.class) //\n\t\t\t\t.addClass(ComponentTestAuthenticationFilter.class) //\n\t\t\t\t.addAsResource(\"arquillian-persistence.xml\", \"META-INF/persistence.xml\") //\n\t\t\t\t.addAsWebInfResource(\"arquillian-web.xml\", \"web.xml\") //\n\t\t\t\t.addAsWebInfResource(\"arquillian-beans.xml\", \"beans.xml\");\n\t}", "@Test\n public void test() throws Exception {\n List<Class<?>> parentClasses =\n ImmutableList.of(\n Parent.class,\n Parent.Inner1.class,\n Parent.Inner2.class,\n Parent.Inner3.class,\n Parent.Inner4.class);\n\n Path parent =\n testForD8()\n .addProgramClasses(parentClasses)\n .setMinApi(parameters.getApiLevel())\n .compile()\n .writeToZip();\n\n Path child =\n testForD8()\n .addProgramClasses(Child.class)\n .addClasspathClasses(parentClasses)\n .setMinApi(parameters.getApiLevel())\n .compile()\n .writeToZip();\n\n // Run the classloader test loading the two dex applications.\n testForD8()\n .addProgramFiles(\n Paths.get(\"build/test/examplesAndroidApi/classes/classloader/Runner.class\"))\n .setMinApi(parameters.getApiLevel())\n .compile()\n .run(\n parameters.getRuntime(),\n \"classloader.Runner\",\n parent.toString(),\n child.toString(),\n Child.class.getTypeName())\n .assertSuccessWithOutput(\"SUCCESS\");\n }", "private static Object createStandaloneTester() {\n List<URL> urls = new ArrayList<>();\n for (String path : Splitter.on(':').split(System.getProperty(\"java.class.path\"))) {\n\n // A small hack is needed since we didn't make example application under different groupId and not prefixed\n // the artifactId with something special (cdap- and hive-)\n // Check for io/cdap/cdap\n if (path.contains(\"/io/cdap/cdap/\")) {\n String artifactFile = Paths.get(path).getFileName().toString();\n if (!artifactFile.startsWith(\"cdap-\") && !artifactFile.startsWith(\"hive-\")) {\n continue;\n }\n }\n\n try {\n urls.add(Paths.get(path).toUri().toURL());\n } catch (MalformedURLException e) {\n throw Throwables.propagate(e);\n }\n }\n\n ClassLoader classLoader = new MainClassLoader(urls.toArray(new URL[urls.size()]), null);\n try {\n Class<?> clz = classLoader.loadClass(StandaloneTester.class.getName());\n Constructor<?> constructor = clz.getConstructor(Object[].class);\n return constructor.newInstance((Object) new Object[0]);\n } catch (Exception e) {\n throw Throwables.propagate(e);\n }\n }", "@Override\r\n public void pack() {\r\n super.pack();\r\n JkFileTree.of(this.classDir()).exclude(\"**/*.jar\").zip().to(packer().jarFile(\"lean\"));\r\n distrib();\r\n }", "public static void main(String[] args) throws IOException {\n\n _project _sc = _project.of();\n //reads from a maven-central jar file\n _downloadArchiveConsumer.of(\"https://search.maven.org/remotecontent?filepath=com/github/javaparser/javaparser-core/3.15.18/javaparser-core-3.15.18-sources.jar\",\n (ZipEntry ze, InputStream is)-> {\n if( ze.getName().endsWith(\".java\")){\n _sc.add( _codeUnit.of(is) );\n }\n });\n System.out.println( _sc.size() );\n\n _project _src = _githubProject.of(\"https://github.com/edefazio/bincat\").load();\n //_sources _src = _sources.of();\n //_downloadArchive _da = _downloadArchive.of(url, (ZipEntry ze,InputStream is)-> {\n // if( ze.getName().endsWith(\".java\")){\n // _src.add( _codeUnit.of(is) );\n // }\n //});\n /*\n try( InputStream inputStream = url.openStream();\n ZipInputStream zis = new ZipInputStream(inputStream) ) {\n\n byte[] buffer = new byte[2048];\n\n while (zis.available() > 0) {\n ZipEntry ze = zis.getNextEntry();\n System.out.println(\"reading \" + ze.getName());\n\n if( ze.isDirectory() ){\n ze.\n } else if( ze.)\n\n if (!ze.isDirectory() && ze.getName().endsWith(\".java\")) {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n int len;\n while ((len = zis.read(buffer)) > 0) {\n baos.write(buffer, 0, len);\n }\n try {\n System.out.println(\"adding\" + ze.getName());\n _src.add(_codeUnit.of(baos.toString()));\n } catch (Exception e) {\n throw new _ioException(\"could not read from entry \" + ze.getName());\n }\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n */\n\n System.out.println( \"finished reading \"+ _src.size());\n }", "@Override\n public void apply(Project project) {\n project.getPluginManager().apply(\"groovy-base\");\n\n RewindFrameworkExtension rewind = project.getObjects().newInstance(RewindFrameworkExtension.class, project);\n project.getExtensions().add(\"rewind\", rewind);\n\n rewind.getTests().all(name -> {\n SourceSetContainer sourceSets = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets();\n SourceSet sourceSet = sourceSets.create(name, it -> it.setRuntimeClasspath(it.getRuntimeClasspath().add(it.getOutput()).add(it.getCompileClasspath())));\n\n\n Test test = project.getTasks().create(sourceSet.getName(), Test.class, task -> {\n task.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP);\n task.setTestClassesDirs(sourceSet.getOutput().getClassesDirs());\n task.setClasspath(sourceSet.getRuntimeClasspath());\n });\n\n project.getTasks().getByName(\"check\").dependsOn(test);\n\n Jar jar = project.getTasks().create(sourceSet.getName() + \"Jar\", ShadowJar.class, (ShadowJar task) -> {\n task.setClassifier(\"tests\");\n\n task.from(sourceSet.getOutput());\n task.setConfigurations(Arrays.asList(project.getConfigurations().getByName(sourceSet.getName() + \"RuntimeClasspath\")));\n task.dependencies((DependencyFilter filter) -> {\n for (Dependency d : project.getConfigurations().getByName(sourceSet.getName() + \"Implementation\").getDependencies()) {\n if (!(d instanceof ProjectDependency)) {\n filter.exclude(filter.dependency(d));\n }\n }\n });\n });\n\n RewindTest remoteTest = project.getTasks().create(sourceSet.getName() + \"Rewind\", RewindTest.class, (RewindTest task) -> {\n task.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP);\n task.dependsOn(jar);\n task.getHostname().set(\"localhost\");\n task.getPort().set(5672);\n task.getTestJar().set(jar.getArchivePath());\n task.getBinaryResultsDirectory().set(project.getLayout().getBuildDirectory().dir(\"test-results/\" + sourceSet.getName() + \"Rewind/binary\"));\n task.getDependencies().set(\n project.provider(\n () -> project.getConfigurations().getByName(sourceSet.getName() + \"Implementation\").getDependencies().stream()\n .filter(((Dependency dependency) -> !(dependency instanceof ProjectDependency)))\n .collect(Collectors.toList())\n ));\n task.getRepositories().set(project.getRepositories());\n task.finalizedBy(sourceSet.getName() + \"RewindReport\");\n });\n\n project.getTasks().create(sourceSet.getName() + \"RewindReport\", TestReport.class, (TestReport task) -> {\n task.setTestResultDirs(Arrays.asList(remoteTest.getBinaryResultsDirectory().getAsFile().get()));\n task.setDestinationDir(new File(project.getBuildDir(), \"reports/tests/\" + sourceSet.getName() + \"Rewind\"));\n });\n });\n }", "@Override\n public List<BazelPublishArtifact> getBazelArtifacts(AspectRunner aspectRunner, Project project, Task bazelExecTask) {\n final File outputArtifactFolder = super.getBazelArtifacts(aspectRunner, project, bazelExecTask).get(0).getFile().getParentFile();\n final File aarOutputFile = new File(outputArtifactFolder, mConfig.targetName + \".aar\");\n return Collections.singletonList(new BazelPublishArtifact(bazelExecTask, aarOutputFile));\n }", "public void testMain() {\n System.out.println(\"main\");\n String[] args = new String[]{\n \n \"-out\", \"ausgabe.jar\",\n \"-mc\", \"inteco.Saukopf\",\n// \"-m manifest.mf \" \n// \"-v\",\n \"-l\",\n \"-lib\", \"CustJar.jar\", \"./asm.jar\", \"D:\\\\Development\\\\Java\\\\Componenten\\\\Hibernate\\\\hibernate-3.0.2\\\\hibernate-3.0\\\\lib\"\n // -mainclass\n };\n CustJar.main(args);\n\n \n }", "@Test\n public void testJ2ObjcLibraryDepThroughStarlarkRule() throws Exception {\n scratch.file(\"examples/inner.java\");\n scratch.file(\"examples/outer.java\");\n scratch.file(\n \"examples/fake_rule.bzl\",\n \"def _fake_rule_impl(ctx):\",\n \" myProvider = ctx.attr.deps[0][JavaInfo]\",\n \" return myProvider\",\n \"\",\n \"fake_rule = rule(\",\n \" implementation = _fake_rule_impl,\",\n \" attrs = {'deps': attr.label_list()},\",\n \" provides = [JavaInfo],\",\n \")\");\n scratch.file(\n \"examples/BUILD\",\n \"package(default_visibility=['//visibility:public'])\",\n \"load('//examples:fake_rule.bzl', 'fake_rule')\",\n \"java_library(\",\n \" name = 'inner',\",\n \" srcs = ['inner.java'],\",\n \")\",\n \"fake_rule(\",\n \" name = 'propagator',\",\n \" deps = [':inner'],\",\n \")\",\n \"java_library(\",\n \" name = 'outer',\",\n \" srcs = ['outer.java'],\",\n \" deps = [':propagator'],\",\n \")\",\n \"j2objc_library(\",\n \" name = 'transpile',\",\n \" deps = [\",\n \" ':outer',\",\n \" ],\",\n \" tags = ['__J2OBJC_LIBRARY_MIGRATION_DO_NOT_USE_WILL_BREAK__'],\",\n \")\",\n \"objc_library(\",\n \" name = 'lib',\",\n \" srcs = ['lib.m'],\",\n \" deps = [':transpile'],\",\n \")\");\n\n ConfiguredTarget objcTarget = getConfiguredTarget(\"//examples:lib\");\n\n // The only way that //examples:lib can see inner's archive is through the Starlark rule.\n CcLinkingContext ccLinkingContext = objcTarget.get(CcInfo.PROVIDER).getCcLinkingContext();\n assertThat(baseArtifactNames(ccLinkingContext.getStaticModeParamsForDynamicLibraryLibraries()))\n .contains(\"libinner_j2objc.lo\");\n }", "@Test\n\tpublic void testClassAndFileLinks() throws Exception\n\t{\n\t\tFile file = new File(System.getProperty(\"user.dir\"));\n\t\twhile (! file.getName().equals(\"swac-testbed\")) {\n\t\t\tfile = file.getParentFile();\n\t\t\tif (file == null)\n\t\t\t\tAssert.fail(\"Could not find create scenario scripts. Started from \" + System.getProperty(\"user.dir\") + \" and went up\");\n\t\t}\n\t\t\n\t\t// Find swac-assembly dir\n\t\tFile swacParent = file.getParentFile();\n\t\tif (swacParent == null)\n\t\t\tAssert.fail(\"Could not find create scenario scripts, no dir above swac-controller\");\n\t\t\n\t\tFile swacAssembly = new File(swacParent, \"swac-assembly\");\n\t\tif (swacAssembly == null || ! swacAssembly.exists())\n\t\t\tAssert.fail(\"Could not find create scenario scripts, swac-assembly not parallel to swac-controller\");\n\t\t\n\t\t// Find windows and unix creat scenario scripts\n\t\tchar sep = File.separatorChar; \n\t\tFile swacAssemblyBin = new File(swacAssembly.getAbsolutePath() + sep + \"src\" + sep + \"main\" + sep + \"bin\");\n\t\tif (swacAssemblyBin == null || ! swacAssemblyBin.exists())\n\t\t\tAssert.fail(\"Could not find create scenario scripts in swac-assembly/src/main/bin\");\n\t\t\n\t\tFile windowsScript = new File(swacAssemblyBin, \"swac-create-scenario.bat\");\n\t\tif (! windowsScript.exists())\n\t\t\tAssert.fail(\"Could not find windows create scenario script in swac-assembly/src/main/bin/swac-create-scenario.bat\");\n\t\t\n\t\tFile unixScript = new File(swacAssemblyBin, \"new-swac-create-scenario.sh\");\n\t\tif (! unixScript.exists())\n\t\t\tAssert.fail(\"Could not find unix create scenario script in swac-assembly/src/main/bin/new-swac-create-scenario.sh\");\n\n\n\t\t// Read in windows create scenario script, parse out file and class lists.\n\t\tSet<String> winFilesSet = new LinkedHashSet<String>();\n\t\tparseWindowsScript(\"file_name_templates\", windowsScript, winFilesSet);\n\t\tSet<String> winClassSet = new LinkedHashSet<String>();\n\t\tparseWindowsScript(\"file_classes\", windowsScript, winClassSet);\n\t\tAssert.assertEquals(\"For windows create scenario script, num of files != num of classes, file \" + winFilesSet.size() + \", classes \" + winClassSet.size(),\n\t\t\t\t\t\t\twinFilesSet.size(), winClassSet.size());\n\t\tMap<String, String> winFileClassMap = new HashMap<String, String>();\n\t\tcombineToMap(winFilesSet, winClassSet, winFileClassMap);\n\t\t\n\t\t// Read in unix create scenario script, parse out file and class lists. \n\t\t// Adjust some values to align with windows style to allow apple to apples comparisons\n\t\tSet<String> unixFilesSet = new LinkedHashSet<String>();\n\t\tparseUnixScript(\"Files\", unixScript, unixFilesSet);\n\t\tunixFilesSet = adjustUnixFiles(unixFilesSet, new LinkedHashSet<String>());\n\t\tSet<String> unixClassSet = new LinkedHashSet<String>();\n\t\tparseUnixScript(\"Classes\", unixScript, unixClassSet);\n\t\tunixClassSet = adjustUnixClasses(unixClassSet, new LinkedHashSet<String>());\n\t\tAssert.assertEquals(\"For unix create scenario script, num of files != num of classes, file \" + unixFilesSet.size() + \", classes \" + unixClassSet.size(),\n\t\t\t\tunixFilesSet.size(), unixClassSet.size());\n\t\tMap<String, String> unixFileClassMap = new HashMap<String, String>();\n\t\tcombineToMap(unixFilesSet, unixClassSet, unixFileClassMap); \n\n\t\t// Test if the classes in windows and unix scripts match up\n\t\tif (! winClassSet.equals(unixClassSet)) {\n\t\t\tLinkedHashSet<String> uniqueWindowClasses = new LinkedHashSet<String>(winClassSet);\n\t\t\tuniqueWindowClasses.removeAll(unixClassSet);\n\t\t\t\n\t\t\tLinkedHashSet<String> uniqueUnixClasses = new LinkedHashSet<String>(unixClassSet);\n\t\t\tuniqueUnixClasses.removeAll(winClassSet);\n\t\t\t\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tsb.append(\"Create scenario script mismatch error between windows and unix. \");\n\t\t\tif(! uniqueWindowClasses.isEmpty()) \n\t\t\t\tsb.append(\"Unique windows class(es): \").append(uniqueWindowClasses).append(\". \");\n\t\t\tif(! uniqueUnixClasses.isEmpty()) \n\t\t\t\tsb.append(\"Unique unix class(es): \").append(uniqueUnixClasses).append(\". \");\n\t\t\t\n\t\t\tSystem.out.println(sb);\n\t\t\tAssert.fail(sb.toString());\n\t\t}\n\t\t\n\t\t// Test if the files in windows and unix scripts match up\n\t\tStringBuilder sb = null;\n\t\tfor (Entry<String, String> winEntry : winFileClassMap.entrySet()) {\n\t\t\tString winFile = winEntry.getValue();\n\t\t\tString unixFile = unixFileClassMap.get(winEntry.getKey());\n\t\t\tif (! winFile.equals(unixFile)) {\n\t\t\t\tif (sb == null) {\n\t\t\t\t\tsb = new StringBuilder();\n\t\t\t\t\tsb.append(\"Create scenario script mismatch error between windows and unix. \");\n\t\t\t\t}\n\t\t\t\tsb.append(\"Different files specified for class '\" + winEntry.getKey() + \"': windows: '\" + winFile + \"', unix: '\" + unixFile + \"'. \");\n\t\t\t}\n\t\t}\n\t\tif (sb != null) {\n\t\t\tSystem.out.println(sb);\n\t\t\tAssert.fail(sb.toString());\n\t\t}\n\t}", "public interface BuildMainSpaceAPI extends API {\n\n /**\n * Build all assets of the main code space.\n *\n * <ul>\n * <li>Compile sources and jar generated classes\n * <li>Check modules\n * <li>Generate API documentation\n * <li>Generate custom runtime image\n * </ul>\n *\n * @see #buildMainBuildModules()\n * @see #buildMainCheckModules()\n * @see #buildMainGenerateAPIDocumentation()\n * @see #buildMainGenerateCustomRuntimeImage()\n */\n default void buildMainSpace() throws Exception {\n buildMainBuildModules();\n buildMainCheckModules();\n buildMainGenerateAPIDocumentation();\n buildMainGenerateCustomRuntimeImage();\n }\n\n /** Compile and jar main modules. */\n default void buildMainBuildModules() {\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n if (modules.isEmpty()) {\n log(\"Main module list is empty, nothing to build here.\");\n return;\n }\n var s = modules.size() == 1 ? \"\" : \"s\";\n say(\"Build %d main module%s: %s\", modules.size(), s, modules.toNames(\", \"));\n\n var release = main.release();\n var feature = release != 0 ? release : Runtime.version().feature();\n var classes = bach().folders().workspace(\"classes-main-\" + feature);\n\n var workspaceModules = bach().folders().workspace(\"modules\");\n Paths.deleteDirectories(workspaceModules);\n if (feature == 8) {\n bach().run(buildMainJavac(9, classes)).requireSuccessful();\n buildMainSpaceClassesForJava8(classes);\n } else {\n bach().run(buildMainJavac(release, classes)).requireSuccessful();\n }\n\n Paths.createDirectories(workspaceModules);\n var jars = new ArrayList<Jar>();\n var javacs = new ArrayList<Javac>();\n for (var declaration : modules.map().values()) {\n for (var folder : declaration.sources().list()) {\n if (!folder.isTargeted()) continue;\n javacs.add(buildMainJavac(declaration, folder, classes));\n }\n jars.add(buildMainJar(declaration, classes));\n }\n if (!javacs.isEmpty()) bach().run(javacs.stream()).requireSuccessful();\n bach().run(jars.stream()).requireSuccessful();\n }\n\n /** Check main modules. */\n default void buildMainCheckModules() {\n if (!bach().project().settings().tools().enabled(\"jdeps\")) return;\n say(\"Check main modules\");\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n var jdeps = new ArrayList<JDeps>();\n for (var declaration : modules.map().values()) {\n jdeps.add(buildMainJDeps(declaration));\n }\n bach().run(jdeps.stream()).requireSuccessful();\n }\n\n /** Generate HTML pages of API documentation from main modules' source files. */\n default void buildMainGenerateAPIDocumentation() {\n if (!bach().project().settings().tools().enabled(\"javadoc\")) return;\n say(\"Generate API documentation\");\n var api = bach().folders().workspace(\"documentation\", \"api\");\n bach().run(buildMainJavadoc(api)).requireSuccessful();\n bach().run(buildMainJavadocJar(api)).requireSuccessful();\n }\n\n /** Assemble and optimize main modules and their dependencies into a custom runtime image. */\n default void buildMainGenerateCustomRuntimeImage() {\n if (!bach().project().settings().tools().enabled(\"jlink\")) return;\n say(\"Assemble custom runtime image\");\n var image = bach().folders().workspace(\"image\");\n Paths.deleteDirectories(image);\n bach().run(buildMainJLink(image));\n }\n\n default void buildMainSpaceClassesForJava8(Path classes) {\n var project = bach().project();\n var folders = project.settings().folders();\n var main = project.spaces().main();\n var classPaths = new ArrayList<Path>();\n main.declarations().toNames().forEach(name -> classPaths.add(classes.resolve(name)));\n classPaths.addAll(Paths.list(bach().folders().externalModules(), Paths::isJarFile));\n var javacs = new ArrayList<Javac>();\n for (var declaration : main.declarations().map().values()) {\n var name = declaration.name();\n var sources = declaration.sources();\n var root = sources.list().isEmpty() ? folders.root() : sources.first().path();\n var java8Files = Paths.find(root, 99, BuildMainSpaceAPI::isJava8File);\n if (java8Files.isEmpty()) continue; // skip aggregator module\n var compileSources =\n Command.javac()\n .with(\"--release\", main.release()) // 8\n .with(\"--class-path\", classPaths)\n .ifTrue(bach().is(Flag.STRICT), javac -> javac.with(\"-Xlint\").with(\"-Werror\"))\n .withAll(main.tweaks().arguments(\"javac\"))\n .with(\"-d\", classes.resolve(name))\n .withAll(java8Files);\n javacs.add(compileSources);\n }\n if (javacs.isEmpty()) return; // no javac command collected\n bach().run(javacs.stream()).requireSuccessful();\n }\n\n /** Test supplied path for pointing to a Java 8 compilation unit. */\n private static boolean isJava8File(Path path) {\n var name = Paths.name(path);\n return !path.startsWith(\".bach\") // ignore all files in `.bach` directory\n && name.endsWith(\".java\")\n && !name.equals(\"module-info.java\") // ignore module declaration compilation units\n && Files.isRegularFile(path);\n }\n\n /**\n * {@return the {@code javac} call to compile all configured modules of the main space}\n *\n * @param release the Java feature release number to compile modules for\n */\n default Javac buildMainJavac(int release, Path classes) {\n var project = bach().project();\n var main = project.spaces().main();\n return Command.javac()\n .ifTrue(release != 0, javac -> javac.with(\"--release\", release))\n .with(\"--module\", main.declarations().toNames(\",\"))\n .with(\"--module-version\", project.version())\n .forEach(\n main.declarations().toModuleSourcePaths(false),\n (javac, path) -> javac.with(\"--module-source-path\", path))\n .ifPresent(\n main.modulePaths().pruned(), (javac, paths) -> javac.with(\"--module-path\", paths))\n .ifTrue(bach().is(Flag.STRICT), javac -> javac.with(\"-Xlint\").with(\"-Werror\"))\n .withAll(main.tweaks().arguments(\"javac\"))\n .with(\"-d\", classes);\n }\n\n /** {@return the {@code javac} call to compile a specific version of a multi-release module} */\n default Javac buildMainJavac(LocalModule local, SourceFolder folder, Path classes) {\n var name = local.name();\n var project = bach().project();\n var main = project.spaces().main();\n var release = folder.release();\n var javaSourceFiles = Paths.find(folder.path(), 99, Paths::isJavaFile);\n return Command.javac()\n .with(\"--release\", release)\n .with(\"--module-version\", project.version())\n .ifPresent(\n main.modulePaths().pruned(), (javac, paths) -> javac.with(\"--module-path\", paths))\n .with(\"--class-path\", classes.resolve(name))\n .with(\"-implicit:none\") // generate classes for explicitly referenced source files\n .withAll(main.tweaks().arguments(\"javac\"))\n .withAll(main.tweaks().arguments(\"javac(\" + name + \")\"))\n .withAll(main.tweaks().arguments(\"javac(\" + release + \")\"))\n .withAll(main.tweaks().arguments(\"javac(\" + name + \"@\" + release + \")\"))\n .with(\"-d\", buildMultiReleaseClassesDirectory(name, release))\n .withAll(javaSourceFiles);\n }\n\n private Path buildMultiReleaseClassesDirectory(String module, int release) {\n return bach().folders().workspace(\"classes-mr-\" + release, module);\n }\n\n default Jar buildMainJar(LocalModule local, Path classes) {\n var project = bach().project();\n var main = project.spaces().main();\n var name = local.name();\n var file = bach().folders().workspace(\"modules\", buildMainJarFileName(name));\n var mainClass = local.reference().descriptor().mainClass();\n var jar =\n Command.jar()\n .ifTrue(bach().is(Flag.VERBOSE), command -> command.with(\"--verbose\"))\n .with(\"--create\")\n .with(\"--file\", file)\n .ifPresent(mainClass, (args, value) -> args.with(\"--main-class\", value))\n .withAll(main.tweaks().arguments(\"jar\"))\n .withAll(main.tweaks().arguments(\"jar(\" + name + \")\"));\n var baseClasses = classes.resolve(name);\n if (Files.isDirectory(baseClasses)) jar = jar.with(\"-C\", baseClasses, \".\");\n // include base resources\n for (var folder : local.resources().list()) {\n if (folder.isTargeted()) continue; // handled later\n jar = jar.with(\"-C\", folder.path(), \".\");\n }\n // add (future) targeted classes and targeted resources in ascending order\n for (int release = 9; release <= Runtime.version().feature(); release++) {\n var paths = new ArrayList<Path>();\n var isSourceTargeted = local.sources().stream(release).findAny().isPresent();\n if (isSourceTargeted) paths.add(buildMultiReleaseClassesDirectory(name, release));\n local.resources().stream(release).map(SourceFolder::path).forEach(paths::add);\n if (paths.isEmpty()) continue;\n jar = jar.with(\"--release\", release);\n for (var path : paths) jar = jar.with(\"-C\", path, \".\");\n }\n return jar;\n }\n\n default String buildMainJarFileName(String module) {\n return module + '@' + bach().project().versionNumberAndPreRelease() + \".jar\";\n }\n\n default JDeps buildMainJDeps(LocalModule local) {\n var folders = bach().folders();\n return Command.jdeps()\n .with(\"--check\", local.name())\n .with(\"--multi-release\", \"BASE\")\n .with(\"--module-path\", List.of(folders.workspace(\"modules\"), folders.externalModules()));\n }\n\n default Javadoc buildMainJavadoc(Path destination) {\n var project = bach().project();\n var main = project.spaces().main();\n return Command.javadoc()\n .with(\"--module\", main.declarations().toNames(\",\"))\n .forEach(\n main.declarations().toModuleSourcePaths(false),\n (javadoc, path) -> javadoc.with(\"--module-source-path\", path))\n .ifPresent(\n main.modulePaths().pruned(), (javadoc, paths) -> javadoc.with(\"--module-path\", paths))\n .ifTrue(bach().is(Flag.STRICT), javadoc -> javadoc.with(\"-Xdoclint\").with(\"-Werror\"))\n .withAll(main.tweaks().arguments(\"javadoc\"))\n .with(\"-d\", destination);\n }\n\n /** {@return the jar call generating the API documentation archive} */\n default Jar buildMainJavadocJar(Path api) {\n var project = bach().project();\n var file = project.name() + \"-api-\" + project.version() + \".zip\";\n return Command.jar()\n .with(\"--create\")\n .with(\"--file\", api.getParent().resolve(file))\n .with(\"--no-manifest\")\n .with(\"-C\", api, \".\");\n }\n\n default JLink buildMainJLink(Path image) {\n var project = bach().project();\n var main = project.spaces().main();\n var test = project.spaces().test();\n return Command.jlink()\n .ifPresent(main.launcher(), (jlink, launcher) -> jlink.with(\"--launcher\", launcher.value()))\n .with(\"--add-modules\", main.declarations().toNames(\",\"))\n .ifPresent(\n test.modulePaths().pruned(), (jlink, paths) -> jlink.with(\"--module-path\", paths))\n .withAll(main.tweaks().arguments(\"jlink\"))\n .with(\"--output\", image);\n }\n}", "@Override\n protected TsArtifact composeApplication() {\n final TsQuarkusExt extH = new TsQuarkusExt(\"ext-h\");\n install(extH);\n final TsQuarkusExt extIConditional = new TsQuarkusExt(\"ext-i-conditional\");\n extIConditional.setDependencyCondition(extH);\n install(extIConditional);\n\n final TsQuarkusExt extGConditional = new TsQuarkusExt(\"ext-g-conditional\");\n\n final TsQuarkusExt extA = new TsQuarkusExt(\"ext-a\");\n extA.setConditionalDeps(extGConditional);\n\n final TsQuarkusExt extB = new TsQuarkusExt(\"ext-b\");\n extB.addDependency(extA);\n\n final TsQuarkusExt extC = new TsQuarkusExt(\"ext-c\");\n extC.addDependency(extB);\n\n final TsQuarkusExt extD = new TsQuarkusExt(\"ext-d\");\n extD.addDependency(extB);\n\n final TsQuarkusExt extEConditional = new TsQuarkusExt(\"ext-e-conditional\");\n extEConditional.setDependencyCondition(extB);\n install(extEConditional);\n\n final TsQuarkusExt extF = new TsQuarkusExt(\"ext-f\");\n extF.setConditionalDeps(extEConditional, extIConditional);\n\n extGConditional.setDependencyCondition(extC);\n extGConditional.addDependency(extF);\n install(extGConditional);\n\n addToExpectedLib(extA.getRuntime());\n addToExpectedLib(extB.getRuntime());\n addToExpectedLib(extC.getRuntime());\n addToExpectedLib(extD.getRuntime());\n addToExpectedLib(extEConditional.getRuntime());\n addToExpectedLib(extF.getRuntime());\n addToExpectedLib(extGConditional.getRuntime());\n\n return TsArtifact.jar(\"app\")\n .addManagedDependency(platformDescriptor())\n .addManagedDependency(platformProperties())\n .addDependency(extC)\n .addDependency(extD);\n }", "public static ResourceAdapterArchive createDescriptorDeployment(String name)\n {\n ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, name + \".rar\");\n\n JavaArchive ja = ShrinkWrap.create(JavaArchive.class, \"arch.jar\");\n ja.addPackage(ContextConnection.class.getPackage()).addClasses(HintsContextCustom.class,\n TransactionContextCustom.class, UnsupportedContext.class, SecurityContext.class, TransactionContext.class);\n\n raa.addAsLibrary(ja);\n raa.addAsManifestResource(\"rars/wm/META-INF/ra-\" + name + \".xml\", \"ra.xml\");\n\n return raa;\n }", "public AnnotationDeploymentAnalyzer(final File archive) {\n\t\tthis.archive = archive;\n\t\tthis.ejbJarAnnotationMetadata = new EjbJarAnnotationMetadata();\n\t\tscanVisitor = new ScanClassVisitor(ejbJarAnnotationMetadata);\n\t}", "public static void main(String[] args) {\n\t\n\tList<Class<?>> test_classes = new ArrayList<Class<?>>(); //List of loaded classes\n\tList<String> class_names = new ArrayList<String>(); \n\tString[] jar_pathes = new String[args.length -1];\n\tSystem.arraycopy(args, 0, jar_pathes, 0, args.length-1);\n\t\n\tfor (String jar_path : jar_pathes) {\t\n\t\ttry {\n\t\t\tJarFile jarFile = new java.util.jar.JarFile(jar_path);\n\t\t\tEnumeration<JarEntry> jar_entries_enum = jarFile.entries();\n\t\t\t\n\t\t\tURL[] urls = { new URL(\"jar:file:\" + jar_pathes[0]+\"!/\") };\n\t\t\tURLClassLoader cl = URLClassLoader.newInstance(urls);\n\t\t\t\n\t\t\twhile (jar_entries_enum.hasMoreElements()) {\n\t\t JarEntry jar_entry = (JarEntry) jar_entries_enum.nextElement();\n\t\t if(jar_entry.isDirectory() || !jar_entry.getName().endsWith(\".class\")) {\n\t\t \tcontinue;\n\t\t }\n\n\t\t\t String className = jar_entry.getName().substring(0,jar_entry.getName().length()-6); //-6 == len(\".class\")\n\t\t\t className = className.replace('/', '.');\n\t\t\t \n\t\t\t Class<?> c = cl.loadClass(className);\n\t\t\t if (TestCase.class.isAssignableFrom(c) || has_annotations(c)){ \n\t\t\t \ttest_classes.add(c);\n\t\t\t \tclass_names.add(className);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tjarFile.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t}\n\t\n\tif (test_classes.isEmpty())\n\t{\n\t\tSystem.err.println(\"There is nothing to test.\");\n\t\tSystem.exit(1);\n\t}\n\telse{\n\t\tSystem.out.println(Arrays.toString(class_names.toArray()));\n\t\t\n\tJUnitCore runner = new JUnitCore();\n\tCustomListener custom_listener = new CustomListener();\n\tcustom_listener.reporter = new Reporter(args[args.length-1]);\n\trunner.addListener(custom_listener);\n\trunner.run(test_classes.toArray(new Class[test_classes.size()]));\n\t\t}\n\t}", "@Test\n public void testCreateAllAssetsDirectoryWithOneAssetsDirectory() {\n BuildRuleResolver ruleResolver = new BuildRuleResolver();\n\n // Two android_library deps, one of which has an assets directory.\n JavaLibraryRule libraryOne = createAndroidLibraryRule(\n \"//java/src/com/facebook/base:libraryOne\",\n ruleResolver,\n null, /* resDirectory */\n null, /* assetDirectory */\n null /* nativeLibsDirectory */);\n JavaLibraryRule libraryTwo = createAndroidLibraryRule(\n \"//java/src/com/facebook/base:libraryTwo\",\n ruleResolver,\n null, /* resDirectory */\n \"java/src/com/facebook/base/assets2\",\n null /* nativeLibsDirectory */);\n\n AndroidResourceRule resourceOne = (AndroidResourceRule) ruleResolver\n .get(BuildTargetFactory.newInstance(\"//java/src/com/facebook/base:libraryTwo_resources\"));\n\n // One android_binary rule that depends on the two android_library rules.\n BuildTarget binaryBuildTarget = BuildTargetFactory.newInstance(\n \"//java/src/com/facebook/base:apk\");\n AndroidBinaryRule androidBinary = ruleResolver.buildAndAddToIndex(\n AndroidBinaryRule.newAndroidBinaryRuleBuilder(new FakeAbstractBuildRuleBuilderParams())\n .setBuildTarget(binaryBuildTarget)\n .addDep(libraryOne.getBuildTarget())\n .addDep(libraryTwo.getBuildTarget())\n .setManifest(\"java/src/com/facebook/base/AndroidManifest.xml\")\n .setTarget(\"Google Inc.:Google APIs:16\")\n .setKeystore(addKeystoreRule(ruleResolver))\n .setPackageType(\"debug\"));\n\n // Build up the parameters needed to invoke createAllAssetsDirectory().\n Set<String> assetsDirectories = ImmutableSet.of(resourceOne.getAssets());\n ImmutableList.Builder<Step> commands = ImmutableList.builder();\n DirectoryTraverser traverser = new DirectoryTraverser() {\n @Override\n public void traverse(DirectoryTraversal traversal) {\n String rootPath = traversal.getRoot().getPath();\n if (\"java/src/com/facebook/base/assets2\".equals(rootPath)) {\n traversal.visit(\n new File(\"java/src/com/facebook/base/assets2\",\n \"fonts/Theinhardt-Medium.otf\"),\n \"fonts/Theinhardt-Medium.otf\");\n traversal.visit(\n new File(\"java/src/com/facebook/base/assets2\",\n \"fonts/Theinhardt-Regular.otf\"),\n \"fonts/Theinhardt-Regular.otf\");\n } else {\n throw new RuntimeException(\"Unexpected path: \" + rootPath);\n }\n }\n };\n\n // Invoke createAllAssetsDirectory(), the method under test.\n Optional<String> allAssetsDirectory = androidBinary.createAllAssetsDirectory(\n assetsDirectories, ImmutableMap.<String, File>of(), commands, traverser);\n\n // Verify that the existing assets/ directory will be passed to aapt.\n assertTrue(allAssetsDirectory.isPresent());\n assertEquals(\n \"Even though there is only one assets directory, the one in \" + BIN_DIR + \" should be used.\",\n androidBinary.getPathToAllAssetsDirectory(),\n allAssetsDirectory.get());\n }", "@Test\n public void testCreateAllAssetsDirectoryWithMultipleAssetsDirectories() {\n BuildRuleResolver ruleResolver = new BuildRuleResolver();\n\n // Two android_library deps, each with an assets directory.\n JavaLibraryRule libraryOne = createAndroidLibraryRule(\n \"//java/src/com/facebook/base:libraryOne\",\n ruleResolver,\n null, /* resDirectory */\n \"java/src/com/facebook/base/assets1\",\n null /* nativeLibsDirectory */);\n JavaLibraryRule libraryTwo = createAndroidLibraryRule(\n \"//java/src/com/facebook/base:libraryTwo\",\n ruleResolver,\n null, /* resDirectory */\n \"java/src/com/facebook/base/assets2\",\n null /* nativeLibsDirectory */);\n\n\n // One android_binary rule that depends on the two android_library rules.\n BuildTarget binaryBuildTarget = BuildTargetFactory.newInstance(\n \"//java/src/com/facebook/base:apk\");\n AndroidBinaryRule androidBinary = ruleResolver.buildAndAddToIndex(\n AndroidBinaryRule.newAndroidBinaryRuleBuilder(new FakeAbstractBuildRuleBuilderParams())\n .setBuildTarget(binaryBuildTarget)\n .addDep(libraryOne.getBuildTarget())\n .addDep(libraryTwo.getBuildTarget())\n .setManifest(\"java/src/com/facebook/base/AndroidManifest.xml\")\n .setTarget(\"Google Inc.:Google APIs:16\")\n .setKeystore(addKeystoreRule(ruleResolver))\n .setPackageType(\"debug\"));\n\n AndroidResourceRule resourceOne = (AndroidResourceRule) ruleResolver.get(\n BuildTargetFactory.newInstance(\"//java/src/com/facebook/base:libraryOne_resources\"));\n AndroidResourceRule resourceTwo = (AndroidResourceRule) ruleResolver.get(\n BuildTargetFactory.newInstance(\"//java/src/com/facebook/base:libraryTwo_resources\"));\n\n // Build up the parameters needed to invoke createAllAssetsDirectory().\n Set<String> assetsDirectories = ImmutableSet.of(\n resourceOne.getAssets(),\n resourceTwo.getAssets());\n ImmutableList.Builder<Step> commands = ImmutableList.builder();\n DirectoryTraverser traverser = new DirectoryTraverser() {\n @Override\n public void traverse(DirectoryTraversal traversal) {\n String rootPath = traversal.getRoot().getPath();\n if (\"java/src/com/facebook/base/assets1\".equals(rootPath)) {\n traversal.visit(\n new File(\"java/src/com/facebook/base/assets1\",\n \"guava-10.0.1-fork.dex.1.jar\"),\n \"guava-10.0.1-fork.dex.1.jar\");\n } else if (\"java/src/com/facebook/base/assets2\".equals(rootPath)) {\n traversal.visit(\n new File(\"java/src/com/facebook/base/assets2\",\n \"fonts/Theinhardt-Medium.otf\"),\n \"fonts/Theinhardt-Medium.otf\");\n traversal.visit(\n new File(\"java/src/com/facebook/base/assets2\",\n \"fonts/Theinhardt-Regular.otf\"),\n \"fonts/Theinhardt-Regular.otf\");\n } else {\n throw new RuntimeException(\"Unexpected path: \" + rootPath);\n }\n }\n };\n\n // Invoke createAllAssetsDirectory(), the method under test.\n Optional<String> allAssetsDirectory = androidBinary.createAllAssetsDirectory(\n assetsDirectories, ImmutableMap.<String, File>of(), commands, traverser);\n\n // Verify that an assets/ directory will be created and passed to aapt.\n assertTrue(allAssetsDirectory.isPresent());\n assertEquals(BIN_DIR + \"/java/src/com/facebook/base/__assets_apk__\", allAssetsDirectory.get());\n List<? extends Step> expectedCommands = ImmutableList.of(\n new MakeCleanDirectoryStep(BIN_DIR + \"/java/src/com/facebook/base/__assets_apk__\"),\n new MkdirAndSymlinkFileStep(\n \"java/src/com/facebook/base/assets1/guava-10.0.1-fork.dex.1.jar\",\n BIN_DIR + \"/java/src/com/facebook/base/__assets_apk__/guava-10.0.1-fork.dex.1.jar\"),\n new MkdirAndSymlinkFileStep(\n \"java/src/com/facebook/base/assets2/fonts/Theinhardt-Medium.otf\",\n BIN_DIR + \"/java/src/com/facebook/base/__assets_apk__/fonts/Theinhardt-Medium.otf\"),\n new MkdirAndSymlinkFileStep(\n \"java/src/com/facebook/base/assets2/fonts/Theinhardt-Regular.otf\",\n BIN_DIR + \"/java/src/com/facebook/base/__assets_apk__/fonts/Theinhardt-Regular.otf\"));\n MoreAsserts.assertListEquals(expectedCommands, commands.build());\n }", "public void testAnnoDeployment(Class classRA) throws Throwable\n {\n String name = classRA.toString();\n name = name.substring(name.lastIndexOf(\".\") + 1);\n\n log.info(\"/////ANNO \" + name + \" started ////\");\n testDeployment(createAnnotationDeployment(classRA), name);\n }", "public static void PackageArchive(File directoryName, File fileName) throws IOException\r\n {\r\n final String ARCHIVE_XML = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-16\\\"?>\\n<archive major_version=\\\"0\\\" minor_version=\\\"1\\\" />\";\r\n\r\n TarArchiveWriter archive = new TarArchiveWriter(new GZIPOutputStream(new FileOutputStream(fileName)));\r\n\r\n // Create the archive.xml file\r\n archive.writeFile(\"archive.xml\", ARCHIVE_XML);\r\n\r\n // Add the assets\r\n File dir = new File(directoryName, ArchiveConstants.ASSETS_PATH);\r\n String[] files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.ASSETS_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n // Add the objects\r\n dir = new File(directoryName, ArchiveConstants.OBJECTS_PATH);\r\n files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.OBJECTS_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n // Add the terrain(s)\r\n dir = new File(directoryName, ArchiveConstants.TERRAINS_PATH);\r\n files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.TERRAINS_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n // Add the parcels(s)\r\n dir = new File(directoryName, ArchiveConstants.LANDDATA_PATH);\r\n files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.LANDDATA_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n // Add the setting(s)\r\n dir = new File(directoryName, ArchiveConstants.SETTINGS_PATH);\r\n files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.SETTINGS_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n archive.close();\r\n }", "@Override\n\tpublic Project packageArchive(IProject ipr, IProject relativeTo) {\n\t\t//throw new RuntimeException(\"This method is not supported for Web based build configurations\");\n\t\tProject proj = null;\n\t\t\n\t\t\n\t\tProjectDeploymentStructure pds = readDeploymentAssembly(ipr);\n\t\t\n\t\tproj = generateArchive(pds, ipr, relativeTo);\n\t\tproj.setProperties(BuildCore.getProjectProperties(relativeTo.getLocation()));\n\t\t/**\n\t\t * If the ProjectDeploymentStructure instance is null. Then it is clear that this archive doesn't need packaging of other archives.\n\t\t * Hence, Only archive this Project.\n\t\t * \n\t\t */\n\t\t\n\t\treturn proj;\n\t}", "CdapArtifact createCdapArtifact();", "@BeforeClass\n public static void beforeClass() throws Throwable\n {\n // Create and set a new MC Bootstrap\n BasicBootstrap bootstrap = new BasicBootstrap();\n Ejb3McRegistrarTestCase.setBootstrap(bootstrap);\n bootstrap.run();\n Kernel kernel = bootstrap.getKernel();\n\n // Bind the Ejb3Registrar\n Ejb3RegistrarLocator.bindRegistrar(new Ejb3McRegistrar(kernel));\n\n // Deploy\n BasicXMLDeployer deployer = new BasicXMLDeployer(kernel);\n URL deployUrl = getDeployableXmlUrl(Ejb3McRegistrarTestCase.class);\n deployer.deploy(deployUrl);\n }", "@Override\r\n\tpublic void decompileFromArchive( String archivePath, String packege, String className )\r\n\t{\r\n\t\tstart = System.currentTimeMillis( );\r\n\t\tFile workingDir = new File(\r\n\t\t\t\tJavaDecompilerPlugin.getDefault( ).getPreferenceStore( ).getString( JavaDecompilerPlugin.TEMP_DIR )\r\n\t\t\t\t\t\t+ \"/\" //$NON-NLS-1$\r\n\t\t\t\t\t\t+ System.currentTimeMillis( ) );\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tworkingDir.mkdirs( );\r\n\t\t\tJarClassExtractor.extract( archivePath, packege, className, true, workingDir.getAbsolutePath( ) );\r\n\t\t\tdecompile( workingDir.getAbsolutePath( ), \"\", className ); //$NON-NLS-1$\r\n\t\t}\r\n\t\tcatch ( Exception e )\r\n\t\t{\r\n\t\t\texcList.add( e );\r\n\t\t\t// logExceptions();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tFileUtil.deltree( workingDir );\r\n\t\t}\r\n\t}", "@Test\n public void testGetClassesInPackage() throws Exception\n {\n\n WarMachine machine = TestHelpers.createWarMachine(WarNames.SERVLET);\n\n Set<String> clist1 = machine.getClassesInPackage(\"com.example.servlet\", false);\n assertEquals(\"number of classes in WEB-INF, non-recursive\", 1, clist1.size());\n assertTrue(\"searching for file in WEB-INF, non-recursive\", clist1.contains(\"com.example.servlet.SomeServlet\"));\n\n Set<String> clist2 = machine.getClassesInPackage(\"net.sf.practicalxml.xpath\", false);\n assertEquals(\"number of classes in JAR, non-recursive\", 13, clist2.size());\n assertTrue(\"searching for classes in JAR, non-recursive\", clist2.contains(\"net.sf.practicalxml.xpath.XPathWrapper\"));\n\n Set<String> clist3 = machine.getClassesInPackage(\"net.sf.practicalxml.xpath\", true);\n assertEquals(\"number of classes in JAR, recursive\", 17, clist3.size());\n assertTrue(\"searching for classes in JAR, recursive\", clist3.contains(\"net.sf.practicalxml.xpath.XPathWrapper\"));\n assertTrue(\"searching for classes in JAR, recursive\", clist3.contains(\"net.sf.practicalxml.xpath.function.Constants\"));\n }", "private void buildClassPath() throws InterruptedException, IOException, CheckedAnalysisException {\n IClassPathBuilder builder = classFactory.createClassPathBuilder(bugReporter);\n\n for (String path : project.getFileArray()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), true);\n }\n for (String path : project.getAuxClasspathEntryList()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), false);\n }\n\n builder.scanNestedArchives(analysisOptions.scanNestedArchives);\n\n builder.build(classPath, progress);\n\n appClassList = builder.getAppClassList();\n\n if (PROGRESS) {\n System.out.println(appClassList.size() + \" classes scanned\");\n }\n\n // If any of the application codebases contain source code,\n // add them to the source path.\n // Also, use the last modified time of application codebases\n // to set the project timestamp.\n for (Iterator<? extends ICodeBase> i = classPath.appCodeBaseIterator(); i.hasNext();) {\n ICodeBase appCodeBase = i.next();\n\n if (appCodeBase.containsSourceFiles()) {\n String pathName = appCodeBase.getPathName();\n if (pathName != null) {\n project.addSourceDir(pathName);\n }\n }\n\n project.addTimestamp(appCodeBase.getLastModifiedTime());\n }\n\n }", "public abstract NestedSet<Artifact> getTransitiveJackClasspathLibraries();", "private static void processJar(Path destinationPath) throws IOException {\n\n if (destinationPath == null) {\n throw new IOException(\"Cobigen folder path not found!\");\n }\n\n File cobigenTemplatesPath = CobiGenPaths.getTemplatesFolderPath().toFile();\n\n Path sourcesJarPath = TemplatesJarUtil.getJarFile(true, cobigenTemplatesPath).toPath();\n Path classesJarPath = TemplatesJarUtil.getJarFile(false, cobigenTemplatesPath).toPath();\n\n LOG.debug(\"Processing jar file @ {}\", sourcesJarPath);\n\n // extract sources jar to target directory\n extractArchive(sourcesJarPath, destinationPath);\n\n // create src/main/java directory\n Files.createDirectory(destinationPath.resolve(\"src/main/java\"));\n\n // move com folder to src/main/java/com\n Files.move(destinationPath.resolve(\"com\"), destinationPath.resolve(\"src/main/java/com\"),\n StandardCopyOption.REPLACE_EXISTING);\n\n // create src/main/resources directory\n Files.createDirectory(destinationPath.resolve(\"src/main/resources\"));\n\n // move META-INF folder to src/main/resources\n Files.move(destinationPath.resolve(\"META-INF\"), destinationPath.resolve(\"src/main/resources/META-INF\"),\n StandardCopyOption.REPLACE_EXISTING);\n\n // delete MANIFEST.MF\n Files.deleteIfExists(destinationPath.resolve(\"src/main/resources/META-INF/MANIFEST.MF\"));\n\n URI zipFile = URI.create(\"jar:file:\" + classesJarPath.toUri().getPath());\n\n // extract classes jar pom.xml\n try (FileSystem fs = FileSystemUtil.getOrCreateFileSystem(zipFile)) {\n Files.copy(fs.getPath(\"pom.xml\"), destinationPath.resolve(\"pom.xml\"), StandardCopyOption.REPLACE_EXISTING);\n }\n\n }", "public static JavaArchive createJarDemoDeployment(String artifactId) {\n return ShrinkwrapUtil.getSwitchYardJavaArchive(QS_DEMO_GID, artifactId);\n }", "@Test\n public void testDERIVATIVE_COMPRESS_CRC() throws IOException {\n// ZipMeVariables.getSINGLETON().setCRC___(true);\n// ZipMeVariables.getSINGLETON().setCOMPRESS___(true);\n// ZipMeVariables.getSINGLETON().setDERIVATIVE_COMPRESS_CRC___(true);\n\t Configuration.CRC=true;\n\t Configuration.COMPRESS=true;\n\t Configuration.DERIVATIVE_COMPRESS_CRC=true;\n if(Configuration.CRC && Configuration.COMPRESS && Configuration.DERIVATIVE_COMPRESS_CRC) { \n ZipOutputStream zout = new ZipOutputStream(new FileOutputStream(new File(\n homeDir + \"/files/src.zip\")));\n zout.crc.update(1);\n ZipEntry ze = new ZipEntry(\"C://\");\n zout.putNextEntry(ze);\n zout.hook41();\n assertTrue(zout.crc.crc == 0);\n\n zout.write(new byte[32], 0, 31);\n assertTrue(zout.size == 31);\n zout.closeEntry();\n assertTrue(ze.getCrc() == zout.crc.crc);\n }\n }", "public void testChangeExternalFolder() throws CoreException {\n String externalLib = Util.getOutputDirectory() + File.separator + \"externalLib\";\n IPath projectPath = env.addProject(\"Project\");\n try {\n new File(externalLib).mkdirs();\n Util.compile(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \" public void foo() {\\n\" + \" }\\n\" + \"}\" }, new HashMap<String, String>(), externalLib);\n env.addExternalJars(projectPath, Util.getJavaClassLibs());\n env.addExternalFolders(projectPath, new String[] { externalLib });\n //$NON-NLS-1$\n IPath root = env.getPackageFragmentRootPath(projectPath, \"\");\n env.setOutputFolder(projectPath, \"\");\n IPath classY = env.addClass(root, \"q\", \"Y\", \"package q;\\n\" + \"public class Y {\\n\" + \" void bar(p.X x) {\\n\" + \" x.foo();\\n\" + \" }\\n\" + \"}\");\n fullBuild(projectPath);\n env.waitForAutoBuild();\n expectingNoProblems();\n String externalClassFile = externalLib + File.separator + \"p\" + File.separator + \"X.class\";\n long lastModified = new java.io.File(externalClassFile).lastModified();\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n }\n Util.compile(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \"}\" }, new HashMap<String, String>(), externalLib);\n // to be sure its different\n new java.io.File(externalClassFile).setLastModified(lastModified + 1000);\n env.getProject(projectPath).refreshLocal(IResource.DEPTH_INFINITE, null);\n env.waitForManualRefresh();\n incrementalBuild(projectPath);\n env.waitForAutoBuild();\n expectingProblemsFor(classY, \"Problem : The method foo() is undefined for the type X [ resource : </Project/q/Y.java> range : <54,57> category : <50> severity : <2>]\");\n } finally {\n new File(externalLib).delete();\n env.removeProject(projectPath);\n }\n }", "public void xtestTraceJar() {\n ResolvedType trace = world.resolve(UnresolvedType.forName(\"Trace\"), true);\n assertTrue(\"Couldnt find type Trace\", !trace.isMissing());\n fieldsTest(trace, Member.NONE);\n /*Member constr = */\n MemberImpl.methodFromString(\"void Trace.<init>()\");\n //XXX need attribute fix - \n //methodsTest(trace, new Member[] { constr });\n interfacesTest(trace, ResolvedType.NONE);\n superclassTest(trace, UnresolvedType.OBJECT);\n isInterfaceTest(trace, false);\n isClassTest(trace, false);\n isAspectTest(trace, true);\n pointcutsTest(trace, new Member[] { MemberImpl.pointcut(trace, \"traced\", \"(Ljava/lang/Object;)V\") });\n modifiersTest(trace.findPointcut(\"traced\"), Modifier.PUBLIC | Modifier.ABSTRACT);\n mungersTest(trace, new ShadowMunger[] { world.shadowMunger(\"before(foo): traced(foo) -> void Trace.ajc_before_4(java.lang.Object))\", 0), world.shadowMunger(\"afterReturning(foo): traced(foo) -> void Trace.ajc_afterreturning_3(java.lang.Object, java.lang.Object))\", Advice.ExtraArgument), world.shadowMunger(\"around(): execution(* doit(..)) -> java.lang.Object Trace.ajc_around_2(org.aspectj.runtime.internal.AroundClosure))\", Advice.ExtraArgument), world.shadowMunger(\"around(foo): traced(foo) -> java.lang.Object Trace.ajc_around_1(java.lang.Object, org.aspectj.runtime.internal.AroundClosure))\", Advice.ExtraArgument) });\n ResolvedType myTrace = world.resolve(UnresolvedType.forName(\"MyTrace\"), true);\n assertTrue(\"Couldnt find type MyTrace\", !myTrace.isMissing());\n interfacesTest(myTrace, ResolvedType.NONE);\n superclassTest(myTrace, trace);\n isInterfaceTest(myTrace, false);\n isClassTest(myTrace, false);\n isAspectTest(myTrace, true);\n //XXX need attribute fix - \n //fieldsTest(myTrace, Member.NONE);\n pointcutsTest(trace, new Member[] { MemberImpl.pointcut(trace, \"traced\", \"(Ljava/lang/Object;)V\") });\n modifiersTest(myTrace.findPointcut(\"traced\"), Modifier.PUBLIC);\n // this tests for declared mungers\n mungersTest(myTrace, ShadowMunger.NONE);\n }", "private static void deployStaticHEResources(String targetDir, boolean bootstrappingEnabled) throws URISyntaxException, IOException{\r\n \t\r\n\t\tClassLoader loader = ServiceGenerator.class.getClassLoader();\r\n\t\tURI jniInterfaceFilePath = loader.getResource(Constants.HE_SERVICE_RESOURCES_FOLDER \r\n\t\t\t\t+ Constants.SERVICE_JNI_INTERFACE_FILE_NAME).toURI();\r\n\t\tURI jniInterfaceHeaderFilePath = loader.getResource(Constants.HE_SERVICE_RESOURCES_FOLDER \r\n\t\t\t\t+ Constants.SERVICE_JNI_INTERFACE_HEADER_FILE_NAME).toURI();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tFile origJniInterfaceFile = new File(jniInterfaceFilePath);\r\n\t\tFile newJniInterfaceFile = new File(targetDir + origJniInterfaceFile.getName());\r\n\t\t\r\n\t\tFile origJniInterfaceHeaderFile = new File(jniInterfaceHeaderFilePath);\r\n\t\tFile newJniInterfaceHeaderFile = new File(targetDir + origJniInterfaceHeaderFile.getName());\r\n\t\t\t\t\t\t\r\n\t\t \t\t\r\n\t\tUtils.deployStaticResource(origJniInterfaceFile, newJniInterfaceFile);\r\n\t\tUtils.deployStaticResource(origJniInterfaceHeaderFile, newJniInterfaceHeaderFile);\r\n }", "private byte[] getDeploymentJarBytesForContract(Contract contract) {\n byte[] jarBytes = null;\n switch (contract) {\n case AION_BUFFER_PERF:\n jarBytes = classesToJarBytes(\n AionBufferPerfContract.class,\n AionBuffer.class);\n // Verify that this size doesn't unexpectedly change.\n Assert.assertEquals(7_764L, jarBytes.length);\n break;\n case BASIC_PERF:\n jarBytes = classesToJarBytes(\n BasicPerfContract.class,\n AionList.class,\n AionMap.class,\n AionSet.class);\n // Verify that this size doesn't unexpectedly change.\n Assert.assertEquals(28_732L, jarBytes.length);\n break;\n case POC_EXCHANGE:\n jarBytes = classesToJarBytes(\n ExchangeController.class,\n Exchange.class,\n ExchangeTransaction.class,\n ByteArrayHelpers.class,\n ERC20Token.class,\n AionList.class,\n AionSet.class,\n AionMap.class);\n // Verify that this size doesn't unexpectedly change.\n Assert.assertEquals(32_571L, jarBytes.length);\n break;\n case ERC20:\n byte[] clinitArgs = ABIUtil.encodeMethodArguments(\"\", \"Pepe\".toCharArray(), \"PEPE\".toCharArray(), 8);\n jarBytes = classesToJarBytesWithClinitArgs(\n clinitArgs,\n CoinController.class,\n ERC20Token.class,\n AionList.class,\n AionSet.class,\n AionMap.class);\n // Verify that this size doesn't unexpectedly change.\n Assert.assertEquals(28_012L, jarBytes.length);\n break;\n case BASIC_APP:\n jarBytes = classesToJarBytes(\n BasicAppTestTarget.class,\n AionMap.class,\n AionSet.class,\n AionList.class);\n // Verify that this size doesn't unexpectedly change.\n Assert.assertEquals(26_106L, jarBytes.length);\n break;\n case TRS:\n jarBytes = classesToJarBytes(\n TRS.class,\n AionMap.class);\n // Verify that this size doesn't unexpectedly change.\n Assert.assertEquals(16_091L, jarBytes.length);\n break;\n default: throw new AssertionError(\"This should never be reached.\");\n }\n\n return jarBytes;\n }", "private ClassLoader createBootClassLoader(ClassLoader hostClassLoader) throws MojoExecutionException {\n \n Set<URL> bootClassPath = artifactHelper.resolve(\"org.codehaus.fabric3\", \"fabric3-test-runtime\", runtimeVersion, Artifact.SCOPE_RUNTIME, \"jar\");\n return new URLClassLoader(bootClassPath.toArray(new URL[] {}), hostClassLoader);\n \n }", "@Test\r\n public void testAssemblyFilter()\r\n {\r\n TestSuiteFilterAssembler assembler = new TestSuiteFilterAssembler();\r\n Collection<String> requirements = new ArrayList<String>();\r\n requirements.add(\"FR_TARGET_0025\");\r\n assembler.setRequirementsFilter(requirements);\r\n\r\n TestSuiteFilter<FlowStep> filter = assembler.assemblyFilter();\r\n TestSuite<TestCase<FlowStep>> newSuite = filter.filter(rawTestSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n Assert.assertEquals(\"Wrong number of test cases.\", 9, newSuite.getTestCases().size());\r\n\r\n requirements.add(\"FR_TARGET_0040\");\r\n assembler.setRequirementsFilter(requirements);\r\n filter = assembler.assemblyFilter();\r\n newSuite = filter.filter(rawTestSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n Assert.assertEquals(\"Wrong number of test cases.\", 15, newSuite.getTestCases().size());\r\n\r\n requirements = new ArrayList<String>();\r\n requirements.add(\"FR_TARGET_0040\");\r\n assembler.setRequirementsFilter(requirements);\r\n filter = assembler.assemblyFilter();\r\n newSuite = filter.filter(newSuite);\r\n Assert.assertNotNull(\"The filtered test suite is null.\", newSuite);\r\n Assert.assertEquals(\"Wrong number of test cases.\", 6, newSuite.getTestCases().size());\r\n }", "public Result loadWarFile(WebBundleDescriptor descriptor) {\n \n Result result = getInitializedResult();\n\tComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();\n\tcontext = getVerifierContext();\n try {\n // TODO : check whether this method is required?\n WebTestsUtil webTestsUtil = WebTestsUtil.getUtil(context.getClassLoader());\n// File f = Verifier.getArchiveFile(descriptor.getModuleDescriptor().\n// getArchiveUri());\n// if (f != null) {\n//\t webTestsUtil.extractJarFile(f);\n// }\n// else {\n// // dont bother about extracting JarFile\n// }\n\t //Sheetal: 09/30/02\n\t //dont need to call Verifier's appendCLWithWebInfContents() since J2EEClassLoader takes care of it\n\t //webTestsUtil.appendCLWithWebInfContents();\n } catch (Throwable e) {\n//\t e.printStackTrace();\n Verifier.debug(e);\n\t result.addErrorDetails(smh.getLocalString\n\t\t\t\t (\"tests.componentNameConstructor\",\n\t\t\t\t\t\"For [ {0} ]\",\n\t\t\t\t\tnew Object[] {compName.toString()}));\n result.addErrorDetails(smh.getLocalString\n\t\t(\"com.sun.enterprise.tools.verifier.tests.web.WebTest\" + \".Exception\",\n\t\t \"Error: Unexpected exception occurred [ {0} ]\",\n\t\t new Object[] {e.toString()}));\n } \n return result;\n }", "public Runner runner(String[] args, String[] remoteArgs, ClassLoader testClassLoader);", "public void testWeaveJavaxClassesNo() { runTest(\"weave javax classes - no\");}", "public static void main(String[] args) {\n\t\textractedMain(JarFolders.SRC_FOLDER);\r\n\t}", "protected void deploySuite(String suitePath, String mainClassName) {\n \n }", "public static File generateAssemblyPlan(Set<AssignedModule> modulesToTest, String filePath) throws Exception {\n \n //Add testing modules to target modules\n HashSet<AssignedModule> allModules = new HashSet<>();\n HashSet<List<Feature>> moduleFeatureHash = new HashSet<>();\n \n for (AssignedModule targetModule : modulesToTest) {\n if (!moduleFeatureHash.contains(targetModule.getAllModuleFeatures())) {\n allModules.add(targetModule);\n moduleFeatureHash.add(targetModule.getAllModuleFeatures());\n }\n\n List<AssignedModule> controlModules = targetModule.getControlModules();\n for (AssignedModule controlModule : controlModules) {\n if (!moduleFeatureHash.contains(controlModule.getAllModuleFeatures())) {\n allModules.add(controlModule);\n moduleFeatureHash.add(controlModule.getAllModuleFeatures());\n }\n }\n }\n \n ClothoConnection conn = new ClothoConnection(Args.clothoLocation,Args.maxTimeOut);\n Clotho clothoObject = new Clotho(conn); \n \n //Get Phoenix data from Clotho\n JSONObject parameters = ClothoAdaptor.getAssemblyParameters(\"default\",clothoObject).toJSON();\n org.json.JSONObject rParameters = convertJSONs(parameters);\n \n Map polyNucQuery = new HashMap();\n //polyNucQuery.put(\"schema\", \"org.cidarlab.phoenix.core.dom.Polynucleotide\");\n HashSet<Polynucleotide> polyNucs = new HashSet<>(ClothoAdaptor.queryPolynucleotides(polyNucQuery,clothoObject));\n \n Map featureQuery = new HashMap();\n //featureQuery.put(\"schema\", \"org.cidarlab.phoenix.core.dom.Feature\");\n List<Feature> allFeatures = ClothoAdaptor.queryFeatures(featureQuery,clothoObject);\n \n Map fluorophoreQuery = new HashMap();\n //fluorophoreQuery.put(\"schema\", \"org.cidarlab.phoenix.core.dom.Fluorophore\");\n allFeatures.addAll(ClothoAdaptor.queryFluorophores(fluorophoreQuery,clothoObject));\n \n //Determine parts library\n HashSet<org.cidarlab.raven.datastructures.Part> partsLibR = new HashSet();\n HashSet<org.cidarlab.raven.datastructures.Vector> vectorsLibR = new HashSet();\n \n //Convert Phoenix Features to Raven Parts\n partsLibR.addAll(phoenixFeaturesToRavenParts(allFeatures));\n \n //Convert Phoenix Polynucleotides to Raven Parts, Vectors and Plasmids\n HashMap<org.cidarlab.raven.datastructures.Part, org.cidarlab.raven.datastructures.Vector> libPairs = ravenPartVectorPairs(polyNucs, partsLibR, vectorsLibR);\n vectorsLibR.addAll(libPairs.values());\n partsLibR.addAll(libPairs.keySet());\n \n //Convert Phoenix Modules to Raven Plasmids\n ArrayList<HashSet<org.cidarlab.raven.datastructures.Part>> listTargetSets = new ArrayList();\n HashSet<AssignedModule> expressees = new HashSet<>();\n HashSet<AssignedModule> expressors = new HashSet<>();\n for (AssignedModule m : allModules) {\n if (m.getRole() == ModuleRole.EXPRESSEE || m.getRole() == ModuleRole.EXPRESSEE_ACTIVATIBLE_ACTIVATOR || m.getRole() == ModuleRole.EXPRESSEE_ACTIVATOR || m.getRole() == ModuleRole.EXPRESSEE_REPRESSIBLE_REPRESSOR || m.getRole() == ModuleRole.EXPRESSEE_REPRESSOR) {\n expressees.add(m);\n } else if (m.getRole() == ModuleRole.EXPRESSOR) {\n expressors.add(m);\n }\n }\n allModules.removeAll(expressees);\n allModules.removeAll(expressors);\n \n listTargetSets.add(phoenixModulesToRavenParts(expressees, partsLibR));\n listTargetSets.add(phoenixModulesToRavenParts(expressors, partsLibR));\n listTargetSets.add(phoenixModulesToRavenParts(allModules, partsLibR)); \n \n //Run Raven to get assembly instructions\n Raven raven = new Raven(); \n RavenController assemblyObj = raven.assemblyObject(listTargetSets, partsLibR, vectorsLibR, libPairs, new HashMap(), rParameters, filePath);\n \n //This is the information to be saved into Clotho and grabbed for the Owl datasheets\n //This information applies to all polynucleotides currently made in Phoenix\n String assemblyMethod = \"MoClo (GoldenGate)\"; //Right now everythig in Phoenix requires MoClo RFC 94 - can be extended in future, but this is what it is right now\n String assemblyRFC = \"BBa_94\";\n String chassis = \"E. coli\"; //Also always the case for Phoenix right now\n String supplementalComments = \"\"; //Nothing for now, perhaps this can be searched upon plasmid re-enrty?\n \n //This information is specific to each Polynucleotide\n for (HashSet<org.cidarlab.raven.datastructures.Part> partSet : listTargetSets) {\n for (org.cidarlab.raven.datastructures.Part p : partSet) {\n \n ArrayList<String> neighborNames = new ArrayList<>();\n String pigeonCode = \"\";\n \n //This assumes part name and rootNode name are the same - I think this is true, but there might be a bug here\n for (RGraph aG : assemblyObj.getAssemblyGraphs()) {\n if (aG.getRootNode().getName().equalsIgnoreCase(p.getName())) {\n \n //Unclear if we want to use this information... The PrimitiveModules already have feature and direction, but these lists place the scars between those features\n ArrayList<String> composition = aG.getRootNode().getComposition();\n ArrayList<String> direction = aG.getRootNode().getDirection();\n ArrayList<String> linkers = aG.getRootNode().getLinkers();\n ArrayList<String> scars = aG.getRootNode().getScars();\n ArrayList<String> type = aG.getRootNode().getType();\n \n //Neighbor names - Assembly components should be the neighbors of the root node - the parts put together in the last cloning reaction for this polynucleotide\n ArrayList<RNode> neighbors = aG.getRootNode().getNeighbors();\n for (RNode n : neighbors) {\n neighborNames.add(n.getName());\n }\n \n //Pigeon code\n if (assemblyObj.getPigeonTextFiles().containsKey(p.getName())) {\n pigeonCode = assemblyObj.getPigeonTextFiles().get(p.getName());\n }\n }\n }\n }\n }\n \n File assemblyInstructions = assemblyObj.getInstructionsFile();\n \n /*\n THESE ARE THE METHODS FOR MAKING THE RAVEN-PIGEON IMAGES\n */\n// WeyekinPoster.setDotText(RGraph.mergeWeyekinFiles(assemblyObj.getPigeonTextFiles()));\n// WeyekinPoster.postMyVision();\n \n conn.closeConnection();\n return assemblyInstructions;\n }", "public static void main(String[] args) throws Exception {\n\n Path rootDir = Paths.get(\".\").normalize().toAbsolutePath();\n if (!rootDir.endsWith(TEST_MODULE_NAME)) {\n rootDir = Paths.get(\".\" + File.separator + TEST_MODULE_NAME).normalize().toAbsolutePath();\n }\n final Path resourcesDir = rootDir.resolve(\"src\").resolve(\"main\").resolve(\"resources\");\n final Path schemaFile = resourcesDir.resolve(\"jaxb2-plugin-test.xsd\");\n final Path bindingFile = resourcesDir.resolve(\"binding-config.xjb\");\n // Use the same dir that the maven plugin uses\n final Path outputDir = rootDir\n .resolve(\"target\")\n .resolve(\"generated-sources\")\n .resolve(\"xjc\");\n\n System.out.println(\"rootDir: \" + rootDir.toAbsolutePath().toString());\n System.out.println(\"schemaFile: \" + schemaFile.toAbsolutePath().toString());\n System.out.println(\"bindingFile: \" + bindingFile.toAbsolutePath().toString());\n System.out.println(\"outputDir: \" + outputDir.toAbsolutePath().toString());\n\n clearDirectory(outputDir);\n\n // Ensure the full path exists\n Files.createDirectories(outputDir);\n\n final String[] xjcOptions = new String[]{\n \"-xmlschema\",\n \"-nv\",\n \"-extension\",\n \"-verbose\",\n// \"-p\", PACKAGE_NAME,\n \"-d\", outputDir.toAbsolutePath().toString(),\n \"-b\", bindingFile.toAbsolutePath().toString(),\n// \"-quiet\",\n schemaFile.toAbsolutePath().toString(), //the source schema to gen classes from\n \"-Ximmutable\",\n \"-Xfluent-builder\",\n \"-generateJavadocFromAnnotations=true\",\n \"-Xclone\",\n // TODO Not sure how to handle the episodes file that group-contract needs\n// \"-Xgroup-contract\",\n };\n\n System.out.println(\"Running XJC with arguments:\");\n Arrays.stream(xjcOptions)\n .map(str -> \" \" + str)\n .forEach(System.out::println);\n\n // Run the xjc code generation process\n final int exitStatus = Driver.run(xjcOptions, System.out, System.out);\n\n if (exitStatus != 0) {\n System.out.print(\"Executing xjc failed\");\n System.exit(1);\n }\n }", "public static void main(String[] args) throws IOException {\n\t\tFile targetFile = new File(\"D:\\\\program\\\\360cse\\\\360Chrome\\\\test.zip\");\n\t\tFile sourceFiles = new File(\"D:\\\\temple\\\\sysMenu-add.html\");\n\t\tboolean flag = compressZip(false, targetFile, sourceFiles);\n\t\tSystem.out.println(flag);\n\t}", "private static String createAzkabanJobZip(AzkabanProjectConfig azkabanProjectConfig)\n throws IOException {\n log.info(\"Creating Azkaban job zip file for project: \" + azkabanProjectConfig.getAzkabanProjectName());\n String workDir = azkabanProjectConfig.getWorkDir();\n\n Optional<String> jarUrlTemplate = azkabanProjectConfig.getAzkabanZipJarUrlTemplate();\n Optional<List<String>> jarNames = azkabanProjectConfig.getAzkabanZipJarNames();\n Optional<String> jarVersion = azkabanProjectConfig.getAzkabanZipJarVersion();\n Optional<List<String>> additionalFiles = azkabanProjectConfig.getAzkabanZipAdditionalFiles();\n boolean failIfJarNotFound = azkabanProjectConfig.getFailIfJarNotFound();\n String jobFlowName = azkabanProjectConfig.getAzkabanProjectFlowName();\n String zipFilename = azkabanProjectConfig.getAzkabanProjectZipFilename();\n\n // Download the job jars\n List<File> filesToAdd = Lists.newArrayList();\n if (jarNames.isPresent() && jarUrlTemplate.isPresent() && jarVersion.isPresent()) {\n String urlTemplate = jarUrlTemplate.get();\n String version = jarVersion.get();\n for (String jarName : jarNames.get()) {\n String jobJarUrl = urlTemplate.replaceAll(\"<module-version>\", version).replaceAll(\"<module-name>\", jarName);\n log.info(\"Downloading job jar from: \" + jobJarUrl + \" to: \" + workDir);\n File jobJarFile = null;\n try {\n jobJarFile = downloadAzkabanJobJar(workDir, jobJarUrl);\n filesToAdd.add(jobJarFile);\n } catch (IOException e) {\n if (failIfJarNotFound) {\n throw e;\n }\n log.warn(\"Could not download: \" + jobJarFile);\n }\n }\n }\n\n // Download additional files\n if (additionalFiles.isPresent()) {\n List<String> files = additionalFiles.get();\n for (String fileName : files) {\n log.info(\"Downloading additional file from: \" + fileName + \" to: \" + workDir);\n File additionalFile = null;\n try {\n additionalFile = downloadAzkabanJobJar(workDir, fileName);\n filesToAdd.add(additionalFile);\n } catch (IOException e) {\n if(failIfJarNotFound) {\n throw e;\n }\n log.warn(\"Could not download: \" + additionalFile);\n }\n }\n }\n\n // Write the config files\n log.info(\"Writing Azkaban config files\");\n File [] jobConfigFile = writeAzkabanConfigFiles(workDir, jobFlowName, azkabanProjectConfig);\n filesToAdd.add(jobConfigFile[0]);\n\n // Create the zip file\n log.info(\"Writing zip file\");\n String zipfile = createZipFile(workDir, zipFilename, filesToAdd);\n log.info(\"Wrote zip file: \" + zipfile);\n\n return zipfile;\n }", "public void archive(MavenBuildProxy build, File file, BuildListener listener) throws IOException, InterruptedException {\n if (build.isArchivingDisabled()) {\n listener.getLogger().println(\"[JENKINS] Archiving disabled - not archiving \" + file);\n }\n else {\n FilePath target = getArtifactArchivePath(build,groupId,artifactId,version);\n FilePath origin = new FilePath(file);\n if (!target.exists()) {\n listener.getLogger().println(\"[JENKINS] Archiving \"+ file+\" to \"+target);\n origin.copyTo(target);\n } else if (!origin.digest().equals(target.digest())) {\n listener.getLogger().println(\"[JENKINS] Re-archiving \"+file);\n origin.copyTo(target);\n } else {\n LOGGER.fine(\"Not actually archiving \"+origin+\" due to digest match\");\n }\n\n /* debug probe to investigate \"missing artifact\" problem typically seen like this:\n\n ERROR: Asynchronous execution failure\n java.util.concurrent.ExecutionException: java.io.IOException: Archived artifact is missing: /files/hudson/server/jobs/glassfish-v3/modules/org.glassfish.build$maven-glassfish-extension/builds/2008-04-02_10-17-15/archive/org.glassfish.build/maven-glassfish-extension/1.0-SNAPSHOT/maven-glassfish-extension-1.0-SNAPSHOT.jar\n at hudson.remoting.Channel$1.adapt(Channel.java:423)\n at hudson.remoting.Channel$1.adapt(Channel.java:418)\n at hudson.remoting.FutureAdapter.get(FutureAdapter.java:32)\n at hudson.maven.MavenBuilder.call(MavenBuilder.java:140)\n at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:476)\n at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:422)\n at hudson.remoting.UserRequest.perform(UserRequest.java:69)\n at hudson.remoting.UserRequest.perform(UserRequest.java:23)\n at hudson.remoting.Request$2.run(Request.java:200)\n at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)\n at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)\n at java.util.concurrent.FutureTask.run(FutureTask.java:123)\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)\n at java.lang.Thread.run(Thread.java:595)\n Caused by: java.io.IOException: Archived artifact is missing: /files/hudson/server/jobs/glassfish-v3/modules/org.glassfish.build$maven-glassfish-extension/builds/2008-04-02_10-17-15/archive/org.glassfish.build/maven-glassfish-extension/1.0-SNAPSHOT/maven-glassfish-extension-1.0-SNAPSHOT.jar\n at hudson.maven.reporters.MavenArtifact.getFile(MavenArtifact.java:147)\n at hudson.maven.reporters.MavenArtifact.toArtifact(MavenArtifact.java:126)\n at hudson.maven.reporters.MavenArtifactRecord.install(MavenArtifactRecord.java:115)\n at hudson.maven.reporters.MavenArtifactArchiver$1.call(MavenArtifactArchiver.java:81)\n at hudson.maven.reporters.MavenArtifactArchiver$1.call(MavenArtifactArchiver.java:71)\n at hudson.maven.MavenBuild$ProxyImpl.execute(MavenBuild.java:255)\n at hudson.maven.MavenBuildProxy$Filter$AsyncInvoker.call(MavenBuildProxy.java:177)\n at hudson.remoting.UserRequest.perform(UserRequest.java:69)\n at hudson.remoting.UserRequest.perform(UserRequest.java:23)\n at hudson.remoting.Request$2.run(Request.java:200)\n at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)\n at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)\n at java.util.concurrent.FutureTask.run(FutureTask.java:138)\n at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)\n at java.lang.Thread.run(Thread.java:619)\n */\n\n if(!target.exists())\n throw new AssertionError(\"Just copied \"+file+\" to \"+target+\" but now I can't find it\");\n }\n }", "List<? extends Test> build() throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException{\n\t\tfor(String eachPositive:this.listOfPositive){\n\t\t\tcreateTest(eachPositive, getPositiveFileContent(eachPositive));\n\t\t}\n\t\tfor(String eachNegative:this.listOfNegative){\n\t\t\tcreateTest(eachNegative, getNegativeFileContent(eachNegative));\n\t\t}\n\t\t\n\t\t// create class loader\n\t\tURLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { new File(PATH_BASE).toURI().toURL() });\n\t\t\n\t\t// load all classes\n\t\tList<NamedTestCase> returnValue=new ArrayList<NamedTestCase>(this.listOfNegative.size()+this.listOfPositive.size());\n\t\tfor(String eachPositive:this.listOfPositive){\n\t\t\tClass<?> cls = Class.forName(eachPositive, true, classLoader);\n\t\t\treturnValue.add((NamedTestCase)cls.newInstance());\n\t\t}\n\t\tfor(String eachNegative:this.listOfNegative){\n\t\t\tClass<?> cls = Class.forName(eachNegative, true, classLoader);\n\t\t\treturnValue.add((NamedTestCase)cls.newInstance());\n\t\t}\n\n\t\t// sort for output\n\t\tCollections.sort(returnValue, new Comparator<NamedTestCase>(){\n\t\t\t@Override\n\t\t\tpublic int compare(NamedTestCase o1, NamedTestCase o2) {\n\t\t\t\treturn o2.getName().compareTo(o1.getName());\n\t\t\t}\n\t\t});\n\t\treturn returnValue; \n\t}", "public void testAddJarToBaseTestsList() throws Exception {\n\t\tString runnerOutDir = envController.getRunnerOutDir();\n\t\tFile jarFile = new File(jarFilePath + \"/\" + jarFileName);\n\t\tjarFile.createNewFile();\n\t\tFileUtils.copyFile(jarFile.getAbsolutePath(), runnerOutDir + \"/runnerout/testsProject/lib/\" + jarFileName);\n\t\tjsystem.launch();\n\t\tScenarioUtils.createAndCleanScenario(jsystem, jsystem.getCurrentScenario());\n\t\tString txt = jsystem.openJarList();\n\t\treport.report(txt);\n\t\tFile fileToDelete = new File(runnerOutDir + \"/runnerout/testsProject/lib/\" + jarFileName);\n\t\tfileToDelete.delete();\n\t\tvalidateJarList(txt, 4);\n\t}", "private void create(String[] dependencies) throws ThinklabClientException {\r\n \t\tif (dependencies == null) {\r\n \t\t\tString dps = Configuration.getProperties().getProperty(\r\n \t\t\t\t\t\"default.project.dependencies\",\r\n \t\t\t\t\t\"org.integratedmodelling.thinklab.core\");\r\n \t\t\t\r\n \t\t\tdependencies = dps.split(\",\");\r\n \t\t}\r\n \t\t\r\n \t\tFile plugdir = Configuration.getProjectDirectory(_id);\r\n \t\tcreateManifest(plugdir, dependencies);\r\n \t\t\r\n \t}", "public static String run(Compilation compilation) throws Exception {\n\t\tfor (String code : compilation.jFiles) {\n\t\t\tClassFile classFile = new ClassFile();\n\t\t\tclassFile.getClassName();\n\t\t\tclassFile.readJasmin(new StringReader(code), \"\", false);\n\t\t\tPath outputPath = tempDir.resolve(classFile.getClassName() + \".class\");\n\t\t\ttry (OutputStream output = Files.newOutputStream(outputPath)) {\n\t\t\t\tclassFile.write(output);\n\t\t\t}\n\t\t}\n\n\t\treturn runJavaClass(tempDir, JasminTemplate.MAIN_CLASS_NAME);\n\t}", "private void serializeComponents(\r\n final WorkspaceComponentSerializer serializer,\r\n final ArchiveContents archive, final ZipOutputStream zipStream)\r\n throws IOException {\r\n\r\n for (WorkspaceComponent component : workspace.getComponentList()) {\r\n\r\n ArchiveContents.ArchivedComponent archiveComp = archive\r\n .addComponent(component);\r\n\r\n ZipEntry entry = new ZipEntry(archiveComp.getUri());\r\n zipStream.putNextEntry(entry);\r\n serializer.serializeComponent(component);\r\n\r\n GuiComponent<?> desktopComponent = SimbrainDesktop.getDesktop(\r\n workspace).getDesktopComponent(component);\r\n\r\n /*\r\n * If there is a desktop component associated with the component\r\n * it's serialized here.\r\n */\r\n if (desktopComponent != null) {\r\n ArchiveContents.ArchivedComponent.ArchivedDesktopComponent dc = archiveComp\r\n .addDesktopComponent(desktopComponent);\r\n entry = new ZipEntry(dc.getUri());\r\n zipStream.putNextEntry(entry);\r\n desktopComponent.save(zipStream);\r\n }\r\n }\r\n }", "public void run() throws Exception {\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tStandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n\t\tPath tempFolder = Files.createTempDirectory(\"gwt-jackson-apt-tmp\", new FileAttribute[0]);\n\t\tfileManager.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tfileManager.setLocation(StandardLocation.SOURCE_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tCompilationTask task = compiler.getTask(\n\t\t\t\tnew PrintWriter(System.out), \n\t\t\t\tfileManager, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tfileManager.getJavaFileObjects(\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicTest.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseInterface.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass2.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SimpleGenericBeanObject.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicGenericClass.java\")));\n\n\n\t\ttask.setProcessors(Arrays.asList(new ObjectMapperProcessor()));\n\t\ttask.call();\n\t}", "TestContainer createTestContainer();", "default void buildMainBuildModules() {\n var main = bach().project().spaces().main();\n var modules = main.declarations();\n if (modules.isEmpty()) {\n log(\"Main module list is empty, nothing to build here.\");\n return;\n }\n var s = modules.size() == 1 ? \"\" : \"s\";\n say(\"Build %d main module%s: %s\", modules.size(), s, modules.toNames(\", \"));\n\n var release = main.release();\n var feature = release != 0 ? release : Runtime.version().feature();\n var classes = bach().folders().workspace(\"classes-main-\" + feature);\n\n var workspaceModules = bach().folders().workspace(\"modules\");\n Paths.deleteDirectories(workspaceModules);\n if (feature == 8) {\n bach().run(buildMainJavac(9, classes)).requireSuccessful();\n buildMainSpaceClassesForJava8(classes);\n } else {\n bach().run(buildMainJavac(release, classes)).requireSuccessful();\n }\n\n Paths.createDirectories(workspaceModules);\n var jars = new ArrayList<Jar>();\n var javacs = new ArrayList<Javac>();\n for (var declaration : modules.map().values()) {\n for (var folder : declaration.sources().list()) {\n if (!folder.isTargeted()) continue;\n javacs.add(buildMainJavac(declaration, folder, classes));\n }\n jars.add(buildMainJar(declaration, classes));\n }\n if (!javacs.isEmpty()) bach().run(javacs.stream()).requireSuccessful();\n bach().run(jars.stream()).requireSuccessful();\n }", "@Test\n @Deployment(resources = ApprovalProcess.RESOURCE)\n public void should_deploy() {\n }", "private DeploymentFactoryInstaller() {\n }", "private void scanJarArchive() throws AnalyzerException {\n\t\tJarFile jarFile;\n\t\ttry {\n\t\t\tjarFile = new JarFile(archive);\n\t\t} catch (IOException ioe) {\n\t\t\tthrow new AnalyzerException(\"Cannot build jar file on archive '\"\n\t\t\t\t\t+ archive + \"'.\", ioe);\n\t\t}\n\t\tEnumeration<? extends ZipEntry> en = jarFile.entries();\n\t\twhile (en.hasMoreElements()) {\n\t\t\tZipEntry e = en.nextElement();\n\t\t\tString name = e.getName();\n\t\t\t// iterate through the jar file\n\t\t\tif (name.toLowerCase().endsWith(\".class\")) {\n\t\t\t\ttry {\n\t\t\t\t\tnew ClassReader(jarFile.getInputStream(e)).accept(\n\t\t\t\t\t\t\tscanVisitor, ClassReader.SKIP_CODE);\n\t\t\t\t} catch (Exception ioe) {\n\t\t\t\t\tthrow new AnalyzerException(\n\t\t\t\t\t\t\t\"Error while analyzing file entry '\" + name\n\t\t\t\t\t\t\t\t\t+ \"' in jar file '\" + archive + \"'\", ioe);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tjarFile.close();\n\t\t} catch (IOException ioe) {\n\t\t\tlogger.warn(\"Error while trying to close the file '\" + jarFile\n\t\t\t\t\t+ \"'\", ioe);\n\t\t}\n\n\t}", "public JSR88Deployer(String uri, String user, String password) {\n this.user = user;\n this.password = password;\n this.uri = uri;\n loadDeploymentFactory();\n loadSystemApps(); //system apps to be filtered\n\n log(\"Connecting using uri = \" + uri + \"; user = \" + user + \"; password = \" + password);\n try {\n dm = DeploymentFactoryManager.getInstance().getDeploymentManager(uri, user, password);\n } catch (Exception ex) {\n ex.printStackTrace();\n System.exit(-1); \n }\n\n Target[] allTargets = dm.getTargets();\n if (allTargets.length == 0) {\n log(\"Can't find deployment targets...\");\n System.exit(-1); \n }\n \n // If test being run on EE, exclude the DAS server instance from the deploy targets\n String targetPlatform = System.getProperty(\"deploymentTarget\");\n List filteredTargets = new ArrayList();\n if( (\"SERVER\".equals(targetPlatform)) || (\"CLUSTER\".equals(targetPlatform)) ) {\n for(int i=0; i<allTargets.length; i++) {\n if(allTargets[i].getName().equals(\"server\")) {\n continue;\n }\n filteredTargets.add(allTargets[i]);\n }\n targets = (Target[])(filteredTargets.toArray(new Target[filteredTargets.size()]));\n } else {\n targets = allTargets;\n }\n\n for(int i=0; i<targets.length; i++) {\n log(\"DBG : Target \" + i + \" -> \" + targets[i].getName());\n }\n }", "public static void zip(BasicShell shell, File archive, List<File> filesToZip) {\n\t\ttry {\n\t\t\tshell.printOut(\"Creating archive '\" + archive.getPath() + \"'.\");\n\t\t\tfinal BufferedOutputStream archiveStream = new BufferedOutputStream(new FileOutputStream(archive));\n\t\t\tZipOutputStream zipStream = new ZipOutputStream(archiveStream);\n\t\t\tzipStream.setLevel(7);\n\t\t\t\n\t\t\tString pwd = shell.pwd().getPath();\n\t\t\tfor ( File file : filesToZip) {\n\t\t\t\tString name = file.getPath();\n\t\t\t\tif (name.equals(pwd)) continue;\n\t\t\t\t\n\t\t\t\tif ( name.startsWith(pwd) ) {\n\t\t\t\t\tname = name.substring(pwd.length()+1);\n\t\t\t\t}\n\t\t\t\tZipEntry entry = new ZipEntry(name);\n\t\t\t\tzipStream.putNextEntry(entry);\n\t\t\t\tif ( file.isFile() ) {\n\t\t\t\t\tBufferedInputStream fileStream = new BufferedInputStream(new FileInputStream(file));\n\t\t\t\t\tbyte[] buffer = new byte[2048];\n\t\t\t\t\tint count = fileStream.read(buffer);\n\t\t\t\t\twhile ( count > -1 ) {\n\t\t\t\t\t\tzipStream.write(buffer, 0, count);\n\t\t\t\t\t\tcount = fileStream.read(buffer);\n\t\t\t\t\t}\n\t\t\t\t\tfileStream.close();\n\t\t\t\t}\n\t\t\t\tshell.printOut(\"File '\" + entry.getName() + \"' added.\");\n\t\t\t}\n\t\t\tzipStream.close();\n\t\t} catch (Exception e) {\n\t\t\tshell.getErrorHandler().handleError(Diagnostic.ERROR, e.getClass().getSimpleName() + \": \"+ e.getMessage());\n\t\t}\n\t}", "public static void main(String[] args) {\r\n\t\tSPECCompressCountingStarter sccs = new SPECCompressCountingStarter();\r\n\t\tsccs.runAll();\r\n\t}", "@Test\n public void testCreateAllAssetsDirectoryWithZeroAssetsDirectories() {\n BuildRuleResolver ruleResolver = new BuildRuleResolver();\n\n // Two android_library deps, neither with an assets directory.\n JavaLibraryRule libraryOne = createAndroidLibraryRule(\n \"//java/src/com/facebook/base:libraryOne\",\n ruleResolver,\n null, /* resDirectory */\n null, /* assetDirectory */\n null /* nativeLibsDirectory */);\n JavaLibraryRule libraryTwo = createAndroidLibraryRule(\n \"//java/src/com/facebook/base:libraryTwo\",\n ruleResolver,\n null, /* resDirectory */\n null, /* assetDirectory */\n null /* nativeLibsDirectory */);\n\n // One android_binary rule that depends on the two android_library rules.\n BuildTarget binaryBuildTarget = BuildTargetFactory.newInstance(\n \"//java/src/com/facebook/base:apk\");\n AndroidBinaryRule androidBinary = ruleResolver.buildAndAddToIndex(\n AndroidBinaryRule.newAndroidBinaryRuleBuilder(new FakeAbstractBuildRuleBuilderParams())\n .setBuildTarget(binaryBuildTarget)\n .addDep(libraryOne.getBuildTarget())\n .addDep(libraryTwo.getBuildTarget())\n .setManifest(\"java/src/com/facebook/base/AndroidManifest.xml\")\n .setTarget(\"Google Inc.:Google APIs:16\")\n .setKeystore(addKeystoreRule(ruleResolver))\n .setPackageType(\"debug\"));\n\n // Build up the parameters needed to invoke createAllAssetsDirectory().\n Set<String> assetsDirectories = ImmutableSet.of();\n ImmutableList.Builder<Step> commands = ImmutableList.builder();\n DirectoryTraverser traverser = new DirectoryTraverser() {\n @Override\n public void traverse(DirectoryTraversal traversal) {\n throw new RuntimeException(\"Unexpected: no assets directories to traverse!\");\n }\n };\n\n // Invoke createAllAssetsDirectory(), the method under test.\n Optional<String> allAssetsDirectory = androidBinary.createAllAssetsDirectory(\n assetsDirectories, ImmutableMap.<String, File>of(), commands, traverser);\n\n // Verify that no assets/ directory is used.\n assertFalse(\"There should not be an assets/ directory to pass to aapt.\",\n allAssetsDirectory.isPresent());\n assertTrue(\"There should not be any commands to build up an assets/ directory.\",\n commands.build().isEmpty());\n }", "void publishPlugin(byte[] jarFile);", "protected abstract void generatePackageFiles(ClassTree classtree) throws Exception;", "public void testARCHIVECHECK() throws ZipException, IOException {\n // REPAIR\n // ZipMeVariables.getSINGLETON().setARCHIVECHECK___(false);\n\t Configuration.ARCHIVECHECK=true;\n if(Configuration.ARCHIVECHECK) {\n FileInputStream zipFile = new FileInputStream(new File(homeDir\n + \"/files/file.gz\"));\n ZipArchive zipArchive = new ZipArchive(zipFile);\n\n // checkZipArchive() checks if the file is valid\n // ZipArchive calls hook1() that calls checkZipArchive()\n // If the test reaches this point with ARCHIVECHECK disabled and\n // an invalid file, the size() will return 0;\n assertFalse(zipArchive.size() > 0);\n }\n }", "@Test\r\n\tpublic void testBundler1() throws ArchiveException, IOException {\r\n\t\r\n\t\t// Build the path to the output file\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tsb.append(ArchiveTest._tempDir);\r\n\t\tsb.append(File.separator);\r\n\t\tsb.append(this._archiveFilename1);\r\n\t\tthis._archiveFilename1 = sb.toString();\r\n\t\t\r\n\t\tArchiveFactory factory = ArchiveFactory.getFactory();\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tBundlerI bundler = factory.getInstance(ArchiveType.BZIP2);\r\n\t\t\tbundler.bundle(ArchiveTest._dirToArchive, this._archiveFilename1);\r\n\t\t\tFile archive = new File(bundler.getArchiveName());\r\n\t\t\tSystem.out.println(bundler.getArchiveName());\r\n\t\t\tassertTrue(archive.exists());\r\n\t\t\tdouble bytes = archive.length();\r\n\t\t\tSystem.out.println(bytes);\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (UnknownArchiveTypeException uae) {\r\n\t\t\t// We *should* never get this exception\r\n\t\t\tuae.printStackTrace();\r\n\t\t}\r\n\t}", "public void execute()\n throws MojoExecutionException\n {\n this.checkOperatingSystem();\n\n final File folderApp =\n new File( this.data.getTargetDirectory(), this.data.getAppName() + \"-\" + this.data.getAppVersion() + \".app\" );\n final File folderContents = new File( folderApp, \"Contents\" );\n final File folderMacOS = new File( folderContents, \"MacOS\" );\n final File folderResources = new File( folderContents, \"Resources\" );\n final File folderJava = new File( folderResources, \"Java\" );\n\n final File targetJavaAppStub = new File( folderMacOS, JAVA_APP_STUB.getName() );\n final File targetInfoPlistFile = new File( folderContents, FILENAME_PLIST_INFO );\n final File targetVersionPlistFile = new File( folderContents, FILENAME_PLIST_VERSION );\n\n if ( folderApp.exists() == true )\n {\n try\n {\n this.logger.info( \"Deleting already existing application folder at '\" + folderApp.getName() + \"' ...\" );\n PtFileUtil.deleteDirectoryRecursive( folderApp );\n }\n catch ( PtException e )\n {\n throw new MojoExecutionException( \"Could not delete directory '\" + folderApp.getAbsolutePath() + \"'!\" );\n }\n }\n\n makeFolders( folderApp );\n makeFolders( folderContents );\n makeFolders( folderMacOS );\n makeFolders( folderResources );\n makeFolders( folderJava );\n\n final String jarWithDependsFileName =\n this.data.getAppName() + \"-\" + this.data.getAppVersion() + \"-\" + \"jar-with-dependencies.jar\";\n final File jarWithDependsSource = new File( this.data.getTargetDirectory(), jarWithDependsFileName );\n\n if ( jarWithDependsSource.exists() == false )\n {\n throw new MojoExecutionException(\n \"Jar with dependencies file not existing (try 'mvn assembly:assembly') at: \"\n + jarWithDependsSource.getAbsolutePath() );\n }\n\n if ( this.data.isPlistInfoParamsSet() == true )\n {\n\n final String mainClassFqn = this.data.getPlistInfoParams( PlistInfoParam.MAIN_CLASS );\n this.checkJarWithDependsMainClass( jarWithDependsSource, mainClassFqn );\n\n }\n else\n {\n this.logger.debug( \"Could not check MainClass existence.\" );\n // TODO if Info.plist file is given directly, check for file\n // existence,\n // then parse it (validate!) and retrieve MainClass attribute to\n // check jar with dependencies\n }\n\n this.executeCopyFiles( folderResources, folderJava, targetJavaAppStub, jarWithDependsSource );\n this.executePlistFiles( jarWithDependsFileName, targetInfoPlistFile, targetVersionPlistFile );\n this.executeShellCommands( folderApp, targetJavaAppStub );\n\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n displayInventoryTest();\n updateInventoryTest();\n getItemTest();\n }", "public void testTargetAwareDeployment() {\n final java.io.File appArchive = \n new java.io.File(APPLICATION);\n printAllDeployedComponents();\n //deployApplication(appArchive,getTargets());\n printAllDeployedComponents();\n //checkDeploymentPassed(\"stateless-simple\", getTargets());\n //undeployApplication(appArchive, getTargets());\n }", "public void execute() throws MojoExecutionException, MojoFailureException {\n\n File target = new File(getDistfolder());\n\n // only create the target directoty when it doesn't exist\n // no deletion\n if (!target.exists()) {\n target.mkdir();\n } else {\n getLog().warn(\"Using existing target directory \" + target.getAbsolutePath());\n }\n\n getLog().info(\"Target is \" + target);\n\n String excludes2 = getExcludes();\n\n if (excludes2 == null) {\n excludes2 = \"**/.svn/,**/.cvs/\";\n\n getLog().info(\"Configuration for excludes not set. Defaulting to: \\\"\" + excludes2\n + \"\\\". Excludes are ant-fileset-style.\");\n } else {\n if (excludes2.contains(\"__acl\") || excludes2.contains(\"__properties\")) {\n getLog().warn(\"Your excludes \\\"\" + excludes2\n + \"\\\" contains __acl or __properties. You do not want these to be excluded in order to have permissoins and properties work.\");\n }\n }\n\n try {\n String targetLibPath = getTargetLibPath();\n\n if ((null != targetLibPath) && !\"\".equals(targetLibPath)) {\n File targetLibDir = new File(target, targetLibPath);\n\n if (!targetLibDir.exists()) {\n targetLibDir.mkdirs();\n }\n\n if (!targetLibDir.isDirectory()) {\n throw new MojoExecutionException(\"Could not create targetLibdir: \" + targetLibDir.toString());\n }\n\n File jar = new File(jarFile);\n FileUtils.copyFileToDirectory(jar, targetLibDir);\n }\n\n for (Resource resource : srcResources) {\n File source = new File(resource.getDirectory());\n File currentTarget = null;\n\n if (resource.getTargetPath() != null) {\n currentTarget = new File(target, resource.getTargetPath());\n } else {\n currentTarget = target;\n }\n\n String normalized = source.getAbsolutePath();\n int offsetLength = normalized.length();\n\n getLog().debug(\"Normalzed sourcefolder is \" + normalized + \" (Offset is: \" + offsetLength + \")\");\n\n List<String> results = FileUtils.getFileAndDirectoryNames(source, null, excludes2, true, true, true,\n true);\n\n for (String fileName : results) {\n File file = new File(fileName);\n\n String normalizedParent = new File(file.getParent()).getAbsolutePath();\n\n if (offsetLength > normalizedParent.length()) {\n getLog().info(\"Skipping file (its the sourcefolder or a parent of it): \"\n + file.getAbsolutePath());\n getLog().debug(\"Parent: \" + normalizedParent + \" with length \" + normalizedParent.length());\n\n continue;\n }\n\n String relative = file.getParent();\n relative = relative.substring(offsetLength); // cut the target-dir away\n\n getLog().debug(\"Copy \" + file + \" to \" + currentTarget.getPath() + File.separator + relative);\n\n if (file.isFile()) {\n File parent = new File(currentTarget.getPath() + File.separator + relative);\n\n if (!parent.exists()) {\n // create dir if it does not exist\n parent.mkdirs();\n }\n\n FileUtils.copyFileToDirectory(file, parent);\n } else if (file.isDirectory()) {\n // take care about directories (so that empty dirs get created)\n\n File tocreate = new File(currentTarget.getPath() + File.separator + relative + File.separator\n + file.getName());\n getLog().debug(\"Creating dir\" + tocreate.toString());\n tocreate.mkdirs();\n }\n }\n }\n } catch (IOException ex) {\n throw new MojoExecutionException(\"Could copy file(s) to directory\", ex);\n }\n }", "default void buildMainSpace() throws Exception {\n buildMainBuildModules();\n buildMainCheckModules();\n buildMainGenerateAPIDocumentation();\n buildMainGenerateCustomRuntimeImage();\n }", "@Timeout(10)\n @TestFactory\n public DynamicContainer generateTestsForAllClasses() throws URISyntaxException {\n List<DynamicNode> tests = new ArrayList<>();\n\n if (structureOracleJSON == null) {\n fail(\"The ClassTest test can only run if the structural oracle (test.json) is present. If you do not provide it, delete ClassTest.java!\");\n }\n\n for (int i = 0; i < structureOracleJSON.length(); i++) {\n JSONObject expectedClassJSON = structureOracleJSON.getJSONObject(i);\n JSONObject expectedClassPropertiesJSON = expectedClassJSON.getJSONObject(JSON_PROPERTY_CLASS);\n\n // Only test the classes that have additional properties (except name and package) defined in the structure oracle.\n if (expectedClassPropertiesJSON.has(JSON_PROPERTY_NAME) && expectedClassPropertiesJSON.has(JSON_PROPERTY_PACKAGE) && hasAdditionalProperties(expectedClassPropertiesJSON)) {\n String expectedClassName = expectedClassPropertiesJSON.getString(JSON_PROPERTY_NAME);\n String expectedPackageName = expectedClassPropertiesJSON.getString(JSON_PROPERTY_PACKAGE);\n ExpectedClassStructure expectedClassStructure = new ExpectedClassStructure(expectedClassName, expectedPackageName, expectedClassJSON);\n tests.add(dynamicTest(\"testClass[\" + expectedClassName + \"]\", () -> testClass(expectedClassStructure)));\n }\n }\n if (tests.size() == 0) {\n fail(\"No tests for classes available in the structural oracle (test.json). Either provide attributes information or delete ClassTest.java!\");\n }\n // Using a custom URI here to workaround surefire rendering the JUnit XML without the correct test names.\n return dynamicContainer(getClass().getName(), new URI(getClass().getName()), tests.stream());\n }", "public void doExport(IProgressMonitor monitor) throws ExportException\n\t{\n\t\tSubMonitor subMonitor = SubMonitor.convert(monitor, \"Creating War File\", 20);\n\t\tFile warFile = createNewWarFile();\n\t\tsubMonitor.worked(1);\n\t\tFile tmpWarDir = createTempDir();\n\t\tsubMonitor.worked(1);\n\t\tString appServerDir = exportModel.getServoyApplicationServerDir();\n\t\tsubMonitor.subTask(\"Copy root webapp files\");\n\t\tcopyRootWebappFiles(tmpWarDir, appServerDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Copy beans\");\n\t\tcopyBeans(tmpWarDir, appServerDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Copy plugins\");\n\t\tcopyPlugins(tmpWarDir, appServerDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Copy lafs\");\n\t\tcopyLafs(tmpWarDir, appServerDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Copy all standard libraries\");\n\t\tfinal File targetLibDir = copyStandardLibs(tmpWarDir, appServerDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Copy Drivers\");\n\t\tcopyDrivers(appServerDir, targetLibDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Copy images\");\n\t\tcopyLibImages(tmpWarDir, appServerDir);\n\t\tsubMonitor.worked(1);\n\t\tmoveSlf4j(tmpWarDir, targetLibDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Creating web.xml\");\n\t\tcopyWebXml(tmpWarDir);\n\t\tsubMonitor.worked(1);\n\t\tcreateTomcatContextXML(subMonitor, tmpWarDir);\n\t\tsubMonitor.worked(1);\n\t\taddServoyProperties(tmpWarDir);\n\t\tsubMonitor.worked(1);\n\t\tif (exportModel.isExportActiveSolution())\n\t\t{\n\t\t\tsubMonitor.subTask(\"Copy the active solution\");\n\t\t\tcopyActiveSolution(subMonitor.newChild(2), tmpWarDir);\n\t\t}\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Create properties for default admin page\");\n\t\tcreateAdminProperties(subMonitor, tmpWarDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Copy NGClient components\");\n\t\tcopyComponents(subMonitor, tmpWarDir, targetLibDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Copy exported components\");\n\t\tcopyExportedComponentsPropertyFile(tmpWarDir);\n\t\tsubMonitor.worked(1);\n\t\tsubMonitor.subTask(\"Creating/zipping the WAR file\");\n\t\tzipDirectory(tmpWarDir, warFile);\n\t\tsubMonitor.worked(2);\n\t\tdeleteDirectory(tmpWarDir);\n\t\tsubMonitor.worked(1);\n\t\tmonitor.done();\n\t\treturn;\n\t}", "@Test\n public void testScanFile() throws DatabaseException {\n try (Engine instance = new Engine(getSettings())) {\n instance.addFileTypeAnalyzer(new JarAnalyzer());\n File file = BaseTest.getResourceAsFile(this, \"dwr.jar\");\n Dependency dwr = instance.scanFile(file);\n file = BaseTest.getResourceAsFile(this, \"org.mortbay.jmx.jar\");\n instance.scanFile(file);\n assertEquals(2, instance.getDependencies().length);\n\n file = BaseTest.getResourceAsFile(this, \"dwr.jar\");\n Dependency secondDwr = instance.scanFile(file);\n\n assertEquals(2, instance.getDependencies().length);\n }\n }", "private int run(Iterable<String> args) throws IOException {\n Path outputErrors = null;\n boolean expectFailure = false;\n boolean expectWarnings = false;\n boolean exportTestFunctions = false;\n\n // Compiler flags we want to read.\n Path jsOutputFile = null;\n Path createSourceMap = null;\n\n // Parse flags in an ad-hoc manner.\n List<String> passThroughArgs = new ArrayList<>(1024);\n PeekingIterator<String> iargs = Iterators.peekingIterator(args.iterator());\n while (iargs.hasNext()) {\n String arg = iargs.next();\n switch (arg) {\n case \"--output_errors\":\n outputErrors = Paths.get(iargs.next());\n continue;\n case \"--expect_failure\":\n expectFailure = true;\n continue;\n case \"--expect_warnings\":\n expectWarnings = true;\n continue;\n case \"--export_test_functions\":\n exportTestFunctions = true;\n continue;\n case \"--js_output_file\":\n jsOutputFile = Paths.get(iargs.peek());\n break;\n case \"--create_source_map\":\n createSourceMap = Paths.get(iargs.peek());\n break;\n default:\n break;\n }\n passThroughArgs.add(arg);\n }\n\n // Run the compiler, capturing error messages.\n boolean failed = false;\n Compiler compiler = new Compiler();\n LightweightMessageFormatter errorFormatter = new LightweightMessageFormatter(compiler);\n errorFormatter.setColorize(true);\n JsCheckerErrorManager errorManager = new JsCheckerErrorManager(errorFormatter);\n compiler.setErrorManager(errorManager);\n Runner runner = new Runner(passThroughArgs, compiler, exportTestFunctions);\n if (runner.shouldRunCompiler()) {\n failed |= runner.go() != 0;\n }\n failed |= runner.hasErrors();\n\n // Output error messages based on diagnostic settings.\n if (!expectFailure && !expectWarnings) {\n for (String line : errorManager.stderr) {\n System.err.println(line);\n }\n System.err.flush();\n }\n if (outputErrors != null) {\n Files.write(outputErrors, errorManager.stderr, UTF_8);\n }\n if (failed && expectFailure) {\n // If we don't return nonzero, Bazel expects us to create every output file.\n if (jsOutputFile != null) {\n Files.write(jsOutputFile, EMPTY_BYTE_ARRAY);\n }\n if (createSourceMap != null) {\n Files.write(createSourceMap, EMPTY_BYTE_ARRAY);\n }\n }\n if (!failed && expectFailure) {\n System.err.println(\"ERROR: Expected failure but didn't fail.\");\n }\n return failed == expectFailure ? 0 : 1;\n }", "private void testZipfileOrder(Path out) throws IOException {\n ZipFile outZip = new ZipFile(out.toFile());\n Enumeration<? extends ZipEntry> entries = outZip.entries();\n int index = 0;\n LinkedList<String> entryNames = new LinkedList<>();\n // We expect classes*.dex files first, in order, then the rest of the files, in order.\n while(entries.hasMoreElements()) {\n ZipEntry entry = entries.nextElement();\n if (!entry.getName().startsWith(\"classes\") || !entry.getName().endsWith(\".dex\")) {\n entryNames.add(entry.getName());\n continue;\n }\n if (index == 0) {\n Assert.assertEquals(\"classes.dex\", entry.getName());\n } else {\n Assert.assertEquals(\"classes\" + (index + 1) + \".dex\", entry.getName());\n }\n index++;\n }\n // Everything else should be sorted according to name.\n String[] entriesUnsorted = entryNames.toArray(StringUtils.EMPTY_ARRAY);\n String[] entriesSorted = entryNames.toArray(StringUtils.EMPTY_ARRAY);\n Arrays.sort(entriesSorted);\n Assert.assertArrayEquals(entriesUnsorted, entriesSorted);\n }", "public BazaarTests() {\r\n\t\tsuper();\r\n\t}", "void makeZip(String zipFilePath, String srcFilePaths[],\n\t\t\tMessageDisplay msgDisplay) {\n\t\t...\n\t\tfor (int i = 0; i < srcFilePaths.length; i++) {\n\t\t\tmsgDisplay.showMessage(\"Zipping \"+srcFilePaths[i]);\n\t\t\t//add the file srcFilePaths[i] into the zip file.\n\t\t\t...\n\t\t}\n\t}", "public void testDeployment(ResourceAdapterArchive raa, String name) throws Throwable\n {\n InitialContext context = null;\n log.info(\"///////BeforeDeployment\");\n\n embedded.deploy(raa);\n log.info(\"///////AfterDeployment\");\n context = new InitialContext();\n ContextConnectionFactory cf = (ContextConnectionFactory) context.lookup(pref + name);\n assertNotNull(cf);\n log.info(\"///////ConnectionFactory:\" + cf);\n\n if (context != null)\n {\n try\n {\n context.close();\n }\n catch (NamingException ne)\n {\n // Ignore\n }\n }\n\n embedded.undeploy(raa);\n\n }", "@Test\n public void testGetClientEngineConfig_compressionEnabled() throws Exception {\n List<Boolean> compressionEnabledSettings = Lists.newArrayList(Boolean.TRUE, Boolean.FALSE);\n\n for (Boolean compressionEnabledSetting : compressionEnabledSettings) {\n when(adsLibConfiguration.isCompressionEnabled()).thenReturn(compressionEnabledSetting);\n\n assertNull(\n EngineConfigurationFactoryDefault.OPTION_CLIENT_CONFIG_FILE\n + \" property is unexpectedly set\",\n System.getProperty(EngineConfigurationFactoryDefault.OPTION_CLIENT_CONFIG_FILE));\n\n EngineConfiguration clientEngineConfig = adsAxisConfigFactory.getClientEngineConfig();\n assertNotNull(\"No client engine config returned\", clientEngineConfig);\n\n AxisClient axisClient = new AxisClient(clientEngineConfig);\n\n assertEquals(\n HttpHandler.class, getTransport(axisClient, \"http\").getPivotHandler().getClass());\n\n assertEquals(\n LocalSender.class, getTransport(axisClient, \"local\").getPivotHandler().getClass());\n\n assertEquals(JavaSender.class, getTransport(axisClient, \"java\").getPivotHandler().getClass());\n\n assertTransportConfiguration(\n new AxisServer(adsAxisConfigFactory.getServerEngineConfig()), defaultAxisServer);\n }\n }", "public static void main(String[] args){\r\n List<File> xzQueue = new ArrayList<>();\r\n List<File> unpackQueue = new ArrayList<>();\r\n List<File> packXZQueue = new ArrayList<>();\r\n\r\n for(int i=0; i<args.length; ++i){\r\n if(args[i].equalsIgnoreCase(\"-packxz\")){\r\n if(i+1<args.length){\r\n ++i;\r\n String[] paths = args[i].split(\",\");\r\n for(String s : paths){\r\n packXZQueue.add(new File(s));\r\n }\r\n }\r\n } else if(args[i].equalsIgnoreCase(\"-xz\")){\r\n if(i+1<args.length){\r\n ++i;\r\n String[] paths = args[i].split(\",\");\r\n for(String s : paths){\r\n xzQueue.add(new File(s));\r\n }\r\n }\r\n } else if(args[i].equalsIgnoreCase(\"-pack\")){\r\n if(i+1<args.length){\r\n ++i;\r\n String[] paths = args[i].split(\",\");\r\n for(String s : paths){\r\n unpackQueue.add(new File(s));\r\n }\r\n }\r\n }\r\n }\r\n\r\n for(File f : packXZQueue) unpack(extractXZ(f));\r\n for(File f : xzQueue) extractXZ(f);\r\n for(File f : unpackQueue) unpack(f);\r\n }", "public static Archive openArchive(String archiveResourcePath) throws IOException {\n UUID uuid = UUID.randomUUID();\n\n File srcFile = new File(DwcaTestUtil.class.getResource(archiveResourcePath).getFile());\n File tmpFile = new File(srcFile.getParentFile(), uuid + \".dwca\");\n Files.copy(srcFile.toPath(), tmpFile.toPath());\n\n File dwcaDir = new File(tmpFile.getParent(), uuid.toString());\n if (srcFile.toString().endsWith(\".zip\")) {\n return DwcFiles.fromCompressed(tmpFile.toPath(), dwcaDir.toPath());\n }\n\n return DwcFiles.fromLocation(tmpFile.toPath());\n }", "public static WebArchive baseDeployment(Asset webXml) {\n return baseDeployment(new BeansXml(BeanDiscoveryMode.ALL), webXml);\n }", "@Test\n public void incrementalBuild_treeArtifacts_correctlyProducesNewTree() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n return;\n }\n writeOutputDirRule();\n write(\n \"BUILD\",\n \"load(':output_dir.bzl', 'output_dir')\",\n \"output_dir(\",\n \" name = 'foo',\",\n \" content_map = {'file-1': '1', 'file-2': '2', 'file-3': '3'},\",\n \")\");\n setDownloadToplevel();\n buildTarget(\"//:foo\");\n waitDownloads();\n\n write(\n \"BUILD\",\n \"load(':output_dir.bzl', 'output_dir')\",\n \"output_dir(\",\n \" name = 'foo',\",\n \" content_map = {'file-1': '1', 'file-4': '4'},\",\n \")\");\n restartServer();\n setDownloadToplevel();\n buildTarget(\"//:foo\");\n waitDownloads();\n\n assertValidOutputFile(\"foo/file-1\", \"1\");\n assertValidOutputFile(\"foo/file-4\", \"4\");\n assertOutputDoesNotExist(\"foo/file-2\");\n assertOutputDoesNotExist(\"foo/file-3\");\n }", "public void execute( final Set pRemovable, final Set pDependencies, final Set pRelocateDependencies )\n throws MojoExecutionException \n {\n \t\n for ( Iterator i = pDependencies.iterator(); i.hasNext(); )\n {\n final Artifact dependency = (Artifact) i.next();\n \n final Map variables = new HashMap();\n \n variables.put( \"artifactId\", dependency.getArtifactId() );\n variables.put( \"groupId\", dependency.getGroupId() );\n variables.put( \"version\", dependency.getVersion() );\n \n final String newName = replaceVariables( variables, name ); \n \t \t\n final File inputJar = dependency.getFile();\n final File outputJar = new File( buildDirectory, newName );\n \n try\n {\n \tfinal Jar jar = new Jar( inputJar, false );\n \t\n \tJarUtils.processJars(\n \t\t\tnew Jar[] { jar },\n \t\t\tnew ResourceHandler() {\n \t\t\t\t\n\t\t\t\t\t\t\tpublic void onStartProcessing( JarOutputStream pOutput )\n\t\t\t\t\t\t\t\tthrows IOException\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpublic void onStartJar( Jar pJar, JarOutputStream pOutput )\n\t\t\t\t\t\t\t\tthrows IOException\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpublic InputStream onResource( Jar jar, String oldName, String newName, Version[] versions, InputStream inputStream )\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\tif ( jar != versions[0].getJar() )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// only process the first version of it\n\n\t\t\t\t\t\t\t\t\tgetLog().info( \"Ignoring resource \" + oldName);\n\n\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfinal String clazzName = oldName.replace( '/' , '.' ).substring( 0, oldName.length() - \".class\".length() );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ( pRemovable.contains(new Clazz ( clazzName ) ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ( isInKeepUnusedClassesFromArtifacts( dependency ) )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\treturn inputStream;\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\tif ( isInKeepUnusedClasses( name ) )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\treturn inputStream;\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\treturn null;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn inputStream;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpublic void onStopJar(Jar pJar, JarOutputStream pOutput)\n\t\t\t\t\t\t\t\tthrows IOException\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpublic void onStopProcessing(JarOutputStream pOutput)\n\t\t\t\t\t\t\t\tthrows IOException\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t}\n \t\t\t\t\n \t\t\t},\n \t\t\tnew FileOutputStream( outputJar ),\n \t\t\tnew Console()\n \t\t\t{\n\t\t\t\t\t\t\tpublic void println( String pString )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tgetLog().debug( pString );\n\t\t\t\t\t\t\t} \t\t\n \t\t\t}\n \t\t);\n }\n catch ( ZipException ze )\n {\n getLog().info( \"No references to jar \" + inputJar.getName() + \". You can safely omit that dependency.\" );\n \n if ( outputJar.exists() )\n {\n outputJar.delete();\n }\n continue;\n }\n catch ( Exception e )\n {\n throw new MojoExecutionException( \"Could not create mini jar \" + outputJar, e );\n }\n \n getLog().info( \"Original length of \" + inputJar.getName() + \" was \" + inputJar.length() + \" bytes. \" + \"Was able shrink it to \" + outputJar.getName() + \" at \" + outputJar.length() + \" bytes (\" + (int) ( 100 * outputJar.length() / inputJar.length() ) + \"%)\" );\n }\n }", "private void copyNGClientJar(File file, File targetLibDir) throws IOException\n\t{\n\t\tFile dest = new File(targetLibDir, file.getName());\n\t\tZipInputStream zin = new ZipInputStream(new FileInputStream(file));\n\t\tZipOutputStream zout = new ZipOutputStream(new FileOutputStream(dest));\n\t\tbyte[] buf = new byte[1024];\n\n\t\tZipEntry entry = zin.getNextEntry();\n\t\twhile (entry != null)\n\t\t{\n\t\t\tString name = entry.getName();\n\t\t\tboolean toBeDeleted = false;\n\t\t\tfor (String f : EXCLUDE_FROM_NG_JAR)\n\t\t\t{\n\t\t\t\tif (name.startsWith(f))\n\t\t\t\t{\n\t\t\t\t\ttoBeDeleted = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!toBeDeleted)\n\t\t\t{\n\t\t\t\t// Add ZIP entry to output stream.\n\t\t\t\tzout.putNextEntry(new ZipEntry(name));\n\t\t\t\t// Transfer bytes from the ZIP file to the output file\n\t\t\t\tint len;\n\t\t\t\twhile ((len = zin.read(buf)) > 0)\n\t\t\t\t{\n\t\t\t\t\tzout.write(buf, 0, len);\n\t\t\t\t}\n\t\t\t}\n\t\t\tentry = zin.getNextEntry();\n\t\t}\n\t\t// Close the streams\n\t\tzin.close();\n\t\t// Compress the files\n\t\t// Complete the ZIP file\n\t\tzout.close();\n\t}", "private static void makeJar(String jarPath, String classPath) throws IOException {\n File jarFile = new File(jarPath);\n File parent = jarFile.getParentFile();\n if (parent != null) {\n parent.mkdirs();\n }\n jarFile.createNewFile();\n String newClassPath = classPath.substring(classPath.indexOf(\"tmp/\") + 4);\n FileOutputStream fout = new FileOutputStream(jarFile);\n Manifest manifest = new Manifest();\n manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, \"1.0\");\n JarOutputStream jarOut = new JarOutputStream(fout, manifest);\n jarOut.putNextEntry(new ZipEntry(newClassPath));\n FileInputStream fit = new FileInputStream(classPath);\n BufferedInputStream bis = new BufferedInputStream(fit);\n byte[] buff = new byte[10000];\n int bytesRead;\n while ((bytesRead = bis.read(buff)) != -1) {\n jarOut.write(buff, 0, bytesRead);\n }\n jarOut.closeEntry();\n jarOut.close();\n fout.close();\n }", "public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException {\n return jmxClient.deploy(getDeploymentName(archive),\n ShrinkWrapUtil.toFile(archive, configuration.isDeployExplodedArchive()));\n }" ]
[ "0.71713585", "0.6890433", "0.58845353", "0.5844497", "0.5731896", "0.57016337", "0.57010204", "0.56170714", "0.548788", "0.54430616", "0.5352575", "0.5308061", "0.5288589", "0.52635705", "0.52440965", "0.51558685", "0.49649665", "0.49365065", "0.48962057", "0.4890721", "0.48735568", "0.481398", "0.4764565", "0.46786016", "0.46240583", "0.46196222", "0.46108276", "0.45813334", "0.45445105", "0.45353606", "0.45250294", "0.45132264", "0.44932973", "0.44719914", "0.44652095", "0.44594076", "0.44562602", "0.4425921", "0.44235966", "0.44221675", "0.4420721", "0.44129267", "0.43799096", "0.43775228", "0.43757087", "0.43595585", "0.435925", "0.43193638", "0.43192276", "0.43162847", "0.43119934", "0.43111834", "0.4307768", "0.4298113", "0.42802653", "0.4266985", "0.42504835", "0.42273948", "0.4219949", "0.42181662", "0.42074403", "0.41944167", "0.41887987", "0.41873172", "0.41857675", "0.41792148", "0.41791233", "0.41687867", "0.4161139", "0.41515267", "0.41499236", "0.41482267", "0.4147943", "0.41478658", "0.41431063", "0.41262248", "0.41127872", "0.41104004", "0.4108532", "0.41071433", "0.4101479", "0.40986615", "0.4091453", "0.4081682", "0.40765116", "0.4067441", "0.40588877", "0.40586782", "0.40567774", "0.4051571", "0.40508842", "0.40463352", "0.40435997", "0.40431336", "0.40407768", "0.40320253", "0.40236366", "0.4018355", "0.40165928", "0.40161845" ]
0.663017
2
Register an initial user
@SuppressWarnings("unchecked") @Test @InSequence(3) public void testDuplicateEmail() throws Exception { Customer customer = createCustomerInstance("Jane Doe", "[email protected]", "02125551234"); customerRestService.createCustomer(customer); // Register a different user with the same email Customer anotherCustomer = createCustomerInstance("John Doe", "[email protected]", "02133551234"); try { customerRestService.createCustomer(anotherCustomer); fail("Expected a RestServiceException to be thrown"); } catch (RestServiceException e) { assertEquals("Unexpected response status", Response.Status.CONFLICT, e.getStatus()); assertTrue("Unexecpted error. Should be Unique email violation", e.getCause() instanceof UniqueEmailException); assertEquals("Unexpected response body", 1, e.getReasons().size()); log.info("Duplicate customer register attempt failed with return code " + e.getStatus()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}", "Boolean registerNewUser(User user);", "void registerUser(User newUser);", "private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }", "private void registerUser() {\n\n // Get register name\n EditText mRegisterNameField = (EditText) findViewById(R.id.register_name_field);\n String nickname = mRegisterNameField.getText().toString();\n\n // Get register email\n EditText mRegisterEmailField = (EditText) findViewById(R.id.register_email_field);\n String email = mRegisterEmailField.getText().toString();\n\n // Get register password\n EditText mRegisterPasswordField = (EditText) findViewById(R.id.register_password_field);\n String password = mRegisterPasswordField.getText().toString();\n\n AccountCredentials credentials = new AccountCredentials(email, password);\n credentials.setNickname(nickname);\n\n if (DataHolder.getInstance().isAnonymous()) {\n credentials.setOldUsername(DataHolder.getInstance().getUser().getUsername());\n }\n\n sendRegistrationRequest(credentials);\n }", "User registration(User user);", "public void register() {\n int index = requestFromList(getUserTypes(), true);\n if (index == -1) {\n guestPresenter.returnToMainMenu();\n return;\n }\n UserManager.UserType type;\n if (index == 0) {\n type = UserManager.UserType.ATTENDEE;\n } else if (index == 1) {\n type = UserManager.UserType.ORGANIZER;\n } else {\n type = UserManager.UserType.SPEAKER;\n }\n String name = requestString(\"name\");\n char[] password = requestString(\"password\").toCharArray();\n boolean vip = false;\n if(type == UserManager.UserType.ATTENDEE) {\n vip = requestBoolean(\"vip\");\n }\n List<Object> list = guestManager.register(type, name, password, vip);\n int id = (int)list.get(0);\n updater.addCredentials((byte[])list.get(1), (byte[])list.get(2));\n updater.addUser(id, type, name, vip);\n guestPresenter.printSuccessRegistration(id);\n }", "public Register() {\n user = new User();\n em = EMF.createEntityManager();\n valid = false;\n }", "void registerNewUser(String login, String name, String password, String matchingPassword,\n String email);", "@Override\n\tpublic void regist(User user) {\n\t\tdao.addUser(user);\n\t}", "public abstract User register(User data);", "@Override\n public void registerUser(User user) {\n userDAO.createUser(user);\n }", "String registerUser(User user);", "public void registerUser(User user) throws UserManagementException;", "private void register() {\r\n if (mName.getText().length() == 0) {\r\n mName.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mEmail.getText().length() == 0) {\r\n mEmail.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() == 0) {\r\n mPassword.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() < 6) {\r\n mPassword.setError(\"password must have at least 6 characters\");\r\n return;\r\n }\r\n\r\n\r\n final String email = mEmail.getText().toString();\r\n final String password = mPassword.getText().toString();\r\n final String name = mName.getText().toString();\r\n\r\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if (!task.isSuccessful()) {\r\n Snackbar.make(view.findViewById(R.id.layout), \"sign up error\", Snackbar.LENGTH_SHORT).show();\r\n } else {\r\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\r\n\r\n //Saves the user's info in the database\r\n Map<String, Object> mNewUserMap = new HashMap<>();\r\n mNewUserMap.put(\"email\", email);\r\n mNewUserMap.put(\"name\", name);\r\n\r\n FirebaseDatabase.getInstance().getReference().child(\"users\").child(uid).updateChildren(mNewUserMap);\r\n }\r\n }\r\n });\r\n\r\n }", "private void initUser() {\n\t}", "public void createUser(User user) {\n\n\t}", "private void registerUserOnServer() throws IOException {\r\n\t\tdataSending.sendMessage(Server.REGISTER+\" \"+userName, Long.toString(userModel.ID));\r\n\t}", "public long registerUserProfile(User user);", "void register() {\n if (registerView.getFirstName().length() == 0 || registerView.getLastName().length() == 0 || registerView.getUsername().length() == 0 || registerView.getPassword().length() == 0) {\n IDialog invalidRegistrationDialog\n = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Fields must be non-empty!\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n } else {\n if (userController.registerUser(registerView.getFirstName(), registerView.getLastName(), registerView.getUsername(), registerView.getPassword()) != null) {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.MAIN_MENU));\n } else {\n IDialog invalidRegistrationDialog = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Username is already taken\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n }\n }\n }", "public void registerUser(View view) {\n this.closeKeyboard();\n this.validator.validate();\n if (this.validator.hasNoErrors()) {\n User user = createUser();\n RealmUser registeredUser = registerUserDetails(user);\n //TODO register on server.\n if (registeredUser != null) {\n new MockUserRegistrationService().registerUser(user.getFirstName(), user.getLastName(), user.getEmail(), user.getInsuranceProvider(), user.getInsurancePlan());\n doOnRegistrationSuccess();\n }\n }\n }", "public void setupUser() {\n }", "private void register(UserAuthenticationMessage uaMessage) {\n\t\tinitialize();\n\t\tUser newUser = uaMessage.getUser();\n\t\tHashMap<String, Boolean> dbInfo = DatabaseRequests.registerNewUser(newUser);\n\t\tcreateRegistrationAnswer(dbInfo.get(MIDs.EMAIL_EXISTS), dbInfo.get(MIDs.USER_EXISTS), dbInfo.get(MIDs.AUTHENTICATE));\n\t}", "public void createUser(User user);", "private final static void onRegister(TextField username, TextField email, PasswordField password, PasswordField passwordAgain)\n\t{\n\t\t// TODO no password = passwordAgain check\n\t\t// TODO check if username exists\n\t\t// TODO check if email exists\n\n\t\tint id = ProfileManipulation.getHighestId(\"Profile\", true);\n\t\tProfileManipulation.registerUser(id, username.getText(), email.getText(),\n\t\t\t\tpassword.getText());\n\t\tPartylize.setUsername(username.getText());\n\t\tPartylize.showMainScene();\n\t}", "private void registerUser(){\n mAuth.createUserWithEmailAndPassword(correo, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //mapa de valores\n Map<String, Object> map = new HashMap<>();\n map.put(\"name\",name);\n map.put(\"email\",correo);\n map.put(\"password\",password);\n map.put(\"birthday\",cumple);\n map.put(\"genre\",genre);\n map.put(\"size\",size);\n //obtenemos el id asignado por la firebase\n String id= mAuth.getCurrentUser().getUid();\n //pasamos el mapa de valores\n mDatabase.child(\"Users\").child(id).setValue(map).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task2) {\n //validams que la tarea sea exitosa\n if(task2.isSuccessful()){\n startActivity(new Intent(DatosIniciales.this, MainActivity.class));\n //evitamos que vuelva a la pantalla con finsh cuando ya se ha registrado\n finish();\n }else{\n Toast.makeText(DatosIniciales.this, \"Algo fallo ups!!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }else{\n Toast.makeText(DatosIniciales.this, \"No pudimos completar su registro\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "private void registerUser(final String firstName, final String lastName, final String email, final String password, final String reEnterPassword) {\n\n if (validRegister(firstName, lastName, email, password, reEnterPassword)){\n mSignUpPresenter.registerUser(NetworkUtils.getInstance(this), email, password, firstName, lastName);\n }\n\n }", "public void register(String form /* should be a Form from GUI */){\n String email = \"email\";\n String nome_completo = \"full_name\";\n Date data_nascimento = new Date(1996-10-21);\n String password = getMd5(\"password\");\n String nif = \"nif\";\n String morada = \"morada\";\n String telemovel = \"telemovel\";\n User user = new User(email);\n if (!user.exists()){\n user.setNome_completo(nome_completo);\n user.setData_nascimento(data_nascimento);\n user.setPassword(password);\n user.setNif(nif);\n user.setMorada(morada);\n user.setTelemovel(telemovel);\n user.setAdmin(FALSE);\n //System registers person\n //db.register(user)\n }\n }", "private RegisterUser() {\n\n }", "public void startingLoginRegister(User user){\n connect();\n\n if (user.getEmail() == null){\n login(user);\n }else{\n register(user);\n }\n\n disconnect();\n }", "public void register()\n {\n String n = nameProperty.getValue();\n if (n == null || n.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String p = passwordProperty.getValue();\n if (p == null || p.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String e = emailProperty.getValue();\n if (e == null || e.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String ph = phoneProperty.getValue();\n if (ph == null || ph.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n if (ph.length() != 8)\n {\n throw new IllegalArgumentException(\"Invalid phone number\");\n }\n try\n {\n Integer.parseInt(ph);\n }\n catch (NumberFormatException ex)\n {\n throw new IllegalArgumentException(\"Invalid phone number\", ex);\n }\n String t = titleProperty.getValue();\n if (t == null || t.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String a = authorProperty.getValue();\n if (a == null || a.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String y = yearProperty.getValue();\n if (y == null || y.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n if (y.length() != 4)\n {\n throw new IllegalArgumentException(\"Invalid year\");\n }\n try\n {\n Integer.parseInt(y);\n }\n catch (NumberFormatException ex)\n {\n throw new IllegalArgumentException(\"Invalid year\", ex);\n }\n\n try\n {\n\n model.registerUser(n, p, e, ph, t, a, y);\n\n }\n catch (Exception e1)\n {\n\n e1.printStackTrace();\n }\n\n }", "@Test\n\tpublic void registerUserTest() throws RemoteException, NoSuchAlgorithmException, InvalidKeySpecException, IOException, InvalidKeyException, SignatureException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, UnrecoverableKeyException, KeyStoreException, CertificateException {\n\t\t\n\t\t// Creation of the server\n\t\tPasswordManager pm = new PasswordManager(8080);\n\n\t\t// Normal register\n\t\tString response = pm.registerUser(DatatypeConverter.printBase64Binary(cliPubKey.getEncoded()), \n\t\t\t\tDigitalSignature.getSignature(cliPubKey.getEncoded(),cliPrivKey));\n\n\t\t// Analyse the correctness of the answer\n\t\tAssert.assertNotSame(response, \"Error: Could not validate signature.\");\n\t}", "User register(String firstName, String lastName, String username, String email) throws UserNotFoundException, EmailExistException, UsernameExistsException, MessagingException;", "public void newUser(User user);", "@Override\n\tpublic void register(User user) {\n\t\tuserDao.register(user);\n\t}", "@Override\r\n\tpublic boolean registerSuperUser(String username, String password, String firstName, String lastName) {\n\t\tSuperUser tempSuperUser = new SuperUser(username, password, firstName, lastName);\r\n\t\t\r\n\t\treturn sudao.createSuperUser(tempSuperUser);\r\n\t}", "@Override\n public void performRegister(final String name, final String email, final String gender, final String password){\n\n mAuth.createUserWithEmailAndPassword(email.toLowerCase(),password)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n User user = new User();\n user.setName(name);\n user.setEmail(email.toLowerCase());\n user.setGender(gender);\n user.setPassword(password);\n FirebaseDatabase.getInstance().getReference(\"Users\")\n .child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(context, \"Authentication Success.\",\n Toast.LENGTH_LONG).show();\n view.redirectToLogin();\n } else {\n Toast.makeText(context, \"Authentication Failed.\",\n Toast.LENGTH_LONG).show();\n }\n }\n });\n } else {\n Log.w(TAG, \"createUserWithEmail:failure\", task.getException());\n Toast.makeText(context, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n }", "private void register(String username,String password){\n\n }", "@Override\r\n\tpublic int register(User user) {\n\t\treturn dao.addUser(user);\r\n\t}", "void regist(User user) throws SQLException;", "public void registerUser(User newUser) {\r\n userRepo.save(newUser);\r\n }", "@Override\n public User register(UserRegisterModel model) {\n User newUser = User.builder()\n .password(model.getPassword())\n .username(model.getUsername())\n .dateOfBirth(model.getDateOfBirth())\n .build();\n return userRepository.save(newUser);\n }", "private void register(String username, String password) {\n User u = null;\n try {\n u = userDao.loadByLogin(username, password);\n } catch (Exception ignored) {}\n if (u == null) {\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"tmp_username\", username);\n editor.putString(\"tmp_password\", password);\n editor.commit();\n Intent intent = new Intent(LoginActivity.this, InfoActivity.class);\n startActivity(intent);\n } else {\n try {\n Toast.makeText(getApplicationContext(), \"Register Failed\", Toast.LENGTH_SHORT).show();\n } catch (Exception e) {\n Looper.prepare();\n Toast.makeText(getApplicationContext(), \"Register Failed\", Toast.LENGTH_SHORT).show();\n Looper.loop();\n }\n }\n }", "public static RegisterResult register(RegisterRequest r) {\n\n User new_user = new User(UUID.randomUUID().toString(), r.userName, r.password, r.email,\n r.firstName, r.lastName, r.gender);\n\n RegisterResult result = new RegisterResult();\n\n User test_user = UserDao.getUser(r.userName);\n if (test_user != null && !test_user.userName.equals(\"\"))\n {\n result.message = \"Error: Username already taken by another user\";\n result.success = false;\n return result;\n }\n\n result.authToken = UUID.randomUUID().toString();\n AuthTokenDao.updateToken(r.userName, result.authToken);\n\n Person p = new Person(new_user.personID, r.userName, r.firstName, r.lastName, r.gender);\n PersonDao.addPerson(p);\n\n result.userName = r.userName;\n result.personID = new_user.personID;\n UserDao.addUser(new_user);\n\n // Generate 4 generations of ancestry\n GenerateData.generateGenerations(r.userName, 4);\n\n result.success = true;\n\n return result;\n }", "@Override\n public User register(User user) {\n if (user.getFirstName() == null || user.getFirstName().length() == 0) //first name cannot be empty\n {\n return null;\n }\n if (user.getLastName() == null || user.getLastName().length() == 0) //last name cannot be empty\n {\n return null;\n }\n if (user.getEmail().equals(\"\") && user.getTelephone().equals(\"\")) {\n return null;\n }\n if ((isEmail(user.getEmail()) == false && !user.getEmail().equals(\"\"))\n || (isNumeric(user.getTelephone()) == false && !user.getTelephone().equals(\"\")))//email and telephone need at least one\n {\n return null;\n }\n\n User newuser = new User((new DataClass().getLastUserID() + 1), user.getFirstName(), user.getLastName(),\n user.getEmail(), user.getTelephone(), 0);\n new DataClass().addUser(newuser);\n return newuser;\n }", "public void creatUser(String name, String phone, String email, String password);", "@Override public void registerNewUser(String username, String password)\r\n throws RemoteException, SQLException {\r\n gameListClientModel.registerNewUser(username, password);\r\n }", "void createUser(User newUser, String token) throws AuthenticationException, InvalidUserException, UserAlreadyExistsException;", "@Override\n\tpublic G_User registerUser(G_User d) {\n\t\tif (ValidationUtils.isValid(d)) {\n\t\t\tif (!ValidationUtils.isValid(d.getAvatar())) {\n\t\t\t\td.setAvatar(\"unknown.png\");\n\t\t\t}\n\n\t\t\td.setActive(true);\n\n\t\t\td.setLastlogin(0l);\n\t\t\td.setNumberlogins(0);\n\t\t\treturn uDao.save(d);\n\t\t}\n\t\treturn null;\n\t}", "public void registerUser(RegisterForm form) throws DAOException;", "String registerUserWithGetCurrentSession(User user);", "@Before\n public void initBeforeEach() throws RegistrationFailedException, LoginFailedException {\n\n AuthenticationFacade authenticationFacade = serviceRegistry.getAuthenticationFacade();\n\n RegisterCommand registerCommand = RegisterCommand\n .builder()\n .clearTxtPassword(password)\n .confirmationClearTxtPassword(password)\n .username(username)\n .email(email)\n .build();\n\n authenticationFacade.register(registerCommand);\n\n // Get the id of the user Chau\n\n LoginCommand loginCommand = LoginCommand.builder()\n .clearTxtPassword(password)\n .username(username)\n .build();\n\n currentUserDTO = authenticationFacade.login(loginCommand);\n }", "private void newUser(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\ttry {\n\t\t\tPrintWriter out = res.getWriter();\n\t\t\tString name = req.getParameter(Constants.NAME_USER);\n\t\t\tUserDB.introduceUser(name);\n\t\t\tlong id = UserDB.getUserId(name);\n\t\t\tUsuario u = new Usuario(name, Long.toString(id));\n\t\t\tout.print(gson.toJson(u));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tres.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n\t\t}\n\t}", "private void createUser(final String email, final String password) {\n\n }", "public void Register() {\n Url url = new Url();\n User user = new User(fname.getText().toString(), lname.getText().toString(), username.getText().toString(), password.getText().toString());\n Call<Void> registerUser = url.createInstanceofRetrofit().addNewUser(user);\n registerUser.enqueue(new Callback<Void>() {\n @Override\n public void onResponse(Call<Void> call, Response<Void> response) {\n Toast.makeText(getActivity(), \"User Registered successfully\", Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onFailure(Call<Void> call, Throwable t) {\n Toast.makeText(getActivity(), \"Error\" + t, Toast.LENGTH_SHORT).show();\n }\n });\n }", "@Override\n\tpublic boolean registerUtente(Utente user) {\n\t\tif(!userExists(user)) {\n\t\t\tDB db = getDB();\n\t\t\tMap<Long, UtenteBase> users = db.getTreeMap(\"users\");\n\t\t\tlong hash = (long) user.getUsername().hashCode();\n\t\t\tusers.put(hash, user);\n\t\t\tdb.commit();\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\t\n\t}", "void createUser() throws SQLException {\n String name = regName.getText();\n String birthdate = regAge.getText();\n String username = regUserName.getText();\n String password = regPassword.getText();\n String query = \" insert into users (name, birthdate, username, password)\"\n + \" values (?, ?, ?, ?)\";\n\n DB.registerUser(name, birthdate, username, password, query);\n }", "@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}", "@Before\n\tpublic void initialize() {\n\t\tuser_reg = new UserRegistration();\n\t}", "public void createUser(String email, String password) {\n\n if (!validateForm()) {\n return;\n }\n\n signupBtn.setEnabled(false);\n startLoadAnim(getString(R.string.registering_user));\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n Toast.makeText(LoginActivity.this, R.string.registration_failed, Toast.LENGTH_SHORT).show();\n signupBtn.setEnabled(true);\n stopLoadAnim();\n }\n }\n });\n }", "public ErrorCode regist( String uname, String pass ){\n ErrorCode eCode = userBaseInfoManager.regist( uname, uname + \"nick\", pass );\n if( eCode.isSuccess() ) {\n User user = getUserByName( uname );\n initNewUser( user );\n }\n return eCode;\n }", "public void insertUser() {}", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "public void RegisterUser() {\n try {\n reg = new Registration();\n reg.setFirstName(FName);\n reg.setLastName(LName);\n reg.setCompanyName(CompanyName);\n reg.setEmail(Email);\n reg.setMobile(mobile);\n ValidateRegistration validator = new ValidateRegistration();\n boolean legitmail = validator.validateEmail(reg);\n if ( legitmail == false ) {\n System.out.println(\"Not a legitimate Email\");\n FacesContext c = FacesContext.getCurrentInstance();\n FacesMessage m = new FacesMessage(\"Invalid Email\", \"The email provided is not correct\");\n c.addMessage(null, m);\n } else {\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"mainpage.xhtml\");\n }\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }", "public void userSignup(String email_addr, String user_pw){\n\n String uuid_str = UUID.randomUUID().toString().replaceAll(\"-\", \"\");\n uuid_str = uuid_str.substring(0, 5);\n int uuid = Integer.parseInt(uuid_str);\n UserProfile new_user = new UserProfile(uuid, email_addr, user_pw);\n userDataAccessService.storeUserInfo(new_user.getUser_id(), new_user.getEmail_addr(), new_user.getUser_pw());\n\n }", "@Override\n\tpublic boolean register(UserInfo ui, String password) {\n\t\treturn _uim.insert(ui, password);\n\t}", "public void register(String firstname, String lastname, String username, String email, String password) {\n BasicDBObject query = new BasicDBObject();\n query.put(\"firstname\", firstname);\n query.put(\"lastname\", lastname);\n query.put(\"username\", username);\n query.put(\"email\", email);\n query.put(\"password\", password);\n query.put(\"rights\", 0);\n users.save(query);\n System.out.println(\"### DATABASE: user \" + username + \" registered ... password hash: \" + password);\n }", "Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);", "@Override\n public RegisterBO register(UserRequest userRequest) {\n User user = new User().with(u -> u.email = userRequest.getEmail())\n .with(u -> u.username = userRequest.getEmail())\n .with(u -> u.preferredLanguages.add(new Locale(\"es\", \"CL\")))//TODO: revisar mas adelante\n .with(u -> u.password = userRequest.getPassword())\n .with(u -> u.fullName = userRequest.getFullName());\n if (userRequest.getPhone() != null)\n user.with(u -> u.mobilePhone = userRequest.getPhone().trim());\n\n // Se inicia el registro de usuario y objecto request\n UserRegistration registration = new UserRegistration();\n registration.applicationId = UUID.fromString(aplicationId);\n registration.verified = false;\n\n RegistrationRequest request = new RegistrationRequest(user, registration);\n\n // Uso el objeto ClientResponse para capturar respuesta\n ClientResponse<RegistrationResponse, Errors> response = getFusionAuthClient.register(null, request);\n\n // Traducto respuesta segun exito o error\n return registerTranslate.translate(response);\n }", "public void registerUser(Register reg)\r\n {\n\t Session session = HibernateUtils.getSession();\r\n\t Transaction tx = session.beginTransaction();\r\n\t session.save(reg);\r\n\t tx.commit();\r\n\t session.close();\r\n }", "public User register(User user) {\n\t\tString sql =\"insert into HealthUsers (firstName,lastName,email,gender,password) values(?,?,?,?,?)\";\n\t\tObject args[] = {user.getFirstName(), user.getLastName(),user.getEmail(),user.getGender(),user.getPassword()};\n\t\tjdbcTemplate.update(sql, args);\n\t\treturn login( user.getEmail(), user.getPassword());\n\t}", "@Test\n public void testRegisterUser() throws AuthenticationException, IllegalAccessException {\n facade.registerUser(\"fiske\", \"JuiceIsLoose123/\");\n assertEquals(\"fiske\", facade.getVeryfiedUser(\"fiske\", \"JuiceIsLoose123/\").getUserName(), \"Expects user exist after register\");\n }", "private void registerUser(HttpServletRequest request, HttpServletResponse response){\n String firstName = request.getParameter(\"firstName\");\n String lastName = request.getParameter(\"lastName\");\n String address = request.getParameter(\"address\");\n String email = request.getParameter(\"email\");\n String shipAddress = request.getParameter(\"shipAddress\");\n int role = Integer.parseInt(request.getParameter(\"role\"));\n User user = new User(firstName,lastName,address,email,shipAddress,role);\n userServices.addUser(user);\n try {\n request.getRequestDispatcher(\"/home\").forward(request,response);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void register(User user) {\n\t\tboolean exists = false ;\n\t\tfor ( User currentUser : users )\n\t\t\tif ( currentUser.getId().equals(user.getId()) )\n\t\t\t\texists = true ;\n\t\tif ( !exists ) {\n\t\t\taddUser(user) ;\n\t\t\tSystem.out.println(\"[USER CREATED]\") ;\n\t\t\tSystem.out.println() ;\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"[INVALID ACTION] User Already Exists\") ;\n\t\t\tSystem.out.println() ;\n\t\t}\n\t}", "@RequestMapping(\"/register-user\")\n public ResponseEntity<UserProfileEntity> register(@RequestBody UserProfileEntity payload, HttpServletRequest request) throws ServletException{\n UserProfileEntity user = userProfileService.findByUser(payload.getUsername());\n\n //if null add new user and login\n if (user == null) {\n RoleEntity role = new RoleEntity();\n role.setRole(\"ROLE_USER\");\n\n Set<RoleEntity> roleSet = new HashSet<>();\n roleSet.add(role);\n\n UserProfileEntity userToAdd = new UserProfileEntity();\n userToAdd.setEnabled(true);\n userToAdd.setUsername(payload.getUsername());\n userToAdd.setPassword(payload.getPassword());\n userToAdd.setRoles(roleSet);\n\n userProfileService.save(userToAdd);\n\n request.login(userToAdd.getUsername(), userToAdd.getPassword());\n\n return new ResponseEntity<UserProfileEntity>(userToAdd, HttpStatus.CREATED);\n\n } else {\n return new ResponseEntity<UserProfileEntity>(HttpStatus.CONFLICT);\n }\n\n }", "public RegisterUserBean() {\n this.account.setGender(Boolean.TRUE);\n this.roleID = 5;\n }", "User createUser();", "public String regist(User user) {\n\t\t\n\t\tuser.setId(UUIDUtils.getNumUUID());\n\t\tuserMapper.insertSelective(user);\n\t\t\n\t\treturn \"success\";\n\t}", "@Override\n\tpublic void registerUser(SpaceUserVO spaceUserVO) throws Exception {\n\t\t\n\t}", "public void onCreationEvent(UserCreateEvent event){\n user = new UserBean(event.getUser());\n }", "private void registerUserToFirebaseAuth() {\n Utils.showProgressDialog(this);\n Task<AuthResult> task = mAuth.createUserWithEmailAndPassword(etEmail.getText().toString().trim(), etPassword.getText().toString().trim());\n task.addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Utils.dismissProgressDialog();\n if (task.isSuccessful()) {\n String firebaseId = task.getResult().getUser().getUid();\n\n // Storage Image to Firebase Storage.\n addProfileImageToFirebaseStorage(firebaseId);\n\n } else {\n Utils.toast(context, \"Some Error Occurs\");\n }\n }\n });\n }", "void addUser(String uid, String firstname, String lastname, String pseudo);", "public void registerUser(String email, String password){\n fbAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"createUserWithEmail:success\");\n FirebaseUser user = fbAuth.getCurrentUser();\n updateUI(user);\n Toast.makeText(Signup.this, \"Registration success.\",\n Toast.LENGTH_SHORT).show();\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"createUserWithEmail:failure\", task.getException());\n Toast.makeText(Signup.this, \"Registration failed.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }", "public String registration() {\n if (name != null) {\n int createdUsers = DBUtils.addUser(name, password, email);\n if (createdUsers > 0) {\n try {\n HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n request.login(name, password);\n initUser();\n request.getSession().setAttribute(\"current_user\", this);\n } catch (ServletException e) {\n FacesContext context = FacesContext.getCurrentInstance();\n FacesMessage message = new FacesMessage(\"Wrong login or password\");\n message.setSeverity(FacesMessage.SEVERITY_ERROR);\n context.addMessage(\"login\", message);\n }\n return \"/index?faces-redirect=true\";\n }\n }\n return \"/pages/register.xhtml?faces-redirect=true\";\n }", "private void registerUser(final String email, final String password) {\n\n progressDialog.show();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, dismiss dialog and start register activity\n progressDialog.dismiss();\n FirebaseUser user = mAuth.getCurrentUser();\n\n String email = user.getEmail();\n String uid = user.getUid();\n String username = mUserNameEdt.getText().toString().trim();\n int selectedId = radioGroup.getCheckedRadioButtonId();\n RadioButton radioSexButton = findViewById(selectedId);\n String gender = radioSexButton.getText().toString();\n\n //store the registered user info into firebase using Hashmap\n HashMap<Object, String> hashMap = new HashMap<>();\n\n hashMap.put(\"email\",email);\n hashMap.put(\"uid\",uid);\n hashMap.put(\"username\", username);\n hashMap.put(\"gender\", gender);\n\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference reference = database.getReference();\n\n reference.child(uid).setValue(hashMap);\n\n Toast.makeText(SignUpActivity.this, \"Registered...\\n\"+user.getEmail(), Toast.LENGTH_SHORT).show();\n startActivity(new Intent(SignUpActivity.this,UserProfileActivity.class));\n finish();\n\n } else {\n // If sign in fails, display a message to the user.\n progressDialog.dismiss();\n Toast.makeText(SignUpActivity.this, \"Authentication failed.\", Toast.LENGTH_SHORT).show();\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n //error, dismiss progress error, get and show the error message\n progressDialog.dismiss();\n Toast.makeText(SignUpActivity.this,\"\"+e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }", "protected abstract void registerUser(Map<String, String> registrationInfo);", "private void signUpNewUserToDB(){\n dbAuthentication.createUserWithEmailAndPassword(this.newUser.getEmail(), this.newUser.getPassword())\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n /**signUp success, will update realTime DB ant firebase Authentication*/\n FirebaseUser currentUser = dbAuthentication.getCurrentUser();\n addToRealDB(currentUser.getUid());\n /**will send verification email to the user from Firebase Authentication*/\n currentUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n }\n });\n }else{isBadEmail = true;}\n }\n });\n }", "private void registerUser(String email, String passwd){\n\n mAuth.createUserWithEmailAndPassword(email, passwd)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n String key = \"\";\n //checking if success\n if(task.isSuccessful()){\n key = task.getResult().getUser().getUid();\n toastMessage(\"seccuss here \"+key);\n String name = \"\";\n String phone = \"\";\n String c = String.valueOf(spinner.getSelectedItem());\n Classe classe = new Classe(c);\n name = nom.getText().toString();\n phone = tel.getText().toString();\n UserInformation U = new UserInformation(name,phone,classe);\n // toastMessage(\"hello uid \"+Useruid);\n myRef.child(\"users\").child(key).setValue(U);\n /* sharedPref = getApplicationContext().getSharedPreferences(Name, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(Key, key);\n editor.apply();*/\n\n }else{\n toastMessage(\"Failed\"); }\n\n\n }\n });\n /*sharedPref = getApplicationContext().getSharedPreferences(Name, MODE_PRIVATE);\n uid = sharedPref.getString(Key, null);\n // toastMessage(\"hello thoast \"+uid);\n return uid ;*/\n }", "void signUpAttempt(String email, String password, String firstName, String lastName);", "@Test\n public void testUserCanBeRegistered() {\n assert username.length() > 3 && username.length() < 16;\n registerUser(username, password);\n assertNotNull(userService.getUser(username));\n }", "private void setUpUser() {\n Bundle extras = getIntent().getExtras();\n mActiveUser = extras.getString(Helper.USER_NAME);\n mUser = mDbHelper.getUser(mActiveUser, true);\n Log.d(TAG, mUser.toString());\n\n if (mUser == null) {\n Toast.makeText(getBaseContext(), \"Error loading user data\", Toast.LENGTH_SHORT);\n return;\n }\n\n mIsNumPassword = Helper.isNumeric(mUser.getPassword());\n\n mKeyController = new KeyController(getApplicationContext(), mUser);\n }", "boolean signUp(User user);", "@GET(Config.REGISTER) Call<User> registerUser(@QueryMap Map<String, String> body);", "private void registerUser(){\r\n String E = Email.getText().toString().trim();\r\n String P = Password.getText().toString().trim();\r\n\r\n //if email is empty then give error\r\n if(E.isEmpty()){\r\n Email.setError(\"Email is required\");\r\n Email.requestFocus();\r\n return;\r\n }\r\n\r\n //if email is not an email format give error\r\n if(!Patterns.EMAIL_ADDRESS.matcher(E).matches()){\r\n Email.setError(\"Please enter a valid email\");\r\n Email.requestFocus();\r\n return;\r\n }\r\n //if password is empty then give error\r\n if(P.isEmpty()){\r\n Password.setError(\"Password is required\");\r\n Password.requestFocus();\r\n return;\r\n }\r\n //if password is less then 6 characters, give error.\r\n if(P.length()< 6){\r\n Password.setError(\"Minimum Password length has to be 6 or more characters\");\r\n Password.requestFocus();\r\n return;\r\n }\r\n //Calls the firebase method to create a new user.\r\n mAuth.createUserWithEmailAndPassword(E, P).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if(task.isSuccessful()){\r\n Toast.makeText(getApplicationContext(),\"User register Sucessfully\",Toast.LENGTH_SHORT).show();\r\n }\r\n }\r\n });\r\n }", "private void createUser(String Address, String Phone_number,String needy) {\n // TODO\n // In real apps this userId should be fetched\n // by implementing firebase auth\n if (TextUtils.isEmpty(userId)) {\n userId = mFirebaseDatabase.push().getKey();\n }\n\n com.glitch.annapurna.needy user = new needy(Address,Phone_number,needy);\n\n mFirebaseDatabase.child(userId).setValue(user);\n\n addUserChangeListener();\n }", "@POST\n @Path(\"register\")\n @Produces(MediaType.APPLICATION_JSON)\n public JAXResult register(UserBE user){\n return null;\n }", "@Override\n\tpublic boolean userRegister(User user) {\n\t\tif(userDao.insertUser(user)<=0)\n\t\t return false;\n\t\telse\n\t\t\treturn true;\n\t}", "public boolean register(String u_Name, String u_pw, String f_name){\n List<User> userList = userDao.getUserFromUsername(u_Name);\n //1.check if userName is used\n if (userList.size() != 0){ \n return false;\n }\n //2.create user and add to the DB\n User user = new User(u_Name, u_pw, f_name);\n userDao.addUser(user);\n //3.return true\n return true;\n }", "private void attemptRegister() {\n\n // Reinicia los errores de los EditText\n mEditEmail.setError(null);\n mEditFirstName.setError(null);\n mEditLastName.setError(null);\n mEditPassword.setError(null);\n mEditPasswordConfirm.setError(null);\n\n // Obtiene los valores ingresados por el usuario\n String email = Utils.checkEditTextForEmpty(getContext(),mEditEmail);\n String firstName = Utils.checkEditTextForEmpty(getContext(),mEditFirstName);\n String lastName = Utils.checkEditTextForEmpty(getContext(),mEditLastName);\n String password = Utils.checkEditTextForEmpty(getContext(),mEditPassword);\n String passwordConfirm = Utils.checkEditTextForEmpty(getContext(),mEditPasswordConfirm);\n\n //Revisa si hay valor vacío\n if (email == null || firstName == null || lastName == null || password == null || passwordConfirm == null) {\n return;\n }\n\n // Valida el correo\n if (!email.contains(\"@\")) {\n mEditEmail.setError(getString(R.string.error_invalid_email));\n mEditEmail.requestFocus();\n return;\n }\n\n // Valida la contraseña\n if (password.length() < 3) {\n mEditPassword.setError(getString(R.string.error_invalid_password));\n mEditPassword.requestFocus();\n return;\n }\n\n //Valida que las contraseñas hagan match\n if (!password.equals(passwordConfirm)) {\n mEditPasswordConfirm.setError(getString(R.string.error_invalid_password_confirmation));\n mEditPasswordConfirm.requestFocus();\n return;\n }\n\n // Intenta crear la cuenta\n Toast.makeText(getContext(), \"Bienvenido\", Toast.LENGTH_LONG).show();\n }", "private void setCreateUser(entity.User value) {\n __getInternalInterface().setFieldValue(CREATEUSER_PROP.get(), value);\n }", "public void registerUser(String username, String password)\n {\n if(!spaceExists.spaceExists(SpaceUtils.getSpace()))\n {\n spaceExists.getSpaceExistsWarning(loginForm,\n \"\");\n }\n // check text fields are not blank\n if(StringUtils.isNotBlank(username) &&\n StringUtils.isNotBlank(password))\n {\n // Check length of password\n if(password.length() >= 6 &&\n password.length() <= 25)\n {\n // check username length\n if(username.length() >= 3 &&\n username.length() <= 20)\n {\n // continue\n String confirmDialogResponse = confirmPassword();\n\n// System.out.println(\"Dialog: \" + confirmDialogResponse);\n// System.out.println(\"Password: \"+password);\n if(password.equals(confirmDialogResponse))\n {\n // passwords match\n // save user to space\n try\n {\n // create new entry\n // encrypt password\n UserEntry user = new UserEntry();\n user.setUsername(username);\n user.setID(UUID.randomUUID());\n user.setSalt(CipherUtils.getSalt(30));\n user.setPassword(\n CipherUtils.generateSecurePassword(\n password, user.getSalt()));\n\n if(user.getSecureUsername().length() > 3)\n {\n // there are at least 3 non-special characters\n // create user\n if(userUtils.createUser(user) != null)\n {\n\n JOptionPane.showMessageDialog(loginForm,\n \"Welcome \" + user.getUsername() + \"!\");\n\n // remove loginForm\n loginForm.setVisible(false);\n loginForm.dispose();\n // Lease is renewed at every login\n userUtils.renewUserLease(user);\n\n // Debug:\n// UserEntry debug = (UserEntry) space.readIfExists(user, null, 3000);\n// System.out.println(\"User: \" + debug.getUsername() +\" Successfully added!\");\n// System.out.println(\"Main Form Created!\");\n\n // Create MainForm\n new MainForm(user);\n }\n else\n {\n // user already exists\n JOptionPane.showMessageDialog(loginForm,\n user.getUsername() + \" is taken.\");\n }\n }\n else\n {\n JOptionPane.showMessageDialog(loginForm,\n \"Username must have at least 3 non-special characters. \");\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n else\n {\n JOptionPane.showMessageDialog(loginForm,\n \"Passwords did not match!\");\n }\n }\n else\n {\n JOptionPane.showMessageDialog(loginForm,\n \"Username must be 3 - 20 characters. \");\n }\n }\n else\n {\n JOptionPane.showMessageDialog(loginForm,\n \"Password must be 6 - 25 characters. \");\n }\n }\n else\n {\n JOptionPane.showMessageDialog(loginForm,\n \"A username and password are required.\");\n }\n }" ]
[ "0.78692836", "0.7506739", "0.74891925", "0.7438242", "0.7378627", "0.7249776", "0.7230874", "0.72092456", "0.7148131", "0.70739675", "0.70463264", "0.69523215", "0.6936487", "0.69267696", "0.6895335", "0.68780243", "0.6850317", "0.6848932", "0.6845927", "0.68211913", "0.67832637", "0.67601585", "0.674004", "0.67374223", "0.6686978", "0.66806835", "0.6678896", "0.6649906", "0.66359955", "0.66324186", "0.6623613", "0.66090184", "0.65933686", "0.6591722", "0.6587824", "0.65866137", "0.6580928", "0.6574516", "0.6573195", "0.65612435", "0.6554699", "0.65464014", "0.6540655", "0.65150017", "0.6513696", "0.6511398", "0.6509483", "0.6501452", "0.6455349", "0.64543766", "0.6453131", "0.645093", "0.644784", "0.6435256", "0.64186287", "0.64038575", "0.6395962", "0.63941014", "0.63810766", "0.6378137", "0.6370659", "0.6354375", "0.63536215", "0.63462013", "0.63423103", "0.6340386", "0.63368475", "0.6332939", "0.63252765", "0.63236153", "0.6306621", "0.6300279", "0.62986785", "0.6297947", "0.6290908", "0.62903136", "0.6284712", "0.62829536", "0.62767214", "0.6272471", "0.626146", "0.6261166", "0.6257476", "0.62535304", "0.6240737", "0.62363553", "0.6235503", "0.62354624", "0.6216973", "0.621644", "0.6213865", "0.6213743", "0.62068933", "0.62062985", "0.62028384", "0.62013125", "0.61986315", "0.61954314", "0.6194545", "0.61879206", "0.6183289" ]
0.0
-1
Creates a new instance of GLEnquiry
public GLEnquiry() { this.setMenuName("Enquiry"); // this.setMenuList(new GLChartOfAccountsAnalysisBalancesMenu()); // this.setMenuList(new GLChartOfAccountsBalancesMenu()); this.setMenuList(new GLTransactionDaySummaryMI()); this.setMenuList(new GLTransactionsDetailMI()); this.setMenuList(new GLTransactionPeriodSummaryMI()); this.setMenuList(new GLTransactionsSummaryMI()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GpflFactoryImpl()\n {\n super();\n }", "public Requisition() {\n\n }", "Geq createGeq();", "public InquiryGrupomuscularRequest()\r\n\t{\r\n\r\n\t}", "public GantBuilder ( ) { }", "NFRSoftgoal createNFRSoftgoal();", "public railway_enquiry() {\n initComponents();\n }", "public GoogleanalyticsFactoryImpl() {\n\t\tsuper();\n\t}", "Gtr createGtr();", "public static QuadricRobustEstimator create() {\n return create(DEFAULT_ROBUST_METHOD);\n }", "public GoogleFluTrendResource() {\n }", "public static Gng init() {\n return new Gng();\n }", "@Nonnull\n public static UBL23WriterBuilder <EnquiryType> enquiry ()\n {\n return UBL23WriterBuilder.create (EnquiryType.class);\n }", "TGG createTGG();", "Leq createLeq();", "public Domicilio() {\n }", "public Facility() {\n }", "public Factory() {\n this(getInternalClient());\n }", "GramaticaFactory getGramaticaFactory();", "public QuestionTF() {}", "public GseqFactoryImpl() {\n\t\tsuper();\n\t}", "public static QuinzicalModel createInstance() throws Exception {\n\t\tif (instance == null) {\n\t\t\tinstance = new QuinzicalModel();\n\t\t}\n\t\treturn instance;\n\t}", "private static synchronized void createInstance() {\r\n\t\tif (instance == null)\r\n\t\t\tinstance = new LOCFacade();\r\n\t}", "public static Factory factory() {\n return ext_dbf::new;\n }", "public static IPCGCallDetailCreator instance()\r\n {\r\n if (instance == null)\r\n {\r\n instance = new IPCGCallDetailCreator();\r\n }\r\n return instance;\r\n }", "public Lanceur() {\n\t}", "public static GpflFactory init()\n {\n try\n {\n GpflFactory theGpflFactory = (GpflFactory)EPackage.Registry.INSTANCE.getEFactory(GpflPackage.eNS_URI);\n if (theGpflFactory != null)\n {\n return theGpflFactory;\n }\n }\n catch (Exception exception)\n {\n EcorePlugin.INSTANCE.log(exception);\n }\n return new GpflFactoryImpl();\n }", "public LyricAnswer() {\n }", "private Gng() {\n }", "public static ExtentReports createInstance() {\n\n\t\tExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(Constants.EXTENTREPORT_PATH+\"---\"+ScreenShot.timeStamp()+\".html\");\n\t\thtmlReporter.config().setTestViewChartLocation(ChartLocation.BOTTOM);\n\t\thtmlReporter.config().setChartVisibilityOnOpen(true);\n\t\thtmlReporter.config().setTheme(Theme.DARK);\n\t\thtmlReporter.config().setReportName(\"Functional Report\");\n\t\thtmlReporter.config().setEncoding(\"utf-8\");\n\t\thtmlReporter.config().setDocumentTitle(\"AutoMation Report\");\n\n\t\thtmlReporter.config().setTimeStampFormat(\"EEEE, MMMM dd, yyyy, hh:mm a '('zzz')'\");\n\n\t\textent = new ExtentReports();\n\t\textent.attachReporter(htmlReporter);\n\t\textent.setSystemInfo(\"OS\", \"Windows\");\n\t\textent.setSystemInfo(\"AUT\", \"QA\");\n\n\t\treturn extent;\n\t}", "public GoogleApiA() {}", "NFRFramework createNFRFramework();", "public OWLAnonymousIndividualHGDB()\r\n\t{\r\n\r\n\t}", "public CorrespondenceFactoryImpl() {\n super();\n }", "public static GFG getInstance() \n { \n if (instance == null) \n { \n // if instance is null, initialize \n instance = new GFG();\n } \n return instance; \n }", "public HGDClient() {\n \n \t}", "public Factory() {\n\t\tsuper();\n\t}", "GlprotoFactory getGlprotoFactory();", "public static GoogleanalyticsFactory init() {\n\t\ttry {\n\t\t\tGoogleanalyticsFactory theGoogleanalyticsFactory = (GoogleanalyticsFactory)EPackage.Registry.INSTANCE.getEFactory(GoogleanalyticsPackage.eNS_URI);\n\t\t\tif (theGoogleanalyticsFactory != null) {\n\t\t\t\treturn theGoogleanalyticsFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new GoogleanalyticsFactoryImpl();\n\t}", "public QueryRegistry() {\r\n }", "public QLearnAgent() {\n\t\tthis(name);\t\n\t}", "public Egrga() {\r\n\t}", "public Investigator() {}", "public GPProblem() {\n\n }", "public static OpenFrgament newInstance() {\n OpenFrgament fragment = new OpenFrgament();\n// Bundle args = new Bundle();\n//\n// fragment.setArguments(args);\n return fragment;\n }", "public MgtFactoryImpl()\n {\n super();\n }", "public static Factory factory() {\n return ext_xspf::new;\n }", "Reproducible newInstance();", "public void createG1(String eq){\n graph1 = false;\n Equation e1 = new Equation(eq);\n q1 = new XYPoints(e1, range);\n createCP(range);\n executeGraphs();\n updateGraph(q1);\n graph1 = true;\n }", "public static FireFighting newInstance() {\n FireFighting fragment = new FireFighting();\n return fragment;\n }", "public QuestionnaireExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public static Builder create() {\n\t\treturn new Builder();\n\t}", "public static Builder create() {\n\t\treturn new Builder();\n\t}", "public Genetic() {\r\n }", "public void create() {\n\t\t\n\t}", "public BugExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public EcoreFactoryImpl()\n {\n super();\n }", "QuestionnaireFactory getQuestionnaireFactory();", "public void create(){}", "public ObjectFactory() {\n super(grammarInfo);\n }", "public REA_EMLFactoryImpl() {\n\t\tsuper();\n\t}", "public GTLServiceTicket() {}", "public EcoreFactoryImpl() {\n super();\n }", "public GermchitExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public XL() {\n Reporter.log(\"New XL ctor\", true);\n }", "public EcoreFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public FareModel() {\n }", "@Override\n\tpublic LightTank create() {\n\t\treturn new LightTank(GameContext.getGameContext());\n\t}", "private static abstract class <init> extends com.google.android.gms.games.hodImpl\n{\n\n public com.google.android.gms.games.quest.Result zzau(Status status)\n {\n return new com.google.android.gms.games.quest.Quests.ClaimMilestoneResult(status) {\n\n final Status zzQs;\n final QuestsImpl.ClaimImpl zzavH;\n\n public Milestone getMilestone()\n {\n return null;\n }\n\n public Quest getQuest()\n {\n return null;\n }\n\n public Status getStatus()\n {\n return zzQs;\n }\n\n \n {\n zzavH = QuestsImpl.ClaimImpl.this;\n zzQs = status;\n super();\n }\n };\n }", "private FireWeaponScreenFactory() {\n\t}", "public static Factory factory() {\n return ext_h::new;\n }", "private LOCFacade() {\r\n\r\n\t}", "public XCanopusFactoryImpl()\r\n {\r\n super();\r\n }", "public Golfer() \n {\n name = \"__\";\n homeCourse = \"__\";\n idNum = 9999;\n this.name = name;\n this.homeCourse = homeCourse;\n this.idNum = idNum;\n final int LENGTH = 20;\n Score[] values = new Score[LENGTH];\n values = this.scores;\n }", "public QuestionDetailExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public static QualificationFragment newInstance() {\n QualificationFragment fragment = new QualificationFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public Libro() {\r\n }", "Instance createInstance();", "public QBXMLRequest() {\n }", "public Purp() {\n }", "protected GEDCOMType() {/* intentionally empty block */}", "private synchronized static void createInstance(){\r\n\t\tif (instance == null){\r\n\t\t\tinstance = new Casino();\r\n\t\t}\r\n\t}", "public Guide create() {\n\t\tfinal Guide res = super.create(Guide.class);\n\n\t\tres.setIncidents(new HashSet<Incident>());\n\t\tres.setExhibitions(new HashSet<Exhibition>());\n\n\t\treturn res;\n\t}", "SpaceInvaderTest_VaisseauAvance_DeplacerVaisseauVersLaGauche createSpaceInvaderTest_VaisseauAvance_DeplacerVaisseauVersLaGauche();", "public God() {}", "public SurveyInstance createSurveyInstance() {\n return new SurveyInstance();\n }", "public TboFlightSearchRequest() {\n}", "public Clade() {}", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "public ChequesRegister() {\n }", "public QLDV() {\n initComponents();\n }", "public QaStep() {\n\t}", "private Geofence createGeofence(LatLng latLng) {\n Log.d(TAG, \"createGeofence\");\n return new Geofence.Builder()\n .setRequestId(GEOFENCE_REQ_ID)\n .setCircularRegion(latLng.latitude, latLng.longitude, AppointmentActivity.GEOFENCE_RADIUS)\n .setExpirationDuration(GEO_DURATION)\n .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER\n | Geofence.GEOFENCE_TRANSITION_EXIT)\n .build();\n }", "public QRFragment() {\n }", "public Household() {\n }", "private static Registrant makeNewRegistrantFromUserInput() {\n\t\tString input_name = getResponseTo(\"Enter registant's first and Last name: \");\r\n\t\tRegistrant new_Registrant = new Registrant(input_name);\r\n\t\treturn new_Registrant;\r\n\t}", "public RDR_RDR() { \r\n this(new DefaultModelClassFactory());\r\n }", "TesttrackFactory getTesttrackFactory();", "public PurchaseExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "@Override\n\tpublic void create () {\n\n\t}" ]
[ "0.61612815", "0.5996081", "0.58458394", "0.582304", "0.57684535", "0.57475543", "0.5659034", "0.56160194", "0.56118834", "0.55166143", "0.54892564", "0.54727715", "0.54699713", "0.54407895", "0.5416347", "0.5413172", "0.5395688", "0.53933614", "0.5376269", "0.5368339", "0.5366286", "0.536551", "0.5363588", "0.5352127", "0.5348936", "0.53393936", "0.5333588", "0.5330785", "0.53300804", "0.5329766", "0.5319052", "0.5305302", "0.53023905", "0.5296279", "0.52938014", "0.5293389", "0.52924395", "0.5272481", "0.52703094", "0.52673703", "0.5256752", "0.5254667", "0.5236369", "0.52301586", "0.5229587", "0.5228446", "0.5220718", "0.5217575", "0.52093065", "0.5207908", "0.5204578", "0.51775676", "0.51775676", "0.5176514", "0.5175016", "0.51686436", "0.5166828", "0.515767", "0.5141419", "0.51404303", "0.51371676", "0.5132703", "0.51322526", "0.5128217", "0.51264", "0.5107519", "0.51043516", "0.5103702", "0.5103148", "0.51001906", "0.5098305", "0.5098107", "0.50956", "0.50946987", "0.5094597", "0.5094533", "0.5093515", "0.5090342", "0.50872344", "0.5079615", "0.50787306", "0.50786364", "0.5078116", "0.507755", "0.50716853", "0.50700366", "0.50696194", "0.50680315", "0.50642115", "0.5059871", "0.5059643", "0.5059102", "0.5058294", "0.50581586", "0.50557923", "0.5051001", "0.50390506", "0.5036814", "0.5036192", "0.5035383" ]
0.6858784
0
Generate a key for the new list
public void addNewList(GroceryList list) { String key = listsRef.push().getKey(); Map<String, Object> postValues = list.toMap(); // TODO: lastUpdated // Set the values listsRef.child(key).setValue(postValues); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public KeyGenerator(SinglyLinkedList wList) {\n generateKey(wList);\n }", "private int genKey()\n {\n return (nameValue.getData() + scopeDefined.getTag()).hashCode();\n }", "String newKey();", "private String createKey(ListPrefix listPrefix, KeyPrefix keyPrefix,\n Plane plane) {\n if (plane != null) {\n return listPrefix + \"-\" + keyPrefix + \"-\" + plane;\n } else {\n return listPrefix + \"-\" + keyPrefix;\n }\n }", "private List<Key> createSequenceKeys(int count) {\n\t\tList<Key> keys = new ArrayList<Key>();\n\t\tdouble id = new Date().getTime();\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tdouble id2 = id + (i / count);\n\t\t\tdouble random = Math.random();\n\t\t\tid2 += random / count;\n\t\t\tlong id3 = (long) (id2 * (1 << 18));\n\t\t\tKey key = Datastore.createKey(UserItemMeta.get(), id3);\n\t\t\tkeys.add(key);\n\t\t}\n\t\treturn keys;\n\t}", "private void rebuildKey() {\r\n\r\n final StringBuffer sb = new StringBuffer();\r\n\r\n sb.append(getClassField().getCanonicalName());\r\n for (final Object k : this.keyPartList) {\r\n sb.append(k.toString()).append('|');\r\n }\r\n this.key = sb.toString();\r\n }", "@Override\n\tpublic String getKey() {\n\t\treturn id+\"\";\n\t}", "protected String generateKey(){\n Random bi= new Random();\n String returnable= \"\";\n for(int i =0;i<20;i++)\n returnable += bi.nextInt(10);\n return returnable;\n }", "public void generateKey(SinglyLinkedList wList) {\n BigInteger wListSum = new BigInteger(\"0\"), qInteger, rInteger;\n int wSumBitLen, qLen;\n Random random;\n SinglyLinkedList bList;//b is the public key list\n\n SinglyNode wListCurrent = wList.getHead();\n while (wListCurrent.getNext() != null) {\n wListCurrent = wListCurrent.getNext();\n wListSum = wListSum.add(new BigInteger((String) wListCurrent.getValue()));\n //wListSum is used to calculate a random q that is bigger than wListSum\n }\n\n wSumBitLen = wListSum.bitLength();\n random = new Random();\n do {\n qInteger = new BigInteger(wSumBitLen, random);\n } while (qInteger.compareTo(wListSum) <= 0);\n\n qLen = qInteger.bitLength();\n do {\n rInteger = new BigInteger(qLen, random);\n } while (Integer.parseInt(rInteger.gcd(qInteger).toString()) != 1);\n\n bList = new SinglyLinkedList();\n wListCurrent = wList.getHead();\n while (wListCurrent.getNext() != null) {\n wListCurrent = wListCurrent.getNext();\n wListSum = wListSum.add(new BigInteger((String) wListCurrent.getValue()));\n\n bList.addObjAtEnd(rInteger.multiply(new BigInteger((String) wListCurrent.getValue())).mod(qInteger) + \"\");\n }\n\n this.publicList = bList;\n this.privateList = new PrivateKey(wList, qInteger, rInteger);\n }", "String key();", "void genKey(){\n Random rand = new Random();\n int key_length = 16;\n String key_alpha = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n StringBuilder sb = new StringBuilder(key_length);\n for(int i = 0; i < key_length; i++){\n int j = rand.nextInt(key_alpha.length());\n char c = key_alpha.charAt(j);\n sb.append(c);\n }\n this.key = sb.toString();\n }", "public void generateKeys(){\n\t\t//Apply permutation P10\n\t\tString keyP10 = permutation(key,TablesPermutation.P10);\n\t\tresults.put(\"P10\", keyP10);\n\t\t//Apply LS-1\n\t\tString ls1L = leftShift(keyP10.substring(0,5),1);\n\t\tString ls1R = leftShift(keyP10.substring(5,10),1);\n\t\tresults.put(\"LS1L\", ls1L);\n\t\tresults.put(\"LS1R\", ls1R);\n\t\t//Apply P8 (K1)\n\t\tk1 = permutation(ls1L+ls1R, TablesPermutation.P8);\n\t\tresults.put(\"K1\", k1);\n\t\t//Apply LS-2\n\t\tString ls2L = leftShift(ls1L,2);\n\t\tString ls2R = leftShift(ls1R,2);\n\t\tresults.put(\"LS2L\", ls2L);\n\t\tresults.put(\"LS2R\", ls2R);\n\t\t//Apply P8 (K2)\n\t\tk2 = permutation(ls2L+ls2R, TablesPermutation.P8);\n\t\tresults.put(\"K2\", k2);\n\t}", "public String createSmartKey(long ... ids);", "public ZoneKey generateZoneKey(final Name name, final List<Record> list) {\n\t\treturn generateZoneKey(name, list, false, false);\n\t}", "BListKey getKey();", "public NodeKey createNodeKey();", "@Override\n\t\tpublic Text createKey() {\n\t\t\treturn null;\n\t\t}", "public KeyGenerator() {\n this.publicList = new SinglyLinkedList();\n this.privateList = new PrivateKey();\n }", "private static String makeDeviceListKey(int device, String deviceAddress) {\n return \"0x\" + Integer.toHexString(device) + \":\" + deviceAddress;\n }", "public String createKey(String type) {\n int i = 0;\n for(i=0; i<EnumFactory.numberOfTypes; i++) {\n if (type.equals(EnumFactory.typeStrings[i])) {\n break;\n }\n }\n countKeys[i]++;\n String key = String.format(\"%s$%d\", EnumFactory.typeStrings[i],countKeys[i]);\n return key;\n }", "@Override\n default String getKey(){\n return key();\n }", "ArrayList<ExportedKeyData> generatePublicKeyList();", "com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest.Key addNewKey();", "public static String generateKey(String key, PageContext pc)\n {\n HttpServletRequest req = (HttpServletRequest)pc.getRequest();\n\n // use the key as the suffix by default\n String suffix = key;\n if (suffix == null) {\n String saved = (String)req.getAttribute(Constants.JSPTAG_COUNTER_KEY);\n\n if (saved == null)\n suffix = \"1\";\n else\n suffix = Integer.toString(Integer.parseInt(saved) + 1);\n\n req.setAttribute(Constants.JSPTAG_COUNTER_KEY, suffix);\n }\n \n // concatenate the servlet path and the suffix to generate key\n return req.getServletPath() + '_' + suffix;\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "private static Key generateKey() {\n return new SecretKeySpec(keyValue, ALGO);\n }", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "@Override\n\tpublic String generaId(String date) {\n\t\tg=new GenerateId();\n\t\treturn g.generateDocumentId(date, \"paymentlist\");\n\t}", "public StringBuilder generateNewKey(int length) {\n\t\tStringBuilder k = new StringBuilder();\n\t\tif (length < 64) {\n\t\t\tlength = 64;\n\t\t}\n\t\tint pv = -1;\n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tint v = pv;\n\t\t\twhile (v == pv) {\n\t\t\t\tv = ZRandomize.getRandomInt(0,99999999);\n\t\t\t}\n\t\t\tk.append(v);\n\t\t\tif (k.length()>=length) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (k.length()>length) {\n\t\t\tk.delete(length,k.length());\n\t\t}\n\t\treturn k;\n\t}", "@Override\n protected void onCreate(KeyList<Ujo> list, InnerDataStore<Ujo> innerData) throws IllegalStateException {\n final Set<String> set = new HashSet<>(list.size());\n for (Key<Ujo,?> key : list) {\n final boolean unique = set.add(key.getName());\n Assert.isTrue(unique, \"The key name is not unique: {}\", key);\n }\n }", "private ArrayList<Integer> generateVoltageLabelKeys() {\r\n\t\t// duct tape workaround. I don't really want to hard-code the values in,\r\n\t\t//(what happens if Jason changes the name of a key in the TelemDataPacket?), \r\n\t\t//but it works for now. If we anticipate changes, we can update this\r\n\t\t//to generate it dynamically. \r\n\t\tArrayList<Integer> keys = new ArrayList();\r\n\t\tkeys.add(0);\r\n\t\tkeys.add(1);\r\n\t\tkeys.add(2);\r\n\t\tkeys.add(3);\r\n\t\treturn keys;\r\n\t}", "NestedListKey getKey();", "private void generateID(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (String t : terms.keySet())\n\t\t\tsb.append(t.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, t.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tfor (String s : sources)\n\t\t\tsb.append(s.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, s.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tsb.deleteCharAt(sb.length()-1);\n\t\tif (yearFrom > -1) sb.append(\"_\" + yearFrom);\n\t\tif (yearTo > -1) sb.append(\"_\" + yearTo);\n\t\tif (useCompounds) sb.append(\"_COMP\");\n\t\tif (useStopwords) sb.append(\"_STOP\");\n\t\tsb.append(\"_CNT\" + contextSize);\n\t\tsb.append(\"_\" + System.currentTimeMillis());\n\t\tthis.id = sb.toString();\n\t}", "@Override\n public String getKey()\n {\n return id; \n }", "public String generateId() {\n return Utils.generateKey();\n }", "private String createKey(OwObject object_p, OwPluginEntry pluginEntry_p) throws Exception\r\n {\r\n String objectId = object_p.getDMSID();\r\n String key = objectId + \"_\" + pluginEntry_p.getIndex();\r\n return key;\r\n }", "@Override\n public String createRecoveryKey() {\n nextRecoveryKey++;\n return Integer.toString(nextRecoveryKey);\n }", "com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest.Key insertNewKey(int i);", "void createPropertyKeyToken( String key, int id );", "@Override public void setKey(IndexKey key) {\n listOfKeys.add(key);\n\n }", "public String getKey() {\n\t\treturn id + \"\";\n\t}", "@Override\n public int key() {\n return this.key;\n }", "private int generateNewId() {\n int size = userListCtrl.getUsers().size();\n \n if (size == 0) {\n return 1;\n } else {\n return userListCtrl.getUsers().get(size-1).getUserID()+1;\n }\n }", "String setKey(String newKey);", "private <TKey extends Comparable<TKey>, TValue> List<TKey> createKeys(List<IKeyValueNode<TKey, TValue>> data) {\n List<TKey> keys = new ArrayList<>();\n\n for (IKeyValueNode<TKey, TValue> node : data) {\n keys.add(node.getKey());\n }\n\n return keys;\n }", "static String makeKey(String id,\n String for_,\n String attrname,\n String attrtype) {\n return format(KEY_FMT, id, for_, attrname, attrtype);\n }", "public void generateID()\n {\n ID = this.hashCode();\n }", "String getLongNameKey();", "public GenerateKey() {\n\t\tsuper(\"generate_key\", org.jooq.example.jaxrs.db.LicenseServer.LICENSE_SERVER, org.jooq.impl.SQLDataType.VARCHAR);\n\n\t\tsetReturnParameter(RETURN_VALUE);\n\t\taddInParameter(LICENSE_DATE);\n\t\taddInParameter(EMAIL);\n\t}", "public abstract String mapItemToKey(String str);", "public String createSmartKey(String userPart, long ... ids);", "@Override\n public String getKey() {\n return key;\n }", "abstract public String getKey();", "private String generateRefKey(int n) {\n String AlphaNumericString = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n + \"0123456789\"\n + \"abcdefghijklmnopqrstuvxyz\";\n\n // create StringBuffer size of AlphaNumericString\n StringBuilder sb = new StringBuilder(n);\n\n for (int i = 0; i < n; i++) {\n\n // generate a random number between\n // 0 to AlphaNumericString variable length\n int index\n = (int)(AlphaNumericString.length()\n * Math.random());\n\n // add Character one by one in end of sb\n sb.append(AlphaNumericString\n .charAt(index));\n }\n\n return sb.toString();\n }", "protected void sequence_ElementList_Key_KeyedElement(ISerializationContext context, Key semanticObject) {\r\n\t\tgenericSequencer.createSequence(context, semanticObject);\r\n\t}", "@Override\n public String generateKey(int round) {\n return this.key.substring(4 * round, 4 * round + 16);\n }", "public static String getKey() {\t\t\n\t\treturn key;\n\t}", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "private synchronized int generateItemID(){\r\n\t\tint i;\r\n\t\tfor(i = 1; items.containsKey(i) || finishedItems.containsKey(i);i++);\r\n\t\treturn i;\r\n\t}", "@Override\n\tpublic String getKey() {\n\t\treturn key;\n\t}", "public java.lang.String getKey(){\n return localKey;\n }", "public String getKey();", "public String getKey();", "public String getKey();", "public String getKey();", "private static int generateMarkerId(){\n return snextMarkerId.incrementAndGet();\n\n }", "protected abstract SingleKeyVersionDataExtractor<DATA> generateDataKeyAsString () ;", "KeyIdPair createKeyIdPair();", "public interface ListWithKeys<T> extends List<T> {\n\t/**\n\t * What is the key field for the given index\n\t * @param index to find the key for\n\t * @return key value for that index\n\t */\n\tString getKey(int index);\n}", "void setKey(int i, int key);", "public String generateKey(long duration) throws Exception;", "@Override\n\tpublic String toString() {\n\t\treturn \"Key, ID: \"+this.id;\n\t}", "@Override\n public String toString(){\n return key;\n }", "public String getRandomKey() {\n return randomKey;\n }", "public static String randomize(char[] list) {\n for (int j = 0; j < list.length; j++) {\n int index = (int) (Math.random() * list.length);\n char temp = list[j];\n list[j] = list[index];\n list[index] = temp;\n }\n String randomKey = \"\";\n for (int x = 0; x < list.length; x++) {\n randomKey += (list[x]);\n } \n return randomKey;\n }", "@Override\n\tpublic Object key() {\n\t\treturn id;\n\t}", "@Override\n public String getNewId()throws DVDLibraryPersistenceException{\n \n int intId = 0;\n for (String key : dvds.keySet()){\n if (Integer.valueOf(key) > intId){\n intId = Integer.valueOf(key);\n }\n }\n return String.valueOf(intId + 1);\n }", "java.lang.String getClientKey();", "QKeyListTerm createKeyListTerm();", "public static String getKey(){\n\t\treturn key;\n\t}", "public String createCacheKey() {\n return \"organization.\" + userEmail;\n }", "public void addKey() {\n setBonusKeys(getBonusKeys() + 1);\n }", "private static Key generateKey() throws NoSuchAlgorithmException {\r\n\t\tif (key == null) {\r\n\t\t\tgenerator = KeyGenerator.getInstance(\"DES\");\r\n\t\t\tgenerator.init(new SecureRandom());\r\n\t\t\tkey = generator.generateKey();\r\n\t\t}\r\n\t\treturn key;\r\n\t}", "public String key() {\n return key;\n }" ]
[ "0.6924966", "0.68250537", "0.68142366", "0.6690118", "0.6618211", "0.6560645", "0.6422024", "0.6369774", "0.6350031", "0.62787515", "0.625755", "0.61643106", "0.60664797", "0.60648525", "0.60615486", "0.60400623", "0.60230297", "0.6005248", "0.5977933", "0.596904", "0.59466255", "0.5941212", "0.59229714", "0.59075475", "0.5895646", "0.5892544", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58877975", "0.58844614", "0.58651507", "0.5861258", "0.5858172", "0.5857662", "0.58425575", "0.5833154", "0.5820199", "0.58194333", "0.58095366", "0.5796083", "0.579469", "0.57877207", "0.578205", "0.5757524", "0.57570344", "0.57532644", "0.57508385", "0.5744605", "0.5743356", "0.57172364", "0.56896263", "0.5689487", "0.56706506", "0.56692034", "0.5667431", "0.56647474", "0.56627434", "0.5656469", "0.5653197", "0.56531286", "0.56531286", "0.56531286", "0.56531286", "0.56531286", "0.56531286", "0.565173", "0.56480074", "0.56357574", "0.5634378", "0.5634378", "0.5634378", "0.5634378", "0.56294143", "0.5622644", "0.5612853", "0.55888546", "0.55875695", "0.5580898", "0.55807793", "0.5575159", "0.5571379", "0.55703324", "0.5560462", "0.55518484", "0.5543357", "0.55397886", "0.553672", "0.5533187", "0.55216306", "0.55201095", "0.5516701" ]
0.0
-1
/ The reason is that the smallest and greater than one factor of a number cannot be more than the sqrt of N. And we stop as soon as we find a factor. For example, if N is 49, the smallest factor is 7. For 15, smallest factor is 3.
public static boolean isPrime(int num){ if(num<=1){ return false; } for(int i=2;i<=(long)Math.sqrt(num) ; i++){ if(num%i==0){ return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int solution1(int N) {\n int numFactors = 0;\n for (int i = 1; i <= (double) Math.sqrt(N); i++) {\n if (N % i == 0) {\n if (i * i != N) {\n numFactors = numFactors + 2;\n } else if (i * i == N) {\n numFactors = numFactors + 1;\n }\n }\n }\n return numFactors;\n }", "public int factoring(int N) {\n\tfor (int i = N-1; i >= 1; i--)\n\t\tif (N % i == 0)\n\t\t\treturn i;\n\treturn 1;\n}", "static double k(int n, final double x) {\n n = Math.abs(n);\n if (n > 31) {\n return Double.POSITIVE_INFINITY; // overflow\n }\n if (x <= 0) {\n return Double.NaN; // domain error or singularity\n }\n if (x <= 9.55) {\n double ans = 0;\n final double z0 = 0.25 * x * x;\n double fn = 1;\n double pn = 0;\n double zmn = 1;\n final double tox = 2 / x;\n double s, t, k;\n\n if (n > 0) {\n // compute factorial of n and psi(n)\n pn = -Constants.EULER;\n k = 1;\n for (int i = 1; i < n; ++i) {\n pn += 1 / k;\n fn *= ++k;\n }\n zmn = tox;\n if (n == 1) {\n ans = 1 / x;\n } else {\n double nk1f = fn / n;\n double kf = 1;\n s = nk1f;\n final double z = -z0;\n double zn = 1;\n for (int i = 1; i < n; ++i) {\n nk1f /= (double) (n - i);\n kf *= (double) i;\n zn *= z;\n t = nk1f * zn / kf;\n s += t;\n if ((Double.MAX_VALUE - Math.abs(t)) < Math.abs(s)) {\n return Double.POSITIVE_INFINITY; // overflow\n }\n if (tox > 1 && Double.MAX_VALUE / tox < zmn) {\n return Double.POSITIVE_INFINITY; // overflow\n }\n zmn *= tox;\n }\n s *= 0.5;\n t = Math.abs(s);\n if (zmn > 1 && Double.MAX_VALUE / zmn < t) {\n return Double.POSITIVE_INFINITY; // overflow\n }\n if (t > 1 && Double.MAX_VALUE / t < zmn) {\n return Double.POSITIVE_INFINITY; // overflow\n }\n ans = s * zmn;\n }\n }\n final double t1g = 2 * Math.log(0.5 * x);\n double pk = -Constants.EULER;\n if (n == 0) {\n pn = pk;\n t = 1;\n } else {\n pn += 1.0 / n;\n t = 1 / fn;\n }\n s = (pk + pn - t1g) * t;\n k = 1;\n do {\n t *= z0 / (k * (k + n));\n pk += 1 / k;\n pn += 1 / (k + n);\n s += (pk + pn - t1g) * t;\n ++k;\n } while (Math.abs(t / s) > Constants.MACHINE_PRECISION);\n s = 0.5 * s / zmn;\n if ((n & 1) != 0) {\n s = -s;\n }\n return ans + s;\n } else {\n // asymptotic expansion\n if (x > MAXLOG) {\n return 0; // underflow\n }\n final double k = (double) n;\n final double pn = 4 * k * k;\n double pk = 1;\n final double z0 = 8 * x;\n double fn = 1;\n double t = 1;\n double s = t;\n double nkf = Double.MAX_VALUE;\n int i = 0;\n do {\n final double z = pn - pk * pk;\n t = t * z / (fn * z0);\n final double nk1f = Math.abs(t);\n if (i >= n && nk1f > nkf) {\n return Math.exp(-x) * Math.sqrt(Math.PI / (2 * x)) * s;\n }\n ++i;\n nkf = nk1f;\n s += t;\n ++fn;\n pk += 2;\n } while (Math.abs(t / s) > Constants.MACHINE_PRECISION);\n return Math.exp(-x) * Math.sqrt(Math.PI / (2 * x)) * s;\n }\n }", "public static void main(String[] args) {\nint N,i,fac=1;\nScanner fn=new Scanner(System.in);\nN =fn.nextInt();\nif(N<=20) {\n\tfor(i=N;i>=1;i--) {\n\t\tfac=fac*i;\n\t}\n}\nSystem.out.println(fac);\n\t}", "public static double sqrt(double num) {\r\n\t\tif (num<0)throw new IllegalArgumentException(\"This method cannot find the square root of a ngeative number.\");\r\n\t\tdouble educatedGuess = num/2;\r\n\t\tfor (int i = 0; i < 5; i++) {\r\n\t\t\teducatedGuess = (num/educatedGuess+educatedGuess)/2;\r\n\t\t}\r\n\t\tint ans = (int) (((educatedGuess+.005)*100)/100);\r\n\t\treturn ans;\r\n\t\t}", "public static void run(){\n //--- --- --- --- --- ---\n //first find the facter of the num\n //second check if the second is a factor of it\n\n System.out.print (\"Please Enter the Base: \");\n int f = Input.input.nextInt ();\n System.out.print (\"Please Enter the Potential Factor: \");\n int p = Input.input.nextInt ();\n\n ArrayList<Integer> primeFactors = new ArrayList<Integer> ();\n while (f % 2 == 0) {\n primeFactors.add ( 2 );\n f /= 2;\n }\n // n must be odd at this point. So we can\n // skip one element (Note i = i +2)\n for (int i = 3; i <= Math.sqrt(f); i += 2) {\n // While i divides n, print i and divide n\n while (f % i == 0) {\n primeFactors.add ( i );\n f /= i;\n }\n }\n // This condition is to handle the case whien\n // n is a prime number greater than 2\n if (f > 2)\n primeFactors.add ( f );\n\n System.out.println ( primeFactors);\n }", "private static int dfs( int n, int level, int min ) {\n\n if (n == 0 || level >= min) return level; //returns only number of perfect squares\n\n for (int i = (int) Math.sqrt(n); i > 0; i--) { //Math.sqrt = same as prime-sieve of prime numbers\n\n min = dfs(n - ((int) Math.pow(i, 2)), level + 1, min);\n\n }\n return min;\n }", "public static void main(String[] args) {\n int product = 1;\n int[] factors = new int[max]; //The position in the array represents the actual factor, the number at that position is the number of occurrences of that factor\n\n for (int i = 2; i < max + 1; i++) { //Checking divisibility by numbers 2-20 inclusive.\n int temp = i;\n for (int j = 2; j < max; j++) { //Checking to see if the number can be represented with current factors in the factors array\n int numOfFactor = factors[j]; //Don't want to change the actual value in the array so we make a copy\n\n while (temp % j == 0 && temp >= j) { //While j, the current factor in the array, is a factor of i and i is smaller than j then divide by j and increment its occurrence in the factors array\n if (numOfFactor > 0) //If j is in the array of factors \"use it\" and decrement the counter for it\n numOfFactor--;\n else //otherwise if the factor doesn't exist in the array add it by incrementing value at the position\n factors[j]++;\n temp /= j; //No matter what, if temp had a factor, it gets smaller\n }\n if (temp < j)\n break; //Don't bother checking the rest of the array since larger numbers can't go into a smaller one...\n }\n }\n\n for (int i = 2; i < max; i++) { //Find the product of all the factors\n if (factors[i] > 0) {\n for (int j = factors[i]; j > 0; j--) { //If there are factors at position j, multiply them!\n product *= i;\n }\n }\n }\n System.out.println(product);\n\n }", "public abstract int getNFactor();", "public String run() {\r\n\t// divisorSum[n] is the sum of all the proper divisors of n\r\n int divisorSum[]= new int[LIMIT+1];\r\n for(int i=1;i<=LIMIT;i++)\r\n {\r\n for(int j=i+i;j<=LIMIT;j+=i)\r\n divisorSum[j]+=i;\r\n }\r\n // Analyze the amicable chain length for each number in ascending order\r\n int maxChainLen=0;\r\n int minChainElem=-1;\r\n for(int i=0;i<=LIMIT;i++){\r\n Set<Integer> visited=new HashSet<>();\r\n for(int count=1,cur=i;;count++){\r\n visited.add(cur);\r\n int next=divisorSum[cur];\r\n if(next==i)\r\n {\r\n if(count>maxChainLen){\r\n minChainElem=i;\r\n maxChainLen=count;\r\n \r\n }\r\n break;\r\n }\r\n // Exceeds limit or not a chain (a rho shape instead)\r\n else if(next>LIMIT || visited.contains(next))\r\n break;\r\n else\r\n cur=next;\r\n }\r\n }\r\n return Integer.toString(minChainElem);\r\n }", "static double squareRoot(double num){\n double epsilon=.01;\n double ans=0;\n double increment=.001;\n int count=0;\n while(Math.abs(ans*ans-num)>epsilon){\n System.out.println(ans);\n ans+=increment;\n }\n if (Math.abs(ans*ans-num)<epsilon){\n System.out.println(\"Found square at count: \"+count+\" It is: \"+ans);\n return ans;\n }\n else {\n System.out.println(\"Failed to find square root\");\n return ans;\n }\n }", "private static int findNextPrimeAfter(int n) {\n n += (n % 2 == 0) ? 1 : 2; // next odd\n foundFactor: for (;; n += 2) { //TODO labels??!!\n int sri = (int) (Math.sqrt(n));\n for (int primeIndex = 0; primeIndex < N_PRIMES; primeIndex++) {\n int p = primes[primeIndex];\n if (p > sri) {\n return n;\n }\n if (n % p == 0) {\n continue foundFactor;\n }\n }\n for (int p = primes[N_PRIMES - 1] + 2;; p += 2) {\n if (p > sri) {\n return n;\n }\n if (n % p == 0) {\n continue foundFactor;\n }\n }\n }\n }", "public static int leastNumberOfPerfectSquares(int n)\n {\n int max = (int)Math.sqrt(n);\n\n int [] dp = new int[n + 1];\n Arrays.fill(dp, Integer.MAX_VALUE);\n\n for(int i = 1; i <= n; ++i)\n {\n for(int j = 1; j <= max; ++j)\n {\n if(i == j * j)\n {\n dp[i] = 1;\n }\n else if( i > j * j)\n {\n dp[i] = Math.min(dp[i], dp[i - j * j] + 1);\n }\n }\n }\n return dp[n];\n }", "private static int getTotient(int n) {\n int result = n;\n for(int i=2; i*i <=n; i++) {\n if(n % i == 0) {\n while(n % i == 0) n /= i;\n result -= result/i;\n }\n }\n if(n > 1) result -= result/n;\n return result;\n }", "private double snrm( int n, double sx[], int itol ) {\n int isamax;\n double ans;\n\n if (itol <= 3) {\n ans = 0.0;\n for( int i = 0; i < n; i++ )\n ans += sx[i] * sx[i];\n return Math.sqrt(ans);\n } else {\n isamax = 0;\n for( int i = 0; i < n; i++ ) {\n if (Math.abs(sx[i]) > Math.abs(sx[isamax]))\n isamax = i;\n }\n return Math.abs(sx[isamax]);\n }\n }", "private static int fact(int n) {\n\t\tint prod = 1;\n\t\tfor (int i = 1; i <= n; prod *= i++)\n\t\t\t;\n\t\treturn prod;\n\t}", "static double root(double x, int n) {\n double err = Double.MAX_VALUE;\n\n double l = 1;\n double r = x;\n\n if (x >= 0 && x <= 1){\n l = x;\n r = 1;\n }\n\n double cur = (l + r)/2;\n\n while (err > OK_ERROR) {\n\n\n double powerNum = Math.pow(cur, n);\n\n err = Math.abs(powerNum - x);\n\n if (powerNum > x) {\n r = cur;\n } else {\n l = cur;\n }\n\n cur = (l + r)/2;\n }\n\n return cur;\n }", "public double findFactorial(double num) \r\n\t{ \r\n\t if (num == 0) \r\n\t return 1; \r\n\t return num * findFactorial(num - 1); \r\n\t}", "private int d(final int n) {\r\n Set<Long> set = new Factors(n).getProperDivisors();\r\n long sum = 0;\r\n for (long i : set) {\r\n sum += i;\r\n }\r\n return (int) sum;\r\n }", "public boolean checkPerfectNumber(int num) {\n //num == 1 is special case.\n if(num == 1) return false;\n int sum = 1;\n for(int i = 2; i <= Math.sqrt(num); i++){\n if(num%i == 0){\n if(i == num/i) sum+=i;\n else sum = sum+i+num/i;\n }\n }\n return sum == num;\n }", "public static BigInteger sqrt(BigInteger n) {\n BigInteger xi = n.divide(primes.get(0));\n for (int i = 0; i < 3; i++) {\n xi = xi.subtract(xi.pow(2).subtract(n).divide(xi.multiply(new\n BigInteger(\"2\"))));\n }\n return (xi.pow(2).compareTo(n) > 0) ? xi : xi.add(ONE);\n }", "private static int countFactors(int number) {\n // number of factors\n int factors = 0;\n\n // count factors\n for (int counter = 1; counter <= Math.sqrt(number); counter++) {\n if (Math.sqrt(number) <= TARGET_FACTORS / HALF) {\n break;\n }\n if (number % counter == 0) {\n factors++;\n }\n }\n\n return factors * MULTIPLIER_TWO;\n }", "public static int factoriel(int n) {\n\t\tif(n <= 1) {\n\t\t\treturn 1;\n\t\t}else {\n\t\t\treturn n * factoriel(n - 1);\n\t\t}\n\t}", "private static void badApproach() {\n\t\t\n\t\tList<Double> result = new ArrayList<>();\n\t\t\n\t\tThreadLocalRandom.current()\n\t\t\t.doubles(10_000).boxed()\n\t\t\t.forEach(\n\t\t\t\t\td -> NewMath.inv(d)\n\t\t\t\t\t\t.ifPresent(\n\t\t\t\t\t\t\tinv -> NewMath.sqrt(inv)\n\t\t\t\t\t\t\t\t.ifPresent(\n\t\t\t\t\t\t\t\t\t\tsqrt -> result.add(sqrt)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\n\t\tSystem.out.println(\"# result = \"+result.size());\n\t\t\n\t}", "public static LinkedList<Integer> allFactors(int n)\n throws IllegalArgumentException\n {\n if (n < 1) throw new IllegalArgumentException(\"Integer < 1: \" + n);\n \n /*\n Cria as listas que retornarao os divisores do argumento n\n */\n LinkedList<Integer> listD = new LinkedList<Integer>();\n LinkedList<Integer> listQ = new LinkedList<Integer>();\n \n int sqrt = (int)Math.sqrt(n);\n \n int d = 1;\n do \n {\n \n listD.add(d);\n int q = n / d;\n if (d != q) listQ.addFirst(q);\n \n do\n {\n d++;\n }while ( ((n % d) != 0) && (d <= sqrt) );\n \n }while (d <= sqrt);\n \n listD.addAll(listQ);\n \n return listD;\n \n }", "public int nthUglyNumber2(int n) {\n Queue<Long> choushu = new PriorityQueue<>();\n if (n == 1)\n return 1;\n choushu.offer((long) 1);\n int[] factor = {2, 3, 5};\n for (int i = 2; i <= n; i++) {\n long num = choushu.poll();\n for (int f : factor) {\n long tmp = f * num;\n if (!choushu.contains(tmp))\n choushu.offer(tmp);\n }\n System.out.println(MessageFormat.format(\"num:{0},list:{1}\", num, printQueue(choushu)));\n }\n return choushu.poll().intValue();\n }", "double factor(int num) {\n\t\tdouble factor = 1.0 / (num/1000.0 + 1.0);\n\t\t//double factor = 0.95 * num / (num + 200) + 0.05;\n\t\treturn factor;\n\t}", "public double sqrt(int n) {\n\t\tif(n<0)\n\t\t\treturn Double.NaN;\n\t\treturn Math.sqrt(n);\n\t}", "public static void solve(int n, List<Integer> a) {\n Collections.sort(a);\n Collections.reverse(a);\n double sum = a.stream().mapToDouble(num -> Double.valueOf(num)).sum();\n double currentN = Double.valueOf(n);\n double currentSum = sum;\n for(Integer next : a)\n {\n double nextDouble = Double.valueOf(next);\n if(nextDouble<=currentSum/currentN)\n {\n break;\n }\n currentSum -= nextDouble;\n currentN--;\n }\n System.out.println(currentSum/currentN);\n\n\n }", "private long largestPrimeFactor(long number)\n\t{\n\t\tfor(int i = 2; i<=number; i++)\n\t\t{\n\t\t\tif(number % i == 0 && number > i)\n\t\t\t{\n\t\t\t\twhile(number % i == 0)\n\t\t\t\t{\n\t\t\t\t\tnumber = number / i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(i >= number)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn 0;\n\t}", "private static int betterSolution(int n) {\n return n*n*n;\n }", "static int fact(int n)\n\n {\n\n int res = 1;\n\n for (int i = 2; i <= n; i++)\n\n res = res * i;\n\n return res;\n\n }", "public int numSquaresII(int n) {\n // build a hashset contains all i from 1 to sqrt(n) which have i^2 <= n\n Set<Integer> set = new HashSet<>();\n for (int i = 1; i * i <= n; i++) {\n set.add(i * i);\n }\n // start from 1 to n, test possible condition\n int count = 1;\n while (count <= n) {\n if (isDivided(n, count, set)) {\n return count;\n }\n count++;\n }\n return count;\n }", "public static void main(String[] args) {\n BigDecimal i;\n BigDecimal factor = new BigDecimal(\"600851475143\");\n \t\t\t\t\t\t\t\t\t\t\t\n /* Start factoring from 2\n * Increase the divisor by 1 -- brute force!!\n * \n */\n\t\t\t\tfor(i= new BigDecimal(\"2\");i.compareTo(factor) <= 0;i=i.add(BigDecimal.ONE)){\n\t\t\t\t\t\n\t\t\t\t\t/* divide the factor by incremental value of i, if the remainder is 0, \n\t\t\t\t\t * the dividend is divisible by the value of divisor\n\t\t\t\t\t */\n\t\t\t\t\tif(factor.remainder(i).intValue()==0) {\n\t\t\t\t\t\t\n System.out.println(\"Factors: \" + i);\n \n /* update the value of factor to the new dividend\n * \n */\n factor = factor.divide(i);\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\t\n }\n\t\t\t\t\n\t\t}", "private static double fact(int n) {\n\t\tdouble sum = 1;\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tsum *= i;\n\t\t}\n\t\treturn sum;\n\t}", "private boolean esPrimo(int n)\r\n {\r\n for (int i = 3; i < (int) Math.sqrt(n); i+=2) {\r\n if (n%i == 0) return false;\r\n }\r\n return true;\r\n }", "public static void highlyDivisibleTriangularNumber(){\n\n int position = 1;\n long triangleNumber;\n Long[] factors;\n do{\n position ++;\n triangleNumber = getTriangleNumber(position);\n factors = getFactors(triangleNumber); \n }while(factors.length <= 500);\n\n System.out.println(triangleNumber);\n}", "private static int findTriangleNumber(int numOfFactors) {\n // value for whether the triangle number is found\n boolean found = false;\n // index used to calculate triangle number\n int index = 1;\n // triangle number\n int triangle_number = 0;\n\n // find triangle number\n while (found == false) {\n triangle_number = index * (index + 1) / HALF;\n if (countFactors(triangle_number) >= numOfFactors) {\n found = true;\n }\n index++;\n }\n\n return triangle_number;\n }", "private int isPerfect(int n)\r\n\t{\r\n\t\tArrayList<Integer> properDivisors = MathPlus.getProperDivisors(n);\r\n\t\t\r\n\t\tint sum = 0;\r\n\t\tfor(int i = 0; i < properDivisors.size(); i++)\r\n\t\t{\r\n\t\t\tsum += properDivisors.get(i);\r\n\t\t}\r\n\t\t\r\n\t\treturn sum - n;\r\n\t}", "public static final int sqrt(int x) \n\t {\n\t int xn;\n\n\t if (x >= 0x10000) {\n\t if (x >= 0x1000000) {\n\t if (x >= 0x10000000) {\n\t if (x >= 0x40000000) {\n\t xn = table[x >> 24] << 8;\n\t } else {\n\t xn = table[x >> 22] << 7;\n\t }\n\t } else {\n\t if (x >= 0x4000000) {\n\t xn = table[x >> 20] << 6;\n\t } else {\n\t xn = table[x >> 18] << 5;\n\t }\n\t }\n\n\t xn = (xn + 1 + (x / xn)) >> 1;\n\t xn = (xn + 1 + (x / xn)) >> 1;\n\t return ((xn * xn) > x) ? --xn : xn;\n\t } else {\n\t if (x >= 0x100000) {\n\t if (x >= 0x400000) {\n\t xn = table[x >> 16] << 4;\n\t } else {\n\t xn = table[x >> 14] << 3;\n\t }\n\t } else {\n\t if (x >= 0x40000) {\n\t xn = table[x >> 12] << 2;\n\t } else {\n\t xn = table[x >> 10] << 1;\n\t }\n\t }\n\n\t xn = (xn + 1 + (x / xn)) >> 1;\n\n\t return ((xn * xn) > x) ? --xn : xn;\n\t }\n\t } else {\n\t if (x >= 0x100) {\n\t if (x >= 0x1000) {\n\t if (x >= 0x4000) {\n\t xn = (table[x >> 8]) + 1;\n\t } else {\n\t xn = (table[x >> 6] >> 1) + 1;\n\t }\n\t } else {\n\t if (x >= 0x400) {\n\t xn = (table[x >> 4] >> 2) + 1;\n\t } else {\n\t xn = (table[x >> 2] >> 3) + 1;\n\t }\n\t }\n\n\t return ((xn * xn) > x) ? --xn : xn;\n\t } else {\n\t if (x >= 0) {\n\t return table[x] >> 4;\n\t }\n\t }\n\t }\n\t \n\t //illegalArgument();\n\t return -1;\n\t }", "public static int getDivisorCount1(int N) {\n int result = 0;\n for (int i = 1; i <= N; i++) {\n if (N % i == 0) result++;\n }\n return result;\n }", "public double sqRoot(double num) {\n double base = 0;\n while (base < num) {\n base++;\n if ((base * base) == num) {\n return base;\n }\n }\n\n double termInSequence = ((base * base) + num) / (2 * base);\n for (int i = 0; i < 10; i++) {\n termInSequence = ((termInSequence * termInSequence) + num) / (2 * termInSequence);\n }\n return Double.parseDouble(String.format(\"%.9f\", termInSequence));\n }", "public static int Main()\n\t{\n\t\tint m;\n\t\tint n;\n\t\tint a;\n\t\tint b;\n\t\tint r;\n\t\tint i;\n\t\tm = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tn = m / 2;\n\t\tfor (a = 3; a <= n; a = a + 2)\n\t\t{\n\t\t\tr = Math.ceil(Math.sqrt(a)); //?a????\n\t\t\tfor (i = 2; i <= r; i++)\n\t\t\t{\n\t\t\t\tif ((a % i) == 0)\n\t\t\t\t{\n\t\t\t\t\tbreak; //??????\n\t\t\t\t}\n\t\t\t}\n\t\t\t\tif (i == r + 1)\n\t\t\t\t{\n\t\t\t\t\tb = m - a;\n\t\t\t\t\tr = Math.ceil(Math.sqrt(b)); //?b????\n\t\t\t\t\tfor (i = 2; i <= r; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((b % i) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak; //??????\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\tif (i == r + 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.print(a);\n\t\t\t\t\t\t\tSystem.out.print(' ');\n\t\t\t\t\t\t\tSystem.out.print(b);\n\t\t\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "private int findDividingFactor(List<EventProducer> groupOfEP) {\n\t\tint dividingFactor = 0;\n\n\t\t// Try the first 10000 integer\n\t\tfor (int i = 1; i <= 10000; i++) {\n\t\t\tif (Math.pow(i, maxHierarchyDepth) > groupOfEP.size()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdividingFactor++;\n\t\t}\n\n\t\t// If we only found 1 as solution try to see if with the value 2, we\n\t\t// can find a working solution with a smaller hierarchy depth (which\n\t\t// means we will not necessarily reach the wanted maxdepth for this\n\t\t// group\n\t\tif (dividingFactor == 1) {\n\t\t\t// Try the first 10000 integer\n\t\t\tfor (int i = maxHierarchyDepth; i > 1; i--) {\n\t\t\t\tif (Math.pow(2, i) < groupOfEP.size()) {\n\t\t\t\t\tdividingFactor = 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn dividingFactor;\n\t}", "private static void dp() {\n\t\tm[0] = 0;\n\t\tk[0] = 0;\n\n\t\t// base case 1:for 1 cent we need give 1 cent\n\t\tm[1] = 1;\n\t\tk[1] = 1;\n\n\t\tfor (int i = 2; i <= n; i++) {\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\tint sel = -1;\n\t\t\tfor (int j = 0; j < sd; j++) {\n\t\t\t\tint a = d[j];\n\t\t\t\tif (a > i) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint v = 1 + m[i - a];\n\t\t\t\tif (v < min) {\n\t\t\t\t\tmin = v;\n\t\t\t\t\tsel = a;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (sel == -1)\n\t\t\t\tthrow new NullPointerException(\"sel != -1\");\n\t\t\tm[i] = min;\n\t\t\tk[i] = sel;\n\t\t}\n\t}", "public static float Q_sqrt(float x) {\n float min = ((x * 2f) * (1f / (x + 1f)));\n float max = (x + 1f) / 2f;\n float guess = 0.5f * max + 0.5f * min;\n\n int n = (int) (x % 5) + DEFAULT_ACCURACY >> 1;\n for (int i = 0; i < n; i++) {\n if (guess * guess > x)\n max = guess;\n else\n min = guess;\n\n guess = 0.5f * max + 0.5f * min;\n }\n return guess;\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n \n boolean[] isNotPrime = new boolean[(N - 1 - 1) / 2 + 1];\n List<Integer> list = new ArrayList<Integer>();\n HashSet<Integer> primes = new HashSet<Integer>();\n \n list.add(2);\n primes.add(2);\n long sum = 0;\n for (int i = 1; i < isNotPrime.length; i++) {\n if (isNotPrime[i]) {\n continue;\n }\n list.add(2 * i + 1);\n primes.add(2 * i + 1);\n long nextIndex = (((long) 2 * i + 1) * (2 * i + 1) - 1) / 2;\n if (nextIndex >= isNotPrime.length) {\n continue;\n }\n for (int j = ((2 * i + 1) * (2 * i + 1) - 1) / 2; j < isNotPrime.length; j += 2 * i + 1) {\n isNotPrime[j] = true;\n }\n }\n int index = 0;\n while (index < list.size()) {\n int curPrime = list.get(index);\n index++;\n if (curPrime < 10) {\n continue;\n }\n int base = 1;\n while (curPrime / base > 9) {\n base *= 10;\n }\n int leftTruncate = curPrime;\n int rightTruncate = curPrime;\n boolean isValid = true;\n while (base != 1) {\n leftTruncate = leftTruncate - leftTruncate / base * base;\n rightTruncate = rightTruncate / 10;\n base /= 10;\n if (primes.contains(leftTruncate) == false || primes.contains(rightTruncate) == false) {\n isValid = false;\n break;\n }\n }\n if (isValid) {\n sum += curPrime;\n }\n }\n System.out.println(sum);\n scanner.close();\n }", "public static void Perfectpower(int n) {\n\t\tlong valuecheck = 0;\n\t\t\n\t\tPriorityQueue<PerfectNumber> pq = new PriorityQueue<>(new Comparator<PerfectNumber>() {\n\t\t\t@Override\n\t\t\tpublic int compare(PerfectNumber o1, PerfectNumber o2) {\n\t\t\t\treturn (int) (o1.value - o2.value);\n\t\t\t}\n\t\t});\n\n\t\t//base condition\n\t\tpq.add(new PerfectNumber(2, 2));\n\t\t\n\t\twhile (!pq.isEmpty()) {\n\t\t\t\n\t\t\tPerfectNumber z = pq.remove();\n\t\t\t\n\t\t\t//return when a^b >n \n\t\t\tif(Math.pow(z.a, z.b)>n){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t//to avoid duplicacy\n\t\t\tif(valuecheck!=z.value){\n\t\t\t\tresult.add(z.value);\n\t\t\t\tvaluecheck = z.value;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// add next elements in priorrity queue\n\t\t\tif (z.a == 2) {\n\t\t\t\tpq.add(new PerfectNumber(2, z.b + 1));\n\t\t\t\tpq.add(new PerfectNumber(3, z.b));\n\n\t\t\t} else {\n\t\t\t\tpq.add(new PerfectNumber(z.a + 1, z.b));\n\t\t\t} \n\t\t}\n\n\t}", "public static int numFactors(int num) {\r\n\t\tassert num >= 2 : \"failed precondition. num must be >= 2. num: \" + num;\r\n\t\tint result = 0;\r\n\t\tfinal double SQRT = Math.sqrt(num);\r\n\t\tfor(int i = 1; i < SQRT; i++) {\r\n\t\t\tif(num % i == 0) {\r\n\t\t\t\tresult += 2;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(num % SQRT == 0)\r\n\t\t\tresult++;\r\n\t\treturn result;\r\n\t}", "private int first_leaf() { return n/2; }", "public int mySqrt(int x) {\n if(x < 2)\n return x;\n\n int tmp = x / 2;\n\n while(x / tmp < tmp) {\n tmp /= 2;\n }\n\n int l = tmp;\n int r = 2 * tmp;\n\n while(l <= r) {\n int mid = l + (r - l) / 2;\n\n tmp = x / mid;\n\n if(mid == tmp)\n return mid;\n\n if(tmp < mid)\n r = mid - 1;\n else\n l = mid + 1;\n }\n\n return r;\n }", "static double bSearchSqrt(double t){\n\t\tdouble l = 0.0, r = t, res = -1.0;\n\t\twhile(Math.abs(r - l) > 1e-7){ //guaranteed 6 \"good\" digits\n\t\t\tdouble m = l + (r - l) / 2.0;\n\t\t\tif(m * m <= t){\n\t\t\t\tl = m;\n\t\t\t\tres = m;\n\t\t\t}else{\n\t\t\t\tr = m;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "public int mySqrt(int x) {\n int exp100 = 0;\n int divBy100 = x;\n while (divBy100 >= 100) {\n exp100++;\n divBy100 /= 100;\n }\n\n long sqrt = 1;\n while (exp100-- > 0) sqrt *= 10;\n\n // When `int` sqrt = 46341, sqrt*sqrt becomes negative.\n // Integer.MAX_VALUE = 2,147,483,647\n while (sqrt * sqrt <= x) {\n sqrt++;\n }\n\n return (int)sqrt - 1;\n }", "public boolean getDivisibileByN(int number, int N){\r\n\t\tint checkNumber = N;\r\n\t\tboolean returnValue = false;\r\n\t\tint count=0;\r\n\t\tdo{\r\n\t\t\tcount++;\r\n\t\t\tcheckNumber += N;// Incrementing by N\r\n\t\t\tif(checkNumber == number){\r\n\t\t\t\treturnValue = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnumber -= N;\r\n\t\t\tif(checkNumber == number){\r\n\t\t\t\treturnValue = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}while(checkNumber <= number);\r\n\t\t\r\n\t\tSystem.out.println(\"Number of iterations : \" + count);\r\n\t\treturn returnValue;\r\n\t}", "private double factorial(int n) {\n if (n < 0 || n > 32) {\n return -1;\n }\n return factorials[n];\n }", "public static int FermatPT(int n) {\n\n for (int i = 2; i < (n/3); i++) {\n\n if((longPow(i,n-1,n))!=1){\n return i;\n }\n\n }\n\n\t\treturn 0;\n\t}", "private static ArrayList<Integer> findPrimeFactors(long unFactoredNumber, int factorArray)\n\t{\n\t\tArrayList<Integer> arrayPrimes = generatePrimes((int)Math.sqrt(unFactoredNumber) * factorArray );\n\t\tArrayList<Integer> arrayPrimeFactors = new ArrayList<Integer>();\n\t\t\n\t\tlong currentNumber = unFactoredNumber; \n\t\t\n\t\t// currentNumber is divisible by a prime, currentNumber becomes result of division and \n\t\t// \n\t\t\n\t\tfor (int indexArrayPrimes = 0; indexArrayPrimes < arrayPrimes.size(); indexArrayPrimes++)\n\t\t{\n\t\t\tif (currentNumber % arrayPrimes.get(indexArrayPrimes) == 0)\n\t\t\t{\n\t\t\t\tarrayPrimeFactors.add(arrayPrimes.get(indexArrayPrimes));\n\t\t\t\tcurrentNumber = currentNumber / arrayPrimes.get(indexArrayPrimes);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// Make sure the biggest have been found\n\t\tif (currentNumber > 1)\n\t\t{\n\t\t\tarrayPrimeFactors = findPrimeFactors(unFactoredNumber, (factorArray + 1));\n\t\t}\n\t\t\n\t\t\n\t\treturn arrayPrimeFactors;\n\t}", "public static double sqrt(double x)\n {\n double root = x, guess=0;\n\n if(x<0) return NaN;\n\n // the accuarcy test is percentual\n for(int i=0; (i<16) && ((guess > x*(1+5e-7f)) || (guess < x*(1-5e-7f))); i++)\n {\n root = (root+x/root)*0.5f; // a multiplication is faster than a division\n guess=root*root; // cache the square to the test\n }\n return root;\n }", "@Override\n\tpublic BigInteger findFact(int num) {\n\t\tBigInteger fact = BigInteger.ONE;\n\t\tfor (int i = 1; i <= num; i++) {\n\t\t\tfact = fact.multiply(BigInteger.valueOf(i));\n\t\t}\n\t\treturn fact;\n\t}", "public static int mySqrt(int x) {\n int res = 0;\n\t\twhile(true){\n\t\t\tif(res * res <= x){\n\t\t\t\tres ++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn res - 1;\n\t\t\t}\n\t\t}\n }", "public static int mySqrt1(int x) {\n if (x < 2) return x;\n int l = (int)Math.pow(Math.E, 0.5*Math.log(x));\n int r = l + 1;\n return (long)r*r > x ? l : r;\n }", "private double factorial(double x) {\r\n double fact=1;\r\n for (double i = x; i > 0; i=i-1) {\r\n fact = fact*i;\r\n }\r\n if(((int)x)!=x) {\r\n fact=fact*SQRTPI;\r\n }\r\n return fact;\r\n }", "public static List<Integer> calculateFor(int n) {\n\t\tArrayList<Integer> factors = new ArrayList<Integer>();\n\t\tint candidate = 2;\n\t\twhile (n > 1) {\n\t\t\twhile (n % candidate == 0) {\n\t\t\t\tfactors.add(candidate);\n\t\t\t\tn /= candidate;\n\t\t\t}\n\t\t\tcandidate++;\n\t\t}\n\t\tif (n > 1) {\n\t\t\tfactors.add(n);\n\t\t}\n\t\treturn factors;\n\t}", "private static int nthUglyNumber(int n) {\n if (n == 0) {\n return 1;\n }\n\n int[] dp = new int[n];\n dp[0] = 1;\n int index2 = 0, index3 = 0, index5 = 0;\n for (int i = 1; i < n; i++) {\n dp[i] = Math.min(2 * dp[index2], Math.min(3 * dp[index3], 5 * dp[index5]));\n System.out.println(dp[i]);\n if (dp[i] == 2 * dp[index2]) {\n index2++;\n }\n\n if (dp[i] == 3 * dp[index3]) {\n index3++;\n }\n\n if (dp[i] == 5 * dp[index5]) {\n index5++;\n }\n }\n\n return dp[n - 1];\n }", "public static void main(String[] args) {\n int a = 2; // starting number\n int r = 2; // Common ratio\n int n = 5; // N th term to be find\n\n int curr_term;\n for (int i = 0; i < n; i++) {\n curr_term = a * (int)Math.pow(r, i);\n System.out.print(curr_term + \" \");\n }\n\n }", "public void smallestMultiple(){\n outerLoop: for( int i = 2; i < Integer.MAX_VALUE; i++ ){\n for( int j = 3; j <= 20; j++ )\n if( i % j != 0 )\n continue outerLoop;\n System.out.println( i );\n break;\n }\n }", "static BigInteger fact(int n)\n {\n BigInteger res = BigInteger.ONE;\n for (int i = 2; i <= n; i++)\n res = res.multiply(BigInteger.valueOf(i));\n return res;\n }", "public static int fact(int num) {\r\n\tint fact = 1, i;\r\n\tfor (i=1; i<=num; i++)\r\n {\r\n fact = fact*i;\r\n }\r\n\treturn fact;\r\n }", "int fact(int n) {\n if (n <= 1)\n return 1;\n else\n return n * fact(n-1);\n}", "public static double factorial(long n){\n\tdouble fac = 1;\n\tif(n <= 0) return fac;\n\tfor (int i=1; i<=n; i++) fac *= i;\n\treturn fac;\n }", "@Test\n\tpublic void generateRandomFactorIsBetweenExpectedLimits() {\n\t\t\n\t\t//when a good sample of randomly generated factors is generated\n\t\tList<Integer> randomFactors = IntStream.range(0, 1000).map(i -> randomGeneratorServiceImpl.generateRandomFactor()).boxed().collect(Collectors.toList());\n\t\t\n\t\t//then all of them should be between 11 and 100 because we want a middle-complexity calculation\n\t\tassertThat(randomFactors).containsOnlyElementsOf(IntStream.range(11, 100).boxed().collect(Collectors.toList()));\n\t}", "public static int factorialiterativa(int n){\n if(n>0){\r\n factorialrecursiva(n-1);//LLAMO A LA RECURSIVA\r\n }else {\r\n return 1;\r\n }\r\nreturn factorialrecursiva(n-1);\r\n }", "public int find(List<Integer> numbers) {\n int count = 0;\n for (Integer n : numbers) {\n int x = 1;\n do {\n if (x * (x + 1) == n) {\n count++;\n }\n x++;\n } while (x < Math.sqrt(n));\n }\n return count;\n }", "public static long fact(int n) {\n if (n <= 0) return 1;\n long f = 1;\n for (int i = 1; i <= n; i++) {\n f *= i;\n }\n return f;\n }", "public static void main(String[] args) {\n\t\tfloat f1 = 5.4f;\r\n\t\tfloat f2 = 5.5f;\r\n\t\tSystem.out.println(Math.round(f1));\r\n\t\tSystem.out.println(Math.round(f2));\r\n\t\tSystem.out.println(Math.random());\r\n\t\tSystem.out.println( (int)(Math.random()*10));\r\n\t\tSystem.out.println(Math.sqrt(64));\r\n\t\tSystem.out.println(Math.pow(2, 10));\r\n\t\tSystem.out.println(Math.PI);\r\n\t\tSystem.out.println(Math.E);\r\n\t\tint n = Integer.MAX_VALUE;\r\n\t\tSystem.out.println( Math.pow((1+1d/n), n));// 1f 不行\r\n\t\tint count = 0;\r\n\t\tfor(int i = 2; i <= 100; i++) {\r\n\t\t\tboolean prime = false;\r\n\t\t\tint c =0;\r\n\t\t\tfor(int j = i; j>=1; j--) {\r\n\t\t\t\tif((i%j) == 0)\r\n\t\t\t\t\tc ++;\r\n\t\t\t\tif (c > 2 )\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif (j == 1) {\r\n\t\t\t\t\tprime = true;\r\n\t\t\t\t\tSystem.out.println(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (prime == true )\r\n\t\t\t\tcount++;\r\n\t\t\telse\r\n\t\t\t\tcontinue;\r\n\t\t}\r\n\t\tSystem.out.println(\"prime count is : \"+ count);\r\n\t\t\r\n\t\tcountPrime(100);\r\n\t}", "public static long getLargestPrimeFactor(BigInteger i) {\n\t\tBigInteger sqrt = new BigInteger(String.valueOf((long)Math.sqrt(i.doubleValue())));\n\t\tBigInteger max = new BigInteger(\"0\");\n\t\tBigInteger start = new BigInteger(\"2\");\n\t\t\n\t\twhile(start.compareTo(sqrt) == -1 || start.compareTo(sqrt) == 0) {\n\t\t\tif(i.mod(start).compareTo(new BigInteger(\"0\")) == 0) {\n\t\t\t\tBigInteger otherFactor = i.divide(start);\n\t\t\t\tif(BigIntegerPrime.isBigIntegerPrime(start) && start.compareTo(max) == 1)\n\t\t\t\t\tmax = start;\n\t\t\t\telse if(otherFactor.isProbablePrime(1) && otherFactor.compareTo(max) == 1)\n\t\t\t\t\tmax = otherFactor;\n\t\t\t}\n\t\t\t\n\t\t\tstart = start.add(BigInteger.ONE);\n\t\t\t\n\t\t}\n\t\treturn max.longValue();\n\t}", "private static long calc2(int max)\n {\n long sum = 1; // \"1\" is valid (1 + 1/1 = 2)\n boolean[] primes = PrimeUtils.isPrimeSoE(max + 1);\n\n // we skip odd values (1 + n/1 is even if n is odd)\n for (int n = 2; n <= max; n = n + 2) {\n // test special case: 1\n if (!primes[n + 1]) {\n continue;\n }\n int sqrt = (int) Math.sqrt(n);\n // skip squares\n if (sqrt * sqrt == n) {\n continue;\n }\n boolean flag = true;\n for (int d = 2; d <= sqrt; d++) {\n if (n % d != 0) {\n continue;\n }\n int e = n / d;\n if (!primes[d + e]) {\n flag = false;\n break;\n }\n }\n if (flag) {\n sum += n;\n // System.out.println(n);\n }\n }\n return sum;\n }", "static int lcmhelp(int j,int k, int n) {\n\t\tif ((n % j == 0) && (n % k == 0)) {\t\t\n\t\t\treturn n; // n is the lowest number\n\t\t}\n\t\telse \n\t\t\treturn lcmhelp(j,k,n+1); // try again with the next-largest number\n\t}", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tint n=17;\r\n\t\tint x = (int) Math.sqrt(n);\r\n\t\t//System.out.println(x);\r\n if (x * x == n) {\r\n System.out.println(x);\r\n \r\n }\r\n x=x+1;\r\n int y = x;\r\n \r\n while (x * y - n > 2) {\r\n y=y-1;\r\n while (x*y<n) x++;\t//Ameya's solution.\r\n //x = (n + y - 1) / y;\r\n //ex:n=42,x=7,y=7, y-1 because if n#y=0, ex:42(7*6) , then we don't want to increment x\r\n }\r\n System.out.println(x+\",\"+y);\r\n \r\n \r\n\r\n\t}", "public static long computeFactorial(int n) {\n if(n<0 || n > 15) throw new IllegalArgumentException(\"Invalid input. N must be >= 0 \");\n if(n==0 || n==1)\n return 1;\n //ddieu kien dung cua de quy \n //song sot den lenh cho nayf thi n chac chan roi vao 2.......15\n return n*computeFactorial(n-1); // n*(n-1)\n \n }", "public static void main(String[] args) {\n int N = 100, i, j, min;\n System.out.println(\"Value of N: \" + N);\n\n for (i = 1; i <= N; i++)\n {\n for (j = 1; j <= N; j++)\n {\n min = i < j ? i : j;\n System.out.print(N - min + 1);\n }\n System.out.println();\n\n\n\n\n }\n}", "public int mySqrt(int x) {\n\t\t// If x is less than 1, it is corner case. \n\t\tif (x < 2) {\n\t\t\treturn x;\n\t\t}\n\n\t\tlong squared;\n\t\tint guess, left = 1, right = x;\n\t\twhile (left <= right) {\n\t\t\tguess = left + (right - left) / 2;\n\t\t\tsquared = (long) guess * guess;\n\t\t\tif (squared == x) {\n\t\t\t\treturn guess;\n\t\t\t}\n\n\t\t\tif (squared > x) {\n\t\t\t\tright = guess - 1;\n\t\t\t} else {\n\t\t\t\tleft = guess + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn left - 1;\n\t}", "public int calculateNthPrime(int i) {\n\t\t//check to see if input is valid\n\t\tif (i < 1) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t/*\n\t\t * Initialize a variable for the number of primes counted at any given point\n\t\t * initialize a variable for the value being tested to be a prime\n\t\t */\n\t\tint numberOfPrimesCounted = 0;\n\t\tint isThisValuePrime = 1;\n\n\t\t//Keep counting primes until we get to the ith prime\n\t\twhile (numberOfPrimesCounted != i) {\n\t\t\tisThisValuePrime++;\n\n\t\t\t/*\n\t\t\t * for the number being tested to be a prime, iterate from 2 to that number.\n\t\t\t * If the counter gets to be more than half the value being tested, we know immediately that the number is prime\n\t\t\t */\n\t\t\tfor (int n = 2; n<=isThisValuePrime; n++) {\n\t\t\t\tif (n > (isThisValuePrime)/2) {\n\t\t\t\t\tnumberOfPrimesCounted++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\t//If at any point we find a valid factor then we know the value being tested is not prime\n\t\t\t\t} else if (isThisValuePrime%n == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn isThisValuePrime;\n\t}", "public static boolean isDifferByOne(int N) {\n\t\tString numString = String.valueOf(N);\n\t\tint len = numString.length();\t\n\t\tint factor = (int) Math.pow(10, len-1);\n\t\tint rul = ((N/factor) - (N%factor));\n\n\t\t//System.out.println(N/factor);\n\t\t\n\t\tif(rul == 1 || rul == -1) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(len>=2) {\n\t\t\tint num = 0;\n\t\t\tint tempN = N;\n\t\t\tint tempFactor = factor;\n\t\t\tint subst = 0;\n//\t\t\tSystem.out.println(\"Whole number: \" +tempN);\n\t\t\tfor (int i = 0; i < len; i++) {\n\t\n\t\t\t\ttempFactor = (int) Math.pow(10, len-(i+1));\n\t\t\t\tnum = tempN/tempFactor;\n\t\t\t\tif(num == 0) {\n\t\t\t\t\tsubst = subst * (-1);\n\t\t\t\t}\n\t\t\t\tsubst = num - subst ;\n//\t\t\t\tSystem.out.println(\" inside arr: \" + num[i]);\n//\t\t\t\tSystem.out.println(\"tempN\" + tempN);\n\t\t\t\ttempN = tempN%tempFactor;\n//\t\t\t\tSystem.out.println(\"tempFactor \" + tempFactor);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t//System.out.println(\"substraction: \" +subst);\n\t\t\tif(subst == 1 || subst == -1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}\n//\tSystem.out.println(Integer.parseInt(numString.substring(0,1)) - Integer.parseInt(numString.substring(1)));\n\t\n\t\t\n\t\treturn false;\n\t}", "public int nthUglyNumber(int n) {\n TreeSet<Long> set = new TreeSet<>();\n set.add(1L);\n long current = 1;\n for(int i = 0; i < n; i++){\n current = set.pollFirst();\n set.add(current*2);\n set.add(current*3);\n set.add(current*5);\n }\n return (int)current;\n }", "boolean ePrimo(int n) {\n \n if (n < 2) {\n return false;\n }\n \n \n // Guarda o numero de divisores de n. Inicialmente eh 1. Todos os numeros\n // sao divisiveis por 1\n \n int numeroDeDivisores = 1;\n \n // O primeiro candidato a divisor nao trivial eh 2.\n \n int candidatoADivisor = 2;\n \n // Testa a divisao por todos os numeros menores ou iguais a n/2 ou ate \n // encontrar o primeiro divisor.\n \n while((candidatoADivisor <= Math.sqrt(n)) && (numeroDeDivisores == 1)) {\n if (n % candidatoADivisor == 0) {\n // o resto da divisao eh zero. Logo, candidatoADivisor eh um divisor de n. \n // Por isso, que o numero de divisores eh incrementado em 1.\n numeroDeDivisores = numeroDeDivisores + 1;\n }\n candidatoADivisor = candidatoADivisor + 1;\n }\n \n if (numeroDeDivisores == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "public void solve() throws IOException {\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n int N = nextInt();\r\n int J = nextInt();\r\n \r\n out.format(\"Case #%d:%n\", t);\r\n \r\n boolean[] bitmask = new boolean[N - 2];\r\n int count = 0;\r\n while (count < J) {\r\n BigInteger[] factors = new BigInteger[9];\r\n boolean success = true;\r\n for (int base = 2; base <= 10; base++) {\r\n BigInteger value = BigInteger.ONE;\r\n BigInteger biBase = BigInteger.valueOf(base);\r\n \r\n for (int i = 0; i < N - 2; i++) {\r\n if (bitmask[i]) {\r\n value = value.add(biBase.pow(i + 1));\r\n }\r\n }\r\n value = value.add(biBase.pow(N - 1));\r\n \r\n if (value.isProbablePrime(10)) {\r\n success = false;\r\n break;\r\n } else {\r\n // Pollard rho\r\n BigInteger x = BigInteger.valueOf(2);\r\n BigInteger y = BigInteger.valueOf(2);\r\n BigInteger d = BigInteger.ONE;\r\n while (d.compareTo(BigInteger.ONE) == 0) {\r\n x = x.pow(2).add(BigInteger.ONE).mod(value);\r\n y = y.pow(2).add(BigInteger.ONE).mod(value)\r\n .pow(2).add(BigInteger.ONE).mod(value);\r\n d = x.subtract(y).gcd(value);\r\n }\r\n if (d.compareTo(value) != 0) {\r\n factors[base - 2] = d;\r\n } else {\r\n success = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (success) {\r\n count++;\r\n StringBuilder sb = new StringBuilder(\"1\");\r\n for (int i = N - 3; i >= 0; i--) {\r\n if (bitmask[i]) {\r\n sb.append(1);\r\n } else {\r\n sb.append(0);\r\n }\r\n }\r\n sb.append(1);\r\n \r\n System.out.println(sb.toString() + \" \" + count);\r\n out.print(sb.toString());\r\n for (int i = 0; i < 9; i++) {\r\n out.print(\" \");\r\n out.print(factors[i].toString());\r\n }\r\n out.println();\r\n }\r\n \r\n // Increment bitmask\r\n for (int i = 0; i < N - 2; i++) {\r\n if (!bitmask[i]) {\r\n bitmask[i] = true;\r\n break;\r\n } else {\r\n bitmask[i] = false;\r\n }\r\n }\r\n }\r\n }\r\n }", "private static int primitiveRoot(int m) {\n if (m == 2)\n return 1;\n if (m == 167772161)\n return 3;\n if (m == 469762049)\n return 3;\n if (m == 754974721)\n return 11;\n if (m == 998244353)\n return 3;\n\n int[] divs = new int[20];\n divs[0] = 2;\n int cnt = 1;\n int x = (m - 1) / 2;\n while (x % 2 == 0)\n x /= 2;\n for (int i = 3; (long) (i) * i <= x; i += 2) {\n if (x % i == 0) {\n divs[cnt++] = i;\n while (x % i == 0) {\n x /= i;\n }\n }\n }\n if (x > 1) {\n divs[cnt++] = x;\n }\n for (int g = 2;; g++) {\n boolean ok = true;\n for (int i = 0; i < cnt; i++) {\n if (pow(g, (m - 1) / divs[i], m) == 1) {\n ok = false;\n break;\n }\n }\n if (ok)\n return g;\n }\n }", "@Test\n public void test34() throws Throwable {\n Complex complex0 = new Complex(11.0, 11.0);\n double double0 = complex0.abs();\n Complex complex1 = complex0.sqrt1z();\n Complex complex2 = complex0.tanh();\n List<Complex> list0 = complex2.nthRoot(266);\n Complex complex3 = complex0.sinh();\n Complex complex4 = complex3.multiply(0.11764700710773468);\n Complex complex5 = complex3.log();\n Complex complex6 = complex2.conjugate();\n Complex complex7 = complex3.log();\n Complex complex8 = complex0.sinh();\n boolean boolean0 = complex0.equals(complex2);\n Complex complex9 = complex4.conjugate();\n Complex complex10 = complex0.tan();\n double double1 = complex3.getImaginary();\n Complex complex11 = complex0.cosh();\n Complex complex12 = complex7.tan();\n Complex complex13 = complex3.multiply(complex6);\n try { \n complex10.nthRoot(0);\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: 0\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }", "public static void main(String[] args) {\n\r\n\r\n Scanner sc = new Scanner(System.in);\r\n System.out.println(\"Enter a number to find its factorial\");\r\n int n = sc.nextInt();\r\n\r\n for(int i = 1 ; i<=n; i++)\r\n {\r\n if(n % i ==0) {\r\n System.out.println(i + \" is factorial\");\r\n }\r\n }\r\n\r\n }", "@Override\n\tpublic long solve(Long num, boolean printResults) {\n\t\tArrayList<Long> factors = new ArrayList<Long>();\n\n\t\twhile (num > 1) {\n\t\t\tfor (long i = 3; i <= num; i += 2) {\n\t\t\t\tif (num % i == 0) {\n\t\t\t\t\tfactors.add(i);\n\t\t\t\t\tnum /= i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlong big = factors.get(factors.size() - 1);\n\t\tif (printResults)\n\t\t\tSystem.out.println(big + \" is the biggest prime factor of 6,008,514,751,43l\");\n\t\treturn big;\n\t}", "public static void findPrime (int n){\n\t\tboolean [] isPrime = new boolean[n];\n\t\tisPrime[0] = false;\n\t\tisPrime[1] = true;\n\t\t\n\t\tfor(int i = 2; i< n; i++){\n\t\t\tisPrime[i]= true;\n\t\t}\n\t\tint limit = (int)Math.sqrt(n);\n\t\tfor(int i = 2; i<= limit; i++){\n\t\t\tif(isPrime[i])\n\t\t\t{\n\t\t\t\tfor(int j= i * i ; j < n; j+= i){\n\t\t\t\t\tisPrime[j] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i< n; i++){\n\t\t\tif(isPrime[i])\n\t\t\tSystem.out.println(i);\n\t\t}\n\t}", "public static int mySqrt(int x) {\n\t\tif (x == 0)\n\t\t\treturn 0;\n\n\t\tint left = 1;\n\t\tint right = x / 2;\n\t\tint result = 1;\n\n\t\twhile (left <= right) {\n\t\t\tlong mid = (left + right) / 2;\n\n\t\t\tif (mid * mid > x) {\n\t\t\t\tright = (int) mid - 1;\n\t\t\t} else {\n\t\t\t\tif ((mid + 1) * (mid + 1) > x) {\n\t\t\t\t\tresult = (int) mid;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tleft = (int) mid + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "static int nextPrime(int N)\n { \n // Base case\n if (N <= 1)\n return 2; \n int prime = N;\n boolean found = false;\n\n // Loop continuously until isPrime returns\n // true for a number greater than n\n\n while (!found)\n {\n prime++;\n if (isPrime(prime))\n found = true;\n }\n return prime;\n }", "public long factorial(int num){\r\n long f=1;\r\n for(int i=1;i<=num;i++)\r\n f=f*i;\r\n \r\n if(num>=1) return f;\r\n else if(num==0)return 1;\r\n \r\n return 1;\r\n }", "private static List<Integer> getNumFactors(int num) {\n\t\tList<Integer> factors = new ArrayList<>();\n\t\tfor(int i = 2 ; i <= num/2; i++) {\n\t\t\tif (num % i == 0) {\n\t\t\t\tfactors.add(i);\n\t\t\t}\n\t\t}\n\t\treturn factors;\n\t}", "public static BigInteger rho(BigInteger N){\r\n\t\tBigInteger ys = null, x = null;\r\n\t\tBigInteger \r\n\t\t\t\ty = new BigInteger(N.bitLength(),rand), \r\n\t\t\t\tc = new BigInteger(N.bitLength(),rand), \r\n\t\t\t\tm = new BigInteger(N.bitLength(),rand);\r\n\t\tBigInteger \tg = RichardPollard.ONE,\r\n\t\t\t\t\tr = RichardPollard.ONE,\r\n\t\t\t\t\tq = RichardPollard.ONE;\r\n\t\twhile(g.compareTo(RichardPollard.ONE)==0){\r\n//\t\t\tSystem.out.println(\"wa\");\r\n\t\t\tx = y;\r\n\t\t\tfor(int i = 0; i<r.doubleValue();i++){\r\n\t\t\t\ty = y.multiply(y).remainder(N).add(c).remainder(N);\r\n\t\t\t}\r\n\t\t\tBigInteger k = RichardPollard.ZERO;\r\n\t\t\twhile(k.compareTo(r)<1 && g.equals(RichardPollard.ONE)){\r\n\t\t\t\tys = y;\r\n\t\t\t\tBigInteger mrk = r.subtract(k).min(m);\r\n\t\t\t\tfor(BigInteger i = RichardPollard.ZERO; i.compareTo(mrk)<1; i=i.add(RichardPollard.ONE)){\r\n\t\t\t\t\ty = y.multiply(y).remainder(N).add(c).remainder(N);\r\n\t\t\t\t\tq = q.multiply(x.subtract(y).abs()).remainder(N);\r\n\t\t\t\t}\r\n\t\t\t\tg = q.gcd(N);\r\n\t\t\t\tk = k.add(m);\r\n\t\t\t}\r\n\t\t\tr = r.multiply(RichardPollard.TWO);\r\n\t\t\t\r\n\t\t}\r\n\t\tif(g.equals(N)){\r\n\t\t\twhile(true) {\r\n\t\t\t\tys = ys.multiply(ys).remainder(N).add(c).remainder(N);\r\n\t\t\t\tg = x.subtract(ys).abs().gcd(N);\r\n\t\t\t\tif(g.compareTo(RichardPollard.ONE)==1){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n//\t\tSystem.out.println(y.doubleValue()+\" \"+r.doubleValue());\r\n\t\treturn g;\r\n\t\t\r\n\t}", "public int sqrt(int x) {\n if(x>=0)\n {\n long left=0;\n long right=x;\n long mid=0;\n while(left<=right)\n {\n mid=left+(right-left)/2;\n long tmp=mid*mid;\n if(tmp<mid){\n right=mid-1;\n }\n else if(tmp==x){\n return (int)mid;\n }\n else if(tmp<x){\n left=mid+1;\n }\n else{\n right=mid-1;\n }\n \n }\n return (int)right;\n }\n return -1;\n }", "private static int lpf(int i) {\n\t\tint j = i-1;\n\t\twhile(j>=2) {\n\t\t\tif (i%j == 0 && checkifprime(j)) {\n\t\t\t\treturn j;\n\t\t\t}\n\t\t\tj--;\n\t\t}\n\t\treturn 2;\n\t}", "ArrayList<BigInteger> factorize(BigInteger num) {\n ArrayList<BigInteger> result = calcPrimeFactors(num);\n return result;\n }", "private static int get_number(int i, int j) { n n!\n// C = _____________\n// r (n-r)! * r!\n//\n return factorial(i)/(factorial(i-j)* factorial(j));\n }" ]
[ "0.7419769", "0.6947678", "0.650291", "0.64552504", "0.6368214", "0.63496864", "0.63379526", "0.6293993", "0.6290237", "0.62370485", "0.6232179", "0.6230693", "0.61897004", "0.6178059", "0.6157577", "0.6133451", "0.6118565", "0.6111401", "0.6089064", "0.6079502", "0.6073985", "0.60614365", "0.6052858", "0.60524946", "0.60398406", "0.60394686", "0.6036176", "0.6025592", "0.6020485", "0.6006182", "0.59961003", "0.5994499", "0.59912413", "0.5989736", "0.5973497", "0.5963434", "0.59578997", "0.59558207", "0.5954614", "0.5946874", "0.59296083", "0.5927913", "0.5923728", "0.59123623", "0.59046483", "0.59033567", "0.58963114", "0.58875", "0.58872575", "0.5870746", "0.58658665", "0.58637416", "0.585157", "0.5851352", "0.58447903", "0.5831354", "0.58305967", "0.5823491", "0.582098", "0.5820069", "0.5804374", "0.5783165", "0.57829934", "0.5778704", "0.57760406", "0.5773871", "0.57644254", "0.576267", "0.57566375", "0.57411116", "0.5735778", "0.57325953", "0.5715051", "0.5702311", "0.5694736", "0.5671256", "0.56648487", "0.56622046", "0.5659279", "0.565075", "0.56445056", "0.5628516", "0.5627028", "0.56188905", "0.56178105", "0.561535", "0.5608723", "0.5606752", "0.5604543", "0.56025827", "0.5590777", "0.5576093", "0.5575705", "0.55741775", "0.55728847", "0.5568561", "0.555931", "0.55553466", "0.5543752", "0.55431545", "0.55412936" ]
0.0
-1
/ inizializza i mock ed il servizio da testare
@Before public void setup() { MockitoAnnotations.initMocks(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mock(){\n\n }", "private Mocks() { }", "public void testMock(){\n\t}", "private DataClayMockObject() {\n\n\t}", "@Before\n\tpublic void inicializarEnCadaTest() {\n\t\tthis.servicioDocumento = spy (new ServicioDocumentoImpl(repositorioDocumento));\n\n\t}", "private MockClientFacade() {\n\t\t//this.c = Client.getInstance();\n\t}", "@Before\n\tpublic void setUp()\n\t{\n\t\tm_mockery = new Mockery();\n\t\tm_values = m_mockery.mock(KeyedValues.class);\n\t}", "private void setUpMockObjects() {\n this.request = new CustomMockHttpServletRequest();\n byte[] content = { 4, 6, 7 };\n ServletInputStream inputStream = new DelegatingServletInputStream(\n new ByteArrayInputStream(content));\n this.request.inputStream = inputStream;\n\n this.response = new MockHttpServletResponse();\n\n this.setUpXmlRpcElementFactory();\n this.setUpXmlRpcRequestParser();\n this.setUpXmlRpcResponseWriter();\n this.setUpXmlRpcServiceExporterMap();\n }", "@Before\n public void setup(){\n\tMockito.when(mockOroSecret.getOROSecretKey()).thenReturn(\"abc@123\");\n\tutility = TokenUtility.getInstance(mockOroSecret);\n }", "@BeforeClass\n public static void setUp() {\n serviceMock = mock(DefaultMisthYpalService.class);\n String inputFile = \"MisthYpal.json\";\n try {\n String json = FileUtils.readFileFromResource2String(inputFile, Charset.defaultCharset());\n records = gson.fromJson(json, MisthYpal[].class);\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n // test data\n when(serviceMock.find(records[0].getKodoikog())).thenReturn(records[0]);\n }", "@Before\n public void setUp() {\n InternalDataSerializer.reinitialize();\n }", "public MockPersistenceProvider()\n{\n\tobjects = new Vector();\n}", "private MockarooPingHelper(){}", "@Before\n public void init(){\n mockClient = MockWebServiceClient.createClient(applicationContext);\n }", "@Before\n public void init(){\n mockClient = MockWebServiceClient.createClient(applicationContext);\n }", "@Before\n\tpublic void setUp() {\n MockitoAnnotations.initMocks(this);\n PowerMockito.mockStatic(HashGeneratorUtil.class);\n\t}", "@Before\r\n\tpublic void setup(){\n\t\t\r\n\t\tMufasaRepository testAccounts = MufasaRepository.getInstance();\r\n\t\ttestAccounts.addMufasa( new Mufasa(\"firstName\", \"lastName\", \"username\", \"password\", 42) );\r\n\t\t\r\n\t\t//Mock create\r\n\t\texampleX= EasyMock.createMock(MufasaRepository.class);//what does this do?\r\n\t\ttestAccounts.tulosta();\r\n\t}", "@Before\r\n public void setup() {\n JacksonTester.initFields(this, new ObjectMapper());\r\n // MockMvc standalone approach\r\n mvc = MockMvcBuilders.standaloneSetup(peopleController)\r\n .build();\r\n //peopleService = Mockito.mock(PeopleServiceImpl.class);\r\n }", "public void testSetBasedata() {\n }", "@Test\r\n public void testSetMiservicio() {\r\n System.out.println(\"setMiservicio\");\r\n Servicio miservicio = new Servicio();\r\n miservicio.descripcion=\"gestion de vigilancia\";\r\n Servicio_CentroEcu instance = new Servicio_CentroEcu();\r\n instance.setMiservicio(miservicio);\r\n assertEquals(instance.getMiservicio().descripcion, \"gestion de vigilancia\");\r\n }", "@Test\r\n public void testSetProxy() {\r\n // Not required\r\n }", "public MockAbstractCarte() {\n super();\n }", "@Before\n public void setUp() {\n MockitoAnnotations.initMocks(this);\n }", "@Before\n public void setUp(){\n mockStatic(JcrUtil.class);\n mockStatic(JcrUtils.class);\n }", "@Before\n public void setUp() throws Exception {\n accessor = mock(ValueVector.Accessor.class);\n when(accessor.getObject(anyInt())).thenAnswer(new Answer<Object>() {\n\n @Override\n public Object answer(InvocationOnMock invocationOnMock) throws Throwable {\n Object[] args = invocationOnMock.getArguments();\n Integer index = (Integer) args[0];\n if(index == 0) {\n return NON_NULL_VALUE;\n }\n if(index == 1) {\n return null;\n }\n throw new IndexOutOfBoundsException(\"Index out of bounds\");\n }\n });\n when(accessor.isNull(anyInt())).thenAnswer(new Answer<Object>() {\n\n @Override\n public Object answer(InvocationOnMock invocationOnMock) throws Throwable {\n Object[] args = invocationOnMock.getArguments();\n Integer index = (Integer) args[0];\n if(index == 0) {\n return false;\n }\n return true;\n }\n });\n\n metadata = UserBitShared.SerializedField.getDefaultInstance();\n valueVector = mock(ValueVector.class);\n when(valueVector.getAccessor()).thenReturn(accessor);\n when(valueVector.getMetadata()).thenReturn(metadata);\n\n genericAccessor = new GenericAccessor(valueVector);\n }", "@Test\n\tpublic void test03(){\n\t\t //criacao do mock\n\t\tConta mockedConta = mock(Conta.class);\n\t\t// definicao de como o mock deve se comportar\n\t\twhen(mockedConta.getSaldo()).thenReturn(0.0);\n\t\t//verificao se o mock esta se comportando como defenido\n\t\tassertEquals(0.0, mockedConta.getSaldo(), 0.0);\n\t}", "@Before\n public void setup(){\n\n mockUserRepo = mock(UserRepository.class);\n mockSession = mock(UserSession.class);\n mockValidator = mock(InputValidator.class);\n sut = new UserService( mockUserRepo, mockSession, mockValidator);\n\n }", "@Before\n public void setUp() {\n MockitoAnnotations.initMocks(this);\n }", "public MockEditNote() {}", "@Before\n\tpublic void init() {\n\t\tbankingTransactionDTO = new BankingTransactionDTO();\n\t\tbankingTransactionDTO.setType(\"deposit\");\n\t\tbankingTransactionDTO.setAmount(100.77d);\n\n\t\t// mock initialization\n\n\t}", "@Test\n public void testRetreiveTodosRelatedToSpringUsingMock(){\n\n List<String> todos = Arrays.asList(\"Learn Spring MVC\", \"Learn angular\", \"Learn Spring\");\n when(todoServiceMock.retreiveTodos(\"dummy\")).thenReturn(todos);\n\n List<String> filtredTodos = todoBusiness.retreiveTodosRelatedToSpring(\"dummy\");\n assertEquals(2, filtredTodos.size());\n\n }", "@Before\n public void setUp() throws Exception {\n fs = new MockFileSystem();\n mv = new Mv(fs);\n io = new IO();\n }", "@BeforeClass\n public static void setUp() {\n revContent = RevContent.builder().build();\n Token token = new Token();\n token.setAccessToken(\"fd2fbd63435b7f80fb1d7d5f1b1841c16fe70d2c\");\n auth = new Authentication(null, token);\n objectMapper = SerializationMapperCreator.createObjectMapper(new SerializationConfig());\n }", "public MockClass(String arg) {\n\t}", "@Before\n\tpublic void setup() {\n\t\tMockitoAnnotations.initMocks(this);\n\t\n\t}", "@Test\n public void testSetPagamentos() {\n }", "protected MockLineChartViewBase() {\n super();\n }", "@Override\n @Before\n public void setUp() throws IOException {\n }", "public void setUpWithMock() {\n\n setUpWithMock(\"plainPluto.json\", null);\n\n }", "@Test\r\n public void testGetMiservicio() {\r\n System.out.println(\"getMiservicio\");\r\n Servicio_CentroEcu instance = new Servicio_CentroEcu();\r\n Servicio expResult = null;\r\n Servicio result = instance.getMiservicio();\r\n assertEquals(expResult, result);\r\n }", "public interface IGradeMock{\n String getGradeName();\n\n void setGradeName(String gradeName);\n\n IPermissionMock getPermissionMock();\n\n void setPermissionMock(IPermissionMock permissionMock);\n\n int getID();\n\n void setID(int ID);\n}", "@Before\n public void setUp() {\n MockitoAnnotations.initMocks(this);\n hazelcastMockServer = new HazelcastMockServer(getServerProperties());\n }", "@Before\n public void setUp(){\n MockitoAnnotations.initMocks(this);\n content =new Content();\n content.setName(\"stomach\");\n content.setType(\"AnatomicalStructure\");\n content.setId(1);\n list = new ArrayList<Integer>();\n list.add(new Integer(1));\n content.setParaId(list);\n }", "@Before\n\tpublic void setup(){\n\t\tMockitoAnnotations.initMocks(this);\n\t}", "@Before\n public void setup() {\n MockitoAnnotations.initMocks(this);\n\n historyList = Lists.newArrayList(new History(\"WWW1234\",\n \"Kuantan\",\n Long.valueOf(\"1542022506879\"),\n \"-sdsad\",\n 0.45,\n 1));\n\n historyPresenter = new HistoryPresenter(historyView, remoteDataSource,\n sharedPreferenceService);\n }", "public void testBuscarEntradas(){\r\n\t\t\r\n\t\t\r\n\t\tfinal Mock mock=mock(MaquilaManager.class);\r\n\t\tmock.expects(once()).method(\"buscarEntradasDeMaterial\")\r\n\t\t\t.withNoArguments()\r\n\t\t\t.will(returnValue(new BasicEventList<EntradaDeMaterial>()))\r\n\t\t\t;\r\n\t\tmodel.setMaquilaManager((MaquilaManager)mock.proxy());\r\n\t\t//assertNotNull(model.getEntradas());\r\n\t\t//assertFalse(model.getEntradas().isEmpty());\r\n\t\t\r\n\t}", "public void resetMocking() {\n mockGraphReadMethods = mock(GraphReadMethods.class);\n mockGraphWriteMethods = mock(GraphWriteMethods.class);\n mockJsonNode = mock(JsonNode.class);\n mockJsonGenerator = mock(JsonGenerator.class);\n mockCache = mock(ImmutableObjectCache.class);\n }", "@Before\r\n public void setUp() { \r\n ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());\r\n //ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(\".\")){});\r\n \t\r\n //helper.setUp();\r\n }", "public void setUpWithMock(String fileName, Exception e) {\n\n apiConfig = new ApiConfig.ConfigBuilder().apiLocation(\"api\").port(\"8081\").host(\"localhost\").build();\n mockApiImpl = new MockDefaultApiImplementation(apiConfig, fileName);\n // We create a new instance of test class under test as usually.\n\n // This is the way to tell PowerMock to mock all static methods of a\n // given class\n mockStatic(ApiFactory.class);\n\n expect(ApiFactory.getDefaultImplementation()).andReturn(mockApiImpl);\n\n // Note how we replay the class, not the instance!\n PowerMock.replay(ApiFactory.class);\n\n }", "@Before\n public void setUp() throws Exception{\n\n MockitoAnnotations.initMocks(this);\n spyMainActivity = spy(new MainActivity());\n spyNewsArticleFragment = spy(new NewsArticleFragment());\n spyService = new Service(networkService);\n/* You have to use doReturn() for stubbing */\n Mockito.doReturn(spyMainActivity).when(spyNewsArticleFragment).getActivity();\n Mockito.doReturn(mockBaseApplication).when(spyMainActivity).getApplication();\n Mockito.doReturn(applicationComponent).when(mockBaseApplication).getAppComponent();\n Mockito.doReturn(mockLayoutInflaterProdRate).when(spyMainActivity).getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n Mockito.doReturn(mockInflatedView).when(mockLayoutInflater).inflate(anyInt(), any(ViewGroup.class), anyBoolean());\n Mockito.doReturn(mockInflatedViewProdRate).when(mockLayoutInflaterProdRate).inflate(anyInt(), any(ViewGroup.class));\n Mockito.doReturn(recyclerView).when(mockInflatedView).findViewById(R.id.recyclerView);\n Mockito.doReturn(mockFragmentManager).when(spyMainActivity).getFragmentManager();\n Mockito.doReturn(mockFragmentTransaction).when(mockFragmentManager).beginTransaction();\n Mockito.doReturn(mockFragmentTransaction).when(mockFragmentTransaction).add(anyInt(), any(Fragment.class), anyString());\n Mockito.doReturn(mockFragmentTransaction).when(mockFragmentTransaction).addToBackStack(anyString());\n Mockito.doReturn(0).when(mockFragmentTransaction).commit();\n }", "@Before\n public void setUp() {\n deviceController = Mockito.mock(DeviceController.class);\n settingController = Mockito.mock(SettingController.class);\n gprsMessageDAO = Mockito.mock(GprsMessageDAO.class);\n postResults = new ArrayList<>();\n\n Mockito.when(settingController.getSetting(\"deviceCommunicator.endpoint\"))\n .thenReturn(\"http://jouko.test/\");\n\n Mockito.when(settingController.getSetting(\"deviceCommunicator.asId\"))\n .thenReturn(\"as\");\n\n Mockito.when(settingController.getSetting(\"deviceCommunicator.enabled\", \"false\"))\n .thenReturn(\"true\");\n\n subject = new DeviceCommunicator(\n deviceController,\n settingController,\n Clock.fixed(Instant.EPOCH, ZoneOffset.UTC),\n (String postResult) -> {\n postResults.add(postResult);\n return \"<html><body>Request queued by LRC</body></html>\";\n }\n );\n }", "@Test\n public void testCorrectInstantiation(){\n MockView mockView = new MockView(\"Pippo\");\n DummyServer server = new DummyServer();\n Client client = new Client(mockView, server);\n\n Assert.assertSame(server, client.getServer());\n Assert.assertEquals(mockView.getPlayerName(), client.getNetInterface().getUsername());\n }", "private MockClientNetworkModule() {\n\t\t// TODO complete this constructor\n\t}", "public interface IOngoingStubbing {}", "@Before\n\tpublic void init() {\n\t\tthis.acccountMock = new AccountDTO();\n\t\tthis.acccountMock.setId(ACCOUNT_ID);\n\t\tthis.acccountMock.setActive(true);\n\t\tthis.acccountMock.setBankingTransactions(new ArrayList<>());\n\n\t}", "protected <T> T mockOf(Class<T> clazz) {\n \n return registerMockObject(createMock(clazz));\n }", "@Before\n public void setUp() throws Exception {\n MockitoAnnotations.initMocks(this);\n track=new Track();\n track.setId(9);\n track.setName(\"ekbaar\");\n track.setComments(\"nice\");\n list = new ArrayList<>();\n list.add(track);\n }", "@Test\n @Override\n public void testMapGet() {\n }", "@Before\n\tpublic void setUp() {\n accessToken = \"123\";\n xeroTenantId = \"xyz\";\n \n // Init projectApi client\n // NEW Sandbox for API Mocking\n\t\tdefaultClient = new ApiClient(\"https://ba3fd247-8fc6-4d7c-bcd1-bdbea4ea1803.mock.pstmn.io/payroll.xro/2.0\",null,null,null,null);\n payrollUkApi = PayrollUkApi.getInstance(defaultClient); \n \n\t}", "@Test\n\tpublic void test01(){ \n\t\t \n\t\t Banco mockedBanco = mock(Banco.class);\n\t\t\n\t\t //usando o mock object\n\t\t mockedBanco.setDescricao(\"Banco da Cidade Universitaria\");\n\t\t mockedBanco.getDescricao();\n\t\n\t\t //verificacoes\n\t\t verify(mockedBanco).setDescricao(\"Banco da Cidade Universitaria\");\n\t\t verify(mockedBanco).getDescricao();\n\t}", "@Override\n public void setUp() {\n }", "public ClientInformationTest()\n {\n }", "@Before\n public void setUp()\n {\n clientIn1 = new ClientInformation();\n clientIn1.setReaderToArray();\n clientIn1.printClientList();\n clientIn1.setAlphabetically();\n }", "public OrderLineServiceTest() {\n\t\tsetupRequestContext();\n\t}", "@BeforeEach\n\tpublic void setUp() {\n\t\t this.coca = mock(Product.class);\n\t\t \n\t\t this.today = LocalDate.now();\n\t\t this.newPrice = CurrentPrice.settlePrice(30f, coca); \n\t\t this.string = \"Price value: 30.0\";\n\t}", "@Before\n\t public void setUp() {\n\t }", "@Test\r\n public void testSetValor() {\r\n \r\n }", "@Before\n public void setUp() {\n photoServiceImpl = new PhotoServiceImpl();\n photoDao = mock(PhotoDao.class);\n photoServiceImpl.setPhotoDao(photoDao);\n }", "@Test\n void testSpy() {\n ExamenRepository examenRepository = spy(ExamenRepositoryImpl.class);\n PreguntaRepository preguntaRepository = spy(PreguntaRepositoryImpl.class);\n ExamenService examenService = new ExamenServiceImpl(examenRepository, preguntaRepository);\n //Attention à ne pas utiliser when avec les spy, car à méthode est réellement appélée\n //seul la valeur de retour est modifiée.\n //préféré doReturn\n doReturn(Arrays.asList(\"aritmetica\")).when(preguntaRepository).findPreguntasPorExamenId(anyLong());\n\n Examen examen = examenService.findExamenPorNombreConPreguntas(\"Matematicas\");\n assertEquals(5, examen.getId());\n assertEquals(\"Matematicas\", examen.getNombre());\n assertEquals(1, examen.getPreguntas().size());\n assertTrue(examen.getPreguntas().contains(\"aritmetica\"));\n\n verify(examenRepository).findAll(); //appelé de façon réel\n verify(preguntaRepository).findPreguntasPorExamenId(anyLong()); //appelé aussi, mais mocké\n }", "@Before\n public void init() {\n DatabaseReference mockReference = mock(DatabaseReference.class);\n Task mockTask = mock(Task.class);\n mockAccount = mock(Account.class);\n when(mockReference.child(isA(String.class))).thenReturn(mockReference);\n when(mockReference.removeValue()).thenReturn(mockTask);\n doNothing().when(mockReference)\n .addListenerForSingleValueEvent(isA(ValueEventListener.class));\n }", "@Before public void setUp() { }", "private ProtomakEngineTestHelper() {\r\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\tMockitoAnnotations.initMocks(this);\n\t}", "void add(MockAPI mockAPI);", "@Before\n public void setUp () {\n }", "@Before\n public void setup() {\n context.build().resource(OAK_INDEX).commit();\n context.registerService(Scheduler.class,scheduler);\n context.registerService(RequireAem.class,requireAem,\"distribution\",\"classic\");\n\n ScheduleOptions options = mock(ScheduleOptions.class);\n lenient().when(scheduler.NOW()).thenReturn(options);\n lenient().when(scheduler.schedule(any(), any())).thenAnswer((InvocationOnMock invocation) -> {\n EnsureOakIndexJobHandler handler = invocation.getArgument(0);\n handler.run();\n return true;\n });\n\n context.registerService(ChecksumGenerator.class, new ChecksumGeneratorImpl());\n \n ensureOakIndexManagerProperties = new HashMap<>();\n ensureOakIndexManagerProperties.put(\"properties.ignore\", null);\n \n }", "@Test\r\n public void getPhoneTest()\r\n {\r\n Assert.assertEquals(stub.getPhone(), PHONE);\r\n }", "public TestModelFacade3(Method method) {\n super(method.toString());\n methodToTest = method;\n }", "@Test\n void spyMockTest() {\n List list = spy(new LinkedList());\n\n //you can enable partial mock capabilities selectively on mocks:\n Person mock = Mockito.mock(Person.class);\n\n //Be sure the real implementation is 'safe'.\n //If real implementation throws exceptions or depends on specific state of the object then you're in trouble.\n when(mock.getName()).thenCallRealMethod();\n\n }", "@Before\r\n\tpublic void setUp() throws IllegalAccessException{\n\t\torder1 = new Order(1,\"Tshirt\",\"T shirt\",100,\"xyz01\",\"hp1\",0.00,\"\");\r\n\t\torder2 = new Order(2,\"Audio Device\",\"Audim Device\",200.90,\"xyz02\",\"Samsung1\",10.00,\"\");\r\n\t\torder3 = new Order(3,\"Formal Shirt\",\"Formal shirt\",100,\"xyz01\",\"RYM\",0.00,\"Completed\");\r\n\t\torder4 = new Order(4,\"Laptop\",\"Laptop\",70000.90,\"amdg\",\"dell1\",10.00,\"Completed\");\r\n\t\torder5 = new Order(5,\"Tshirt\",\"T shirt\",200.90,\"sgfkn\",\"hp2\",10.00,\"Completed\");\r\n\t\torder6 = new Order(6,\"TV\",\"TV\",200.90,\"sdfsg\",\"LG2\",10.00,\"Completed\");\r\n\t\torder7 = new Order(7,\"Stationary\",\"Stationary \",270.20,\"lsdfh\",\"Venus1\",20.00,\"Completed\");\r\n\t\t\r\n\t\t//configure mock objects\r\n\t\twhen(orderDao.create(order1)).thenReturn(order1.getId());\r\n\t\twhen(orderDao.update(order1)).thenReturn(order1.getId());\r\n\t\twhen(orderDao.delete(order1)).thenReturn(true);\r\n\t\twhen(orderDao.getAllOrders()).thenReturn(Arrays.asList(order1,order2,order3,order4,order5,order6,order7));\r\n\t\t\r\n\t\t//difference between spy and mock\r\n\t\twhen(orderDao_spy1.create(order2)).thenReturn(order2.getId());\r\n\t\tdoReturn(order2.getId()).when(orderDao_spy2).create(order2);\r\n\t\t\r\n\t\torderBO1.setOrderDao(orderDao_spy1);\r\n\t\torderBO2.setOrderDao(orderDao_spy2);\r\n\t}", "@Before\n public void setUp()\n {\n m_instance = ConversationRepository.getInstance();\n m_fileSystem = FileSystem.getInstance();\n }", "@Test\n public void deveDevolverNaSegundaAoAlugarNoSabado() throws Exception {\n\t Usuario usuario = umUsuario().agora();\n\t List<Filme> filmes = Arrays.asList(umFilme().agora());\n\n //PowerMockito.whenNew(Date.class).withNoArguments().thenReturn(DataUtils.obterData(29, 4, 2017));\n /*Calendar calendar = Calendar.getInstance();\n calendar.set(Calendar.DAY_OF_MONTH, 29);\n calendar.set(Calendar.MONTH, Calendar.APRIL);\n calendar.set(Calendar.YEAR, 2017);\n PowerMockito.mockStatic(Calendar.class);\n PowerMockito.when(Calendar.getInstance()).thenReturn(calendar);*/\n\n Mockito.doReturn(DataUtils.obterData(29,4,2017)).when(service).obterData();\n\n\t //acao\n Locacao retorno = service.alugarFilme(usuario, filmes);\n\n //verificacao\n //boolean ehSegunda = DataUtils.verificarDiaSemana(retorno.getDataRetorno(), Calendar.MONDAY);\n //assertTrue(ehSegunda);\n assertThat(retorno.getDataRetorno(), caiNumaSegunda());\n //PowerMockito.verifyNew(Date.class, Mockito.times(2)).withNoArguments();\n\n //PowerMockito.verifyStatic(Mockito.times(2));\n //Calendar.getInstance();\n\n\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() throws Exception {\n MockServletContext mockServletContext = new MockServletContext();\n new SpannerClient().contextInitialized(new ServletContextEvent(mockServletContext));\n SpannerTestTasks.setup();\n\n eventVolunteeringFormHandlerServlet = new VolunteeringFormHandlerServlet();\n\n request = Mockito.mock(HttpServletRequest.class);\n response = Mockito.mock(HttpServletResponse.class);\n }", "@Test\n public void shouldReturnOKStatus() throws Exception{\n Mockito.when(itemService.getItemById(1)).thenReturn(new Item(1,\"Item1\",12,25));\n RequestBuilder requestBuilder= MockMvcRequestBuilders.get(\"/item?id=1\").accept(MediaType.APPLICATION_JSON);\n mockMvc.perform(requestBuilder).andExpect(status().isOk()).andExpect(content().json(\"{\" +\n \"id:1,name:Item1,price:12,quantity:25}\"));\n }", "private DeviceBCFMockImpl getDeviceMock()\r\n\t{\r\n\t\treturn (DeviceBCFMockImpl)SensusAppContext.getApplicationContext().getBean(MapAPIController.class)\r\n\t\t\t\t.getDeviceBCF();\r\n\t}", "@Before\n\tpublic void setup(){\n\t\taccount = mock(Account.class);\n\t\t\t\t\n\t\taccountDB = mock(AccountRepository.class);\n\t\twhen(accountDB.find(anyString())).thenReturn(account);\n\t\tservice = new LoginService(accountDB);\n\n\t}", "@Before\n public void before() {\n \t// TODO 07b: make mock for CargoDao using Mockito.mock(...)\n \t// (...)\n flightControlService = new FlightControlService(mCargoDao, mMessagingService);\n \n loadDummyCargoToMap();\n }", "@Before\n public void setUp() {\n }", "protected void setUp() {\n\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n @Override\n public void init() {\n }", "@Before\n public void setup() {\n MockitoAnnotations.initMocks(this);\n type = new IntegerType();\n }" ]
[ "0.75723696", "0.72790915", "0.68689317", "0.6838007", "0.678331", "0.6725844", "0.65919346", "0.65337664", "0.6354191", "0.6328691", "0.6269765", "0.6253151", "0.6227518", "0.62149745", "0.62149745", "0.6210237", "0.61968875", "0.61525613", "0.6133599", "0.611367", "0.60995805", "0.608285", "0.6039242", "0.60123736", "0.60079515", "0.60009074", "0.5999757", "0.5996589", "0.59755546", "0.5970959", "0.59567654", "0.5956079", "0.5944916", "0.5941529", "0.594031", "0.59342176", "0.5933123", "0.5925455", "0.5919959", "0.5918982", "0.5913802", "0.59110314", "0.5910185", "0.58969593", "0.5887692", "0.58874774", "0.5885465", "0.586972", "0.5868809", "0.58607", "0.58533186", "0.58410025", "0.58308256", "0.5823408", "0.58221", "0.5813604", "0.5803745", "0.58011806", "0.57931614", "0.57899845", "0.5780508", "0.5779172", "0.57764477", "0.5775439", "0.57721984", "0.57675284", "0.576589", "0.5764719", "0.57600063", "0.5757167", "0.57540625", "0.575364", "0.57533973", "0.57530063", "0.5750241", "0.5746068", "0.57459164", "0.5741756", "0.5737859", "0.57288843", "0.57262063", "0.5723284", "0.5719361", "0.5719361", "0.5719361", "0.5719361", "0.5719361", "0.57184273", "0.57167417", "0.57125324", "0.57116514", "0.57110226", "0.57090867", "0.57037175", "0.57019114", "0.57019114", "0.57019114", "0.57019114", "0.5700622", "0.5700134" ]
0.5787649
60
/ verifica che, quando viene usato il servizio per creare un consumatore: 1) il consumatore viene salvato tramite il repository e 2) viene pubblicato un evento di creazione del consumatore / configura ConsumerRepository.save per settare l'id del consumatore
@Test public void createConsumerTest() { when(consumerRepository.save(any(Consumer.class))) .then(invocation -> { Consumer consumer = (Consumer) invocation.getArguments()[0]; consumer.setId(CONSUMER_ID); return consumer; }); /* invoca la creazione del consumatore */ Consumer consumer = consumerService.create(CONSUMER_FIRST_NAME, CONSUMER_LAST_NAME); /* verifica che il consumatore è stato salvato */ verify(consumerRepository) .save(same(consumer)); /* verifica che è stato creato un evento di creazione del consumatore */ verify(domainEventPublisher) .publish(new ConsumerCreatedEvent(CONSUMER_ID, CONSUMER_FIRST_NAME, CONSUMER_LAST_NAME), ConsumerServiceChannel.consumerServiceChannel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean ajouterConseiller(Conseiller conseiller) {\n\t\treturn false;\n\t}", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,ClienteArchivo clientearchivo,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(ClienteArchivoConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(clientearchivo.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,ClienteArchivoDataAccess.TABLENAME, clientearchivo.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(ClienteArchivoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////ClienteArchivoLogic.registrarAuditoriaDetallesClienteArchivo(connexion,clientearchivo,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(clientearchivo.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!clientearchivo.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,ClienteArchivoDataAccess.TABLENAME, clientearchivo.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////ClienteArchivoLogic.registrarAuditoriaDetallesClienteArchivo(connexion,clientearchivo,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,ClienteArchivoDataAccess.TABLENAME, clientearchivo.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(clientearchivo.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,ClienteArchivoDataAccess.TABLENAME, clientearchivo.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(ClienteArchivoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////ClienteArchivoLogic.registrarAuditoriaDetallesClienteArchivo(connexion,clientearchivo,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "Secuencia createSecuencia();", "public synchronized Boolean nuevoCliente(JSONObject persona,JSONObject cliente) throws ExceptionViajesCompartidos {\n\n\n //creo los objectos a partir de los JSON recibidos\n \tPersona p= new Persona(persona);\n \tCliente c= new Cliente(cliente);\n \t/*\n \ttry{\n\t\t\t iniciarTransaccion( );\n\t\t\t c.setPersona(p);\n\t\t\t System.out.println(\"id persona antes de insert: \"+p.getId_persona());\n\t\t\t entitymanager.persist(p);\n\t\t\t System.out.println(\"id persona despues de insert: \"+p.getId_persona());\n\t\t\t System.out.println(\"id cliente antes de insert: \"+c.getId_usuario());\n\t\t\t entitymanager.persist(c);\n\t\t\t System.out.println(\"id cliente despues de insert: \"+c.getId_usuario());\n\t\t\t Query qry = entitymanager.createNamedQuery(\"Rol.porNombre\");\n\t \t qry.setParameter(\"nombre\", \"cliente\");\n\t\t\t Rol r= (Rol) qry.getSingleResult();\n\t\t\t c.asignarRol(r);\n\t\t\t entitymanager.getTransaction( ).commit( );\t\n\t\t\t \n\t\t\t System.out.println(\"id persona despues de commit: \"+p.getId_persona());\n\t\t\t System.out.println(\"id cliente despues de commit: \"+c.getId_usuario());\n\t\t\t Rol rol_recien_asignado= c.getRoles().get(0).getRol();\n\t\t\t System.out.println(\"nombre del rol recien asignado: \"+rol_recien_asignado.getNombre_rol());\n\t\t\t \n\t\t\t return true;\n\t\t}catch(Exception e){\n\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t} \n\t\t*/\t\n\t\tthis.iniciarTransaccion();\n\t\t c.setPersona(p);\n\t\t c.setPuntos(0);\n\t\t c.setReputacion(3);\n\t\t entitymanager.persist(p);\n\t\t entitymanager.persist(c);\n\t\t Query qry = entitymanager.createNamedQuery(\"Rol.porNombre\");\n\t\t qry.setParameter(\"nombre\", \"cliente\");\n\t\t Rol r= (Rol) qry.getSingleResult();\n c.asignarRol(r);\n try{\n this.entitymanager.getTransaction().commit();\n return true;\n\n }catch(RollbackException e){\n String error= ManejadorErrores.parsearRollback(e);\n throw new ExceptionViajesCompartidos(\"ERROR: \"+error);\n }\n\t}", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,PresuTipoProyecto presutipoproyecto,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(PresuTipoProyectoConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(presutipoproyecto.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PresuTipoProyectoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PresuTipoProyectoLogic.registrarAuditoriaDetallesPresuTipoProyecto(connexion,presutipoproyecto,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(presutipoproyecto.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!presutipoproyecto.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////PresuTipoProyectoLogic.registrarAuditoriaDetallesPresuTipoProyecto(connexion,presutipoproyecto,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(presutipoproyecto.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PresuTipoProyectoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PresuTipoProyectoLogic.registrarAuditoriaDetallesPresuTipoProyecto(connexion,presutipoproyecto,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "@Override\n public Viagem save(Viagem viagem) {\n\n Viagem viagemDb = findByCliente(viagem.getCliente());\n\n if(viagemDb != null){\n throw getAlreadyExistException();\n }\n\n Veiculo veiculo = veiculoService.findVeiculoDisponivel();\n\n if(veiculo == null){\n throw new ServiceValidationException(\"Veiculo Indisponivel.\",\n \"veiculo_indisponivel\",\n \"veiculo\");\n }\n\n viagem.setId(UUID.randomUUID().toString());\n viagem.setVeiculo(veiculo);\n viagem.getVeiculo().setStatus(\"Em trânsito\");\n viagem.setStatus(\"Veiculo a caminho\");\n viagem.setValor(new BigDecimal(Math.random()*100).setScale(2, BigDecimal.ROUND_HALF_UP));\n viagem.setChegada((long) (Math.random()*100));\n\n /*\n * if throw DuplicateKeyException that means a concurrency issue to be treated.\n */\n try{\n veiculoService.atualizarStatusVeiculo(veiculo);\n Viagem viagemAdd = viagemRepository.insert(viagem);\n\n return viagemAdd;\n }catch (DuplicateKeyException ex ){\n logger.error(ex);\n throw getAlreadyExistException();\n }\n }", "private static void registrarAuditoriaDetallesClienteArchivo(Connexion connexion,ClienteArchivo clientearchivo)throws Exception {\n\t\t\r\n\t\tString strValorActual=null;\r\n\t\tString strValorNuevo=null;\r\n\t\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getid_cliente().equals(clientearchivo.getClienteArchivoOriginal().getid_cliente()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getid_cliente()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getid_cliente().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getid_cliente()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getid_cliente().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.IDCLIENTE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getid_tipo_archivo().equals(clientearchivo.getClienteArchivoOriginal().getid_tipo_archivo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getid_tipo_archivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getid_tipo_archivo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getid_tipo_archivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getid_tipo_archivo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.IDTIPOARCHIVO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getnombre().equals(clientearchivo.getClienteArchivoOriginal().getnombre()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getnombre();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getnombre() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.NOMBRE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getarchivo().equals(clientearchivo.getClienteArchivoOriginal().getarchivo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getarchivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getarchivo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getarchivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getarchivo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.ARCHIVO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getdescripcion().equals(clientearchivo.getClienteArchivoOriginal().getdescripcion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getdescripcion();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getdescripcion() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.DESCRIPCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t}", "@Test\n @Transactional\n void createTipoObraWithExistingId() throws Exception {\n tipoObra.setId(1L);\n\n int databaseSizeBeforeCreate = tipoObraRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restTipoObraMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(tipoObra)))\n .andExpect(status().isBadRequest());\n\n // Validate the TipoObra in the database\n List<TipoObra> tipoObraList = tipoObraRepository.findAll();\n assertThat(tipoObraList).hasSize(databaseSizeBeforeCreate);\n }", "@Test\n @Transactional\n void createTerritorioWithExistingId() throws Exception {\n territorio.setId(1L);\n\n int databaseSizeBeforeCreate = territorioRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restTerritorioMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(territorio)))\n .andExpect(status().isBadRequest());\n\n // Validate the Territorio in the database\n List<Territorio> territorioList = territorioRepository.findAll();\n assertThat(territorioList).hasSize(databaseSizeBeforeCreate);\n }", "@Test\n @Transactional\n void createInternacoesWithExistingId() throws Exception {\n internacoes.setId(1L);\n\n int databaseSizeBeforeCreate = internacoesRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restInternacoesMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(internacoes)))\n .andExpect(status().isBadRequest());\n\n // Validate the Internacoes in the database\n List<Internacoes> internacoesList = internacoesRepository.findAll();\n assertThat(internacoesList).hasSize(databaseSizeBeforeCreate);\n }", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,TarjetaCredito tarjetacredito,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(TarjetaCreditoConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(tarjetacredito.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,TarjetaCreditoDataAccess.TABLENAME, tarjetacredito.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(TarjetaCreditoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////TarjetaCreditoLogic.registrarAuditoriaDetallesTarjetaCredito(connexion,tarjetacredito,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(tarjetacredito.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!tarjetacredito.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,TarjetaCreditoDataAccess.TABLENAME, tarjetacredito.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////TarjetaCreditoLogic.registrarAuditoriaDetallesTarjetaCredito(connexion,tarjetacredito,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,TarjetaCreditoDataAccess.TABLENAME, tarjetacredito.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(tarjetacredito.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,TarjetaCreditoDataAccess.TABLENAME, tarjetacredito.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(TarjetaCreditoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////TarjetaCreditoLogic.registrarAuditoriaDetallesTarjetaCredito(connexion,tarjetacredito,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "private void testVolverAInsertarObservacion() throws SQLException \n\t{\n\t\tLong idObv = this.observacion.getIdObservation();\n\t\tLong idArea = this.observacion.getArea().getIdArea();\n\t\tLong idIndicador = this.observacion.getIndicator().getIdIndicator();\n\t\tLong idMedida = this.observacion.getMeasure().getIdMeasure();\n\t\tLong idProvider = this.observacion.getProvider().getIdOrganization();\n\t\tLong idTiempo = this.observacion.getTime().getIdTime();\n\t\t\n\t\t//Borrar los ids\n\t\tthis.observacion.setIdObservation(null);\n\t\tthis.observacion.getArea().setIdArea(null);\n\t\tthis.observacion.getIndicator().setIdIndicator(null);\n\t\tthis.observacion.getMeasure().setIdMeasure(null);\n\t\tthis.observacion.getProvider().setIdOrganization(null);\n\t\tthis.observacion.getTime().setIdTime(null);\n\t\t\n\t\t// Insertar la observacion\n\t\tObservacionesDAO obvDAO = PersistenceFactory.createObservacionesDAO();\n\t\tthis.observacion = obvDAO.insertarObservacion(this.observacion);\n\t\t\n\t\t//Comprobar que se les ha asignado el mismo id\n\t\tassertEquals(idObv, this.observacion.getIdObservation());\n\t\tassertEquals(idArea, this.observacion.getArea().getIdArea());\n\t\tassertEquals(idIndicador, this.observacion.getIndicator().getIdIndicator());\n\t\tassertEquals(idProvider, this.observacion.getProvider().getIdOrganization());\n\t\tassertEquals(idMedida, this.observacion.getMeasure().getIdMeasure());\n\t\tassertEquals(idTiempo,this.observacion.getTime().getIdTime());\n\t\t\n\t\t\n\t}", "private void caricaRegistrazione() {\n\t\tfor(MovimentoEP movimentoEP : primaNota.getListaMovimentiEP()){\n\t\t\t\n\t\t\tif(movimentoEP.getRegistrazioneMovFin() == null) { //caso di prime note libere.\n\t\t\t\tthrow new BusinessException(ErroreCore.OPERAZIONE_NON_CONSENTITA.getErrore(\"La prima nota non e' associata ad una registrazione.\"));\n\t\t\t}\n\t\t\t\n\t\t\tthis.registrazioneMovFinDiPartenza = registrazioneMovFinDad.findRegistrazioneMovFinById(movimentoEP.getRegistrazioneMovFin().getUid());\n\t\t\t\n\t\t}\n\t\t\n\t\tif(this.registrazioneMovFinDiPartenza.getMovimento() == null){\n\t\t\tthrow new BusinessException(\"Movimento non caricato.\");\n\t\t}\n\t\t\n\t}", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,DatoGeneralEmpleado datogeneralempleado,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(DatoGeneralEmpleadoConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(datogeneralempleado.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,DatoGeneralEmpleadoDataAccess.TABLENAME, datogeneralempleado.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(DatoGeneralEmpleadoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////DatoGeneralEmpleadoLogic.registrarAuditoriaDetallesDatoGeneralEmpleado(connexion,datogeneralempleado,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(datogeneralempleado.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!datogeneralempleado.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,DatoGeneralEmpleadoDataAccess.TABLENAME, datogeneralempleado.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////DatoGeneralEmpleadoLogic.registrarAuditoriaDetallesDatoGeneralEmpleado(connexion,datogeneralempleado,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,DatoGeneralEmpleadoDataAccess.TABLENAME, datogeneralempleado.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(datogeneralempleado.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,DatoGeneralEmpleadoDataAccess.TABLENAME, datogeneralempleado.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(DatoGeneralEmpleadoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////DatoGeneralEmpleadoLogic.registrarAuditoriaDetallesDatoGeneralEmpleado(connexion,datogeneralempleado,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "@Override\r\n public void crearCliente(Cliente cliente) throws Exception {\r\n entity.getTransaction().begin();//inicia la creacion\r\n entity.persist(cliente);//se crea el cliente\r\n entity.getTransaction().commit();//finaliza la creacion\r\n }", "public String save() {\r\n\t\ttry {\r\n\r\n\t\t\tif (obs != null && !obs.trim().isEmpty()) {\r\n\t\t\t\tconcurso.setObservacionReserva(obs);\r\n\t\t\t\tconcursoHome.setInstance(concurso);\r\n\t\t\t\tString res = concursoHome.update();\r\n\t\t\t}\r\n\r\n\t\t\tfor (PlantaCargoDetDTO dto : listaPlantaCargoDto) {\r\n\r\n\t\t\t\tif (dto.getReservar()) {\r\n\t\t\t\t\tEstadoDet est = buscarEstado(\"en reserva\");\r\n\t\t\t\t\tif (!existeEnDetalle(dto.getPlantaCargoDet(), est)) {\r\n\t\t\t\t\t\t// buscar\r\n\r\n\t\t\t\t\t\tConcursoPuestoDet p = new ConcursoPuestoDet();\r\n\t\t\t\t\t\tp.setActivo(true);\r\n\t\t\t\t\t\tp.setFechaAlta(new Date());\r\n\t\t\t\t\t\tp.setUsuAlta(usuarioLogueado.getCodigoUsuario());\r\n\t\t\t\t\t\tp.setNroOrden(2);\r\n\t\t\t\t\t\tp.setPlantaCargoDet(dto.getPlantaCargoDet());\r\n\r\n\t\t\t\t\t\tif (est != null)\r\n\t\t\t\t\t\t\tp.setEstadoDet(est);\r\n\t\t\t\t\t\tp.setConcurso(concursoHome.getInstance());\r\n\t\t\t\t\t\tem.persist(p);\r\n\r\n\t\t\t\t\t\tPlantaCargoDet planta = new PlantaCargoDet();\r\n\t\t\t\t\t\tplanta = dto.getPlantaCargoDet();\r\n\t\t\t\t\t\tplanta.setEstadoCab(est.getEstadoCab());\r\n\t\t\t\t\t\tplanta.setEstadoDet(est);\r\n\t\t\t\t\t\tem.merge(planta);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/* Incidencia 1079 */\r\n\t\t\t\trefreshListaPuestoReservados();\r\n\t\t\t\t/**/\r\n\t\t\t\tEstadoCab estadoCab = obtenerEstadosCabecera(\"VACANTE\");\r\n\t\t\t\tif (esta(dto.getPlantaCargoDet())) {\r\n\t\t\t\t\tConcursoPuestoDet p = new ConcursoPuestoDet();\r\n\t\t\t\t\tp = recuperarConcurso(dto.getPlantaCargoDet());\r\n\r\n\t\t\t\t\tif (!dto.getReservar()) {\r\n\t\t\t\t\t\tif (p.getConcursoPuestoAgr() != null) {\r\n\t\t\t\t\t\t\tstatusMessages.clear();\r\n\t\t\t\t\t\t\tstatusMessages.add(Severity.ERROR,\r\n\t\t\t\t\t\t\t\t\t\"El puesto pertenece a un grupo\");\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * p.setActivo(true); p.setNroOrden(1);\r\n\t\t\t\t\t\t * p.setFechaMod(new Date());\r\n\t\t\t\t\t\t * p.setUsuMod(usuarioLogueado.getCodigoUsuario());\r\n\t\t\t\t\t\t * EstadoDet est = buscarEstado(\"libre\");\r\n\t\t\t\t\t\t * p.setEstadoDet(est); em.merge(p);\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tPlantaCargoDet planta = new PlantaCargoDet();\r\n\t\t\t\t\t\tplanta = dto.getPlantaCargoDet();\r\n\t\t\t\t\t\tplanta.setEstadoCab(estadoCab);\r\n\t\t\t\t\t\tplanta.setEstadoDet(null);\r\n\t\t\t\t\t\tem.merge(planta);\r\n\t\t\t\t\t\tif (!concurso\r\n\t\t\t\t\t\t\t\t.getDatosEspecificosTipoConc()\r\n\t\t\t\t\t\t\t\t.getDescripcion()\r\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\r\n\t\t\t\t\t\t\t\t\t\tCONCURSO_INTERNO_INTERINSTITUCIONAL)\r\n\t\t\t\t\t\t\t\t&& planta.getPermanente())\r\n\t\t\t\t\t\t\treponerCategoriasController.reponerCategorias(p,\r\n\t\t\t\t\t\t\t\t\t\"PUESTO\", \"CONCURSO\");\r\n\t\t\t\t\t\tem.remove(p);\r\n\t\t\t\t\t\t// listaPlantaCargoDto.remove(dto);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tobs = null;\r\n\t\t\tem.flush();\r\n\t\t\tllenarListado1();\r\n\t\t\tstatusMessages.clear();\r\n\t\t\tstatusMessages.add(Severity.INFO, SeamResourceBundle.getBundle()\r\n\t\t\t\t\t.getString(\"GENERICO_MSG\"));\r\n\t\t\treturn \"persisted\";\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public void CrearNew(ActionEvent e) {\n List<Pensum> R = ejbFacade.existePensumID(super.getSelected().getIdpensum());\n if(R.isEmpty()){\n super.saveNew(e);\n }else{\n new Auxiliares().setMsj(3,\"PENSUM ID YA EXISTE\");\n }\n }", "@Test\r\n public void testCarregarPeloId() throws Exception {\r\n tx.begin();\r\n Categoria categoria = new Categoria(\"Teste carregar categoria por id\");\r\n dao.persiste(categoria);\r\n tx.commit();\r\n em.refresh(categoria);\r\n Long id = categoria.getId();\r\n Categoria result = dao.carregarPeloId(id);\r\n assertEquals(categoria, result);\r\n \r\n }", "@Test\n @Transactional\n void createAcheteurWithExistingId() throws Exception {\n acheteur.setId(1L);\n AcheteurDTO acheteurDTO = acheteurMapper.toDto(acheteur);\n\n int databaseSizeBeforeCreate = acheteurRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restAcheteurMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(acheteurDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Acheteur in the database\n List<Acheteur> acheteurList = acheteurRepository.findAll();\n assertThat(acheteurList).hasSize(databaseSizeBeforeCreate);\n }", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,PlantillaFactura plantillafactura,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(PlantillaFacturaConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(plantillafactura.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PlantillaFacturaDataAccess.TABLENAME, plantillafactura.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PlantillaFacturaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PlantillaFacturaLogic.registrarAuditoriaDetallesPlantillaFactura(connexion,plantillafactura,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(plantillafactura.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!plantillafactura.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,PlantillaFacturaDataAccess.TABLENAME, plantillafactura.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////PlantillaFacturaLogic.registrarAuditoriaDetallesPlantillaFactura(connexion,plantillafactura,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PlantillaFacturaDataAccess.TABLENAME, plantillafactura.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(plantillafactura.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PlantillaFacturaDataAccess.TABLENAME, plantillafactura.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PlantillaFacturaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PlantillaFacturaLogic.registrarAuditoriaDetallesPlantillaFactura(connexion,plantillafactura,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "public static Consumo insertConsumo(int cantidad_consumo,Date fecha_inicio,\n Producto producto,Servicio servicio){\n Consumo miConsumo = new Consumo(cantidad_consumo,fecha_inicio, \n producto, servicio);\n miConsumo.registrarConsumo();\n return miConsumo;\n }", "OperacionColeccion createOperacionColeccion();", "@Test\n @Transactional\n void createKpiWithExistingId() throws Exception {\n kpi.setId(1L);\n\n int databaseSizeBeforeCreate = kpiRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restKpiMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(kpi)))\n .andExpect(status().isBadRequest());\n\n // Validate the Kpi in the database\n List<Kpi> kpiList = kpiRepository.findAll();\n assertThat(kpiList).hasSize(databaseSizeBeforeCreate);\n }", "@Override\n public ComprobanteContable createComprobante(Aerolinea a, Boleto boleto, Cliente cliente, String tipo, NotaDebito nota) throws CRUDException {\n\n ComprobanteContable comprobante = new ComprobanteContable();\n //ComprobanteContablePK pk = new ComprobanteContablePK();\n //pk.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n\n //creamos el concepto\n StringBuilder buff = new StringBuilder();\n\n // DESCRIPCION \n // AEROLINEA/ # Boleto / Pasajero / Rutas\n buff.append(a.getNumero());\n\n buff.append(\"/\");\n\n //numero boleto\n buff.append(\"#\");\n buff.append(boleto.getNumero());\n buff.append(\"/\");\n\n //Pasajero\n buff.append(boleto.getNombrePasajero().toUpperCase());\n\n // Rutas\n buff.append(\"/\");\n buff.append(boleto.getIdRuta1() != null ? boleto.getIdRuta1() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta2() != null ? boleto.getIdRuta2() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta3() != null ? boleto.getIdRuta3() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta4() != null ? boleto.getIdRuta4() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta5() != null ? boleto.getIdRuta5() : \"\");\n\n //jala el nombre cliente\n comprobante.setIdCliente(cliente);\n comprobante.setConcepto(buff.toString());\n comprobante.setFactorCambiario(boleto.getFactorCambiario());\n comprobante.setFecha(boleto.getFechaEmision());\n comprobante.setFechaInsert(boleto.getFechaInsert());\n comprobante.setIdEmpresa(boleto.getIdEmpresa());\n comprobante.setIdUsuarioCreador(boleto.getIdUsuarioCreador());\n comprobante.setTipo(tipo);\n comprobante.setEstado(ComprobanteContable.EMITIDO);\n //comprobante.setComprobanteContablePK(pk);\n\n //ComprobanteContablePK numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n Integer numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n comprobante.setIdNumeroGestion(numero);\n comprobante.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n return comprobante;\n }", "public void salvarNoBanco() {\n\n try {\n ofertaDisciplinaFacade.save(oferta);\n// JsfUtil.addSuccessMessage(\"Pessoa \" + pessoa.getNome() + \" criado com sucesso!\");\n oferta= null;\n// recriarModelo();\n } catch (Exception e) {\n JsfUtil.addErrorMessage(e, \"Ocorreu um erro de persistência\");\n }\n }", "@Test\n\tpublic void finConsumerdByIdTest() {\n\t\twhen(consumerRepository.findById(CONSUMER_ID))\n//\t\t\t\t.thenReturn(Optional.of(CONSUMER));\n\t\t\t\t.then(invocation -> {\n\t\t\t\t\tConsumer consumer = new Consumer(CONSUMER_FIRST_NAME, CONSUMER_LAST_NAME);\n\t\t\t\t\tconsumer.setId(CONSUMER_ID);\n\t\t\t\t\treturn Optional.of(consumer);\n\t\t\t\t});\n\n\t\t/* invoca la ricerca del consumatore */\n\t\tConsumer consumer = consumerService.findById(CONSUMER_ID);\n\n\t\t/* verifica che il consumatore è stato trovato */\n\t\tverify(consumerRepository)\n\t\t\t\t.findById(same(CONSUMER_ID));\n\t\tassertThat(consumer.getFirstName()).isEqualTo(CONSUMER_FIRST_NAME);\n\t\tassertThat(consumer.getLastName()).isEqualTo(CONSUMER_LAST_NAME);\n\t}", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,ValorPorUnidad valorporunidad,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(ValorPorUnidadConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(valorporunidad.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,ValorPorUnidadDataAccess.TABLENAME, valorporunidad.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(ValorPorUnidadConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////ValorPorUnidadLogic.registrarAuditoriaDetallesValorPorUnidad(connexion,valorporunidad,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(valorporunidad.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!valorporunidad.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,ValorPorUnidadDataAccess.TABLENAME, valorporunidad.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////ValorPorUnidadLogic.registrarAuditoriaDetallesValorPorUnidad(connexion,valorporunidad,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,ValorPorUnidadDataAccess.TABLENAME, valorporunidad.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(valorporunidad.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,ValorPorUnidadDataAccess.TABLENAME, valorporunidad.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(ValorPorUnidadConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////ValorPorUnidadLogic.registrarAuditoriaDetallesValorPorUnidad(connexion,valorporunidad,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "private void criarConexao(){\n\n try {\n\n clientOpenHelper = new ClientOpenHelper(this);\n\n conexao = clientOpenHelper.getWritableDatabase();\n\n Snackbar.make(layoutMain, R.string.Aviso, Snackbar.LENGTH_SHORT)\n .setAction(R.string.ok,null)\n .show();\n clienteRepositorio = new ClienteRepositorio(conexao);\n }catch (SQLException ex){\n AlertDialog.Builder dlg = new AlertDialog.Builder(this);\n dlg.setTitle(\"Error\");\n dlg.setMessage(ex.getMessage());\n dlg.setNeutralButton(\"OK\",null);\n dlg.show();\n }\n }", "public boolean crearCliente(Cliente cliente) {\n\t\ttry{\n\t\t\tString insert = \"INSERT INTO clientes(nit, email, pais, fecharegistro, \"\n + \"razonsocial, idioma, categoria) VALUES ( ?, ?, ?, ?, ?, ?, ? );\";\n\t\t\tPreparedStatement ps = con.prepareStatement(insert);\n\t\t\tps.setString(1, cliente.getNit());\n ps.setString(2, cliente.getEmail());\n ps.setString(3, cliente.getPais());\n ps.setDate(4, new java.sql.Date(cliente.getFechaRegistro().getTime()));\n ps.setString(5, cliente.getRazonSocial());\n ps.setString(6, cliente.getIdioma());\n ps.setString(7, cliente.getCategoria());\n //para marca un punto de referencia en la transacción para hacer un ROLLBACK parcial. \n\t\t\tSavepoint sp1 = con.setSavepoint(\"SAVE_POINT_ONE\");\t\t\t\n\t\t\tps.executeUpdate();\t\n\t\t\tcon.commit();\n\t\t\treturn true;\n\t\t}catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "private void verificaIdade() {\r\n\t\thasErroIdade(idade.getText());\r\n\t\tisCanSave();\r\n\t}", "@Override\n public ComprobanteContable createComprobante(\n Aerolinea a, Boleto boleto, Cliente cliente, String tipo) throws CRUDException {\n Optional op;\n ComprobanteContable comprobante = new ComprobanteContable();\n //ComprobanteContablePK pk = new ComprobanteContablePK();\n //pk.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n comprobante.setEstado(ComprobanteContable.EMITIDO);\n //comprobante.setComprobanteContablePK(pk);\n //creamos el concepto\n StringBuilder buff = new StringBuilder();\n\n // DESCRIPCION \n // AEROLINEA/ # Boleto / Pasajero / Rutas\n buff.append(a.getNumero());\n\n buff.append(\"/\");\n\n //numero boleto\n buff.append(\"#\");\n buff.append(boleto.getNumero());\n buff.append(\"/\");\n\n //Pasajero\n buff.append(boleto.getNombrePasajero().toUpperCase());\n\n // Rutas\n buff.append(\"/\");\n buff.append(boleto.getIdRuta1() != null ? boleto.getIdRuta1() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta2() != null ? boleto.getIdRuta2() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta3() != null ? boleto.getIdRuta3() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta4() != null ? boleto.getIdRuta4() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta5() != null ? boleto.getIdRuta5() : \"\");\n\n //jala el nombre cliente\n comprobante.setIdCliente(cliente);\n comprobante.setConcepto(buff.toString());\n comprobante.setFactorCambiario(boleto.getFactorCambiario());\n comprobante.setFecha(boleto.getFechaEmision());\n comprobante.setFechaInsert(boleto.getFechaInsert());\n comprobante.setIdEmpresa(boleto.getIdEmpresa());\n comprobante.setIdUsuarioCreador(boleto.getIdUsuarioCreador());\n comprobante.setTipo(tipo);\n\n //ComprobanteContablePK numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n Integer numero = getNextComprobantePK(boleto.getFechaEmision(), tipo);\n comprobante.setIdNumeroGestion(numero);\n comprobante.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n\n return comprobante;\n }", "@Test\r\n\tpublic void addToDb() {\r\n\t\tservice.save(opinion);\r\n\t\tassertNotEquals(opinion.getId(), 0);\r\n\t\tassertTrue(service.exists(opinion.getId()));\r\n\t}", "@Override\r\n\tpublic void save(ComercialSolicitudServicioAlCliente comercialSolicitudServicioAlCliente) {\n\t\trepository.save(comercialSolicitudServicioAlCliente);\r\n\t}", "public String crearProducto(String id, String nombre, String precio, String idCategoria, \n String estado, String descripcion) {\n \n String validacion = \"\";\n if (verificarCamposVacios(id, nombre, precio, idCategoria, estado, descripcion) == false) {\n //Se crea en EntityManagerFactory con el nombre de nuestra unidad de persistencia\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"SG-RESTPU\");\n //se crea un objeto producto y se le asignan sus atributos\n if (verificarValoresNum(id,precio,idCategoria)) {\n //Se crea el controlador de la categoria del producto\n CategoriaProductoJpaController daoCategoriaProducto = new CategoriaProductoJpaController(emf);\n CategoriaProducto categoriaProducto = daoCategoriaProducto.findCategoriaProducto(Integer.parseInt(idCategoria));\n //se crea el controlador del producto \n ProductoJpaController daoProducto = new ProductoJpaController(emf);\n Producto producto = new Producto(Integer.parseInt(id), nombre);\n producto.setPrecio(Long.parseLong(precio));\n producto.setIdCategoria(categoriaProducto);\n producto.setDescripcion(descripcion);\n producto.setFotografia(copiarImagen());\n if (estado.equalsIgnoreCase(\"Activo\")) {\n producto.setEstado(true);\n } else {\n producto.setEstado(false);\n }\n try {\n if (ExisteProducto(nombre) == false) {\n daoProducto.create(producto);\n deshabilitar();\n limpiar();\n validacion = \"El producto se agrego exitosamente\";\n } else {\n validacion = \"El producto ya existe\";\n }\n } catch (NullPointerException ex) {\n limpiar();\n } catch (Exception ex) {\n Logger.getLogger(Gui_empleado.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n validacion = \"El campo id, precio, idCategoria deben ser numéricos\";\n }\n } else {\n validacion = \"Llene los datos obligatorios\";\n }\n return validacion;\n }", "private void saveNewCatalog() {\n\n\t}", "private static void registrarAuditoriaDetallesPresuTipoProyecto(Connexion connexion,PresuTipoProyecto presutipoproyecto)throws Exception {\n\t\t\r\n\t\tString strValorActual=null;\r\n\t\tString strValorNuevo=null;\r\n\t\t\r\n\t\t\t\r\n\t\t\tif(presutipoproyecto.getIsNew()||!presutipoproyecto.getid_empresa().equals(presutipoproyecto.getPresuTipoProyectoOriginal().getid_empresa()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(presutipoproyecto.getPresuTipoProyectoOriginal().getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=presutipoproyecto.getPresuTipoProyectoOriginal().getid_empresa().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(presutipoproyecto.getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=presutipoproyecto.getid_empresa().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PresuTipoProyectoConstantesFunciones.IDEMPRESA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(presutipoproyecto.getIsNew()||!presutipoproyecto.getcodigo().equals(presutipoproyecto.getPresuTipoProyectoOriginal().getcodigo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(presutipoproyecto.getPresuTipoProyectoOriginal().getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=presutipoproyecto.getPresuTipoProyectoOriginal().getcodigo();\r\n\t\t\t\t}\r\n\t\t\t\tif(presutipoproyecto.getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=presutipoproyecto.getcodigo() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PresuTipoProyectoConstantesFunciones.CODIGO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(presutipoproyecto.getIsNew()||!presutipoproyecto.getnombre().equals(presutipoproyecto.getPresuTipoProyectoOriginal().getnombre()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(presutipoproyecto.getPresuTipoProyectoOriginal().getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=presutipoproyecto.getPresuTipoProyectoOriginal().getnombre();\r\n\t\t\t\t}\r\n\t\t\t\tif(presutipoproyecto.getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=presutipoproyecto.getnombre() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PresuTipoProyectoConstantesFunciones.NOMBRE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t}", "@Test\n @Transactional\n void createSectieWithExistingId() throws Exception {\n sectie.setId(1L);\n\n int databaseSizeBeforeCreate = sectieRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restSectieMockMvc\n .perform(\n post(ENTITY_API_URL).with(csrf()).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(sectie))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the Sectie in the database\n List<Sectie> sectieList = sectieRepository.findAll();\n assertThat(sectieList).hasSize(databaseSizeBeforeCreate);\n\n // Validate the Sectie in Elasticsearch\n verify(mockSectieSearchRepository, times(0)).save(sectie);\n }", "void saveChangesTo(Consumer consumer) throws RegistrationException;", "@Override\n public ScontrinoDtoIll trovaEan(String ean, Scontrino sc) {\n Prodotto p = anagraficaProdottiRepository.findByEan(ean);\n if (p == null) {\n //se non è stato trovato alcun prodotto recupero il dto e\n //spedisco un messaggio di errore\n return new ScontrinoDtoIll(null, null, \"prodotto non trovato\");\n }\n //se invece è stato trovato un prodotto devo associarlo alla\n //riga scontrino che è a sua volta associata ad uno scontrino\n // quindi recupero lo scontrino ...\n if (sc != null) {\n sc = scontrinoRepository.findById(sc.getId()).get();\n //return new ScontrinoDtoIll(null, null, \"prodotto trovato\");\n }\n // se non esiste lo scontrino lo creo ...\n if (sc == null) {\n sc = new Scontrino();\n sc = scontrinoRepository.save(sc);\n }\n\n // creo la riga e la salvo ...\n RigaScontrino r = new RigaScontrino();\n r = rigaRepository.save(r);\n r.setProdotto(p);\n r.setScontrino(sc);\n r = rigaRepository.save(r);\n\n // aggiungo la riga allo scontrino\n sc.getRigheScontrino().add(r);\n sc = scontrinoRepository.save(sc);\n\n // creo il DTO con i dati da ritornare al client\n ScontrinoDtoIll risp = new ScontrinoDtoIll();\n Set<RigaScontrino> righe = sc.getRigheScontrino();\n List<RigaScontrinoClientDto> righeDto = new ArrayList<>();\n // trasformo le righe originali dello scontrino in righe del DTO\n righe.forEach(rr\n -> righeDto.add(\n new RigaScontrinoClientDto(\n rr.getId(),\n rr.getScontrino().getId(),\n p.getId(),\n rr.getProdotto().getDescrizione(),\n rr.getProdotto().getPrezzo())));\n\n risp.setRigheScontrino(righeDto);\n risp.setScontrino(sc);\n risp.setMessaggio(\"scontrino pronto!\");\n\n return risp;\n }", "@Override\n\n public void run(String... strings) throws Exception {\n \n Usuario u= new Usuario(1521L, \"Viridiana Hernandez\",\"[email protected]\");\n \n //la guardamos\n \n // repoUsu.save(u);\n \n //GENERAMOS LA DIRECCION QUE VAMOS A GUARDAR\n \n Direccion d = new Direccion(new Usuario(1521L),\"Calle 13\", 55120, \"Ecatepec\");\n //repoDir.save(d);\n \n \n //AQUI HAREMOS EL JOIN\n \n \n Direccion d2= repoDir.findOne(2L);\n System.out.println(\"Correo:\"+d2.getU().getEmail()+ \" municipio \"+d2.getMunicipio());\n \n \n \n \n \n \n //repoMensa.save (new Mensajito(\"Primero\",\"Mi primera vez con hibernate\"))\n /*\n Mensajito m= repoMensa.findOne(1);\n System.out.println(m.getTitulo());\n \n \n \n // repoMensa.save(new Mensajito(\"17 de octubre\",\"No temblo\"));\n System.out.println(\"vamos a uscar todos\");\n \n for (Mensajito mensa:repoMensa.findAll()){\n System.out.println(mensa);\n \n }\n \n //para buscar por id FINDONE\n System.out.println(\"vamos a buscar por id\");\n System.out.println(repoMensa.findOne(1));\n \n \n // Actualizar \n repoMensa.save(new Mensajito(1,\"nuevo titulo\",\"nuevo cuerpo\"));\n System.out.println(repoMensa.findOne(1));\n*/\n }", "public void SalvarNovaPessoa(){\r\n \r\n\t\tpessoaModel.setUsuarioModel(this.usuarioController.GetUsuarioSession());\r\n \r\n\t\t//INFORMANDO QUE O CADASTRO FOI VIA INPUT\r\n\t\tpessoaModel.setOrigemCadastro(\"I\");\r\n \r\n\t\tpessoaRepository.SalvarNovoRegistro(this.pessoaModel);\r\n \r\n\t\tthis.pessoaModel = null;\r\n \r\n\t\tUteis.MensagemInfo(\"Registro cadastrado com sucesso\");\r\n \r\n\t}", "Persistencia() {\n\t}", "@Test\n @Transactional\n void createEnseignerWithExistingId() throws Exception {\n enseigner.setId(1L);\n\n int databaseSizeBeforeCreate = enseignerRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restEnseignerMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(enseigner)))\n .andExpect(status().isBadRequest());\n\n // Validate the Enseigner in the database\n List<Enseigner> enseignerList = enseignerRepository.findAll();\n assertThat(enseignerList).hasSize(databaseSizeBeforeCreate);\n }", "@Override\n public boolean create(Revue objet) {\n return false;\n }", "@Override\n\tpublic Comprobante save(Comprobante entity) throws Exception {\n\t\treturn comproRepository.save(entity);\n\t}", "@Override\n public ComprobanteContable createAsientoDiarioBoleto(Boleto boleto) throws CRUDException {\n\n Optional op;\n ComprobanteContable comprobante = new ComprobanteContable();\n //ComprobanteContablePK pk = new ComprobanteContablePK();\n //pk.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n comprobante.setEstado(ComprobanteContable.EMITIDO);\n //comprobante.setComprobanteContablePK(pk);\n\n //creamos el concepto\n StringBuilder buff = new StringBuilder();\n\n // DESCRIPCION \n // AEROLINEA/ # Boleto / Pasajero / Rutas\n /*Aerolinea a = em.find(Aerolinea.class, boleto.getIdAerolinea().getIdAerolinea());\n if (a != null) {\n buff.append(a.getNumero());\n }*/\n buff.append(boleto.getIdAerolinea().getNumero());\n\n buff.append(\"/\");\n\n //numero boleto\n buff.append(\"#\");\n buff.append(boleto.getNumero());\n buff.append(\"/\");\n\n //Pasajero\n buff.append(boleto.getNombrePasajero().toUpperCase());\n\n // Rutas \n buff.append(\"/\");\n buff.append(boleto.getIdRuta1() != null ? boleto.getIdRuta1() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta2() != null ? boleto.getIdRuta2() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta3() != null ? boleto.getIdRuta3() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta4() != null ? boleto.getIdRuta4() : \"\");\n buff.append(\"/\");\n buff.append(boleto.getIdRuta5() != null ? boleto.getIdRuta5() : \"\");\n\n //jala el nombre cliente\n Cliente c = em.find(Cliente.class, boleto.getIdCliente().getIdCliente());\n op = Optional.ofNullable(c);\n\n if (!op.isPresent()) {\n throw new CRUDException(\"No se encontro un Cliente para el boleto\");\n }\n\n comprobante.setIdCliente(c);\n comprobante.setConcepto(buff.toString());\n comprobante.setFactorCambiario(boleto.getFactorCambiario());\n comprobante.setFecha(boleto.getFechaEmision());\n comprobante.setFechaInsert(boleto.getFechaInsert());\n comprobante.setIdEmpresa(boleto.getIdEmpresa());\n comprobante.setIdUsuarioCreador(boleto.getIdUsuarioCreador());\n comprobante.setTipo(ComprobanteContable.Tipo.ASIENTO_DIARIO);\n\n Integer numero = getNextComprobantePK(boleto.getFechaEmision(), ComprobanteContable.Tipo.ASIENTO_DIARIO);\n comprobante.setGestion(DateContable.getPartitionDateInt(DateContable.getDateFormat(boleto.getFechaEmision(), DateContable.LATIN_AMERICA_FORMAT)));\n comprobante.setIdNumeroGestion(numero);\n\n return comprobante;\n }", "@Test\n @Transactional\n void createProducerWithExistingId() throws Exception {\n producer.setId(1L);\n ProducerDTO producerDTO = producerMapper.toDto(producer);\n\n int databaseSizeBeforeCreate = producerRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restProducerMockMvc\n .perform(\n post(ENTITY_API_URL)\n .with(csrf())\n .contentType(MediaType.APPLICATION_JSON)\n .content(TestUtil.convertObjectToJsonBytes(producerDTO))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the Producer in the database\n List<Producer> producerList = producerRepository.findAll();\n assertThat(producerList).hasSize(databaseSizeBeforeCreate);\n }", "public void reabrirContrato() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Nao existe hospedes cadastrados\\n\");\n } else {\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//hospede\n if (hospedesCadastrados.get(i).getContrato().isSituacao()) {//verifica se o contrato já estpa aberto\n System.err.println(\"O contrado desse hospede já encontra-se aberto\");\n\n } else {//caso o contrato encontre-se fechado\n hospedesCadastrados.get(i).getContrato().setSituacao(true);\n System.err.println(\"Contrato reaberto, agora voce pode reusufruir de nossos servicos!\");\n }\n }\n }\n }\n }", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,GrupoBodega grupobodega,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(GrupoBodegaConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(grupobodega.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(GrupoBodegaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////GrupoBodegaLogic.registrarAuditoriaDetallesGrupoBodega(connexion,grupobodega,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(grupobodega.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!grupobodega.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////GrupoBodegaLogic.registrarAuditoriaDetallesGrupoBodega(connexion,grupobodega,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(grupobodega.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(GrupoBodegaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////GrupoBodegaLogic.registrarAuditoriaDetallesGrupoBodega(connexion,grupobodega,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "private void checkInseribilitaEvento(Long idSoggetto, DecorsoForElenco decorso) {\n\t\t\n\t\tif(idSoggetto == null || idSoggetto <= 0) {\n\t\t\tlog.info(\"Decorso senza idSoggetto\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(decorso == null || decorso.getIdTipoEvento() == null) {\n\t\t\tlog.info(\"ID Tipo Evento obbligatorio\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//recupero gli eventi del soggetto\n\t\tList<DecorsoForElenco> listDecorsi = decorsoMapper.selectForElencoByIdSoggetto(idSoggetto);\n\t\t\n\t\t//se l'evento che si vuole inserire è DECESSO\n\t\tif(decorso.getIdTipoEvento().intValue() == ID_TIPO_EVENTO_DECEDUTO_COVID\n\t\t\t|| decorso.getIdTipoEvento().intValue() == ID_TIPO_EVENTO_DECEDUTO_NON_COVID) {\n\t\t\t\n\t\t\tfor(DecorsoForElenco dfe : listDecorsi) {\n\t\t\t\t\n\t\t\t\t//verifico che non ci sia già un altro decesso inserito\n\t\t\t\tif(dfe.getIdTipoEvento()!=null && \n\t\t\t\t\t\t(dfe.getIdTipoEvento().intValue() == ID_TIPO_EVENTO_DECEDUTO_COVID\n\t\t\t\t\t\t|| dfe.getIdTipoEvento().intValue() == ID_TIPO_EVENTO_DECEDUTO_NON_COVID)) {\n\t\t\t\t\tlog.info(\"Impossibile inserire decesso per soggetto \"+idSoggetto+\". Un evento decesso è già presente per questo soggetto.\");\n\t\t\t\t\tthrow new WebApplicationException(\n\t\t\t\t\t\t\tResponse.status(Status.BAD_REQUEST)\n\t\t\t\t\t\t\t.entity(new Message(\"Impossibile inserire decesso per soggetto \"+idSoggetto+\". Un evento decesso è già presente per questo soggetto.\")).build());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//controllo che non ci siano eventi con inizio successivo al decesso\n\t\t\t\tif(dfe.getDataDimissioni()!=null && \n\t\t\t\t\tdfe.getDataDimissioni().after(decorso.getDataDimissioni()) ) {\n\t\t\t\t\tlog.info(\"Impossibile inserire decesso per soggetto \"+idSoggetto+\". Esistono altri decorsi con data di inizio successiva al decesso.\");\n\t\t\t\t\tthrow new WebApplicationException(\n\t\t\t\t\t\t\tResponse.status(Status.BAD_REQUEST)\n\t\t\t\t\t\t\t.entity(new Message(\"Impossibile inserire decesso per soggetto \"+idSoggetto+\". Esistono altri decorsi con data di inizio successiva al decesso.\")).build());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//se l'evento che si vuole inserire NON è un decesso\n\t\tif(decorso.getIdTipoEvento().intValue() != ID_TIPO_EVENTO_DECEDUTO_COVID\n\t\t\t&& decorso.getIdTipoEvento().intValue() != ID_TIPO_EVENTO_DECEDUTO_NON_COVID) {\n\t\t\t\n\t\t\tfor(DecorsoForElenco dfe : listDecorsi) {\n\t\t\t\t\n\t\t\t\t//verifico che non ci sia già un decesso inserito\n\t\t\t\tif(dfe.getIdTipoEvento()!=null && \n\t\t\t\t\t\t(dfe.getIdTipoEvento().intValue() == ID_TIPO_EVENTO_DECEDUTO_COVID\n\t\t\t\t\t\t|| dfe.getIdTipoEvento().intValue() == ID_TIPO_EVENTO_DECEDUTO_NON_COVID)) {\n\t\t\t\t\tlog.info(\"Impossibile inserire decorso per soggetto \"+idSoggetto+\". Un evento decesso è presente per questo soggetto.\");\n\t\t\t\t\tthrow new WebApplicationException(\n\t\t\t\t\t\t\tResponse.status(Status.BAD_REQUEST)\n\t\t\t\t\t\t\t.entity(new Message(\"Impossibile inserire decorso per soggetto \"+idSoggetto+\". Un evento decesso è presente per questo soggetto.\")).build());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Test\n @Transactional\n void createPrestamoWithExistingId() throws Exception {\n prestamo.setId(1L);\n PrestamoDTO prestamoDTO = prestamoMapper.toDto(prestamo);\n\n int databaseSizeBeforeCreate = prestamoRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restPrestamoMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(prestamoDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Prestamo in the database\n List<Prestamo> prestamoList = prestamoRepository.findAll();\n assertThat(prestamoList).hasSize(databaseSizeBeforeCreate);\n }", "@Test\n\tpublic void nuevoTest() {\n\t\tFactura resultadoObtenido = sut.nuevo(facturaSinId);\n\t\t//resuladoObtenido es unicamente dependiente de nuestro algoritmo\n\t\t\n\t\t//Validar\n\t\tassertEquals(facturaConId.getId(), resultadoObtenido.getId());\n\t\t\n\t}", "public void persistir(Cliente cliente){\n }", "private DocumentoProcesoDTO registrarDocumentoSolicitudBien(EnumTipoDocumentoGenerado tipoDocGenerado,\n TrazabilidadProcesoDTO traza, OficioBienDTO oficioBienDTO, EnumTipoDocumentoProceso tipoDocProceso,\n String responsableGeneracion) throws CirculemosAlertaException {\n // Genera documento\n GeneraDocumentoDTO generaDocumento = new GeneraDocumentoDTO();\n generaDocumento.setFechaGeneracion(oficioBienDTO.getFechaGeneracion());\n generaDocumento.setIdTipoDocumentoGenerado(tipoDocGenerado);\n Object[] valoresParametros = { oficioBienDTO.getId() };\n generaDocumento.setValoresParametros(valoresParametros);\n Long idDocumento = iRDocumentosCirculemos.generarDocumento(generaDocumento);\n\n // Guarda el documento generado\n DocumentoProcesoDTO documentoProceso = new DocumentoProcesoDTO();\n documentoProceso.setNumeroDocumento(idDocumento);\n documentoProceso.setTrazabilidadProceso(traza);\n TipoDocumentoProcesoDTO tipoDocumento = new TipoDocumentoProcesoDTO();\n tipoDocumento.setId(tipoDocProceso.getValue());\n documentoProceso.setTipoDocumento(tipoDocumento);\n // Responsable de la generacion de los documentos\n documentoProceso.setResponsableGeneracion(responsableGeneracion);\n documentoProceso = iRFachadaProceso.registrarDocumento(documentoProceso);\n return documentoProceso;\n }", "@Override\n public Viagem update(Viagem viagem) {\n\n try{\n\n if(\"FINALIZAR\".equals(viagem.getStatus())){\n viagem.getVeiculo().setStatus(\"Livre\");\n viagem.setCliente(viagem.getCliente()+\" Finalizado \"+System.currentTimeMillis());\n veiculoService.atualizarStatusVeiculo(viagem.getVeiculo());\n }\n\n return viagemRepository.save(viagem);\n }catch (DuplicateKeyException ex ){\n logger.error(ex);\n throw getAlreadyExistException();\n }\n }", "public void GuardarSerologia(RecepcionSero obj)throws Exception{\n Session session = sessionFactory.getCurrentSession();\n session.saveOrUpdate(obj);\n }", "@Override\n\tpublic int create(Proveedor r) {\n\t\treturn 0;\n\t}", "public boolean save() {\n\n return this.consumer.getDataConnector().saveConsumerNonce(this);\n\n }", "@Override\n\tpublic void save(CorsoDiLaurea corso) {\n\t\t\n\t}", "private static void registrarAuditoriaDetallesTarjetaCredito(Connexion connexion,TarjetaCredito tarjetacredito)throws Exception {\n\t\t\r\n\t\tString strValorActual=null;\r\n\t\tString strValorNuevo=null;\r\n\t\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_empresa().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_empresa()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_empresa().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_empresa().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDEMPRESA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_sucursal().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_sucursal()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_sucursal()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_sucursal().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_sucursal()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_sucursal().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDSUCURSAL,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_banco().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_banco()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_banco()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_banco().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_banco()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_banco().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDBANCO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getcodigo().equals(tarjetacredito.getTarjetaCreditoOriginal().getcodigo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getcodigo();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getcodigo() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.CODIGO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getnombre().equals(tarjetacredito.getTarjetaCreditoOriginal().getnombre()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getnombre();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getnombre() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.NOMBRE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getnombre_corto().equals(tarjetacredito.getTarjetaCreditoOriginal().getnombre_corto()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getnombre_corto()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getnombre_corto();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getnombre_corto()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getnombre_corto() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.NOMBRECORTO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getdigito_valido().equals(tarjetacredito.getTarjetaCreditoOriginal().getdigito_valido()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getdigito_valido()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getdigito_valido().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getdigito_valido()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getdigito_valido().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.DIGITOVALIDO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getdigito_tarjeta().equals(tarjetacredito.getTarjetaCreditoOriginal().getdigito_tarjeta()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getdigito_tarjeta()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getdigito_tarjeta().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getdigito_tarjeta()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getdigito_tarjeta().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.DIGITOTARJETA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getcomision().equals(tarjetacredito.getTarjetaCreditoOriginal().getcomision()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getcomision()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getcomision().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getcomision()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getcomision().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.COMISION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getinteres().equals(tarjetacredito.getTarjetaCreditoOriginal().getinteres()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getinteres()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getinteres().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getinteres()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getinteres().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.INTERES,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getmonto_minimo().equals(tarjetacredito.getTarjetaCreditoOriginal().getmonto_minimo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getmonto_minimo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getmonto_minimo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getmonto_minimo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getmonto_minimo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.MONTOMINIMO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getporcentaje_retencion().equals(tarjetacredito.getTarjetaCreditoOriginal().getporcentaje_retencion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getporcentaje_retencion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getporcentaje_retencion().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getporcentaje_retencion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getporcentaje_retencion().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.PORCENTAJERETENCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getcomision_retencion().equals(tarjetacredito.getTarjetaCreditoOriginal().getcomision_retencion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getcomision_retencion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getcomision_retencion().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getcomision_retencion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getcomision_retencion().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.COMISIONRETENCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getes_retencion_redondeo().equals(tarjetacredito.getTarjetaCreditoOriginal().getes_retencion_redondeo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getes_retencion_redondeo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getes_retencion_redondeo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getes_retencion_redondeo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getes_retencion_redondeo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.ESRETENCIONREDONDEO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getes_pago_banco_redondeo().equals(tarjetacredito.getTarjetaCreditoOriginal().getes_pago_banco_redondeo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getes_pago_banco_redondeo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getes_pago_banco_redondeo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getes_pago_banco_redondeo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getes_pago_banco_redondeo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.ESPAGOBANCOREDONDEO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getes_comision_redondeo().equals(tarjetacredito.getTarjetaCreditoOriginal().getes_comision_redondeo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getes_comision_redondeo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getes_comision_redondeo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getes_comision_redondeo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getes_comision_redondeo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.ESCOMISIONREDONDEO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_tipo_retencion().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_tipo_retencion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_tipo_retencion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_tipo_retencion().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_tipo_retencion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_tipo_retencion().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDTIPORETENCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_cuenta_contable().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_cuenta_contable()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_cuenta_contable()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_cuenta_contable().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_cuenta_contable()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_cuenta_contable().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDCUENTACONTABLE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_tipo_retencion_iva().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_tipo_retencion_iva()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_tipo_retencion_iva()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_tipo_retencion_iva().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_tipo_retencion_iva()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_tipo_retencion_iva().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDTIPORETENCIONIVA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_cuenta_contable_comision().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_cuenta_contable_comision()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_cuenta_contable_comision()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_cuenta_contable_comision().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_cuenta_contable_comision()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_cuenta_contable_comision().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDCUENTACONTABLECOMISION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_formula_pago_banco().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_formula_pago_banco()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_formula_pago_banco()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_formula_pago_banco().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_formula_pago_banco()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_formula_pago_banco().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDFORMULAPAGOBANCO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_cuenta_contable_diferencia().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_cuenta_contable_diferencia()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_cuenta_contable_diferencia()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_cuenta_contable_diferencia().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_cuenta_contable_diferencia()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_cuenta_contable_diferencia().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDCUENTACONTABLEDIFERENCIA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_formula_retencion().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_formula_retencion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_formula_retencion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_formula_retencion().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_formula_retencion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_formula_retencion().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDFORMULARETENCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(tarjetacredito.getIsNew()||!tarjetacredito.getid_formula_comision().equals(tarjetacredito.getTarjetaCreditoOriginal().getid_formula_comision()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(tarjetacredito.getTarjetaCreditoOriginal().getid_formula_comision()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=tarjetacredito.getTarjetaCreditoOriginal().getid_formula_comision().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(tarjetacredito.getid_formula_comision()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=tarjetacredito.getid_formula_comision().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),TarjetaCreditoConstantesFunciones.IDFORMULACOMISION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t}", "@PostMapping(\"/provider-commands\")\n @Timed\n @Transactional(readOnly = false)\n public ResponseEntity<ProviderCommand> createProviderCommand(@Valid @RequestBody ProviderCommand providerCommand) throws URISyntaxException {\n log.debug(\"REST request to save ProviderCommand : {}\", providerCommand);\n if (providerCommand.getId() != null) {\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, \"idexists\", \"A new providerCommand cannot already have an ID\")).body(null);\n }\n //check nested info and then save\n Provider provider = providerCommand.getProvider();\n if (provider.getId() != null) {\n //get from db\n providerCommand.setProvider(providerService.findOne(provider.getId()));\n } else {\n //este si puede ser null\n }\n\n CommunicationStandard communicationStandard = providerCommand.getCommunicationStandard();\n if (communicationStandard.getId() != null) {\n providerCommand.setCommunicationStandard(communicationStandardService.findOne(communicationStandard.getId()));\n\n //providerCommand.setCommunicationStandard(null);\n }\n Command command = providerCommand.getCommand();\n if (command.getId() != null) {\n providerCommand.setCommand(commandService.findOne(command.getId()));\n }\n\n Set<SecurityParams> securityParams = new HashSet<>();\n ServiceSecurity serviceSec = serviceSecurityService.findOne(providerCommand.getServiceSecurity().getId());\n if(providerCommand.getServiceSecurity().getSecurityParams() != null && providerCommand.getServiceSecurity().getSecurityParams().size() > 0){\n for(SecurityParams paramSec :providerCommand.getServiceSecurity().getSecurityParams()){\n securityParams.add(paramSec);\n }\n }\n\n ServiceSecurity serviceSecurity = providerCommand.getServiceSecurity();\n if (serviceSecurity.getId() != null) {\n //serviceSecurityService.save(serviceSecurity);\n providerCommand.setServiceSecurity(serviceSecurityService.findOne(serviceSecurity.getId()));\n }\n\n\n ProviderCommand savedCommand = providerCommandService.save(providerCommand);\n\n for(SecurityParams param:securityParams){\n param.setServiceSecurity(serviceSec);\n param.setProviderCommand(savedCommand);\n securityParamsService.save(param);\n }\n\n Set<ProviderResponse> providerResponses = providerCommand.getProviderResponses();\n if (providerResponses != null && providerResponses.size() > 0) {\n for (ProviderResponse providerResponse : providerResponses) {\n providerResponse.setProviderCommand(savedCommand);\n providerResponseService.save(providerResponse);\n }\n }\n\n Set<RequestParameter> requestParameters = providerCommand.getRequestParameters();\n if (requestParameters != null && requestParameters.size() > 0) {\n for (RequestParameter requestParameter : requestParameters) {\n requestParameter.setProviderCommand(savedCommand);\n requestParameterService.save(requestParameter);\n }\n }\n\n\n\n return ResponseEntity.ok()\n .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, providerCommand.getId().toString()))\n .body(null);\n\n }", "private void criarConexao(){\n try{\n testeOpenHelper = new TesteOpenHelper(this);\n conexao = testeOpenHelper.getWritableDatabase();\n Toast.makeText(this,\"Conexao executada com sucesso\", Toast.LENGTH_SHORT).show();\n produtoRepositorio = new ProdutoRepositorio(conexao);\n }catch(SQLException e){\n AlertDialog.Builder dlg = new AlertDialog.Builder(this);\n dlg.setTitle(\"Erro\");\n dlg.setMessage(e.getMessage());\n dlg.setNeutralButton(\"Ok\", null);\n dlg.show();\n Toast.makeText(this,\"ERRO na conexao\", Toast.LENGTH_LONG).show();\n }\n }", "com.soa.SolicitarServicioDocument.SolicitarServicio addNewSolicitarServicio();", "@Override\n @Transactional\n public Producto save(Producto producto) {\n Presentacion presentacion = presentacionDao.findById(producto.getPresentacion().getId());\n producto.setPresentacion(presentacion);\n return productoDao.save(producto);\n }", "private void persistirRemessaC17() throws Exception {\n if (this.remessa == null || this.remessa.getId() == null) { \n this.remessa = new RemessaVO();\n this.remessa.setDataHoraAbertura(new Date());\n this.remessa.setCodigoUsuarioAbertura(this.usuario.getNuMatricula());\n this.remessa.setUnidadeSolicitante(unidadeServiceRef.findUnidadeLotacaoUsuarioLogado());\n this.remessa = remessaService.salvarRascunhoRemessaAB(this.remessa);\n }\n }", "public boolean salvarVeiculo(Veiculo veiculo){\n\t\treturn veiculoDAO.persist(veiculo);\n\t\t\n\t}", "@Test\n public void testCrear() {\n System.out.println(\"crear\");\n Repositorio repo = new RepositorioImpl();\n Persona persona = new Persona();\n persona.setNombre(\"Hugo\");\n persona.setApellido(\"González\");\n persona.setNumeroDocumento(\"4475199\");\n repo.crear(persona);\n Persona p = (Persona) repo.buscar(persona.getId());\n assertEquals(p, persona);\n }", "private void saveClientePasajero(Boleto b) throws CRUDException {\n if (b.getIdCliente() != null) {\n ClientePasajero cp = createClientePasajero(b);\n HashMap<String, Object> parpas = new HashMap<>();\n parpas.put(\"idCliente\", b.getIdCliente().getIdCliente());\n parpas.put(\"nombrePasajero\", b.getNombrePasajero());\n\n List search = get(\"ClientePasajero.findPasajero\", ClientePasajero.class, parpas);\n if (search.isEmpty()) {\n cp.setIdClientePasajero(insert(cp));\n }//else ya existe el cliente\n }\n }", "@Override\n public CerereDePrietenie save(CerereDePrietenie entity) {\n\n String SQL = \"INSERT INTO cereredeprietenie(id, id_1,id_2,status,datac) VALUES(?,?,?,?,?)\";\n\n long id = 0;\n\n\n try (Connection conn = connect();\n PreparedStatement pstmt = conn.prepareStatement(SQL,\n Statement.RETURN_GENERATED_KEYS)) {\n\n\n pstmt.setInt(1, Math.toIntExact(entity.getId()));\n pstmt.setInt(2, Math.toIntExact(entity.getTrimite().getId()));\n pstmt.setInt(3, Math.toIntExact(entity.getPrimeste().getId()));\n pstmt.setString(4, entity.getStatus());\n pstmt.setObject(5, entity.getData());\n\n\n int affectedRows = pstmt.executeUpdate();\n // check the affected rows\n if (affectedRows > 0) {\n // get the ID back\n try (ResultSet rs = pstmt.getGeneratedKeys()) {\n if (rs.next()) {\n id = rs.getLong(1);\n }\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n }\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n\n\n return entity;\n\n }", "@Transactional\n DataRistorante insert(DataRistorante risto);", "void notifyDepositChanges(int id, ResourceContainer resourceContainer, boolean added);", "@Test\n @Transactional\n void createSiegeLesionsWithExistingId() throws Exception {\n siegeLesions.setId(1L);\n SiegeLesionsDTO siegeLesionsDTO = siegeLesionsMapper.toDto(siegeLesions);\n\n int databaseSizeBeforeCreate = siegeLesionsRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restSiegeLesionsMockMvc\n .perform(\n post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(siegeLesionsDTO))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the SiegeLesions in the database\n List<SiegeLesions> siegeLesionsList = siegeLesionsRepository.findAll();\n assertThat(siegeLesionsList).hasSize(databaseSizeBeforeCreate);\n }", "public boolean save(Cliente cliente) {\n\t\ttry {\n\t\t\t\n\t\t\t\tdb.save(cliente);\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "@Test\n @Transactional\n void createAutorWithExistingId() throws Exception {\n autor.setId(1L);\n AutorDTO autorDTO = autorMapper.toDto(autor);\n\n int databaseSizeBeforeCreate = autorRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restAutorMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(autorDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Autor in the database\n List<Autor> autorList = autorRepository.findAll();\n assertThat(autorList).hasSize(databaseSizeBeforeCreate);\n }", "private void registrarResidencia(Residencias residencia) {\n\t\t\t\t\t\t\t\t\n\t\tResidenciasobservaciones observacion = residencia.getResidenciasobservaciones();\t\n\t\t\t\t\n\t\tif(observacion==null) {\t\t\t\n\t\t\thibernateController.insertResidencia(residencia);\n\t\t\t\n\t\t}else {\t\t\t\n\t\t\thibernateController.insertResidenciaObservacion(residencia, observacion);\t\t\n\t\t}\n\t\t\n\t\tupdateContent();\t\n\t\t\n\t}", "@Test\n public void createComentarioTest() {\n PodamFactory factory = new PodamFactoryImpl();\n ComentarioEntity nuevaEntity = factory.manufacturePojo(ComentarioEntity.class);\n ComentarioEntity resultado = comentarioPersistence.create(nuevaEntity);\n\n Assert.assertNotNull(resultado);\n\n ComentarioEntity entity = em.find(ComentarioEntity.class, resultado.getId());\n\n Assert.assertEquals(nuevaEntity.getNombreUsuario(), entity.getNombreUsuario());\n \n }", "public com.alain.puntocoma.model.Catalogo create(long catalogoId);", "public void recupera() {\n Cliente clienteActual;\n clienteActual=clienteDAO.buscaId(c.getId());\n if (clienteActual!=null) {\n c=clienteActual;\n } else {\n c=new Cliente();\n }\n }", "public boolean registrar(Proveedor proveedor) {\n boolean verificar;\n if (dao.save(proveedor)) {\n verificar = true;\n } else {\n verificar = false;\n }\n return verificar;\n }", "public boolean añadirproducto(ProductoDTO c) {/* */\r\n try {\r\n\r\n try {\r\n try {\r\n PreparedStatement ps;\r\n ps = conn.getConn().prepareStatement(SQL_INSERT);\r\n ps.setInt(1, c.getId());\r\n ps.setString(2, c.getDescripcion());\r\n ps.setString(3, c.getFechaproducto());\r\n ps.setInt(4, c.getStock());\r\n ps.setInt(5, c.getPrecio());\r\n ps.setString(6, c.getNombre());\r\n ps.setString(7, c.getFechacaducidad());\r\n ps.setString(8, c.getFechaelaboracion());\r\n ps.setString(9, c.getNombrecategoria());\r\n\r\n if (ps.executeUpdate() > 0) {\r\n\r\n JOptionPane.showMessageDialog(null, \"Producto registrado correctamente\");\r\n return true;\r\n }\r\n } catch (MysqlDataTruncation ef) {\r\n JOptionPane.showMessageDialog(null, \"Formato de fecha debe ser MM/DD/AAAA\");\r\n }\r\n\r\n } catch (MySQLIntegrityConstraintViolationException e) {\r\n JOptionPane.showMessageDialog(null, \"codigo ya existe\");\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProductoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n } finally {\r\n conn.cerrarconexion();\r\n }\r\n JOptionPane.showMessageDialog(null, \"no se ha podido registrar\");\r\n return false;\r\n\r\n }", "boolean agregarProducto(Producto p) {\n boolean hecho = false;\n try {\n operacion = ayudar.beginTransaction();\n ayudar.save(p);\n operacion.commit();\n } catch (Exception e) {\n operacion.rollback();\n System.out.println(e);\n }\n return hecho;\n }", "private static void registrarAuditoriaDetallesPlantillaFactura(Connexion connexion,PlantillaFactura plantillafactura)throws Exception {\n\t\t\r\n\t\tString strValorActual=null;\r\n\t\tString strValorNuevo=null;\r\n\t\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_empresa().equals(plantillafactura.getPlantillaFacturaOriginal().getid_empresa()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_empresa().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_empresa().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDEMPRESA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getcodigo().equals(plantillafactura.getPlantillaFacturaOriginal().getcodigo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getcodigo();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getcodigo() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.CODIGO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getnombre().equals(plantillafactura.getPlantillaFacturaOriginal().getnombre()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getnombre();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getnombre() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.NOMBRE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getdescripcion().equals(plantillafactura.getPlantillaFacturaOriginal().getdescripcion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getdescripcion();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getdescripcion() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.DESCRIPCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getes_proveedor().equals(plantillafactura.getPlantillaFacturaOriginal().getes_proveedor()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getes_proveedor()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getes_proveedor().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getes_proveedor()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getes_proveedor().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.ESPROVEEDOR,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_cuenta_contable_aplicada().equals(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_aplicada()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_aplicada()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_aplicada().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_cuenta_contable_aplicada()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_cuenta_contable_aplicada().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDCUENTACONTABLEAPLICADA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_cuenta_contable_credito_bien().equals(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_bien()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_bien().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_cuenta_contable_credito_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_cuenta_contable_credito_bien().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDCUENTACONTABLECREDITOBIEN,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_cuenta_contable_credito_servicio().equals(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_servicio()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_servicio().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_cuenta_contable_credito_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_cuenta_contable_credito_servicio().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDCUENTACONTABLECREDITOSERVICIO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_tipo_retencion_fuente_bien().equals(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_bien()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_bien().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_tipo_retencion_fuente_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_tipo_retencion_fuente_bien().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDTIPORETENCIONFUENTEBIEN,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_tipo_retencion_fuente_servicio().equals(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_servicio()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_servicio().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_tipo_retencion_fuente_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_tipo_retencion_fuente_servicio().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDTIPORETENCIONFUENTESERVICIO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_tipo_retencion_iva_bien().equals(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_bien()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_bien().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_tipo_retencion_iva_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_tipo_retencion_iva_bien().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDTIPORETENCIONIVABIEN,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_tipo_retencion_iva_servicio().equals(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_servicio()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_servicio().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_tipo_retencion_iva_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_tipo_retencion_iva_servicio().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDTIPORETENCIONIVASERVICIO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_cuenta_contable_gasto().equals(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_gasto()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_gasto()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_gasto().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_cuenta_contable_gasto()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_cuenta_contable_gasto().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDCUENTACONTABLEGASTO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t}", "@Test\r\n public void testPersiste() throws Exception {\r\n Categoria categoria = new Categoria(\"Teste de categoria\");\r\n tx.begin();\r\n dao.persiste(categoria);\r\n tx.commit();\r\n em.refresh(categoria);\r\n assertTrue(\"O objeto não foi persistido\", categoria.getId() != null);\r\n }", "@Transactional //deve ser executado dentro de uma transação\n\tpublic Cliente salvar(Cliente cliente) {\n\t\t\n\t\t//valida se o emaiol está em uso e se é diferente do cliente que ja tem ele\n\t\t//por causa da atualização o cliente pode alterar seu email\n\t\tboolean emailEmUso = clienteRepository.findByEmail(cliente.getEmail())\n\t\t\t\t.stream()\n\t\t\t\t.anyMatch(clienteExistente -> !clienteExistente.equals(cliente));\n\t\t\n\t\tif(emailEmUso) {//se tiver em uso passa essa mensagem\n\t\t\tthrow new NegocioException(\"Já existe um cliente cadastrado com esse e-mail\");\n\t\t}\n\t\t\n\t\treturn clienteRepository.save(cliente);\n\t}", "@Test\r\n public void createTest() {\r\n repo = ctx.getBean(KitchenRepository.class);\r\n Kitchen k = new Kitchen();\r\n k.setStove(\"Defy\");\r\n k.setFridge(\"LG\");\r\n k.setBasin(\"Cobra Stainless Steel\");\r\n repo.save(k);\r\n id = k.getId();\r\n k.toString();\r\n Assert.assertNotNull(id);\r\n }", "public CervejaDTO criarCerveja( CervejaDTO cervejaDTO ) throws ExcecaoCervejaJaRegistrada {\n verificarSeFoiRegistrada( cervejaDTO.getNome() );\n\n Cerveja cerveja = mapperCerveja.paraModelo( cervejaDTO );\n Cerveja cervejaSalva = repositorioCerveja.save( cerveja );\n return mapperCerveja.paraDTO( cervejaSalva );\n }", "@Test\n void createAWithExistingId() throws Exception {\n a.setId(1L);\n\n int databaseSizeBeforeCreate = aRepository.findAll().collectList().block().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n webTestClient\n .post()\n .uri(ENTITY_API_URL)\n .contentType(MediaType.APPLICATION_JSON)\n .bodyValue(TestUtil.convertObjectToJsonBytes(a))\n .exchange()\n .expectStatus()\n .isBadRequest();\n\n // Validate the A in the database\n List<A> aList = aRepository.findAll().collectList().block();\n assertThat(aList).hasSize(databaseSizeBeforeCreate);\n }", "@Override\n\t@Transactional\n\tpublic Cliente save(Cliente entity) throws Exception {\n\t\treturn clienteRepository.save(entity);\n\t}", "@Test\n public void createPerroTest() throws BusinessLogicException {\n \n PerroEntity newEntity = factory.manufacturePojo(PerroEntity.class);\n int ed = newEntity.getEdad();\n \n if(ed<0){\n newEntity.setEdad(ed*-1);\n }\n \n PerroEntity result = perroLogic.createPerro(newEntity);\n int edad =result.getEdad();\n if(edad<0)\n {\n result.setEdad(edad*-1);\n }\n \n\n\n \n Assert.assertNotNull(result);\n PerroEntity entity = em.find(PerroEntity.class, result.getId());\n int eda =entity.getEdad();\n if(eda<0)\n {\n entity.setEdad(eda*-1);\n }\n \n Assert.assertEquals(newEntity.getId(), entity.getId());\n Assert.assertEquals(newEntity.getIdPerro(), entity.getIdPerro());\n Assert.assertEquals(newEntity.getNombre(), entity.getNombre());\n Assert.assertEquals(newEntity.getEdad(), entity.getEdad());\n Assert.assertEquals(newEntity.getRaza(), entity.getRaza());\n }", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,Caja caja,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(CajaConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(caja.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,CajaDataAccess.TABLENAME, caja.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(CajaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////CajaLogic.registrarAuditoriaDetallesCaja(connexion,caja,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(caja.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!caja.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,CajaDataAccess.TABLENAME, caja.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////CajaLogic.registrarAuditoriaDetallesCaja(connexion,caja,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,CajaDataAccess.TABLENAME, caja.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(caja.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,CajaDataAccess.TABLENAME, caja.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(CajaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////CajaLogic.registrarAuditoriaDetallesCaja(connexion,caja,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "private DocumentoProcesoDTO registrarDocumentoCoactivo(EnumTipoDocumentoGenerado tipoDocGenerado,\n TrazabilidadProcesoDTO traza, Coactivo coactivo, EnumTipoDocumentoProceso tipoDocProceso,\n String responsableGeneracion) throws CirculemosAlertaException {\n // Genera documento\n GeneraDocumentoDTO generaDocumento = new GeneraDocumentoDTO();\n generaDocumento.setFechaGeneracion(coactivo.getProceso().getFechaInicio());\n generaDocumento.setIdTipoDocumentoGenerado(tipoDocGenerado);\n Object[] valoresParametros = { coactivo.getId() };\n generaDocumento.setValoresParametros(valoresParametros);\n Map<String, Object> valoresVistaPreliminar = new HashMap<>();\n valoresVistaPreliminar.put(ConstantesDocumentosC2.TOTAL_LETRAS, coactivo.getValorTotalObligaciones());\n valoresVistaPreliminar.put(ConstantesDocumentosC2.VALOR_TOTAL, coactivo.getValorTotalObligaciones());\n generaDocumento.setValoresVistaPreliminar(valoresVistaPreliminar);\n Long idDocumento = iRDocumentosCirculemos.generarDocumento(generaDocumento);\n\n // Guarda el documento generado\n DocumentoProcesoDTO documentoProceso = new DocumentoProcesoDTO();\n documentoProceso.setNumeroDocumento(idDocumento);\n documentoProceso.setTrazabilidadProceso(traza);\n TipoDocumentoProcesoDTO tipoDocumento = new TipoDocumentoProcesoDTO();\n tipoDocumento.setId(tipoDocProceso.getValue());\n documentoProceso.setTipoDocumento(tipoDocumento);\n // Responsable de la generacion de los documentos\n documentoProceso.setResponsableGeneracion(responsableGeneracion);\n documentoProceso = iRFachadaProceso.registrarDocumento(documentoProceso);\n return documentoProceso;\n }", "@Override\n\tpublic int save(CursoAsignatura ca) {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic boolean create(Moteur obj, Connection conn) throws SQLException {\n\t\treturn false;\r\n\t}", "@Override\r\npublic int create(Detalle_pedido d) {\n\treturn detalle_pedidoDao.create(d);\r\n}", "@Override\r\n /* OSINE791 - RSIS1 - Inicio */\r\n //public ExpedienteDTO generarExpedienteOrdenServicio(ExpedienteDTO expedienteDTO,String codigoTipoSupervisor,UsuarioDTO usuarioDTO) throws ExpedienteException{\r\n public ExpedienteGSMDTO generarExpedienteOrdenServicio(ExpedienteGSMDTO expedienteDTO,String codigoTipoSupervisor,UsuarioDTO usuarioDTO,String sigla) throws ExpedienteException{\r\n LOG.error(\"generarExpedienteOrdenServicio\");\r\n ExpedienteGSMDTO retorno= new ExpedienteGSMDTO();\r\n try{\r\n expedienteDTO.setEstado(Constantes.ESTADO_ACTIVO);\r\n PghExpediente pghExpediente = ExpedienteGSMBuilder.toExpedienteDomain(expedienteDTO);\r\n pghExpediente.setFechaEstadoProceso(new Date());\r\n pghExpediente.setDatosAuditoria(usuarioDTO);\r\n crud.create(pghExpediente);\r\n retorno=ExpedienteGSMBuilder.toExpedienteDto(pghExpediente);\r\n \r\n //reg historicoEstado\r\n MaestroColumnaDTO tipoHistorico=maestroColumnaDAO.findMaestroColumna(Constantes.DOMINIO_TIPO_COMPONENTE, Constantes.APLICACION_INPS, Constantes.CODIGO_TIPO_COMPONENTE_EXPEDIENTE).get(0);\r\n /* OSINE_SFS-480 - RSIS 40 - Inicio */\r\n HistoricoEstadoDTO historicoEstado=historicoEstadoDAO.registrar(pghExpediente.getIdExpediente(), null, pghExpediente.getIdEstadoProceso().getIdEstadoProceso(), pghExpediente.getIdPersonal().getIdPersonal(), pghExpediente.getIdPersonal().getIdPersonal(), tipoHistorico.getIdMaestroColumna(),null,null, null, usuarioDTO);\r\n LOG.info(\"historicoEstado-->\"+historicoEstado);\r\n /* OSINE_SFS-480 - RSIS 40 - Fin */\r\n //inserta ordenServicio\r\n Long idLocador=codigoTipoSupervisor.equals(Constantes.CODIGO_TIPO_SUPERVISOR_PERSONA_NATURAL)?expedienteDTO.getOrdenServicio().getLocador().getIdLocador():null;\r\n Long idSupervisoraEmpresa=codigoTipoSupervisor.equals(Constantes.CODIGO_TIPO_SUPERVISOR_PERSONA_JURIDICA)?expedienteDTO.getOrdenServicio().getSupervisoraEmpresa().getIdSupervisoraEmpresa():null;\r\n OrdenServicioDTO OrdenServicioDTO=ordenServicioDAO.registrar(retorno.getIdExpediente(), \r\n expedienteDTO.getOrdenServicio().getIdTipoAsignacion(), expedienteDTO.getOrdenServicio().getEstadoProceso().getIdEstadoProceso(), \r\n /* OSINE791 - RSIS1 - Inicio */\r\n //codigoTipoSupervisor, idLocador, idSupervisoraEmpresa, usuarioDTO);\r\n codigoTipoSupervisor, idLocador, idSupervisoraEmpresa, usuarioDTO,sigla);\r\n /* OSINE791 - RSIS1 - Fin */\r\n LOG.info(\"OrdenServicioDTO:\"+OrdenServicioDTO.getNumeroOrdenServicio());\r\n //busca idPersonalDest\r\n PersonalDTO personalDest=null;\r\n List<PersonalDTO> listPersonalDest=null;\r\n if(codigoTipoSupervisor.equals(Constantes.CODIGO_TIPO_SUPERVISOR_PERSONA_NATURAL)){\r\n //personalDest=personalDAO.find(new PersonalFilter(expedienteDTO.getOrdenServicio().getLocador().getIdLocador(),null)).get(0);\r\n listPersonalDest=personalDAO.find(new PersonalFilter(expedienteDTO.getOrdenServicio().getLocador().getIdLocador(),null));\r\n }else if(codigoTipoSupervisor.equals(Constantes.CODIGO_TIPO_SUPERVISOR_PERSONA_JURIDICA)){\r\n //personalDest=personalDAO.find(new PersonalFilter(null,expedienteDTO.getOrdenServicio().getSupervisoraEmpresa().getIdSupervisoraEmpresa())).get(0);\r\n listPersonalDest=personalDAO.find(new PersonalFilter(null,expedienteDTO.getOrdenServicio().getSupervisoraEmpresa().getIdSupervisoraEmpresa()));\r\n }\r\n if(listPersonalDest==null || listPersonalDest.isEmpty()){\r\n throw new ExpedienteException(\"La Empresa Supervisora no tiene un Personal asignado\",null);\r\n }else{\r\n personalDest=listPersonalDest.get(0);\r\n }\r\n //inserta historico Orden Servicio\r\n EstadoProcesoDTO estadoProcesoDto=estadoProcesoDAO.find(new EstadoProcesoFilter(Constantes.IDENTIFICADOR_ESTADO_PROCESO_OS_REGISTRO)).get(0);\r\n MaestroColumnaDTO tipoHistoricoOS=maestroColumnaDAO.findMaestroColumna(Constantes.DOMINIO_TIPO_COMPONENTE, Constantes.APLICACION_INPS, Constantes.CODIGO_TIPO_COMPONENTE_ORDEN_SERVICIO).get(0);\r\n /* OSINE_SFS-480 - RSIS 40 - Inicio */\r\n HistoricoEstadoDTO historicoEstadoOS=historicoEstadoDAO.registrar(null, OrdenServicioDTO.getIdOrdenServicio(), estadoProcesoDto.getIdEstadoProceso(), expedienteDTO.getPersonal().getIdPersonal(), personalDest.getIdPersonal(), tipoHistoricoOS.getIdMaestroColumna(),null,null, null, usuarioDTO); \r\n LOG.info(\"historicoEstadoOS:\"+historicoEstadoOS);\r\n /* OSINE_SFS-480 - RSIS 40 - Fin */\r\n retorno.setOrdenServicio(new OrdenServicioDTO(OrdenServicioDTO.getIdOrdenServicio(),OrdenServicioDTO.getNumeroOrdenServicio()));\r\n }catch(Exception e){\r\n LOG.error(\"error en generarExpedienteOrdenServicio\",e);\r\n throw new ExpedienteException(e.getMessage(), e);\r\n }\r\n return retorno;\r\n }", "boolean isNew();", "public static void actualizarCreencias(int id) {\n\t\tint j =0;\t\t\n\t\t//Actualizamos las creecias del jugador \n\t\tint i =0;\n\t\tfor(j =0; j < GestorPartida.getContJugadores();j++) {\n\t\t\t\n\t\t\t\n\t\t\tif(GestorPartida.getJugadores()[j].getId() != id) {\n\t\t\t\t//Filtramos que los jugadores que vayan a actualizar sus creencias sean los de la sala del jugador que acaba de realizar una accion, excepto las suyas propias\t\t\t\n\t\t\t\tif(GestorPartida.getJugadores()[j].getSala().equalsIgnoreCase(GestorPartida.getJugadores()[id].getSala()) && GestorPartida.getJugadores()[j].getId() != id) {\n\t\t\t\t\t//Actualizamos la sala por si el jugador se acaba de mover\n\t\t\t\t\tGestorPartida.getJugadores()[id].getCreencias().setSalaPersona(GestorPartida.getJugadores()[j].getSala(), i);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tfor(j = 0; j < GestorPartida.getContObjetosJugador();j++) {\n\t\t\t//Comprobamos que el jugador coincida con un poseedor de un objeto\n\t\t\tif(GestorPartida.getObjetoJugador()[j].getJugador().getSala().equalsIgnoreCase(GestorPartida.getJugadores()[id].getSala())) {\n\t\t\t\tfor(int x =0; GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x]!=null ; x++) {\n\t\t\t\t\t//Cogemos la posicion del objeto donde esta el objeto dentro de las creencias\n\t\t\t\t\tif(GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x].equalsIgnoreCase(GestorPartida.getObjetoJugador()[j].getNombreObjeto())) {\n\t\t\t\t\t\tGestorPartida.getJugadores()[id].getCreencias().setLugarObjeto(GestorPartida.getObjetoJugador()[j].getJugador().getNombre(), x);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(j = 0; j < GestorPartida.getContObjetosSala();j++) {\n\t\t\t//Comprobamos si hay objetos en la sala del jugador\n\t\t\tif(GestorPartida.getObjetoSala()[j].getSala().getNombre().equalsIgnoreCase(GestorPartida.getJugadores()[id].getSala())) {\n\t\t\t\tfor(int x =0; GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x]!=null ; x++) {\n\t\t\t\t\t//Cogemos la posicion del objeto donde esta el objeto dentro de las creencias\n\t\t\t\t\tif(GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x].equalsIgnoreCase(GestorPartida.getObjetoSala()[j].getNombreObjeto())) {\n\t\t\t\t\t\tGestorPartida.getJugadores()[id].getCreencias().setLugarObjeto(GestorPartida.getObjetoSala()[j].getSala().getNombre(), x);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "public String guardarComentario(){\r\n\t\tcomDao.save(com);\r\n\t\tinit();\r\n\t\treturn null;\r\n\t}", "public void registrarPagoFacturaCredito(){\n if(facturaCredito != null){\n try{\n //NUEVA TRANSACCION\n Transaccion transac = new Transaccion();\n transac.setFechaTransac(new funciones().getTime());\n transac.setHoraTransac(new funciones().getTime());\n transac.setResponsableTransac(new JsfUtil().getEmpleado());\n transac.setTipoTransac(4); //REGISTRO DE PAGO\n transac.setIdtransac(ejbFacadeTransac.getNextIdTransac());\n ejbFacadeTransac.create(transac);\n //REGISTRAR PAGO\n PagoCompra pagoCompra = new PagoCompra();\n pagoCompra.setFacturaIngreso(facturaCredito);\n pagoCompra.setIdtransac(transac);\n pagoCompra.setInteresPagoCompra(new BigDecimal(intereses));\n pagoCompra.setMoraPagoCompra(new BigDecimal(mora));\n pagoCompra.setAbonoPagoCompra(new BigDecimal(pago));\n BigDecimal total = pagoCompra.getAbonoPagoCompra().add(pagoCompra.getInteresPagoCompra()).add(pagoCompra.getMoraPagoCompra());\n pagoCompra.setTotalPagoCompra(new BigDecimal(new funciones().redondearMas(total.floatValue(), 2)));\n pagoCompra.setIdpagoCompra(ejbFacadePagoCompra.getNextIdPagoCompra());\n ejbFacadePagoCompra.create(pagoCompra); // Registrar Pago en la BD\n //Actualizar Factura\n facturaCredito.getPagoCompraCollection().add(pagoCompra); //Actualizar Contexto\n BigDecimal saldo = facturaCredito.getSaldoCreditoCompra().subtract(pagoCompra.getAbonoPagoCompra());\n facturaCredito.setSaldoCreditoCompra(new BigDecimal(new funciones().redondearMas(saldo.floatValue(), 2)));\n if(facturaCredito.getSaldoCreditoCompra().compareTo(BigDecimal.ZERO)==0){\n facturaCredito.setEstadoCreditoCompra(\"CANCELADO\");\n facturaCredito.setFechaCancelado(transac.getFechaTransac());\n }\n facturaCredito.setUltimopagoCreditoCompra(transac.getFechaTransac());\n ejbFacadeFacturaIngreso.edit(facturaCredito);\n new funciones().setMsj(1, \"PAGO REGISTRADO CORRECTAMENTE\");\n if(facturaCredito.getEstadoCreditoCompra().equals(\"CANCELADO\")){\n RequestContext context = RequestContext.getCurrentInstance(); \n context.execute(\"alert('FACTURA CANCELADA POR COMPLETO');\");\n }\n prepararPago();\n }catch(Exception e){\n new funciones().setMsj(3, \"ERROR AL REGISTRAR PAGO\");\n }\n }\n }" ]
[ "0.5799657", "0.57285386", "0.5723809", "0.5713809", "0.5711758", "0.5695808", "0.567103", "0.56546843", "0.5597595", "0.5594069", "0.5523391", "0.552207", "0.55032235", "0.5499445", "0.54940677", "0.54924506", "0.549185", "0.54722416", "0.5457981", "0.54508877", "0.54447806", "0.5444088", "0.5426693", "0.54197437", "0.541148", "0.5404524", "0.5392316", "0.537886", "0.537423", "0.5372427", "0.5367066", "0.5359814", "0.53569216", "0.5352355", "0.53417325", "0.5330475", "0.53284264", "0.53102964", "0.5307291", "0.5297358", "0.5263195", "0.5261846", "0.52544165", "0.5249146", "0.52459705", "0.52414215", "0.523051", "0.5225443", "0.5223977", "0.5222311", "0.5217496", "0.52117664", "0.5207792", "0.5202797", "0.519822", "0.51981527", "0.5194159", "0.51935315", "0.5188461", "0.5184557", "0.5181227", "0.5180718", "0.5178011", "0.5177249", "0.5172272", "0.5171117", "0.51680154", "0.5156068", "0.515347", "0.5148452", "0.51449436", "0.5139837", "0.5139224", "0.51376", "0.51369613", "0.51327527", "0.5129795", "0.5127301", "0.5127203", "0.5116691", "0.5115771", "0.510672", "0.5105463", "0.5104899", "0.5102445", "0.509276", "0.50856966", "0.50856936", "0.50800365", "0.5071742", "0.50705945", "0.50699943", "0.5069278", "0.5067345", "0.5065248", "0.5060023", "0.5059971", "0.5057083", "0.50540423", "0.5052753" ]
0.6225922
0
/ verifica che, quando viene usato il servizio per cercare un consumatore: 1) il consumatore viene cercato tramite il repository / configura ConsumerRepository.findById per trovare il consumatore
@Test public void finConsumerdByIdTest() { when(consumerRepository.findById(CONSUMER_ID)) // .thenReturn(Optional.of(CONSUMER)); .then(invocation -> { Consumer consumer = new Consumer(CONSUMER_FIRST_NAME, CONSUMER_LAST_NAME); consumer.setId(CONSUMER_ID); return Optional.of(consumer); }); /* invoca la ricerca del consumatore */ Consumer consumer = consumerService.findById(CONSUMER_ID); /* verifica che il consumatore è stato trovato */ verify(consumerRepository) .findById(same(CONSUMER_ID)); assertThat(consumer.getFirstName()).isEqualTo(CONSUMER_FIRST_NAME); assertThat(consumer.getLastName()).isEqualTo(CONSUMER_LAST_NAME); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t@Transactional(readOnly=true)\n\tpublic List<Interesado> findByConsumidor(Consumidor consumidor) { \n\t\tSystem.out.println(\"entro2\");\n\t\treturn interesadoDao.findByConsumidor(consumidor); \n\t}", "public Cliente buscarClientePorDocumento(String id) throws ExceptionService {\n Optional<Cliente> verificar = repositorio.findById(Long.parseLong(id));\n if (verificar.isPresent()) { //verificamos que traiga un resultado\n Cliente cliente = verificar.get(); //con el get obtenemos del optional el objeto en este caso de tipo cliente\n return cliente;\n } else {\n throw new ExceptionService(\"no se encontro el cliente con el documento indicado\");\n }\n }", "@Test\r\n\tpublic void testfindByIdCandidateOK() {\r\n\t\tassertTrue(evaluationService.findByIdCandidate(1).size() > 0); // Necessite au moins une evaluation associée au candidat de id=1\r\n\t}", "public void buscar() {\r\n sessionProyecto.getProyectos().clear();\r\n sessionProyecto.getFilterProyectos().clear();\r\n try {\r\n List<ProyectoCarreraOferta> proyectoCarreraOfertas = proyectoCarreraOfertaService.buscar(\r\n new ProyectoCarreraOferta(null, sessionProyecto.getCarreraSeleccionada().getId() != null\r\n ? sessionProyecto.getCarreraSeleccionada().getId() : null, null, Boolean.TRUE));\r\n \r\n if (proyectoCarreraOfertas == null) {\r\n return;\r\n }\r\n for (ProyectoCarreraOferta proyectoCarreraOferta : proyectoCarreraOfertas) {\r\n proyectoCarreraOferta.getProyectoId().setEstado(itemService.buscarPorId(proyectoCarreraOferta.getProyectoId().\r\n getEstadoProyectoId()).getNombre());\r\n proyectoCarreraOferta.getProyectoId().setCatalogo(itemService.buscarPorId(proyectoCarreraOferta.getProyectoId().\r\n getCatalogoProyectoId()).getNombre());\r\n proyectoCarreraOferta.getProyectoId().setTipo(itemService.buscarPorId(proyectoCarreraOferta.getProyectoId().\r\n getTipoProyectoId()).getNombre());\r\n proyectoCarreraOferta.getProyectoId().setAutores(autores(proyectoCarreraOferta.getProyectoId()));\r\n proyectoCarreraOferta.getProyectoId().setDirectores(directores(proyectoCarreraOferta.getProyectoId()));\r\n proyectoCarreraOferta.getProyectoId().setNombreOferta(ofertaAcademicaService.find(proyectoCarreraOferta.getOfertaAcademicaId()).getNombre());\r\n if (!this.sessionProyecto.getProyectos().contains(proyectoCarreraOferta.getProyectoId())) {\r\n proyectoCarreraOferta.getProyectoId().setCarrera(carreraService.find(proyectoCarreraOferta.getCarreraId()).getNombre());\r\n this.sessionProyecto.getProyectos().add(proyectoCarreraOferta.getProyectoId());\r\n }\r\n }\r\n sessionProyecto.setFilterProyectos(sessionProyecto.getProyectos());\r\n } catch (Exception e) {\r\n LOG.info(e.getMessage());\r\n }\r\n }", "@Test\n public void getComentarioTest() {\n ComentarioEntity entity = data.get(0);\n ComentarioEntity nuevaEntity = comentarioPersistence.find(dataLibro.get(0).getId(), entity.getId());\n Assert.assertNotNull(nuevaEntity);\n Assert.assertEquals(entity.getNombreUsuario(), nuevaEntity.getNombreUsuario());\n }", "@Override\r\n public Concursando consultarConcursandoPorId(long id) throws Exception {\n return rnConcursando.consultarPorId(id);\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof ConvenioVO)) {\n return false;\n }\n ConvenioVO other = (ConvenioVO) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Condominios)) {\r\n return false;\r\n }\r\n Condominios other = (Condominios) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@PUT\n @JWTTokenNeeded\n @Consumes({MediaType.APPLICATION_JSON})\n @Produces({MediaType.APPLICATION_JSON})\n public Response update(EscenarioDTO entidad) {\n logger.log(Level.INFO, \"entidad:{0}\", entidad);\n \n try {\n \tConciliacion entidadPadreJPA = null;\n if (entidad.getIdConciliacion() != null) {\n entidadPadreJPA = padreDAO.find(entidad.getIdConciliacion());\n if (entidadPadreJPA == null) {\n throw new DataNotFoundException(Response.Status.NOT_FOUND.getReasonPhrase() + entidad.getIdConciliacion());\n }\n }\n //Hallar La entidad actual para actualizarla\n Escenario entidadJPA = managerDAO.find(entidad.getId());\n if (entidadJPA != null) {\n entidadJPA.setFechaActualizacion(Date.from(Instant.now()));\n entidadJPA.setNombre(entidad.getNombre() != null ? entidad.getNombre() : entidadJPA.getNombre());\n entidadJPA.setImpacto(entidad.getImpacto() != null ? entidad.getImpacto() : entidadJPA.getImpacto());\n entidadJPA.setDescripcion(entidad.getDescripcion() != null ? entidad.getDescripcion() : entidadJPA.getDescripcion());\n \n Boolean actualizarConciliacion = false;\n entidadJPA.setConciliacion(entidad.getIdConciliacion() != null ? (entidadPadreJPA != null ? entidadPadreJPA : null) : entidadJPA.getConciliacion());\n \n Conciliacion conciliacionpadreactual = null;\n \n \n if (entidadJPA.getConciliacion() != null && !Objects.equals(entidadJPA.getConciliacion().getId(), entidad.getIdConciliacion())){\n actualizarConciliacion = true;\n conciliacionpadreactual = padreDAO.find(entidadJPA.getConciliacion().getId());\n }\n //entidadJPA.setConciliacion(entidad.getIdConciliacion() != null ? (entidadPadreJPA != null ? entidadPadreJPA : null) : entidadJPA.getConciliacion());\n managerDAO.edit(entidadJPA);\n if (actualizarConciliacion){\n if ((entidadPadreJPA != null)) {\n entidadPadreJPA.addEscenario(entidadJPA);\n padreDAO.edit(entidadPadreJPA);\n conciliacionpadreactual.removeEscenario(entidadJPA);\n padreDAO.edit(conciliacionpadreactual);\n }\n }\n LogAuditoria logAud = new LogAuditoria(this.modulo, Constantes.Acciones.EDITAR.name(), Date.from(Instant.now()), entidad.getUsername(), entidadJPA.toString());\n logAuditoriaDAO.create(logAud);\n \n ResponseWrapper wraper = new ResponseWrapper(true,I18N.getMessage(\"escenario.update\", entidad.getNombre()) ,entidadJPA.toDTO());\n \treturn Response.ok(wraper,MediaType.APPLICATION_JSON).build();\n }\n \n ResponseWrapper wraper = new ResponseWrapper(false,I18N.getMessage(\"escenario.notfound\", entidad.getNombre()));\n \treturn Response.ok(wraper,MediaType.APPLICATION_JSON).build();\n }catch (Exception e) {\n \tif(e.getCause() != null && (e.getCause() instanceof DataAlreadyExistException || e.getCause() instanceof DataNotFoundException)) {\n \t\tlogger.log(Level.SEVERE, e.getMessage(), e);\n \t\tResponseWrapper wraper = new ResponseWrapper(false, e.getCause().getMessage(), 500);\n \t\treturn Response.ok(wraper,MediaType.APPLICATION_JSON).build();\n \t}else {\n \t\tlogger.log(Level.SEVERE, e.getMessage(), e);\n \t\tResponseWrapper wraper = new ResponseWrapper(false, I18N.getMessage(\"general.readerror\"), 500);\n \t\treturn Response.ok(wraper,MediaType.APPLICATION_JSON).build();\n \t}\n }\n }", "static protected Cliente verificar(Cliente cliente) throws Exception {\n\t\tClienteRepositorio repositorio = new ClienteRepositorio();\n\t\tCliente procurado = null;\n\t\ttry {\n\t\t\tprocurado = repositorio.consultaPorId(cliente);\n\t\t\t\n\t\t\tif (procurado == null) {\n\t\t\t\tthrow new Exception(\"Cliente inexistente na base de dados.\");\n\t\t\t}\n\t\t} catch (ConexaoException e) {\n\t\t\tthrow new Exception(\n\t\t\t\t\t\"Estamos com dificuldades. Tente novamente mais tarde (daqui a 12horas)<br/>[ALTERAR] Erro: \" + e.getMessage());\n\t\t} catch (RepositorioException e) {\n\t\t\tthrow new Exception(\"O programador fez kk. Nem adianta tentar de novo.<br/>[ALTERAR] Erro: \" + e.getMessage());\n\t\t}\n\t\t\n\t\treturn procurado;\n\t}", "public void reabrirContrato() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Nao existe hospedes cadastrados\\n\");\n } else {\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//hospede\n if (hospedesCadastrados.get(i).getContrato().isSituacao()) {//verifica se o contrato já estpa aberto\n System.err.println(\"O contrado desse hospede já encontra-se aberto\");\n\n } else {//caso o contrato encontre-se fechado\n hospedesCadastrados.get(i).getContrato().setSituacao(true);\n System.err.println(\"Contrato reaberto, agora voce pode reusufruir de nossos servicos!\");\n }\n }\n }\n }\n }", "@Test\r\n\tpublic void testfetchServicoItensById2() throws Exception\r\n\t{\n\t\tFetchByIdRequest request = new FetchByIdRequest();\r\n\t\trequest.setFetchId(3);\r\n\t\tInternalResultsResponse<ServicoItens> response = getServicoItensDAC().fetchServicoItensById(request);\r\n\t\tassertTrue(response.getResultsSetInfo().getPageSize() == 1);\r\n\t\tassertEquals(response.getStatus(), Status.OperationSuccess);\r\n\t}", "@Test\n public void findViajeroByCorreoTest() {\n ViajeroEntity entity = data.get(0);\n ViajeroEntity newEntity = vp.findByCorreo(entity.getCorreo());\n Assert.assertNotNull(newEntity);\n Assert.assertEquals(entity.getCorreo(), newEntity.getCorreo());\n\n newEntity = vp.findByCorreo(null);\n Assert.assertNull(newEntity);\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Contrato)) {\r\n return false;\r\n }\r\n Contrato other = (Contrato) object;\r\n if ((this.idcontrato == null && other.idcontrato != null) || (this.idcontrato != null && !this.idcontrato.equals(other.idcontrato))) {\r\n return false;\r\n }\r\n return true;\r\n }", "public Cliente[] findWhereIdVendedorConsignaEquals(int idVendedorConsigna) throws ClienteDaoException;", "@Test\n public void testfindNoteCoursByIdRepositoryIsInvoked() throws NoteCoursNotFoundException {\n when(ncRepository.findById(eq(ncExpected.getId()))).thenReturn(Optional.ofNullable(ncExpected));\n // when: la méthode findActiviteById est invoquée\n ncService.findNoteCoursById(ncExpected.getId());\n // then: la méthode findById du Repository associé est invoquée\n verify(ncService.getNoteCoursRepository()).findById(ncExpected.getId());\n }", "private void thenLaPuedoBuscarPorSuId(Long id) {\n\tIngrediente ingredienteBuscado = session().get(Ingrediente.class, id);\t\n\tassertThat(ingredienteBuscado).isNotNull();\n\t}", "public void findbyid() throws Exception {\n try {\n Con_contadorDAO con_contadorDAO = getCon_contadorDAO();\n List<Con_contadorT> listTemp = con_contadorDAO.getByPK( con_contadorT);\n\n con_contadorT= listTemp.size()>0?listTemp.get(0):new Con_contadorT();\n \n } catch (Exception e) {\n e.printStackTrace();\n setMsg(\"Falha ao realizar consulta!\");\t\n } finally {\n\tclose();\n }\n }", "public void recupera() {\n Cliente clienteActual;\n clienteActual=clienteDAO.buscaId(c.getId());\n if (clienteActual!=null) {\n c=clienteActual;\n } else {\n c=new Cliente();\n }\n }", "public Reserva updateReserva(Reserva reserva){\n /**\n * Verificar que el objeto auditorio recibido tenga un ID.\n */\n if (reserva.getIdReservation()!=null){\n /**\n * Verificar la existencia del objeto en BD.\n */\n Optional<Reserva> existeReserva = getReserva(reserva.getIdReservation());\n /**\n * Si el objeto existe en la BD, editarlo. Si no,retornarlo como\n * está.\n */\n if (!existeReserva.isEmpty()){\n /**\n * Si el objeto reserva tiene un valor startDate, asignarlo a\n * existeCliente.\n */\n if (reserva.getStartDate()!=null){\n existeReserva.get().setStartDate(reserva.getStartDate());\n }\n /**\n * Si el objeto cliente tiene un valor devolutionDate, asignarlo\n * a existeCliente.\n */\n if (reserva.getDevolutionDate()!=null){\n existeReserva.get().setDevolutionDate(reserva.getDevolutionDate());\n }\n /**\n * Si el objeto reserva tiene un valor status, asignarlo a\n * existeCliente.\n */\n if (reserva.getStatus()!=null){\n existeReserva.get().setStatus(reserva.getStatus());\n }\n /**\n * Si el objeto reserva tiene un valor audience, asignarlo\n * a existeCliente.\n */\n if (reserva.getAudience()!=null){\n existeReserva.get().setAudience(reserva.getAudience());\n }\n /**\n * Si el objeto reserva tiene un valor client, asignarlo\n * a existeCliente.\n */\n if (reserva.getClient()!=null){\n existeReserva.get().setClient(reserva.getClient());\n }\n /**\n * Devolver existeCliente con valores ajustados.\n */\n return repositorioReserva.save(existeReserva.get());\n } else {\n return reserva;\n }\n } else {\n return reserva;\n }\n }", "public boolean existeEventoComSecao(Secao sec) {\n\t\treturn existe(\" o.id_secao = \"+ sec.getId().toString());\r\n\t\t\r\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof ConcesionPagoSri)) {\n return false;\n }\n ConcesionPagoSri other = (ConcesionPagoSri) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Test\r\n public void testCarregarPeloId() throws Exception {\r\n tx.begin();\r\n Categoria categoria = new Categoria(\"Teste carregar categoria por id\");\r\n dao.persiste(categoria);\r\n tx.commit();\r\n em.refresh(categoria);\r\n Long id = categoria.getId();\r\n Categoria result = dao.carregarPeloId(id);\r\n assertEquals(categoria, result);\r\n \r\n }", "private void caricaRegistrazione() {\n\t\tfor(MovimentoEP movimentoEP : primaNota.getListaMovimentiEP()){\n\t\t\t\n\t\t\tif(movimentoEP.getRegistrazioneMovFin() == null) { //caso di prime note libere.\n\t\t\t\tthrow new BusinessException(ErroreCore.OPERAZIONE_NON_CONSENTITA.getErrore(\"La prima nota non e' associata ad una registrazione.\"));\n\t\t\t}\n\t\t\t\n\t\t\tthis.registrazioneMovFinDiPartenza = registrazioneMovFinDad.findRegistrazioneMovFinById(movimentoEP.getRegistrazioneMovFin().getUid());\n\t\t\t\n\t\t}\n\t\t\n\t\tif(this.registrazioneMovFinDiPartenza.getMovimento() == null){\n\t\t\tthrow new BusinessException(\"Movimento non caricato.\");\n\t\t}\n\t\t\n\t}", "@Test\n public void testeResolucoes() throws Exception {\n resPersistencia.persiste(getResolucao1());\n resPersistencia.persiste(getResolucao2());\n\n //Criando a lista para comparaçao com os ids dos objetos persistidos:\n List<String> listaIdsResolucoes = new ArrayList<String>();\n listaIdsResolucoes.add(getResolucao1().getId());\n listaIdsResolucoes.add(getResolucao2().getId());\n\n //Comparando as duas listas:\n Assert.assertEquals(listaIdsResolucoes, resPersistencia.resolucoes());\n }", "@Test\n\tpublic void testConsultarPorTipo() {\n\t\tList<Dispositivo> dispositivos = new ArrayList<Dispositivo>();\n\t\tint idTipo = 1;\n\t\ttry {\n\t\t\tdispositivos = dispositivoBL.consultarPorTipo(idTipo);\n\t\t\tassertTrue(dispositivos.size() > 0);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@GetMapping(\"/produtos/{id}\")\n @Timed\n public ResponseEntity<Produto> getProduto(@PathVariable Long id) {\n log.debug(\"REST request to get Produto : {}\", id);\n Produto produto = produtoRepository.findOne(id);\n\n//////////////////////////////////REQUER PRIVILEGIOS\n if (!PrivilegioService.podeVer(cargoRepository, ENTITY_NAME)) {\n produto = null;\n log.error(\"TENTATIVA DE VISUALIZAR SEM PERMISSÃO BLOQUEADA! \" + ENTITY_NAME + \" : {}\", id);\n }\n//////////////////////////////////REQUER PRIVILEGIOS\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(produto));\n }", "@Test\r\n public void testFind() throws Exception {\r\n MonitoriaEntity entity = data.get(0);\r\n MonitoriaEntity nuevaEntity = persistence.find(entity.getId());\r\n Assert.assertNotNull(nuevaEntity);\r\n Assert.assertEquals(entity.getId(), nuevaEntity.getId());\r\n Assert.assertEquals(entity.getIdMonitor(), nuevaEntity.getIdMonitor());\r\n Assert.assertEquals(entity.getTipo(), nuevaEntity.getTipo());\r\n \r\n }", "@Override\n public ScontrinoDtoIll trovaEan(String ean, Scontrino sc) {\n Prodotto p = anagraficaProdottiRepository.findByEan(ean);\n if (p == null) {\n //se non è stato trovato alcun prodotto recupero il dto e\n //spedisco un messaggio di errore\n return new ScontrinoDtoIll(null, null, \"prodotto non trovato\");\n }\n //se invece è stato trovato un prodotto devo associarlo alla\n //riga scontrino che è a sua volta associata ad uno scontrino\n // quindi recupero lo scontrino ...\n if (sc != null) {\n sc = scontrinoRepository.findById(sc.getId()).get();\n //return new ScontrinoDtoIll(null, null, \"prodotto trovato\");\n }\n // se non esiste lo scontrino lo creo ...\n if (sc == null) {\n sc = new Scontrino();\n sc = scontrinoRepository.save(sc);\n }\n\n // creo la riga e la salvo ...\n RigaScontrino r = new RigaScontrino();\n r = rigaRepository.save(r);\n r.setProdotto(p);\n r.setScontrino(sc);\n r = rigaRepository.save(r);\n\n // aggiungo la riga allo scontrino\n sc.getRigheScontrino().add(r);\n sc = scontrinoRepository.save(sc);\n\n // creo il DTO con i dati da ritornare al client\n ScontrinoDtoIll risp = new ScontrinoDtoIll();\n Set<RigaScontrino> righe = sc.getRigheScontrino();\n List<RigaScontrinoClientDto> righeDto = new ArrayList<>();\n // trasformo le righe originali dello scontrino in righe del DTO\n righe.forEach(rr\n -> righeDto.add(\n new RigaScontrinoClientDto(\n rr.getId(),\n rr.getScontrino().getId(),\n p.getId(),\n rr.getProdotto().getDescrizione(),\n rr.getProdotto().getPrezzo())));\n\n risp.setRigheScontrino(righeDto);\n risp.setScontrino(sc);\n risp.setMessaggio(\"scontrino pronto!\");\n\n return risp;\n }", "public void actualizarClasificacionArticuloProveedor(Collection<ProveedorClasificacionDTO> proveedorClasificacionDTOs, Integer codigoTipoProcesoIntegracion, String idUsuarioRegistro,Boolean sincronizarDescuentoNotaCredito, ProveedorVO proveedorVO, Collection<DatosOrdenCompra> ordenesCompra) throws SICException;", "@Override\n\tpublic Collection<LineaComercialClienteImportacionDTO> consultarLinComClienImp(LineaComercialClienteImportacionDTO linComCliImpDTO)throws SICException{\n\t\ttry {\n\t\t\tLogeable.LOG_SICV2.info(\"Metodo consultarLinComClienImp \");\n\t\t\tLogeable.LOG_SICV2.info(\"Parametros : \");\n\t\t\tLogeable.LOG_SICV2.info(\"codigoClienteImportacion() : \"+linComCliImpDTO.getId().getCodigoClienteImportacion());\n\t\t\tLogeable.LOG_SICV2.info(\"estado : \"+linComCliImpDTO.getEstado());\n\t\t\tLogeable.LOG_SICV2.info(\"codigoLineaComercial : \"+ linComCliImpDTO.getId().getCodigoLineaComercial());\n\n\t\t\t\n\t\t\tCriteria criteria = hibernateH.getHibernateSession().createCriteria(LineaComercialClienteImportacionDTO.class);\n\t\t\tProjectionList projectionList = Projections.projectionList()\n\t\t\t\t\t\t.add(Projections.property(\"id.codigoLineaComercial\"),\"id.codigoLineaComercial\")\n\t\t\t\t\t\t.add(Projections.property(\"id.codigoClienteImportacion\"),\"id.codigoClienteImportacion\")\n\t\t\t\t\t\t.add(Projections.property(\"id.codigoCompania\"),\"id.codigoCompania\")\n\t\t\t\t\t\t.add(Projections.property(\"estado\"),\"estado\");\n\t\t\t\n\t\t\tif(linComCliImpDTO.getId().getCodigoClienteImportacion() == null){\n\t\t\t\t/**si la validacion es verdadera se trae de base las descripciones de (lineaComercialDTO,clienteImportacionDTO) para presentar en pantalla estas descripciones**/\n\t\t\t\tprojectionList.add(Projections.property(\"linCom.nombre\"),\"lineaComercialDTO.nombre\");\n\t\t\t\tprojectionList.add(Projections.property(\"linCom.descripcion\"),\"lineaComercialDTO.descripcion\");\n\t\t\t\tprojectionList.add(Projections.property(\"clienImp.nombre\"),\"clienteImportacionDTO.nombre\");\n\t\t\t\tprojectionList.add(Projections.property(\"clienImp.siglas\"),\"clienteImportacionDTO.siglas\");\n\t\t\t\t\n\t\t\t\t/**se agrega restricciones para cliente importacion clienImp*/\n\t\t\t\tif(linComCliImpDTO.hasDynamicProperty(\"linComCliImp\") && linComCliImpDTO.getDynamicProperty(\"linComCliImp\") != null){\t\t\t\t\t\n\t\t\t\t\tDetachedCriteria subCriterio = DetachedCriteria.forClass(ClienteImportacionDTO.class, \"clienteImportacionDTO\")\n\t\t\t\t .add(Restrictions.eq(\"estado\", SICConstantes.ESTADO_ACTIVO_LITERAL))\n\t\t\t\t /**se agrega las restricciones ingresadas por el usuario**/\n\t\t\t\t .add(((DynamicCriteriaRestriction)linComCliImpDTO.getDynamicProperty(\"linComCliImp\")).getCriteriaRestriction())\n\t\t\t\t .setProjection(Projections.property(\"id.codigoClienteImportacion\"));\n\t\t\t\t\t/**Se agrega un exist el cual valida si existe una relacion**/\n\t\t\t\t\tcriteria.add(Subqueries.propertyIn(\"id.codigoClienteImportacion\", subCriterio));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\tcriteria.createAlias(\"lineaComercialDTO\", \"linCom\");\n\t\t\t\tcriteria.createAlias(\"clienteImportacionDTO\", \"clienImp\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t/**si la validacion es false no se une a otra tabla porque lo que se requiere es un solo registro**/\n\t\t\t\tcriteria.add(Restrictions.eq(\"id.codigoClienteImportacion\", linComCliImpDTO.getId().getCodigoClienteImportacion()));\n\t\t\t}\n\t\t\t/**al no agreagar esta restriccion se puede traer de base los estados(1,0)**/\n\t\t\tif(StringUtils.isNotBlank(linComCliImpDTO.getEstado())){\n\t\t\t\tcriteria.add(Restrictions.eq(\"estado\", linComCliImpDTO.getEstado()));\n\t\t\t}\n\t\t\t\n\t\t\tcriteria.add(Restrictions.eq(\"id.codigoLineaComercial\", linComCliImpDTO.getId().getCodigoLineaComercial()));\n\t\t\t\n\t\t\tcriteria.setProjection(projectionList);\n\t\t\t\n\t\t\tcriteria.setResultTransformer(new DtoResultTransformer(LineaComercialClienteImportacionDTO.class));\n\t\t\t\n\t\t\tCollection<LineaComercialClienteImportacionDTO> linComCliImpDTOResultCol = criteria.list();\n\t\t\t\n\t\t\treturn linComCliImpDTOResultCol;\n\t\t\t\n\t\t} catch (SICException e) {\n\t\t\tthrow new SICException(\"Error consultarLinComClienImp: \",e);\n\t\t}\n\t}", "public Conge find( Integer idConge ) ;", "@Override\r\n public Cliente buscarCliente(String cedula) throws Exception {\r\n return entity.find(Cliente.class, cedula);//busca el cliente\r\n }", "@Test\n\tpublic void test08FindByIdCRIL() throws SQLException {\n\t\tEntreprise entreprise = spentreprise.findById(0);\n\t\tassertThat(entreprise, is(Entreprise.CRIL));\n\t}", "@Test\n public void getPerrosTest() {\n List<PerroEntity> list = perroLogic.getPerros();\n Assert.assertEquals(Perrodata.size(), list.size());\n for (PerroEntity entity : list) {\n boolean found = false;\n for (PerroEntity storedEntity : Perrodata) {\n if (entity.getId().equals(storedEntity.getId())) {\n found = true;\n }\n }\n Assert.assertTrue(found);\n }\n }", "private void verificaIdade() {\r\n\t\thasErroIdade(idade.getText());\r\n\t\tisCanSave();\r\n\t}", "@Test\n @Transactional\n void createTipoObraWithExistingId() throws Exception {\n tipoObra.setId(1L);\n\n int databaseSizeBeforeCreate = tipoObraRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restTipoObraMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(tipoObra)))\n .andExpect(status().isBadRequest());\n\n // Validate the TipoObra in the database\n List<TipoObra> tipoObraList = tipoObraRepository.findAll();\n assertThat(tipoObraList).hasSize(databaseSizeBeforeCreate);\n }", "@Test\r\n\tpublic void testfetchServicoItensById() throws Exception\r\n\t{\n\t\tFetchByIdRequest request = new FetchByIdRequest();\r\n\t\trequest.setFetchId(3);\r\n\t\tInternalResultsResponse<ServicoItens> response = getServicoItensDAC().fetchServicoItensById(request);\r\n\t\tassertTrue(response.getResultsSetInfo().getPageSize() == 1);\r\n\t\tassertEquals(response.getStatus(), Status.OperationSuccess);\r\n\t}", "private boolean idSaoIguais(Service servico, Service servicoAComparar) {\n return servico.getId() == servicoAComparar.getId();\n }", "@Override\n public boolean compruebaPorId(Integer id) {\n return usuarioRepository.existsById(id);\n }", "private void testVolverAInsertarObservacion() throws SQLException \n\t{\n\t\tLong idObv = this.observacion.getIdObservation();\n\t\tLong idArea = this.observacion.getArea().getIdArea();\n\t\tLong idIndicador = this.observacion.getIndicator().getIdIndicator();\n\t\tLong idMedida = this.observacion.getMeasure().getIdMeasure();\n\t\tLong idProvider = this.observacion.getProvider().getIdOrganization();\n\t\tLong idTiempo = this.observacion.getTime().getIdTime();\n\t\t\n\t\t//Borrar los ids\n\t\tthis.observacion.setIdObservation(null);\n\t\tthis.observacion.getArea().setIdArea(null);\n\t\tthis.observacion.getIndicator().setIdIndicator(null);\n\t\tthis.observacion.getMeasure().setIdMeasure(null);\n\t\tthis.observacion.getProvider().setIdOrganization(null);\n\t\tthis.observacion.getTime().setIdTime(null);\n\t\t\n\t\t// Insertar la observacion\n\t\tObservacionesDAO obvDAO = PersistenceFactory.createObservacionesDAO();\n\t\tthis.observacion = obvDAO.insertarObservacion(this.observacion);\n\t\t\n\t\t//Comprobar que se les ha asignado el mismo id\n\t\tassertEquals(idObv, this.observacion.getIdObservation());\n\t\tassertEquals(idArea, this.observacion.getArea().getIdArea());\n\t\tassertEquals(idIndicador, this.observacion.getIndicator().getIdIndicator());\n\t\tassertEquals(idProvider, this.observacion.getProvider().getIdOrganization());\n\t\tassertEquals(idMedida, this.observacion.getMeasure().getIdMeasure());\n\t\tassertEquals(idTiempo,this.observacion.getTime().getIdTime());\n\t\t\n\t\t\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof ClienteContrato)) {\n return false;\n }\n ClienteContrato other = (ClienteContrato) object;\n if ((this.codClienteContrato == null && other.codClienteContrato != null) || (this.codClienteContrato != null && !this.codClienteContrato.equals(other.codClienteContrato))) {\n return false;\n }\n return true;\n }", "@Test\n public void retriveByIdTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(1);\n assertNotNull(servizio,\"Should return true if return Servizio 1\");\n }", "private boolean existeCondicionSeguridad(ConcursoPuestoAgr concursoPuestoAgr) {\r\n\t\tString query =\r\n\t\t\t\" SELECT * FROM planificacion.det_condicion_segur \"\r\n\t\t\t\t+ \" where id_concurso_puesto_agr = \" + concursoPuestoAgr.getIdConcursoPuestoAgr()\r\n\t\t\t\t+ \" and tipo = 'GRUPO' \";\r\n\t\treturn seleccionUtilFormController.existeNative(query);\r\n\t}", "@Override\r\n\tpublic ComercialSolicitudServicioAlCliente findOne(Long id) {\n\t\treturn repository.findById(id).orElse(null);\r\n\t}", "private void grabarProyectoCarrerasOferta() {\r\n try {\r\n if (!sessionProyecto.getEstadoActual().getCodigo().equalsIgnoreCase(EstadoProyectoEnum.INICIO.getTipo())) {\r\n return;\r\n }\r\n for (ProyectoCarreraOferta proyectoCarreraOferta : sessionProyecto.getCarrerasSeleccionadasTransfer()) {\r\n Carrera c = carreraService.find(proyectoCarreraOferta.getCarreraId());\r\n List<ProyectoCarreraOferta> proyectoCarreraOfertas = proyectoCarreraOfertaService.buscar(\r\n new ProyectoCarreraOferta(sessionProyecto.getProyectoSeleccionado(), null, null, Boolean.TRUE));\r\n \r\n Long pcoId = devuelveProyectoCarreraId(proyectoCarreraOfertas, proyectoCarreraOferta);\r\n proyectoCarreraOferta = proyectoCarreraOfertaService.buscarPorId(new ProyectoCarreraOferta(pcoId));\r\n if (proyectoCarreraOferta == null) {\r\n proyectoCarreraOferta = new ProyectoCarreraOferta(sessionProyecto.getProyectoSeleccionado(), c.getId(), sessionProyecto.getOfertaAcademicaSeleccionada().getId(),\r\n Boolean.TRUE);\r\n if (contieneCarrera(proyectoCarreraOfertas, proyectoCarreraOferta) == false) {\r\n proyectoCarreraOfertaService.guardar(proyectoCarreraOferta);\r\n this.grabarIndividuoPCO(proyectoCarreraOferta);\r\n logDao.create(logDao.crearLog(\"ProyectoCarreraOferta\", proyectoCarreraOferta.getId() + \"\", \"CREAR\", \"Carrera=\"\r\n + proyectoCarreraOferta.getCarreraId() + \"|Oferta=\" + proyectoCarreraOferta.getOfertaAcademicaId() + \"|Proyecto= \"\r\n + proyectoCarreraOferta.getProyectoId().getId(), sessionUsuario.getUsuario()));\r\n }\r\n }\r\n proyectoCarreraOferta.setEsActivo(true);\r\n proyectoCarreraOfertaService.actualizar(proyectoCarreraOferta);\r\n logDao.create(logDao.crearLog(\"ProyectoCarreraOferta\", proyectoCarreraOferta.getId() + \"\", \"EDITAR\", \"Carrera=\"\r\n + proyectoCarreraOferta.getCarreraId() + \"|Oferta=\" + proyectoCarreraOferta.getOfertaAcademicaId()\r\n + \"|Proyecto= \" + proyectoCarreraOferta.getProyectoId().getId(), sessionUsuario.getUsuario()));\r\n }\r\n } catch (Exception e) {\r\n LOG.info(e.getMessage());\r\n }\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Contrato)) {\n return false;\n }\n Contrato other = (Contrato) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "public void cargarEConcepto() {\n\tevidenciaConcepto = true;\n\tif (conceptoSeleccionado.getOrigen().equals(\n\t OrigenInformacionEnum.CONVENIOS.getValor())) {\n\t idEvidencia = convenioVigenteDTO.getId();\n\t nombreFichero = iesDTO.getCodigo() + \"_\"\n\t\t + convenioVigenteDTO.getId();\n\t}\n\n\ttry {\n\t listaEvidenciaConcepto = institutosServicio\n\t\t .obtenerEvidenciasDeIesPorIdConceptoEIdTabla(\n\t\t iesDTO.getId(), conceptoSeleccionado.getId(),\n\t\t idEvidencia, conceptoSeleccionado.getOrigen());\n\n\t} catch (ServicioException e) {\n\t LOG.log(Level.SEVERE, e.getMessage(), e);\n\t}\n }", "@Test\r\n public void getCarritoDeComprasTest() {\r\n System.out.println(\"g entra\"+data);\r\n CarritoDeComprasEntity entity = data.get(0);\r\n CarritoDeComprasEntity newEntity = carritoDeComprasPersistence.find(entity.getId());\r\n Assert.assertNotNull(newEntity);\r\n Assert.assertEquals(entity.getTotalCostDeCarritoCompras(), newEntity.getTotalCostDeCarritoCompras());\r\n System.out.println(\"g voy\"+data);\r\n }", "@Override\r\n @Transactional(rollbackFor = InfraccionException.class)\r\n public List<InfraccionDTO> findByFilter(EscenarioIncumplimientoFilter filtro) throws InfraccionException {\r\n LOG.info(\"findByFilter\");\r\n List<InfraccionDTO> retorno=null;\r\n try{\r\n Query query = getFindQuery(filtro);\r\n retorno = InfraccionBuilder.toListInfraccionDTO(query.getResultList());\r\n }catch(Exception e){\r\n LOG.error(\"Error en findByFilter\",e);\r\n }\r\n return retorno;\r\n }", "@Test\n @Transactional\n void createTerritorioWithExistingId() throws Exception {\n territorio.setId(1L);\n\n int databaseSizeBeforeCreate = territorioRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restTerritorioMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(territorio)))\n .andExpect(status().isBadRequest());\n\n // Validate the Territorio in the database\n List<Territorio> territorioList = territorioRepository.findAll();\n assertThat(territorioList).hasSize(databaseSizeBeforeCreate);\n }", "@Override\n public boolean containsId(int Id) {\n try {\n Entity retValue = null; \n Connection c = null;\n PreparedStatement pstmt = null;\n ResultSet rs = null;\n c = DBUtils.getConnection();\n pstmt = c.prepareStatement(\"SELECT * FROM curso where idcurso = ?\");\n\n pstmt.setInt(1, Id);\n\n rs = pstmt.executeQuery();\n\n if (rs.next()) {\n return true; \n } \n \n } catch (SQLException ex) {\n Logger.getLogger(JdbcCursoRepository.class.getName()).log(Level.SEVERE, null, ex);\n }\n return false;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Convenio)) {\n return false;\n }\n Convenio other = (Convenio) object;\n if ((this.idconvenio == null && other.idconvenio != null) || (this.idconvenio != null && !this.idconvenio.equals(other.idconvenio))) {\n return false;\n }\n return true;\n }", "private static void registrarAuditoriaDetallesClienteArchivo(Connexion connexion,ClienteArchivo clientearchivo)throws Exception {\n\t\t\r\n\t\tString strValorActual=null;\r\n\t\tString strValorNuevo=null;\r\n\t\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getid_cliente().equals(clientearchivo.getClienteArchivoOriginal().getid_cliente()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getid_cliente()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getid_cliente().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getid_cliente()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getid_cliente().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.IDCLIENTE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getid_tipo_archivo().equals(clientearchivo.getClienteArchivoOriginal().getid_tipo_archivo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getid_tipo_archivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getid_tipo_archivo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getid_tipo_archivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getid_tipo_archivo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.IDTIPOARCHIVO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getnombre().equals(clientearchivo.getClienteArchivoOriginal().getnombre()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getnombre();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getnombre() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.NOMBRE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getarchivo().equals(clientearchivo.getClienteArchivoOriginal().getarchivo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getarchivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getarchivo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getarchivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getarchivo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.ARCHIVO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getdescripcion().equals(clientearchivo.getClienteArchivoOriginal().getdescripcion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getdescripcion();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getdescripcion() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.DESCRIPCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t}", "@Test\n public void updateComentarioTest(){\n ComentarioEntity entity = data.get(0);\n PodamFactory factory = new PodamFactoryImpl();\n ComentarioEntity newEntity = factory.manufacturePojo(ComentarioEntity.class);\n newEntity.setId(entity.getId());\n comentarioPersistence.update(newEntity);\n \n ComentarioEntity respuesta = em.find(ComentarioEntity.class,entity.getId());\n \n Assert.assertEquals(respuesta.getNombreUsuario(), newEntity.getNombreUsuario());\n \n \n }", "@Test\n public void whenFindById_thenReturnSdlcSystem() throws Exception {\n SdlcSystem newSdlcSystem = (SdlcSystem)appendDates(getSdlcSystem(\"https://java.itunufatoki.com\"));\n newSdlcSystem = entityManager.merge(newSdlcSystem);\n entityManager.flush();\n\n // When\n SdlcSystem sdlcSystem = sdlcSystemRepository.findById(newSdlcSystem.getId()).get();\n\n // Then\n assertThat(sdlcSystem.getId()).isEqualTo(newSdlcSystem.getId());\n assertThat(sdlcSystem.getBaseUrl()).isEqualTo(newSdlcSystem.getBaseUrl());\n assertThat(sdlcSystem.getDescription()).isEqualTo(newSdlcSystem.getDescription());\n }", "@Test\n public void getQuejaTest() {\n QuejaEntity entity = data.get(0);\n QuejaEntity newEntity = quejaPersistence.find(dataServicio.get(0).getId(), entity.getId());\n Assert.assertNotNull(newEntity);\n Assert.assertEquals(entity.getName(), newEntity.getName());\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof SicRecurso)) {\n return false;\n }\n SicRecurso other = (SicRecurso) object;\n if ((this.idSicRecurso == null && other.idSicRecurso != null) || (this.idSicRecurso != null && !this.idSicRecurso.equals(other.idSicRecurso))) {\n return false;\n }\n return true;\n }", "private void obtenerClienteRecomendado(Cliente clienteParametro, Long oidPais) throws MareException {\n \n UtilidadesLog.info(\" DAOSolicitudes.obtenerClienteRecomendado(ClienteclienteParametro, Long oidPais):Entrada\");\n\n BelcorpService bsInc = null;\n RecordSet respuestaInc = null;\n StringBuffer queryInc = new StringBuffer();\n ArrayList lstRecomendados;\n\n if ( clienteParametro.getClienteRecomendante() != null){\n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"oidClienteRecomendante=\"+clienteParametro.getClienteRecomendante().getRecomendante());\n }\n\n try {\n bsInc = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n }\n\n try {\n queryInc.append(\" SELECT \");\n queryInc.append(\" CLIE_OID_CLIE_VNDO CLIE_OID_CLIE, \");\n queryInc.append(\" FEC_DESD FEC_INIC, \");\n queryInc.append(\" FEC_HAST FEC_FINA \");\n queryInc.append(\" FROM MAE_CLIEN_VINCU, MAE_TIPO_VINCU \");\n queryInc.append(\" WHERE CLIE_OID_CLIE_VNTE = \" + clienteParametro.getOidCliente());\n queryInc.append(\" AND TIVC_OID_TIPO_VINC = OID_TIPO_VINC \");\n queryInc.append(\" AND PAIS_OID_PAIS = \" + oidPais);\n queryInc.append(\" AND IND_RECO = 1 \");\n queryInc.append(\" AND CLIE_OID_CLIE_VNDO NOT IN ( \");\n \n // queryInc.append(\" SELECT RDO.CLIE_OID_CLIE, FEC_INIC, FEC_FINA \");\n queryInc.append(\" SELECT DISTINCT RDO.CLIE_OID_CLIE \");\n queryInc.append(\" FROM INC_CLIEN_RECDO RDO, CRA_PERIO, \");\n queryInc.append(\" INC_CLIEN_RECTE RECT \");\n queryInc.append(\" WHERE PERD_OID_PERI = OID_PERI \");\n queryInc.append(\" AND RECT.CLIE_OID_CLIE = \" + clienteParametro.getOidCliente());\n queryInc.append(\" AND CLR3_OID_CLIE_RETE = OID_CLIE_RETE \");\n \n queryInc.append(\" ) \");\n \n respuestaInc = bsInc.dbService.executeStaticQuery(queryInc.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuestaInc \" + respuestaInc); \n\n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n\n //BelcorpService bsMae = null;\n RecordSet respuestaMae = null;\n //StringBuffer queryMae = new StringBuffer();\n\n try {\n bsInc = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n }\n \n boolean hayRecomendado = false;\n Cliente clienteLocal = new Cliente();\n lstRecomendados = clienteParametro.getClienteRecomendado();\n\n if (!respuestaInc.esVacio()) {\n \n hayRecomendado = true;\n \n clienteParametro.setIndRecomendadosEnINC(true);\n \n /* vbongiov -- RI SiCC 20090941 -- 16/06/2009 \n * no lleno lstRecomendados con estos valores solo mantengo el indicador IndRecomendadosEnINC \n \n lstRecomendados.clear();\n \n for(int i=0; i<respuestaInc.getRowCount();i++){ \n ClienteRecomendado clienteRecomendado = new ClienteRecomendado(); \n\n clienteRecomendado.setRecomendante(clienteParametro.getOidCliente()); \n \n BigDecimal recomendado = (BigDecimal) respuestaInc.getValueAt(i, \"CLIE_OID_CLIE\");\n clienteRecomendado.setRecomendado((recomendado != null) ? new Long(recomendado.longValue()) : null);\n \n clienteRecomendado.setFechaInicio((Date) respuestaInc.getValueAt(i, \"FEC_INIC\"));\n Date fechaFin = (Date) respuestaInc.getValueAt(i, \"FEC_FINA\");\n clienteRecomendado.setFechaFin((fechaFin != null) ? fechaFin : null);\n\n clienteLocal.setOidCliente(clienteRecomendado.getRecomendado());\n this.obtenerPeriodosConPedidosCliente(clienteLocal);\n clienteRecomendado.setPeriodosConPedidos(clienteLocal.getPeriodosConPedidos());\n \n lstRecomendados.add(clienteRecomendado); \n }*/\n } \n \n // vbongiov -- RI SiCC 20090941 -- 16/06/2009 \n // \n \n try {\n queryInc = new StringBuffer(); \n queryInc.append(\" SELECT CLIE_OID_CLIE_VNDO, FEC_DESD, FEC_HAST \");\n queryInc.append(\" FROM MAE_CLIEN_VINCU, MAE_TIPO_VINCU \");\n queryInc.append(\" WHERE CLIE_OID_CLIE_VNTE = \" + clienteParametro.getOidCliente());\n queryInc.append(\" AND TIVC_OID_TIPO_VINC = OID_TIPO_VINC \");\n queryInc.append(\" AND PAIS_OID_PAIS = \" + oidPais);\n queryInc.append(\" AND IND_RECO = 1 \");\n\n respuestaMae = bsInc.dbService.executeStaticQuery(queryInc.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuestaMae \" + respuestaMae); \n \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n \n if (!respuestaMae.esVacio()) {\n \n hayRecomendado = true;\n \n clienteParametro.setIndRecomendadosEnMAE(true);\n \n lstRecomendados.clear();\n \n for(int i=0; i<respuestaMae.getRowCount();i++){ \n \n ClienteRecomendado clienteRecomendado = new ClienteRecomendado(); \n\n clienteRecomendado.setRecomendante(clienteParametro.getOidCliente());\n\n clienteRecomendado.setRecomendado(new Long(((BigDecimal) \n respuestaMae.getValueAt(i, \"CLIE_OID_CLIE_VNDO\")).longValue()));\n {\n Date fechaInicio = (Date) respuestaMae.getValueAt(i, \"FEC_DESD\");\n clienteRecomendado.setFechaInicio((fechaInicio != null) ? fechaInicio : null);\n }\n\n {\n Date fechaFin = (Date) respuestaMae.getValueAt(i, \"FEC_HAST\");\n clienteRecomendado.setFechaFin((fechaFin != null) ? fechaFin : null);\n }\n \n clienteLocal.setOidCliente(clienteRecomendado.getRecomendado());\n this.obtenerPeriodosConPedidosCliente(clienteLocal);\n clienteRecomendado.setPeriodosConPedidos(clienteLocal.getPeriodosConPedidos());\n \n lstRecomendados.add(clienteRecomendado); \n \n }\n \n clienteParametro.setClienteRecomendado(lstRecomendados);\n \n } else {\n hayRecomendado = false;\n }\n\n if (!hayRecomendado) {\n clienteParametro.setClienteRecomendado(null);\n }\n \n // JVM, sicc 20070381, if, manejo del Recomendador, bloque de recuparacion de periodo\n if (lstRecomendados.size() > 0)\n { \n try {\n bsInc = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n } \n \n RecordSet respuestaMaeRdr = null;\n\n try { \n queryInc = new StringBuffer();\n queryInc.append(\" SELECT DISTINCT CLIE_OID_CLIE_VNTE , FEC_DESD , FEC_HAST \");\n queryInc.append(\" FROM MAE_CLIEN_VINCU \");\n queryInc.append(\" WHERE CLIE_OID_CLIE_VNTE = \" + clienteParametro.getOidCliente());\n respuestaMaeRdr = bsInc.dbService.executeStaticQuery(queryInc.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuestaMaeRdr \" + respuestaMaeRdr); \n \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n \n ClienteRecomendante clienteRecomendador = new ClienteRecomendante();\n \n if (!respuestaMaeRdr.esVacio()) {\n \n {\n BigDecimal recomendador = (BigDecimal) respuestaMaeRdr.getValueAt(0, \"CLIE_OID_CLIE_VNTE\");\n clienteRecomendador.setRecomendante((recomendador != null) ? new Long(recomendador.longValue()) : null);\n }\n \n clienteRecomendador.setFechaInicio((Date) respuestaMaeRdr.getValueAt(0, \"FEC_DESD\"));\n // fecha fin de INC\n {\n Date fechaFin = (Date) respuestaMaeRdr.getValueAt(0, \"FEC_HAST\");\n clienteRecomendador.setFechaFin((fechaFin != null)? fechaFin : null);\n }\n \n clienteParametro.setClienteRecomendador(clienteRecomendador);\n }\n \n for (int i=0; i<lstRecomendados.size(); i++){\n\n ClienteRecomendado clienteRecomendados = new ClienteRecomendado(); \n \n clienteRecomendados = (ClienteRecomendado) lstRecomendados.get(i);\n \n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n \n try {\n bsInc = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n } \n\n queryInc = new StringBuffer();\n \n try {\n queryInc.append(\" select x.n, x.oid_peri, x.fec_inic, x.fec_fina, x.pais_oid_pais, x.marc_oid_marc, x.cana_oid_cana \"); \n queryInc.append(\" from ( \"); \n queryInc.append(\" select 1 n, b.oid_peri as oid_peri, \"); \n queryInc.append(\" b.fec_inic as fec_inic, \"); \n queryInc.append(\" b.fec_fina as fec_fina, \"); \n queryInc.append(\" b.pais_oid_pais as pais_oid_pais, \"); \n queryInc.append(\" b.marc_oid_marc as marc_oid_marc, \"); \n queryInc.append(\" b.cana_oid_cana as cana_oid_cana \"); \n queryInc.append(\" from mae_clien_prime_conta a, cra_perio b, seg_perio_corpo c \"); \n queryInc.append(\" where a.clie_oid_clie = \" + clienteRecomendados.getRecomendado()); \n queryInc.append(\" and a.perd_oid_peri = b.oid_peri \"); \n queryInc.append(\" and b.peri_oid_peri = c.oid_peri \"); \n queryInc.append(\" and b.oid_peri in ( \"); \n queryInc.append(\" select oid_peri \"); \n queryInc.append(\" from cra_perio \"); \n queryInc.append(\" where fec_inic <= to_date ('\"+ df.format(clienteRecomendados.getFechaInicio()) +\"', 'DD-MM-YYYY') \");\n queryInc.append(\" and to_date ('\"+ df.format(clienteRecomendados.getFechaInicio()) +\"', 'DD/MM/YYYY') <= fec_fina ) \");\n queryInc.append(\" union \"); \n queryInc.append(\" select rownum + 1 as n, oid_peri as oid_peri, \"); \n queryInc.append(\" fec_inic as fec_inic, \"); \n queryInc.append(\" fec_fina as fec_fina, \"); \n queryInc.append(\" pais_oid_pais as pais_oid_pais, \"); \n queryInc.append(\" marc_oid_marc as marc_oid_marc, \"); \n queryInc.append(\" cana_oid_cana as cana_oid_cana \"); \n queryInc.append(\" from cra_perio \"); \n queryInc.append(\" where fec_inic <= to_date ('\"+ df.format(clienteRecomendados.getFechaInicio()) +\"', 'DD-MM-YYYY') \");\n queryInc.append(\" and to_date('\"+ df.format(clienteRecomendados.getFechaInicio()) +\"', 'DD-MM-YYYY') <= fec_fina \");\n queryInc.append(\" order by oid_peri asc \"); \n queryInc.append(\" ) x \"); \n queryInc.append(\" order by n \"); \n\n respuestaInc = bsInc.dbService.executeStaticQuery(queryInc.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuestaInc \" + respuestaInc); \n\n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n\n BigDecimal bd;\n \n if (!respuestaInc.esVacio()) {\n\n Periodo periodo = new Periodo();\n \n bd = (BigDecimal) respuestaInc.getValueAt(0, \"OID_PERI\");\n periodo.setOidPeriodo(new Long(bd.longValue()));\n \n periodo.setFechaDesde((Date) respuestaInc.getValueAt(0, \"FEC_INIC\"));\n\n periodo.setFechaHasta((Date) respuestaInc.getValueAt(0, \"FEC_FINA\")); \n \n bd = (BigDecimal) respuestaInc.getValueAt(0, \"PAIS_OID_PAIS\");\n periodo.setOidPais(new Long(bd.longValue()));\n \n bd = (BigDecimal) respuestaInc.getValueAt(0, \"MARC_OID_MARC\");\n periodo.setOidMarca(new Long(bd.longValue()));\n\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"CANA_OID_CANA\");\n periodo.setOidCanal(new Long(bd.longValue()));\n \n clienteRecomendados.setPeriodo(periodo);\n } \n }\n }\n\n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"lstRecomendados(\"+lstRecomendados.size() + \n \") getIndRecomendadosEnMAE(\"+clienteParametro.getIndRecomendadosEnMAE() +\n \") getIndRecomendadosEnINC(\"+clienteParametro.getIndRecomendadosEnINC() +\")\"); \n \n UtilidadesLog.info(\" DAOSolicitudes.obtenerClienteRecomendado(ClienteclienteParametro, Long oidPais):Salida\"); \n \n }", "private void checkDatosCliente(Cliente cliente) throws ValidacionException{\n\t\tList<Cliente> clientes = clienteDAOLocal.getClienteByCUIT(cliente.getCuit(), cliente.getId() == null ? 0 : cliente.getId());\n\t\tif(!clientes.isEmpty()) {\n\t\t\tthrow new ValidacionException(EValidacionException.CLIENTE_YA_EXISTE_CUIT.getInfoValidacion());\n\t\t}\n\t\t// Chequeo lo del dígito verificador\n\t\tif(!cuitValido(cliente.getCuit())) {\n\t\t\tthrow new ValidacionException(EValidacionException.CLIENTE_CUIT_INVALIDO.getInfoValidacion());\n\t\t}\n\t}", "public static void registrarAuditoria(Connexion connexion,Long idUsuario,ClienteArchivo clientearchivo,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(ClienteArchivoConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(clientearchivo.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,ClienteArchivoDataAccess.TABLENAME, clientearchivo.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(ClienteArchivoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////ClienteArchivoLogic.registrarAuditoriaDetallesClienteArchivo(connexion,clientearchivo,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(clientearchivo.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!clientearchivo.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,ClienteArchivoDataAccess.TABLENAME, clientearchivo.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////ClienteArchivoLogic.registrarAuditoriaDetallesClienteArchivo(connexion,clientearchivo,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,ClienteArchivoDataAccess.TABLENAME, clientearchivo.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(clientearchivo.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,ClienteArchivoDataAccess.TABLENAME, clientearchivo.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(ClienteArchivoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////ClienteArchivoLogic.registrarAuditoriaDetallesClienteArchivo(connexion,clientearchivo,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}", "@Test\n public void testEliminarCliente() throws Exception {\n long sufijo = System.currentTimeMillis(); \n Usuario usuario = new Usuario(\"Alexander\" + String.valueOf(sufijo), \"alex1.\", TipoUsuario.Administrador); \n usuario.setDocumento(Long.valueOf(sufijo)); \n usuario.setTipoDocumento(TipoDocumento.CC);\n servicio.registrar(usuario); \n servicio.eliminarCliente(usuario.getLogin()); \n Usuario usuarioRegistrado =(Usuario) servicioPersistencia.findById(Usuario.class, usuario.getLogin()); \n assertNull(usuarioRegistrado); \n }", "@ApiOperation(value = \"Retorna la Ubicacion de Implemntacion enviado a buscar de la BD\", authorizations = {@Authorization(value = \"Token-PGC\")})\r\n @GetMapping(value = UBICACION_IMPLEMENTACION_ENDPOINT_FIND_BY_ID_UBIC_NIVEL_IMPL_2, produces = \"application/json; charset=UTF-8\")\r\n public HashMap<String, Object> getFindByIdNivelImplementacionAndIdNivelUbicacion(@ApiParam(value = \"Identificador de la Ubicacion de Implementacion a Buscar, segun el Nivel de Implementacion\", required = true)\r\n @PathVariable(\"idNivelImplementacion\") long idNivelImplementacion,\r\n @ApiParam(value = \"Identificador de la Ubicacion de Implementacion a Buscar, segun el Nivel de Ubicacion\", required = true)\r\n @PathVariable(\"idNivelUbicacion\") long idNivelUbicacion) throws Exception {\r\n //Ejecuta el try Cacth\r\n msgExceptions msgExeptions = new msgExceptions();\r\n\r\n try {\r\n // Busca el Nivel de Implementacion Solicitado\r\n TblNivelImplementacion _tblNivelImplementacion = _nivelImplementacionRepository.findByIdNivel( idNivelImplementacion );\r\n\r\n // Busca el Nivel de Ubicacion Solicitado\r\n TblNivelUbicacionImplementacion _tblNivelUbicacionImplementacion = _nivelUbicacionImplementacionRepository.findByIdNivelUbicacion( idNivelUbicacion );\r\n\r\n try {\r\n if ( _ubicacionImplementacionRepository.countByIdNivelImplementacionAndIdNivelUbicacion( _tblNivelImplementacion, _tblNivelUbicacionImplementacion ) == 0) {\r\n // Sobreescirbe el Metodo de Mensajes\r\n msgMethod = \"No se ha encontrado dato de la Ubicacion de Implementación consultado\";\r\n\r\n msgExeptions.map.put(\"error\", \"No data found\");\r\n\r\n //Retorno del json\r\n return msgExeptions.msgJson(msgMethod, 200);\r\n } else {\r\n //Sobreescirbe el Metodo de Mensajes\r\n msgMethod = \"Detalle de la de Ubicacion de Implementacion consultado\";\r\n msgExeptions.map.put(\"data\", _ubicacionImplementacionRepository.findByIdNivelImplementacionAndIdNivelUbicacion( _tblNivelImplementacion, _tblNivelUbicacionImplementacion ));\r\n\r\n //Retorno del json\r\n return msgExeptions.msgJson(msgMethod, 200);\r\n }\r\n } catch (Exception ex) {\r\n msgMethod = \"No se ha encontrado dato de la Ubicacion de Implementación consultada\";\r\n throw new RuntimeException(\"Se ha producido una excepción con el mensaje : \" + msgMethod, ex);\r\n }\r\n } catch (Exception ex) {\r\n msgMethod = \"No se ha encontrado dato de la Ubicacion de Implementación consultada\";\r\n throw new RuntimeException(\"Se ha producido una excepción con el mensaje : \" + msgMethod, ex);\r\n }\r\n }", "@Test\n @Transactional\n void createInternacoesWithExistingId() throws Exception {\n internacoes.setId(1L);\n\n int databaseSizeBeforeCreate = internacoesRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restInternacoesMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(internacoes)))\n .andExpect(status().isBadRequest());\n\n // Validate the Internacoes in the database\n List<Internacoes> internacoesList = internacoesRepository.findAll();\n assertThat(internacoesList).hasSize(databaseSizeBeforeCreate);\n }", "@Override\n public CerereDePrietenie findOne(Long aLong) {\n// String SQL = \"SELECT id,id_1,id_2,status,datac\"\n// + \"FROM cereredeprietenie \"\n// + \"WHERE id = ?\";\n//\n// try (Connection conn = connect();\n// PreparedStatement pstmt = conn.prepareStatement(SQL)) {\n//\n// pstmt.setInt(1, Math.toIntExact(aLong));\n// ResultSet rs = pstmt.executeQuery();\n//\n// while(rs.next()) {\n// Long id = rs.getLong(\"id\");\n// Long id_1 = rs.getLong(\"id_1\");\n// Long id_2 = rs.getLong(\"id_2\");\n//\n// String status = rs.getString(\"status\");\n// LocalDateTime data = rs.getObject( 5,LocalDateTime.class);\n//\n// Utilizator u1=repository.findOne(id_1);\n// Utilizator u2=repository.findOne(id_2);\n//\n// CerereDePrietenie u =new CerereDePrietenie(u1,u2);\n// u.setId(id);\n// u.setStatus(status);\n// u.setData(data);\n// return u;\n// }\n//\n//\n// } catch (SQLException ex) {\n// System.out.println(ex.getMessage());\n// }\n//\n// return null;\n List<CerereDePrietenie> list=new ArrayList<>();\n findAll().forEach(list::add);\n for(CerereDePrietenie cerere: list){\n if(cerere.getId() == aLong)\n return cerere;\n }\n return null;\n }", "public void verificarDatosConsola(Cliente cliente, List<Cuenta> listaCuentas) {\n\n int codigoCliente = cliente.getCodigo();\n\n System.out.println(\"Codigo: \"+cliente.getCodigo());\n System.out.println(\"Nombre: \"+cliente.getNombre());\n System.out.println(\"DPI: \"+cliente.getDPI());\n System.out.println(\"Direccion: \"+cliente.getDireccion());\n System.out.println(\"Sexo: \"+cliente.getSexo());\n System.out.println(\"Password: \"+cliente.getPassword());\n System.out.println(\"Tipo de Usuario: \"+ 3);\n\n System.out.println(\"Nacimiento: \"+cliente.getNacimiento());\n System.out.println(\"ArchivoDPI: \"+cliente.getDPIEscaneado());\n System.out.println(\"Estado: \"+cliente.isEstado());\n \n \n for (Cuenta cuenta : listaCuentas) {\n System.out.println(\"CUENTAS DEL CLIENTE\");\n System.out.println(\"Numero de Cuenta: \"+cuenta.getNoCuenta());\n System.out.println(\"Fecha de Creacion: \"+cuenta.getFechaCreacion());\n System.out.println(\"Saldo: \"+cuenta.getSaldo());\n System.out.println(\"Codigo del Dueño: \"+codigoCliente);\n \n }\n \n\n\n }", "public Cliente buscarCliente(int codigo) {\n Cliente cliente =new Cliente();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, \"\n + \"idioma, categoria FROM clientes where codigo=? \";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n ps.setInt(1, codigo);\n\t\tSavepoint sp1 = con.setSavepoint(\"SAVE_POINT_ONE\");\n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n cliente.setCodigo(rs.getInt(\"codigo\"));\n cliente.setNit(rs.getString(\"nit\"));\n cliente.setEmail(rs.getString(\"email\"));\n cliente.setPais(rs.getString(\"pais\"));\n cliente.setFechaRegistro(rs.getDate(\"fecharegistro\"));\n cliente.setRazonSocial(rs.getString(\"razonsocial\"));\n cliente.setIdioma(rs.getString(\"idioma\"));\n cliente.setCategoria(rs.getString(\"categoria\")); \n\t\t} \n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n }\n return cliente;\n\t}", "public void containsACustomer() {\r\n\t\tSystem.out.println(\"\\nChecking if a customer object is in persistent context\");\r\n\r\n\t\tEntityManager em = emf.createEntityManager();\r\n//\t\tEntityTransaction tx = em.getTransaction();\r\n//\t\ttx.begin();\r\n\t\tCustomer2 customerRetrieved = em.find(Customer2.class, (long)10);\r\n\t\tSystem.out.println(customerRetrieved);\r\n\t\tCustomer2 newCustomer = new Customer2(customerRetrieved.getCustId(), \r\n\t\t\t\t\t\t\t\t\t\t\t customerRetrieved.getFirstName(), \r\n\t\t\t\t\t\t\t\t\t\t\t customerRetrieved.getLastName());\r\n\t\tSystem.out.println(newCustomer);\r\n\t\tSystem.out.println(\"Does persistent context have newCustomer? \" + em.contains(newCustomer));\r\n\t\tSystem.out.println(\"Does persistent context have customerRetrieved? \" + em.contains(customerRetrieved));\r\n\t\tem.remove(customerRetrieved);\r\n\t\tSystem.out.println(\"Does persistent context have customerRetrieved? \" + em.contains(customerRetrieved));\r\n//\t\ttx.commit();\r\n\t\tem.close();\r\n\t}", "public static boolean testDaoLireSecteur() {\n boolean ok = true;\n ArrayList<Secteur> lesSecteurs = new ArrayList<Secteur>();\n try {\n lesSecteurs = daoSecteur.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des secteurs\");\n for (Secteur unSecteur: lesSecteurs){\n System.out.println(unSecteur);\n }\n return ok;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Ordemdeservico)) {\n return false;\n }\n Ordemdeservico other = (Ordemdeservico) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Test\n @Transactional\n void createSectieWithExistingId() throws Exception {\n sectie.setId(1L);\n\n int databaseSizeBeforeCreate = sectieRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restSectieMockMvc\n .perform(\n post(ENTITY_API_URL).with(csrf()).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(sectie))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the Sectie in the database\n List<Sectie> sectieList = sectieRepository.findAll();\n assertThat(sectieList).hasSize(databaseSizeBeforeCreate);\n\n // Validate the Sectie in Elasticsearch\n verify(mockSectieSearchRepository, times(0)).save(sectie);\n }", "@Override\n public Boleto anular(Boleto boleto) throws CRUDException {\n\n Boleto boletoAnular = em.find(Boleto.class, boleto.getIdBoleto());\n\n Optional op = Optional.ofNullable(boletoAnular);\n\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe el Boleto\");\n }\n\n if (boletoAnular.getEstado().equals(Boleto.Estado.ANULADO)) {\n throw new CRUDException(\"El Boleto ya se encuentra anulado\");\n }\n\n //Si el Boleto esta Emitido se deben dar de bajas su contabilidad\n if (boletoAnular.getEstado().equals(Boleto.Estado.EMITIDO)) {\n System.out.println(\"Anulando Boleto:\" + boleto.getIdBoleto());\n System.out.println(\"Anulando Boleto NotaDebito:\" + boleto.getIdNotaDebito());\n System.out.println(\"Anulando Boleto IngresoCaja :\" + boleto.getIdIngresoCaja());\n boletoAnular.setEstado(Boleto.Estado.ANULADO);\n em.merge(boletoAnular);\n\n //anulamos los asientos contables de los asientos. (AD y CI)\n ejbComprobante.anularAsientosContables(boletoAnular);\n\n //anulamos las transacciones de la nota de debito\n //El proceso de Anular la transaccion de la Nota de Debito\n //llama internamente en el Procedimiento Almacenado a un proceso de anulacion \n //las transacciones del Ingreso de Caja. esto debido a mejorar el proceso y no \n //realizar un doble barrido en la tabla de transacciones de \n //la nota dede\n ejbNotaDebito.anularTransaccion(boletoAnular);\n\n //anulamos las transacciones del Ingreso de Caja\n //ejbIngresoCaja.anularTransaccion(boleto) ;\n // si esta en Pendiente solo debe cambiar el estado\n } else if (boletoAnular.getEstado().equals(Boleto.Estado.PENDIENTE)\n || boletoAnular.getEstado().equals(Boleto.Estado.CANCELADO)) {\n boletoAnular.setEstado(Boleto.Estado.ANULADO);\n em.merge(boletoAnular);\n //Si el Boleto es Void, se puede volver a ingresar el boleto.\n }\n return boletoAnular;\n\n }", "@Override\n\tpublic Optional<Cliente> findById(int id) throws Exception {\n\t\treturn clienteRepository.findById(id);\n\t}", "private boolean existeUsuario(String chatId)\n\t{\n\t\treturn usuarioService.findById(chatId).isPresent();\n\t}", "@Test\n public void testConsultarTodos() throws Exception {\n System.out.println(\"testConsultarTodos\");\n List<ConfiguracaoTransferencia> result = instance.findAll();\n assertTrue(result != null && result.size() > 0);\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof CursoEstudiantes)) {\r\n return false;\r\n }\r\n CursoEstudiantes other = (CursoEstudiantes) object;\r\n if ((this.cursoEstudiantesPK == null && other.cursoEstudiantesPK != null) || (this.cursoEstudiantesPK != null && !this.cursoEstudiantesPK.equals(other.cursoEstudiantesPK))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Cliente)) {\n return false;\n }\n Cliente other = (Cliente) object;\n if ((this.clienteId == null && other.clienteId != null) || (this.clienteId != null && !this.clienteId.equals(other.clienteId))) {\n return false;\n }\n return true;\n }", "@Test\n\tpublic void testConsultarUno() {\n\t\tDispositivo dispositivo = new Dispositivo();\n\t\tString referencia = \"A0021R\";\n\t\ttry {\n\t\t\tdispositivo = dispositivoBL.consultarUno(referencia);\n\t\t\tassertTrue(dispositivo != null);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test\n\tpublic void validarPeticionRecuperarRegistroByIdVehiculo() {\n\t\t// Arrange\n\t\tString idVehiculo = \"2\";\n\t\tRegistro registro = new RegistroTestDataBuilder().withIdVehiculo(\"2\").build();\n\t\tList<Registro> registros = new ArrayList<>();\n\t\tregistros.add(registro);\n\t\tMockito.when(registroRepository.findByidVehiculo(registro.getIdVehiculo())).thenReturn(registros);\n\t\t// Act\n\t\tList<Registro> registroRecuperado = registroService.getRegistrosByIdVehiculo(idVehiculo);\n\t\t// Assert\n\t\tAssert.assertEquals(\"Valor recuperado es igual\", registroRecuperado.get(0).getIdVehiculo(), idVehiculo);\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Serviço)) {\n return false;\n }\n Serviço other = (Serviço) object;\n if ((this.idServiço == null && other.idServiço != null) || (this.idServiço != null && !this.idServiço.equals(other.idServiço))) {\n return false;\n }\n return true;\n }", "boolean exists(Curso curso) throws BusinessException;", "protected void filtrarEstCid() {\r\n\t\tif (cmbx_cidade.getSelectedItem() != \"\" && cmbx_estado.getSelectedItem() != \"\") {\r\n\t\t\tStringBuilder filtracomando = new StringBuilder();\r\n\r\n\t\t\tfiltracomando\r\n\t\t\t\t\t.append(comando + \" WHERE ESTADO = '\" + Estado.validar(cmbx_estado.getSelectedItem().toString())\r\n\t\t\t\t\t\t\t+ \"' AND CIDADE = '\" + cmbx_cidade.getSelectedItem().toString() + \"'\");\r\n\t\t\tlistacliente = tabelaCliente.mostraRelatorio(filtracomando.toString());\r\n\r\n\t\t\ttablecliente.setModel(tabelaCliente);\r\n\r\n\t\t} else {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Escolha a Cidade e o Estado que deseja Filtrar\");\r\n\t\t}\r\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof CpserxconPK)) {\n return false;\n }\n CpserxconPK other = (CpserxconPK) object;\n if (this.cscnclinic != other.cscnclinic) {\n return false;\n }\n if (this.cscnnumero != other.cscnnumero) {\n return false;\n }\n if ((this.csccservic == null && other.csccservic != null) || (this.csccservic != null && !this.csccservic.equals(other.csccservic))) {\n return false;\n }\n if (this.cscnposisuper != other.cscnposisuper) {\n return false;\n }\n if ((this.csccutiliza == null && other.csccutiliza != null) || (this.csccutiliza != null && !this.csccutiliza.equals(other.csccutiliza))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Seguimiento)) {\r\n return false;\r\n }\r\n Seguimiento other = (Seguimiento) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof ObservacionesPK)) {\n return false;\n }\n ObservacionesPK other = (ObservacionesPK) object;\n if (this.codCia != other.codCia) {\n return false;\n }\n if (this.id != other.id) {\n return false;\n }\n return true;\n }", "@Test\r\n public void testGetExist() throws PAException {\r\n Ii studyDiseaseIi = IiConverter.convertToStudyDiseaseIi(TestSchema.studyDiseaseIds.get(0));\r\n StudyDiseaseDTO studyDiseaseDTO = bean.get(studyDiseaseIi);\r\n assertNotNull(\"studyDiseaseDTO not found\", studyDiseaseDTO);\r\n assertEquals(\"Wrong studyDiseaseDTO returned\", studyDiseaseIi, studyDiseaseDTO.getIdentifier());\r\n }", "@Test\n public void testSelectAllByEducationIdAndEducationPromo() {\n List<Discipline> listDisciplines = new ArrayList();\n listDisciplines = disciplineDao.selectAllByEducationIdAndEducationPromo(educationBdd);\n boolean result = listDisciplines.size() > 0;\n assertTrue(result);\n }", "public void testexisteDescripcion()\n\t{\n\t\tString descripcion = new String(\"admin\");\n\t\tLong id = new Long(\"-1\");\n\t\t\n\t\tBoolean bol = servicio.existeDescripcion(descripcion, id);\n\t\t\tassertEquals(bol.booleanValue(), true);\n\t}", "@Test(expected = NoSuchElementException.class)\r\n\tpublic void testFindByIdAndDeleted_NotDeleted() {\r\n\t\tOptional<Sector> found = sectorRepository.findByIdAndDeleted(DB_STAND_SECTOR_ID, true);\r\n\t\tassertNull(found.get());\r\n\t}", "@Test(expected = NoSuchElementException.class)\r\n\tpublic void testFindByIdAndDeleted_NonExistent() {\r\n\t\tOptional<Sector> found = sectorRepository.findByIdAndDeleted(SECTOR_ID_NON_EXISTENT, false);\r\n\t\tassertNull(found.get());\r\n\t}", "@Test\n public void findOneTest() throws Exception {\n Client client = clientRepository.findOne(1);\n log.info(client.toString());\n Assert.assertNotNull(client);\n Assert.assertTrue(1 == client.getId());\n }", "@Override\n public boolean validarConfiguracion(ContabilidadBoletaje conf) throws CRUDException {\n Optional op = Optional.ofNullable(conf.getIdTotalBoletoBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe configuracion para la el Total Boleto Bs\");\n }\n\n op = Optional.ofNullable(conf.getIdTotalBoletoUs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe configuracion para la el Total Boleto Usd\");\n }\n\n op = Optional.ofNullable(conf.getIdCuentaFee());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe configuracion para la el Total Cuenta Fee\");\n }\n\n op = Optional.ofNullable(conf.getIdDescuentos());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe configuracion para la el Total Descuentos\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspDebeBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Efectivo No BSP Debe Bs\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspDebeUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Efectivo No BSP Debe Usd\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspHaberBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Efectivo No BSP Haber Bs\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspHaberUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Efectivo No BSP Haber Usd\");\n }\n op = Optional.ofNullable(conf.getTarjetaCreditoBspDebeBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Tarjeta Credito Bsp Debe BS\");\n }\n op = Optional.ofNullable(conf.getTarjetaCreditoBspDebeUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Tarjeta Credito Bsp Debe USD\");\n }\n op = Optional.ofNullable(conf.getTarjetaCreditoBspHaberBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Tarjeta Credito Bsp Haber BS\");\n }\n op = Optional.ofNullable(conf.getTarjetaCreditoBspHaberUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Tarjeta Credito Bsp Debe USD\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspDebeBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Cuenta Efectivo No BSP Debe Bs\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspDebeUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Cuenta Efectivo No BSP Debe USD\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspHaberBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Cuenta Efectivo No BSP Haber Bs\");\n }\n op = Optional.ofNullable(conf.getCuentaEfectivoNoBspHaberUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Cuenta Efectivo No BSP Haber USD\");\n }\n\n op = Optional.ofNullable(conf.getOtrosCargosClienteCobrarDebeBs());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Otros Cargos Clientes x Cobrar Debe Bs.\");\n }\n op = Optional.ofNullable(conf.getOtrosCargosClienteCobrarDebeUsd());\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe Cuenta Configurada para Otros Cargos Clientes x Cobrar Debe Usd.\");\n }\n\n return true;\n }", "@Test\r\n public void testGetUsuarios() throws Exception \r\n {\r\n List<UsuarioEntity> list;\r\n list = usuarioLogic.getUsuarios();\r\n Assert.assertEquals(dataUs.size(), list.size()); \r\n for(UsuarioEntity entity : list)\r\n {\r\n boolean found = false;\r\n for(UsuarioEntity storedEntity : dataUs)\r\n {\r\n if(entity.getId().equals(storedEntity.getId()))\r\n {\r\n found=true;\r\n }\r\n }\r\n Assert.assertTrue(found);\r\n }\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof CatalogoVehiculos)) {\r\n return false;\r\n }\r\n CatalogoVehiculos other = (CatalogoVehiculos) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\n @Transactional\n public void getAllListWrkStatusesByIdWrkKindIsEqualToSomething() throws Exception {\n ListWrkKind idWrkKind = listWrkStatus.getIdWrkKind();\n listWrkStatusRepository.saveAndFlush(listWrkStatus);\n Long idWrkKindId = idWrkKind.getId();\n\n // Get all the listWrkStatusList where idWrkKind equals to idWrkKindId\n defaultListWrkStatusShouldBeFound(\"idWrkKindId.equals=\" + idWrkKindId);\n\n // Get all the listWrkStatusList where idWrkKind equals to idWrkKindId + 1\n defaultListWrkStatusShouldNotBeFound(\"idWrkKindId.equals=\" + (idWrkKindId + 1));\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof AdmsServicoEfetuado)) {\n return false;\n }\n AdmsServicoEfetuado other = (AdmsServicoEfetuado) object;\n if ((this.pkIdServicoEfetuado == null && other.pkIdServicoEfetuado != null) || (this.pkIdServicoEfetuado != null && !this.pkIdServicoEfetuado.equals(other.pkIdServicoEfetuado))) {\n return false;\n }\n return true;\n }", "public Integer consultarIdInstitucaoCentralporSingular(Integer idInstituicao) throws BancoobException{\n\t\tSciIntFiltroHierarquiaCooperativa filtro = new SciIntFiltroHierarquiaCooperativa();\n\t\tfiltro.setIdInstituicao(idInstituicao);\n\t\t\n\t\tSciIntHierarquiaCooperativaDelegate delegate = SciIntFabricaDelegate.getInstance().criarSciIntHierarquiaCooperativaDelegate();\n\t\ttry {\n\t\t\treturn delegate.pesquisarHierarquiaCooperativaNivelMenor(filtro).getIdInstituicaoResp();\n\t\t} catch (SciIntegracaoException e) {\n\t\t\tthis.getLogger().erro(e, e.getMessage());\n\t\t\tthrow new IntegracaoInstituicaoCooperativaException(e);\n\t\t}\n\t}", "public static boolean testDaoLirePraticien() {\n boolean ok = true; \n ArrayList<Praticien> lesPraticiens = new ArrayList<Praticien>();\n try {\n lesPraticiens = daoPraticien.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des praticiens\");\n for (Praticien unPraticien: lesPraticiens){\n System.out.println(unPraticien);\n }\n return ok;\n \n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Servicio)) {\n return false;\n }\n Servicio other = (Servicio) object;\n if ((this.idservicio == null && other.idservicio != null) || (this.idservicio != null && !this.idservicio.equals(other.idservicio))) {\n return false;\n }\n return true;\n }", "public void buscarDocentes() {\r\n try {\r\n List<DocenteProyecto> docenteProyectos = docenteProyectoService.buscar(new DocenteProyecto(\r\n sessionProyecto.getProyectoSeleccionado(), null, null, Boolean.TRUE, null));\r\n if (docenteProyectos.isEmpty()) {\r\n return;\r\n }\r\n for (DocenteProyecto docenteProyecto : docenteProyectos) {\r\n DocenteProyectoDTO docenteProyectoDTO = new DocenteProyectoDTO(docenteProyecto, null,\r\n docenteCarreraService.buscarPorId(new DocenteCarrera(docenteProyecto.getDocenteCarreraId())));\r\n docenteProyectoDTO.setPersona(personaService.buscarPorId(new Persona(docenteProyectoDTO.getDocenteCarrera().getDocenteId().getId())));\r\n sessionProyecto.getDocentesProyectoDTO().add(docenteProyectoDTO);\r\n }\r\n sessionProyecto.setFilterDocentesProyectoDTO(sessionProyecto.getDocentesProyectoDTO());\r\n } catch (Exception e) {\r\n }\r\n }" ]
[ "0.5967618", "0.5912499", "0.57905096", "0.5723887", "0.5681413", "0.56775653", "0.5672302", "0.5640779", "0.56279725", "0.5617356", "0.5616211", "0.5579485", "0.55792266", "0.55790293", "0.5570609", "0.55632114", "0.5560025", "0.55577433", "0.5550008", "0.55408794", "0.55269104", "0.5518519", "0.551735", "0.5513026", "0.55125624", "0.5512471", "0.5502639", "0.5497167", "0.5492671", "0.546071", "0.5460699", "0.5456672", "0.5453913", "0.5451307", "0.5446635", "0.54396427", "0.5429186", "0.5428314", "0.5423668", "0.54081446", "0.5407803", "0.54004365", "0.53968775", "0.53786016", "0.53758526", "0.53753954", "0.5355278", "0.5348335", "0.53412205", "0.5339753", "0.53312624", "0.5326181", "0.53249085", "0.53203154", "0.5314258", "0.52941257", "0.5283274", "0.52786875", "0.52710617", "0.5256434", "0.5255288", "0.52541", "0.52535206", "0.52502704", "0.5249816", "0.5248433", "0.52472806", "0.5237718", "0.52369636", "0.5231004", "0.52276474", "0.5223016", "0.5218961", "0.52154976", "0.5213506", "0.5206252", "0.520387", "0.52025783", "0.52019644", "0.519864", "0.51966614", "0.5195113", "0.5194634", "0.51937103", "0.51912737", "0.51877475", "0.51859754", "0.51853293", "0.51807886", "0.5177324", "0.51747024", "0.5172694", "0.5170458", "0.5170315", "0.5167729", "0.5166839", "0.51642704", "0.5164039", "0.51581573", "0.5157878" ]
0.64137316
0
reset the start components
public void checkAndSetStart() { System.out.println(" checkAndSetStart "+this.id +" size:"+this.components.size()); if(hasNoStart()) { List<ComponentConfig> longestVisitedComps = new ArrayList<ComponentConfig>(); ComponentConfig longestVisitedComp = null; int longestVisited = 0; for(ComponentConfig comp: components) { int visited = traverseModel(0,comp); System.out.println(" traverse"+comp.getId()+" v:"+visited); if(visited > longestVisited) { longestVisited = visited; longestVisitedComps.clear(); longestVisitedComps.add(comp); } else if(visited == longestVisited) { longestVisitedComps.add(comp); } // catch deadloop, if all component are visisted if(longestVisited == components.size()) break; } for(ComponentConfig st: longestVisitedComps) { st.setIsstartcaller(true); } } // find other component that call to the same component that start component calls within model List<ComponentConfig> startComps = new ArrayList<ComponentConfig>(); for(ComponentConfig st: components) { if(st.isIsstartcaller()) startComps.add(st); } List<Integer> calls = new ArrayList<Integer>(); for(ComponentConfig st: startComps) { if(st.isIsstartcaller() && st.getCalls()!=null) { for(int i: st.getCalls()) for(ComponentConfig eachComp: components) { System.out.println(" find comp that call "+i+" "+eachComp.getCalls()); if(eachComp.getCalls()!=null) for(int callee: eachComp.getCalls()) { // found component that call to the same target if(callee == i) eachComp.setIsstartcaller(true); break; } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void reset()\n {\n m_source_.setToStart();\n updateInternalState();\n }", "public void reset() {\n //mLoader.reset();\n start();\n }", "public void resetClick() {\n timeline.stop();\n startButton.setText(\"Start\");\n isRunning = false;\n isMovable = false;\n gOL.resetGenCounter();\n generationLabel.setText(Integer.toString(gOL.getGenCounter()));\n board.resetBoard();\n if (board instanceof DynamicBoard) {\n ((DynamicBoard)board).setGridSize(50);\n canvasDrawer.resetCellSize();\n }\n aliveLabel.setText(Integer.toString(board.getCellsAlive()));\n fileHandler.resetMetaData();\n canvasDrawer.resetOffset(board, canvasArea);\n draw();\n }", "public void reset() {\n\t\tinit(0, 0, 1, false);\n\t}", "public void reset() {\n\t\tpos.tijd = 0;\r\n\t\tpos.xposbal = xposstruct;\r\n\t\tpos.yposbal = yposstruct;\r\n\t\tpos.hoek = Math.PI/2;\r\n\t\tpos.start = 0;\r\n\t\topgespannen = 0;\r\n\t\tpos.snelh = 0.2;\r\n\t\tbooghoek = 0;\r\n\t\tpos.geraakt = 0;\r\n\t\tgeraakt = 0;\r\n\t\t\r\n\t}", "private void reset() {\n darkSquare.reset();\n lightSquare.reset();\n background.reset();\n border.reset();\n showCoordinates.setSelected(resetCoordinates);\n pieceFont.reset();\n }", "@Override\r\n\tpublic void reset() {\r\n\t\tpilots.clear();\r\n\t\tcabinCrew.clear();\r\n\r\n\t}", "void resetComponents() {\n Utilitarios.fechaActual(jdcFechaInicio);\n Utilitarios.fechaActual(jdcFechaFin);\n if (oMedicoAtiendeReal != null) {\n oMedicoAtiendeReal = null;\n }\n if (oComprobanteDetalle != null) {\n oComprobanteDetalle = null;\n }\n oModeloRegistrarPagoMedicos.clear();\n personalizaVistaTabla();\n txfMedicoDeriva.setText(\"\");\n txfMedicoAtiende.setText(\"\");\n if(oMedico != null){\n oMedico = null;\n }\n txfMedico.setText(\"\");\n }", "public void reset() {\n\t\t\t\t\r\n\t\t\t}", "private void reset() {\n }", "protected void reset(){\n inited = false;\n }", "public void reset() {\n next = 0;\n renderList.clear();\n viewList.clear();\n }", "public void reset(){\n active = false;\n done = false;\n state = State.invisible;\n curX = 0;\n }", "public void resetX() {this.startX = 0f;}", "protected void reset() {\n\t\t}", "public void reset() {\n\t\tmCycleFlip = false;\n\t\tmRepeated = 0;\n\t\tmMore = true;\n //mOneMoreTime = true;\n \n\t\t// 추가\n\t\tmStarted = mEnded = false;\n\t\tmCanceled = false;\n }", "public void reset()\n\t{\n\t\tthis.sourceUnit.setSelectedIndex(0);\n\t\tthis.destUnit.setSelectedIndex(0);\n\t\tthis.input.setText(\"\");\n\t\tthis.outputLabel.setText(\"\");\n\t}", "private void reset() {\n ms = s = m = h = 0;\n actualizar();\n }", "protected void reset() {\n\t\tpush();\n\n\t\t// Clearen, en niet opnieuw aanmaken, om referenties elders\n\t\t// in het programma niet corrupt te maken !\n\t\tcurves.clear();\n\t\tselectedCurves.clear();\n\t\thooveredCurves.clear();\n\t\tselectedPoints.clear();\n\t\thooveredPoints.clear();\n\t\tselectionTool.clear();\n\t}", "public void reset(){\r\n\t\tSystem.out.println(\"(EnigmaMachine) Initial Positions: \" + Arrays.toString(initPositions));\r\n\t\trotors.setPositions(initPositions);\r\n\t}", "public void reset() {\n super.reset();\n }", "public void reset() {\n\n\t}", "public void reset()\n\t{ removeAll();\n\t\t int center_y=(getHeight()/2);\n int center_x=(getWidth()/2);\n\t\tScaffoldEnd=new GPoint((center_x-BEAM_LENGTH),ARM_OFFSET_FROM_HEAD+(2*HEAD_RADIUS)+ROPE_LENGTH);\n\t\tGLine scaffold=new GLine((center_x-BEAM_LENGTH),ScaffoldEnd.getY()+SCAFFOLD_HEIGHT,ScaffoldEnd.getX(),ScaffoldEnd.getY());\n\t\tadd(scaffold);\n\t\tBeamEnd=new GPoint((center_x),ScaffoldEnd.getY());\n\t\tGLine beam=new GLine(ScaffoldEnd.getX(),ScaffoldEnd.getY(),BeamEnd.getX(),BeamEnd.getY());\n\t\tadd(beam);\n\t\tRopeEnd=new GPoint((center_x),(BeamEnd.getY()+ROPE_LENGTH));\n\t\tGLine rope=new GLine(BeamEnd.getX(),BeamEnd.getY(),RopeEnd.getX(),RopeEnd.getY());\n\t\tadd(rope);\n\t\tguessedLabel=new GLabel(\"-----\",20,20);\n\t\twrongLabel=new GLabel(\"-----\",20,40);\n\t\ti=1;\n\t\twrong=\"\";\n\t}", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}", "void reset () {\n\t if ( solid != null )\n\t SwingUtilities.invokeLater( new Runnable() {\n\t @Override\n\t public void run () {\n\t if ( solid != null ) {\n\t app.stop();\n\t app.setNostopOperaPanelBean( solid.connBean, solid.nonStopBean, solid.ea );\n\t app.start();\n\t }\n\t }\n\t } );\n\t}", "public void reset() {\n firstUpdate = true;\n }", "public void reset () {}", "public void reset() {\n\t\trabbitcount[1]=8;\n\t\trabbitcount[2]=8;\n\t\tpieces.clear();\n\t\tselectedsquares.clear();\n\t\trepaint();\n\t}", "public void reset()\n\t{\n\t}", "public void reset()\n\t{\n\t}", "public synchronized void reset() {\n }", "public void reset() {\n\t\tx = 0;\n\t\ty = 0;\n\t\tdir = -90;\n\t\tcoul = 0;\n\t\tcrayon = true;\n\t\tlistSegments.clear();\n \t}", "@Override public void start() {\n timer_.reset();\n\n resetControlVariables(); // need reset all key counters bcz they are used in init_loop()\n }", "private void reset(){\n locationFieldX.setText(\"0.00\");\n locationFieldY.setText(\"0.00\");\n locationFieldZ.setText(\"0.00\");\n rotationFieldX.setText(\"0.00\");\n rotationFieldY.setText(\"0.00\");\n rotationFieldZ.setText(\"0.00\");\n scaleField.setText(\"1.00\");\n \n setObjects();\n setImage();\n }", "public void reset() {\n\r\n\t}", "public void reset(){\n }", "void reset(Component paramComponent1, Component paramComponent2, int paramInt1, int paramInt2) {\n/* 152 */ if (getComponent() == null) {\n/* 153 */ this.component = createComponent(paramComponent1);\n/* */ }\n/* */ \n/* 156 */ Component component = getComponent();\n/* */ \n/* 158 */ if (component instanceof JWindow) {\n/* 159 */ JWindow jWindow = (JWindow)getComponent();\n/* */ \n/* 161 */ jWindow.setLocation(paramInt1, paramInt2);\n/* 162 */ jWindow.getContentPane().add(paramComponent2, \"Center\");\n/* 163 */ jWindow.invalidate();\n/* 164 */ jWindow.validate();\n/* 165 */ if (jWindow.isVisible())\n/* */ {\n/* */ \n/* 168 */ pack();\n/* */ }\n/* */ } \n/* */ }", "public void reset() {\n started = false;\n flushing = false;\n moreText = true;\n headerCount = 0;\n actualLen = 0;\n }", "public void reset ()\n\t{\n\t\t//The PaperAirplane and the walls (both types) use their reconstruct ()\n\t\t//method to set themselves back to their starting points.\n\t\tp.reconstruct ();\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i].reconstruct ();\n\t\t\n\t\tfor (int i = 0; i < sW.length; i++)\n\t\t\tsW[i].reconstruct ();\n\t\t\t\n\t\t//the time is reset using the resetTime () method from the Timer class.\n\t\ttime.resetTime ();\n\t\t\n\t\t//the score is reset using the reconstruct method from the Score class.\n\t\tscore.reconstruct ();\n\t\t\n\t\t//The following variables are set back to their original values set in\n\t\t//the driver class.\n\t\ttimePassed = 0;\t\n\t\tnumClicks = 0;\n\t\teventFrame = 0;\n\t\tlevel = 1;\n\t\txClouds1 = 0;\n\t\txClouds2 = -500;\n\t\tyBkg1 = 0;\n\t\tyBkg2 = 600;\t\t\n\t}", "private void reset()\r\n\t{\r\n\t\t\r\n\t\toriginDock = null;\r\n\t\tdraggedDockable = null;\r\n\r\n\t}", "public void reset(){\n this.context.msr.setReadyForInput(false);\n emptyAllInputBuffers();\n emptyAllOutputBuffers();\n emptyEngineersConsoleBuffer();\n }", "public void reset(){\r\n\t\tdialogToDisplay=0;\r\n\t\tqueuedDialog=0;\r\n\t\toptionSelection=null;\r\n\t\tdone=false;\r\n\t}", "public void reset() {\n actionFlag = true;\n messageFlag = false;\n self.getInputBuffer().clear();\n self.getOutputBuffer().clear();\n self.setCurrentProduct(null);\n self.resetCounters();\n self.getServiceManager().init(getRandom(), template);\n syncUpdate();\n }", "public void reset() {\n\n }", "public void reset() {\n setPrimaryDirection(-1);\n setSecondaryDirection(-1);\n flags.reset();\n setResetMovementQueue(false);\n setNeedsPlacement(false);\n }", "public void reset() {\n this.setIndex(0);\n }", "public void reset()\n\t{\n\t\tassociations = new Vector<Association>();\n\t\tif(hotspots != null)\n\t\t{\n\t\t\tfor(int i=0; i < hotspots.size(); i++)\n\t\t\t{\n\t\t\t\thotspots.elementAt(i).bound = null;\n\t\t\t\thotspots.elementAt(i).setHighlighted(false);\n\t\t\t}\n\t\t}\n\n\t\tif(movableObjects != null)\n\t\t{\n\t\t\tfor(int i=0; i < movableObjects.size(); i++)\n\t\t\t{\n\t\t\t\tmovableObjects.elementAt(i).resetPos();\n\t\t\t\tmovableObjects.elementAt(i).bound = null;\n\t\t\t}\n\t\t}\n\t\tuser_responses=0;\n\t\tmov = null;\n\t\tstart = null;\n\t\tmpos = null;\n\t\tsetFeedback();\n\t\trepaint();\n\t}", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset() {\n\t\t// set any default values\n\t\t// setDefaultController() ???\n\t}", "public void reset() {\n\t\tthis.startTime = 0;\n\t\tthis.stopTime = 0;\n\t\tthis.running = false;\n\t}", "public void reset(){\n currentStage = 0;\n currentSide = sideA;\n }", "public void reset() {\r\n this.x = resetX;\r\n this.y = resetY;\r\n state = 0;\r\n }", "public void reset() {\n \titems.clear();\n \tsetProcessCount(0);\n }", "public void reset(){\n newGame();\n removeAll();\n repaint();\n ended = false;\n }", "public void reset() // reset method start\n\t\t{\n\t\t\tcreditBox1.setSelectedIndex(0);\n\t\t\tcreditBox1.setEnabled(false);\n\t\t\tcreditBox2.setSelectedIndex(0);\n\t\t\tamountField1.setText(\"0.00\");\n\t\t\tamountField2.setText(\"0.00\");\n\t\t\tcheckBox.setSelected(false);\n\t\t}", "public void reset(){\n star.clear();\n planet.clear();\n }", "public void reset() {\n cycles = 0;\n nextHaltCycle = GB_CYCLES_PER_FRAME;\n nextUpdateCycle = 0;\n running = false;\n timer.reset();\n \n cpu.reset();\n ram.reset();\n soundHandler.reset();\n }", "public void reset() {\n\t\tsetVisible(false);\n\t\tfor (GameObject gameObject : objects) {\n\t\t\tgameObject.reset();\n\t\t}\n\t}", "@Override\n public void start() {\n runtime.reset();\n }", "@Override\n public void start() {\n runtime.reset();\n }", "@Override\n public void start() {\n runtime.reset();\n }", "@Override\n public void start() {\n runtime.reset();\n }", "@Override\n public void start() {\n runtime.reset();\n }", "public void reset() {\n\t\tremoveAll();\n\t\twrongLetters = \"\";\n\t\taddScaffold(getWidth(),getHeight());\n\t}", "private void reset(){\n plotValues.clear();\n xLabels.clear();\n }", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();", "void reset();" ]
[ "0.7174821", "0.7147488", "0.7147273", "0.7136476", "0.70892423", "0.7073714", "0.7058236", "0.70578647", "0.7038836", "0.70217323", "0.7011002", "0.6993751", "0.69895935", "0.6964412", "0.69639784", "0.6893282", "0.68902093", "0.6886458", "0.68593323", "0.6849909", "0.6849771", "0.68485755", "0.6842491", "0.6833655", "0.6833655", "0.6833655", "0.6833655", "0.6830222", "0.6830222", "0.6830222", "0.6830222", "0.6829928", "0.68294966", "0.6825488", "0.68251", "0.68156147", "0.68156147", "0.6814173", "0.6810709", "0.6801929", "0.67873585", "0.67850053", "0.6784985", "0.6784714", "0.6722967", "0.67201614", "0.6715212", "0.6712206", "0.67023283", "0.6699916", "0.6694416", "0.66909987", "0.66881484", "0.66823226", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6671719", "0.6669351", "0.6666632", "0.6661801", "0.6650392", "0.6633714", "0.6632386", "0.66272014", "0.66226846", "0.66215396", "0.6605384", "0.6598709", "0.6598709", "0.6598709", "0.6598709", "0.6598709", "0.65973276", "0.6587057", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696", "0.6584696" ]
0.0
-1
remove call to other component that does not existed in this submodel
public void clean() { for(ComponentConfig comp: components ) { List<Integer> cleanCalls = new ArrayList<Integer>(); if(comp.getCalls()!=null) { for(int call:comp.getCalls()) { if(hasComp(call)) { cleanCalls.add(call); } } int[] result = new int[cleanCalls.size()]; int i=0; for(Integer call: cleanCalls) { result[i] = call; i++; } comp.setCalls(result); } } // remove duplicate List<ComponentConfig> newComponentList = new ArrayList<ComponentConfig>(); this.compids.clear(); for(ComponentConfig c:components) { if(!compids.contains(c.getId())) { newComponentList.add(c); compids.add(c.getId()); } } this.components = newComponentList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\npublic void remove(VirtualComponent component) {\n\t\n}", "@Override\npublic void remove(VirtualComponent comp, ObjectAdapter childAdapter) {\n\t\n}", "@Override\npublic void remove(VirtualContainer parent, VirtualComponent component) {\n\t\n}", "public void removeComponent(DrawingComponent component) \n\t{\n\n\t\tif (component instanceof DrawingCompositeWord)Log.d(\"DrawingIndividual\", \"removeComponent IF \" + ((DrawingCompositeWord)component).getResult());\n\t\tif (component instanceof FormalizedPropertyRelationButton)Log.d(\"DrawingIndividual\", \"removeComponent IF \" + ((FormalizedPropertyRelationButton)component).getItemText());\n\t\telse Log.d(\"DrawingIndividual\", \"removeComponent ELSE \" + component);\n\t\t\n\t\tchanged = true;\n\t\n\t\tif (children.contains(component)) \n\t\t{\n\t\t\tif (component.isComposite) \n\t\t\t{\n\t\t\t\tcomponent.setDisplayState(DisplayObjectState.NONE);\n\t\t\t\t\n\t\t\t\tchildren.remove(component);\n\t\t\t\t\n\t\t\t\tcomponentChild = null;\n\t\n\t\t\t\tfor (DrawingComponent child : ((DrawingComposite) component).children) \n\t\t\t\t{\n\t\t\t\t\tif (!children.contains(child))\n\t\t\t\t\t{\n\t\t\t\t\t\tchildren.add(child);\n\t\t\t\t\t\tchild.setDisplayState(DisplayObjectState.NONE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tupdateDrawingComponent();\n\t\n\t\t\t\treturn;\n\t\n\t\t\t} else \n\t\t\t{\n\t\t\t\tchildren.remove(component);\n\t\t\t\tcomponentChild = null;\n\t\t\t\tcomponent.setDisplayState(DisplayObjectState.NONE);\n\t\t\t\tupdateDrawingComponent();\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tif (component != null)\n\t\t\tfor (DrawingComponent child : children) \n\t\t\t{\n\t\t\t\tif (child.isComposite)\n\t\t\t\t{\n\t\t\t\t\tcomponent.setDisplayState(DisplayObjectState.NONE);\n\t\t\t\t\tchild.removeComponent(component);\n\t\t\t\t\tcomponentChild = null;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tupdateDrawingComponent();\n\t}", "public void remove(Component c){}", "@Override\r\n\tpublic void removeLayoutComponent(Component arg0) {\n\t\t\r\n\t}", "public void removeAllInterpretedBy() {\r\n\t\tBase.removeAll(this.model, this.getResource(), INTERPRETEDBY);\r\n\t}", "@Override\n public void remove(SpectatorComponent spectatorComponent) {\n }", "public void supprimerImproductifs(){\n grammaireCleaner.nettoyNonProdGramm();\n setChanged();\n notifyObservers(\"2\");\n }", "public void removeCompositeComponent(DrawingComponent component)\n\t{\n\t\t\n\t}", "public void remove() {\r\n super.remove();\r\n }", "public abstract void onRemove();", "public void removeComponent(Component c);", "@Override\n\tpublic void onRemove() {\n\n\t}", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}", "@Override\n public void remove() {\n }", "public abstract void removedFromWidgetTree();", "@Override\n\t\t\t\tpublic void remove() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\npublic void remove(VirtualContainer parent, VirtualComponent comp,\n\t\tObjectAdapter childAdapter) {\n\t\n}", "@Override\r\n\tpublic void onRemove() {\n\r\n\t}", "@Override\r\n\t\tpublic void remove() {\r\n\t\t\t// YOU DO NOT NEED TO WRITE THIS\r\n\t\t}", "@Override\r\n\tpublic void remove() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void remove() {\n\t\t\r\n\t}", "@Override\n public void remove() {\n }", "public void removeAllConductor() {\r\n\t\tBase.removeAll(this.model, this.getResource(), CONDUCTOR);\r\n\t}", "public void removeComponent(DrawingComponent component) {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void removeLayoutComponent(Component component) { }", "@Override\n\tpublic void remove() { }", "public abstract boolean remove(KitComponent component);", "@Override\npublic void removeFromParentUIContainer() {\n\t\n}", "public abstract void onRemoveAction();", "public void remElementName(){\n ((MenuDMO) core).remElementName();\n }", "protected void removeSelf() {\n if (!removed && parentNode != null && componentNode != null) {\n // remove this node from parent node\n parentNode.removeChild(componentNode);\n // Mark as removed\n removed = true;\n }\n }", "public void removeLayoutComponent(Component comp) \n {\n\t\n }", "public abstract void unbindComponents();", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "@Override\n\tpublic void remove() {\n\t\t\n\t}", "public void removeAllComponents();", "protected void RemoveEvents()\r\n {\r\n INotifyPropertyChanged propParent = (INotifyPropertyChanged)getProxyParent();\r\n propParent.getPropertyChanged().removeObservers(filterPropertyChanges);\r\n }", "@PreRemove\r\n public void preRemove() {\r\n\r\n }", "@Override\n\tpublic void remove(Component comp) {\n\t\t_childComponents.remove(comp);\n\t}", "public void removeFromLinesOfBusiness(entity.AppCritLineOfBusiness element);", "public void removeLayoutComponent(Component comp) {}", "public void removeLayoutComponent(Component comp) {}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tmanager.getAbnormal().remove();\n\t\t\t\tXianlu();\n\t\t\t}", "@Override\n\tpublic synchronized void removeLayoutComponent(Component comp) {\n\t\tint index = constrains.indexOf(comp);\n\t\tif (index == -1)\n\t\t\treturn;\n\t\tcomponents.remove(index);\n\t\tconstrains.remove(index);\n\t}", "public @Override void removeUpdate(DocumentEvent evt, Shape a, ViewFactory f) {\n if (children == null && getParent() == null) {\n return;\n }\n\n if (useCustomReloadChildren()) {\n customRemoveUpdate(evt, a, f);\n } else {\n super.removeUpdate(evt, a, f); // default element-based update\n }\n }", "@Override\n\tpublic void removeChild(IComponent c) {\n\t\tcomponents.remove(c);\n\t\t\n\t}", "@Override\n public boolean remove(Object o) //Modify to take in Authenication ID for future logging function\n {\n if(super.remove(o)){\n if(comboBoxModelSelectedItem.equals(o))\n comboBoxModelSelectedItem = ((this.size()>0)? this.first() : null);\n modelListenersNotify();\n ViewerController.saveModel();\n return true;\n }\n return false;\n }", "public void remove() {\r\n //\r\n }", "@Override\r\n public void removeNotify() {\r\n // remove listener\r\n component.getResults().removeLabTestListener(this);\r\n \r\n super.removeNotify();\r\n }", "@Override\r\n\t\tpublic void remove() {\n\r\n\t\t}", "void clearIsChanged();", "private void remove() {\n disableButtons();\n clientgui.getClient().sendDeleteEntity(cen);\n cen = Entity.NONE;\n }", "public void supprimerInaccessibles(){\n grammaireCleaner.nettoyNonAccGramm();\n setChanged();\n notifyObservers(\"3\");\n }", "public interface RemoveNeeded {\n\t/** \n\t * This method is called once the drawable is not needed.\n\t * It should remove all auxiliary objects of this drawable. \n\t */\n\tpublic void remove();\n}", "void unsetFurtherRelations();", "void removeModelEventListener(PropertyChangeListener listener, Object modelelement);", "@Override\n\tpublic void excluir() {\n\t\t\n\t}", "void removeAll() throws ModelRuntimeException;", "@Override\n public void remove(Component c) {\n children.remove(c);\n }", "void removeModelEventListener(UmlChangeListener listener, Object modelelement, String propertyName);", "public void removeAllComposer() {\r\n\t\tBase.removeAll(this.model, this.getResource(), COMPOSER);\r\n\t}", "public void remove() {\n\n }", "@Override\r\n\t\t\tpublic void OnUnCheck(Object o) {\n\t\t\t\tchecAll(getProcTbl().getModel().getData(), false);\r\n\t\t\t\tgetProcTbl().updateUI();\r\n\t\t\t}", "void removePickDetail(Question question);", "public void removeFromParent();", "public void remove() {\n super.remove();\n if (this.caughtEntity != null) {\n this.caughtEntity.noClip = false;\n }\n if (this.angler != null) {\n this.angler.fishingBobber = null;\n this.angler.noClip = false;\n }\n if(this.rod.getItem() == Items.ITEM_GRAB_HOOK){\n this.rod.getOrCreateTag().putBoolean(\"cast\", false);\n }\n }", "@Override\n protected void removeMember() {\n }", "public void remove() {\r\n return;\r\n }", "public void remove(){\n }", "void removeIsInputTo(MethodCall oldIsInputTo);", "@Override\n\tpublic void removeLayoutComponent(Component comp) {\n\t\tif (center == comp)\n\t\t\tcenter = null;\n\t\telse\n\t\t\tedge.remove(comp);\n\t}", "@Override\n\tpublic void remove(Component component) {\n\t\tlist.remove(component);\n\t}", "@Override\n\tpublic void removechild(EndpointEntity entity) {\n\t\t\n\t}", "@Override\npublic void remove(ObjectAdapter compAdapter) {\n\t\n}", "public void remove() {\n/* 1379 */ super.remove();\n/* 1380 */ this.inventoryMenu.removed(this);\n/* 1381 */ if (this.containerMenu != null) {\n/* 1382 */ this.containerMenu.removed(this);\n/* */ }\n/* */ }", "public void removed() {\n }", "public void remove()\n {\n ShapeParent parent = getShapeParent();\n \n if (parent != null)\n {\n parent.remove(this);\n }\n }", "@Override\n public void removeNotify()\n {\n unregisterListeners();\n super.removeNotify();\n }", "public void remove () {}", "public void setRemover() {\n Disposable d = Disposable.from(() -> parent.psm.remove(this));\n UNSAFE.putOrderedObject(this, REMOVE, d);\n }", "protected final void removeCollectableComponentModelListeners() {\n\t\tfor (CollectableComponentModel clctcompmodel : this.getCollectableComponentModels()) {\n\t\t\tclctcompmodel.removeCollectableComponentModelListener(this.getCollectableComponentModelListener());\n\t\t}\n\t}", "@Override\n\t\t\t\tpublic void notifyParent(int signalType) {\n\t\t\t\t\tlayeredPane.remove(operationPanels[position]);\n\t\t\t\t\treaddChoicePanel();\n\t\t\t\t}", "void removeModelEventListener(UmlChangeListener listener, Object modelelement, String[] propertyNames);", "private void removeTraversedComponents(){\n // hack for not traversing and focusing Window on JDK1.4\n traversableComponents.remove(parent);\n \n Iterator i = traversedComponents.iterator();\n while(i.hasNext()){\n traversableComponents.remove(i.next());\n }\n }" ]
[ "0.66298264", "0.66226536", "0.65371764", "0.6404002", "0.62908447", "0.6214268", "0.61755824", "0.61630327", "0.60943323", "0.60639256", "0.6050994", "0.6046711", "0.6042226", "0.60294884", "0.6028008", "0.6028008", "0.6028008", "0.6028008", "0.6028008", "0.6028008", "0.6028008", "0.6025628", "0.6025628", "0.59903187", "0.5979867", "0.59552807", "0.59456253", "0.59245014", "0.5910697", "0.5896328", "0.5896328", "0.58703667", "0.58592427", "0.58448833", "0.5843212", "0.5830625", "0.5811967", "0.57995117", "0.579382", "0.57737154", "0.5766271", "0.5766261", "0.57627183", "0.5750823", "0.5750823", "0.5750823", "0.5750823", "0.5750823", "0.5750823", "0.5750823", "0.5750823", "0.5730962", "0.57124835", "0.5708925", "0.5706902", "0.5703364", "0.57033396", "0.57033396", "0.5700684", "0.5699205", "0.56830156", "0.5678971", "0.567569", "0.56742996", "0.5669559", "0.56681013", "0.565992", "0.5658165", "0.56493855", "0.56485873", "0.56357807", "0.56317025", "0.5620444", "0.56126845", "0.5608847", "0.5596895", "0.55919194", "0.5588091", "0.558717", "0.5577378", "0.557483", "0.5574641", "0.5549334", "0.55484456", "0.5548114", "0.55392665", "0.5538525", "0.552828", "0.5524998", "0.5524669", "0.5519568", "0.55188906", "0.5516049", "0.5512532", "0.55077505", "0.5488227", "0.5469355", "0.5469122", "0.54650486", "0.54639965" ]
0.5931345
27
Default Constructor Kelly May 11/11/2020
public DBViewAllPilot() { try { statement = connection.createStatement(); viewAll(); //call the viewAll function; }catch(SQLException ex) { System.out.println("Database connection failed DBViewAllAircraft"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "defaultConstructor(){}", "private Default()\n {}", "void DefaultConstructor(){}", "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "public Pitonyak_09_02() {\r\n }", "private Instantiation(){}", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "Reproducible newInstance();", "public CyanSus() {\n\n }", "private ARXDate() {\r\n this(\"Default\");\r\n }", "private Rekenhulp()\n\t{\n\t}", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "public Tbdcongvan36() {\n super();\n }", "public AllDifferent()\n {\n this(0);\n }", "public Basic() {}", "private TMCourse() {\n\t}", "public Lanceur() {\n\t}", "public Tbdtokhaihq3() {\n super();\n }", "public PSRelation()\n {\n }", "public SgaexpedbultoImpl()\n {\n }", "public Demo() {\n\t\t\n\t}", "public Pasien() {\r\n }", "public Orbiter() {\n }", "public Aanbieder() {\r\n\t\t}", "public Demo3() {}", "public Chick() {\n\t}", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public Clade() {}", "default void init() {\n }", "private Main() {\n\n super();\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public Mannschaft() {\n }", "private Converter()\n\t{\n\t\tsuper();\n\t}", "public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }", "public Waschbecken() {\n this(0, 0);\n }", "@Override\n\t\tpublic void init() {\n\t\t}", "public Curso() {\r\n }", "public Chauffeur() {\r\n\t}", "public Cohete() {\n\n\t}", "public Student() {\n//\t\tname = \"\";\n//\t\tage = 0;\n\t\t\n\t\t\n\t\t//call constructors inside of other constructors\n\t\tthis(999,0);\n\t}", "public lo() {}", "public MethodEx2() {\n \n }", "@Override\r\n\tpublic void init() {}", "private ExampleVersion() {\n throw new UnsupportedOperationException(\"Illegal constructor call.\");\n }", "public SlanjePoruke() {\n }", "public Generic(){\n\t\tthis(null);\n\t}", "public TennisCoach () {\n\t\tSystem.out.println(\">> inside default constructor.\");\n\t}", "@Override public void init()\n\t\t{\n\t\t}", "private void __sep__Constructors__() {}", "public Anschrift() {\r\n }", "public CSSTidier() {\n\t}", "private MApi() {}", "public Ov_Chipkaart() {\n\t\t\n\t}", "public void init() {\n \n }", "private Cat() {\n\t\t\n\t}", "protected Betaling()\r\n\t{\r\n\t\t\r\n\t}", "@Override\n public void init() {}", "public Naive() {\n\n }", "Petunia() {\r\n\t\t}", "public Person()\n\t{\n\t\tthis.age = -1;\n\t\tthis.name = \"Unknown\";\n\t}", "protected Asignatura()\r\n\t{}", "public Achterbahn() {\n }", "public Coche() {\n super();\n }", "private Marinator() {\n }", "private Marinator() {\n }", "public Main() {\n\t\tsuper();\n\t}", "@Test\n public void constructorDefault() {\n final CourseType courseType = new CourseType();\n\n assertNull(courseType.getId());\n assertNull(courseType.getName());\n assertNull(courseType.getPicture());\n assertNull(courseType.getPosition());\n assertNull(courseType.getStatus());\n assertNull(courseType.getCourses());\n assertNull(courseType.getAllowedDishes());\n }", "private NfkjBasic()\n\t\t{\n\t\t\t\n\t\t}", "public JSFOla() {\n }", "public Odontologo() {\n }", "public Self__1() {\n }", "DefaultConstructor(int a){}", "private SingleObject()\r\n {\r\n }", "public Factory() {\n\t\tsuper();\n\t}", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public Person() {\n\t\t\n\t}", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "TypesOfConstructor(){\n System.out.println(\"This is default constructor\");\n }", "public _355() {\n\n }", "public void init() {\r\n\t\t// to override\r\n\t}", "private UsineJoueur() {}", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "Employees() { \r\n\t\t this(100,\"Hari\",\"TestLeaf\");\r\n\t\t System.out.println(\"default Constructor\"); \r\n\t }", "protected Doodler() {\n\t}", "public God() {}", "public Car() {\r\n this(\"\", \"\", \"\", 0, Category.EMPTY, 0.00, \"\", 0, \"\", 0.00, \"\", DriveTrain.EMPTY,\r\n Aspiration.EMPTY, 0.00, 0.00, 0.00, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n }", "public Alojamiento() {\r\n\t}", "public Dog() {\n // Default constructor\n }", "public DefaultImpl() {\n this(DEFAULT_DATE_FORMAT);\n }", "O() { super(null); }", "public Kullanici() {}", "public Mitarbeit() {\r\n }", "public Mueble() {\n }", "private Ognl() {\n }", "public Trening() {\n }", "public Sad() {\n }", "public Livro() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}" ]
[ "0.79305947", "0.7914428", "0.78157705", "0.7459926", "0.7459294", "0.7414234", "0.7309289", "0.72836655", "0.7254249", "0.72177505", "0.7104103", "0.7099299", "0.70473444", "0.69796264", "0.6979096", "0.6970475", "0.6959638", "0.6954579", "0.69257355", "0.69237936", "0.6918851", "0.6910635", "0.6909984", "0.69043994", "0.6901319", "0.68938065", "0.6888793", "0.6871143", "0.6868606", "0.68668044", "0.68633616", "0.6863248", "0.68485403", "0.68458945", "0.6834305", "0.6825471", "0.6813629", "0.6806807", "0.6804464", "0.6801295", "0.6797299", "0.67963624", "0.67937225", "0.6793271", "0.67784363", "0.6776508", "0.67721105", "0.6763325", "0.67593896", "0.6759278", "0.6758151", "0.675497", "0.67476135", "0.67472327", "0.67443067", "0.6739418", "0.67246604", "0.6718668", "0.6713813", "0.6707257", "0.67060566", "0.66983896", "0.6691027", "0.66853064", "0.6684132", "0.6679637", "0.6679637", "0.6677422", "0.6676278", "0.6669938", "0.66649866", "0.6664515", "0.6661164", "0.6658292", "0.6658043", "0.6656785", "0.66537726", "0.6651167", "0.6648384", "0.66449636", "0.6642489", "0.66397697", "0.6638772", "0.663722", "0.6627187", "0.66247976", "0.6623827", "0.6623473", "0.66225183", "0.6621127", "0.66184545", "0.6617852", "0.66174", "0.6616795", "0.6615365", "0.66113794", "0.6601722", "0.6600932", "0.65894145", "0.6582821", "0.6582821" ]
0.0
-1
viewAll method that calls the View_All_Pilot stored procedure in the SQL DB Kelly May 11/11/2020
public void viewAll() { try { String method = "{call CAFDB.dbo.View_All_Pilot}"; callable = connection.prepareCall(method); //execute the query ResultSet rs = callable.executeQuery(); /** * Output from View_All_Pilot: * 1 = PilotID - int * 2 = FirstName - varchar (string) * 3 = LastName - varchar (string) * 4 = DateOfBirth - date * 5 = EmployeeNumber - varchar (string) * 6 = DateOfHire - date * 7 = DateLeftCAF - date */ while(rs.next()) { //append to arraylists pilotID.add(rs.getInt(1)); firstName.add(rs.getString(2)); lastName.add(rs.getString(3)); dob.add(rs.getDate(4)); employeeNumber.add(rs.getString(5)); dateOfHire.add(rs.getDate(6)); dateLeftCAF.add(rs.getDate(7)); } }catch (SQLException ex) { Logger.getLogger(DBViewAllClient.class.getName()).log(Level.SEVERE, null, ex); } catch(Exception e) { e.printStackTrace(); System.out.println("view all clients could not be completed"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DBViewAllPilot() {\n\t\ttry {\n\t\tstatement = connection.createStatement(); \n\t\tviewAll(); //call the viewAll function; \n\t\t\n\t}catch(SQLException ex) {\n\t\tSystem.out.println(\"Database connection failed DBViewAllAircraft\"); \n\t}\n}", "@RequestMapping(\"/pilot/viewall\")\n\tpublic String viewallPilot(Model model) {\n\t\t\n\t\tList<PilotModel> listPilot= pilotService.getPilotList();\n\t\t\n\t\tmodel.addAttribute(\"listPilot\",listPilot);\n\t\treturn \"viewall-pilot\";\n\t}", "public void viewAll() {\n click(viewAllLink);\n }", "public static void showAllVilla(){\n ArrayList<Villa> villaList = getListFromCSV(FuncGeneric.EntityType.VILLA);\n displayList(villaList);\n showServices();\n }", "void query9InterativaPrint(List<ParQuery9> pares);", "void showAll();", "public ResultSet fetchSelectAllParkLots() {\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t*\tTo create connection to the DataBase\r\n\t\t\t*/\r\n\t\t\tnew DbConnection();\r\n\t\t\t/**\r\n\t\t\t*\tStore the table data in ResultSet rs and then return it\r\n\t\t\t*/\r\n\t\t\trs = stmt.executeQuery(SELECT_ALL_PARKLOT_QUERY);\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSqlExcep.printStackTrace();\r\n\t\t} catch(ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\tcloseDbConnection();\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t\treturn rs;\r\n\t}", "public abstract List<LocationDto> viewAll();", "@JsonView(View.Summary.class)\n\t@GetMapping(path=\"/statusList\")\n\tpublic Iterable<Pilot> listAllPilotStatus() {\n\t\treturn pilotRepository.findAll();\n\t}", "@GetMapping(\"/view-policies\")\n @Timed\n public List<ViewPolicyDTO> getAllViewPolicies() {\n log.debug(\"REST request to get all ViewPolicies\");\n return viewPolicyService.findAll();\n }", "@Override\r\n\tpublic List<Planter> viewAllPlanters() {\r\n\t\t\r\n\t\treturn planterRepo.findAll();\r\n\t}", "private void doViewAllPartners() {\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"***Hors Management System:: System Administration:: View All Partners\");\n\n List<Partner> partners = partnerControllerRemote.retrieveAllPartners();\n\n partners.forEach((partner) -> {\n System.out.println(\"Partner ID:\" + partner.getPartnerId() + \"Partner Name: \" + partner.getName() + \"Password: \" + partner.getPassword());\n });\n\n System.out.println(\"Press any key to continue...>\");\n sc.nextLine();\n }", "@GetMapping(\"/view-all\")\r\n\tpublic List<ProductDetails> viewAllProducts() {\r\n\r\n\t\treturn productUtil.toProductDetailsList(productService.viewAllProducts());\r\n\t}", "@GetMapping(path=\"/pilots\")\n\tpublic Iterable<Pilot> listPilots() {\n\t\t// This returns a JSON or XML with the users\n\t\treturn pilotRepository.findAll();\n\t}", "public void printAll()\n {\n r.showAll();\n }", "private void butViewLoansActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butViewLoansActionPerformed\n //ResultSet rs = driver.query(\"select borrowerID, fullName, bookID, title, date from BBLink L, \"\n // + \"Borrowers B, AllBooks A where A.id=bookID and B.id = borrowerID\");\n\n CallableStatement cstmt = driver.getCallStatement(\"{CALL viewAllLoans()}\");\n ResultSet rs = null;\n try {\n rs = cstmt.executeQuery();\n\n JTable myTable = new JTable(driver.buildTableModel(rs));\n rs.close();\n cstmt.close();\n\n scrollPane.setViewportView(myTable);\n } catch (SQLException se) {\n driver.errorMessageNormal(\"From LoansPanel.butViewLoansAP: \" + se);\n se.printStackTrace();\n }\n\n }", "public static void showAllRoom(){\n ArrayList<Room> roomList = getListFromCSV(FuncGeneric.EntityType.ROOM);\n displayList(roomList);\n showServices();\n }", "public void ViewAllData(View v){\n Cursor res = myDB.viewAllData();\n // if there are no data\n if (res.getCount() == 0) {\n // show an error message\n showMessage(\"Error\", \"Nothing found\");\n return;\n }\n\n StringBuffer buffer = new StringBuffer();\n while(res.moveToNext()){\n buffer.append(\"Id :\" + res.getString(0) + \"\\n\");\n buffer.append(\"Name :\" + res.getString(1) + \"\\n\");\n buffer.append(\"Surname :\" + res.getString(2) + \"\\n\");\n buffer.append(\"Marks :\" + res.getString(3) + \"\\n\\n\");\n }\n\n // then show all the data inside the buffer\n showMessage(\"Data\", buffer.toString());\n }", "public void view() {\r\n\t\tfor (int i = 0; i < this.getTableNumber(); i++) {\r\n\t\t\tthis.getTables(i).view();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "@Override\n\tpublic Iterable<Flight> viewAllFlight() {\n\t\treturn flightDao.findAll();\n\t}", "private List<String> getAllViewsDDL() {\n\t\tList<String> resultList = new ArrayList<String>();\n\t\tList<String> viewNameList = new ArrayList<String>();\n\t\tLinkedHashMap<String, String> viewQuerySpecMap = new LinkedHashMap<String, String>();\n\t\tConnection conn = null;\n\t\tStatement stmt = null;\n\t\tCUBRIDResultSetProxy rs = null;\n\n\t\tString sql;\n\t\tif (dbInfo.isSupportUserSchema()) {\n\t\t\tsql = \"SELECT c.class_name, c.owner_name, c.class_type\" + \" FROM db_class c, db_attribute a\"\n\t\t\t\t+ \" WHERE c.class_name=a.class_name AND c.is_system_class='NO'\"\n\t\t\t\t+ \" AND c.owner_name=a.owner_name\"\n\t\t\t\t+ \" AND c.class_type='VCLASS'\" + \" GROUP BY c.owner_name, c.class_name, c.class_type\"\n\t\t\t\t+ \" ORDER BY c.owner_name, c.class_type, c.class_name\";\n\t\t} else {\n\t\t\tsql = \"SELECT c.class_name, c.class_type\" + \" FROM db_class c, db_attribute a\"\n\t\t\t\t\t+ \" WHERE c.class_name=a.class_name AND c.is_system_class='NO'\"\n\t\t\t\t\t+ \" AND c.class_type='VCLASS'\" + \" GROUP BY c.class_name, c.class_type\"\n\t\t\t\t\t+ \" ORDER BY c.class_type, c.class_name\";\n\t\t}\n\n\t\t// [TOOLS-2425]Support shard broker\n\t\tsql = dbInfo.wrapShardQuery(sql);\n\t\ttry {\n\t\t\tconn = JDBCConnectionManager.getConnection(dbInfo, false);\n\t\t\tstmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t\t\t\tResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);\n\n\t\t\trs = (CUBRIDResultSetProxy) stmt.executeQuery(sql);\n\t\t\twhile (rs.next()) {\n\t\t\t\tif (dbInfo.isSupportUserSchema()) {\n\t\t\t\t\tString className = rs.getString(1);\n\t\t\t\t\tString ownerName = rs.getString(2);\n\t\t\t\t\tviewNameList.add(ownerName + \".\" + className);\n\t\t\t\t} else {\n\t\t\t\t\tString className = rs.getString(1);\n\t\t\t\t\tviewNameList.add(className);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"\", e);\n\t\t} finally {\n\t\t\tQueryUtil.freeQuery(stmt, rs);\n\t\t}\n\n\t\ttry {\n\t\t\tstmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t\t\t\tResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);\n\n\t\t\tfor (String viewName : viewNameList) {\n\t\t\t\tString querySpecSql;\n\t\t\t\tif (dbInfo.isSupportUserSchema()) {\n\t\t\t\t\tquerySpecSql = \"SELECT vclass_def FROM db_vclass WHERE CONCAT(owner_name, '.' , vclass_name)='\"\n\t\t\t\t\t\t+ viewName + \"'\";\n\t\t\t\t} else {\n\t\t\t\t\tquerySpecSql = \"SELECT vclass_def FROM db_vclass WHERE vclass_name='\"\n\t\t\t\t\t\t+ viewName + \"'\";\n\t\t\t\t}\n\n\t\t\t\t// [TOOLS-2425]Support shard broker\n\t\t\t\tquerySpecSql = dbInfo.wrapShardQuery(querySpecSql);\n\n\t\t\t\ttry {\n\t\t\t\t\trs = (CUBRIDResultSetProxy) stmt.executeQuery(querySpecSql);\n\t\t\t\t\tif (rs.next()) {\n\t\t\t\t\t\tviewQuerySpecMap.put(viewName, rs.getString(1));\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tQueryUtil.freeQuery(rs);\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"\", e);\n\t\t} finally {\n\t\t\tQueryUtil.freeQuery(conn, stmt);\n\t\t}\n\n\t\tfor (Map.Entry<String, String> entry : viewQuerySpecMap.entrySet()) {\n\t\t\tSchemaInfo viewInfo = dbInfo.getSchemaInfo(entry.getKey());\n\t\t\tString ddl = getViewDDL(viewInfo, dbInfo, entry.getValue());\n\t\t\tresultList.add(ddl);\n\t\t}\n\n\t\treturn resultList;\n\t}", "private void listViewPendentes(List<Compra> listAll) {\n\t\t\n\t}", "public void displayAllPatients() {\r\n\t\ttry {\r\n\t\t\tString query= \"SELECT * FROM patients\";\r\n\t\t\tStatement stm= super.getConnection().createStatement();\r\n\t\t\tResultSet results= stm.executeQuery(query);\r\n\t\t\twhile(results.next()) {\r\n\t\t\t\tString[] row= new String[7];\r\n\t\t\t\trow[0]= results.getInt(1)+\"\";\r\n\t\t\t\trow[1]= results.getString(2);\r\n\t\t\t\trow[2]= results.getString(3);\r\n\t\t\t\trow[3]= results.getString(4);\r\n\t\t\t\trow[4]= results.getString(5);\r\n\t\t\t\trow[5]= results.getInt(6)+\"\";\r\n\t\t\t\tmodelHostory.addRow(row);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t}", "@Override\n public List<Item> viewAllItems() {\n // calls List<Item> itemRepo.findCatalog();\n return itemRepo.findCatalog();\n }", "public void displayAll() {\n\t\t\n\t\tbankop.display();\n\t\n\t}", "@Query(\"FROM Flight WHERE flightState=true\")\r\n\tpublic List<Flight> viewAll();", "@Override\n\tpublic String showAll() {\n\t\treturn null;\n\t}", "public void updateViewRs(){\n try{\n this.viewrs= viewstmt.executeQuery \n (\"SELECT * FROM JEREMY.TICKET ORDER BY ID\"); \n// viewrs.beforeFirst();\n// viewrs.next();\n }catch (Exception e ){\n System.out.println(\"sql exception at updateViewRs\" + e);\n }\n }", "private void butViewBorrowersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butViewBorrowersActionPerformed\n CallableStatement cstmt = driver.getCallStatement(\"{CALL viewAllBorrowers()}\");\n\n try {\n ResultSet rs = cstmt.executeQuery();\n\n JTable myTable = new JTable(driver.buildTableModel(rs));\n rs.close();\n cstmt.close();\n\n scrollPane.setViewportView(myTable);\n } catch (SQLException se) {\n driver.errorMessageNormal(\"From LoansPanel.butViewBorrowersAP: \" + se);\n se.printStackTrace();\n }\n\n }", "private static void registerAllViews() {\n Aggregation latencyDistribution =\n Aggregation.Distribution.create(BucketBoundaries.create(Arrays.asList(0.0, 5.0, 10.0, 15.0, 20.0)));\n\n // Define the views\n List<TagKey> noKeys = new ArrayList<TagKey>();\n View[] views =\n new View[]{\n View.create(\n Name.create(\"ocjavaexporter/latency\"),\n \"The distribution of latencies\",\n M_LATENCY_MS,\n latencyDistribution,\n noKeys)\n };\n\n // Create the view manager\n ViewManager vmgr = Stats.getViewManager();\n\n // Then finally register the views\n for (View view : views) {\n vmgr.registerView(view);\n }\n }", "@Override\n public List<Plan> listAll() {\n List<Plan> plans = new ArrayList<>();\n planRepository.findAll().forEach(plans::add);\n return plans;\n }", "org.naru.park.ParkController.CommonAction getAll();", "org.naru.park.ParkController.CommonAction getAll();", "@RequestMapping(value = \"/viewAllObjectLocationGas\", method = RequestMethod.GET)\n\tpublic List<ObjectLocationGas> viewAllObjectLocationGas() {\n\t\tAndroidDAO ad = new AndroidDAO();\n\t\tList<ObjectLocationGas> listObjLocationGas = ad.getAllObjectLocationGas();\n\t\treturn listObjLocationGas;\n\t}", "public static void main_printList(){\n\n table.printApplicantTable();\n\n }", "@Override\n\tpublic List<Employee> viewAllEmployees() {\n\t\t CriteriaBuilder cb = em.getCriteriaBuilder();\n\t\t CriteriaQuery<Employee> cq = cb.createQuery(Employee.class);\n\t\t Root<Employee> rootEntry = cq.from(Employee.class);\n\t\t CriteriaQuery<Employee> all = cq.select(rootEntry);\n\t \n\t\t TypedQuery<Employee> allQuery = em.createQuery(all);\n\t\t return allQuery.getResultList();\n\t}", "public void displayLots() {\r\n\t\tResultSet displayLotsRs = null;\r\n\t\t/**\r\n\t\t*\tSince connecting to database (DbConnection()) and retrieving data (fetchSelectAllParkLots())\r\n\t\t* throw SQLException and throwing an exception from multiple levels again and again is not\r\n\t\t*\ta good way, so its is needed to catch the exception here.\r\n\t\t*/\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t*\tCreate a connection to the database\r\n\t\t\t*/\r\n\t\t\tDbConnection displayLotsConn = new DbConnection();\r\n\t\t\t/**\r\n\t\t\t*\tRetrieve all data from parklot table and save it in ResultSet displayLotsRs\r\n\t\t\t*/\r\n\t\t\tdisplayLotsRs = displayLotsConn.fetchSelectAllParkLots();\r\n\t\t\tSystem.out.println(\"*************PARKING LOTS*************\");\r\n\t\t\tSystem.out.println(\"\\tLot No.\\tStatus\");\r\n\t\t\twhile (displayLotsRs.next()) {\r\n\t\t\t\t/**\r\n\t\t\t\t*\tDisplay all the data one by one in this loop\r\n\t\t\t\t*/\r\n\r\n\t\t\t\tlotNo = displayLotsRs.getInt(1);\r\n\r\n\t\t\t\t/**\r\n\t\t\t\t*\tDecide the state of boolean isBooke by the state of isbooked in the DataBase\r\n\t\t\t\t*\tisbooked = 0 => isBooked = false\r\n\t\t\t\t*\tisbooked = 1 => isBooked = true\r\n\t\t\t\t*/\r\n\t\t\t\tSystem.out.print(\"\\t\" + lotNo + \"\\t\");\r\n\t\t\t\tif (displayLotsRs.getInt(2) == 0) {\r\n\t\t\t\t\tisBooked = false;\r\n\t\t\t\t\tSystem.out.print(\"Available\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tisBooked = true;\r\n\t\t\t\t\tSystem.out.print(\"Booked\");\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSystem.out.println(\"**************Error Connecting to the Database**************\");\r\n\t\t\tSqlExcep.printStackTrace();\r\n\t\t} catch (ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\t//DbConnection.closeDbConnection();\r\n\t\t\t\tif (loginRs != null) {\r\n\t\t\t\t\tloginRs.close();\r\n\t\t\t\t}\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t}", "public String displayAllTickets(){\n String p = \" \";\n try {\n \n rs = stmt.executeQuery \n (\"SELECT * FROM JEREMY.TICKET ORDER BY ID\");\n p = loopDBInfo(rs);\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n } \n return p;\n \n }", "public static void showAllHouse(){\n ArrayList<House> houseList = getListFromCSV(FuncGeneric.EntityType.HOUSE);\n displayList(houseList);\n showServices();\n }", "@ApiOperation(value = \"Route Get mapping to fetch all routes\", response = List.class)\n\t@GetMapping(\"/all\")\n\tpublic ResponseEntity<List<RouteDto>> viewAllRoutes() {\n\t \n\t List<Route> routeList = this.routeServices.viewRouteList();\n\t\tList<RouteDto> routeDtoList = new ArrayList<>();\n\t\tfor (Route r : routeList) {\n\t\t\tRouteDto routedto = modelMapper.map(r, RouteDto.class);\n\t\t\trouteDtoList.add(routedto);\n\t\t}\n\t\tif (!(routeDtoList.isEmpty())) {\n\t\t\treturn new ResponseEntity<>(routeDtoList, HttpStatus.OK);\n\t\t} else {\n\t\t\treturn new ResponseEntity<>(routeDtoList, HttpStatus.NOT_FOUND);\n\t\t}\n\t}", "public static void showAllVillaNotDuplicate(){\n showAllNameNotDuplicate(FuncGeneric.EntityType.VILLA);\n }", "@Override\r\n\tpublic Map<String, Object> readAll() {\n\t\tsimpleJdbcCall = new SimpleJdbcCall(jdbcTemplate).withCatalogName(\"PKG_ESTADO_CIVIL\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .withProcedureName(\"PR_LIS_ESTADO_CIVIL\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .declareParameters(new SqlOutParameter(\"CUR_ESTADO_CIVIL\", OracleTypes.CURSOR,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t new ColumnMapRowMapper()));\r\n\t\treturn simpleJdbcCall.execute();\r\n\t}", "public abstract String viewTrips(List<Trip> tripList);", "@GetMapping(\"/view-all-order\")\n\tpublic List<OrderDTO> viewAllOrders() {\n\t\tLOGGER.info(\"view-all-Order URL is opened\");\n\t\tLOGGER.info(\"view-all-Order() is initiated\");\n\t\tLOGGER.info(\"view-all-Order() has executed\");\n\t\treturn orderService.getAllOrders();\n\t}", "@Override\n\tpublic List<MyFoodDTO> selectAll() {\n\t\tString sql = \" SELECT * FROM view_식품정보 \";\n\t\tPreparedStatement pStr = null;\n\t\ttry {\n\t\t\tpStr = dbConn.prepareStatement(sql);\n\t\t\tList<MyFoodDTO> brList = this.select(pStr);\n\t\t\tpStr.close();\n\t\t\treturn brList;\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public void viewVehiclesInGarage() {\n\t\tfor (Vehicle vehicle : vehicleList) {\n\t\t\tvehicle.print();\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public LinkedList<PetReportBySpecieVO> getAllPetsBySpecie() {\n xcon = MySQLConnection.getInstance();\n LinkedList<PetReportBySpecieVO> petList = new LinkedList<>();\n try {\n PreparedStatement ps = xcon.getConnection().prepareCall(\"{call sp_getAllPetsBySpecie_Report}\");\n ResultSet rs = ps.executeQuery();\n \n while(rs.next()) {\n PetReportBySpecieVO report = new PetReportBySpecieVO();\n report.setCount(rs.getInt(\"amount\"));\n report.setSpecie(rs.getString(\"PetSpecie\"));\n petList.add(report);\n }\n } catch (SQLException e) {\n JOptionPane.showMessageDialog(null, \"Query error\" + e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n } finally {\n xcon.close_connection();\n }\n return petList;\n }", "@Override\n\tpublic List<Planification> listPlan() {\n\t\treturn dao.listPlan();\n\t}", "private void listParkingLots() {\n for (ParkingLot pl: parkinglots) {\n System.out.println(pl.getName() + \" | price: \" + pl.getPrice() + \" /hour\");\n }\n }", "@Override\n\tpublic Map<String, Object> readAll() {\n\t\tsimpleJdbcCall = new SimpleJdbcCall(jdbcTemplate)\n\t\t\t\t.withCatalogName(\"PKG_ALM_CRUD_PRODUNIDADMED\")\n\t\t\t\t.withProcedureName(\"PA_MAT_PRODUNIDADMED_LIS\")\t\n\t\t\t\t.declareParameters(new SqlOutParameter(\"uni\", OracleTypes\n\t\t\t\t.CURSOR, new ColumnMapRowMapper()));\n\t\treturn simpleJdbcCall.execute();\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic List<DbLotniskoEntity> getAll() {\n \tList<DbLotniskoEntity> airports = (List<DbLotniskoEntity>)getSession().createQuery(\"from kiwi.models.DbLotniskoEntity\").list();\n\n \treturn airports;\n }", "@Override\r\n\tpublic void viewAllUsers() {\n\t\tList<User> allUsers = new ArrayList<User>();\r\n\t\tallUsers = udao.getAllUsers();\r\n\t\t\r\n\t\tSystem.out.println(\"ALL USERS:\");\r\n\t\tSystem.out.println(\"ID\\tUsername\\tName\");\r\n\t\t\r\n\t\tfor(int i = 0; i < allUsers.size(); i++) {\r\n\t\t\tUser tempUser = allUsers.get(i);\r\n\t\t\tSystem.out.println(tempUser.getUserID() + \"\\t\" + tempUser.getUsername() + \"\\t\"\r\n\t\t\t\t\t+ tempUser.getFirstName() + \" \" + tempUser.getLastName());\r\n\t\t}\r\n\r\n\t}", "@GetMapping(\"/payment\")\n\tpublic ResponseEntity<List<Payment>> viewAllPayments() {\n\t\tlogger.info(\"View all Payments\");\n\t\treturn ResponseEntity.ok().body(payService.viewAllPayments());\n\t}", "@RequestMapping(value = \"/show/all/products\")\r\n\tpublic ModelAndView showAllProducts() {\r\n\t\tModelAndView mv = new ModelAndView(\"page\");// Here page is the logical view name\r\n\t\tmv.addObject(\"title\", \"All Products\");\r\n\t\tmv.addObject(\"userClickAllProducts\", true);\r\n\t\treturn mv;\r\n\t}", "@Override\n\tpublic List<vip> selectAll() {\n\t\treturn this.vd.selectAll();\n\t}", "private void printAllProducts()\n {\n manager.printAllProducts();\n }", "public List<ParamIntervento> getAll()\n {\n\t System.out.println(\"chiamo getAll: \");\n System.out.flush();\n CriteriaQuery<ParamIntervento> criteria = this.entityManager.getCriteriaBuilder().createQuery(ParamIntervento.class);\n return this.entityManager.createQuery(criteria.select(criteria.from(ParamIntervento.class))).getResultList();\n }", "@Override\r\n\tpublic List<Pilot> getAllPilots() {\r\n\t\tList<Pilot> cloned = new ArrayList<>(pilots);\r\n\t\treturn cloned;\r\n\t}", "void loadAll(int pageNum, LoadView mLoadView);", "public static void viewtable() {\r\n\t\tt.dibuixa(table);\r\n\t}", "private void doViewAllTasks() {\n ArrayList<Task> t1 = todoList.getListOfTasks();\n if (t1.size() > 0) {\n for (Task task : t1) {\n System.out.println(task.getTime() + \" \" + task.getDescription() + \" \" + task.getDate());\n }\n } else {\n System.out.println(\"No tasks available.\");\n }\n }", "public void executeView()\n\t{\n\t\tString cmd = \"\";\n\t\tString opar = Deducer.getUniqueName(\"opar\");\n\t\tcmd += (opar + \" <- par()\"); //save the original margin parameters\n\t\tcmd += (\"\\npar(mar=c(8, 4, 4, 0.5))\"); //give the plot more space at the bottom for long words.\n\t\tcmd += (\n\t\t\t\t\"\\nbarplot(\" \n\t\t\t\t+ \n\t\t\t\ttfDialog.getTermFreqCall(this.getExtraTermFreqArgs()) + \",\" \n\t\t\t\t+\n\t\t\t\t\"cex.names=0.8,\" //make the terms a bit smaller\n\t\t\t\t+\n\t\t\" las=2);\");\n\t\tcmd += (\"\\npar(\"+ opar +\")\");\n\t\tDeducer.execute(cmd);\n\t\tDeducer.execute(\"dev.set()\", false); //give the plot focus\n\t\t\n\t\t\n\t}", "@Override\n\tpublic List<Games> allGamesView() {\n\t\treturn gameDAO.viewAllGame();\n\t}", "private void view() {\n\n\t\ttry {\n\t\t\tString databaseUser = \"blairuser\";\n\t\t\tString databaseUserPass = \"password!\";\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tConnection connection = null;\n\t\t\tString url = \"jdbc:postgresql://13.210.214.176/test\";\n\t\t\tconnection = DriverManager.getConnection(url, databaseUser, databaseUserPass);\n//\t\t\tStatement s = connection.createStatement();\n\t\t\ts = connection.createStatement();\n\t\t\tResultSet rs = s.executeQuery(\"select * from account;\");\n\t\t\t// while (rs.next()) {\n\t\t\tString someobject = rs.getString(\"name\") + \" \" + rs.getString(\"password\");\n\t\t\tSystem.out.println(someobject);\n\t\t\toutput.setText(someobject);\n\t\t\t// output.setText(rs);\n\t\t\t// System.out.println(rs.getString(\"name\")+\" \"+rs.getString(\"message\"));\n\t\t\t// rs.getStatement();\n\t\t\t// }\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t\tPostgresJDBC();\n\t}", "@Override\r\n\tpublic void viewAllAccountsAllUsers() {\n\t\tas.getAllAccountsAllUsers();\r\n\t}", "public List<Visit> getVisits() {\n JdbcTemplate select = new JdbcTemplate(dataSource);\n return select.query(\"SELECT id, date, description, petId, vetId FROM visit\", new VisitRowMapper());\n }", "public List<Vet> getAllVets() {\n\t\tentityManager = JPAUtils.getEntityManager();\n\t\tentityManager.getTransaction().begin();\n\t\tvets = entityManager.createQuery(\"from Vet\", Vet.class).getResultList();\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t\treturn vets;\n\t}", "public void Refresh()\r\n \t{\r\n\t try{\r\n\t\t rsTution=db.stmt.executeQuery(\"Select * from Tution\");\r\n\t\t rsTution.next();\r\n\t\t Display();\r\n\t }catch(SQLException sqle)\r\n\t {System.out.println(\"Refresh Error:\"+sqle);\r\n\t }\r\n \t}", "@Override\r\n\tpublic List<Product> showAll() throws Exception {\n\t\treturn this.dao.showAll();\r\n\t}", "private CommandResult viewTimetable() {\n timetable.executeView();\n logger.log(Level.INFO, \"User has printed timetable\");\n return new CommandResult(\"Timetable has been printed above\");\n }", "private void viewAllStudents() {\n Iterable<Student> students = ctrl.getStudentRepo().findAll();\n students.forEach(System.out::println);\n }", "public List<TimeSheet> showAllTimeSheet(){\n log.info(\"Inside TimeSheetService#ShowAllTimeSheet() Method\");\n List<TimeSheet> allTimeSheet = timeSheetRepository.findAll();\n return allTimeSheet;\n }", "private void listAll() throws SQLException { \n\t\t List<SearchList> bookList = searchListDao.listAll();\n\t\t System.out.printf(\"%-5s %-35s %-30s %-30s \\n\",\"Id#\", \"Title\", \"Author\", \"Series\"); \n\t\t for (SearchList book : bookList) { \n\t\t\t System.out.printf(\"%-5s %-35s %-30s %-30s \\n\", book.getBookIdNum(), book.getTitle(), book.getAuthor(), book.getSeries());\n\t\t }\n\t }", "@Override\n\tpublic List<Parking> getAllParking() {\n\t\treturn parkingRepository.getAllParking();\n\t}", "public ResultSet view(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"select c.compname,f.no_share from company c,finalallocation f,login l,customer cu where l.login_id=cu.login_id and c.comp_id=f.comp_id and cu.user_id=f.user_id and cu.login_id=\"+userid+\"\");\r\n\treturn rs;\r\n}", "public LinkedList<PetVO> getAllPetsCustomers() {\n xcon = MySQLConnection.getInstance();\n LinkedList<PetVO> petList = new LinkedList<>();\n try {\n PreparedStatement ps = xcon.getConnection().prepareCall(\"{call sp_getPetsCustomers_ReportExcel}\");\n ResultSet rs = ps.executeQuery();\n \n while(rs.next()) {\n PetVO pet = new PetVO();\n CustomerVO customer = new CustomerVO();\n customer.setId(rs.getInt(\"CustomerID\"));\n customer.setName(rs.getString(\"CusName\"));\n customer.setLastname(rs.getString(\"CusLastname\"));\n customer.setAddress(rs.getString(\"CusAddress\"));\n customer.setPhone(rs.getString(\"CusPhone\"));\n customer.setEmail(rs.getString(\"CusEmail\")); \n pet.setCode(rs.getString(\"PetCode\"));\n pet.setName(rs.getString(\"PetName\"));\n pet.setAge(rs.getInt(\"PetAge\"));\n pet.setWeight(rs.getFloat(\"PetWeight\"));\n pet.setSpecie(rs.getString(\"PetSpecie\"));\n pet.setCustomer(customer);\n petList.add(pet);\n }\n } catch (SQLException e) {\n JOptionPane.showMessageDialog(null, \"Query error\" + e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n } finally {\n xcon.close_connection();\n }\n return petList;\n }", "@Override\n\tpublic Set<String> loadViews(String databaseName) throws SQLException {\n\t\tSet<String> tables=new HashSet<String>();\n\t\tString sql=\"select VIEW_NAME from user_views\";\n\t\tPreparedStatement preparedStatement= connection.prepareStatement(sql);\n\t\tResultSet resultSet=preparedStatement.executeQuery();\n\t\twhile(resultSet.next()) {\n\t\t String table=resultSet.getString(1).toUpperCase();\n\t\t tables.add(table);\n\t\t}\n\t\treturn tables;\n\t}", "public View getViewAllPanels()\n\t{\n\t\treturn view;\n\t}", "private void doViewAllEmployees() {\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"***Hors Management System:: System Administration:: View All Staffs\");\n\n List<Employee> employees = employeeControllerRemote.retrieveAllEmployees();\n\n employees.forEach((employee) -> {\n System.out.println(\"Employee ID: \" + employee.getEmployeeId() + \"First Name: \" + employee.getFirstName() + \"Last Name: \" + employee.getLastName() + \"Job Role: \" + employee.getJobRole().toString() + \"Username: \" + employee.getUserName() + \"Password: \" + employee.getPassword());\n });\n\n System.out.println(\"Press any key to continue...>\");\n sc.nextLine();\n }", "public void displayAllLoans() {\n try (Statement stmt = connection.createStatement(); // TODO: explain try with resources\n ResultSet rs = stmt.executeQuery(SQL_FIND_ALL_LOANS)) {\n\n System.out.print(\"\\n\\nThe following are the loans in ToyBank:\\n\\n\");\n while (rs.next()) { // TODO: iterating through the ResultSet\n displayOneLoan(rs);\n }\n System.out.print(\"\\n\\n\");\n } catch (SQLException sqle) {\n LOGGER.log(Level.SEVERE, \"Unable to execute DB statement due to error {0}\", sqle.getMessage());\n }\n }", "@Override\n\tpublic DataResult<List<CurriculumVitae>> getAll() {\n\t\treturn null;\n\t}", "public void showAllPictures(View view) {\n\n Intent intent = new Intent(this, PicturesActivity.class);\n intent.putExtra(\"show_all_pictures\", \"showAllPictures\");\n startActivity(intent);\n }", "private void viewAll(HashMap<Integer, Employee> viewAllEmployee) {\r\n\t\tSet<Entry<String, String>> set = employee.entrySet();\r\n\t\tset.stream().forEach((element) -> System.out.println(element.getValue() + \" \" + element.getKey()));\r\n\t}", "public void viewAllPressed(ActionListener viewAllAction){\n \n viewAll.addActionListener(viewAllAction);\n }", "@Transactional\n\t@Override\n\tpublic List<ApplicantModel> viewAllApplicants() {\n\t\treturn applicantRepo.findAll().stream().map(course -> parser.parse(course))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "protected void showReservations() {\n storageDao.findAllRented()\n .forEach(System.out::println);\n }", "@GetMapping(\"/listAll\")\n public String listAll(Model model) {\n List<Person> people = personRepo.getAll();\n\n model.addAttribute(\"people\", people);\n\n return \"listAll\";\n }", "List<ProductView> getAllByPage(int pageNumber, int itemsPerPage) throws ProductException;", "public void printAll() {\r\n\t\t\t\t\r\n\t\tSystem.out.println(\"################\");\r\n\t\tSystem.out.println(\"Filename:\" +getFileName());\r\n\t\tSystem.out.println(\"Creation Date:\" +getCreationDate());\r\n\t\tSystem.out.println(\"Genre:\" +getGenre());\r\n\t\tSystem.out.println(\"Month:\" +getMonth());\r\n\t\tSystem.out.println(\"Plot:\" +getPlot());\r\n\t\tSystem.out.println(\"New Folder Name:\" + getNewFolder());\r\n\t\tSystem.out.println(\"New Thumbnail File Name:\" +getNewThumbnailName());\r\n\t\tSystem.out.println(\"New File Name:\" +getNewFilename());\r\n\t\tSystem.out.println(\"Season:\" +getSeason());\r\n\t\tSystem.out.println(\"Episode:\" +getEpisode());\r\n\t\tSystem.out.println(\"Selected:\" +getSelectEdit());\r\n\t\tSystem.out.println(\"Title:\" +getTitle());\r\n\t\tSystem.out.println(\"Year:\" +getYear());\r\n\t\tSystem.out.println(\"Remarks:\" +getRemarks());\r\n\t\tSystem.out.println(\"################\");\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public List<DetalleVenta> all() {\n return detalleVentaJpaRepository.findAll();\n }", "List<Travel> getAllTravel();", "@GetMapping(\"home\")\n public ModelAndView All(){\n List<DataEntity> allData = dataService.findAll();\n ModelAndView modelAndView = new ModelAndView();\n modelAndView.setViewName(\"list.html\");\n modelAndView.addObject(\"datas\",allData);\n return modelAndView;\n\n }", "private void printAllCourseInDB(){\n\n System.out.println(\"--------------------------------------------------------------------------------------\");\n System.out.println(\"COURSE SCHOOL AU INDEX SLOT TYPE DAY TIME\");\n System.out.println(\"--------------------------------------------------------------------------------------\");\n ArrayList<String> courseIDList = courseMgr.readAllCourseIDFromDB();\n for(String courseID: courseIDList){\n System.out.print(String.format(\"%6s \", courseID));\n Course course = courseMgr.readCourseByID(courseID);\n System.out.print(String.format(\"%5s \", course.getSchool()));\n int j = 0;\n for(CourseIndex courseIndex:course.getCourseIndices()){\n if (j==0)\n System.out.print(String.format(\" %d \", courseIndex.getAu()));\n else\n System.out.print(String.format(\" \", courseIndex.getAu()));\n System.out.print(String.format(\"%6s \", courseIndex.getIndex()));\n System.out.print(String.format(\"%3d \", courseIndex.getSlot()));\n int i = 0;\n for (CourseCompo courseCompo : courseIndex.getCourseCompos()){\n if(i==0){\n System.out.print(String.format(\"%3s \", courseCompo.getCompoType()));\n System.out.print(String.format(\"%3s \", courseCompo.getDay()));\n System.out.println(String.format(\"%3s \", courseCompo.getTimeSlot()));\n }\n else{\n System.out.print(String.format(\" %3s \", courseCompo.getCompoType()));\n System.out.print(String.format(\"%3s \", courseCompo.getDay()));\n System.out.println(String.format(\"%3s \", courseCompo.getTimeSlot()));\n }\n i++;\n }\n j++;\n System.out.println(\"\");\n }\n }\n\n System.out.println(\"--------------------------------------------------------------------------------------\\n\");\n }", "@Override\r\n\tpublic List<String> queryAll() {\n\t\tList<String> list = homePageDao.queryAll();\r\n\t\treturn list;\r\n\t}", "@PostMapping(\"/tlb-trade/getAll\")\n @Timed\n public ResponseEntity<ResponseResult> getAll() {\n log.debug(\"REST request to get a page of TlbTrades\");\n List<TlbTradeDTO> tlbTradeDTOList = tlbTradeService.findAll();\n ResponseResult json = new ResponseResult();\n json.setData(tlbTradeDTOList);\n json.setStatusCode(ResponseResult.SUCCESS_CODE);\n return new ResponseEntity<>(json, HttpStatus.OK);\n }", "List<TParklotstatusFile> selectAll();", "@Override\r\n\tpublic List<shopPet> getAll() {\n\t\treturn dao.getAll();\r\n\t}", "@Override\r\n\tpublic List<Spot> queryAllSpot() {\n\t\treturn spotRepository.queryAllSpot();\r\n\t}", "private void printAll() {\n int numberToPrint = searchResultsTable.getItems().size();\n\n FXMLCustomerController printController = new FXMLCustomerController();\n printController = (FXMLCustomerController) printController.load();\n printController.setUpPrint(numberToPrint);\n\n if (printController.okToPrint()) {\n System.out.println(\"Printing\");\n printController.getStage().show();\n for (SearchRowItem eachItem : searchResultsTable.getItems()) {\n printController.setCustomerDetails(eachItem);\n printController.print();\n System.out.println(\"Printed : \" + eachItem.toString());\n }\n printController.endPrint();\n //printController.getStage().hide();\n }\n }", "private void printViewReport(int reportID){\n\t\ttry {\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tString query = \"select reports.week, reports.total_time, reports.signed, \";\n\t\t\tString q = \"\";\n\t\t\tfor (int i = 0; i<ReportGenerator.act_sub_names.length; i++) {\n\t\t\t\tString valueStr = \"report_times.\" + ReportGenerator.act_sub_names[i];\n\t\t\t\tq += valueStr+\",\";\n\t\t\t}\n\t\t\tfor (int i = 0; i<ReportGenerator.lower_activities.length-1; i++) {\n\t\t\t\tString valueStr = ReportGenerator.lower_activities[i];\n\t\t\t\tq += valueStr+\",\";\n\t\t\t}\n\t\t\tq += ReportGenerator.lower_activities[ReportGenerator.lower_activities.length-1];\n\t\t\tquery += q;\n\t\t\tquery += \", reports.user_group_id, reports.date, users.username, groups.name from reports\";\n\t\t\tString inner = \" inner join report_times on reports.id = report_times.report_id\";\t\t\t\n\t\t\tString inner1 = \" inner join user_group on reports.user_group_id = user_group.id\";\n\t\t\tString inner2 = \" inner join users on user_group.user_id = users.id\";\n\t\t\tString inner3 = \" inner join groups on user_group.group_id = groups.id\";\n\t\t\tString end = \" where reports.id = \" + reportID;\n\t\t\tquery += inner;\n\t\t\tquery += inner1;\n\t\t\tquery += inner2;\n\t\t\tquery += inner3;\n\t\t\tquery += end;\n\t\t\tResultSet rs = stmt.executeQuery(query);\n\t\t\tif(rs.first()){\t\t\t\t\n\t\t\t\tout.println(ReportGenerator.viewReport(rs));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"SQLException: \" + e.getMessage());\n\t\t\tSystem.out.println(\"SQLState: \" + e.getSQLState());\n\t\t\tSystem.out.println(\"VendorError: \" + e.getErrorCode());\n\t\t}\n\t}" ]
[ "0.78104985", "0.6823169", "0.64761144", "0.59811413", "0.5969001", "0.5915256", "0.59043086", "0.5856143", "0.584759", "0.5771593", "0.56997705", "0.56974", "0.5670845", "0.56701225", "0.56266755", "0.56029576", "0.5510244", "0.5501344", "0.5498585", "0.54932606", "0.54189074", "0.54165506", "0.54163617", "0.5411086", "0.5397917", "0.5384275", "0.5345108", "0.5332024", "0.5325856", "0.5325527", "0.5310131", "0.53016007", "0.53016007", "0.5293315", "0.5275189", "0.52665126", "0.5262439", "0.52430016", "0.52389157", "0.52150416", "0.521271", "0.5212358", "0.5187458", "0.5185335", "0.51799494", "0.51698625", "0.5155385", "0.5152087", "0.51453793", "0.5144047", "0.51295996", "0.51289195", "0.5125014", "0.5116354", "0.5113809", "0.51129174", "0.509588", "0.5088394", "0.5086761", "0.5066266", "0.50566334", "0.5044625", "0.5043752", "0.5036206", "0.50304914", "0.5026028", "0.50246865", "0.50215214", "0.5011687", "0.50022537", "0.5001316", "0.49988002", "0.49944976", "0.49908733", "0.49908617", "0.49904624", "0.497224", "0.49703044", "0.49665183", "0.49664783", "0.49649268", "0.4960115", "0.4960085", "0.49557877", "0.49521464", "0.49514654", "0.4945274", "0.494471", "0.494269", "0.49404842", "0.4938434", "0.49361542", "0.49342063", "0.49330923", "0.4930923", "0.49287304", "0.49206537", "0.4918377", "0.49060914", "0.49053916" ]
0.8001571
0
multiple get methods to access the ArrayLists individually
public ArrayList<Integer> getPilotID(){ return pilotID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ArrayList<E> getAll();", "public List getList();", "public ArrayList getList() {\n \t\treturn list;\n \t}", "public ArrayList getStudents();", "Object getTolist();", "public abstract List<T> getList();", "public Object get(ListField list, int index) {\nif ( list == _lfBoys ) {\nreturn _listBoys.elementAt(index);\n} else {\nreturn _listGirls.elementAt(index);\n}\n}", "public ArrayList<Book> getListBook();", "protected Object[] getList() {\n return list;\n }", "List<T> obtenerAll();", "protected List getList() {\n/* 88 */ return (List)getCollection();\n/* */ }", "protected abstract List<E> getList();", "ArrayList getAttributes();", "Map getAll();", "public ArrayList <Students> getStudentList ()\n\n {\n\n // Returns studentList when called.\n return studentList;\n\n }", "public abstract List<Object> getAll();", "boolean get(List<T> datas);", "public ArrayList getCourses();", "ArrayList<RecipeObject> getRecipes();", "public interface IFollowTheMoney {\n\n ArrayList<FollowTheMoneyLegislator> getFollowTheMoneyLegislatorData(ArrayList<FollowTheMoneyLegislator> followTheMoneyArrayList);\n void getFollowTheMoneyLegislatorByLegID(ArrayList<FollowTheMoneyLegislator> followTheMoneyArrayList, String followTheMoneyID);\n void getFollowTheMoneyLegislatorByLastName(ArrayList<FollowTheMoneyLegislator> followTheMoneyArrayList, String lastName);\n\n\n\n}", "private List getList() {\n if(itemsList == null) {\n itemsList = new ArrayList<>();\n }\n return itemsList;\n }", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "ArrayList<IItem> getItems(Position position);", "List<?> getList();", "abstract ArrayList<User> getAllUsers();", "public abstract ArrayList<? extends Domain> read();", "public List getList() throws HibException;", "public ArrayList<String> readItem();", "List<Student> getStudent();", "List<T> getResults();", "public abstract List get(List oids) throws OIDDoesNotExistException;", "public ArrayList getCartas();", "public ArrayList<User> getArrayList(){\n return userlist;\n }", "public List<T> read(int numbersToRetrieve)\r\n {\r\n// final String methodName = \"read\";\r\n List<T> list = null;\r\n\r\n if (_cache.isEmpty())\r\n {\r\n// Advisory advisory = new Advisory();\r\n//\r\n// advisory.setPackageName (ConstantsPackages.CACHE);\r\n// advisory.setMethodName (_className + \"::\" + methodName);\r\n// advisory.setStatus (Status.STATUS_CACHE_INVALID);\r\n//\r\n// AdvisoryLog.log (advisory);\r\n }\r\n\r\n else\r\n {\r\n int elementIndex = 0;\r\n int pageIndex = 0;\r\n\r\n list = new ArrayList<T>();\r\n\r\n while((list.size() < numbersToRetrieve)&&(!_cache.isEmpty()))\r\n {\r\n List<T> workList;\r\n \r\n synchronized(_cache)\r\n {\r\n workList = _cache.get (pageIndex);\r\n }\r\n \r\n int numbersRemaining = numbersToRetrieve - list.size();\r\n\r\n // Can current cache be used to retrieve all data?\r\n if (numbersRemaining < workList.size())\r\n {\r\n for (int index = 0; index < numbersRemaining; index++)\r\n {\r\n list.add (workList.remove (elementIndex));\r\n }\r\n }\r\n\r\n // Data must be retrieved from multiple pages of cache.\r\n else\r\n {\r\n // Retrieve available data from current page of cache.\r\n int available = workList.size();\r\n\r\n for (int index = 0; index < available; index++)\r\n {\r\n list.add (workList.remove (elementIndex));\r\n }\r\n \r\n synchronized(_cache)\r\n {\r\n _cache.remove (pageIndex);\r\n }\r\n \r\n // Refill page.\r\n _addPages (1);\r\n }\r\n }\r\n }\r\n\r\n return list;\r\n }", "@Override\n public List<E> get(Long... ids) {\n // TODO Auto-generated method stub\n return null;\n }", "private ArrayList<ImageItem> getData() {\n final ArrayList<ImageItem> imageItems = new ArrayList<>();\n // TypedArray imgs = getResources().obtainTypedArray(R.array.image_ids);\n for (int i = 0; i < f.size(); i++) {\n Bitmap bitmap = imageLoader.loadImageSync(\"file://\" + f.get(i));;\n imageItems.add(new ImageItem(bitmap, \"Image#\" + i));\n }\n return imageItems;\n }", "public List<Item> getItemList();", "private ArrayList<String> getList(int code) {\n\t\tif (!infoList.containsKey(code)) {\n\t\t\tinfoList.put(code, new ArrayList<String>());\n\t\t}\n\t\treturn infoList.get(code);\n\t}", "public List<People> getPeople();", "public List<Product> getProducts();", "public List<Product> getProducts();", "Object get()\n\t{\n\t\tif (length == 0 ) \n\t\t{\t\n\t\t\tthrow new RuntimeException(\"List Error: cannot call get() on empty List\");\n\t\t}\n\t\tif (cursor == null\t) \n\t\t{\n\t\t\tthrow new RuntimeException(\"List Error: cannot call get() on cursor that is off the list\");\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn cursor.data;\n\t\t}\n\t}", "java.util.List<protocol.Data.Friend.FriendItem> \n getFriendList();", "public <T> List<T> get(Class<T> clz) {\n\t\treturn get(clz, null, null, null, null, null, null);\n\t}", "private ArrayList<HashMap<String, String>> getList(){\n return alertList;\n }", "public ArrayList getSongs() {\r\n\t\tArrayList songs = new ArrayList(mlitDataFields.size());\r\n\t\tfor (int i = 0; i < mlitDataFields.size(); i++) {\r\n\t\t\tArrayList fps = ((ArrayList) mlitDataFields.get(i));\r\n\t\t\tString name = null;\r\n\t\t\tint id = 0;\r\n\t\t\tDaapSong s = new DaapSong();\r\n\t\t\t\ts.host = host;\r\n\t\t\tfor (int j = 0; j < fps.size(); j++) {\r\n\t\t\t\tFieldPair fp = ((FieldPair) fps.get(j));\r\n\t\t\t\tif (fp.name.equals(\"miid\")) {\r\n\t\t\t\t\ts.id = Request.readInt(fp.value, 0, 4);\r\n\t\t\t\t} else if (fp.name.equals(\"minm\")) {\r\n\t\t\t\t\ts.name = Request.readString(fp.value, 0, fp.value.length).trim();\r\n\t\t\t\t} else if (fp.name.equals(\"mper\")) {\r\n\t\t\t\t s.persistent_id = Request.readString(fp.value, 0, fp.value.length).trim();\r\n\t\t\t\t} else if (fp.name.equals(\"asal\")) {\r\n\t\t\t\t\ts.album = Request.readString(fp.value, 0, fp.value.length).trim();\r\n\t\t\t\t} else if (fp.name.equals(\"asar\")) {\r\n\t\t\t\t\ts.artist = Request.readString(fp.value, 0, fp.value.length).trim();\r\n\t\t\t\t} else if (fp.name.equals(\"astn\")) {\r\n\t\t\t\t\ts.track = Request.readInt(fp.value, 0, 2);\r\n\t\t\t\t} else if (fp.name.equals(\"asgn\")) {\r\n\t\t\t\t\ts.genre = Request.readString(fp.value, 0, fp.value.length);\r\n\t\t\t\t} else if (fp.name.equals(\"asfm\")) {\r\n\t\t\t\t\ts.format = Request.readString(fp.value, 0, fp.value.length);\r\n\t\t\t\t} else if (fp.name.equals(\"astm\")) {\r\n\t\t\t\t\ts.time = Request.readInt(fp.value, 0, 4);\r\n\t\t\t\t} else if (fp.name.equals(\"assz\")) {\r\n\t\t\t\t\ts.size = Request.readInt(fp.value, 0, 4);\r\n\t\t\t\t} else if (fp.name.equals(\"asco\")) {\r\n\t\t\t\t s.compilation = (Request.readInt(fp.value, 0,1) == 1);\r\n\t\t\t\t} else if (fp.name.equals(\"asbr\")) {\r\n\t\t\t\t s.bitrate = Request.readInt(fp.value,0,2);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tsongs.add(s);\r\n\t\t}\r\n\t\treturn songs;\r\n\t}", "private void getItems() {\n getComputers();\n getPrinters();\n }", "ArrayList retrievestudentdata() throws ClassNotFoundException;", "public abstract ArrayList<ProfesorAsignatura> getProfesores();", "private ArrayList<ItemData> GetDataForList(Context context) {\n Log.i(TAG, \"Get kuv list in Offer\");\n\n // get offer list from database\n // ArrayList<EkData> kuvList = EkDatabaseHelper.getCategoryHelper(\n //getApplicationContext()).getKuvList();\n ArrayList<EkData> kuvList = new ArrayList<EkData>();\n //Collections.reverse(kuvList);\n\n // map offer list to list view\n ArrayList<ItemData> arrayList = new ArrayList<ItemData>();\n for (EkData kuv : kuvList) {\n ItemData item = new ItemData(kuv.getMessage(), \"\");\n item.setId(\"\");\n arrayList.add(item);\n }\n\n arrayList.add(new ItemData(\"City\",\"\"));\n arrayList.add(new ItemData(\"District\",\"\"));\n arrayList.add(new ItemData(\"Street\",\"\"));\n\n return arrayList;\n }", "public void getRemoteItems() {\n url = getAllItemsOrderedByCategory;\n params = new HashMap<>();\n params.put(param_securitykey, param_securitykey);\n\n if (ApiHelper.checkInternet(mContext)) {\n mApiHelper.getItems(mIRestApiCallBack, true, url, params);\n } else {\n //Toast.makeText(mContext, mContext.getString(R.string.noInternetConnection), Toast.LENGTH_LONG).show();\n mIRestApiCallBack.onNoInternet();\n CacheApi cacheApi = loadCacheData(url, params);\n mSqliteCallBack.onDBDataObjectLoaded(cacheApi);\n }\n\n }", "private ArrayList<TodoData> getTodos() {\n Intent intent = (Intent) getIntent();\n return (ArrayList<TodoData>) intent.getSerializableExtra(\"todos\");\n }", "private void getCourseList(){\r\n\r\n CourseDAO courseDAO = new CourseDAO(Statistics.this);\r\n List<Course> courseList= courseDAO.readListofCourses();\r\n for(Course course: courseList) {\r\n courses.add(course.getName());\r\n }\r\n\r\n }", "public List getAll() throws FileNotFoundException, IOException;", "private StudentRecord[] getList() {\r\n\t\treturn this.list;\r\n\t}", "public List<Movie> getMovies();", "public List<GeneralItem> getList() {\n return stList;\n }", "public static ArrayList getList() {\r\n return ListeElem;\r\n }", "public ArrayList<Book> getBookList()\r\n {\r\n ArrayList<Book> bookCopy = new ArrayList<Book>();\r\n //Add code here to copy the bookList ArrayList elements into the local variable bookCopy and return bookCopy\r\n //Hint: You will use the 2-arg Book constructor and the getters or you can add a copy constructor to the Book\r\n //Class\r\n for(Book book: bookList){\r\n Book bk = new Book(book.getTitle(), book.getPrice());\r\n bookCopy.add(bk);\r\n }\r\n return bookCopy;\r\n }", "public interface DownloadBooks {\n ArrayList getAvaliableBooks();\n}", "private static void retriveElementInArrayList() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tSystem.out.println(list.get(3));\n\n\t}", "abstract List<T> getReuslt();", "ArrayList<RecipeObject> getRecipes(String recipeName);", "public void loadAllLists(){\n }", "public static void getLista(UsoApi<ArrayList> needResult, String lista)\n {\n final String[] response = new String[1];\n final SyncHttpClient client = new SyncHttpClient();\n client.setTimeout(5000);\n\n\n String api = host + \"/playlist/\" + lista;\n\n client.get(api,\n new TextHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, final String res) {\n response[0] = res;\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, final String res, Throwable t) {\n response[0] = res;\n }\n }\n );\n\n ArrayList<Marcha> marchas = new ArrayList<>();\n\n JsonArray array = new JsonParser().parse(response[0]).getAsJsonArray();\n for(int i=0; i<array.size(); i++) {\n Marcha marcha = new Marcha(array.get(i).getAsJsonObject());\n marchas.add(marcha);\n }\n needResult.result(marchas);\n }", "private void getVehicleList() {\n mApiCall.getVehicleList();\n }", "public ArrayList<DanhMuc> getListDanhMucCha();", "java.util.List<java.lang.Integer> getItemsList();", "public ArrayList<CarDetail> gettingAllAvailableCars() throws Exception;", "public ArrayList<?> getItems(String filename){\n \n try {\n FileInputStream fis = new FileInputStream(filename);\n ObjectInputStream ois = new ObjectInputStream(fis);\n items = (ArrayList<?>) ois.readObject();\n ois.close();\n \n \n }catch(IOException e){\n System.out.println(e);\n }catch(ClassNotFoundException e){\n System.out.println(e);\n }\n \n return items;\n }", "java.util.List<com.rpg.framework.database.Protocol.Item> \n getItemsList();", "public ArrayList<Collectable> getItems(){\n return items;\n }", "public ArrayList<GeoPlace> getPlaces(){\n return GeoPlaces;\n}", "public List<IContact> getContacts();", "public ArrayList<String> retrieveArrayList(String key) {\n SharedPreferences preferences = getSharedPreferences(\"itemlist\", Context.MODE_PRIVATE);\n\n Gson gson = new Gson();\n String json = preferences.getString(key, null);\n if (json != null) {\n Type type = new TypeToken<ArrayList<String>>() {}.getType();\n return gson.fromJson(json, type);\n } else {\n return new ArrayList<String>();\n }\n }", "public List<Loan> getLoan();", "protected static void get() {\n\t\tstepsTable.get();\n\t\tstepsTable.getWeek();\n\t\tactive.get();\n\t\tmeals.get();\n\t\taccountInfo.get();\n\t\t\n\t}", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }", "public ArrayList<Moto> getMotos()\r\n {\r\n return motos;\r\n }", "TaskList getList();", "private static void getListTest() {\n\t\tList<CartVo> list=new CartDao().getList();\r\n\t\t\r\n\t\tfor(CartVo cartVo : list) {\r\n\t\t\tSystem.out.println(cartVo);\r\n\t\t}\r\n\t}", "public ArrayList getDepartments();", "E[] getAll();", "List getValues();", "private List<EffectInfoModel> m19296a(List<TemplateInfo> list, List<TemplateInfo> list2, Set<Long> set) {\n ArrayList arrayList = new ArrayList();\n int count = this.bOt.getCount();\n if (count == 0) {\n return arrayList;\n }\n for (int i = 0; i < count; i++) {\n EffectInfoModel vh = this.bOt.mo35214vh(i);\n if (vh != null && !vh.isbNeedDownload() && C8451b.m24479up(QTemplateIDUtils.getTemplateSubType(vh.mTemplateId))) {\n TemplateInfo a = m19294a(vh.mTemplateId, (List<TemplateInfo>[]) new List[]{list2, list});\n if (a != null && !a.isRecommendItem()) {\n vh.mThumbUrl = a.strIcon;\n vh.mName = a.strTitle;\n vh.strSceneName = a.strScene;\n }\n if (set.add(Long.valueOf(vh.mTemplateId))) {\n arrayList.add(vh);\n }\n }\n }\n return arrayList;\n }", "public ArrayList getRooms();", "private void getBooks(){\n final ProgressDialog loading = ProgressDialog.show(this,\"Fetching Data\",\"Please wait...\",false,false);\n\n //Creating a rest adapter\n RestAdapter adapter = new RestAdapter.Builder()\n .setEndpoint(ROOT_URL)\n .build();\n\n //Creating an object of our api interface\n BooksAPI api = adapter.create(BooksAPI.class);\n\n //Defining the method\n api.getBooks(new Callback<List<Book>>() {\n @Override\n public void success(List<Book> list, Response response) {\n //Dismissing the loading progressbar\n loading.dismiss();\n Log.e(\"response\", response.getReason());\n //Storing the data in our list\n books = (ArrayList<Book>) list;\n lv.setAdapter(listAdapter);\n //Calling a method to show the list\n //showList();\n }\n\n @Override\n public void failure(RetrofitError error) {\n //you can handle the errors here\n Log.e(\"error\",error.getResponse().getReason());\n }\n });\n }", "public ArrayList<Value> getAll(Batch batch)\n\t{\n\t\treturn null;\n\t}", "java.util.List<online_info>\n getInfoList();", "ArrayList<Episode> getEpisodes(){\n\n\n Uri builtUri = Uri.parse(episodesURL)\n .buildUpon()\n .build();\n String url = builtUri.toString();\n\n return doCallEpisode(url);\n\n }", "private ArrayList<Item> getData() { // generates an array containing 3 Item class objects\n\n // cost\n String[] cost = getResources().getStringArray(R.array.elvCostItems);\n Item i1=new Item(cost[0], new ArrayList<>(Collections.singletonList(cost[5])),false); // Define an Item object call i1\n i1.elements.add(cost[1]); // child elements below\n i1.elements.add(cost[2]);\n i1.elements.add(cost[3]);\n i1.elements.add(cost[4]);\n i1.elements.add(cost[5]);\n i1.elements.add(cost[6]);\n\n // activity or event\n String[] category = getResources().getStringArray(R.array.elvCategoryItems);\n Item i2=new Item(category[0], new ArrayList<>(Arrays.asList(category[1],category[2])),true); // Item.Option is set by the arg1 and default selection is set by arg 2\n i2.elements.add(category[1]);\n i2.elements.add(category[2]);\n\n // city\n String[] location = getResources().getStringArray(R.array.elvLocationItems);\n Item i4=new Item(location[0],new ArrayList<>(Collections.singletonList(location[1])),false);\n i4.elements.add(location[1]);\n\n // distance away\n String[] distance = getResources().getStringArray(R.array.elvDistanceItems);\n Item i5=new Item(distance[0],new ArrayList<>(Collections.singletonList(distance[4])),false);\n i5.elements.add(distance[1]);\n i5.elements.add(distance[2]);\n i5.elements.add(distance[3]);\n i5.elements.add(distance[4]);\n i5.elements.add(distance[5]);\n\n // other - disabled access, indoors, etc\n String[] other = getResources().getStringArray(R.array.elvOtherItems);\n ArrayList<String> temp = new ArrayList<>();\n Item i6=new Item(other[0], temp,true);\n i6.elements.add(other[1]);\n i6.elements.add(other[2]);\n i6.elements.add(other[3]);\n i6.elements.add(other[4]);\n i6.elements.add(other[5]);\n i6.elements.add(other[6]);\n\n // add items to the elv\n ArrayList<Item> allItems=new ArrayList<>(); // append all Item objects into an ArrayList\n allItems.add(i1);\n allItems.add(i2);\n allItems.add(i4);\n allItems.add(i5);\n allItems.add(i6);\n\n return allItems;\n }", "List<Goods> getGoodsList();", "@Override\n\tpublic List<User> get() {\n\t\tList<User> result = new ArrayList<>();\n\t\tfor (String key : userlist.keySet()) {\n\t\t\tUser user = userlist.get(key);\n\t\t\tint dni = user.getDni();\n\t\t\tString name = user.getName();\n\t\t\tString secondName = user.getSecondName();\n\t\t\tString username = user.getUser();\n\t\t\tString pass = user.getPass();\n\t\t\tresult.add(new User(dni, name, secondName, username, pass));\n\t\t}\n\t\treturn result;\n\t}", "public ArrayList<TradeRequest> getTradeRequests(){return tradeRequests;}", "public ArrayList<CoffeeShop> returnShops(){\r\n return allShops;\r\n }", "private ArrayList<MovieItem> requestMovieList(int movieType){\n\n //create array list buffer\n ArrayList<MovieItem> movies = new ArrayList<>();\n\n //check if the movie list type needs to be refreshed\n if(mRefreshStaff.needToRefresh(movieType)){\n //need to refresh movie list, make an API call to TheMovieDB API\n mMoviesButler.requestMovies(movieType);\n\n //send toast message to user\n Toast.makeText(mActivityContext, getString(R.string.str_api_call),\n Toast.LENGTH_SHORT).show();\n }\n else{\n //do NOT need to refresh list, check if movie list is in buffer\n movies = mMovieStaff.getMovies(movieType);\n\n //check size of list from buffer\n if (movies.size() == 0) {\n //list is zero, retrieve movie list from database\n mMovieValet.requestMovies(movieType);\n\n //send toast message to user\n Toast.makeText(mActivityContext, getString(R.string.str_retrieve_from_db),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n //return poster items\n return movies;\n\n }", "public ArrayList<Ball> getBalls(){\n return balls;\n }" ]
[ "0.6407092", "0.6296718", "0.62056726", "0.6195927", "0.6175108", "0.615329", "0.6062536", "0.6059419", "0.59828925", "0.5957558", "0.5948418", "0.5945747", "0.59280235", "0.5927191", "0.5909074", "0.58852863", "0.5881122", "0.58768", "0.5871893", "0.5854064", "0.58371294", "0.5823917", "0.5823917", "0.5823917", "0.5823917", "0.5823917", "0.57805806", "0.5767291", "0.5762376", "0.57407206", "0.57297385", "0.57202333", "0.5713273", "0.5711246", "0.5704474", "0.56939876", "0.5691013", "0.56860626", "0.5665524", "0.5660882", "0.56550795", "0.56517386", "0.56495064", "0.56472635", "0.56472635", "0.5647017", "0.5646813", "0.5646442", "0.5645541", "0.5645231", "0.5643369", "0.5622812", "0.5622589", "0.562106", "0.5606326", "0.560608", "0.56054217", "0.5603273", "0.55955774", "0.5587126", "0.5570665", "0.5568653", "0.5568062", "0.5563832", "0.55571735", "0.5553843", "0.5550456", "0.55504304", "0.55461", "0.5542109", "0.5534206", "0.553245", "0.5530373", "0.5528248", "0.5522167", "0.55213886", "0.5521158", "0.5520826", "0.551588", "0.5513672", "0.5511302", "0.55059636", "0.55038", "0.55015916", "0.54973805", "0.5496527", "0.54926735", "0.5487093", "0.5486349", "0.548367", "0.54818225", "0.54802966", "0.5479057", "0.5473835", "0.5470779", "0.54670924", "0.546574", "0.54618686", "0.5458437", "0.5454434", "0.5451581" ]
0.0
-1
appends first and last name into an arrayList
public ArrayList<String> getFullName(){ ArrayList<String> fullName = new ArrayList<>(); for(int i =0; i<firstName.size(); i++) { fullName.add(firstName.get(i) + " " + lastName.get(i)); } return fullName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDetails() {\n\t\tScanner input = new Scanner(System.in);\n\t\t\n//\t\tList<String> list1 = new ArrayList<String>();\n//\t\tlist1.add(\"Jhone\");\n//\t\tlist1.add(\"Jim\");\n\t\t\n//\t\tList<String> list2 = new ArrayList<String>();\n//\t\tlist2.add(\"USA\");\n//\t\tlist2.add(\"CA\");\n\n\t\tSystem.out.println(\"Enter Names : \");\n\t\tString names = input.nextLine();\n\t\tScanner tokenizer = new Scanner(names);\n\t\ttokenizer.useDelimiter(\" \");\n\t\tArrayList<String> arr = new ArrayList<String>();\n\t\twhile (tokenizer.hasNext()) {\n\t\t\tarr.add(tokenizer.next());\n//\t\t\tSystem.out.println(arr.get(arr.size() - 1));\n\t\t}\n\t\tSystem.out.println(arr);\n\t\t\n\t\tSystem.out.println(\"Enter Names : \");\n\t\tString address = input.nextLine();\n\t\tScanner tokenizerAdd = new Scanner(names);\n\t\ttokenizer.useDelimiter(\" \");\n\t\tArrayList<String> arr1 = new ArrayList<String>();\n\t\twhile (tokenizerAdd.hasNext()) {\n\t\t\tarr1.add(tokenizerAdd.next());\n//\t\t\tSystem.out.println(arr.get(arr.size() - 1));\n\t\t}\n\t\tSystem.out.println(arr1);\n\t\t\n\t\t\n\t\t// using addAll( ) method to concatenate the lists\n\t\tList<String> concatenated_list = new ArrayList<String>();\n\t\tconcatenated_list.addAll(arr);\n\t\tconcatenated_list.addAll(arr1);\n\t\tSystem.out.println(\"Name : \" + arr + \" Address : \" + arr1);\n\t}", "public static void main(String[] args) {\n\n ArrayList<Person> addressBook = new ArrayList<>();\n\n\n\n Person individual; //create an object of type Person\n Scanner scan = new Scanner(System.in);\n\n for(int i=1; i <= 5; i++) {\n\n individual = new Person();\n\n\n System.out.println(\"Please enter your first name \");\n individual.setFirstName(scan.nextLine());\n\n\n System.out.println(\"Please enter your last name \");\n individual.setLastName(scan.nextLine());\n\n\n System.out.println(\"Please enter address \");\n individual.setAddress(scan.nextLine());\n\n\n System.out.println(\"Please enter phone \");\n individual.setPhone(scan.nextLine());\n\n System.out.println(\"Enter email \");\n individual.setEmail(scan.nextLine());\n\n addressBook.add(individual); //adding an individual to the arraylist\n\n\n }\n\n for(Person eachPerson: addressBook){\n System.out.println(\"First names are \" + eachPerson.getFirstName() );\n\n }\n }", "public void add(){\n //Declare an ArrayList which contains string objects\n \n ArrayList<Employee> employeesList = new ArrayList<Employee>();\n \n Employee emp = new Employee();\n emp.setName(\"Marc\");\n emp.setSalary_complement(100);\n \n emp.setName(\"Paco\");\n emp.setSalary_complement(120);\n \n emp.setName(\"David\");\n emp.setSalary_complement(400);\n \n emp.setName(\"Albert\");\n emp.setSalary_complement(110);\n \n emp.setName(\"Javi\");\n emp.setSalary_complement(20);\n \n emp.setName(\"Jose\");\n emp.setSalary_complement(170);\n \n emp.setName(\"Raul\");\n emp.setSalary_complement(101);\n \n emp.setName(\"Enric\");\n emp.setSalary_complement(80);\n \n emp.setName(\"Javier\");\n emp.setSalary_complement(10);\n \n emp.setName(\"Daniel\");\n emp.setSalary_complement(120);\n \n \n employeesList.add(emp);\n /* \n ArrayList<String> employeesList = new ArrayList<>();\n employeesList.add(200,\"Marc\") ArrayList<Employee> employeesList = new ArrayList<Employee>();\n ;\n employeesList.add(250,\"Cristian\");\n employeesList.add(100,\"Paco\");\n employeesList.add(400,\"Roberto\");\n */\n }", "public void addToDepartmentFullNameList(String fullName) {\n departmentFullNameList.add(fullName);\n }", "public ArrayList<String[]> getPatientsNameList()\r\n {\r\n\t String lists[]= new String[2];\r\n\t ArrayList<String[]> name = new ArrayList<String[]>();\r\n\t try \r\n\t {\r\n\t\tResultSet rs = stmt.executeQuery( \"SELECT * FROM PATIENTDATA;\" );\r\n\t\tint i =0;\r\n\t\twhile (rs.next())\r\n\t\t{\r\n\t\t\tlists[0] = rs.getString(\"LASTNAME\");\r\n\t\t\tlists[1]=rs.getString(\"FIRSTNAME\");\r\n\t\t\tname.add(lists);\r\n\t\t\tlists = new String[2];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn name;\r\n\t } \r\n\t catch (SQLException e) \r\n\t {\r\n\t\t\r\n\t\te.printStackTrace();\r\n\t }\r\n\t return name;\r\n\t \r\n }", "private void addToArrayList(String getName) {\n\t\tUser newUser = new User(getName);\n\t\tmgUsr.arrList.add(newUser);\n\t\tobs = FXCollections.observableArrayList(mgUsr.arrList);\n\n\t\tsetOnListView();\n\t}", "private void createUserListQual() {\n\t\tuserListAvailQual.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tuserListAvailQual.addElement(String.format(\"%s, %s [%s]\", users.get(i).get_lastname(), users.get(i).get_firstname(), users.get(i).get_username()));\n\t\t}\n\t}", "public static void addContact()\n {\n System.out.println(\"Enter your firstName : \");\n String firstName = sc.nextLine();\n for (int i = 0; i < list.size(); i++)\n {\n if (list.get(i).getFirstName().equalsIgnoreCase(firstName))\n {\n System.out.println(\"Name already exists. Try another name\");\n addPersons();\n break;\n }\n }\n\n System.out.println(\"Enter your lastName : \");\n String lastName = sc.nextLine();\n System.out.println(\"Enter your address : \");\n String address = sc.nextLine();\n System.out.println(\"Enter your city : \");\n String city = sc.nextLine();\n System.out.println(\"Enter your state : \");\n String state = sc.nextLine();\n System.out.println(\"Enter your zipCode : \");\n String zip = sc.nextLine();\n System.out.println(\"Enter your phoneNo : \");\n long phoneNo = sc.nextLong();\n System.out.println(\"Enter your emailId : \");\n String email = sc.nextLine();\n Contact contact = new Contact(firstName, lastName, address, city, state, zip, phoneNo, email);\n list.add(contact);\n }", "@GetMapping(\"/addsomenames\")\r\n public Greeting addsomenames(@RequestParam(value = \"last\", defaultValue = \"World\") String last) {\n Vector<Person> people = new Vector<Person>();\r\n for (String first : firstNames) {\r\n people.add(new Person(first, last));\r\n }\r\n repository.insert(people);\r\n return new Greeting(counter.incrementAndGet(), String.format(template, last));\r\n }", "private void updateUserList() {\n\t\tUser u = jdbc.get_user(lastClickedUser);\n\t\tString s = String.format(\"%s, %s [%s]\", u.get_lastname(), u.get_firstname(), u.get_username());\n\t\tuserList.setElementAt(s, lastClickedIndex);\n\t}", "private void createManagersList(){\n\t\tmanagerList.clear();\n\t\tArrayList<User> users = jdbc.get_Managers();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tmanagerList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t}\n\t}", "private void createAllUsersList(){\n\t\tunassignedUsersList.clear();\n\t\tlistedUsersAvailList.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tunassignedUsersList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t\tlistedUsersAvailList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t}\n\t}", "private static List<String> appendAll(final String[] names, final String toAppend) {\n return new ArrayList<String>() { {\n for (String name : names) { add(name + toAppend); }\n } };\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"[\"+ this.firstName + \" \" + this.lastName +\"]\";\n\t}", "private void createAllUsersList(String s){\n\t\tunassignedUsersList.clear();\n\t\tlistedUsersAddList.clear();\n\t\tArrayList<User> users = jdbc.getUsersWithQual(s);\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tunassignedUsersList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t\tlistedUsersAvailList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t}\n\t}", "public static void addRecords() {\n\t\t\n\t\ttry {\n\t\t\twhile(fileInput.hasNextLine()) {\n\t\t\t\t// get user input to add contact to list. \n\t\t\t\tSystem.out.print(\"\\n\\nEnter contact first name: \");\t\n\t\t\t\tString firstName = input.next();\n\t\t\t\tSystem.out.print(\"\\nEnter contact last name: \");\n\t\t\t\tString lastName = input.next();\n\t\t\t\tSystem.out.print(\"\\nEnter contact phone number: \"); \n\t\t\t\tString phoneNumber = input.next();\n\t\t\t\tSystem.out.print(\"\\nEnter contact email address: \");\n\t\t\t\tString email = input.next();\n\t\t\t\t\n\t\t\t\tString[] contactInfo = { firstName, lastName, phoneNumber, email };\n\t\t\t\t\n\t\t\t\tList<String> newInput = Arrays.asList(contactInfo);\n\t\t\t\tSystem.out.printf(\"Unsorted array elements: %s%n\", list);\n\t\t\t\t\n\t\t\t\tCollections.sort(list); // sort ArrayList\n\t\t\t\tSystem.out.printf(\"Sorted array elements: %s%n\", list);\n\t\t\t\t\n\t\t\t\t// output new record to file.\n\n\t\t}\n\t\tcatch (FormatterClosedException f) {\n\t\t\tSystem.err.println(\"Error writing to file. Terminating.\"); break;\n\t\t}\n\t\tcatch (NoSuchElementException e) {\n\t\t\tSystem.err.println(\"Invalid input. Please try again.\");\n\t\t\tinput.nextLine(); // discard input so user can try again. \n\t\t}\n\t\t\t\n\t\tSystem.out.println(\"Enter another contact? 0 for no, 1 for yes: \");\n\t\tswitch(input.nextInt()) {\n\t\t\tcase 0: moreInput = false; break;\n\t\t\tcase 1: moreInput = true; break;\n\t\t}\n\t\t\t\n\t\t\t\n\t\t} // end while. \n\n\t\tSystem.out.println();\n\t}", "private static void format1(ArrayList<String> l) {\n\t\tArrayList<String> listContents = l;\n\t\tArrayList<Person> personList = new ArrayList<Person>();\n\t\tfor (int i = 0; i < listContents.size(); i++) {\n\t\t\tPerson person = new Person();\n\n\t\t\tperson.setFirstName(listContents.get(i).substring(0, 10).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setLastName(listContents.get(i).substring(10, 27).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setStartDate(listContents.get(i).substring(27, 35).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setAddress(listContents.get(i).substring(35, 45).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setAptNum(listContents.get(i).substring(45, 55).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setCity(listContents.get(i).substring(55, 65).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setState(listContents.get(i).substring(65, 67).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setCountry(listContents.get(i).substring(67, 70).replaceFirst(\"\\\\s++$\", \"\"));\n\t\t\tperson.setZipCode(listContents.get(i).substring(70, 80).replaceFirst(\"\\\\s++$\", \"\"));\n\n\t\t\tpersonList.add(person);\n\t\t}\n\t\tselectSortingOption(personList);\n\t}", "private static void LessonCollections() {\n List<Employee> employeeList = new ArrayList<Employee>();\n\n //Create Employees from Employee objects constructor\n Employee emp1 = new Employee(\"Jordan\", \"Walker\");\n Employee emp2 = new Employee(\"Mark\", \"Tuttle\");\n Employee emp3 = new Employee(\"Wayne\", \"Henderson\");\n\n //Add them to employee list\n employeeList.add(emp1);\n employeeList.add(emp2);\n employeeList.add(emp3);\n\n //Create employee and add to list in one line\n employeeList.add(new Employee(\"Erick\", \"Jensen\"));\n\n //Get info from list\n System.out.println(employeeList.get(3).GetFullName());\n\n //Print all full names from employee list\n for(Employee e : employeeList) {\n System.out.println(e.GetFullName());\n }\n\n }", "public void editStudentList(String lastName){\n for(int i = 0; i<studList.size();i++){\n \n if(lastName.equals(studList.get(i).getLastName())){\n \n System.out.println(\"Student Name: \" + studList.get(i).getFullName() + \", Student Number: \" + studList.get(i).getStuNumber() + \", Student GPA: \" + studList.get(i).getGPA());\n\n Scanner input = new Scanner(System.in);\n String newName = \"\";\n double newGPA;\n\n System.out.print(\"Student name: \");\n newName = input.nextLine();\n\n System.out.print(\"Student GPA: \");\n newGPA = input.nextDouble();\n\n Student temp = new Student(newName, studList.get(i).getStuNumber(), newGPA);\n studList.set(i, temp);\n }\n }\n }", "public List<SickPerson> getSickPersonList(String lastNameSubString) throws SQLException;", "public void addNames() {}", "public void addNames() {}", "@Override\n public final String toString() {\n return firstName + \" \" + lastName;\n\n }", "public static void addContact ( LinkedList contactsList ) { \n\t\tSystem.out.print ( \"\\n\" + \"Enter the contact's first and last name: \" ); // prompt\n\t\tString [ ] firstAndLastName = CheckInput.getString( ).split( \" \" ); // split the name into first and last\n\t\tString firstName = firstAndLastName [ 0 ]; // assign\n\t\tString lastName = firstAndLastName [ 1 ];\n\t\tSystem.out.print ( \"Enter the contact's phone number: \" );\n\t\tString phoneNumber = CheckInput.getString ( );\n\t\tSystem.out.print ( \"Enter the contact's address: \" );\n\t\tString address = CheckInput.getString ( );\n\t\tSystem.out.print ( \"Enter the contact's city: \" );\n\t\tString city = CheckInput.getString ( );\n\t\tSystem.out.print ( \"Enter the contact's zip code: \" );\n\t\tString zip = CheckInput.getString( );\n\t\tcontactsList.add ( new Contact ( firstName, lastName, phoneNumber, address, city, zip ) );\n\t\t// adds to the LinkedList a new contact with the user given information\n\t\tSystem.out.print ( \"\\n\" );\n\t}", "public void addContact() {\n Contacts contacts = new Contacts();\n System.out.println(\"Enter first name\");\n contacts.setFirstName(scannerForAddressBook.scannerProvider().nextLine());\n System.out.println(\"Enter last name\");\n contacts.setLastName(scannerForAddressBook.scannerProvider().nextLine());\n System.out.println(\"Enter address\");\n contacts.setAddress(scannerForAddressBook.scannerProvider().nextLine());\n System.out.println(\"Enter city\");\n contacts.setCity(scannerForAddressBook.scannerProvider().nextLine());\n System.out.println(\"Enter state\");\n contacts.setState(scannerForAddressBook.scannerProvider().nextLine());\n System.out.println(\"Enter email\");\n contacts.setEmail(scannerForAddressBook.scannerProvider().nextLine());\n System.out.println(\"Enter zip\");\n contacts.setZip(scannerForAddressBook.scannerProvider().nextInt());\n System.out.println(\"Enter phone number\");\n contacts.setPhoneNumber(scannerForAddressBook.scannerProvider().nextLine());\n contactList.add(contacts);\n }", "private static void format2(String[] l) {\n\t\tString[] listContents = l;\n\t\tArrayList<Person> personList = new ArrayList<Person>();\n\n\t\tfor (int i = 0; i < (listContents.length / 9); i++) {\n\t\t\tPerson person = new Person();\n\n\t\t\tperson.setFirstName(listContents[i * 9]);\n\t\t\tperson.setLastName(listContents[1 + i * 9]);\n\t\t\tperson.setStartDate(listContents[2 + i * 9]);\n\t\t\tperson.setAddress(listContents[3 + i * 9]);\n\t\t\tperson.setAptNum(listContents[4 + i * 9]);\n\t\t\tperson.setCity(listContents[5 + i * 9]);\n\t\t\tperson.setState(listContents[6 + i * 9]);\n\t\t\tperson.setCountry(listContents[7 + i * 9]);\n\t\t\tperson.setZipCode(listContents[8 + i * 9]);\n\n\t\t\tpersonList.add(person);\n\t\t}\n\t\tselectSortingOption(personList);\n\t}", "public static void fillList ( LinkedList contactsList ) {\n\t\ttry { // needed to read in files\n\t\t\tScanner read = new Scanner ( new File ( \"contacts.txt\" ) );\n\t\t\tdo {\n\t\t\t\tString [ ] contactData = read.nextLine ( ).split ( \",\" ); // create an array to have the 0. first name, 1. last name, 2. phone, 3. address, 4. city, 5. zip stored\n\t\t\t\tcontactsList.add ( new Contact ( contactData [ 0 ], contactData [ 1 ], contactData [ 2 ], contactData [ 3 ], contactData [ 4 ], contactData [ 5 ] ) ); \n\t\t\t\t// add the new contact with values to set to to the LinkedList\n\t\t\t} while ( read.hasNextLine ( ) ); // as long as there is another line to read in\n\t\t} catch ( FileNotFoundException fnf ) {\n\t\t\tSystem.out.println ( \"File was not found\" );\n\t\t}\n\t}", "@Override\n public String toString() {\n return firstName + \"\\n\" + lastName + \"\\n\";\n }", "public List <Person> addUser(List <Person> listOfPerson) {\n\t\tdo {\n\t\t\tPerson person = new Person();\n\n\t\t\tSystem.out.println(\"Enter the First Name: \");\n\t\t\tperson.setFname(Utility.inputString());\n\t\t\tSystem.out.println(\"Enter the Last Name: \");\n\t\t\tperson.setLname(Utility.inputString());\n\t\t\tSystem.out.println(\"Enter the Address: \");\n\t\t\tperson.setAddress(Utility.inputString());\n\t\t\tSystem.out.println(\"Enter the City: \");\n\t\t\tperson.setCity(Utility.inputString());\n\t\t\tSystem.out.println(\"Enter the State: \");\n\t\t\tperson.setState(Utility.inputString());\n\t\t\tSystem.out.println(\"Enter the Zip Code: \");\n\t\t\tperson.setZip(Utility.inputInteger());\n\t\t\tSystem.out.println(\"Enter the Phone Number: \");\n\t\t\tperson.setPhn(Utility.inputLong());\n //Adding the details given in person to the listOfPerson\n\t\t\tlistOfPerson.add(person);\n\t\t\tSystem.out.println(\"Person added successfully\");\n\t\t\tSystem.out.println(\"To add more person type true\");\n\t\t\treturn listOfPerson;\n\t\t} while (Utility.inputBoolean());\n\t}", "public static void updateList(Patient p) {\r\n \t\tpatientArray.add(p);\r\n \t\tlistModel.addElement(p.getFirstName());\r\n \t}", "public void add(String fullName, String username, String password, String accType, String email, String salary){\n\t\t\n\t\t// Determine position where new User needs to be added\n\t\tUser marker = new User();\t\t\t\t\t\t\t\t\t/* ====> Create a marker */\n\t\tmarker = this.getHead();\t\t\t\t\t\t\t\t\t/* ====> Set the marker at the beginning of the list */\n\t\t\n\t\t// Check if the list contains only the head\n\t\tif(marker.getNext()!= null){\n\t\tmarker = marker.getNext();\t\t\t\t\t\t\t\t\t/* ====> If not then skip the head */\n\t\t}\n\t\t\n\t\t\n\t\t/*Iterate through the whole list and compare Strings. Move the marker until it reaches the end or until the input\n\t\t * username is greater than the marker's username . */\n\t\twhile((marker.getNext() != null) && (username.compareTo(marker.getUsername())>0)){\n\t\t\t\t\tmarker = marker.getNext();\n\t\t\t\t}\t\t\n\t\t\n\t\t/* When marker finds a user whose username is greater than the input it moves the marker back a position so that the new\n\t\t * user can be appended to that marker */\n\t\tif(marker.getPrev() != null){\n\t\t\t\tif(username.compareTo(marker.getUsername())<0){\n\t\t\t\t\tmarker = marker.getPrev();\n\t\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// Create new user with the method's parameters as properties. Append it to the marker\n\t\tUser newUser = new User(marker.getNext(), marker);\n\t\tnewUser.setFullName(fullName);\n\t\tnewUser.setUsername(username);\n\t\tnewUser.setPassword(password);\n\t\tnewUser.setAccType(accType);\n\t\tnewUser.setEmail(email);\n\t\tnewUser.setSalary(salary);\n\t\t\n\t\t// Set connections to the new User\n\t\tnewUser.getPrev().setNext(newUser);\n\t\tif(newUser.getNext() != null){\n\t\tnewUser.getNext().setPrev(newUser);\n\t\t}\n\n\t}", "public void create() {\n String[] arrays = new String[100];\n ArrayList<String> list1 = new ArrayList(); //Object[10]\n list1.size(); //0\n list1.add(\"Vivek\"); //object[0] = \"Vivek\"\n list1.size(); //1\n list1.get(0);//\"Vivek\"\n\n list1.remove(1);\n\n list1.add(0, \"Vivek\");\n\n\n ArrayList<String> list3 = new ArrayList<String>(list1);\n\n ArrayList<Student> list = new ArrayList<Student>();\n\n\n\n }", "private void addArray(ArrayList<Student> array) {\n\t\t\n\t\tSystem.out.println(\"请输入学号:\");\n\t\tString id = sc.next();\n\t\tSystem.out.println(\"请输入姓名:\");\n\t\tString name = sc.next();\n\t\tSystem.out.println(\"请输入年龄:\");\n\t\tint age = sc.nextInt();\n\t\tSystem.out.println(\"请输入性别:\");\n\t\tString sex = sc.next();\n\t\tSystem.out.println(\"请输入地址:\");\n\t\tString address = sc.next();\t\n\t\tStudent s= new Student(name,age,id,sex,address);\n\t\tarray.add(s);\n\t\tSystem.out.println(\"添加学生成功\");\n\t\t\n\t}", "public void getFirstAndLastName( String name ){//\r\n String nameNew = name.trim();\r\n String[] arr = nameNew.split(\"\\\\s\");\r\n firstName = arr[0];\r\n lastName = arr[1];\r\n }", "public static void fillArrayList(List<String> list1){\n\t\tlist1.add(new String(\"Will\"));\n\t\tlist1.add(new String(\"John\"));\n\t\tlist1.add(new String(\"James\"));\n\t\tlist1.add(new String(\"Frank\"));\n\t\tlist1.add(new String(\"Fred\"));\n\t\tlist1.add(new String(\"Jake\"));\n\t\tlist1.add(new String(\"Winston\"));\n\t\tlist1.add(new String(\"Wally\"));\n\t\tlist1.add(new String(\"Karen\"));\n\t\tlist1.add(new String(\"Mary\"));\n\t\tlist1.add(new String(\"Michelle\"));\n\t\tlist1.add(new String(\"Micheal\"));\n\t\tlist1.add(new String(\"Mick\"));\n\t\tlist1.add(new String(\"Valdez\"));\n\t}", "public static void personTest(){\n ArrayList<Person> people = new ArrayList<>();\n //people[0] = new Person(\"Fer\", \"Mendoza\", true);\n people.add(new Person(\"Fer\", \"Mendoza\", true));\n people.add(new Person(\"Stacy\", \"Malibu\", false));\n people.add(new Person(\"Ana\", \"Morton\", true));\n\n for (Person person : people) {\n System.out.println(\"person.getFullName() = \" + person.getFullName());\n }\n\n }", "@Override\n public String toString() {\n return \"Name: \" + firstName + \"\\n\" + \"Lastname: \" + lastName;\n \n }", "public void populateStreetNames() {\n streetNameField.removeAllItems();\n streetNameField.addItem(\"\");\n for (Street street : bindingService.getStreets()) {\n streetNameField.addItem(street.getName());\n }\n }", "public void addList(String name){\n }", "ArrayList<String> createList(String finalInput);", "public void addContacts(List<Contact> contactList){\n for(Contact contact:contactList){\n addContact(contact);\n }\n }", "public void addUsers(String[] array) {\n\n boolean existingUser = false;\n int newUser;\n ArrayList<Integer> userList;\n\n if(userObservers.containsKey(array[1])) {\n addObserver(userObservers.get(array[1]));\n users.add(array[1]);\n existingUser = false;\n }\n\n if(array.length > 2){\n String[] otherUsers = array[2].split(nameSeparator);\n\n for(int i = 0; i < otherUsers.length; i++) {\n addObserver(userObservers.get(otherUsers[i]));\n users.add(otherUsers[i]);\n }\n }\n }", "public void addContacts() {\r\n\t\tList<String> numberList= new ArrayList<String>();\r\n\t\tList<String> emailList= new ArrayList<String>();\r\n\t\tSystem.out.println(\"enter the contact name \");\r\n\t\tString name = scanner.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"enter the contact address \");\r\n\t\tString address = scanner.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"enter the contact mobile Number \");\r\n\t\tString number = scanner.nextLine();\r\n\t\tnumberList.add(number);\r\n\t\t\r\n//allowing user to add one or more contact numbers\r\n\t\tString choice=null;\r\n\t\tdo {\r\n\t\t\tSystem.out.println(\"Do you want to add more Number?\");\r\n\t\t\tSystem.out.println(\"yes or no?\");\r\n\t\t\tchoice=scanner.nextLine();\r\n\t\t\tif(choice.equalsIgnoreCase(\"yes\")) {\r\n\t\t\t\tSystem.out.println(\"enter the mobile number\");\r\n\t\t\t\tnumber = scanner.nextLine();\r\n\t\t\t\tnumberList.add(number);\r\n\t\t\t}\r\n\t\t}while(choice.equalsIgnoreCase(\"yes\"));\r\n\t\t\r\n\t\tString[] mobileNumber = numberList.toArray(new String[0]);\r\n\t\t\r\n\t\t\r\n\r\n\t\tSystem.out.println(\"choose the profile picture\");\r\n\t\tString imageReference = scanner.nextLine();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"enter your date of birth as yyyy-MM-dd\");\r\n\t\tString strDateOfBirth = scanner.nextLine();\r\n\t\tLocalDate dateOfBirth = LocalDate.parse(strDateOfBirth);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"enter the contact email Id \");\r\n\t\tString email = scanner.nextLine();\r\n\t\temailList.add(email);\r\n\t\t\r\n\t\t\r\n//allowing user to add one or more email ids\r\n\t\tchoice=null;\r\n\t\tdo {\r\n\t\t\tSystem.out.println(\"Do you want to add more email Id?\");\r\n\t\t\tSystem.out.println(\"yes or no?\");\r\n\t\t\tchoice=scanner.nextLine();\r\n\t\t\tif(choice.equalsIgnoreCase(\"yes\")) {\r\n\t\t\t\tSystem.out.println(\"enter the email Id\");\r\n\t\t\t\temail = scanner.nextLine();\r\n\t\t\t\temailList.add(email);\r\n\t\t\t}\r\n\t\t}while(choice.equalsIgnoreCase(\"yes\"));\r\n\t\t\r\n\t\tString emailArray[]= emailList.toArray(new String[0]);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"select the group you want to add the contact to\");\r\n\t\tshowGroups(service);\r\n\t\tint groupId = Integer.parseInt(scanner.nextLine());\r\n\t\t\r\n\t\t//setting up the contact object with the user defined details\r\n\t\tContact contact = new Contact(name, address, mobileNumber, imageReference, dateOfBirth, emailArray, groupId); \r\n\t\t\r\n\t\t//calling the addContact service which in turn calls add method of DAO\r\n\t\tint rowsAdded = service.addContact(contact);\r\n\t\tSystem.out.println(rowsAdded+\" rows added \");\r\n\t}", "private void sortByLastName() { \r\n\t\tfor ( int i = 0; i < size-1; i++) {\r\n\t\t\tint minIndex = i; \r\n\t\t\tfor(int j = i + 1; j < size; j++) {\r\n\t\t\t\tif ( accounts[j].getHolder().getLname().compareTo(accounts[minIndex].getHolder().getLname()) < 0 ) { \r\n\t\t\t\t\tSystem.out.println(accounts[j].getHolder().getLname());\r\n\t\t\t\t\tminIndex = j;\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\tAccount temp = accounts[minIndex];\r\n\t\t\taccounts[minIndex] = accounts[i];\r\n\t\t\taccounts[i] = temp;\r\n\t\t}\r\n\t\treturn;\r\n\t}", "private void createUserList() {\n\t\tif (!userList.isEmpty() && !listUsers.isSelectionEmpty()) {\n\t\t\tlistUsers.clearSelection();\n\t\t}\t\t\n\t\tif (!archivedUserList.isEmpty() && !listArchivedUsers.isSelectionEmpty()) {\n\t\t\tlistArchivedUsers.clearSelection();\n\t\t}\t\t\n\t\tarchivedUserList.clear();\n\t\tuserList.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tif (users.get(i).active()) {\n\t\t\t\tuserList.addElement(String.format(\"%s, %s [%s]\", users.get(i).get_lastname(), users.get(i).get_firstname(), users.get(i).get_username()));\n\t\t\t} else {\n\t\t\t\tarchivedUserList.addElement(String.format(\"%s, %s [%s]\", users.get(i).get_lastname(), users.get(i).get_firstname(), users.get(i).get_username()));\n\t\t\t}\t\t\n\t\t}\n\t}", "public List<String > getNames(){\n List<String> names = new ArrayList<>();\n String fNameQuery = \"SELECT \" + _IDP + \",\" + COL_F_NAME + \",\" + COL_L_NAME + \" FROM \" + TPYTHONISTAS + \" ;\";\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(fNameQuery, null);\n String name;\n if (c.moveToFirst()) {\n do {\n // put together NameID#, period, Lastname, Firstname\n name = c.getString(0) + \". \" + c.getString(2) + \", \" + c.getString(1);\n names.add(name);\n } while (c.moveToNext());\n }\n c.close();\n db.close();\n return names;\n }", "public ArrayList<String> retrieveFullNameList() throws Exception{\r\n\t\tArrayList<String> nameList = new ArrayList<String>();\r\n\t\tHashMap<String, ArrayList<String>> map = MySQLConnector.executeMySQL(\"select\", \"SELECT * FROM `is480-matching`.users inner join `is480-matching`.students on users.id=students.id;\");\r\n\t\tSet<String> keySet = map.keySet();\r\n\t\tIterator<String> iterator = keySet.iterator();\r\n\t\t\r\n\t\twhile (iterator.hasNext()){\r\n\t\t\tString key = iterator.next();\r\n\t\t\tArrayList<String> array = map.get(key);\t\r\n\t\t\tString username \t= array.get(2);\r\n\t\t\t\r\n\t\t\tnameList.add(username);\r\n\t\t}\r\n\t\t\r\n\t\tCollections.sort(nameList, new Comparator<String>() {\r\n\t @Override public int compare(String s1, String s2) {\r\n\t \treturn s1.compareTo(s2);\r\n\t }\r\n\t\t});\r\n\t\t\r\n\t\treturn nameList;\r\n\t}", "public void addTextFieldsAndLabels(){\n this.add(this.firstLabel);\n this.add(firstNameField);\n this.add(this.secondLabel);\n this.add(lastNameField);\n }", "public void addListMembers(String cat, List<String> inputs) {\n addListMembers(cat, inputs.toArray(new String[0]));\n }", "public String getName() {\n return lastname + \", \" + firstname;\n }", "private void sortByLastName() { \n\t\t\n\t\tint numAccounts = size;\n\t\tString firstHolder_lname;\n\t\tString secondHolder_lname;\n\t\t\n\t\tfor (int i = 0; i < numAccounts-1; i++) {\n\t\t\t\n\t\t\t\n\t\t\tint min_idx = i;\n\t\t\t\n\t\t\t\n\t\t\tfor (int j = i+1; j < numAccounts; j++) {\n\t\t\t\t\n\t\t\t\t// Retrieve last name of two that you are comparing\n\t\t\t\tfirstHolder_lname = (accounts[j].getHolder()).get_lname();\n\t\t\t\tsecondHolder_lname = (accounts[min_idx].getHolder()).get_lname();\n\t\t\t\t\n\t\t\t\tif (firstHolder_lname.compareTo(secondHolder_lname) < 0) {\n\t\t\t\t\tmin_idx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tAccount temp = accounts[min_idx];\n\t\t\taccounts[min_idx] = accounts[i];\n\t\t\taccounts[i] = temp;\n\n\t\t\t\n\t\t}\n\t}", "public void obtenerLista(){\n listaInformacion = new ArrayList<>();\n for (int i = 0; i < listaPersonales.size(); i++){\n listaInformacion.add(listaPersonales.get(i).getId() + \" - \" + listaPersonales.get(i).getNombre());\n }\n }", "public List<String> updatePublicationAddAuthor(String firstName, String lastName, String hash) {\n\t\tfinal Post<BibTex> post = getPublicationByResourceHash(hash).get(0);\n\t\tPersonName p = new PersonName();\n\t\tp.setFirstName(firstName);\n\t\tp.setLastName(lastName);\n\t\tList<PersonName> persons = post.getResource().getAuthor();\n\t\tpersons.add(p);\n\t\tpost.getResource().setAuthor(persons);\n\t\t\n\t\treturn logic.updatePosts(Collections.<Post<? extends Resource>>singletonList(post), PostUpdateOperation.UPDATE_ALL);\n\t}", "public RTWLocation append(Object... list);", "void addInputData(List<Profile> profiles) {\n\t\tfinal String METHOD_NAME = \"addInputData\";\n\t\tLOGGER.entering(CLASS_NAME, METHOD_NAME);\n\t\tfinal String inputFilePath = \"input.txt\";\n\t\tFile file = new File(inputFilePath);\n\t\ttry {\n\t\t\tBufferedReader bufferedReader = new BufferedReader(new FileReader(file));\n\t\t\tString currentLine;\n\t\t\twhile((currentLine = bufferedReader.readLine()) != null) {\n\t\t\t\tString[] inputs = currentLine.split(\" \");\n\t\t\t\tProfile tempProfile = new Profile();\n\t\t\t\ttempProfile.setFirstName(inputs[0]);\n\t\t\t\tif(inputs.length > 1) {\n\t\t\t\t\ttempProfile.setLastName(inputs[1]);\n\t\t\t\t}\n\t\t\t\tif(inputs.length > 2) {\n\t\t\t\t\tStringBuilder location = new StringBuilder();\n\t\t\t\t\tfor(int i = 2; i < inputs.length; i++) {\n\t\t\t\t\t\tlocation.append(inputs[i] + \" \");\n\t\t\t\t\t}\n\t\t\t\t\ttempProfile.setLocation(location.toString().trim());\n\t\t\t\t}\n\t\t\t\tprofiles.add(tempProfile);\n\t\t\t}\n\t\t\tbufferedReader.close();\n\t\t} catch (IOException ex) {\n\t\t\tLOGGER.logp(Level.SEVERE, CLASS_NAME, METHOD_NAME, \"Error reading data from input file\" + inputFilePath);\n\t\t}\n\t\tLOGGER.exiting(CLASS_NAME, METHOD_NAME);\n\t}", "public void name(String first, String last) {\r\n String display = first + \" \" + last;\r\n textName.setText(display);\r\n }", "void setList(ArrayList<UserContactInfo> contactDeatailsList);", "public static void editContact() {\n System.out.println(\"Enter first name: \");\n String firstName = sc.nextLine();\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).getFirstName().equalsIgnoreCase(firstName)) {\n list.remove(i);\n addContact();\n } else {\n System.out.println(\"No data found in Address Book\");\n }\n }\n }", "public String getName (){\r\n return firstName + \" \" + lastName;\r\n }", "private void sortByLastName() {\n //selection sort\n for (int i = 0; i < size - 1; i++) {\n int alphaSmallerIndex = i;\n for (int j = i + 1; j < size; j++)\n if (accounts[j].getHolder().getLastNameFirstName().compareTo(accounts[alphaSmallerIndex].getHolder().getLastNameFirstName()) < 0) {\n alphaSmallerIndex = j;\n }\n Account acc = accounts[alphaSmallerIndex];\n accounts[alphaSmallerIndex] = accounts[i];\n accounts[i] = acc;\n }\n }", "public void addFriendList(FriendList list);", "public ArrayList<AddressEntry> find(String startOf_lastName) {\n ArrayList<AddressEntry> filteredList = new ArrayList<>();\n\n for (int i = 0; i < addressEntryList.size(); i++) {\n if (addressEntryList.get(i).getLastName().toLowerCase().startsWith(startOf_lastName.toLowerCase())) {\n filteredList.add(addressEntryList.get(i));\n }\n }\n\n return filteredList;\n }", "public List<Person> createPerson() throws ParseException {\n\t\tList<Person> lespersons = new ArrayList<Person>();\n\t\tint numOfPersons = manager.createQuery(\"Select p From Person p\", Person.class).getResultList().size();\n\n if (numOfPersons == 0) {\n \tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n \tPerson p1 = new Person(\"dupont\", \"paul\", \"[email protected]\", \"M\", \"http://\", simpleDateFormat.parse(\"06/12/1965\"));\n \tPerson p2 = new Person(\"durand\", \"gerard\", \"[email protected]\", \"F\", \"http://\", simpleDateFormat.parse(\"06/04/1965\"));\n \tPerson p3 = new Person(\"Pierre\", \"martin\", \"[email protected]\", \"M\", \"http://\", simpleDateFormat.parse(\"06/08/1965\"));\n \tp1.getListAmis().add(p2);\n \tp2.getListAmis().add(p1);\n \tp2.getListAmis().add(p3);\n manager.persist(p1);\n manager.persist(p2);\n manager.persist(p3);\n lespersons.add(p1);\n lespersons.add(p2);\n lespersons.add(p3);\n }\n return lespersons;\n\t}", "private void addNamesToAutoComplete(List<String> nameCollection)\n\t{\n\t\tArrayAdapter<String> adapter =\n\t\t\t\tnew ArrayAdapter<>(SignupPersonalActivity.this,\n\t\t\t\t\t\tandroid.R.layout.simple_dropdown_item_1line, nameCollection);\n\n\t\tmNameView.setAdapter(adapter);\n\t}", "public static void getAcountsWithlName(String lastName) {\n\t\t\t\n\t\t\taccounts.clear();\n\t\t\t\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND lName =\" + \"'\" + lastName + \"'\";\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsWithlName\");\n\t\t }\n\t\n\t\t}", "public static String[] add(String[] list, String title, boolean prepend) {\n\t\treturn list;\n\t}", "public static void loadArrayList() throws IOException\n\t{\n\t\tString usersXPFile = \"UsersXP.txt\";\n\t\t\n\t\tFile file = new File(usersXPFile);\n\t\t\n\t\tScanner fileReader;\n\t\t\n\t\tif(file.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(file);\n\t\t\twhile(fileReader.hasNext())\n\t\t\t\tuserDetail1.add(userData.addNewuser(fileReader.nextLine().trim()));\n\t\t\tfileReader.close();\n\t\t}\n\t\telse overwriteFile(usersXPFile, \"\");\n\t\t\n\t\t\n\t}", "public String toString() {\n return firstName + \" \" + lastName;\n }", "static String concatName( String firstName , String lastName) {\n\t\treturn firstName + \" \" + lastName; \n\t}", "public void addPerson() {\n\t\tSystem.out.println(\"*****ADD RECORDS*****\");\n\t\tSystem.out.println(\"How many records you want to add?\");\n\t\tint numOfRecods = sc.nextInt();\n\t\tcount = 0;\n\t\tfor (int i = 1; i <= numOfRecods; i++) {\n\t\t\tSystem.out.println(\"Enter the First name\");\n\t\t\tString firstName = sc.next();\n\t\t\tperson.setFirstName(firstName);\n\n\t\t\tSystem.out.println(\"Enter the Last name\");\n\t\t\tString lastName = sc.next();\n\t\t\tperson.setLastName(lastName);\n\n\t\t\tSystem.out.println(\"Enter your Address\");\n\t\t\tString address = sc.next();\n\t\t\tperson.setAddress(address);\n\n\t\t\tSystem.out.println(\"Enter your City\");\n\t\t\tString city = sc.next();\n\t\t\tperson.setCity(city);\n\n\t\t\tSystem.out.println(\"Enter your State\");\n\t\t\tString state = sc.next();\n\t\t\tperson.setState(state);\n\n\t\t\tSystem.out.println(\"Enter your Zip Code\");\n\t\t\tint zipcode = sc.nextInt();\n\t\t\tperson.setZip(zipcode);\n\n\t\t\tSystem.out.println(\"Enter your Phone Number\");\n\t\t\tlong phone = sc.nextLong();\n\t\t\tperson.setPhoneNo(phone);\n\n\t\t\tdetails[count++] = new Person(firstName, lastName, address, city, state, zipcode, phone);\n\t\t\tSystem.out.println(i + \" records added successfully\");\n\t\t}\n\t\tSystem.out.println(\"All records are added successfully\\n\");\n\t}", "private static void addCardsToList(ArrayList<Card> destination , String[] listOfNames , String type)\n {\n for (String name : listOfNames) {\n Card card = new Card(type, name);\n destination.add(card);\n }\n\n }", "public String addAddressList(BufferedReader address);", "public void setPersonnames(List<Personname> personnames) {\r\n\r\n this.personnames = personnames;\r\n\r\n }", "private static void RecommendedUserNames(String first, String last) {\n\t\tString [][] usernames = new String [2][2];\n\t\tint [] RandomNumbers = new int [4];\n\t\tfor (int i=0; i < 4; i++) {\n\t\t\tRandomNumbers[i]=(int)(Math.random()*100);\n\t\t}\n\t\tint k = 0;\n\t\tSystem.out.println(\"Choose a unique username, some of the recommended ones for you are below\");\n\t\tfor (int i = 0; i < 2; i++)\n\t\t\tfor (int j = 0; j < 2; j++) {\n\t\t\t\tif (k%2==0) usernames[i][j] = first+last+RandomNumbers[k];\n\t\t\t\telse usernames[i][j] = last+first+RandomNumbers[k];\n\t\t\t\tk++;\n\t\t\t\tSystem.out.println(usernames[i][j]+ \" \");\n\t\t\t}\n\t\tSystem.out.println();\n\t}", "private void addFriendList(People value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureFriendListIsMutable();\n friendList_.add(value);\n }", "public List<Person> createPersonListUsingNew() {\n return names.stream()\n // .parallel()\n .map(Person::new)\n .collect(LinkedList::new, // Supplier<LinkedList>\n LinkedList::add, // BiConsumer<LinkedList,Person>\n LinkedList::addAll); // BiConsumer<LinkedList,LinkedList>\n }", "private void updateForename() {\n String mySurname = this.surnameCombo.getSelectedItem().toString();\n //Clear the forename combo\n this.forenameCombo.removeAllItems();\n //Get the list of people\n List<String> forenames = pers.getForenamesforSurname(mySurname);\n for (String str : forenames) {\n this.forenameCombo.addItem(str);\n }\n this.updateText();\n }", "@Override\n public String getFullName() {\n return firstName + \" \" + lastName;\n }", "public WriteToFile(List<Person> peopleList){\r\n\r\n try {\r\n // write over existing file if exists or create new\r\n FileWriter myWriter = new FileWriter(\"sorted-names-list.txt\", false);\r\n for (Person person: peopleList){\r\n // Get person name in order to append to text file\r\n String wholeName = person.getFirstName() + \" \" + person.getLastName();\r\n System.out.println(wholeName);\r\n myWriter.write(wholeName);\r\n myWriter.write(\"\\n\");\r\n }\r\n myWriter.close();\r\n System.out.println(\"Successfully wrote to the file.\");\r\n } catch (IOException e) {\r\n System.out.println(\"An error occurred.\");\r\n e.printStackTrace();\r\n }\r\n\r\n\r\n }", "private void addApartmentNames() {\n apartmentNamesAdapter.clear();\n for (ApartmentNamesInUnivs university : apartmentNamesInUnivs) {\n\n if (university.getUniversityName().equals(universityNamesSpinner.getSelectedItem().toString())) {\n\n for (ApartmentNamesWithType aptName : university.getApartmentNames()) {\n\n if (aptName.getApartmentType().equals(UrlGenerator.getApartmentTypeCodeMap().get(apartmentTypeSpinner.getSelectedItem().toString())))\n\n apartmentNamesAdapter.add(aptName.getApartmentName());\n }\n }\n }\n }", "public void addRow(ArrayList<String> stringList) {\n }", "@Override public String toString(){\n\t\treturn String.format(\"%s %s %s\", firstName, middleName, lastName);\n\t}", "private void saveMemberList () {\r\n\t\tStringBuffer\tmembers\t\t= new StringBuffer();\r\n\t\tboolean\t\t\taddSplit\t= false;\r\n\t\t\r\n\t\tfor (String member : this.members) {\r\n\t\t\tif (addSplit)\r\n\t\t\t\tmembers.append(splitMember);\r\n\t\t\tmembers.append(member);\r\n\t\t\taddSplit = true;\r\n\t\t}\r\n\t\t\r\n\t\tstorage.setString(namedStringMembers, members.toString());\r\n\t}", "public void bulkAdd(){\n employees.add(new Employee(23.0, 15000.0, \"Shayan\"));\n employees.add(new Employee(22.0, 60000.0, \"Rishabh\"));\n employees.add(new Employee(23.0, 45000.0, \"Ammar\"));\n employees.add(new Employee(25.0, 30000.0, \"Fahad\"));\n employees.add(new Employee(21.0, 50000.0, \"Ankur\"));\n }", "public void list() {\n // Sort by Last Name\n addressEntryList.sort(Comparator.comparing(AddressEntry::getLastName));\n\n // Iterate through AddressEntry and print out the data\n for (int i = 1; i <= addressEntryList.size(); i++) {\n System.out.print(i + \": \");\n System.out.println(addressEntryList.get(i-1).toString());\n }\n }", "public List <Person> sortLastName(List <Person> listOfPerson)\n\t{\n\t\tfor(int i = 0; i < listOfPerson.size(); i++)\n\t\t{\n\t\t\tfor(int j = i+1; j < listOfPerson.size(); j++)\n\t\t\t{\n\t\t\t\tif(listOfPerson.get(i).getLname().compareTo(listOfPerson.get(j).getLname())>0)\n\t\t\t\t{\n\t\t\t\t\tPerson temp;\n\t\t\t\t\ttemp = listOfPerson.get(i);\n\t\t\t\t\tlistOfPerson.set(i, listOfPerson.get(j));\n\t\t\t\t\tlistOfPerson.set(j, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn listOfPerson;\n\t}", "public void addCustomer(ArrayList<String> customers) {\n System.out.println(\"what is your name?\");\n String userName = System.console().readLine();\n // System.out.println(\"your name is = \" + userName);\n customers.add(userName);\n System.out.println(\"you have \" + (customers.size() - 1) + \" ahead of you\");\n\n }", "public static void main(String[] args) {\n\n\t\tSystem.out.println(\"******student name list****\");\n\t\t// 1. creating arraylist\n\n\t\tList<String> studentNameList = new ArrayList<String>();\n\t\t// before adding elements\n\t\tSystem.out.println(\"isEmpty: \" + studentNameList.isEmpty());\n\t\tSystem.out.println(\"size: \" + studentNameList.size());\n\n\t\t// 2. adding elements: add method returns true\n\t\tstudentNameList.add(\"VIRAT\");\n\t\tstudentNameList.add(\"SACHIN\");\n\t\tstudentNameList.add(\"RAHUL\");\n\t\tstudentNameList.add(\"RAHUL\"); // arraylist can contain duplicate\n\t\t\t\t\t\t\t\t\t\t// elments.\n\n\t\t// 3. getting elements based upon index.\n\n\t\tSystem.out.println(studentNameList.get(0));\n\t\tSystem.out.println(studentNameList.get(1));\n\t\tSystem.out.println(studentNameList.get(2));\n\t\tSystem.out.println(studentNameList.get(3));\n\n\t\t// after adding elements;\n\t\tSystem.out.println(\"isEmpty: \" + studentNameList.isEmpty());\n\t\tSystem.out.println(\"size: \" + studentNameList.size());\n \n\t}", "private void populateFullname() {\n dataBaseHelper = new DataBaseHelper(this);\n List<String> lables = dataBaseHelper.getFN();\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, lables);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n fullname.setAdapter(dataAdapter);\n\n }", "public static void main(String[] args) {\n Person[] staffs = new Person[3];\r\n Staff staff [] = new Staff[3];\r\n //JOptionPane.showMessageDialog(null,s1.toString());\r\n\r\n for(int i=1;i<=staff.length;i++){\r\n\r\n staff[i].setName(JOptionPane.showInputDialog(\"Enter Name: \"));\r\n staff[i].setAddress(JOptionPane.showInputDialog(\"Enter Address: \"));\r\n staff[i].setEmail(JOptionPane.showInputDialog(\"Enter Email: \"));\r\n staff[i].setPhoneNum(JOptionPane.showInputDialog(\"Enter Phone Number: \"));\r\n staff[i].setPps(JOptionPane.showInputDialog(\"Enter PPS: \"));\r\n staff[i].setEmpNum(Integer.parseInt(JOptionPane.showInputDialog(\"Enter Employee Number: \")));\r\n staff[i].setJobTitle(JOptionPane.showInputDialog(\"Enter Job Title: \"));\r\n i++;\r\n\r\n JTextArea area = new JTextArea(\"The full list of friends\\n\");\r\n for (i = 0; i< staffs.length; i++) // reuse the same 'i'\r\n area.append(staffs[i] + \"\\n\"); \r\n }\r\n }", "public void displayUsers(){\n //go through the userName arraylist and add them to the listView\n for(String val:this.userNames){\n this.userListView.getItems().add(val);\n }\n }", "public static ArrayList<String> getNameFromPerson(ArrayList<Person> persons){\n ArrayList<String> nameList = new ArrayList<String>();\n for(Person person : persons){\n nameList.add(person.name);\n }\n return nameList;\n }", "private void listControllerAdd(TextField fNameText, TextField lNameText, TextField phoneText, TextField emailText,\n\t\t\tTableView<Person> table, ObservableList<Person> tableData, Button add)\n\t{\n\t\tadd.setOnAction(e ->\n\t\t{\n\t\t\tString firstName = fNameText.getText();\n\t\t\tString lastName = lNameText.getText();\n\t\t\tString phone = phoneText.getText();\n\t\t\tString email = emailText.getText();\n\n\t\t\tFirstName firstNameObj;\n\t\t\tLastName lastNameObj;\n\t\t\tPhone phoneObj;\n\t\t\tEmail emailObj;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfirstNameObj = new FirstName(firstName);\n\t\t\t\tlastNameObj = new LastName(lastName);\n\t\t\t\tphoneObj = new Phone(phone);\n\t\t\t\temailObj = new Email(email);\n\n\t\t\t\tif (firstNameObj.isValidName(firstName) && lastNameObj.isValidName(lastName)\n\t\t\t\t\t\t&& phoneObj.isValidPhone(phone) && emailObj.isValidEmail(email))\n\t\t\t\t{\n\t\t\t\t\ttableData.add(new Person(firstNameObj, lastNameObj, phoneObj, emailObj));\n\t\t\t\t\tfNameText.clear();\n\t\t\t\t\tlNameText.clear();\n\t\t\t\t\tphoneText.clear();\n\t\t\t\t\temailText.clear();\n\t\t\t\t}\n\t\t\t} catch (BadInput e1)\n\t\t\t{\n\t\t\t\tAlert dialog = new Alert(Alert.AlertType.ERROR);\n\t\t\t\tdialog.setHeaderText(null);\n\t\t\t\tdialog.setContentText(e1.getMessage());\n\t\t\t\tdialog.showAndWait();\n\t\t\t}\n\n\t\t});\n\n\t}", "public ArrayList<String> arrayListFromIngredient(List<IngredientModel> ingredientModelList){\n ArrayList<String> ingredientList = new ArrayList<>();\n\n //Loops through List<IngredientModel>, retrieves ingredient name and adds to ArrayList<String>\n for(int i = 0; i<ingredientModelList.size(); i++){\n String ingredient = ingredientModelList.get(i).getName();\n ingredientList.add(ingredient);\n }\n\n return ingredientList;\n }", "public void addMember()\r\n\t{\r\n\t\tlistOfMembers.add(new Member(\r\n\t\t\t\tgetUserString(\"Enter Member's First Name\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Surname\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Email\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Telephone\"),\r\n\t\t\t\tgetUserInt(\"Enter Member's Number\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Type\")\r\n\t\t\t\t));\r\n\t\t\r\n\t}", "public void addExtraInfo(final ArrayList<PersonInfo> extra) {\n info.addAll(extra);\n hasExtra = true;\n }", "public void fillNameBox(){\n for(UserAccount userAccount : userAccounts) {\n nameBox.addItem(userAccount.getEmail());\n }\n }", "public PersonRecord(){\n\t\tlistNames = new ArrayList<String>();\n\t}", "private void populateList(){\n //Build name list\n this.names = new String[] {\"Guy1\",\"Guy2\",\"Guy3\",\"Guy4\",\"Guy5\",\"Guy6\"};\n //Get adapter\n //ArrayAdapter<String>(Context, Layout to be used, Items to be placed)\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_items, names);\n //Filling the list view\n ListView list = findViewById(R.id.transaction_list);\n list.setAdapter(adapter);\n }", "private void addData() {\n Details d1 = new Details(\"Arpitha\", \"+91-9448907664\", \"25/05/1997\");\n Details d2 = new Details(\"Abhijith\", \"+91-993602342\", \"05/10/1992\");\n details.add(d1);\n details.add(d2);\n }" ]
[ "0.60713106", "0.6064289", "0.5979176", "0.5963248", "0.59397835", "0.5907029", "0.58442277", "0.5827114", "0.57660264", "0.57401323", "0.57287854", "0.57124156", "0.5710012", "0.56376684", "0.56342196", "0.563117", "0.5630216", "0.56263727", "0.55781615", "0.55687314", "0.5557747", "0.5557747", "0.5551587", "0.55358917", "0.5518259", "0.55024576", "0.5490104", "0.54769677", "0.54716915", "0.5451118", "0.5440597", "0.54227096", "0.542171", "0.5421595", "0.540348", "0.53944486", "0.53884774", "0.538847", "0.5357257", "0.53330004", "0.53319526", "0.53224534", "0.53042984", "0.5303582", "0.5298656", "0.5297048", "0.5291163", "0.5290917", "0.52857584", "0.52803355", "0.5272244", "0.52695775", "0.52658165", "0.52586883", "0.52570075", "0.525218", "0.52489597", "0.5235325", "0.52216434", "0.5216425", "0.5213374", "0.5205017", "0.5204527", "0.52034897", "0.5196479", "0.51958245", "0.51922387", "0.51900655", "0.51828253", "0.5175442", "0.51696175", "0.5169153", "0.5152703", "0.5142285", "0.51418686", "0.51281554", "0.511949", "0.51147753", "0.51141256", "0.51105285", "0.5110031", "0.5091789", "0.50910157", "0.5087148", "0.5085571", "0.50839555", "0.5083758", "0.50783426", "0.5064754", "0.5064198", "0.5060772", "0.5057566", "0.50469893", "0.5044327", "0.50440824", "0.50402313", "0.50379074", "0.50373924", "0.50351024", "0.5032123" ]
0.66835713
0
clearAllPilot method to clear all the ArrayLists with pilot information Kelly May 11/11/2020
public void clearAllPilot() { pilotID.clear(); firstName.clear(); lastName.clear(); dob.clear(); employeeNumber.clear(); dateOfHire.clear(); dateLeftCAF.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void reset() {\r\n\t\tpilots.clear();\r\n\t\tcabinCrew.clear();\r\n\r\n\t}", "public void clear(){\r\n MetersList.clear();\r\n }", "void clearAllLists() {\n this.pm10Sensors.clear();\n this.tempSensors.clear();\n this.humidSensors.clear();\n }", "@Override\r\n\tpublic List<Pilot> getAllPilots() {\r\n\t\tList<Pilot> cloned = new ArrayList<>(pilots);\r\n\t\treturn cloned;\r\n\t}", "public void clear() {\n\t\tpointList.clear();\n\t\tySum = 0;\n\t}", "public void clearAllPoints() {\n\t\tpoints.clear();\n\t\tnotifyListeners();\n\t}", "public void clearAll();", "public void clearAll();", "public void clearMap() {\n\t\tfor (int i = 0; i < parkingsArray.size(); i++)\n\t\t\tparkingsArray.valueAt(i).removeMarker();\n\t\tparkingsArray.clear();\n\t\tmap.clear();\n\t}", "public void clearAll() {\n bikeName = \"\";\n bikeDescription = \"\";\n bikePrice = \"\";\n street = \"\";\n zipcode = \"\";\n city = \"\";\n bikeImagePath = null;\n }", "public void clear()\n\t{\n\t\tpairs.clear();\n\t}", "public void clearAllData() {\n atoms.clear();\n connections.clear();\n lines.clear();\n radical = null;\n }", "public void clear() {\r\n GiftList.clear();\r\n names = new LinkedList<>();\r\n totalGifts = 0;\r\n totalCost = 0;\r\n }", "void clearAll();", "void clearAll();", "public void clear(){\r\n BarsList.clear();\r\n }", "public void emptyList() {\n coursesTaken = new ArrayList<CourseTaken>();\r\n }", "static void wipeLocations(){\n\t \tfor (int i= 0; i < places.length; i++){\n\t\t\t\tfor (int j = 0; j < places[i].items.size(); j++)\n\t\t\t\t\tplaces[i].items.clear();\n\t\t\t\tfor (int k = 0; k < places[i].receptacle.size(); k++)\n\t\t\t\t\tplaces[i].receptacle.clear();\n\t \t}\n\t \tContainer.emptyContainer();\n\t }", "public void removeAllPortlet()\r\n {\r\n _portletList.removeAllElements();\r\n }", "void clear() {\n initialize(INITIAL_PIECES, BP);\n }", "public void clear()\n {\n dessertList.clear();\n }", "public void clearVariables()\n {\n if(arrayListPLPDetails!=null) {\n arrayListPLPDetails.clear();\n ProductListPageAdaptorNoView.SingletonInstance().updateData(false);\n }\n }", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "public void clear() {\n \tthis.listShapes.clear();\n }", "public void resetAll() {\r\n for (PropertyChangeListener pcl : pcs.getPropertyChangeListeners()) {\r\n pcs.removePropertyChangeListener(pcl);\r\n }\r\n GameInfo.getInstance().init();\r\n MazeMap.getInstance().init();\r\n addListener(Constants.MAZE, MazeMap.getInstance());\r\n addListener(Constants.GAMEINFO, GameInfo.getInstance());\r\n PacMan pacMan = initPacMan();\r\n initGhosts(pacMan);\r\n }", "protected abstract void clearAll();", "public void emptyTickets() {\r\n tickets.clear();\r\n }", "public void clearPartyList() {\n currentlyProcessingParties.clear();\n }", "@Override\n\tpublic void clearAll() {\n\t\t\n\t}", "public void cleanAll() {\n\t\tfor (VirtualPet p : shelterPets.values()) {\n\t\t\tp.cleanPet();\n\t\t}\n\t}", "public void clear(){\n\n \tlist = new ArrayList();\n\n }", "public void removeAllPlots() {\r\n plots.clear();\r\n repaint();\r\n }", "public void reset(){\n star.clear();\n planet.clear();\n }", "public void clearAll()\n\t{\n\t\t// add code to clear all names from the graphArray \n\t\t// and call repaint() to update the graph\n\t}", "public void emptyArrayList_PriceQTY_ShoppingCard() {\n PriceList.clear();\n QtyList.clear();\n System.out.println(\" Clear Price Array List: \" + PriceList);\n System.out.println(\" Clear Qty History Array List: \" + QtyList);\n }", "private void clearLists(){\r\n\t\tfor(int i=0; i<potentialFriends.length; i++){\r\n\t\t\tpotentialFriends[i] = null;\r\n\t\t}\r\n\t\tfor(int i=0; i<mutualNum.length; i++){\r\n\t\t\tmutualNum[i] = -1;\r\n\t\t}\r\n\t}", "public void removeAll() {\n this.arrayList = null;\n this.arrayList = new ArrayList<>();\n }", "public void emptyBasket() {\n balls.clear();\n }", "public void clearAll()\n {\n textureMap.clear();\n componentMap.clear();\n }", "public void ClearAll()\r\n {\r\n balls.clear();\r\n board.SetMissedBall(0);\r\n }", "public void clear() {\n for (int i = 0; i < size; i++) genericArrayList[i] = null;\n size = 0;\n }", "public void clear()\n {\n m_packageCommunities.clear();\n }", "public void clear() {\n\t\tpoints.clear();\n\t\trepaint();\n\t}", "void clear() {\n\t\tfor (int list = getFirstList(); list != -1;) {\n\t\t\tlist = deleteList(list);\n\t\t}\n\t}", "public void clearAppointments(){\n appointments.clear();\n }", "private void clearAll( )\n {\n for( Vertex v : vertexMap.values( ) )\n v.reset( );\n }", "public void clearAll()\r\n {\r\n if(measurementItems!=null) measurementItems.clear();\r\n itemsQuantity=(measurementItems!=null)?measurementItems.size():0;\r\n }", "private void clear() {\n\t\tremoveAll();\n\t\taddCircle();\n\t}", "public void clear() {\n\t\tlists.clear();\n\t}", "public void clear() {\n this.atoms.clear();\n this.bonds.clear();\n this.finished = false;\n }", "public static void clearTempProdList() {\r\n tempProductList.clear();\r\n }", "public void clearCockpitCrits() {\n for (int i = 0; i < locations(); i++) {\n removeCriticals(i, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, SYSTEM_LIFE_SUPPORT));\n removeCriticals(i, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, SYSTEM_SENSORS));\n removeCriticals(i, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, SYSTEM_COCKPIT));\n }\n }", "public void reset() {\r\n setGiftCardList(new ArrayList());\r\n for (int i = 0; i < getMaxNumGiftCards(); i++) {\r\n addBlankGiftCard(getGiftCardList());\r\n }\r\n \r\n setGiftCardTempList(new ArrayList());\r\n for (int i = 0; i < getMaxNumGiftCards(); i++) {\r\n addBlankGiftCard(getGiftCardTempList());\r\n }\r\n }", "public void clearDEALER() {\r\n\t\t_DEALERList.clear();\r\n\t}", "public void clean() {\n\t\tfor(ComponentConfig comp: components ) {\r\n\t\t\tList<Integer> cleanCalls = new ArrayList<Integer>();\r\n\t\t\tif(comp.getCalls()!=null) {\r\n\t\t\t\tfor(int call:comp.getCalls()) {\r\n\t\t\t\t\tif(hasComp(call)) {\r\n\t\t\t\t\t\tcleanCalls.add(call);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tint[] result = new int[cleanCalls.size()];\r\n\t\t\t\tint i=0;\r\n\t\t\t\tfor(Integer call: cleanCalls) {\r\n\t\t\t\t\tresult[i] = call;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\tcomp.setCalls(result);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// remove duplicate\r\n\t\tList<ComponentConfig> newComponentList = new ArrayList<ComponentConfig>();\r\n\t\tthis.compids.clear();\r\n\t\tfor(ComponentConfig c:components) {\r\n\t\t\tif(!compids.contains(c.getId())) {\r\n\t\t\t\tnewComponentList.add(c);\r\n\t\t\t\tcompids.add(c.getId());\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.components = newComponentList;\r\n\t}", "public static void clearTempPartList() {\r\n\r\n tempPartList.clear();\r\n }", "public void clearPayments(){\n payment.clear();\n tips.clear();\n totalPaid = 0;\n }", "public void clearAll() {\r\n\t\tfor (EnTablero et : listaElementos) et.setTablero( null ); // Anula tablero de todos los elementos previos\r\n\t\tlistaElementos.clear();\r\n\t\tfor (int f=0; f<numFilas; f++) {\r\n\t\t\tfor (int c=0; c<numColumnas; c++) {\r\n\t\t\t\telementosTablero[f][c] = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void clearGameList() {\n gameJList.removeAll();\n }", "public void clear()\r\n {\r\n phoneList = new ArrayList<String>();\r\n }", "public void clearAll() {\n\n\t\t// Removing the graphics from the layer\n\t\trouteLayer.removeAll();\n\t\t// hiddenSegmentsLayer.removeAll();\n\t\tmMapViewHelper.removeAllGraphics();\n\t\tmResults = null;\n\n\t}", "public void clear() throws Exceptions.OsoException {\n loadedNames.clear();\n loadedContent.clear();\n ffiPolar = Ffi.get().polarNew();\n }", "public void limpaPontos() {\n\t\tthis.pontos = new ArrayList<Point>();\n\t}", "protected void clear() {\n\n\t\tthis.myRRList.clear();\n\t}", "public void Reset()\n {\n this.list1.clear();\n }", "public void removeAllPawns(){\n\n for (Map.Entry<Integer, ImageView> entry : actionButtons.entrySet()) {\n Image image = null;\n entry.getValue().setImage(image);\n }\n\n for (Map.Entry<Integer, ImageView> entry : harvestBox.entrySet()) {\n\n Image image = null;\n entry.getValue().setImage(image);\n harvestBoxFreeSlot = 0;\n\n }\n\n for (Map.Entry<Integer, ImageView> entry : productionBox.entrySet()) {\n\n Image image = null;\n entry.getValue().setImage(image);\n productionBoxFreeSlot = 0;\n\n }\n\n for (Map.Entry<Integer, ImageView> entry : gridMap.entrySet()) {\n Image image = null;\n entry.getValue().setImage(image);\n gridFreeSlot = 0;\n }\n }", "public void clear() {\n duplicates.clear();\n }", "private void clear() {\r\n\t\tpstate.clear();\r\n\t\tdisplay.setLegend(\"\");\r\n\t\tship = null;\r\n\t}", "private void clearAll(){\r\n List<FantasyMatch> allMatches = fmatchBean.findAll();\r\n for(FantasyMatch fm : allMatches){\r\n fmatchBean.remove(fm);\r\n }\r\n \r\n List<RosterPlayer> allRps= rpBean.findAll();\r\n for(RosterPlayer rp : allRps){\r\n rpBean.remove(rp);\r\n }\r\n \r\n List<FantasyTeam> allTeams = ftBean.findAll();\r\n for(FantasyTeam ft : allTeams){\r\n ftBean.remove(ft);\r\n }\r\n \r\n List<FantasyLeague> allLeagues = flBean.findAll();\r\n for(FantasyLeague fl : allLeagues){\r\n flBean.remove(fl);\r\n }\r\n \r\n List<FantasyUser> allUsers = fUserBean.findAll();\r\n for(FantasyUser fu : allUsers){\r\n fUserBean.remove(fu);\r\n }\r\n }", "public void clearAllPreferenceData() {\n sharedPreferences.edit().clear().apply();\n }", "public void reset() {\r\n\t\t//begin\r\n\t\tproducerList.clear();\r\n\t\tretailerList.clear();\r\n\t\tBroker.resetLists();\r\n\t\t//end\r\n\t}", "public void reset() {\n\tthis.pinguins = new ArrayList<>();\n\tthis.pinguinCourant = null;\n\tthis.pret = false;\n\tthis.scoreGlacons = 0;\n\tthis.scorePoissons = 0;\n }", "public void clearResults()\n\t{\n\t\tremoveAll();\n\t\tm_PrinterList.setPrinterList(ToolBox.generatePrinterList().getPrinterList());\n\t\tm_PrinterList.clearMatches(m_PrinterList.getPrinterList());\n\t\tdesignComponents();\n\t\taddComponents();\n\t}", "private void clearLists() {\n\t\tobjects = new ArrayList<Entity>();\n\t\tenemies.clear();\n\t\titemList.clear();\n\t}", "public void clearConcertList(){\n concertList.clear();\n }", "public void reset() {\n this.list.clear();\n }", "public void limpiarPuntos() {\n \tpuntos.clear();\n }", "public void clear()\n {\n int llSize = ll.getSize();\n for(int i=0; i<llSize; i++){\n ll.remove(0);\n }\n }", "public void clearLobbies() {\n\t\tlobbies.clear();\n\t}", "private void clearAllAirfields() {\n Nation nation = determineNation();\n\n game.getHumanPlayer().getAirfields()\n .stream()\n .filter(airfield -> airfield.usedByNation(nation))\n .forEach(airfield -> view.clearAirfield(nation, airfield));\n }", "@AfterMethod(description = \"After method: deleting all list\")\n public void clearList()\n {\n HTMLReport htmlReport = new HTMLReport();\n TodoMVCWorkFlow flow = new TodoMVCWorkFlow();\n htmlReport.log(\"STARTING AfterMethod\");\n htmlReport.logINFO(\"Clearing of the rows in the list before new session\");\n flow.deleteAllList();\n }", "public void clear() {\n\t\t//Kill all entities\n\t\tentities.parallelStream().forEach(e -> e.kill());\n\n\t\t//Clear the lists\n\t\tentities.clear();\n\t\tdrawables.clear();\n\t\tcollidables.clear();\n\t}", "public void clear() {\n synchronized (mLock) {\n mNumStartRangingCalls = 0;\n mOverallStatusHistogram.clear();\n mPerPeerTypeInfo[PEER_AP] = new PerPeerTypeInfo();\n mPerPeerTypeInfo[PEER_AWARE] = new PerPeerTypeInfo();\n }\n }", "public void clear() {\n\t\tshowList = new ArrayList<Slide>();\n\t\tsetSlideNumber(-1);\n\t}", "private void clearTemporaryData() {\n\n numbers.stream().forEach(n -> {\n n.setPossibleValues(null);\n n.setUsedValues(null);\n });\n }", "public void removeAll() {\n\t\tsynchronized (mNpcs) {\n\t\t\tmNpcs = Collections.synchronizedList(new ArrayList<Npc>());\n\t\t\tmDemonCount = 0;\n\t\t\tmHumanCount = 0;\n\t\t}\n\t}", "public void clear() {\n\t\tallItems.clear();\n\t\tminimums.clear();\n\t}", "public void resetAll() {\n reset(getAll());\n }", "public void reset() {\n unvisitedPOIs = new LinkedList<>(instance.getPlaceOfInterests());\n unvisitedPOIs.remove(instance.getStartPOI());\n unvisitedPOIs.remove(instance.getEndPOI());\n\n // initially, all the unvisited POIs should be feasible.\n feasiblePOIs = new LinkedList<>(unvisitedPOIs);\n feasiblePOIs.remove(instance.getStartPOI());\n feasiblePOIs.remove(instance.getEndPOI());\n\n tour.reset(instance);\n currDay = 0;\n\n // update features for the feasible POIs\n for (PlaceOfInterest poi : feasiblePOIs)\n updateFeatures(poi);\n }", "public void clear()\r\n {\r\n first = null;\r\n last = null;\r\n count = 0;\r\n }", "public void clear(){\r\n NotesList.clear();\r\n }", "public synchronized void clear()\n\t{\n\t\tthis.mApList.clear();\n\t}", "@Override\r\n public void clear() {\r\n this.roomMap.clear();\r\n this.buildingMap.clear();\r\n this.roomResponsibleOrgMap.clear();\r\n }", "public static void clearData() {\n cutPoints.clear();\n data.delete(0, data.length());\n }", "public void clear() {\n\t\tstringList = null;\n\t}", "public void clearTable() {\n this.lstDaqHware.clear();\n this.mapDevPBar.clear();\n this.mapDevMotion.clear();\n }", "public void clearMoteList()\n {\n swapMotes.removeAllElements();\n }", "void clear() throws PapooseException;", "public void clear() {\n this.first = null;\n this.last = null;\n this.nrOfElements = 0;\n }" ]
[ "0.6892552", "0.6821955", "0.6765913", "0.663909", "0.6606045", "0.6489515", "0.6364951", "0.6364951", "0.63397497", "0.6308922", "0.6297752", "0.6282615", "0.6282282", "0.62819594", "0.62819594", "0.6263264", "0.6263012", "0.6258313", "0.62041694", "0.6201935", "0.61978495", "0.619359", "0.6183492", "0.6183492", "0.6176979", "0.6165022", "0.6160343", "0.6158538", "0.61316425", "0.61279565", "0.61199504", "0.6105471", "0.6075118", "0.6072085", "0.6067331", "0.60456556", "0.603509", "0.60312885", "0.6028763", "0.6019157", "0.60086715", "0.5993936", "0.5985794", "0.5979417", "0.5979246", "0.5968816", "0.5966713", "0.59505165", "0.5934871", "0.5932111", "0.5923489", "0.5919423", "0.5919081", "0.59169716", "0.5899174", "0.5896306", "0.5896214", "0.58871496", "0.58838725", "0.5880491", "0.58797574", "0.5876805", "0.58752966", "0.58595014", "0.5855354", "0.58521605", "0.583261", "0.58279985", "0.58209836", "0.58118576", "0.5810097", "0.5809505", "0.5806787", "0.58013076", "0.58002913", "0.578991", "0.57779396", "0.5773727", "0.5769183", "0.5767645", "0.5759077", "0.5752222", "0.5747696", "0.574678", "0.57281685", "0.57271504", "0.5726073", "0.57232237", "0.5716603", "0.57151115", "0.5712705", "0.5711537", "0.5708559", "0.5706044", "0.5703494", "0.5696379", "0.56939256", "0.56914365", "0.56862515", "0.56788355" ]
0.83434516
0
TODO Autogenerated method stub
@Override public Object getModel() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0.6080555", "0.6076938", "0.6041293", "0.6024541", "0.6019185", "0.5998426", "0.5967487", "0.5967487", "0.5964935", "0.59489644", "0.59404725", "0.5922823", "0.5908894", "0.5903041", "0.5893847", "0.5885641", "0.5883141", "0.586924", "0.5856793", "0.58503157", "0.58464456", "0.5823378", "0.5809384", "0.58089525", "0.58065355", "0.58065355", "0.5800514", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57896614", "0.5789486", "0.5786597", "0.5783299", "0.5783299", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5760369", "0.5758614", "0.5758614", "0.574912", "0.574912", "0.574912", "0.57482654", "0.5732775", "0.5732775", "0.5732775", "0.57207066", "0.57149917", "0.5714821", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57115865", "0.57045746", "0.5699", "0.5696016", "0.5687285", "0.5677473", "0.5673346", "0.56716853", "0.56688815", "0.5661065", "0.5657898", "0.5654782", "0.5654782", "0.5654782", "0.5654563", "0.56536144", "0.5652585", "0.5649566" ]
0.0
-1
TODO Autogenerated method stub
@Override public void setModel(Object o) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
construct a new Atom
public Atom(int givenProtons, int givenNeutrons, int givenElectrons) { protons = givenProtons; neutrons = givenNeutrons; electrons = givenElectrons; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected Atom createXAtom() {\n \t\treturn new Atom();\n \t}", "private void constructAtom(String name, Set<SWRLAtom> antecedent, String value, String operator) throws Exception {\n if (searchOntology(name)) {\n if (ontologyOwlClassVocabulary.containsKey(name)) {\n constructClassAtom(name, antecedent, value, operator);\n } else if (ontologyOWLDataPropertyVocabulary.containsKey(name)) {\n constructOwlDataPropertyAtom(name, antecedent, value, operator);\n } else if (ontologyOWLObjectPropertylVocabulary.containsKey(name)) {\n constructObjectPropertyAtom(name, antecedent, value, operator);\n } else {\n //@todo add more necessary swrl atom types \n }\n } else {\n name = prepareTerm(name);\n constructAtom(name, antecedent, value, operator);\n }\n\n }", "AtomFactory getAtomFactory();", "public Atom(int givenProtons, int givenNeutrons, int givenElectrons) {\r\n\t\tprotons = givenProtons;\r\n\t\tneutrons = givenNeutrons;\r\n\t\telectrons = givenElectrons;\r\n\t}", "public Element marshall()\n {\n Element element = new Element(getQualifiedName(), Namespaces.NS_ATOM);\n if( type != null )\n {\n Attribute typeAttribute = new Attribute(\"type\", type.toString());\n element.addAttribute(typeAttribute);\n }\n \n if( content != null )\n\t {\n\t\t element.appendChild(content);\n\t }\n\t return element;\n }", "public Molecule(Atom root){\n if(root == null)\n throw new IllegalArgumentException(\"Root atom cannot be null\");\n //initialise bonds to a new array\n atoms = new ArrayList<>();\n longestChain = new ArrayList<>();\n this.root = root;\n this.atoms.add(root);\n this.longestChain.add(root);\n }", "public static AtomType CreateAtomType(String Name) {\n\t\tAtomType atomtype = behavFactory.createAtomType();\n\t\tatomtype.setName(Name) ;\n\t\tatomtype.setBehavior(behavFactory.createPetriNet()) ; \n\t\treturn atomtype;\n\t}", "private void constructObjectPropertyAtom(String name, Set<SWRLAtom> antecedent, String value, String operator) {\n\n SWRLVariable var1 = null, var2 = null, var3 = null;\n String classNm, classObject = null;\n OWLObjectProperty o = ontologyOWLObjectPropertylVocabulary.get(name);\n\n classNm = constructObjectSubjectAtom(name, antecedent);\n classObject = constructObjectObjectAtom(name, antecedent);\n var2 = initalizeVariable(classNm, var2);\n var3 = initalizeVariable(classObject, var3);\n antecedent.add(factory.getSWRLObjectPropertyAtom(o, var2, var3));\n\n constructBuiltinAtom(classObject, operator, value, null, antecedent);\n\n }", "public ConceptAtom(IRI iri)\n {\n super(iri);\n this.strVariable = \"\"; \n }", "public final PythonParser.atom_return atom() throws RecognitionException {\n PythonParser.atom_return retval = new PythonParser.atom_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token lb=null;\n Token rb=null;\n Token LPAREN219=null;\n Token RPAREN222=null;\n Token LBRACK223=null;\n Token RBRACK225=null;\n Token LCURLY226=null;\n Token RCURLY228=null;\n Token NAME230=null;\n Token INT231=null;\n Token LONGINT232=null;\n Token FLOAT233=null;\n Token COMPLEX234=null;\n Token S=null;\n List list_S=null;\n PythonParser.yield_expr_return yield_expr220 = null;\n\n PythonParser.testlist_gexp_return testlist_gexp221 = null;\n\n PythonParser.listmaker_return listmaker224 = null;\n\n PythonParser.dictmaker_return dictmaker227 = null;\n\n PythonParser.testlist_return testlist229 = null;\n\n\n PythonTree lb_tree=null;\n PythonTree rb_tree=null;\n PythonTree LPAREN219_tree=null;\n PythonTree RPAREN222_tree=null;\n PythonTree LBRACK223_tree=null;\n PythonTree RBRACK225_tree=null;\n PythonTree LCURLY226_tree=null;\n PythonTree RCURLY228_tree=null;\n PythonTree NAME230_tree=null;\n PythonTree INT231_tree=null;\n PythonTree LONGINT232_tree=null;\n PythonTree FLOAT233_tree=null;\n PythonTree COMPLEX234_tree=null;\n PythonTree S_tree=null;\n RewriteRuleTokenStream stream_RBRACK=new RewriteRuleTokenStream(adaptor,\"token RBRACK\");\n RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,\"token RPAREN\");\n RewriteRuleTokenStream stream_BACKQUOTE=new RewriteRuleTokenStream(adaptor,\"token BACKQUOTE\");\n RewriteRuleTokenStream stream_NAME=new RewriteRuleTokenStream(adaptor,\"token NAME\");\n RewriteRuleTokenStream stream_LBRACK=new RewriteRuleTokenStream(adaptor,\"token LBRACK\");\n RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,\"token RCURLY\");\n RewriteRuleTokenStream stream_LONGINT=new RewriteRuleTokenStream(adaptor,\"token LONGINT\");\n RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,\"token LCURLY\");\n RewriteRuleTokenStream stream_COMPLEX=new RewriteRuleTokenStream(adaptor,\"token COMPLEX\");\n RewriteRuleTokenStream stream_INT=new RewriteRuleTokenStream(adaptor,\"token INT\");\n RewriteRuleTokenStream stream_FLOAT=new RewriteRuleTokenStream(adaptor,\"token FLOAT\");\n RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,\"token LPAREN\");\n RewriteRuleTokenStream stream_STRING=new RewriteRuleTokenStream(adaptor,\"token STRING\");\n RewriteRuleSubtreeStream stream_testlist_gexp=new RewriteRuleSubtreeStream(adaptor,\"rule testlist_gexp\");\n RewriteRuleSubtreeStream stream_dictmaker=new RewriteRuleSubtreeStream(adaptor,\"rule dictmaker\");\n RewriteRuleSubtreeStream stream_yield_expr=new RewriteRuleSubtreeStream(adaptor,\"rule yield_expr\");\n RewriteRuleSubtreeStream stream_listmaker=new RewriteRuleSubtreeStream(adaptor,\"rule listmaker\");\n RewriteRuleSubtreeStream stream_testlist=new RewriteRuleSubtreeStream(adaptor,\"rule testlist\");\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1338:5: ( LPAREN ( yield_expr -> yield_expr | testlist_gexp -> testlist_gexp | -> ^( LPAREN[$LPAREN, new ArrayList<expr>(), $expr::ctype] ) ) RPAREN | LBRACK ( listmaker[$LBRACK] -> listmaker | -> ^( LBRACK[$LBRACK, new ArrayList<expr>(), $expr::ctype] ) ) RBRACK | LCURLY ( dictmaker -> ^( LCURLY[$LCURLY, actions.castExprs($dictmaker.keys),\\n actions.castExprs($dictmaker.values)] ) | -> ^( LCURLY[$LCURLY, new ArrayList<expr>(), new ArrayList<expr>()] ) ) RCURLY | lb= BACKQUOTE testlist[expr_contextType.Load] rb= BACKQUOTE -> ^( BACKQUOTE[$lb, actions.castExpr($testlist.tree)] ) | NAME -> ^( NAME[$NAME, $NAME.text, $expr::ctype] ) | INT -> ^( INT[$INT, actions.makeInt($INT)] ) | LONGINT -> ^( LONGINT[$LONGINT, actions.makeInt($LONGINT)] ) | FLOAT -> ^( FLOAT[$FLOAT, actions.makeFloat($FLOAT)] ) | COMPLEX -> ^( COMPLEX[$COMPLEX, actions.makeComplex($COMPLEX)] ) | (S+= STRING )+ -> ^( STRING[actions.extractStringToken($S), actions.extractStrings($S, encoding)] ) )\n int alt110=10;\n switch ( input.LA(1) ) {\n case LPAREN:\n {\n alt110=1;\n }\n break;\n case LBRACK:\n {\n alt110=2;\n }\n break;\n case LCURLY:\n {\n alt110=3;\n }\n break;\n case BACKQUOTE:\n {\n alt110=4;\n }\n break;\n case NAME:\n {\n alt110=5;\n }\n break;\n case INT:\n {\n alt110=6;\n }\n break;\n case LONGINT:\n {\n alt110=7;\n }\n break;\n case FLOAT:\n {\n alt110=8;\n }\n break;\n case COMPLEX:\n {\n alt110=9;\n }\n break;\n case STRING:\n {\n alt110=10;\n }\n break;\n default:\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 110, 0, input);\n\n throw nvae;\n }\n\n switch (alt110) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1338:7: LPAREN ( yield_expr -> yield_expr | testlist_gexp -> testlist_gexp | -> ^( LPAREN[$LPAREN, new ArrayList<expr>(), $expr::ctype] ) ) RPAREN\n {\n LPAREN219=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_atom5818); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN219);\n\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1339:7: ( yield_expr -> yield_expr | testlist_gexp -> testlist_gexp | -> ^( LPAREN[$LPAREN, new ArrayList<expr>(), $expr::ctype] ) )\n int alt106=3;\n switch ( input.LA(1) ) {\n case YIELD:\n {\n alt106=1;\n }\n break;\n case NAME:\n case LAMBDA:\n case NOT:\n case LPAREN:\n case PLUS:\n case MINUS:\n case TILDE:\n case LBRACK:\n case LCURLY:\n case BACKQUOTE:\n case INT:\n case LONGINT:\n case FLOAT:\n case COMPLEX:\n case STRING:\n {\n alt106=2;\n }\n break;\n case RPAREN:\n {\n alt106=3;\n }\n break;\n default:\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 106, 0, input);\n\n throw nvae;\n }\n\n switch (alt106) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1339:9: yield_expr\n {\n pushFollow(FOLLOW_yield_expr_in_atom5828);\n yield_expr220=yield_expr();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_yield_expr.add(yield_expr220.getTree());\n\n\n // AST REWRITE\n // elements: yield_expr\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1340:6: -> yield_expr\n {\n adaptor.addChild(root_0, stream_yield_expr.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1341:9: testlist_gexp\n {\n pushFollow(FOLLOW_testlist_gexp_in_atom5847);\n testlist_gexp221=testlist_gexp();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_testlist_gexp.add(testlist_gexp221.getTree());\n\n\n // AST REWRITE\n // elements: testlist_gexp\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1342:6: -> testlist_gexp\n {\n adaptor.addChild(root_0, stream_testlist_gexp.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 3 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1344:6: \n {\n\n // AST REWRITE\n // elements: LPAREN\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1344:6: -> ^( LPAREN[$LPAREN, new ArrayList<expr>(), $expr::ctype] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1344:9: ^( LPAREN[$LPAREN, new ArrayList<expr>(), $expr::ctype] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Tuple(LPAREN, LPAREN219, new ArrayList<expr>(), ((expr_scope)expr_stack.peek()).ctype), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n RPAREN222=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_atom5895); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN222);\n\n\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1347:7: LBRACK ( listmaker[$LBRACK] -> listmaker | -> ^( LBRACK[$LBRACK, new ArrayList<expr>(), $expr::ctype] ) ) RBRACK\n {\n LBRACK223=(Token)match(input,LBRACK,FOLLOW_LBRACK_in_atom5903); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_LBRACK.add(LBRACK223);\n\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1348:7: ( listmaker[$LBRACK] -> listmaker | -> ^( LBRACK[$LBRACK, new ArrayList<expr>(), $expr::ctype] ) )\n int alt107=2;\n int LA107_0 = input.LA(1);\n\n if ( (LA107_0==NAME||(LA107_0>=LAMBDA && LA107_0<=NOT)||LA107_0==LPAREN||(LA107_0>=PLUS && LA107_0<=MINUS)||(LA107_0>=TILDE && LA107_0<=LBRACK)||LA107_0==LCURLY||(LA107_0>=BACKQUOTE && LA107_0<=STRING)) ) {\n alt107=1;\n }\n else if ( (LA107_0==RBRACK) ) {\n alt107=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 107, 0, input);\n\n throw nvae;\n }\n switch (alt107) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1348:8: listmaker[$LBRACK]\n {\n pushFollow(FOLLOW_listmaker_in_atom5912);\n listmaker224=listmaker(LBRACK223);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_listmaker.add(listmaker224.getTree());\n\n\n // AST REWRITE\n // elements: listmaker\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1349:6: -> listmaker\n {\n adaptor.addChild(root_0, stream_listmaker.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1351:6: \n {\n\n // AST REWRITE\n // elements: LBRACK\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1351:6: -> ^( LBRACK[$LBRACK, new ArrayList<expr>(), $expr::ctype] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1351:9: ^( LBRACK[$LBRACK, new ArrayList<expr>(), $expr::ctype] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new org.python.antlr.ast.List(LBRACK, LBRACK223, new ArrayList<expr>(), ((expr_scope)expr_stack.peek()).ctype), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n RBRACK225=(Token)match(input,RBRACK,FOLLOW_RBRACK_in_atom5969); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_RBRACK.add(RBRACK225);\n\n\n }\n break;\n case 3 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1354:7: LCURLY ( dictmaker -> ^( LCURLY[$LCURLY, actions.castExprs($dictmaker.keys),\\n actions.castExprs($dictmaker.values)] ) | -> ^( LCURLY[$LCURLY, new ArrayList<expr>(), new ArrayList<expr>()] ) ) RCURLY\n {\n LCURLY226=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_atom5977); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY226);\n\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1355:8: ( dictmaker -> ^( LCURLY[$LCURLY, actions.castExprs($dictmaker.keys),\\n actions.castExprs($dictmaker.values)] ) | -> ^( LCURLY[$LCURLY, new ArrayList<expr>(), new ArrayList<expr>()] ) )\n int alt108=2;\n int LA108_0 = input.LA(1);\n\n if ( (LA108_0==NAME||(LA108_0>=LAMBDA && LA108_0<=NOT)||LA108_0==LPAREN||(LA108_0>=PLUS && LA108_0<=MINUS)||(LA108_0>=TILDE && LA108_0<=LBRACK)||LA108_0==LCURLY||(LA108_0>=BACKQUOTE && LA108_0<=STRING)) ) {\n alt108=1;\n }\n else if ( (LA108_0==RCURLY) ) {\n alt108=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 108, 0, input);\n\n throw nvae;\n }\n switch (alt108) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1355:9: dictmaker\n {\n pushFollow(FOLLOW_dictmaker_in_atom5987);\n dictmaker227=dictmaker();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_dictmaker.add(dictmaker227.getTree());\n\n\n // AST REWRITE\n // elements: LCURLY\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1356:7: -> ^( LCURLY[$LCURLY, actions.castExprs($dictmaker.keys),\\n actions.castExprs($dictmaker.values)] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1356:10: ^( LCURLY[$LCURLY, actions.castExprs($dictmaker.keys),\\n actions.castExprs($dictmaker.values)] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Dict(LCURLY, LCURLY226, actions.castExprs((dictmaker227!=null?dictmaker227.keys:null)), actions.castExprs((dictmaker227!=null?dictmaker227.values:null))), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1359:7: \n {\n\n // AST REWRITE\n // elements: LCURLY\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1359:7: -> ^( LCURLY[$LCURLY, new ArrayList<expr>(), new ArrayList<expr>()] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1359:10: ^( LCURLY[$LCURLY, new ArrayList<expr>(), new ArrayList<expr>()] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Dict(LCURLY, LCURLY226, new ArrayList<expr>(), new ArrayList<expr>()), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n RCURLY228=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_atom6046); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY228);\n\n\n }\n break;\n case 4 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1362:8: lb= BACKQUOTE testlist[expr_contextType.Load] rb= BACKQUOTE\n {\n lb=(Token)match(input,BACKQUOTE,FOLLOW_BACKQUOTE_in_atom6057); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_BACKQUOTE.add(lb);\n\n pushFollow(FOLLOW_testlist_in_atom6059);\n testlist229=testlist(expr_contextType.Load);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_testlist.add(testlist229.getTree());\n rb=(Token)match(input,BACKQUOTE,FOLLOW_BACKQUOTE_in_atom6064); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_BACKQUOTE.add(rb);\n\n\n\n // AST REWRITE\n // elements: BACKQUOTE\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1363:5: -> ^( BACKQUOTE[$lb, actions.castExpr($testlist.tree)] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1363:8: ^( BACKQUOTE[$lb, actions.castExpr($testlist.tree)] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Repr(BACKQUOTE, lb, actions.castExpr((testlist229!=null?((PythonTree)testlist229.tree):null))), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 5 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1364:8: NAME\n {\n NAME230=(Token)match(input,NAME,FOLLOW_NAME_in_atom6087); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_NAME.add(NAME230);\n\n\n\n // AST REWRITE\n // elements: NAME\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1365:5: -> ^( NAME[$NAME, $NAME.text, $expr::ctype] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1365:8: ^( NAME[$NAME, $NAME.text, $expr::ctype] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Name(NAME, NAME230, (NAME230!=null?NAME230.getText():null), ((expr_scope)expr_stack.peek()).ctype), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 6 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1366:8: INT\n {\n INT231=(Token)match(input,INT,FOLLOW_INT_in_atom6110); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_INT.add(INT231);\n\n\n\n // AST REWRITE\n // elements: INT\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1367:5: -> ^( INT[$INT, actions.makeInt($INT)] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1367:8: ^( INT[$INT, actions.makeInt($INT)] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Num(INT, INT231, actions.makeInt(INT231)), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 7 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1368:8: LONGINT\n {\n LONGINT232=(Token)match(input,LONGINT,FOLLOW_LONGINT_in_atom6133); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_LONGINT.add(LONGINT232);\n\n\n\n // AST REWRITE\n // elements: LONGINT\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1369:5: -> ^( LONGINT[$LONGINT, actions.makeInt($LONGINT)] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1369:8: ^( LONGINT[$LONGINT, actions.makeInt($LONGINT)] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Num(LONGINT, LONGINT232, actions.makeInt(LONGINT232)), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 8 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1370:8: FLOAT\n {\n FLOAT233=(Token)match(input,FLOAT,FOLLOW_FLOAT_in_atom6156); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_FLOAT.add(FLOAT233);\n\n\n\n // AST REWRITE\n // elements: FLOAT\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1371:5: -> ^( FLOAT[$FLOAT, actions.makeFloat($FLOAT)] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1371:8: ^( FLOAT[$FLOAT, actions.makeFloat($FLOAT)] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Num(FLOAT, FLOAT233, actions.makeFloat(FLOAT233)), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 9 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1372:8: COMPLEX\n {\n COMPLEX234=(Token)match(input,COMPLEX,FOLLOW_COMPLEX_in_atom6179); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_COMPLEX.add(COMPLEX234);\n\n\n\n // AST REWRITE\n // elements: COMPLEX\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1373:5: -> ^( COMPLEX[$COMPLEX, actions.makeComplex($COMPLEX)] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1373:8: ^( COMPLEX[$COMPLEX, actions.makeComplex($COMPLEX)] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Num(COMPLEX, COMPLEX234, actions.makeComplex(COMPLEX234)), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 10 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1374:8: (S+= STRING )+\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1374:8: (S+= STRING )+\n int cnt109=0;\n loop109:\n do {\n int alt109=2;\n int LA109_0 = input.LA(1);\n\n if ( (LA109_0==STRING) ) {\n alt109=1;\n }\n\n\n switch (alt109) {\n \tcase 1 :\n \t // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1374:9: S+= STRING\n \t {\n \t S=(Token)match(input,STRING,FOLLOW_STRING_in_atom6205); if (state.failed) return retval; \n \t if ( state.backtracking==0 ) stream_STRING.add(S);\n\n \t if (list_S==null) list_S=new ArrayList();\n \t list_S.add(S);\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt109 >= 1 ) break loop109;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(109, input);\n throw eee;\n }\n cnt109++;\n } while (true);\n\n\n\n // AST REWRITE\n // elements: STRING\n // token labels: \n // rule labels: retval\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\n root_0 = (PythonTree)adaptor.nil();\n // 1375:5: -> ^( STRING[actions.extractStringToken($S), actions.extractStrings($S, encoding)] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1375:8: ^( STRING[actions.extractStringToken($S), actions.extractStrings($S, encoding)] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new Str(STRING, actions.extractStringToken(list_S), actions.extractStrings(list_S, encoding)), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "@Test\n public void testAtomString_9() {\n LOGGER.info(\"testAtomString_9\");\n final StringBuilder s = new StringBuilder(\"Hello\");\n AtomString atomString1 = new AtomString(\"Hello\");\n AtomString atomString2 = new AtomString(s);\n assertEquals(atomString1, atomString2);\n final StringBuilder ss = new StringBuilder(atomString1);\n assertEquals(s.toString(), ss.toString());\n }", "private void constructClassAtom(String name, Set<SWRLAtom> antecedent, String value, String operator) {\n SWRLVariable var = null;\n OWLClass c = ontologyOwlClassVocabulary.get(name);\n\n var = initalizeVariable(name, var);\n\n SWRLClassAtom classRule = factory.getSWRLClassAtom(c, var);\n antecedent.add(classRule);\n\n if (!TextUtils.isBlank(value) && !TextUtils.isBlank(operator)) {\n constructBuiltinAtom(name, operator, value, null, antecedent);\n }\n }", "public interface Atom extends Serializable {\n\n /**\n * ID of this atom in the space time data store.\n * Format is optimized per Dimension\n * @return unique ID in this dimenstion\n */\n AtomID ID();\n\n /**\n * Measurement name\n * @return name of the atom\n */\n String name();\n\n /**\n * The particles associated with this time translator data atom.\n * Under the hood particles.size() * name time translator are created\n * Only use particles for data which needs to be queried scalably\n * @return particles of the atomg\n */\n Particles particles();\n\n /**\n * Fields associated with this tagged, measurement's data atom\n * Use particles for meta data which does not need to be queried scalably\n * @return fields of the atom\n */\n Fields fields();\n\n /**\n * Values tuple of (min,max,count,sum,values)\n * @return values of the atom\n */\n Values values();\n\n /**\n * The timestamp of the atom expressed as millisecond epoch\n * @return timestamp of the atom\n */\n Long timestamp();\n\n /**\n * The dimenstion of this Atom\n * @return Time or Space\n */\n Dimension dimension();\n}", "public Manifest() {}", "@Test\n public void testAtomString_8() {\n LOGGER.info(\"testAtomString_8\");\n final CharSequence s = \"Hello\";\n AtomString atomString1 = new AtomString(\"Hello\");\n AtomString atomString2 = new AtomString(s);\n assertEquals(atomString1, atomString2);\n }", "@Override\n\tpublic function initFromString(String s) {\n\t\treturn new Monom(s);\n\t}", "private AtomExpr atomExpr() {\n Expr e = atom(), d = null;\n\n if (lexer.token == Symbol.LEFTBRACKET || lexer.token == Symbol.LEFTPAR) {\n d = details(e);\n }\n\n return new AtomExpr(e, d);\n }", "@Override\n\tpublic Nota buildObject() {\n\t\treturn new Nota(emitente, destinatario, chave, numero, serie, emissao, total, isIncomplete);\n\t}", "public Bond(IAtom[] atoms) {\n this.atoms = new IAtom[atoms.length];\n System.arraycopy(atoms, 0, this.atoms, 0, atoms.length);\n atomCount = this.atoms.length;\n }", "public CMObject newInstance();", "private IAtomContainer makeAtomContainer(IAtom atom, List<IBond> parts) {\n \t\n \tboolean[] atomsDone = new boolean[this.atomsContained];\n \t\n IAtomContainer partContainer = new AtomContainerMetFrag();\n partContainer.addAtom(atom);\n atomsDone[Integer.parseInt(atom.getID())] = true;\n \n for (IBond aBond : parts) {\n for (IAtom bondedAtom : aBond.atoms()) {\n \t//check if the atom is already contained\n \tif(atomsDone[Integer.parseInt(bondedAtom.getID())])\n \t\tcontinue;\n \t\n \tpartContainer.addAtom(bondedAtom);\n \tatomsDone[Integer.parseInt(bondedAtom.getID())] = true;\n }\n partContainer.addBond(aBond);\n }\n return partContainer;\n }", "private Element createManifestEntry (String location, URI format,\n\t\tboolean mainEntry)\n\t{\n\t\tElement element = new Element (\"content\", Utils.omexNs);\n\t\telement.setAttribute (\"location\", location);\n\t\telement.setAttribute (\"format\", format.toString ());\n\t\tif (mainEntry)\n\t\t\telement.setAttribute (\"master\", \"\" + mainEntry);\n\t\treturn element;\n\t}", "Manifest createManifest();", "private void constructOwlDataPropertyAtom(String name, Set<SWRLAtom> antecedent, String value, String operator) {\n SWRLVariable var1 = null, var2;\n String classNm = null;\n\n var1 = initalizeVariable(name, var1);\n OWLDataProperty p = ontologyOWLDataPropertyVocabulary.get(name);\n\n classNm = constructpropertySubjectAtom(name, antecedent);\n\n var2 = factory.getSWRLVariable(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + literalVocabulary.get(classNm)));\n antecedent.add(factory.getSWRLDataPropertyAtom(p, var2, var1));\n Set<OWLDataPropertyRangeAxiom> sgdp = domainOntology.getDataPropertyRangeAxioms(p);\n OWLDataRange r = null;\n for (OWLDataPropertyRangeAxiom a : sgdp) {\n r = a.getRange();\n }\n constructBuiltinAtom(name, operator, value, r.asOWLDatatype(), antecedent);\n\n }", "public AddressBookEntry build() {\n return new AddressBookEntry(this);\n }", "public static Symbol atom(String text)\r\n\t{\r\n\t\tint linepos = line_;\r\n\t\tint charpos = char_;\r\n\t\tint colpos = col_;\r\n\t\tscan(text);\r\n\t\tToken token = new Token(fname, text, linepos, charpos, colpos);\r\n\t\tif (keywords.get(text) != null)\r\n\t\t{\r\n\t\t\tint type = keywords.get(text);\r\n\t\t\treturn new Symbol(type, linepos, colpos, token);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn new Symbol(sym.ATOM, linepos, colpos, token);\r\n\t\t}\r\n\t}", "@Test\n public void testAtomString_7() {\n LOGGER.info(\"testAtomString_7\");\n final String s = \"Hello\";\n final byte[] b = s.getBytes(US_ASCII);\n AtomString atomString1 = new AtomString(b);\n AtomString atomString2 = new AtomString(s);\n assertEquals(atomString1, atomString2);\n }", "public Entry() {\n }", "public Entry()\n {\n this(null, null, true);\n }", "private void constructBuiltinAtom(String name, String operator, String value, OWLDatatype od, Set<SWRLAtom> antecedent) {\n if (!TextUtils.isBlank(value) && !TextUtils.isBlank(operator)) {\n if (od == null) {\n SWRLIArgument ind = factory.getSWRLIndividualArgument(ontologyOWLNamedIndividualVocabulary.get(TextUtil.formatName(value)));\n SWRLIArgument variable = factory.getSWRLIndividualArgument(factory.getOWLNamedIndividual(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + literalVocabulary.get(name))));\n\n switch (operator) {\n case \"equal\": {\n SWRLSameIndividualAtom sameInd = factory.getSWRLSameIndividualAtom(ind, variable);\n antecedent.add(sameInd);\n break;\n }\n case \"notEqual\": {\n SWRLDifferentIndividualsAtom diffInd = factory.getSWRLDifferentIndividualsAtom(ind, variable);\n antecedent.add(diffInd);\n break;\n }\n }\n } else {\n SWRLVariable var2 = factory.getSWRLVariable(IRI.create(manager.getOntologyDocumentIRI(domainOntology) + \"#\" + literalVocabulary.get(name)));\n OWLLiteral lit = factory.getOWLLiteral(value, od);\n SWRLLiteralArgument litArg = factory.getSWRLLiteralArgument(lit);\n List<SWRLDArgument> list = new ArrayList<>();\n list.add(var2);\n list.add(litArg);\n\n switch (operator) {\n case \"equal\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"notEqual\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.NOT_EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"lessThan\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.LESS_THAN.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"lessOrEqual\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.LESS_THAN_OR_EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"greaterThan\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.GREATER_THAN.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n case \"greaterOrEqual\": {\n SWRLBuiltInAtom builtins = factory.getSWRLBuiltInAtom(SWRLBuiltInsVocabulary.GREATER_THAN_OR_EQUAL.getIRI(), list);\n antecedent.add(builtins);\n break;\n }\n }\n }\n }\n }", "private OMElement createElement(String str) throws XMLStreamException {\n InputStream in = new ByteArrayInputStream(str.getBytes());\n return new StAXOMBuilder(in).getDocumentElement();\n }", "@Override\n protected T createInstance() throws Exception {\n return this.isSingleton() ? this.builder().build() : XMLObjectSupport.cloneXMLObject(this.builder().build());\n }", "EM createEM();", "Coordinate createCoordinate();", "public Entry() {\n this(GtkEntry.createEntry());\n }", "protected abstract void construct();", "public Iterable<IAtom> atoms() {\n return new Iterable<IAtom>() {\n \tpublic Iterator<IAtom> iterator() {\n \t\treturn new AtomsIterator();\n \t}\n };\n }", "Object build();", "@Test\n public void testAtomString_6() {\n LOGGER.info(\"testAtomString_6\");\n AtomString actual = null;\n final AtomString expected = null;\n boolean caught = false;\n try {\n actual = new AtomString(expected);\n } catch (final NullPointerException ex) {\n caught = true;\n }\n assertTrue(caught);\n assertEquals(expected, actual);\n }", "public AtomFeed(String feedURL) throws ParserConfigurationException, IOException\r\n\t{\r\n\t\tthis.feedURL = feedURL;\r\n\t\txml = null;\r\n\t\tdocumentbuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();\r\n\t\tif (!refresh()) throw new IOException();\r\n\t}", "public BccManifest() {\n this(DSL.name(\"bcc_manifest\"), null);\n }", "private void addAtom(String newAtomType, IAtom otherConnectingAtom, Order bondOrder, int hydrogenCount)\n {\n //Create the new atom and bond.\n Atom newAtom = new Atom(newAtomType);\n newAtom.setHydrogenCount(hydrogenCount);\n Bond newBond = new Bond(newAtom, otherConnectingAtom, bondOrder);\n \n //Add the new atom and bond to the molecule.\n currentMolecule.addAtom(newAtom);\n currentMolecule.addBond(newBond);\n }", "private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }", "AtomicData createAtomicData();", "public XMLElement(String fullName)\n/* */ {\n/* 101 */ this(fullName, null, null, -1);\n/* */ }", "@Test\n public void testAtomString_5() {\n LOGGER.info(\"testAtomString_5\");\n final AtomString hej = new AtomString(\"Hej\");\n final AtomString actual = new AtomString(hej);\n final AtomString expected = new AtomString(\"Hej\");\n assertEquals(expected, actual);\n }", "public final Statistic newInstance() {\n Statistic s = new Statistic();\n s.myNumMissing = myNumMissing;\n s.firstx = firstx;\n s.max = max;\n s.min = min;\n s.myConfidenceLevel = myConfidenceLevel;\n s.myJsum = myJsum;\n s.myValue = myValue;\n s.setName(getName());\n s.num = num;\n s.sumxx = sumxx;\n s.moments = Arrays.copyOf(moments, moments.length);\n if (getSaveOption()) {\n s.save(getSavedData());\n s.setSaveOption(true);\n }\n return (s);\n }", "public Exchange(int a) {\r\n id = a;\r\n // allexchanges.Insert(new ExchangeNode(this)); //problem here\r\n }", "@Test\n public void testAtomString_2() {\n LOGGER.info(\"testAtomString_2\");\n AtomString atomString1 = new AtomString();\n Atom atom = new AtomString();\n assertEquals(atomString1, atom);\n }", "protected abstract M createNewElement();", "Parse createParse();", "abstract Object build();", "public Bond(IAtom[] atoms, Order order) {\n this.atoms = new IAtom[atoms.length];\n System.arraycopy(atoms, 0, this.atoms, 0, atoms.length);\n atomCount = this.atoms.length;\n this.order = order;\n }", "@Test\n public void testAtomString_1() {\n LOGGER.info(\"testAtomString_1\");\n AtomString atomString1 = new AtomString();\n AtomString atomString2 = new AtomString();\n assertEquals(atomString1, atomString2);\n }", "public @NotNull Address newAddress();", "public static NumberAmount create(){\n NumberAmount NA = new NumberAmount(new AdvancedOperations(Digit.Zero()));\n return NA;\n }", "Object create(String uri) throws IOException, SAXException, ParserConfigurationException;", "public static NewExpression new_(Constructor constructor) { throw Extensions.todo(); }", "private MarketDataRequest generateRequestFromAtom(MarketDataRequestAtom inAtom,\n MarketDataRequest inCompleteRequest)\n {\n return MarketDataRequestBuilder.newRequest().withAssetClass(inCompleteRequest.getAssetClass()).withSymbols(inAtom.getSymbol()).withContent(inAtom.getContent()).withExchange(inAtom.getExchange()).create();\n }", "Assignment createAssignment();", "Assignment createAssignment();", "public Molecule(final String[] rows){\n relMin = null;\n actor = null;\n chkArr = new int[rows.length][rows[0].length()];\n atomInPlace = new boolean[rows.length][rows[0].length()];\n offsetX = 9999;\n offsetY = 9999;\n x0 = 0;\n for(int i = 0; i < rows.length; i++){\n for(int j = 0; j < rows[0].length(); j++){\n if(rows[i].charAt(j) == '.'){\n atomInPlace[i][j] = true;\n chkArr[i][j] = 0;\n }else {\n atomInPlace[i][j] = false;\n chkArr[i][j] = Integer.parseInt(String.valueOf(rows[i].charAt(j)));\n }\n }\n }\n }", "public Position create() {\n\t\tfinal Actor actorLogged = this.actorService.findActorLogged();\n\t\tAssert.notNull(actorLogged);\n\t\tthis.actorService.checkUserLoginCompany(actorLogged);\n\n\t\tPosition result;\n\n\t\tresult = new Position();\n\t\tfinal Collection<Problem> problems = new HashSet<>();\n\t\tfinal Collection<Application> applications = new HashSet<>();\n\n\t\t// R4\n\t\tfinal String ticker = \"\"; //Será generado en el reconstruct\n\n\t\tresult.setTicker(ticker);\n\t\tresult.setProblems(problems);\n\t\tresult.setApplications(applications);\n\t\tresult.setIsFinalMode(false);\n\t\tresult.setIsCancelled(false);\n\n\t\treturn result;\n\t}", "Stone create();", "public Data(IAtomContainer atomContainer) {\n this.atomContainer = atomContainer;\n }", "public StreetAddress() {}", "private Moment() {}", "private Nota criarNota(){\n\n Nota nota = new Nota();\n nota.setTitulo(edtTituloNota.getText().toString());\n nota.setValor(Float.parseFloat(edtNotaAluno.getText().toString()));\n\n return nota;\n }", "public Node(){\n this(9);\n }", "public EmailAddress build(){\n return new EmailAddress(this);\n }", "public Entry create(int compoID,\n\t\t\tint entryID,\n\t\t\tString entryName,\n\t\t\tString entryDesc,\n\t\t\tString entryAuthor) throws CreateException, RemoteException;", "Attribute createAttribute();", "Attribute createAttribute();", "public Address() {}", "public static Address newAddress(final String address) throws AddressException,\r\n\t\tUnsupportedEncodingException\r\n\t{\r\n\t\treturn newAddress(address, null, null);\r\n\t}", "Object create(Element element) throws IOException, SAXException, ParserConfigurationException;", "public static AtomType getCopy(AtomType at) {\n\t\tAtomType copyat = behavFactory.createAtomType();\n\t\tcopyat = (AtomType) EcoreUtil.copy(at);\t\n\t\treturn copyat;\n\t}", "public XMLElement() {\n this(new Properties(), false, true, true);\n }", "public AtomTypeInfo (String params){\n\t\ttry{\n\t\t\tEnumeration data = new StringTokenizer(params);\n\t\t\ttype = (String)data.nextElement();\n\t\t\tsize = Integer.parseInt((String)data.nextElement());\n\t\t\tint red = Integer.parseInt((String)data.nextElement());\n\t\t\tint green = Integer.parseInt((String)data.nextElement());\n\t\t\tint blue = Integer.parseInt((String)data.nextElement());\n\t\t\tcol = new Color(red, green, blue);\n\t\t}\n\t\tcatch (Exception ex){\n\t\t\tSystem.out.println(\"Invalid parameters for atom information: \"+params);\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "Annotation createAnnotation();", "Annotation createAnnotation();", "public abstract Object build();", "public BccManifest(Name alias) {\n this(alias, BCC_MANIFEST);\n }", "public XMLElement(String fullName, String namespace, String systemID, int lineNr)\n/* */ {\n/* 144 */ this.attributes = new Vector();\n/* 145 */ this.children = new Vector(8);\n/* 146 */ this.fullName = fullName;\n/* 147 */ if (namespace == null) {\n/* 148 */ this.name = fullName;\n/* */ } else {\n/* 150 */ int index = fullName.indexOf(':');\n/* 151 */ if (index >= 0) {\n/* 152 */ this.name = fullName.substring(index + 1);\n/* */ } else {\n/* 154 */ this.name = fullName;\n/* */ }\n/* */ }\n/* 157 */ this.namespace = namespace;\n/* 158 */ this.content = null;\n/* 159 */ this.line = lineNr;\n/* 160 */ this.systemID = systemID;\n/* 161 */ this.parent = null;\n/* */ }", "public Contract create(){\n\t\treturn new Contract();\n\t}", "@Override\n public Stanza createFromParcel(Parcel source) {\n return new Stanza(source);\n }", "public static Node constructTree() {\n\n Node node2 = new Node(2, null, null);\n Node node8 = new Node(8, null, null);\n Node node12 = new Node(12, null, null);\n Node node17 = new Node(17, null, null);\n\n Node node6 = new Node(6, node2, node8);\n Node node15 = new Node(15, node12, node17);\n\n //Root Node\n Node node10 = new Node(10, node6, node15);\n\n return node10;\n }", "public Entry(String n)\n {\n name = n;\n }", "public AirObject(String[] things) {\n type = things[1];\n name = things[2];\n x = Integer.valueOf(things[3]);\n y = Integer.valueOf(things[4]);\n z = Integer.valueOf(things[5]);\n xwid = Integer.valueOf(things[6]);\n ywid = Integer.valueOf(things[7]);\n zwid = Integer.valueOf(things[8]);\n lastThings = new String[things.length - 9];\n for (int i = 0; i < things.length - 9; i++) {\n lastThings[i] = things[i + 9];\n }\n }", "TarEntry CreateEntry(String name);", "public BccManifest(String alias) {\n this(DSL.name(alias), BCC_MANIFEST);\n }", "public MetalNode(int date1){\n date = date1;\n }", "@Test\n public void testAtomString_3() {\n LOGGER.info(\"testAtomString_3\");\n AtomString atomString1 = new AtomString(\"Hello\");\n AtomString atomString2 = new AtomString(\"Hello\");\n assertEquals(atomString1, atomString2);\n }", "public Object build();", "TNode createTNode();", "public Entry(String text) {\n this(GtkEntry.createEntry());\n setText(text);\n }", "public static MElement createConcept(String concept) {\n System.out.println(\"Attempting to create Concept from string \" + concept);\n AbstractMFeature2 sf = AbstractMFeature2.getSemanticFeature(concept);\n return getInstance(sf, MFeatureType.CONCEPT);\n }", "Instruction createInstruction();", "XExpr createXExpr();", "public Nodo() {\n\t\tthis(null, null);\n\t}" ]
[ "0.7430135", "0.6195304", "0.6102732", "0.5994514", "0.5942457", "0.5689618", "0.5662915", "0.56356543", "0.5554161", "0.5459157", "0.5437875", "0.53328395", "0.5322808", "0.5273481", "0.5255578", "0.51804143", "0.51780844", "0.5142374", "0.5113681", "0.5082665", "0.5059404", "0.50515753", "0.50451875", "0.5022949", "0.50013256", "0.49871325", "0.4978989", "0.4973572", "0.495209", "0.49402454", "0.49345258", "0.49016377", "0.48922956", "0.48870593", "0.48858985", "0.4874764", "0.4865597", "0.48550725", "0.4853993", "0.4847709", "0.48435184", "0.48286468", "0.48232874", "0.48219988", "0.4814484", "0.47982424", "0.4789836", "0.47747236", "0.4771696", "0.47543135", "0.47484076", "0.4740615", "0.47346124", "0.47144783", "0.47008264", "0.4688503", "0.4684551", "0.4682461", "0.46741596", "0.4669662", "0.4669662", "0.46680313", "0.46661052", "0.46636897", "0.466345", "0.466001", "0.46555543", "0.46542868", "0.46318296", "0.4622302", "0.46209142", "0.4607993", "0.4607993", "0.46052793", "0.46033385", "0.46030644", "0.45994356", "0.45965913", "0.45938835", "0.45896333", "0.45896333", "0.45889443", "0.4578133", "0.45764002", "0.4572723", "0.4572453", "0.45622545", "0.45619625", "0.45610383", "0.45527843", "0.4551696", "0.45490995", "0.45464042", "0.4535555", "0.45331144", "0.45228332", "0.45197544", "0.4517921", "0.4517592", "0.45166272" ]
0.6178724
2
get the atomic mass of this atom
public int getAtomicMass() { return protons+neutrons; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getAtomicMass() {\r\n\t\treturn protons + neutrons;\r\n\t}", "public double getMass() {\n return mass;\n }", "public double getMass() {\n return mass;\n }", "public double getMass()\n\t{\n\t\treturn this.mass;\n\t}", "public float getMass() {\n return mass;\n }", "public double getMass() {\n\t\treturn _mass;\n\t}", "public Double getMass() {\n return mass;\n }", "public static long mass () { return mass;}", "@Basic @Raw\n public double getMass(){\n \treturn this.mass;\n }", "public double getMass();", "public double getmass(int position){\n\t\treturn masses.get(position);\n\t}", "public double molarMass(){\n double c = comp.getCarbon()* PhysicalProperties.MOLARMASS_C;\n double h = comp.getHydrogen()* PhysicalProperties.MOLARMASS_H;\n double o = comp.getOxygen()* PhysicalProperties.MOLARMASS_O;\n double s = comp.getSulfur()* PhysicalProperties.MMOLARMASS_S;\n double n = comp.getNitrogen()* PhysicalProperties.MOLARMASS_N;\n return c + h + o + s + n;\n }", "public float getMass () {\n\t\treturn body.getMass();\n\t}", "public double getMass(double mz) {\n return ((mz * this.getAbsCharge()) - this.getMass());\n }", "public abstract float getMass();", "public float getMass() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 16);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 16);\n\t\t}\n\t}", "public double getMolarMass() {\n /* Checks if molar mass has been calculated or not to ensure the code doesn't\n\t\trun and unnessacary times */\n if (molarMass == -1.0) {\n molarMass = molarMassCalc(chemicalFormula);\n return molarMass;\n }\n // Returns molar mass if previously calculated\n else {\n return molarMass;\n }\n }", "public double getMZ() {\n return iMass;\n }", "public double findMass(String atname) {\n return atomicWeight.get(atname);\n }", "@Override\n public double getMass() {\n return 0;\n }", "public double Mass() {\n return OCCwrapJavaJNI.Units_Dimensions_Mass(swigCPtr, this);\n }", "public double getMass() { return modules.values().stream().mapToDouble(Module::getMass).sum(); }", "public byte getMass_unit() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readByte(__io__address + 9);\n\t\t} else {\n\t\t\treturn __io__block.readByte(__io__address + 9);\n\t\t}\n\t}", "public double getM() {\r\n return m;\r\n }", "public int getAtomicCharge()\n\t{\n\t\treturn protons-electrons;\n\t}", "public double getMontant() {\n\t\treturn montant;\n\t}", "public double getMontant() {\n\t\treturn _montant;\n\t}", "public final int getMM()\n {\n return mm;\n }", "public Vector3 getCenterOfMass() {\n //Does a weighted average of all the centers of mass of the modules\n Vector3 sum = Vector3.zero();\n for(Module module : modules.values())\n sum.addAltering(module.getCenterOfMass().multiply(module.getMass()));\n return sum.multiplyAltering(1.0/modules.values().size());\n }", "public int getMM() {\n\t\treturn MM;\n\t}", "public double mass2() {\n\t\treturn this.m2();\n\t}", "public int getAtomicCharge() {\r\n\t\treturn protons - electrons;\r\n\t}", "public int getMp() \n\t{\n\t\treturn mp;\n\t}", "public double masse () {return this.volume()*this.element.masseVolumique();}", "@Override\r\n\tpublic int getMM() {\n\t\treturn MM;\r\n\t}", "public double getMZ(double neutralmass) {\n return (neutralmass + getMass()) / getAbsCharge();\n }", "public int getNumMP(){\n\t\treturn numMP;\n\t}", "public int getM () {\n\t\treturn M;\n\t}", "private double getFragmentMass(IAtomContainer fragment, double mass)\n {\n \tDouble massFinal = mass;\n \tdouble nlMass = 0.0;\n \tif(fragment.getProperty(\"FragmentMass\") != null && fragment.getProperty(\"FragmentMass\") != \"\")\n \t{\n \t\tif(fragment.getProperty(\"NlMass\") != null && fragment.getProperty(\"NlMass\") != \"\")\n \t\t{\n \t\t\tString[] tempNLMass = fragment.getProperty(\"NlMass\").toString().split(\",\");\n \t\t\tfor (int i = 0; i < tempNLMass.length; i++) {\n\t\t\t\t\tnlMass += Double.parseDouble(tempNLMass[i]);\n\t\t\t\t}\n \t\t}\n \t}\n \tmassFinal = massFinal -nlMass;\n \tfragment.setProperty(\"FragmentMass\", massFinal.toString());\n \treturn massFinal;\n }", "public int getM() {\n return m_;\n }", "public int getM() {\n return m_;\n }", "public MassData getMassData () {\n\t\tbody.getMassData(massData2);\n\t\tmassData.center.set(massData2.center.x, massData2.center.y);\n\t\tmassData.I = massData2.I;\n\t\tmassData.mass = massData2.mass;\n\t\treturn massData;\n\t}", "public void setMass(float value) {\n this.mass = value;\n }", "public java.lang.Float getM() {\n return m;\n }", "public static Float getElementMass(String elementName_) {\n\t\t\n\t\tif(elementName_.equals(\"Carbonate\"))\n\t\t\treturn 75f;\n\t\telse if(elementName_.equals(\"Hydroxide\"))\n\t\t\treturn 17f;\n\t\t\t\n\t\tString[] args = new String[2];\n\t\targs[0] = \"SELECT mass FROM elements WHERE name = \\\"\" + elementName_ + \"\\\"\";\n\t\targs[1] = \"mass\";\n\t\tArrayList results = dbConnect(args);\n\n\t\ttry {\n\t\t\treturn Float.valueOf((String)results.get(0)).floatValue();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn null;\n\t\t}\n\t}", "private double getPlanetMass() {\r\n\t\treturn MathUtils.randRange(MIN_PLANET_MASS, MAX_PLANET_MASS);\r\n\t}", "public java.lang.Float getM() {\n return m;\n }", "public int getNatom() {\n return natom;\n }", "public void setMass(double value) {\n this.mass = value;\n }", "@Override\n\tpublic double getMassaInterna()\n\t{\n\t\treturn 0.0;\n\t}", "public void setMass(double amount)\n\t{\n\t\tthis.mass = amount;\n\t}", "@JsonIgnore public Mass getProteinContent() {\n return (Mass) getValue(\"proteinContent\");\n }", "public abstract Vector2 getCentreOfMass();", "public double getBurntFuelMass();", "public String getMolecule() {\r\n\t\treturn molecule;\r\n\t}", "public double getAtomicNumber(MAPAtomAbstract a_oAtom) {\n\t\tdouble t_dAtomicNumber = 0.0D;\n\n\t\t// For atom group number XXX: to consider it should be large or small number\n\t\tif ( a_oAtom instanceof MAPAtomGroup ) return 999.9D;\n\n\t\tAtomicProperties t_enumAP = AtomicProperties.forSymbol( a_oAtom.getSymbol() );\n\t\tt_dAtomicNumber = t_enumAP.getAtomicNumber();\n\n\t\t// Add small number for star\n\t\tif ( a_oAtom instanceof MAPStar )\n\t\t\tt_dAtomicNumber += 0.01D;\n\n\t\t// Add aditional weight\n\t\tif ( this.m_mapAtomToAdditionalWeight.containsKey(a_oAtom) )\n\t\t\tt_dAtomicNumber += this.m_mapAtomToAdditionalWeight.get(a_oAtom);\n\n\t\t\treturn t_dAtomicNumber;\n\t}", "private double getRotationMomentum()\n\t{\n\t\treturn getRotation() * this.currentMomentMass;\n\t}", "private double molarMassCalc(String formula) {\n /* Base case for if the entire formula has been checked, therefor length = 0, or\n \t\tif a bracket is found */\n if (formula.length() == 0 || formula.charAt(0) == ')') {\n return 0.0;\n }\n /* If there is a bracket find the molar mass inside of the bracket and the\n multiply it by its multiplyier */\n else if (formula.charAt(0) == '(') {\n int multiplier = findNumber(formula.substring(findBracket(formula.substring(1)) + 1));\n int indexBracket = findBracket(formula.substring(1));\n int indexString = indexBracket + String.valueOf(findNumber(formula.substring(indexBracket + 1))).length()\n + 1;\n /* Returns molar mass of inside of bracket * its multiplier and then adds what\n is outside the bracket to the molar mass */\n return molarMassCalc(formula.substring(1)) * multiplier + molarMassCalc(formula.substring(indexString));\n\n }\n // Add mm of single letter element no multiplier\n else if (formula.length() == 1 || formula.charAt(1) == ')' || formula.charAt(1) == '('\n || (formula.charAt(1) < 96 && formula.charAt(1) > 58)) {\n return findElement(formula.substring(0, 1)) + molarMassCalc(formula.substring(1));\n }\n\n // Add mm of single letter element with multiplier\n else if (formula.charAt(1) < 96 && formula.charAt(1) < 58) {\n return findElement(formula.substring(0, 1)) * findNumber(formula.substring(1))\n + molarMassCalc(formula.substring(1 + String.valueOf(findNumber(formula.substring(1))).length()));\n }\n // Add mm of double letter element no multiplier\n else if (formula.length() == 2 || formula.charAt(2) == ')' || formula.charAt(2) == '('\n || (formula.charAt(1) > 96 && formula.charAt(2) > 58)) {\n return findElement(formula.substring(0, 2)) + molarMassCalc(formula.substring(2));\n }\n\n // Add mm of double letter element with multiplier\n else if (formula.charAt(1) > 96 && formula.charAt(2) < 58) {\n return findElement(formula.substring(0, 2)) * findNumber(formula.substring(2))\n + molarMassCalc(formula.substring(2 + String.valueOf(findNumber(formula.substring(2))).length()));\n }\n /* Returns 0 as final ensurance program runs, however\n checkIfValid() ensures that the input is a valid formula */\n else {\n return 0.0;\n }\n\n }", "public double getMoles(Component nu) {\n return N[nu.index()];\n }", "private double calculateInitialMass(int numC, int numH, int numO, int numN\n , int numAg, int numLi, int numNa, int numK, int numCl, int numP, int numS, int numF)\n {\n double CARBON = 12.000000;\n double HYDROGEN = 1.007825;\n double NITROGEN = 14.003074;\n double OXYGEN = 15.994915;\n double SILVER = 106.905090;\n double LITHIUM = 7.016004;\n double SODIUM = 22.989771;\n double POTASSIUM = 38.963707;\n double CHLORIDE = 34.968853;\n double PHOSPHORUS = 30.973761;\n double SULFUR = 31.972071;\n double FLUORIDE = 18.998404;\n return mass = ((CARBON *numC)+(HYDROGEN*numH)+(OXYGEN*numO)+(NITROGEN*numN)+(SILVER*numAg)+\n (LITHIUM*numLi)+(SODIUM*numNa)+(POTASSIUM*numK)+(CHLORIDE*numCl)+(PHOSPHORUS*numP)+\n (SULFUR*numS)+(FLUORIDE*numF));\n }", "public int getMpen(){\n\t\treturn mpen;\n\t}", "public int GetM()\r\n\t{\r\n\t\treturn M;\r\n\t}", "int getM();", "public double getMassStdev() {\n\t\t\treturn this.massStdev;\n\t\t}", "public double getMonto() {\r\n\t\treturn monto;\r\n\t}", "public int getMontantTotal() {\n\t\treturn montantTotal;\n\t}", "public String getMolecularFormula() {\n return molecularFormula;\n }", "@Override\n\tpublic double getMontant() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getMC() {\n\t\treturn MC;\n\t}", "public double getMontantOp() {\n return montantOp;\n }", "public double getPer_month(){\n\t\tdouble amount=this.num_of_commits/12;\n\t\treturn amount;\n\t}", "public double getManaregen(){\n\t\treturn manaregen;\n\t}", "@Override\r\n\tpublic double getTMB() {\r\n\t\tif (isAdultoJovem()) {\r\n\t\t\treturn 15.3 * anamnese.getPesoUsual() + 679;\r\n\t\t}\r\n\t\tif (isAdulto()) {\r\n\t\t\treturn 11.6 * anamnese.getPesoUsual() + 879;\r\n\t\t}\r\n\t\tif (isIdoso()) {\r\n\t\t\treturn 13.5 * anamnese.getPesoUsual() + 487;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public Number getMemArtId() {\n return (Number) getAttributeInternal(MEMARTID);\n }", "public BigDecimal getAmmount() {\r\n return ammount;\r\n }", "public double getMoleFraction(Component nu) {\n if (NT > 0)\n return N[nu.index()] / NT;\n else\n return 0;\n }", "public double tempoMedio(String t){\n\t\tt = t.toUpperCase();\n\t\tif(t == \"B\"){\n\t\t\treturn this.tempMB;\n\t\t}else if(t == \"S\"){\n\t\t\treturn this.tempMS;\n\t\t}else if(t == \"I\"){\n\t\t\treturn this.tempMI;\n\t\t}\n\t\n\t\treturn 0;\n\t}", "private static double calculateAcceleration(double force, double mass) {\n return force / mass;\n }", "public void setMass(Double mass) {\n this.mass = mass;\n }", "public double getMoon()\n {\n double moon = earthWeight * 0.1666;\n return moon;\n }", "private void calculateMediem(){\r\n int mediemNum = accountInTotal/2;\r\n Account mediemAccount = theAccounts.get(mediemNum);\r\n System.out.println(mediemAccount.toString());\r\n }", "public String getMiNo() {\r\n return miNo;\r\n }", "public BigDecimal getMos() {\r\n return mos;\r\n }", "public double getMu() {\n return mu;\n }", "public static float mzToNeutralMass(float mz, int charge) {\n\t\treturn (mz - AAMasses.protMass) * charge;\n\t}", "public int getSomme() {\r\n\t\treturn somme;\r\n\t}", "public int getSomme() {\r\n\t\treturn somme;\r\n\t}", "public double getMtm() {\r\n return mtm;\r\n }", "public void setMass(final float mass);", "public String getMolecule(int subsystem) {\n String returnString = _avTable.get(ATTR_MOLECULE, subsystem);\n return returnString;\n }", "public double getDistanceMoyenne() {\n\t\treturn getDistanceTotale () / 12;\n\t}", "public int getMprice() {\r\n return mprice;\r\n }", "public String getMaj(){\n return this.major;\n }", "com.google.protobuf.ByteString\n getMentBytes();", "public Point2D centerOfMass() \n {\n double cx = 0, cy = 0;\n double area = areaUnsigned();\n double factor = 0;\n for (Line2D line : lines) \n {\n factor = line.getP1().getX() * line.getP2().getY() - line.getP2().getX() * line.getP1().getY();\n cx += (line.getP1().getX() + line.getP2().getX()) * factor;\n cy += (line.getP1().getY() + line.getP2().getY()) * factor;\n }\n area *= 6.0d;\n factor = 1 / area;\n cx *= factor;\n cy *= factor;\n return new Point2D.Double(cx, cy);\n }", "public int getMps() {\n return (int) (80d * this.getCondition() / 100d);\n }", "public final Double getMile() {\n return mile;\n }", "public double getMoles() {\n return NT;\n }", "public Mass getProteinContent() throws ClassCastException;", "java.lang.String getMent();" ]
[ "0.7999108", "0.78782636", "0.78782636", "0.7850894", "0.7845057", "0.77940696", "0.7789923", "0.77559817", "0.7644828", "0.7587747", "0.7489921", "0.746049", "0.7432685", "0.7211973", "0.7176195", "0.7108404", "0.70435745", "0.6822102", "0.679784", "0.668303", "0.668045", "0.66726196", "0.6562918", "0.6415066", "0.63263655", "0.63046426", "0.62994164", "0.6269708", "0.62587476", "0.6215852", "0.6146569", "0.60459876", "0.60408896", "0.60385823", "0.5996884", "0.59950763", "0.59712833", "0.5961166", "0.5934272", "0.59337974", "0.5890299", "0.58888364", "0.584927", "0.58341503", "0.5824429", "0.5817614", "0.58129823", "0.58003074", "0.57721", "0.5761284", "0.575006", "0.5728056", "0.5710883", "0.56980324", "0.56701005", "0.56662416", "0.56652176", "0.5655842", "0.5638318", "0.5616539", "0.560677", "0.5600932", "0.5597322", "0.558194", "0.5569426", "0.5551168", "0.55191135", "0.5498361", "0.5484381", "0.5469531", "0.5466664", "0.54521495", "0.5448584", "0.54374427", "0.54356664", "0.54285514", "0.5425803", "0.5423676", "0.5404773", "0.54027784", "0.5397577", "0.5392334", "0.5385293", "0.5375222", "0.5372295", "0.53458315", "0.53458315", "0.5341348", "0.5336462", "0.5329395", "0.5324047", "0.5321752", "0.5310809", "0.53003746", "0.52917355", "0.5281227", "0.527925", "0.52545893", "0.52333575", "0.5225857" ]
0.8035667
0
get the atomic charge of this atom
public int getAtomicCharge() { return protons-electrons; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getAtomicCharge() {\r\n\t\treturn protons - electrons;\r\n\t}", "public ChargeComponent getCharge() {\r\n return charge;\r\n }", "public BigDecimal getCHARGE() {\r\n return CHARGE;\r\n }", "public java.lang.Float getCharge() {\n\t\treturn charge;\n\t}", "public double getCharge() {\n\t\treturn chargedEnergy;\n\t}", "public BigDecimal getCHARGE_AMOUNT() {\r\n return CHARGE_AMOUNT;\r\n }", "public int getcharge(int position){\n\t\treturn charges.get(position);\n\t}", "@Override\r\n\tpublic float getCharge() {\n\t\treturn 0;\r\n\t}", "public java.lang.String getChargecurrency() {\n\treturn chargecurrency;\n}", "public int getChargeRate();", "public BigDecimal getCHARGE_CODE() {\r\n return CHARGE_CODE;\r\n }", "public int getC_Charge_ID() {\n\t\tInteger ii = (Integer) get_Value(\"C_Charge_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public Integer getChargeid() {\n return chargeid;\n }", "public double getCharges()\r\n {\r\n //variables\r\n double charges = 0.0;\r\n double parts = 0.0;\r\n double hours = 0.0;\r\n\r\n //get user input and change double\r\n parts = Double.parseDouble(chargeField.getText());\r\n hours = Double.parseDouble(hourField.getText());\r\n\r\n //math for charges\r\n charges = hours * LABOR_RATE + parts;\r\n return charges;\r\n }", "public String getIdCharge() {\n return idCharge;\n }", "public String getChargePerson() {\n return chargePerson;\n }", "public String getChargeUnit() {\n return this.ChargeUnit;\n }", "public int getAtomicMass()\n\t{\n\t\treturn protons+neutrons;\n\t}", "public int getAtomicMass() {\r\n\t\treturn protons + neutrons;\r\n\t}", "@ApiModelProperty(required = true, value = \"The amount of the purchase. The tax was calculated on this amount.\")\n public BigDecimal getChargeAmount() {\n return chargeAmount;\n }", "public double getMinCharge() {\r\n return minCharge;\r\n }", "public BigDecimal getRechargeMoney() {\n return rechargeMoney;\n }", "@Override\n\tpublic Charge getChargeById(int id) {\n\t\tCharge charge = chargeMapper.getChargeById(id);\n\t\treturn charge;\n\t}", "public jkt.hms.masters.business.MasChargeType getChargeType() {\n\t\treturn chargeType;\n\t}", "public double calculateAdditionalCharge() {\n return 5.0;\n }", "public double getMaxCharge() {\r\n return maxCharge;\r\n }", "public java.lang.String getChargePeriod() {\n\treturn chargePeriod;\n}", "public BigDecimal getCredit() {\n return credit;\n }", "@Override\n\tpublic List<Charge> getCharges() {\n\t\tList<Charge> list = chargeMapper.getCharges();\n\t\treturn list;\n\t}", "public double getC() {\n return c;\n }", "protected void getChargeInfo() {\n\t\tString c = extractNodeInfo(chargeCurNodePath);\n\t\tString v = extractNodeInfo(charegeVolNodepath);\n\t\tif(c != null && v != null ) {\n\t\t\tresult[2] = c;\n\t\t\tresult[3] = v;\n\t\t\tflag[1] = true;\n\t\t} else {\n\t\t\tflag[1] = false;\n\t\t}\n\t}", "public Date getNextChargeTime() {\n return nextChargeTime;\n }", "public float getBusC() {\r\n return costs.get(Transports.BUS);\r\n }", "public BigDecimal getCommission() {\n return commission;\n }", "public BigDecimal getCommission() {\n return commission;\n }", "public String getSWIFT_CHARGE() {\r\n return SWIFT_CHARGE;\r\n }", "public java.math.BigDecimal getCardMoney() {\r\n return localCardMoney;\r\n }", "public java.math.BigDecimal getOtherCharges () {\n\t\treturn otherCharges;\n\t}", "public double getCEMENTAmount();", "public Double getCash() {\n\t\treturn cash;\n\t}", "public Date getLastChargeTime() {\n return lastChargeTime;\n }", "@ApiModelProperty(value = \"The id of this object.\")\n public BigDecimal getChargeId() {\n return chargeId;\n }", "public double getCash() {\n return cash;\n }", "public BigDecimal getArtificialRechargeMoney() {\n return artificialRechargeMoney;\n }", "@Override\n\tpublic double calculateServiceCharge() {\n\t\treturn 10.19;\n\t}", "public BigDecimal getCashMoney() {\n return cashMoney;\n }", "public Double getConcentration();", "public double getGas() {\n\t\treturn serbatoio;\n\t}", "public Number getCost()\r\n {\r\n return (m_cost);\r\n }", "public double getCurrentCash() {\r\n return currentCash;\r\n }", "@Override\n\tpublic double getPrice() {\n\t\treturn auto.getPrice() + AC_ADDITIONAL_CHARGE;\n\t}", "public BigDecimal getCmPaid() {\n return cmPaid;\n }", "public double getArcCost(AsNode child) {\n\t\treturn this.state.getG() + childCost.get(child);\n\t}", "public double getMass(double mz) {\n return ((mz * this.getAbsCharge()) - this.getMass());\n }", "public java.lang.String getAutoOPBillChargeResult() {\r\n return localAutoOPBillChargeResult;\r\n }", "public BigDecimal getACC_CY() {\r\n return ACC_CY;\r\n }", "@Override\n\tpublic int charge(int time) {\n\t\treturn super.charge(time*10);\n\t}", "public int calculateBill() {\n\t\treturn chargeVehicle(); \n\t}", "public double getCash()\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to getCash : \" + \"Agent\");\r\n/* 219 */ return this.cash;\r\n/* */ }", "public double getAtomicWeight() {\n }", "public int getAtomicNumber() {\n }", "public Money getAvailableCash(){\n\t\treturn availableCash;\n\t}", "public final boolean isChargeable()\r\n {\r\n return this.chargeable_;\r\n }", "public java.sql.Date getChargedate() {\n\treturn chargedate;\n}", "public VDouble getC() {\r\n return c;\r\n }", "public java.math.BigDecimal getInsuranceCharge () {\n\t\treturn insuranceCharge;\n\t}", "public BigDecimal getCpMoney() {\n return cpMoney;\n }", "public BigDecimal getRechargeFee() {\n return rechargeFee;\n }", "public java.math.BigDecimal getCreditBalance() {\n return creditBalance;\n }", "@Override\n public float getPriceCard() {\n return database.getPriceCard();\n }", "public double getCommission(){\r\n return commission;\r\n }", "public double getMoney() {\n return this.money;\n }", "public java.math.BigDecimal getCrvComittedAmount () {\n\t\treturn crvComittedAmount;\n\t}", "protected void charge() {\n Station nearestStation = map.nearestStation(currentPosition);\n if (Position.withinRange(nearestStation.pos, currentPosition)) {\n float[] values = nearestStation.discharge();\n coins += values[0];\n power += values[1];\n }\n }", "SerialResponse charge(PinChargePost pinChargePost);", "public double getCapacidadeCarga() {\n return capacidadeCarga;\n }", "@NotNull\n @Override\n public final String getUniqueID() {\n return \"charge\";\n }", "public CX getCostCenter() { \r\n\t\tCX retVal = this.getTypedField(25, 0);\r\n\t\treturn retVal;\r\n }", "public int getMoney() {\n\t\treturn currentMoney.getAmount();\n\t}", "public float fetchConstant() {\n\t\treturn fetchConstantService.getConstantValue();\n\t}", "public com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity() {\n com.cantor.drop.aggregator.model.CFTrade.Capacity result = com.cantor.drop.aggregator.model.CFTrade.Capacity.valueOf(capacity_);\n return result == null ? com.cantor.drop.aggregator.model.CFTrade.Capacity.AGENT : result;\n }", "public int getCredit() {\n return this.credit;\n }", "public double get_overcharge_cost() {\n\t\treturn overchargepermin;\n\t}", "public BigDecimal getFreeMoney() {\r\n return freeMoney;\r\n }", "public com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity() {\n com.cantor.drop.aggregator.model.CFTrade.Capacity result = com.cantor.drop.aggregator.model.CFTrade.Capacity.valueOf(capacity_);\n return result == null ? com.cantor.drop.aggregator.model.CFTrade.Capacity.AGENT : result;\n }", "public Integer getContractAmount() {\n return contractAmount;\n }", "public int chargeVehicle() {\n\t\t\n\t\tint price = 0; \n\t\t\n\t\tfor (int i = 0; i < vehicles.size(); i++) {\n\t\t\t\n\t\t\tif(vehicles.get(i) instanceof Car) { // charge 10 GBP per car \n\t\t\t\tprice += 10;\n\t\t\t}\n\t\t\telse if(vehicles.get(i) instanceof Motorcycle) { // charge 5 GBP per motorcycle \n\t\t\t\tprice += 5;\n\t\t\t}\n\t\t\telse if(vehicles.get(i) instanceof Bus) { // charge 25 GBP per bus \n\t\t\t\tprice += 25; \n\t\t\t}\n\t\t}\n\t\t\n\t\treturn price; \n\t}", "public BigDecimal getCost() {\n return this.cost;\n }", "public BigDecimal getCostStandardCumAmt () \n\t{\n\t\tBigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_CostStandardCumAmt);\n\t\tif (bd == null)\n\t\t\t return Env.ZERO;\n\t\treturn bd;\n\t}", "public double getMoney() {\n return money_;\n }", "public int getCreditCost() {\n\t\treturn 0;\n\t}", "public double getC1() {\n return c1;\n }", "public double getMoney() {\n return money_;\n }", "public float getCost() {\r\n\t\treturn this.cost.floatValue();\r\n\t}", "public static Currency getReferenceCurrency() {\n return REFERENCE.get();\n }", "public double getMoney() {\n\t\treturn money;\n\t}", "public double getMoney() {\n\t\treturn money;\n\t}", "public double getCredits() {\n\n return Math.round(this.credits * 100.0) / 100.0;\n }", "public ArmCurrency getCompositeAmount() {\n return this.compositeAmount;\n }", "public Number getActualCost()\r\n {\r\n return (m_actualCost);\r\n }" ]
[ "0.8048934", "0.75399107", "0.7505196", "0.7352328", "0.70913374", "0.70589304", "0.69191974", "0.6834027", "0.6717453", "0.6637139", "0.64379305", "0.6429562", "0.63646245", "0.6354694", "0.62854487", "0.6281966", "0.6260507", "0.6234461", "0.6209391", "0.6206046", "0.6198673", "0.6155567", "0.6102749", "0.60857683", "0.6057813", "0.6000816", "0.59977275", "0.599143", "0.59869015", "0.5976104", "0.5969107", "0.59237814", "0.5920768", "0.5913366", "0.5913366", "0.5898944", "0.5891473", "0.58881056", "0.58839536", "0.5836848", "0.58162403", "0.58042186", "0.57954293", "0.5791451", "0.57619554", "0.5724402", "0.5713505", "0.5699863", "0.56925684", "0.5689167", "0.56766105", "0.5671845", "0.5639375", "0.56390214", "0.5623189", "0.5622763", "0.56165415", "0.5610541", "0.56008184", "0.55970013", "0.55938613", "0.5578095", "0.55741215", "0.5572711", "0.5568756", "0.55603164", "0.5555962", "0.555379", "0.5528127", "0.55274", "0.5526469", "0.55205625", "0.5513123", "0.5507698", "0.55019027", "0.54986215", "0.54946685", "0.5490169", "0.5487053", "0.5483519", "0.54757005", "0.547341", "0.5464588", "0.54604584", "0.54563177", "0.5454407", "0.5451719", "0.5447876", "0.54465514", "0.5444435", "0.5441869", "0.5439518", "0.54359835", "0.54257476", "0.54251766", "0.54216", "0.54216", "0.5417317", "0.5416653", "0.5413246" ]
0.818952
0
decreases the proton and neutron count by 2
public void decay() { protons -= 2; neutrons -= 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void decay() {\r\n\t\tprotons -= 2;\r\n\t\tneutrons -= 2;\r\n\t}", "void decrementsGops();", "private void devolver100() {\n cambio = cambio - 100;\n de100--;\n cambio100++;\n }", "public void diminueVies() {\n\n nbVies_restantes.set(nbVies_restantes.get()-1);\n\n }", "private void calculeStatRemove() {\n resourceA = this.getContext().getGame().getPlayer(idPlayer).getInventory().getValueRessource(type);\n int loose = resourceB - resourceA;\n int diff = (resourceA - resourceB) + value;\n this.getContext().getStats().incNbRessourceLoosePlayers(idPlayer,type,loose);\n this.getContext().getStats().incNbRessourceNotLoosePlayers(idPlayer,type,diff);\n }", "public void nourrir() {\n if (!autoriseOperation()) {\n return;\n }\n\n incrFaim(-2);\n incrPoids(1);\n incrHumeur(1);\n incrXp(1);\n\n System.out.println(tamagoStats.getXp());\n setChanged();\n notifyObservers();\n\n }", "void unsetMultipleBetMinimum();", "public final void diminuerNbVie() {\n this.nbVie--;\n }", "public void depreciate(){\r\n float amountN = getAmount();\r\n float reduce = amountN*(rate/100);\r\n amountN = amountN - reduce;\r\n this.amount = amountN;\r\n }", "public void incrementFitnessBy2()\n {\n this.fitness=this.fitness+2;\n }", "void unsetSingleBetMinimum();", "public void soin() {\n if (!autoriseOperation()) {\n return;\n }\n if (tamagoStats.getXp() >= 2) {\n incrFatigue(-3);\n incrHumeur(3);\n incrFaim(-3);\n incrSale(-3);\n incrXp(-2);\n\n if (tamagoStats.getPoids() == 0) {\n incrPoids(3);\n } else if (tamagoStats.getPoids() == TamagoStats.POIDS_MAX) {\n incrPoids(-3);\n }\n\n setEtatPiece(Etat.NONE);\n tamagoStats.setEtatSante(Etat.NONE);\n\n setChanged();\n notifyObservers();\n }\n }", "public void ferdig(){\n antallTelegrafister--;\n }", "public void Grasshopper(){\n this.hops = 2;\n this.hopLim = 3;\n }", "void decrease();", "void decrease();", "public void decMonstres() {\n\t\tthis.nbMonstres -= 1;\n\t}", "public void decrementNumStones() {\n this.numStones--;\n }", "@Override\r\n\tprotected void afterStep() {\r\n\t\tif (pr_disappearing_potential > 0) {\r\n\t\t\tfor (V v : graph.getVertices()) {\r\n\t\t\t\tif (v instanceof TopicVertex) {\r\n\t\t\t\t\tsetOutputValue(v, getOutputValue(v) + (1 - alpha)\r\n\t\t\t\t\t\t\t* (pr_disappearing_potential * getVertexPrior(v)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tpr_disappearing_potential = 0;\r\n\t\t}\r\n\t\t// not necessary for hits-hub\r\n\t\t// if (disappearing_potential.hub > 0) {\r\n\t\t// for (V v : graph.getVertices()) {\r\n\t\t// if (v instanceof TopicVertex) {\r\n\t\t// double new_hub = getOutputValue(v)\r\n\t\t// + (1 - alpha)\r\n\t\t// * (hitsCoeff * disappearing_potential.hub * getVertexPrior(v));\r\n\t\t// setOutputValue(v, new_hub);\r\n\t\t// } else if (v instanceof TopicCategoryVertex) {\r\n\t\t// // auth and hub of topic category\r\n\t\t// }\r\n\t\t// }\r\n\t\t// disappearing_potential.hub = 0;\r\n\t\t// }\r\n\t\t// if (disappearing_potential.authority > 0) {\r\n\t\t// for (V v : graph.getVertices()) {\r\n\t\t// if (v instanceof TopicCategoryVertex) {\r\n\t\t// double new_auth = getOutputValue(v)\r\n\t\t// + (1 - alpha)\r\n\t\t// * (hitsCoeff * disappearing_potential.authority * getVertexPrior(v));\r\n\t\t// setOutputValue(v, new_auth);\r\n\t\t// }\r\n\t\t// }\r\n\t\t// disappearing_potential.authority = 0;\r\n\t\t// }\r\n\r\n\t\tsuper.afterStep();\r\n\t}", "public void Down4()\r\n {\r\n if(By2>0 && By2<900){\r\n \r\n By2+=2.5;\r\n }\r\n }", "public void eduque() {\n if (!autoriseOperation()) {\n return;\n }\n incrXp(2);\n incrFatigue(1);\n incrHumeur(1);\n\n setChanged();\n notifyObservers();\n }", "@FXML\r\n private void deduPoints() {\r\n int f1 = Integer.parseInt(strength.getText());\r\n if (f1 > 0) {\r\n int f2 = f1 - 1;\r\n strength.setText(String.valueOf(f2));\r\n diffPoint++;\r\n point.setText(\"You have \" + diffPoint + \" points\");\r\n }\r\n }", "public void Down2(){\r\n if(Hy>0 && Hy<900){\r\n \r\n Hy+=3;\r\n }\r\n }", "public void disperse() {\t\t\n\t\tfor (int r = 0; r < rows; r++){\n\t\t\tfor (int c = 1; c < cols; c++){\n\t\t\t\tint sum = values[r+1][c-1] + values[r+1][c] + values[r+1][c+1];\n\t\t\t\tif(r < rows - fireLevel + 14){\n\t\t\t\t\tvalues[r][c] = (sum / 3) - 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvalues[r][c] = (int)((sum / 3.0) - 0.0); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (values[r][c] < 0) values[r][c] = 0;\n\t\t\t\tg2.setColor(colors[values[r][c]]);\n\t\t\t\tif(values[r][c] > 5){\n\t\t\t\t\tg2.fillRect(c*res,r*res,res,res);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void detonate()\r\n\t{\r\n\t\tdetonated = true;\r\n\t}", "private void nourrireLePeuple() {\n\t\t\tint totalDepense = (int)((population * 1) + (populationColoniale * 0.8) + ((armee + armeeDeployee()) * nourritureParArmee));\r\n\t\t\tnourriture -= totalDepense;\r\n\t\t\tenFamine = (nourriture > 0) ? false : true;\r\n\t\t}", "void setGensNoImprovement(int gensNoImprovement);", "private void promote() {\r\n //promote gives more money\r\n increment();\r\n }", "private void incrNegativeCount(){\n m_NegativeCount++;\n }", "public void VaciarPila()\n {\n this.tope = 0;\n }", "public void decreaseRemainingPausesCount() {\r\n remainingPausesCount--;\r\n }", "private int siguientePrimo(int n)\r\n {\r\n if (n%2 == 0) n++;\r\n for (; !esPrimo(n); n+=2);\r\n return n;\r\n }", "public void Down3(){\r\n if(Hy2>0 && Hy2<900){\r\n \r\n Hy2+=3;\r\n }\r\n }", "public void updatePatience(){\n Patience = Patience - 1;\n }", "public void setTwoChipsInOneProject(Subproject project) {\n\t\tcurrent.raiseScore(project.setChip(current.removeChip()).getAmountSZT());\n\t\tcurrent.raiseScore(project.setChip(current.removeChip()).getAmountSZT());\n\t}", "@Override\n protected void update() {\n if (Pneumatics.get_instance().get_solenoids() && in_inner_thresh()) {\n Pneumatics.get_instance().set_solenoids(false);\n }\n }", "void recount();", "public void depolarize(){\n\t\t\tif(sodiumChannel.getGateStatus().equalsIgnoreCase(\"open\")) {\n\t\t\t\tfor(int i = 1; i <= threshold; i++) {\n\t\t\t\t\tcurrentVoltage = currentVoltage + sodiumIon;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void decreaseDegreeOfUsedNodes() {\n\t\tthis.v0.decreseDegree();\n\t\tthis.v1.decreseDegree();\n\t}", "private void decrementOpponentRechargeTimes()\n\t{\n\t\tfor (Map.Entry<Skills, Integer> pair : rechargingOpponentSkills.entrySet())\n\t\t{\n\t\t\tint val = pair.getValue();\n\t\t\tSkills s = pair.getKey();\n\t\t\t\n\t\t\tif (val > 0)\n\t\t\t{\n\t\t\t\trechargingOpponentSkills.put(s, --val);\n\t\t\t}\n\t\t}\n\t}", "public void decrementPossiblePoints() {\n if (groupScore == 1) {groupScore = 0; return;}\n if (groupScore - (groupScore / 2) >= 0) {\n groupScore -= (groupScore / 2);\n }\n }", "public void decreasePigsCounter() {\n --_pigsCounter;\n }", "public void increaseDecrease(String toDo)\n {\n\n ObservableList<?>fields= updateNew.getChildren();\n for(int i=0;i<fields.size();i++)\n {\n if(toDo.equals(\"i\")) {\n for(int k=0;k<=100;k++) {\n slowMotion(fields, i, k);\n }\n }\n else if(toDo.equalsIgnoreCase(\"d\"))\n {\n for(int k=100;k>=0;k--) {\n slowMotion(fields, i, k);\n }\n }\n }\n }", "public void decrease() {\r\n\r\n\t\tdecrease(1);\r\n\r\n\t}", "public void decPieceCount () {\n\t\tm_PieceCount --;\n\t}", "public void removeMissiles(){\n nunMissiles--;\n }", "public void reset() {\nsuper.reset();\nsetIncrease_( \"no\" );\nsetSwap_( \"tbr\" );\nsetMultrees_( \"no\" );\nsetRatchetreps_(\"200\");\nsetRatchetprop_(\"0.2\");\nsetRatchetseed_(\"0\");\n}", "int main()\n{\n int n,p=0,n2=2;\n cin>>n;\n if(n>0)\n cout<<p<<\" \";\n for(int i=1;i<n;i++)\n {\n p=p+n2;\n cout<<p<<\" \";\n if(i%2==1)\n \tn2=n2+4;\n }\n \n}", "public void resetUpdateCount() {\n updateCount = 0;\n numNucleiToRemove = 0;\n }", "public void toilette() {\n if (!autoriseOperation()) {\n return;\n }\n incrSale(-3);\n incrHumeur(1);\n incrXp(1);\n\n setChanged();\n notifyObservers();\n }", "public void decreaseRepDegree() {\r\n\t\tactualRepDegree--;\r\n\r\n\t}", "@FXML\r\n private void deduPointsAG() {\r\n int f1 = Integer.parseInt(agility.getText());\r\n if (f1 > 0) {\r\n int f2 = f1 - 1;\r\n agility.setText(String.valueOf(f2));\r\n diffPoint++;\r\n point.setText(\"You have \" + diffPoint + \" points\");\r\n }\r\n }", "public void decrementTotalScore(){\n totalScore -= 1;\n }", "public int increaseDefense () {\n return 3;\n }", "public void supprimerEpsilonProd(){\n grammaireCleaner.supprimer_epsilon_prod();\n setChanged();\n notifyObservers(\"4\");\n }", "public void decrementerPinCount() {\n\t\tthis.pin_count--;\n\t}", "public void usedOxygen() {\n\t\tthis.oxygenPoints -=1;\n\t}", "public static void main(String[] args) {\nint n1=20;\r\nn1 =50;\r\nSystem.out.println(n1);\r\nn1+=50;\r\nSystem.out.println(n1);\r\nn1-=30;\r\nSystem.out.println(n1);\r\nn1*=2;\r\nSystem.out.println(n1);\r\n\t}", "public void diminuiInSitu(){\n if(quantidade_in_situ>0)\n quantidade_in_situ--;\n else\n return;\n }", "private int numberOfIncorrectFollowUp(JigsawNode jNode) {\n\t\tint s = 0;\n\t\tint dimension = JigsawNode.getDimension();\n\t\tfor (int index = 1; index < dimension * dimension; index++) {\n\t\t\tif (jNode.getNodesState()[index] + 1 != jNode.getNodesState()[index + 1])\n\t\t\t\ts++;\n\t\t}\n\t\treturn s;\n\t}", "@Override\r\n\tpublic double calculate() {\n\t\treturn n1 - n2;\r\n\t}", "public void reinforce(int numTroops){\n inGameInvariant();\n this.troops += numTroops;\n inGameInvariant();\n }", "public void setGrilledVegetables(double countNo) {\n grilledVegetables = countNo;\r\n }", "@Override\n public int howManyXp() {\n return 2;\n }", "private void sharplyChange(){\r\n\t\t\tgovernmentLegitimacy -= 0.3;\r\n\t\t}", "@FXML\r\n private void deduPointsIn() {\r\n int f1 = Integer.parseInt(intelligence.getText());\r\n if (f1 > 0) {\r\n int f2 = f1 - 1;\r\n intelligence.setText(String.valueOf(f2));\r\n diffPoint++;\r\n point.setText(\"You have \" + diffPoint + \" points\");\r\n }\r\n }", "public void gagne()\r\n\t{\r\n\t\tthis.nbVictoires++;\r\n\t}", "public void setPrevCount(double n)\n {\n\n this.prevCount = n;\n }", "private void decrementGazingCount() {\n // TODO - You fill in here.\n mGazingThreads.decrementAndGet();\n }", "public void decrease() {\r\n --lives;\r\n }", "public void decrementHops() {\n\t\tthis.hopCount--;\n\t}", "public void supprimerImproductifs(){\n grammaireCleaner.nettoyNonProdGramm();\n setChanged();\n notifyObservers(\"2\");\n }", "@Override\n protected boolean removeChanceNode() {\n\n Node candidateToReduce;\n Node candidateToRemove;\n Node nodeToRemove;\n String operation;\n int i;\n NodeList children;\n Node valueNodeToReduce;\n\n NodeList chancesID;\n boolean removed = false;\n Node nodeUtil = null;\n\n\n\n\n // Obtain the value node \n\n //sv = ((IDWithSVNodes) diag).getTerminalValueNode();\n\n //diag.save(\"debug-mediastinet.elv\");\n\n //List of chance nodes in the diagram\n chancesID = diag.getNodesOfKind(Node.CHANCE);\n\n for (i = 0; (i < chancesID.size()) && removed == false; i++) {\n\n candidateToRemove = chancesID.elementAt(i);\n\n //Check if the candidaToRemove can be removed\n if (isRemovableChance(candidateToRemove)) {\n\n nodeToRemove = candidateToRemove;\n children = nodeToRemove.getChildrenNodes();\n //Reduce value nodes if it's necessary\n\n if (children.size() > 1) {\n //We have to reduce\n candidateToReduce = getCandidateValueNodeToReduceForChanceNode(nodeToRemove);\n\n //valueNodeToReduce =\tobtainValueNodeToReduce(reachableParents);\n valueNodeToReduce = obtainValueNodeToReduce(nodeToRemove, candidateToReduce);\n ReductionAndEvalID.reduceNode(\n (IDWithSVNodes) diag,\n valueNodeToReduce);\n nodeUtil = valueNodeToReduce;\n operation = \"Reduce: \" + nodeUtil.getName() + \" to eliminate: \" + nodeToRemove.getName();\n System.out.println(operation);\n statistics.addOperation(operation);\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException ex) {\n Logger.getLogger(ArcReversalSV.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n //The chance has only one child (utility)\n nodeUtil = children.elementAt(0);\n\n }\n\n\n String auxName = candidateToRemove.getName();\n operation = \"Chance node removal: \" + auxName;\n System.out.println(operation);\n statistics.addOperation(operation);\n\n //Add the name of the node to 'orderOfElimination'\n ((PropagationStatisticsID) statistics).addNameToOrderOfElimination(auxName);\n\n // The relation of the utility node is modified. In this \n // case the parents of the node to remove will be parents \n // of the utility node \n\n modifyUtilityRelation(nodeUtil, nodeToRemove, true);\n\n // Calculate the new expected utility \n getExpectedUtility(nodeUtil, nodeToRemove);\n\n // The node is deleted \n\n diag.removeNodeOnly(nodeToRemove);\n\n//\t\t\t\tStore the size of the diagram\n\n statistics.addSize(diag.calculateSizeOfPotentials());\n\n statistics.addTime(crono.getTime());\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException ex) {\n Logger.getLogger(ArcReversalSV.class.getName()).log(Level.SEVERE, null, ex);\n }\n // Set removed \n removed = true;\n\n }\n }//for\n return removed;\n }", "public void restarPunto ( ) {\n\t\tif ( vida > 0 )\n\t\t\tvida--;\n\t}", "public void tick(){\n oilLevel --;\n maintenance --;\n happiness --;\n health --;\n boredom ++;\n }", "public void removeCount() {\n \t\tdupCount--;\n \t}", "@Override\r\n\tpublic void decreaseNbProjectilesWith(int amount) {\r\n\t\tif (getNbProjectiles() > 0)\t\r\n\t\t\tsetNbProjectiles( getNbProjectiles() - amount );\t\t\r\n\t}", "private void resetProp(){\n proposition.clear();\n for (int i = 0; i<tailleCombinaison; i++) {\n proposition.add(\"-1\");\n }\n }", "U2(){\r\n setCurrentWeight(0);\r\n setMaxWeight(29*1000);\r\n setCost(120*1000000);\r\n }", "public void setNetworth(int value);", "public void detonate(){\n\t\tdetonatePosition = new Vector2(body.getPosition().x, body.getPosition().y);\n\t\tdetonate = true;\n\t\tdata.flagDetonation();\n\t\treset();\n\t}", "public void add2ChipsOnTheSameProject(Subproject project) {\n\t\tcurrent.raiseScore(project.setChip(current.removeChip()).getAmountSZT());\n\t\tcurrent.raiseScore(project.setChip(current.removeChip()).getAmountSZT());\n\t}", "void dropcard()\n{\nfor (int i=0;i<hc.size()-1;i++)\n\t{\n\tif(hc.get(i)==1||hc.get(i)==2)\n\t\tcontinue;\n\telse if((((hc.get(i))-3)/4)==(((hc.get(i+1))-3)/4))\n\t\t{hc.remove(i);\n\t\thc.remove(i);\n\t\ti--;}\t\n\t}\n}", "private void dec_x()\n {\n synchronized(mLock_IndexX) { set_x(get_x() - 1); }\n }", "public void resetPotandWins() {\n setPot(0.0);\n setNumOfPaylines(0);\n }", "public double costNEX() {\r\n double diff=0;\r\n double intensity=0;\r\n \r\n for(int x=Config.ptvXLow-0; x < Config.ptvXHigh+0; x++) {\r\n// for(int x=Solver.xBoundsTumor[0]; x < Solver.xBoundsTumor[1]; x+= Config.scaleFactor) {\r\n for(int y=Config.ptvYLow-0; y < Config.ptvYHigh+0; y++) {\r\n// for(int y=Solver.yBoundsTumor[0]; y < Solver.yBoundsTumor[1]; y+= Config.scaleFactor) {\r\n for(int z=Config.ptvZLow-0; z < Config.ptvZHigh+0; z++) {\r\n// for(int z=Solver.zBoundsTumor[0]; z < Solver.zBoundsTumor[1]; z+= Config.scaleFactor) {\r\n\r\n this.body2[x][y][z].setCurrentDosis(0.0); //Set currentPtvVoxel Dose to 0 \r\n for(int i=0; i<Config.numberOfSeeds;++i) { \r\n // Calculate intensity based based on current dwelltime\r\n intensity = this.body2[x][y][z].radiationIntensity(this.seeds2[i].getCoordinate(), New_state[i]);\r\n if (intensity>0) {\r\n// LogTool.print(\"Cost: Intensity :\" + intensity + \"@ \" + x + \" \" + y + \" \" + z,\"notification\");\r\n }\r\n this.body2[x][y][z].addCurrentDosis(intensity);\r\n } \r\n diff += Math.pow((this.body2[x][y][z].getGoalDosis()-this.body2[x][y][z].getCurrentDosis()),2);\r\n// LogTool.print(\" diffdose \" + (Looper.body2[x][y][z].getGoalDosis()-Looper.body2[x][y][z].getCurrentDosis()),\"notification\");\r\n } \r\n }\r\n }\r\n return Math.sqrt(diff);\r\n// return Math.random();\r\n }", "public void subtractCoins (int n) {\n this.coinCount = Math.max(0, this.coinCount - n);\n this.save();\n }", "public void stopGame()\r\n\t{\r\n\t\tthis.inProgress = false;\r\n\t\tif(this.round == 0)\r\n\t\t{\r\n\t\t\t++this.round;\r\n\t\t}\r\n\t}", "public void takeoutMoney (double amount) {\n if(amount >= 2.0) {\n int numberToRemove = (int) Math.min(getToonie(), amount / 2.0);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 2.0) {\n coins.remove(j);\n break;\n }\n }\n }\n NToonie -= numberToRemove;\n amount -= 2.0 * numberToRemove;\n }\n if(amount >= 1.0) {\n int numberToRemove = (int) Math.min(getLoonie(), amount / 1.0);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 1.0) {\n coins.remove(j);\n break;\n }\n }\n }\n NLoonie -= numberToRemove;\n amount -= 1.0 * numberToRemove;\n }\n if(amount >= 0.25) {\n int numberToRemove = (int) Math.min(getQuarter(), amount / 0.25);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 0.25) {\n coins.remove(j);\n break;\n }\n }\n }\n NQuarter -= numberToRemove;\n amount -= 0.25 * numberToRemove;\n }\n if(amount >= 0.1) {\n int numberToRemove = (int) Math.min(getDime(), amount / 0.1);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 0.1) {\n coins.remove(j);\n break;\n }\n }\n }\n NDime -= numberToRemove;\n amount -= 0.1 * numberToRemove;\n }\n if(amount >= 0.05) {\n int numberToRemove = (int) Math.min(getNickel(), amount / 0.05);\n for(int i = 0; i < numberToRemove; i++) {\n for(int j = 0; j < coins.size(); j++) {\n if(coins.get(j).getValue() == 0.05) {\n coins.remove(j);\n break;\n }\n }\n }\n NNickel -= numberToRemove;\n amount -= 0.05 * numberToRemove;\n }\n }", "public void crunch(){\n cpuBurstTime--;\n rem--;\n }", "private void doubleDemoteright (WAVLNode z) {\n\t z.rank--;\r\n\t z.left.rank--;\r\n }", "void unsetWagerMinimum();", "public void decrease(int number) {\r\n this.count -= number;\r\n }", "public void decrease(int number) {\r\n this.count -= number;\r\n }", "void unsetMaximum();", "public static void test_2(){\r\n try{\r\n System.out.println(\"\\n\\nTestCase-2\\n\\n\");\r\n TestNetwork n=new TestNetwork(4,4,2);\r\n Paxos p=new Paxos(n);\r\n p.runPaxos();\r\n n.change_DPmode(-1,1);\r\n for(int i=0;i<10;i++) //Block the channel of all processes\r\n n.block_channel(i, 1); \r\n Thread.sleep(500);\r\n for(int i=0;i<4;i++) //Release all Proposers\r\n n.block_channel(i,0); \r\n Thread.sleep(1000);\r\n for(int i=4;i<8;i++) //Release all Acceptors\r\n n.block_channel(i,0);\r\n Thread.sleep(1000);\r\n n.block_channel(9,0); //Release one of the learner's channel\r\n Thread.sleep(1000); \r\n n.block_channel(8,0); //Lets release the next learner's channel\r\n Thread.sleep(5000);\r\n n.terminate_run();\r\n Thread.sleep(2000);\r\n System.out.println(\"\\n\\nTERMINATED PAXOS RUN-2\");\r\n n.printTrace();\r\n }\r\n catch(Exception e){}\r\n}", "public Percolation(int n) {\n this.count = n;\n\n\n }", "@Override\n\tpublic double neto() {\n\t\treturn 2000;\n\t}", "private void recolteNourriture() {\r\n\t\t\t//1pop recolte toute la case\r\n\t\t\tint tempNourr = 0;\r\n\t\t\tint totalPop = population + populationColoniale;\r\n\t\t\tint limite = (totalPop < caseOwned.size()) ? totalPop : caseOwned.size();\r\n\t\t\tfor(int id = 0; id < limite; id++) {\r\n\t\t\t\ttempNourr += caseOwned.get(id).getFood();\r\n\t\t\t}\r\n\t\t\t//animaux\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Bétail) * 10; //Ca mange de l'herbe, ça se tente.\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Cervidés) * 7.5; //CARIBOUUUUUUUUU !!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Crabe) * 2; //ca pique les pied, a mort!!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Elephants) * 30; //polution sonore\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Moutons) * 5; //kébab landais\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Poissons) * 5; //croustibat\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Chevaux) * 7; //lasagnes\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Baleines) * 50; //*bruit de baleine virile*\r\n\t\t\t//aplication des bonus\r\n\t\t\ttempNourr *= (1 + (0.15 * scienceLvl) + (0.05 * (bonheur - baseBonheur))); // +15% par scienceLvl +5% par bonheur excedentaire, -5% par bonheur négatif\r\n\t\t\t\r\n\t\t\tnourriture += tempNourr;\r\n\t\t\t//bonus de conservation grâce au sel\r\n\t\t\tif(howManyRessource(StrategicRessource.Sel) > 0 && nourriture > 0) nourriture *= 1.10;\r\n\t\t\t//limitation de stockage\r\n\t\t\tint stockageMax = caseOwned.size() * 100 * scienceLvl;\r\n\t\t\tif(nourriture > stockageMax) nourriture = stockageMax;\r\n\t\t}", "public void progressInfectionProbV2(int probability){\n int recoveryProb = 0;\n recoveryProb = daysInfected * probability;\n int recov = rand.nextInt(100);\n if (recov < recoveryProb) {\n //recover\n nextState = States.RecoveredVirus2;\n immuneV2 = true;\n } else daysInfected++;\n }" ]
[ "0.6659547", "0.5779345", "0.5720552", "0.5705601", "0.5665709", "0.56412506", "0.5631502", "0.55665034", "0.5502645", "0.54807156", "0.5409504", "0.53976816", "0.53425765", "0.531377", "0.53005505", "0.53005505", "0.5260245", "0.524404", "0.5243459", "0.5242553", "0.52120864", "0.52112025", "0.5142991", "0.5138288", "0.5136015", "0.5135735", "0.51351696", "0.5133366", "0.51295435", "0.5125749", "0.5118193", "0.51161516", "0.51115483", "0.51099527", "0.51047164", "0.51027", "0.50988376", "0.50941175", "0.5092413", "0.5087629", "0.5081609", "0.50736535", "0.5069084", "0.506898", "0.50555027", "0.5045585", "0.50276214", "0.50226426", "0.5018454", "0.5010992", "0.50077087", "0.5003481", "0.49898863", "0.4984238", "0.49823314", "0.49723813", "0.49678653", "0.49645826", "0.4964005", "0.4951211", "0.4947663", "0.49469104", "0.49454272", "0.49444544", "0.49425092", "0.4929856", "0.49285743", "0.49239716", "0.49179217", "0.49147454", "0.49100792", "0.49092406", "0.48862907", "0.4883488", "0.48815137", "0.48789907", "0.48745304", "0.4871655", "0.48711023", "0.48690158", "0.4867681", "0.48651227", "0.48631984", "0.48611754", "0.4852365", "0.48509964", "0.48504445", "0.4844643", "0.4843295", "0.48400155", "0.48264262", "0.4822287", "0.4817873", "0.4817873", "0.48125732", "0.48111552", "0.48095837", "0.4807437", "0.48072684", "0.48061866" ]
0.65210676
1
Util for generation id
public interface IGeneratorIdService { /** * @return "unique" long id */ Long generateId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static String generateId() {\r\n\t\treturn UUID.randomUUID().toString().replaceAll(\"-\", \"\");\r\n\t}", "private static int generateId() {\n\t\treturn ++sId;\n\t}", "private String creatUniqueID(){\n long ID = System.currentTimeMillis();\n return Long.toString(ID).substring(9,13);\n }", "String generateUID();", "private long generateID() {\n\t\treturn ++lastID;\n\t}", "private Long createId() {\n return System.currentTimeMillis() % 1000;\n }", "private String createId() {\n int idLength = 5;\n String possibleChars = \"1234567890\";\n Random random = new Random();\n StringBuilder newString = new StringBuilder();\n\n for (int i = 0; i < idLength; i++) {\n int randomInt = random.nextInt(10);\n newString.append(possibleChars.charAt(randomInt));\n }\n\n return newString.toString();\n }", "private String generateUniqueIdString() {\r\n return TimeBasedUUID.getUUIDAsString();\r\n }", "private void generateID(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (String t : terms.keySet())\n\t\t\tsb.append(t.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, t.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tfor (String s : sources)\n\t\t\tsb.append(s.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, s.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tsb.deleteCharAt(sb.length()-1);\n\t\tif (yearFrom > -1) sb.append(\"_\" + yearFrom);\n\t\tif (yearTo > -1) sb.append(\"_\" + yearTo);\n\t\tif (useCompounds) sb.append(\"_COMP\");\n\t\tif (useStopwords) sb.append(\"_STOP\");\n\t\tsb.append(\"_CNT\" + contextSize);\n\t\tsb.append(\"_\" + System.currentTimeMillis());\n\t\tthis.id = sb.toString();\n\t}", "private String getID()\n {\n String chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()_+{}|:<>?/.,';][=-`~\";\n String id = \"\";\n int max = new Random().nextInt((16 - 12) + 1)+12;\n for(int i=0;i<16;i++)\n {\n int r = new Random().nextInt((chars.length()-1 - 0) + 1)+0;\n id+=chars.charAt(r);\n }\n return id;\n }", "String uniqueId();", "public String generateID() {\n return IDPREFIX + nextidint++;\n }", "public String generateId() {\n return Utils.generateKey();\n }", "public String generateId() {\n return RandomStringUtils.randomAlphabetic(32);\n }", "public String GenerateID()\n\t{\n\t\tRandom randomGenerator = new Random();\n\t\treturn Integer.toString(randomGenerator.nextInt(Integer.MAX_VALUE));\n\t}", "String createUniqueID(String n){\n String uniqueID =UUID.randomUUID().toString();\n return n + uniqueID;\n }", "public int generateUniqueID(){\n\n int uniqueID = 100; \n int maxID =getMaxId() ;\n \n uniqueID = uniqueID + maxID;\n\n return uniqueID;\n }", "public static String generateId(String prefix) {\n\t\tlong now = System.currentTimeMillis();\n\t\tlong randomLong = Math.round(Math.random() * 89999) + 10000;\n\t\treturn (prefix + now + \"-\" + randomLong);\n\t}", "public void generateID()\n {\n ID = this.hashCode();\n }", "public String generateLink_Id() {\n\t\tString Link_Id = \"L\" + String.valueOf(rand.genRandomDigits(7));\n\t\twhile (registerDao.checkLinkIdIfExist(Link_Id)) {\n\t\t\tLink_Id = \"C\" + String.valueOf(rand.genRandomDigits(7));\n\t\t}\n\t\treturn Link_Id;\n\t}", "public static int generateUniqueId(){\r\n String returnme = GregorianCalendar.getInstance().getTimeInMillis() + \"\";\r\n return Integer.parseInt(returnme.substring(returnme.length() - 9, returnme.length()));\r\n }", "protected String generateRandomId(String prefix) {\n int nextInt = RANDOM.nextInt();\n nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);\n return prefix + \"_\" + String.valueOf(nextInt);\n }", "private String generatePurchaseId() {\n\t\tint purchaseId = purchaseIdCounter.incrementAndGet();\n\t\treturn Integer.toString(purchaseId);\n\t}", "String getUniqueId();", "public static String generateEmpID() {\n\tempID++;\n\treturn String.valueOf(empID);\n }", "public int genID() {\n int uid = this.hashCode();\n if (uid < 0) {\n uid = Math.abs(uid);\n uid = uid * 15551;\n }\n return uid;\n }", "public static int genID(){\n Random rand = new Random();\n\n int theID = rand.nextInt(999)+1;\n\n return theID;\n\n }", "private static String getUniqueId()\n\t{\n\t\tfinal int limit = 100000000;\n\t\tint current;\n\t\tsynchronized (DiskFileItem.class)\n\t\t{\n\t\t\tcurrent = counter.nextInt();\n\t\t}\n\t\tString id = Integer.toString(current);\n\n\t\t// If you manage to get more than 100 million of ids, you'll\n\t\t// start getting ids longer than 8 characters.\n\t\tif (current < limit)\n\t\t{\n\t\t\tid = (\"00000000\" + id).substring(id.length());\n\t\t}\n\t\treturn id;\n\t}", "public static String makeRandomID() {\n UUID uuid = UUID.randomUUID();\n return uuid.toString();\n }", "public String generateTeamID() {\n List<Team> teams = getAllOrdered();\n int idNum;\n \n if (teams == null || teams.isEmpty()) \n idNum = 0;\n else {\n String idStr = teams.get(teams.size() - 1).getTeamID();\n idNum = Integer.parseInt(idStr.substring(2, idStr.length()));\n }\n \n String teamID;\n int newIdNum = idNum + 1;\n if (newIdNum <= 9)\n teamID = \"T_000\" + newIdNum;\n else if (newIdNum <= 99) \n teamID = \"T_00\" + newIdNum;\n else if (newIdNum <= 999)\n teamID = \"T_0\" + newIdNum;\n else \n teamID = \"T_\" + newIdNum;\n \n return teamID;\n }", "Id createId();", "private String generateNewCallId()\n {\n\n\t\t// Generate the variant number\n\t\tint variable = NumberUtils.getIntRandom();\n\n\t\t// Convert to hex value\n\t\tString hex = NumberUtils.toHexValue(variable);\n\n\t\t// Compose the final call id\n\t\treturn \"{2B073406-65D8-A7B2-5B13-B287\" + hex + \"}\";\n\t}", "UUID id();", "public String gerarUID() {\n //String id1 = UUID.randomUUID().toString().replace(\"-\", \"\");\n String id1 = UUID.randomUUID().toString();\n return id1;\n }", "public static String generateId(String s){\n\t\tString date = LocalDate.now().format(DateTimeFormatter.ofPattern(\"yyMMdd\"));\n\t\tString key = s +\"_\" + date;\n\t\t//com.incr(key);\n\t\tredisTemplate.opsForValue().increment(key);\n\t\tInteger num = redisTemplate.opsForValue().get(key);\n\t\treturn date + \"-\" + String.format(\"%08d\",num);\n\t}", "public static String generateProductID() {\n\tproductID++;\n\treturn String.valueOf(productID);\n }", "public String generatePlayerID() {\n List<Player> players = getAllOrdered();\n int idNum;\n \n if (players == null || players.isEmpty())\n idNum = 0;\n else {\n String idStr = players.get(players.size() - 1).getPlayerID();\n idNum = Integer.parseInt(idStr.substring(2, idStr.length()));\n }\n \n String playerID;\n int newIdNum = idNum + 1;\n if (newIdNum <= 9)\n playerID = \"P_000\" + newIdNum;\n else if (newIdNum <= 99) \n playerID = \"P_00\" + newIdNum;\n else if (newIdNum <= 999)\n playerID = \"P_0\" + newIdNum;\n else \n playerID = \"P_\" + newIdNum;\n \n return playerID;\n }", "public int generateId(){\n return repository.getCount()+1;\n }", "int nextId();", "public static String generateID(int num){\n StringBuilder str=new StringBuilder();//定义变长字符串\n Random random=new Random();\n for (int i = 0; i < num; i++) {\n str.append(random.nextInt(10));\n }\n return str.toString();\n }", "private static Integer generateID() {\n Integer uniqueID = -1;\n while (setOfIDs.contains(uniqueID) || !Employee.isPositive(uniqueID)) {\n uniqueID += 1;\n }\n return uniqueID;\n }", "public static String generateNewUserId() {\r\n\t\tDate date = new Date();\r\n\t\treturn String.format(\"%s-%s\", UUID.randomUUID().toString(),\r\n\t\t\t\tString.valueOf(date.getTime()));\r\n\t}", "protected int generateUniqueId() {\n\t\tint id = super.getUniqueId();\n\t\tsuper.setUniqueId(getUniqueId() + 1);\n\t\treturn id;\n\t}", "public static String generateSaleID() {\n\tsaleID++;\n\treturn String.valueOf(saleID);\n }", "public static String aUniqueIdentifier() {\n return \"MONEXT\" + new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\n }", "String mo10312id();", "private String generateId(String input) {\n\t\treturn StringUtil.hashSHA256(input);\n\t}", "public static String uniqueId() {\r\n return UUID.randomUUID().toString();\r\n }", "String getIdNumber();", "private int generateNewId() {\n int size = userListCtrl.getUsers().size();\n \n if (size == 0) {\n return 1;\n } else {\n return userListCtrl.getUsers().get(size-1).getUserID()+1;\n }\n }", "String getContentGeneratorId();", "String idProvider();", "protected String getNextID(String prefix) {\n return String.format(\"%s-%s\", prefix, UUID.randomUUID().toString()) ;\n }", "public void generarId() {\n try{\n int numAleatorio = (int)(Math.random()*99999);\n boolean resultado = dgt.generarIdAutomatico(numAleatorio);\n tfid.setText(String.valueOf(numAleatorio));\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n }", "String getUniqueID();", "private int IdRandom() {\n\t\tRandom random = new Random();\n\t\tint id = random.nextInt(899999) + 100000;\n\t\treturn id;\n\t}", "private String generateRandomId(){\n\n //creates a new Random object\n Random rnd = new Random();\n\n //creates a char array that is made of all the alphabet (lower key + upper key) plus all the digits.\n char[] characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\".toCharArray();\n\n //creates the initial, empty id string\n String id = \"\";\n\n /*Do this 20 times:\n * randomize a number from 0 to the length of the char array, characters\n * add the id string the character from the index of the randomized number*/\n for (int i = 0; i < 20; i++){\n id += characters[rnd.nextInt(characters.length)];\n }\n\n //return the 20 random chars long string\n return id;\n\n }", "protected String generateReviewID() {\n Random r = new Random();\n String restID;\n do {\n int randomIDnum = r.nextInt(999999999) + 1;\n restID = String.valueOf(randomIDnum);\n } while (this.reviewMap.containsKey(restID));\n return restID;\n }", "public String generateCustomer_Id() {\n\t\tString customer_Id = \"C\" + String.valueOf(rand.genRandomDigits(7));\n\t\twhile (registerDao.checkCustomerIdIfExist(customer_Id)) {\n\t\t\tcustomer_Id = \"C\" + String.valueOf(rand.genRandomDigits(7));\n\t\t}\n\t\treturn customer_Id;\n\t}", "public static String uniqueId() {\n return UUID.randomUUID().toString();\n }", "public static String generateInstanceId() {\n\t\t// TODO Use a complex hashing algorithm and generate 16-character\n\t\t// string;\n\n\t\treturn Calendar.getInstance().getTime().toString().replaceAll(\" \", \"\");\n\t}", "public static String newId(long useFor, long dbNum, long tableNum) throws Exception{\n\t\treturn IdGenerator.generate61ForId(useFor, dbNum, tableNum);\t\t\n\t}", "@Test\n public void testGenerateIdExpectedValue() {\n Monkey monkey = new Monkey();\n int id = monkey.generateIdRefactored(100);\n assertEquals(id,223592);\n }", "public static long getID() {\n int localizador = 0;\n Long min = 1000000000L;\n Long max = 9999999999L;\n\n do {\n localizador = (int) Math.floor(Math.random() * (max - min + 1) + min);\n } while (Integer.toString(localizador).length() != 10);\n return localizador;\n }", "public static String generateId(int digitAmount) {\n\t\t\n\t\tfinal String upperAlpha = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\t\t\n\t\tString brokerOrderID = \"\";\n\t\tfor (int i = 0; i < digitAmount; i++) {\n\t\t\tif (i % 2 == 0) {\n\t\t\t\tint randomAlphaIndex = ThreadLocalRandom.current().nextInt(0, 25 + 1);\n\t\t\t\tbrokerOrderID += upperAlpha.charAt(randomAlphaIndex);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tint randomInteger = ThreadLocalRandom.current().nextInt(1, 9 + 1);\n\t\t\t\tbrokerOrderID += Integer.toString(randomInteger);\n\t\t\t}\n\t\t}\n\t\treturn brokerOrderID;\n\t}", "public static String generateID(int length) {\n\t\tString id = \"\";\n\t\t\n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tid += (int) (Math.random() * 10);\n\t\t}\n\t\t\n\t\treturn id;\n\t}", "public String getConvertToId();", "private synchronized int generateJobID() {\n\t\t/* generate JobID */\n\t\tint jobID = lastJobID;\n\t\tlastJobID += 1;\n\t\treturn jobID;\n\t}", "private\tString\tgenerateUUID(){\n\t\treturn\tUUID.randomUUID().toString().substring(0, 8).toUpperCase();\n\t}", "public static String createPID()\r\n\t{\r\n\t\tunique_count++;\r\n\t\tif(unique_count >= 100) unique_count = 0;\r\n\t\tString str_num = String.format(\"%02d\", unique_count);\r\n\t\t\r\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyMMddHHmmss\");\r\n\t\tString pid = dateFormat.format(new Date()) + str_num;\r\n\t\treturn pid;\r\n\t}", "private static int generateMarkerId(){\n return snextMarkerId.incrementAndGet();\n\n }", "private String generateUID()\n {\n String uid;\n int nbAccounts = this.getNumberOfAccounts();\n String host = this.registration.getHost();\n int nbAccountsForHost = this.getNbAccountForHost(host);\n \n if (nbAccounts == 0 || (this.isModification() && nbAccounts == 1) ||\n nbAccountsForHost == 0 || (this.isModification() && nbAccountsForHost == 1))\n {\n // We create the first account or we edit the onlyone\n // Or we create the first account for this server or edit the onlyone\n uid = host;\n }\n else\n {\n uid = host + \":\" + this.registration.getPort();\n }\n \n return uid;\n }", "private static int generateViewId() {\n for (;;) {\n final int result = sNextGeneratedId.get();\n // aapt-generated IDs have the high byte nonzero; clamp to the range under that.\n int newValue = result + 1;\n if (newValue > 0x00FFFFFF) newValue = 1; // Roll over to 1, not 0.\n if (sNextGeneratedId.compareAndSet(result, newValue)) {\n return result;\n }\n }\n }", "public static String generateCustomerID() {\n\tcustomerID++;\n\treturn String.valueOf(customerID);\n }", "public int idGenerator() {\n Random random = new Random();\n int id;\n return id = random.nextInt(10000);\n }", "public String generatePurchaseId() {\n\t\tint purchaseId = purchaseIdCounter.incrementAndGet();\n\t\treturn Integer.toString(purchaseId);\n\t}", "public static String getUniqueIdentifier() {\r\n UUID uuid = UUID.randomUUID();\r\n return uuid.toString();\r\n }", "public void obtenerID();", "UUID getUniqueId();", "public static int generateViewId() {\n\t\tdo {\n\t\t\tfinal int result = sNextGeneratedId.get();\n\t\t\t// aapt-generated IDs have the high byte nonzero; clamp to the range under that.\n\t\t\tint newValue = result + 1;\n\t\t\tif (newValue > 0x00FFFFFF){\n\t\t\t\tnewValue = 1; // Roll over to 1, not 0.\n\t\t\t}\n\t\t\tif (sNextGeneratedId.compareAndSet(result, newValue)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}while(true);\n\t}", "@Override\n\tpublic native final String createUniqueId() /*-{\n // In order to force uid's to be document-unique across multiple modules,\n // we hang a counter from the document.\n if (!this.gwt_uid) {\n this.gwt_uid = 1;\n }\n\n return \"gwt-uid-\" + this.gwt_uid++;\n\t}-*/;", "private static int generateCircleId(){\n return snextCircleId.incrementAndGet();\n\n }", "java.lang.String getID();", "public String generateReferenceId(){\n String lastSequenceNumber = databaseAccessResource.getLastRequestSequenceNumber();\n //ToDo : write the logic to generate the next sequence number.\n return null;\n }", "public static String generateReverseTimestampId() {\r\n\t\tString sTs = Str.leftPad(String.valueOf(Long.MAX_VALUE-System.currentTimeMillis()),'0',20);\r\n\t\tString sRd = Str.leftPad(String.valueOf(new Random().nextInt(Integer.MAX_VALUE)),'0',10);\r\n\t\treturn Str.leftPad(sTs+sRd,'0',32);\r\n\t }", "@Override\r\n\tpublic String createID() {\r\n\t\t \r\n\t\t\t\treturn transCode.toString();\r\n\t\t\t\t}", "private static synchronized String getNextID() {\r\n\t\tlastID = lastID.add(BigInteger.valueOf(1));\r\n\t\t\r\n\t\treturn lastID.toString();\r\n\t}", "UUID getId();", "public static synchronized String generateUniqueId(String prefixString) \n\t{\n\t\tprefixString += \"-\" + generateTimeStamp(\"yyMM\");\n\t\treturn String.format(\"%s%d%d%d%d\", prefixString, generateRandomNumber(10), generateRandomNumber(10), generateRandomNumber(10), generateRandomNumber(10));\n\t}", "public String getNextID() {\n String id = \"am\" + Integer.toString(nextID);\n nextID++;\n return id;\n }", "protected String generateRestaurantID() {\n Random r = new Random();\n String restID;\n do {\n int randomIDnum = r.nextInt(999999999) + 1;\n restID = String.valueOf(randomIDnum);\n } while (this.restaurantMap.containsKey(restID));\n return restID;\n }", "public int generateId() {\n if (allMessage.size() ==0) {\n return 1000;\n }\n return allMessage.get(allMessage.size() - 1).getId() + 1;\n }", "@PrePersist\n public void generateId() {\n if (this.id == null) {\n this.id = UUID.randomUUID().toString();\n }\n }", "String getExistingId();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();" ]
[ "0.82725453", "0.8056425", "0.7982797", "0.79655623", "0.790947", "0.7899518", "0.7856485", "0.7855903", "0.78320795", "0.78074753", "0.77978295", "0.77870107", "0.77233714", "0.7651246", "0.76057434", "0.7584845", "0.75772154", "0.7560984", "0.75052524", "0.74607366", "0.7444828", "0.7440963", "0.7427679", "0.74060684", "0.7397839", "0.7375721", "0.73560524", "0.73542744", "0.7328122", "0.7321496", "0.73081315", "0.7295131", "0.7276465", "0.72731674", "0.72714466", "0.72393155", "0.72305423", "0.72257996", "0.72221255", "0.72213435", "0.7215492", "0.719888", "0.71927387", "0.7191036", "0.71320784", "0.71314746", "0.7124684", "0.7115396", "0.71137506", "0.7113137", "0.71103776", "0.71059185", "0.7103564", "0.7098304", "0.70911956", "0.70888174", "0.7065928", "0.7062662", "0.7060326", "0.7049458", "0.7040697", "0.7036314", "0.7025805", "0.70257425", "0.70250136", "0.6993381", "0.69929403", "0.6992591", "0.6991029", "0.6989453", "0.69872266", "0.6985079", "0.69728804", "0.6954979", "0.6953587", "0.69455236", "0.6935053", "0.69346946", "0.6925878", "0.6925307", "0.6921704", "0.69205284", "0.69133794", "0.69125956", "0.6906465", "0.6904189", "0.69031155", "0.6898985", "0.6896384", "0.689132", "0.688689", "0.68810564", "0.6880007", "0.68764", "0.68675315", "0.68675315", "0.68675315", "0.68675315", "0.68675315", "0.68675315" ]
0.7300325
31
Initialize the contents of the frame.
private void initialize() { frmTrainmodelmodule = new JFrame(); frmTrainmodelmodule.setTitle("TrainModelModule"); frmTrainmodelmodule.setBounds(100, 100, 1161, 579); frmTrainmodelmodule.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frmTrainmodelmodule.getContentPane().setLayout(null); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// JPanel failureModesPanel = new JPanel(); failureModesPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); failureModesPanel.setBounds(12, 23, 219, 347); frmTrainmodelmodule.getContentPane().add(failureModesPanel); failureModesPanel.setLayout(null); JLabel lblFailModes = new JLabel("Failure Modes"); lblFailModes.setBounds(30, 0, 164, 48); failureModesPanel.add(lblFailModes); lblFailModes.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblFailModes.setHorizontalAlignment(SwingConstants.CENTER); JButton engineFailureButton = new JButton("Engine Failure"); engineFailureButton.setFont(new Font("Times New Roman", Font.PLAIN, 13)); engineFailureButton.setBounds(30, 61, 164, 54); failureModesPanel.add(engineFailureButton); engineFailureButton.setForeground(Color.BLACK); JButton brakeFailureButton = new JButton("Brake Failure"); brakeFailureButton.setFont(new Font("Times New Roman", Font.PLAIN, 13)); brakeFailureButton.setBounds(30, 130, 164, 54); failureModesPanel.add(brakeFailureButton); JButton signalPickupFailureButton = new JButton("Signal Pickup Failure"); signalPickupFailureButton.setFont(new Font("Times New Roman", Font.PLAIN, 13)); signalPickupFailureButton.setBounds(30, 208, 164, 54); failureModesPanel.add(signalPickupFailureButton); JButton resetButton = new JButton("Reset"); resetButton.setFont(new Font("Times New Roman", Font.PLAIN, 13)); resetButton.setBounds(30, 289, 164, 45); failureModesPanel.add(resetButton); engineFailureButton.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { brakeFailureButton.setEnabled(false); signalPickupFailureButton.setEnabled(false); train.activateEngineFailure(); } }); brakeFailureButton.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { engineFailureButton.setEnabled(false); signalPickupFailureButton.setEnabled(false); train.activateBrakeFailure(); } }); signalPickupFailureButton.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { brakeFailureButton.setEnabled(false); engineFailureButton.setEnabled(false); train.activateSignalPickupFailure(); } }); resetButton.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { brakeFailureButton.setEnabled(true); engineFailureButton.setEnabled(true); signalPickupFailureButton.setEnabled(true); train.deactivateEngineFailure(); train.deactivateBrakeFailure(); train.deactivateSignalPickupFailure(); } }); JPanel enginePwrPanel = new JPanel(); enginePwrPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); enginePwrPanel.setBounds(506, 23, 144, 70); frmTrainmodelmodule.getContentPane().add(enginePwrPanel); enginePwrPanel.setLayout(null); JLabel lblEnginePwr = new JLabel("Engine Power"); lblEnginePwr.setBounds(19, 0, 106, 22); enginePwrPanel.add(lblEnginePwr); lblEnginePwr.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblEnginePwr.setHorizontalAlignment(SwingConstants.CENTER); txtEnginePower = new JTextField(); txtEnginePower.setBounds(6, 28, 131, 28); enginePwrPanel.add(txtEnginePower); txtEnginePower.setEditable(false); txtEnginePower.setHorizontalAlignment(SwingConstants.CENTER); txtEnginePower.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtEnginePower.setColumns(10); JPanel brkInputPanel = new JPanel(); brkInputPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); brkInputPanel.setBounds(243, 23, 251, 347); frmTrainmodelmodule.getContentPane().add(brkInputPanel); brkInputPanel.setLayout(null); JLabel lblBrkInputs = new JLabel("Brake Inputs"); lblBrkInputs.setBounds(71, 13, 101, 22); brkInputPanel.add(lblBrkInputs); lblBrkInputs.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblBrkInputs.setHorizontalAlignment(SwingConstants.CENTER); JButton tglbtnServiceBrake = new JButton("Service Brake"); tglbtnServiceBrake.setFont(new Font("Times New Roman", Font.PLAIN, 13)); tglbtnServiceBrake.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent o) { switchServiceBrakeStatus(); } }); tglbtnServiceBrake.setSelected(false); tglbtnServiceBrake.setBounds(12, 213, 228, 121); brkInputPanel.add(tglbtnServiceBrake); JButton tglbtnEmergencyBrake = new JButton("Passenger Emergency Brake"); tglbtnEmergencyBrake.setFont(new Font("Times New Roman", Font.PLAIN, 13)); tglbtnEmergencyBrake.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent y) { switchEmergencyBrakeStatus(); } }); tglbtnEmergencyBrake.setSelected(false); tglbtnEmergencyBrake.setBounds(12, 56, 228, 121); brkInputPanel.add(tglbtnEmergencyBrake); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Fixed values on the gui JLabel lblLength = new JLabel("Length:"); lblLength.setHorizontalAlignment(SwingConstants.LEFT); lblLength.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblLength.setBounds(47, 398, 60, 22); frmTrainmodelmodule.getContentPane().add(lblLength); JLabel lblWidth = new JLabel("Width:"); lblWidth.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblWidth.setBounds(54, 430, 53, 22); frmTrainmodelmodule.getContentPane().add(lblWidth); JLabel lblHeight = new JLabel("Height:"); lblHeight.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblHeight.setBounds(50, 462, 57, 22); frmTrainmodelmodule.getContentPane().add(lblHeight); JLabel lblEmptyMass = new JLabel("Empty Mass:"); lblEmptyMass.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblEmptyMass.setBounds(6, 493, 101, 22); frmTrainmodelmodule.getContentPane().add(lblEmptyMass); JLabel lblEmergencyBrakeDeceleration = new JLabel("Emergency Brake Deceleration Limit:"); lblEmergencyBrakeDeceleration.setHorizontalAlignment(SwingConstants.LEFT); lblEmergencyBrakeDeceleration.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblEmergencyBrakeDeceleration.setBounds(285, 394, 291, 22); frmTrainmodelmodule.getContentPane().add(lblEmergencyBrakeDeceleration); JLabel lblServiceBrakeAcceleration = new JLabel("Service Brake Deceleration Limit:"); lblServiceBrakeAcceleration.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblServiceBrakeAcceleration.setBounds(315, 429, 261, 22); frmTrainmodelmodule.getContentPane().add(lblServiceBrakeAcceleration); JLabel lblAccelerationLimit = new JLabel("Acceleration Limit:"); lblAccelerationLimit.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblAccelerationLimit.setBounds(426, 462, 150, 22); frmTrainmodelmodule.getContentPane().add(lblAccelerationLimit); JLabel lblMaxEnginePower = new JLabel("Max Engine Power:"); lblMaxEnginePower.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblMaxEnginePower.setBounds(771, 394, 151, 22); frmTrainmodelmodule.getContentPane().add(lblMaxEnginePower); JLabel lblMaxSpeed = new JLabel("Max Speed:"); lblMaxSpeed.setHorizontalAlignment(SwingConstants.LEFT); lblMaxSpeed.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblMaxSpeed.setBounds(831, 428, 91, 22); frmTrainmodelmodule.getContentPane().add(lblMaxSpeed); txtLength = new JTextField(); txtLength.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtLength.setText("105.64 ft"); txtLength.setEditable(false); txtLength.setBounds(115, 397, 116, 22); frmTrainmodelmodule.getContentPane().add(txtLength); txtLength.setColumns(10); txtWidth = new JTextField(); txtWidth.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtWidth.setText("8.69 ft"); txtWidth.setEditable(false); txtWidth.setColumns(10); txtWidth.setBounds(115, 431, 116, 22); frmTrainmodelmodule.getContentPane().add(txtWidth); txtHeight = new JTextField(); txtHeight.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtHeight.setText("11.22 ft"); txtHeight.setEditable(false); txtHeight.setColumns(10); txtHeight.setBounds(115, 463, 116, 22); frmTrainmodelmodule.getContentPane().add(txtHeight); txtEmptyMass = new JTextField(); txtEmptyMass.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtEmptyMass.setText("90169.07 lbs"); txtEmptyMass.setEditable(false); txtEmptyMass.setColumns(10); txtEmptyMass.setBounds(115, 494, 116, 22); frmTrainmodelmodule.getContentPane().add(txtEmptyMass); txtEBrakeDecel = new JTextField(); txtEBrakeDecel.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtEBrakeDecel.setText("- 8.96 (ft)/(s^2)"); txtEBrakeDecel.setEditable(false); txtEBrakeDecel.setColumns(10); txtEBrakeDecel.setBounds(584, 397, 127, 22); frmTrainmodelmodule.getContentPane().add(txtEBrakeDecel); txtSBrakeDecel = new JTextField(); txtSBrakeDecel.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtSBrakeDecel.setText("- 3.94 (ft)/(s^2)"); txtSBrakeDecel.setEditable(false); txtSBrakeDecel.setColumns(10); txtSBrakeDecel.setBounds(584, 431, 127, 22); frmTrainmodelmodule.getContentPane().add(txtSBrakeDecel); txtAccelLim = new JTextField(); txtAccelLim.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtAccelLim.setText("1.64 (ft)/(s^2)"); txtAccelLim.setEditable(false); txtAccelLim.setColumns(10); txtAccelLim.setBounds(584, 463, 127, 22); frmTrainmodelmodule.getContentPane().add(txtAccelLim); txtMaxEnginePwr = new JTextField(); txtMaxEnginePwr.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtMaxEnginePwr.setText("120000 W"); txtMaxEnginePwr.setEditable(false); txtMaxEnginePwr.setColumns(10); txtMaxEnginePwr.setBounds(927, 396, 116, 22); frmTrainmodelmodule.getContentPane().add(txtMaxEnginePwr); txtMaxSpeed = new JTextField(); txtMaxSpeed.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtMaxSpeed.setText("43.50 mph"); txtMaxSpeed.setEditable(false); txtMaxSpeed.setColumns(10); txtMaxSpeed.setBounds(927, 430, 116, 22); frmTrainmodelmodule.getContentPane().add(txtMaxSpeed); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// JPanel doorPanel = new JPanel(); doorPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); doorPanel.setBounds(506, 252, 272, 118); frmTrainmodelmodule.getContentPane().add(doorPanel); doorPanel.setLayout(null); JLabel lblLeftDoorsStatus = new JLabel("Left Doors Status:"); lblLeftDoorsStatus.setBounds(23, 44, 142, 22); doorPanel.add(lblLeftDoorsStatus); lblLeftDoorsStatus.setFont(new Font("Times New Roman", Font.BOLD, 18)); JLabel lblRightDoorsStatus = new JLabel("Right Doors Status:"); lblRightDoorsStatus.setBounds(12, 70, 153, 22); doorPanel.add(lblRightDoorsStatus); lblRightDoorsStatus.setHorizontalAlignment(SwingConstants.LEFT); lblRightDoorsStatus.setFont(new Font("Times New Roman", Font.BOLD, 18)); JLabel lblNewLabel_5 = new JLabel("Doors"); lblNewLabel_5.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblNewLabel_5.setBounds(112, 13, 56, 16); doorPanel.add(lblNewLabel_5); textLeftDoorStat = new JTextField(); textLeftDoorStat.setHorizontalAlignment(SwingConstants.CENTER); textLeftDoorStat.setFont(new Font("Times New Roman", Font.PLAIN, 13)); textLeftDoorStat.setEditable(false); textLeftDoorStat.setColumns(10); textLeftDoorStat.setBounds(176, 45, 84, 22); doorPanel.add(textLeftDoorStat); textRightDoorStat = new JTextField(); textRightDoorStat.setHorizontalAlignment(SwingConstants.CENTER); textRightDoorStat.setFont(new Font("Times New Roman", Font.PLAIN, 13)); textRightDoorStat.setEditable(false); textRightDoorStat.setColumns(10); textRightDoorStat.setBounds(176, 71, 84, 22); doorPanel.add(textRightDoorStat); JPanel brakePanel = new JPanel(); brakePanel.setLayout(null); brakePanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); brakePanel.setBounds(790, 252, 338, 118); frmTrainmodelmodule.getContentPane().add(brakePanel); JLabel lblEmergencyBrakeStatus = new JLabel("Emergency Brake Status:"); lblEmergencyBrakeStatus.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblEmergencyBrakeStatus.setBounds(12, 44, 194, 22); brakePanel.add(lblEmergencyBrakeStatus); JLabel lblServiceBrakeStatus = new JLabel("Service Brake Status:"); lblServiceBrakeStatus.setHorizontalAlignment(SwingConstants.LEFT); lblServiceBrakeStatus.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblServiceBrakeStatus.setBounds(42, 76, 164, 22); brakePanel.add(lblServiceBrakeStatus); JLabel lblBrakes = new JLabel("Brakes"); lblBrakes.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblBrakes.setBounds(159, 13, 56, 16); brakePanel.add(lblBrakes); trainSelectBox.setFont(new Font("Times New Roman", Font.PLAIN, 13)); trainSelectBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent arg0) { if (arg0.getStateChange() == ItemEvent.SELECTED) { Integer trainID = (Integer) arg0.getItem(); switchTrain(trainID); } } }); trainSelectBox.setBounds(1060, 23, 58, 20); frmTrainmodelmodule.getContentPane().add(trainSelectBox); txtEBrkStat = new JTextField(); txtEBrkStat.setHorizontalAlignment(SwingConstants.CENTER); txtEBrkStat.setFont(new Font("Times New Roman", Font.PLAIN, 13)); txtEBrkStat.setEditable(false); txtEBrkStat.setColumns(10); txtEBrkStat.setBounds(209, 45, 116, 22); brakePanel.add(txtEBrkStat); txtSBrkStat = new JTextField(); txtSBrkStat.setHorizontalAlignment(SwingConstants.CENTER); txtSBrkStat.setFont(new Font("Times New Roman", Font.PLAIN, 13)); txtSBrkStat.setEditable(false); txtSBrkStat.setColumns(10); txtSBrkStat.setBounds(209, 77, 116, 22); brakePanel.add(txtSBrkStat); JPanel setSpdPanel = new JPanel(); setSpdPanel.setLayout(null); setSpdPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); setSpdPanel.setBounds(662, 23, 144, 70); frmTrainmodelmodule.getContentPane().add(setSpdPanel); JLabel lblSetSpd = new JLabel("Target Speed"); lblSetSpd.setHorizontalAlignment(SwingConstants.CENTER); lblSetSpd.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblSetSpd.setBounds(19, 0, 106, 22); setSpdPanel.add(lblSetSpd); txtSetSpd = new JTextField(); txtSetSpd.setHorizontalAlignment(SwingConstants.CENTER); txtSetSpd.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtSetSpd.setEditable(false); txtSetSpd.setColumns(10); txtSetSpd.setBounds(6, 28, 131, 28); setSpdPanel.add(txtSetSpd); JPanel Authoritypanel = new JPanel(); Authoritypanel.setLayout(null); Authoritypanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); Authoritypanel.setBounds(818, 23, 144, 70); frmTrainmodelmodule.getContentPane().add(Authoritypanel); JLabel lblAuthority = new JLabel("Authority"); lblAuthority.setHorizontalAlignment(SwingConstants.CENTER); lblAuthority.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblAuthority.setBounds(19, 0, 106, 22); Authoritypanel.add(lblAuthority); txtAuthority = new JTextField(); txtAuthority.setHorizontalAlignment(SwingConstants.CENTER); txtAuthority.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtAuthority.setEditable(false); txtAuthority.setColumns(10); txtAuthority.setBounds(6, 28, 131, 28); Authoritypanel.add(txtAuthority); JPanel blkSpdLimPanel = new JPanel(); blkSpdLimPanel.setLayout(null); blkSpdLimPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); blkSpdLimPanel.setBounds(506, 135, 144, 70); frmTrainmodelmodule.getContentPane().add(blkSpdLimPanel); JLabel lblBlockSpeedLimit = new JLabel("Block Speed Limit"); lblBlockSpeedLimit.setHorizontalAlignment(SwingConstants.CENTER); lblBlockSpeedLimit.setFont(new Font("Times New Roman", Font.BOLD, 16)); lblBlockSpeedLimit.setBounds(6, 0, 131, 22); blkSpdLimPanel.add(lblBlockSpeedLimit); txtBockSpdLim = new JTextField(); txtBockSpdLim.setHorizontalAlignment(SwingConstants.CENTER); txtBockSpdLim.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtBockSpdLim.setEditable(false); txtBockSpdLim.setColumns(10); txtBockSpdLim.setBounds(6, 28, 131, 28); blkSpdLimPanel.add(txtBockSpdLim); JPanel currSpeedPanel = new JPanel(); currSpeedPanel.setLayout(null); currSpeedPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); currSpeedPanel.setBounds(662, 135, 144, 70); frmTrainmodelmodule.getContentPane().add(currSpeedPanel); JLabel lblCurrSpd = new JLabel("Current Speed"); lblCurrSpd.setHorizontalAlignment(SwingConstants.CENTER); lblCurrSpd.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblCurrSpd.setBounds(6, 0, 131, 22); currSpeedPanel.add(lblCurrSpd); txtCurrSpd = new JTextField(); txtCurrSpd.setHorizontalAlignment(SwingConstants.CENTER); txtCurrSpd.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtCurrSpd.setEditable(false); txtCurrSpd.setColumns(10); txtCurrSpd.setBounds(6, 28, 131, 28); currSpeedPanel.add(txtCurrSpd); JPanel accelPanel = new JPanel(); accelPanel.setLayout(null); accelPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2)); accelPanel.setBounds(818, 135, 144, 70); frmTrainmodelmodule.getContentPane().add(accelPanel); JLabel lblAcceleration = new JLabel("Acceleration"); lblAcceleration.setHorizontalAlignment(SwingConstants.CENTER); lblAcceleration.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblAcceleration.setBounds(19, 0, 106, 22); accelPanel.add(lblAcceleration); txtAccel = new JTextField(); txtAccel.setHorizontalAlignment(SwingConstants.CENTER); txtAccel.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtAccel.setEditable(false); txtAccel.setColumns(10); txtAccel.setBounds(6, 28, 131, 28); accelPanel.add(txtAccel); JPanel panel_5 = new JPanel(); panel_5.setLayout(null); panel_5.setBorder(new LineBorder(new Color(0, 0, 0), 2)); panel_5.setBounds(974, 135, 144, 70); frmTrainmodelmodule.getContentPane().add(panel_5); JLabel lblGrade = new JLabel("Grade"); lblGrade.setHorizontalAlignment(SwingConstants.CENTER); lblGrade.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblGrade.setBounds(19, 0, 106, 22); panel_5.add(lblGrade); txtGrade = new JTextField(); txtGrade.setHorizontalAlignment(SwingConstants.CENTER); txtGrade.setFont(new Font("Times New Roman", Font.PLAIN, 18)); txtGrade.setEditable(false); txtGrade.setColumns(10); txtGrade.setBounds(6, 28, 131, 28); panel_5.add(txtGrade); JLabel lblTrainId = new JLabel("Train ID:"); lblTrainId.setFont(new Font("Times New Roman", Font.BOLD, 18)); lblTrainId.setBounds(985, 22, 74, 20); frmTrainmodelmodule.getContentPane().add(lblTrainId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BreukFrame() {\n super();\n initialize();\n }", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}", "public SiscobanFrame() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1100, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tsetUIComponents();\n\t\tsetControllers();\n\n\t}", "private void initialize() {\r\n\t\tthis.setSize(530, 329);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\taddSampleData();\n\t\tsetDefaultSettings();\n\t\topenHomePage();\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"Media Inventory\");\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(0, 0, 1000, 700);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tframeContent = new JPanel();\n\t\tframe.getContentPane().add(frameContent);\n\t\tframeContent.setBounds(10, 10, 700, 640);\n\t\tframeContent.setLayout(null);\n\t\t\n\t\tinfoPane = new JPanel();\n\t\tframe.getContentPane().add(infoPane);\n\t\tinfoPane.setBounds(710, 10, 300, 640);\n\t\tinfoPane.setLayout(null);\n\t}", "private void initialize() {\n\t\tframe = new JFrame(\"BirdSong\");\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t\tframe.setBounds(100, 100, 400, 200);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tabc = new BirdPanel();\n\t\ttime = new TimePanel();\n\t\tgetContentPane().setLayout(new BoxLayout(frame, BoxLayout.Y_AXIS));\n\n\t\tframe.getContentPane().add(abc, BorderLayout.NORTH);\n\t\tframe.getContentPane().add(time, BorderLayout.CENTER);\n\t}", "private void initialize() {\r\n\t\tthis.setSize(311, 153);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tsetCancelButton( btnCancel );\r\n\t}", "public Frame() {\n initComponents();\n }", "public Frame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(497, 316);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JFrame\");\r\n\t\tthis.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "protected HFrame(){\n\t\tinit();\n\t}", "private void initializeFields() {\r\n myFrame = new JFrame();\r\n myFrame.setSize(DEFAULT_SIZE);\r\n }", "private void initialize() {\n\t\tthis.setSize(329, 270);\n\t\tthis.setContentPane(getJContentPane());\n\t}", "private void initialize() {\r\n\t\t//setFrame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(125,175, 720, 512);\r\n\t\tframe.setTitle(\"Periodic Table\");\r\n\t\tframe.setResizable(false);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void initFrame() {\n setLayout(new BorderLayout());\n }", "private void initialize() {\n\t\tthis.setSize(300, 300);\n\t\tthis.setIconifiable(true);\n\t\tthis.setClosable(true);\n\t\tthis.setTitle(\"Sobre\");\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setFrameIcon(new ImageIcon(\"images/16x16/info16x16.gif\"));\n\t}", "public FrameControl() {\n initComponents();\n }", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "public MainFrame() {\n initComponents();\n \n }", "private void init(Element frame) {\n\t\tthis.frameWidth = Integer.parseInt(frame.attributeValue(\"width\"));\n\t\tthis.frameHeight = Integer.parseInt(frame.attributeValue(\"height\"));\n\t\tthis.paddle = Integer.parseInt(frame.attributeValue(\"paddle\"));\n\t\tthis.size = Integer.parseInt(frame.attributeValue(\"size\"));\n\t}", "public MainFrame() {\n \n initComponents();\n \n this.initNetwork();\n \n this.render();\n \n }", "public internalFrame() {\r\n initComponents();\r\n }", "private void initialize() {\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setSize(810, 600);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n\t\tthis.setModal(true);\n\t\tthis.setResizable(false);\n\t\tthis.setName(\"FramePrincipalLR\");\n\t\tthis.setTitle(\"CR - Lista de Regalos\");\n\t\tthis.setLocale(new java.util.Locale(\"es\", \"VE\", \"\"));\n\t\tthis.setUndecorated(false);\n\t}", "public Mainframe() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(392, 496);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"Informações\");\r\n\t}", "private void initialize() {\n this.setSize(253, 175);\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setContentPane(getJContentPane());\n this.setTitle(\"Breuken vereenvoudigen\");\n }", "private void initialize() {\r\n\t\t// Initialize main frame\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(Constants.C_MAIN_PREFERED_POSITION_X_AT_START, Constants.C_MAIN_PREFERED_POSITION_Y_AT_START, \r\n\t\t\t\tConstants.C_MAIN_PREFERED_SIZE_X, Constants.C_MAIN_PREFERED_SIZE_Y);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.setTitle(Constants.C_MAIN_WINDOW_TITLE);\r\n\t\t\r\n\t\t// Tab panel and their panels\r\n\t\tmainTabbedPane = new JTabbedPane(JTabbedPane.TOP);\r\n\t\tframe.getContentPane().add(mainTabbedPane, BorderLayout.CENTER);\r\n\t\t\r\n\t\tpanelDecision = new DecisionPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_DECISION_TITLE, null, panelDecision, null);\r\n\t\t\r\n\t\tpanelCalculation = new CalculationPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_CALCULATION_TITLE, null, panelCalculation, null);\r\n\t\t\r\n\t\tpanelLibrary = new LibraryPanel();\r\n\t\tmainTabbedPane.addTab(Constants.C_TAB_LIBRARY_TITLE, null, panelLibrary, null);\r\n\t\t\r\n\t\t// Menu bar\r\n\t\tmenuBar = new JMenuBar();\r\n\t\tframe.setJMenuBar(menuBar);\r\n\t\tcreateMenus();\r\n\t}", "public void initializeFrame() {\n frame.getContentPane().removeAll();\n createComponents(frame.getContentPane());\n// frame.setSize(new Dimension(1000, 600));\n }", "private void initialize() {\r\n\t\t// this.setSize(271, 295);\r\n\t\tthis.setSize(495, 392);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(ResourceBundle.getBundle(\"Etiquetas\").getString(\"MainTitle\"));\r\n\t}", "private void initializeFrame() {\n add(container);\n setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n pack();\n }", "private void initialize() {\n this.setSize(300, 200);\n this.setContentPane(getJContentPane());\n this.pack();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"DB Filler\");\n\t\tframe.setBounds(100, 100, 700, 500);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tdbc = new DataBaseConnector();\n\t\tcreateFileChooser();\n\n\t\taddTabbedPane();\n\t\tsl_panel = new SpringLayout();\n\t\taddAddFilePanel();\n\t}", "public mainframe() {\n initComponents();\n }", "public FrameDesign() {\n initComponents();\n }", "public Jframe() {\n initComponents();\n setIndice();\n loadTextBoxs();\n }", "public JGSFrame() {\n\tsuper();\n\tinitialize();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n try {\n initComponents();\n initElements();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error \" + e.getMessage());\n }\n }", "private void initialize() {\n this.setSize(495, 276);\n this.setTitle(\"Translate Frost\");\n this.setContentPane(getJContentPane());\n }", "private void initialize() {\r\n\t\t// set specific properties and add inner components.\r\n\t\tthis.setBorder(BorderFactory.createEtchedBorder());\r\n\t\tthis.setSize(300, 400);\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\taddComponents();\r\n\t}", "private void initialize() {\r\n\t\tthis.setBounds(new Rectangle(0, 0, 670, 576));\r\n\t\tthis.setResizable(false);\r\n\t\tthis.setTitle(\"数据入库 \");\r\n\t\tthis.setLocationRelativeTo(getOwner());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public void initializePanelToFrame() {\n\t\tnew ColorResources();\n\t\tnew TextResources().changeLanguage();\n\t\tpanel = new JPanel();\n\t\tpanel.setLayout(null);\n\t\tpanel.setPreferredSize(new Dimension(375, 812));\n\n\t\tconfigureLabels();\n\t\tconfigureButtons();\n\t\taddListeners();\n\t\taddComponentsToPanel();\n\n\t\tthis.setContentPane(panel);\n\t\tthis.pack();\n\t}", "private void initialize() {\n this.setLayout(new BorderLayout());\n this.setSize(new java.awt.Dimension(564, 229));\n this.add(getMessagePanel(), java.awt.BorderLayout.NORTH);\n this.add(getBalloonSettingsListBox(), java.awt.BorderLayout.CENTER);\n this.add(getBalloonSettingsButtonPane(), java.awt.BorderLayout.SOUTH);\n\n editBalloonSettingsFrame = new EditBalloonSettingsFrame();\n\n }", "public SMFrame() {\n initComponents();\n updateComponents();\n }", "private void initialize() {\n m_frame = new JFrame(\"Video Recorder\");\n m_frame.setResizable(false);\n m_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n m_frame.setLayout(new BorderLayout());\n m_frame.add(buildContentPanel(), BorderLayout.CENTER);\n\n JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 5));\n JButton startButton = new JButton(\"Start\");\n startButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent ae) {\n listen();\n }\n });\n buttonPanel.add(startButton);\n\n m_connectionLabel = new JLabel(\"Disconnected\");\n m_connectionLabel.setOpaque(true);\n m_connectionLabel.setBackground(Color.RED);\n m_connectionLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 3));\n m_connectionLabel.setPreferredSize(new Dimension(100, 26));\n m_connectionLabel.setHorizontalAlignment(SwingConstants.CENTER);\n buttonPanel.add(m_connectionLabel);\n\n m_frame.add(buttonPanel, BorderLayout.PAGE_END);\n }", "public FirstNewFrame() {\n\t\tjbInit();\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Play\");\n\t\tbtnNewButton.setFont(new Font(\"Bodoni 72\", Font.BOLD, 13));\n\t\tbtnNewButton.setBounds(frame.getWidth() / 2 - 60, 195, 120, 30);\n\t\tframe.getContentPane().add(btnNewButton);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Space Escape\");\n\t\tlblNewLabel.setForeground(Color.WHITE);\n\t\tlblNewLabel.setFont(new Font(\"Bodoni 72\", Font.BOLD, 24));\n\t\tlblNewLabel.setBounds(frame.getWidth() / 2 - 60, 30, 135, 25);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"New label\");\n\t\tlblNewLabel_1.setBounds(0, 0, frame.getWidth(), frame.getHeight());\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t}", "private void initializeFrame()\r\n\t{\r\n\t\tthis.setResizable(false);\r\n\r\n\t\tsetSize(DIMENSIONS); // set the correct dimensions\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetLayout( new GridLayout(1,1) );\r\n\t}", "private void setupFrame()\n\t{\n\t\tthis.setContentPane(botPanel);\n\t\tthis.setSize(800,700);\n\t\tthis.setTitle(\"- Chatbot v.2.1 -\");\n\t\tthis.setResizable(true);\n\t\tthis.setVisible(true);\n\t}", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public EmulatorFrame() {\r\n\t\tsuper(\"Troyboy Chip8 Emulator\");\r\n\t\t\r\n\t\tsetNativeLAndF();\r\n\t\tinitComponents();\r\n\t\tinitMenubar();\r\n\t\tsetupLayout();\r\n\t\tinitFrame();\r\n\t\t//frame is now ready to run a game\r\n\t\t//running of any games must be started by loading a ROM\r\n\t}", "public void init()\n {\n buildUI(getContentPane());\n }", "private void initialize()\n {\n this.setTitle( \"SerialComm\" ); // Generated\n this.setSize( 500, 300 );\n this.setContentPane( getJContentPane() );\n }", "public launchFrame() {\n \n initComponents();\n \n }", "private void initialize() {\r\n\t\tthis.setSize(378, 283);\r\n\t\tthis.setJMenuBar(getMenubar());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"JAVIER\");\r\n\t}", "private void initialize() {\n\t\tthis.setSize(430, 280);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setUndecorated(true);\n\t\tthis.setModal(true);\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setTitle(\"Datos del Invitado\");\n\t\tthis.addComponentListener(this);\n\t}", "public PilaFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 900, 900);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tgame = new Game();\n\t\t\n\t\tGameTable puzzle = new GameTable(game.getPuzzle());\n\t\tpuzzle.setBounds(100, 100, 700, 700);\n\t\t\n\t\tframe.add(puzzle);\n\t\t\n\t\tSystem.out.println(\"SAD\");\n\t\t\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setResizable(false);\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tPanel mainFramePanel = new Panel();\r\n\t\tmainFramePanel.setBounds(10, 10, 412, 235);\r\n\t\tframe.getContentPane().add(mainFramePanel);\r\n\t\tmainFramePanel.setLayout(null);\r\n\t\t\r\n\t\tfinal TextField textField = new TextField();\r\n\t\ttextField.setBounds(165, 62, 79, 24);\r\n\t\tmainFramePanel.add(textField);\r\n\t\t\r\n\t\tButton changeTextButt = new Button(\"Change Text\");\r\n\t\tchangeTextButt.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\ttextField.setText(\"Domograf\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tchangeTextButt.setBounds(165, 103, 79, 24);\r\n\t\tmainFramePanel.add(changeTextButt);\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setResizable(false);\n\t\tframe.setAlwaysOnTop(true);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t}", "StudentFrame() {\n \tgetContentPane().setFont(new Font(\"Times New Roman\", Font.PLAIN, 11));\n s1 = null; // setting to null\n initializeComponents(); // causes frame components to be initialized\n }", "private void initialize() {\r\n\t\tthis.setSize(300, 200);\r\n\t\tthis.setTitle(\"Error\");\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public NewFrame() {\n initComponents();\n }", "public SerialCommFrame()\n {\n super();\n initialize();\n }", "public LoginFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public BaseFrame() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setSize(733, 427);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t\tthis.setTitle(\"jProxyChecker\");\r\n\t}", "public frame() {\r\n\t\tadd(createMainPanel());\r\n\t\tsetTitle(\"Lunch Date\");\r\n\t\tsetSize(FRAME_WIDTH, FRAME_HEIGHT);\r\n\r\n\t}", "public MercadoFrame() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 800, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJPanel browserPanel = new JPanel();\n\t\tframe.getContentPane().add(browserPanel, BorderLayout.CENTER);\n\t\t\n\t\t// create javafx panel for browser\n browserFxPanel = new JFXPanel();\n browserPanel.add(browserFxPanel);\n \n // create JavaFX scene\n Platform.runLater(new Runnable() {\n public void run() {\n createScene();\n }\n });\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(X_FRAME, Y_FRAME, WIDTH_FRAME, HEIGHT_FRAME);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJButton btnAddSong = new JButton(\"Add song\");\r\n\t\tbtnAddSong.setBounds(X_BTN, Y_ADDSONG, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddSong);\r\n\t\t\r\n\t\tJTextPane txtpnBlancoYNegro = new JTextPane();\r\n\t\ttxtpnBlancoYNegro.setText(\"Blanco y negro\\r\\nThe Spectre\\r\\nGirasoles\\r\\nFaded\\r\\nTu Foto\\r\\nEsencial\");\r\n\t\ttxtpnBlancoYNegro.setBounds(X_TXT, Y_TXT, WIDTH_TXT, HEIGHT_TXT);\r\n\t\tframe.getContentPane().add(txtpnBlancoYNegro);\r\n\t\t\r\n\t\tJLabel lblSongs = new JLabel(\"Songs\");\r\n\t\tlblSongs.setBounds(X_LBL, Y_LBL, WIDTH_LBL, HEIGHT_LBL);\r\n\t\tframe.getContentPane().add(lblSongs);\r\n\t\t\r\n\t\tJButton btnAddAlbum = new JButton(\"Add album\");\r\n\t\tbtnAddAlbum.setBounds(X_BTN, Y_ADDALBUM, WIDTH_BTN, HEIGHT_BTN);\r\n\t\tframe.getContentPane().add(btnAddAlbum);\r\n\t}", "public holdersframe() {\n initComponents();\n }", "public void init() {\n\t\tsetSize(500,300);\n\t}", "private void setupFrame()\n\t\t{\n\t\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\tthis.setResizable(false);\n\t\t\tthis.setSize(800, 600);\n\t\t\tthis.setTitle(\"SEKA Client\");\n\t\t\tthis.setContentPane(panel);\n\t\t\tthis.setVisible(true);\n\t\t}", "public addStFrame() {\n initComponents();\n }", "public JFrame() {\n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "private void initialize() {\n\t\tframe = new JFrame(\"View Report\");\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\n\t\tJButton backButton = new JButton(\"Back\");\n\t\tbackButton.setBounds(176, 227, 89, 23);\n\t\tframe.getContentPane().add(backButton);\n\t\tbackButton.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tframe.setVisible(false);\n\t\t\t}\n\t\t});\n\t\t\n\t\tJTextArea textArea = new JTextArea();\n\t\ttextArea.setBounds(50, 30, 298, 173);\n\t\tframe.getContentPane().add(textArea);\n\t\ttextArea.append(control.seeReport());\n\t\tframe.setVisible(true);\n\t}", "private void initialize() {\r\n this.setSize(new Dimension(666, 723));\r\n this.setContentPane(getJPanel());\r\n\t\t\t\r\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblSubmission = new JLabel(\"Submission\");\n\t\tlblSubmission.setForeground(Color.WHITE);\n\t\tlblSubmission.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 16));\n\t\tlblSubmission.setBounds(164, 40, 83, 14);\n\t\tframe.getContentPane().add(lblSubmission);\n\t\t\n\t\tJLabel lblTitle = new JLabel(\"Title:\");\n\t\tlblTitle.setForeground(Color.WHITE);\n\t\tlblTitle.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblTitle.setBounds(77, 117, 41, 14);\n\t\tframe.getContentPane().add(lblTitle);\n\t\t\n\t\tJLabel lblPath = new JLabel(\"Path:\");\n\t\tlblPath.setForeground(Color.WHITE);\n\t\tlblPath.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tlblPath.setBounds(85, 155, 33, 14);\n\t\tframe.getContentPane().add(lblPath);\n\t\t\n\t\ttitle = new JTextField();\n\t\ttitle.setBounds(128, 116, 197, 20);\n\t\tframe.getContentPane().add(title);\n\t\ttitle.setColumns(10);\n\t\t\n\t\tpath = new JTextField();\n\t\tpath.setBounds(128, 154, 197, 20);\n\t\tframe.getContentPane().add(path);\n\t\tpath.setColumns(10);\n\t\t\n\t\tbtnSubmit = new JButton(\"Submit\");\n\t\tbtnSubmit.setBackground(Color.BLACK);\n\t\tbtnSubmit.setForeground(Color.WHITE);\n\t\tbtnSubmit.setFont(new Font(\"Comic Sans MS\", Font.PLAIN, 14));\n\t\tbtnSubmit.setBounds(158, 210, 89, 23);\n\t\tframe.getContentPane().add(btnSubmit);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tframe.setVisible(true);\n\t}", "public void init() {\r\n\t\t\r\n\t\tsetSize(WIDTH, HEIGHT);\r\n\t\tColor backgroundColor = new Color(60, 0, 60);\r\n\t\tsetBackground(backgroundColor);\r\n\t\tintro = new GImage(\"EvilMehranIntroGraphic.png\");\r\n\t\tintro.setLocation(0,0);\r\n\t\tadd(intro);\r\n\t\tplayMusic(new File(\"EvilMehransLairThemeMusic.wav\"));\r\n\t\tinitAnimationArray();\r\n\t\taddKeyListeners();\r\n\t\taddMouseListeners();\r\n\t\twaitForClick();\r\n\t\tbuildWorld();\r\n\t}", "public FrameIntroGUI() {\n\t\ttry {\n\t\t\tjbInit();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initialize() {\n\t\tthis.setBounds(100, 100, 950, 740);\n\t\tthis.setLayout(null);\n\n\t\n\t}", "private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblCoisa = new JLabel(\"Coisa\");\n\t\tlblCoisa.setBounds(10, 11, 46, 14);\n\t\tframe.getContentPane().add(lblCoisa);\n\t\t\n\t\ttextField = new JTextField();\n\t\ttextField.setBounds(39, 8, 86, 20);\n\t\tframe.getContentPane().add(textField);\n\t\ttextField.setColumns(10);\n\t}", "private void initialize() {\n\t\tthis.setExtendedState(Frame.MAXIMIZED_BOTH);\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setResizable(true);\n\t\tthis.screenDimensions = Toolkit.getDefaultToolkit().getScreenSize();\n\t\tthis.getContentPane().setLayout(new BorderLayout());\n\t\t// Initialize SubComponents and GUI Commands\n\t\tthis.initializeSplitPane();\n\t\tthis.initializeExplorer();\n\t\tthis.initializeConsole();\n\t\tthis.initializeMenuBar();\n\t\tthis.pack();\n\t\tthis.hydraExplorer.refreshExplorer();\n\t}" ]
[ "0.77704835", "0.75652915", "0.7442664", "0.7369101", "0.7366378", "0.7358479", "0.73146075", "0.73096764", "0.72987294", "0.72978777", "0.7278321", "0.72729623", "0.7269468", "0.7269468", "0.7215727", "0.7180792", "0.71682984", "0.7140954", "0.7140953", "0.7126852", "0.7107974", "0.7100368", "0.7092515", "0.708178", "0.70652425", "0.70630395", "0.70621413", "0.7060283", "0.70517516", "0.7043992", "0.6996167", "0.6978269", "0.6971387", "0.6956391", "0.6938475", "0.6929829", "0.6929629", "0.69251114", "0.6921989", "0.6920365", "0.6914633", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.6911002", "0.69020075", "0.68911743", "0.6886017", "0.6873457", "0.6870402", "0.68686837", "0.68669385", "0.686311", "0.68616706", "0.68552315", "0.68537515", "0.681551", "0.68141145", "0.68094325", "0.67992085", "0.67930394", "0.6782133", "0.6765297", "0.6748138", "0.6731745", "0.6716807", "0.6711878", "0.6706194", "0.6697453", "0.6692831", "0.66927665", "0.6689213", "0.66724384", "0.66606426", "0.664954", "0.6642464", "0.6640775", "0.6638488", "0.663824", "0.663545", "0.66264987", "0.6625419", "0.6611392", "0.6608291", "0.6600817", "0.66005784", "0.6591052", "0.65869486", "0.65862876", "0.65753394", "0.6575285", "0.6570335", "0.655961" ]
0.0
-1
tenure of tabu status constructors
TabuSearchwithGreedy(double wl, double ar, TransactionClass tc, Partition p, int useCase) { super(wl, ar, tc, p, useCase); // TODO Auto-generated constructor stub }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Status() {\n }", "protected Status() {\r\n\t\t;\r\n\t}", "public CreateStatus()\n {\n super(new DataMap(), null);\n }", "public Status() {\n\n }", "public Tabono() {\n }", "public StatusComponent()\n {\n }", "public Status(){\n this(StatusDescription.REGISTERED);\n }", "public IntegratedAvirUpdateStatus() {\n \n }", "public ProgressStatusList() {\n }", "public DDEBaseDescStatusBean() {\n }", "public CashFlowImportStatus() {\n\t\t// empty constructor\n\t}", "protected ClientStatus() {\n }", "private STATUS(String name) {\n this.name = name;\n }", "public Flight() {//Initial flight\n status = \"正常\";\n }", "private StatusMessage() {\n\n\t}", "private StatusMessage() {\n\n\t}", "public Ludo() {\n this.status = \"Created\";\n }", "Status(String description) {\n this.description = description;\n }", "public CreateStatus(DataMap data)\n {\n super(data, null);\n }", "UIBar(int instance, String context) {\n\tsuper(instance, context);\n\n\t// Setup object property and method table.\n\t//\n\taddObjectTable(fieldTable, null);\n }", "public StatusLabel (GlContext ctx)\n {\n super(ctx, \"\");\n }", "public AlmaStatus(AdvancedComponentClient _client,SubsystemStatus _SubsystemStatus) {\n\t\tsuper(_client);\n\t\tthis.SubsystemStatus = _SubsystemStatus;\n\t\t// TODO Auto-generated constructor stub\n\t}", "public GraficaEstatus() {\n initComponents();\n }", "private AeStatusKeeper() {\n }", "public TStateTable () {\r\n\t m_users = new TIDIndex();\r\n\t m_resources = new TIDIndex();\r\n\t m_associations = new TUseStatus[INITIAL_MAX_RESOURCES_COUNT][INITIAL_MAX_USERS_COUNT];\r\n\t for (int a=0; a<INITIAL_MAX_RESOURCES_COUNT; a++)\r\n\t for (int b=0; b<INITIAL_MAX_USERS_COUNT; b++)\r\n\t m_associations[a][b] = null;\r\n\t m_current_max_users = INITIAL_MAX_USERS_COUNT;\r\n\t m_current_max_resources = INITIAL_MAX_RESOURCES_COUNT;\r\n\t m_current_users_count = 0;\r\n\t m_current_resources_count = 0;\r\n }", "public StStatutesub() {\n }", "protected JzChronicstatusExample(JzChronicstatusExample example) {\r\n this.orderByClause = example.orderByClause;\r\n this.oredCriteria = example.oredCriteria;\r\n }", "public Stat() {\n }", "protected Status(final String name) {\r\n\t\tthis.name = name;\r\n\t}", "public ReadEJStatus2() {\r\n }", "private void getStatus() {\n\t\t\n\t}", "public Stat()\n {\n // empty constructor\n }", "public DetalleTablaComplementario() {\r\n }", "public TableObject()\r\n {\r\n\tsuper(ObjectType.Table);\r\n\tglobal = false;\r\n }", "public StatusResource() {\n this.statusService = DeathStar.getStatusService();\n logger.log(Level.FINE, \"Status resource instantiated: {0}\", this);\n }", "public GamePlayStatus() {}", "public DacGetStatusResponse() {\n super();\n this.setStatusInfoList(new LazyArrayList<StatusInfo>());\n }", "public Catelog(Integer id, String name, Integer number, Byte status) {\n this.id = id;\n this.name = name;\n this.number = number;\n this.status = status;\n }", "public void loadStatus (){\n\t}", "public ReportMakerTab() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t}", "public StatTablePanel() {\n\t\tinitComponents();\n\t\tdateLabel.setText(\"—— \"+Today.getDate());\n\t}", "private EstabelecimentoTable() {\n\t\t\t}", "private StatusType(int value, String name, String literal) {\n\t\tthis.value = value;\n\t\tthis.name = name;\n\t\tthis.literal = literal;\n\t}", "public StatusBar() {\n\t\tthis(DEFAULT_STATUS_MESSAGE, true, 1, 1, true);\n\t}", "public TriangleComponent()\n {\n status=-1;\n }", "public StatusBayar() {\n initComponents();\n }", "public HwStatus() {\n \t\tsuper();\n \t\tthis.hwSig = 0;\n \t\tthis.microtickPeriod = 10000;\t// default\n \t\tthis.cf_version = \"\";\n \t}", "public ResponseBase(Status status) {\n this.status = status;\n }", "public CursosTable() {\n \n \n }", "public Tabuada() {\n initComponents();\n }", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "public JzChronicstatusExample() {\r\n oredCriteria = new ArrayList<Criteria>();\r\n }", "public ControladorCatalogoEstado() {\r\n }", "public EmanagerDatabaseStatusCode()\n {\n }", "@Override\n\tpublic void getStatus() {\n\t\t\n\t}", "public void status() {\n System.out.println(\"Nome: \" + this.getNome());\n System.out.println(\"Data de Nascimento: \" + this.getDataNasc());\n System.out.println(\"Peso: \" + this.getPeso());\n System.out.println(\"Altura: \" + this.getAltura());\n }", "@SuppressWarnings(\"unused\")\n private ZimletAclStatusPri() {\n this((String) null);\n }", "public JsonResponse(int status) {\n super();\n this.status = status;\n }", "private ByaTableModel() {\n\t}", "public StatusBar() {\n\t\tsuper();\n\t}", "public mbvBoletinPeriodo() {\r\n }", "private static void statusCommand() {\n String lineFormat = \"%-8s | %-15s | %s\\n\";\n\n List<Job> neededJobs = fetchNeededJobs();\n\n // table header\n if (neededJobs.size() < 2) {\n System.out.printf(lineFormat, \"STATE\", \"START TIME\", \"JOB DIRECTORY\");\n for (int i = 0; i < 78; i++) {\n System.out.print(((9 == i || 27 == i) ? \"+\" : \"-\"));\n }\n System.out.println();\n }\n\n // table rows\n ObjectCounter<JobState> counter = new ObjectCounter<JobState>();\n for (Job job : neededJobs) {\n Date startDate = job.getStartDate();\n JobState state = job.getState();\n counter.add(state);\n String startDateStr = (null == startDate) ? \"N/A\" : new SimpleDateFormat(\"yyyyMMdd HHmmss\").format(startDate);\n System.out.printf(lineFormat, state.toString(), startDateStr, job.getDir());\n }\n\n // table footer\n System.out.println();\n String sumFormat = \"%6d %s\\n\";\n System.out.printf(sumFormat, heritrix.getJobs().size(), \"TOTAL JOBS\");\n for (JobState state : JobState.values()) {\n if (counter.getMap().keySet().contains(state)) {\n System.out.printf(sumFormat, counter.get(state), state.toString());\n }\n }\n }", "private EventHistoryTable() {}", "private TableAccessET() {\n\n }", "private Ambulancia() {\n this.estado = new DisponibleState(this);\n }", "public RegisterStatus() {\n registerStatus=NOT_REGISTERED;\n }", "public TesttabRecord() {\n\t\tsuper(org.jooq.h2.generated.tables.Testtab.TESTTAB);\n\t}", "public History() {\n\tthis.timestampMinute = new Date();\n\tthis.status = false;\n\n }", "public Status getStatus();", "public TTau() {}", "public TimeEntry status(StatusEnum status) {\n this.status = status;\n return this;\n }", "private Status(final String displayName) {\n this.displayname = displayName;\n }", "public fbStatusPostingValidation() {\n\t\tsuper();\t\n\t}", "protected void init_status(String id) {\n\t\tstatus.put(id, 1);\n\t\t\n\t}", "public StateHeader() { // for externalization\r\n }", "public DebugTableModel() {\r\n }", "public Estado() {\r\n //Constructor vacio\r\n }", "public status(Locale locale) {\n initComponents();\n try {\n initlocale();\n } catch (Exception e) {\n }\n setLocationRelativeTo(null);\n Bindcombo();\n }", "public abstract String currentStatus();", "MultTable() //do not use the name of the constructor for the name of another method\n {}", "private MessageStatus(int value, String name, String literal) {\n\t\tthis.value = value;\n\t\tthis.name = name;\n\t\tthis.literal = literal;\n\t}", "public MonsterStatus()\n {\n mMonster = null;\n mStatus = \"\";\n mInitial = -1;\n mIncrease = -1;\n mMax = -1;\n mDamage = -1;\n mDuration = -1;\n }", "public MastermindStatus() {\r\n super();\r\n value = new int[4];\r\n matrixMastermind = new MatrixMastermind(4, 10);\r\n currentRow = 0;\r\n }", "public Services(){\n ID = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n state = STATUS_IN_PROGRESS;\n name = \"\";\n date = \"\";\n description = \"\";\n note = \"\";\n mileage = 000000;\n }", "private void initComponents() {\n tabbedPane = new javax.swing.JTabbedPane();\n statusLabel = new javax.swing.JLabel();\n\n statusLabel.setText(\" \");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(statusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(statusLabel))\n );\n }", "private void populateStatus() {\n\t\t\n\t\tstatusList.add(new Status(MainActivity.profileUrls[1], \"Mohamed\", \"14 minutes ago\"));\n\t\tstatusList.add(new Status(MainActivity.profileUrls[4], \"Ahmed Adel\", \"10 minutes ago\"));\n\t\tstatusList.add(new Status(MainActivity.profileUrls[0], \"Manar\", \"Yesterday, 5:08 PM\"));\n\t\tstatusList.add(new Status(MainActivity.profileUrls[5], \"Ramadan\", \"Today, 10:30 AM\"));\n\t\t\n\t}", "Kerucut(){\r\n Tabung tab = new Tabung();\r\n tinggi=tab.getTinggi();\r\n }", "public Statistic() {\n this(null, null);\n }", "private ServiceMonitoringStatusInterpreter() { /* do nothing */ }", "@Override\n public void setStatus(int arg0) {\n\n }", "public RSPStatusPanel() \n {\n initComponents();\n }", "public NuevaTablaResource() {\r\n }", "private Status(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public DoctorMainTabbedPane() {\n super();\n initialize();\n }", "public Estado() {\r\n }", "Constructor() {\r\n\t\t \r\n\t }", "public Lanceur() {\n\t}", "public TrackStat() {\r\n }", "public TrackerTableChangeLog() {\r\n\t\t// Default constructor\r\n\t}", "public TabelaDoces() {\n initComponents();\n }", "@SuppressWarnings(\"unused\")\n private ReplicationStatusResponse() {\n this(false);\n }" ]
[ "0.7161485", "0.7150005", "0.71258897", "0.70955503", "0.67103815", "0.6708779", "0.66990113", "0.66425604", "0.6590854", "0.65824735", "0.65822357", "0.6553414", "0.64979535", "0.6397526", "0.63939637", "0.63939637", "0.63424593", "0.6338416", "0.6329256", "0.63184226", "0.6295333", "0.62922627", "0.6243295", "0.6243104", "0.6214684", "0.61857855", "0.6177049", "0.6151234", "0.6137865", "0.61014557", "0.61000395", "0.60999966", "0.6098356", "0.6085003", "0.60758334", "0.6064531", "0.60568935", "0.6050016", "0.60462254", "0.60378826", "0.603762", "0.60290015", "0.59935576", "0.59818053", "0.5954318", "0.5953457", "0.5927729", "0.5920642", "0.5920576", "0.5917967", "0.59178114", "0.591124", "0.590848", "0.59065884", "0.5901994", "0.58686996", "0.5864762", "0.5841171", "0.5840199", "0.58229", "0.58204883", "0.58186775", "0.58132553", "0.5812661", "0.5808153", "0.58001125", "0.5783142", "0.5768752", "0.57597476", "0.57586396", "0.5756556", "0.57538486", "0.5743858", "0.5736375", "0.5721256", "0.57182884", "0.5704749", "0.5699923", "0.5698414", "0.56924236", "0.5686828", "0.5686025", "0.5680837", "0.5677176", "0.5676702", "0.56765884", "0.5667945", "0.56613415", "0.5655995", "0.56530493", "0.5652458", "0.56489295", "0.56461084", "0.5641477", "0.56283134", "0.56219935", "0.56211424", "0.5619809", "0.56169635", "0.56135726", "0.5607582" ]
0.0
-1
nextMove: take next cheapest step based on cost of if unstable
public void makeNextMove() { takeNextNonTabuedCheapestStep(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Move getBestMove() {\r\n\t\tSystem.out.println(\"getting best move\");\r\n\t\tChessConsole.printCurrentGameState(this.chessGame);\r\n\t\tSystem.out.println(\"thinking...\");\r\n\t\t\r\n\t\tList<Move> validMoves = generateMoves(false);\r\n\t\tint bestResult = Integer.MIN_VALUE;\r\n\t\tMove bestMove = null;\r\n\t\t\r\n\t\tfor (Move move : validMoves) {\r\n\t\t\texecuteMove(move);\r\n\t\t\t//System.out.println(\"evaluate move: \"+move+\" =========================================\");\r\n\t\t\tint evaluationResult = -1 * negaMax(this.maxDepth,\"\");\r\n\t\t\t//System.out.println(\"result: \"+evaluationResult);\r\n\t\t\tundoMove(move);\r\n\t\t\tif( evaluationResult > bestResult){\r\n\t\t\t\tbestResult = evaluationResult;\r\n\t\t\t\tbestMove = move;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"done thinking! best move is: \"+bestMove);\r\n\t\treturn bestMove;\r\n\t}", "public Coordinate getNextMove() {\n\n if (targetMode && salvationMode == false) {\n\n Coordinate bestNextTarget;\n\n if (!fixedDirection) { // direction is not known\n\n int maxCount = 0;\n bestNextTarget = this.previousTarget;\n\n // find the best target around the last target //\n\n if (inBound(this.axis.y + 1, this.axis.x)) {\n maxCount = countGrid[this.axis.y + 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + 1);\n direction = 0; // north by default\n }\n\n if (inBound(this.axis.y - 1, this.axis.x)) {\n if (countGrid[this.axis.y - 1][this.axis.x] > maxCount) {\n maxCount = countGrid[this.axis.y - 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - 1);\n direction = 2;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x + 1)) { // try east\n if (countGrid[this.axis.y][this.axis.x + 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x + 1];\n bestNextTarget = new Coordinate(this.axis.x + 1, this.axis.y);\n direction = 1;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x - 1)) { // try west\n if (countGrid[this.axis.y][this.axis.x - 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x - 1];\n bestNextTarget = new Coordinate(this.axis.x - 1, this.axis.y);\n direction = 3;\n }\n }\n\n seekAgain = false;\n\n } else { // direction is known\n\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y);\n\n if (direction == 0) { // north\n if (inBound(this.axis.y + distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n } else { // else go south\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n direction = 2;\n }\n\n } else if (direction == 1) { // east\n if (inBound(this.axis.y, this.axis.x + distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n } else { // else go west\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n direction = 3;\n }\n\n } else if (direction == 2) { // south\n if (inBound(this.axis.y - distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n } else { // else go north\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n direction = 0;\n }\n\n } else if (direction == 3) { // west\n if (inBound(this.axis.y, this.axis.x - distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n } else { // else go east\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n direction = 1;\n }\n }\n }\n\n this.previousTarget = bestNextTarget;\n\n } else {\n this.previousTarget = getGlobalHighestCount();\n }\n\n toExclude.add(new Coordinate(this.previousTarget.y, this.previousTarget.x));\n\n this.countGrid[this.previousTarget.y][this.previousTarget.x] = 0;\n\n return this.previousTarget;\n }", "private int getBestMove(int[] board, int depth, boolean turn) {\n int boardCopy[];\n if (depth <= 0) {\n return 0;\n }\n if (depth > STEP_BACK_DEPTH) {\n try {\n Thread.sleep(3);\n } catch (InterruptedException e) {\n e.printStackTrace();\n if (shouldStop()) {\n Log.d(Constants.MY_TAG,\"out CalculatingBot\");\n unlock();\n return 0;\n }\n }\n }\n if (turn) {\n int minimum = MAXIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 0; i < 5; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, ! turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n }\n int i = 10;\n if (board[2] < 2) {\n return minimum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n return minimum;\n } else {\n int maximum = MINIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 5; i < 10; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n }\n int i = 11;\n if (board[7] < 2) {\n return maximum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n return maximum;\n }\n }", "public void compNextMove(){\r\n int flatNextMove;\r\n\r\n /* transfer the matrix to an array */\r\n Sign[] flatBoard = flattenBoard();\r\n\r\n /* choose best next move according to difficulty */\r\n flatNextMove = CompPlayer.nextMove(flatBoard,moves,playerSign,difficulty);\r\n\r\n /* set the sign in the correct place in the matrix */\r\n for (int i=0;i<3;i++)\r\n for (int j=0;j<3;j++){\r\n flatNextMove--;\r\n if (flatNextMove == 0)\r\n setSign(i,j,compSign);\r\n }\r\n }", "private int[] findNextMove(State s, double[] weights) {\n\t\tboolean[][] newField = new boolean[State.ROWS][State.COLS];\n\t\tint[] newTop = new int[State.COLS];\n\t\tint bestRot = 0;\n\t\tint bestPos = 0;\n\t\tdouble bestValue = -Double.MAX_VALUE;\n\n\t\tint nextPiece = s.getNextPiece();\n\t\tint[][] legalMoves = s.legalMoves();\n\t\tfor (int i = 0; i < legalMoves.length; i++) {\n\t\t\tint rot = legalMoves[i][State.ORIENT];\n\t\t\tint pos = legalMoves[i][State.SLOT];\n\t\t\tint rowsCleared = performMove(s, newField, newTop, nextPiece, rot, pos);\n\t\t\tint holes = 0;\n\t\t\tint bumpiness = 0;\n\t\t\tint maxHeight = 0;\n\t\t\tint minHeight = State.ROWS;\n\n\t\t\tfor (int c = 0; c < State.COLS; ++c) {\n\t\t\t\tboolean blocked = false;\n\t\t\t\t// total height\n\t\t\t\tmaxHeight = Math.max(maxHeight, s.getTop()[c]);\n\t\t\t\tminHeight = Math.min(minHeight, s.getTop()[c]);\n\t\t\t\t// sum of difference of consecutive heights\n\t\t\t\tif (c > 0)\n\t\t\t\t\tbumpiness += (newTop[c] - newTop[c - 1]) * (newTop[c] - newTop[c - 1]);\n\t\t\t\tfor (int r = State.ROWS - 1; r >= 0; --r) {\n\t\t\t\t\tif (newField[r][c]) {\n\t\t\t\t\t\tblocked = true;\n\t\t\t\t\t} else if (!newField[r][c] && blocked) {\n\t\t\t\t\t\t// number of holes\n\t\t\t\t\t\tholes += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdouble value = calculateValueOfField(weights, maxHeight, minHeight, rowsCleared, holes, bumpiness);\n\t\t\tif (value > bestValue) {\n\t\t\t\tbestValue = value;\n\t\t\t\tbestRot = rot;\n\t\t\t\tbestPos = pos;\n\t\t\t}\n\n\t\t}\n\n\t\treturn new int[] { bestRot, bestPos };\n\n\t}", "public Direction nextMove(Game gameState) {\n\n // Create a copy of this game state and walk in the first direction\n Game curr = new Game(gameState);\n curr.step(directions[0]);\n\n // Set the current minimum found cost and index to this first direction's cost\n int minCost = getCost(curr);\n int minIndex = 0;\n\n // Loop through the other directions\n for (int i = 1, max = directions.length; i < max; i++) {\n\n // Create a copy of this game state and walk in a new direction\n curr = new Game(gameState);\n curr.step(directions[i]);\n int thisCost = getCost(curr);\n\n // Check if this new cost is lower than previous ones and if so, update minCost and minIndex accordingly\n if (thisCost < minCost) {\n minCost = thisCost;\n minIndex = i;\n }\n }\n\n // Return the direction corresponding to this minimum cost\n return directions[minIndex];\n }", "@Override\n /**\n * Selects a move based on the current game state\n */\n public Move selectMove() {\n Game game = this.game.copy();\n List<Move> moves = game.getValidMoves(this.player);\n Collections.shuffle(moves);\n\n // Create a thread pool\n Executor executor = Executors.newFixedThreadPool(this.threadCount);\n CompletionService<MinimaxEngineWorker> service = new ExecutorCompletionService<MinimaxEngineWorker>(executor);\n\n // Determine the value of each move using the thread pool\n for (Move move : moves) {\n service.submit(new MinimaxEngineWorker(game, move, this.hashMap));\n }\n\n Move bestMove = null;\n double bestMoveValue = Double.NEGATIVE_INFINITY;\n int movesSize = moves.size();\n long moveCount = 0;\n long hashMapHits = 0;\n for (int i = 0; i < movesSize; i++) {\n try {\n // Block until a worker thread finishes\n MinimaxEngineWorker worker = service.take().get();\n\n // Report progress\n moveCount += worker.moveCount;\n hashMapHits += worker.hashMapHits;\n this.setProgress((double) i / movesSize, moveCount, hashMapHits);\n\n // Update the best move\n if (bestMove == null || worker.moveValue >= bestMoveValue) {\n bestMove = worker.move;\n bestMoveValue = worker.moveValue;\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n }\n \n // Clear the hashmap\n this.hashMap.clear();\n Runtime.getRuntime().gc();\n\n return bestMove;\n }", "@Override\n\tpublic Direction nextMove(State state)\n\t{\n\t\t\n\t\tthis.direction = Direction.STAY;\n\t\tthis.hero = state.hero();\n\t\tthis.position = new Point( this.hero.position.right, this.hero.position.left ); //x and y are reversed, really\n\t\t\n\t\tthis.pathMap = new PathMap( state, this.position.x, this.position.y );\n\n\t\t//find the richest hero\n\t\tHero richestHero = state.game.heroes.get(0);\n\t\tif( richestHero == this.hero ) { richestHero = state.game.heroes.get(1); } //just grab another hero if we are #0\n\t\t\n\t\tfor( Hero hero : state.game.heroes )\n\t\t{\n\t\t\tif( hero != this.hero && hero.gold > richestHero.gold )\n\t\t\t{\n\t\t\t\trichestHero = hero;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//get all interesting sites\n\t\tList<TileInfo> minesInRange = this.pathMap.getSitesInRange( TileType.FREE_MINE, 20 );\t//mines in vicinity\n\t\tList<TileInfo> takenMinesInRange = this.pathMap.getSitesInRange( TileType.TAKEN_MINE, (100-richestHero.life)/2 );\t//mines in vicinity\n\t\tList<TileInfo> pubsInRange = this.pathMap.getSitesInRange( TileType.TAVERN, (int)(Math.pow(100-this.hero.life,2)*state.game.board.size/5000) );\t\t//pubs in vicinity\n\t\t\n\t\t//first visit pubs (apparently we need it)\n\t\tif( pubsInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( pubsInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit the mines\n\t\telse if( minesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( minesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit taken mines\n\t\telse if( takenMinesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( takenMinesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then hunt for players\n\t\telse\n\t\t{\n\t\t\t//kill the richest hero! (but first full health)\n\t\t\tif( this.hero.life > 85 )\n\t\t\t{\n\t\t\t\tthis.direction = this.pathMap.getDirectionTo( richestHero.position.right, richestHero.position.left );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//run away!!!\n\t\t\t\tthis.direction = intToDir( (int)(Math.random()*4) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//VisualPathMap.getInstance( pathMap );\n\t\t\n\t\treturn this.direction;\n\t}", "public int nextAction() {\n double w = random.nextDouble();\n for (int i = 0; i < nMoves; i++) {\n if (w < probabilities[i]) {\n lastMove = i;\n break;\n }\n w -= probabilities[i];\n }\n nIters++;\n\n if (N_SELECTED_ACTIONS > 1) {\n lastNMoves.add(lastMove);\n if (lastNMoves.size() > N_SELECTED_ACTIONS)\n lastNMoves.poll();\n }\n\n if (LOGGING && nIters % 1000 == 0) {\n for (int i = 0; i < nMoves; i++)\n logWriter.printf(\"%.8f;\", probabilities[i]);\n logWriter.println();\n logWriter.flush();\n }\n\n return lastMove;\n }", "Move getBestMove() {\n //System.out.println(\"AI chooses: \" + m.toString());\n return moves.get((int) (Math.random() * moves.size()));\n }", "public abstract void makeBestMove();", "public Move chooseMove(TablutBoardState boardState) {\n \n \tList<TablutMove> options = boardState.getAllLegalMoves();\n\n \n bestMove = options.get(((int) MyTools.getSomething())% (options.size()));\n\n int depth = DEPTH;\n int opponent = boardState.getOpponent();\n boolean isMax;\n if(opponent==1){\n \tisMax = true;\n \t//System.out.println(\"I'm max\");\n }\n else{\n \tisMax = false;\n \t//System.out.println(\"I'm min\");\n }\n //bestMove = \n \n int bestvalue = minimax(boardState,isMax, depth,-10000,10000);\n \n \n //int minNumberOfOpponentPieces = boardState.getNumberPlayerPieces(opponent);\n //boolean moveCaptures = false;\n //System.out.println(\"minimax return value: \"+bestvalue);\n \n \n \n \n return bestMove;\n }", "private Move alphaBetaSearch(Node state) {\n\t\t\n\t\tint v = this.maxValue(state, Integer.MIN_VALUE, Integer.MAX_VALUE);\n\t\t\n\t\tthis.nodesExplored--;\n\t\tthis.nodesExploredThisTurn--;\n\t\t\n\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000) {\n\t\t\treturn this.bestMoveSoFar;\n\t\t}\n\n\t\tif (Math.abs(v) == Integer.MAX_VALUE / 2 || Math.abs(v) == Math.abs(Integer.MIN_VALUE / 2) ) {\n\t\t\t\n\t\t\tthis.isEndGameStatusFound = true;\n\t\t\treturn state.getBestMove();\n\t\t}\n\t\t\n\t\treturn state.getBestMove();\n\t}", "@Override\n public WorkflowStep next() {\n this.missingTetromino = 0;\n timeCalculationStarted = 0;\n firstScan = true;\n if (checkAutoBlue()) {\n nosync = 0;\n try {\n Thread.sleep(MIN_BLUE_TIME);\n } catch (InterruptedException e) {\n // wait\n }\n return INITIAL_BOARD;\n } else {\n\t \tif (QQTetris.getSleep() < 300) {\n\t\t if (++nosync >= MAX_NOSYNC) {\n\t\t nosync = 0;\n\t\t return INITIAL_BOARD;\n\t\t } else {\n\t\t QQTetris.calculationThread.mergeMove();\n\t\t return DETECT_BLOCKS;\n\t\t }\n\t \t} else {\n\t \t\t\treturn INITIAL_BOARD;\n\t \t}\n }\n }", "protected Object[] getBestMove(Solution soln, Move[] moves, ObjectiveFunction objectiveFunction, TabuList tabuList, AspirationCriteria aspirationCriteria, boolean maximizing, boolean chooseFirstImprovingMove)\n/* */ {\n/* 260 */ int threads = getThreads();\n/* 261 */ if (threads == 1)\n/* */ {\n/* 263 */ return SingleThreadedTabuSearch.getBestMove(soln, moves, objectiveFunction, tabuList, aspirationCriteria, maximizing, chooseFirstImprovingMove, this);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 271 */ Move bestMove = null;\n/* 272 */ double[] bestMoveVal = null;\n/* 273 */ boolean bestMoveTabu = false;\n/* 274 */ NeighborhoodHelper[] helpers = getHelpers();\n/* */ \n/* */ \n/* 277 */ int numGroups = helpers.length;\n/* 278 */ int nominalSize = moves.length / numGroups;\n/* 279 */ Move[][] moveGroups = new Move[numGroups][];\n/* */ \n/* */ \n/* 282 */ for (int i = 0; i < numGroups - 1; i++)\n/* */ {\n/* 284 */ moveGroups[i] = new Move[nominalSize];\n/* 285 */ System.arraycopy(moves, i * nominalSize, moveGroups[i], 0, nominalSize);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 291 */ moveGroups[(numGroups - 1)] = new Move[nominalSize + moves.length % numGroups];\n/* 292 */ System.arraycopy(moves, (numGroups - 1) * nominalSize, moveGroups[(numGroups - 1)], 0, moveGroups[(numGroups - 1)].length);\n/* */ \n/* */ \n/* */ \n/* 296 */ for (int i = 0; i < numGroups; i++) {\n/* 297 */ helpers[i].setWork(soln, moveGroups[i], objectiveFunction, tabuList, aspirationCriteria, maximizing, chooseFirstImprovingMove, this);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 304 */ Object[][] bestMoves = new Object[numGroups][];\n/* 305 */ for (int i = 0; i < numGroups; i++)\n/* */ {\n/* */ \n/* 308 */ Object[] contender = helpers[i].getBestMove();\n/* */ \n/* */ \n/* 311 */ Move newMove = (Move)contender[0];\n/* 312 */ double[] newObjVal = (double[])contender[1];\n/* 313 */ boolean newMoveTabu = ((Boolean)contender[2]).booleanValue();\n/* */ \n/* */ \n/* */ \n/* 317 */ if (bestMove == null)\n/* */ {\n/* 319 */ bestMove = newMove;\n/* 320 */ bestMoveVal = newObjVal;\n/* 321 */ bestMoveTabu = newMoveTabu;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* 327 */ else if (SingleThreadedTabuSearch.isFirstBetterThanSecond(newObjVal, bestMoveVal, maximizing))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 335 */ if ((bestMoveTabu) || (!newMoveTabu)) {\n/* 336 */ bestMove = newMove;\n/* 337 */ bestMoveVal = newObjVal;\n/* 338 */ bestMoveTabu = newMoveTabu;\n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ }\n/* 344 */ else if ((bestMoveTabu) && (newMoveTabu)) {\n/* 345 */ bestMove = newMove;\n/* 346 */ bestMoveVal = newObjVal;\n/* 347 */ bestMoveTabu = newMoveTabu;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 355 */ return new Object[] { bestMove, bestMoveVal, new Boolean(bestMoveTabu) };\n/* */ }", "PrioritizedMove getBestMoveFor(int player, int desiredLength);", "private boolean isNextMoveRochade(Move move)\r\n\t{\r\n\t\tif (!(move.from.piece instanceof King)) return false;\r\n\t\tint xDiffAbs = Math.abs(move.to.coordinate.x - move.from.coordinate.x); \r\n\t\treturn xDiffAbs == 2;\r\n\t}", "private Coordinate firstMoveHeuristics(TicTacToeModel model, PossibleBoard possibleBoard) {\n BoardSpace[][] board = possibleBoard.board;\n\n if (possibleBoard.freeSpace == TicTacToeModel.BOARD_DIMENSION*TicTacToeModel.BOARD_DIMENSION) {\n if (board[0][0].getIcon() == Icon.EMPTY) {\n return new Coordinate(0,0);\n } else {\n return new Coordinate(0, TicTacToeModel.BOARD_DIMENSION - 1);\n }\n } else if (possibleBoard.freeSpace == TicTacToeModel.BOARD_DIMENSION*TicTacToeModel.BOARD_DIMENSION - 1) {\n if (model.cornerTaken()) {\n return new Coordinate(TicTacToeModel.BOARD_DIMENSION/2, TicTacToeModel.BOARD_DIMENSION/2);\n } else if (board[TicTacToeModel.BOARD_DIMENSION/2][TicTacToeModel.BOARD_DIMENSION/2].getIcon() != Icon.EMPTY) {\n return new Coordinate(0,0);\n } else {\n return model.getCornerNextToEdge();\n }\n }\n\n return null;\n }", "private int firstMove(ArrayList<Integer> open, ArrayList<Integer> plyr, ArrayList<Integer> comp, int turn)\r\n {\r\n int[] first = {0,2,4,4,4,4,6,8};\r\n int[] second = {0,2,6,8};\r\n if(turn == 0)\r\n return first[gen.nextInt(8)];\r\n else\r\n {\r\n int plyrMove = plyr.get(0);\r\n if(plyrMove == 4)\r\n return second[gen.nextInt(4)];\r\n else\r\n return 4;\r\n }\r\n }", "public int stepOne(int step)\n\t{ \n\t\tint i,j; \n\t\tint min;\n\t\tfor(i=0; i<n; i++) \n\t\t{ \n\t\t\tmin=cost[i][0];\n\t\t\tfor(j=0; j<n; j++)\n\t\t\t {\n\t\t\t\tif(cost[i][j]<min)\n\t\t\t\t{\n\t\t\t\t\tmin = cost[i][j];\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t}\n\t\t\tfor (j=0; j<n;j++)\n\t\t\t{\n\t\t\t\tcost[i][j] = cost[i][j]- min;\n\t\t\t}\t\t\t\n\t\t}\n\t\tstep=2;\n\t\treturn step;\n\t}", "public PentagoMove alphabetaw(PentagoBoardState boardState){\n PentagoBoardState pbs = (PentagoBoardState) boardState.clone();\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n\n PentagoMove bestmove = legalmoves.get(0);\n PentagoMove bestopponentmove = new PentagoMove(0,0,0,0,0);\n int bestmovescore = -9999999;\n int bestwhitescore = 0;\n //ArrayList<Integer> scores = new ArrayList<Integer>();\n for(int i = 0;i<legalmoves.size()-1;i++){\n\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove next = legalmoves.get(i);\n\n newboard.processMove(next);\n\n int score = evaluate(newboard);\n //scores.add(score);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n\n if(score > 100000){\n newboard.getWinner();\n newboard.printBoard();\n System.out.println(\"FOUND A WINNER\" + score);\n return next;\n }\n\n\n PentagoMove currentopponentmove;\n ArrayList<PentagoMove> opponentlegalmoves = newboard.getAllLegalMoves();\n if (opponentlegalmoves.size()!=0){\n currentopponentmove = opponentlegalmoves.get(0);\n }\n\n int minopponentmovescore = 999999;\n int thismovescore = -9999;\n ArrayList<PentagoMove> bestopponentmoves = new ArrayList<PentagoMove>();\n PentagoMove currentbestopponentmove = new PentagoMove(0,0,0,0,0);\n\n for(int a = 0;a<opponentlegalmoves.size()-1;a++){\n\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove opponentnext = opponentlegalmoves.get(a);\n\n pbsopponent.processMove(opponentnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int opponentscore = evaluate(pbsopponent);\n\n\n\n\n\n if (minopponentmovescore>opponentscore){\n //currentopponentmove = opponentnext;\n minopponentmovescore = opponentscore;\n bestopponentmoves.add(opponentnext);\n currentbestopponentmove = opponentnext;\n }\n\n\n }\n bestopponentmove = currentbestopponentmove;\n //lvl 3\n /*\n\n int lvl3minscore =99999;\n PentagoMove currentmaxmove;\n for (int r = 0;r<bestopponentmoves.size()-1;r++) {\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n pbsopponent.processMove(bestopponentmoves.get(r));\n\n ArrayList<PentagoMove> maxlegalmoves = pbsopponent.getAllLegalMoves();\n if (maxlegalmoves.size() != 0) {\n currentmaxmove = maxlegalmoves.get(0);\n }\n int opponentscore = evaluate(pbsopponent);\n int findminmaxmovescore = -99999;\n for (int s = 0; s < maxlegalmoves.size() - 1; s++) {\n\n PentagoBoardState maxboard = (PentagoBoardState) pbsopponent.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove maxnext = maxlegalmoves.get(s);\n\n maxboard.processMove(maxnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int maxnextscore = evaluate(pbsopponent);\n if (findminmaxmovescore < maxnextscore) {\n currentmaxmove = maxnext;\n findminmaxmovescore = maxnextscore;\n }\n }\n if (thismovescore<findminmaxmovescore){\n //currentopponentmove = opponentnext;\n thismovescore = findminmaxmovescore;\n }\n\n //opponentscore = maxmovescore;\n }\n\n //end experiment\n\n\n\n\n if (mycolour ==1){\n lvl3minscore =minopponentmovescore;\n }\n */\n if (minopponentmovescore>bestmovescore){//minopponentmovescore\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n\n }\n else if (minopponentmovescore == bestmovescore){\n if (score > bestwhitescore){\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n }\n\n\n\n }\n\n\n }\n System.out.println(\"final max player move score: \"+ bestmovescore + \"\\n My best move: \"+bestmove.toPrettyString() + \"\\n My best move: \"+ bestopponentmove.toPrettyString());\n return bestmove;\n }", "Point2D getNextMove(Point2D target, boolean pursuit, Set<Point2D> map);", "public void move(BoardState state) {\n\t move = alphabetaSearch(state, maxDepth);\r\n\r\n\t\t// TEST CASES\r\n\t\t// System.out.println(maxValue(state, maxDepth, 2, -1000, 1000));\r\n\t\t// System.out.println(alphabetaSearch(state, 10));\r\n\r\n\t}", "public void performMove() {\n\t\tfor (int x = 0; x <= size-1; x++)\n\t\t\tfor (int y = 0; y <= size-1; y++)\n\t\t\t\tlocalBoard[y][x] = 0;\n\t\t\n\t\t//reset the flag that indicates if a move has been found that decreases the heuristic\n\t\tfoundBetterMove = false;\n\t\t\n\t\t//fill in the appropriate heuristic values\n\t\tpopulateHillValues();\n\t\tArrayList<PotentialMove> myBestList = new ArrayList<PotentialMove>();\n\n\t\t//Find the square with the lowest heuristic value. this should really write the values to an array. \n\t\tint squareDifferential = -1;\n\t\t//String outValue = \"\";\n\t\tfor (int y = 0; y <= size-1; y++) {\n\t\t\tfor (int x = 0; x <= size-1; x++){\n\t\t\t\t//outValue = outValue + localBoard[y][x];\n\t\t\t\tif (squareDifferential < 0) //lowestSquareFound not found yet \n\t\t\t\t{\n\t\t\t\t\tif ((NQueens.queens[x] != y) && //set if the current square isn't already occupied by a queen\n\t\t\t\t\t\t\t(localBoard[NQueens.queens[x]][x] >= localBoard[y][x])) {\n\t\t\t\t\t\tif (localBoard[y][x] == localBoard[NQueens.queens[x]][x])\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) > squareDifferential) { // find the square with the largest differential in value from the queen in the column\n\t\t\t\t\tmyBestList.clear();\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t}\n\t\t\t\telse if (((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) == squareDifferential) && // the differential is equal to the current best differential\n\t\t\t\t\t\t(NQueens.queens[x] != y)) { // and isn't already occupied by a queen\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t}\n\t\t\t\t//else the square is higher, has a queen or isn't marginally better than the current queen's position in the row\n\t\t\t}\n\t\t\t//outValue = outValue + \"\\n\";\n\t\t}\n\t\t//JOptionPane.showMessageDialog(null, outValue);\n\t\t\n\t\tif (myBestList.isEmpty())\n\t\t\treturn;\n\t\t\n\t\tint listSize = myBestList.size();\n\t\tPotentialMove bestMove;\n\t\t\n\t\t//grab the non-Sideways moves first\n\t\tfor (int i = 0; i < listSize; i++) {\n\t\t\tif (!(myBestList.get(i).isSideways)) {\n\t\t\t\tbestMove = myBestList.get(i);\n\t\t\t\tfoundBetterMove = true;\n\t\t\t\tsidewaysMoves = 0;\n\t\t\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (sidewaysMoves > MAXSIDEWAYSMOVES) { // hit MAXSIDEWAYSMOVES consecutive sideways moves, mark as unsolvable\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//all available moves sideways moves, let's select one randomly\n\t\tRandom generator = new Random();\n\t\tint randomElement = generator.nextInt(listSize);\n\t\t\n\t\tbestMove = myBestList.get(randomElement);\n\t\tfoundBetterMove = true;\n\t\tsidewaysMoves++;\n\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t}", "private StatusEnum stepInternal()\n {\n if (initialStep)\n {\n this.tail = map.getStart();\n this.openSet.push(map.getStart());\n initialStep = false;\n }\n\n if (status != StatusEnum.RUNNING)\n return status;\n\n cursor = openSet.pop(); // Pull the cursor off the open set min-heap\n if (cursor == null)\n {\n // The open set was empty, so although we have not reached the goal, there are no more points to investigate\n return StatusEnum.COMPLETED_NOT_FOUND;\n }\n\n while (closedSet.contains(cursor) || !map.isTraversable(cursor))\n {\n // The cursor is in the closed set (meaning it was already investigated) or the cursor point is non traversable on the map\n cursor = openSet.pop();\n if (cursor == null)\n {\n return StatusEnum.COMPLETED_NOT_FOUND;\n }\n }\n\n // The goal has been reached, the path is complete\n if (cursor.equals(map.getGoal()))\n {\n tail = cursor; // Set the member tail to be used in the reconstruction done in getPath()\n return StatusEnum.COMPLETED_FOUND;\n }\n\n // Add the cursor point to the closed set\n closedSet.add(cursor);\n\n // Get the list of neighboring points\n List<WeightedPoint> neighbors = neighborSelector.getNeighbors(map, cursor, heuristic);\n\n // Link the neighbors to the cursor (for backtracking the path when the goal is reached) and calculate their weight\n for (WeightedPoint wp : neighbors)\n {\n if (map.isTraversable(wp.getRow(), wp.getCol()) && !closedSet.contains(wp))\n {\n wp.setFromCost(cursor.getFromCost() + heuristic.distance(cursor, wp));\n\n if (dijkstra)\n {\n wp.setToCost(0);\n }\n else\n {\n wp.setToCost(heuristic.distance(wp, map.getGoal()));\n }\n wp.setPrev(cursor);\n }\n }\n\n if (shuffle)\n {\n // Shuffle the neighbors to randomize the order of testing nodes with the same cost value\n Collections.shuffle( neighbors );\n }\n Collections.sort( neighbors );\n\n // Put the neighbors on the open set\n for (WeightedPoint wp : neighbors)\n {\n if (!openSet.contains(wp))\n openSet.push(wp);\n }\n\n return StatusEnum.RUNNING;\n }", "private boolean selectedPieceHasNextMove(Position startingPosition) {\n\t\treturn false;\n\t}", "public Move pickBestMove(Board board) {\n\t\treturn null;\n\t}", "@Override\r\n\t\tpublic Action BestMove(AI_Domain game) {\r\n\t\t\t return new Action(minimax(game,true,depth,true,null).getPath());\r\n\t\t}", "public Move makeSubsequentMove(){\n Move move = null;\n maxScore = 0;\n bestWord = new ArrayList<Tile>();\n for (Anchor anchor : findAnchors()){\n ArrayList<Tile> inputTiles = new ArrayList<Tile>(tray);\n inputTiles.add(anchor.anchorTile);\n findHighestScoringWord(inputTiles, new ArrayList<Tile>(), \"\", 0, anchor);\n }\n if (bestWord == null || bestWord.size() == 0){\n //should i have some kind of get new tray of tiles thing?\n return move;\n } else {\n int startCol;\n int startRow;\n if (currentAnchor.isAcross()){\n startCol = currentAnchor.col - getAnchorPosition(currentAnchor, bestWord);\n startRow = currentAnchor.row;\n } else {\n startCol = currentAnchor.col;\n startRow = currentAnchor.row - getAnchorPosition(currentAnchor, bestWord);\n }\n\n move = new Move(bestWord , startRow , startCol ,currentAnchor.isAcross(), maxScore , bot);\n //move.execute(Board?);\n }\n return move;\n }", "public void actionPerformed(ActionEvent e) {\n timer.stop();\n //get all the available moves\n ArrayList<Point> possibleMoves = getCurrentlyValidMoves();\n canLastPlayerMove = false;\n try {\n //check if we can move\n if( possibleMoves.size() == 0 ){\n return;\n }\n //make an array to store the best moves available\n ArrayList<Point> bestMoves = new ArrayList<Point>();\n //the lower the level, the higher priority is assigned to the move\n //a move of level 10 is the absolute lowest\n //this heuristic follows the strategy I use, omitting situation-specific content\n int level = 10;\n for (Point p : possibleMoves) {\n int x = (int) p.getX();\n int y = (int) p.getY();\n if ((x == 0 || x == 7) && (y == 0 || y == 7)) {\n if (level > 0) {\n bestMoves.clear();\n level = 0;\n }\n bestMoves.add( p );\n } else if (level >= 1 && (x == 0 || y == 0 || x == 7 || y == 7)) {\n if (level > 1) {\n bestMoves.clear();\n level = 1;\n }\n bestMoves.add( p );\n } else if (level >= 2 && (x > 2 && x < 6 && y > 2 && y < 6)) {\n if ( level > 2) {\n bestMoves.clear();\n level = 2;\n }\n bestMoves.add( p );\n } else if (level >= 3 && x != 1 && x != 6 && y != 1 && y != 6) {\n if (level > 3) {\n bestMoves.clear();\n level = 3;\n }\n bestMoves.add(p);\n } else if (level >= 4) {\n bestMoves.add(p);\n }\n }\n //for debugging purposes, output the level of move chosen by the ai\n System.out.println(level);\n //select a random move from the pool of best moves\n Point move = bestMoves.get((int) (Math.random() * bestMoves.size()));\n int aix = (int) move.getX();\n int aiy = (int) move.getY();\n //move there\n attemptMove(aix, aiy);\n gamepieces[aix][aiy] = currentPlayer;\n //the ai moved, so this is true\n canLastPlayerMove = true;\n } finally { //if the ai moved or if it didn't\n //change the player\n currentPlayer = Color.WHITE;\n gameFrame.repaint();\n //if the human player has no moves left\n if( getCurrentlyValidMoves().size() == 0 ){\n if( canLastPlayerMove ){ //... and the ai could move\n //switch players, enable the ai to move again in 1 second\n currentPlayer = Color.BLACK;\n timer.start();\n }else{ //... and the ai couldn't move\n gameOver();\n }\n }\n }\n }", "private static Point chooseNextPos(Point currPos, Point droneNextDes, Point coord1, Point coord2, double buildingSideGrad, Point buildingCentre, List<List<List<Point>>> noFlyZonesCoords, Point previous1, Point previous2) throws IOException, InterruptedException {\r\n\t\tvar possibleNextPos = possibleNextPos(currPos, coord1, coord2, buildingSideGrad, buildingCentre);\r\n\t\tvar nextPosTemp1 = possibleNextPos.get(0);\r\n\t\tvar nextPosTemp2 = possibleNextPos.get(1);\r\n\t\t\r\n\t\tvar euclidDist1 = euclidDist(droneNextDes, nextPosTemp1); \r\n\t\tvar euclidDist2 = euclidDist(droneNextDes, nextPosTemp2);\r\n\t\t\r\n\t\tPoint nextPos = droneNextDes;\r\n\t\t\r\n\r\n\t\t//in the case that both directions result in no intersection, \r\n\t\t//it chooses the one that minimises the distance between the drone's next position and desired position \r\n\t\t//and doesn't result in the drone going back and fourth continuously \r\n\t\tif(noIntersections(currPos, nextPosTemp1, noFlyZonesCoords)==true && noIntersections(currPos, nextPosTemp2, noFlyZonesCoords)==true) {\r\n\t\t\tvar repeatedMoveDir1 = false; //in the case that previous1 and previous2 are null\r\n\t\t\tvar repeatedMoveDir2 = false;\r\n\t\t\tif(previous1!=null && previous2!=null) {\r\n\t\t\t\trepeatedMoveDir1 = computeDir(previous2, previous1)==computeDir(currPos, nextPosTemp1); //next move is equal to 2 moves before, indicating repeated move\r\n\t\t\t\trepeatedMoveDir2 = computeDir(previous2, previous1)==computeDir(currPos, nextPosTemp2);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(euclidDist1<euclidDist2 && repeatedMoveDir1==false || repeatedMoveDir2==true) {\r\n\t\t\t\tnextPos = nextPosTemp1;\r\n\t\t\t}\r\n\t\t\tif(repeatedMoveDir1==true || euclidDist2<euclidDist1 && repeatedMoveDir2==false){\r\n\t\t\t\tnextPos = nextPosTemp2;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(noIntersections(currPos, nextPosTemp1, noFlyZonesCoords)==true && noIntersections(currPos, nextPosTemp2, noFlyZonesCoords)==false) {\r\n\t\t\tnextPos = nextPosTemp1;\r\n\t\t}\r\n\t\telse if(noIntersections(currPos, nextPosTemp1, noFlyZonesCoords)==false && noIntersections(currPos, nextPosTemp2, noFlyZonesCoords)==true) { //\r\n\t\t\tnextPos = nextPosTemp2;\r\n\t\t}\r\n\t\t\r\n\r\n\t\treturn nextPos;\r\n\t}", "private ProblemModel findCheapestNode(){\n\t\tProblemModel ret = unvisitedPM.peek();\n\t\t\n\t\tfor(ProblemModel p : unvisitedPM){ \n\t\t\t//f(s) = depth + cost to make this move\n\t\t\tif(p.getCost() + p.getDepth() <= ret.getCost() + ret.getDepth()) ret = p;\n\t\t}\n\t\tunvisitedPM.remove(ret);\n\t\treturn ret;\n\t}", "public AgentAction getNextMove(GameTile [][] visibleMap) {\r\n\t\t//Possible things to add to your moves\r\n//\t\tnextMove = AgentAction.doNothing;\r\n//\t\tnextMove = AgentAction.moveDown;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveLeft;\r\n//\t\tnextMove = AgentAction.pickupSomething;\r\n//\t\tnextMove = AgentAction.declareVictory;\r\n//\r\n//\t\tnextMove = AgentAction.shootArrowNorth;\r\n//\t\tnextMove = AgentAction.shootArrowSouth;\r\n//\t\tnextMove = AgentAction.shootArrowEast;\r\n//\t\tnextMove = AgentAction.shootArrowWest;\r\n//\t\tnextMove = AgentAction.quit\r\n\t\t\r\n\t\t\r\n\r\n\t\t//Ideally you would remove all this code, but I left it in so the keylistener would work\r\n\t\tif(keyboardPlayOnly) {\r\n\t\t\tif(nextMove == null) {\r\n\t\t\t\treturn AgentAction.doNothing;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tAgentAction tmp = nextMove;\r\n\t\t\t\tnextMove = null;\r\n\t\t\t\treturn tmp;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//This code plays 5 \"games\" and then quits\r\n\t\t\t//Just does random things\r\n\t\t\tif(numGamesPlayed > 19) {\r\n\t\t\t\treturn AgentAction.quit;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(nextMoves.isEmpty()) {\r\n\t\t\t\t\tsetStartingPosition(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tWumpusState currentState = huntTheWumpus(visibleMap);\r\n//\t\t\t\t\tSystem.out.println(wumpusHunted);\r\n//\t\t\t\t\tif(wumpusHunted) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//this is the code to collect the gold\r\n//\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\tcurrentState = findTheGold(currentState);\r\n//\t\t\t\t\tif(currentState.getGoldCollected()) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tif(!goldCollected) {\r\n\t\t\t\t\t\twellItsDarkNow(visibleMap);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(goldCollected) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n\t\t\t\t\t\taddToNextMoves(visibleMap);\r\n//\t\t\t\t\t\tgoldCollected = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(!nextMoves.isEmpty()) {\r\n\t\t\t\t\tSystem.out.println(nextMoves.peek());\r\n\t\t\t\t\tsetNextMove(nextMoves.remove());\r\n//\t\t\t\t\tSystem.out.println(nextMove);\r\n//\t\t\t\t\treturn nextMove;\r\n\t\t\t\t}\r\n\t\t\t\treturn nextMove;\r\n//\t\t\t\tcurrentNumMoves++;\r\n//\t\t\t\tif(currentNumMoves < 20) {\r\n//\t\t\t\t\treturn AgentAction.randomAction();\r\n//\t\t\t\t}\r\n//\t\t\t\telse {\r\n//\t\t\t\t\treturn AgentAction.declareVictory;\r\n//\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public MoveEvaluation alreadyDetermined(IGameState state) {\n\t\tNode<Pair> node = list.head();\n\t\t\n\t\twhile (node != null) {\n\t\t\tPair p = node.value();\n\t\t\tif (state.equivalent(p.state)) {\n\t\t\t\treturn p.move;\n\t\t\t}\n\t\t\t\n\t\t\tnode = node.next();\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "private Move getBestMove(Node node) {\n Move bestMove = null;\n double best_val = Integer.MIN_VALUE;\n for (Node child : node.getChildren()) {\n double payOff = (child.getPlays() == 0) ? 0 : (child.getWins() / child.getPlays());\n if (child.getPlays() == 0) {\n System.out.println(\"No records for play: \" + \"oldRow: \" + child.getState().getMove().oldRow + \", oldCol: \"\n + child.getState().getMove().oldCol + \", newRow: \" + child.getState().getMove().newRow + \", newCol: \" +\n child.getState().getMove().newCol + \", board: \" + Arrays.deepToString(child.getState().getBoard()));\n } else {\n System.out.println(\"payOff: \" + payOff + \", play: \" + \"oldRow: \" + child.getState().getMove().oldRow + \", oldCol: \"\n + child.getState().getMove().oldCol + \", newRow: \" + child.getState().getMove().newRow + \", newCol: \" +\n child.getState().getMove().newCol + \", plays: \" + child.getPlays() + \", wins: \" + child.getWins());\n }\n if (payOff > best_val) {\n best_val = payOff;\n bestMove = child.getState().getMove();\n }\n }\n System.out.println();\n return bestMove;\n }", "public Move chooseMove(PentagoBoardState boardState) {\r\n try {\r\n if (heuristicOnly) {\r\n System.out.println(\"chose from heuristic\");\r\n return Heuristics.choseMove(new LowMemoryBoardState(boardState));\r\n }\r\n if (mcts == null) {\r\n mcts = new MonteCarloUCT();\r\n }\r\n return mcts.nextMove(new LowMemoryBoardState(boardState));\r\n } catch (OutOfMemoryError e) {\r\n /*\r\n if the memory limit is exceeded, we *attempt* to free memory\r\n by nullifying our mcts and asking the JVM to garbage collect.\r\n Since this is a serious error, we switch the instance to use\r\n a heuristic exclusively, to prevent going over the memory limit\r\n again.\r\n */\r\n mcts = null;\r\n System.gc();\r\n this.heuristicOnly = true;\r\n return Heuristics.choseMove(new LowMemoryBoardState(boardState));\r\n }\r\n }", "@Override\n\tpublic double stateEvaluator(GameState s)\n\t{\r\n\t\tint count = 0;\n\t\tif (s.takenList[1] == 0)\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\telse if(s.lastMove == 1)\r\n\t\t{\r\n\t\t\tfor (int i = 1; i < s.takenList.length ; i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.5;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\treturn 0.5;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (isPrime(s.lastMove))\r\n\t\t{\r\n\t\t\tfor (int i = 1; i < s.takenList.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0 && i % s.lastMove == 0) // i = 4, % 2\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.7;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn 0.7;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tint largestPrime = 2;\r\n\t\t\tfor (int i = 2; i < (s.lastMove/2); i++)\r\n\t\t\t{\r\n\t\t\t\tif (s.lastMove % i == 0 && isPrime(i))\r\n\t\t\t\t{\r\n\t\t\t\t\tlargestPrime = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = largestPrime; i <= s.lastMove; i+= largestPrime)\r\n\t\t\t{\r\n\t\t\t\tif (s.takenList[i] == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (count % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\treturn -0.6;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\treturn 0.6;\r\n\t\t\t}\r\n\r\n\t\t}\n\t}", "UAction nextAction() { What should we do next? Override this for custom AI.\n //\n updateSeenEntities();\n UAction bestAction = null;\n float bestUrgency = 0f;\n int bc=0;\n for (UBehavior behavior : behaviors) {\n bc++;\n UAction action = behavior.getAction(this);\n if (action != null) {\n if (bestAction == null) {\n bestAction = action;\n bestUrgency = behavior.getCurrentUrgency();\n } else if (behavior.getCurrentUrgency() > bestUrgency) {\n bestAction = action;\n bestUrgency = behavior.getCurrentUrgency();\n }\n }\n }\n return bestAction;\n }", "private NewMove findBestMove(ChessGameNode node, char player ) {\r\n\t\tChessGameNode[] childrenNodes = node.getChildren();\r\n\t\tint currentValue = this.rootNode.getValue();\r\n\t\tint bestValue = 0;\r\n\t\tNewMove bestMove = null;\r\n\t\tfor( ChessGameNode childNode : childrenNodes) {\r\n\t\t\tif (childNode != null) {\r\n\t\t\t\tif (player == 'w') {\r\n\t\t\t\t\tif (childNode.getValue() >= currentValue) {\r\n\t\t\t\t\t\tbestValue = childNode.getValue();\r\n\t\t\t\t\t\tbestMove = childNode.getOriginalMove();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (player == 'b') {\r\n\t\t\t\t\tif (childNode.getValue() <= currentValue) {\r\n\t\t\t\t\t\tbestValue = childNode.getValue();\r\n\t\t\t\t\t\tbestMove = childNode.getOriginalMove();\r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t}\r\n\t\treturn bestMove;\r\n\t}", "private double[] chooseBestMove(List<double[]> possibleMoves) {\n double bestScore = 0;\n int indexBest = 0;\n for (int i = 0; i < possibleMoves.size(); i++) {\n if (possibleMoves.get(i)[4] > bestScore) {\n bestScore = possibleMoves.get(i)[4];\n indexBest = i;\n }\n }\n return possibleMoves.get(indexBest);\n }", "@Override\n\tpublic void makeNextMove() \n\t{\n\t}", "private synchronized Object[] getBestMove()\n/* */ {\n/* 580 */ while (this.workToDo)\n/* 581 */ synchronized (this) {\n/* 582 */ try { wait();\n/* */ } catch (InterruptedException e) {\n/* 584 */ e.printStackTrace(SingleThreadedTabuSearch.err); } } return this.bestMove;\n/* */ }", "public Player nextMove() {\n\t\treturn null;\n\t\t\n\t}", "public MoveEvaluation computeBest (int ply, IGameState s, IPlayer player, IPlayer opponent) {\n\t\tthis.original = player;\n\t\tthis.state = s.copy();\n\t\tMoveEvaluation move = minimax(ply, IComparator.MAX, player, opponent);\n\t\treturn move;\n\t}", "@SuppressWarnings(\"unused\")\n private void notSoLazyPathfinder(final Coords dest, final MoveStepType type,\n final int timeLimit) {\n final long endTime = System.currentTimeMillis() + timeLimit;\n\n MoveStepType step = type;\n if (step != MoveStepType.BACKWARDS) {\n step = MoveStepType.FORWARDS;\n }\n\n final MovePathComparator mpc =\n new MovePathComparator(dest, step == MoveStepType.BACKWARDS);\n\n MovePath bestPath = clone();\n\n // A collection of paths we have already explored\n final HashMap<MovePath.Key, MovePath> discovered =\n new HashMap<MovePath.Key, MovePath>();\n discovered.put(bestPath.getKey(), bestPath);\n\n // A collection of hte possible next-moves\n final PriorityQueue<MovePath> candidates =\n new PriorityQueue<MovePath>(110, mpc);\n candidates.add(bestPath);\n\n boolean keepLooping = getFinalCoords().distance(dest) > 1;\n int loopcount = 0;\n\n // Keep looping while we have candidates to explore, and certain stop\n // conditions aren't met (time-limit, destination found, etc)\n while ((candidates.size() > 0) && keepLooping) {\n final MovePath candidatePath = candidates.poll();\n final Coords startingPos = candidatePath.getFinalCoords();\n final int startingElev = candidatePath.getFinalElevation();\n\n // Check to see if we have found the destination\n if (candidatePath.getFinalCoords().distance(dest) == 0) {\n bestPath = candidatePath;\n keepLooping = false;\n break;\n }\n\n // Get next possible steps\n final Iterator<MovePath> adjacent =\n candidatePath.getNextMoves(step == MoveStepType.BACKWARDS,\n step == MoveStepType.FORWARDS).iterator();\n // Evaluate possible next steps\n while (adjacent.hasNext()) {\n final MovePath expandedPath = adjacent.next();\n\n if (expandedPath.getLastStep().isMovementPossible(getGame(),\n startingPos, startingElev)) {\n\n if (discovered.containsKey(expandedPath.getKey())) {\n continue;\n }\n candidates.add(expandedPath);\n discovered.put(expandedPath.getKey(), expandedPath);\n // Make sure the candidate list doesn't get too big\n if (candidates.size() > 100) {\n candidates.remove(candidates.size() - 1);\n }\n }\n }\n // If we're doing a special movement, like charging or DFA, we will\n // have to take extra steps to see if we can finish off the move\n // this is because getNextMoves only considers turning and\n // forward/backward movement\n if (type == MoveStepType.CHARGE ||\n type == MoveStepType.DFA){\n MovePath expandedPath = candidatePath.clone();\n expandedPath.addStep(type);\n if (expandedPath.getLastStep().isMovementPossible(getGame(),\n startingPos, startingElev)) {\n\n if (discovered.containsKey(expandedPath.getKey())) {\n continue;\n }\n candidates.add(expandedPath);\n discovered.put(expandedPath.getKey(), expandedPath);\n // Make sure the candidate list doesn't get too big\n if (candidates.size() > 100) {\n candidates.remove(candidates.size() - 1);\n }\n }\n }\n\n\n loopcount++;\n if (((loopcount % 256) == 0) && keepLooping\n && (candidates.size() > 0)) {\n final MovePath front = candidates.peek();\n if (front.getFinalCoords().distance(dest) < bestPath\n .getFinalCoords().distance(dest)) {\n bestPath = front;\n }\n if (System.currentTimeMillis() > endTime) {\n keepLooping = false;\n System.out.println(\"Time limit reached searching \" +\n \"for path!\");\n }\n }\n } // end while\n //System.out.println(\"iteration count: \" + loopcount);\n if (getFinalCoords().distance(dest) > bestPath.getFinalCoords().distance(dest)) {\n // Make the path we found, this path.\n steps = bestPath.steps;\n }\n if (!getFinalCoords().equals(dest)) {\n lazyPathfinder(dest, type);\n }\n }", "private Action doNextMove(Action move){\n\t\t// update east or north\n\t\tif (move == Action.East){\n\t\t\teast++;\n\t\t} else if (move == Action.West){\n\t\t\teast--;\n\t\t} else if (move == Action.North){\n\t\t\tnorth++;\n\t\t} else if (move == Action.South){\n\t\t\tnorth--;\n\t\t}\n\t\treturn move;\n\t}", "private void StepForRobot() { \r\n\r\n\t\tIterator<Robot> itr = rob.iterator();\r\n\t\twhile(itr.hasNext()) {\r\n\r\n\t\t\tRobot r = itr.next();\r\n\t\t\tFruit fDest = null;\r\n\t\t\tdouble maxSum = 0;\r\n\t\t\tnode_data v = null;\r\n\t\t\tIterator<Fruit> it = fru.iterator();\r\n\t\t\twhile(it.hasNext()) {\r\n\r\n\r\n\t\t\t\tFruit f = it.next();\r\n\t\t\t\tdouble sum =0;\r\n\t\t\t\tint dest = f.e.getSrc();\r\n\t\t\t\tList<node_data> list = Algo.shortestPath(r.src, dest);\r\n\t\t\t\tlist.add(dgraph.getNode(f.e.getDest()));\r\n\r\n\r\n\r\n\t\t\t\tfor(int i = 0;i<list.size()-1;i++)\r\n\t\t\t\t\tsum += dgraph.getEdge(list.get(i).getKey(), list.get(i+1).getKey()).getWeight();\r\n\t\t\t\tsum = f.getValue() / sum;\r\n\r\n\t\t\t\tif(sum > maxSum && !f.isDest) {\r\n\r\n\r\n\t\t\t\t\tmaxSum = sum;\r\n\t\t\t\t\tv = list.get(1); \r\n\t\t\t\t\tfDest = f;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(fDest != null) {\r\n\r\n\r\n\r\n\t\t\t\tfDest.setDest(true);\r\n\t\t\t\tgame.chooseNextEdge(r.id, v.getKey());\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "private Move getBestMove(RaceTrack track, CellData[][] cells,\n\t\t\tPair<Integer, Integer> pos, Pair<Integer, Integer> speed, int depth) {\n\t\tCellData cellData = cells[pos.getLeft()][pos.getRight()];\n\n\t\tMap<Pair<Integer, Integer>, Character> availableMoves = new HashMap<>();\n\t\tint contX = pos.getLeft() + speed.getLeft();\n\t\tint contY = pos.getRight() + speed.getRight();\n\n\t\tPair<Integer, Integer> cont0 = Pair.of(contX, contY);\n\t\tif (cellData.getLegalMoves().contains(cont0)) {\n\t\t\tavailableMoves.put(cont0, '0');\n\t\t}\n\t\tPair<Integer, Integer> contL = Pair.of(contX - 1, contY);\n\t\tif (cellData.getLegalMoves().contains(contL)) {\n\t\t\tavailableMoves.put(contL, 'L');\n\t\t}\n\t\tPair<Integer, Integer> contR = Pair.of(contX + 1, contY);\n\t\tif (cellData.getLegalMoves().contains(contR)) {\n\t\t\tavailableMoves.put(contR, 'R');\n\t\t}\n\t\tPair<Integer, Integer> contU = Pair.of(contX, contY - 1);\n\t\tif (cellData.getLegalMoves().contains(contU)) {\n\t\t\tavailableMoves.put(contU, 'U');\n\t\t}\n\t\tPair<Integer, Integer> contD = Pair.of(contX, contY + 1);\n\t\tif (cellData.getLegalMoves().contains(contD)) {\n\t\t\tavailableMoves.put(contD, 'D');\n\t\t}\n\t\tfinal Map<Pair<Integer, Integer>, Integer> moveMap = new HashMap<>();\n\n\t\tfor (Pair<Integer, Integer> move : availableMoves.keySet()) {\n\t\t\tint moveValue = getMoveValue(cells, pos.getLeft(), pos.getRight(),\n\t\t\t\t\tmove.getLeft(), move.getRight());\n\t\t\tmoveMap.put(move, moveValue);\n\t\t}\n\n\t\tList<Pair<Integer, Integer>> allMoves = new ArrayList<>(\n\t\t\t\tmoveMap.keySet());\n\t\tCollections.sort(allMoves, new Comparator<Pair<Integer, Integer>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n\t\t\t\t\tPair<Integer, Integer> o2) {\n\t\t\t\treturn Integer.compare(moveMap.get(o2), moveMap.get(o1));\n\t\t\t}\n\t\t});\n\t\tPair<Integer, Integer> bestMove = allMoves.get(0);\n\n\t\tif ((depth == 0) || (moveMap.get(bestMove) > 0)) {\n\t\t\treturn new Move(bestMove, moveMap.get(bestMove),\n\t\t\t\t\tavailableMoves.get(bestMove));\n\t\t}\n\t\tfinal Map<Pair<Integer, Integer>, Integer> newMoveMap = new HashMap<>();\n\t\tfor (Pair<Integer, Integer> move : allMoves) {\n\t\t\tPair<Integer, Integer> newSpeed = Pair.of(\n\t\t\t\t\tmove.getLeft() - pos.getLeft(),\n\t\t\t\t\tmove.getRight() - pos.getRight());\n\t\t\tint moveValue = getBestMove(track, cells, move, newSpeed, depth - 1).value;\n\t\t\tnewMoveMap.put(move, moveValue);\n\t\t}\n\t\tCollections.sort(allMoves, new Comparator<Pair<Integer, Integer>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n\t\t\t\t\tPair<Integer, Integer> o2) {\n\t\t\t\treturn Integer.compare(newMoveMap.get(o2), newMoveMap.get(o1));\n\t\t\t}\n\t\t});\n\t\tbestMove = allMoves.get(0);\n\t\treturn new Move(bestMove, moveMap.get(bestMove),\n\t\t\t\tavailableMoves.get(bestMove));\n\t}", "private Move produceHeuristicMove(Board board){\n\n\t\tint numRows = board.getNumberOfRows();\n\t\tint[][] bins = new int[numRows][BINARY_LENGTH];\n\t\tint[] binarySum = new int[BINARY_LENGTH];\n\t\tint bitIndex,higherThenOne=0,totalOnes=0,lastRow=0,lastLeft=0,lastSize=0,lastOneRow=0,lastOneLeft=0;\n\t\t\n\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\tbinarySum[bitIndex] = 0;\n\t\t}\n\t\t\n\t\tfor(int k=0;k<numRows;k++){\n\t\t\t\n\t\t\tint curRowLength = board.getRowLength(k+1);\n\t\t\tint i = 0;\n\t\t\tint numOnes = 0;\n\t\t\t\n\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\tbins[k][bitIndex] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tdo {\n\t\t\t\tif(i<curRowLength && board.isStickUnmarked(k+1,i+1) ){\n\t\t\t\t\tnumOnes++;\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tif(numOnes>0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tString curNum = Integer.toBinaryString(numOnes);\n\t\t\t\t\t\twhile(curNum.length()<BINARY_LENGTH){\n\t\t\t\t\t\t\tcurNum = \"0\" + curNum;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\t\t\t\tbins[k][bitIndex] += curNum.charAt(bitIndex)-'0'; //Convert from char to int\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(numOnes>1){\n\t\t\t\t\t\t\thigherThenOne++;\n\t\t\t\t\t\t\tlastRow = k +1;\n\t\t\t\t\t\t\tlastLeft = i - numOnes + 1;\n\t\t\t\t\t\t\tlastSize = numOnes;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttotalOnes++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastOneRow = k+1;\n\t\t\t\t\t\tlastOneLeft = i;\n\t\t\t\t\t\t\n\t\t\t\t\t\tnumOnes = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}while(i<=curRowLength);\n\t\t\t\n\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\tbinarySum[bitIndex] = (binarySum[bitIndex]+bins[k][bitIndex])%2;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//We only have single sticks\n\t\tif(higherThenOne==0){\n\t\t\treturn new Move(lastOneRow,lastOneLeft,lastOneLeft);\n\t\t}\n\t\t\n\t\t//We are at a finishing state\t\t\t\t\n\t\tif(higherThenOne<=1){\n\t\t\t\n\t\t\tif(totalOnes == 0){\n\t\t\t\treturn new Move(lastRow,lastLeft,lastLeft+(lastSize-1) - 1);\n\t\t\t} else {\n\t\t\t\treturn new Move(lastRow,lastLeft,lastLeft+(lastSize-1)-(1-totalOnes%2));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH-1;bitIndex++){\n\t\t\t\n\t\t\tif(binarySum[bitIndex]>0){\n\t\t\t\t\n\t\t\t\tint finalSum = 0,eraseRow = 0,eraseSize = 0,numRemove = 0;\n\t\t\t\tfor(int k=0;k<numRows;k++){\n\t\t\t\t\t\n\t\t\t\t\tif(bins[k][bitIndex]>0){\n\t\t\t\t\t\teraseRow = k+1;\n\t\t\t\t\t\teraseSize = (int)Math.pow(2,BINARY_LENGTH-bitIndex-1);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(int b2 = bitIndex+1;b2<BINARY_LENGTH;b2++){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(binarySum[b2]>0){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(bins[k][b2]==0){\n\t\t\t\t\t\t\t\t\tfinalSum = finalSum + (int)Math.pow(2,BINARY_LENGTH-b2-1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfinalSum = finalSum - (int)Math.pow(2,BINARY_LENGTH-b2-1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tnumRemove = eraseSize - finalSum;\n\t\t\t\t\n\t\t\t\t//Now we find that part and remove from it the required piece\n\t\t\t\tint numOnes=0,i=0;\n\t\t\t\twhile(numOnes<eraseSize){\n\n\t\t\t\t\tif(board.isStickUnmarked(eraseRow,i+1)){\n\t\t\t\t\t\tnumOnes++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnumOnes=0;\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn new Move(eraseRow,i-numOnes+1,i-numOnes+numRemove);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If we reached here, and the board is not symmetric, then we only need to erase a single stick\n\t\tif(binarySum[BINARY_LENGTH-1]>0){\n\t\t\treturn new Move(lastOneRow,lastOneLeft,lastOneLeft);\n\t\t}\n\t\t\n\t\t//If we reached here, it means that the board is already symmetric, and then we simply mark one stick from the last sequence we saw:\n\t\treturn new Move(lastRow,lastLeft,lastLeft);\t\t\n\t}", "@Override\n public void runMovingTest() {\n long now;\n int count, search;\n elapsedTime.clear();\n expandedCells.clear();\n GraphPath<Integer,DefaultWeightedEdge> agentPath=null;\n GraphPath<Integer,DefaultWeightedEdge> targetPath=null;\n //Integer agentNode, targetNode;\n List<Integer> pathToFollow = null;\n for(Point[] p : points){\n pathfinder = new LazyMovingTargetAdaptiveAStarShortestPath<Integer, DefaultWeightedEdge>(map);\n count=0;\n search=0;\n agentNode = p[0].toNode();\n targetNode = p[1].toNode();\n LinkedList<Integer> movingExpCell = new LinkedList<>();\n LinkedList<Long> movingElapsTime = new LinkedList<>();\n targetThread r = new targetThread();\n evadeThread = new Thread(r);\n evadeThread.start();\n while(!agentNode.equals(targetNode)){\n if(pathToFollow==null || !agentPath.getEndVertex().equals(targetNode)) {\n agentPath = pathfinder.getShortestPath(agentNode, targetNode, new OctileDistance());\n if(pathfinder.getElapsedTime() > Long.valueOf(1900))\n continue;\n movingElapsTime.add(pathfinder.getElapsedTime());\n movingExpCell.add(pathfinder.getNumberOfExpandedNodes());\n search++;\n }\n Integer targetNext = null;\n Integer agentNext = null;\n if(count%2==0) {\n /*targetPath = new Trailmax<Integer,DefaultWeightedEdge>(map).getShortestPath(agentNode,targetNode,null);\n pathToFollow = Graphs.getPathVertexList(targetPath);\n if (!pathToFollow.isEmpty()) targetNext = pathToFollow.remove(0);\n if (targetNext.equals(targetNode) && !pathToFollow.isEmpty()) targetNext = pathToFollow.remove(0);\n targetNode = targetNext;*/\n synchronized(moveTarget) {\n moveTarget = new Boolean(true);\n }\n\n try {\n Thread.sleep(12);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n pathToFollow=Graphs.getPathVertexList(agentPath);\n if(!pathToFollow.isEmpty()){\n int i = pathToFollow.lastIndexOf(agentNode);\n agentNext=pathToFollow.remove(i+1);\n }\n agentNode = agentNext;\n count++;\n //System.out.println(agentNode+\",\"+targetNode);\n\n }\n\n r.terminate();\n try {\n evadeThread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n pathToFollow=null;\n movingElapsedTime.put(p, movingElapsTime);\n movingExpandedCells.put(p, movingExpCell);\n movesMap.put(p, count);\n searchesMap.put(p, search);\n if(verbose) {\n Long totElaps = Long.valueOf(0);\n Integer totExp = 0;\n for (Long l : movingElapsTime) totElaps += l;\n for (Integer i : movingExpCell) totExp += i;\n System.out.println(\"total elapsed: \" + totElaps + \" total expanded \" + totExp);\n }\n }\n }", "@Override\n\tpublic boolean step(){\n\t\tboolean ret=false;\n\t\tif(!isFollowing()){\n\t\t\t//80% valoszinuseggel leptet egy szomszedra\n\t\t\tRandom rng=new Random();\n\t\t\tboolean doAStep =rng.nextInt(10)>1;\n\t\t\tif(doAStep){\n\t\t\t\tif(tile != null){\n\t\t\t\tint bound=tile.getNeighbors().size();\n\t\t\t\t//System.out.println(\"bound :\"+bound);\n\t\t\t\t//System.out.println(\"ez lett a bound: \"+rng.nextInt(bound));\n\t\t\t\tret=step(tile.getNeighbors().get(rng.nextInt(bound)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "boolean nextStep();", "public TurnState step() {\n ReadOnlyHistory history = board.viewHistory();\n \n if (!isGameOver) {\n Player next = nextPlayer();\n Move move = null;\n \n try {\n final long startTime = System.currentTimeMillis();\n move = next.play(history);\n next.addTime(System.currentTimeMillis() - startTime);\n \n if (next.getTime() >= timeLimit || !board.isValid(move)){\n isGameOver = true;\n }\n else {\n board.set(move);\n }\n }\n catch (IllegalArgumentException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n catch (ArrayIndexOutOfBoundsException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n \n return new TurnState(next, move, isGameOver);\n }\n else {\n return new TurnState(null, null, true);\n }\n }", "public boolean moveFirst(\n )\n {moveStart(); return moveNext();}", "private int getSmartMove(char[] boardConfig) {\n\n ArrayList<Integer> emptySpaces = getEmptySpaces(boardConfig);\n\n double bestScore = -1;\n String bestChoice = \"\";\n int move = 0;\n\n //Loop through each empty space on the board\n for (Integer emptySpace : emptySpaces) {\n int space = emptySpace;\n\n char[] tempBoard = new char[boardConfig.length];\n\n //Create a copy of the board array\n System.arraycopy(boardConfig, 0, tempBoard, 0, boardConfig.length);\n\n //Add the current player's piece to the current empty spot\n tempBoard[space] = game.getPlayer() == 0 ? 'X' : 'O';\n\n //Get a string from the possible move board\n String tempBoardString = boardToString(tempBoard);\n\n //Attempt to get the possible move board configuration data from the long term memory\n BoardRecord record = longTermMemory.get(tempBoardString);\n\n //Check if a record was found\n if (record != null) {\n\n //Calculate the score of the current move in question\n float currentValue = (float) (record.getWins() - record.getLosses()) / (record.getLosses() + record.getWins() + record.getTies());\n\n //If the new move is better than the current best move choose it\n if (currentValue > bestScore) {\n bestScore = currentValue;\n move = space;\n bestChoice = tempBoardString;\n }\n }\n }\n\n if (!Objects.equals(bestChoice, \"\")) {\n shortTermMemory.add(bestChoice);\n return move;\n } else {\n return getRandomMove(boardConfig);\n }\n }", "public Move makeFirstMove(){\n bestWord = new ArrayList<>();\n getStartingWord( tray , bestWord, \"\", 0); //maxScore get's updated in here.\n if (maxScore == 0){ return null; }\n //right now the AI is dumb and always starts on the first tile.... this is only safe with boardSize/2 >= 7\n Move move =\n new Move(bestWord , Constants.BOARD_DIMENSIONS/2 ,\n Constants.BOARD_DIMENSIONS/2 - (bestWord.size() / 2) , true , maxScore , bot);\n //refillTray();\n return move;\n }", "private void nextPiece() {\n if (_c == M && _r <= M) {\n _c = 1;\n _r++;\n } else if (_r > M) {\n _move = null;\n } else {\n _c++;\n }\n }", "private void incr() {\n Move tempMove = null;\n Piece t1, t2;\n while (_r <= M) {\n t1 = Board.this._turn;\n t2 = Board.this.get(_c, _r);\n if (t1 == t2) {\n break;\n } else {\n nextPiece();\n }\n }\n if (_r > M) {\n _move = null;\n return;\n }\n int c1, r1, count3;\n Piece temp1, temp2;\n Board tempBoard;\n _dir = _dir.succ();\n while (_dir != null) {\n count3 = pieceCountAlong(_c, _r, _dir);\n c1 = _c + _dir.dc * count3;\n r1 = _r + _dir.dr * count3;\n tempMove = Move.create(_c, _r, c1, r1, Board.this);\n if (tempMove == null) {\n _dir = _dir.succ();\n continue;\n }\n if (isLegal(tempMove)) {\n _move = tempMove;\n break;\n }\n _dir = _dir.succ();\n }\n if (_dir == null) {\n _dir = NOWHERE;\n nextPiece();\n incr();\n }\n }", "private static double bestMoveHelper(Board board, int pliesLeft) {\n\t\tif (TRANSPOSITION_TABLE.containsKey(board.getHashCode())) {\n\t\t\treturn TRANSPOSITION_TABLE.get(board.getHashCode());\n\t\t}\n\t\tif (pliesLeft == 1 || board.isOver()) {\n\t\t\treturn recordEvaluation(board, board.evaluate());\n\t\t}\n\t\tBinaryOperator<Double> optimumFinder = board.whoseMove().isWhite() ? Math::max : Math::min;\n\t\treturn recordEvaluation(board, board.getLegalMoves().stream()\n\t\t\t\t.map(bindAtEnd(BasicDepthBasedMinimax::bestMoveHelper, pliesLeft - 1).compose(board::performMove))\n\t\t\t\t.reduce(optimumFinder).get());\n\t}", "static int minStepToReachTarget(int knightPos[], int targetPos[], int N) {\n // x and y direction, where a knight can move\n int dx[] = {-2, -1, 1, 2, -2, -1, 1, 2};\n int dy[] = {-1, -2, -2, -1, 1, 2, 2, 1};\n\n // queue for storing states of knight in board\n Queue<Cell> q = new LinkedList<>();\n\n // push starting position of knight with 0 distance\n q.add(new Cell(knightPos[0], knightPos[1], 0));\n\n Cell t;\n int x, y;\n boolean[][] visit = new boolean[N + 1][N + 1];\n\n // loop untill we have one element in queue\n while (!q.isEmpty()) {\n t = q.poll();\n if (visit[t.x][t.y]) \n continue;\n visit[t.x][t.y] = true;\n\n // if current cell is equal to target cell,\n // return its distance\n if (t.x == targetPos[0] && t.y == targetPos[1]) {\n return t.dis;\n }\n\n // loop for all reahable states\n for (int i = 0; i < 8; i++) {\n x = t.x + dx[i];\n y = t.y + dy[i];\n\n // If rechable state is not yet visited and\n // inside board, push that state into queue\n if (isInside(x, y, N) && !visit[x][y]) {\n q.add(new Cell(x, y, t.dis + 1));\n }\n }\n }\n return 0;\n }", "public int get_next(boolean optimized) {\n\t\tint id = future_moves.get(0).get(0);\n\t\tfuture_moves.remove(0);\n\t\treturn id;\n\t\t\n\t}", "public void paradiseMove(){\n if (!getCurrentMainCellCoordinates().equals(new DiscreteCoordinates(11, 9))) {\n move(30);\n }\n }", "@Override\r\n\tpublic int move(int lastMove, int[] takenList, int depthLimit) \r\n\t{\r\n\t\tGameState myState = new GameState(takenList, lastMove);\r\n\t\tdouble maxValue = max_value(myState, depthLimit);\r\n\t\tint myBestMove = myState.bestMove;\r\n\t\tif (myState.leaf) //why did i do this\r\n\t\t{\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn myBestMove;\r\n\t}", "@Override\n public void calculateMove() {\n int xa = 0, ya = 0;\n if (steps <= 0) {\n direction = ep.calculateDirection();\n steps = MAX_STEPS;\n }\n if (direction == 0) {\n ya--;\n }\n if (direction == 2) {\n ya++;\n }\n if (direction == 3) {\n xa--;\n }\n if (direction == 1) {\n xa++;\n }\n if (canMove(xa, ya)) {\n steps -= 1 + rest;\n move(xa * speed, ya * speed);\n moving = true;\n } else {\n steps = 0;\n moving = false;\n }\n }", "@Override\n\tpublic void determineNextState(Cell cell)\n\t{\n\t\tMap<String, Cell> neighbors = cell.getNeighborsWrap();\n\t\tif (!cell.nextStateFinalized()) {\n\t\t\tList<Cell> emptyNeighbors = getEligibleNeighborsOfState(neighbors, EMPTY);\n\t\t\tif (cell.getState() == FISH) {\n\t\t\t\tupdateGenericSpeciesTraits(cell);\n\t\t\t\tif (emptyNeighbors.size() != 0) {\n\t\t\t\t\tif (readyToReproduce(cell)) {\n\t\t\t\t\t\treproduce(cell, emptyNeighbors);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmove(cell, emptyNeighbors);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (cell.getState() == SHARK) {\n\t\t\t\tupdateGenericSpeciesTraits(cell);\n\t\t\t\tincrementStarveTime(cell);\n\t\t\t\tList<Cell> fishNeighbors = new ArrayList<Cell>();\n\t\t\t\tfishNeighbors = getEligibleNeighborsOfState(neighbors, FISH);\n\t\t\t\tif (readyToStarve(cell)) {\n\t\t\t\t\tkill(cell);\n\t\t\t\t} else if (fishNeighbors.size() != 0) {\n\t\t\t\t\teat(fishNeighbors, cell);\n\t\t\t\t} else if (emptyNeighbors.size() != 0) {\n\t\t\t\t\tif (readyToReproduce(cell)) {\n\t\t\t\t\t\treproduce(cell, emptyNeighbors);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCell movedTo = move(cell, emptyNeighbors);\n\t\t\t\t\t\tincrementStarveTime(movedTo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private int calculateNextMove(@TTTConstants.Sign int sign, int depth) {\n\n if (isWin(computerSign, false)) {\n return 10 - depth;\n } else if (isWin(playerSign, false)) {\n return depth - 10;\n }\n\n if (depth >= 9) {\n return 0;\n }\n\n List<Integer> scores = new ArrayList<>(), rowIndices = new ArrayList<>(), columnIndices = new ArrayList<>();\n\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n if (board[i][j] == TTTConstants.EMPTY) {\n board[i][j] = sign;\n scores.add(calculateNextMove(getOppositeSign(sign), depth + 1));\n rowIndices.add(i);\n columnIndices.add(j);\n board[i][j] = TTTConstants.EMPTY;\n }\n }\n }\n\n if (sign == computerSign) {\n int maxScore = -100;\n for (int i = 0; i < scores.size(); i++) {\n if (scores.get(i) > maxScore) {\n maxScore = scores.get(i);\n }\n }\n return randomizeScore(maxScore, scores, rowIndices, columnIndices);\n\n } else {\n int minScore = 100;\n for (int i = 0; i < scores.size(); i++) {\n if (scores.get(i) < minScore) {\n minScore = scores.get(i);\n }\n }\n return randomizeScore(minScore, scores, rowIndices, columnIndices);\n }\n }", "Piece getNextPiece();", "private Move guessBestMove(Piece player, Board board, double cutoff) {\n Board newBoard = new Board(board);\n Move bestSoFar;\n Iterator<Move> moveIterator = board.iterator();\n bestSoFar = moveIterator.next();\n newBoard.retract();\n while (moveIterator.hasNext()) {\n Move nextMove = moveIterator.next();\n int val = eval(newBoard);\n newBoard.makeMove(nextMove);\n if (eval(newBoard) > val) {\n bestSoFar = nextMove;\n val = eval(newBoard);\n if (val >= cutoff) {\n break;\n }\n }\n newBoard.retract();\n }\n return bestSoFar;\n }", "public List<MovePath> getNextMoves(boolean backward, boolean forward) {\n final ArrayList<MovePath> result = new ArrayList<MovePath>();\n final MoveStep last = getLastStep();\n// if (isJumping()) {\n// final MovePath left = clone();\n// final MovePath right = clone();\n//\n// // From here, we can move F, LF, RF, LLF, RRF, and RRRF.\n// result.add(clone().addStep(MovePath.MoveStepType.FORWARDS));\n// for (int turn = 0; turn < 2; turn++) {\n// left.addStep(MovePath.MoveStepType.TURN_LEFT);\n// right.addStep(MovePath.MoveStepType.TURN_RIGHT);\n// result.add(left.clone().addStep(MovePath.MoveStepType.FORWARDS));\n// result.add(right.clone().addStep(MovePath.MoveStepType.FORWARDS));\n// }\n// right.addStep(MovePath.MoveStepType.TURN_RIGHT);\n// result.add(right.addStep(MovePath.MoveStepType.FORWARDS));\n//\n// // We've got all our next steps.\n// return result;\n// }\n\n // need to do a separate section here for Aeros.\n // just like jumping for now, but I could add some other stuff\n // here later\n if (getEntity() instanceof Aero) {\n MovePath left = clone();\n MovePath right = clone();\n\n // From here, we can move F, LF, RF, LLF, RRF, and RRRF.\n result.add((clone()).addStep(MovePath.MoveStepType.FORWARDS));\n for (int turn = 0; turn < 2; turn++) {\n left.addStep(MovePath.MoveStepType.TURN_LEFT);\n right.addStep(MovePath.MoveStepType.TURN_RIGHT);\n result.add(left.clone().addStep(MovePath.MoveStepType.FORWARDS));\n result.add(right.clone().addStep(MovePath.MoveStepType.FORWARDS));\n }\n right.addStep(MovePath.MoveStepType.TURN_RIGHT);\n result.add(right.addStep(MovePath.MoveStepType.FORWARDS));\n\n // We've got all our next steps.\n return result;\n }\n\n // If the unit is prone or hull-down it limits movement options, unless\n // it's a tank; tanks can just drive out of hull-down and they cannot\n // be prone.\n if (getFinalProne() || (getFinalHullDown() && !(getEntity() instanceof Tank))) {\n if ((last != null) && (last.getType() != MoveStepType.TURN_RIGHT)) {\n result.add(clone().addStep(MovePath.MoveStepType.TURN_LEFT));\n }\n if ((last != null) && (last.getType() != MoveStepType.TURN_LEFT)) {\n result.add(clone().addStep(MovePath.MoveStepType.TURN_RIGHT));\n }\n\n if (getEntity().isCarefulStand()) {\n result.add(clone().addStep(MovePath.MoveStepType.CAREFUL_STAND));\n } else {\n result.add(clone().addStep(MovePath.MoveStepType.GET_UP));\n }\n return result;\n }\n if (canShift()) {\n if (forward && (!backward || ((last == null) || (last.getType() != MovePath.MoveStepType.LATERAL_LEFT)))) {\n result.add(clone().addStep(MoveStepType.LATERAL_RIGHT));\n }\n if (forward && (!backward || ((last == null) || (last.getType() != MovePath.MoveStepType.LATERAL_RIGHT)))) {\n result.add(clone().addStep(MovePath.MoveStepType.LATERAL_LEFT));\n }\n if (backward\n && (!forward || ((last == null) || (last.getType() != MovePath.MoveStepType.LATERAL_LEFT_BACKWARDS)))) {\n result.add(clone().addStep(MovePath.MoveStepType.LATERAL_RIGHT_BACKWARDS));\n }\n if (backward\n && (!forward || ((last == null) || (last.getType() != MovePath.MoveStepType.LATERAL_RIGHT_BACKWARDS)))) {\n result.add(clone().addStep(MovePath.MoveStepType.LATERAL_LEFT_BACKWARDS));\n }\n }\n if (forward && (!backward || ((last == null) || (last.getType() != MovePath.MoveStepType.BACKWARDS)))) {\n result.add(clone().addStep(MovePath.MoveStepType.FORWARDS));\n }\n if ((last == null) || (last.getType() != MovePath.MoveStepType.TURN_LEFT)) {\n result.add(clone().addStep(MovePath.MoveStepType.TURN_RIGHT));\n }\n if ((last == null) || (last.getType() != MovePath.MoveStepType.TURN_RIGHT)) {\n result.add(clone().addStep(MovePath.MoveStepType.TURN_LEFT));\n }\n if (backward && (!forward || ((last == null) || (last.getType() != MovePath.MoveStepType.FORWARDS)))) {\n result.add(clone().addStep(MovePath.MoveStepType.BACKWARDS));\n }\n return result;\n }", "static double addHeuristic1(GameState c, boolean isMaxNode) {\n\t\t// Value returned will be absolute. If its max node, this config is good\n\t\t// then value will be positive. If its min node,\n\t\t// and this config is good for min, then value will be negative\n\n\t\tint i, j, vacant_spaces;\n\t\t// Compute : Feasible Moves for self\n\t\tint self_feasible_moves = 0;\n\t\tint self_remaining_moves = 0;\n\t\tint opponent_feasible_moves = 0;\n\t\tint opponent_remaining_moves = 0;\n\n\t\t// Go through the board and figure out vacant spots\n\t\tvacant_spaces = 0;\n\t\tfor (i = -GameState.HALF_BOARD; i <= GameState.HALF_BOARD; i = i + 1) {\n\t\t\tif (c.getWeight(i) == 0) {\n\t\t\t\tvacant_spaces++;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 1; i <= GameState.MAX_WEIGHT; i = i + 1) {\n\t\t\t// Check if self have the weight\n\t\t\tif (c.IHaveWeight(i)) {\n\t\t\t\tself_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\t// Place it and see if you tip\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\tself_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if opponent has this weight\n\t\t\tif (c.opponentHasWeight(i)) {\n\t\t\t\topponent_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\t// Place the weight and see if you tip\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\topponent_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Need to take the max because one of the players may have played one\n\t\t// chance less\n\t\tif (self_remaining_moves == 0 && opponent_remaining_moves == 0) {\n\t\t\treturn 0.0;\n\t\t} else if (self_remaining_moves > opponent_remaining_moves)\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (self_remaining_moves * vacant_spaces);\n\t\telse\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (opponent_remaining_moves * vacant_spaces);\n\t}", "private Pair decideMovement(Entity e) {\n Pair pos = gameMap.getCoordinatesFor(e.getId());\n Movable movable = mm.get(e);\n Array<Pair> reachableCells = gameMap.pathFinder.getReachableCells(pos.x, pos.y, movable);\n ImmutableBag<Integer> enemies = groupAI.getEnemies(e);\n if (enemies.size() == 0) return reachableCells.get(MathUtils.random(reachableCells.size-1));\n\n // The best enemy you are considering chasing and its score\n int targetEnemy = -1;\n float bestScore = 0f;\n\n // The current enemy you are checking out and its score\n int id;\n float score;\n\n // How far away is the enemy? How many enemies are within a small radius of it?\n int distance, count;\n\n for (int i = 0; i < enemies.size(); i++) {\n count = 1;\n Pair target = gameMap.getCoordinatesFor(enemies.get(i));\n distance = MapTools.distance(pos.x, pos.y, target.x, target.y);\n for (Pair cell : MapTools.getNeighbors(target.x, target.y, 6)) {\n id = gameMap.getEntityAt(cell.x, cell.y);\n if (!enemies.contains(id)) continue;\n count++;\n }\n\n score = groupAI.entityScores.get(enemies.get(i)) * count / (1 + distance / 5);\n if (score > bestScore) {\n bestScore = score;\n targetEnemy = enemies.get(i);\n }\n }\n\n if (targetEnemy > -1) {\n Pair target = gameMap.getCoordinatesFor(targetEnemy);\n Path path = gameMap.pathFinder.findPath(pos.x, pos.y, target.x, target.y, movable, true);\n for (int i = 0; i < path.getLength(); i++) {\n Step step = path.getStep(i);\n Pair p = new Pair(step.getX(),step.getY());\n if (reachableCells.contains(p, false)) return p;\n }\n }\n return reachableCells.get(MathUtils.random(reachableCells.size-1));\n }", "int getNextStep() {\n if (!includedInLastStep()) {\n return nextStepLength + lastPenaltyLength \n + borderBefore + borderAfter + paddingBefore + paddingAfter;\n } else {\n start = end + 1;\n if (knuthIter.hasNext()) {\n goToNextLegalBreak();\n return nextStepLength + lastPenaltyLength \n + borderBefore + borderAfter + paddingBefore + paddingAfter; \n } else {\n return -1;\n }\n }\n }", "private MoveEvaluation minimax (int ply, IComparator comp, \n\t\t\tIPlayer player, IPlayer opponent) {\n\n\t\t// Try to improve on this lower-bound (based on selector). Reflects no move possible.\n\t\tMoveEvaluation best = new MoveEvaluation (comp.initialValue());\n\n\t\t// get all moves for this player and generate the boards that result\n\t\t// from making these moves. Select maximum of children if we are MAX\n\t\t// and minimum of children if we are MIN\n\t\tIterator<IGameMove> it = player.validMoves(state).iterator(); \n\t\twhile (it.hasNext()) {\n\t\t\tIGameMove move = it.next();\n\t\t\t\n\t\t\tmove.execute(state);\n\t\t\tnumComputationalStates++;\n\t\t\t\n\t\t\t// debugging output along the way...\n\t\t\tif (numComputationalStates % 100 == 0) {\n\t\t\t\tSystem.out.println (numComputationalStates);\n\t\t\t}\n\t\t\t\n\t\t\tMoveEvaluation pathMove = alreadyDetermined(state);\n\t\t\t\n\t\t\tif (pathMove == null) {\n\t\t\t\tint trial;\n\t\t\t\tif (ply <= 0) {\n\t\t\t\t\ttrial = original.eval(state);\n\t\t\t\t} else {\n\t\t\t\t\t// Recursively evaluate position. Compute MiniMax and swap\n\t\t\t\t\t// player and opponent, synchronously with MIN and MAX. If no move is\n\t\t\t\t\t// associated, then evaluate the generated board from original player\n\t\t\t\t\tMoveEvaluation me = minimax (ply-1, comp.opposite(), opponent, player);\n\t\t\t\t\tif (me.move == null) {\n\t\t\t\t\t\ttrial = original.eval(state);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrial = me.score;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpathMove = new MoveEvaluation (move, trial);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmove.undo(state);\n\t\t\t\n\t\t\t// If we are selected as the better move, then update accordingly\n\t\t\tif (comp.compare(best.score, pathMove.score) < 0) {\n\t\t\t\tbest = new MoveEvaluation (move, pathMove.score); \n\t\t\t}\n\t\t}\n\t\t\n\t\t// this move was selected for the gameState. record it. If it is null, then the game has\n\t\t// already been won or this is a draw; in either case, we will let recursive parent take\n\t\t// care of the scoring. Even add when no move, so we can keep track of the WON games.\n\t\taddToList(state, best);\n\t\t\n\t\treturn best;\n\t}", "@Override\n\tpublic Move getMove(Board game) {\n\t\t\n\t\tthis.maximumDepthReachedThisTurn = 0;\n\t\tArrayList<Move> moveList = game.getLegalMoves();\n\t\t/* tell the player what her options are */\n\t\tSystem.out.println(\"Turn \" + game.getTurn() + \", legal moves (\" + moveList.size() + \"): \");\n\t\tfor(Move m : moveList) {\n\t\t\tSystem.out.println(m.toString());\n\t\t}\n\t\t\n\t\tthis.nodesExploredThisTurn = 0;\n\t\tthis.isEndGameStatusFound = false;\n\t\tthis.maxDepth = 1;\n\t\tthis.bestMoveSoFar = null;\n\t\tthis.startMili = System.currentTimeMillis();\n\t\n\t\twhile (System.currentTimeMillis() - startMili < this.maxTime * 1000) {\n\t\t\tNode state = new Node(game, null, 0);\n\t\t\tthis.bestMoveSoFar = this.alphaBetaSearch(state);\n\t\t\t\n\t\t\tif (this.isEndGameStatusFound)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tthis.maxDepth++;\n\t\t}\n\n\t\tlong endMili=System.currentTimeMillis();\n\t\tdouble duration = ((double)(endMili - startMili)) / 1000.0;\n\t\t\n\t\tthis.maximumDepthReached += this.maximumDepthReachedThisTurn;\n\t\tSystem.out.println(\"Maximum depth reached at this turn: \" + this.maximumDepthReachedThisTurn);\n\t\tSystem.out.println(\"Maximum depth reached from game start state: \" + this.maximumDepthReached);\n\t\tSystem.out.println(\"Nodes explored at this turn: \" + this.nodesExploredThisTurn);\n\t\tSystem.out.println(\"Total nodes explored: \" + this.nodesExplored);\n\t\tSystem.out.println(\"Time to decide on a move: \" + duration);\n\n\t\treturn this.bestMoveSoFar;\n\t\t\n\t}", "@Override\r\n\tpublic double min_value(GameState s, int depthLimit)\r\n\t{\r\n\t\tdouble stateEvaluationValue = stateEvaluator(s);\r\n\t\r\n\t\tif (depthLimit == 0)\r\n\t\t{\r\n\t\t\treturn -(stateEvaluationValue);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdouble currMin = Double.POSITIVE_INFINITY;\r\n\t\t\tint bestMove = 0;\r\n\t\t\tArrayList <Integer> succList = generateSuccessors(s.lastMove, s.takenList);\r\n\t\t\tif (succList.isEmpty())\r\n\t\t\t{\r\n\t\t\t\ts.leaf = true;\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\tIterator <Integer> myItr = succList.iterator();\r\n\t\t\t\r\n\t\t\twhile (myItr.hasNext())\r\n\t\t\t{\r\n\t\t\t\tint currNumber = myItr.next();\r\n\t\t\t\t\r\n\t\t\t\tdouble tempMin = currMin;\r\n\t\t\t\tint [] newList = s.takenList;\r\n\t\t\t\tnewList [currNumber] = 2;\r\n\t\t\t\tGameState newGameState = new GameState(newList, currNumber);\r\n\t\t\t\tcurrMin = Math.min(currMin, max_value(newGameState, depthLimit - 1));\r\n\r\n\t\t\t\tif (currMin < tempMin)\r\n\t\t\t\t{\r\n\t\t\t\t\tbestMove = currNumber;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ts.bestMove = bestMove;\r\n\t\t\treturn currMin;\r\n\r\n\t\t}\r\n\t}", "public void move() {\n if (this.nextMove.equals(\"a\")) { // move down\n this.row = row + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"b\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"b\")) { // move right\n this.col = col + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"c\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"c\")) { // move up\n this.row = row - 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"a\";\n progress = 0;\n }\n }\n }", "protected Direction selectMove() {\n Map<Integer, Direction> positive, negative;\n // Add the directions that contains negative stations in a negative set\n // And every other direction in a positive set\n positive = new HashMap<Integer,Direction>(16);\n negative = new HashMap<Integer,Direction>(16);\n for (Direction d : Direction.directions) {\n int result = checkMove(d);\n if (result == 1) {\n positive.put(positive.size(), d);\n } else if (result == 0) {\n negative.put(negative.size(), d);\n } else {\n continue;\n }\n }\n // If there is no positive move, choose a RANDOM negative move\n if (positive.isEmpty()) {\n return negative.get(rand.nextInt(negative.size()));\n } else { // Otherwise choose a RANDOM positive move\n return positive.get(rand.nextInt(positive.size()));\n }\n }", "public Position getNextMove(TicTacToeBoard state) throws Exception {\r\n\t\treturn getRandomMove(state);\r\n\t}", "private Pair<Double, Move> minimax(OthelloBoard board, OthelloSide side, int depth, int max_depth, \n\t\t\t\t\t\t\t\tMove m, double alpha, double beta) {\n\t\tdouble bestScore;\n\t\tint turncount = turn;\n\t\tMove bestMove;\n\t\t//System.out.println(\"Start of minimax. Depth: \" + depth + \" Side: \" + side);\n\t /* int state = board.getState();\n\t\tif (state == OthelloBoard.DRAW)\n\t return new Pair<Double, Move>(0, m);\n\t if ((state == OthelloBoard.BLACK_WINS) && (side == OthelloSide.BLACK)) \n\t return new Pair<Double, Move>(Double.POSITIVE_INFINITY, m); \n\t if ((state == OthelloBoard.WHITE_WINS) && (side == OthelloSide.WHITE))\n\t return new Pair<Double, Move>(Double.POSITIVE_INFINITY, m);\n\t if ((state == OthelloBoard.BLACK_WINS) && (side == OthelloSide.WHITE))\n\t return new Pair<Double, Move>(Double.NEGATIVE_INFINITY, m);\n\t if ((state == OthelloBoard.WHITE_WINS) && (side == OthelloSide.BLACK))\n\t return new Pair<Double, Move>(Double.NEGATIVE_INFINITY, m);*/\n\t\tif(board.isDone()) {\n\t\t\tdouble endgame = board.countBlack() - board.countWhite();\n\t\t\treturn new Pair<Double, Move>(endgame, m);\n\t\t}\n\t\tif(depth == max_depth) {\n\t\t\tdouble mdScore = evaluator(board, side);\n\t\t\treturn new Pair<Double, Move>(mdScore, m);\t\t\t\n\t\t} else {\n\t\t\tLinkedList<Move> moveList = getMoveList(board, side);\n\t\t\tif(depth == 0) {\n\t \t\t\tLinkedList<Move> corners = new LinkedList<Move>();\n\t\t\t\tfor(Move mv : moveList) {\n\t\t\t\t\tif(board.isCorner(mv)) {\n\t\t\t\t\t\tcorners.add(mv);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(corners.size() != 0) {\n\t\t\t\t\tMove bcorner = null;\n\t\t\t\t\tdouble best = -Double.MAX_VALUE;\n\t\t\t\t\tfor(Move ml : corners) {\n\t\t\t\t\t\tdouble temp = evalMove(board, side, ml);\n\t\t\t\t\t\tif(temp > best) {\n\t\t\t\t\t\t\tbest = temp;\n\t\t\t\t\t\t\tbcorner = ml;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn new Pair<Double, Move>(best, bcorner);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(moveList.toString());\n\t\t\tbestScore = -Double.MAX_VALUE;\n\t\t\tbestMove = new Move(1,1);\n\t\t\tif(moveList.size() == 0) {\n\t\t\t\tdouble mdScore = evaluator(board, side);\n\t\t\t\treturn new Pair<Double, Move>(mdScore, m);\n\t\t\t} else {\n\t\t\t\tfor(int i = 0; i < moveList.size(); i++) {\n\t\t\t\t\tOthelloBoard tempBoard = board.copy();\n\t\t\t\t\tMove move = moveList.get(i);\n\t\t\t\t\ttempBoard.move(move, side);\n\t\t\t\t\talpha = -(minimax(tempBoard, side.opposite(), depth + 1, max_depth, move, -beta, -alpha)).score;\n\t\t\t\t\t//System.out.println(\"Side: \" + side);\n\t\t\t\t\t//System.out.println(\"alpha (before IF): \" + alpha);\n\t\t\t\t\t//System.out.println(\"bestScore (before IF): \" + bestScore);\n\t\t\t\t\tif(beta <= alpha) {\n\t\t\t\t\t\treturn new Pair<Double, Move>(alpha, move);\n\t\t\t\t\t}\n\t\t\t\t\tif(alpha > bestScore ) {\n\t\t\t\t\t\tbestScore = alpha;\n\t\t\t\t\t\tbestMove = move;\n\t\t\t\t\t\t//bestMove.copy(move);\n\t\t\t\t\t\t//System.out.println(\"theScore(IF): \" + alpha);\n\t\t\t\t\t\t//System.out.println(\"bestScore(IF): \" + bestScore);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn new Pair<Double, Move>(bestScore, bestMove);\n\t\t\t}\n\t\t}\n\t}", "java.lang.String getNextStep();", "public static boolean move() {\n S.rc.setIndicatorString(2, \"move\");\n if (target == null) {\n System.err.println(\"ERROR: tried to move without target\");\n return false;\n }\n\n // Check if we are close enough.\n int distanceSqToTarget = S.rc.getLocation().distanceSquaredTo(target);\n if (distanceSqToTarget <= thresholdDistanceSq) {\n // Stop bugging.\n start = null;\n S.rc.setIndicatorString(2, \"close enough\");\n return moveCloserToTarget();\n }\n\n if (start == null) {\n // Not currently bugging.\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"not buggin\");\n if (moveForwardish()) return true;\n // Start bugging.\n start = S.rc.getLocation();\n forward = forward.rotateRight().rotateRight();\n return move();\n } else {\n // Already bugging.\n // Stop bugging if we got closer to the target than when we started bugging.\n if (distanceSqToTarget < start.distanceSquaredTo(target)) {\n start = null;\n return move();\n }\n\n // Stop bugging if back-left is clear.\n // This means that we must have bugged around something that has since moved.\n if (canMove(forward.rotateLeft().rotateLeft().rotateLeft())) {\n start = null;\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"back left clear, forward \" + forward);\n return moveForwardish();\n }\n\n S.rc.setIndicatorString(2, \"scan circle\");\n forward = forward.rotateLeft().rotateLeft();\n // Try moving left, and try every direction in a circle from there.\n for (int i = 0; i < 8; i++) {\n if (moveForwardStrict()) return true;\n forward = forward.rotateRight();\n }\n return false;\n }\n }", "@Override\n public WorkflowStep next() {\n this.boardChangeDetected = 0;\n this.missingFutures = 0;\n this.missingTetromino = 0;\n startCalculator(false);\n return DETECT_ANOMALIES;\n }", "private Move findBestMove(Piece player, Board board, int depth,\n double cutoff) {\n Board newBoard = new Board(board);\n Move bestSoFar = newBoard.iterator().next();\n Iterator<Move> moveIterator = board.iterator();\n if (newBoard.piecesContiguous(player)) {\n return bestSoFar;\n } else if (newBoard.piecesContiguous(player.opposite())) {\n return guessBestMove(player, newBoard, cutoff);\n } else if (depth == 0) {\n return guessBestMove(player, newBoard, cutoff);\n }\n while (moveIterator.hasNext()) {\n Move nextMove = moveIterator.next();\n newBoard.makeMove(nextMove);\n int boardValue = eval(newBoard);\n Move response = findBestMove(player.opposite(),\n newBoard, depth - 1, -boardValue);\n newBoard.makeMove(response);\n int responseVal = eval(newBoard);\n newBoard.retract();\n newBoard.retract();\n if (-responseVal > boardValue) {\n boardValue = -responseVal;\n bestSoFar = nextMove;\n if (boardValue >= cutoff) {\n break;\n }\n }\n }\n return bestSoFar;\n }", "public void challengeMove(){\n int maxOutcome = -1;\n int returnIndex = -1;\n Hole lastHole;\n Hole selectedHole;\n ArrayList<Hole> availableHoles = availableMoves(nextToPlay);\n for(int i = 0; i < availableHoles.size(); i++){\n selectedHole = availableHoles.get(i);\n lastHole = holes[(selectedHole.getHoleIndex() + selectedHole.getNumberOfKoorgools() - 1) % 18];\n if(lastHole.getOwner() != nextToPlay){\n int numOfKorgools = lastHole.getNumberOfKoorgools() +1;\n if(numOfKorgools == 3 && !nextToPlay.hasTuz()){\n int otherTuzIndex = getPlayerTuz(Side.WHITE);\n if(otherTuzIndex == -1 || ((otherTuzIndex + 9) != lastHole.getHoleIndex())) {\n redistribute(selectedHole.getHoleIndex());\n return;\n }\n redistribute(selectedHole.getHoleIndex());\n return;\n }\n if(numOfKorgools % 2 == 0 && numOfKorgools > maxOutcome){\n maxOutcome = numOfKorgools;\n returnIndex = selectedHole.getHoleIndex();\n }\n }\n }\n if(returnIndex <= -1){\n randomMove();\n return;\n }\n redistribute(returnIndex);\n }", "public void monteCarlo(BlackHoleBoard currentBoard){\n if(currentBoard.getBoardDepth() < (currentBoard.getGameDepth() - THRESHOLD)){\n HashMap<Integer,Integer> mapNextMovetoScore = new HashMap<>();//map first move to final outcome\n for(int i = 0; i < BlackHoleBoard.NUM_GAMES_TO_SIMULATE; i++){\n //ArrayList<Integer> currentIndices = new ArrayList<>();\n int finalScore = 0;\n BlackHoleBoard currentWorkingBoard = new BlackHoleBoard();\n currentWorkingBoard.copyBoardState(currentBoard);\n int score = 0;\n int index = currentWorkingBoard.pickRandomMove();\n while(!currentWorkingBoard.gameOver()){\n //int index = currentWorkingBoard.pickRandomMove();\n\n currentWorkingBoard.setValue(index);\n index = currentWorkingBoard.pickRandomMove();\n\n\n }\n if(currentWorkingBoard.gameOver()){\n score = currentWorkingBoard.getScore();\n }\n mapNextMovetoScore.put(index,score);\n }\n int minScore = 0;\n int indexWithMinScore = 0;\n for(int key: mapNextMovetoScore.keySet()){\n if(mapNextMovetoScore.get(key) < minScore){\n minScore = mapNextMovetoScore.get(key);\n indexWithMinScore = key;\n }\n }\n //ArrayList<Integer> reccomendedMoves = mapNextMovetoScore.get(minScore);\n nextMove = indexWithMinScore;\n }else {\n nextMove = -1;\n }\n }", "public void makeMove() {\n ArrayList<Field> myFields = new ArrayList<>();\n for (Field[] fieldsRow : fields) {\n for (Field field : fieldsRow) {\n if(field != null && this.equals(field.getPlayer())) {\n myFields.add(field);\n }\n }\n }\n bestMove[0] = myFields.get(0);\n bestMove[1] = myFields.get(0);\n\n Random rand = new Random();\n for(Field destination : destinationFields) {\n if(canMove()) break;\n destinationField = destination;\n for (Field origin : myFields) {\n for(int i = 0; i < origin.getNeighbours().length; ++i) {\n Field neighbour = origin.getNeighbours()[i];\n if(neighbour != null) {\n if(neighbour.getPlayer() == null) {\n if(valueOfMove(origin, neighbour) > valueOfMove(bestMove[0], bestMove[1])) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n } else if(valueOfMove(origin, neighbour) == valueOfMove(bestMove[0], bestMove[1])) {\n if(rand.nextBoolean()) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n }\n }\n } else {\n Field nextField = neighbour.getNeighbours()[i];\n if(nextField != null) {\n correctJumpPaths(origin,null, origin);\n }\n }\n }\n }\n }\n }\n }", "private static Node updateNextNodeAlgo1(Node nextNode, Node destination) {\n if (nextNode.getDistanceToZ() > destination.getDistanceToZ()) {\n return destination;\n }\n return nextNode;\n }", "@Override\r\n\t// Precondition: During testing the AI is associated with the 'O', the odd number move.\r\n \tpublic Point desiredMove(TicTacToeGame theGame) {\n\t\t\r\n\t\tchar[][] board = theGame.getTicTacToeBoard();\r\n\t\tPoint dPoint;\r\n\t //check for win\r\n\t\tdPoint = winOrBlock(board,'O');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"winning\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//check for block\r\n\t\tdPoint = winOrBlock(board,'X');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"blocking\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//otherwise pick random loc\r\n\t\tRandom randy = new Random(); \r\n\t int randX = randy.nextInt(3);\r\n\t int randY = randy.nextInt(3);\r\n\t while(!theGame.available(randX, randY)) {\r\n\t \trandX = randy.nextInt(3);\r\n\t \trandY = randy.nextInt(3);\r\n\t }\r\n\t System.out.println(\"random\");\r\n\t return new Point(randX, randY);\r\n\t}", "public static FieldBattlePosition nextCheckpoint(Order order) {\n\n FieldBattlePosition nextCheckPoint = null;\n\n if (order.getCheckpoint3()!=null && order.getCheckpoint3().exists() && order.isReachedCheckpoint2()) {\n nextCheckPoint = order.getCheckpoint3();\n } else if (order.getCheckpoint2()!=null && order.getCheckpoint2().exists() && order.isReachedCheckpoint1()) {\n nextCheckPoint = order.getCheckpoint2();\n } else if (order.getCheckpoint1()!=null && order.getCheckpoint1().exists() && !order.isReachedCheckpoint1()) {\n nextCheckPoint = order.getCheckpoint1();\n }\n\n return nextCheckPoint;\n }", "public E nextStep() {\r\n\t\tthis.current = this.values[Math.min(this.current.ordinal() + 1, this.values.length - 1)];\r\n\t\treturn this.current;\r\n\t}", "private int[] getBestMoveAndScoreDifference(int[] board, int depth, boolean turn) {\n int boardCopy[];\n if (depth <= 0) {\n return new int[] {0,-1};\n }\n if (turn) {\n int minimum = MAXIMUM_POSSIPLE_SCORE_DIFFERENCE;\n int move = -1;\n for (int i = 0; i < 5; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, ! turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n move = i;\n }\n }\n int i = 10;\n if (board[2] < 2) {\n return new int[] {minimum,move};\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n move = i;\n }\n return new int[] {minimum,move};\n } else {\n int maximum = MINIMUM_POSSIPLE_SCORE_DIFFERENCE;\n int move = -1;\n for (int i = 5; i < 10; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n move = i;\n }\n }\n int i = 11;\n if (board[7] < 2) {\n return new int[] {maximum,move};\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n move = i;\n }\n return new int[] {maximum,move};\n }\n }", "public void next() {\n Solver<ArrayList<Integer>> mySolver =\n new Solver<ArrayList<Integer>>();\n ArrayList<ArrayList<Integer>> Solution =\n mySolver.SolveBFS(this);\n\n //Reset 'tried' to none\n tried = new HashSet<ArrayList<Integer>>();\n\n //Set up the nextState\n ArrayList<Integer> nextState = new ArrayList<Integer>();\n\n if(Solution.size() == 0) {\n //No Solution\n } else if (Solution.size() == 1) {\n nextState = Solution.get(0);\n curBoard = nextState;\n } else {\n nextState = Solution.get(1);\n curBoard = nextState;\n moveCount++;\n }\n clearStack();\n\n\tsetChanged();\n\tnotifyObservers();\n }", "public abstract String whichToMove(boolean[] available, String lastMove, int whoseTurn, Scanner scanner);", "int chooseMove();", "private void nextTraining() {\n\t\tif(!training_queue.isEmpty()) {\n\t\t\tPair<Soldier, Integer> tmp = training_queue.remove();\n\t\t\tif(tmp!=null) {\n\t\t\t\tcurrent = tmp.getKey();\n\t\t\t\tnb_to_train = tmp.getValue();\t\t\n\t\t\t\tnb_rounds = current.getTime_prod();\n\t\t\t}else {\n\t\t\t\tcurrent = null;\n\t\t\t\tnb_to_train = 1;\n\t\t\t\tnb_rounds = 100+50*(owner_castle.getLevel()+1);\n\t\t\t\tupgrade = true;\n\t\t\t}\n\t\t}else\n\t\t\tcurrent = null;\n\t}", "public static PentagoMove excecuteMiniMax(PentagoBoardState bs, int depth) {\n\t\tlong timerStart = System.currentTimeMillis();\n\t\tPentagoMove bestMove = null;\n\t\tint highestVal = Integer.MIN_VALUE;\n\t\tint lowestVal = Integer.MAX_VALUE;\n\t\tint currentVal = 0;\n\t\tint possibleMoves = bs.getAllLegalMoves().size();\n\t\tfor (PentagoMove move : bs.getAllLegalMoves()) {\n\t\t\tPentagoBoardState stateClone = (PentagoBoardState) bs.clone();\n\t\t\tstateClone.processMove(move);\n\t\t\tif(bs.getTurnPlayer() == 0) {\n\t\t\t\tMax(stateClone, depth-1);\n\t\t\t}\n\t\t\telse if(bs.getTurnPlayer() == 1) {\n\t\t\t\tMin(stateClone, depth-1);\n\t\t\t}\n\t\t\tif (bs.getTurnPlayer() == 0 && currentVal >= highestVal) {\n\t\t\t\thighestVal = currentVal;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\telse if (bs.getTurnPlayer() == 1 && currentVal <= lowestVal) {\n\t\t\t\tlowestVal = currentVal;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\tif (System.currentTimeMillis() - timerStart >= 1900) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlong totalTime = System.currentTimeMillis() - timerStart;\n\t\tSystem.out.println(totalTime);\n\t\treturn bestMove;\n\t}", "@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }", "public Move calculateMove(Location location) {\r\n\t\tDirection newDirection;\r\n\r\n\t\tArrayList<Location> neighbors = location.getNeighbors(location, map, 2);\r\n\t\t// remove neighbors that are mine or neutral\r\n\t\tneighbors = location.getEnemies(location, map, myID);\r\n\r\n\t\tif (location.getSite().strength == 0) {\r\n\t\t\tLocation.planMove(location, Direction.STILL);\r\n\t\t\treturn new Move(location, Direction.STILL);\r\n\t\t}\r\n\t\tif ((location.getSite().strength < 5 || location.getSite().strength < 4 * location.getSite().production)\r\n\t\t\t\t&& location.getSite().isAllowed(location.getSite().production)) {\r\n\t\t\tLocation.planMove(location, Direction.STILL);\r\n\t\t\treturn new Move(location, Direction.STILL);\r\n\t\t}\r\n\r\n\t\tif(neighbors.size() == 0) {\r\n\r\n\t\t\tif (isSafe(location)) {\r\n\t\t\t\tnewDirection = getClosestBoundary(location);\r\n\t\t\t\tLocation.planMove(location, newDirection);\r\n\t\t\t\treturn new Move(location, newDirection);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tnewDirection = getBestNeighbor(location);\r\n\t\t\tif (newDirection != Direction.STILL) {\r\n\t\t\t\tLocation.planMove(location, newDirection);\r\n\t\t\t\treturn new Move(location, newDirection);\r\n\t\t\t}\r\n\t\t\tnewDirection = chooseBestDirection(location);\r\n\t\t\tLocation.planMove(location, newDirection);\r\n\t\t\treturn new Move(location, newDirection);\r\n\t\t}\r\n\t\tnewDirection = getClosestEnemy(location);\r\n\t\tLocation.planMove(location, newDirection);\r\n\t\treturn new Move(location, newDirection);\r\n\t}", "@Override\n\tpublic GridCell execute() {\n\t\t//1. if there is a winning position, take it\n\t\tArrayList<GridCell> winningCell = TicTacToeBoardExaminer.getWinningPositions(board, side);\n\t\tif (winningCell.size() > 0) {\n\t\t\tGridCell move = winningCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//2. if there is a losing position, block it\n\t\tArrayList<GridCell> losingCell = TicTacToeBoardExaminer.getLosingPositions(board, side);\n\t\tif (losingCell.size() > 0) {\n\t\t\tGridCell move = losingCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//TODO: Implement checking of forks. This will get you to 100% win or tie rate\n\t\t\n\t\t//3. Otherwise get the optimal position\n\t\tGridCell optimal = TicTacToeBoardExaminer.getOptimal(board, side);\n\t\tif (optimal != null)\n\t\t\treturn optimal;\n\t\t\n\t\t//4. Otherwise just move randomly\n\t\telse \n\t\t\treturn new RandomStrategy(board, side).execute();\n\t\t\n\t}", "public static int findBestMove(Board board, PieceType playerPiece) {\n int bestVal = -1000;\n int row = -1;\n int col = -1;\n\n // Traverse all cells, evaluate minimax function\n // for all empty cells. And return the cell\n // with optimal value.\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n // Check if cell is empty\n if (board.getBoard()[i][j] == 0) {\n // Make the move\n board.getBoard()[i][j] = playerPiece.getValue();\n\n // compute evaluation function for this\n // move.\n int moveVal = minimax(board, playerPiece, 0, false);\n\n // Undo the move\n board.getBoard()[i][j] = 0;\n\n // If the value of the current move is\n // more than the best value, then update\n // best/\n if (moveVal > bestVal) {\n row = i;\n col = j;\n bestVal = moveVal;\n }\n }\n }\n }\n return (col + 1) + (row * board.getGame().getGridType().getSize());\n }" ]
[ "0.66812617", "0.66336364", "0.65516335", "0.6504919", "0.649822", "0.6468789", "0.64639395", "0.6434643", "0.6421773", "0.641829", "0.63782036", "0.63028204", "0.6289977", "0.62611187", "0.62594044", "0.61581826", "0.6125704", "0.61120886", "0.6097406", "0.60772645", "0.60585225", "0.60321844", "0.6032073", "0.601298", "0.60109895", "0.59817964", "0.59813917", "0.59755313", "0.5972588", "0.5964913", "0.5963394", "0.5959208", "0.59558266", "0.5954305", "0.59433824", "0.59336954", "0.5933119", "0.5929951", "0.59280634", "0.59177244", "0.5912", "0.5911069", "0.5910244", "0.59069836", "0.58995056", "0.58993816", "0.5892145", "0.58899945", "0.5873301", "0.58717763", "0.5854626", "0.58527505", "0.58499056", "0.58441406", "0.58434665", "0.5838286", "0.5827149", "0.5813096", "0.58016413", "0.5800508", "0.5790729", "0.57899743", "0.57630765", "0.575769", "0.5751713", "0.57514036", "0.5745504", "0.57362825", "0.5729852", "0.5725311", "0.5721524", "0.57194936", "0.5711459", "0.57113725", "0.5700559", "0.5700258", "0.56973356", "0.56966794", "0.5685045", "0.56832105", "0.56705505", "0.5659073", "0.5654546", "0.56515247", "0.56498706", "0.5631639", "0.5630568", "0.562767", "0.56237733", "0.5621774", "0.56162584", "0.5613525", "0.56039745", "0.5596094", "0.55921", "0.5587908", "0.55863565", "0.5580575", "0.55792916", "0.5576675" ]
0.7013818
0
Encodes a tree to a single string.
public String serialize(TreeNode root) { StringBuilder sb = new StringBuilder(); serialize(root,sb); return sb.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void encodeTree(){\n StringBuilder builder = new StringBuilder();\n encodeTreeHelper(root,builder);\n }", "public TreeNode encode(Node root) {\n return en(root);\n }", "public String toTreeString() {\n return toTreeString(overallRoot);\n }", "public String tree2Str(TreeNode t){\n\t\tif(t == null)\n\t\t\treturn \"\";\n\t\t\n\t\tStack<TreeNode> stack = new Stack<>();\n\t\tstack.push(t);\n\t\t\n\t\tSet<TreeNode> visited = new HashSet<>();\n\t\tStringBuilder s = new StringBuilder();\n\t\twhile(!stack.isEmpty()){\n\t\t\tt = stack.peek();\n\t\t\t\n\t\t\tif(visited.contains(t)){\n\t\t\t\tstack.pop();\n\t\t\t\ts.append(\")\");\n\t\t\t}else{\n\t\t\t\tvisited.add(t);\n\t\t\t\ts.append(\"(\" + t.data);\n\t\t\t\tif(t.left == null && t.right != null){\n\t\t\t\t\ts.append(\"()\");\n\t\t\t\t}\n\t\t\t\tif(t.right != null){\n\t\t\t\t\tstack.push(t.right);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(t.left != null){\n\t\t\t\t\tstack.push(t.left);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn s.substring(1, s.length()-1);\n\t}", "public String serialize(TreeNode root) {\n if(root == null)\n return \"N\";\n else\n return root.val + \" \"+ serialize(root.left) + \" \"+ serialize(root.right);\n \n }", "public String serialize(TreeNode root) {\n StringBuffer rst = preorderTraversal(root, new StringBuffer());\n return rst.toString();\n\n }", "public static String printTree()\r\n {\r\n String result = \"\";\r\n for (String s: tree.toArrayList())\r\n result = result + \" \" + s;\r\n return result;\r\n }", "public String toString() {\n return tree.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder ans = new StringBuilder();\n preorder(root, ans);\n return ans.toString();\n }", "public String serialize(TreeNode root) {\n if (root == null) return \"\";\n \n //BFS, level order\n StringBuilder sb = new StringBuilder();\n Queue<TreeNode> q = new LinkedList<>();\n q.offer(root);\n while(!q.isEmpty()) {\n root = q.poll();\n if (root == null) sb.append(\"null \");\n else {\n sb.append(root.val + \" \");\n q.offer(root.left);\n q.offer(root.right);\n }\n }\n \n return sb.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n TreeNode x = root;\n Deque<TreeNode> stack = new LinkedList<>();\n while (x != null || !stack.isEmpty()) {\n if (x != null) {\n sb.append(x.val);\n sb.append(' ');\n stack.push(x);\n x = x.left;\n } else {\n sb.append(\"null \");\n x = stack.pop();\n x = x.right;\n }\n }\n return sb.toString();\n }", "public static void main(String a[]) {\n TreeNode root = new TreeNode(1,\n new TreeNode(2,\n null,\n new TreeNode(4, null, null)),\n new TreeNode(3, null, null));\n StringBuffer sb = new StringBuffer();\n tree2str(root, sb);\n System.out.println(sb.toString());\n }", "public String serialize(TreeNode root) {\n \n \tif(root == null) {\n \t\treturn \"\";\n \t}\n \tif(root.left == null && root.right == null) {\n \t\treturn \"\" + root.val;\n \t}\n \tString s = serialize(root.left);\n \ts = \"(\" + s + \")\" + \"(\" + root.val + \")\";\n \ts += \"(\" + serialize(root.right) + \")\";\n \treturn s;\n \t\n }", "public String serialize(TreeNode root) {\n return preOrderToString(root);\n }", "private void encodeTree(BitOutputStore output, SymbolNode root) {\n output.appendBits(8, nLeafNodes - 1);\n SymbolNode[] path = new SymbolNode[256];\n int[] pathBranch = new int[256];\n path[0] = root;\n pathBranch[0] = 0;\n int depth = 1;\n while (depth > 0) {\n int index = depth - 1;\n SymbolNode pNode = path[index];\n int pBranch = pathBranch[index];\n // pBranch is set as follows:\n // 0 we've just arrived at the node and have not yet\n // identified whether it is a branch or a leaf.\n // we have not yet traversed any of its children\n //\n // 1 we traversed down the left branch and need to traverse\n // down the right\n //\n // 2 we have traversed both branches and are on our way up\n\n switch (pBranch) {\n case 0:\n // we've just pushed the node on the stack and have not yet\n // identified whether it is a leaf or a branch.\n if (pNode.isLeaf) {\n output.appendBit(1); // terminal\n output.appendBits(8, pNode.symbol);\n BitOutputStore bitpath = encodePath(depth, path);\n pNode.nBitsInCode = bitpath.getEncodedTextLength();\n pNode.code = bitpath.getEncodedText();\n // pop the stack\n depth--;\n index--;\n // pro-forma, clear the stack variables\n pathBranch[depth] = 0;\n path[depth] = null;\n\n } else {\n output.appendBit(0); // non-terminal\n pathBranch[index] = 1;\n pathBranch[depth] = 0;\n path[depth] = pNode.left;\n depth++;\n }\n break;\n case 1:\n pathBranch[index] = 2;\n pathBranch[depth] = 0;\n path[depth] = pNode.right;\n depth++;\n break;\n case 2:\n // we're on our way up\n pathBranch[index] = 0;\n path[index] = null;\n depth--;\n break;\n default:\n // error condition, won't happen\n throw new IllegalStateException(\"Internal error encoding tree\");\n }\n }\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n visit(root, sb);\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n visit(root, sb);\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n visit(root, sb);\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder res = mySeri(root, new StringBuilder());\n return res.toString();\n }", "public String serialize(TreeNode root) {\n if (root == null) {\n return \"X\";\n }\n return \"(\" + serialize(root.left) + \")\" + root.val + \"(\" + serialize(root.right) + \")\";\n }", "public String serialize(TreeNode root) {\n StringBuilder builder = new StringBuilder();\n serialize(root, builder);\n return builder.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder stringBuilder = new StringBuilder();\n buildString(root, stringBuilder);\n return stringBuilder.toString();\n }", "public String serialize(TreeNode root) {\r\n StringBuilder sb = new StringBuilder();\r\n buildString(root, sb);\r\n return sb.toString();\r\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n buildString(root, sb);\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n String res = \"\";\n return serializeCore(root,res);\n }", "public String serialize(TreeNode root) {\n if (root == null) return \"\";\n Queue<TreeNode> qu = new LinkedList<>();\n StringBuilder sb = new StringBuilder();\n qu.offer(root);\n sb.append(root.val);\n sb.append(' ');\n while (!qu.isEmpty()) {\n TreeNode x = qu.poll();\n if (x.left == null) sb.append(\"null \");\n else {\n qu.offer(x.left);\n sb.append(x.left.val);\n sb.append(' ');\n }\n if (x.right == null) sb.append(\"null \");\n else {\n qu.offer(x.right);\n sb.append(x.right.val);\n sb.append(' ');\n }\n }\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n buildTree(sb, root);\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n if (root == null) {\n return \"\";\n }\n StringBuilder sb = new StringBuilder();\n serialize(root, sb);\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n if (root == null) {\n \treturn \"#\";\n }\n \n return \"\" + root.val + \" \" + serialize(root.left) + \" \" + serialize(root.right);\n }", "public String serialize(TreeNode root) {\n if(root==null)\n return \"#\";\n return String.valueOf(root.val)+\"|\"+serialize(root.left)+\"|\"+serialize(root.right);\n }", "public TreeNode encode(Node root) {\n if (root == null) {\n return null;\n }\n TreeNode head = new TreeNode(root.val);\n head.left = en(root.children);\n return head;\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n serHelper(root, sb);\n return sb.toString().trim(); \n }", "public String serialize(TreeNode root) {\n ArrayList<Integer> buffer = new ArrayList<>();\n serialize(root, buffer);\n int[] ints = buffer.stream().mapToInt(i -> i).toArray();\n ByteBuffer byteBuf = ByteBuffer.allocate(ints.length * 4);\n IntBuffer intBuf = byteBuf.order(ByteOrder.BIG_ENDIAN).asIntBuffer();\n intBuf.put(ints);\n String result = Base64.getEncoder().encodeToString(byteBuf.array());\n //System.out.println(result);\n return result;\n }", "public String serialize(TreeNode root) {\n if (root == null) {\n return \"\";\n }\n StringBuilder sb = new StringBuilder();\n\n preOrderSerialize(root, sb);\n\n // remove last delimiter from output\n sb.setLength(sb.length() - 1);\n return sb.toString();\n }", "public static String printTree()\n {\n \tString tree = \"\";\n ArrayList<String> letters = converter.toArrayList();\n for(int i = 0; i < letters.size(); i++)\n {\n tree += letters.get(i);\n if(i + 1 < letters.size())\n \t tree += \" \";\n }\n \n return tree;\n }", "public String serialize(TreeNode root) {\r\n\r\n // **** initialization ****\r\n StringBuilder sb = new StringBuilder();\r\n\r\n // **** recursive call (implements DFS) ****\r\n serialize(root, sb);\r\n\r\n // **** return trimmed string ****\r\n return sb.toString().trim();\r\n }", "public TreeNode encode(Node root) {\n\t\t\tif (root == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tTreeNode head = new TreeNode(root.val);\n\t\t\thead.left = en(root.children);\n\t\t\treturn head;\n\t\t}", "public String toString() {\n if (size == 0) {\n return \"Empty tree\";\n }\n\n\n StringBuilder sb = new StringBuilder();\n Node<T> right = root.getRight();\n Node<T> left = root.getLeft();\n\n if (right != null) {\n right.buildBranch(true, \"\", sb);\n }\n\n sb.append(root.getData() + \"\\n\");\n\n if (left != null)\n left.buildBranch(false, \"\", sb);\n\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n if (root==null){\n return \"\";\n }\n StringBuilder str = new StringBuilder();\n serializeRec(str,root);\n str.deleteCharAt(str.length()-1);\n return str.toString();\n }", "public String serialize(TreeNode root) {\n // write your code here\n StringBuilder sb = new StringBuilder();\n ArrayList<TreeNode> queue = new ArrayList<TreeNode>();\n if (root == null) {\n sb.append(\"{}\");\n return sb.toString();\n }\n queue.add(root);\n TreeNode node;\n for(int i = 0; i < queue.size(); i++){\n \tnode = queue.get(i);\n \tif(node != null){\n \t\tqueue.add(node.left);\n \t\tqueue.add(node.right);\n \t}\n }\n while (queue.get(queue.size() - 1) == null) {\n queue.remove(queue.size() - 1);\n }\n\n sb.append(\"{\");\n sb.append(queue.get(0).val);\n for(int i = 1; i < queue.size(); i++){\n \tif (queue.get(i) == null) {\n \t\tsb.append(\",#\");\n \t} else {\n \t\tsb.append(\",\" + queue.get(i).val);\n \t}\n }\n sb.append(\"}\");\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n build_string(root, sb);\n return String.format(\"[%s]\", sb.substring(0, sb.length() - 1).toString());\n }", "public String serialize(TreeNode root) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tpreOrderSerialization(root, sb);\n\t\treturn sb.toString();\n\t}", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n if (root==null) return \"#\";\n sb.append(String.valueOf(root.val));\n String left = serialize(root.left);\n String right = serialize(root.right);\n sb.append(\",\").append(left).append(\",\").append(right);\n return sb.toString();\n }", "private void writeTree() throws IOException {\n\t\ttry (final BufferedWriter writer = Files.newBufferedWriter(destinationFile, CHARSET)) {\n\t\t\tfinal char[] treeString = new char[512];\n\t\t\tint treeStringLength = 0;\n\t\t\tfor (final CharacterCode cur : sortedCodes) {\n\t\t\t\ttreeString[treeStringLength++] = cur.getChar();\n\t\t\t\ttreeString[treeStringLength++] = (char) cur.getCode().length();\n\t\t\t}\n\t\t\tif (treeStringLength > 0xff) { //tree length will not always be less than 255, we have to write it on two bytes\n\t\t\t\tfinal int msb = (treeStringLength & 0xff00) >> Byte.SIZE;\n\t\t\t\ttreeStringLength &= 0x00ff;\n\t\t\t\twriter.write(msb);\n\t\t\t} else {\n\t\t\t\twriter.write(0);\n\t\t\t}\n\t\t\twriter.write(treeStringLength);\n\t\t\twriter.write(treeString, 0, treeStringLength);\n\t\t}\n\t}", "public String serialize(TreeNode root) {\n if (root == null) return \"\";\n\n StringBuilder sb = postOrder(root, new StringBuilder());\n sb.deleteCharAt(sb.length() - 1);\n return sb.toString();\n }", "public String serialize(TreeNode root) {\r\n StringBuilder stringBuilder = new StringBuilder();\r\n doSerialize(root,stringBuilder);\r\n String result = stringBuilder.toString();\r\n return result.substring(0,result.length()-1);\r\n }", "public String toString() {\n\t\t\n\t\tStringBuilder tree = new StringBuilder();\n\t\t\n\t\tQueue<AVLNode> queue = new LinkedList<>();\n\t\tqueue.add(root);\n\t\t\n\t\twhile(!queue.isEmpty()) {\n\t\t\tAVLNode node = queue.poll();\n\t\t\ttree.append(node.num);\n\n\t\t\tif(node.left!=null)\n\t\t\t\tqueue.add(node.left);\n\t\t\t\n\t\t\tif(node.right!=null)\n\t\t\t\tqueue.add(node.right);\n\t\t}\n\t\t\n\t\treturn tree.toString();\n\t}", "public String serialize(TreeNode root) {\n if (root == null) {\n return \"\";\n }\n\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n List<String> result = new ArrayList<>();\n while (queue.size() > 0) {\n int size = queue.size();\n for (int i = 0; i < size; i++) {\n TreeNode node = queue.remove();\n if (node == null) {\n result.add(\"#\");\n } else {\n result.add(node.val + \"\");\n queue.add(node.left);\n queue.add(node.right);\n }\n }\n }\n\n return String.join(\",\", result);\n }", "public String serialize(TreeNode root) {\n return serialize(root, \"\");\n }", "public String serialize(TreeNode root) {\n\n if (root == null)\n return \"\";\n\n StringBuffer stringBuffer = new StringBuffer();\n Queue<TreeNode> nodeQueue = new LinkedBlockingQueue<TreeNode>();\n nodeQueue.offer(root);\n TreeNode nullNode = new TreeNode(Integer.MIN_VALUE);\n\n while (!nodeQueue.isEmpty()) {\n TreeNode node = nodeQueue.poll();\n if (node != null && !node.equals(nullNode)) {\n stringBuffer.append(node.val + \",\");\n\n\n if (node.left != null || node.right != null) {\n if (node.left != null) {\n nodeQueue.offer(node.left);\n } else {\n nodeQueue.offer(nullNode);\n //stringBuffer.append(\"null,\");\n }\n\n if (node.right != null) {\n nodeQueue.offer(node.right);\n } else {\n nodeQueue.offer(nullNode);\n // stringBuffer.append(\"null,\");\n }\n }\n } else if (node.equals(nullNode)){\n stringBuffer.append(\"null,\");\n }\n }\n\n stringBuffer.setLength(stringBuffer.length()-1);\n return stringBuffer.toString();\n }", "public String serialize(TreeNode root) {\n return root == null ? \"null\" : root.val + \" \" + serialize(root.left) + \" \" + serialize(root.right);\n }", "public String serialize(TreeNode root) {\n if (root == null) {\n return \"\";\n }\n Queue<TreeNode> queue = new LinkedList<>();\n StringBuilder builder = new StringBuilder();\n queue.offer(root);\n while (!queue.isEmpty()) {\n TreeNode node = queue.poll();\n if (node == null) {\n builder.append(\"X,\");\n } else {\n builder.append(node.val + \",\");\n queue.offer(node.left);\n queue.offer(node.right);\n }\n }\n return builder.toString();\n }", "public String toString() {\n if (subTrees.isEmpty()) return rootToString();\n StringBuilder result = new StringBuilder(rootToString() + \"(\" + subTrees.get(0).toString());\n for (int i = 1; i < subTrees.size(); i++) result.append(\",\").append(subTrees.get(i).toString());\n return result + \")\";\n }", "public String printBFSTree(){\n if(root==null)return \"\";\n String binstr=\"\";\n String valuestr=\"\";\n String codestr=\"\";\n LinkedList<HCNode> list=new LinkedList<HCNode>();\n root.code=\"\";\n list.add(root);\n HCNode node;\n while(list.size()>0){\n node=list.getFirst();\n if(node.left==null && node.right==null){\n binstr=binstr+\"0\";\n valuestr=valuestr+((byte)node.str.charAt(0))+\"\\n\";\n codestr=codestr+node.code;\n }else{\n binstr=binstr+\"1\";\n }\n if(node.left!=null){node.left.code=node.left.parent.code+\"0\";list.addLast(node.left);}\n if(node.right!=null){node.right.code=node.right.parent.code+\"1\";list.addLast(node.right);}\n list.removeFirst();\n }\n String res=binstr+\"\\n\"+valuestr+codestr+\"\\n\";\n System.out.println(binstr);\n System.out.print(valuestr);\n System.out.println(codestr);\n return res;\n }", "public String serialize(TreeNode root) {\n if (root==null){\n return \"[]\";\n }\n Queue<TreeNode> queue = new LinkedList<TreeNode>();\n List<Integer> res = new ArrayList<Integer>();\n queue.add(root);\n int num=0;\n while (queue.size() > 0) {\n TreeNode p=queue.poll();\n if (p==null){\n // System.out.println(\"null\");\n res.add(null);\n continue;\n }\n // System.out.println(p.val);\n res.add(p.val);\n num=res.size();\n queue.offer(p.left);\n queue.offer(p.right);\n }\n res=res.subList(0, num);\n System.out.println(res.toString());\n return res.toString().replaceAll(\" \", \"\");\n }", "public String treeJSON() {\n\t\ttry{\r\n\t\tList trees = this.getTransedTrees();\r\n\t\tString result = this.treeJSON(trees);\r\n\t\treturn result;\r\n\t\t}catch(Exception e){\r\n\t\t\tlog.info(\">>>>faceye error in method:treeJSON() is\"+e.toString());\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t}", "public String serialize(TreeNode root) {\n if (root == null){\n return \"\";\n }\n StringBuilder sb = new StringBuilder();\n Queue<TreeNode> queue = new LinkedList<>();\n queue.offer(root);\n while (!queue.isEmpty()){\n TreeNode curt = queue.poll();\n if (curt == null){\n sb.append(\"null,\");\n continue;\n }\n sb.append(curt.val);\n sb.append(\",\");\n queue.offer(curt.left);\n queue.offer(curt.right);\n }\n sb.deleteCharAt(sb.length() - 1);\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n Queue<TreeNode> queue=new LinkedList<>();\n queue.add(root);\n StringBuilder str=new StringBuilder(\"[\");\n while(!queue.isEmpty()){\n TreeNode node=queue.poll();\n if(node==null){\n str.append(\"null,\");\n }else{\n str.append(node.val).append(\",\");\n queue.add(node.left);\n queue.add(node.right);\n }\n }\n str.setLength(str.length()-1);\n str.append(\"]\");\n return str.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n TreeNode current = root;\n if (current == null) {\n return sb.toString();\n }\n Queue<TreeNode> queue = new LinkedList<>();\n queue.offer(current);\n while (!queue.isEmpty()) {\n current = queue.poll();\n if (current == null) {\n sb.append(\"null\");\n } else {\n sb.append(current.val);\n }\n sb.append(\",\");\n if (current != null) {\n queue.offer(current.left);\n }\n if (current != null) {\n queue.offer(current.right);\n }\n }\n return sb.toString();\n }", "public String printTree() {\n printSideways();\n return \"\";\n }", "public String serialize(TreeNode root) {\n if(root == null){\n return \"\";\n }\n Queue<TreeNode> curList = new LinkedList<TreeNode>();\n Queue<TreeNode> nextList = new LinkedList<TreeNode>();\n StringBuilder sb = new StringBuilder();\n curList.add(root);\n while(curList.size() != 0){\n while(curList.size() != 0){\n \tTreeNode curNode = curList.poll();\n if(curNode == null){\n sb.append(\",null\");\n }\n else{\n \tif(sb.length() != 0)\n \t\tsb.append(',');\n sb.append(String.valueOf(curNode.val));\n nextList.add(curNode.left);\n nextList.add(curNode.right);\n }\n }\n curList = nextList;\n }\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n if(root==null) return \"null\";\n Deque<TreeNode> deque = new LinkedList<>();\n StringBuilder sb = new StringBuilder();\n deque.push(root);\n sb.append(root.val);\n sb.append(',');\n while(!deque.isEmpty()){\n TreeNode current = deque.poll();\n if(current.left!=null){\n deque.addLast(current.left);\n sb.append(current.left.val);\n sb.append(',');\n }\n else sb.append(\"null,\");\n \n if(current.right!=null){\n deque.addLast(current.right);\n sb.append(current.right.val);\n sb.append(',');\n }\n else sb.append(\"null,\");\n }\n \n return sb.toString();\n }", "public void encodeTreeHelper(HuffmanNode node, StringBuilder builder){\n if(node.getLeft() == null && node.getRight()== null && !node.getCharAt().equals(null))\n encodedTable.put(node.getCharAt(),builder.toString());\n else{\n encodeTreeHelper(node.getLeft(), builder.append(\"0\"));\n encodeTreeHelper(node.getRight(), builder.append(\"1\"));\n }\n \n if(builder.length()>0)\n builder.deleteCharAt(builder.length()-1);\n }", "public static String getTreeString(final BinaryNodeInterface<Character> root) {\n String treeString = \"\";\n\n if (root == null) {\n return \"\";\n }\n\n if (root.isLeaf()) {\n treeString = \"L\" + root.getData().toString();\n return treeString;\n }\n\n treeString = \"I\";\n\n if (root.getLeftChild() != null) {\n treeString = treeString + getTreeString(root.getLeftChild());\n }\n if (root.getRightChild() != null) {\n treeString = treeString + getTreeString(root.getRightChild());\n }\n\n return treeString;\n\n }", "public String serialize(Node15 root) {\n\t if(root == null) return \"\";\n\t serializeT(root);\n\t return sb.toString();\n\t }", "public String toString(){\n //return myString(root);\n printInOrder(root);\n return \"\";\n }", "public String serialize(TreeNode root) {\n StringBuilder s = new StringBuilder();\n s.append('[');\n if (root == null) {\n s.append(']');\n return s.toString();\n }\n Queue<TreeNode> q =new LinkedList<>();\n q.add(root);\n boolean now=true,next=false;\n while(!q.isEmpty()){\n int size = q.size();\n while (size-- != 0) {\n TreeNode p = q.poll();\n if (p!=null){\n s.append(p.val+\",\");\n q.add(p.left);\n q.add(p.right);\n if (p.left != null||p.right!=null) {\n next=true;\n }\n } else {\n if (now){\n s.append(\"null,\");\n }\n }\n }\n now=next;\n next=false;\n }\n s.append(\"]\");\n return s.toString();\n }", "public String serialize(TreeNode root) {\n if (root == null) {\n return \"[]\";\n }\n\n List<String> list = new ArrayList<>();\n Queue<TreeNode> queue = new LinkedList<>();\n queue.offer(root);\n\n while (!queue.isEmpty()) {\n TreeNode node = queue.poll();\n\n if (node == null) {\n list.add(\"null\");\n continue;\n } else {\n list.add(\"\" + node.val);\n }\n\n if (node.left != null) {\n queue.offer(node.left);\n } else {\n queue.offer(null);\n }\n\n if (node.right != null) {\n queue.offer(node.right);\n } else {\n queue.offer(null);\n }\n }\n\n // 移除末尾的 null\n for (int i = list.size() - 1; i >= 0; i--) {\n if (list.get(i).equals(\"null\")) {\n list.remove(i);\n } else {\n break;\n }\n }\n\n StringBuilder sb = new StringBuilder();\n sb.append('[');\n for (int i = 0; i < list.size(); i++) {\n sb.append(list.get(i));\n if (i == list.size() - 1) {\n sb.append(\"]\");\n } else {\n sb.append(\",\");\n }\n }\n\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n if (root == null) return null;\n\n StringBuilder sb = new StringBuilder();\n serializePreorder(root, sb);\n\n return sb.substring(0, sb.length() - 1);\n }", "private static void serializeHelper(TreeNode root, StringBuilder res){\n if (root == null){\n res.append(\"null,\");\n return;\n }\n res.append(Integer.toString(root.val));\n res.append(\",\");\n serializeHelper(root.left, res);\n serializeHelper(root.right, res);\n }", "public String serialize(Node root) {\n List<String> childString = new ArrayList<>();\n for (Node node : root.children) {\n childString.add(serialize(node));\n }\n return \"(\" + root.val + String.join(\"\", childString) + \")\";\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n \n Queue<TreeNode> q = new LinkedList<>();\n \n q.add(root);\n while(!q.isEmpty()) {\n TreeNode node = q.poll();\n sb.append(node != null ? node.val : \"null\");\n sb.append(\",\");\n \n if (node != null) {\n q.offer(node.left);\n q.offer(node.right);\n }\n }\n sb.deleteCharAt(sb.length() - 1);\n //System.out.println(sb);\n return sb.toString();\n }", "public String serialize(TreeNode root) {\n if (root == null) return \"\";\n Queue<TreeNode> queue = new LinkedList<>();\n queue.offer(root);\n StringBuilder ans = new StringBuilder();\n while (!queue.isEmpty()) {\n int sz = queue.size();\n for (int i = 0; i < sz; ++i) {\n TreeNode cur = queue.poll();\n if (cur == null) ans.append(\"#\").append(\",\");\n else {\n ans.append(cur.val).append(\",\");\n queue.offer(cur.left);\n queue.offer(cur.right);\n }\n }\n }\n return ans.toString();\n }", "private String toTreeString(PhyloTreeNode node) {\n if(node == null) {\n return \"\";\n }\n if(node.isLeaf()) {\n if(node.getParent() != null)\n builderTree.append(node.getLabel() + \":\" + String.format(\"%.5f\", node.getParent().getDistanceToChild()));\n else{\n builderTree.append(node.getLabel() + \":0.0\");\n }\n }\n else{\n builderTree.append(\"(\");\n toTreeString(node.getRightChild());\n builderTree.append(\",\");\n toTreeString(node.getLeftChild());\n builderTree.append(\")\");\n if(node.getParent() != null) {\n builderTree.append(\":\" + String.format(\"%.5f\", node.getParent().getDistanceToChild()));\n }\n }\n return builderTree.toString();\n }", "public String toString() {\n return toString(root) + \" \";//call helper method for in-order traversal representation\n }", "public String serialize(TreeNode root) {\n if(root == null) return \"#\";\n return root.val + \",\" + serialize(root.left) + \",\" + serialize(root.right);\n }", "public String toString(Tree<K, V> t) {\n\t\tString result = \"\", leftString, rightString;\n\n\t\tleftString = left.toString(left);\n\t\trightString = right.toString(right);\n\t\tresult = leftString + (leftString.equals(\"\") ? \"\" : \" \") + key + \"/\"\n\t\t\t\t+ value + (rightString.equals(\"\") ? \"\" : \" \") + right;\n\n\t\treturn result;\n\t}", "public String serialize(TreeNode root) {\r\n // Preorder traversal to build our string.\r\n if (root == null) return \"#\";\r\n String left = serialize(root.left);\r\n String right = serialize(root.right);\r\n return root.val + \",\" + left + \",\" + right;\r\n\r\n }", "public static String printTree(Tree t) {\n\tStringWriter sw = new StringWriter();\n\tPrintWriter pw = new PrintWriter(sw);\n\tTreePrint tp = new TreePrint(\"penn\", \"markHeadNodes\", tlp);\n\ttp.printTree(t, pw);\n\treturn sw.toString();\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n Stack<TreeNode> stack = new Stack<TreeNode>();\n stack.push(root);\n while(!stack.isEmpty()) {\n TreeNode n = stack.pop();\n if(n == null) sb.append(\"#\").append(\",\");\n else {\n sb.append(n.val).append(\",\");\n stack.push(n.right);\n stack.push(n.left);\n }\n }\n sb.deleteCharAt(sb.length()-1);\n return sb.toString();\n }", "private String _toString(IntTreeNode root) {\r\n if (root == null) {\r\n return \"\";\r\n } else {\r\n String leftToString = _toString(root.left);\r\n String rightToString = _toString(root.right);\r\n return leftToString + rightToString + \" \" + root.data;\r\n } \r\n }", "public static String serialize(TreeNode root) {\n StringBuilder temp = new StringBuilder();\n serializeHelper(root, temp);\n return temp.toString().substring(0, temp.length() - 1);\n }", "public TreeNode encode(Node root) {\n if (root == null) return null;\n TreeNode node = new TreeNode(root.val);\n List<Node> children = root.children;\n TreeNode tmp = node;\n if (!children.isEmpty()) {\n for (int i = 0; i < children.size(); i++) {\n if (i == 0) {\n node.left = encode(children.get(0));\n tmp = node.left;\n } else {\n tmp.right = encode(children.get(i));\n tmp = tmp.right;\n }\n }\n }\n return node;\n }", "public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n LinkedList<TreeNode> stack = new LinkedList<>();\n stack.push(root);\n while (!stack.isEmpty()) {\n TreeNode now = stack.pop();\n if (null == now) {\n sb.append(\"#,\");\n } else {\n sb.append(now.val).append(\",\");\n stack.push(now.right);\n stack.push(now.left);\n }\n }\n return sb.toString().substring(0, sb.length() - 1);\n }", "public String serialize(TreeNode root) {\r\n\t\tif (root == null)\r\n\t\t\treturn \"null\";\r\n\r\n\t\tStringBuilder ret = new StringBuilder();\r\n\t\tQueue<TreeNodePP> q = new LinkedList<>();\r\n\t\tq.offer(new TreeNodePP(root));\r\n\t\tint qSize = 0;\r\n\r\n\t\twhile (!q.isEmpty()) {\r\n\t\t\tqSize = q.size();\r\n\t\t\tfor (int i = 0; i < qSize; i++) {\r\n\t\t\t\tTreeNodePP pp = q.poll();\r\n\t\t\t\tTreeNode n = pp.n;\r\n\t\t\t\tif (n != null) {\r\n\t\t\t\t\tq.offer(new TreeNodePP(n.left));\r\n\t\t\t\t\tq.offer(new TreeNodePP(n.right));\r\n\t\t\t\t\tret.append(n.val + \",\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tret.append(\"null,\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString ans = ret.toString();\r\n\r\n\t\t// remove the last two nulls.\r\n\t\treturn ans.substring(0, ans.length() - 11);\r\n\t}", "public String serialize(TreeNode root) {\n\t\tStringBuilder preorder = new StringBuilder(), inorder = new StringBuilder();\n\t\tinorder(root, inorder);\n\t\tpreorder(root, preorder);\n\t\tStringBuilder serialize = new StringBuilder();\n\t\tserialize.append(preorder);\n\t\tserialize.append(\":\");\n\t\tserialize.append(inorder);\n\t\treturn serialize.toString();\n\t}", "public String serialize(Node root) {\n StringBuilder sb = new StringBuilder();\n serialize_helper(root, sb);\n return sb.toString();\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n traverseNode(sb, \"\", \"\", root, false);\n return sb.toString();\n }", "@Override\n public String toString() { // display subtree in order traversal\n String output = \"[\";\n LinkedList<Node<T>> q = new LinkedList<>();\n q.add(this);\n while(!q.isEmpty()) {\n Node<T> next = q.removeFirst();\n if(next.leftChild != null) q.add(next.leftChild);\n if(next.rightChild != null) q.add(next.rightChild);\n output += next.data.toString();\n if(!q.isEmpty()) output += \", \";\n }\n return output + \"]\";\n }", "private void serialize(TreeNode root, StringBuilder sb) {\r\n\r\n // **** end / base condition ****\r\n if (root == null)\r\n return;\r\n\r\n // **** append node to string builder ****\r\n sb.append(root.val + \" \");\r\n\r\n // **** traverse left subtree ****\r\n serialize(root.left, sb);\r\n\r\n // **** traverse right subtree ****\r\n serialize(root.right, sb);\r\n }", "public String getTree ( ) {\n\n String tree;\n StringWriter s = new StringWriter();\n PrintWriter out = null;\n\n try {\n out = new PrintWriter(s);\n } catch ( Exception ex ) {};\n\n program.printIndividual(param.Parameters.STATE, out);\n\n tree = s.toString();\n String list2[] = tree.split(\"\\n\");\n\n out.close();\n try { s.close(); } catch ( Exception e ) {};\n\n return list2[list2.length - 1];\n\n }", "public String preOrderToString(TreeNode tn){\n \tif (tn==null) return \"\";\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(tn.val);\n \tsb.append(\",\");\n \tif (tn.left==null){\n \t\tsb.append(\"#,\");\n \t}else{\n \t\tsb.append(preOrderToString(tn.left));\n \t}\n \tif (tn.right==null){\n \t\tsb.append(\"#,\");\n \t}else{\n \t\tsb.append(preOrderToString(tn.right));\n \t}\n \treturn sb.toString();\n }", "public String toString() {\n if (root == null) {\n return (treeName + \" Empty tree\\n\");\n } else {\n String space = \"\";\n return treeName + \"\\n\" + toStringRecur(root.right, space) + \"\\n\" + root.element +\n \"[No Parent so sad]\" + toStringRecur(root.left, space) + \"\\n\";\n }\n }", "public void testToString() {\r\n tree.insert(\"act\");\r\n tree.insert(\"apple\");\r\n tree.insert(\"bagel\");\r\n\r\n assertEquals(\"(act, apple, bagel)\", tree.toString());\r\n Lab14BinarySearchTree<String> tree2 =\r\n new Lab14BinarySearchTree<String>();\r\n assertEquals(\"()\", tree2.toString());\r\n }", "@Override\n\t\tpublic String toString() {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tpreOrderTraverse(expression.root, 1, sb);\n\t\t\treturn sb.toString();\n\t\t}", "public void writeTree(String path) {\n this.sb = new StringBuilder();\n writeTreeRec(this._root);\n\n try (PrintWriter out = new PrintWriter(path)){\n out.println(sb.toString());\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void getDecodedMessage(String encoding){\n\n String output = \"\";\n Node temp = this.root;\n for(int i = 0;i<encoding.length();i++){\n\n if(encoding.charAt(i) == '0'){\n temp = temp.left;\n\n if(temp.left == null && temp.right == null){\n System.out.print(temp.getData());\n temp = this.root;\n }\n }\n else\n {\n temp = temp.right;\n if(temp.left == null && temp.right == null){\n System.out.print(temp.getData());\n temp = this.root; \n }\n\n }\n }\n }", "private String traverseForToString() {\n\t\tif (this.root != null)\n\t\t\tpreorderTraverseForToString(this.root);\n\n\t\treturn this.order;\n\t}", "public void printCode(PrintStream out, String code, BinaryTree<HuffData> tree) {\n HuffData theData = tree.getData(); //Get the data of the tree\n if (theData.symbol != null) { //If the data's symbol is not null (as in a symbol and not a sum)\n if(theData.symbol.equals(\" \")) { //If the symbol is a space print out \"space: \"\n out.println(\"space: \" + code);\n } else { //Otherwise print out the symbol and the code\n out.println(theData.symbol + \" \" + code);\n //Then add the symbol and code to the EncodeData table\n this.encodings[encodingsTop++] = new EncodeData(code, theData.symbol);\n }\n } else {\n //If the data's symbol is null, that means it is a sum node\n //and so it needs to go farther down the tree\n \n //Go down the left tree and add a 0\n printCode(out, code + \"0\", tree.getLeftSubtree());\n //Go down the right tree and add a 1\n printCode(out, code + \"1\", tree.getRightSubtree());\n }\n }", "@Override\n public String toString() {\n StringBuilder outString = new StringBuilder();\n int currentTreeIndex = this.indexCorrespondingToTheFirstElement;\n if (treeSize > 0) {\n while (currentTreeIndex != -1) {\n Node<T> currentNode = getHelper(currentTreeIndex);\n outString.append(currentNode.data).append(\", \");\n currentTreeIndex = currentNode.nextIndex;\n }\n }\n\n if (outString.length() != 0) {\n outString.deleteCharAt(outString.length() - 1); // \", \"\n outString.deleteCharAt(outString.length() - 1);\n }\n return \"[\" + outString.toString() + \"]\";\n }" ]
[ "0.79797685", "0.7266544", "0.6766947", "0.67098355", "0.65929043", "0.6520053", "0.651422", "0.6502086", "0.6480438", "0.6466228", "0.6452631", "0.6446793", "0.6446198", "0.64218706", "0.6407569", "0.64030504", "0.64030504", "0.64030504", "0.6394578", "0.6385417", "0.6381468", "0.63735145", "0.6369932", "0.636884", "0.6354713", "0.635004", "0.6341996", "0.63252956", "0.6320339", "0.6310683", "0.63047385", "0.6293301", "0.62849295", "0.6284787", "0.6258395", "0.6234277", "0.6215959", "0.6201105", "0.6189887", "0.618641", "0.61788976", "0.61625683", "0.6157522", "0.61480963", "0.6142877", "0.6130256", "0.6123191", "0.6120755", "0.61178523", "0.6117542", "0.6097112", "0.60458636", "0.604062", "0.60347533", "0.6030559", "0.60221565", "0.5992314", "0.59820646", "0.5971955", "0.59686804", "0.59669226", "0.59489965", "0.59384716", "0.59372765", "0.59284425", "0.592408", "0.5918216", "0.58973026", "0.589485", "0.5886111", "0.5884969", "0.5880159", "0.58759373", "0.587404", "0.5872872", "0.58665675", "0.586645", "0.5835777", "0.582354", "0.58163106", "0.58071697", "0.57734656", "0.5771894", "0.57675743", "0.5759923", "0.5754951", "0.57327545", "0.56898916", "0.5654589", "0.56353855", "0.5627884", "0.5606264", "0.55901295", "0.5561329", "0.5547123", "0.552698", "0.54959106", "0.548813", "0.5484927", "0.5480989" ]
0.62459517
35
Decodes your encoded data to tree.
public TreeNode deserialize(String data) { String[] strs = data.split(","); LinkedList<String> list = new LinkedList<>(); for(String s:strs){ list.add(s); } return deserialize(list); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TreeNode deserialize(String data) {\n byte[] bytes = Base64.getDecoder().decode(data);\n IntBuffer intBuf = ByteBuffer.wrap(bytes)\n .order(ByteOrder.BIG_ENDIAN).asIntBuffer();\n int[] nums = new int[intBuf.remaining()];\n intBuf.get(nums);\n //for (int i = 0; i<nums.length;++i) System.out.print(nums[i]);\n return deserialize(new DataIterator(nums), false, 0);\n }", "public TreeNode deserialize(String data) {\n return null;\n }", "public TreeNode deserialize(String data) {\n return deserialize(data, new int[]{0});\n }", "public TreeNode deserialize(String data) {\n return preOrderFromString(data);\n }", "public TreeNode deserialize(StringBuilder data) {\r\n //分成两组\r\n \tHashMap<Integer,Integer> showMapAct = new HashMap<>();\r\n \tStringBuilder[] result = data.split(\"k\");\r\n \t//deal with showMapAct\r\n \tif(result.length==1 || result[1].length()==0){\r\n \t}\r\n \telse{\r\n \t\tStringBuilder[] extraInfo = result[1].split(\",\");\r\n \t\tfor(int i = 0; i < extraInfo.length;i++){\r\n \t\t\tStringBuilder[] temp = extraInfo[i].split(\":\");\r\n \t\t\tshowMapAct.put(Integer.valueOf(temp[0]),Integer.valueOf(temp[1]));\r\n \t\t}///////\r\n \t}\r\n \tStringBuilder[] nums = result[0].split(\",\");\r\n \tint[] preOrder = new int[nums.length/2];\r\n \tint[] inOrder = new int[nums.length/2];\r\n \tinitArray(preOrder,nums,0,nums.length/2);\r\n \tinitArray(inOrder,nums,nums.length/2,nums.length);\r\n \treturn constructTree(preOrder,0,preOrder.length,inOrder,0,inOrder.length,showMapAct);\r\n }", "public TreeNode deserialize(String data) {\n int[] ptr = { 0 };\n return parse(data, ptr);\n }", "public TreeNode deserialize(String data) {\n if (data.length() == 0) {\n return null;\n }\n return deserialize(data.toCharArray(), new int[] { 0 });\n }", "public TreeNode deserialize(String data) {\n return build(new Scanner(data));\n }", "public Node decode(TreeNode root) {\n if (root == null) return null;\n\n Node newNodeRoot = new Node(root.val, new ArrayList<>());\n\n // Decoding all the children nodes\n TreeNode sibling = root.left;\n while (sibling != null) {\n newNodeRoot.children.add(decode(sibling));\n sibling = sibling.right;\n }\n\n return newNodeRoot;\n }", "public Node decode(TreeNode root) {\n\t\t\tif (root == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new Node(root.val, de(root.left));\n\t\t}", "public Node decode(TreeNode root) {\n if (root == null) {\n return null;\n }\n return new Node(root.val, de(root.left));\n }", "private RealDecisionTree deserialize(byte[] bytes){\n try {\n ObjectInputStream stream = new ObjectInputStream(new ByteArrayInputStream(bytes));\n RealDecisionTree tree = (RealDecisionTree)stream.readObject();\n return tree;\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "public TreeNode deserialize(String data) {\n if (data == null) return null;\n String[] nodes = data.split(separator);\n Queue<String> q = new LinkedList<>();\n for (String n : nodes) {\n q.offer(n);\n }\n return helper(q);\n }", "public TreeNode deserialize(String data) {\n Queue<String> queue = new LinkedList<>(Arrays.asList(data.split(SP)));\n return buildTree(queue);\n }", "public TreeNode deserialize(String data) {\n if (data.length() == 0) return null;\n String[] node = data.split(\" \");\n int n = node.length;\n Deque<TreeNode> stack = new LinkedList<>();\n TreeNode root = new TreeNode(Integer.parseInt(node[0]));\n TreeNode x = root;\n stack.push(x);\n\n int i = 1;\n while (i < n) {\n while (i < n && !node[i].equals(\"null\")) {\n x.left = new TreeNode(Integer.parseInt(node[i++]));\n x = x.left;\n stack.push(x);\n }\n while (i < n && node[i].equals(\"null\")) {\n x = stack.pop();\n i++;\n }\n if (i < n) {\n x.right = new TreeNode(Integer.parseInt(node[i++]));\n x = x.right;\n stack.push(x);\n }\n }\n return root;\n }", "public TreeNode deserialize(String data) {\n \n Queue<String> q = new LinkedList<>(Arrays.asList(data.split(\" \")));\n return helper(q);\n }", "public TreeNode deserialize(String data) {\n String[] nodes=data.substring(1,data.length()-1).split(\",\");\n TreeNode root=reverseTreeNode(nodes[0]);\n Queue<TreeNode> parents=new LinkedList<>();\n TreeNode parent=root;\n boolean isLeft=true;\n for(int i=1;i<nodes.length;i++){\n TreeNode cur=reverseTreeNode(nodes[i]);\n if(isLeft){\n parent.left=cur;\n }else{\n parent.right=cur;\n }\n if(cur!=null){\n parents.add(cur);\n }\n isLeft=!isLeft;\n if(isLeft){\n parent=parents.poll();\n }\n }\n return root;\n }", "public void decode(String name) {\n\t\tByteWriter bw = new ByteWriter(name + \"-restored\");\n\n\t\t/*\n\t\t * Read bytes until none are left.\n\t\t */\n\t\twhile (!data.eof()) {\n\t\t\tBST node = tree;\n\t\t\tString decoded = \"\";\n\t\t\tclear();\n\n\t\t\twhile (decoded.equals(\"\")) {\n\t\t\t\tgrabBits(1);\n\n\t\t\t\t/*\n\t\t\t\t * Follow the bits read from file through the Huffman tree\n\t\t\t\t * until a leaf is found. Once found, convert the code back\n\t\t\t\t * to the original bitstring.\n\t\t\t\t */\n\t\t\t\tnode = (proc.equals(\"0\")) ? node.getLeft() : node.getRight();\n\n\t\t\t\tif (node.getRight() == null && node.getLeft() == null) {\n\t\t\t\t\tdecoded = node.getData().getBitstring();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* \n\t\t\t * If EOF byte is found, quit writing to file.\n\t\t\t */\n\t\t\tif (decoded.equals(\"0000\")) {\n\t\t\t\tSystem.out.println(\"Found the null byte!\");\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//Write translated H. code to target as byte\n\t\t\tbw.writeByte(decoded);\n\t\t}\n\t\tbw.close();\n\t}", "public TreeNode deserialize(String data) {\r\n // We use a queue because we can deserialse in the same way we serialised (preorder)\r\n Queue<String> dserialised = new LinkedList<>();\r\n dserialised.addAll(Arrays.asList(data.split(\",\")));\r\n return helper(dserialised);\r\n }", "public TreeNode deserialize(String data) {\n\t\tString[] orders = data.split(\":\");\n\t\tString[] preorderString = orders[0].split(\",\");\n\t\tString[] inorderString = orders[1].split(\",\");\n\n\t\tint[] preorder = new int[preorderString.length], inorder = new int[inorderString.length];\n\t\tfor (int i = 0; i < preorderString.length; i++) {\n\t\t\tpreorder[i] = Integer.parseInt(preorderString[i]);\n\t\t\tinorder[i] = Integer.parseInt(inorderString[i]);\n\t\t}\n\t\treturn buildTree(preorder, inorder, 0, preorder.length - 1, 0, inorder.length - 1);\n\t}", "public Node decode(TreeNode root) {\n if (root == null) {\n return null;\n }\n Node result = new Node(root.val, new ArrayList<>());\n TreeNode cur = root.left;\n while (cur != null) {\n result.children.add(decode(cur));\n cur = cur.right;\n }\n return result;\n }", "public TreeNode deserialize(String data) {\n // write your code here\n Queue<String> queue = new LinkedList<>();\n queue.addAll(Arrays.asList(data.split(splitter)));\n return deserializeHelper(queue);\n }", "public TreeNode deserialize(String data) {\n if (data.length() == 0) return null;\n String[] node = data.split(\" \");\n Queue<TreeNode> qu = new LinkedList<>();\n TreeNode root = new TreeNode(Integer.parseInt(node[0]));\n qu.offer(root);\n int i = 1;\n while (!qu.isEmpty()) {\n Queue<TreeNode> nextQu = new LinkedList<>();\n while (!qu.isEmpty()) {\n TreeNode x = qu.poll();\n if (node[i].equals(\"null\")) x.left = null;\n else {\n x.left = new TreeNode(Integer.parseInt(node[i]));\n nextQu.offer(x.left);\n }\n i++;\n if (node[i].equals(\"null\")) x.right = null;\n else {\n x.right = new TreeNode(Integer.parseInt(node[i]));\n nextQu.offer(x.right);\n }\n i++;\n }\n qu = nextQu;\n }\n return root;\n }", "public TreeNode deserialize(String data) {\n Deque<String> nodes = new LinkedList<>();\n nodes.addAll(Arrays.asList(data.substring(1, data.length() - 1).split(SPLITER)));\n \n return build_tree(nodes);\n }", "private static void decode() throws IOException{\n File file = new File(_encodedBinFile);\n String longStringAsFile;\n \n //DataInputStream dis;\n FileWriter w;\n try {\n //dis = new DataInputStream(new FileInputStream(file));\n longStringAsFile = getLongStringAsFile();\n //dis.close();\n w = new FileWriter(\"decoded.txt\");\n Node traverser = root;\n for(int i=0; i < longStringAsFile.length(); i++){\n if(longStringAsFile.charAt(i) == '0'){\n //go to left\n if (traverser.getLeftPtr() == null){\n //fallen off the tree. Print to file\n if (i == longStringAsFile.length() - 1 ){\n w.write(((LeafNode)traverser).getData());\n }\n else{\n w.write(((LeafNode)traverser).getData() + \"\\n\");\n traverser = root.getLeftPtr();\n }\n }\n else{\n traverser = traverser.getLeftPtr();\n }\n }\n else{\n //go to right of tree\n if (traverser.getRightPtr() == null){\n //fallen off the tree. PRint to file\n if (i == longStringAsFile.length() - 1){\n w.write(((LeafNode)traverser).getData() );\n }\n else{\n w.write(((LeafNode)traverser).getData() + \"\\n\");\n traverser = root.getRightPtr();\n }\n\n }\n else{\n traverser = traverser.getRightPtr();\n }\n }\n \n }\n //dis.close();\n w.close();\n } catch (IOException ex) {\n Logger.getLogger(decoder.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public TreeNode deserialize(String data) {\r\n Deque<String> nodes = new LinkedList<>();\r\n nodes.addAll(Arrays.asList(data.split(spliter)));\r\n return buildTree(nodes);\r\n }", "public TreeNode deserialize(String data) {\n // write your code here\n ArrayList<TreeNode> queue = new ArrayList<TreeNode>();\n boolean isLeftPosition = true;\n String[] stringArray = data.substring(1, data.length() - 1).split(\",\");\n if(data.equals(\"{}\")){\n \treturn null;\n }\n TreeNode root = new TreeNode(Integer.parseInt(stringArray[0]));\n queue.add(root);\n int index = 0;\n for(int i = 1; i < stringArray.length; i++){\n \tif(!stringArray[i].equals(\"#\")){\n \t\tTreeNode node = new TreeNode(Integer.parseInt(stringArray[i]));\n \t\tSystem.out.print((new TreeNode(Integer.parseInt(stringArray[i])).equals(new TreeNode(Integer.parseInt(stringArray[i])))));\n \t\tif (isLeftPosition){\n \t\t queue.get(index).left = new TreeNode(Integer.parseInt(stringArray[i]));\n \t\t}\n \t\telse {\n \t\t queue.get(index).right = new TreeNode(Integer.parseInt(stringArray[i]));\n \t\t}\n \t\tqueue.add(new TreeNode(Integer.parseInt(stringArray[i])));\n \t}\n \tif(!isLeftPosition) index++;\n \tisLeftPosition = !isLeftPosition;\n }\n return root;\n }", "public TreeNode deserialize(String data) {\n if(data.charAt(start)=='#'){\n start++;\n return null;\n }\n int end=start;\n while(end==data.length() || data.charAt(end)!='|'){\n end++;\n }\n String num=data.substring(start,end);\n TreeNode node=new TreeNode(Integer.valueOf(num));\n start=end;\n start++; node.left=deserialize(data);\n start++;node.right=deserialize(data);\n return node;\n }", "public String decode(String encoded) {\n\t\t// TODO fill this in.\n\t\tchar[] encodedArray = encoded.toCharArray();\n\n\t\tString decoded = \"\";\n\n\t\tLeaf current = root;\n\n\t\tfor(char c : encodedArray) {\n\n\t\t\tif (c == '0' && current.left != null) {\n\t\t\t\tcurrent = current.left;\n\t\t\t}\n\t\t\telse if(c == '1' && current.right != null){\n\t\t\t\tcurrent = current.right;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tchar letter = current.character;\n\t\t\t\tdecoded = decoded + letter;\n\t\t\t\tcurrent = root;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(textArray);\n\t\tSystem.out.println(decoded);\n\n\t\treturn decoded;\n\t}", "public TreeNode deserialize(String data) {\n LinkedList<String> linkedList = new LinkedList<>(Arrays.asList(data.split(\",\")));\n return buildTree(linkedList);\n }", "public TreeNode deserialize(String data) {\n if (data == null) return null;\n LinkedList<String> queue = new LinkedList<>(Arrays.asList(data.split(\",\")));\n return deserialize(queue);\n }", "public TreeNode deserialize(String data) {\n if (data.length() == 0) return null;\n String[] vals = data.split(\"\\\\,\");\n Queue<TreeNode> queue = new LinkedList<>();\n TreeNode root = new TreeNode(Integer.valueOf(vals[0]));\n queue.offer(root);\n for (int i = 1; i < vals.length; ++i) {\n TreeNode cur = queue.poll();\n if (!vals[i].equals(\"#\")) {\n cur.left = new TreeNode(Integer.valueOf(vals[i]));\n queue.offer(cur.left);\n } \n if (!vals[++i].equals(\"#\")) {\n cur.right = new TreeNode(Integer.valueOf(vals[i]));\n queue.offer(cur.right);\n }\n }\n return root;\n }", "public TreeNode deserialize(String data) {\n String[] token = data.split(\",\");\n int index = 0;\n Queue<TreeNode> q = new LinkedList<>();\n TreeNode root = convertTreeNode(token[index++]);\n q.add(root);\n \n while(!q.isEmpty()) {\n TreeNode node = q.poll();\n if (node == null) {\n continue;\n }\n node.left = convertTreeNode(token[index++]);\n node.right = convertTreeNode(token[index++]);\n q.offer(node.left);\n q.offer(node.right);\n }\n \n return root;\n }", "public TreeNode deserialize(String data) {\n if (data==null || data.length()==0){\n return null;\n }\n Node n = deSerRec(data.split(\",\"),0);;\n return n.node;\n }", "public TreeNode deserialize(String data) {\n \n \tif(!data.contains(\"(\") && !data.contains(\")\")) {\n \t\tif(data.length() == 0) {\n \t\t\treturn null;\n \t\t}else {\n \t\t\treturn new TreeNode(Integer.valueOf(data));\n \t\t}\n \t}\n \tint count = 0;\n \tint index = 0;\n \tint start = 0;\n \twhile(index < data.length()) {\n \t\tif(data.charAt(index) == '(') {\n \t\t\tcount ++;\n \t\t}\n \t\tif(data.charAt(index) == ')') {\n \t\t\tcount --;\n \t\t}\n \t\tif(count == 0) {\n \t\t\tstart = index;\n \t\t\tbreak;\n \t\t}\n \t\tindex ++;\n \t}\n \tstart ++;\n \tint temp = start + 1;\n \twhile(temp < data.length()) {\n \t\tif(data.charAt(temp) == ')') {\n \t\t\tbreak;\n \t\t}\n \t\ttemp ++;\n \t}\n \tTreeNode root = new TreeNode(Integer.valueOf(data.substring(start + 1, temp)));\n \troot.left = deserialize(data.substring(1, start - 1));\n \troot.right = deserialize(data.substring(temp + 2, data.length() - 1));\n \treturn root;\n \t\n }", "public TreeNode deserialize(String data) {\r\n\r\n\t\tQueue<TreeNode> q = new LinkedList<>();\r\n\t\tint[] start = new int[1];\r\n\t\tint qSize = 0;\r\n\t\tTreeNode head = read(data, start);\r\n\t\tif (head == null)\r\n\t\t\treturn head;\r\n\t\tq.offer(head);\r\n\r\n\t\twhile (!q.isEmpty()) {\r\n\t\t\tqSize = q.size();\r\n\r\n\t\t\tfor (int i = 0; i < qSize; i++) {\r\n\t\t\t\tTreeNode n = q.poll();\r\n\t\t\t\tif (start[0] >= data.length()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tn.left = read(data, start);\r\n\r\n\t\t\t\tn.right = read(data, start);\r\n\t\t\t\tif (n.left != null) {\r\n\t\t\t\t\tq.offer(n.left);\r\n\t\t\t\t}\r\n\t\t\t\tif (n.right != null) {\r\n\t\t\t\t\tq.offer(n.right);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn head;\r\n\t}", "public TreeNode deserialize(String data) {\n if (\"\".equals(data)) return null;\n String dataArray[] = data.split(NODE_SEPERATOR);\n TreeNode root = new TreeNode(Integer.valueOf(dataArray[0]));\n Queue<TreeNode> q = new LinkedList<>();\n q.offer(root);\n int dataIndex = 1;\n while (!q.isEmpty()) {\n TreeNode parent = q.poll();\n if (!dataArray[dataIndex].equals(EMPTY_NODE_INDICATOR)) {\n TreeNode left = new TreeNode(Integer.valueOf(dataArray[dataIndex]));\n parent.left = left;\n q.offer(left);\n }\n dataIndex++;\n if (!dataArray[dataIndex].equals(EMPTY_NODE_INDICATOR)) {\n TreeNode right = new TreeNode(Integer.valueOf(dataArray[dataIndex]));\n parent.right = right;\n q.offer(right);\n }\n dataIndex++;\n }\n return root;\n }", "public TreeNode deserialize(String data) {\n String[] dchar = data.split(\",\");\n return deserialize(dchar, new Index(0));\n }", "public TreeNode deserialize(String data) {\r\n String[] ar = data.split(\":\");\r\n\r\n LinkedList<String> list = new LinkedList<>(Arrays.asList(ar));\r\n\r\n return doDeSerialize(list);\r\n }", "public static TreeNode deserialize(String data) {\n String[] split = data.split(\"-\");\n if (split[0].length() == 2 && split[1].length() == 2) {\n return null;\n }\n split[0] = split[0].replace('[', ' ').replace(']', ' ').trim();\n split[1] = split[1].replace('[', ' ').replace(']', ' ').trim();\n String[] split1 = split[0].split(\",\");\n String[] split2 = split[1].split(\",\");\n int[] pre = new int[split1.length];\n int[] inor = new int[split2.length];\n for (int i = 0; i < pre.length; i++) {\n pre[i] = Integer.parseInt(split1[i].trim());\n }\n for (int i = 0; i < inor.length; i++) {\n inor[i] = Integer.parseInt(split2[i].trim());\n }\n return buildTree(pre, inor);\n }", "public TreeNode deserialize(String data) {\n if (data == \"\") return null; \n \n String[] strs = data.split(\" \");\n Queue<TreeNode> q = new LinkedList<>();\n TreeNode root = new TreeNode(Integer.parseInt(strs[0]));\n q.offer(root);\n \n for (int i = 1; i < strs.length; i++) {\n TreeNode cur = q.poll(); // cannot use root, since we need return root at the end\n if (!strs[i].equals(\"null\")) { // use equals, not ==\n cur.left = new TreeNode(Integer.parseInt(strs[i]));\n q.offer(cur.left);\n }\n \n if (!strs[++i].equals(\"null\")) { // use equals, not ==\n cur.right = new TreeNode(Integer.parseInt(strs[i]));\n q.offer(cur.right);\n }\n }\n \n return root;\n }", "public TreeNode deserialize(String tree) {\r\n\r\n // **** sanity check ****\r\n if (tree.isEmpty())\r\n return null;\r\n\r\n // **** populate the queue with the serialized data ****\r\n Queue<String> q = new LinkedList<>(Arrays.asList(tree.split(\" \")));\r\n\r\n // **** deserialize the BST ****\r\n return deserialize(q, Integer.MIN_VALUE, Integer.MAX_VALUE);\r\n }", "public TreeNode deserialize(String data) {\n start = 0;\n TreeNode root = build(data.split(\",\",-1));\n return root;\n }", "public TreeNode deserialize(String data) {\n// String[] nodes = data.split(\",\");\n Deque<String> nodes = new LinkedList<>(Arrays.asList(data.split(\",\")));\n return build(nodes);\n }", "public TreeNode deserialize(String data) {\r\n if (\"n\".equals(data)) {\r\n return null;\r\n }\r\n\r\n final String[] nodes = data.split(\", \");\r\n int i = 0;\r\n final TreeNode root = new TreeNode(Integer.parseInt(nodes[i]));\r\n final Queue<TreeNode> queue = new ArrayDeque<>();\r\n queue.add(root);\r\n i++;\r\n while (!queue.isEmpty()) {\r\n final TreeNode node = queue.poll();\r\n\r\n if (!\"n\".equals(nodes[i])) {\r\n node.left = new TreeNode(Integer.parseInt(nodes[i]));\r\n queue.add(node.left);\r\n } else {\r\n node.left = null;\r\n }\r\n i++;\r\n\r\n\r\n if (!\"n\".equals(nodes[i])) {\r\n node.right = new TreeNode(Integer.parseInt(nodes[i]));\r\n queue.add(node.right);\r\n } else {\r\n node.right = null;\r\n }\r\n i++;\r\n }\r\n\r\n return root;\r\n }", "public CodeTree toCodeTree() {\n List<Node> nodes = new ArrayList<Node>();\n for (int i = max(codeLengths); i >= 0; i--) { // Descend through code lengths\n List<Node> newNodes = new ArrayList<Node>();\n\n // Add leaves for symbols with positive code length i\n if (i > 0) {\n for (int j = 0; j < codeLengths.length; j++) {\n if (codeLengths[j] == i)\n newNodes.add(new Leaf(j)); //Isidedame ASCII reiksmes ilgiausio kodo\n }\n }\n\n // Merge pairs of nodes from the previous deeper layer\n for (int j = 0; j < nodes.size(); j += 2) {\n newNodes.add(new InternalNode(nodes.get(j), nodes.get(j + 1))); //Sujungia lapus i InternalNodes\n }\n nodes = newNodes;\n }\n return new CodeTree((InternalNode)nodes.get(0), codeLengths.length);\n }", "public TreeNode deserialize(String data) {\n String[] vals = data.split(\"\\\\,\");\n Queue<String> queue = new LinkedList<>();\n queue.addAll(Arrays.asList(vals));\n return deserialize(queue);\n }", "public TreeNode deserialize(String data) {\n if (data == \"\") {\n return null;\n }\n String[] dataSplit = data.split(\",\");\n Queue<String> nodes = new ArrayDeque<String>(Arrays.asList(dataSplit));\n Queue<TreeNode> queue = new LinkedList<>();\n TreeNode root = new TreeNode(Integer.parseInt(nodes.poll()));\n queue.offer(root);\n while (!queue.isEmpty()) {\n TreeNode curNode = queue.poll();\n String left = nodes.poll(), right = nodes.poll();\n if (!left.equals(\"X\")) {\n curNode.left = new TreeNode(Integer.parseInt(left));\n queue.offer(curNode.left);\n }\n if (!right.equals(\"X\")) {\n curNode.right = new TreeNode(Integer.parseInt(right));\n queue.offer(curNode.right);\n }\n }\n return root;\n }", "public Node deserialize(String data) {\n String subData = data.substring(1, data.length() - 1);\n if (subData.indexOf(\"(\") == -1) {\n return new Node(Integer.parseInt(subData));\n }\n System.out.println(\"the data \" + subData);\n String val = subData.substring(0, subData.indexOf(\"(\"));\n\n List<String> childData = new ArrayList<>();\n subData = subData.substring(subData.indexOf(\"(\"));\n int cnt = 0;\n int lstIndex = 0;\n for (int i = subData.indexOf('('); i < subData.length(); i++) {\n if (subData.charAt(i) == '(') {\n cnt += 1;\n } else if (subData.charAt(i) == ')') {\n cnt -= 1;\n }\n\n if (cnt == 0) {\n childData.add(subData.substring(lstIndex, i + 1));\n lstIndex = i + 1;\n }\n }\n System.out.println(childData);\n\n Node root = new Node();\n root.val = Integer.parseInt(val);\n for (int i = 0; i < childData.size(); i++) {\n root.children.add(deserialize(childData.get(i)));\n }\n return root;\n }", "@Test\r\n public void testDeserialize() {\r\n System.out.println(\"deserialize\");\r\n String data = \"1,#,2\";\r\n BinaryTreeSerialization instance = new BinaryTreeSerialization();\r\n TreeNode expResult = null;\r\n TreeNode result = instance.deserialize(data);\r\n String s = instance.serialize(result);\r\n result = instance.deserialize(s);\r\n assertEquals(expResult, result);\r\n }", "public TreeNode deserialize(String data) {\n //LinkedList doesnot have the constructor form array\n LinkedList<String> l = new LinkedList<>();\n //LinkedList.addAll doesnot support array, need to use Arrays.asList\n //String.split(String regex, int limit) when limit<0, return the most part of splits as possibile, delete the empty items\n l.addAll(Arrays.asList(data.split(\",\",-1)));\n TreeNode root = build(l);\n return root;\n }", "public TreeNode deserialize(String data) {\n String[] strings = data.split(\",\");\n LinkedList<String> stack = new LinkedList<>();\n for (String s : strings) {\n stack.add(s);\n }\n return deserialize(stack);\n }", "public TreeNode deserialize1(String tree) {\r\n \r\n // **** sanity checks ****\r\n if (tree.isEmpty())\r\n return null;\r\n\r\n // **** split the tree string ****\r\n String[] strs = tree.split(\" \");\r\n\r\n // **** deserialise BST ****\r\n return deserialize1(strs, 0, strs.length - 1);\r\n }", "public TreeNode deserialize(String data) {\n if(data.charAt(0)=='n') return null;\n String[] array = data.split(\",\");\n TreeNode[] nodes = new TreeNode[array.length];\n for(int i = 0; i < nodes.length; i++){\n if(array[i].equals(\"null\")) nodes[i] = null;\n else nodes[i] = new TreeNode(Integer.valueOf(array[i]));\n }\n int index = 0;\n Deque<TreeNode> deque = new LinkedList<>();\n deque.addLast(nodes[index++]);\n //level-first recover\n while(!deque.isEmpty() && index<nodes.length){\n TreeNode current = deque.pollFirst();\n if(current==null) continue;\n current.left = nodes[index++];\n current.right = nodes[index++];\n deque.addLast(current.left);\n deque.addLast(current.right);\n }\n \n return nodes[0];\n }", "public void getDecodedMessage(String encoding){\n\n String output = \"\";\n Node temp = this.root;\n for(int i = 0;i<encoding.length();i++){\n\n if(encoding.charAt(i) == '0'){\n temp = temp.left;\n\n if(temp.left == null && temp.right == null){\n System.out.print(temp.getData());\n temp = this.root;\n }\n }\n else\n {\n temp = temp.right;\n if(temp.left == null && temp.right == null){\n System.out.print(temp.getData());\n temp = this.root; \n }\n\n }\n }\n }", "public TreeNode deserialize(String data) {\n ArrayList<Integer> res = new ArrayList<Integer>();\n data=data.substring(1,data.length()-1);\n System.out.println(data);\n if(data.length()==0) return null;\n String[] datas=data.split(\",\");\n if (datas.length%2==0) {\n data=data.concat(\",null\");\n System.out.println(data);\n datas=data.split(\",\");\n }\n TreeNode[] nodes=new TreeNode[datas.length];\n nodes[0]=new TreeNode(Integer.parseInt(datas[0]));\n int p=0;\n for (int i=1;i<datas.length;i+=2){\n System.out.println(datas[i]);\n System.out.println(datas[i+1]);\n nodes[i]=datas[i].equals(\"null\")?null:new TreeNode(Integer.parseInt(datas[i]));\n nodes[i+1]=datas[i+1].equals(\"null\")?null:new TreeNode(Integer.parseInt(datas[i+1]));\n nodes[p].left=nodes[i];\n nodes[p].right=nodes[i+1];\n p++;\n while(nodes[p]==null) p++;\n }\n return nodes[0];\n // res=new ArrayList<Integer>(Arrays.asList(data.split(\",\")));\n }", "public TreeNode deserialize(String data) {\n if (data == null || data.isEmpty()) {\n return null;\n }\n String[] nodesStr = data.split(\",\");\n TreeNode[] nodes = new TreeNode[nodesStr.length];\n for (int i = 0; i < nodes.length; i++) {\n nodes[i] = \"null\".equals(nodesStr[i]) ? null : new TreeNode(Integer.parseInt(nodesStr[i]));\n }\n int index = 1;\n for (int i = 0; i < nodes.length; i++) {\n if (nodes[i] != null) {\n nodes[i].left = nodes[index++];\n nodes[i].right = nodes[index++];\n }\n }\n return nodes[0];\n }", "public TreeNode deserialize(String data) {\n String[] arr = data.split(\",\");\n Queue<String> queue = new LinkedList<>(Arrays.asList(arr));\n return deserialize(queue);\n }", "void decodeObject();", "public TreeNode deserialize(String data) {\n if (data == null || data.equals(\"[]\") || data.length() <= 2) {\n return null;\n }\n\n String[] strArray = data.substring(1, data.length() - 1).split(\",\");\n Queue<String> list = new LinkedList<>();\n list.addAll(Arrays.asList(strArray));\n\n Queue<TreeNode> queue = new LinkedList<>();\n TreeNode root = new TreeNode(Integer.valueOf(list.poll()));\n queue.offer(root);\n\n while (!queue.isEmpty()) {\n TreeNode node = queue.poll();\n\n String leftVal = list.poll();\n if (leftVal == null || leftVal.equals(\"null\")) {\n node.left = null;\n } else {\n TreeNode leftNode = new TreeNode(Integer.valueOf(leftVal));\n node.left = leftNode;\n queue.offer(leftNode);\n }\n\n String rightVal = list.poll();\n if (rightVal == null || rightVal.equals(\"null\")) {\n node.right = null;\n } else {\n TreeNode rightNode = new TreeNode(Integer.valueOf(rightVal));\n node.right = rightNode;\n queue.offer(rightNode);\n }\n }\n\n return root;\n }", "public TreeNode deserialize(String data) {\n if (data == null || data.length() == 0) return null;\n Queue<TreeNode> queue = new LinkedList<>();\n String[] nodes = data.split(\",\");\n TreeNode root = new TreeNode(Integer.parseInt(nodes[0]));\n queue.offer(root);\n for (int i = 1; i < nodes.length; i += 2) {\n TreeNode cur = queue.poll();\n if (!nodes[i].equals(\"null\")) {\n TreeNode left = new TreeNode(Integer.parseInt(nodes[i]));\n cur.left = left;\n queue.offer(left);\n }\n if (!nodes[i+1].equals(\"null\")) {\n TreeNode right = new TreeNode(Integer.parseInt(nodes[i+1]));\n cur.right = right;\n queue.offer(right);\n }\n }\n return root;\n }", "public TreeNode deserialize(String data) {\n //1,2,3,null,null,4,5\n // 0 1 2 3 4 5 6 7\n // 1, 2, null, 3, null, 4, null, 5\n\n if (data == null || data.length() ==0)\n return null;\n\n StringTokenizer st = new StringTokenizer(data, \",\");\n String[] nodes = new String[st.countTokens()];\n int index =0;\n while (st.hasMoreTokens()) {\n nodes[index++] = st.nextToken();\n }\n\n TreeNode root = new TreeNode(Integer.parseInt(nodes[0]));\n Queue<TreeNode> nodeQueue = new LinkedBlockingQueue<TreeNode>();\n Queue<Integer> indexQueue = new LinkedBlockingQueue<Integer>();\n int currentIndex = 0;\n\n indexQueue.offer(currentIndex);\n nodeQueue.offer(root);\n\n while (!nodeQueue.isEmpty()) {\n\n TreeNode node = nodeQueue.poll();\n int nodeIndex = indexQueue.poll();\n int leftChild = 2 * nodeIndex + 1;\n int rightChild = 2 * nodeIndex + 2;\n TreeNode leftNode = generateNode(leftChild, nodes);\n if (leftNode != null) {\n node.left = leftNode;\n nodeQueue.offer(leftNode);\n indexQueue.offer(++currentIndex);\n }\n\n TreeNode rightNode = generateNode(rightChild, nodes);\n if (rightNode != null) {\n node.right = rightNode;\n nodeQueue.offer(rightNode);\n indexQueue.offer(++currentIndex);\n }\n }\n\n return root;\n\n }", "public TreeNode deserialize(String data) {\n if (data.length() == 0) {\n return null;\n }\n String[] input = data.split(\",\");\n\n int childIndex = 1;\n Queue<TreeNode> queue = new LinkedList<>();\n TreeNode root = new TreeNode(Integer.valueOf(input[0]));\n queue.add(root);\n while (queue.size() > 0) {\n TreeNode node = queue.remove();\n if (!input[childIndex].equals(\"#\")) {\n node.left = new TreeNode(Integer.valueOf(input[childIndex]));\n queue.add(node.left);\n }\n if (!input[childIndex + 1].equals(\"#\")) {\n node.right = new TreeNode(Integer.valueOf(input[childIndex + 1]));\n queue.add(node.right);\n }\n childIndex += 2;\n }\n return root;\n }", "public TreeNode deserialize(String data){\n String[] arr = data.split(\",\");\n List<String> list = new ArrayList<String>(Arrays.asList(arr));\n return desHelper(list);\n }", "public TreeNode deserialize(String data) {\n String[] nums = data.split(\",\");\n List<String> dataNums = new ArrayList<>(Arrays.asList(nums));\n return deserializeCore(dataNums);\n }", "public TreeNode deserialize(String data) {\n\t\tString[] nodes = data.split(\",\");\n\t\tQueue<String> queue = new LinkedList<>();\n\t\tqueue.addAll(Arrays.asList(nodes));\n\t\treturn treeDeserialize(queue);\n\t}", "public TreeNode deserialize(String data) {\n if (data == null || data.isEmpty()) {\n return null;\n }\n\n String[] values = data.split(\",\");\n List<Integer> preorder = Arrays.stream(values)\n .map(Integer::parseInt)\n .collect(Collectors.toList());\n\n return preOrderDeserialize(preorder);\n }", "public TreeNode deserialize(String data) {\n if (data.isEmpty()) return null;\n\n LinkedList<Integer> list = new LinkedList();\n for (String s: data.split(\",\"))\n list.add(Integer.parseInt(s));\n return doDeserialize(list, Integer.MIN_VALUE, Integer.MAX_VALUE);\n }", "public TreeNode deserialize(String data) {\n if (data.length()==0 || data.equals(\"#\")) return null;\n String[] n = data.split(\",\");\n idx = 0;\n return helper(n);\n }", "public TreeNode deserialize(String data) {\n \tif(data == null || data.length() == 0)\n return null;\n String[] splits = data.split(\",\");\n if(splits.length == 0)\n return null;\n Queue<TreeNode> curList = new LinkedList<TreeNode>();\n int index = 0;\n if(isNull(splits[index]))\n return null;\n TreeNode head = new TreeNode(Integer.parseInt(splits[index++])); \n curList.add(head);\n Queue<TreeNode> nextList = new LinkedList<TreeNode>();\n while(curList.size() != 0){\n while(curList.size() != 0){\n TreeNode curNode = curList.poll();\n if(isNull(splits[index])){\n curNode.left = null;\n index++;\n }\n else{\n TreeNode left = new TreeNode(Integer.parseInt(splits[index++]));\n curNode.left = left;\n nextList.add(left);\n }\n if(isNull(splits[index])){\n curNode.right = null;\n index++;\n }\n else{\n TreeNode right = new TreeNode(Integer.parseInt(splits[index++]));\n curNode.right = right;\n nextList.add(right);\n }\n }\n curList = nextList;\n }\n return head;\n }", "public TreeNode deserialize(String data) {\n String[] arr = data.split(\",\");\n int[] index = new int[1];\n return helper(arr, index);\n }", "public Node deserialize(String data) {\n return deserialize_helper(data, new int[]{1}, new StringBuilder());\n }", "Object decode(String encoded);", "public void decode() throws Exception {\n decodeFat();\n decodeDat();\n }", "public void encodeTree(){\n StringBuilder builder = new StringBuilder();\n encodeTreeHelper(root,builder);\n }", "public static TreeNode deserialize(String data) {\n String[] dataArray = data.split(\",\");\n Queue<String> dataQueue = new LinkedList<>(Arrays.asList(dataArray));\n return deserializeHelper(dataQueue);\n }", "private void buildTree() {\n\t\tfinal TreeSet<Tree> treeSet = new TreeSet<Tree>();\n\t\tfor (char i = 0; i < 256; i++) {\n\t\t\tif (characterCount[i] > 0) {\n\t\t\t\ttreeSet.add(new Tree(i, characterCount[i]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge the trees to one Tree\n\t\tTree left;\n\t\tTree right;\n\t\twhile (treeSet.size() > 1) {\n\t\t\tleft = treeSet.pollFirst();\n\t\t\tright = treeSet.pollFirst();\n\t\t\ttreeSet.add(new Tree(left, right));\n\t\t}\n\n\t\t// There is only our final tree left\n\t\thuffmanTree = treeSet.pollFirst();\n\t}", "private static TreeNode deserializeHelper(Queue<String> dataQueue){\n \t// use equals to compare Strings\n if (dataQueue.peek().equals(\"null\")){\n dataQueue.poll();\n return null;\n }\n int val = Integer.parseInt(dataQueue.poll());\n TreeNode res = new TreeNode(val);\n res.left = deserializeHelper(dataQueue);\n res.right = deserializeHelper(dataQueue);\n return res;\n }", "public Node readTree() {\n boolean totuusarvo = b.readBoolean();\n if (totuusarvo == true) {\n return new Node(b.readShort(), -1, null, null);\n } else {\n return new Node(\"9000\", -1, readTree(), readTree());\n }\n }", "public Node deserialize(String data) {\n if (data.length()==0){\n return null;\n }\n int i=0;\n int temp=0;\n while (i<data.length()&&Character.isDigit(data.charAt(i))){\n temp=temp*10+data.charAt(i)-'0';\n i++;\n }\n data=data.substring(i);\n Node root=new Node(temp);\n Queue<Node> q=new LinkedList<>();\n q.offer(root);\n while (!q.isEmpty()){\n Node n=q.poll();\n int index=data.indexOf(')');\n String childrenString=data.substring(1,index);\n n.children=new ArrayList<>();//就算没有children也要建,不然lc不行\n if (childrenString!=null&&childrenString.length()!=0){\n String[] array=childrenString.split(\",\");\n if (array.length>0){\n for (String v:array){\n Node child=new Node(Integer.valueOf(v));\n n.children.add(child);\n q.offer(child);\n }\n }\n }\n data=data.substring(index+1);\n }\n return root;\n }", "private void encodeTree(BitOutputStore output, SymbolNode root) {\n output.appendBits(8, nLeafNodes - 1);\n SymbolNode[] path = new SymbolNode[256];\n int[] pathBranch = new int[256];\n path[0] = root;\n pathBranch[0] = 0;\n int depth = 1;\n while (depth > 0) {\n int index = depth - 1;\n SymbolNode pNode = path[index];\n int pBranch = pathBranch[index];\n // pBranch is set as follows:\n // 0 we've just arrived at the node and have not yet\n // identified whether it is a branch or a leaf.\n // we have not yet traversed any of its children\n //\n // 1 we traversed down the left branch and need to traverse\n // down the right\n //\n // 2 we have traversed both branches and are on our way up\n\n switch (pBranch) {\n case 0:\n // we've just pushed the node on the stack and have not yet\n // identified whether it is a leaf or a branch.\n if (pNode.isLeaf) {\n output.appendBit(1); // terminal\n output.appendBits(8, pNode.symbol);\n BitOutputStore bitpath = encodePath(depth, path);\n pNode.nBitsInCode = bitpath.getEncodedTextLength();\n pNode.code = bitpath.getEncodedText();\n // pop the stack\n depth--;\n index--;\n // pro-forma, clear the stack variables\n pathBranch[depth] = 0;\n path[depth] = null;\n\n } else {\n output.appendBit(0); // non-terminal\n pathBranch[index] = 1;\n pathBranch[depth] = 0;\n path[depth] = pNode.left;\n depth++;\n }\n break;\n case 1:\n pathBranch[index] = 2;\n pathBranch[depth] = 0;\n path[depth] = pNode.right;\n depth++;\n break;\n case 2:\n // we're on our way up\n pathBranch[index] = 0;\n path[index] = null;\n depth--;\n break;\n default:\n // error condition, won't happen\n throw new IllegalStateException(\"Internal error encoding tree\");\n }\n }\n }", "public String decode(String encoded) {\n\t\t// TODO fill this in.\n\t\tStringBuilder decodedText = new StringBuilder();\n\t\tNode currentBit = huffmanTree;\n\t\tint index = 0;\n\t\t//System.out.println(currentBit.getLeft());\n\t\t//System.out.println(currentBit.getRight());\n\t\twhile (index < encoded.length()) {\n\t\t\tif (encoded.charAt(index) == '0') {\n\t\t\t\tif (currentBit.getLeft() != null) {\n\t\t\t\t\tcurrentBit = currentBit.getLeft();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdecodedText.append(currentBit.getCharacter());\n\t\t\t\t\tcurrentBit = huffmanTree;\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentBit.getRight() != null) {\n\t\t\t\t\tcurrentBit = currentBit.getRight();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdecodedText.append(currentBit.getCharacter());\n\t\t\t\t\tcurrentBit = huffmanTree;\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex++;\n if (index == encoded.length()) {\n decodedText.append(currentBit.getCharacter());\n }\n\t\t}\n System.out.println(\"EncondedText: \" + encoded);\n\t\tSystem.out.print(\"decodedText: \" + decodedText.toString());\n\t\treturn decodedText.toString();\n\n\t}", "public MorseCodeTree()\r\n\t{\r\n\t\tbuildTree();\r\n\t}", "void decodeObjectArray();", "void decode (DataInputStream dis, Node [] table, Decoder decoder) {\n m_size = Decoder.readUnsignedByte (dis);\n if (m_size == 255) {\n m_size = Decoder.readUnsignedByte (dis) * 255 + Decoder.readUnsignedByte (dis) ;\n }\n //System.out.println (m_size);\n if (m_size > 0) {\n m_node = new Node [m_size];\n for (int i = 0; i < m_size; i++) {\n m_node[i] = Node.decode (dis, table, decoder);\n }\n }\n //System.out.println (\"decoding MFNode done\");\n }", "public void decode()\n {\n if (null == escherRecords || 0 == escherRecords.size()){\n byte[] rawData = getRawData();\n convertToEscherRecords(0, rawData.length, rawData );\n }\n }", "private String decoder(String code, Tree iterator) {\n for (int i = 0; i < code.length(); i++) {\n String decodedChar = iterator.decode(code.substring(0, i + 1));\n\n if (decodedChar != null) {\n decode = decode + decodedChar;\n code = code.substring(i + 1);\n i = -1;\n }\n }\n\n return code;\n }", "public static void main(String[] args) {\n TreeNode root = new TreeNode(50);\n root.left = new TreeNode(30);\n root.right = new TreeNode(70);\n root.left.left = new TreeNode(20);\n root.left.right = new TreeNode(40);\n root.right.left = new TreeNode(60);\n root.right.right = new TreeNode(80);\n StringBuilder result = serialiseBT(root, new StringBuilder());\n System.out.println(result.toString());\n String[] strings = result.toString().split(\",\");\n TreeNode head = deserialize(strings, new int[]{0});\n System.out.println(serialiseBT(head, new StringBuilder()));\n }", "public static java.lang.Object decodeObject(com.webobjects.foundation.NSCoder coder){\n return null; //TODO codavaj!!\n }", "@Override\n public String decode(String code) throws IllegalStateException {\n if (code == null || code.equals(\"\")) {\n throw new IllegalStateException(\"the code cannot be null or empty.\");\n }\n Tree iterator = root;\n decode = \"\";\n\n for (int i = 0; i < code.length(); i++) {\n if (!encodingArray.contains(code.charAt(i))) {\n throw new IllegalStateException(\"The encoded string contains illegal symbol\");\n }\n }\n\n code = decoder(code, iterator);\n\n if (code.length() != 0) {\n throw new IllegalStateException(\"there is some problem with decoding.\");\n }\n\n return decode;\n }", "public void decode(String data) throws JSONException {\n\t\tthis.dtoObj=getObj(data, JrGxpgbillDTO.class);\n\t}", "void loadNodeData(byte[] data) throws Exception;", "public TreeNode encode(Node root) {\n return en(root);\n }", "public TreeNode encode(Node root) {\n if (root == null) {\n return null;\n }\n TreeNode head = new TreeNode(root.val);\n head.left = en(root.children);\n return head;\n }", "@Override\n public String decode(File fileName) throws IOException\n {\n HuffmanEncodedResult result = readFromFile(fileName);\n StringBuilder stringBuilder = new StringBuilder();\n\n BitSet bitSet = result.getEncodedData();\n\n for (int i = 0; bitSet.length() - 1 > i; )\n {\n Node currentNode = result.getRoot();\n while (!currentNode.isLeaf())\n {\n if (bitSet.get(i))\n {\n currentNode = currentNode.getLeftChild();\n }\n else\n {\n currentNode = currentNode.getRightChild();\n }\n i++;\n }\n stringBuilder.append(currentNode.getCharacter());\n }\n return stringBuilder.toString();\n }", "public TreeNode encode(Node root) {\n\t\t\tif (root == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tTreeNode head = new TreeNode(root.val);\n\t\t\thead.left = en(root.children);\n\t\t\treturn head;\n\t\t}", "public void reset(final byte[] treeData) {\n \t\traw = treeData;\n \t\trawPtr = 0;\n \t}", "public void decode(byte[] data)\n\t{\n\t\ttry\n\t\t{\n\n\t\t\tByteArrayInputStream bstream = new ByteArrayInputStream(data);\n\t\t\tDataInputStream istream = new DataInputStream(bstream);\n\t\t\tlevel = istream.readInt();\n\t\t\thp = istream.readInt();\n\t\t\tattack = istream.readInt();\n\t\t\tdefend = istream.readInt();\n\t\t\tmoney = istream.readInt();\n\t\t\texperience = istream.readInt();\n\t\t\tyellowKey = istream.readInt();\n\t\t\tblueKey = istream.readInt();\n\t\t\tredKey = istream.readInt();\n\t\t\tint can = istream.readInt();\n\t\t\t// canlookup\n\t\t\tif (can == 0)\n\t\t\t{\n\t\t\t\tcanLookup = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcanLookup = true;\n\t\t\t}\n\t\t\tcan = istream.readInt();\n\t\t\t// canjump\n\t\t\tif (can == 0)\n\t\t\t{\n\t\t\t\tcanJump = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcanJump = true;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"decode error::\" + e);\n\t\t}\n\t}", "public Object decode(Object value) {\n\t\treturn decode(value, null, this.filter);\n\t}", "private byte[] decode(Node root) {\n BitSet dataInBits = BitSet.valueOf(Arrays.copyOfRange(buffer.array(), bufferPosition, buffer.capacity()));\n int bitIndex = 0;\n\n ByteBuffer result = ByteBuffer.allocate(inputFileSize);\n\n for (int i = 0; i < inputFileSize; i++) {\n Node node = root;\n while (!node.hasValue() && i < inputFileSize) {\n boolean bit = dataInBits.get(bitIndex);\n bitIndex += 1;\n if (bit) node = node.getRightChild();\n else node = node.getLeftChild();\n }\n if (node.hasValue()) {\n result.put(node.getValue());\n }\n }\n\n // preparing byte buffer for converting to byte array\n int pos = result.position();\n result.flip();\n byte[] resultArray = new byte[pos];\n result.get(resultArray);\n return resultArray;\n }" ]
[ "0.6894664", "0.6808548", "0.650279", "0.64891165", "0.64851105", "0.6415433", "0.6362339", "0.63083476", "0.6284537", "0.622987", "0.6213446", "0.6161982", "0.6147146", "0.6140804", "0.6133282", "0.6078927", "0.6073399", "0.6069482", "0.6064389", "0.60632867", "0.6053727", "0.60433733", "0.60367304", "0.6033932", "0.59991515", "0.59938365", "0.5980659", "0.596683", "0.5959962", "0.59403956", "0.5926964", "0.59259915", "0.5904777", "0.5904113", "0.58938473", "0.58901024", "0.5863078", "0.585575", "0.58412635", "0.5839326", "0.5826294", "0.5817251", "0.58140945", "0.58085304", "0.5806847", "0.5799143", "0.5789812", "0.57792795", "0.57764786", "0.57683444", "0.57327855", "0.5725321", "0.5709299", "0.5705495", "0.56862473", "0.56824213", "0.5681499", "0.5657532", "0.5635658", "0.5633201", "0.5621862", "0.5619518", "0.5614503", "0.55898565", "0.5585282", "0.55714303", "0.5560025", "0.5553068", "0.55436295", "0.5540626", "0.5527881", "0.5520708", "0.5510794", "0.5509914", "0.54495806", "0.54390955", "0.53605646", "0.5349602", "0.5349041", "0.5328883", "0.5313851", "0.52906096", "0.52453035", "0.5230596", "0.5184324", "0.5172378", "0.5150647", "0.5116578", "0.5107965", "0.5099443", "0.5095703", "0.5091816", "0.5067655", "0.5054793", "0.5025217", "0.49959937", "0.49791348", "0.49754342", "0.49738646", "0.49662596" ]
0.56222343
60
Constructs a controller to coordinate the game and screen
public Controller(int n) { // Enhanced Mode if (n > 0) { enhanced = true; // keeps track of the number of times that the user has been given a new life // for reaching // a scoring threshold numLiveUpdated = 0; // Initializes/opens the sound files for enhanced mode } initializeSounds(); // Initialize member variables for the new Controller object highScore = 0; flame = false; turnLeft = 0; turnRight = 0; accelerate = 0; shoot = 0; speed = 3; // Record the game and screen objects display = new Display(this); display.setVisible(true); // Initialize the ParticipantState pstate = new ParticipantState(); // Set up the refresh timer. refreshTimer = new Timer(FRAME_INTERVAL, this); // Clear the transitionTime transitionTime = Long.MAX_VALUE; // Bring up the splash screen and start the refresh timer splashScreen(); refreshTimer.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MainController() {\n initializeControllers();\n initializeGui();\n runGameLoop();\n }", "public GameController() {\r\n\t\tsuper();\r\n\t\tthis.model = Main.getModel();\r\n\t\tthis.player = this.model.getPlayer();\r\n\t\tthis.timeline = this.model.getIndefiniteTimeline();\r\n\t}", "private Controller() {\n\t\tthis.gui = GUI.getInstance();\n\t\tthis.gui.setController(this);\n\t}", "public MainScreen(GproToolController controller) {\n this.baseController = controller;\n \n initComponents();\n centerFrame();\n }", "public GameController(int width, int height) {\n\n // YOUR CODE HERE\n }", "public GameController(int width, int height) {\n\n this.width=width;\n this.height=height;\n model = new GameModel(width,height);\n view = new GameView(model,this);\n }", "protected WorldController() {\n\t\tthis(new Rectangle(0,0,DEFAULT_WIDTH,DEFAULT_HEIGHT), \n\t\t\t\tnew Vector2(0,DEFAULT_GRAVITY));\n\t}", "public GameScreen() {\n\n\t\tint midPointY = (int) (Const.GAME_HEIGHT / 2);\n\n\t\tworld = new GameWorld(midPointY);\n\t\trenderer = new GameRenderer(world);\n\n\t\tGdx.input.setInputProcessor(new InputHandler(world.getVentilatorUp(), world.getVentilatorDown()));\n\t\t// Gdx.input.setInputProcessor(new\n\t\t// InputHandler(world.getVentilatorTwo()));\n\t}", "private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}", "GameController makeGameController(LobbyController lobbyController);", "public Controller()\r\n {\r\n fillBombs();\r\n fillBoard();\r\n scoreBoard = new ScoreBoard();\r\n }", "SpawnController createSpawnController();", "private void setController() {\n\t\tcontroller = new Controller();\n\t\t// adds mouse listeners\n\t\tthis.addMouseListener(controller);\n\t\tthis.addMouseMotionListener(controller);\n\t\t// adds default DraggableRect objects with positions\n\n\t\t// adds all draggableRects to the JFrame\n\t\t/*\n\t\t * for(DraggableRect r : controller.getRects()){ add(r); }\n\t\t */\n\t}", "public MainController() {\n\t\tcontroller = new Controller(this);\n\t}", "public GuiController()\n {\n\n DefaultTerminalFactory terminalFactory = new DefaultTerminalFactory();\n PageStack = new ArrayDeque<>(); // Gives us a screen stack\n window = new BasicWindow(\"Just put anything, I don't even care\");\n try\n {\n screen = terminalFactory.createScreen(); //Populates screen\n screen.startScreen(); //Runs screen\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n textGUI = new MultiWindowTextGUI(screen);\n\n }", "public SinglePlayerGameController() {\n player1 = new Player(\"Player 1\");\n computer = new Player(\"Computer\");\n game = new Game(new Dice(), player1, computer);\n player1.setColor(\"blue\");\n computer.setColor(\"red\");\n diceImage = new DiceImage();\n }", "View(Controller c, Model m){\r\n\t\tmodel = m;\r\n\t\tcontroller = c;\r\n\t\tbackground = null;\r\n\t\tground = null;\r\n\t\twindowHeight = 0;\r\n\t}", "public Controller(char[][] levelmap){\r\n\t\r\n\tgameRunning = true;\r\n\tthis.wind = new Window();\r\n\tthis.map=levelmap;\r\n\tthis.Gameloop(this.map);\r\n\t\r\n\t}", "public MainMenuScreen(MainController controller) {\n this.controller = controller;\n startButton = new Button(\"start_button\", new SpriteBatch());\n optionsButton = new Button(\"options_button\", new SpriteBatch());\n topButton = new Button(\"top_button\", new SpriteBatch());\n exitButton = new Button(\"exit_button\", new SpriteBatch());\n }", "public void init(final Controller controller){\n Gdx.app.debug(\"View\", \"Initializing\");\n \n this.controller = controller;\n \n //clear old stuff\n cameras.clear();\n \n //set up renderer\n hudCamera = new OrthographicCamera();\n hudCamera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n \n batch = new SpriteBatch();\n igShRenderer = new ShapeRenderer();\n shapeRenderer = new ShapeRenderer();\n \n //set up stage\n stage = new Stage();\n \n //laod cursor\n cursor = new Pixmap(Gdx.files.internal(\"com/BombingGames/WurfelEngine/Core/images/cursor.png\"));\n\n controller.getLoadMenu().viewInit(this);\n \n initalized = true;\n }", "public GameController() {\n \t\t// Fill the table empty positions.\n \t\tfor (int i = 0; i < MAX_NUMBER_OF_PILES; i++) {\n \t\t\tmTable.add(i, null);\n \t\t}\n \t\tcreateDeck();\n \t\tgs = new GameState(mTable, pileNames, pileNo);\n \t\tnew Listener(this);\n \t}", "public GameController() {\n\t\t\n\t\t\n\t\tGameController.gc = this;\n\t}", "public void createAndShowGUI() {\n\t\tcontroller = new ControllerClass(); \r\n\r\n\t\t// Create and set up the window\r\n\t\twindowLookAndFeel();\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tsetTitle(\"Media Works - Add Screen\");\r\n\t\tsetResizable(false);\r\n\t\tadd(componentSetup());\r\n\t\tpack();\r\n\t\tsetSize(720,540);\r\n\t\tsetLocationRelativeTo(null);\r\n\t\tsetVisible(true);\r\n\t}", "public GameController(){\n\t\t\n\t\tupdaterRunnable = new Updater();\n\t\tgameLoopThread = new Thread(updaterRunnable);\n\t\trunning = false;\n\t\tgameFinished = false;\n\t}", "public GameController(int width, int height) {\r\n\t\tthis.gameMap = new GameMap(10);\r\n\t\tthis.isDebugVisible = true;\r\n\t\tthis.initializeGUI(width, height);\r\n\t\tthis.gameMap.addObserver(this.mapView);\r\n\t\tthis.gameMap.addObserver(this.debugView);\r\n\t\tthis.gameMap.addObserver(this.controlView);\r\n\t\tthis.timer = new Timer(10000, this);\r\n\t\tthis.countdown = new Timer(1000, this);\r\n\t\tthis.timer.setActionCommand(\"Timer\");\r\n\t\tthis.countdown.setActionCommand(\"Countdown\");\r\n\t}", "public GameController() {\n GameLoop.getInstance();\n }", "public PorController() {\n window = utils.getWindow();\n storageLocation = null;\n }", "private void createGameController() {\n\t\tLog.i(LOG_TAG, \"createGameController\");\n\n\t\tBundle intent = this.getIntent().getExtras();\n\t\t\n\t\tthis.punchMode = intent.getString(\"punchMode\");\n\t\t\n\t\tthis.gameController = new TimeTrialGameController( this.timerTextView,\n\t\t\t\tthis.numberOfPunchesCounterTextView, this.punchMode);\n\t\t\n\t\tthis.gameController.addObserver(this);\n\t}", "public PlaneUIController() {\n this.launcherFacade = new LauncherFacade();\n }", "public Controller() {\n\t\tdoResidu = false;\n\t\tdoTime = false;\n\t\tdoReference = false;\n\t\tdoConstraint = false;\n\t\ttimeStarting = System.nanoTime();\n\t\t\n\t\tsetPath(Files.getWorkingDirectory());\n\t\tsetSystem(true);\n\t\tsetMultithreading(true);\n\t\tsetDisplayFinal(true);\n\t\tsetFFT(FFT.getFastestFFT().getDefaultFFT());\n\t\tsetNormalizationPSF(1);\n\t\tsetEpsilon(1e-6);\n\t\tsetPadding(new Padding());\n\t\tsetApodization(new Apodization());\n\n\t\tmonitors = new Monitors();\n\t\tmonitors.add(new ConsoleMonitor());\n\t\tmonitors.add(new TableMonitor(Constants.widthGUI, 240));\n\n\t\tsetVerbose(Verbose.Log);\n\t\tsetStats(new Stats(Stats.Mode.NO));\n\t\tsetConstraint(Constraint.Mode.NO);\n\t\tsetResiduMin(-1);\n\t\tsetTimeLimit(-1);\n\t\tsetReference(null);\n\t\tsetOuts(new ArrayList<Output>());\n\t}", "public Screen() {\n super();\n controller = null;\n }", "protected abstract Controller initialScreen();", "public Controller(Game game, View consoleView, View graphicalView){\n\t\tthis.game = game;\n\t\tthis.consoleView = consoleView;\n\t\tthis.graphicalView = graphicalView;\t\n\t\t\n\t\tstart();\n\t}", "public GameController(VirtualView client, int num, String gameName) {\n running = new AtomicBoolean(true);\n setup = new AtomicBoolean(true);\n playerControllers = new ArrayList<PlayerController>();\n colors = new ArrayList<String>();\n colors.add(\"r\");\n colors.add(\"g\");\n colors.add(\"b\");\n Player p1 = new Player(client.getId(), colors.get(0));\n PlayerController p1Controller = new PlayerController(p1, client, this);\n game = new Game(gameName, p1, num);\n playerControllers.add(p1Controller);\n client.setPlayerController(p1Controller);\n }", "public void setController(GameController cont) {\n this.controller = cont;\n }", "public RobotContainer() {\n \n camServer = CameraServer.getInstance();\n driveCam = camServer.startAutomaticCapture(\"Driver View\", 0);\n driveCam.setResolution(160, 120);\n driveCam.setFPS(15);\n driveCam.setBrightness(50);\n // cameraThreader.start();\n\n leftJoy = new Joystick(LEFT_JOY_PORT);\n rightJoy = new Joystick(RIGHT_JOY_PORT);\n xbox = new XboxController(XBOX_PORT);\n\n //Set default drivetrain command to DriveWithJoysticks or xbox\n drivetrain.setDefaultCommand(xboxCommand);\n \n //For testing purposes, this will control simple one- or two-motor subsystems.\n genericSubsystem.setDefaultCommand(genericJoysticksCommand);\n \n //shooter.setDefaultCommand(shootCommand);\n //shooter.setDefaultCommand(turretCommand);\n\n\n // Configure the button bindings\n configureButtonBindings();\n }", "public ViewMain()\n\t{\n\t\tview = new View();\n\t\t\n\t\tcolors = new Color[20][10];\n\t\tfor(int i=0; i < 20; ++i)\n\t\t\tfor(int j=0; j < 10; ++j)\n\t\t\t\tcolors[i][j] = Color.DARK_GRAY;\n\t\t\n\t\tpanel = new BoardGamePanel(colors);\n\t\tpanel.setVisible(true);\n\t\t\n\t\tgameInfo = new GameInfo();\n\t\t\n\t\tactionListenner();\n\t\t\n\t}", "public WinScreen()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(1500, 500, 1); \r\n\r\n prepare();\r\n }", "public Controller(ViewIF view) {\n\t\tthis.view = view;\n\t\tthis.dao = new DAO();\n\t\tthis.stats = new Statistics(this.dao);\n\t\tthis.gameStarted = false;\n\t}", "Main ()\n\t{\n\t\tview = new View ();\t\t\n\t\tmodel = new Model(view);\n\t\tcontroller = new Controller(model, view);\n\t}", "public MainWindow(Controller ctrl) { //constructor\r\n\t\t\r\n\t\tsuper(\"Physics Simulator\"); //pone de tutulo del JFrame Physics Simulator\r\n\t\t_ctrl = ctrl; //asigna el controler pasado por argumento\r\n\t\tinitGUI(); //inicia la gui\r\n\t\t\r\n\t}", "public BoardView(Controller controller)\r\n {\r\n this.controller = controller;\r\n controller.addChangeListener(this);\r\n \r\n addMouseMotionListener(new MouseMotionAdapter()\r\n {\r\n \r\n @Override\r\n public void mouseMoved(MouseEvent e)\r\n {\r\n moved(e);\r\n }\r\n });\r\n \r\n addMouseListener(new MouseAdapter()\r\n {\r\n \r\n @Override\r\n public void mousePressed(MouseEvent e)\r\n {\r\n pressed(e);\r\n }\r\n });\r\n }", "private void initPlayModeController() {\n playMode.setOnMouseClicked(event -> {\n MasterMindMain mm = null;\n try { mm = new MasterMindMain(); }\n catch (Exception e) { e.printStackTrace(); }\n mm.start(SimulatorMain.stage);\n });\n playMode.setOnMouseEntered(event -> { playMode.setGraphic(new Circle(5)); });\n playMode.setOnMouseExited(event -> { playMode.setGraphic(null); });\n }", "public GUIController() {\n\n }", "public Controller() {\n\t\tthis.nextID = 0;\n\t\tthis.data = new HashMap<Integer, T>();\n\t}", "public Car_Controller(Controller_Computer ControllerComputer){\r\n\t\tcontroller_computer = ControllerComputer;\r\n\t\tcontroller = ControllerEnvironment.getDefaultEnvironment().getControllers();\r\n\t\tListGamePad = new String[controller.length][2];\r\n\t\tFindGamepad();\r\n\t\tfindRumblers(controller[Gamepadnum]);\r\n\t\tcontrolsignal.scheduleAtFixedRate(ControlTask, 0, 100);\r\n\t}", "public GameTask(GameController controller) {\n this.controller = controller;\n }", "public Window() {\n initComponents();\n setTitle(\"Clash of Asteroids 1J\");\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setResizable(false);\n setLocationRelativeTo(null);\n canvas = new Canvas();\n keyBoard = new KeyBoard();\n mouseInput = new MouseInput();\n canvas.setPreferredSize(new Dimension(Constants.WIDTH, Constants.HEIGHT));\n canvas.setMaximumSize(new Dimension(Constants.WIDTH, Constants.HEIGHT));\n canvas.setMinimumSize(new Dimension(Constants.WIDTH, Constants.HEIGHT));\n canvas.setFocusable(true);\n add(canvas);\n canvas.addKeyListener(keyBoard);\n addKeyListener(keyBoard);\n canvas.addMouseListener(mouseInput);\n addMouseListener(mouseInput);\n canvas.addMouseMotionListener(mouseInput);\n addMouseMotionListener(mouseInput);\n setVisible(true);\n }", "public ConnectionScreenController() {\n\n }", "public GUI(Controller controller){\n this.controller=controller;\n szer = controller.setWidth();\n wys = controller.setHeight();\n\n\n try\n {\n SwingUtilities.invokeAndWait(new Runnable() {\n @Override\n public void run() {\n createAndShowGUI();\n }\n });\n }\n catch(Exception e)\n {\n System.out.println(\"Blad podczas budowania GUI\");\n }\n }", "private void setupController() {\n setupWriter();\n Controller controller1 = new Controller(writer);\n controller = controller1;\n }", "public Controller(){\r\n\t\tthis.fabricaJogos = new JogoFactory();\r\n\t\tthis.loja = new Loja();\r\n\t\tthis.preco = 0;\r\n\t\tthis.desconto = 0;\r\n\t}", "public PlayerController(World world, ElementModel model) {\n super(world, model, BodyDef.BodyType.DynamicBody);\n\n state = new FloatState();\n\n this.width = imageWidth;\n this.height = imageHeight;\n\n //head\n FixtureInfo info = new FixtureInfo(new float[]{\n 62, 186,\n 32, 122,\n 57, 67,\n 98, 48,\n 160, 53,\n 207, 123,\n 193, 195,\n 62, 186\n }, width, height);\n\n info.physicsComponents(density, friction, restitution);\n\n info.collisionComponents(PLAYER_BODY, (short) (PLANET_BODY | PLAYER_BODY | COMET_BODY));\n\n createFixture(body, info);\n\n //corns\n info.vertexes = new float[]{\n 114, 49,\n 118, 33,\n 109, 19,\n 142, 13,\n 142, 26,\n 129, 33,\n 114, 49};\n\n createFixture(body, info);\n\n info.vertexes = new float[]{\n 191, 83,\n 207, 66,\n 215, 52,\n 219, 26,\n 241, 34,\n 232, 52,\n 219, 76,\n 191, 83};\n\n createFixture(body, info);\n\n //arms\n info.vertexes = new float[]{\n 61, 196,\n 23, 198,\n 3, 217,\n 21, 268,\n 61, 196};\n\n createFixture(body, info);\n\n info.vertexes = new float[]{\n 150, 229,\n 175, 285,\n 166, 316,\n 156, 330,\n 150, 229};\n\n createFixture(body, info);\n\n\n //legs\n info.vertexes = new float[]{\n 31, 332,\n 37, 370,\n 36, 401,\n 31, 416,\n 90, 418,\n 85, 403,\n 81, 374,\n 31, 332};\n\n createFixture(body, info);\n\n info.vertexes = new float[]{\n 107, 359,\n 102, 395,\n 106, 418,\n 161, 417,\n 144, 397,\n 107, 359,\n 152, 327};\n\n createFixture(body, info);\n\n\n //Belly\n info.vertexes = new float[]{\n 75, 219,\n 17, 283,\n 41, 346,\n 90, 364,\n 143, 330,\n 151, 280,\n 138, 227,\n 75, 219};\n\n createFixture(body, info);\n\n this.body.setGravityScale(0);\n this.body.setAngularDamping(0.7f);\n\n this.lost = false;\n }", "private GameController() {\n\n }", "public RobotContainer()\n\t{\n\t\t// Create OI devices:\n\t\tgameController = new XboxController(OIConstants.xboxControllerPort);\n\t\tleftStick = new Joystick(OIConstants.leftJoystickPort);\n\t\trightStick = new Joystick(OIConstants.rightJoystickPort);\n\n\t\t// Create subsystems:\n\t\tdriveTrain = new DriveTrain();\n\t\tshooter = new Shooter(gameController);\n\t\tturret = new Turret(gameController);\n\t\tintake = new Intake();\n\t\tindexer = new Indexer();\n\t\tclimber = new Climber(gameController);\n\n\t\t// Create camera:\n\t\tlimelightCamera = LimelightCamera.getInstance();\n\n\t\t// Configure default commands:\n\t\tdriveTrain.setDefaultCommand(new DriveWithJoysticks(driveTrain, leftStick, rightStick));\n\t\tturret.setDefaultCommand(new RunTurretWithGameController(turret, gameController));\n\t\tclimber.setDefaultCommand(new RunClimberWithGameController(climber, gameController));\n\n\t\t// Configure the button bindings\n\t\tconfigureButtonBindings();\n\n\t\tinitSmartDashboard();\n\t}", "public RoboViewController(CGRect bounds, RoboPlatform.Config config) {\n EAGLContext ctx = new EAGLContext(EAGLRenderingAPI.OpenGLES2);\n platform = new RoboPlatform(bounds, config);\n view = new GLKView(bounds, ctx) {\n @Method(selector = \"touchesBegan:withEvent:\")\n public void touchesBegan(NSSet<UITouch> touches, UIEvent event) {\n platform.touch().onTouchesBegan(touches, event);\n platform.pointer().onTouchesBegan(touches, event);\n }\n @Method(selector = \"touchesCancelled:withEvent:\")\n public void touchesCancelled(NSSet<UITouch> touches, UIEvent event) {\n platform.touch().onTouchesCancelled(touches, event);\n platform.pointer().onTouchesCancelled(touches, event);\n }\n @Method(selector = \"touchesEnded:withEvent:\")\n public void touchesEnded(NSSet<UITouch> touches, UIEvent event) {\n platform.touch().onTouchesEnded(touches, event);\n platform.pointer().onTouchesEnded(touches, event);\n }\n @Method(selector = \"touchesMoved:withEvent:\")\n public void touchesMoved(NSSet<UITouch> touches, UIEvent event) {\n platform.touch().onTouchesMoved(touches, event);\n platform.pointer().onTouchesMoved(touches, event);\n }\n @Override\n public void draw(CGRect rect) {\n platform.paint();\n }\n };\n view.setMultipleTouchEnabled(true);\n view.setDrawableColorFormat(platform.config.glBufferFormat);\n // view.setDrawableDepthFormat(GLKViewDrawableDepthFormat._16);\n // view.setDrawableStencilFormat(GLKViewDrawableStencilFormat.None);\n setView(view);\n setDelegate(this);\n setPreferredFramesPerSecond(config.targetFPS);\n addStrongRef(platform);\n PlayN.setPlatform(platform);\n }", "public Controller() {\n\t\tenabled = false;\n\t\tloop = new Notifier(new ControllerTask(this));\n\t\tloop.startPeriodic(DEFAULT_PERIOD);\n\t}", "@JsConstructor\n public ScreenSpaceCameraController(Scene scene) {}", "public HudTopController(Stage stage) {\n root = CompositionRoot.getInstance();\n HudBuildController hudBuildController = new HudBuildController(stage);\n HudCarsController hudCarsController = new HudCarsController(stage);\n HudSettingsController hudSettingsController = new HudSettingsController(stage);\n\n view = new HudTopView(stage);\n\n // LEFT\n view.pauseButton.addListener((ClickListener) (event, actor) -> root.simulationController.togglePaused());\n view.saveButton.addListener((ClickListener) (event, actor) -> {\n root.floorsController.toJson();\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd.MMM.yyyy HH.mm\");\n String savePath = dateFormat.format(new Date(System.currentTimeMillis())) + \".parkingsimulatortycoon\";\n Dialogs.showOKDialog(stage, \"Save Complete\", savePath);\n });\n view.speedSlider.addListener(event -> {\n root.simulationController.setUpdatesPerSecond((int)(view.speedSlider.getValue()));\n return true;\n });\n view.floorUp.addListener((ClickListener) (event, actor) -> root.floorsController.moveUpOneFloor());\n view.floorDown.addListener((ClickListener) (event, actor) -> root.floorsController.moveDownOneFloor());\n\n // RIGHT\n view.deletedButton.addListener((ClickListener) (event, actor) -> root.bluePrintsController.toggleDemolishMode() );\n view.buildButton.addListener((ClickListener) (event, actor) -> hudBuildController.show(stage));\n view.carsButton.addListener((ClickListener) (event, actor) -> hudCarsController.show(stage));\n view.settings.addListener((ClickListener) (event, actor) -> hudSettingsController.show(stage));\n }", "public Controller (Game game) {\n fsm = new FiniteStateMachine();\n this.game = game;\n }", "public RunMVC() {\n\n\t\t//cria o Modelo e a Visao\n\t\tModel myModel \t= new Model();\n\t\tView myView \t= new View();\n\t\t//View outraView \t= new View();\n\t\tOutraView outraView \t= new OutraView();\n\n\t\t//avisa o modelo que a visao existe \n\t\tmyModel.addPropertyChangeListener(myView);\n\t\tmyModel.addPropertyChangeListener(outraView);\n\n\t\tController myController = new Controller();\n\t\tmyController.addModel(myModel);\n\t\t//myController.addView(myView);\n\t\t//myController.addView(outraView);\n\t\tmyController.initModel(start_value);\n\n\t\t//tell View about Controller \n\t\tmyView.addController(myController);\n\t\toutraView.addController(myController);\n\t\t\n\n\t}", "public TemplateController() {\n super();\n // get distance sensors and save them in array\n _distanceSensors = new DistanceSensor[] {\n getDistanceSensor(\"ps5\"),\n getDistanceSensor(\"ps6\"),\n getDistanceSensor(\"ps7\"),\n getDistanceSensor(\"ps0\"),\n getDistanceSensor(\"ps1\"),\n getDistanceSensor(\"ps2\"),\n };\n // get light sensors and save them in array\n _lightSensors = new LightSensor[]{\n getLightSensor(\"ls5\"),\n getLightSensor(\"ls6\"),\n getLightSensor(\"ls7\"),\n getLightSensor(\"ls0\"),\n getLightSensor(\"ls1\"),\n getLightSensor(\"ls2\")\n };\n\n //enable the sensors\n for (int i = 0; i < 6; i++){\n _distanceSensors[i].enable(10);\n _lightSensors[i].enable(10);\n }\n }", "public GameView() {\n initComponents();\n gameView(30, 30);\n }", "public Game(){\n\t\tDimension size = new Dimension(width * scale, height * scale);\n\t\tsetPreferredSize(size);\n\t\t\n\t\tscreen = new Screen(width, height);//instantiated the new screen\n\t\t\n\t\tframe = new JFrame();\n\t\t\n\t}", "public WindowControler(String sname,vector pos) {\n super(sname,pos);\n WindowControler_init();\n }", "public Game(){\n\t\tDimension dimension = new Dimension(Game.WIDTH, Game.HEIGHT); //Create dimensions for window size\n\t\tsetPreferredSize(dimension); //Set the start size\n\t\tsetMinimumSize(dimension); //Set the min size\n\t\tsetMaximumSize(dimension); //Set the max size, this locks the window size.\n\t\taddKeyListener(this); //Add the key listener to the game object\n\t\tlevel1(); //Load level 1\n\t\twinScreen = new WinScreen(); //Create win object\n\t\tdeadScreen = new DeadScreen(); //Create dead object\n\t\tstartScreen = new StartScreen(); //Create startScreen object\n\t\tpauseScreen = new PauseScreen(); //Create pauseScreen object\n\t\tspriteSheet = new SpriteSheet(\"img/sprites.png\"); //Create SpriteSheet object\n\t\tnew Texture(); //Initialize texture object\n\t}", "public Controller()\n {\n // Create initial queues and stations\n q0 = new Queue(); //registration q\n \n // p[arameters are id of station, 4 queues, completed q)\n s0 = new Station(0, q0, q1, q2, q3, qx);\n \n //Student soiurce ss is an actor\n \n actors = new ArrayList<>(); \n actors.add(s0); // add all Actor implementors\n //actors.add(myStudentSorce);\n }", "@Override\n public void create() {\n setScreen(new ServerScreen(\n new RemoteGame(),\n new SocketIoGameServer(HOST, PORT)\n ));\n }", "public Tron()\n\t{\n\t\tdim = Toolkit.getDefaultToolkit().getScreenSize();\n\t\tjframe = new JFrame(\"Tron\");\n\t\tjframe.setVisible(true);\n\t\tjframe.setSize(600, 400);\n\t\tjframe.setResizable(false);\n\t\tjframe.setLocationRelativeTo(null);\n\t\tjframe.add(renderPanel = new RenderPanel());\n\t\tjframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tjframe.addKeyListener(this);\n\t\tstartGame();\n\t}", "public GameFrame() {\n\t\tsuper(\"Treasure Hunt - Game\");\n\t\tthis.setSize(1800,1000);\n\t\t\n\t\tthis.setVisible(true);\n\t\tthis.setDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tthis.setMinimumSize(new Dimension(1775,850));\n\t\tthis.setLocationRelativeTo(null);\n\t\t\n\t\tthis.controller = new Controller(this);\n\t\t\n\t\t// Main container\n\t\tContainer main = this.getContentPane();\n\t\tmain.setLayout(new BorderLayout());\n\t\t\n\t\t// Buttons pane\n\t\tGameButtonsPanel buttonsPane = new GameButtonsPanel(controller);\n\t\tmain.add(buttonsPane,\"North\");\n\t\tthis.buttonsPanel = buttonsPane;\n\t\t\n\t\t// Game pane\n\t\tthis.gamePanel = new GamePanel(this);\n\t\tmain.add(gamePanel);\n\t\t\n\t\t\n\t\t// Menu bar\n\t\tthis.menuBar = new GameMenuBar(controller);\n\t\tthis.setJMenuBar(this.menuBar);\n\t\t\n\t\t\n\t\tthis.revalidate();\n\t\n\t}", "public Game() {\n\t\tsuper();\n\t\tgameModel = new GameModel();\n\t\tview = new GamePane(gameModel);\n\t\t\n\t\tadd(view);\n\t\tpack();\n\t\tsetLocationRelativeTo(null);\n\t}", "public RobotContainer() {\n // Configure the button bindings\n configureButtonBindings();\n\n drivetrain.setDefaultCommand(new RunCommand(\n () -> drivetrain.setTank(Math.pow(-joystick1.getY(), 3), Math.pow(joystick2.getY(), 3)), drivetrain));\n\n }", "public RiskController() {\r\n\t\trisk = new RiskGameModel();\r\n\t\tinitComponents();\r\n\t\tinitializePhaseView(risk);\r\n\t\tsetLocationRelativeTo(null);\r\n\t\tsetResizable(false);\r\n\t\tjPanel1.repaint();\r\n\t\tjPanel1.addMouseListener(this);\r\n\t\tAttackButton.setVisible(false);\r\n\t}", "public abstract void initController();", "public LevelController(GameCanvas gameCanvas) {\r\n\t\tsuper(DEFAULT_WIDTH,DEFAULT_HEIGHT,DEFAULT_GRAVITY);\r\n\t\tsetDebug(false);\r\n\t\tsetComplete(false);\r\n\t\tsetFailure(false);\r\n\t\tworld.setContactListener(movementController);\r\n\t\tlightSensorFixtures = new ObjectSet<Fixture>();\r\n\t\tdarkSensorFixtures = new ObjectSet<Fixture>();\r\n\t\tcombinedSensorFixtures = new ObjectSet<Fixture>();\r\n\t\tholdingHands = false;\r\n\t\twidthUpperBound = 0;\r\n\t\theightUpperBound = 0;\r\n\t\tcanvas = gameCanvas;\r\n\r\n\t}", "public MoveController(Model m, Window w) {\n this.model = m;\n this.window = w;\n }", "public Controller()\r\n\t{\r\n\t\tview = new View();\r\n\t}", "public Controller(BasicBoard basicBoard)\n\t{\n\t\tboard = basicBoard;\n\t\t// What to do when users click on pits\n\t\tMouseListener mouseListener = new MouseListener()\n\t\t{\n\n\t\t\tpublic void mouseClicked(MouseEvent event) {\n\t\t\t\tPit pit = (Pit) event.getSource();\n\t\t\t\tint pick = pit.getIndex();\n\t\t\t\tboard.getDataModel().pick_pit(pick);\n\t\t\t\tboard.stateChanged(new ChangeEvent(this));\n\t\t\t\t\n\t\t\t}\n\n\t\t\tpublic void mouseEntered(MouseEvent arg0) {\n\t\t\t}\n\n\t\t\tpublic void mouseExited(MouseEvent arg0) {\n\t\t\t}\n\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t}\n\n\t\t\tpublic void mouseReleased(MouseEvent arg0) {\n\t\t\t}\n\t\t\t\n\t\t};\n\t\t\n\t\t// What to do when users click on buttons\n\t\tActionListener actionListener = new ActionListener()\n\t\t{\n\n\t\t\tpublic void actionPerformed(ActionEvent event) {\n\t\t\t\tJButton button = (JButton) event.getSource();\n\t\t\t\tif (button.getText().equals(\"Undo\"))\n\t\t\t\t{\n\t\t\t\t\tboard.getDataModel().undo();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tboard.getDataModel().endTurn();\n\t\t\t\t}\n\t\t\t\tboard.stateChanged(new ChangeEvent(this));\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t};\n\t\t\n\t\tboard.attachMouseListener(mouseListener);\n\t\tboard.attachActionListener(actionListener);\n\t}", "ABcontroller(){\n\t\tsuper(50);\n\t\ttimer = new Timer();\n\t}", "private void setUpController(){\n\n SessionController.getInstance().addCommand(new PartyCreateCommand(\"PARTY_CREATE\"));\n SessionController.getInstance().addCommand(new PartyDetailsRetrieveCommand(\"PARTY_DETAILS_RETRIEVE\"));\n SessionController.getInstance().addCommand(new PartyInvitesRetrieveCommand(\"PARTY_INVITES_RETRIEVE\"));\n SessionController.getInstance().addCommand(new PartyLeaveCommand(\"PARTY_LEAVE\"));\n SessionController.getInstance().addCommand(new PartyMemberRemoveCommand(\"PARTY_MEMBER_REMOVE\"));\n SessionController.getInstance().addCommand(new PlayerCreateCommand(\"PLAYER_CREATE\"));\n SessionController.getInstance().addCommand(new PlayerInvitesRetrieveCommand(\"PLAYER_INVITES_RETRIEVE\"));\n SessionController.getInstance().addCommand(new PlayerLogOutCommand(\"PLAYER_LOG_OUT\"));\n }", "public Controller()\n\t{\n\t\ttheParser = new Parser();\n\t\tstarList = theParser.getStars();\n\t\tmessierList = theParser.getMessierObjects();\n\t\tmoon = new Moon(\"moon\");\n\t\tsun = new Sun(\"sun\");\n\t\tconstellationList = theParser.getConstellations();\n\t\tplanetList = new ArrayList<Planet>();\n\t\ttheCalculator = new Calculator();\n\t\tepoch2000JD = 2451545.0;\n\t}", "public static void init() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n drivetrainSpeedController1 = new CANTalon(1);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 1\", (CANTalon) drivetrainSpeedController1);\n \n drivetrainSpeedController2 = new CANTalon(2);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController2);\n drivetrainSpeedController3 = new CANTalon(3);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController3);\n drivetrainSpeedController4 = new CANTalon(4);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController4);\n drivetrainSpeedController5 = new CANTalon(5);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController5);\n drivetrainSpeedController6 = new CANTalon(6);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController6);\n \n drivetrainRobotDrive21 = new RobotDrive(drivetrainSpeedController1, drivetrainSpeedController2, drivetrainSpeedController3, drivetrainSpeedController4, drivetrainSpeedController5, drivetrainSpeedController6);\n \n drivetrainRobotDrive21.setSafetyEnabled(true);\n drivetrainRobotDrive21.setExpiration(0.1);\n drivetrainRobotDrive21.setSensitivity(0.5);\n drivetrainRobotDrive21.setMaxOutput(1.0);\n\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }", "public MainMenuController()\n {\n ArrayList<JButton> menuList = new ArrayList();\n \n //Setup default colors\n player1Color = Color.RED;\n player2Color = Color.BLUE;\n \n //Setup the start button\n startButton = new JButton(\"Start\");\n startButton.setBackground(Color.GREEN);\n menuList.add(startButton);\n \n startButton.addActionListener((ActionEvent ae) -> {\n uControll = new UltimateController();\n uControll.start(player1Color, player2Color);\n this.setupGameWindow();\n menuPanel.close();\n });\n \n //Setup multiplayer button\n JButton multiButton = new JButton(\"Network Play\");\n multiButton.setBackground(new Color(0,255,200));\n menuList.add(multiButton);\n multiButton.addActionListener((ActionEvent ae) -> {\n View.Multiplayer mp = new View.Multiplayer();\n mp.setParentWindow(menuPanel);\n mp.launchWindow();\n menuPanel.close();\n });\n \n //Setup the settings button\n JButton settingButton = new JButton(\"Settings\");\n settingButton.setBackground(Color.orange);\n menuList.add(settingButton);\n settingButton.addActionListener((ActionEvent ae) -> {\n setGUI = new View.SettingGUI(player1Color, player2Color);\n setupSettingWindow();\n });\n \n //Setup the how to play button\n howToButton = new JButton(\"How to Play\");\n howToButton.setBackground(Color.LIGHT_GRAY);\n menuList.add(howToButton);\n howToButton.addActionListener((ActionEvent ae) -> {\n //Create a frame\n JFrame newWindow = new JFrame(\"How to Play\"); \n View.HowToPlayPanel hPlay = new View.HowToPlayPanel();\n newWindow.add(hPlay);\n newWindow.setSize(1200,550);\n \n //Make the return button work\n hPlay.getReturnBtn().addActionListener((ActionEvent ae2) -> {\n newWindow.dispose();\n });\n \n newWindow.setVisible(true);\n newWindow.requestFocus();\n });\n \n //Setup the Quit button\n quitButton = new JButton(\"Quit\");\n quitButton.setBackground(Color.RED);\n menuList.add(quitButton);\n \n quitButton.addActionListener((ActionEvent ae) -> {\n System.out.println(\"Quit the program\");\n System.exit(0);\n });\n \n startButton.setBounds(570, 300, 120, 45);\n howToButton.setBounds(570, 375, 120, 45);\n quitButton.setBounds(570, 450, 120, 45);\n \n menuPanel = new MenuPanel(menuList);\n }", "public Controller(IView view) {\n\t\tengine = new Engine(this);\n\t\tclock = new Clock();\n\t\tsoundEmettor = new SoundEmettor();\n\t\tthis.view = view;\n\t}", "public ControlView (SimulationController sc){\n myProperties = ResourceBundle.getBundle(\"english\");\n myStartBoolean = false;\n mySimulationController = sc;\n myRoot = new HBox();\n myPropertiesList = sc.getMyPropertiesList();\n setView();\n\n }", "public interface Controller {\n\n\t/**\n\t * This method sets the Model of the controller\n\t * @param m the Model to be set for Controller\n\t */\n\tvoid setModel(Model m);\n\t\n\t/**\n\t * This method sets the View of the controller\n\t * @param v the View to be set for Controller\n\t */\n\tvoid setView(View v);\n\t/**\n\t * This method transfers messages to mView to be printed on the screen\n\t * @param toPrnt A String to be printed on the screen in the manner View chooses\n\t */\n\tvoid PrintOnScreen(String toPrnt);\n\t/**\n\t * This method gets the data that the user entered as input to View\n\t * @return the user's String-the input\n\t */\n\tString getDataFromScreen();\n//\t/**\n//\t * \n//\t * @param commandToExecute\n//\t * @param params\n//\t */\n//\tvoid excuteCommand(Command commandToExecute, String[] params);\n\t/**\n\t * This message returns a Maze3d according to a given name\n\t * @param name the name of maze to be checked\n\t * @return a maze with the name \"name\" if name does not exist returns false\n\t */\n\tMaze3d getMaze(String name);\n\t/**\n\t * This message returns the map of <String, Command>\n\t * @return A map with all the strings and commands\n\t */\n\tHashMap <String, Command> getMap();\n\t/**\n\t * This method sets the map of Strings and Commands so will know the matches/\n\t */\n\tvoid setHashMap();\n\n\t/**\n\t * This method returns the Error String in the correct format to be recognized and so the user will know\n\t * @param toPrint the mesage of the error String\n\t * @return A String[] with error in [0] and toPrint at [1]\n\t */\n\tString[] returnErrorString(String toPrint);\n\n\t/**\n\t * This method checks if the String is a legal Commad and makes it one in the correct format if it is.\n\t * if not will return a message or an error String[]\n\t * @param strToChck The String that the user entered as his command\n\t * @return a String in the format to be identified for the command to work\n\t */\n\tString[] checkIfLegalCommand(String strToChck);\n\t\n\t/**\n\t * This method execute the command that it receives with the parameters from param[]\n\t * @param commandToExecute the command to execute \n\t * @param params all the data that the command needs to execute\n\t */\n\tvoid excuteCommand(Command commandToExecute, String [] params);\n}", "public StartScreen()\n { \n // Create a new world with 1111x602 cells with a cell size of 1x1 pixels.\n super(1111, 602, 1); \n prepare();\n background.playLoop();\n }", "private void initSimulateModeController() {\n simulateMode.setOnMouseClicked(event -> {\n SimulatorMain sm = null;\n try { sm = new SimulatorMain(); }\n catch (Exception e) { e.printStackTrace(); }\n sm.start(SimulatorMain.stage);\n });\n simulateMode.setOnMouseEntered(event -> { simulateMode.setGraphic(new Circle(5)); });\n simulateMode.setOnMouseExited(event -> { simulateMode.setGraphic(null); });\n }", "public Model() {\n\t \tentranceCarQueue = new CarQueue();\n\t entrancePassQueue = new CarQueue();\n\t paymentCarQueue = new CarQueue();\n\t exitCarQueue = new CarQueue();\n\t abonnementsPlaatsen = abonnementsPlaatsen < 0 ? 0 : abonnementsPlaatsen;\n\t numberOfOpenSpots =numberOfFloors*numberOfRows*numberOfPlaces;\n\t hoeveelheid = abonnementsPlaatsen;\n\t cars = new Car[numberOfFloors][numberOfRows][numberOfPlaces];\n\t \n\t /*\n\t\tguiframe=new JFrame(\"Parkeergarage Simulator\");\n\t\tscreen.setSize(800, 500);\n\t\tscreen.setLayout(null);\n\t \n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t Container Controlpanelview = getContentPane();\n\t Controlpanelview.add(cpview, BorderLayout.CENTER);\n\t Controlpanelview.add(simcontroller, BorderLayout.EAST);\n\t pack();\n\t screen.setVisible(true);\n\t\t\n\t updateViews(); */\n\t}", "public Controller() {\n model = new Model();\n comboBox = new ChannelComboBox();\n initView();\n new ChannelWorker().execute();\n timer = new Timer();\n }", "private void createUI() throws FactoryException {\n assert theGame != null;\n assert ghostController != null;\n\n buttonPanel = new ButtonPanel(this);\n buttonPanel.initialize();\n\n pi = new PacmanInteraction(this, theGame);\n pi.addController(ghostController);\n buttonPanel.setListener(pi);\n this.addKeyListener(new PacmanKeyListener(pi));\n\n boardView = createBoardView();\n animator = new Animator(boardView);\n pi.addController(animator);\n\n points = new PointsPanel();\n points.initialize(theGame.getPointManager());\n theGame.attach(points);\n\n JPanel mainGrid = new JPanel();\n mainGrid.setLayout(new BorderLayout());\n mainGrid.setName(\"jpacman.topdown\");\n mainGrid.add(points, BorderLayout.NORTH);\n mainGrid.add(boardView, BorderLayout.CENTER);\n mainGrid.add(buttonPanel, BorderLayout.SOUTH);\n\n getContentPane().add(mainGrid);\n\n int width = Math.max(boardView.windowWidth(), buttonPanel.getWidth());\n int height = boardView.windowHeight() + buttonPanel.getHeight();\n setSize(width, height);\n setGridSize();\n\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n setName(\"jpacman.main\");\n setTitle(\"JPacman\");\n }", "public GameGUI( RiskGameEngine gameEngine )\n\t{\t\n\t\t//this.setPreferredSize( new java.awt.Dimension( 1000, 800 ) );\n\t\tthis.gameEngine = gameEngine;\n\t\t// START SCREEN INIT\n\t\tthis.startScreenHandler = new StartScreenHandler( gameEngine );\n\t\tthis.startScreen = new StartScreenPanel( startScreenHandler );\n\n\t\t// CREATE PLAYERS SCREEN INIT\n\t\tthis.createPlayersScreenHandler = new CreatePlayersScreenHandler(\n\t\t\t\tthis.gameEngine );\n\t\tthis.createPlayersScreen = new CreatePlayersScreenPanel(\n\t\t\t\tthis.createPlayersScreenHandler );\n\t\t\n\t\t//MAIN MAP SCREEN \n\t\tmapScreenHandler = new MapScreenHandler( gameEngine );\n\t\tmapScreen = new MapScreenPanelTest( mapScreenHandler );\n\t\t\n\t\t/* all panels below are internal frames to the main map screen */\n\t\t//CARD SCREEN \n\t\tcardHandler = new CardScreenHandler( gameEngine );\n\t\tcardScreen = new CardScreenPanel( cardHandler );\n\t\tmapScreen.setCardScreenPanel( cardScreen );\n\t\t\n\t\t//ATTACK SCREEN \n\t\tattackHandler = new AttackScreenHandler( gameEngine );\n\t\tattackScreen = new AttackScreenPanel( attackHandler );\n\t\tmapScreen.setAttackScreenPanel( attackScreen );\n\t\t\n\t\t//FORTIFY SCREEN \n\t\tmoveTroopsHandler = new MoveTroopsScreenHandler( gameEngine );\n\t\tmoveTroopsScreen = new MoveTroopsScreenPanel( moveTroopsHandler );\n\t\tmapScreen.setMoveTroopsScreenPanel( moveTroopsScreen );\n\t\t\n\t\tthis.currentPanel = this.startScreen;\t\n\t\tthis.getContentPane().add( currentPanel );\n\t\tthis.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );\n\t\t\n\t}", "public GUI(GUIController controler){\n\t\t//Create the fame with specific features\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (InstantiationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedLookAndFeelException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.controler=controler;\n\t\tsetFrame(new JFrame(\"Network Topology\"));\n\t\t//getFrame().setPreferredSize(new Dimension(1200, 700));\n\t\tbuttons=new ArrayList<JButton>();\n\t\tcirclePanel=new CirclePanel();\n\t\tstratButtons= new ArrayList<JButton>();\n\t\t\n\t\tgetFrame().setResizable(true);\n\t\t}", "public GameController(GameModel gameModel) {\n\t\tthis.gameModel = gameModel;\n\t\tcurrState = State.WAIT;\n\t\tcurrDisk = null;\n\t\tcurrSquare = null;\n\t}", "public GameWindow(GameEngineImpl model, int width, int height) {\n this.model = model;\n this.pane = new Pane();\n this.width = width;\n this.scene = new Scene(pane, width, height);\n\n this.entityViews = new ArrayList<>();\n\n KeyboardInputHandler keyboardInputHandler = new KeyboardInputHandler(model);\n\n scene.setOnKeyPressed(keyboardInputHandler::handlePressed);\n scene.setOnKeyReleased(keyboardInputHandler::handleReleased);\n\n this.backgroundDrawer = new ParallaxBackground();\n backgroundDrawer.draw(model, pane);\n time = new Text();\n lives = new Text();\n pane.getChildren().add(time);\n pane.getChildren().add(lives);\n }", "public SnakeUI() {\r\n setFrame(); \r\n setKeyListener();\r\n setTimer();\r\n startGame();\r\n this.setVisible(true);\r\n }", "public ParticleRenderingGameController(int width, int height, WorldToDisplayTransformer worldToDisplayTransformer) {\n this.worldToDisplayTransformer = worldToDisplayTransformer;\n\n boundedGameArea = new Rectangle(width, height);\n particles = new ArrayList<>();\n particleSimulator = new ParticleSimulator(particles); // share the list\n\n // Initialize the time, fps, and other variables\n oldTime = System.nanoTime();\n nanoseconds = 0;\n frames = 0;\n updates = 0;\n fps = 0;\n ups = 0;\n\n // Create the timer that will handle our update task\n updateTimer = new java.util.Timer();\n // Initializing TimerTask with a default do nothing task to avoid\n // having a null reference\n updateTask = new TimerTask() {\n @Override\n public void run() {\n // do nothing default initialization\n }\n };\n\n }", "@Override\n\tpublic void create() {\n\t\t// This should come from the platform\n\t\theight = platform.getScreenDimension().getHeight();\n\t\twidth = platform.getScreenDimension().getWidth();\n\n\t\t// create the drawing boards\n\t\tsb = new SpriteBatch();\n\t\tsr = new ShapeRenderer();\n\n\t\t// Push in first state\n\t\tgsm.push(new CountDownState(gsm));\n//\t\tgsm.push(new PlayState(gsm));\n\t}", "public Controller (Salle salle) {\n double marge = 30;\n this.salle = salle;\n \n cSalle = salle.afficher();\n cSalle.setTranslateX(marge);\n cSalle.setTranslateY(marge);\n cSalle.setController(this);\n\n cPanel = new ControllerPanel();\n cPanel.setTranslateY(salle.getHauteur() + (3 * marge));\n\n creerObstacle = new ArrayList<>();\n pointObstacle = new ArrayList<>();\n ligneObstacle = new ArrayList<>();\n suppressionObstacle = false;\n \n // Event utilisé pour ajouter des Personnes, Obstacles en lors d'un clique.\n // Seulement lorsque la simulation n'est pas lancée\n cSalle.getSalleGraphique().setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n double rayon = new Personne().getRayon();\n double x = event.getX();\n double y = event.getY();\n if((x+marge > marge+rayon && x < salle.getLargeur()-rayon)){\n if(!salle.isRunning() && !creationObstacle && !suppressionObstacle){\n cSalle.afficherPersonne(cSalle.createPersonne(x,y));\n } else if(!salle.isRunning() && creationObstacle && !suppressionObstacle){\n Circle c = new Circle(x+marge, y+marge, 10);\n getChildren().add(c);\n pointObstacle.add(c);\n if(pointObstacle.size()>1){\n Line l = new Line(pointObstacle.get(pointObstacle.size()-2).getCenterX(),pointObstacle.get(pointObstacle.size()-2).getCenterY() , event.getX()+marge, event.getY()+marge);\n getChildren().add(l);\n ligneObstacle.add(l);\n }\n if(pointObstacle.size()>2){\n if(pointObstacle.size()>3) getChildren().remove(getChildren().get(getChildren().size()-3));\n Line l = new Line(event.getX()+marge, event.getY()+marge, pointObstacle.get(0).getCenterX(), pointObstacle.get(0).getCenterY());\n getChildren().add(l);\n ligneObstacle.add(l);\n }\n \n creerObstacle.add(new Point(event.getX(), event.getY()));\n }\n }\n }\n });\n\n // Event utilisé pour supprimer un obstacle en cliquant.\n // Seulement lorsque la simulation n'est pas lancée\n this.setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n if(!salle.isRunning() && suppressionObstacle){\n for(ControllerObstacle o : cSalle.getListObstacles()){\n if(o.contains(event.getX()-marge, event.getY()-marge)){\n salle.removeObstacle(o.getObstacle()); \n suppressionObstacle = false;\n cPanel.visibility(true);\n cPanel.getGroupeGraphe().getSelectedToggle().setSelected(false);\n cPanel.getEnleverGrapheRB().setSelected(true);\n cSalle.cacherGraphe();\n }\n }\n }\n }\n });\n\n // Event qui lance la simulation lorsque l'utilisateur appuie sur le bouton play.\n // Prends en compte les différents paramètres (checkbox) de gestion des collisions.\n cPanel.getPlayButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n salle.setVitessePersonnes(cPanel.getVitesseValue());\n if(cPanel.getCollisionStatus()){\n salle.play(true);\n }\n else\n salle.play(false);\n if(salle.isRunning())\n cPanel.setLoopTimer(0);\n }\n });\n\n // Event qui met en pause la simulation lorsque l'utilisateur clique sur le bouton pause.\n cPanel.getPauseButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n salle.pause();\n cPanel.setLoopTimer(1);\n }\n });\n\n // Event qui supprime toutes les personnes de la salle et stoppe la simulation lorsque l'utilisateur clique sur clear.\n cPanel.getClearButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n salle.removeAllPersonne();\n cPanel.setLoopTimer(2);\n }\n });\n\n // Event qui affiche ou cache le graphe des chemins les plus courts lorsque l'utilisateur active ou désactive la checkbox correspondante.\n cPanel.getGrapheRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"\");\n }\n });\n\n cPanel.getGrapheDiagonaleRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"Diagonale\");\n }\n });\n\n cPanel.getGrapheCartesienRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"Cartesien\");\n }\n });\n\n cPanel.getGraphePhysiqueRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"Physique\");\n }\n });\n\n cPanel.getEnleverGrapheRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n }\n });\n\n // Event qui ouvre un popup pour ajouter un nombre de personnes définis lorsque l'utilisateur clique sur le bouton correspondant.\n cPanel.getAddPersonButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if(!salle.isRunning())\n createPopup(\"Personne\");\n }\n });\n\n // Event qui permet d'activer l'option de creation d'obstacle lorsque l'utilisateur clique sur le bouton correspondant.\n cPanel.getAddObstacleButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if(!salle.isRunning()){\n creationObstacle = true;\n cPanel.visibility(false);\n }\n }\n });\n\n // Event qui permet de valider la creation d'un obstacle lorsque l'utilisateur clique sur le bouton valider.\n cPanel.getValiderObstacleButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n boolean intersec = false;\n double rayon = new Personne().getRayon();\n for(int i=0;i<pointObstacle.size() && !intersec;i++){\n Point A = new Point(pointObstacle.get(i).getCenterX()-marge,pointObstacle.get(i).getCenterY()-marge);\n Point B;\n if(i==pointObstacle.size()-1) B = new Point(pointObstacle.get(0).getCenterX()-marge,pointObstacle.get(0).getCenterY()-marge);\n else B = new Point(pointObstacle.get(i+1).getCenterX()-marge,pointObstacle.get(i+1).getCenterY()-marge);\n if(salle.intersecObstacle(A, B)) {\n intersec = true;\n }\n }\n creationObstacle = false;\n cPanel.visibility(true);\n if(!intersec){\n if(!creerObstacle.isEmpty() && creerObstacle.size()>2){\n Obstacle obstacle = new ObstaclePolygone(creerObstacle);\n ControllerObstacle obstacleGraphique = obstacle.afficher();\n salle.addObstacle(obstacle);\n cSalle.afficherControllerObstacle(obstacleGraphique);\n List<ControllerObstacle> obstacles = cSalle.getListObstacles();\n for(ControllerObstacle o : obstacles){\n if(!obstacleGraphique.equals(o)){\n if(obstacleGraphique.contains(o.getObstacle().getListePointsGraphiques().get(0).getX(),o.getObstacle().getListePointsGraphiques().get(0).getY())) salle.removeObstacle(o.getObstacle());\n }\n }\n cPanel.getGroupeGraphe().getSelectedToggle().setSelected(false);\n cPanel.getEnleverGrapheRB().setSelected(true);\n cSalle.cacherGraphe();\n }\n }\n creerObstacle.clear();\n for(Circle c : pointObstacle) getChildren().remove(c);\n for(Line l : ligneObstacle) getChildren().remove(l);\n pointObstacle.clear();\n ligneObstacle.clear();\n }\n });\n // Event qui permet d'activer l'option pour supprimer un obstacle lorsque l'utilisateur clique sur le bouton correspondant.\n cPanel.getSupprimerObstacleButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if(!salle.isRunning() && !salle.getListObstacles().isEmpty()){\n suppressionObstacle = true;\n cPanel.visibility(false);\n cPanel.getValiderObstacleButton().setVisible(false);\n }\n }\n });\n\n getChildren().addAll(cSalle, cPanel);\n }", "private void initBoard() {\n initCommands();\n setBackground(Color.BLACK);\n setPreferredSize(new Dimension((int) (W * Application.scale), (int) (H * Application.scale)));\n\n commandClasses.forEach((cmdstr) -> {\n try {\n Object obj = Class.forName(cmdstr).getDeclaredConstructor().newInstance();\n Command cmd = (Command) obj;\n connectCommand(cmd);\n System.out.println(\"Loaded \" + cmdstr);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n });\n\n Particle.heatmap.addColor(0, Color.GREEN);\n Particle.heatmap.addColor(50, Color.YELLOW);\n Particle.heatmap.addColor(100, Color.RED);\n\n Particle.slopemap.addColor(-5, Color.RED);\n Particle.slopemap.addColor(0, Color.WHITE);\n Particle.slopemap.addColor(5, Color.GREEN);\n\n setFocusable(true);\n }", "public RobotContainer() {\n\nleftJoystick = new Joystick(0);\nrightJoystick = new Joystick(1);\n\ndriveBase = new DriveBase();\ndriveWithJoystick = new DriveWithJoystick();\nCommandScheduler.getInstance().setDefaultCommand(driveBase, driveWithJoystick);\n\n\n // Configure the button bindings\n configureButtonBindings();\n }" ]
[ "0.69840455", "0.69730765", "0.6949034", "0.69392926", "0.68090934", "0.6790249", "0.6781664", "0.6720752", "0.6701822", "0.6692148", "0.66838115", "0.6649389", "0.66404784", "0.6638239", "0.6601399", "0.6553962", "0.654265", "0.6489629", "0.64819735", "0.6470105", "0.64615476", "0.6441654", "0.642194", "0.6418012", "0.63979", "0.6392661", "0.637352", "0.63637406", "0.6333669", "0.63189405", "0.6288153", "0.628725", "0.6276371", "0.62755007", "0.6271741", "0.62710387", "0.6228255", "0.62148315", "0.6193718", "0.61917096", "0.6173836", "0.61672", "0.61609155", "0.6160033", "0.61588216", "0.6156339", "0.6140613", "0.6138466", "0.61322147", "0.6128847", "0.6124372", "0.6122999", "0.6119905", "0.6115551", "0.6108074", "0.60902137", "0.6088925", "0.60828346", "0.60784453", "0.60749", "0.60696954", "0.6065497", "0.60602134", "0.6059222", "0.6054208", "0.60513055", "0.60500383", "0.60408133", "0.6038461", "0.6025497", "0.60190564", "0.6017104", "0.60085195", "0.60050815", "0.60048586", "0.598438", "0.5979959", "0.5976718", "0.5973132", "0.59725124", "0.5968417", "0.596823", "0.5962619", "0.5950769", "0.5943516", "0.5943335", "0.5941252", "0.59397024", "0.5938915", "0.5937823", "0.59344137", "0.592887", "0.592567", "0.59235364", "0.5913059", "0.59109867", "0.59062546", "0.5904653", "0.5902739", "0.5891177", "0.5879606" ]
0.0
-1
Returns true if the game mode is in enhanced mode, and returns false otherwise
public boolean isEnhancedMode() { return enhanced; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isEngineOn();", "boolean hasMode();", "@Override\n public boolean isStealthActive() {\n // Try to find a Mek Stealth system.\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_STEALTH)) {\n\n if (mEquip.curMode().equals(\"On\") && hasActiveECM() && !Compute.isAffectedByECCM(this, getPosition(), getPosition())) {\n // Return true if the mode is \"On\" and ECM is working\n // and we're not in ECCM\n return true;\n }\n }\n }\n // No Mek Stealth or system inactive. Return false.\n return false;\n }", "public boolean needEnableExposureAdjustment() {\n boolean z = true;\n if (CustomUtil.getInstance().getBoolean(CustomFields.DEF_CAMERA_ENABLE_COMPENSATION_OTHER_THAN_AUTO, true)) {\n return true;\n }\n if (this.mSceneMode != SceneMode.AUTO || Keys.isLowlightOn(this.mAppController.getSettingsManager())) {\n z = false;\n }\n return z;\n }", "protected boolean isAIEnabled()\n {\n return true;\n }", "public boolean enabled() {\r\n\t\treturn engaged;\r\n\t}", "@Override\n public boolean isStealthOn() {\n // Try to find a Mek Stealth system.\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_STEALTH)) {\n if (mEquip.curMode().equals(\"On\")) {\n // Return true if the mode is \"On\"\n return true;\n }\n }\n }\n // No Mek Stealth or system inactive. Return false.\n return false;\n }", "boolean isPlayableInGame();", "private boolean ModeCheck() {\n\t\treturn prefs.getBoolean(\"appmode\", false);\n\n\t}", "public boolean isAIEnabled() {\r\n\t\treturn true;\r\n\t}", "public boolean extended() {\n // WRITE CODE BETWEEN THESE LINES -------------------------------------------------------- //\n // TODO: return the value of the m_extended flag.\n \n // ^^-----------------------------------------------------------------------------------^^ //\n return false;\n }", "private boolean m11885j() {\n IUser a = ((C3592a) C3596c.m13172a(C3592a.class)).user().mo22165a();\n if (!C9290a.f25466a && a != null && a.isEnableShowCommerceSale()) {\n if (this.f9687p == LiveMode.VIDEO) {\n return true;\n }\n LiveMode liveMode = this.f9687p;\n LiveMode liveMode2 = LiveMode.THIRD_PARTY;\n }\n return false;\n }", "private boolean isAdventureMode(EntityPlayer player) {\n\t\t/*if(player.worldObj.isRemote) {\n\t\t\treturn isAdventureMode_Client(player);\n\t\t}*/\n\t\t//return !player.worldObj.isRemote && ((EntityPlayerMP) player).theItemInWorldManager.getGameType().isAdventure();\n\t\treturn !(player instanceof FakePlayer) && !player.worldObj.isRemote && ((EntityPlayerMP) player).theItemInWorldManager.getGameType() != GameType.CREATIVE && !player.canCommandSenderUseCommand(2, \"cv\");\n\t}", "GameMode mode();", "public boolean canOfferInsurance() {\n\t\treturn this.hand.getCards().get(0) == Card.ACE;\n\t}", "public boolean isPistonACEngine () \n\t{\n\t\tObject oo = get_Value(COLUMNNAME_IsPistonACEngine);\n\t\tif (oo != null) \n\t\t{\n\t\t\t if (oo instanceof Boolean) \n\t\t\t\t return ((Boolean)oo).booleanValue(); \n\t\t\treturn \"Y\".equals(oo);\n\t\t}\n\t\treturn false;\n\t}", "private boolean canEnlist() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n || uiStateManager.getState().equals(GameUIState.STANDBY);\n }", "public boolean isAltMode() {\r\n return this.altMode;\r\n }", "public boolean isExtended() {\n return extended;\n }", "public static boolean UnityAdsGetDebugMode() {\n Log.d(\"Unity cocos2dx Sample\", \"[UnityAds Demo] UnityAdsGetDebugMode\");\n return UnityAds.getDebugMode();\n }", "public boolean isEnchanted() {\n return enchanted;\n }", "public boolean needEnableExposureAdjustment() {\n if (CustomUtil.getInstance().getBoolean(CustomFields.DEF_CAMERA_ENABLE_COMPENSATION_OTHER_THAN_AUTO, true)) {\n return true;\n }\n return false;\n }", "@Override\r\n\tpublic boolean isAggressive() {\n\t\treturn true;\r\n\t}", "public abstract boolean isLiveMode();", "private boolean canResumeGame() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n && isGamePaused();\n }", "public static boolean isVolteEnhancedConfCallSupport() {\n if (sEnableVolteConfForTest) {\n return true;\n } else {\n return MTK_ENHANCE_VOLTE_CONF_CALL && MTK_IMS_SUPPORT && MTK_VOLTE_SUPPORT;\n }\n }", "public void enableSurvivialMode()\n\t{\n\t\tthis.player.useFlyingMode = false;\n\t\tthis.player.setHealth(100f);\n\t}", "public boolean isAgressive() {\n\t\treturn aggressive;\n\t}", "@Override\n\tpublic boolean isAIEnabled() {\n\t\treturn true;\n\t}", "static boolean m61447d(Context context) {\n try {\n if (System.getInt(context.getContentResolver(), \"airplane_mode_on\", 0) != 0) {\n return true;\n }\n return false;\n } catch (NullPointerException unused) {\n return false;\n }\n }", "boolean hasEnabled();", "private boolean isDemoMode() {\r\n\t\treturn Boolean.valueOf(getSettingAsText(CONFIG_DEMO_MODE, Boolean.FALSE.toString()));\r\n\t}", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isGameSpedUp();", "public boolean isExtended() {\n return isExtended;\n }", "private boolean isSmartModeEnabled()\n {\n try\n {\n return Integer.parseInt((String) _smartModeComboBox.getSelectedItem()) > 0;\n }\n catch (NumberFormatException neverOccurs)\n {\n return false;\n }\n }", "public boolean getEnabled() {\r\n \t\tif (status == AlternativeStatus.ADOPTED) {\r\n \t\t\treturn true;\r\n \t\t} else {\r\n \t\t\treturn false;\r\n \t\t}\r\n \t}", "boolean getHardcoreEnabled();", "public boolean isOnFight();", "@Override\n public boolean isAiOn()\n {\n return aiIsOn;\n }", "public boolean isAwake();", "public boolean isEdible()\n {\n return this.aEdible;\n }", "public boolean isAGCEnabled()\n\t{\n\t\treturn mAGCEnabled.get();\n\t}", "public boolean areComponentsEnabled() {\n return itiefe.isEnabled();\n }", "private static boolean getState(Context context) {\n return Settings.System.getInt(context.getContentResolver(),\n Settings.System.AIRPLANE_MODE_ON, 0) == 1;\n }", "public boolean gameOver() \n {\n \treturn status() != GAME_NOT_OVER;\n }", "final public boolean isEnabled() {\n return enabledType!=ENABLED_NONE;\n }", "public final boolean updateState(GameStateEvent e) {\n if (e == null) {\n getUtils().log(Logger.Level.WARNING, this.getClass(), \"State update function was passed null\");\n return false;\n }\n switch (e) {\n case RESET:\n reset();\n gameState = GameState.LOBBY;\n return true;\n case INIT:\n if (gameState == GameState.LOBBY) {\n if (init()) {\n gameState = GameState.INITIATING;\n return true;\n }\n }\n return false;\n case START:\n if (gameState == GameState.INITIATING) {\n if (start()) {\n gameState = GameState.ACTIVE;\n return true;\n }\n }\n return false;\n case PAUSE:\n if (gameState == GameState.ACTIVE) {\n if (pause()) {\n gameState = GameState.PAUSED;\n return true;\n }\n }\n return false;\n case RESUME:\n if (gameState == GameState.PAUSED) {\n if (resume()) {\n gameState = GameState.ACTIVE;\n return true;\n }\n }\n return false;\n case END:\n if (gameState == GameState.ACTIVE) {\n if (end()) {\n gameState = GameState.ENDED;\n return true;\n }\n }\n return false;\n default:\n getUtils().log(Logger.Level.WARNING, this.getClass(), \"Invalid GameStateEvent passed to GameInstance #\" + gameID\n + \"\\nThis is probably a bug! Please report it to https://github.com/uhcmanager/uhcautomation\");\n return false;\n }\n }", "public boolean isMode() {\n return mode;\n }", "public abstract boolean isEdible();", "public boolean isHardcoreModeEnabled()\n {\n return hardcore;\n }", "private void IsAbleToGebruikEigenschap() throws RemoteException {\n boolean eigenschapGebruikt = speler.EigenschapGebruikt();\n if (eigenschapGebruikt == true) {\n gebruikEigenschap.setDisable(true);\n }\n }", "public boolean checkEngineStatus(){\r\n return isEngineRunning;\r\n }", "private boolean canViewOptions() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n || uiStateManager.getState().equals(GameUIState.STANDBY);\n }", "int getACMode();", "public boolean isOver() {\n \treturn status == GameStatus.victory || status == GameStatus.draw || status == GameStatus.quit;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isTurning();", "public boolean isExtendedScope() {\n return (flags & EXTENDEDSCOPE) != 0;\n }", "public String getGameMode() {\n return gameMode;\n }", "public boolean getEasterEgg() {\n\t\treturn easterEgg;\n\t}", "public boolean IsEnableOptionMenu() {\n if (this.f12125b.mo8885u()) {\n C2331d.m10114a((Activity) this, C2328a.ON_ERROR_NOW_PIC_CAPTURE, (Bundle) null);\n return false;\n } else if (!this.f12125b.mo8871g()) {\n return false;\n } else {\n if (!((Boolean) this.f12125b.f12207ad.mo3217b()).booleanValue()) {\n return false;\n }\n if (!C2274o.m9889M(this.f12125b.mo8842J()) && !C2274o.m9890N(this.f12125b.mo8842J())) {\n return true;\n }\n C2331d.m10114a((Activity) this, C2328a.ON_CANNOT_CHANGE_SETUP, (Bundle) null);\n return false;\n }\n }", "public boolean isEnabled() {\n\t\treturn true;\n\t}", "public boolean affordCard() {\n \t\treturn (FREE_BUILD || getResources(Type.WOOL) >= 1\n \t\t\t\t&& getResources(Type.GRAIN) >= 1 && getResources(Type.ORE) >= 1);\n \t}", "public boolean AssetIDEnable() {\r\n\t\t// return IsElementEnabledStatus(DefineSetup_AssetID_txtBx);\r\n\t\t// DefineSetup_AssetID_txtBx.isDisplayed();\r\n\t\t// return DefineSetup_AssetID_txtBx.isDisplayed();\r\n\t\treturn IsElementEnabledStatus(DefineSetup_AssetID_txtBx);\r\n\t}", "boolean updateEnabling();", "public boolean isEnabled() {\n return mBundle.getBoolean(KEY_ENABLED, true);\n }", "public boolean isEnderChest() {\n return this.type == Type.ENDERCHEST;\n }", "public boolean avengersAlive() {\n\t\tif (avengersHp <= 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean isForcedAppStandbyEnabled() {\n return AppStateTracker.this.injectGetGlobalSettingInt(\"forced_app_standby_enabled\", 1) == 1;\n }", "public boolean isFacebeautyEnabled() {\n return false;\n }", "@DISPID(37)\r\n\t// = 0x25. The runtime will prefer the VTID if present\r\n\t@VTID(42)\r\n\tboolean enabled();", "public static boolean isEnabled() {\n return true;\n }", "protected boolean hasGameStarted() {\r\n return super.hasGameStarted();\r\n }", "public boolean isOn() throws Exception;", "boolean isGameComplete();", "public boolean getVisualizerOn()\n {\n DsLog.log1(LOG_TAG, \"getVisualizerOn\");\n boolean enabled = false;\n int count = 0;\n\n //\n // Send EFFECT_CMD_GET_PARAM\n // EFFECT_PARAM_VISUALIZER_ENABLE\n //\n byte[] baValue = new byte[4];\n count = getParameter(EFFECT_PARAM_VISUALIZER_ENABLE, baValue);\n if (count != 4)\n {\n Log.e(LOG_TAG, \"getVisualizerOn: Error in getting the visualizer on/off state!\");\n }\n else\n {\n int on = byteArrayToInt32(baValue);\n enabled = (on == DsAkSettings.AK_DS1_FEATURE_ON) ? true : false;\n }\n\n return enabled;\n }", "public boolean isEndGameDelay() {\n\t\treturn endGameDelay;\n\t}", "public char getGameMode() {\n return gameMode;\n }", "public boolean isElected(){\n\treturn (synState == SynCT.IAM_THE_CENTER);\n }", "public boolean isGameOver(){\n if( character.getHp() <= 0 ){\n System.out.println(\"GAME IS OVER BECAUSE CHARACTER DEAD\");\n return true;\n }\n for (int i = 0 ; i < enemies.size() ; i++)\n {\n if(!enemies.get(i).isDead()){\n System.out.println(\"NOT ALL ENEMIES DEAD\");\n return false;\n }\n }\n if( !isGameOver ){\n endGame();\n isGameOver = true;\n }\n System.out.println(\"GAME IS OVER BECAUSE ALL ENEMIES ARE DEAD\");\n return true;\n }", "public boolean validInCreativeMode();", "public boolean gameOver()\n {\n return checkmate()||draw()!=NOT_DRAW;\n }", "@DISPID(79)\r\n\t// = 0x4f. The runtime will prefer the VTID if present\r\n\t@VTID(77)\r\n\tboolean enabled();", "public boolean gameWon(){\n return false;\n }", "public boolean isGameWon(){\r\n for(Card c: this.cards){\r\n if (c.getFace() == false){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public boolean isEnabledByEmulator() {\n return mEnabledByEmulator;\n }", "@Override\n public boolean isAIEnabled() {\n return false;\n }", "private boolean askCustom(){\n String title = \"Custom mode?\";\n String message = \"Now the game mode is classical mode. \\nDo you wish to play custom pieces?\";\n ConfirmBox.display(title, message);\n return ConfirmBox.isConfirmed;\n }", "public abstract boolean gameIsOver();", "public int getMode()\r\n { \r\n return this.mode; // used at the beginning to check if the game has started yet\r\n }", "public void setInGame() {\n this.inGame = true;\n }", "public boolean isTestMode() {\n return testMode;\n }", "public boolean hasExtendedRetractableBlade() {\n for (Mounted m : getEquipment()) {\n if (!m.isInoperable() && (m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_CLUB) && m.getType().hasSubType(MiscType.S_RETRACTABLE_BLADE) && m.curMode().equals(\"extended\")) {\n return true;\n }\n }\n return false;\n }" ]
[ "0.6743145", "0.6635975", "0.6464843", "0.6394729", "0.63934815", "0.63350284", "0.62904197", "0.62591755", "0.6240603", "0.62298775", "0.6206427", "0.6132987", "0.6123108", "0.60638654", "0.59783524", "0.59738314", "0.59518474", "0.5947822", "0.59356904", "0.59353656", "0.5931605", "0.5910017", "0.5841264", "0.58247894", "0.5807723", "0.5804791", "0.5793472", "0.5787665", "0.57855517", "0.5783204", "0.577322", "0.5766171", "0.5761554", "0.5761554", "0.5761554", "0.5761554", "0.5761554", "0.5761554", "0.5761554", "0.5761554", "0.57526547", "0.57488865", "0.57468057", "0.5733251", "0.57307875", "0.5711328", "0.5709934", "0.57074684", "0.56966484", "0.56905323", "0.5677538", "0.56617653", "0.56605464", "0.5639244", "0.56386995", "0.5632702", "0.5632461", "0.5631688", "0.5626392", "0.56258357", "0.56244695", "0.560826", "0.5604142", "0.560369", "0.5595987", "0.5593771", "0.558965", "0.5585705", "0.55769795", "0.55693233", "0.55671704", "0.55652434", "0.5563341", "0.5551038", "0.5548778", "0.5547691", "0.55381835", "0.5535331", "0.55340004", "0.55330986", "0.55318135", "0.5529017", "0.55264294", "0.55236685", "0.55098385", "0.55085677", "0.55014014", "0.5500848", "0.5500484", "0.5487335", "0.54830384", "0.5478264", "0.54779345", "0.54737496", "0.54735667", "0.5465999", "0.5458047", "0.5455703", "0.5455354", "0.545045" ]
0.7908754
0
Returns the ship, or null if there isn't one
public Ship getShip() { return ship; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Spaceship getTheSpaceship() {\n\t\tfor(GameObject object : gameObject)\n\t\t\tif(object instanceof Spaceship)\n\t\t\t\treturn (Spaceship) object;\n\t\treturn null;\n\t}", "public Ship loadShip() {\n DbResponse d = db.select(DbTables.SHIP);\n Ship ship = null;\n\n try {\n if (d.r != null) {\n ResultSet rs = d.r;\n ship = new Ship(ShipType.values()[rs.getInt(\"ship_type\")], rs.getInt(\"fuel\"));\n ship.setWeaponSlots(rs.getInt(\"weapon\"));\n ship.setGadgetSlots(rs.getInt(\"gadget\"));\n ship.setShieldSlots(rs.getInt(\"shield\"));\n d.r.close();\n d.s.close();\n d.c.close();\n }\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n return null;\n }\n\n return ship;\n }", "public Ship getShip()\n {\n return ship;\n }", "public Ship getShip (){\n \treturn this.ship;\n }", "private Ship findUnpilotedShip() {\r\n\t\tfor (Ship ship : ships) {\r\n\t\t\tif (ship.getPilot() == null) {\r\n\t\t\t\t// ship has no pilot, so pass it back\r\n\t\t\t\treturn ship;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// no unpiloted ships present\r\n\t\treturn null;\r\n\t}", "public Ship getShip(){\n return this.ship;\n }", "private Ship getShip(Board board, int x, int y) {\r\n\t\tfor(Ship ship:board.ships) {\r\n\t\t\tif(ship.contains(x,y)) {\r\n\t\t\t\treturn ship;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Ship getShipAt(int row, int col) {\n\t\tfor (Ship s : ships) {\n\t\t\tif (s.isHit(row, col)) {\n\t\t\t\treturn s;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private Ship findWhichShip(Point p) {\n int row, col;\n for (Ship s : ships) {\n for (int i = 0; i < s.getShipSize(); i++) {\n row = s.getBodyLocationPoints()[i].x;\n col = s.getBodyLocationPoints()[i].y;\n if (row == p.x && col == p.y) {\n //Point head = s.getHeadCoordinatePoint();\n //touchingView = ivCell[head.x][head.y];\n Log.i(\"VIEW FOUND: \", \"!!!!!!!!!!!!!!!!\");\n return s;\n }\n }\n }\n return null;\n }", "public String getShipName() {\n return shipName;\n }", "public ReturnShipping getShipping() {\n return (ReturnShipping) get(\"shipping\");\n }", "@Override\r\n\tSpaceship getShip() {\n\t\treturn new MotherShip(getWidth()/2, getHeight());\r\n\t}", "public LiveData<ShipWithContainer> getShip() {\n return mObservableShip;\n }", "public com.jspgou.cms.entity.Shipping getShipping () {\r\n\t\treturn shipping;\r\n\t}", "ShippingPointStructure getShipTo();", "public String getSpaceshipNmae() {\n\t\treturn shipName;\n\t}", "private Ship pickNearestEnemyShip(Toroidal2DPhysics space, Ship ship) {\n\t\tdouble minDistance = Double.POSITIVE_INFINITY;\n\t\tShip nearestShip = null;\n\t\tfor (Ship otherShip : space.getShips()) {\n\t\t\t// don't aim for our own team (or ourself)\n\t\t\tif (otherShip.getTeamName().equals(ship.getTeamName())) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tdouble distance = space.findShortestDistance(ship.getPosition(), otherShip.getPosition());\n\t\t\tif (distance < minDistance) {\n\t\t\t\tminDistance = distance;\n\t\t\t\tnearestShip = otherShip;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn nearestShip;\n\t}", "public Integer getShip_address() {\n return ship_address;\n }", "ShippingPointStructure getShipFrom();", "public java.lang.String getShipName() {\n\t\treturn _tempNoTiceShipMessage.getShipName();\n\t}", "public Boolean getShipStatus() {\n return shipStatus;\n }", "public List<Ship> getShips()\n {\n return this.fleet;\n }", "public synchronized Ship allocatePilot() {\r\n\t\twhile (findUnpilotedShip() == null) {\r\n\t\t\t// no ships are in the arrival zone without a pilot\r\n\t\t\ttry {\r\n\t\t\t\twait();\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn findUnpilotedShip();\r\n\t}", "public Ship getBase() {\n return base;\n }", "public char getShipID() {\n\t\treturn shipIdentifier;\n\t}", "public java.lang.String getShipCaptain() {\n\t\treturn _tempNoTiceShipMessage.getShipCaptain();\n\t}", "public Ship get(int index) {\n\t\tif ((index < 0) || (index > ships.size() - 1)) {\n\t\t\tthrow new ArrayIndexOutOfBoundsException(\"Index out of Bounds.\");\n\t\t}\n\t\treturn ships.get(index);\n\n\t}", "@Override\r\n\tString getShipType() {\r\n\t\treturn \"empty\"; \r\n\t}", "public vrealm_350275.Buyer.Ariba.ERPOrder_PurchOrdSplitDetailsLineItemsItemShipTo getShipTo() {\n return shipTo;\n }", "@Override\r\n\tpublic String getShipType() {\r\n\t\t\r\n\t\treturn (EmptySea.name);\r\n\t}", "private Base findNearestBase(Toroidal2DPhysics space, Ship ship) {\n\t\tdouble minDistance = Double.MAX_VALUE;\n\t\tBase nearestBase = null;\n\n\t\tfor (Base base : space.getBases()) {\n\t\t\tif (base.getTeamName().equalsIgnoreCase(ship.getTeamName())) {\n\t\t\t\tdouble dist = space.findShortestDistance(ship.getPosition(), base.getPosition());\n\t\t\t\tif (dist < minDistance) {\n\t\t\t\t\tminDistance = dist;\n\t\t\t\t\tnearestBase = base;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nearestBase;\n\t}", "public Ship[] getShips() {\n return ships;\n }", "public ShipSystem getSystem() {\n return system;\n }", "@POST(\"/GetShipByID\")\n\tShip getShipByID(@Body FindShipParams params) throws ShipNotFoundException;", "public org.landxml.schema.landXML11.Station xgetRoadwayPI()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.Station target = null;\r\n target = (org.landxml.schema.landXML11.Station)get_store().find_attribute_user(ROADWAYPI$18);\r\n return target;\r\n }\r\n }", "public SpaceShipValet access(String license) \n\t{\n\t\tint index = license.hashCode() % chainedPortList.length; //Find the index based on the hashCode based on the first letter of the license\n\t\tif(index < 0)\n\t\t\tindex += chainedPortList.length;\n\t\tif(chainedPortList[index] == null)\n\t\t\treturn null;\n\t\tfor(SpacePort<String, SpaceShipValet> nextShip : chainedPortList[index]) //Go through the entire SpacePort\n\t\t{\n\t\t\tif(nextShip.license.equals(license))//See if there is already a slot with a ship\n\t\t\t\treturn nextShip.ship;\n\t\t}\n\t\treturn null;\n\t}", "public Ship newShip(GameScreen screen){\n\t\tthis.ship = new Ship(screen);\n\t\treturn ship;\n\t}", "public String getShipDate() {\n\t\t\treturn shipDate;\n\t\t}", "@Override\r\n\tpublic Shipper getById(int id) {\n\t\t\r\n\t\treturn shipperDao.getById(id);\r\n\t}", "public Date getShipDate() {\n return _shipDate;\n }", "public Ship[][] getShipArray(){\n return ships;\n }", "public Spot getSpot(int x, int y) {\n if (! areValidCoordinates(x, y)) {\n return null;\n } else {\n return board[x][y];\n }\n }", "private Warship getWarship(String info) {\n\t\tString[] infos = info.split(\" \");\n\t\treturn new Warship(Long.parseLong(infos[0]), infos[1], Integer.parseInt(infos[2]), infos[3], Double.parseDouble(infos[4]), Integer.parseInt(infos[5]));\n\t}", "public Cost getBuildShipCost() {\n\t\treturn new Cost(buildShipCost);\n\t}", "public int getShipType(Point xy) {\r\n\t\treturn shipTypeMap.get(xy);\r\n\t}", "Shipment_Package getShipment_Package();", "public void setShip (Ship s){\n \tthis.ship=s;\n }", "public Ship[][] getPlayerShips() {\n \treturn playerShips;\n }", "public ArrayList<Ship> getShipsOnBoard(){\n return ships;\n }", "public boolean hasShip(int row, int column) {\n\t\treturn this.grid[row][column].hasShip();\n\t}", "@Override\n public String toString() {\n return \"Ship\";\n }", "public Spaceship getSpaceshipByName(String name) throws SQLException {\r\n connection();\r\n Spaceship spaceship = new Spaceship(name);\r\n String select = \"select * from spaceship where name='\" + name + \"'\";\r\n Statement st = conexion.createStatement();\r\n ResultSet rs = st.executeQuery(select);\r\n spaceship = new Spaceship();\r\n if (rs.next()) {\r\n spaceship.setName(rs.getString(\"name\"));\r\n spaceship.setCapacity(rs.getInt(\"capacity\"));\r\n spaceship.setStatus(ToolsApp.converStringToSpaceshipsStatus(rs.getString(\"status\")));\r\n spaceship.setFlightNumbers(rs.getInt(\"numflights\"));\r\n }\r\n rs.close();\r\n st.close();\r\n disconnect();\r\n return spaceship;\r\n }", "@Override\n\tpublic long getId() {\n\t\treturn _dmGTShipPosition.getId();\n\t}", "private static String placeShip(Request req) {\n BattleshipModel currentModel = getModelFromReq(req);\n\n int rows = Integer.parseInt(req.params(row));\n int col = Integer.parseInt(req.params(col));\n\n BattleshipModel placeModel = getModelFromReq(req);\n\n\n\n return \"SHIP\";\n }", "public boolean addShip(Ships ship) {\n\t\tfor (int i = 0; i < this.aliveShips.length; i++) {\r\n\t\t\tif (this.aliveShips[i] == null) {\r\n\t\t\t\tthis.aliveShips[i] = ship;\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 int getShipLength() {\n return shipLength;\n }", "public int getSpeed() {return ship.getSpeed();}", "public void putShip(Ship ship) throws OverlapException{\r\n if(this.ship == null){\r\n this.ship = ship;\r\n }else{\r\n throw new OverlapException(row, column);\r\n }\r\n }", "public int getSize(){\n\t\treturn shipSize;\n\t}", "public String getShippingId() {\n return shippingId;\n }", "public byte getShipType() {\n\n return (byte)((m_shipType + 1) % 9);\n }", "private void placeShip() {\r\n\t\t// Expire the ship ship\r\n\t\tParticipant.expire(ship);\r\n\r\n\t\tclipShip.stop();\r\n\r\n\t\t// Create a new ship\r\n\t\tship = new Ship(SIZE / 2, SIZE / 2, -Math.PI / 2, this);\r\n\t\taddParticipant(ship);\r\n\t\tdisplay.setLegend(\"\");\r\n\t}", "public int getShipHealth()\r\n\t{\r\n\t\treturn ShipHealth;\r\n\t}", "public String getVesselName()\n\t{\n\t\treturn this.ship;\n\t}", "public boolean atSpaceship()\r\n\t{\r\n\t\treturn this.currentPlace.isSpaceship();\r\n\t}", "public int checkScreenedShip(Spaceship aShip){\n\t \r\n\t \r\n\t int found = -1;\r\n\t for (int i = 0; i < screenedShips.size(); i++){\r\n\t if (aShip.getId() == screenedShips.get(i)){\r\n\t found = i;\r\n\t }\r\n\t }\r\n\t \r\n\t return found;\r\n\t }", "@POST(\"/UpdateShip\")\n\tShip updateShip(@Body Ship ship,@Body int id) throws GameNotFoundException;", "public List<Spaceship> getShipAtPlanetNextTurn(Player aPlayer, Planet aPlanet){\r\n\t\tList<Spaceship> tempShipList = aPlayer.getGalaxy().getPlayersSpaceshipsOnPlanet(aPlayer, aPlanet);\r\n\t\tList<ShipMovement> shipMovemants = getShipMoves();\r\n\t\tfor (ShipMovement shipMovement : shipMovemants) {\r\n\t\t\tif(shipMovement.getDestinationName().equalsIgnoreCase(aPlanet.getName())){// adding ships with travel ordes against the planet.\r\n\t\t\t\tSpaceship tempShip = aPlayer.getGalaxy().findSpaceship(shipMovement.getSpaceShipID());\r\n\t\t\t\tif(!tempShipList.contains(tempShip)){\r\n\t\t\t\t\ttempShipList.add(tempShip);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(tempShip.isCarrier()){\r\n\t\t\t\t\tList<ShipToCarrierMovement> SqdToCarrierMovementList = getShipToCarrierMoves();\r\n\t\t\t\t\tfor (ShipToCarrierMovement shipToCarrierMovement : SqdToCarrierMovementList) {\r\n\t\t\t\t\t\tif(shipToCarrierMovement.getDestinationCarrierId() == tempShip.getId()){\r\n\t\t\t\t\t\t\ttempShipList.add(aPlayer.getGalaxy().findSpaceship(shipToCarrierMovement.getSpaceshipId()));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tList<Spaceship> shipListAtCarrierPlanet = aPlayer.getGalaxy().getPlayersSpaceshipsOnPlanet(aPlayer, tempShip.getLocation());\r\n\t\t\t\t\tfor (Spaceship spaceship : shipListAtCarrierPlanet) {\r\n\t\t\t\t\t\tif(spaceship.getCarrierLocation() == tempShip){\r\n\t\t\t\t\t\t\tboolean add = true;\r\n\t\t\t\t\t\t\tfor (ShipMovement shipMove : shipMovemants) {\r\n\t\t\t\t\t\t\t\tif(shipMove.getSpaceShipID() == spaceship.getId()){\r\n\t\t\t\t\t\t\t\t\tadd = false;\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\tif(add){\r\n\t\t\t\t\t\t\t\ttempShipList.add(spaceship);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tSpaceship tempSpaceship = aPlayer.getGalaxy().findSpaceship(shipMovement.getSpaceShipID());\r\n\t\t\t\tif(tempSpaceship.getLocation() != null && tempSpaceship.getLocation() == aPlanet){// removing ships on the planet with move orders\r\n\t\t\t\t\ttempShipList.remove(tempSpaceship);\r\n\t\t\t\t\tif(tempSpaceship.isCarrier()){\r\n\t\t\t\t\t\tList<Spaceship> removeShips = new ArrayList<Spaceship>();\r\n\t\t\t\t\t\tfor (Spaceship tempShip : tempShipList) {\r\n\t\t\t\t\t\t\tif(tempShip.isSquadron()){\r\n\t\t\t\t\t\t\t\tList<ShipToCarrierMovement> SqdToCarrierMovementList = getShipToCarrierMoves();\r\n\t\t\t\t\t\t\t\tfor (ShipToCarrierMovement shipToCarrierMovement : SqdToCarrierMovementList) {\r\n\t\t\t\t\t\t\t\t\tif(shipToCarrierMovement.getDestinationCarrierId() == tempSpaceship.getId()){\r\n\t\t\t\t\t\t\t\t\t\tremoveShips.add(tempShip);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(tempShip.getCarrierLocation() == tempSpaceship){\r\n\t\t\t\t\t\t\t\t\tboolean add = true;\r\n\t\t\t\t\t\t\t\t\tfor (ShipMovement shipMove : shipMovemants) {\r\n\t\t\t\t\t\t\t\t\t\tif(shipMove.getSpaceShipID() == tempShip.getId()){\r\n\t\t\t\t\t\t\t\t\t\t\tadd = false;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif(add){\r\n\t\t\t\t\t\t\t\t\t\tremoveShips.add(tempShip);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttempShipList.removeAll(removeShips);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn tempShipList;\r\n\t}", "public GameObject getObstacle() {\n \tif (selection != null) {\n \tjava.lang.Object data = selection.getBody().getUserData();\n \ttry {\n \t\treturn (GameObject)data;\n \t} catch (Exception e) {\n \t}\n }\n return null;\n }", "@Override\n\tpublic JFrame getFrame() {\n\t\treturn this.frmShip;\n\t}", "public GetShipmentResponse getShipment(GetShipmentRequest request) \n throws MWSMerchantFulfillmentServiceException {\n return newResponse(GetShipmentResponse.class);\n }", "public java.lang.String getShipTypeCode() {\n\t\treturn _tempNoTiceShipMessage.getShipTypeCode();\n\t}", "public List<Coordinate> getShipPositions() {\n\t\treturn shipPositions;\n\t}", "public String getShipmentCode() {\n return shipmentCode;\n }", "public byte getShipTypeRaw() {\n return m_shipType;\n }", "@Transactional(readOnly = true) \n public Shipping findOne(Long id) {\n log.debug(\"Request to get Shipping : {}\", id);\n Shipping shipping = shippingRepository.findOne(id);\n return shipping;\n }", "public final Optional<Tile> getTile(final GridPoint2D tilePoint) {\n\t if ((tilePoint.getRow() >= 0) && \n\t (tilePoint.getRow() < mLayout.size()) &&\n\t (tilePoint.getColumn() >= 0) && \n\t (tilePoint.getColumn() < mLayout.get(tilePoint.getRow()).size())) {\n\t return Optional.<Tile>of(mLayout.get(tilePoint.getRow()).get(tilePoint.getColumn()));\n\t } \n\t // The indicated point was outside of the battlefield, so return a null\n\t else {\n\t return Optional.<Tile>absent();\n\t }\n\t}", "private Ship[] consoleGetShips(int player) {\n //Grid grid = new Grid();\n Ship[] ships = new Ship[5];\n System.out.println();\n System.out.println(\"You are player \" + player);\n System.out.println(\"Please place your ships.\");\n ships[0] = consoleGetAShip(ships, \"CARRIER\", 5);\n ships[1] = consoleGetAShip(ships, \"DESTROYER\", 4);\n ships[2] = consoleGetAShip(ships, \"BATTLESHIP\", 3);\n ships[3] = consoleGetAShip(ships, \"SUBMARINE\", 3);\n ships[4] = consoleGetAShip(ships, \"PT\", 2);\n return ships;\n }", "public interface Iship {\t\n\t\n//gunpoints, places where the cannons stick out of a model, cannot have more than 2?\t\n\tpublic static final int[] PLAYER_GUNPOINTS = {3,60};\n\tpublic static final int[] GUNSHIP_GUNPOINTS = {8, 40};\n\tpublic static final int[] SIDEWAYS_GUNPOINTS = {12, 36};\n\tpublic static final int[] ADVANCED_GUNPOINTS = {0};\n\tpublic static final int[] MOTHERSHIP_GUNPOINTS = {36, 190, 56, 168, 84, 140};\n\tpublic static final int[] SUIBOSS_GUNPOINTS = {10, 200, 145, 60};\n\t\n//bullet destruction vals\npublic static final int PLAYER_BULLET_VAL = 50;\n\n//ship score vals\npublic static final int SUICIDE_SCORE_VAL = 15;\npublic static final int SHOOTER_SCORE_VAL = 25;\npublic static final int SIDEWAYS_SCORE_VAL = 50;\n\n//health values:\npublic static final int PLAYER_MAX_HEALTH = 100;\n\n//standard collision health value\npublic static final int COLLISION_DAMAGE = 10;\npublic static final int BULLET_DAMAGE = 15;\n\n//enemy type ids \npublic static final int SUICIDE_ID = 0;\npublic static final int GUNSHIP_ID = 1;\n\n//enemy health\npublic static final int REGULAR_ENEM_HEALTH = 1;\npublic static final int ELEVATED_ENEM_HEALTH = 2;\n\n//speeds \npublic static final float SHIP_SPEED_NORMAL = 0.2f;\n\n//methods\n\t\n\tpublic int[] getGunpoints(); //returns gun-barrel pixels\n\tpublic int getHealth(); //gets health\n\tpublic void setHealth(int newHealth); //sets the health\n}", "public VRPBShipment getSelectShipment(VRPBDepotLinkedList currDepotLL,\r\n\t\t\tVRPBDepot currDepot,\r\n\t\t\tVRPBShipmentLinkedList currShipLL,\r\n\t\t\tVRPBShipment currShip) {\n\t\tboolean isDiagnostic = false;\r\n\t\t//VRPShipment temp = (VRPShipment) getHead(); //point to the first shipment\r\n\t\tVRPBShipment temp = (VRPBShipment)currShipLL.getVRPBHead().getNext(); //point to the first shipment\r\n\t\tVRPBShipment foundShipment = null; //the shipment found with the criteria\r\n\t\tdouble angle;\r\n\t\tdouble foundAngle = 360; //initial value\r\n\t\tdouble distance;\r\n\t\tdouble foundDistance = 200; //initial distance\r\n\t\tdouble depotX, depotY;\r\n\t\tint type = 2;\r\n\r\n\t\t//Get the X and Y coordinate of the depot\r\n\t\tdepotX = currDepot.getXCoord();\r\n\t\tdepotY = currDepot.getYCoord();\r\n\r\n\t\twhile (temp != currShipLL.getVRPBTail()) {\r\n\t\t\tif (isDiagnostic) {\r\n\t\t\t\tSystem.out.print(\"Shipment \" + temp.getIndex() + \" \");\r\n\r\n\t\t\t\tif ( ( (temp.getXCoord() - depotX) >= 0) &&\r\n\t\t\t\t\t\t( (temp.getYCoord() - depotX) >= 0)) {\r\n\t\t\t\t\tSystem.out.print(\"Quadrant I \");\r\n\t\t\t\t}\r\n\t\t\t\telse if ( ( (temp.getXCoord() - depotX) <= 0) &&\r\n\t\t\t\t\t\t( (temp.getYCoord() - depotY) >= 0)) {\r\n\t\t\t\t\tSystem.out.print(\"Quadrant II \");\r\n\t\t\t\t}\r\n\t\t\t\telse if ( ( (temp.getXCoord()) <= (0 - depotX)) &&\r\n\t\t\t\t\t\t( (temp.getYCoord() - depotY) <= 0)) {\r\n\t\t\t\t\tSystem.out.print(\"Quadrant III \");\r\n\t\t\t\t}\r\n\t\t\t\telse if ( ( (temp.getXCoord() - depotX) >= 0) &&\r\n\t\t\t\t\t\t( (temp.getYCoord() - depotY) <= 0)) {\r\n\t\t\t\t\tSystem.out.print(\"Quadrant VI \");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.print(\"No Quadrant\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//if the shipment is assigned, skip it\r\n\t\t\tif (temp.getIsAssigned()) {\r\n\t\t\t\tif (isDiagnostic) {\r\n\t\t\t\t\tSystem.out.println(\"has been assigned\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttemp = (VRPBShipment) temp.getNext();\r\n\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tdistance = calcDist(depotX, temp.getXCoord(), depotY, temp.getYCoord());\r\n\t\t\tangle = calcPolarAngle(depotX, depotX, temp.getXCoord(),\r\n\t\t\t\t\ttemp.getYCoord());\r\n\r\n\t\t\tif (isDiagnostic) {\r\n\t\t\t\tSystem.out.println(\" \" + angle);\r\n\t\t\t}\r\n\r\n\t\t\t//check if this shipment should be tracked\r\n\t\t\tif (foundShipment == null) { //this is the first shipment being checked\r\n\t\t\t\tfoundShipment = temp;\r\n\t\t\t\tfoundAngle = angle;\r\n\t\t\t\tfoundDistance = distance;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//if angle and disnace are smaller than what had been found\r\n\t\t\t\t//if (angle <= foundAngle && distance <= foundDistance) {\r\n\t\t\t\tif (angle+ distance <= foundAngle + foundDistance) {\r\n\t\t\t\t\t//if ((angle*.90)+ (distance * 0.1) <= (foundAngle*0.9) + (foundDistance*0.1)) {\r\n\t\t\t\t\tfoundShipment = temp;\r\n\t\t\t\t\tfoundAngle = angle;\r\n\t\t\t\t\tfoundDistance = distance;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttemp = (VRPBShipment) temp.getNext();\r\n\t\t}\r\n\t\treturn foundShipment; //stub\r\n\t}", "public String getShipMode() {\n return (String)getAttributeInternal(SHIPMODE);\n }", "private Beacon pickNearestBeacon(Toroidal2DPhysics space, Ship ship) {\n\t\t// get the current beacons\n\t\tSet<Beacon> beacons = space.getBeacons();\n\n\t\tBeacon closestBeacon = null;\n\t\tdouble bestDistance = Double.POSITIVE_INFINITY;\n\n\t\tfor (Beacon beacon : beacons) {\n\t\t\tdouble dist = space.findShortestDistance(ship.getPosition(), beacon.getPosition());\n\t\t\tif (dist < bestDistance) {\n\t\t\t\tbestDistance = dist;\n\t\t\t\tclosestBeacon = beacon;\n\t\t\t}\n\t\t}\n\n\t\treturn closestBeacon;\n\t}", "public String getShipping(){\n return this.post.getType();\n }", "public boolean isSpaceship();", "@POST(\"/AddShip\")\n\tint addShip(@Body Ship ship,@Body int id) throws GameNotFoundException;", "Optional<ShipmentInfoPODDTO> findOne(Long id);", "public boolean is_Empty(){\n \treturn this.ship==null;\n }", "public java.lang.String getShipAgencyPhone() {\n\t\treturn _tempNoTiceShipMessage.getShipAgencyPhone();\n\t}", "public boolean placeShip(int player, int x, int y) {\n\n Ship ship = null;\n\n for (int i = 0; i < 5; i++) {\n if (playerShips[i].selected) {\n ship = playerShips[i];\n }\n }\n if (ship == null) {\n return false;\n }\n\n if (orientation == 1) {\n if (ship.length + y > 10) {\n return false;\n }\n }\n if (orientation == 0) {\n if (ship.length + x > 10) {\n return false;\n }\n }\n for (int i = 0; i < ship.length; i++) {\n if(orientation == 0) {\n if (humanPlayerBoard[y][x+i] != board.water.ordinal()) {\n return false;\n }\n }\n else{\n if(humanPlayerBoard[y+i][x] != board.water.ordinal()){\n return false;\n }\n }\n }\n for (int i = 0; i < ship.length; i++) {\n if(orientation == 0) {\n humanPlayerBoard[y][x+i] = board.ship.ordinal();\n }\n else{\n humanPlayerBoard[y+i][x] = board.ship.ordinal();\n }\n }\n if(ship.placed){\n if(ship.orientation == 1){\n for(int i = 0; i < ship.length; i++){\n humanPlayerBoard[ship.y+i][ship.x] = board.water.ordinal();\n }\n }\n else{\n for(int j = 0; j < ship.length; j++){\n humanPlayerBoard[ship.y][ship.x+j] = board.water.ordinal();\n }\n }\n }\n ship.setShip(x, y, orientation);\n ship.placed = true;\n\n return true;\n }", "@Override\n public String toString() {\n return \"Ship X:\" + position.x\n + \"\\nShip Y:\" + position.y;\n }", "public Tile getTile()\r\n\t{\r\n\t\tif(this.hasTiles())\r\n\t\t\treturn _tiles.remove(0);\r\n\t\telse\r\n\t\t\treturn null;\r\n\t}", "private static String placeShip(Request req) {\n\n if( req.params(\"Version\").equals(\"Updated\") ) {\n\n BattleshipModelUpdated model = (BattleshipModelUpdated) getModelFromReq( req );\n\n model.resetArrayUpdated( model );\n model = model.PlaceShip( model, req );\n model.resetArrayUpdated( model );\n\n Gson gson = new Gson();\n return gson.toJson( model );\n\n }else{\n\n BattleshipModelNormal model = (BattleshipModelNormal) getModelFromReq( req );\n\n model.resetArrayNormal( model );\n model = model.PlaceShip( model, req );\n model.resetArrayNormal( model );\n\n Gson gson = new Gson();\n return gson.toJson( model );\n\n }\n }", "@POST(\"/GetShipList\")\n\tCollection<Ship> getShipList(@Body int id) throws GameNotFoundException;", "public org.landxml.schema.landXML11.Station xgetIntersectRoadwayPI()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.Station target = null;\r\n target = (org.landxml.schema.landXML11.Station)get_store().find_attribute_user(INTERSECTROADWAYPI$22);\r\n return target;\r\n }\r\n }", "@Override\n\tpublic Address getShippingAddress() {\n\t\treturn (Address)map.get(SHIPPING_ADDRESS);\n\t}", "public Station getStationByPos(int x, int y)\r\n\t{\r\n\t\t\r\n\t\tfor(Line l : line)\r\n\t\t{\r\n\t\t\tint i = 0;\r\n\t\t\t\r\n\t\t\tfor(int j = 0 ; j < l.getNumberOfStation() ; j++)\r\n\t\t\t{\r\n\t\t\t\tStation tmp = l.returnStation(i);\r\n\t\t\t\t\r\n\t\t\t\tif(Math.abs(tmp.getPosX() - x) < 5 && Math.abs(tmp.getPosY() - y) < 5)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn tmp;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public boolean isShipTo() {\n\t\tObject oo = get_Value(\"IsShipTo\");\n\t\tif (oo != null) {\n\t\t\tif (oo instanceof Boolean)\n\t\t\t\treturn ((Boolean) oo).booleanValue();\n\t\t\treturn \"Y\".equals(oo);\n\t\t}\n\t\treturn false;\n\t}", "public java.lang.String getShipOwnerPhone() {\n\t\treturn _tempNoTiceShipMessage.getShipOwnerPhone();\n\t}", "public VRPBShipment getSelectShipment(VRPBDepotLinkedList currDepotLL,\r\n\t\t\tVRPBDepot currDepot,\r\n\t\t\tVRPBShipmentLinkedList currShipLL,\r\n\t\t\tVRPBShipment currShip) {\n\t\tboolean isDiagnostic = false;\r\n\t\t//VRPShipment temp = (VRPShipment) getHead(); //point to the first shipment\r\n\t\tVRPBShipment temp = (VRPBShipment) currShipLL.getVRPBHead().getNext(); //point to the first shipment\r\n\r\n\t\tVRPBShipment foundShipment = null; //the shipment found with the criteria\r\n\t\tdouble angle;\r\n\t\tdouble foundAngle = 360; //initial value\r\n\t\t//double distance;\r\n\t\t//double foundDistance = 200; //initial distance\r\n\t\tdouble depotX, depotY;\r\n\t\tint type = 2;\r\n\r\n\t\t//Get the X and Y coordinate of the depot\r\n\t\tdepotX = currDepot.getXCoord();\r\n\t\tdepotY = currDepot.getYCoord();\r\n\t\t\r\n\t\twhile (temp != currShipLL.getVRPBTail()) {\r\n\t\t\tSystem.out.println(temp.getCustomerType());\r\n\r\n\t\t\tif (isDiagnostic) {\r\n\t\t\t\tSystem.out.println(\"Temp is \"+temp);\r\n\t\t\t\tSystem.out.println(\"Tail is \"+getTail());\r\n\t\t\t\tSystem.out.print(\"Shipment \" + temp.getIndex() + \" \");\r\n\r\n\t\t\t\tif ( ( (temp.getXCoord() - depotX) >= 0) &&\r\n\t\t\t\t\t\t( (temp.getYCoord() - depotX) >= 0)) {\r\n\t\t\t\t\tSystem.out.print(\"Quadrant I \");\r\n\t\t\t\t}\r\n\t\t\t\telse if ( ( (temp.getXCoord() - depotX) <= 0) &&\r\n\t\t\t\t\t\t( (temp.getYCoord() - depotY) >= 0)) {\r\n\t\t\t\t\tSystem.out.print(\"Quadrant II \");\r\n\t\t\t\t}\r\n\t\t\t\telse if ( ( (temp.getXCoord()) <= (0 - depotX)) &&\r\n\t\t\t\t\t\t( (temp.getYCoord() - depotY) <= 0)) {\r\n\t\t\t\t\tSystem.out.print(\"Quadrant III \");\r\n\t\t\t\t}\r\n\t\t\t\telse if ( ( (temp.getXCoord() - depotX) >= 0) &&\r\n\t\t\t\t\t\t( (temp.getYCoord() - depotY) <= 0)) {\r\n\t\t\t\t\tSystem.out.print(\"Quadrant VI \");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.print(\"No Quadrant\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//if the shipment is assigned, skip it\r\n\t\t\tif (temp.getIsAssigned()) {\r\n\t\t\t\tif (isDiagnostic) {\r\n\t\t\t\t\tSystem.out.println(\"has been assigned\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttemp = (VRPBShipment) temp.getNext();\r\n\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tangle = calcPolarAngle(depotX, depotX, temp.getXCoord(),\r\n\t\t\t\t\ttemp.getYCoord());\r\n\r\n\t\t\tif (isDiagnostic) {\r\n\t\t\t\tSystem.out.println(\" \" + angle);\r\n\t\t\t}\r\n\r\n\t\t\t//check if this shipment should be tracked\r\n\t\t\tif (foundShipment == null) { //this is the first shipment being checked\r\n\t\t\t\tfoundShipment = temp;\r\n\t\t\t\tfoundAngle = angle;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (angle < foundAngle) { //found an angle that is less\r\n\t\t\t\t\tfoundShipment = temp;\r\n\t\t\t\t\tfoundAngle = angle;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttemp = (VRPBShipment) temp.getNext();\r\n\t\t}\r\n\t\treturn foundShipment; //stub\r\n\t}" ]
[ "0.77254945", "0.7723071", "0.7662856", "0.7512577", "0.7432063", "0.71256584", "0.7079235", "0.7025025", "0.68609196", "0.6760289", "0.6684411", "0.6621121", "0.64405304", "0.63989913", "0.63822865", "0.63653743", "0.6355992", "0.63391984", "0.6333068", "0.6304169", "0.62622905", "0.6218149", "0.6203774", "0.61870295", "0.61555046", "0.61241645", "0.6102306", "0.60889214", "0.60855377", "0.60773826", "0.6056589", "0.5998974", "0.5991621", "0.5967054", "0.59160066", "0.59086347", "0.58613616", "0.58480096", "0.5806569", "0.5775301", "0.57711816", "0.5757539", "0.572714", "0.5719356", "0.57133204", "0.5704591", "0.56949705", "0.56609744", "0.5649258", "0.56470674", "0.562985", "0.5617219", "0.56104815", "0.55992043", "0.55916804", "0.55770034", "0.5571951", "0.55705005", "0.5566986", "0.55553514", "0.5544342", "0.55441844", "0.5542131", "0.5537415", "0.55308354", "0.5529058", "0.55190814", "0.5514487", "0.54854244", "0.5482374", "0.54806334", "0.54735607", "0.54699224", "0.54669034", "0.54641825", "0.5458611", "0.54543996", "0.54516786", "0.54413956", "0.5437102", "0.5427375", "0.54234546", "0.5415736", "0.5394824", "0.5392975", "0.5391434", "0.5380964", "0.5379857", "0.5379582", "0.5372715", "0.53727007", "0.5369971", "0.53654736", "0.5363137", "0.535548", "0.5346282", "0.5345884", "0.53442293", "0.5341321" ]
0.781134
1
Configures the game screen to display the splash screen
private void splashScreen() { // Clear the screen, reset the level, and display the legend clear(); display.setLegend("Asteroids"); // Place four asteroids near the corners of the screen. placeAsteroids(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showSplashScreen() {\r\n\r\n JPanel content = (JPanel) getContentPane();\r\n content.setBackground(Color.white);\r\n\r\n // setting the window's properties\r\n \r\n int width = 700;\r\n int height = 438;\r\n Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();\r\n int x = (screen.width - width) / 2;\r\n int y = (screen.height - height) / 2;\r\n setBounds(x, y, width, height);\r\n\r\n // build the splash screen using an image \r\n \r\n JLabel gifImage = new JLabel(new ImageIcon(this.getClass().getResource(\"/splash.gif\")));\r\n content.add(gifImage, BorderLayout.CENTER);\r\n\r\n // display it\r\n setVisible(true);\r\n\r\n new resourceLoader().execute();\r\n }", "public ScreenSplash() {\n initComponents();\n this.setCursor(new Cursor(HAND_CURSOR));\n setBackground(new Color(0, 0, 0, 0));\n }", "public SplashScreen() {\r\n instance = this;\r\n\r\n width = 600;\r\n height = 600;\r\n\r\n icon = \"graphics/application/icon_96.png\";\r\n }", "private static void splashScreen() {\n\t\t\n\t\tString message = \"Welcome to JProject v\"+VERSION+\"\\nby Gabriel Skoropada\";\n\t\t\n\t\tJOptionPane.showMessageDialog(null, message, \"JProject v\"+VERSION, JOptionPane.NO_OPTION, null);\n\t\t\n\t}", "private void showSplashScreen() {\n splashDialog = new SplashScreenDialog(this);\n splashDialog.show();\n }", "protected void displaySplashScreen() {\n\t\t// Creates new thread to act as timer.\n\t\tThread logoTimer = new Thread() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\n\t\t\t\t\tint logoTimer = 0;\n\t\t\t\t\t// Pauses for SPLASH_TIME amount of time\n\t\t\t\t\twhile (logoTimer < SPLASH_TIME) {\n\t\t\t\t\t\tsleep(100);\n\t\t\t\t\t\tlogoTimer = logoTimer + 100;\n\t\t\t\t\t}\n\t\t\t\t\t// Calls the activity from manifest.xml\n\t\t\t\t\tIntent intent = new Intent(getApplicationContext(),\n\t\t\t\t\t\t\tMenuActivity.class);\n\t\t\t\t\tintent.putExtra(\"connect\", connect);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} finally {\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Starts the thread.\n\t\tlogoTimer.start();\n\t}", "@Override\n public void showSplash() {\n }", "public void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n\r\n // Do not display title bar, this makes the splash screen really full screen\r\n requestWindowFeature(Window.FEATURE_NO_TITLE);\r\n \r\n // Check if we need to display the splash screen. If no, go directly to the main intent\r\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\r\n boolean showscreen = prefs.getBoolean(\"showsplashscreen\", true);\r\n if (! showscreen) {\r\n \t gotoMainIntent();\r\n \t return;\r\n }\r\n \r\n\r\n // Set the layout\r\n setContentView(R.layout.splash);\r\n\r\n // This will run after a specified time (SPLASH_DISPLAY_LENGHT milliseconds)\r\n new Handler().postDelayed(new Runnable(){\r\n public void run() {\r\n \t gotoMainIntent();\r\n }\r\n }, SPLASH_DISPLAY_LENGHT);\r\n }", "private void SplashScreen() {\n// if (!mSettings.getBoolean(\"PlayedBefore\", false)) {\n// mSolitaireView.DisplaySplash();\n// }\n splas.setVisibility(View.VISIBLE);\n Handler h = new Handler(Looper.getMainLooper());\n h.postDelayed(new Runnable() {\n @Override\n public void run() {\n splas.setVisibility(View.GONE);\n }\n }, 3000);\n }", "public static void splashScreen() {\n System.out.println(printLine(\"-\",100));\n System.out.println(\"Welcome to KaviBase\"); // Display the string.\n System.out.println(\"Version \" + getVersion());\n System.out.println(getCopyright());\n System.out.println(\"\\nType \\\"help;\\\" to display supported commands.\");\n System.out.println(\"\\nEvery command should end with semicolon ;\");\n System.out.println(printLine(\"-\",100));\n }", "public frmSplashScreen() {\n initComponents();\n this.setLocationRelativeTo(null);\n timer.start();\n }", "private void showSplash ()\n {\n ResourceBundle resourceBundle = null;\n try\n {\n resourceBundle = ResourceBundle.getBundle(\"splash\", Locale.getDefault());\n }\n catch (MissingResourceException ignored)\n {\n System.out.println(\"Info: file splash.properties not found in resources root directory.\");\n }\n\n FXMLLoader fxmlLoader = new FXMLLoader();\n if (resourceBundle != null)\n {\n fxmlLoader.setResources(resourceBundle);\n }\n try\n {\n primaryStage.setScene(new Scene(fxmlLoader.load(getClass().getResourceAsStream(\"/splash.fxml\"))));\n primaryStage.initStyle(StageStyle.UNDECORATED);\n primaryStage.centerOnScreen();\n primaryStage.show();\n }\n catch (NullPointerException ignored)\n {\n System.out.println(\"Info: file splash.fxml not found in resources root directory.\");\n }\n catch (Exception ex)\n {\n ex.printStackTrace();\n }\n }", "public void launchMainScreen() {\n\t\tmainWindow = new MainGameScreen(this);\n\t}", "public static void splashScreen() {\n System.out.println(line(\"-\", 80));\n System.out.println(\"Welcome to DavisBaseLite\"); // Display the string.\n System.out.println(\"DavisBaseLite Version \" + getVersion());\n System.out.println(getCopyright());\n System.out.println(\"\\nType \\\"help;\\\" to display supported commands.\");\n System.out.println(line(\"-\", 80));\n }", "public Splash() {\n initComponents();\n }", "public Splash() {\n initComponents();\n }", "public void startSplashGameOver(){\r\n\t\t\r\n\t\tpanel[CurrentPanel].stop();\r\n\t\t\r\n\t\tDriver.panel[CurrentPanel].setVisible(false);\r\n\t\tgame.remove(panel[CurrentPanel] );\r\n\t\t\r\n\t\tCurrentPanel = 0;\r\n\t\t\r\n\t\t\r\n\t\tpanel[CurrentPanel] = new Splash(this);\r\n\t\t\r\n\t\tadd( panel[CurrentPanel] );\r\n\t\tpanel[CurrentPanel].setVisible(true);\r\n\t\tgame.setVisible(true);\r\n\t\t\r\n\t\tpanel[CurrentPanel].start();\r\n\t\t\r\n\t}", "protected void init() {\n splashImg = new Texture(\"splash.png\");\n }", "private void initializeSplashScreenCycle()\n\t{\n\t\t// desabilitando os botoes antes de iniciar a animacao da splash screen:\n\t\tUtilidades.Views.disableViews(this.arrViewsBloqueaveis);\n\n\t\tAnimation animLayoutSplitLogo = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.splash_move);\n\t\tAnimation animLayoutContent = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.splash_fade_in);\n\n\t\tanimLayoutContent.setAnimationListener(new AnimationListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void onAnimationStart(Animation animation)\n\t\t\t{\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onAnimationRepeat(Animation animation)\n\t\t\t{\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onAnimationEnd(Animation animation)\n\t\t\t{\n\t\t\t\t// rehabilitando os botoes depois de finalizar a animacao da splash screen:\n\t\t\t\tUtilidades.Views.enableViews(arrViewsBloqueaveis);\n\t\t\t}\n\t\t});\n\n\t\t((RelativeLayout) findViewById(R.id.layout_split_logo)).startAnimation(animLayoutSplitLogo);\n\t\t((RelativeLayout) findViewById(R.id.layout_content)).startAnimation(animLayoutContent);\n\t}", "public void initialGameScreen() {\n timer.stop();\n gameModel.setState(\"Game Screen\");\n currentScene = levelSetup.getGameScreen().getScene(gameScreenInitialEntrance);\n currentBoard = levelSetup.getGameScreen().getBoard();\n currentLevelScreen = levelSetup.getGameScreen();\n gameScreenInitialEntrance = (gameScreenInitialEntrance ? false : false);\n moveCharacter(mainWindow, currentScene, hero, currentBoard);\n }", "private void showSplash() {\n \t\tthis.splashInfoContainer.setVisibility( View.VISIBLE );\n \t}", "public void launchStartupScreen() {\n\t\tnew StartUpScreen(this);\n\t}", "@Override\n public void onStart() {\n super.onStart();\n waitForSplashAnimation(SPLASH_SCREEN_DELAY);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n makeActivityFullScreen();\n setContentView(R.layout.activity_splash);\n }", "@Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.splash);\n\n }", "protected void displayInitialScene() {\n stageManager.switchScene(FxmlView.SPLASH, StageStyle.UNDECORATED);\n }", "@Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_splash_screen);\n\n SharedPreferences sp = getSharedPreferences(FrozenBubble.PREFS_NAME,\n Context.MODE_PRIVATE);\n boolean showSplashScreen = sp.getBoolean(\"showSplashScreen\", true);\n if ( showSplashScreen )\n {\n SharedPreferences.Editor editor = sp.edit();\n editor.putBoolean(\"showSplashScreen\", false);\n editor.commit();\n }\n else\n {\n startFrozenBubble();\n return;\n }\n\n // thread for displaying the SplashScreen\n splashThread = new Thread()\n {\n @Override\n public void run()\n {\n try\n {\n synchronized(this)\n {\n //\n // TODO: The splash screen waits before launching\n // the game activity. Change this so that\n // the game activity is started immediately,\n // and notifies the splash screen activity\n // when it is done loading saved state data\n // and preferences, so the splash screen\n // functions as a distraction from game\n // loading latency.\n //\n //\n wait(_splashTime); //wait 3 seconds\n }\n } catch(InterruptedException e) {}\n finally\n {\n startFrozenBubble();\n }\n }\n };\n\n splashThread.start();\n }", "private void setupSplash() {\n \t\tthis.splashInfoContainer = (LinearLayout) this.findViewById( R.id.edit_gpsfilter_area_splash );\n \n \t\tTextView textView = (TextView) this.splashInfoContainer.findViewById( R.id.edit_gpsfilter_area_splash_text );\n \t\ttextView.setText( Html.fromHtml( this.getString( R.string.edit_gpsfilter_area_splash_text ) ) );\n \n \t\t// Define fade out animation.\n \t\tthis.splashFadeOut = new AlphaAnimation( 1.00f, 0.00f );\n \t\tthis.splashFadeOut.setDuration( SPLASH_FADE_DELAY );\n \t\tthis.splashFadeOut.setAnimationListener( new AnimationListener() {\n \t\t\tpublic void onAnimationStart( Animation animation ) {\n \t\t\t}\n \n \t\t\tpublic void onAnimationRepeat( Animation animation ) {\n \t\t\t}\n \n \t\t\tpublic void onAnimationEnd( Animation animation ) {\n \t\t\t\tsplashInfoContainer.setVisibility( View.GONE );\n \t\t\t}\n \t\t} );\n \n \t\t// Don't show if not new and we got polygon.\n \t\tif ( !this.isConsideredFresh() ) {\n \t\t\tthis.splashInfoContainer.setVisibility( View.GONE );\n \t\t}\n \t}", "@SuppressWarnings(\"unchecked\")\n\tpublic void initGui() {\n\t\tthis.viewportTexture = new DynamicTexture(256, 256);\n\t\tthis.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation(\"background\", this.viewportTexture);\n\t\tCalendar var1 = Calendar.getInstance();\n\t\tvar1.setTime(new Date());\n\n\t\tif (var1.get(2) + 1 == 11 && var1.get(5) == 9) {\n\t\t\tthis.splashText = \"Happy birthday, ez!\";\n\t\t} else if (var1.get(2) + 1 == 6 && var1.get(5) == 1) {\n\t\t\tthis.splashText = \"Happy birthday, Notch!\";\n\t\t} else if (var1.get(2) + 1 == 12 && var1.get(5) == 24) {\n\t\t\tthis.splashText = \"Merry X-mas!\";\n\t\t} else if (var1.get(2) + 1 == 1 && var1.get(5) == 1) {\n\t\t\tthis.splashText = \"Happy new year!\";\n\t\t} else if (var1.get(2) + 1 == 10 && var1.get(5) == 31) {\n\t\t\tthis.splashText = \"OOoooOOOoooo! Spooky!\";\n\t\t} else {\n\t\t\tthis.splashText = \"\";\n\t\t}\n\n\t\tboolean var2 = true;\n\t\tint var3 = this.height / 4 + 48;\n\n\t\tthis.addSingleplayerMultiplayerButtons();\n\n\t\tthis.buttonList.add(new GuiButton(0, this.width - 120, 3, 60, 20, I18n.format(\"menu.options\", new Object[0])));\n\t\tthis.buttonList.add(new GuiButton(4, this.width - 54, 3, 50, 20, I18n.format(\"menu.quit\", new Object[0])));\n\n\t\t// Remove annoying language button\n\t\t// this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124,\n\t\t// var3 + 72 + 12));\n\n\t\tObject var4 = this.field_104025_t;\n\n\t\tsynchronized (this.field_104025_t) {\n\t\t\tthis.field_92023_s = this.fontRendererObj.getStringWidth(this.field_92025_p);\n\t\t\tthis.field_92024_r = this.fontRendererObj.getStringWidth(this.field_146972_A);\n\t\t\tint var5 = Math.max(this.field_92023_s, this.field_92024_r);\n\t\t\tthis.field_92022_t = (this.width - var5) / 2;\n\t\t\tthis.field_92021_u = ((GuiButton) this.buttonList.get(0)).yPosition - 24;\n\t\t\tthis.field_92020_v = this.field_92022_t + var5;\n\t\t\tthis.field_92019_w = this.field_92021_u + 24;\n\t\t}\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n //TODO: add any code you want to do while the splash screen is showing before the MainActivity is shown\n\n// try {\n// Thread.sleep(5000);\n// } catch (InterruptedException e) {\n// e.printStackTrace();\n// }\n\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n finish();\n }", "public void setWelcomeScreen() {\n clearAllContent();\n add(WelcomeScreen.create(controller));\n pack();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_splash);\n ButterKnife.inject(this);\n\n if(getResources().getBoolean(R.bool.isTablet)){\n lyMain.setBackgroundResource(R.drawable.ic_tablet_splash);\n }else {\n lyMain.setBackgroundResource(R.drawable.ic_smatphone_splash);\n }\n\n Thread timerThread = new Thread() {\n public void run() {\n try {\n sleep(3000);\n\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n startActivity(new Intent(SplashActivity.this, ApplicationsGridActivity.class));\n }\n }\n };\n timerThread.start();\n\n }", "public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n requestWindowFeature(1);\n getWindow().setFlags(1024, 1024);\n setContentView(R.layout.activity_splash_screen);\n new Handler().postDelayed(new Runnable() {\n public void run() {\n SplashScreen.this.startActivity(new Intent(SplashScreen.this, MainActivity.class));\n SplashScreen.this.finish();\n }\n }, 3000);\n }", "@Override\n\tpublic Screen getStartScreen() {\n\t\treturn new Splash(this);\n\t}", "public void initGui()\r\n\t{\r\n\t\tthis.viewportTexture = new DynamicTexture(256, 256);\r\n\t\tthis.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation(\"background\", this.viewportTexture);\r\n\t\tthis.widthCopyright = this.fontRenderer.getStringWidth(\"Copyright Mojang AB. Do not distribute!\");\r\n\t\tthis.widthCopyrightRest = this.width - this.widthCopyright - 2;\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(new Date());\r\n\r\n\t\tif (calendar.get(2) + 1 == 12 && calendar.get(5) == 24)\r\n\t\t{\r\n\t\t\tthis.splashText = \"Merry X-mas!\";\r\n\t\t}\r\n\t\telse if (calendar.get(2) + 1 == 1 && calendar.get(5) == 1)\r\n\t\t{\r\n\t\t\tthis.splashText = \"Happy new year!\";\r\n\t\t}\r\n\t\telse if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31)\r\n\t\t{\r\n\t\t\tthis.splashText = \"OOoooOOOoooo! Spooky!\";\r\n\t\t}\r\n\r\n\t\tint i = 24;\r\n\t\tint j = this.height / 4 + 48;\r\n\r\n\t\tif (this.mc.isDemo())\r\n\t\t{\r\n\t\t\tthis.addDemoButtons(j, 24);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.addSingleplayerMultiplayerButtons(j, 24);\r\n\t\t}\r\n\r\n\t\tthis.buttonList.add(new GuiButton(0, this.width / 2 - 100, j + 72 + 12, 98, 20, I18n.format(\"menu.options\")));\r\n\t\tthis.buttonList.add(new GuiButton(4, this.width / 2 + 2, j + 72 + 12, 98, 20, I18n.format(\"menu.quit\")));\r\n\r\n\t\tsynchronized (this.threadLock)\r\n\t\t{\r\n\t\t\tthis.openGLWarning1Width = this.fontRenderer.getStringWidth(this.openGLWarning1);\r\n\t\t\tthis.openGLWarning2Width = this.fontRenderer.getStringWidth(this.openGLWarning2);\r\n\t\t\tint k = Math.max(this.openGLWarning1Width, this.openGLWarning2Width);\r\n\t\t\tthis.openGLWarningX1 = (this.width - k) / 2;\r\n\t\t\tthis.openGLWarningY1 = (this.buttonList.get(0)).y - 24;\r\n\t\t\tthis.openGLWarningX2 = this.openGLWarningX1 + k;\r\n\t\t\tthis.openGLWarningY2 = this.openGLWarningY1 + 24;\r\n\t\t}\r\n\r\n\t\tthis.mc.setConnectedToRealms(false);\r\n\r\n\t\tif (Minecraft.getMinecraft().gameSettings.getOptionOrdinalValue(GameSettings.Options.REALMS_NOTIFICATIONS) && !this.hasCheckedForRealmsNotification)\r\n\t\t{\r\n\t\t\tRealmsBridge realmsbridge = new RealmsBridge();\r\n\t\t\tthis.realmsNotification = realmsbridge.getNotificationScreen(this);\r\n\t\t\tthis.hasCheckedForRealmsNotification = true;\r\n\t\t}\r\n\r\n\t\tif (this.areRealmsNotificationsEnabled())\r\n\t\t{\r\n\t\t\tthis.realmsNotification.setGuiSize(this.width, this.height);\r\n\t\t\tthis.realmsNotification.initGui();\r\n\t\t}\r\n\t}", "void setSplashContentView() {\n// verifyUser = PreferenceHelper.isVerifyMail(getContext());\n // user is logged in app and is active.\n view.setSplashViewLayout(R.layout.activity_splash);\n\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_splash_screen);\n\n pref = getApplicationContext().getSharedPreferences(AppConstants.mypreference, Context.MODE_PRIVATE);\n\n\n // ************************** SCREEN DISPLAY FOR SOMETIMES ******************************************\n\n final int welcomeScreenDisplay = 1500;\n /** create a thread to show splash up to splash time */\n Thread welcomeThread = new Thread()\n {\n int wait = 0;\n\n @Override\n public void run()\n {\n try\n {\n super.run();\n /**\n * use while to get the splash time. Use sleep() to increase\n * the wait variable for every 100L.\n */\n while (wait < welcomeScreenDisplay)\n {\n sleep(100);\n wait += 100;\n }\n }\n catch (Exception e) {\n System.out.println(\"EXC=\" + e);\n }\n finally {\n /**\n * Called after splash times up. Do some action after splash\n * times up. Here we moved to another main activity class\n */\n String getStatus=pref.getString(AppConstants.IS_LOGIN, \"null\");\n if(getStatus.equals(\"true\"))\n {\n Intent i=new Intent(getApplicationContext(),WelcomeScreen.class);\n startActivity(i);\n finish();\n\n }else\n {\n //first time\n Intent i=new Intent(getApplicationContext(),LoginScreen.class);\n startActivity(i);\n finish();\n\n }\n\n }\n }\n };\n welcomeThread.start();\n\n }", "private void startingScreen() {\n screenWithGivenValues(-1,-2,1,2,3,-1,0);\n }", "public void initConstantDisplay(){\n\t\t\n\t\t\n\t\t// Add colour buttons\n\t\tSprite blueSprite = new Sprite(Textures.blueSplash);\n\t\tSprite orangeSprite = new Sprite(Textures.orangeSplash);\n\t\tSprite purpleSprite = new Sprite(Textures.purpleSplash);\n\t\tSprite redSprite = new Sprite(Textures.redSplash);\n\t\t\n\t\tblueSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+7), MARGIN_TOP_BUTTONS);\n\t\torangeSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+(7*2)+Textures.blueSplash.getSize().y), MARGIN_TOP_BUTTONS);\n\t\tpurpleSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+(7*3)+Textures.blueSplash.getSize().y*2), MARGIN_TOP_BUTTONS);\n\t\tredSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+(7*4)+Textures.blueSplash.getSize().y*3), MARGIN_TOP_BUTTONS);\n\t\t\n\t\tblueSplash = new Button(blueSprite, null, null);\n\t\torangeSplash = new Button(orangeSprite, null, null);\n\t\tpurpleSplash = new Button(purpleSprite, null, null);\n\t\tredSplash = new Button(redSprite, null, null);\n\t\t\n\t\t// Add lightable button and teleport button\n\t\tSprite teleportSprite = new Sprite(Textures.teleportButtonTextureRelief);\n\t\tSprite lightSprite = new Sprite(Textures.lightButtonTextureRelief);\n\t\tteleportSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+(135/3)), MARGIN_TOP_BUTTONS+85);\n\t\tlightSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+(135/3)*2+Textures.lightButtonTextureRelief.getSize().y), MARGIN_TOP_BUTTONS+85);\n\t\t\n\t\tteleportButton = new Button(teleportSprite, Textures.teleportButtonTexture, Textures.teleportButtonTextureRelief);\n\t\tlightButton = new Button(lightSprite, Textures.lightButtonTexture, Textures.lightButtonTextureRelief);\n\t\t\n\t\t// Add save button\n\t\tSprite saveSprite = new Sprite(Textures.saveButtonTextureRelief);\n\t\tSprite loadSprite = new Sprite(Textures.loadButtonTextureRelief);\n\t\tsaveSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+(135/3)), MARGIN_TOP_BUTTONS+170);\n\t\tloadSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+(135/3)*2+Textures.loadButtonTextureRelief.getSize().y), MARGIN_TOP_BUTTONS+170);\n\t\t\n\t\tsaveButton = new Button(saveSprite, Textures.saveButtonTexture, Textures.saveButtonTextureRelief);\n\t\tloadButton = new Button(loadSprite, Textures.loadButtonTexture, Textures.loadButtonTextureRelief);\n\t\t\n\t\t// Robot button\n\t\tSprite robotSprite = new Sprite(Textures.robotButtonTextureRelief);\n\t\trobotSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+(185/2)), MARGIN_TOP_BUTTONS+255);\n\t\t\n\t\trobotButton = new Button(robotSprite, Textures.robotButtonTexture, Textures.robotButtonTextureRelief);\n\t\t\n\t\t\n\t\t// Button for the robot's rotation\n\t\tSprite turnRobotLeftSprite = new Sprite(Textures.rotationRobotL);\n\t\tSprite turnRobotRightSprite = new Sprite(Textures.rotationRobotR);\n\t\tturnRobotLeftSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+((235-2*Textures.rotationRobotR.getSize().x)/3)), MARGIN_TOP_BUTTONS+340);\n\t\tturnRobotRightSprite.setPosition((float)(GRID_DISPLAY_SIZE+MARGIN_LEFT+((235-2*Textures.rotationRobotR.getSize().x)/3)*2+Textures.rotationRobotR.getSize().y), MARGIN_TOP_BUTTONS+340);\n\t\t\n\t\tturnRobotLeft = new Button(turnRobotLeftSprite, null, null);\n\t\tturnRobotRight = new Button(turnRobotRightSprite, null, null);\n\t\t\n\t\t// Button for grid rotation\n\t\tSprite turnLeftSprite = new Sprite(Textures.rotateLeft);\n\t\tturnLeftSprite.setPosition(MARGIN_LEFT+35, (WINDOW_HEIGHT-MARGIN_LEFT-30-Textures.rotateLeft.getSize().y));\n\t\t\n\t\tSprite turnRightSprite = new Sprite(Textures.rotateRight);\n\t\tturnRightSprite.setPosition((GRID_DISPLAY_SIZE+MARGIN_LEFT-35-Textures.rotateRight.getSize().y), (WINDOW_HEIGHT-MARGIN_LEFT-30-Textures.rotateRight.getSize().y));\n\t\t\n\t\tturnLeftButton = new Button(turnLeftSprite, null, null);\n\t\tturnRightButton = new Button(turnRightSprite, null, null);\n\t\t\n\t\tSprite homeSprite = new Sprite(Textures.homeButtonTextureRelief);\n\t\thomeSprite.setPosition(MARGIN_LEFT, MARGIN_LEFT);\n\t\t\n\t\thomeButton = new Button(homeSprite, null, null);\n\t\t\n\t\ttoDisplay.add(new Sprite(Textures.backgroundTexture));\n\t\tcanva.initCanva();\n\t\ttoDisplay.addAll(canva.getCanva());\n\t\ttoDisplay.add(turnLeftSprite);\n\t\ttoDisplay.add(turnRightSprite);\n\t\t\n\t\tint id = toDisplay.size();\n\t\t\n\t\ttoDisplay.add(blueSprite);\n\t\ttoDisplay.add(orangeSprite);\n\t\ttoDisplay.add(purpleSprite);\n\t\ttoDisplay.add(redSprite);\n\t\t\n\t\ttoDisplay.add(teleportSprite);\n\t\ttoDisplay.add(lightSprite);\n\t\t\n\t\ttoDisplay.add(saveSprite);\n\t\ttoDisplay.add(loadSprite);\n\t\ttoDisplay.add(robotSprite);\n\t\t\n\t\ttoDisplay.add(homeSprite);\n\t\t\n\t\ttoDisplay.add(turnRobotLeftSprite);\n\t\ttoDisplay.add(turnRobotRightSprite);\n\t\t\n\t\tblueSplash.setId(id);\n\t\torangeSplash.setId(id+1);\n\t\tpurpleSplash.setId(id+2);\n\t\tredSplash.setId(id+3);\n\t\t\n\t\tteleportButton.setId(id+4);\n\t\tlightButton.setId(id+5);\n\t\tsaveButton.setId(id+6);\n\t\tloadButton.setId(id+7);\n\t\trobotButton.setId(id+8);\n\t\t\n\t\thomeButton.setId(id+9);\n\t\t\n\t\tturnRobotLeft.setId(id+10);\n\t\tturnRobotRight.setId(id+11);\n\t\t\n\t\tif(!LightCore.soundButton.getSprite().getPosition().equals(new Vector2f(15, 65))){\n\t\t\tSprite soundSprite = LightCore.soundButton.getSprite();\n\t\t\tsoundSprite.setPosition(15, 65);\n\t\t\tLightCore.soundButton.setSprite(soundSprite);\n\t\t}\n\t\ttoDisplay.add(LightCore.soundButton.getSprite());\n\t\tLightCore.soundButton.setId(id+12);\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n SplashScreen.show(this); // here\n super.onCreate(savedInstanceState);\n }", "private void launchHomeScreen(){\n\n prefManager.setFirstTimeLaunch(false);\n Intent i = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(i);\n }", "@Override\r\n\tpublic void render(float delta) {\n\t\tif(game.getScreen().getClass().getName().equals(\"by.aleks.christmasboard.screens.SplashScreen\")){\r\n\t\t\tGdx.gl.glClearColor(0f, 0f, 0f, 1);\r\n\t\t} else Gdx.gl.glClearColor(BACKGROUND_COLOR.r, BACKGROUND_COLOR.g, BACKGROUND_COLOR.b, BACKGROUND_COLOR.a);\r\n\t\t\r\n\t\tGdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);\r\n\r\n\t\tstage.act(delta);\r\n\t\tstage.draw();\r\n\t}", "public Welcome(){\n\t\tinitComponents();\n\t\tcenterScreen();\n\t}", "@Override\n\tpublic void init() throws Exception {\n\t\ttry {\n\t\t\tThread.sleep(SPLASH_SCREEN_TIMER);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "private static void hideSplashScreen() {\n if (splash != null) {\n splash.dispose();\n splash = null;\n }\n }", "@Override\n\t\t\t\t\tpublic boolean act(float delta) {\n\t\t\t\t\t\tchangeScreen(SplashScreen.class);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n super.onCreate(savedInstanceState);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\n GLSurfaceView view = new GLSurfaceView(this);\n view.setEGLConfigChooser(8, 8, 8, 8, 16, 0); //Transparent background\n view.getHolder().setFormat(PixelFormat.TRANSLUCENT); //Transparent background\n view.setRenderer(new OpenGLRenderer(this));\n setContentView(view);\n //Transition to Landing screen\n new Handler().postDelayed(new Runnable() {\n\n @Override\n public void run() {\n // This app main activity\n Intent i = new Intent(SplashActivity.this, SearchActivity.class);\n startActivity(i);\n finish();\n }\n }, SPLASH_TIME_OUT);\n }", "@Override // org.apache.cordova.CordovaPlugin\n public void pluginInitialize() {\n if (!HAS_BUILT_IN_SPLASH_SCREEN) {\n this.cordova.getActivity().runOnUiThread(new Runnable() {\n /* class org.apache.cordova.splashscreen.SplashScreen.AnonymousClass1 */\n\n public void run() {\n SplashScreen.this.getView().setVisibility(4);\n }\n });\n getSplashId();\n this.orientation = this.cordova.getActivity().getResources().getConfiguration().orientation;\n if (firstShow) {\n showSplashScreen(this.preferences.getBoolean(\"AutoHideSplashScreen\", true));\n }\n if (this.preferences.getBoolean(\"SplashShowOnlyFirstTime\", true)) {\n firstShow = false;\n }\n }\n }", "public static void showSplashScreen(Class cls, String propFile) {//todo: is this useful ?????.....\n final Class appClass = cls;\n final String resPropFile = propFile;\n SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n if (splashScreen == null) {\n String filename = \"\";\n String resFile = CoreUtil.getPathOnly(appClass.getName(), true) + \"resources.\" + resPropFile;\n try {\n filename = ResourceBundle.getBundle(resFile)\n .getString(\"image.SplashScreenImage\");\n } catch (MissingResourceException e) {\n System.out.println(\"java.util.MissingResourceException: Couldn't find value for: image.SplashScreenImage\");\n }\n String path = \"resources/images/\" + filename;\n ImageIcon img = new ImageIcon(appClass.getResource(path));\n splashScreen = new JWindow();\n splashLabel = new JLabel(img);\n splashScreen.getContentPane().add(splashLabel);\n splashScreen.pack();\n }\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n splashScreen.setLocation(screenSize.width / 2 - splashScreen.getSize().width / 2,\n screenSize.height / 2 - splashScreen.getSize().height / 2);\n splashScreen.setVisible(true);\n }\n });\n }", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n\t\t/* layout splashscreen dengan background gambar */\n setContentView(R.layout.activity_spalsh);\n\t/* handler untuk menjalankan splashscreen selama 5 detik lalu\n\t * membuat HomeActivity\n\t */\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n Intent mainIntent = null;\n\n mainIntent = new Intent(SpalshActivity.this,\n HomeActivity.class);\n\n SpalshActivity.this.startActivity(mainIntent);\n SpalshActivity.this.finish();\n overridePendingTransition(R.layout.fadein,R.layout.fadeout);\n\n\n }\n }, SPLASH_DISPLAY_LENGHT);\n }", "public StartScreen()\n { \n // Create a new world with 1111x602 cells with a cell size of 1x1 pixels.\n super(1111, 602, 1); \n prepare();\n background.playLoop();\n }", "@Override\n\t\t public void run() {\n\t\t \tsetContentView(R.layout.activity_splash);\n\t\t }", "public static void main(String args[]) \n {\n //declare constant to hold the speed of the loader\n final int LOAD_SPEED = 10;\n //create the new splash screen called mySplash\n TspSplash mySplash = new TspSplash();\n //center splash\n mySplash.setLocationRelativeTo(null);\n //set icon \n mySplash.setIconImage(Toolkit.getDefaultToolkit().getImage\n (\"src/Images/Salesperson.png\")); \n //make splash visible\n mySplash.setVisible(true);\n \n try\n {\n //create a variable which will count loop to 100, incrementing by\n //one until it reaches 100\n for(int loader = 0; loader <= 100; loader++)\n {\n //set speed of counter (miliseconds)\n Thread.sleep(LOAD_SPEED);\n //display the counter in the loading label\n mySplash.loadingJLabel.setText(\"Loading \" \n + Integer.toString(loader) + \"%\");\n //increment the progress bar with the counter\n mySplash.splashJProgressBar.setValue(loader);\n //when the loop gets to 100, close the splash screen\n if (loader == 100)\n {\n //when loader is done, close the splash screen\n mySplash.dispose();\n }\n }\n }\n catch (Exception exp)\n {\n JOptionPane.showMessageDialog(null, \"Loading error--\" \n + \"Cannot load splash\");\n }\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(TspGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(TspGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(TspGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(TspGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() \n {\n public void run() \n {\n new TspGUI().setVisible(true);\n }\n });\n }", "@Override\n public void simpleInitApp() {\n configureCamera();\n configureMaterials();\n viewPort.setBackgroundColor(new ColorRGBA(0.5f, 0.2f, 0.2f, 1f));\n configurePhysics();\n initializeHeightData();\n addTerrain();\n showHints();\n }", "private void startup() {\r\n createMineField();\r\n setMinesMesg( mineField.getNumHiddenMines() );\r\n\r\n adjustSize();\r\n adjustScore();\r\n\r\n settingsFrame = new MineSettings( this );\r\n setLocation( 630, 50 );// while in development\r\n setVisible( true );\r\n }", "public static void main(String[] args) {\n\t\t// Define new Runnable for splash screen execution\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\tSplashScreenView splash;\n\t\t\tTimer timer;\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\t// Create splash screen boundary object and set visible\n\t\t\t\t\tsplash = new SplashScreenView();\n\t\t\t\t\tsplash.setVisible(true);\n\n\t\t\t\t\t// Begin timer for 2 seconds to display\n\t\t\t\t\ttimer = new Timer(2000, new ActionListener(){ \n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\t// Create event on timer completion that hide the splash screen, and creates\n\t\t\t\t\t\t\t// the Kabasuji and corresponding view for interactions\n\t\t\t\t\t\t\tsplash.setVisible(false);\n\t\t\t\t\t\t\tKabasuji game = new Kabasuji();\n\t\t\t\t\t\t\tLevelSelectorView window = new LevelSelectorView(game);\n\n\t\t\t\t\t\t\t// allow controller to set up GUI based on the levels loaded by 'game'\n\t\t\t\t\t\t\tStartLevelSelectorController selectorController = new StartLevelSelectorController(window, game);\n\t\t\t\t\t\t\tselectorController.process();\n\n\t\t\t\t\t\t\t// show window\n\t\t\t\t\t\t\twindow.setVisible(true);\n\t\t\t\t\t\t\tImageIcon image = new ImageIcon(StartKabasuji.class.getResource(\"/images/heineman.jpg\"));\n\t\t\t\t\t\t\twindow.setIconImage(image.getImage().getScaledInstance(40, 40, 0));\n\t\t\t\t\t\t\tSystem.out.println(image);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// Start the timer and ensure it only runs once\n\t\t\t\t\ttimer.setRepeats(false);\n\t\t\t\t\ttimer.start();\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\t\t});\n\t}", "public SplashScreen getSplashScreen() {\n if (splashScreen == null) {//GEN-END:|26-getter|0|26-preInit\n // write pre-init user code here\n splashScreen = new SplashScreen(getDisplay());//GEN-BEGIN:|26-getter|1|26-postInit\n splashScreen.setTitle(\"splashScreen\");\n splashScreen.setCommandListener(this);\n splashScreen.setText(\"Who is Java`s mascote?\");//GEN-END:|26-getter|1|26-postInit\n // write post-init user code here\n }//GEN-BEGIN:|26-getter|2|\n return splashScreen;\n }", "public void initApp() {\n \tint ms = (int) Math.round(1000d / Settings.getFramesPerSecond());\n \ttimer = new Timer(ms, this);\n \ttimer.start();\n setBackground(new Color(35, 35, 35));\n Dimension d = new Dimension(Settings.getGridDimensions());\n d.setSize(d.getWidth() + Settings.getBoxSize() * 4 + 80, d.getHeight());\n setPreferredSize(d);\n setFocusable(true);\n }", "@Override\n public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n //Assign the splashscreen_activity_main layout to the SplashScreenActivity\n setContentView(R.layout.splashscreen_activity_main);\n\n /* New Handler to start the Menu-Activity\n * and close this Splash-Screen after some seconds.*/\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n /* Create an Intent that will start the Menu-Activity. */\n Intent mainIntent = new Intent(SplashscreenActivity.this, MainActivity.class);\n SplashscreenActivity.this.startActivity(mainIntent);\n //We call finish() function to prevent user to come back to splashScreen\n SplashscreenActivity.this.finish();\n }\n }, SPLASH_DISPLAY_LENGTH);\n }", "public void initialize(){\n\t screens.put(ScreenType.Game, new GameScreen(this));\n screens.put(ScreenType.Menu, new MenuScreen(this));\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n SplashScreen.show(this);\n super.onCreate(savedInstanceState);\n }", "@Override\r\n\tpublic void create() {\n\t\tbatch = new SpriteBatch();\r\n\t\tcamera = new OrthographicCamera();\r\n\t\tassets = new AssetManager();\r\n\t\t\r\n\t\tcamera.setToOrtho(false,WIDTH,HEIGHT);\r\n\t\t\r\n\t\tTexture.setAssetManager(assets);\r\n\t\tTexture.setEnforcePotImages(false);\r\n\t\t\r\n\t\tsetScreen(new SplashScreen(this));\r\n\t}", "public LetsPlayGUI() {\n super(\"Let's Play!\");\n initComponents();\n setCardLayouts();\n showSplashPanel();\n }", "public LoadingScreen(MainGame game) {\n super(game);\n\n stage = new Stage(new FitViewport(640, 360));\n skin = new Skin(Gdx.files.internal(\"skin/uiskin.json\"));\n loading = new Label(\"Loading...\", skin);\n loading.setPosition(320-loading.getWidth()/2, 180-loading.getHeight()/2);\n porcentage = new Label(\"\", skin);\n porcentage.setPosition(320-loading.getWidth()/2, 140-loading.getHeight()/2);\n stage.addActor(loading);\n stage.addActor(porcentage);\n }", "public WelcomeScreen() {\n initComponents();\n }", "@Override\n public void simpleInitApp() {\n this.viewPort.setBackgroundColor(ColorRGBA.LightGray);\n im = new InteractionManager();\n setEdgeFilter();\n initEnemies();\n initCamera();\n initScene();\n initPlayer();\n initCrossHairs();\n }", "public UIMainWorld()\n { \n super(600, 400, 1); \n startScreen();\n }", "private void handleStartGame()\n {\n String name = nameInputLabel.getText();\n if (name != null)\n {\n gameScreen.setPlayerName(name.replaceAll(\";\", \" \").trim());\n }\n else\n {\n gameScreen.setPlayerName(\"\");\n }\n \n // Set the new screen state\n gameScreen.setState(gameScreen.getLevelSplashState());\n }", "public void showSplashScreen(View view) {\n // start the splash screen to show information\n Intent intent = new Intent(LoginActivity.this, InformationActivity.class);\n startActivity(intent);\n }", "public void start() {\n\t\tFile splashFile = new File(\"Splash\", \"title\");\r\n\t\tsplashString = TextFileReader.getContents(splashFile);\r\n\t\tsendOutput(splashString);\r\n\t\tsendOutput(\"Version \" + versionNum);\r\n\t\tsendOutput(\"by \" + author);\r\n\t\tprintMenu();\r\n\t}", "private void initialScreen() {\r\n\t\t// Clear the screen\r\n\t\tclear();\r\n\r\n\t\t// Place four asteroids\r\n\t\tplaceAsteroids();\r\n\r\n\t\t// Place the ship\r\n\t\tplaceShip();\r\n\r\n\t\t// Reset statistics\r\n\t\tlives = 3;\r\n\t\tdisplay.setLives(lives);\r\n\t\tnumLevel = 1;\r\n\t\tdisplay.setLevel(numLevel);\r\n\t\tdisplay.setScore(0);\r\n\t\tspeed = 3;\r\n\r\n\t\t// Start listening to events\r\n\t\tdisplay.removeKeyListener(this);\r\n\t\tdisplay.addKeyListener(this);\r\n\r\n\t\t// Give focus to the game screen\r\n\t\tdisplay.requestFocusInWindow();\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_splash_screen);\n Intent intent = new Intent(getApplicationContext(),InitialSetupActivity.class);\n startActivity(intent);\n finish();\n }", "@Override\r\n public void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_splash_screen);\r\n StartAnimations();\r\n\r\n new Handler().postDelayed(new Runnable() {\r\n\r\n\r\n @Override\r\n public void run() {\r\n // This method will be executed once the timer is over\r\n Intent i = new Intent(SplashScreen.this, MainActivity.class);\r\n startActivity(i);\r\n finish();\r\n }\r\n }, 5000);\r\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n this.requestWindowFeature(Window.FEATURE_NO_TITLE);\n setContentView(R.layout.activity_splash);\n\n initView();\n initPoint();\n mHandler = new AutoHandler(this);\n }", "@Override\r\n\t\t public void run() {\n\t\t Intent i = new Intent(SplashScreen.this, MainMenuActivity.class);\r\n\t\t startActivity(i);\r\n\t\t \r\n\t\t //Menyelesaikan Splashscreen\r\n\t\t finish();\r\n\t\t }", "@Override \r\n public void onCreate(Bundle icicle) { \r\n super.onCreate(icicle);\r\n \r\n getWindow().setFormat(PixelFormat.RGBA_8888);\r\n getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);\r\n setContentView(R.layout.splash_activity);\r\n \r\n //Display the current version number \r\n PackageManager pm = getPackageManager(); \r\n try {\r\n \tPackageInfo pi = pm.getPackageInfo(\"org.mems\", 0);\r\n TextView versionNumber = (TextView) findViewById(R.id.versionNumber); \r\n versionNumber.setText(\"Version \" + pi.versionName); \r\n } catch (NameNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n \r\n new Handler().postDelayed(new Runnable() {\r\n public void run() { \r\n \tIntent mainIntent = new Intent(SplashActivity.this, MainActivity.class); \r\n \tSplashActivity.this.startActivity(mainIntent); \r\n \tSplashActivity.this.finish(); \r\n } \r\n }, 2000); //2000 for release \r\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n new AddressBookPresenter(this);\n // 去掉标题\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n setContentView(R.layout.act_splash_screen);\n // 闪屏核心代码\n new Handler().postDelayed(new Runnable() {\n\n @Override\n public void run() {\n // TODO Auto-generated method stub\n if (LinphoneManager.getCore().getProxyConfigList().length > 0)\n {\n return;\n }\n Intent intent = new Intent(ActSplashScreen.this,\n LoginPhoneActivity.class);\n // 从启动动画切换到主界面\n startActivity(intent);\n ActSplashScreen.this.finish();// 结束动画\n }\n }, 3000);\n }", "public void run() {\n Intent i = new Intent(activity_splash.this, MainActivity.class);\r\n startActivity(i); // menghubungkan activity splashscren ke xml\r\n //jeda selesai Splashscreen\r\n this.finish();\r\n }", "public SplashScreen(String image, int showTime)\r\n {\r\n\tlogo = new ImageIcon(image);\r\n\r\n\tContainer splashPanel = getContentPane();\r\n\tsplashPanel.setLayout(new BorderLayout());\r\n\tBorder bd1 = BorderFactory.createBevelBorder(BevelBorder.RAISED);\r\n\tBorder bd2 = BorderFactory.createEtchedBorder();\r\n\tBorder bd3 = BorderFactory.createCompoundBorder(bd1, bd2);\r\n\t((JPanel) splashPanel).setBorder(bd3);\r\n\r\n\tsplashPanel.add(\"Center\", new JLabel(logo, JLabel.CENTER));\r\n\r\n\tsetUndecorated(true);\r\n\tshowFor(showTime);\r\n }", "private void settingsScreenRender() {\n overlay.draw(batch, 0.5f);\n uiFont.draw(batch, scoreTxt, 0, HEIGHT - (scoreLayout.height));\n uiFont.draw(batch, healthTxt, WIDTH / 2, HEIGHT - (healthLayout.height));\n musicOn.draw(batch, 1);\n musicOff.draw(batch, 1);\n resume.draw(batch, 1);\n settingStage.draw();\n }", "private void hideSplash() {\n \t\tthis.splashInfoContainer.startAnimation( this.splashFadeOut );\n \t}", "public SplashWindow() {\n imagem = new JLabel(new ToImageIcon().toImageIcon(new ImagemLoad().imageLoader(img)));\n imagem.setBorder(BorderFactory.createLineBorder(Color.black, 1));\n }", "public MainScreen() {\n initComponents();\n \n }", "public SplashScreen getSplashScreen1() {\n if (splashScreen1 == null) {//GEN-END:|31-getter|0|31-preInit\n // write pre-init user code here\n splashScreen1 = new SplashScreen(getDisplay());//GEN-BEGIN:|31-getter|1|31-postInit\n splashScreen1.setTitle(\"splashScreen1\");\n splashScreen1.setCommandListener(this);\n splashScreen1.setImage(getImage());\n splashScreen1.setText(\"TA-DAAAA!!!\");//GEN-END:|31-getter|1|31-postInit\n // write post-init user code here\n }//GEN-BEGIN:|31-getter|2|\n return splashScreen1;\n }", "public Home() {\n initComponents();\n ShowLauncher();\n }", "@Override\n public void onCreate(final Bundle icicle) {\n super.onCreate(icicle);\n setContentView(R.layout.splash_screen);\n\n /* New Handler to start the Menu-Activity\n * and close this Splash-Screen after some seconds.*/\n new Handler().postDelayed(() -> {\n Intent mainIntent = new Intent(SplashScreen.this, MainActivity.class);\n SplashScreen.this.startActivity(mainIntent);\n SplashScreen.this.finish();\n }, SPLASH_DISPLAY_SECONDS * 1000);\n }", "public SplashScreen(EventHandler<ActionEvent> splashScreenComboBoxEvent) {\n\t\troot = new BorderPane();\n\t\troot.setCenter(makeLanguageSelectionView(splashScreenComboBoxEvent));\n\t}", "public Main(){\n \tsetSize(new Dimension(1024, 768));\n \t\n \t//setUndecorated(true); // borderless (fullscreen) window\n \tsetExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH); // maximize window\n \t\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setTitle(\"Game\");\n setLocationRelativeTo(null); // center on screen\n\n \tContentLoader.LoadContent();\n init();\n start();\n }", "public static void hideSplashScreen() {//todo: is this useful ?????.....\n SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n if (splashScreen != null) {\n splashScreen.setVisible(false);\n splashScreen.dispose();\n }\n }\n });\n }", "public void showSplashScreen(int gameCondition, StatusDisplay statusDisplay){\n String printText = \"\";\n switch (gameCondition){\n case WON_GAME:\n printText = \"You won the game :)\"\n + \"\\n\\n\"\n + \"You had \" + statusDisplay.getLives() + \" lives left\"\n + \"\\n and had a score of \" + statusDisplay.getScore()\n + \"\\n\\n\"\n + \"press ENTER to start over\";\n break;\n case LOST_GAME: // i wanted to put this text as a final static, but i cant because of the level\n printText = \"You lost the game :(\"\n + \"\\n\\n\"\n + \"You reached level \" + statusDisplay.getLevel()\n + \"\\n and had a score of \" + statusDisplay.getScore()\n + \"\\n\\n\"\n + \"press ENTER to start over\";\n break;\n case START_GAME:\n printText = START_TEXT;\n break;\n }\n text.setText(printText);\n text.setY(HEIGHT/2 - text.getBoundsInLocal().getHeight()/2);\n text.setX(WIDTH/2 - text.getBoundsInLocal().getWidth()/2);\n text.setFill(Color.GREEN);\n text.setStroke(Color.GREEN);\n text.setOpacity(1);\n background.setOpacity(1);\n }", "public MainMenuScreen(Game game)\n {\n super(game);\n\n batcher = new SpriteBatcher(glGraphics, 100);\n guiCam = new Camera2D(glGraphics, 1920, 1080);\n\n openIntent = new Intent(ScreenManager.game.getPackageName()+\".ACTION2\");\n }", "public Main() {\n\t\tsuper();\n\t\tInitScreen screen = new InitScreen();\n\t\tpushScreen(screen);\n\t\tUiApplication.getUiApplication().repaint();\n\t}", "@Override\r\n public void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n\r\n //이걸 제일 먼저 해야됌\r\n AppManager.getInstance().setAppManager(this);\r\n\r\n AppManager.getInstance().setSize();\r\n AppManager.getInstance().setVibeSensor();\r\n AppManager.getInstance().setPreference();\r\n AppManager.getInstance().setMoveSensor();\r\n AppManager.getInstance().setResuorces(getResources());\r\n AppManager.getInstance().set_myMediaPlayer();\r\n AppManager.getInstance().set_mySoundPool();\r\n\r\n\r\n setContentView(new LoadingCanvas(this));\r\n\r\n Handler handler = new Handler();\r\n handler.postDelayed(new Runnable() {\r\n public void run() {\r\n Intent intent = new Intent(Loading.this, SelectMenu.class);\r\n startActivity(intent);\r\n finish();\r\n }\r\n }, 3000);\r\n }", "private void displayWelcomeScreen(){\n\t\t\n\t\tIntent intent = new Intent();\n\t\tintent.setClassName(getApplicationContext(), Welcome.class.getName());\n\t\t\n\t\t//Start the welcome screen\n\t\tstartActivity(intent);\n\t\t\n\t\tthis.finish();\n\t}", "@Override protected void startup() {\n LoganoView main = new LoganoView(this);\n JFrame frame = main.getFrame();\n\n \n show(main);\n\n frame.setMinimumSize(new Dimension(800, 600));\n frame.setExtendedState(JFrame.MAXIMIZED_BOTH);\n\n FrmLogin frmLogin = new FrmLogin();\n Helper.showForm(frmLogin);\n frmLogin.setLocationRelativeTo(frame);\n }", "private void nextScreen() {\n mHandler.post(new Runnable() {\n @Override\n public void run() {\n Intent intent = new Intent(SplashScreenActivity.this, HomeActivity.class);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n //check draw over app permission\n if (!Settings.canDrawOverlays(SplashScreenActivity.this)) {\n intent = new Intent(SplashScreenActivity.this, DrawOverAppActivity.class);\n }\n }\n startActivity(intent);\n }\n });\n }", "public void run (){\n\t\t\t\t\t\t\t\t\tgame.setScreen(game.ui);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "public StartScreen() {\n initComponents();\n }", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n setContentView(R.layout.activity_splash_screen);\n\n intent = new Intent(this, MainActivity.class);\n\n\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run() {\n\n //Start MainActivity\n startActivity(intent);\n finish();\n }\n }, SPLASH_DISPLAY_LENGTH);\n }", "public void launchSetupScreen() {\n\t\tnew SetUpScreen(this);\n\t}" ]
[ "0.74685806", "0.7453721", "0.71698534", "0.7137998", "0.7111149", "0.7104745", "0.7021648", "0.6941446", "0.69216305", "0.67711633", "0.672097", "0.6682769", "0.66748846", "0.6670227", "0.6648109", "0.6648109", "0.6578763", "0.65755737", "0.65726656", "0.6568186", "0.6562837", "0.6556824", "0.6549156", "0.6523088", "0.6522682", "0.6505131", "0.650366", "0.64755505", "0.64602417", "0.64080715", "0.6406229", "0.63990915", "0.63888407", "0.6354996", "0.6344799", "0.63382983", "0.6263506", "0.62294644", "0.6218519", "0.6218508", "0.6181641", "0.6181571", "0.6171028", "0.6169642", "0.61681294", "0.6166645", "0.6165308", "0.61650705", "0.61315566", "0.6127299", "0.6122443", "0.61217564", "0.6116893", "0.6115982", "0.6114551", "0.61139756", "0.6109206", "0.61060286", "0.60985863", "0.60972005", "0.6092884", "0.6086523", "0.6056551", "0.6054648", "0.60230994", "0.601716", "0.5999941", "0.59970635", "0.59856325", "0.598139", "0.5965339", "0.59520173", "0.593795", "0.5935509", "0.59306884", "0.5924388", "0.59090704", "0.590874", "0.59056854", "0.5904916", "0.59019446", "0.58691704", "0.5865005", "0.58608437", "0.5860473", "0.58575237", "0.58544165", "0.5851183", "0.584939", "0.5842591", "0.58411145", "0.583552", "0.5822175", "0.58171916", "0.5812441", "0.5809171", "0.57845116", "0.5783839", "0.5782164", "0.5778278" ]
0.7953296
0
The game is over. Displays a message to that effect.
private void finalScreen() { display.setLegend(GAME_OVER); display.removeKeyListener(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void gameOver()\r\n {\n addObject(new Text(\"Game Over\"), 550, 300);\r\n backgroundMusic.pause();\r\n Greenfoot.stop();\r\n }", "public void gameOver() {\r\n\t\tgameFrame.gameOver();\r\n\t\tnotifyViews();\r\n\t}", "@Override\r\n\tpublic void gameOver() {\n\t\tover = true;\r\n\t\tupdate();\r\n\t}", "public void gameOver(){ // will be more complex in processing (like a fadey screen or whatever, more dramatic)\n System.out.println();\n System.out.println(\"Three strikes and you're out! You're FIRED!\");\n gameOver = true;\n }", "@Override\r\n\tpublic void gameOver() {\n\t\tgameOver = true;\r\n\t\tupdate();\r\n\t}", "@Override\n public void gameOver() {\n messagePanel.showMessage(image);\n setEnabled(false);\n }", "public void gameOver(){\n\t\tstatus.setGameStarted(false);\n\t\tstatus.setGameOver(true);\n\t\tgameScreen.doNewGame();\n\t\tsoundMan.StopMusic();\n\t\n\t\t// delay to display \"Game Over\" messa\tprivate Object rand;\n\n\t\tTimer timer = new Timer(3000, new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tstatus.setGameOver(false);\n\t\t\t}\n\t\t});\n\t\ttimer.setRepeats(false);\n\t\ttimer.start();\n\t}", "private void gameOver() {\n\t\t\n\t}", "public void gameOver() {\n\t\tframe.setTitle(frame.getTitle() + \" - Game Over\");\n\t}", "void gameOver();", "void gameOver();", "public void gameOver() {\n\t}", "private void gameOver() {\n\t\tgameOver=true;\n\t}", "public void displayGameOver() {\n\t\tthis.theScreen.setFont(Preferences.GAME_OVER_FONT);\n\t\tthis.theScreen.setColor(Preferences.GAME_OVER_COLOR);\n\t\tthis.theScreen.drawString(Preferences.GAME_OVER_TEXT,\n\t\t\t\tPreferences.GAME_OVER_X, Preferences.GAME_OVER_Y);\n\t}", "private void gameOver() {\n System.out.println(\"GAME OVER!!\");\n\n reset();\n mGameOver = true;\n mChangeObserver.gameOver();\n }", "private void gameOver() {\n\t\tAsteroidsGameOverString gameOverString = new AsteroidsGameOverString(GameObject.ROOT);\n\t\tgameOverString.setScale(new Vector3(5.0, 5.0, 5.0));\n\t\tgameOverString.translate(new Vector3(0.0, 8.0));\n\t}", "public void gameOver(){\n gameOverMusic.loop(pitch, volume);\n }", "@Override\n public void gameOver(GameController game) {\n updateScreen(game);\n ((MultiplayerHostController) Main.game).updateClient();\n\n switch (game.getCurrentState()) {\n case END_DRAW:\n JOptionPane.showMessageDialog(this, \"Draw!\");\n break;\n case END_CIRCLE:\n JOptionPane.showMessageDialog(this, \"You won!\");\n break;\n case END_CROSS:\n JOptionPane.showMessageDialog(this, \"You lost!\");\n break;\n }\n stopGame();\n }", "public void gameOver(Graphics art)\n\t{\n\t\tart.setColor(Color.blue);\n\t\tart.drawString(\"Game Over\",300,100);\n\t\tart.drawString(\"Your time is \"+seconds+\" seconds\", 200, 300);\n\t\tart.drawString(\"Press the R to restart the game\",10,500);\n\t}", "public void display_game_over_text () {\n\n fill(150, 100);\n rect(0, 0, displayW, displayH);\n\n textFont(myFont);\n textAlign(CENTER);\n textSize(displayH/20);\n fill(255);\n text(\"Game Over\", displayW/2, 3*displayH/7);\n\n if (score.winnerName == \"Pacmax\") {\n text(\"Winner is Pacmax! Your score is \" + score.score, displayW/2, 4*displayH/7);\n } else {\n text(\"Winner is Blinky!\", displayW/2, 4*displayH/7);\n }\n\n mySound.play_game_over_song();\n\n isKeyInputAllowed = false;\n }", "public void gameOver() {\r\n grid.exposeMines();\r\n this.displayGrid();\r\n System.out.println(\"Better luck next time!\");\r\n }", "public void gameOver() \n {\n ScoreBoard endGame = new ScoreBoard(\"You Lose!\", scoreCounter.getValue());\n addObject(endGame, getWidth()/2, getHeight()/2);\n }", "private void gameOverAlert() {\n \tAlert alert = new Alert(AlertType.INFORMATION);\n \t\n \talert.setTitle(\"Game Over!\");\n \talert.setHeaderText(\"You Did Not Get A New High Score!\\nYour High Score: \" + level.animal.getPoints());\n \talert.setContentText(\"Try Again Next Time!\");\n \talert.show();\n\t}", "public void gameOver ()\n {\n Greenfoot.delay (50);\n if (gameOver)\n {\n fader = new Fader (); // create a new fader\n addObject (fader, 400, 300); // add the fader object to the world\n if (UserInfo.isStorageAvailable()) {\n HighScore highScore = new HighScore (score);\n addObject (highScore, 300, 170);\n }\n Greenfoot.stop();\n }\n }", "public void notifyGameOver() {\n\t\tgameOver = true;\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n controller.gameOver();\n }", "public void gameOver(Graphics g){\n\t\tg.setColor(Color.BLACK);\n\t\tg.setFont(new Font(\"Dialog\", Font.ROMAN_BASELINE, 100));\t\n\t\tg.drawString(\"GAME OVER\" ,100,400);\n\t}", "public void notifyGameOver() {\n this.myStatusString.setText(\"Game Over\");\n final LineBorder line = new LineBorder(Color.RED, 2, true);\n this.myStatusString.setBorder(line);\n this.myStatusString.setForeground(Color.RED);\n this.myStatusString.setFont(new Font(FONT_TIMES, Font.BOLD, NUM_FONT_SIZE_BIG));\n \n }", "private void drawGameOver() {\r\n\t\tg.setColor(Color.GRAY);\r\n\t\t// creates a new font\r\n\t\tFont myFont = new Font(Font.SANS_SERIF, Font.BOLD, TetrisGame.PANEL_WIDTH * 3 / 2);\r\n\t\tg.setFont(myFont);\r\n\t\t// draws the words \"Game Over\"\r\n\t\tg.drawString(\"GAME OVER!\",\r\n\t\t\t\t TetrisGame.PANEL_WIDTH * TetrisGame.SQUARE_LENGTH / 3,\r\n\t\t\t\t TetrisGame.PANEL_HEIGHT * TetrisGame.SQUARE_LENGTH / 2);\r\n\t\t// draws the score\r\n\t\tg.drawString(game.gameOverMessage,\r\n\t\t\t\t TetrisGame.PANEL_WIDTH * TetrisGame.SQUARE_LENGTH / 3,\r\n\t\t\t\t TetrisGame.PANEL_HEIGHT * TetrisGame.SQUARE_LENGTH / 2 + 20);\r\n\t\t// draws the restart message\r\n\t\tg.drawString(\"Press R to Retry\",\r\n\t\t\t\t TetrisGame.PANEL_WIDTH * TetrisGame.SQUARE_LENGTH / 3,\r\n\t\t\t\t TetrisGame.PANEL_HEIGHT * TetrisGame.SQUARE_LENGTH / 2 + 40);\r\n\t}", "public void GameOver(){\n\n\t\tguessBttn.setVisible(false);\n\t\tguessFullWord.setVisible(false);\n\t\tAnswerBox.setDisable(true); //can no longer use the text box\n\t\tresultMessage.setText(\" Sorry!! You Lost.\\nLet's Try to Play Again!\");\n\t\tplayAgain.setVisible(true);\n\t\trevealLabel.setText(\"The mystery word was:\");\n\t\trevealLabel.setVisible(true);\n\t\twordDashes.setText(mysteryWord);\n\t}", "public void gameOver() \n {\n new GameOver();\n Greenfoot.stop();\n }", "private void gameOver(final int status) {\n // Play R.raw.robot_bleep\n soundPool.play(this.soundIds[2], 1, 1, 3, 0, (float) 1.0);\n this.gameOverDisplayed = true;\n ((PongGame) context).gameState = PongGame.GAME_OVER;\n this.touchEnabled = false;\n\n ((PongGame) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n DialogInterface.OnDismissListener listener = new DialogInterface.OnDismissListener() {\n @Override\n public void onDismiss(@NonNull DialogInterface dialog) {\n dialog.dismiss();\n }\n };\n GeneralFunctions.displayDialog(context, status, listener);\n }\n });\n }", "public void gameOver() {\n // if (ENABLE_SOUND) {\n // sfx.endGame();\n // }\n doLeaderboard = true;\n frameRate(10);\n //this.state = GameState.MENU;\n //If line 151 runs, it bypasses the gameover leaderboard screen for some reason\n //redraw();\n}", "public void gameOver() {\n cls();\n displayWord();\n displayGuessedAndRemain();\n printHangman();\n System.out.println(\"Game over!\");\n System.exit(0);\n }", "public static void gameOver() {\n ScoreBoard.write(ScoreController.getScoresPath());\n populate();\n }", "public void gameOver() {\n\n g.setColor(Color.red);\n Font small = new Font(\"Helvetica\", Font.BOLD, 30);\n g.setFont(small);\n g.drawString(\"GAME OVER\", 250, 300);\n g.drawString(\"PRESS R TO RESTART GAME\", 150,400 );\n if(keyManager.restart==true)\n {\n gameOver=true;\n aliens.clear();\n shotVisible=false;\n Assets.init();\n \n player = new Player(getWidth() / 2, getHeight() - 100, 1, 60, 40, this);\n for (int i = 0; i < 4; i++) {\n for (int j = 0; j < 6; j++) {\n aliens.add(new Alien(150 + 50 * j, 50 + 50 * i, 1, 40, 40, this));\n }\n }\n \n \n }\n }", "public void gameOver() \n {\n Greenfoot.stop();\n }", "public void gameOver() {\n this.lives --;\n this.alive = false;\n }", "public void gameOver()\n {\n \tString message = String.format( \"Game over!\\nYou scored %d.\\nYou left %d words on the board.\\nPlay again?\", \n \t\t\tscore, g.getAllWords().length - foundWordsAmount );\n \tint n = JOptionPane.showConfirmDialog(\n \t\t frame,\n \t\t message,\n \t\t \"Game over!\",\n \t\t JOptionPane.YES_NO_OPTION );\n \tif( n == JOptionPane.YES_OPTION )\n \t\trestart();\n \telse\n \t\tSystem.exit( 0 );\n }", "private void gameOver(Graphics g) {\n Color saved = g.getColor();\n g.setColor(new Color(0, 0, 0));\n g.setFont(new Font(\"Arial\", 20, 20));\n FontMetrics fm = g.getFontMetrics();\n centreString(OVER, g, fm, PBG.DIMENSION2 / 2);\n centreString(REPLAY, g, fm, PBG.DIMENSION2 / 2 + 50);\n g.setColor(saved);\n }", "private void renderGuiGameOverMessage (SpriteBatch batch)\n\t{\n\t\tfloat x = cameraGUI.viewportWidth / 2;\n\t\tfloat y = cameraGUI.viewportHeight / 2;\n\t\t\n\t\tif (worldController.isGameOver())\n\t\t{\n\t\t\tBitmapFont fontGameOver = Assets.instance.fonts.defaultBig;\n\t\t\tfontGameOver.setColor(1, 0.75f, 0.25f, 1);\n\t\t\t\n\n\t\t\tfontGameOver.draw(batch, \"GAME OVER\", x, y, 1, Align.center, false);\n\t\t\t\n\t\t\tfontGameOver.setColor(1, 1, 1, 1);\n\t\t}\n\t}", "public void gameOver() {\n tb.setState();\n Date finalDate = new Date();\n float currTime = (finalDate.getTime() - start) / 1000F;\n Intent intent = new Intent(getContext(), TrueBlueOverActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n\n intent.putExtra(\"Score\", score);\n\n intent.putExtra(\"Time\", currTime);\n\n intent.putExtra(\"Level\", level);\n getContext().startActivity(intent);\n }", "@Override\n\tpublic void gameOver(String message) {\n\t\tSystem.out.println(message);\n\t\tboolean state = false;\n\t\twhile(state == false) {\n\t\t\tString username = game.getName();\n\t\t\tint durationGame = game.getTravellingDays();\n\t\t\tSystem.out.println(\"Name: \" + username);\n\t\t\tSystem.out.println(\"You have play for: \" + durationGame + \" days\");\n\t\t\tSystem.out.println(\"Total profit you have made: \" + game.countProfit());\n\t\t\tSystem.out.println(\"Your final score is: \" + this.getTotalProfit());\n\t\t\tSystem.out.println(\"Do you want to try again?\");\n\t\t\tSystem.out.println(\"(1) Yes, I want to play again\");\n\t\t\tSystem.out.println(\"(2) No, just quit\");\n\t\t\tint selectedAction = scanner.nextInt();\n\t\t\ttry {\n\t\t\t\tif (selectedAction <= 2 && selectedAction > 0) {\n\t\t\t\t\tstate = true;\n\t\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\t\tgame.newGame();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\n\t}", "private void renderGuiGameOverMessage(SpriteBatch batch)\n {\n float x = cameraGui.viewportWidth / 2;\n float y = cameraGui.viewportHeight / 2;\n if (worldController.isGameOver())\n {\n BitmapFont fontGameOver = Assets.instance.fonts.defaultBig;\n fontGameOver.setColor(1, 0.75f, 0.25f, 1);\n fontGameOver.draw(batch, \"GAME OVER\", x, y, 0, Align.center, false);\n fontGameOver.setColor(1, 1, 1, 1);\n }\n }", "protected void quitGame() {\n gameOver = true;\n }", "private void gameOver(Graphics g){\n g.setColor(Color.WHITE);\n g.setFont(new Font(\"arial\", Font.BOLD, 50));\n g.drawString(\"Game Over\", 300, 300);\n\n g.setFont(new Font(\"arial\", Font.BOLD, 20));\n g.drawString(\"Space to RESTART\", 340, 340);\n\n g.setColor(Color.WHITE);\n g.setFont( new Font(\"arial\", Font.PLAIN, 20));\n g.drawString(\"Score: \" +score, 390,380);\n }", "private void displayLoseScreen() {\n new EventPopupWindow(String.format(\"GAME OVER:\\nYou failed to collect all %d parts.\\n\\n\"\n + \"Score: %d\",\n getShipPartsNeededCount(),\n getScore()));\n }", "private void gameOver(Button button) {\n\t\tImageView iv = new ImageView(new Image(\"public/images/\"+selectedTheme+\"/mine.png\"));\n\t\tiv.setFitHeight(40);\n\t\tiv.setFitWidth(40);\n\t\tbutton.setGraphic(iv);\n\n\t\tgameOver.setText(\"GAME OVER: Try again?\");\n\t\tgameOver.setVisible(true);\n\n\t\tgame.setDone();\n\t}", "@Override\n public void endGame(){\n gameOver = true;\n }", "private void gameOver() {\r\n timer.stop();\r\n if (JOptionPane.showConfirmDialog(this, \r\n \"Game Over!\\nDo you want to play again?\",\r\n FORM_TITLE,JOptionPane.YES_NO_OPTION) == \r\n JOptionPane.YES_OPTION) {\r\n startGame();\r\n }\r\n else { \r\n close();\r\n }\r\n }", "public void isGameOver() { \r\n myGameOver = true;\r\n myGamePaused = true; \r\n }", "private void gameOverDialog() {\n Toast makeText;\n makeText = Toast.makeText(this.getContext(), getResources().getString(R.string.game_over), Toast.LENGTH_LONG);\n makeText.show();\n makeText = Toast.makeText(this.getContext(), getResources().getString(R.string.final_score) + score, Toast.LENGTH_LONG);\n makeText.show();\n }", "@Override\n\tpublic void gameover(GameOverMessage state) {\n\t\tplatform.notifyCurrGameOver(state);\n\t\tsb.dispose();\n\t\tsr.dispose();\n\t}", "public void gameOver(int gameOver);", "public boolean gameOver();", "public boolean gameOver();", "void endGame () {\n gameOver = true;\n System.out.println(\"Game over\");\n timer.cancel();\n }", "public void lose()\r\n {\r\n Alert inputConfirmation = new Alert(Alert.AlertType.INFORMATION);\r\n inputConfirmation.setTitle(\"Game Over!\");\r\n inputConfirmation.setHeaderText(\"You Lose!\");\r\n inputConfirmation.setGraphic(null);\r\n scoreBoard.gameTimer.gameTime.cancel();\r\n\r\n inputConfirmation.showAndWait();\r\n }", "public void endGameSequence()\n {\n gameOver = true;\n repaint();\n }", "void setGameOver() {\n myGameOver = true;\n myJump.userPauseThreads();\n }", "public void gameOver() {\n \tint currentPosition=0;\n \twhile(lenght-1 > currentPosition) {\n \t\tif(this.xCoord==handler.getWorld().body.get(currentPosition).x && this.yCoord==handler.getWorld().body.get(currentPosition).y) {\n \t\t\tState.setState(handler.getGame().gameOverState);\n \t\t}\n \t\t\n \t\tcurrentPosition++;\n \t\t\n \t}\n }", "private void showEndMessage()\n {\n showText(\"Time is up - you win!\", 390, 150);\n showText(\"Your final score: \" + healthLevel + \" points\", 390, 170);\n }", "private void drawGameOverScreen(Graphics g) {\n \t\tg.setColor(Color.blue);\n \t\tg.fillRect(0, 0, getWidth(), getHeight());\n \t\tg.setColor(Color.white);\n \t\tg.setFont(new Font(\"Courier New\", Font.PLAIN, 18));\n \t\tg.drawString(\"A problem has been detected and your computer\", 50, 30);\n \t\tg.drawString(\"has been shut down to prevent damage to your computer.\", 50, 60);\n \n \t\tg.drawString(\"OUT_OF_CPU_ERROR\", 50, 120);\n \n \t\tg.drawString(\"Diagnostics\", 50, 240);\n \t\tg.drawString(\"Items Junked: \" + ((RecycleBin) (objects.get(0))).getAmountCollected(), 50, 300);\n \t\tg.drawString(\"Time Elapsed: \" + (timeGameEnded - timeGameStarted) / 1000000000.0 + \" s\", 50, 360);\n \n \t\tg.drawString(\"Press <Esc> to power down.\", 50, 400);\n \t}", "public static void gameOver(Stage endGame) {\n\t\tendGame.setTitle(\"Game over\");\n\t\tInventory.inventory.clear();\n\t\tPane GOLayout = new Pane();\n\t\t\n\t\tGOLayout.getChildren().add(ButtonEvents.playButton(endGame, 265, 230));\n\t\tGOLayout.getChildren().add(ButtonEvents.exitButton(165,230));\n\t\tScene scene = new Scene (GOLayout, 500, 500);\n\n\t\tendGame.setScene(scene);\n\t\tendGame.show();\n\t}", "void lose() {\n System.out.println(\"You have lost the game!!!\" + \"\\n\" + \"You spend: \" + Time.getSecondsPassed() + \" seconds playing the game!\");\n System.exit(0);\n\n }", "public boolean gameOver() \n {\n \treturn status() != GAME_NOT_OVER;\n }", "private void gameOver(Graphics g) {\r\n String msg = \"Game Over!\";\r\n String msgScore = \"Your Score: \"+score;\r\n Font small = new Font(\"Helvetica\", Font.BOLD, 14);\r\n FontMetrics metr = getFontMetrics(small);\r\n //set color of text\r\n g.setColor(Color.white);\r\n //set font to small\r\n g.setFont(small);\r\n //draw string message in the center of the screen\r\n g.drawString(msg, (BRDWIDTH - metr.stringWidth(msg)) / 2, BRDHEIGHT / 2);\r\n g.drawString(msgScore, (BRDWIDTH - metr.stringWidth(msg)) / 2, BRDHEIGHT / 3);\r\n }", "public void lose() {\n status.setText(\"You're finished\");\n gamegoing = false;\n }", "public void gameOver(boolean won){\r\n\t\tif(won){\r\n\t\t\tgameState = \"Won\";\r\n\t\t}else{\r\n\t\t\tgameState = \"Lost\";\r\n\t\t}\r\n\t\tb1.setVisible(true);\r\n\t\tb2.setText(\"Play Again\");\r\n\t\tb2.setVisible(true);\r\n\t}", "private void drawGameOver(Graphics g) {\n\t\tString msg;\n\t\tFont small = new Font(\"Helvetica\", Font.BOLD, 75);\n\t\tFontMetrics fm = getFontMetrics(small);\n\n\t\tif (p1score == p2score) {\n\t\t\tImageIcon ii = new ImageIcon(\"t71.gif\");\n\t\t\timage = ii.getImage();\n\t\t} else {\n\t\t\tImageIcon ii = new ImageIcon(\"g_over.gif\");\n\t\t\timage = ii.getImage();\n\t\t}\n\n\t\tg.drawImage(image, 0, 0, 1024, 768, this);\n\t\tif (p1score > p2score) {\n\t\t\tmsg = \"Congratulations COMPUTER\" + \"!\";\n\t\t\tg.setColor(Color.white);\n\t\t\tg.setFont(small);\n\t\t\tg.drawString(msg, (1024 - fm.stringWidth(msg)) / 2, 768 / 2);\n\t\t} else if (p1score < p2score) {\n\t\t\tmsg = \"Congratulations \" + Player2 + \"!\";\n\t\t\tg.setColor(Color.white);\n\t\t\tg.setFont(small);\n\t\t\tg.drawString(msg, (1024 - fm.stringWidth(msg)) / 2, 768 / 2);\n\t\t}\n\n\t}", "public void run() //call game over method \r\n {\r\n gui.display(\"The time limit has been reached. The game is now over!\");\r\n \r\n try { //try catch for Thread.sleep in gameOver()\r\n gameOver();\r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void playSoundGameLost() {\n\t\tlostGameSound.play();\n\t}", "boolean isGameOver() {\n\t\treturn Hit;\n\t}", "void gameResumed();", "public void game_over() {\n JOptionPane.showMessageDialog(null,\"GAME OVER\",\"Titolo finestra mettici quello che vuoi\",1);\n\n System.exit(0);\n}", "public void gameOver() {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Game is over. Calculating points\");\r\n\t\tstatus = \"over\";\r\n\t\ttry {\r\n\t\t\tupdateBoard();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tupdateEvents(false);\r\n\t\tEmbedBuilder embed = new EmbedBuilder();\r\n\t\tembed.setTitle(\"Game Results\");\r\n\t\tMap<Integer, Integer> scores = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tfor (int i = 0; i < players.size(); i++) {\r\n\t\t\tscores.put(i,players.get(i).calculatePoints());\r\n\t\t\t// Utils.getName(players.get(i).getPlayerID(),guild)\r\n\t\t}\r\n\t\t\r\n\t\tList<Entry<Integer, Integer>> sortedList = sortScores(scores);\r\n\t\t\r\n\t\t// If tied, add highest artifact values\r\n\t\tif ((playerCount > 1) && (sortedList.get(0).getValue().equals(sortedList.get(1).getValue()))) {\r\n\t\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Scores were tied\");\r\n\t\t\tint highestScore = sortedList.get(0).getValue();\r\n\t\t\tfor (Map.Entry<Integer, Integer> entry : sortedList) {\r\n\t\t\t\t// Only add artifacts to highest scores\r\n\t\t\t\tif (entry.getValue().equals(highestScore)) {\r\n\t\t\t\t\tscores.put(entry.getKey(),entry.getValue()+players.get(entry.getKey()).getHighestArtifactValue());\r\n\t\t\t\t\tplayers.get(entry.getKey()).setAddedArtifactValue(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Sort with added artifact values\r\n\t\tsortedList = sortScores(scores);\r\n\t\t\r\n\t\t// Assigns 1st, 2nd, 3rd\r\n\t\tfor (int i = 0; i < sortedList.size(); i++) {\r\n\t\t\tMap.Entry<Integer, Integer> entry = sortedList.get(i);\r\n\t\t\t// If tie, include artifact\r\n\t\t\tString name = Utils.getName(players.get(entry.getKey()).getPlayerID(),guild);\r\n\t\t\tif (players.get(entry.getKey()).getAddedArtifactValue()) {\r\n\t\t\t\tint artifactValue = players.get(entry.getKey()).getHighestArtifactValue();\r\n\t\t\t\tembed.addField(Utils.endGamePlaces[i],\"**\"+name+\"** - ``\"+(entry.getValue()-artifactValue)+\" (\"+artifactValue+\")``\",true);\r\n\t\t\t} else {\r\n\t\t\t\tembed.addField(Utils.endGamePlaces[i],\"**\"+name+\"** - ``\"+entry.getValue()+\"``\",true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tembed.setFooter(\"Credit to Renegade Game Studios\", null);\r\n\t\tgameChannel.sendMessage(embed.build()).queueAfter(dragonAttackingDelay+3000,TimeUnit.MILLISECONDS);\r\n\t\t\r\n\t\tGlobalVars.remove(this);\r\n\t}", "public boolean gameOver() {\n\t\treturn gameOver;\n\t}", "@Override\n public void onAnimationEnd(Animator animator) {\n proclaimGameOver();\n\n\n }", "@Override\n public void endGameAsLoss()\n {\n // UPDATE THE GAME STATE USING THE INHERITED FUNCTIONALITY\n super.endGameAsLoss();\n \n // RECORD IT AS A loss\n ((MahjongSolitaireMiniGame)miniGame).getPlayerRecord().addLoss(currentLevel);\n ((MahjongSolitaireMiniGame)miniGame).savePlayerRecord();\n \n // DISPLAY THE loss DIALOG\n miniGame.getGUIDialogs().get(LOSS_DIALOG_TYPE).setState(VISIBLE_STATE); \n\n // AND PLAY THE LOSS AUDIO\n miniGame.getAudio().stop(MahjongSolitairePropertyType.SPLASH_SCREEN_SONG_CUE.toString()); \n miniGame.getAudio().stop(MahjongSolitairePropertyType.GAMEPLAY_SONG_CUE.toString());\n miniGame.getAudio().play(MahjongSolitairePropertyType.LOSS_AUDIO_CUE.toString(), false);\n }", "public void Hit()\n {\n this.numLives--;\n //Oscillate visible and not if the number of lives is greater than zero\n if(this.numLives > 0)\n {\n this.damaged = true;\n this.Blink(1);\n\n }\n }", "private void HandleOnGameOver(Board board, State state, Piece winner){\n\t\tif(state == State.Stopped) {\n\t\t\tthis.setVisible(false);\n\t\t\tthis.dispose();\n\t\t}\n\t}", "public void wonGame(){\n\t\tSystem.out.println(\"Bravo, du hast gewonnen! Möchtest du noch einmal spielen?\");\n\t\tstopGame();\n\t\tstarted = false;\n\t\tspiel_status = 1;\n\t\tpaintMenu();\n\t}", "public boolean gameOver()\n {\n return checkmate()||draw()!=NOT_DRAW;\n }", "public void gameOver(){\n\t\tif(wrongList.size()==8){\r\n\t\t\tSystem.out.println(\"The game is end\");\r\n\t\t\tSystem.exit(0);}\r\n\t\telse if(gameWon()==true){\r\n\t\t\tSystem.out.println(\"You win the Game!\");\r\n\t\t\tSystem.out.println(\"The game is end\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\telse\r\n\t\t\tplayGame();\r\n\t\t\r\n\t}", "public void theGameMenuClicked() {\n System.out.println(\"THE GAME (you just lost it)\");\n }", "public void gameWon()\n {\n ScoreBoard endGame = new ScoreBoard(\"You Win!\", scoreCounter.getValue());\n addObject(endGame, getWidth()/2, getHeight()/2);\n }", "private void showGameOver()\n {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n //Todo:\n // step 1. get the winner name using game.getWinner()\n // step 2. put the string player.getName()+\" won the game!\" to the string reference called \"result\"\n Player winner = game.getWinner();\n String result = winner.getName() + \" won the game!\";\n\n // pass the string referred by \"result\" to make an alert window\n // check the bottom of page 9 of the PA description for the appearance of this alert window\n Alert alert = new Alert(AlertType.CONFIRMATION, result, ButtonType.YES, ButtonType.NO);\n alert.showAndWait();\n if (alert.getResult() == ButtonType.YES)\n {\n Platform.exit();\n }\n }\n });\n }", "public GameOverScreen(final PApplet display) {\n\t\tsuper(display);\n\n\t\tviews.add(new Background(display));\n\t\tviews.add(new Text(display, \"Game Over\\n\" + \"¯\\\\_(X.x)_/¯\\n\" + \"Press ENTER to restart ♪♫♪\", true));\n\t}", "private boolean gameOver() {\r\n\t\treturn (lifeBar == null || mehran == null);\r\n\t}", "public void endGame(){\n if(character.getHp() > 0 )effectHandler.endGame();\n character.clearBuffs();\n }", "@Override\n\tpublic void render(float delta) \n\t{\n\t\tif (state_Game==GAME_READY) \n\t\t{\n\t\t\t/*Si esta en Ready Decrementa el tiempo hasta que el tiempo se igual a 0*/\n\t\t\ttiempo=60-(int) (stateTime/2);\n\t\t\tif(tiempo==0)\n\t\t\t{\n\t\t\t\t/*Si es igual a 0 entonces muestra la pantalla de gameover*/\n\t\t\t\tSettings.addScore(Score.getScore());\n\t\t\t\tgame.setScreen(new PantallaGameOver(game));\n\t\t\t}\n\t\t\tupdate(delta);\n\t\t}\n\t\tif (state_Game==GAME_PAUSED) \n\t\t{\n\t\t\t/*Si el estado del juego es Pausa muestra la ventana de Pausa*/\n\t\t\tpauseGame(delta);\n\t\t}\n\t\t\n\t}", "static void feedPet() {\r\n\t\tJOptionPane.showMessageDialog(null, \"Your \" + pet + \" is happy and full.\");\r\n\t\thappinessLevel+=3;\r\n\t}", "private void gameOver(Stage stage) {\n\t\t\n\t\t//A specific label is created, coloured red and is scaled to be 2.5 times its usual size,\n\t\t//to emphasise the state of the game.\n\t\tLabel gameOver = new Label(\"Game over\");\n\t\tgameOver.setTextFill(Color.RED);\n\t\tgameOver.setScaleX(2.5);\n\t\tgameOver.setScaleY(2.5);\n\t\tgameOver.setMinWidth(300);\n\t\tgameOver.setAlignment(Pos.BASELINE_CENTER);\n\t\t\n\t\t//End statement labels are created to explain to the player why the game has ended and\n\t\t//what they can do next.\n\t\tLabel endStatement1 = new Label(\"You have run out of tries\");\n\t\tendStatement1.setMinWidth(300);\n\t\tendStatement1.setAlignment(Pos.CENTER);\n\t\tLabel endStatement2 = new Label(\"Press any key to start a new game or escape to exit.\");\n\t\tendStatement2.setWrapText(true);\n\t\tendStatement2.setPrefWidth(200);\n\t\tendStatement2.setMinWidth(200);\n\t\tendStatement2.setMaxWidth(200);\n\t\tendStatement2.setAlignment(Pos.BASELINE_CENTER);\n\n\t\t//These labels are put into a VBox, along with the Region object to help move the labels down\n\t\t//on the screen. The int determines how much space should be between each node in the VBox.\n\t\tVBox v = new VBox(20,eh,gameOver,endStatement1,endStatement2);\n\t\tv.setAlignment(Pos.TOP_CENTER);\n\t\tVBox.setVgrow(eh,Priority.ALWAYS);\n\t\t\n\t\t//The VBox is put into a group and the scene is then recreated with this group.\n\t\tgroup = new Group(v);\n\t\tscene = new Scene(group,300,300,Color.LIGHTGREY);\n\t\tstage.setScene(scene);\n\t\tstage.setResizable(false);\n\t\tstage.setTitle(\"Hangman\");\n\t\tstage.show();\n\t\t\n\t\tscene.setOnKeyReleased(new EventHandler<KeyEvent>() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void handle(KeyEvent e) {\n\t\t\t\t\n\t\t\t\t//If the player presses the escape button, the socket and stage are closed, ending\n\t\t\t\t//the client program.\n\t\t\t\tif(e.getCode()==KeyCode.ESCAPE) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tclient.close();\n\t\t\t\t\t}catch(IOException ioe) {\n\t\t\t\t\t}\n\t\t\t\t\tstage.close();\n\t\t\t\t//However, if the player has pressed any other button, the start method is called in\n\t\t\t\t//order to start a new game. It sets up the window once again and resets certain values\n\t\t\t\t//so that the game can behave normally.\n\t\t\t\t}else {\n\t\t\t\t\tstart(stage);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void gameOver(String str) {\n console(str);\n setGameInProgress(false);\n }", "public void act() \n {\n\n if(isTouching(Car.class))\n {\n Lap = Lap + 1;\n if ((Lap % 11) == 0)\n {\n String lap = Integer.toString(Lap / 11);\n\n getWorld().showText(lap, 450, 30);\n getWorld().showText(\"Lap:\", 400, 30);\n }\n } \n if (Lap == 47)\n {\n Greenfoot.stop();\n getWorld().showText(\"GameOver\",250,250);\n }\n }", "public void onTurnOver() {}", "void win() {\n if (_game.isWon()) {\n showMessage(\"Congratulations you win!!\", \"WIN\", \"plain\");\n }\n }", "public void triggerEndGame()\n\t{\n\t\tif(livesRemaining <= 0)\n\t\t{\n\t\t\tmP[0].stop();\n\t\t\tmP[1].stop();\n\t\t\tmP[2].stop();\n\t\t\tendGame = new Alert(AlertType.CONFIRMATION);\n\t\t\tendGame.setTitle(\"1942\");\n\t\t\tendGame.setHeaderText(null);\n\t\t\tendGame.getButtonTypes().clear();\n\t\t\tendGame.setContentText(\"You're dead! \\nYou finished with \" + p1Score + \" points. \\nWould you like to play again?\");\n\t\t\tendGame.getButtonTypes().addAll(ButtonType.YES, ButtonType.NO);\n\t\t\tendGame.setGraphic(new ImageView(new Image(\"file:images/gameOver.png\")));\n\t\t\tspawnTimerTL.stop();\n\t\t\tmainTimer.stop();\n\t\t\tp1.getNode().setImage(null); //Removes player from screen\n\t\t\tOptional<ButtonType> result = endGame.showAndWait();\n\n\t\t\tif(result.get() == ButtonType.YES)\n\t\t\t{\n\t\t\t\tlivesRemaining = 3;\n\t\t\t\thealthRemaining = 10;\n\t\t\t\tivHealthBar.setImage(imgHealth[healthRemaining]);\n\t\t\t\tivLives.setImage(imgLives[livesRemaining]);\t\n\n\t\t\t\tif (highScore < p1Score)\n\t\t\t\t\thighScore = p1Score;\n\t\t\t\ttry //Writes new high score and throws IO Exception\n\t\t\t\t{\n\t\t\t\tfileWriter = new FileWriter(highScoreSave);\n\t\t\t\tfileWriter.write(String.valueOf(highScore));\n\t\t\t\tfileWriter.close();\n\t\t\t\t}\n\t\t\t\tcatch(IOException e)\n\t\t\t\t{e.printStackTrace();}\n\t\t\t\t\n\t\t\t\tlblHighScore.setText(Integer.toString(highScore));\n\t\t\t\tp1Score = 0;\n\t\t\t\tlblp1score.setText(Integer.toString(p1Score));\n\n\t\t\t\tp1.setDead(false);\n\t\t\t\tmainTimer.start();\n\t\t\t\tspawnTimerTL.play();\n\t\t\t\t\n\t\t\t\tfor(int k = 0; k < enemyPlanes.length; k++)\n\t\t\t\t{\n\t\t\t\t\tenemyPlanes[k].toggleIsDead(true);\n\t\t\t\t\tenemyPlanes[k].setY(2000);\n\t\t\t\t\tenemyPlanes[k].getNode().setLayoutY(enemyPlanes[k].getY());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (highScore < p1Score)\n\t\t\t\t\thighScore = p1Score;\n\t\t\t\ttry //Writes new high score and throws IO Exception\n\t\t\t\t{\n\t\t\t\tfileWriter = new FileWriter(highScoreSave);\n\t\t\t\tfileWriter.write(String.valueOf(highScore));\n\t\t\t\tfileWriter.close();\n\t\t\t\t}\n\t\t\t\tcatch(IOException e)\n\t\t\t\t{e.printStackTrace();}\n\t\t\t\tthankYou = new Alert(AlertType.INFORMATION);\n\t\t\t\tthankYou.setTitle(\"1942\");\n\t\t\t\tthankYou.setHeaderText(null);\n\t\t\t\tthankYou.setGraphic(new ImageView(new Image(\"file:images/plane.png\")));\n\t\t\t\tthankYou.setContentText(\"Thank you for playing.\\nGoodbye!\");\n\t\t\t\tthankYou.show();\n\t\t\t\tPlatform.exit();\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\n\t\t}\n\t}", "@Override\n\tpublic void onGameOver(ReadOnlyBoard board, Counter winner) {\n\n\t}", "public void resign(){\n\t\tif(Main.getInstance().getScreen() instanceof GEngine){\r\n\t\t\tPlayer user = getUserPlayer();\r\n\t\t\tPlayer winner = state.players[user.playerId == 0 ? 1 : 0];\r\n\t\t\t\r\n\t\t\tnew Popup(\"Game over\", true,\r\n\t\t\t\tnew Label(String.format(\"Player %s has won the game!\", winner.getDisplayName()), Assets.SKIN), \r\n\t\t\t\tComponentFactory.createButton(\"OK\", new ClickListener() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void clicked(InputEvent event, float x, float y) {\r\n\t\t\t\t\t\tMain.getInstance().setScreen(MainMenu.getInstance());\r\n\t\t\t\t\t\tPopup.getCurrentPopup().close();\r\n\t\t\t\t\t}\r\n\t\t\t\t})).show();\r\n\t\t}\r\n\t\t\r\n\t\tMain.getInstance().games.endGame(this);\r\n\t}", "public void gameOver() {\r\n\t\t// Clean up the model layer\r\n\t\tModelEventSource.clear();\r\n\t\tStargate.clearStargates();\r\n\r\n\t\t//\r\n\t\tisReplicatorMoving = false;\r\n\t\tplayers.clear();\r\n\t\treplicator = null;\r\n\t\tzpmSet.clear();\r\n\t}" ]
[ "0.8199384", "0.7909308", "0.7906861", "0.7889991", "0.78879184", "0.7874186", "0.78540313", "0.78296435", "0.7793599", "0.7642243", "0.7642243", "0.76191974", "0.76186854", "0.7590056", "0.75664055", "0.7542757", "0.7392767", "0.7381664", "0.73782456", "0.73744124", "0.7371645", "0.73709625", "0.73553413", "0.7346689", "0.72892684", "0.71606714", "0.7142155", "0.71406454", "0.7133248", "0.71199584", "0.70879567", "0.70747846", "0.7070002", "0.70360124", "0.7026349", "0.7024586", "0.69914544", "0.6976854", "0.69683295", "0.69465137", "0.6933753", "0.6927788", "0.6893892", "0.6887161", "0.6873335", "0.6862454", "0.6841416", "0.6821473", "0.67885035", "0.6765029", "0.6739016", "0.6721507", "0.672011", "0.67137665", "0.6698523", "0.6698523", "0.6676679", "0.6669714", "0.6660169", "0.6642587", "0.6638332", "0.66300833", "0.66047305", "0.6599542", "0.6594109", "0.6574459", "0.6573722", "0.6561292", "0.65593535", "0.6552126", "0.65379506", "0.65324986", "0.65105", "0.65070295", "0.6502815", "0.6500743", "0.6466293", "0.6464983", "0.6460397", "0.6458584", "0.64404064", "0.6421335", "0.64144087", "0.6404249", "0.6389945", "0.6383674", "0.63781846", "0.63769346", "0.6371445", "0.636428", "0.63617665", "0.63544995", "0.6337173", "0.6325759", "0.6322374", "0.63072157", "0.63039976", "0.6288078", "0.62835896", "0.6278067", "0.6277241" ]
0.0
-1
Place a new ship in the center of the screen. Remove any existing ship first.
private void placeShip() { // Expire the ship ship Participant.expire(ship); clipShip.stop(); // Create a new ship ship = new Ship(SIZE / 2, SIZE / 2, -Math.PI / 2, this); addParticipant(ship); display.setLegend(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void ship_respawn() {\n ship.resetPosition();\n ship_image_view.setX(ship.x_position); // Update the ship image position\n }", "public Ship newShip(GameScreen screen){\n\t\tthis.ship = new Ship(screen);\n\t\treturn ship;\n\t}", "public void addPlayerShip()\n\t{\n\t\t//if a PlayerShip is already spawned, a new one will not be added\n\t\tif(shipSpawned)\n\t\t{\n\t\t\t\tSystem.out.println(\"A player ship is already spawned\");\n\t\t\t\treturn;\n\t\t}\n\t\tgameObj.add(new PlayerShip(getHeight(), getWidth()));\n\t\tSystem.out.println(\"Player ship added\");\n\t\tshipSpawned = true;\n\t\tnotifyObservers();\n\t}", "private void placePlayerShip(int x, int y) {\n\t\tif (shipsToPlace == 3) {\n\t\t\tlongShipCoords = new int[2];\n\t\t\tlongShipCoords[0] = x;\n\t\t\tlongShipCoords[1] = y;\n\n\t\t\t// creates long ship at x,y on egrid\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\tegrid[x + i][y] = 1;\n\n\t\t\t// makes ship tiles blue on enemy's board\n\t\t\tfor (int counter = 0; counter < 5; counter++)\n\t\t\t\tenemyBoard[x + counter][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t}\n\n\t\telse if (shipsToPlace == 2) {\n\t\t\t// create medium ship at x,y on egrid\n\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\t\t\tegrid[x][y + 2] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 2].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t}\n\n\t\telse if (shipsToPlace == 1) {\n\t\t\t// create small ship at x,y on egrid\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t\tstatus.setText(\" Click to attack\");\n\t\t}\n\t\tshipsToPlace--;\n\t\tenableAllTiles();\n\t\tdisableRestrictedTiles(x, y);\n\t}", "public SpaceShip() {\r\n\t\tsuper();\r\n\t\tthis.radius = 15;\r\n\t\tgameController.setSpaceShip(this);\r\n\t\tArrayList<Point> shipList = new ArrayList<Point>();\r\n\t\tshipList.add(new Point(-10, -10));\r\n\t\tshipList.add(new Point(-10, 10));\r\n\t\tshipList.add(new Point(15, 0));\r\n\t\tthis.addShape(new Polygon(shipList, Color.WHITE, false));\r\n\t\t// this.addShape(new Circle(radius, this.getCenterPoint().copy(),\r\n\t\t// Color.RED, false));\r\n\t}", "public void placeShip(Ship thisShip, String coordinate, int direction){\r\n\t\tthisShip.placed = true;\r\n\t\tint letterCoord = letterToIndex(coordinate.charAt(0));\r\n\t\tint numberCoord = Integer.parseInt(coordinate.substring(1))-1;\r\n\t\t\r\n\t\t\r\n\t\t\tif (direction == 1) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\t\tthisShip.set_position(numberCoord+i, letterCoord);\r\n\t\t\t\t\t}\r\n\t\t\t} else if (direction == 2) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\tthisShip.set_position(numberCoord, letterCoord+i);\r\n\t\t\t\t\t}\r\n\t\t\t} else if (direction == 3) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\tthisShip.set_position(numberCoord-i, letterCoord);\r\n\t\t\t\t}\r\n\t\t\t} else if (direction == 4) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\tthisShip.set_position(numberCoord, letterCoord - i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\tif(thisShip.name == \"Carrier\"){\r\n\t\t\tmyBoard.carrier.placed=thisShip.placed;\r\n\t\t\tmyBoard.carrier.position=thisShip.position;\r\n\t\t\t}\r\n\t\t\t\r\n\t\telse if(thisShip.name == \"Battleship\"){\r\n\t\t\tmyBoard.battleship.placed=thisShip.placed;\r\n\t\t\tmyBoard.battleship.position=thisShip.position;\r\n\t\t}\r\n\t\telse if(thisShip.name == \"Cruiser\"){\r\n\t\t\tmyBoard.cruiser.placed=thisShip.placed;\r\n\t\t\tmyBoard.cruiser.position=thisShip.position;\r\n\t\t}\r\n\t\telse if(thisShip.name == \"Submarine\"){\r\n\t\t\tmyBoard.submarine.placed=thisShip.placed;\r\n\t\t\tmyBoard.submarine.position=thisShip.position;\r\n\t\t}\r\n\t\telse if(thisShip.name == \"Patrol Boat\"){\r\n\t\t\t\tmyBoard.patrolboat.placed=thisShip.placed;\r\n\t\t\t\tmyBoard.patrolboat.position=thisShip.position;\r\n\t\t}\r\n\t\t\t\r\n\t\t}", "public void addPlayerShip()\n\t{\n\t\t//if a PlayerShip is already spawned, a new one will not be added\n\t\tif (gameObj[1].size() == 0)\n\t\t{\n\t\t\tgameObj[1].add(new PlayerShip());\n\t\t\tSystem.out.println(\"PlayerShip added\");\n\t\t}else{\n\t\t\tSystem.out.println(\"A player ship is already spawned\");\n\t\t}\n\t\t\n\t}", "public void addOrRemoveScreenedShip(Spaceship aShip){\n int found = -1;\r\n for (int i = 0; i < screenedShips.size(); i++){\r\n if (aShip.getId() == screenedShips.get(i)){\r\n found = i;\r\n }\r\n }\r\n if (found > -1){ // ta bort den\r\n screenedShips.remove(found);\r\n }else{ // annars l�gg till den\r\n screenedShips.add(aShip.getId());\r\n }\r\n }", "public void putShip(Ship ship) throws OverlapException{\r\n if(this.ship == null){\r\n this.ship = ship;\r\n }else{\r\n throw new OverlapException(row, column);\r\n }\r\n }", "public void placeShip(Board board, Ship ship) {\n\n\n Point startPoint = null;\n boolean validPoint = false;\n while (!validPoint) {\n System.out.printf(\"Place your %s (%d spaces).%n\", ship.getName(), ship.getLength());\n try {\n startPoint = returnPointFromInput(board);\n if (startPoint != null && !startPoint.hasShip()) {\n validPoint = true;\n } else {\n System.out.println(\"Invalid input. Please enter a coordinate pair. Ex: 1A (Case insensitive).\");\n }\n } catch (IllegalArgumentException | NoSuchElementException e) {\n System.out.println(e.getMessage());\n }\n }\n\n int emptySpaces = 0;\n boolean validBranch = false;\n Point[] branch = null;\n while (!validBranch) {\n\n String direction = null;\n boolean validDirection = false;\n while (!validDirection) {\n try {\n direction = directionFromInput();\n validDirection = true;\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n }\n }\n\n branch = makeBranch(board, startPoint, ship.getLength(), direction);\n for (Point point : branch) {\n if (!point.hasShip()) {\n emptySpaces++;\n }\n }\n if (emptySpaces == ship.getLength()) {\n validBranch = true;\n } else {\n System.out.println(\"You can't put a ship there. Not enough room\");\n emptySpaces = 0;\n }\n }\n\n // pass ship to point\n for (Point point : branch) {\n point.setShip(ship);\n point.setHasShip(true);\n }\n }", "public void addShip(Ship ship) {\n\t\tint row = ship.getRow();\n\t\tint column = ship.getColumn();\n\t\tint direction = ship.getDirection();\n\t\tint shipLength = ship.getLength();\n\t\t//0 == Horizontal; 1 == Vertical\n\t\tif (direction == 0) {\n\t\t\tfor (int i = column; i < shipLength + column; i++) {\n\t\t\t\tthis.grid[row][i].setShip(true);\n\t\t\t\tthis.grid[row][i].setLengthOfShip(shipLength);\n\t\t\t\tthis.grid[row][i].setDirectionOfShip(direction);\n\t\t\t}\n\t\t}\n\t\telse if (direction == 1) {\n\t\t\tfor (int i = row; i < shipLength + row; i++) {\n\t\t\t\tthis.grid[i][column].setShip(true);\n\t\t\t\tthis.grid[i][column].setLengthOfShip(shipLength);\n\t\t\t\tthis.grid[i][column].setDirectionOfShip(direction);\n\t\t\t}\n\t\t}\n\t}", "private void removeShip(){\n mainPanel.remove(this);\n gbc.gridheight=1;\n gbc.gridwidth=1;\n int placeX = getMy_x();\n int placeY = getMy_y();\n for(int i=0;i<getMy_length();i++){ //put free spaces by the length of the ship.\n if(getMy_dir().equals(\"Horizontal\")){\n placeX = getMy_x()+i;\n }\n if(getMy_dir().equals(\"Vertical\")){\n placeY = getMy_y()+i;\n }\n gbc.gridx = placeX;\n gbc.gridy = placeY;\n freeSpaceButton freeSpace = new freeSpaceButton(new Point(placeX,placeY));\n freeSpace.setPreferredSize(new Dimension(58,58));\n mainPanel.add(freeSpace,gbc); //add free space to the board.\n }\n mainPanel.revalidate();\n mainPanel.repaint();\n }", "public boolean placeShip(Ship ship, int x, char y, boolean isVertical) {\n Ship s2;\n switch(ship.getShipType()) {\n case \"BATTLESHIP\":\n ship = new Battleship();\n s2 = new Battleship();\n break;\n case \"DESTROYER\":\n ship = new Destroyer();\n s2 = new Destroyer();\n break;\n case \"MINESWEEPER\":\n ship = new Minesweeper();\n s2 = new Minesweeper();\n break;\n default:\n return false;\n }\n\n boolean successful = playersBoard.placeShip(ship, x, y, isVertical);\n if (!successful)\n return false;\n\n boolean opponentPlacedSuccessfully;\n do {\n // AI places random ships, so it might try and place overlapping ships\n // let it try until it gets it right\n opponentPlacedSuccessfully = opponentsBoard.placeShip(s2, randRow(), randCol(), randVertical());\n } while (!opponentPlacedSuccessfully);\n\n return true;\n }", "public void placeShip(Coordinate selected, int orientation) {\r\n HashSet<Coordinate> location = new HashSet<>();\r\n if (orientation == -1) { //user Xed the orientation window\r\n location.add(selected);\r\n data.orientationXedFlag = true;\r\n } \r\n else { //user didnt X the orientation window\r\n Boolean spaceIsFree = false;\r\n if (data.gameState == 1) {\r\n location = game.getPlayerOne().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerOne().checkLegalPlacement(location, orientation);\r\n }\r\n else if (data.gameState == 2) {\r\n location = game.getPlayerTwo().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerTwo().checkLegalPlacement(location, orientation);\r\n }\r\n\r\n if (spaceIsFree) {\r\n if (data.gameState == 1)\r\n game.getPlayerOne().placeShip(location, data.shipToPlace);\r\n else if (data.gameState == 2)\r\n game.getPlayerTwo().placeShip(location, data.shipToPlace);\r\n data.placementSuccessful = true;\r\n data.shipToPlace++;\r\n }\r\n else {\r\n data.placementSuccessful = false; \r\n location.clear();\r\n location.add(selected);\r\n } \r\n }\r\n data.placement = convertPlacementData(location);\r\n setChanged();\r\n notifyObservers(data);\r\n data.orientationXedFlag = false;\r\n data.placementSuccessful = false; //reset flags to false to avoid errornous updates \r\n }", "@POST(\"/UpdateShip\")\n\tShip updateShip(@Body Ship ship,@Body int id) throws GameNotFoundException;", "public void addShip(Ship ship){\n\n ship.setGamePlayers(this);\n myships.add(ship);\n }", "void move_ship() {\n if (pressed_key_codes.contains(KeyCode.A)) {\n ship.moveLeft();\n ship_image_view.setX(ship.x_position);\n }\n if (pressed_key_codes.contains(KeyCode.D)) {\n ship.moveRight();\n ship_image_view.setX(ship.x_position);\n }\n }", "private void positionShipRandomly(Ship ship, boolean[][] b) {\r\n\t\tsetRandomOrientation(ship);\r\n\t\tship.setStartLocation(new int[] {rm.nextInt(BOARD_WIDTH_DEFAULT),rm.nextInt(BOARD_HEIGHT_DEFAULT)});\r\n\t\tint[] startLocation = findFreePosition(b, ship);\r\n\t\tship.setStartLocation(startLocation);\r\n\t\tmarkOccupiedSectors(b,ship);\r\n\t}", "public void hyperSpace()\n\t{\n\t\t//only return the ship if a PlayerShip is currently spawned\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\t//invoke resetShip() method from PlayerShip\n\t\t\t((PlayerShip)gameObj[1].get(0)).resetShip();\n\t\t\tSystem.out.println(\"PS location reset\");\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"There is no playership spawned\");\n\t}", "private static String placeShip(Request req) {\n BattleshipModel currentModel = getModelFromReq(req);\n\n int rows = Integer.parseInt(req.params(row));\n int col = Integer.parseInt(req.params(col));\n\n BattleshipModel placeModel = getModelFromReq(req);\n\n\n\n return \"SHIP\";\n }", "public boolean placeShip(int row, int col, int shipSize, char orientation) {\n /* validate the input values before adding the ship */\n if(!checkAddShipParams(row, col, shipSize, orientation))\n return false;\n /* if someone is in the spot already we can't put another ship there */\n else if(spotTaken(row, col, shipSize, orientation))\n return false;\n \n /* We made it this far so everything must be ok, now place the ship */\n if(orientation == 'v' || orientation == 'V') {\n for(int i = 0; i < shipSize; i++)\n this.board[row+i][col] = 'S';\n \n numShips++;\n return true;\n }\n else { // don't need to check if it equals H because it has to if it passed the param check\n for(int i = 0; i < shipSize; i++)\n this.board[row][col+i] = 'S';\n \n numShips++;\n return true;\n }\n }", "public static void placeShips (Game game) {\n\t\t\n\t\tint dir, x, y, length, width;\n\t\tint[] shipDim;\n\t\tboolean[] success = new boolean[shipSizes.length];\n\t\t\n\t\tfor (int i = 0; i < shipSizes.length; i++) {\n\t\t\tsuccess[i] = false;\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < shipSizes.length; i++) {\n\t\t\t\n\t\t\t// If an attempted ship location is invalid (off-screen or overlapping another ship) then success[i] will be false so it tries again.\n\t\t\twhile (success[i] == false) {\n\t\t\t\tdir = rnd.nextInt(2);\n\t\t\t\tx = rnd.nextInt(Config.BOARD_LENGTH);\n\t\t\t\ty = rnd.nextInt(Config.BOARD_WIDTH);\n\t\t\t\tshipDim = shipSizes[i];\n\t\t\t\tif (dir == 0) {\n\t\t\t\t\t// Across.\n\t\t\t\t\tlength = shipDim[0];\n\t\t\t\t\twidth = shipDim[1];\n\t\t\t\t} else {\n\t\t\t\t\t// Down.\n\t\t\t\t\tlength = shipDim[1];\n\t\t\t\t\twidth = shipDim[0];\n\t\t\t\t}\n\n\t\t\t\tShip ship = new Ship(i*10+5,length,width); // IDs will be 5, 15, 25, etc.\n\t\t\t\tsuccess[i] = game.addShip(ship, x, y);\n\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void actionPerformed(ActionEvent event)\n {\n if (add)\n {\n if (validInput())\n {\n Ship newShip = map.addUserShip(\"Lobsterboat\",shipName,\n xcoord,ycoord,speed,direction);\n main.setUserShip(newShip);\n map.repaint();\n main.closeStartWindow();\n }\n }\n else\n {\n main.closeStartWindow();\n }\n }", "public boolean placeShip(int player, int x, int y) {\n\n Ship ship = null;\n\n for (int i = 0; i < 5; i++) {\n if (playerShips[i].selected) {\n ship = playerShips[i];\n }\n }\n if (ship == null) {\n return false;\n }\n\n if (orientation == 1) {\n if (ship.length + y > 10) {\n return false;\n }\n }\n if (orientation == 0) {\n if (ship.length + x > 10) {\n return false;\n }\n }\n for (int i = 0; i < ship.length; i++) {\n if(orientation == 0) {\n if (humanPlayerBoard[y][x+i] != board.water.ordinal()) {\n return false;\n }\n }\n else{\n if(humanPlayerBoard[y+i][x] != board.water.ordinal()){\n return false;\n }\n }\n }\n for (int i = 0; i < ship.length; i++) {\n if(orientation == 0) {\n humanPlayerBoard[y][x+i] = board.ship.ordinal();\n }\n else{\n humanPlayerBoard[y+i][x] = board.ship.ordinal();\n }\n }\n if(ship.placed){\n if(ship.orientation == 1){\n for(int i = 0; i < ship.length; i++){\n humanPlayerBoard[ship.y+i][ship.x] = board.water.ordinal();\n }\n }\n else{\n for(int j = 0; j < ship.length; j++){\n humanPlayerBoard[ship.y][ship.x+j] = board.water.ordinal();\n }\n }\n }\n ship.setShip(x, y, orientation);\n ship.placed = true;\n\n return true;\n }", "public void toggleShipAtTile(int tile) {\r\n if (placedShips < 4 || hasShip(tile)) {\r\n if (hasShip(tile)) {\r\n placedShips -= 1;\r\n } else {\r\n placedShips += 1;\r\n }\r\n tiles[tile] = tiles[tile] ^ 1;\r\n }\r\n }", "public void moveSpaceShipUp() {\n\t\tSpaceship sp = getTheSpaceship();\n\t\tsp.moveUp();\n\t}", "public void moveSpaceShipLeft() {\n\t\tSpaceship sp = getTheSpaceship();\n\t\tsp.moveLeft();\n\t}", "public void shipPlacer(Board board, ShipTeam fleet){\r\n\r\n\t\tArrayList<Ship> theShips = fleet.getShips();\r\n\r\n\t\tint randomX, randomY;\r\n\t\tfor (Ship s : theShips){\r\n\t\t\tboolean goodPlace = false;\r\n\t\t\twhile (goodPlace == false){\r\n\t\t\t\tRandom randCoords = new Random();\r\n\t\t\t\trandomX = randCoords.nextInt(10);\r\n\t\t\t\trandomY = randCoords.nextInt(10);\r\n\t\t\t\tif (randomX % 2 == 0)\r\n\t\t\t\t\tgoodPlace = board.placeShip(randomX, randomY, s, 1);\r\n\t\t\t\telse\r\n\t\t\t\t\tgoodPlace = board.placeShip(randomX, randomY, s, 2);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void positionShips(Ship ships[]) {\n ships[0] = new AircraftCarrier(3, true, 'A', 5, 'F');\n ships[1] = new Battleship(6, true, 'B', 4, 'A');\n ships[2] = new Destroyer(2, false, 'D', 3, 'E');\n ships[3] = new Submarine(1, true, 'S', 3, 'J');\n ships[4] = new PatrolBoat(9, false, 'P', 2, 'C');\n }", "private void cp2PlaceShips(){\n\t\tint start = 5, stop = 9, orientation;\n\t\tboolean placed;\n\n\t\tfor(int x = start; x <= stop; x++){\n\t\t\tplaced = false;\n\n\t\t\twhile(!placed)\n\t\t\t{\n\t\t\t\tranX = ranNum.nextInt(600);\n\t\t\t\tranY = ranNum.nextInt(600);\n\t\t\t\torientation = ranNum.nextInt(2);\n\t\t\t\tplaced = true;\n\n\t\t\t\tships[x] = new Ship(x, shipNames[x], 'H', shipPlayer[x], shipWidth[x], shipHeight[x], ranX, ranY, shipSize[x]);\n\t\t\t\tships[x].setLocation(ships[x].getX(), ships[x].getY());\n\t\t\t\tships[x].setSize(ships[x].getWidth(), ships[x].getHeight());\n\n\t\t\t\tif(orientation == 1){\n\t\t\t\t\tchangeOrientation(x);\n\t\t\t\t}\n\n\t\t\t\tif(ships[x].getX() + ships[x].getWidth() < boardTwo.getWidth() && ships[x].getY() + ships[x].getHeight() < boardTwo.getHeight()){\n\t\t\t\t\tfor(int y = start; y < x; y++){\n\t\t\t\t\t\tif(ships[x].getBounds().intersects(ships[y].getBounds())){\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tplaced = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboardTwo.add(ships[x]);\n\t\t}\n\t}", "@Override\r\n\tpublic void ship(Robot t) {\n\t\t\r\n\t}", "public void connectShipToBoard(Ship ship){\n ships.add(ship);\n }", "private void createShips() {\n //context,size, headLocation, bodyLocations\n Point point;\n Ship scout_One, scout_Two, cruiser, carrier, motherShip;\n if(player) {\n point = new Point(maxN - 1, 0); //row, cell\n scout_One = new Ship(1, point, maxN, \"Scout One\", player);\n ships.add(scout_One);\n point = new Point(maxN - 1, 1);\n scout_Two = new Ship(1, point, maxN, \"Scout Two\", player);\n ships.add(scout_Two);\n point = new Point(maxN - 2, 2);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n ships.add(cruiser);\n point = new Point(maxN - 2, 3);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n ships.add(carrier);\n point = new Point(maxN - 4, 5);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n ships.add(motherShip);\n\n }else{\n Random rand = new Random();\n int rowM = maxN-3;\n int colM = maxN -2;\n int row = rand.nextInt(rowM);\n int col = rand.nextInt(colM);\n point = new Point(row, col);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n updateOccupiedCells(motherShip.getBodyLocationPoints());\n ships.add(motherShip);\n\n rowM = maxN - 1;\n colM = maxN -1;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n updateOccupiedCells(carrier.getBodyLocationPoints());\n ships.add(carrier);\n checkIfOccupiedForSetShip(carrier, row, col, rowM, colM);\n\n\n rowM = maxN - 1;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n updateOccupiedCells(cruiser.getBodyLocationPoints());\n ships.add(cruiser);\n checkIfOccupiedForSetShip(cruiser, row, col, rowM, colM);\n\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_Two = new Ship(1, point, maxN, \"Scout_Two\", player);\n updateOccupiedCells(scout_Two.getBodyLocationPoints());\n ships.add(scout_Two);\n checkIfOccupiedForSetShip(scout_Two, row, col, rowM, colM);\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_One = new Ship(1, point, maxN, \"Scout_One\", player);\n updateOccupiedCells(scout_One.getBodyLocationPoints());\n ships.add(scout_One);\n checkIfOccupiedForSetShip(scout_One, row, col, rowM, colM);\n\n\n\n\n }\n //Need an algorithm to set enemy ship locations at random without overlaps\n }", "@POST(\"/AddShip\")\n\tint addShip(@Body Ship ship,@Body int id) throws GameNotFoundException;", "void ship_setup() {\n ship = new Ship(level);\n ship_image_view = new ImageView(ship_image);\n ship_image_view.setX(ship.x_position);\n ship_image_view.setY(ship.y_position);\n ship_image_view.setFitWidth(Ship.SHIP_WIDTH);\n ship_image_view.setFitHeight(Ship.SHIP_HEIGHT);\n game_pane.getChildren().add(ship_image_view);\n }", "protected void warp() {\n\t\tRandom r = new Random();\n\t\t\n\t\t// Get random index from coordinates list\n\t\tint nextPos = r.nextInt(this.coords.length);\n\t\t\n\t\t// Set new position for monster\n\t\tthis.setBounds(this.coords[nextPos].width, this.coords[nextPos].height, mWidth, mHeight);\n\t\t\n\t\tthis.setVisible(true);\n\t}", "PlayerShip(int screenLength, int newY, int size, int newSpeed) {\n \tsuper(screenLength/2, newY, size, size);\n setHSpeed(newSpeed);\n }", "public void assignAsteroidToShip(Ship ship, Asteroid asteroid) {\n\t\tasteroidToShip.put(asteroid.getId(), ship);\n\t}", "private void cp1PlaceShips(){\n\t\tint start = 0;\n\t\tint stop = 4;\n\t\tboolean placed;\n\n\t\tfor(int x = start; x <= stop; x++){\n\t\t\tplaced = false;\n\n\t\t\twhile(!placed)\n\t\t\t{\n\t\t\t\tranX = ranNum.nextInt(600);\n\t\t\t\tranY = ranNum.nextInt(600);\n\t\t\t\tplaced = true;\n\n\t\t\t\tships[x] = new Ship(x, shipNames[x], 'H', shipPlayer[x], shipWidth[x], shipHeight[x], ranX, ranY, shipSize[x]);\n\t\t\t\tships[x].setLocation(ships[x].getX(), ships[x].getY());\n\t\t\t\tships[x].setSize(ships[x].getWidth(), ships[x].getHeight());\n\n\t\t\t\tif(ships[x].getX() + ships[x].getWidth() < boardOne.getWidth() && ships[x].getY() + ships[x].getHeight() < boardOne.getHeight()){\n\t\t\t\t\tfor(int y = start; y < x; y++){\n\t\t\t\t\t\tif(ships[x].getBounds().intersects(ships[y].getBounds())){\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tplaced = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboardOne.add(ships[x]);\n\t\t}\n\t}", "public boolean placeShipUser(Ship ship) {\r\n return fieldUser.addShip(ship);\r\n }", "public void move(int x, int y){\n universe.erase(this);\n this.yPosition = y;\n this.xPosition = x;\n universe.draw(this);\n }", "public static void placeShipVertMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length - (ship.getLength() - 1) || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n if (!board[r][indexC].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n r = indexR - 1;\r\n }\r\n }\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n board[r][indexC] = symbol;\r\n } \r\n \r\n }", "public void hyperSpace()\n\t{\n\t\t//only return the ship if a PlayerShip is currently spawned\n\t\tIIterator iter = gameObj.getIterator();\n\t\twhile(iter.hasNext())\n\t\t{\n\t\t\tGameObject current = (GameObject)iter.getNext();\n\t\t\tif(current instanceof PlayerShip)\n\t\t\t{\n\t\t\t//invoke resetShip() method from PlayerShip\n\t\t\t\t((PlayerShip)current).resetShip();\n\t\t\t\tSystem.out.println(\"PS location reset\");\n\t\t\t\tnotifyObservers();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"There is no playership spawned\");\n\t}", "public void setShip (Ship s){\n \tthis.ship=s;\n }", "@Override\r\n\tSpaceship getShip() {\n\t\treturn new MotherShip(getWidth()/2, getHeight());\r\n\t}", "public void shootIntoCargoShip(){\n shoot.set(SHIP_SHOOT);\n }", "@Override\n public void Insert(Ship ship, String start,String end){\n if(start.charAt(0)==end.charAt(0)){\n for(int i = 0;i < ship.getSize(); i++){\n grid[start.charAt(1)+i-'0'][start.charAt(0)-'A'] = \"[\"+ ship.getType() +\"]\";\n ship.updateCoordlist(start.charAt(1)+i-'0',start.charAt(0)-'A');\n }\n }\n else{\n for(int i = 0;i < ship.getSize(); i++){\n grid[start.charAt(1)-'0'][start.charAt(0)-'A'+i] = \"[\"+ ship.getType() +\"]\";\n ship.updateCoordlist(start.charAt(1)-'0',start.charAt(0)-'A'+i);\n\n }\n }\n }", "public static void placeShipHorzMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length - (ship.getLength() - 1) || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n if (!board[indexR][c].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n c = indexC - 1;\r\n }\r\n }\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n board[indexR][c] = symbol;\r\n } \r\n }", "public void positionShipsRandomly() {\r\n\t\tfor(Ship ship:ships) {\r\n\t\t\tpositionShipRandomly(ship,occupiedFields);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void update() {\n\t\tmove();\n\t\tplace();\n\t}", "@POST(\"/IDShip\")\n\tShip IDShip(@Body int id, @Body int shipID);", "public void setShip(int row, int column, boolean value) {\n\t\tthis.grid[row][column].setShip(value);\n\t}", "public void move()\n\t{\n\t\tVector v = ship.v;\n\t\tb = b.getLocation().add(v).getBlock();\n\t\tif(triangle != null) triangle.move();\n\t\tif(rear != null) rear.move();\n\t\tif(foreAndAft != null) foreAndAft.move();\n\t\tif(sails != null) for(int i = 0; i < sails.size(); i++)\n\t\t{\n\t\t\tSail sail = sails.get(i);\n\t\t\tsail.move();\n\t\t}\n\t}", "public void set(int sx,int sy, int ax, int ay)\n {\n shipX = sx;\n shipY = sy;\n astX = ax;\n astY = ay;\n }", "public Ship(float x, float y) {\r\n\t\tthis.bounds = new Rectangle(x, y, width, height);\r\n\t}", "private void movePlayer() {\r\n\t\tshipImageView.setX(ship.getCurrentLocation().x * scalingFactor);\r\n\t\tshipImageView.setY(ship.getCurrentLocation().y * scalingFactor);\r\n\t\tship.notifyObservers();\r\n\t}", "public void autoPutShip(int padding) {\n for (int l=3; l>=0; l--) {\n// if already have ships of this type go to another length\n if (decks[l] == (4-l)) continue;\n for (int i = 0; i < (4-l); i++) {\n// if already put ships of that type go on..\n if (decks[l] == (4-l)) continue;\n// choice random side of sea\n// (for optimal placing need to place near it)\n int side = (int) (Math.random() * 4);\n// generate random indent from side corner\n// (like you go counter clock wise)\n int indent = (int) (Math.random() * (10 - l));\n int x = 0, y = 0;\n// for side get direction\n Direction dir = Direction.values()[side];\n// calculate coordinates\n switch (side) {\n case 0:\n x = padding;\n y = indent;\n break;\n case 1:\n x = indent;\n y = 9 - padding;\n break;\n case 2:\n x = 9 - padding;\n y = 9 - indent;\n break;\n case 3:\n x = 9 - indent;\n y = padding;\n break;\n }\n// create ship (just for right coordinates)\n Ship ship = new Ship(x, y, l, dir);\n// and if you can put it - put\n if (canPutShip(ship)) putShip(ship);\n }\n }\n if (!isAllShipsOn()&& padding < 9) autoPutShip(padding + 1);\n }", "private void markShips(Point start, Point end, GenericShip newShip, GameCell[][] board) {\n\t\t// check if vertical or horizontal\n\t\tif (start.x == end.x ) {\n\t\t\t// must be horizontal\n\t\t\tfor (int i = start.y ; i <= end.y ; i++) {\n\t\t\t\tboard[start.x][i].addShip(newShip);\n\t\t\t}\n\t\t}\n\t\telse if (start.y == end.y){\n\t\t\t// vertical\n\t\t\tfor (int i = start.x ; i <= end.x ; i++) {\n\t\t\t\tboard[i][start.y].addShip(newShip);\n\t\t\t}\n\t\t}\n\t\telse { //must be diagonal\n\t\t\tfor (int i = start.x, j = start.y; i <= end.x ; i++, j++) {\n\t\t\t\tboard[i][j].addShip(newShip);\n\t\t\t}\n\t\t}\n\t}", "public void collideWithShip (Ship ship)\n {\n ship.takeDamage(AvoiderGame.getBundle().getDouble(\"floating_object_to_ship_damage\"));\n setActive(false);\n }", "public void shootShip(Cell cell) {\n// int shipIndex = cell.getShipIndex();\n// if (shipIndex == -1) return;\n//\n// System.out.println(shipIndex);\n// if(shipCellMap.get(shipIndex)!=null)\n// \tshipCellMap.get(shipIndex).remove(cell);\n//\n// if (shipCellMap.get(shipIndex)!=null && shipCellMap.get(shipIndex).size() == 0)\n// {\n// String infoString;\n// if (isEnemy)\n// {\n// infoString = \"An enemy ship is sinking! Enemy still has %d ships\";\n// } else\n// {\n// infoString = \"One of your ships is sinking! You still have %d ships\";\n// }\n// if(shipCellMap.get(shipIndex)!=null)\n// \tshipCellMap.remove(shipIndex);\n// removeOneShip();\n//\n// String alertString = String.format(infoString, shipNumOnBoard);\n// // The ship is sinking\n// Alert alert = new Alert(Alert.AlertType.INFORMATION,\n// alertString,\n// ButtonType.YES);\n// alert.showAndWait();\n//\n// }\n }", "public void resetPaddleToStartingPosition(){\n myRectangle.setX(initialXLocation);\n }", "public void draw(Graphics g) {\n Image imageShip = new javax.swing.ImageIcon(\"ship.gif\").getImage();\n g.drawImage(imageShip, getXCoord()-9,getYCoord(),null);\n }", "@Override\r\n public void moveSoldier(int previousLocationX, int previousLocationY, int newLocationX, int newLocationY) {\r\n\r\n // delete soldier representation from previous location \r\n // then render soldier representation in new location \r\n }", "private void drawShip(int startX, int startY, int direction, int length) {\n if (direction == 4) { //South\n for (int y = 0; y < length; y++) {\n defendingGrid[startX][startY + y].setHasShip(true);\n\n\n }\n } else if (direction == 2) { //East\n\n for (int y = 0; y < length; y++) {\n defendingGrid[startX + y][startY].setHasShip(true);\n\n }\n } else if (direction == 6) { //West\n for (int y = 0; y < length; y++) {\n defendingGrid[startX - y][startY].setHasShip(true);\n\n }\n } else if (direction == 0) { //North\n for (int y = 0; y < length; y++) {\n defendingGrid[startX][startY - y].setHasShip(true);\n }\n }\n }", "@Test\n void should_place_ships_scenario_1() {\n Board board = BoardData.getBoard(15, 15);\n\n List<ShipType> shipConfigs = Arrays.asList(\n ShipType.ONE,\n ShipType.ONE,\n ShipType.TWO,\n ShipType.THREE\n );\n\n AutomaticShipPlacer automaticShipPlacer = new AutomaticShipPlacer();\n automaticShipPlacer.placeShips(shipConfigs, board);\n\n assertSame(4, board.getShips().size());\n BoardPrinter.print(board);\n }", "public void place() {\n\t\tprocessing.image(Image, x, y);\n\t}", "public boolean addShip(Ships ship) {\n\t\tfor (int i = 0; i < this.aliveShips.length; i++) {\r\n\t\t\tif (this.aliveShips[i] == null) {\r\n\t\t\t\tthis.aliveShips[i] = ship;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@POST(\"/DeleteShip\")\n\tint deleteShip(@Body Ship ship,@Body int id) throws GameNotFoundException;", "public void act() \n {\n move(-16);\n \n \n if (isAtEdge())\n {\n setLocation(700,getY());\n }\n \n if (isTouching(Shots.class))\n {\n getWorld().addObject(new SpaceObject(), 500,Greenfoot.getRandomNumber(400));\n }\n \n }", "private void setShipPositionsGivenDirectionStartingPoint (){\n\n\t\tfor (int i = 0; i < shipSize - 1; i++) {\n\t\t\t// orient the ship in the given direction\n\t\t\tswitch (direction) {\n\t\t\tcase NORTH:\n\t\t\t\tshipPositions.add(new Coordinate(shipPositions.get(i).getxPosition(),shipPositions.get(i).getyPosition() - 1, false, false));\n\t\t\t\tbreak;\n\t\t\tcase SOUTH:\n\t\t\t\tshipPositions.add(new Coordinate(shipPositions.get(i).getxPosition(),shipPositions.get(i).getyPosition() + 1, false, false));\n\t\t\t\tbreak;\n\t\t\tcase EAST:\n\t\t\t\tshipPositions.add(new Coordinate(shipPositions.get(i).getxPosition() + 1,shipPositions.get(i).getyPosition(), false, false));\n\t\t\t\tbreak;\n\t\t\tcase WEST:\n\t\t\t\tshipPositions.add(new Coordinate(shipPositions.get(i).getxPosition() -1 ,shipPositions.get(i).getyPosition(), false, false));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testSunkShip() {\n final Ship submarine = new Submarine();\n final String errorMessage = \"There isn't a ship in that position\";\n\n submarine.placeShipAt(0, 0, true, ocean);\n assertTrue(errorMessage, ocean.shootAt(0, 0));\n assertTrue(errorMessage, ocean.shootAt(0, 1));\n assertTrue(errorMessage, ocean.shootAt(0, 2));\n assertEquals(1, ocean.getShipsSunk());\n ocean.print();\n }", "private void placeEnemyShips() {\n\t\tint s51 = (int) (Math.random() * 6); // mostly random numbers\n\t\tint s52 = (int) (Math.random() * 10);\n\t\tfor (int i = 0; i < 5; i++)\n\t\t\tpgrid[s51 + i][s52] = 1;\n\n\t\t// Places the ship of length 3\n\t\tint s31 = (int) (Math.random() * 10);\n\t\tint s32 = (int) (Math.random() * 8);\n\t\twhile (pgrid[s31][s32] == 1 || pgrid[s31][s32 + 1] == 1 // prevents\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overlaps\n\t\t\t\t|| pgrid[s31][s32 + 2] == 1) {\n\t\t\ts31 = (int) (Math.random() * 10);\n\t\t\ts32 = (int) (Math.random() * 8);\n\t\t}\n\t\tpgrid[s31][s32] = 1;\n\t\tpgrid[s31][s32 + 1] = 1;\n\t\tpgrid[s31][s32 + 2] = 1;\n\n\t\t// Places the ship of length 1\n\t\tint s21 = (int) (Math.random() * 10);\n\t\tint s22 = (int) (Math.random() * 9);\n\t\twhile (pgrid[s21][s22] == 1 || pgrid[s21][s22 + 1] == 1) { // prevents\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overlaps\n\t\t\ts21 = (int) (Math.random() * 10);\n\t\t\ts22 = (int) (Math.random() * 9);\n\t\t}\n\t\tpgrid[s21][s22] = 1;\n\t\tpgrid[s21][s22 + 1] = 1;\n\n\t}", "public void addSpaceStation()\n\t{\n\t\t//if a space station is already spawned, one will not be added\n\n\t\tgameObj.add(new SpaceStation(getHeight(), getWidth()));\n\t\tSystem.out.println(\"Space station added\");\n\t\tnotifyObservers();\n\t}", "public void move()\n {\n universe.erase(this);\n \n // compute new position\n \n yPosition += ySpeed;\n xPosition += xSpeed;\n\n // check if it has hit the ground\n if(yPosition >= (groundPosition - diameter) && ySpeed > 0) {\n yPosition = groundPosition - diameter;\n ySpeed = -ySpeed; \n }\n // check if top\n if(yPosition <= 0 && ySpeed < 0){\n ySpeed = -ySpeed; \n }\n //check right\n if(xPosition >= (universe.getLength() - diameter) && xSpeed >0){\n xSpeed = -xSpeed;\n }\n //check left\n if(xPosition <= 0 && xSpeed < 0){\n xSpeed = -xSpeed;\n }\n \n // draw again at new position\n universe.draw(this);\n }", "public void moveSpaceShipDown() {\n\t\tSpaceship sp = getTheSpaceship();\n\t\tsp.moveDown();\n\t}", "public Spaceship(int x, int y)\r\n\t{\r\n\t\tsuper(x, y);\r\n\t}", "public ShipSpecScreen(GameEnvironment game) {\n\t\tthis.game = game;\n\t\tthis.ship = game.getSelectedShip();\n\t\tinitialize();\n\t\tfillIdentity();\n\t\tfrmShip.setVisible(true);\n\t\t\n\t}", "public F2_Ship4() {\n\n setH(100);\n setW(50); //Set the size of the ship\n\n setArt(\"Art/SpaceShips/Faction2/Ship4.png\"); //Set the artwork of the ship\n }", "@Test\n void should_place_ships_scenario_2() {\n Board board = BoardData.getBoard(15, 15);\n\n List<ShipType> shipConfigs = Arrays.asList(\n ShipType.ONE,\n ShipType.ONE,\n ShipType.ONE,\n ShipType.ONE,\n ShipType.TWO,\n ShipType.TWO\n );\n\n AutomaticShipPlacer automaticShipPlacer = new AutomaticShipPlacer();\n automaticShipPlacer.placeShips(shipConfigs, board);\n\n assertSame(6, board.getShips().size());\n BoardPrinter.print(board);\n }", "public void place(float x,float y){\n\t\tz=0.2f+Main.world.land.getHigh(Main.world.timeline.getTerra(),(int)x, (int)y);\r\n\t\tMain.world.contacts(this);\r\n\t\tz+=getTopObjects();\r\n\t\tplace(x,y,z);\r\n\t}", "public void PlaceRandomBoard(){\r\n\r\n\t\tString whichShip;\r\n\t\tString coordinate;\r\n\t\t\r\n\t\t\t// Display the random board and the random board menu \r\n\t\t// DISPLAY BOARDS!!!!!\r\n\t\tint whichInput=0;\r\n\t\tShip temp = new Ship();\r\n\t\tRandom generator = new Random();\r\n\t\tint randomIndex = generator.nextInt();\r\n\t\twhile (!this.myBoard.carrier.placed || !this.myBoard.battleship.placed\r\n\t\t\t\t|| !this.myBoard.cruiser.placed || !this.myBoard.submarine.placed\r\n\t\t\t\t|| !this.myBoard.patrolboat.placed) {\r\n\r\n\t\t\twhichInput++;\r\n\r\n\t\t\twhichShip = String.valueOf(whichInput);\r\n\t\t\t\r\n\t\t\tint direction=0;\r\n\r\n\t\t\tboolean placed = false;\r\n\t\t\twhile (!placed) {\r\n\t\t\t\trandomIndex = generator.nextInt(10);\r\n\t\t\t\tcoordinate = this.indexToLetter(randomIndex);\r\n\t\t\t\tcoordinate += String.valueOf(generator.nextInt(10)+1);\r\n\t\t\t\tdirection = generator.nextInt(4) + 1;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tswitch (Integer.parseInt(whichShip)) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\ttemp = new Carrier();\r\n\t\t\t\t\ttemp.name=\"Carrier\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\ttemp = new Battleship();\r\n\t\t\t\t\ttemp.name=\"Battleship\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\ttemp = new Cruiser();\r\n\t\t\t\t\ttemp.name=\"Cruiser\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\ttemp = new Submarine();\r\n\t\t\t\t\ttemp.name=\"Submarine\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\ttemp = new PatrolBoat();\r\n\t\t\t\t\ttemp.name=\"Patrol Boat\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\tplaced = this.validateShipPlacement(temp, coordinate, direction);\r\n\r\n\t\t\t\tif (placed) {\r\n\t//\t\t\t\tSystem.out.println(\"Success\");\r\n\t\t\t\t\tthis.placeShip(temp, coordinate, direction);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t//\t\t\t\tdisplay.scroll(\"Invalid coordinate, please enter another\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "final protected void setSpawnPosition(int newX, int newY)\n {\n spawnPoint = new Point(newX, newY);\n boundingBox.setLocation(spawnPoint);\n }", "public Ship getShip() {\r\n\t\treturn ship;\r\n\t}", "public Ship getShip() {\r\n\t\treturn ship;\r\n\t}", "public void placeShip(int startTileX ,int startTileY , int orient,Tile myTiles[][],int size, boolean verbose)\n {\n if (orient ==0 ){\n for (int i=0; i<size; i++) { \n if (myTiles[startTileX+i][startTileY].getType() == Tile.Type.Sea){\n myTiles[startTileX+i][startTileY].setType(Tile.Type.Ship);\n }\n } \n }\n \n else if ( orient == 1) \n {\n for(int i=0; i<size; i++) { \n if (myTiles[startTileX][startTileY + i].getType() == Tile.Type.Sea){\n myTiles[startTileX][startTileY + i].setType(Tile.Type.Ship);\n }\n }\n }\n }", "private void updateAsteroidToShip(Toroidal2DPhysics space) {\n\t\tList<Asteroid> finishedAsteroids = new ArrayList<Asteroid>();\n\t\tAsteroid asteroid;\n\t\tShip ship; // Reference to ship assigned\n\t\t\n\t\tfor (UUID asteroidId : asteroidToShip.keySet()) {\n\t\t\tasteroid = (Asteroid) space.getObjectById(asteroidId);\n\t\t\t\n\t\t\tif(asteroidToShip.get(asteroid.getId()) != null ) {\n\t\t\t\tship = (Ship) space.getObjectById(asteroidToShip.get(asteroid.getId()).getId());\n\t\t\t\t\n\t\t\t\tif (asteroid == null || !(asteroid.isAlive()) || asteroid.isMoveable() || ship.getEnergy() < WorldKnowledge.ENERGY_THRESHOLD || \n\t\t\t\t\t\t(shipToNavigator.get(ship.getId()).getGoalObjectUUID() == null && !(asteroidId.equals(shipToNavigator.\n\t\t\t\t\t\t\t\tget(ship.getId()).getGoalObjectUUID())))) {\n\t \t\t\t\tfinishedAsteroids.add(asteroid);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (Asteroid asteroidElement : finishedAsteroids) { // Delete asteroid from map\n\t\t\tasteroidToShip.remove(asteroidElement.getId());\n\t\t}\n\t}", "public void addPassengerShip(Scanner sc){\n PassengerShip pShip = new PassengerShip(sc, portMap, shipMap, dockMap);\n if(hashMap.containsKey(pShip.getParent())){\n if(hashMap.get(pShip.getParent()).getIndex()>=10000 && hashMap.get(pShip.getParent()).getIndex() < 20000){\n currentPort = (SeaPort) hashMap.get(pShip.getParent());\n currentPort.setShips(pShip);\n currentPort.setAllShips(pShip);\n \n }\n else{\n currentDock = (Dock) hashMap.get(pShip.getParent());\n currentDock.addShip(pShip);\n currentPort = (SeaPort) hashMap.get(currentDock.getParent());\n currentPort.setAllShips(pShip);\n }\n \n \n }\n hashMap.put(pShip.getIndex(), pShip);\n shipMap.put(pShip.getIndex(), pShip);\n everything.add(pShip);\n }", "public Ship(List<Coordinate> coordinates) {\n\t\tfor (Coordinate coordinate : coordinates) {\n\t\t\tcoordinate.setIsHit(false);\n\t\t\tcoordinate.setIsSunk(false);\n\t\t}\n\t\tshipPositions = coordinates;\n\t}", "public Ship(int indexX, int indexY) {\n this(indexX, indexY, indexX, indexY);\n }", "protected void placeAllShipsRandomly(){\n ArrayList<Ship> shipArrayList = initiateShips();\n Random random = new Random();\n int row;\n int col;\n boolean orientation;\n //place battleship first\n for (Ship ship: shipArrayList){\n row = random.nextInt(10);\n col = random.nextInt(10);\n orientation = random.nextBoolean();\n\n while(!ship.okToPlaceShipAt(row, col, orientation,this)){\n row = random.nextInt(10);\n col = random.nextInt(10);\n orientation = random.nextBoolean();\n }\n\n ship.placeShipAt(row,col,orientation,this);\n }\n\n }", "public void createIsipship() {\r\n\t\tRandom randomGenerator = new Random();\r\n\t\tint posX = 840;\r\n\t\tint randomPosY = randomGenerator.nextInt(480); \r\n\t\tIsipEngineer isipEngineer = new IsipEngineer(posX, randomPosY);\r\n\t\tisipShips.add(isipEngineer);\r\n\t\t//rectangles.add(isipEngineer.r);\r\n\t}", "public static void setUpGamePlayer() {\r\n String orientation; \r\n int xCoord;\r\n int yCoord;\r\n \r\n System.out.println(\"Let's place your ships on this \" + gameBoardPlayer.length + \"\"\r\n + \" by \" + gameBoardPlayer[0].length + \" board!\");\r\n \r\n displayBoard(gameBoardPlayer);\r\n \r\n System.out.println(\"\\n - - - - - - - - - - - - - - - - - - - \\n\");\r\n System.out.print(\"Position ships randomly (r) or manually (m): \");\r\n String choice = scan.next();\r\n \r\n // randomly places ships\r\n if (choice.equalsIgnoreCase(\"r\")) {\r\n System.out.println(\"Outcome: \");\r\n for (int i = 0; i < fleet.length; i++) {\r\n int random = (int)(Math.random() * 10);\r\n //0 - 4: ships placed horizontally, 5 - 9: ships placed vertically\r\n if (random < 5) {\r\n placeShipHorzRand(gameBoardPlayer, fleet[i], symbols[i]);\r\n }\r\n else {\r\n placeShipVertRand(gameBoardPlayer, fleet[i], symbols[i]);\r\n }\r\n }\r\n // display after all ships are randomly placed\r\n displayBoard(gameBoardPlayer);\r\n }\r\n // player chooses location for each ship\r\n else {\r\n for (int i = 0; i < fleet.length; i++) {\r\n System.out.println();\r\n displayBoard(gameBoardPlayer);\r\n System.out.println();\r\n System.out.println(\"Current ship: \" + fleet[i].getTitle());\r\n System.out.println(\"Length: \" + fleet[i].getLength());\r\n System.out.println();\r\n System.out.print(\"Place vertically (v) or horizontally (h): \");\r\n orientation = scan.next();\r\n System.out.print(\"Starting x-coordinate: \");\r\n xCoord = scan.nextInt();\r\n System.out.print(\"Starting y-coordinate: \");\r\n yCoord = scan.nextInt();\r\n \r\n if (orientation.equalsIgnoreCase(\"h\")) {\r\n placeShipHorzMan(gameBoardPlayer, fleet[i], symbols[i], xCoord, yCoord);\r\n }\r\n else {\r\n placeShipVertMan(gameBoardPlayer, fleet[i], symbols[i], xCoord, yCoord);\r\n }\r\n }\r\n }\r\n System.out.print(\"\\nComplete!! Now the computer is setting up . . .\");\r\n \r\n }", "public void assignBaseToShip(Ship ship, Base base) {\n\t\tbaseToShip.put(base.getId(), ship);\n\t}", "public void insertShipment(String custType, int xCoord, int yCoord, int capacity,int shipmentIndex)\r\n\t{\r\n\t\tVRPBShipment thisShip = new VRPBShipment(custType, xCoord, yCoord, capacity,shipmentIndex); //creates shipment\r\n\t\t//System.out.println(custType);\r\n\t\tinsertLast(thisShip); //and adds it to the linked list\r\n\t}", "PositionedObject(){\n float x = DrawingHelper.getGameViewWidth()/2;\n float y = DrawingHelper.getGameViewHeight()/2;\n _position.set(x,y);\n }", "private void setShips() {\n //This clears the board. To \"Invalidate\"\n for (int x = 0; x < maxN; x++) {\n for (int y = 0; y < maxN; y++) {\n ivCell[x][y].setBackgroundResource(gridID);\n }\n }\n\n for (Ship s : ships) {\n for (int i = 0; i < s.getShipSize(); i++) {\n if(player)ivCell[s.getBodyLocationPoints()[i].x][s.getBodyLocationPoints()[i].y].setBackgroundResource(s.getBodyResources()[i]);\n updateOccupiedCells(s.getBodyLocationPoints());\n }\n }\n\n }", "@Override\r\n\tpublic synchronized void arrive (Ship ship) {\r\n\t\tsuper.arrive(ship);\r\n\t\t// notify pilots looking for a ship potentially!\r\n\t\tnotifyAll();\r\n\t}", "@Override\n\tpublic void update() {\n\t\tcanBuild = true;\n\t\tfor (Ship s : SceneManager.sm.currSector.ships) {\n\t\t\tif (!s.isPlayer) {\n\t\t\t\tif (s.cm.distanceTo(p.cm) < 2500) {\n\t\t\t\t\tcanBuild = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (SceneManager.sm.endSector.clear && SceneManager.sm.currSector.pos.isSame(SceneManager.sm.endSector.pos)) {\n\t\t\tSystem.out.println(\"Game WON\");\n\t\t\tthis.setActive(false);\n\t\t\tSceneManager.ws.setActive(true);\n\t\t}\n\t\tif (p.destroyed) {\n\t\t\tSystem.out.println(\"Game LOST\");\n\t\t\tthis.setActive(false);\n\t\t\tSceneManager.ls.setActive(true);\n\t\t}\n\n\t\tshipYard.update();\n\t\tstarMap.update();\n\n\t\t// TODO remove before flight: to draw where mouse is - temp\n\t\t// if (InputManager.mouse[2]) {\n\t\t// System.out.println(InputManager.mPos.toString());\n\t\t// }\n\n\t\tif (InputManager.keys[81])\n\t\t\tp.cmdRotate(false);\n\t\tif (InputManager.keys[69])\n\t\t\tp.cmdRotate(true);\n\t\tif (InputManager.keys[87])\n\t\t\tp.cmdMove(0, 1);\n\t\tif (InputManager.keys[83])\n\t\t\tp.cmdMove(2, 1);\n\t\tif (InputManager.keys[65])\n\t\t\tp.cmdMove(3, 1);\n\t\tif (InputManager.keys[68])\n\t\t\tp.cmdMove(1, 1);\n\t\tif (InputManager.keys[38]) {\n\t\t\tCamera.yOff += 10 * (1 / Camera.scale);\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t}\n\t\tif (InputManager.keys[40]) {\n\t\t\tCamera.yOff -= 10 * (1 / Camera.scale);\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t}\n\t\tif (InputManager.keys[39]) {\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t\tCamera.xOff -= 10 * (1 / Camera.scale);\n\t\t}\n\t\tif (InputManager.keys[37]) {\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t\tCamera.xOff += 10 * (1 / Camera.scale);\n\t\t}\n\n\t\t// key to go to build area - b\n\t\tif (canBuild && InputManager.keysReleased[66] || shipYard.clicked) {\n\t\t\tswtichToBuild();\n\t\t}\n\t\tif (InputManager.keysReleased[77] || starMap.clicked) {\n\t\t\tswtichToStarMap();\n\t\t}\n\t\t\n\t\t// key to select a ship - no use atm\n\t\tif (InputManager.mouse[1]) {\n\t\t\t//selected = SceneManager.sm.currSector.getClickShip();\n\t\t\t// now have a ship selected\n\t\t}\n\t\t\n\t\tif(InputManager.keysReleased[32]) {\n\t\t\tcamFocus = p.cm;\n\t\t}\n\n\t\t// key to move the camera to a ship or area\n\t\tif (InputManager.mouseReleased[2]) {\n\t\t\teyeFocused = false;\n\t\t\tif(SceneManager.sm.currSector.getClickShip() != null)\n\t\t\t{\n\t\t\t\tcamFocus = SceneManager.sm.currSector.getClickShip().cm;\n\t\t\t}else if(Camera.toScreen(eyeLoc).distanceTo(InputManager.mPos) < 40){\n\t\t\t\tcamFocus = eyeLoc;\n\t\t\t\teyeFocused = true;\n\t\t\t}else {\n\t\t\t\tcamFocus = Camera.toMap(InputManager.mPos.x, InputManager.mPos.y);\n\t\t\t}\n\t\t}\n\t\tif (partTarget != null && partTarget.health <= 0)\n\t\t\tpartTarget = null;\n\n\t\tif (partTarget == null && target != null)\n\t\t\tp.shoot(target);\n\n\t\tif (partTarget == null && target == null)\n\t\t\tp.ceaseFire();\n\n\t\tif (target != null && InputManager.mouseReleased[3] && !target.destroyed) {\n\t\t\tpartTarget = SceneManager.sm.currSector.getClickShipPart(target);\n\t\t\tp.shoot(partTarget);\n\t\t}\n\n\t\tif (InputManager.mouseReleased[3]) {\n\t\t\ttarget = SceneManager.sm.currSector.getClickShip();\n\t\t\tif (target != null && partTarget == null) {\n\t\t\t\tp.shoot(target);\n\t\t\t}\n\t\t}\n\t\tif (target != null && (target.destroyed || target.isPlayer)) {\n\t\t\ttarget = null;\n\t\t\tpartTarget = null;\n\t\t\tp.ceaseFire();\n\t\t}\n\n\t\tif (camFocus != null)\n\t\t\tCamera.focus(camFocus);\n\t\t// if(selected != null) selected.vel.print();\n\n\t\tSceneManager.sm.currSector.update();\n\t}", "public void shipDestroyed() {\r\n\t\tplaceDebris(ship.getX(), ship.getY());\r\n\r\n\t\t// Null out the ship\r\n\t\tship = null;\r\n\r\n\t\topenShipSound();\r\n\r\n\t\t// Decrement lives\r\n\t\tlives--;\r\n\t\tdisplay.setLives(lives);\r\n\r\n\t\t// Since the ship was destroyed, schedule a transition\r\n\t\tscheduleTransition(END_DELAY);\r\n\t}", "public void setPosition(float x, float y);" ]
[ "0.722217", "0.68478346", "0.66322595", "0.66267216", "0.6506968", "0.64849716", "0.6409253", "0.6378425", "0.63259554", "0.6284999", "0.62723994", "0.62689537", "0.62665594", "0.6233731", "0.621067", "0.6161366", "0.6122554", "0.6112514", "0.6106764", "0.60997826", "0.6093412", "0.60692966", "0.60650617", "0.6048824", "0.60402185", "0.6023324", "0.59960145", "0.59943956", "0.5991827", "0.5958582", "0.59309566", "0.59266984", "0.59167767", "0.5901773", "0.58986735", "0.5859511", "0.58473915", "0.58352727", "0.5798703", "0.57863784", "0.5781952", "0.57788926", "0.5741368", "0.5711685", "0.5699889", "0.56993824", "0.56972986", "0.5686607", "0.5682665", "0.5671617", "0.56682587", "0.56602454", "0.564793", "0.5634099", "0.5632087", "0.56168", "0.56013274", "0.5594699", "0.55945444", "0.5591996", "0.5587794", "0.5562734", "0.5561506", "0.5560044", "0.5549396", "0.5541506", "0.55257183", "0.55192775", "0.5516278", "0.55145216", "0.55082893", "0.55027294", "0.54955566", "0.5485565", "0.54840046", "0.54764944", "0.54729885", "0.54697526", "0.5468211", "0.54615045", "0.54591364", "0.545437", "0.5449652", "0.5449652", "0.54288834", "0.5427113", "0.54259646", "0.5424171", "0.54138607", "0.54105026", "0.5409952", "0.5406075", "0.5399375", "0.5398107", "0.5395543", "0.53880733", "0.5384866", "0.5363463", "0.53531986", "0.5351737" ]
0.82363135
0
Places 3 debris objects and sets them all to expire slightly apart from each other
private void placeDebris(double x, double y) { // Place three Debris objects int variety = RANDOM.nextInt(4); Debris d = new Debris(x, y, variety); d.setVelocity(RANDOM.nextInt(16) / 10 + 1, 20); variety = RANDOM.nextInt(4); Debris d2 = new Debris(x + 5, y + 5, variety); d2.setVelocity(RANDOM.nextInt(16) / 10 + 1, 10); variety = RANDOM.nextInt(4); Debris d3 = new Debris(x - 5, y - 5, variety); d3.setVelocity(RANDOM.nextInt(16) / 10 + 1, -20); // Add the Debris objects as participants addParticipant(d); addParticipant(d2); addParticipant(d3); // Expire the three debris objects after 2 seconds new ParticipantCountdownTimer(d, 2000); new ParticipantCountdownTimer(d2, 2100); new ParticipantCountdownTimer(d3, 2200); // Place a dust object at the site of the debris placeDust(x, y); display.setLegend(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBoostExpiration(){\r\n\t\tboostExpiration = GameController.getTimer() + 1000000000l * length;\r\n\t}", "public void removeExpiredAuctions(){\r\n ArrayList <String> expiredAuction = new ArrayList <String>(super.size());\r\n for(String expiredKey: keySet()){\r\n if(getAuction(expiredKey).getTimeRemaining() == 0){\r\n expiredAuction.add(expiredKey);\r\n }\r\n } \r\n for(String expiredKey: expiredAuction){\r\n super.remove(expiredKey);\r\n }\r\n }", "public void mraiExpire() {\n for (int tDest : this.dirtyDest) {\n this.sendUpdate(tDest);\n }\n this.dirtyDest.clear();\n }", "@Override\n public void setExpiration( Date arg0)\n {\n \n }", "public void renew(){\n kickOut();\n cashOut();\n for(Player player: players){\n player.renew();\n }\n dealer.renew();\n go();\n }", "public static void setAllDMAsWithInventory(String startDate, String endDate, List<ForcastInventoryObj> forcastInventoryObjList){ \n\t \tString key = ALL_DMA_WITH_INVENTORY_KEY+startDate+endDate;\n\t\t\tlog.info(\"setAllDMAsWithInventory : memcache key:\"+key);\t\t\t\n\t\t\tif(memcache !=null && memcache.contains(key)){\n\t \t\tmemcache.delete(key);\n\t \t}\n\t \tmemcache.put(key, forcastInventoryObjList, Expiration.byDeltaSeconds(expireInDay));\n\t\t}", "public abstract void expire();", "@SuppressWarnings(\"unused\")\n void expire();", "public void dropExplosives() {\n // Updates the time elapsed for each of the explosives\n for (int i=0; i<this.explosives.size(); i++) {\n Explosive dormantExplosive = this.explosives.get(i);\n dormantExplosive.increaseTime();\n }\n // If the Airplane has reached the end, doesn't detect any enemies\n // Isn't deleted straight away as it needs to wait for explosives to detonate\n if (super.outOfBounds()) {return;}\n this.timeElapsedDrop += ShadowDefend.getTimescale()/FPS;\n //Adds a new explosive\n if (this.timeElapsedDrop >= this.dropTime) {\n this.timeElapsedDrop = 0;\n Explosive newExplosive = new Explosive(super.getCenter());\n // Centers the explosive at the airplane's current position\n newExplosive.centerRectAt(super.getCenter());\n this.explosives.add(newExplosive);\n // Generates a new drop time in range\n this.dropTime = generateDropTime();\n this.numDropped++;\n }\n\n }", "@PostConstruct\n public void init() {\n if (revenueRepository.findAll().isEmpty()) {\n for (int i = 2; i < 20; i++) {\n Revenue revenue = new Revenue.RevenueBuilder()\n // TODO später durch Response von Reservation ersetzen\n// .withValue(12)\n .withTimestamp(new Date().getTime())\n .withSoldTicketsFirstClassInternet(i + 40)\n .withSoldTicketsEconomyClassInternet(i + 30)\n .withSoldTicketsFirstClassTravelOffice(i + 25)\n .withSoldTicketsEconomyClassTravelOffice(i + 47)\n .withSoldTicketsFirstClassCounter(i + 40)\n .withSoldTicketsEconomyClassCounter(i + 23)\n .withsoldTicketsBusinessClassStaff(i + 13)\n .withsoldTicketsBusinessClassCounter(i + 41)\n .withsoldTicketsBusinessClassTravelOffice(i + 54)\n .withSoldTicketsBusinessClassInternet(i + 68)\n .withsoldTicketsFirstClassStaff(i + 24)\n .withsoldTicketsEconomyClassStaff(i + 17)\n .withFlightId(UUID.randomUUID())\n .build();\n revenueRepository.save(revenue);\n }\n Revenue revenueSame = new Revenue.RevenueBuilder()\n .withTimestamp(1452759161549L)\n .withSoldTicketsFirstClassInternet(50)\n .withSoldTicketsEconomyClassInternet(80)\n .withSoldTicketsFirstClassTravelOffice(90)\n .withSoldTicketsEconomyClassTravelOffice(100)\n .withSoldTicketsFirstClassCounter(500)\n .withSoldTicketsEconomyClassCounter(100)\n .withsoldTicketsBusinessClassStaff(13)\n .withsoldTicketsBusinessClassCounter(41)\n .withsoldTicketsBusinessClassTravelOffice(54)\n .withSoldTicketsBusinessClassInternet(68)\n .withsoldTicketsFirstClassStaff(24)\n .withsoldTicketsEconomyClassStaff(17)\n .withFlightId(UUID.fromString(\"9aacad96-6730-4443-b6f6-33325b00ce39\"))\n .build();\n revenueRepository.save(revenueSame);\n }\n }", "protected void scheduleExpiry()\n {\n long dtExpiry = 0L;\n int cDelay = OldOldCache.this.m_cExpiryDelay;\n if (cDelay > 0)\n {\n dtExpiry = getSafeTimeMillis() + cDelay;\n }\n setExpiryMillis(dtExpiry);\n }", "protected abstract void _set(String key, Object obj, Date expires);", "synchronized void setExpiration(long newExpiration) {\n \texpiration = newExpiration;\n }", "public static void setDFPSitesWithDMAObjs(List<DFPSitesWithDMAObj> DFPSitesWithDMAObjList){ \n\t \tString key = DFP_SITES_WITH_DMA_OBJS_KEY;\n\t\t\tlog.info(\"setDFPSitesWithDMAObjs : memcache key:\"+key);\t\t\t\n\t\t\tif(memcache !=null && memcache.contains(key)){\n\t \t\tmemcache.delete(key);\n\t \t}\n\t \tmemcache.put(key, DFPSitesWithDMAObjList, Expiration.byDeltaSeconds(expireInDay));\n\t\t}", "@Override\n public void cleanup() {\n for (String key : cache.keySet()) {\n CacheObject co = cache.get(key).get();\n if (co.isExpired()) {\n synchronized (co) {\n if (co.isExpired()) {\n cache.remove(key);\n queue.add(co);\n }\n }\n }\n }\n\n }", "public static void setAllocateInventry(String startDate, String endDate, String codeListstr, List<ForcastInventoryObj> forcastInventoryObjList){ \n\t \tString hashedKeyPart = StringUtil.getHashedValue(startDate+endDate+codeListstr);\n\t \tString key=ALL_ALLOCATE_INVENTORY_KEY+\"_\"+hashedKeyPart;\n\t\t\tlog.info(\"setAllocateInventry : memcache key:\"+key);\t\t\t\n\t\t\tif(memcache !=null && memcache.contains(key)){\n\t \t\tmemcache.delete(key);\n\t \t}\n\t \tmemcache.put(key, forcastInventoryObjList, Expiration.byDeltaSeconds(expireInDay));\n\t\t}", "public void ReservaEfetivadas () {\n Date hoje = new Date ();\n for (int z = 0; z < vecReserva.size(); z++) {\n if (((int) ((((entReserva)vecReserva.elementAt(z)).getDatain().getTime() - (hoje.getTime())) / 86400000L)) == 0){// Reserva será relaizada hj\n if (((entReserva)vecReserva.elementAt(z)).getPagamento().getSituacao() == 0){//Cliente fez todo o pagamento e o quarto será\n vecReservaEfetivadas.add(vecReserva.elementAt(z));\n }\n \n }\n }\n }", "public void updateOwners() {\n\t\tbuyOrder.getOwner().executedOrder(buyOrder,this);\n\t\tsellOrder.getOwner().executedOrder(sellOrder,this);\n\t}", "protected void deadlineLeasing() {\n log.info(\"OrdersBean : deadlineLeasing\");\n List<OrdersEntity> ordersEntitiesDeadline = ordersServices.findAllOrdersByIdUserAndStatusIsValidate(usersBean.getUsersEntity().getId());\n if (!ordersEntitiesDeadline.isEmpty()) {\n contractsBean.findAllContractsInAllMyOrdersForLeasingAndDeadlineIsLowerThan1Month(ordersEntitiesDeadline);\n }\n }", "boolean flush_all(int expire);", "public void setExpiryTime(java.util.Calendar param){\n localExpiryTimeTracker = true;\n \n this.localExpiryTime=param;\n \n\n }", "public static void purgeExpired()\n {\n Date now = new Date();\n List<DealWatchRecord> allRecords = getAllRecords(null);\n for (int i = 0; i < allRecords.size(); i++)\n {\n DealWatchRecord record = allRecords.get(i);\n if (record != null && record.expiration != null)\n {\n if (record.expiration.getTime() < now.getTime())\n {\n record.delete();\n }\n }\n }\n }", "public void setExpiry(int expiry)\n {\n this.expiry = expiry;\n }", "@Override\n public Date getExpiration()\n {\n return null;\n }", "@Override\n public final void setExpiration(double expirationTime) {\n safetyHelper.setExpiration(expirationTime);\n }", "private void expire()\n\t{\n\t\tif (m_expire != 0 && m_timeExp < System.currentTimeMillis())\n\t\t{\n\t\t//\tSystem.out.println (\"------------ Expired: \" + getName() + \" --------------------\");\n\t\t\treset();\n\t\t}\n\t}", "@Autowired\n\tpublic void setExpiry(@Value(\"${repair.expiry}\") Duration expiry) {\n\t\tthis.expiry = DurationConverter.oneOrMore(expiry);\n\t}", "private void expire(final boolean byType) {\n LOG.info(\"expiring cache...\");\n\n try {\n CacheManager cacheManager = _db.getCacheManager();\n if (byType) {\n Class[] typeArray = new Class[5];\n typeArray[0] = LazyContract.class;\n typeArray[1] = LazyContractCategory.class;\n typeArray[2] = LazyPayRoll.class;\n typeArray[3] = LazyAddress.class;\n typeArray[4] = LazyEmployee.class;\n cacheManager.expireCache(typeArray);\n } else {\n Object[] identityArray = new Object[1];\n identityArray[0] = new Identity(\"First\", \"Person\");\n cacheManager.expireCache(LazyEmployee.class, identityArray);\n }\n } catch (Exception e) {\n LOG.error(\"expireCache: exception encountered clearing cache\", e);\n }\n }", "@SuppressWarnings({ \"deprecation\", \"unchecked\" })\r\n\tpublic void init() throws Exception{\r\n\t\tAsset CurrentAsset;\r\ndouble TotalAmount = CurrentPortfolio.getTotalAmount(CurrentDate);\r\nCurrentPortfolio.sellAssetCollection(CurrentDate);\r\n\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"US large cap\");\r\nCurrentAsset.setClassID(getAssetClassID(\"US Equity\"));\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"^GSPC\", TotalAmount/7,\r\n\t\tCurrentDate);\r\n\t\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"IUS small cap\");\r\nCurrentAsset.setClassID(52l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"^RUT\", TotalAmount /7,\r\n\t\tCurrentDate);\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"International Equity\");\r\nCurrentAsset.setClassID(9l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"VGTSX\", TotalAmount /7,CurrentDate);\r\n\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"Real Estate\");\r\nCurrentAsset.setClassID(5l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"VGSIX\",\r\n\t\tTotalAmount /7, CurrentDate);\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"Commodity\");\r\nCurrentAsset.setClassID(getAssetClassID(\"Commodity\"));\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"QRAAX\",\r\n\t\tTotalAmount /7, CurrentDate);\r\n\r\n\r\n\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"Cash\");\r\nCurrentAsset.setClassID(3l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"CASH\",\r\n\t\tTotalAmount /7, CurrentDate);\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"US Bond\");\r\nCurrentAsset.setClassID(2l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"VBMFX\", TotalAmount /7,\r\n\t\tCurrentDate);\r\n\r\ninitialAmount=TotalAmount;\r\nwithdrawRate=0.05;\r\n\t}", "public void helpersExpirerTick() {\n Iterator<Helper> iter = helpers.iterator();\n long currentTime = System.currentTimeMillis();\n while (iter.hasNext()) {\n Helper helper = iter.next();\n if (helper.getExpireTimestamp() <= currentTime) {\n notifyExpire(helper);\n iter.remove();\n removeFromCache(helper);\n }\n }\n }", "protected void deallocate() {\r\n\t\t// create a list of objects ordered by the time of last access\r\n\t\tList<ObjectStatus> timeOrderedObjects = getListOfObjectClassTimeSorted();\r\n\t\twhile (!sizeNormal() && timeOrderedObjects.size() > 0) {\r\n\t\t\t// take the least recently used object and remove it from the list\r\n\t\t\tString currentObjectID = timeOrderedObjects.remove(0).getID();\r\n\t\t\t// kill that object in the ever seen so\r\n\t\t\t// it would be treated as a dead object from now on\r\n\t\t\tkillObject(currentObjectID);\r\n\t\t\tdeallocate(currentObjectID);\r\n\r\n\t\t}\r\n\r\n\t}", "public void imprimirBilletes()\n {\n maquina1.insertarDinero(800);\n maquina2.insertarDinero(800);\n maquina1.imprimirTicket();\n maquina2.imprimirTicket();\n }", "private void updateEISAndEAS(){\n eas.registerPayment(paymentDTO);\n eis.updateInventory(saleDTO);\n }", "private void clearExpires() {\n bitField0_ = (bitField0_ & ~0x00000004);\n expires_ = 0L;\n }", "private void updatePrice() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tfor(int i = first;i<last;i++){\r\n\t\t\tProduct product = products.get(i);\r\n\t\t\tproduct.setPrivce(product.getPrivce()*(1+increment));\r\n\t\t}\r\n\t\t\r\n\t}", "@Scheduled(cron = \"0 0 0 * * ?\")\n\tpublic void executeMaturityTrades() {\n\t\tfinal Stream<Trade> maturedTrades = this.getTrades().stream()\n\t\t\t\t.filter(item -> item.getmDate().before(DateTimeUtils.getTodayDate()));\n\t\tmaturedTrades.forEachOrdered(item -> item.setExpired('Y'));\n\t\tSystem.out.println(\"All matured trades set to exprired.\");\n\t}", "@Scheduled(cron = \"0 0 1 * * *\")\n\tpublic void removeExpiredPremiumUsers(){\n\t\tIterable <User> users = userDao.findAll();\n\t\tDate now = new Date();\n\t\t\n\t\tfor (User user : users){\n\t\t\tif (user.isPremium()){\n\t\t\t\ttry{\n\t\t\t\t\tif(user.getPremiumExpiryDate().before(now)){\n\t\t\t\t\t\tuser.removePremium();\n\t\t\t\t\t\tuserDao.save(user);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tcatch(Exception e){\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void makeDeposit() {\n\t\t\r\n\t}", "public void DeductCharges () {\r\n\r\n\t\tdouble Temp = 0;\r\n\r\n\t\tfor ( Map.Entry<String, Double> CA : _ChargeAmounts.entrySet() ) {\r\n\r\n\t\t\tTemp += CA.getValue();;\r\n\r\n\t\t}\r\n\r\n\t\t_MonthlyChargeAmounts.put( _Tick.getMonthNumber(), Temp );\r\n\r\n\t\t_FundValue -= Temp;\r\n\r\n\t\tSystem.out.println( \"\\t\\t\\t \" + _Name + \" After Charges : \" + _FundValue );\r\n\t}", "private void renewTimes() {\n String time_morgens_new = time_prefs.getString(\"time_morgens\", getResources().getString(R.string.default_morgens));\n String time_mittags_new = time_prefs.getString(\"time_mittags\", getResources().getString(R.string.default_mittags));\n String time_abends_new = time_prefs.getString(\"time_abends\", getResources().getString(R.string.default_abends));\n String time_zur_nacht_new = time_prefs.getString(\"time_morgens\", getResources().getString(R.string.default_morgens));\n /*comparison of class local time variblaes with new Preferences\n deletes alarms affected medicines and creates new alarms for them\n */\n\n if (!time_morgens.equals(time_morgens_new)) {\n //list all affected Meds and iterate for each\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Morgens\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n\n if (!time_mittags.equals(time_mittags_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Mittags\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n if (!time_abends.equals(time_abends_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Abends\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n if (!time_zur_nacht.equals(time_zur_nacht_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Morgens\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n }", "@Test\n\tvoid purchaseTest() {\n\t\ttestCrew.setMoney(10000);\n\t\tfor(MedicalItem item: itemList) {\n\t\t\tint currentMoney = testCrew.getMoney();\n\t\t\titem.purchase(testCrew);\n\t\t\tassertEquals(testCrew.getMoney(), currentMoney - item.getPrice());\n\t\t\tassertTrue(testCrew.getMedicalItems().get(0).getClass().isAssignableFrom(item.getClass()));\n\t\t\ttestCrew.removeFromMedicalItems(testCrew.getMedicalItems().get(0));\n\t\t}\n\t}", "void cleanUpExpiredSessions() {\n try (TarantoolClient client = clientSource.getClient()) {\n client.select(getSpace(client), SPACE_EXPIRY_INDEX, Integer.MAX_VALUE, 0, Iter.LE);\n client.setLong(System.currentTimeMillis());\n Result result = client.execute();\n Set<UUID> ids = new HashSet<>();\n while (result.next()) {\n ids.add(new UUID(result.getLong(2), result.getLong(3)));\n }\n ids.forEach(id -> deleteById(id, client));\n if (logger.isDebugEnabled()) {\n logger.debug(\"Cleaned up \" + ids.size() + \" expired sessions\");\n }\n }\n }", "private static void cleanLeaseCache(Map<HashPair, Lease> tc) {\n for (Iterator<Lease> iter = tc.values().iterator(); iter.hasNext(); ) {\n Lease l = iter.next();\n if (l.isExpired(Router.CLOCK_FUDGE_FACTOR))\n iter.remove();\n }\n }", "public void setExpires(long expires)\r\n/* 224: */ {\r\n/* 225:338 */ setDate(\"Expires\", expires);\r\n/* 226: */ }", "@SuppressWarnings(\"rawtypes\")\n @BeforeEach\n public void setUp() \n {\n // Clean up from previous tests\n tariffRepo.recycle();\n timeslotRepo.recycle();\n brokerRepo.recycle();\n reset(mockProxy);\n reset(mockServerProperties);\n\n // create a Competition, needed for initialization\n comp = Competition.newInstance(\"accounting-test\");\n \n // set the clock\n //Instant now = new DateTime(2011, 1, 26, 12, 0, 0, 0, DateTimeZone.UTC).toInstant();\n Instant now = Competition.currentCompetition().getSimulationBaseTime(); \n now = now.plus(TimeService.HOUR);\n timeService.setCurrentTime(now);\n \n // set up brokers and customers\n bob = new Broker(\"Bob\");\n brokerRepo.add(bob);\n jim = new Broker(\"Jim\");\n brokerRepo.add(jim);\n\n customerInfo1 = new CustomerInfo(\"downtown\", 42)\n .withPowerType(PowerType.CONSUMPTION);\n customerInfo2 = new CustomerInfo(\"suburbs\", 21)\n .withPowerType(PowerType.CONSUMPTION);\n customerInfo3 = new CustomerInfo(\"exburbs\", 11)\n .withPowerType(PowerType.CONSUMPTION);\n\n // set up tariffs - tariff1 for consumption, tariff2 for production\n Instant exp = now.plus(TimeService.WEEK * 10);\n TariffSpecification tariffSpec = new TariffSpecification(bob, PowerType.CONSUMPTION)\n .withExpiration(exp)\n .withMinDuration(TimeService.WEEK * 8)\n .withPeriodicPayment(0.02)\n .addRate(new Rate().withValue(0.121));\n tariffRepo.addSpecification(tariffSpec);\n tariffB1 = new Tariff(tariffSpec);\n tariffB1.init();\n tariffRepo.addTariff(tariffB1);\n\n tariffSpec = new TariffSpecification(bob, PowerType.CONSUMPTION)\n .withMinDuration(TimeService.WEEK * 8)\n .withExpiration(exp)\n .addRate(new Rate().withValue(0.09));\n tariffRepo.addSpecification(tariffSpec);\n tariffB2 = new Tariff(tariffSpec);\n tariffB2.init();\n tariffRepo.addTariff(tariffB2);\n tariffSpec = new TariffSpecification(jim, PowerType.CONSUMPTION)\n .withMinDuration(TimeService.WEEK * 8)\n .withExpiration(exp)\n .withPeriodicPayment(0.01)\n .addRate(new Rate().withValue(0.123));\n tariffRepo.addSpecification(tariffSpec);\n tariffJ1 = new Tariff(tariffSpec);\n tariffJ1.init();\n tariffRepo.addTariff(tariffJ1);\n \n // set up some timeslots\n timeslotRepo.makeTimeslot(now.minus(TimeService.HOUR));\n timeslotRepo.makeTimeslot(now);\n timeslotRepo.makeTimeslot(now.plus(TimeService.HOUR));\n timeslotRepo.makeTimeslot(now.plus(TimeService.HOUR * 2));\n\n // Set up serverProperties mock\n config = new Configurator();\n doAnswer(new Answer() {\n @Override\n public Object answer(InvocationOnMock invocation) {\n Object[] args = invocation.getArguments();\n config.configureSingleton(args[0]);\n return null;\n }\n }).when(mockServerProperties).configureMe(any());\n }", "public void withdrawAll() {\r\n for (int i = 0; i < container.capacity(); i++) {\r\n Item item = container.get(i);\r\n if (item == null) {\r\n continue;\r\n }\r\n int amount = owner.getInventory().getMaximumAdd(item);\r\n if (item.getCount() > amount) {\r\n item = new Item(item.getId(), amount);\r\n container.remove(item, false);\r\n owner.getInventory().add(item, false);\r\n } else {\r\n container.replace(null, i, false);\r\n owner.getInventory().add(item, false);\r\n }\r\n }\r\n container.update();\r\n owner.getInventory().update();\r\n }", "private void removeExpired() {\n Map<K,CacheableObject> removeMap = new HashMap<K,CacheableObject>(valueMap.size()/2);\n List<CacheListener<K>> tempListeners = new ArrayList<CacheListener<K>>();\n\n // Retrieve a list of everything that's to be removed\n synchronized(theLock) {\n for (Map.Entry<K,CacheableObject> entry : valueMap.entrySet()) {\n if (isExpired(entry.getValue())) {\n removeMap.put(entry.getKey(), entry.getValue());\n }\n }\n tempListeners.addAll(listeners);\n }\n\n // Remove the entries one-at-a-time, notifying the listener[s] in the process\n for (Map.Entry<K,CacheableObject> entry : removeMap.entrySet()) {\n synchronized(theLock) {\n currentCacheSize -= entry.getValue().containmentCount;\n valueMap.remove(entry.getKey());\n }\n Thread.yield();\n\n for (CacheListener<K> listener : tempListeners) {\n listener.expiredElement(entry.getKey());\n }\n }\n }", "@Override\n\tpublic void deposit() {\n\t\t\n\t}", "@Test\n void sellingDatePast() {\n int originalQuality = 10;\n Item[] items = new Item[]{\n new Item(\"single\", 5, originalQuality),\n new Item(\"double\", -1, originalQuality)\n };\n GildedRose app = new GildedRose(items);\n app.updateQuality();\n\n assertEquals(\"single\", app.items[0].name);\n assertTrue(originalQuality > app.items[0].quality, \"Quality should've dropped\");\n assertEquals(originalQuality - 1, app.items[0].quality, \"Quality should've dropped regularly\");\n\n assertEquals(\"double\", app.items[1].name);\n assertTrue(originalQuality > app.items[1].quality, \"Quality should've dropped\");\n assertEquals(originalQuality - 2, app.items[1].quality, \"Quality should've dropped twice as much\");\n }", "@Override\n\tvoid make_deposit(DataStore ds){\n\tds.setbalancedepositAccount1(ds.getbalanceAccount1_temp()+ds.getdepositAccount1());\n\t}", "long getExpiration();", "@Test\n public void testSubsequentUpdateTimestamp() {\n Product newProduct = TestUtil.createProduct();\n productCurator.create(newProduct);\n Pool pool = createPoolAndSub(owner, newProduct, 1L,\n TestUtil.createDate(2011, 3, 30),\n TestUtil.createDate(2022, 11, 29));\n \n pool = poolCurator.create(pool);\n \n // set updated to 10 minutes ago\n Calendar calendar = Calendar.getInstance();\n calendar.add(Calendar.MINUTE, -10);\n pool.setUpdated(calendar.getTime());\n \n Date updated = (Date) pool.getUpdated().clone();\n pool.setQuantity(23L);\n pool = poolCurator.merge(pool);\n \n assertFalse(updated.getTime() == pool.getUpdated().getTime());\n }", "public void resetSaleAndCostTracking() {\n for (int i = 0; i < stockList.size(); i++) {\r\n // If the beanBag object at the current position is \"isSold\" bool is true.\r\n if (((BeanBag) stockList.get(i)).isSold()) {\r\n // Remove beanBag object at that position from the \"stockList\".\r\n stockList.remove(i);\r\n }\r\n }\r\n }", "public void setExpireBefore(Duration expireBefore)\n {\n this.expireBefore = expireBefore;\n }", "public void resetDepartments() {\n\t\tHRDepartment.setInstance(HRDepartment.createInstance());\n\t\tProductionDepartment.setInstance(ProductionDepartment.createInstance());\n\t\tWarehousingDepartment.setInstance(WarehousingDepartment.createInstance());\n\t\tFinanceDepartment.setInstance(FinanceDepartment.createInstance());\n\t\tMarketingDepartment.setInstance(MarketingDepartment.createInstance());\n\t\tLogisticsDepartment.setInstance(LogisticsDepartment.createInstance());\n\t\tProductSupport.setInstance(ProductSupport.createInstance());\n\t\tSalesDepartment.setInstance(SalesDepartment.createInstance());\n\t\tResearchAndDevelopmentDepartment.setInstance(ResearchAndDevelopmentDepartment.createInstance());\n\t\tProcurementDepartment.setInstance(ProcurementDepartment.createInstance());\n\n\n\t\tCustomerSatisfaction.setInstance(CustomerSatisfaction.createInstance());\n\t\tCustomerDemand.setInstance(CustomerDemand.createInstance());\n\t\tExternalEvents.setInstance(ExternalEvents.createInstance());\n\t\tCompanyEcoIndex.setInstance(CompanyEcoIndex.createInstance());\n\t\tEmployeeGenerator.setInstance(EmployeeGenerator.createInstance());\n\t\tEmployeeGenerator.getInstance().setDepartment(HRDepartment.getInstance());\n\t\tInternalFleet.setInstance(InternalFleet.createInstance());\n\t\tBankingSystem.setInstance(BankingSystem.createInstance());\n\t}", "private void recycle() {\n attributes.clear();\n creationTime = 0L;\n expiring = false;\n id = null;\n lastAccessedTime = 0L;\n maxInactiveInterval = -1;\n\n isNew = false;\n valid = false;\n Manager savedManager = manager;\n manager = null;\n\n // Tell our Manager that this Session has been recycled\n if ((savedManager != null) && (savedManager instanceof ManagerBase))\n ((ManagerBase) savedManager).recycle(this);\n //setAuthType(null);\n //notes.clear();\n //setPrincipal(null);\n }", "private void saveObjects() {\n\t\tgo.setMeteors(meteors);\n\t\tgo.setExplosions(explosions);\n\t\tgo.setTargets(targets);\n\t\tgo.setRockets(rockets);\n\t\tgo.setCrosses(crosses);\n\t\tgo.setEarth(earth);\n\t}", "private void setExits() {\n doors.clear();\n for (int i = 0; i < mySize.getNumExits(); i++) {\n Door door = new Door();\n doors.add(door);\n }\n }", "private void actualizarEnemigosItems() {\n if(estadoMapa== EstadoMapa.RURAL || estadoMapa== EstadoMapa.RURALURBANO ){\n moverCamionetas();\n moverAves();\n }\n if(estadoMapa== EstadoMapa.URBANO || estadoMapa == EstadoMapa.URBANOUNIVERSIDAD){\n moverCarroLujo();\n moverAves();\n }\n if(estadoMapa== EstadoMapa.UNIVERSIDAD){\n moverCarritoGolf();\n moverAves();\n }\n if (estadoMapa == EstadoMapa.SALONES){\n moverLamparas();\n moverSillas();\n }\n actualizaPuntuacion();\n moverTareas();\n moverItemCorazon();\n verificarColisiones();\n verificarMuerte();\n moverItemRayo();\n /*\n IMPLEMENTAR\n\n //moverPajaro();\n //etc\n */\n }", "@Override\n public void cacheResult(List<EntityDealer> entityDealers) {\n for (EntityDealer entityDealer : entityDealers) {\n if (EntityCacheUtil.getResult(\n EntityDealerModelImpl.ENTITY_CACHE_ENABLED,\n EntityDealerImpl.class, entityDealer.getPrimaryKey()) == null) {\n cacheResult(entityDealer);\n } else {\n entityDealer.resetOriginalValues();\n }\n }\n }", "public void ventaBilleteMaquina2()\n {\n maquina2.insertMoney(600);\n maquina1.printTicket();\n }", "private void setItems()\n {\n sewers.setItem(rope); \n promenade.setItem(rope);\n bridge.setItem(potion);\n tower.setItem(potion);\n throneRoomEntrance.setItem(potion);\n depths.setItem(shovel);\n crypt.setItem(shovel);\n }", "void cacheTrades(Collection<Trade> trades);", "private void buy() {\n if (asset >= S_I.getPirce()) {\n Item item = S_I.buy();\n asset -= item.getPrice();\n S_I.setAsset(asset);\n } else {\n System.out.println(\"cannot afford\");\n }\n }", "public void bsetCostElements() {\n\t\t\t\n\t\t\t\n\t\tfor (int obj = 0; obj < finalLocation.length; obj++) {\n\t\t for (int time = 0; time < finalLocation[obj].length; time++) {\n\t\t\t\n\t\t bfCost[obj][time].bstorageCost=totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].bstorageCost;\n\t\t\t bfCost[obj][time].breadCost=totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].breadCost;\n\t\t\t bfCost[obj][time].bwriteCost=totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].bwriteCost;\n\t\t\t bfCost[obj][time].btranCost=totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].btranCost;\n\t\t\t \n\t\t\t //1. we calculate latency cost for two cases separately: when the object is in the hot tier or cool tier.\n\t\t\t if (finalLocation[obj][time]==0){//Object is in the cool tier\n\t\t\t\t bfCost[obj][time].bdelayCost=totalCostCalculation.btotalResidentCost[time][obj][0].bdelayCost;\n\t\t\t\t \n\t\t\t }else{// object is in both tiers and, in consequence, the latency cost of writes is the maximum latency of writing in both tiers, and the read latency is the one in hot tier.\n\t\t\t\t bfCost[obj][time].bedelCost=fc.bdelayMaxWriteReadCost(workloadGenerator.objectListRegion[obj], 1, obj, time);\n\t\t\t }\n\t\t\t \n\t\t /* 2. Here we calculate storage cost and transaction cost to make consistent data. This requires just write transaction. Since in our cost \n calculation make a computation for both read and writes.\n\t\t */\n\t\t \n\t\t if(finalLocation[obj][time]==1){//NOTE: in above cost storage, we calculate the cost of object in either in hot or cold tier. \n\t\t \t //So here we calculate the storage cost in cold tier when the object is in hot tier.\n\t\t \t bfCost[obj][time].bstorageCost=bfCost[obj][time].bstorageCost.add(totalCostCalculation.btotalResidentCost[time][obj][0].bstorageCost);\n\t\t bfCost[obj][time].bconsisCost=totalCostCalculation.btotalResidentCost[time][obj][0].bconsisCost;\n\t\t }\n\t\t\t bfCost[obj][time].bnonMigrationCost=bfCost[obj][time].bstorageCost.add(bfCost[obj][time].breadCost).add( bfCost[obj][time].bwriteCost).\n\t\t\t\t\t add(bfCost[obj][time].btranCost).add( bfCost[obj][time].bconsisCost).\n\t\t\t\t\t add(bfCost[obj][time].bdelayCost);\n\t\t\t\t\t //totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].bnonMigrationCost.add(bfCost[obj][time].bconsisCost);\n\t\t\t \n\t\t\t //3. We need to calculate just transfer cost between cold to hot tier. From hot to cold tier does not make sense because we have a copy of data in cold tier.\n\t\t if(breakPoint==1){//If breakPoint is ONE then for serving every user, the object for each time slot is transfered from Cold to Hot tier.\n\t\t \t \n\t\t }\n\t\t else if(time>0 && finalLocation[obj][time-1]==0 && finalLocation[obj][time]==1){\n\t\t\t bfCost[obj][time].bmigrationCost=totalCostCalculation.btotalMigrationCost[time][obj][finalLocation[obj][time-1]][finalLocation[obj][time]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public void addAndShift(){\n Requests.remove(0);\r\n float targetPrice;\r\n\r\n int sORb = rng.nextInt(2);\r\n if(sORb==0){\r\n targetPrice = (float)(((rng.nextGaussian())*sDev) + meanSellPrice + (sellVolume*sDev*0.03));\r\n if(targetPrice<0){\r\n targetPrice = 0;\r\n }\r\n int ass = ((rng.nextInt(4)+1)); \r\n int aType = rng.nextInt(3); \r\n switch(aType){\r\n case 0: Requests.add(new SellRequest(\"Pork Bellies\", (targetPrice*1.28f), (ass*40000)));\r\n break;\r\n case 1: Requests.add(new SellRequest(\"Frozen Orange Juice Concentrate\", (targetPrice*1.57f), (ass*15000)));\r\n break;\r\n case 2: Requests.add(new SellRequest(\"Soybeans\", (targetPrice*14.05f), (ass*5000)));\r\n }\r\n }\r\n if(sORb==1){\r\n targetPrice = (float)(((rng.nextGaussian())*sDev) + meanBuyPrice - (buyVolume*sDev*0.03));\r\n if(targetPrice<0){\r\n targetPrice = 0;\r\n }\r\n int ass = ((rng.nextInt(4)+1));\r\n int aType = rng.nextInt(3); \r\n switch(aType){\r\n case 0: Requests.add(new BuyRequest(\"Pork Bellies\", (targetPrice*1.28f), (40000*ass)));\r\n break;\r\n case 1: Requests.add(new BuyRequest(\"Frozen Orange Juice Concentrate\", (targetPrice*1.57f), (ass*15000)));\r\n break;\r\n case 2: Requests.add(new BuyRequest(\"Soybeans\", (targetPrice*14.05f), (ass*5000)));\r\n }\r\n }\r\n if(sellVolume > 0){\r\n sellVolume = sellVolume -1;\r\n }\r\n if(buyVolume > 0){\r\n buyVolume = buyVolume -1;\r\n }\r\n printRequest(Requests.size()-1);\r\n lowestSellPrice();\r\n highestBuyPrice();\r\n }", "@Override\n public void onDateSet(DatePicker view, int year, int monthOfYear,\n int dayOfMonth) {\n myCalendar.set(Calendar.YEAR, year);\n myCalendar.set(Calendar.MONTH, monthOfYear);\n myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);\n updateLabel(expireDateEditText);\n\n // TODO: is ther better way to get date?\n GregorianCalendar gc = new GregorianCalendar(TimeZone.getDefault());\n gc.clear();\n gc.set(year, monthOfYear, dayOfMonth, 23, 59, 0);\n Log.d(\"set expire date: \", \"mItem: \" + mItem);\n if (mItem != null) {\n mItem.setExpirationDate(gc.getTimeInMillis());\n SimpleDateFormat sdf = new SimpleDateFormat();\n sdf.setTimeZone(TimeZone.getDefault());\n Log.d(\"get purchase date: \", sdf.format(new Date(mItem.getPurchaseDate())));\n Log.d(\"get expiration date: \", sdf.format(new Date(mItem.getExpirationDate())));\n\n }\n }", "public void sell() throws UnavailableObjectException {\r\n\t\tGame game = Game.getInstance();\r\n\t\tgame.increaseBudget(getSellValue());\r\n\t\tgame.getInventory().take(id);\r\n\t}", "public checkUserExpiration() {\n memberBroker = new membersBroker();\naccountBroker= new accountsBroker();\n }", "@Transactional\n public ApiResponse saveItems(List<Df00201VO> itemList) {\n\n List<DfDegree> dfDegreeList = ModelMapperUtils.mapList(itemList, DfDegree.class);\n\n DfDegree orgDfDegree = null;\n int degree = 0;\n\n for (DfDegree dfDegree : dfDegreeList) {\n if (dfDegree.isCreated() || dfDegree.isModified()) {\n orgDfDegree = repository.findOne(dfDegree.getId());\n\n if (mapper.checkDegree(dfDegree.getDisposalFreezeEventUuid()) >= dfDegree.getDegree()){\n if(dfDegree.isCreated()) {\n return ApiResponse.error(ApiStatus.SYSTEM_ERROR, CommonMessageUtils.getMessage(\"DF002_05\"));\n }else if(dfDegree.isModified()){\n if(orgDfDegree.getDegree() != dfDegree.getDegree()){\n return ApiResponse.error(ApiStatus.SYSTEM_ERROR, CommonMessageUtils.getMessage(\"DF002_05\"));\n }\n }\n }\n\n if(dfDegree.isCreated()){ //disposalFreezeDegreeUuid 없을때\n degree = jdbcTemplate.queryForObject(\"select FC_DF_DEGREE_NUMBER('\"+ dfDegree.getDisposalFreezeEventUuid() +\"') from dual\", Integer.class);\n dfDegree.setDegree(degree);\n dfDegree.setStatusUuid(CommonCodeUtils.getCodeDetailUuid(\"CD115\",\"Draft\"));\n }\n\n if(dfDegree.isModified()) {\n dfDegree.setInsertDate(orgDfDegree.getInsertDate());\n dfDegree.setInsertUuid(orgDfDegree.getInsertUuid());\n\n if(dfDegree.getEndYn().equals(\"Y\")){\n dfDegree.setTerminatorUuid(SessionUtils.getCurrentLoginUserUuid());\n dfDegree.setEndDate(Timestamp.valueOf(DateUtils.convertToString(LocalDateTime.now(), DateUtils.DATE_TIME_PATTERN)));\n }else{\n dfDegree.setTerminatorUuid(\"\");\n dfDegree.setEndDate(null);\n }\n }\n\n repository.save(dfDegree);\n } else if (dfDegree.isDeleted()) {\n if (mapper.checkDegree(dfDegree.getDisposalFreezeEventUuid()) > 0) {\n return ApiResponse.error(ApiStatus.SYSTEM_ERROR, CommonMessageUtils.getMessage(\"DF002_05\"));\n } else {\n repository.delete(dfDegree);\n }\n }\n\n }\n return ApiResponse.of(ApiStatus.SUCCESS, \"SUCCESS\");\n }", "public void loadCache() {\r\n\t\tint rango = getEmpleadoActual().getRango();\r\n\t\tArrayList<String> idsDptos = getEmpleadoActual().getDepartamentosId();\r\n\t\t\r\n\t\t// Para todos los departamentos a los que pertenezca el empleado\r\n\t\tfor (int nd=0; nd<idsDptos.size(); nd++){\r\n\t\t\tString dep = idsDptos.get(nd);\r\n\t\t\tint numvendedor = getEmpleadoActual().getEmplId();\r\n\r\n\t\t\tif (!alive) return;\r\n\t\t\tsetProgreso(\"Cargando contratos dpto \"+dep, 50);\r\n\t\t\tcontratos = controlador.getListaContratosDpto(dep);\r\n\t\t\tsetProgreso(\"Cargando contratos dpto \"+dep, 100);\r\n\r\n\t\t\tif (!alive) return;\r\n\t\t\tsetProgreso(\"Cargando empleados dpto \"+dep, 25);\r\n\t\t\templeados = controlador.getEmpleadosDepartamento(getEmpleadoActual().getEmplId(),dep);\r\n\t\t\tsetProgreso(\"Cargando empleados dpto \"+dep, 100);\r\n\t\t\t\r\n\t\t\t//Prueba ordenación empleados\r\n//\t\t\tfor (int i = 0; i < empleados.size(); i++) {\r\n//\t\t\t\tSystem.out.println(empleados.get(i).getPosicion());\r\n//\t\t\t}\r\n\t\t\tordenaEmpleados();\r\n//\t\t\tfor (int i = 0; i < empleados.size(); i++) {\r\n//\t\t\t\tSystem.out.println(empleados.get(i).getPosicion());\r\n//\t\t\t}\r\n\t\t\t//Fin PRueba\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (!alive) return;\r\n\t\t\tif (rango == 1) { // Si es un empleado, coger turnos de su departamento\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 70);\r\n\t\t\t\tturnos = controlador.getListaTurnosEmpleadosDpto(dep);\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 100);\r\n\t\t\t} else if (rango == 2) { // Si es un jefe, coger turnos de todos los departamentos\r\n\t\t\t\tArrayList<String> temp = new ArrayList<String>();\r\n\t\t\t\ttemp = controlador.getDepartamentosJefe(numvendedor);\r\n\t\t\t\tfor (int i=0; i<temp.size(); i++)\r\n\t\t\t\t\tdepartamentosJefe.add(controlador.getDepartamento(temp.get(i)));\r\n\t\t\t\t//TODO borrar si al final no se usa\r\n\t//\t\t\tsetProgreso(\"Cargando jefes de departamento\", 60);\r\n\t//\t\t\tnumeroJefesDepartamento = controlador.getNumVendedorTodosJefes();\r\n\t//\t\t\tnombreJefesDepartamento = controlador.getNombreTodosJefes();\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 70);\r\n\t\t\t\tArrayList<Turno> turnosDep = new ArrayList<Turno>();\r\n\t\t\t\tfor (int i=0; i<departamentosJefe.size(); i++) {\r\n\t\t\t\t\tturnosDep = controlador.getListaTurnosEmpleadosDpto(departamentosJefe.get(i).getNombreDepartamento());\r\n\t\t\t\t\tfor (int j=0; j<turnosDep.size(); j++) {\r\n\t\t\t\t\t\tturnos.add(turnosDep.get(j));\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 100);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tSystem.err.println(\"Vista\\t:: Tipo de empleado inválido para cargar la cache.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(rango==1){//si es un empleado guardamos las ventas que éste ha hecho en un año\r\n\t\t\tjava.util.Date fecha = new java.util.Date();//cogemos la fecha del sistema\r\n\t\t\tvector_ventas=controlador.getVentas(this.getEmpleadoActual().getEmplId(),fecha.getYear()+1900);\r\n\t\t}else if(rango==2){//si es un jefe almacenamos la suma de las ventas de todos los empleados de este departamento durante un año\r\n\t\t\tjava.util.Date fecha = new java.util.Date();//cogemos la fecha del sistema\r\n\t\t\tvector_ventas=controlador.getVentasJefe(this.empleados,fecha.getYear()+1900);\r\n\t\t}\r\n\t\tSystem.out.println(\"Cache cargada\");\r\n\t}", "private void purgeEphemeralIDs( long now) {\n\t\tassert( this.getAppType() == Beacon.AppType.APPLE_GOOGLE_CONTACT_TRACING);\n\t\tlong beforeTS = now - getDurationKeepEphemeralExposures();\n\t\tif ( !this.idStore.purgeEphemeralEncounters( getMinDurationOfExposure(), new Date( beforeTS))) {\n\t\t\tlogger.warning( \"failure to purge ephemeral encounters\");\n\t\t} else {\n\t\t\tsetPurgedEphemeralIDsTS( now);\n\t\t};\t\t\n\t}", "private void reacquireLocks() {\n getCommander().requestLockOn( getPart() );\n for ( Long id : expansions ) {\n try {\n ModelObject expanded = getQueryService().find( ModelObject.class, id );\n if ( !( expanded instanceof Segment || expanded instanceof Plan ) )\n getCommander().requestLockOn( expanded );\n } catch ( NotFoundException e ) {\n LOG.warn( \"Expanded model object not found at: \" + id );\n }\n }\n }", "@Scheduled(fixedDelay = 10000)\n @Transactional\n @Override\n public void updatedExpiredTradesStatus() {\n tradeRepository.updateExpiredTradesStatus();\n }", "public VendingMachineDaoInMemImpl() {\n Item itemOne = new Item(1, \"Snickers\", new BigDecimal(1.85).setScale(2, RoundingMode.HALF_UP),9);\n Item itemTwo = new Item(2, \"M&Ms\", new BigDecimal(1.50).setScale(2, RoundingMode.HALF_UP),2); \n Item itemThree = new Item(3, \"Pringles\", new BigDecimal(2.10).setScale(2, RoundingMode.HALF_UP),5);\n Item itemFour = new Item(4, \"Reese's\", new BigDecimal(1.85).setScale(2, RoundingMode.HALF_UP), 4);\n Item itemFive = new Item(5, \"Pretzels\", new BigDecimal(1.25).setScale(2, RoundingMode.HALF_UP), 9);\n Item itemSix = new Item(6, \"Twinkies\", new BigDecimal(1.95).setScale(2, RoundingMode.HALF_UP), 3);\n Item itemSeven = new Item(7, \"Doritos\", new BigDecimal(1.75).setScale(2, RoundingMode.HALF_UP), 11);\n Item itemEight = new Item(8, \"Almond Joy\", new BigDecimal(1.85).setScale(2, RoundingMode.HALF_UP),0);\n Item itemNine = new Item(9, \"Trident\", new BigDecimal(1.95).setScale(2, RoundingMode.HALF_UP), 6);\n \n allItems.put(1, itemOne);\n allItems.put(2, itemTwo);\n allItems.put(3, itemThree);\n allItems.put(4, itemFour);\n allItems.put(5, itemFive);\n allItems.put(6, itemSix);\n allItems.put(7, itemSeven);\n allItems.put(8, itemEight);\n allItems.put(9, itemNine);\n }", "@Override\n\tpublic void run() {\n\t\t\n\t\tfor (Entry<String, TreeMap<Integer, TradeObject>> entryObj : tradeStore.entrySet()) {\n\t\t\tList<TradeObject> expiredTrade = entryObj.getValue().values().parallelStream()\n\t\t\t\t\t.filter(t -> isTradeExpired(t)).map(t -> updatedExpired(t)).collect(Collectors.toList());\n\n\t\t\texpiredTrade.stream().collect(Collectors.toMap(TradeObject::getVersion, tradeObject -> tradeObject));\n\n\t\t\ttradeStore.put(entryObj.getKey(), new TreeMap<Integer, TradeObject>(expiredTrade.stream()\n\t\t\t\t\t.collect(Collectors.toMap(TradeObject::getVersion, tradeObject -> tradeObject))));\n\t\t}\n\t}", "private void getDetailedDebitAgingOLDEST(List<DebtorsDetailedAgingHelper> agingList, Date atDate, EMCUserData userData) {\n getDetailedDebitAgingNONE(agingList, atDate, userData);\n\n //Aging lines to remove\n //List<DebtorsDetailedAgingLineDS> toRemove = new ArrayList<DebtorsDetailedAgingLineDS>();\n\n //All credits\n List<DebtorsDetailedAgingLineDS> credits = new ArrayList<DebtorsDetailedAgingLineDS>();\n //All debits\n List<DebtorsDetailedAgingLineDS> debits = new ArrayList<DebtorsDetailedAgingLineDS>();\n\n for (DebtorsDetailedAgingHelper agingHelper : agingList) {\n for (DebtorsDetailedAgingLineDS agingLine : agingHelper.getAgingLines()) {\n if (agingLine.getAmount().compareTo(BigDecimal.ZERO) < 0) {\n //Credit\n credits.add(agingLine);\n } else {\n //Debit\n debits.add(agingLine);\n }\n }\n }\n\n//Start allocating from oldest credits.\ncredit: for (DebtorsDetailedAgingLineDS credit : credits) {\n if (credit.getBalance().compareTo(BigDecimal.ZERO) != 0) {\n//Loop through debits\ndebit: for (DebtorsDetailedAgingLineDS debit : debits) {\n if (debit.getBalance().compareTo(BigDecimal.ZERO) != 0) {\n //Get difference between debit and credit balances.\n BigDecimal difference = debit.getBalance().add(credit.getBalance());\n if (difference.compareTo(BigDecimal.ZERO) > 0) {\n //Debit greater than credit. Allocate credit in full.\n debit.setBalance(debit.getBalance().add(credit.getBalance()));\n credit.setBalance(BigDecimal.ZERO);\n\n //toRemove.add(credit);\n\n //Credit consumed. Continue outer loop.\n continue credit;\n } else if (difference.compareTo(BigDecimal.ZERO) < 0) {\n //Credit greater than debit.\n credit.setBalance(credit.getBalance().add(debit.getBalance()));\n debit.setBalance(BigDecimal.ZERO);\n\n //toRemove.add(debit);\n\n //Debit consumed\n continue;\n } else {\n //Debit == credit. Consume both.\n debit.setBalance(BigDecimal.ZERO);\n credit.setBalance(BigDecimal.ZERO);\n\n //toRemove.add(credit);\n //toRemove.add(debit);\n\n //Credit consumed. Continue outer loop.\n continue credit;\n }\n } else {\n //Credit, continue to next line.\n continue;\n }\n }\n } else {\n //Debit, continue to next line\n continue;\n }\n }\n\n //Try to remove all records from all bins.\n //TODO: Is there a more efficient way?\n //for (DebtorsDetailedAgingHelper agingHelper : agingList) {\n // agingHelper.getAgingLines().removeAll(toRemove);\n //}\n }", "public void sellProperty(){\n owner.addMoney(costs[0]/2);\n owner.removeProperty(this);\n owner = null;\n }", "private void reallocateUnConsumedEsnRecords() {\n\t\tesnInfoRepository\n\t\t\t\t.findAllByIsConsumed(false).stream().filter(item -> (Days\n\t\t\t\t\t\t.daysBetween(new DateTime(item.getDateClaimed()), new DateTime()).isGreaterThan(Days.days(2))))\n\t\t\t\t.forEach(item -> {\n\t\t\t\t\titem.setUserClaimed(null);\n\t\t\t\t\titem.setDateClaimed(null);\n\t\t\t\t});\n\t}", "public void onSuccess(ImmutableList<Expiration> immutableList) {\n e.this.anZ.remove(aVar2);\n }", "public void setExpiryDate(SIPDateOrDeltaSeconds e) {\n expiryDate = e ;\n }", "public void markDestroyed() {\n\t\tsetupResult = environmentStatus;\n\t\tenvironmentStatus = State.DESTROYED.name();\n\t\tdestroyedAt = System.currentTimeMillis();\n\t\tBasicDBObject updateQuery = new BasicDBObject(); \n\t\tBasicDBObject fieldSets = new BasicDBObject(); \n\t\tfieldSets.put(\"environmentStatus\", environmentStatus); \n\t\tfieldSets.put(\"destroyedAt\", destroyedAt); \n\t\tfieldSets.put(\"numDestroyed\", numDestroyed); \n\t\tfieldSets.put(\"destroyError\", destroyError); \n\t\tfieldSets.put(\"setupResult\", setupResult); \n\t\tupdateQuery.put( \"$set\", fieldSets); \n\t\tappendData(updateQuery);\n\t}", "public void setAfter() {\r\n\t\t\tbasemapAfter = new HashMap<Location, SurfaceEntity>(surface.basemap);\r\n\t\t\tsurfaceAfter = new ArrayList<SurfaceFeature>(surface.features);\r\n\t\t\t\r\n\t\t\tbuildingmapAfter = new HashMap<Location, SurfaceEntity>(surface.buildingmap);\r\n\t\t\tbuildingsAfter = new ArrayList<Building>(surface.buildings);\r\n\t\t}", "public void placeDust(double x, double y) {\r\n\r\n\t\t// Place 4 dust objects, and add them as participants\r\n\t\tDust du = new Dust(x, y);\r\n\t\tDust du2 = new Dust(x + 5, y);\r\n\t\tDust du3 = new Dust(x + 5, y + 5);\r\n\t\tDust du4 = new Dust(x, y + 5);\r\n\t\taddParticipant(du);\r\n\t\taddParticipant(du2);\r\n\t\taddParticipant(du3);\r\n\t\taddParticipant(du4);\r\n\r\n\t\t// Set the velocities of the 4 dust objects\r\n\t\tdu.setVelocity(RANDOM.nextInt(16) / 10 + 1, 20);\r\n\t\tdu2.setVelocity(RANDOM.nextInt(16) / 10 + 1, 10);\r\n\t\tdu3.setVelocity(RANDOM.nextInt(16) / 10 + 1, -20);\r\n\t\tdu4.setVelocity(RANDOM.nextInt(16) / 10 + 1, -5);\r\n\r\n\t\t// Expire the 4 dust objects\r\n\t\tnew ParticipantCountdownTimer(du, 2000);\r\n\t\tnew ParticipantCountdownTimer(du2, 2100);\r\n\t\tnew ParticipantCountdownTimer(du3, 2200);\r\n\t\tnew ParticipantCountdownTimer(du4, 2300);\r\n\r\n\t\tdisplay.setLegend(\"\");\r\n\r\n\t}", "protected void cleanBullets() {\n Set<Bullet> recyclable = new HashSet<Bullet>();\n for (Bullet bullet : this.bullets) {\n bullet.update();\n if (bullet.getPositionY() < SEPARATION_LINE_HEIGHT\n || bullet.getPositionY() > this.height)\n recyclable.add(bullet);\n }\n this.bullets.removeAll(recyclable);\n //BulletPool.recycle(recyclable);\n }", "void setExpiredDate(Date expiredDate);", "@Before\n public void setUp() {\n /* get customer groups at first */\n String customerGroupsPath = \"Groups/\";\n String[] customerGroups = new String[] { customerGroupsPath + \"Neukunde\", customerGroupsPath + \"Stammkunde\" };\n TGetList_Return[] retGroups = customerGroupService.getList();\n\n char qw = '\\\"';\n customerGroups[0] = customerGroupsPath + qw + retGroups[0].getAlias() + qw;\n customerGroups[1] = customerGroupsPath + qw + retGroups[1].getAlias() + qw;\n\n // create test PriceLists that can be used with the create and update\n // methods\n PriceList_in.setAlias(alias);\n PriceList_in.setCurrencyID(\"EUR\");\n PriceList_in.setCustomerGroups(new String[] { customerGroups[1] });\n PriceList_in.setCustomers(new String[] { \"Customers/1001\" });\n PriceList_in.setName(new TLocalizedValue[] { new TLocalizedValue(\"de\", \"Meine Preisliste\"),\n new TLocalizedValue(\"en\", \"my price list\") });\n PriceList_in.setValidFrom(new GregorianCalendar(2007, 12, 1));\n PriceList_in.setValidTo(new GregorianCalendar(2007, 12, 31));\n\n String dateStr = new String(sdf_in.format(new GregorianCalendar(2006, 1, 1, 0, 00).getTime()));\n TAttribute attr1 = new TAttribute();\n attr1.setName(\"CreationDate\");\n attr1.setType(\"DateTime\");\n attr1.setValue(dateStr);\n PriceList_in.setAttributes(new TAttribute[] { attr1 });\n\n PriceList_update.setPath(path + alias);\n PriceList_update.setName(new TLocalizedValue[] { new TLocalizedValue(\"de\", \"Meine geänderte Preisliste\"),\n new TLocalizedValue(\"en\", \"my updated price list\") });\n\n dateStr = new String(sdf_in.format(new GregorianCalendar(2006, 1, 1, 11, 11).getTime()));\n TAttribute attr_update = new TAttribute();\n attr_update.setName(\"CreationDate\");\n attr_update.setType(\"DateTime\");\n attr_update.setValue(dateStr);\n PriceList_update.setAttributes(new TAttribute[] { attr_update });\n PriceList_update.setCustomerGroups(new String[] { customerGroups[1] });\n PriceList_update.setCustomers(new String[] { \"Customers/1001\" });\n\n // delete the test price list if it exists\n TExists_Return[] PriceLists_exists_out = priceListService.exists(new String[] { path + alias });\n if (PriceLists_exists_out[0].getExists()) {\n priceListService.delete(new String[] { path + alias });\n }\n }", "public void startSale(){\n this.sale = new Sale();\n this.inventory = new Inventory();\n this.accounting = new Accounting();\n }", "@Test\n public void testDeletionWithExpiredAndValidLocks() throws BackendException {\n\n final int lockCount = 10;\n final int expiredCount = 3;\n assertTrue(expiredCount + 2 <= lockCount);\n final long timeIncr = 1L;\n final long timeStart = 0L;\n final long timeCutoff = timeStart + (expiredCount * timeIncr);\n\n ImmutableList.Builder<Entry> locksBuilder = ImmutableList.builder();\n ImmutableList.Builder<Entry> delsBuilder = ImmutableList.builder();\n\n for (int i = 0; i < lockCount; i++) {\n final long ts = timeStart + (timeIncr * i);\n Entry lock = StaticArrayEntry.of(\n codec.toLockCol(ts, defaultLockRid),\n BufferUtil.getIntBuffer(0));\n\n if (ts < timeCutoff) {\n delsBuilder.add(lock);\n }\n\n locksBuilder.add(lock);\n }\n\n EntryList locks = StaticArrayEntryList.of(locksBuilder.build());\n EntryList dels = StaticArrayEntryList.of(delsBuilder.build());\n assertTrue(expiredCount == dels.size());\n\n del = new StandardLockCleanerRunnable(store, kc, tx, codec, timeCutoff);\n\n expect(store.getSlice(eq(ksq), eq(tx))).andReturn(locks);\n\n store.mutate(\n eq(key),\n eq(ImmutableList.<Entry> of()),\n eq(columnsOf(dels)),\n anyObject(StoreTransaction.class));\n\n ctrl.replay();\n del.run();\n }", "private void updateObjects(final Set<Object> objectsToUpdate, \n final Set<Object> objectsToRemove)\n throws CvqException {\n \n for (Object object : objectsToUpdate) {\n logger.debug(\"updateObjects() Updating \" + object);\n \n // only for children because new adults are written when calling\n // modify method (because we need their login and pwd)\n // FIXME REFACTORING : validate this \n if (object instanceof Child) {\n Child child = (Child) object;\n individualService.assignLogin(child);\n }\n }\n \n for (Object object : objectsToRemove) {\n logger.debug(\"updateObjects() Removing \" + object);\n genericDAO.delete(object);\n }\n }", "private void initializeAggTradesCache(String symbol) {\r\n\r\n\t\tBinanceApiClientFactory factory = BinanceApiClientFactory.newInstance();\r\n\t\tBinanceApiRestClient client = factory.newRestClient();\r\n\t\tList<AggTrade> aggTrades = client.getAggTrades(symbol.toUpperCase());\r\n\t\tthis.aggTradesCache = new HashMap<>();\r\n\r\n\t\t/*\r\n\t\t * List<Tick> ticks = null; Long tickIndex = 0L; List<AggTrade> listAggTrade =\r\n\t\t * new CopyOnWriteArrayList<AggTrade>(); this.aggTradeTicksCashe = new\r\n\t\t * HashMap<Long, List<AggTrade>>();\r\n\t\t * \r\n\t\t *\r\n\t\t * ZonedDateTime tickStartTime = ZonedDateTime.now(ZoneId.systemDefault());\r\n\t\t * ZonedDateTime tickEndTime = ZonedDateTime.now(ZoneId.systemDefault());\r\n\t\t */\r\n\r\n\t\t// Check server time\r\n\t\ttradeSessionStartTime = client.getServerTime();\r\n\r\n\t\tList<Integer> xData = new CopyOnWriteArrayList<Integer>();\r\n\t\tList<Double> yData = new CopyOnWriteArrayList<Double>();\r\n\t\tList<Double> errorBars = new CopyOnWriteArrayList<Double>();\r\n\r\n\t\tlong startTimestamp = tradeSessionStartTime;\r\n\t\tlong endTimestamp = tradeSessionStartTime;\r\n\t\tfor (AggTrade aggTrade : aggTrades) {\r\n\t\t\tLong currentTimestamp = aggTrade.getTradeTime();\r\n\t\t\tif (currentTimestamp < startTimestamp)\r\n\t\t\t\tstartTimestamp = currentTimestamp;\r\n\t\t\tif (currentTimestamp > endTimestamp)\r\n\t\t\t\tendTimestamp = currentTimestamp;\r\n\t\t}\r\n\r\n\t\tfor (AggTrade aggTrade : aggTrades) {\r\n\r\n\t\t\t/*\r\n\t\t\t * ZonedDateTime tradeTimestamp =\r\n\t\t\t * ZonedDateTime.ofInstant(Instant.ofEpochMilli(aggTrade.getTradeTime()),\r\n\t\t\t * ZoneId.systemDefault()); if ( tradeTimestamp.isBefore(tickStartTime))\r\n\t\t\t * tickStartTime = tradeTimestamp; if (!tradeTimestamp.isBefore(tickEndTime))\r\n\t\t\t * tickEndTime = tradeTimestamp;\r\n\t\t\t * \r\n\t\t\t * if (!tradeTimestamp.isBefore(tickEndTime)) { // new tick if ( (tickIndex >0)\r\n\t\t\t * && (listAggTrade.size() > 0)) aggTradeTicksCashe.put( tickIndex, listAggTrade\r\n\t\t\t * ); tickEndTime = tradeTimestamp.plus(tickDuration); listAggTrade = new\r\n\t\t\t * CopyOnWriteArrayList<AggTrade>(); tickIndex++; } listAggTrade.add(aggTrade);\r\n\t\t\t */\r\n\r\n\t\t\tLong currentTimestamp = aggTrade.getTradeTime();\r\n\t\t\tDouble price = new Double(aggTrade.getPrice());\r\n\t\t\tDouble quantity = new Double(aggTrade.getQuantity());\r\n\t\t\tDouble amount = price * quantity;\r\n\t\t\txData.add((int) (50 * (currentTimestamp - startTimestamp) / (endTimestamp - startTimestamp)));\r\n\t\t\tyData.add(amount);\r\n\t\t\terrorBars.add(0.0);\r\n\t\t\taggTradesCache.put(aggTrade.getAggregatedTradeId(), aggTrade);\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * realTimeChart = new MercuryRealTimeChart(xData,yData, errorBars, response ->\r\n\t\t * {\r\n\t\t * \r\n\t\t * } );\r\n\t\t */\r\n\t}", "public void testExpireCache(final boolean expireByType) {\n LOG.info(\"starting testExpireCache \"\n + (expireByType ? \"by type\" : \"by object identity\"));\n try {\n\n // delete any data left over from previous tests\n deleteTestDataSet();\n try {\n createTestDataSet();\n } catch (Exception e) {\n // attempt to delete any test data that was created.\n deleteTestDataSet();\n fail(\"Failed to create test data set\");\n }\n\n // now update the database outside of JDO\n updatePersonUsingJDBC(\"First\", \"Person\", JDBC_UPDATED_DATE);\n updateEmplUsingJDBC(\"First\", \"Person\", JDBC_UPDATED_DATE);\n\n updateAddrUsingJDBC(1, Integer.toString(1) + JDBC_UPDATED_STRING);\n updateAddrUsingJDBC(2, Integer.toString(2) + JDBC_UPDATED_STRING);\n updateAddrUsingJDBC(3, Integer.toString(3) + JDBC_UPDATED_STRING);\n\n // and force the cache to expire\n expire(expireByType);\n\n // validate that cached field values are not used in\n // subsequent read/write operations\n boolean success = true;\n if (!validReadTransaction(\"First\", \"Person\")) { success = false; }\n if (!validWriteTransaction(\"First\", \"Person\")) { success = false; }\n\n if (success) {\n LOG.info(\"Test Completed Successfully.\");\n } else {\n fail(\"Cache was not properly expired\");\n }\n deleteTestDataSet();\n } catch (Exception e) {\n LOG.error(\"ERROR: fatal exception encountered during test\", e);\n fail(\"Exception encountered during test\");\n }\n }", "@Override\n protected void inputObjects() {\n alpha1 = Utils.computeRandomNumber(Modulus, sp);\n alpha2 = Utils.computeRandomNumber(Modulus, sp);\n gamma = Utils.computeRandomNumber(Modulus, sp);\n gammaTilde = Utils.computeRandomNumber(Modulus, sp);\n\n capC = g2.modPow(gamma, Modulus);\n capCTilde = g2.modPow(gammaTilde, Modulus);\n\n beta1 = alpha1.multiply(x);\n beta2 = alpha2.multiply(x);\n BigInteger capU1 = t_i.modPow(alpha1, Modulus).multiply(b_i.modPow(beta1.negate(), Modulus))\n .mod(Modulus);\n BigInteger capU2 = g1.modPow(alpha1, Modulus).multiply(g2.modPow(alpha2, Modulus)).mod(Modulus);\n\n objects.put(\"tInverse\", t.modInverse(Modulus));\n objects.put(\"b\", b);\n objects.put(\"g1\", g1);\n objects.put(\"g2\", g2);\n objects.put(\"U1Inverse\", capU1.modInverse(Modulus));\n objects.put(\"U2Inverse\", capU2.modInverse(Modulus));\n objects.put(\"CInverse\", capC.modInverse(Modulus));\n objects.put(\"CTildeInverse\", capCTilde.modInverse(Modulus));\n objects.put(\"t_i\", t_i);\n objects.put(\"b_iInverse\", b_i.modInverse(Modulus));\n }", "@Test\n public void oldNotUpdateSuccessExchangeWithdraw() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";\n long secondTokenQuant = 200000000L;\n\n byte[] ownerAddress = ByteArray.fromHexString(OWNER_ADDRESS_FIRST);\n AccountCapsule accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n Map<String, Long> assetMap = accountCapsule.getAssetMap();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(null, assetMap.get(firstTokenId));\n Assert.assertEquals(null, assetMap.get(secondTokenId));\n\n ExchangeWithdrawActuator actuator = new ExchangeWithdrawActuator(getContract(\n OWNER_ADDRESS_FIRST, exchangeId, String.valueOf(1), firstTokenQuant),\n dbManager);\n TransactionResultCapsule ret = new TransactionResultCapsule();\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(1);\n try {\n actuator.validate();\n actuator.execute(ret);\n Assert.assertEquals(ret.getInstance().getRet(), code.SUCESS);\n long id = 1;\n //V1 not update\n ExchangeCapsule exchangeCapsule = dbManager.getExchangeStore().get(ByteArray.fromLong(id));\n Assert.assertNotNull(exchangeCapsule);\n Assert.assertEquals(ByteString.copyFrom(ownerAddress), exchangeCapsule.getCreatorAddress());\n Assert.assertEquals(id, exchangeCapsule.getID());\n Assert.assertEquals(1000000, exchangeCapsule.getCreateTime());\n Assert.assertTrue(Arrays.equals(firstTokenId.getBytes(), exchangeCapsule.getFirstTokenId()));\n Assert.assertEquals(firstTokenId, ByteArray.toStr(exchangeCapsule.getFirstTokenId()));\n Assert.assertEquals(secondTokenId, ByteArray.toStr(exchangeCapsule.getSecondTokenId()));\n Assert.assertNotEquals(0L, exchangeCapsule.getFirstTokenBalance());\n Assert.assertNotEquals(0L, exchangeCapsule.getSecondTokenBalance());\n //V2\n ExchangeCapsule exchangeCapsule2 = dbManager.getExchangeV2Store().get(ByteArray.fromLong(id));\n Assert.assertNotNull(exchangeCapsule2);\n Assert.assertEquals(ByteString.copyFrom(ownerAddress), exchangeCapsule2.getCreatorAddress());\n Assert.assertEquals(id, exchangeCapsule2.getID());\n Assert.assertEquals(1000000, exchangeCapsule2.getCreateTime());\n Assert.assertEquals(0L, exchangeCapsule2.getFirstTokenBalance());\n Assert.assertEquals(0L, exchangeCapsule2.getSecondTokenBalance());\n\n accountCapsule = dbManager.getAccountStore().get(ownerAddress);\n assetMap = accountCapsule.getAssetMapV2();\n Assert.assertEquals(10000_000000L, accountCapsule.getBalance());\n Assert.assertEquals(firstTokenQuant, assetMap.get(String.valueOf(1)).longValue());\n Assert.assertEquals(secondTokenQuant, assetMap.get(String.valueOf(2)).longValue());\n\n Assert.assertEquals(secondTokenQuant, ret.getExchangeWithdrawAnotherAmount());\n\n } catch (ContractValidateException e) {\n logger.info(e.getMessage());\n Assert.assertFalse(e instanceof ContractValidateException);\n } catch (ContractExeException e) {\n Assert.assertFalse(e instanceof ContractExeException);\n } catch (ItemNotFoundException e) {\n Assert.assertFalse(e instanceof ItemNotFoundException);\n } finally {\n dbManager.getExchangeStore().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeStore().delete(ByteArray.fromLong(2L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(1L));\n dbManager.getExchangeV2Store().delete(ByteArray.fromLong(2L));\n }\n }", "public static void main(String[] args) throws Exception {\n\t\t\n\t\tTradeImpl tf = new TradeImpl();\n\t\tDate todaysDate = Calendar.getInstance ().getTime();\n\t\tSimpleDateFormat sd = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\n\t\t\n\t\t\n//\t\tAdding Trade T1\n\t\tDate maturityDate=sd.parse(\"10/05/2021\");\n\t\tTradeBean t1=new TradeBean(\"T1\",1,\"CP-1\",\"B1\",maturityDate, todaysDate, 'N');\n\t\ttf.addTrade(t1);\n\t\t\n\t\t//Adding Trade T2\n\t\tmaturityDate=sd.parse(\"20/05/2021\");\n\t\tTradeBean t2=new TradeBean(\"T2\",2,\"CP-2\",\"B1\",maturityDate, todaysDate, 'N');\n\t\ttf.addTrade(t2);\t\t\n\n\t\tTradeBean t4=new TradeBean(\"T3\",5,\"CP-4\",\"B1\",maturityDate, todaysDate, 'N');\n\t\ttf.addTrade(t4);\n\t\t\n\t\t\n\t\t//Adding Trade T3\n\t\tmaturityDate=sd.parse(\"20/05/2021\");\n\t\tTradeBean t3=new TradeBean(\"T4\",5,\"CP-3\",\"B2\",maturityDate, todaysDate, 'N');\n\t\ttf.addTrade(t3);\n\t\t\n\t\t\n\t\t\n\t\t//Display all Trade\n\t\tSystem.out.println(\"\\n\\n\");\n\t\tSystem.out.println(\"Displaying total number of Trade in the list\");\n\t\ttf.printTrade();\n\t\tSystem.out.println(\"\\n\\n\");\t\n\t\t\t\t\n\t\t//Checking for all Expired Flag\n\t\tSystem.out.println(\"Checking for Expired Flag\");\n\t\tmaturityDate=sd.parse(\"20/01/2021\");\n\t\tTradeBean t6=new TradeBean(\"T2\",2,\"CP-2\",\"B1\",maturityDate, todaysDate, 'N');\n\t\ttf.tradeList.replace(\"T2\", t6);\n\t\t\n\t\tmaturityDate=sd.parse(\"20/01/2021\");\n\t\tTradeBean t7=new TradeBean(\"T4\",5,\"CP-3\",\"B2\",maturityDate, todaysDate, 'N');\n\t\ttf.tradeList.replace(\"T4\", t7);\n\t\ttf.checkExpiredDates();\n\t\ttf.printTrade();\n\t\t\n\t\t\n\n\t}", "private void purgeObsoleteTempExpKeys( long now) {\n\t\tlong beforeTS = now - getDurationKeepTempExpKeys();\n\t\tif ( Crypto.purgeObsoleteTempExpKeys( beforeTS)) {\n\t\t\t// set time-stamp of last purge\n\t\t\tsetPurgedObsoleteTempExpKeysTS( now);\n\t\t} else {\n\t\t\tlogger.warning( \"failed to purge temporary exposure keys\");\n\t\t}\n\t}", "@Override\n public void setRentabilityValues(List<RentaPortafolioVO> rentaPortafolioVOList) {\n /* Store data coming from service */\n if (rentaPortafolioVOList != null) {\n LOGGER.info(\"Datos provenientes del servicio leidos\");\n\n Map<String, Map<String, Double>> rentRiskValues = new HashMap<>();\n Map<String, Map<String, Double>> rentConsValues = new HashMap<>();\n Map<String, Map<String, Double>> rentModValues = new HashMap<>();\n Map<String, Double> tmpMap;\n\n RentaPortafolioVO riskRent;\n RentaPortafolioVO consRent;\n RentaPortafolioVO modRent;\n\n for(int i = 0, j = 0; i < rentaPortafolioVOList.size(); i+= 3, j++) {\n riskRent = rentaPortafolioVOList.get(i);\n consRent = rentaPortafolioVOList.get(i+1);\n modRent = rentaPortafolioVOList.get(i+2);\n\n /* Rent values Mayor Riesgo */\n tmpMap = new HashMap<>();\n\n tmpMap.put(BrandsKeys.COLFONDOS, riskRent.getColfondosRentaPortafolio());\n tmpMap.put(BrandsKeys.PORVENIR, riskRent.getPorvenirRentaPortafolio());\n tmpMap.put(BrandsKeys.PROTECCION, riskRent.getProteccionRentaPortafolio());\n tmpMap.put(BrandsKeys.OLD_MUTUAL, riskRent.getOldMutualRentaPortafolio());\n\n rentRiskValues.put( ProjectionKeys.getProjectionName(j), tmpMap );\n\n /* Rent values Conservador */\n tmpMap = new HashMap<>();\n\n tmpMap.put(BrandsKeys.COLFONDOS, consRent.getColfondosRentaPortafolio());\n tmpMap.put(BrandsKeys.PORVENIR, consRent.getPorvenirRentaPortafolio());\n tmpMap.put(BrandsKeys.PROTECCION, consRent.getProteccionRentaPortafolio());\n tmpMap.put(BrandsKeys.OLD_MUTUAL, consRent.getOldMutualRentaPortafolio());\n\n rentConsValues.put( ProjectionKeys.getProjectionName(j), tmpMap);\n\n /* Rent values Moderado */\n tmpMap = new HashMap<>();\n\n tmpMap.put(BrandsKeys.COLFONDOS, modRent.getColfondosRentaPortafolio());\n tmpMap.put(BrandsKeys.PORVENIR, modRent.getPorvenirRentaPortafolio());\n tmpMap.put(BrandsKeys.PROTECCION, modRent.getProteccionRentaPortafolio());\n tmpMap.put(BrandsKeys.OLD_MUTUAL, modRent.getOldMutualRentaPortafolio());\n\n rentModValues.put( ProjectionKeys.getProjectionName(j), tmpMap);\n }\n\n pensionParameters.setRentRisk(rentRiskValues);\n pensionParameters.setRentCons(rentConsValues);\n pensionParameters.setRentMod(rentModValues);\n }\n }", "public void setExpiration(long expiration) {\n this.expiration = expiration;\n }", "@Test\n\t@Order(9)\n\tpublic void alterarDatasReserva() throws Exception {\n\t\tLocacao locacao = locacoes.get(1);\n\t\tLocacao alterarDatasReserva = locacaoService.alterarDatasReserva(locacao, gerarData(\"01/02/2020\"), gerarData(\"09/03/2020\"));\n\n\t\tassertNotNull(alterarDatasReserva);\n\t}", "public Object creditEarningsAndPayTaxes()\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setInitialCash : \" + \"Agent\");\r\n/* 144 */ \tgetPriceFromWorld();\r\n/* 145 */ \tgetDividendFromWorld();\r\n/* */ \r\n/* */ \r\n/* 148 */ \tthis.cash -= (this.price * this.intrate - this.dividend) * this.position;\r\n/* 149 */ \tif (this.cash < this.mincash) {\r\n/* 150 */ \tthis.cash = this.mincash;\r\n/* */ }\t\r\n/* */ \r\n/* 153 */ \tthis.wealth = (this.cash + this.price * this.position);\r\n/* */ \r\n/* 155 */ \treturn this;\r\n/* */ }" ]
[ "0.5603393", "0.5600707", "0.55995244", "0.55549705", "0.5512298", "0.5458975", "0.54202235", "0.5333544", "0.53280914", "0.53041124", "0.5191258", "0.51373935", "0.5128477", "0.5087504", "0.5062237", "0.5051879", "0.4977448", "0.49771306", "0.49711362", "0.4962293", "0.4942221", "0.4939078", "0.49213713", "0.49153185", "0.48979998", "0.48950258", "0.48945117", "0.48731193", "0.4870917", "0.48641306", "0.48631933", "0.48562783", "0.48480594", "0.48244995", "0.48242646", "0.48066914", "0.4802968", "0.4802878", "0.47986364", "0.47950366", "0.47868717", "0.47665244", "0.4751765", "0.47457352", "0.4742871", "0.47321814", "0.47317582", "0.47227427", "0.4713157", "0.4710943", "0.4703296", "0.47009277", "0.46950418", "0.46928442", "0.46834016", "0.4680978", "0.46607322", "0.46594474", "0.46470544", "0.46451968", "0.46418265", "0.4638492", "0.46381995", "0.46381068", "0.46369356", "0.46334296", "0.46308777", "0.46302772", "0.46289065", "0.4628039", "0.46264663", "0.46223977", "0.46211225", "0.46192923", "0.46173626", "0.46152553", "0.46123466", "0.46049774", "0.45990166", "0.45979586", "0.4593938", "0.45933992", "0.45927826", "0.45926782", "0.4590763", "0.45907012", "0.45888698", "0.45848402", "0.45812792", "0.45776474", "0.45690987", "0.45636308", "0.4563205", "0.4562152", "0.45579058", "0.45578858", "0.4555803", "0.45550922", "0.45527717", "0.45501733" ]
0.59438705
0
Places 4 dust objects at the given x and y coordinates
public void placeDust(double x, double y) { // Place 4 dust objects, and add them as participants Dust du = new Dust(x, y); Dust du2 = new Dust(x + 5, y); Dust du3 = new Dust(x + 5, y + 5); Dust du4 = new Dust(x, y + 5); addParticipant(du); addParticipant(du2); addParticipant(du3); addParticipant(du4); // Set the velocities of the 4 dust objects du.setVelocity(RANDOM.nextInt(16) / 10 + 1, 20); du2.setVelocity(RANDOM.nextInt(16) / 10 + 1, 10); du3.setVelocity(RANDOM.nextInt(16) / 10 + 1, -20); du4.setVelocity(RANDOM.nextInt(16) / 10 + 1, -5); // Expire the 4 dust objects new ParticipantCountdownTimer(du, 2000); new ParticipantCountdownTimer(du2, 2100); new ParticipantCountdownTimer(du3, 2200); new ParticipantCountdownTimer(du4, 2300); display.setLegend(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void placeDebris(double x, double y) {\r\n\r\n\t\t// Place three Debris objects\r\n\t\tint variety = RANDOM.nextInt(4);\r\n\t\tDebris d = new Debris(x, y, variety);\r\n\t\td.setVelocity(RANDOM.nextInt(16) / 10 + 1, 20);\r\n\r\n\t\tvariety = RANDOM.nextInt(4);\r\n\t\tDebris d2 = new Debris(x + 5, y + 5, variety);\r\n\t\td2.setVelocity(RANDOM.nextInt(16) / 10 + 1, 10);\r\n\r\n\t\tvariety = RANDOM.nextInt(4);\r\n\t\tDebris d3 = new Debris(x - 5, y - 5, variety);\r\n\t\td3.setVelocity(RANDOM.nextInt(16) / 10 + 1, -20);\r\n\r\n\t\t// Add the Debris objects as participants\r\n\t\taddParticipant(d);\r\n\t\taddParticipant(d2);\r\n\t\taddParticipant(d3);\r\n\r\n\t\t// Expire the three debris objects after 2 seconds\r\n\t\tnew ParticipantCountdownTimer(d, 2000);\r\n\t\tnew ParticipantCountdownTimer(d2, 2100);\r\n\t\tnew ParticipantCountdownTimer(d3, 2200);\r\n\r\n\t\t// Place a dust object at the site of the debris\r\n\t\tplaceDust(x, y);\r\n\t\tdisplay.setLegend(\"\");\r\n\r\n\t}", "public void place(float x,float y){\n\t\tz=0.2f+Main.world.land.getHigh(Main.world.timeline.getTerra(),(int)x, (int)y);\r\n\t\tMain.world.contacts(this);\r\n\t\tz+=getTopObjects();\r\n\t\tplace(x,y,z);\r\n\t}", "public void place(float x,float y,float z){\n\t\tthis.x=x;\r\n\t\tthis.y=y;\r\n\t\tthis.z=z;\r\n\t\tdx=x;\r\n\t\tdy=y;\r\n\t\tvz=0;\r\n\t\tvx=0;\r\n\t\tvy=0;\r\n\t}", "void spawnEntityAt(String typeName, int x, int y);", "void position(double x, double y, double z);", "public void act() \n {\n // Add your action code here.\n if (Greenfoot.mouseClicked(this)){\n World myWorld = getWorld();\n List<Crab> crabs = myWorld.getObjects(Crab.class);\n for(Crab c : crabs){\n // int y = Greenfoot.getRandomNumber(560);\n // int x = Greenfoot.getRandomNumber(560);\n //c.setLocation(x,y);\n // myWorld.removeObjects(crabs);\n }\n \n /*\n Crab c = new Crab();\n int y = Greenfoot.getRandomNumber(560);\n int x = Greenfoot.getRandomNumber(560);\n myWorld.addObject(c, x, y);\n */\n \n }\n}", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n \n Player player = new Player();\n Point point0 = new Point();\n Point point1 = new Point();\n Point point2 = new Point();\n Point point3 = new Point();\n Point point4 = new Point();\n Danger danger0 = new Danger();\n Danger danger1 = new Danger();\n addObject(player, getWidth()/2, getHeight()/2);\n \n addObject(point0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point2,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point3,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point4,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n \n addObject(danger0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(danger1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n }", "public void setupWorld()\r\n\t{\r\n\t\t//build walls\r\n\t\twall1.add(new PointD(-500, 500));\r\n\t\twall1.add(new PointD(-490, 500));\r\n\t\twall1.add(new PointD(-490, -500));\r\n\t\twall1.add(new PointD(-500, -500));\r\n\r\n\t\twall2.add(new PointD(-500, 500));\r\n\t\twall2.add(new PointD(2000, 500));\r\n\t\twall2.add(new PointD(2000, 490));\r\n\t\twall2.add(new PointD(-500, 490));\r\n\t\t\r\n\t\twall3.add(new PointD(2000, 500));\r\n\t\twall3.add(new PointD(1990, 500));\r\n\t\twall3.add(new PointD(1990, -500));\r\n\t\twall3.add(new PointD(2000, -500));\r\n\r\n\t\twall4.add(new PointD(-500, -500));\r\n\t\twall4.add(new PointD(2000, -500));\r\n\t\twall4.add(new PointD(2000, -490));\r\n\t\twall4.add(new PointD(-500, -490));\r\n\r\n\t\tobjects.add(wall1);\r\n\t\tobjects.add(wall2);\r\n\t\tobjects.add(wall3);\r\n\t\tobjects.add(wall4);\r\n\t\t\r\n\t\t\r\n\t\t//add people\r\n\t\tGameVars.people = people;\r\n\t\tGameVars.aSquare = aSquare;\r\n\t\t\r\n\t\tobjects.add(grandson.boundary);\r\n\t\tpeople.add(grandson);\r\n\t\t\r\n\t\tobjects.add(son.boundary);\r\n\t\tpeople.add(son);\r\n\t\t\r\n\t\tobjects.add(triangle.boundary);\r\n\t\tpeople.add(triangle);\r\n\r\n\t\tobjects.add(wife.boundary);\r\n\t\tpeople.add(wife);\r\n\r\n\t\tobjects.add(runaway.boundary);\r\n\t\tpeople.add(runaway);\r\n\t\t\r\n\t\t\r\n\t\t//set aSquare's position\r\n\t\taSquare.rotate(220);\r\n\t\t\r\n\t}", "public void setSpawn (int x, int y) {\n xCord = x;\n yCord = y;\n }", "private void placeAsteroids() {\r\n\t\taddParticipant(new Asteroid(0, 2, EDGE_OFFSET, EDGE_OFFSET, speed, this));\r\n\t\taddParticipant(new Asteroid(1, 2, SIZE - EDGE_OFFSET, EDGE_OFFSET, 3, this));\r\n\t\taddParticipant(new Asteroid(2, 2, EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this));\r\n\t\taddParticipant(new Asteroid(3, 2, SIZE - EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this));\r\n\t}", "public void plant(int x, int y) throws IOException {\r\n\t\tint level = killed / 5 + 1;\r\n\t\t// The amount of plants cannot exceed the number of zombies\r\n\t\tif (planted <= zombies.size() ) {\r\n\t\t\tfield[x][y] = new Plant(level*3, Plants.PEASHOOTER);\r\n\t\t\tplanted++;\r\n\t\t\tupdate(getGraphics());\r\n\t\t}\r\n\t}", "Obj(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3){\t// CAMBIAR LAS COORDENADAS X,Y,Z CON 0,1 PARA CONSTRUIR PRISMA, CILINDRO, PIRAMIDE, CONO Y ESFERA.\n w\t= new Point3D[4];\n\tvScr\t= new Point2D[4];\n \n w[0]\t= new Point3D(0, 0, 0); // desde la base\n\tw[1]\t= new Point3D(x1, y1, z1);\n\tw[2]\t= new Point3D(x2, y2, z2);\n\tw[3]\t= new Point3D(x3, y3, z3);\n \n\tobjSize = (float) Math.sqrt(12F); \n rho\t= 5 * objSize;\n }", "@Override\n\tpublic void drop(int x, int y) throws IOException {\n\t\tArrayList<GameObjects> newList = new ArrayList<GameObjects>();\n\t\tfor(GameObjects o: objects) {\n\t\t\tif(o.getDrag()) {\n\t\t\t\to.updatePosition(x,y);\n\t\t\t\tswitch(o.toString()) {\n\t\t\t\tcase \"algae\":\n\t\t\t\t\tif(o.getX() > (int)(frameWidth - frameWidth/5) && o.getY() > (int)(frameHeight - frameHeight/4)) {\n\t\t\t\t\t\tif(o.getOrigin()) {\n\t\t\t\t\t\t\tnewList.add(new Algae(frameWidth, frameHeight));\n\t\t\t\t\t\t\to.setOrigin(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(o.getX()<((int)(frameWidth/7)) && (o.getY()>(int)(frameHeight/6) && o.getY()<(int)(frameHeight - frameHeight/6))) {\n\t\t\t\t\t\tif(o.getOrigin()) {\n\t\t\t\t\t\t\tnewList.add(new Algae(frameWidth, frameHeight));\n\t\t\t\t\t\t\to.setOrigin(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnewList.add(o);\n\t\t\t\t\t\tif(o.getOrigin()) {\n\t\t\t\t\t\t\tnewList.add(new Algae(frameWidth, frameHeight));\n\t\t\t\t\t\t\to.setOrigin(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"crab\":\n\t\t\t\t\tif(o.getX() > (int)(frameWidth - frameWidth/5) && o.getY() > (int)(frameHeight - frameHeight/4)) {\n\t\t\t\t\t\tif(o.getOrigin()) {\n\t\t\t\t\t\t\tnewList.add(new Crab(frameWidth, frameHeight));\n\t\t\t\t\t\t\to.setOrigin(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(o.getX()<((int)(frameWidth/7)) && (o.getY()>(int)(frameHeight/6) && o.getY()<(int)(frameHeight - frameHeight/6))) {\n\t\t\t\t\t\tif(o.getOrigin()) {\n\t\t\t\t\t\t\tnewList.add(new Crab(frameWidth, frameHeight));\n\t\t\t\t\t\t\to.setOrigin(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnewList.add(o);\n\t\t\t\t\t\tif(o.getOrigin()) {\n\t\t\t\t\t\t\tnewList.add(new Crab(frameWidth, frameHeight));\n\t\t\t\t\t\t\to.setOrigin(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"big fish\":\n\t\t\t\t\tif(o.getX() > (int)(frameWidth - frameWidth/5) && o.getY() > (int)(frameHeight - frameHeight/4)) {\n\t\t\t\t\t\tif(o.getOrigin()) {\n\t\t\t\t\t\t\tnewList.add(new BigFish(frameWidth, frameHeight));\n\t\t\t\t\t\t\to.setOrigin(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(o.getX()<((int)(frameWidth/7)) && (o.getY()>(int)(frameHeight/6) && o.getY()<(int)(frameHeight - frameHeight/6))) {\n\t\t\t\t\t\tif(o.getOrigin()) {\n\t\t\t\t\t\t\tnewList.add(new BigFish(frameWidth, frameHeight));\n\t\t\t\t\t\t\to.setOrigin(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnewList.add(o);\n\t\t\t\t\t\tif(o.getOrigin()) {\n\t\t\t\t\t\t\tnewList.add(new BigFish(frameWidth, frameHeight));\n\t\t\t\t\t\t\to.setOrigin(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\to.setDrag(false);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewList.add(o);\n\t\t\t}\n\n\t\t}\n\t\tobjects=newList;\n\t}", "public void onPlace(World var1, int var2, int var3, int var4)\n {\n super.onPlace(var1, var2, var3, var4);\n\n if (BuildersProxy.canPlaceTorch(var1, var2 - 1, var3, var4))\n {\n var1.setData(var2, var3, var4, 1);\n }\n else if (BuildersProxy.canPlaceTorch(var1, var2 + 1, var3, var4))\n {\n var1.setData(var2, var3, var4, 2);\n }\n else if (BuildersProxy.canPlaceTorch(var1, var2, var3, var4 - 1))\n {\n var1.setData(var2, var3, var4, 3);\n }\n else if (BuildersProxy.canPlaceTorch(var1, var2, var3, var4 + 1))\n {\n var1.setData(var2, var3, var4, 4);\n }\n else if (BuildersProxy.canPlaceTorch(var1, var2, var3 - 1, var4))\n {\n var1.setData(var2, var3, var4, 5);\n }\n else if (BuildersProxy.canPlaceTorch(var1, var2, var3 + 1, var4))\n {\n var1.setData(var2, var3, var4, 0);\n }\n\n this.dropTorchIfCantStay(var1, var2, var3, var4);\n }", "void setPosition (double x, double y, double z);", "PositionedObject(){\n float x = DrawingHelper.getGameViewWidth()/2;\n float y = DrawingHelper.getGameViewHeight()/2;\n _position.set(x,y);\n }", "@Override\n\tprotected void placeStones(int numStones) {\n\n\t\tShape pitBounds = this.getShape();\n\t\tdouble pitW = pitBounds.getBounds().getWidth();\n\t\tdouble pitH = pitBounds.getBounds().getHeight();\n\t\t\n\n\t\tint stoneWidth = this.stoneIcon.getIconWidth();\n\t\tint stoneHeight = this.stoneIcon.getIconHeight();\n\n\t\t\t\n\t\tfor (int i = 0; i < numStones; i++){\n\t\t\tboolean locationFound = false;\n\t\t\tdo{\n\t\t\t\tfloat x = (float) Math.random();\n\t\t\t\tfloat y = (float) Math.random();\n\n\t\t\t\tx *= pitW;\n\t\t\t\ty *= pitH;\n\t\t\t\t\n\t\t\t\tEllipse2D.Float stoneBounds = new Ellipse2D.Float((float) (x+pitBounds.getBounds().getX()), (float) (y+pitBounds.getBounds().getY()), (float) (stoneWidth), (float) (stoneHeight));\n\n\t\t\t\tSystem.out.println(stoneBounds.getBounds());\n\t\t\t\tpitBounds.getBounds().setLocation(0, 0);\n\t\t\t\tArea pitArea = new Area(pitBounds);\n\t\t\t\tArea pendingStoneLocation = new Area(stoneBounds);\n\t\t\t\tArea intersectionArea = (Area) pitArea.clone();\n\t\t\t\tintersectionArea.add(pendingStoneLocation);\n\t\t\t\tintersectionArea.subtract(pitArea);\n\t\t\t\t\n\t\t\t\tif(intersectionArea.isEmpty() ){\n\t\t\t\t\tlocationFound = true;\n\t\t\t\t\tPoint2D p = new Point2D.Float((float) (x/pitW), (float) (y/pitH));\n\t\t\t\t\trelativeStoneLocations.add(p);\n\t\t\t\t\tSystem.out.println(p);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} while(!locationFound);\n\t\n\t\t}\n\t}", "protected void putMonsters() {\n\t\tRandom rand = new Random();\n\t\tfor (int monsterCount = 0; monsterCount < 4; monsterCount++){\n\t\t\tint x, y;\n\t\t\tdo {\n\t\t\t\tx = rand.nextInt(xSize);\n\t\t\t\ty = rand.nextInt(ySize);\n\t\t\t} while((levelSetup[x][y] instanceof SimpleRoom) && (x == 0 & y == 0) && !levelSetup[x][y].hasItem());\n\t\t\tlevelSetup[x][y].putMonster(new BasicMonster());\n\t\t}\n\t}", "void postGen(World world, int x, int y, int z);", "City(){\n x_coordinate = (int)(Math.random()*200);\n y_coordinate = (int)(Math.random()*200);\n }", "private void setup()\n {\n // TO STUDENTS: Add, revise, or remove methods as needed to define your own game's world\n //addLeftGround();\n //addFences();\n //addMetalPlateSteps();\n addClouds();\n addEnemy();\n addCoin();\n //addRightGround();\n // add a metal plate\n for(int i=0; i<=3; i+=1)\n {\n //location\n int x = 10 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=3; i+=1)\n {\n //location\n int x = 11 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=4; i+=1)\n {\n //location\n int x = 10 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=4; i+=1)\n {\n //location\n int x = 11 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 17 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 18 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=7; i+=1)\n {\n //location\n int x = 17 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 7 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=7; i+=1)\n {\n //location\n int x = 18 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 7 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=3; i+=1)\n {\n //location\n int x = 24 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=3; i+=1)\n {\n //location\n int x = 25 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=5; i+=1)\n {\n //location\n int x = 24 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=5; i+=1)\n {\n //location\n int x = 25 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 31 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n }\n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 32 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n }\n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 31 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 13 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 32 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 13 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 42 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=1; i+=1)\n {\n //location\n int x = 43 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 42 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 8 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 43 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 8 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=4; i+=1)\n {\n //location\n int x = 47 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=4; i+=1)\n {\n //location\n int x = 48 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=5; i+=1)\n {\n //location\n int x = 47 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=5; i+=1)\n {\n //location\n int x = 48 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 10 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=2; i+=1)\n {\n //location\n int x = 52 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=2; i+=1)\n {\n //location\n int x = 53 * TILE_SIZE + HALF_TILE_SIZE;\n int y = HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 52 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 8 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n // add a metal plate\n for(int i=0; i<=6; i+=1)\n {\n //location\n int x = 53 * TILE_SIZE + HALF_TILE_SIZE;\n int y = 8 * TILE_SIZE + HALF_TILE_SIZE + i * TILE_SIZE;\n\n MetalPlate plate = new MetalPlate(x,y);\n addObject(plate, x, y);\n } \n\n addHero();\n }", "private void setPosition(float x, float y) {\n this.x = x;\r\n this.y = y;\r\n group();\r\n }", "private void cp1PlaceShips(){\n\t\tint start = 0;\n\t\tint stop = 4;\n\t\tboolean placed;\n\n\t\tfor(int x = start; x <= stop; x++){\n\t\t\tplaced = false;\n\n\t\t\twhile(!placed)\n\t\t\t{\n\t\t\t\tranX = ranNum.nextInt(600);\n\t\t\t\tranY = ranNum.nextInt(600);\n\t\t\t\tplaced = true;\n\n\t\t\t\tships[x] = new Ship(x, shipNames[x], 'H', shipPlayer[x], shipWidth[x], shipHeight[x], ranX, ranY, shipSize[x]);\n\t\t\t\tships[x].setLocation(ships[x].getX(), ships[x].getY());\n\t\t\t\tships[x].setSize(ships[x].getWidth(), ships[x].getHeight());\n\n\t\t\t\tif(ships[x].getX() + ships[x].getWidth() < boardOne.getWidth() && ships[x].getY() + ships[x].getHeight() < boardOne.getHeight()){\n\t\t\t\t\tfor(int y = start; y < x; y++){\n\t\t\t\t\t\tif(ships[x].getBounds().intersects(ships[y].getBounds())){\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tplaced = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboardOne.add(ships[x]);\n\t\t}\n\t}", "public Clouds(Terrain landscape, int x1, int y1){\n\t\txLength = x1;\n\t\tyHeight = y1;\n\t\tcollectCloud();\n\n\t\ty = (int) (Math.random() * (yHeight / 3));\n\t\tx = Math.random() * landscape.getXTerrain();\n\t\trate = Math.random() * 40 + 20;\n\t\toffset = (int) (Math.random() * 200);\n\n\t\tTicker.addMethod(this::moveCloud);\n\t}", "private void createLocations( int numLocation, double offset, double sceneX, double sceneY, Random rand) {\n\n for (int k = 0; k < numLocation; k++) {\n int tmpOffSetX = (int) sceneX - ((int) offset * 2);\n int tmpOffsetY = (int) sceneY - ((int) offset * 2);\n double x = rand.nextInt(tmpOffSetX - 300);\n double y = rand.nextInt(tmpOffsetY);\n for (Location lo : locations)\n if (lo.intersects(new BoundingBox(x, y, offset * 2, offset * 2))) {\n x = rand.nextInt(tmpOffSetX - 300);\n y = rand.nextInt(tmpOffsetY);\n }\n if (x < offset) x += (offset + 10); // Attempts to buffer location from being placed off-screen.\n if (y < offset) y += (offset + 10);\n if (y > sceneY - offset) y -= (offset + 10);\n if (x > sceneX - offset) x -= (offset + 10);\n locations.add(new Location(x, y, offset, \"Location \" + k)); // adds new locations\n this.getChildren().add(locations.get(k));\n this.getChildren().add(new Text(\n locations.get(k).getCenterX() - offset,\n locations.get(k).getCenterY() + (offset * 2),\n locations.get(k).getName()));\n locations.get(k).setOnMouseClicked(locationEvent);\n }\n\n }", "public void spawn(double minimumY, double maximumY, double minimumX, double maximumX) {\r\n\r\n double startingY = minimumY + (maximumY - minimumY) * Math.random();\r\n double startingX = minimumX + (maximumX - minimumX) * Math.random();\r\n\r\n y = startingY;\r\n x = startingX;\r\n\r\n }", "public Entity( int x, int y){\n this.x = x;\n this.y = y;\n }", "public GameObject(int x, int y, int dx, int dy, Mapa m){\n\t\tmap=m;\n\t\tthis.x=x;\n\t\tthis.y=y;\n\t\tdimensionX=dx;\n\t\tdimensionY=dy;\n\t}", "public static void draw(ArrayList<Sighting> data){\n \n \t\tint backgroundColor = Utils.globalProcessing.color(120, 120, 120, 60);\n \n \t\tUtils.globalProcessing.fill(backgroundColor);\n \n \t\tUtils.globalProcessing.rect(200, 0, 1024, 768);\n \t\t//Utils.globalProcessing.rectMode(Utils.globalProcessing.CORNERS);\n \t\tArrayList<Shape> shapes = new ArrayList<Shape>();\n \t\tArrayList<Time> times = new ArrayList<Time>();\n \t\tArrayList<City> locations = new ArrayList<City>();\n \t\t//calculate min/max for each dimension\n \t\tfor(int i = 0; i < data.size(); i++){\n \t\t\tSighting s = data.get(i);\n \t\t\tif(!shapes.contains(s.getShape()))\n \t\t\t\tshapes.add(s.getShape());\n \t\t\tif(!times.contains(s.getTime()))\n \t\t\t\ttimes.add(s.getTime());\n \t\t\tif(!locations.contains(s.getPosition()))\n \t\t\t\tlocations.add((City)s.getPosition());\n \t\t}\n \t\tfloat xPloti, xPlote, yPloti, yPlote;\n \t\txPloti = 200;\n \t\txPlote = 1024;\n \t\tyPloti = 100;\n \t\tyPlote = 700;\n \n \t\tfloat maxDistance = 0;\n\t\tfloat minPopulationDensity = Utils.allCities.get(0).getPopulationDensity();\n\t\tfloat maxpopulationDensity = Utils.allCities.get(0).getPopulationDensity();\n \t\tfor(City c: locations){\n \t\t\tif(c.getDistanceAirport() > maxDistance)\n \t\t\t\tmaxDistance = c.getDistanceAirport();\n \t\t\tif(c.getPopulationDensity()< minPopulationDensity)\n \t\t\t\tminPopulationDensity = c.getPopulationDensity();\n \t\t\telse if(c.getPopulationDensity() > maxpopulationDensity)\n \t\t\t\tmaxpopulationDensity = c.getPopulationDensity();\n \n \t\t}\n \n \n \n \t\t\n \t\tfor(int i = 0; i < data.size(); i++){\n \t\t\tSighting s = data.get(i);\n \t\t\tUtils.globalProcessing.stroke(s.getShape().getColor());\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t//Utils.globalProcessing.stroke(120);\n \t\t\tfloat x = Utils.globalProcessing.map((float)1/7, 0, 1, xPloti, xPlote);\n \t\t\tfloat y = Utils.globalProcessing.map(((City)s.getPosition()).getDistanceAirport(), 0, maxDistance, yPloti, yPlote);\n \n \t\t\tUtils.globalProcessing.vertex(x,y); // distance\n \n \t\t\tx = Utils.globalProcessing.map((float)2/7, 0, 1, xPloti, xPlote);\n \t\t\ty = Utils.globalProcessing.map(((City)s.getPosition()).getPopulationDensity(), minPopulationDensity, maxpopulationDensity, yPloti, yPlote);\n \n \t\t\tUtils.globalProcessing.vertex(x,y); //populationDensity\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\t//It works only if I threat all the couple of points as separate, indipendent lines\n \t\t\tUtils.globalProcessing.beginShape();\n \n \t\t\tUtils.globalProcessing.vertex(x,y);\n \n \t\t\tx = Utils.globalProcessing.map((float)3/7, 0, 1, xPloti, xPlote);\n \t\t\tif(s.getTime().getBeginTime().get(Calendar.HOUR_OF_DAY)<19 &&s.getTime().getBeginTime().get(Calendar.HOUR_OF_DAY)>=7)\n \t\t\t\ty = Utils.globalProcessing.map(1, 0, 3, yPloti, yPlote); //day \n \t\t\telse\t\n \t\t\t\ty = Utils.globalProcessing.map(2, 0, 3, yPloti, yPlote); //night \n \t\t\t//System.out.println(x +\" \" +y);\n \t\t\tUtils.globalProcessing.vertex(x,y); // night/day\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t\n \t\t\tUtils.globalProcessing.vertex(x,y);\n \t\t\tx = Utils.globalProcessing.map((float)4/7, 0, 1, xPloti, xPlote);\n \t\t\ty = Utils.globalProcessing.map(s.getTime().getBeginTime().get(Calendar.MONTH)+1, 0, 13, yPloti, yPlote);\n \t\t\tUtils.globalProcessing.vertex(x, y); //month of the year\n \t\t\t\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t\n \t\t\tUtils.globalProcessing.vertex(x, y);\n \t\t\tx = Utils.globalProcessing.map((float)5/7, 0, 1, xPloti, xPlote);\n \t\t\tif(s.getTime().getBeginTime().get(Calendar.MONTH)==Calendar.MARCH || s.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.APRIL ||\n \t\t\t\t\ts.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.MAY) //Spring\n \t\t\ty = Utils.globalProcessing.map(1, 0, 5, yPloti, yPlote);\n \t\t\telse if(s.getTime().getBeginTime().get(Calendar.MONTH)==Calendar.JUNE || s.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.JULY ||\n \t\t\t\t\ts.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.AUGUST) //summer\n \t\t\t\ty = Utils.globalProcessing.map(2, 0, 5, yPloti, yPlote);\n \t\t\telse if(s.getTime().getBeginTime().get(Calendar.MONTH)==Calendar.SEPTEMBER || s.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.OCTOBER ||\n \t\t\t\t\ts.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.NOVEMBER) //autumn\n \t\t\t\ty = Utils.globalProcessing.map(3, 0, 5, yPloti, yPlote);\n \t\t\telse\n \t\t\t\ty = Utils.globalProcessing.map(3, 0, 5, yPloti, yPlote);\n \t\t\tUtils.globalProcessing.vertex(x, y); //seasons\n \t\t\t\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t\n \t\t\tUtils.globalProcessing.vertex(x, y);\n \t\t\t\n \t\t\tx = Utils.globalProcessing.map((float)6/7, 0, 1, xPloti, xPlote);\n \t\t\ty = Utils.globalProcessing.map(s.getTime().getBeginTime().get(Calendar.YEAR), 2000, 2011, yPloti, yPlote);\n \t\t\tUtils.globalProcessing.vertex(x, y); //years\n \t\t\tUtils.globalProcessing.endShape();\n \t\t}\n \t\t//draw vertical lines\n \n \t\tfor(int i = 1; i < 7 ; i++){\n \t\t\tfloat x = Utils.globalProcessing.map((float)i/7, 0, 1, xPloti, xPlote);\n \t\t\t//Utils.globalProcessing.\n \t\t}\n \n \t}", "public static final Vector<JARWall> createBridge( int x, int y, int width )\n {\n Vector<JARWall> ret = new Vector<JARWall>();\n\n int drawX = x;\n\n //left socket\n ret.add( new JARWall( drawX, y, JARImage.EWallWood1Small, CollisionType.EColliding, DrawingLayer.EBehindPlayer ) );\n ret.add( new JARWall( drawX + 64, y, JARImage.EWallWood1ArcLeft, CollisionType.ENonColliding, DrawingLayer.EBeforePlayer ) );\n ret.add( new JARWall( drawX, y - 64, JARImage.EWallWood1Ascending, CollisionType.EColliding, DrawingLayer.EBehindPlayer ) );\n ret.add( new JARWall( drawX, y - 128, JARImage.EDecoRailing1Ascending, CollisionType.ENonColliding, DrawingLayer.EBeforePlayer ) );\n\n //water\n drawX += 64;\n ret.add( new JARWall( drawX, y, JARImage.EWallWater1, CollisionType.ENonColliding, DrawingLayer.EBehindPlayer ) );\n\n //browse width\n for ( int i = 0; i < width; ++i )\n {\n drawX += 64;\n\n //railing\n ret.add( new JARWall( drawX, y - 128, JARImage.EDecoRailing1, CollisionType.ENonColliding, DrawingLayer.EBeforePlayer ) );\n //rack\n ret.add( new JARWall( drawX, y - 64, JARImage.EWallWood1, CollisionType.EColliding, DrawingLayer.EBehindPlayer ) );\n //water\n drawX += 64;\n ret.add( new JARWall( drawX, y, JARImage.EWallWater1, CollisionType.ENonColliding, DrawingLayer.EBehindPlayer ) );\n }\n\n //right socket\n drawX += 64;\n ret.add( new JARWall( drawX, y - 64, JARImage.EWallWood1Descending, CollisionType.EColliding, DrawingLayer.EBehindPlayer ) );\n ret.add( new JARWall( drawX, y - 128, JARImage.EDecoRailing1Descending, CollisionType.ENonColliding, DrawingLayer.EBeforePlayer ) );\n drawX += 64;\n ret.add( new JARWall( drawX, y, JARImage.EWallWood1Small, CollisionType.EColliding, DrawingLayer.EBehindPlayer ) );\n ret.add( new JARWall( drawX - 64, y, JARImage.EWallWood1ArcRight, CollisionType.ENonColliding, DrawingLayer.EBeforePlayer ) );\n\n return ret;\n }", "private void setPointActors() {\n switch (host.getUnlockedStages()) {\n // cases is not break to add unlocked stage and everything lower level than that\n case 5:\n stage5Point = new PointActor(screenWidth * 6.5f / 12,\n screenHeight * 4.5f / 24, 5);\n pointActors.add(stage5Point);\n pointStage.addActor(stage5Point);\n\n case 4:\n stage4Point = new PointActor(screenWidth * 2.5f / 12,\n screenHeight * 3.5f / 12, 4);\n pointActors.add(stage4Point);\n pointStage.addActor(stage4Point);\n case 3:\n stage3Point = new PointActor(screenWidth * 0.5f / 12,\n screenHeight * 6 / 12, 3);\n pointActors.add(stage3Point);\n pointStage.addActor(stage3Point);\n case 2:\n stage2Point = new PointActor(screenWidth * 8f / 12,\n screenHeight * 6f / 12, 2);\n pointActors.add(stage2Point);\n pointStage.addActor(stage2Point);\n case 1:\n stage1Point = new PointActor(screenWidth * 4.5f / 12,\n screenHeight * 8.5f / 12, 1);\n pointActors.add(stage1Point);\n pointStage.addActor(stage1Point);\n }\n\n }", "public void scatter(ArrayList<Wall> listOfWalls, ArrayList<Point> intersections) {\n final int MAXTILE = 160;\r\n double minDistance = 5000000000.0; //no distance is greater than this 4head\r\n double upDistance = 500000000.0;\r\n double downDistance = 5000000.0;\r\n double leftDistance = 50000000.0;\r\n double rightDistance = 5000000.0;\r\n boolean isIntersection = checkIntersection(intersections);\r\n boolean isRightCollision = checkWallCollision(listOfWalls, 2);\r\n boolean isLeftCollision = checkWallCollision(listOfWalls, 3);\r\n boolean isUpCollision = checkWallCollision(listOfWalls,0);\r\n boolean isDownCollision = checkWallCollision(listOfWalls, 1);\r\n\r\n if(isIntersection) {\r\n if(!isRightCollision && this.direction != 3) {\r\n rightDistance = Math.pow((xPos + 20) - SCATTERX,2) + Math.pow(yPos - SCATTERY,2);\r\n }\r\n if(!isLeftCollision && this.direction !=2) {\r\n leftDistance = Math.pow((xPos - 20) - SCATTERX,2) + Math.pow(yPos - SCATTERY,2);\r\n }\r\n if(!isUpCollision && this.direction != 1) {\r\n upDistance = Math.pow((xPos) - SCATTERX,2) + Math.pow((yPos-20) - SCATTERY,2);\r\n }\r\n if(!isDownCollision && this.direction != 0) {\r\n downDistance = Math.pow((xPos) - SCATTERX,2) + Math.pow((yPos+20) - SCATTERY,2);\r\n }\r\n if(upDistance <= downDistance && upDistance <= leftDistance && upDistance <= rightDistance) {\r\n this.direction = 0;\r\n }\r\n else if(downDistance <= upDistance && downDistance <= leftDistance && downDistance <= rightDistance) {\r\n this.direction = 1;\r\n }\r\n\r\n else if(rightDistance <= leftDistance && rightDistance <= downDistance && rightDistance <= upDistance) {\r\n this.direction = 2;\r\n }\r\n\r\n else if(leftDistance <= rightDistance && leftDistance <= upDistance && leftDistance <= downDistance) {\r\n this.direction = 3;\r\n }\r\n\r\n\r\n }\r\n\r\n if(this.direction == 0) {\r\n yPos = yPos - 5;\r\n }\r\n if(this.direction ==1) {\r\n yPos = yPos + 5;\r\n }\r\n if(this.direction ==2) {\r\n xPos = xPos + 5;\r\n }\r\n if(this.direction == 3) {\r\n xPos = xPos -5;\r\n }\r\n\r\n }", "private void createShips() {\n //context,size, headLocation, bodyLocations\n Point point;\n Ship scout_One, scout_Two, cruiser, carrier, motherShip;\n if(player) {\n point = new Point(maxN - 1, 0); //row, cell\n scout_One = new Ship(1, point, maxN, \"Scout One\", player);\n ships.add(scout_One);\n point = new Point(maxN - 1, 1);\n scout_Two = new Ship(1, point, maxN, \"Scout Two\", player);\n ships.add(scout_Two);\n point = new Point(maxN - 2, 2);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n ships.add(cruiser);\n point = new Point(maxN - 2, 3);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n ships.add(carrier);\n point = new Point(maxN - 4, 5);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n ships.add(motherShip);\n\n }else{\n Random rand = new Random();\n int rowM = maxN-3;\n int colM = maxN -2;\n int row = rand.nextInt(rowM);\n int col = rand.nextInt(colM);\n point = new Point(row, col);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n updateOccupiedCells(motherShip.getBodyLocationPoints());\n ships.add(motherShip);\n\n rowM = maxN - 1;\n colM = maxN -1;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n updateOccupiedCells(carrier.getBodyLocationPoints());\n ships.add(carrier);\n checkIfOccupiedForSetShip(carrier, row, col, rowM, colM);\n\n\n rowM = maxN - 1;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n updateOccupiedCells(cruiser.getBodyLocationPoints());\n ships.add(cruiser);\n checkIfOccupiedForSetShip(cruiser, row, col, rowM, colM);\n\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_Two = new Ship(1, point, maxN, \"Scout_Two\", player);\n updateOccupiedCells(scout_Two.getBodyLocationPoints());\n ships.add(scout_Two);\n checkIfOccupiedForSetShip(scout_Two, row, col, rowM, colM);\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_One = new Ship(1, point, maxN, \"Scout_One\", player);\n updateOccupiedCells(scout_One.getBodyLocationPoints());\n ships.add(scout_One);\n checkIfOccupiedForSetShip(scout_One, row, col, rowM, colM);\n\n\n\n\n }\n //Need an algorithm to set enemy ship locations at random without overlaps\n }", "protected GameObject(double x, double y, double xSize, double ySize, ID id) {\n\t\tthis.pos = new Point2D(x, y);\n\t\tthis.body = new Rectangle2D.Double(pos.getX(), pos.getY(), xSize, ySize);\n\t\tthis.id = id;\n\t}", "GameObject(int x, int y){\n loadSprite();\n this.x = x;\n this.y = y;\n }", "private void placePlayerShip(int x, int y) {\n\t\tif (shipsToPlace == 3) {\n\t\t\tlongShipCoords = new int[2];\n\t\t\tlongShipCoords[0] = x;\n\t\t\tlongShipCoords[1] = y;\n\n\t\t\t// creates long ship at x,y on egrid\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\tegrid[x + i][y] = 1;\n\n\t\t\t// makes ship tiles blue on enemy's board\n\t\t\tfor (int counter = 0; counter < 5; counter++)\n\t\t\t\tenemyBoard[x + counter][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t}\n\n\t\telse if (shipsToPlace == 2) {\n\t\t\t// create medium ship at x,y on egrid\n\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\t\t\tegrid[x][y + 2] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 2].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t}\n\n\t\telse if (shipsToPlace == 1) {\n\t\t\t// create small ship at x,y on egrid\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t\tstatus.setText(\" Click to attack\");\n\t\t}\n\t\tshipsToPlace--;\n\t\tenableAllTiles();\n\t\tdisableRestrictedTiles(x, y);\n\t}", "public void initZoneAreas() {\n this.zoneList = new ArrayList<Node>();\n this.zoneRoot = new Node(\"Zone Root\");\n \n Material mat = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\"); \n mat.setColor(\"Color\", new ColorRGBA(0,1,1,0.5f));\n mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);\n \n Geometry zoneBox1 = new Geometry(\"Zone 1\",new Box(12,1,12));\n Node zoneNode1 = new Node(\"Zone 1\");\n zoneBox1.setMaterial(mat);\n zoneBox1.setQueueBucket(Bucket.Transparent);\n zoneNode1.attachChild(zoneBox1);\n this.zoneList.add(zoneNode1);\n this.zoneRoot.attachChild(zoneNode1);\n \n zoneNode1.setLocalTranslation(CubeToWorldVector(7.5f,0,47.5f));\n \n Geometry zoneBox2 = new Geometry(\"Zone 2\",new Box(18f,1,6));\n Node zoneNode2 = new Node(\"Zone 2\");\n zoneBox2.setMaterial(mat);\n zoneBox2.setQueueBucket(Bucket.Transparent);\n zoneNode2.attachChild(zoneBox2);\n this.zoneList.add(zoneNode2);\n this.zoneRoot.attachChild(zoneNode2);\n \n zoneNode2.setLocalTranslation(CubeToWorldVector(17.5f,0,47.5f));\n \n Geometry zoneBox2b = new Geometry(\"Zone 2b\",new Box(6f,1,6));\n Node zoneNode2b = new Node(\"Zone 2b\");\n zoneBox2b.setMaterial(mat);\n zoneBox2b.setQueueBucket(Bucket.Transparent);\n zoneNode2b.attachChild(zoneBox2b);\n this.zoneList.add(zoneNode2b);\n this.zoneRoot.attachChild(zoneNode2b);\n \n zoneNode2b.setLocalTranslation(CubeToWorldVector(21.5f,0,43.5f));\n \n Geometry zoneBox3 = new Geometry(\"Zone 3\",new Box(24f,1,22.5f));\n Node zoneNode3 = new Node(\"Zone 3\");\n zoneBox3.setMaterial(mat);\n zoneBox3.setQueueBucket(Bucket.Transparent);\n zoneNode3.attachChild(zoneBox3);\n this.zoneList.add(zoneNode3);\n this.zoneRoot.attachChild(zoneNode3);\n \n zoneNode3.setLocalTranslation(CubeToWorldVector(23.5f,0,34f));\n \n Geometry zoneBox4 = new Geometry(\"Zone 4\",new Box(9f,1,9f));\n Node zoneNode4 = new Node(\"Zone 4\");\n zoneBox4.setMaterial(mat);\n zoneBox4.setQueueBucket(Bucket.Transparent);\n zoneNode4.attachChild(zoneBox4);\n this.zoneList.add(zoneNode4);\n this.zoneRoot.attachChild(zoneNode4);\n \n zoneNode4.setLocalTranslation(CubeToWorldVector(12.5f,0,29.5f));\n \n Geometry zoneBox4b = new Geometry(\"Zone 4b\",new Box(9f,1,22.5f));\n Node zoneNode4b = new Node(\"Zone 4b\");\n zoneBox4b.setMaterial(mat);\n zoneBox4b.setQueueBucket(Bucket.Transparent);\n zoneNode4b.attachChild(zoneBox4b);\n this.zoneList.add(zoneNode4b);\n this.zoneRoot.attachChild(zoneNode4b);\n \n zoneNode4b.setLocalTranslation(CubeToWorldVector(6.5f,0,25f));\n \n Geometry zoneBox5 = new Geometry(\"Zone 5\",new Box(36f,1,18f));\n Node zoneNode5 = new Node(\"Zone 5\");\n zoneBox5.setMaterial(mat);\n zoneBox5.setQueueBucket(Bucket.Transparent);\n zoneNode5.attachChild(zoneBox5);\n this.zoneList.add(zoneNode5);\n this.zoneRoot.attachChild(zoneNode5);\n \n zoneNode5.setLocalTranslation(CubeToWorldVector(13.5f,0,11.5f));\n rootNode.attachChild(this.zoneRoot);\n }", "@Override\n public void run() {\n// handler.addObject(new Enemy(rnd.nextInt(Game.WIDTH), rnd.nextInt(200), ID.Trump));\n// handler.addObject(new Enemy(rnd.nextInt(Game.WIDTH), rnd.nextInt(200), ID.Trump));\n int rnd_x = rnd.nextInt(Game.WIDTH);\n handler.addObject(new Enemy(getX() + 30, y, ID.Trump, 0));\n handler.addObject(new Enemy(getX() -30, y, ID.Trump, 0));\n handler.addObject(new Enemy(getX() , y+30, ID.Trump, 0));\n handler.addObject(new Enemy(getX() , y-30, ID.Trump, 0));\n\n\n }", "private void placeAllShips()\n {\n \t\n \t//place 2 aircrafts\n \tfor(int n = 0; n < 2; n++){\n \trandomRow = rnd.nextInt(10); //get random integer from 0-9\n \trandomCol = rnd.nextInt(10);//get random integer from 0-9\n \trandomDir = rnd.nextInt(2);//get random integer from 0-1\n \twhile(!checkOverlap(randomRow,randomCol,AIRCRAFT_CARRIER_LENGTH)){ //check if random integers overlap existing ones\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \t//place aircraft if no overlap\n \tfor(int i = randomRow; i <randomRow + AIRCRAFT_CARRIER_LENGTH ; i++){\n \t\tfor(int j = randomCol; j < randomCol + AIRCRAFT_CARRIER_LENGTH; ++j){\n \t\t\tif(randomDir == DIRECTION_RIGHT)\n \t\t\t\tgrid[i][randomCol] = SHIP;\n \t\t\tif(randomDir == DIRECTION_DOWN)\n \t\t\t\tgrid[randomRow][j] = SHIP;\n \t\t\t}\n \t\t}\n \t}\n \t\n \t\n \t//place battleship\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,BATTLESHIP_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i <randomRow + BATTLESHIP_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + BATTLESHIP_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\t\n \t//place destroyer\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,DESTROYER_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + DESTROYER_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + DESTROYER_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\t\n \t//place submarine\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,SUBMARINE_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + SUBMARINE_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + SUBMARINE_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\n \t//place patrol\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,PATROL_BOAT_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + PATROL_BOAT_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + PATROL_BOAT_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\n }", "public void setLocation(float x, float y);", "public void setCoords() \r\n {\r\n \tthis.coordX = rand.nextInt(10);\r\n \tthis.coordY = rand.nextInt(10);\r\n }", "public static void main(String[] args) {\n World world = new World();\n Bug bug = new Bug();\n Bug bug2 = new Bug();\n Flower flower = new Flower();\n Flower flower2 = new Flower();\n Location location = new Location(3,4);\n \n Location location2 = world.getRandomEmptyLocation();\n Location left = location2.getAdjacentLocation(270);\n Location right = location2.getAdjacentLocation(90);\n\t world.show();\n\t world.add(left, flower);\n\t world.add(right, flower2);\n world.add(location,bug);\n world.add(location2,bug2);\n bug2.setColor(Color.BLUE);\n bug2.setDirection(90);\n for (int i = 0; i < world.getGrid().getNumCols()-1; i++) {\n\t\tfor (int j = 0; j <world.getGrid().getNumRows()-1 ; j++) {\n\t\tLocation current = new Location(i,j);\n\t\tworld.add(current, new Flower());\n\t\t}\n\t}\n\t}", "public void placeMandatoryObjects()\r\n {\r\n Random rng = new Random();\r\n //Adds an endgame chest somewhere (NOT in spawn)\r\n Room tempRoom = getRoom(rng.nextInt(dungeonWidth - 1) +1, rng.nextInt(dungeonHeight - 1) +1);\r\n tempRoom.addObject(new RoomObject(\"Endgame Chest\", \"overflowing with coolness!\"));\r\n if (tempRoom.getMonster() != null)\r\n {\r\n tempRoom.removeMonster();\r\n }\r\n tempRoom.addMonster(new Monster(\"Pelo Den Stygge\", \"FINAL BOSS\", 220, 220, 12));\r\n //Adds a merchant to the spawn room\r\n getRoom(0,0).addObject(new RoomObject(\"Merchant\", \"like a nice fella with a lot of goods (type \\\"wares\\\" to see his goods)\"));\r\n }", "public void assign(double x, double y, double z) {\n xCoord = x;\n yCoord = y;\n zCoord = z;\n }", "public void createLocations() {\n createAirports();\n createDocks();\n createEdges();\n createCrossroads();\n }", "private void cp2PlaceShips(){\n\t\tint start = 5, stop = 9, orientation;\n\t\tboolean placed;\n\n\t\tfor(int x = start; x <= stop; x++){\n\t\t\tplaced = false;\n\n\t\t\twhile(!placed)\n\t\t\t{\n\t\t\t\tranX = ranNum.nextInt(600);\n\t\t\t\tranY = ranNum.nextInt(600);\n\t\t\t\torientation = ranNum.nextInt(2);\n\t\t\t\tplaced = true;\n\n\t\t\t\tships[x] = new Ship(x, shipNames[x], 'H', shipPlayer[x], shipWidth[x], shipHeight[x], ranX, ranY, shipSize[x]);\n\t\t\t\tships[x].setLocation(ships[x].getX(), ships[x].getY());\n\t\t\t\tships[x].setSize(ships[x].getWidth(), ships[x].getHeight());\n\n\t\t\t\tif(orientation == 1){\n\t\t\t\t\tchangeOrientation(x);\n\t\t\t\t}\n\n\t\t\t\tif(ships[x].getX() + ships[x].getWidth() < boardTwo.getWidth() && ships[x].getY() + ships[x].getHeight() < boardTwo.getHeight()){\n\t\t\t\t\tfor(int y = start; y < x; y++){\n\t\t\t\t\t\tif(ships[x].getBounds().intersects(ships[y].getBounds())){\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tplaced = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboardTwo.add(ships[x]);\n\t\t}\n\t}", "public Monster(int x,int y){\n\tposition[0] = x; //x position\n\tposition[1] = y; //y position\n }", "public void setStreets(int numx, int numy);", "public void onPlace(World var1, int var2, int var3, int var4) {}", "public void shootBabyInto(int x, int y) {\n home.world.cells[x][y].resident\n = new Omnivore(home.world.cells[x][y]);\n }", "@Override\n protected void spawnInWorld(float x, float y, float xVel, float yVel)\n {\n PolygonShape hitbox = new PolygonShape();\n hitbox.setAsBox(3.0F, 1.0F, new Vector2(0, 0), 0);\n \n //Set up body definition - Defines the type of physics body that this is\n BodyDef bodyDef = new BodyDef();\n bodyDef.type = BodyDef.BodyType.DynamicBody;\n bodyDef.position.set(x, y);\n \n //Set up physics body - Defines the actual physics body\n this.physBody = this.world.getPhysWorld().createBody(bodyDef);\n this.physBody.setUserData(this); //Store this object into the body so that it isn't lost\n \n //Set up physics fixture - Defines physical properties\n FixtureDef fixtureDef = new FixtureDef();\n fixtureDef.shape = hitbox;\n fixtureDef.density = 100.0F; //About 1 g/cm^2 (2D), which is the density of water, which is roughly the density of humans.\n fixtureDef.friction = 0.1F; //friction with other objects\n fixtureDef.restitution = 0.1F; //Bouncyness\n \n //Set which collision type this object is\n fixtureDef.filter.categoryBits = COL_SEA_CREATURE;\n //Set which collision types this object collides with\n fixtureDef.filter.maskBits = COL_ALL ^ COL_SEA_PROJECTILE; //Collide with everything except sea creature projectiles\n \n this.physBody.createFixture(fixtureDef);\n \n //Set the linear damping\n this.physBody.setLinearDamping(5F);\n \n //Set the angular damping\n this.physBody.setAngularDamping(2.5F);\n \n //Apply impulse\n this.physBody.applyLinearImpulse(xVel, yVel, x, y, true);\n \n //Dispose of the hitbox shape, which is no longer needed\n hitbox.dispose();\n }", "public GameObject(String name, int x, int y) {\n this.image = GameObject.processing.loadImage(\"images\" + File.separator + name + \".png\");\n this.xPosition = x;\n this.yPosition = y;\n this.active = true;\n }", "public zCoordinates(int x, int y){\n this.x = x;\n this.y = y;\n }", "@Override\n public void tick() {\n x+=velX;\n y+=velY;\n\n if(Dante.getInstance().getX() <= x)\n displayedImage = left;\n else\n displayedImage = right;\n\n choose = r.nextInt(50);\n\n for(int i = 0; i < Handler1.getInstance().objects.size(); i++) {\n GameObject temp = Handler1.getInstance().objects.get(i);\n\n if(temp.getId() == ID.Block||temp.getId()==ID.Door|| temp.getId() == ID.Obstacle) {\n if(getBoundsBigger().intersects(temp.getBounds())) {\n x += (velX*2) * -1;\n y += (velY*2) * -1;\n velX *= -1;\n velY *= -1;\n } else if(choose == 0) {\n velX = (r.nextInt(2 + 2) - 2) + speed;\n velY = (r.nextInt(2 + 2) - 2) + speed;\n\n if (velX!=0){\n if (velY<0){\n velY+=1;\n }else {\n velY-=1;\n }\n }\n\n if (velY!=0){\n if (velX>0){\n velX-=1;\n }else {\n velX+=1;\n }\n }\n }\n }\n if(temp.id==ID.Dante){\n if (++tickCounter % (r.nextInt(50) + 50) == 0) {\n\n Handler1.getInstance().addObject(new Bullet(x, y, ID.Bullet,\n temp.getX() +(r.nextInt( 11+11) -11),\n temp.getY()+(r.nextInt(11 +11) -11),\n 30, 1, bulletImage,30));\n }\n }\n }\n\n if(hp <= 0) {\n Random rand = new Random();\n if(rand.nextInt(100) <= 33)\n Handler1.getInstance().addObject(new Coin(x, y));\n Handler1.getInstance().removeObject(this);\n }\n }", "public void setup()\n\t\t{\n\t\tsize(800, 600, P3D);\n\t\tsmooth();\n\t\tgfx = new ToxiclibsSupport(this);\n\t\tvoronoi = new Voronoi();\n\t\t// focus x positions around horizontal center (w/ 33% standard deviation)\n\t\txPos = new BiasedFloatRange(0, width, width / 2, 0.333f);\n\t\t// focus y positions around bottom (w/ 50% standard deviation)\n\t\tyPos = new BiasedFloatRange(0, height, height, 0.5f);\n\t\tclipper = new SutherlandHodgemanClipper(new Rect(0, 0, width, height));\n\t\tpos = new ArrayList<Vec2D>();\n\t\theights = new ArrayList<Vec3D>();\n\t\tdoShowPoint = true;\n\t\tdoShowPolygon = true;\n\t\tdoTriangle = true;\n\t\tdoTerrain = false;\n\t\tdoInteract = true;\n\t\t//addGridSites();\n\t\t}", "@Override\n public void relocatedWithinBounds() {\n x = random.nextInt(maxX - width);\n y = random.nextInt(maxY - height);\n }", "public Place(int x, int y, TYPE typeDiskHere){\n this.x=x;\n this.y=y;\n isFull=true;\n type=typeDiskHere;\n }", "public void initSpawnPoints() {\n this.spawnPointList = new ArrayList<Node>();\n \n //Player spawn point location (5,0,47) In Ready Room\n this.addSpawnPoint(5.5f,0,47.5f,90, true);\n //Mob spawn point location (16,0,47) In Zone 2\n this.addSpawnPoint(16.5f, 0, 47.5f, 270, false); \n //Mob spawn point location (21,0,43)\n this.addSpawnPoint(21.5f, 0, 43.5f, 0,false);\n \n //Mob spawners in Zone 3\n this.addSpawnPoint(17.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(29.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(17.5f, 0, 29.5f, 270, false);\n \n //Mob spawners in Zone 4\n this.addSpawnPoint(12.5f, 0, 29.5f, 90, false);\n this.addSpawnPoint(6.5f, 0, 20.5f, 0, false);\n \n //Mob spawners in Zone 5\n this.addSpawnPoint(9.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(17.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(24.5f, 0, 8.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 11.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 14.5f, 270, false);\n }", "public static void test10(World w){\n\t\tUtilities.generateGeometry2(w.points ,w.pivots, \"Front.png\", \"Side.png\", 1900, 2500, 0, 0, 1/7.0);\r\n\t\t\r\n\t}", "protected void addZombie(int x, int y) {\r\n units.add(new EnemyZombie(game, String.format(\"Zombie %d\", game.nextEnemyID()), new Posn(x,y), game.getPlayer(2)));\r\n }", "private void setupEnemySpawnPoints() {\n float ring = ProtectConstants.VIEWPORT_WIDTH / 2 + (ProtectConstants.GAME_OBJECT_SIZE * 2);\n float angle = 18; // start angle\n for(int i = 1; i < ProtectConstants.COLUMNS + 1; i++){\n enemySpawnPoints.add(divideCircle(ring, angle));\n angle += 360 / ProtectConstants.COLUMNS;\n }\n enemySpawnPoints.shuffle();\n }", "public void spawnEntity(String entityToSpawn,World world, int xplane, int yplane, int zplane)\n { \n \t//Spawn a creeper\n \tif(entityToSpawn.contentEquals(\"Cr\"))\n \t{\t\n \t\tEntityCreeper creeper = new EntityCreeper(world);\n \t\tcreeper.entityAge = -24000;\n \t\tcreeper.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(creeper);\n \t\treturn;\n \t}\n \t//Spawn an Enderman\n \tif(entityToSpawn.contentEquals(\"En\"))\n \t{\n \t\tEntityEnderman enderman = new EntityEnderman(world);\n \t\tenderman.entityAge = -24000;\n \t\tenderman.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(enderman);\n \t\treturn;\n \t}\n \t//Spawn a Skeleton\n \tif(entityToSpawn.contentEquals(\"Sk\"))\n \t{\n \t\tEntitySkeleton skeleton = new EntitySkeleton(world);\n \t\tskeleton.entityAge = -24000;\n \t\tskeleton.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(skeleton);\n \t\treturn;\n \t}\n \t//Spawn a Zombie\n \tif(entityToSpawn.contentEquals(\"Zo\"))\n \t{\n \t\tEntityZombie zombie = new EntityZombie(world);\n \t\tzombie.entityAge = -24000;\n \t\tzombie.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(zombie);\n \t\treturn;\n \t}\n \t//Spawn a Slime\n \tif(entityToSpawn.contentEquals(\"Sl\"))\n \t{\n \t\tEntitySlime slime = new EntitySlime(world);\n \t\tslime.entityAge = -24000;\n \t\tslime.setSlimeSize(3);\n \t\tslime.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(slime);\n \t\treturn;\n \t}\n \t//Spawn a Spider\n \tif(entityToSpawn.contentEquals(\"Sp\"))\n \t{\n \t\tEntitySpider spider = new EntitySpider(world);\n \t\tspider.entityAge = -24000;\n \t\tspider.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(spider);\n \t\treturn;\n \t}\n \t//Spawn a Cave Spider\n \tif(entityToSpawn.contentEquals(\"Cs\"))\n \t{\n \t\tEntityCaveSpider cavespider = new EntityCaveSpider(world);\n \t\tcavespider.entityAge = -24000;\n \t\tcavespider.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(cavespider);\n \t\treturn;\n \t}\n \t//Spawn a Ghast\n \tif(entityToSpawn.contentEquals(\"Gh\"))\n \t{\n \t\tEntityGhast ghast = new EntityGhast(world);\n \t\tghast.entityAge = -24000;\n \t\tghast.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(ghast);\n \t\treturn;\n \t}\n \t//Spawn a Blaze\n \tif(entityToSpawn.contentEquals(\"Bl\"))\n \t{\n \t\tEntityBlaze blaze = new EntityBlaze(world);\n \t\tblaze.entityAge = -24000;\n \t\tblaze.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(blaze);\n \t\treturn;\n \t}\n \t//Spawn a Magma Cube\n \tif(entityToSpawn.contentEquals(\"Ma\"))\n \t{\n \t\tEntityMagmaCube magmacube = new EntityMagmaCube(world);\n \t\tmagmacube.entityAge = -24000;\n \t\tmagmacube.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(magmacube);\n \t\treturn;\n \t}\n \t//Spawn a Dragon\n \tif(entityToSpawn.contentEquals(\"Dr\"))\n \t{\n \t\tEntityDragon dragon = new EntityDragon(world);\n \t\tdragon.entityAge = -24000;\n \t\tdragon.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(dragon);\n \t\treturn;\n \t}\n \t//Spawn a sheep\n \tif(entityToSpawn.contentEquals(\"Sh\"))\n \t{\n \t\tEntitySheep sheep = new EntitySheep(world);\n \t\tsheep.entityAge = -2;\n \t\tsheep.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(sheep);\n \t\treturn;\n \t}\n \t//Spawn a Cow\n \tif(entityToSpawn.contentEquals(\"Co\"))\n \t{\n \t\tEntityCow cow = new EntityCow(world);\n \t\tcow.entityAge = -2;\n \t\tcow.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(cow);\n \t\treturn;\n \t}\n \t//Spawn a Pig\n \tif(entityToSpawn.contentEquals(\"Pi\"))\n \t{\n \t\tEntityPig pig = new EntityPig(world);\n \t\tpig.entityAge = -2;\n \t\tpig.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(pig);\n \t\treturn;\n \t}\n \t//Spawn a Chicken\n \tif(entityToSpawn.contentEquals(\"Ch\"))\n \t{\n \t\tEntityChicken chicken = new EntityChicken(world);\n \t\tchicken.entityAge = -2;\n \t\tchicken.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(chicken);\n \t\treturn;\n \t}\n \t//Spawn a Ocelot\n \tif(entityToSpawn.contentEquals(\"Ch\"))\n \t{\n \t\tEntityOcelot ocelot = new EntityOcelot(world);\n \t\tocelot.entityAge = -2;\n \t\tocelot.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(ocelot);\n \t\treturn;\n \t}\n \t//Spawn a Pig Zombie\n \tif(entityToSpawn.contentEquals(\"Pz\"))\n \t{\n \t\tEntityPigZombie pigzombie = new EntityPigZombie(world);\n \t\tpigzombie.entityAge = -24000;\n \t\tpigzombie.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(pigzombie);\n \t\treturn;\n \t}\n \t//Spawn a boat\n \tif(entityToSpawn.contentEquals(\"Bo\"))\n \t{\n \t\tEntityBoat boat = new EntityBoat(world);\n \t\t//boat.entityAge = -2;\n \t\tboat.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(boat);\n \t\treturn;\n \t}\n \t//Spawn a Iron Golem\n \tif(entityToSpawn.contentEquals(\"Ir\"))\n \t{\n \t\tEntityIronGolem irongolem = new EntityIronGolem(world);\n \t\tirongolem.entityAge = -24000;\n \t\tirongolem.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(irongolem);\n \t\treturn;\n \t}\n \t//Spawn a Giant Zombie\n \tif(entityToSpawn.contentEquals(\"Gi\"))\n \t{\n \t\tEntityGiantZombie giant = new EntityGiantZombie(world);\n \t\tgiant.entityAge = -24000;\n \t\tgiant.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(giant);\n \t\treturn;\n \t}\n \t//Spawn a Mine Cart\n \tif(entityToSpawn.contentEquals(\"Mi\"))\n \t{\n \t\tEntityMinecart cart = new EntityMinecart(world);\n \t\t//cart.entityAge = -24000;\n \t\tcart.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(cart);\n \t\treturn;\n \t}\n \t//Spawn a Mooshroom\n \tif(entityToSpawn.contentEquals(\"Gi\"))\n \t{\n \t\tEntityMooshroom moosh = new EntityMooshroom(world);\n \t\tmoosh.entityAge = -2;\n \t\tmoosh.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(moosh);\n \t\treturn;\n \t}\n \t//Spawn a Sliver Fish\n \tif(entityToSpawn.contentEquals(\"Si\"))\n \t{\n \t\tEntitySilverfish silverfish = new EntitySilverfish(world);\n \t\tsilverfish.entityAge = -24000;\n \t\tsilverfish.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(silverfish);\n \t\treturn;\n \t}\n \t//Spawn a Snowman\n \tif(entityToSpawn.contentEquals(\"Sn\"))\n \t{\n \t\tEntitySnowman frosty = new EntitySnowman(world);\n \t\tfrosty.entityAge = -24000;\n \t\tfrosty.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(frosty);\n \t\treturn;\n \t}\n \t//Spawn a Squid\n \tif(entityToSpawn.contentEquals(\"Sq\"))\n \t{\n \t\tEntitySquid squid = new EntitySquid(world);\n \t\tsquid.entityAge = -2;\n \t\tsquid.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(squid);\n \t\treturn;\n \t}\n \t//Spawn a Villager\n \tif(entityToSpawn.contentEquals(\"Vi\"))\n \t{\n \t\tEntityVillager villager = new EntityVillager(world);\n \t\tvillager.entityAge = -2;\n \t\tvillager.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(villager);\n \t\treturn;\n \t}\n \t//Spawn a Wolf\n \tif(entityToSpawn.contentEquals(\"Wo\"))\n \t{\n \t\tEntityWolf wolf = new EntityWolf(world);\n \t\twolf.entityAge = -2;\n \t\twolf.setLocationAndAngles(xplane, yplane, zplane, 0, 0.0F);\n \t\tworld.spawnEntityInWorld(wolf);\n \t\treturn;\n \t}\n }", "public Place(int x, int y){\n this.x=x;\n this.y=y;\n isFull=false;\n }", "@SuppressWarnings(\"unused\")\n\tpublic static void main(String[] args) {\n\t\tField field = new Field(0,6);\n\t\tArrayList<TileOnPositionEX> move = new ArrayList<TileOnPositionEX>();\n\t\t\n\t\t// Colors\n\t\tint blue \t= 1;\n\t\tint green \t= 5;\n\t\tint purple \t= 4;\n\t\tint orange \t= 3;\n\t\tint red \t= 0;\n\t\tint yellow \t= 2;\n\t\t// Shapes\n\t\tint circle\t= 0;\n\t\tint club \t= 11;\n\t\tint diamond\t= 3;\n\t\tint square\t= 1;\n\t\tint star\t= 7;\n\t\tint sun\t\t= 4;\n\t\t\n\t\t/* TEST CASE\tTILEONPOSITION(X,Y,TILE)\tTILE(COLOR,SHAPE,UNIQUEID) */\n\t\t// CAUTION: EVERY TILEONPOSITION WITH THE SAME TILE HAS CURRENTLY THE SAME UNIQUEID!\n\t\t\n\t\t// BLUE\n\t\tTile blueCircle\t\t= new Tile(blue,circle,0);\n\t\tTile blueClub\t\t= new Tile(blue,club,1);\n\t\tTile blueDiamond\t= new Tile(blue,diamond,2);\n\t\tTile blueSquare\t\t= new Tile(blue,square,3);\n\t\tTile blueStar\t\t= new Tile(blue,star,4);\n\t\tTile blueSun\t\t= new Tile(blue,sun,5);\n\t\t// GREEN\n\t\tTile greenCircle\t= new Tile(green,circle,6);\n\t\tTile greenClub\t\t= new Tile(green,club,7);\n\t\tTile greenDiamond\t= new Tile(green,diamond,8);\n\t\tTile greenSquare\t= new Tile(green,square,9);\n\t\tTile greenStar\t\t= new Tile(green,star,10);\n\t\tTile greenSun\t\t= new Tile(green,sun,11);\n\t\t// PURPLE\n\t\tTile purpleCircle\t= new Tile(purple,circle,12);\n\t\tTile purpleClub\t\t= new Tile(purple,club,13);\n\t\tTile purpleDiamond\t= new Tile(purple,diamond,14);\n\t\tTile purpleSquare\t= new Tile(purple,square,15);\n\t\tTile purpleStar\t\t= new Tile(purple,star,16);\n\t\tTile purpleSun\t\t= new Tile(purple,sun,17);\n\t\t// ORANGE\n\t\tTile orangeCircle\t= new Tile(orange,circle,18);\n\t\tTile orangeClub\t\t= new Tile(orange,club,19);\n\t\tTile orangeDiamond\t= new Tile(orange,diamond,20);\n\t\tTile orangeSquare\t= new Tile(orange,square,21);\n\t\tTile orangeStar\t\t= new Tile(orange,star,22);\n\t\tTile orangeSun\t\t= new Tile(orange,sun,23);\n\t\t// RED\n\t\tTile redCircle\t\t= new Tile(red,circle,24);\n\t\tTile redClub\t\t= new Tile(red,club,25);\n\t\tTile redDiamond\t\t= new Tile(red,diamond,26);\n\t\tTile redSquare\t\t= new Tile(red,square,27);\n\t\tTile redStar\t\t= new Tile(red,star,28);\n\t\tTile redSun\t\t\t= new Tile(red,sun,29);\n\t\t// YELLOW\n\t\tTile yellowCircle\t= new Tile(yellow,circle,30);\n\t\tTile yellowClub\t\t= new Tile(yellow,club,31);\n\t\tTile yellowDiamond\t= new Tile(yellow,diamond,32);\n\t\tTile yellowSquare\t= new Tile(yellow,square,33);\n\t\tTile yellowStar\t\t= new Tile(yellow,star,34);\n\t\tTile yellowSun\t\t= new Tile(yellow,sun,35);\n\t\t\n\t\tmove.add(new TileOnPositionEX(0,1,redCircle));\n\t\tmove.add(new TileOnPositionEX(0,0,blueCircle));\n\t\t\n\t\tfield.processMove(move, ControlParameters.Server);\n\t\tArrayList<TileOnPositionEX> tilesOnField = field.getTilesOnBoard();\n\t\tmove.clear();\n\t\t\n\t\tmove.add(new TileOnPositionEX(2,1,redClub));\n\t\tmove.add(new TileOnPositionEX(4,1, redStar));\n\t\tmove.add(new TileOnPositionEX(3,1, redDiamond));\n\t\tmove.add(new TileOnPositionEX(1,1, redSun));\n\t\tmove.add(new TileOnPositionEX(5,1, redSquare));\n\t\tfield.processMove(move, ControlParameters.Server);\n\t\ttilesOnField = field.getTilesOnBoard();\n\t\tmove.clear();\n\n\t\t\n\t\tSystem.out.println(\"\\nAMOUNT OF TILES ON FIELD: \" + tilesOnField.size() + \"\\n\");\n\t\tfor (TileOnPositionEX tile : tilesOnField) {\n\t\t\tSystem.out.println(\"The tile: \" + tile);\n\t\t\tif(tile.getNeighbor(Neighbor.Top)!=null) {System.out.println(\"TOP: \" + tile.getNeighbor(Neighbor.Top));}else {System.out.println(\"TOP: NULL\");}\n\t\t\tif(tile.getNeighbor(Neighbor.Right)!=null) {System.out.println(\"RIGHT: \" + tile.getNeighbor(Neighbor.Right));}else {System.out.println(\"RIGHT: NULL\");}\n\t\t\tif(tile.getNeighbor(Neighbor.Bottom)!=null) {System.out.println(\"BOTTOM: \" + tile.getNeighbor(Neighbor.Bottom));}else {System.out.println(\"BOTTOM: NULL\");}\n\t\t\tif(tile.getNeighbor(Neighbor.Left)!=null) {System.out.println(\"LEFT: \" + tile.getNeighbor(Neighbor.Left) + \"\\n\");}else {System.out.println(\"LEFT: NULL\\n\");}\n\t\t}\n\t}", "private void placeBullet(double x, double y) {\r\n\t\tb = new Bullet(x, y);\r\n\t\taddParticipant(b);\r\n\t\tb.setVelocity(BULLET_SPEED, ship.getRotation());\r\n\t\tnew ParticipantCountdownTimer(b, \"expire\", BULLET_DURATION);\r\n\t}", "private void addClouds()\n {\n Cloud cloud1 = new Cloud(170, 125);\n addObject(cloud1, 170, 125);\n Cloud cloud2 = new Cloud(450, 175);\n addObject(cloud2, 450, 175);\n Cloud cloud3 = new Cloud(775, 50);\n addObject(cloud3, 775, 50);\n }", "private void positionObjectInScene(float x, float y, float z) {\n setIdentityM(modelMatrix, 0);\n translateM(modelMatrix, 0, x, y, z);\n multiplyMM(modelViewProjectionMatrix, 0, viewProjectionMatrix,\n 0, modelMatrix, 0);\n }", "public void touchToScatter() {\n for (int i = 0; i < pointCount; i++) {\n int speedX = random.nextInt(2 * speedXBarrier) - speedXBarrier;\n int speedY = random.nextInt(2 * speedYBarrier) - speedYBarrier;\n points.get(i).setSpeedX(speedX);\n points.get(i).setSpeedY(speedY);\n }\n }", "private void spawnStart() {\n\t\tswitch (gameType) {\n\t\t\n\t\t}\n\t\tspawnCloud(10,1,0,0); //spawns base cloud\n\t\tspawnCloud(rng(7,10),6,rng(1,2),rng(2,3)); //spawns first clouds\n\t\tspawnCloud(rng(9,12),6,rng(1,2),rng(2,3));\n\t\t//spawnCloud(10,6,16,0);\n\t}", "public Critter(){\n\tthis.x_location = (int) (Math.random()*99);\n\tthis.y_location = (int) (Math.random()*99);\n\tthis.wrap();\n\t}", "protected void registerTile(int x, int y) {}", "public void setXYZ(int x, int y, int z)\n\t{\n\t\tsetWorldPosition(x, y, z);\n\n\t\ttry\n\t\t{\n\t\t\tupdateWorldRegion();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tlog.log(Level.ERROR, \"Object Id at bad coords: (x: \" + getX() + \", y: \" + getY() + \", z: \" + getZ() + \").\", e);\n\t\t\tonBadCoords();\n\t\t}\n\t}", "public void encapsulate(int x, int y, int z) {\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n minZ = Math.min(minZ, z);\n maxX = Math.max(x, maxX);\n maxY = Math.max(y, maxY);\n maxZ = Math.max(z, maxZ);\n }", "void setOffsetWorldPosition(double x, double y, double z);", "public City(){\n this.x = (int)(Math.random()*200);\n this.y = (int)(Math.random()*200);\n }", "@Override\n\tpublic void pasteInWorld(World world, int xCoord, int yCoord ,int zCoord) {\n\n\t\t//Set all the blocks\n\t\tfor(int x = 0; x < sizeX; x++) {\n\t\t\tfor(int z = 0; z < sizeZ; z++) {\n\t\t\t\tfor(int y = 0; y< sizeY; y++) {\n\n\t\t\t\t\tif(blocks[x][y][z] != null) {\n\t\t\t\t\t\tworld.setBlockState(new BlockPos(xCoord + x, yCoord + y, zCoord + z), blocks[x][y][z].getStateFromMeta(metas[x][y][z]), 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Set tiles for each block\n\t\tfor(TileEntity tile : tileEntities) {\n\t\t\tNBTTagCompound nbt = new NBTTagCompound();\n\t\t\ttile.writeToNBT(nbt);\n\t\t\tint x = nbt.getInteger(\"x\");\n\t\t\tint y = nbt.getInteger(\"y\");\n\t\t\tint z = nbt.getInteger(\"z\");\n\n\t\t\tint tmpX = x + xCoord;\n\t\t\tint tmpY = y + yCoord;\n\t\t\tint tmpZ = z + zCoord;\n\n\t\t\t//Set blocks of tiles again to avoid weirdness caused by updates\n\t\t\t//world.setBlock(xCoord + x, yCoord + y, zCoord + z, blocks[x][y][z], metas[x][y][z], 2);\n\n\n\t\t\tnbt.setInteger(\"x\",tmpX);\n\t\t\tnbt.setInteger(\"y\",tmpY);\n\t\t\tnbt.setInteger(\"z\",tmpZ);\n\n\t\t\tTileEntity entity = world.getTileEntity(new BlockPos(tmpX, tmpY, tmpZ));\n\n\t\t\tif(entity != null)\n\t\t\t\tentity.readFromNBT(nbt);\n\t\t}\n\t}", "public Cow(int _pos_x , int _pos_y)\n {\n pos_x = _pos_x;\n pos_y = _pos_y;\n availableProduct = false;\n hunger_countdown = 5;\n allowed_tiles = \"Grassland\";\n }", "public void camposRegistro(int x, int y) {\n\n\t\tfor (int i = 0; i < 5; i++) {\n\n\t\t\t// Imprimir cuadros para prueba de zona activa\n\t\t\t// app.fill(255);\n\t\t\t// app.rect(71, i*60+279, 280, 30);\n\n\t\t\tif (x > 71 && x < 350 && y > i * 60 + 280 && y < i * 60 + 310) {\n\t\t\t\tindex = i;\n\t\t\t\t// System.out.println(index);\n\t\t\t} else {\n\t\t\t\t// index = 6;\n\t\t\t}\n\t\t}\n\n\t}", "void setPosition (DVector3C xyz);", "@Override\n public void render(float delta) {\n Gdx.gl.glClearColor(1, 1, 1, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n \n world.step(1/60f,8,3);\n \n \n \n // new body stuff\n \n\n // tell the camera to update its matrices.\n camera.update();\n\n game.batch.setProjectionMatrix(camera.combined);\n // tell the SpriteBatch to render in the\n // coordinate system specified by the camera.\n //batch.setProjectionMatrix(camera.combined);\n\n\n //this is currently what can render lines\n \n if (Gdx.input.isTouched()) {\n touchPos.set(Gdx.input.getX(), Gdx.input.getY(), 0);\n camera.unproject(touchPos);\n renderer.begin(ShapeRenderer.ShapeType.Line); // shape type\n renderer.setColor(1, 0.5F, 0.5F, 1); // line's color\n renderer.line(position.x, position.y, touchPos.x, touchPos.y); // shape's set of coordinates (x1,y1,x2,y2)\n renderer.end();\n\n }\n\n // begin a new batch and draw the bucket and\n // all drops\n game.batch.begin();\n world.getBodies(tempBodies);\n for(Body body : tempBodies) {\n \tif(body.getUserData() != null && body.getUserData() instanceof Sprite) {\n \t\tSprite sprite = (Sprite)body.getUserData();\n // System.out.println(body.getPosition().y * BOX_TO_WORLD);\n if(body.getType() == BodyType.DynamicBody) {\n sprite.setPosition((body.getPosition().x * BOX_TO_WORLD) - (sprite.getWidth() / 2), (body.getPosition().y * BOX_TO_WORLD) - (sprite.getHeight() / 2));\n }\n else\n {\n sprite.setPosition(body.getPosition().x * BOX_TO_WORLD , body.getPosition().y * BOX_TO_WORLD );\n }\n \t\t//sprite.setPosition(body.getPosition().x - sprite.getWidth() / 2, body.getPosition().y - sprite.getHeight() / 2);\n \t\tsprite.setRotation(body.getAngle() * MathUtils.radiansToDegrees);\n \t\tsprite.draw(game.batch);\n \t}\n }\n\n // game.batch.draw(circleImage, circle.x, circle.y);\n \n game.batch.end();\n \n \n\n \n \n if (Gdx.input.isKeyPressed(Keys.BACK)){\n \t((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenuScreen(game));\n \t}\n \n if (Gdx.input.isKeyPressed(Keys.BACKSPACE)){\n \t((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenuScreen(game));\n \t}\n debugRenderer.render(world, camera.combined);\n \n \n \n \n }", "public void postPlace(World var1, int var2, int var3, int var4, int var5)\n {\n super.postPlace(var1, var2, var3, var4, var5);\n int var6 = var1.getData(var2, var3, var4);\n\n if (var5 == 1 && BuildersProxy.canPlaceTorch(var1, var2, var3 - 1, var4))\n {\n var6 = 5;\n }\n\n if (var5 == 2 && BuildersProxy.canPlaceTorch(var1, var2, var3, var4 + 1))\n {\n var6 = 4;\n }\n\n if (var5 == 3 && BuildersProxy.canPlaceTorch(var1, var2, var3, var4 - 1))\n {\n var6 = 3;\n }\n\n if (var5 == 4 && BuildersProxy.canPlaceTorch(var1, var2 + 1, var3, var4))\n {\n var6 = 2;\n }\n\n if (var5 == 5 && BuildersProxy.canPlaceTorch(var1, var2 - 1, var3, var4))\n {\n var6 = 1;\n }\n\n if (var5 == 0 && BuildersProxy.canPlaceTorch(var1, var2, var3 + 1, var4))\n {\n var6 = 0;\n }\n\n var1.setData(var2, var3, var4, var6);\n }", "public Stone(int x, int y, int width, int height) {\n\t\tsuper(x, y, width, height);\n\t\t\n\t}", "public void createWall() { // make case statement?\n\t\tRandom ran = new Random();\n\t\tint range = 6 - 1 + 1; // max - min + min\n\t\tint random = ran.nextInt(range) + 1; // add min\n\n\t\t//each wall is a 64 by 32 chunk \n\t\t//which stack to create different structures.\n\t\t\n\t\tWall w; \n\t\tPoint[] points = new Point[11];\n\t\tpoints[0] = new Point(640, -32);\n\t\tpoints[1] = new Point(640, 0);\n\t\tpoints[2] = new Point(640, 32); // top\n\t\tpoints[3] = new Point(640, 384);\n\t\tpoints[4] = new Point(640, 416);\n\n\t\tif (random == 1) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 288);\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 2) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96); // top\n\t\t\tpoints[7] = new Point(640, 256);\n\t\t\tpoints[8] = new Point(640, 288); // bottom\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 3) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 160);\n\t\t\tpoints[9] = new Point(640, 192); // top\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 4) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 160);\n\t\t\tpoints[9] = new Point(640, 192);\n\t\t\tpoints[10] = new Point(640, 224); // top\n\t\t} else if (random == 5) {\n\t\t\tpoints[5] = new Point(640, 64); // top\n\t\t\tpoints[6] = new Point(640, 224);\n\t\t\tpoints[7] = new Point(640, 256);\n\t\t\tpoints[8] = new Point(640, 288); // bottom\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 6) {\n\t\t\tpoints[5] = new Point(640, 192);\n\t\t\tpoints[6] = new Point(640, 224);\n\t\t\tpoints[7] = new Point(640, 256); // bottom\n\t\t\tpoints[8] = new Point(640, 288);\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t}\n\n\t\tfor (int i = 0; i < points.length; i++) { // adds walls\n\t\t\tw = new Wall();\n\t\t\tw.setBounds(new Rectangle(points[i].x, points[i].y, 64, 32));\n\t\t\twalls.add(w);\n\t\t}\n\t\tWall c; // adds a single checkpoint\n\t\tc = new Wall();\n\t\tcheckPoints.add(c);\n\t\tc.setBounds(new Rectangle(640, 320, 32, 32));\n\t}", "protected void warp() {\n\t\tRandom r = new Random();\n\t\t\n\t\t// Get random index from coordinates list\n\t\tint nextPos = r.nextInt(this.coords.length);\n\t\t\n\t\t// Set new position for monster\n\t\tthis.setBounds(this.coords[nextPos].width, this.coords[nextPos].height, mWidth, mHeight);\n\t\t\n\t\tthis.setVisible(true);\n\t}", "private void placeEnemyShips() {\n\t\tint s51 = (int) (Math.random() * 6); // mostly random numbers\n\t\tint s52 = (int) (Math.random() * 10);\n\t\tfor (int i = 0; i < 5; i++)\n\t\t\tpgrid[s51 + i][s52] = 1;\n\n\t\t// Places the ship of length 3\n\t\tint s31 = (int) (Math.random() * 10);\n\t\tint s32 = (int) (Math.random() * 8);\n\t\twhile (pgrid[s31][s32] == 1 || pgrid[s31][s32 + 1] == 1 // prevents\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overlaps\n\t\t\t\t|| pgrid[s31][s32 + 2] == 1) {\n\t\t\ts31 = (int) (Math.random() * 10);\n\t\t\ts32 = (int) (Math.random() * 8);\n\t\t}\n\t\tpgrid[s31][s32] = 1;\n\t\tpgrid[s31][s32 + 1] = 1;\n\t\tpgrid[s31][s32 + 2] = 1;\n\n\t\t// Places the ship of length 1\n\t\tint s21 = (int) (Math.random() * 10);\n\t\tint s22 = (int) (Math.random() * 9);\n\t\twhile (pgrid[s21][s22] == 1 || pgrid[s21][s22 + 1] == 1) { // prevents\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overlaps\n\t\t\ts21 = (int) (Math.random() * 10);\n\t\t\ts22 = (int) (Math.random() * 9);\n\t\t}\n\t\tpgrid[s21][s22] = 1;\n\t\tpgrid[s21][s22 + 1] = 1;\n\n\t}", "Car(int x, int y) {\n // ASSIGN ALL PARAMETERS TO THE CAR CLASS GLOBAL VARIABLES HERE\n xCord = x;\n yCord = y;\n targetCord = 0;\n // CREATE CAR PSHAPE HERE\n // ATTEMPT TO CREATE A CAR-LOOKING-THING USING YOUR OWN VERTICES\n\n //front of car\n //let's slam a bunch of vertices down and hope.\n car = createShape();\n fullCar = createShape(GROUP);\n car.beginShape();\n car.vertex(0, 20);\n car.vertex(2, 10);\n car.vertex(2.25f, 9);\n car.vertex(3, 7);\n car.vertex(4, 5);\n car.vertex(5, 3);\n car.vertex(6, 2);\n car.vertex(7, 1);\n car.vertex(8, .33f);\n car.vertex(9, .1f);\n car.vertex(10, 0);\n car.vertex(20, 0);\n\n car.vertex(21, .1f);\n car.vertex(22, .33f);\n car.vertex(23, 1);\n car.vertex(24, 2);\n car.vertex(25, 3);\n car.vertex(26, 5);\n car.vertex(27, 7);\n car.vertex(27.75f, 9);\n car.vertex(28, 10);\n car.vertex(30, 20);\n ////hood curve\n car.vertex(0, 20);\n car.vertex(0, 50);\n car.vertex(30, 50);\n car.vertex(30, 20);\n car.endShape(CLOSE);\n\n\n ////main body\n //have as three shape groups on top\n carTopLeft = createShape();\n carTopLeft.beginShape();\n carTopLeft.vertex(7, 24);\n carTopLeft.vertex(0, 50);\n carTopLeft.vertex(0, 20);\n carTopLeft.vertex(7, 24);\n carTopLeft.endShape(CLOSE);\n\n carTopRight = createShape();\n carTopRight.beginShape();\n carTopRight.vertex(23, 24);\n carTopRight.vertex(30, 50);\n carTopRight.vertex(30, 20);\n carTopRight.vertex(23, 24);\n carTopRight.endShape(CLOSE);\n\n carTop = createShape();\n carTop.beginShape();\n carTop.vertex(23, 24);\n\n carTop.vertex(15, 21);\n\n carTop.vertex(7, 24);\n carTop.vertex(0, 50);\n carTop.vertex(30, 50);\n carTop.vertex(23, 24);\n carTop.endShape(CLOSE);\n //car.vertex(23,24);\n //car.vertex(30,50);\n //car.vertex(30,20);\n //car.vertex(23,24);\n //car.vertex(22,23.25);\n //car.vertex(21,22.6);\n //car.vertex(20,22.1);\n //car.vertex(19,21.8);\n //car.vertex(18,21.4);\n //car.vertex(17,21.2);\n //car.vertex(16,21.1);\n //car.vertex(15,21);\n\n //car.vertex(14,21.1);\n //car.vertex(13,21.2);\n //car.vertex(12,21.4);\n //car.vertex(11,21.8);\n //car.vertex(10,22.1);\n //car.vertex(9,22.6);\n //car.vertex(8,23.25);\n //car.vertex(7,24);\n //car.vertex(0,50);\n //car.vertex(0,20);\n //car.vertex(7,24);\n //car.vertex(0,50);\n ////top details\n\n ////rear\n //test vertex\n carRear = createShape();\n carRear.beginShape();\n carRear.vertex(0, 50);\n carRear.vertex(0, 70);\n carRear.vertex(1, 71.2f);\n carRear.vertex(2, 72.33f);\n carRear.vertex(3, 73);\n carRear.vertex(4, 73.25f);\n carRear.vertex(5, 73.75f);\n carRear.vertex(6, 74);\n carRear.vertex(7, 74.2f);\n carRear.vertex(8, 74.4f);\n carRear.vertex(9, 74.6f);\n carRear.vertex(10, 74.8f);\n // carRear.vertex(11,74.85);\n // carRear.vertex(12,74.9);\n //carRear.vertex(14,74.95); \n carRear.vertex(15, 75);\n //carRear.vertex(16,74.95); \n //carRear.vertex(17,74.93);\n //carRear.vertex(18,74.9);\n carRear.vertex(19, 74.85f);\n carRear.vertex(20, 74.8f);\n carRear.vertex(21, 74.6f);\n carRear.vertex(22, 74.4f);\n carRear.vertex(23, 74.2f);\n carRear.vertex(24, 74);\n carRear.vertex(25, 73.75f);\n carRear.vertex(26, 73.25f);\n carRear.vertex(27, 73);\n carRear.vertex(28, 72.33f);\n carRear.vertex(29, 71.2f);\n carRear.vertex(30, 70);\n carRear.vertex(30, 50);\n carRear.endShape(CLOSE);\n //FINISH THE PSHAPE WITH YOUR CUSTOM VERTICES\n\n //it worked\n\n // ADD WHEELS TO THE CAR (ELLIPSES)\n //leftWheel = createShape(ELLIPSE, xCoord +10, yCoord + 25, 8, 8);\n // rightWheel = createShape(ELLIPSE, xCoord +45, yCoord + 25, 8, 8);\n\n //groups everything together\n fullCar.addChild(car);\n fullCar.addChild(carRear);\n fullCar.addChild(carTopLeft);\n fullCar.addChild(carTopRight);\n fullCar.addChild(carTop);\n // fullCar.addChild(leftWheel);\n // fullCar.addChild(rightWheel);\n }", "public void setBallLocation(int x, int y, int level){\n rect.left = x ;\n rect.top = y-200;\n rect.right = x + width;\n rect.bottom = y - 100 - height;\n\n this.setRandomVelocity(level);\n this.xVelocity = 0;\n }", "public void positionShipsRandomly() {\r\n\t\tfor(Ship ship:ships) {\r\n\t\t\tpositionShipRandomly(ship,occupiedFields);\r\n\t\t}\r\n\t}", "public void deplacer(int nx, int ny)\n\t{\n\t\tposX = nx;\n\t\tposY = ny;\n\t}", "public void setPosition(float x, float y);", "private void setShips(){\n\t\t\n\t\tint x,y;\n\t\tboolean orientacja;\n\t\tRandom generator = new Random();\n\t\t\n\t\tint ilosc = 1;\n\t\tint j = 0;\n\t\tfor(int i = 4; i > 0 ; i--){\n\t\t\twhile( j < ilosc ){\n\t\t\t\tx = generator.nextInt( 13 );\t\t\n\t\t\t\ty = generator.nextInt( 13 );\n\t\t\t\torientacja = generator.nextBoolean();\n\t\t\t\tif( isPossibleAddShip(x, y, i, orientacja) ) j++;\t\n\t\t\t}\n\t\tilosc++;\n\t\tj=0;\n\t\t}\n\t\t\n\t}", "private void addAsteroids(int count)\n {\n int x;\n int y;\n \n for(int i = 0; i < count; i++)\n {\n x = Greenfoot.getRandomNumber(getWidth()/2);\n y = Greenfoot.getRandomNumber(getHeight()/2);\n addObject(new Asteroid(), x, y);\n }\n }", "public MyWorld()\n { \n // Create a new world with 1600x1200 cells with a cell size of 1x1 pixels.\n super(1125, 1125, 1);\n //Adds the Cornucopia to the center of the Arena.\n int centerX = this.getWidth()/2;\n int centerY = this.getHeight()/2;\n this.addObject(new Cornucopia(), centerX, centerY);\n \n //The following adds the main character for the game.\n int CharacterX = 1125/2;\n int CharacterY = 770;\n this.addObject(new Character(), CharacterX, CharacterY);\n \n //The following code adds 6 \"Careers\" into the arena.\n int CareerX = 405;\n int CareerY = 328;\n this.addObject(new Careers(), CareerX, CareerY);\n this.addObject(new Careers(), CareerX+310, CareerY-5);\n this.addObject(new Careers(), CareerX+90, CareerY+430);\n this.addObject(new Careers(), CareerX+290, CareerY+405);\n this.addObject(new Careers(), CareerX+190, CareerY-60);\n \n //The following code add the remaining 17 Tributes to the arena.\n //Also, I cannot add like a normal person so there will only be twenty-three tributes. The Capitol goofed this year.\n int TribX = 660;\n int TribY = 288;\n this.addObject(new Tributes(), TribX, TribY);\n this.addObject(new Tributes(), TribX-200, TribY);\n this.addObject(new Tributes(), TribX-227, TribY+443);\n this.addObject(new Tributes(), TribX-280, TribY+400);\n this.addObject(new Tributes(), TribX-34, TribY+467);\n this.addObject(new Tributes(), TribX+86, TribY+397);\n this.addObject(new Tributes(), TribX-134, TribY-22);\n this.addObject(new Tributes(), TribX+103, TribY+82);\n this.addObject(new Tributes(), TribX+139, TribY+144);\n this.addObject(new Tributes(), TribX+150, TribY+210);\n this.addObject(new Tributes(), TribX+150, TribY+280);\n this.addObject(new Tributes(), TribX+120, TribY+342);\n this.addObject(new Tributes(), TribX-338, TribY+275);\n this.addObject(new Tributes(), TribX-319, TribY+343);\n this.addObject(new Tributes(), TribX-343, TribY+210);\n this.addObject(new Tributes(), TribX-330, TribY+150);\n this.addObject(new Tributes(), TribX-305, TribY+80);\n \n //The following code should add the forest onto the map.\n int ForX = this.getWidth()/2;\n int ForY = 900;\n this.addObject(new Forest(), ForX, ForY);\n \n //The following code should add the lake to the map.\n int LakX = 790;\n int LakY = 990;\n this.addObject(new Lake(), LakX, LakY);\n \n //The following should add the cave to the map.\n int CavX = 125;\n int CavY = 110;\n this.addObject(new Cave(), CavX, CavY);\n \n \n int actorCount = getObjects(Tributes.class).size();\n if(actorCount == 17) {\n int BeastX = 200;\n int BeastY = 200;\n this.addObject(new Beasts(), BeastX, BeastY);\n this.addObject(new Beasts(), BeastX+100, BeastY+100);\n }\n }", "public static void main(String[] args) {\n int[] a = {1, 2, 3, 4, 5, 6, 7, 8};\n ActorWorld world = new ActorWorld();\n //creat a DancingBug with the patten array above\n DancingBug zyh = new DancingBug(a);\n zyh.setColor(Color.ORANGE);\n //add the bug into grid, and set the location initially\n world.add(new Location(5,5), zyh);\n world.show();\n }", "public void updatePosition(int y, int x){\r\n\t\tposition = owner.getPosition().add(new Vector(x*SIZE, y*SIZE));\r\n\t\tcenter = this.position.add(new Vector(SIZE/2.,SIZE/2.));\r\n\t\tnode = new Node(center, y*owner.C + x);\r\n\t}", "public void setPosition(float x, float y) {\n internalGroup.setPosition(x, y);\n dataTrait.x = x;\n dataTrait.y = y;\n resetSprite();\n }", "private void setSpawnLocation(Object packet, Vector location, String xName, String yName, String zName) {\n ReflectUtils.setField(packet, xName, location.getX());\n ReflectUtils.setField(packet, yName, location.getY());\n ReflectUtils.setField(packet, zName, location.getZ());\n }", "@Override\n public void create () {\n batch = new SpriteBatch();\n height = Gdx.graphics.getHeight();\n width = Gdx.graphics.getWidth();\n\n bullets = new ArrayList<Bullet>();\n fondo = new Texture(\"background.png\");\n nave = new Texture(\"space-ship-24px.png\");\n\n spaceship = new SpaceShip();\n Enemy = new Enemy();\n //Enemy = new Sprite(nave);\n //spaceship.setPosition(348, 50);\n Enemy.setPosition(348, 300);\n System.out.println(x);\n }", "public Spots(int ID, double x, double y, double x2, double y2) {\n\t\tsuper(ID, x, y, x2, y2);\n\t}", "public void generateRooms(int x, int y, int z, int count) {\r\n this.generator = new RoomGenerator(world, x, y, z);\r\n\r\n generator.generatePoints(count);\r\n generator.buildAndConnectRooms();\r\n }" ]
[ "0.6596576", "0.6574158", "0.6315657", "0.60236704", "0.5879554", "0.58338255", "0.5833432", "0.5833214", "0.57702667", "0.5724294", "0.56670374", "0.56055075", "0.5585766", "0.55792934", "0.5572675", "0.55264354", "0.54997134", "0.54913527", "0.5487425", "0.5478634", "0.5474013", "0.5471526", "0.5461569", "0.54372036", "0.54365015", "0.5396849", "0.53828436", "0.5382007", "0.5374355", "0.5373094", "0.53647965", "0.5351582", "0.5345204", "0.53377974", "0.5333103", "0.5331701", "0.53244525", "0.5320466", "0.53173363", "0.5316719", "0.5313992", "0.5311423", "0.5308966", "0.5308471", "0.5303236", "0.5301717", "0.5298868", "0.5293875", "0.5292462", "0.52890635", "0.5269915", "0.5265662", "0.5258296", "0.5257403", "0.52492493", "0.5248766", "0.5246651", "0.52448636", "0.52385235", "0.5237713", "0.52372867", "0.5231518", "0.52304876", "0.5228378", "0.5226985", "0.5220559", "0.52192396", "0.5218863", "0.5215064", "0.52128214", "0.5198052", "0.51948774", "0.5194136", "0.51877636", "0.5183297", "0.51818967", "0.51748675", "0.5173277", "0.5171585", "0.5170781", "0.5159971", "0.51584375", "0.5154795", "0.5146824", "0.51463765", "0.51461023", "0.5146019", "0.514594", "0.51447695", "0.51427895", "0.5142159", "0.51282835", "0.51275146", "0.51231384", "0.5121759", "0.5119899", "0.51133394", "0.5113049", "0.51113945", "0.51111037" ]
0.77861977
0
Returns true if the Flame should be displayed and false if otherwise
public boolean getFlame() { return flame; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isDisplay();", "boolean isDisplay();", "public boolean isFlashShow() {\n return (isBeautyShow() || isMaskSelected()) ? false : true;\n }", "public boolean shouldShowFaceTransientIndication() {\n if (this.mBouncerShowing || !MiuiKeyguardUtils.isIndianRegion(this.mContext) || !WallpaperAuthorityUtils.isLockScreenMagazineOpenedWallpaper() || !this.mUpdateMonitor.isSupportLockScreenMagazineLeft()) {\n return false;\n }\n return true;\n }", "public boolean isBeautyShow() {\n return this.mActivity.getCameraAppUI().getBeautySeek() > 0.0f && !isDepthEnabled();\n }", "@Override\n protected boolean isAppropriate() {\n return true; // always show\n }", "private boolean isDisplay(JPiereIADTabpanel tabPanel)\n {\n String logic = tabPanel.getDisplayLogic();\n if (logic != null && logic.length() > 0)\n {\n boolean display = Evaluator.evaluateLogic(tabPanel, logic);\n if (!display)\n {\n log.info(\"Not displayed - \" + logic);\n return false;\n }\n }\n return true;\n }", "public boolean okToDisplay() {\n return this.mDisplayId == 0 ? !this.mWmService.mDisplayFrozen && this.mWmService.mDisplayEnabled && this.mWmService.mPolicy.isScreenOn() : this.mDisplayInfo.state == 2;\n }", "public boolean shown();", "public boolean canDisplay(){\n if(title.isEmpty() && body.isEmpty()){\n return false;\n }\n\n return true;\n }", "public boolean isFurnace() {\n return this.type == Type.FURNACE;\n }", "public boolean isShowfps() {\r\n\t\treturn showfps;\r\n\t}", "boolean isDisplayMessageOnRedeem();", "public boolean showPlayer(){\n\t\t\n\t\tSystem.out.println(\"\\t\"+color+\"\\t \"+playermoney+\"\\t \\t\"+totalminions+\" \\t\"+totalbuildings+\" \\t\\t\"+personalityCard.cardName);\n\t\treturn true;\n\t}", "@java.lang.Override\n public boolean hasDisplay() {\n return display_ != null;\n }", "public boolean isTextShown() {\n return introText.getVisibility() == View.VISIBLE;\n }", "public boolean shouldShow()\n {\n Timestamp today = DateUtils.getToday();\n Timestamp lastHintTimestamp = prefs.getLastHintTimestamp();\n return (lastHintTimestamp.isOlderThan(today));\n }", "public boolean hasDisplay() {\n return displayBuilder_ != null || display_ != null;\n }", "boolean hasPokemonDisplay();", "public boolean mo38893g() {\n return this.f30723V.isShowing();\n }", "boolean isSetDisplayName();", "public boolean isShowFPS() {\n return showFPS;\n }", "private boolean isAtFish(){\n final RSNPC[] fishing_spots = NPCs.findNearest(\"Fishing spot\");\n if (fishing_spots.length < 1){\n return false;\n }\n return fishing_spots[0].isOnScreen();\n }", "public boolean isSetDisplay() {\n return this.display != null;\n }", "public boolean isDoneFlgTrue() {\n HangarCDef.Flg cdef = getDoneFlgAsFlg();\n return cdef != null ? cdef.equals(HangarCDef.Flg.True) : false;\n }", "public boolean useF()\n {\n return (Greenfoot.isKeyDown(\"f\"));\n }", "private boolean fireAutoFlashFrontScreen() {\n final int iso_threshold = 750;\n return capture_result_has_iso && capture_result_iso >= iso_threshold;\n }", "boolean isShowLabelBackdrop();", "public boolean isShown(){\r\n return shown;\r\n }", "public boolean isShowcoor() {\r\n\t\treturn showcoor;\r\n\t}", "public boolean displayMessage()\n {\n boolean show = false;\n Calendar cal2 = null;\n Calendar cal = null;\n\n int h = this.getIntHora();\n cal = Calendar.getInstance();\n cal.setTime(cfg.getCoreCfg().getIesClient().getDatesCollection().getHoresClase()[h-1]);\n cal.set(Calendar.YEAR, m_cal.get(Calendar.YEAR));\n cal.set(Calendar.MONTH, m_cal.get(Calendar.MONTH));\n cal.set(Calendar.DAY_OF_MONTH, m_cal.get(Calendar.DAY_OF_MONTH));\n cal.add(Calendar.MINUTE, cfg.activaMissatges);\n\n cal2 = (Calendar) cal.clone();\n cal2.add(Calendar.SECOND, 4); //show during 4 sec\n\n //System.out.println(\"ara es hora\" + h);\n //System.out.println(\"comparing dates \" + cal.getTime() + \"; \" + cal2.getTime() + \"; \" + m_cal.getTime());\n\n if(cal.compareTo(m_cal)<=0 && m_cal.compareTo(cal2)<=0 )\n {\n show = true;\n }\n\n return show;\n }", "boolean hasAlreadShowCard();", "public boolean getFpsDisplay() { return fpsDisplay; }", "public boolean isFonc() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isShowing() {\n\t\treturn false;\n\t}", "protected boolean isShowFormatterSetting() {\n \t\treturn true;\n \t}", "@Override\n public boolean isShown() {\n return super.isShown();\n }", "public boolean isFrei() {\n return frei;\n }", "@java.lang.Override\n public boolean hasPokemonDisplay() {\n return pokemonDisplay_ != null;\n }", "public Boolean getDisplay() {\n return display;\n }", "public boolean okToAnimate() {\n return okToDisplay() && (this.mDisplayId != 0 || this.mWmService.mPolicy.okToAnimate());\n }", "public boolean hasFainted() {\n return hp <= 0;\n }", "public boolean isFell() {\n return fell;\n }", "public boolean isDisplayed() {\n return isValid() && (getLastSeen() > System.currentTimeMillis() - DAYS_30);\n }", "public boolean myHealthVisible()\n\t{\n\t\tIntBitmap lifeBar = IntBitmap.getInstance(takeScreenshot(ScreenRegion.LIFE_RECT));\n\t\tRatioFilter.maintainRatio(lifeBar, FilterType.LIFE);\n\t\tBinaryImage bin = lifeBar.toGreyscale().doubleCutoff(30);\n\t\treturn bin.countWhite() > 1000;\n\t\t//return imageMatches(IntBitmap.getInstance(takeScreenshot(ScreenRegion.FIND_HEALTH_RECT)), ImageLibrary.MY_HEALTH_ICON.get());\n\t}", "public boolean shouldDisplayTextLabel()\r\n {\r\n return displayTextLabelInformation_;\r\n }", "public abstract boolean isRendered();", "public boolean isMotionShow() {\n return (isDepthEnabled() || isBeautyShow() || isMaskSelected() || saveDngEnabled() || !CustomUtil.getInstance().isPanther()) ? false : true;\n }", "public boolean isHdrShow() {\n SettingsManager settingsManager = this.mActivity.getSettingsManager();\n return (!Keys.isAlgorithmsOn(settingsManager) || saveDngEnabled() || isDepthEnabled() || Keys.isMotionOn(settingsManager) || isBeautyShow() || isMaskSelected()) ? false : true;\n }", "boolean hasFeedback();", "public boolean hasPresentation();", "public boolean isFine();", "public boolean hasPokemonDisplay() {\n return pokemonDisplayBuilder_ != null || pokemonDisplay_ != null;\n }", "public boolean isAlface(){\n return salada.isAlface();\n }", "public boolean ShowStats(){\n if(!determineValid()){\n Main.errorNumber = WrongNumber;\n return false;\n }\n labelNames();\n groupDisplay.setText(\"\");\n groupDisplay.setText(groupDisplay.getText() + displayArray(racers.get(group.get(0))));\n\n for(int i = 1; i < group.size(); ++i){\n groupDisplay.setText(groupDisplay.getText() + \"\\n\\n\" + displayArray(racers.get(group.get(i))));\n\n }\n\n return true; //success\n }", "boolean isVisible();", "boolean isVisible();", "private boolean show(AttributeModel am) {\n\t\t// never show invisible or LOB attributes\n\t\tif (!am.isVisible() || AttributeType.LOB.equals(am.getAttributeType())) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// show multiple value attributes only if they would normally show up in a table\n\t\tif (AttributeType.DETAIL.equals(am.getAttributeType())\n\t\t || AttributeType.ELEMENT_COLLECTION.equals(am.getAttributeType())) {\n\t\t\treturn am.isVisibleInTable();\n\t\t}\n\t\treturn true;\n\t}", "public boolean isDisplayed_click_Fuel_Rewards_Link(){\r\n\t\tif(click_Fuel_Rewards_Link.isDisplayed()) { return true; } else { return false;} \r\n\t}", "protected void staffIsLegend(){\r\n System.out.println(\"you must show some respect to staff \");\r\n }", "private boolean visible() {\r\n return NOT(GO() && CATS(Cc,Cn,Co,Cs,Zl,Zp)) && POINT();\r\n }", "boolean isReadyForShowing();", "boolean hasFaceUp();", "public boolean isVisualFire ( ) {\n\t\treturn extract ( handle -> handle.isVisualFire ( ) );\n\t}", "public boolean isPerdu() {\n\t\tassert(f.getLevel() != null);\n\t\t\n\t\tLevel l = f.getLevel();\n\t\t\n\t\tif(l.getBall() == null) {//pour le menu principal -> pas de balle\n\t\t\treturn false;\n\t\t}\n\t\tif(l.getType() == Type.INVERSE) {\n\t\t\treturn l.getBall().getPosY()<50;//en haut de l'ecran\n\t\t}else {\n\t\t\treturn l.getBall().getPosY()>f.getHauteurFenetre()-50;//en bas de l'ecran\n\t\t}\n\t}", "public boolean mo23026i() {\n return this.f26122b.getBoolean(\"has.show.tut\", false);\n }", "public boolean isSetShowNarration()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(SHOWNARRATION$18) != null;\n }\n }", "boolean isCanSeeFriendlyInvisibles();", "boolean hasFairplay();", "@Override\n\tpublic boolean canRenderOnFire() {\n\t\treturn super.canRenderOnFire() && !getBreed().isImmuneToDamage(DamageSource.IN_FIRE);\n\t}", "public boolean affordCard() {\n \t\treturn (FREE_BUILD || getResources(Type.WOOL) >= 1\n \t\t\t\t&& getResources(Type.GRAIN) >= 1 && getResources(Type.ORE) >= 1);\n \t}", "public boolean isRender()\r\n/* 284: */ {\r\n/* 285:307 */ if (this.tipoReporte.ordinal() == 1) {\r\n/* 286:308 */ this.render = true;\r\n/* 287: */ } else {\r\n/* 288:310 */ this.render = false;\r\n/* 289: */ }\r\n/* 290:311 */ return this.render;\r\n/* 291: */ }", "public boolean isDisplayed();", "public boolean isPreview() {\r\n return preview;\r\n }", "@Override\n public boolean isNeedShowBOTPRule() {\n \treturn true;\n }", "void updateFiducialessDisplay() {\n if (dialog == null) {\n return;\n }\n EtomoBoolean2 sampleFiducialess = state.getSampleFiducialess(axisID);\n boolean enable = false;\n if (sampleFiducialess == null || sampleFiducialess.is() == dialog.isFiducialess()) {\n enable = true;\n }\n dialog.setTomopitchEnabled(enable);\n dialog.setAngleOffsetEnabled(enable);\n dialog.setTiltAxisZShiftEnabled(enable);\n dialog.setAlignButtonEnabled(enable);\n dialog.setTiltAngleOffsetEnabled(enable);\n dialog.setZShiftEnabled(enable);\n dialog.setXAxisTiltEnabled(enable);\n dialog.setThicknessEnabled(enable);\n }", "public boolean isAnimationDisplayable() {\r\n \t\treturn true;\r\n \t}", "private boolean getNeedTitle()\r\n\t{\n\t\tif (new EditionSpeService().ficheProducteurNeedEngagement()==false)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Si on interdit d'afficher un des deux blocs : pas de titre\r\n\t\tif ((peMesContrats.canPrintContrat==ImpressionContrat.JAMAIS) || (peMesContrats.canPrintContratEngagement==ImpressionContrat.JAMAIS))\r\n\t\t{\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Sinon, il faut un titre\r\n\t\treturn true;\r\n\t}", "public boolean isFacebeautyEnabled() {\n return false;\n }", "@Override\n public boolean isVisible()\n {\n return true;\n }", "public String getIsdisplay() {\n return isdisplay;\n }", "public boolean isDoneFlgFalse() {\n HangarCDef.Flg cdef = getDoneFlgAsFlg();\n return cdef != null ? cdef.equals(HangarCDef.Flg.False) : false;\n }", "@Override\n\tpublic boolean isFournisseur() {\n\t\treturn false;\n\t}", "public int isTurtleShowing () {\n if (myTurtleShowing) return 1;\n return 0;\n }", "public boolean isTargetVisible() {\n return getDouble(\"tv\") == 1;\n }", "public boolean getNoDisplay() {\n\t\treturn false;\n\t}", "boolean isDisplayed();", "public boolean shouldHide() {\n\t\treturn hide;\n\t}", "public boolean isHidden();", "boolean isAllowFriendlyFire();", "@Override\n public boolean isLearnMoreDisplayed() {\n\n setLogString(\"Check if Learn More is displayed\", true, CustomLogLevel.HIGH);\n return isDisplayed(getDriver(), By.cssSelector(\".help_icon.clickable\"), TINY_TIMEOUT);\n }", "public void hintDisplay() {\n hintLayout.setVisibility(View.VISIBLE);\n String largeThan = (getString(R.string.large_than) + \" \" + userGuess);\n String smallerThan = (getString(R.string.smaller_than) + \" \" + userGuess);\n\n if (userGuess < randomNumber) {\n// DO THIS IS GUESS IS SMALLER THAN NUMBER\n hintArrow.setImageResource(R.drawable.ic_arrow_upward);\n hintArrow.setColorFilter(getResources().getColor(R.color.low));\n hintMessage.setText(largeThan);\n } else {\n// DO THIS IS GUESS IS SMALLER THAN NUMBER\n hintArrow.setImageResource(R.drawable.ic_arrow_downward);\n hintArrow.setColorFilter(getResources().getColor(R.color.high));\n hintMessage.setText(smallerThan);\n }\n }", "@Override\r\n\tpublic boolean canShow() {\r\n\t\treturn super.canShow() &&\r\n\t\t\t\t(getSpeakControl().isSpeaking() || getSpeakControl().isPaused());\r\n\t}", "public boolean getCorrectFuncion(){\n\t\tif(this.getBackground().equals(Color.RED))\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public boolean isFractured() {\n\t\treturn isFractured;\n\t}", "public boolean isShowEvidence() {\n return showEvidence;\n }", "public boolean isVisible();", "public boolean isVisible();", "public boolean isVisible();", "public Boolean isVisible();" ]
[ "0.68687874", "0.68687874", "0.6737179", "0.64586407", "0.64115024", "0.6402886", "0.63198483", "0.6305653", "0.628968", "0.62894756", "0.62563354", "0.6235373", "0.62334675", "0.6163642", "0.61428034", "0.61330825", "0.60777533", "0.606668", "0.6053503", "0.6040934", "0.60400224", "0.60248077", "0.60147834", "0.6009947", "0.6008927", "0.5997538", "0.599246", "0.5982452", "0.5970242", "0.5951604", "0.59411335", "0.59296477", "0.59251285", "0.5921944", "0.5916284", "0.5906609", "0.59042895", "0.59039676", "0.58752877", "0.58635014", "0.58397824", "0.5839203", "0.5838415", "0.5835256", "0.5834862", "0.58259255", "0.58201694", "0.5811172", "0.5804094", "0.5803151", "0.57973504", "0.5796718", "0.57836217", "0.5782549", "0.57679075", "0.57649165", "0.57649165", "0.57645524", "0.57303965", "0.5714451", "0.5713903", "0.57090336", "0.5708925", "0.57083136", "0.5697679", "0.56931096", "0.5692465", "0.5690226", "0.5685713", "0.56844246", "0.5681447", "0.5678631", "0.5673044", "0.5666239", "0.5665655", "0.56646985", "0.5660452", "0.5660089", "0.5656543", "0.5647694", "0.5643597", "0.5638783", "0.56361157", "0.5633872", "0.56228745", "0.56174314", "0.56138074", "0.5611309", "0.56073904", "0.5604409", "0.5601742", "0.559963", "0.5596667", "0.5587044", "0.5585274", "0.5576685", "0.55736405", "0.55736405", "0.55736405", "0.55724114" ]
0.70315117
0
Place a bullet object at the given x and y coordinates
private void placeBullet(double x, double y) { b = new Bullet(x, y); addParticipant(b); b.setVelocity(BULLET_SPEED, ship.getRotation()); new ParticipantCountdownTimer(b, "expire", BULLET_DURATION); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createBullet(String name, double x, double y) {\n Player player = (Player) players.get(name);\r\n if (player != null) {\r\n Bullet bullet = new Bullet(x, y);\r\n bullet.player = name;\r\n playAudio(\"shoot\");\r\n }\r\n }", "public void shoot(){\n int bulletPosX = posX;\n int bulletPosY = posY;\n int bulletVelX = 0;\n int bulletVelY = -9;\n //add the new bullets to the array of bullets\n bullets.add(new Bullet(bulletPosX,bulletPosY,bulletVelX,bulletVelY,0,attack));\n }", "private void setBulletLocation(View v, float x, float y) {\n v.setX(x);\n v.setY(y);\n }", "Bullet(int posX,int posY,int velX,int velY,int classOfObejct,int attack){\n this.posX = posX;\n this.posY = posY;\n this.velX = velX;\n this.velY = velY;\n this.classOfObejct = classOfObejct;\n this.attack = attack;\n\n }", "public static void addBullet(float x, float y, float xspeed, float yspeed) {\r\n \tFloat[] t = new Float[4];\r\n \tt[0] = x;\r\n \tt[1] = y;\r\n \tt[2] = xspeed;\r\n \tt[3] = yspeed;\r\n \tbulletsToAdd.add(t);\r\n }", "public void shootAimingBullet(){\n bossBullet = new BossBullet(bossBulletImage,this.getXposition() + 100, this.getYposition() + 100, 8, player, true);\n bulletList.add(bossBullet);\n }", "public void attack()\n {\n getWorld().addObject(new RifleBullet(player.getX(), player.getY(), 1, 6, true), getX(), getY()); \n }", "public void place(float x,float y){\n\t\tz=0.2f+Main.world.land.getHigh(Main.world.timeline.getTerra(),(int)x, (int)y);\r\n\t\tMain.world.contacts(this);\r\n\t\tz+=getTopObjects();\r\n\t\tplace(x,y,z);\r\n\t}", "public void placeAlienBullet() {\r\n\t\tif (alien != null) {\r\n\t\t\t// If the alien is large fires a bullet in a random direction\r\n\t\t\tif (alien.getSize() == 1 && ship != null) {\r\n\r\n\t\t\t\t// Create the alien bullet\r\n\t\t\t\tab = new AlienBullet(alien.getX(), alien.getY());\r\n\r\n\t\t\t\t// give the alien bullet a random direction and the bullet speed velocity,\r\n\t\t\t\t// then add as participant\r\n\t\t\t\tdouble r = (2 * Math.PI) * RANDOM.nextDouble();\r\n\t\t\t\tab.setVelocity(BULLET_SPEED, r);\r\n\t\t\t\taddParticipant(ab);\r\n\r\n\t\t\t\t// Sets the alien bullet to expire when it reaches the bullet duration time\r\n\t\t\t\t// limit\r\n\t\t\t\tnew ParticipantCountdownTimer(ab, \"expire\", BULLET_DURATION);\r\n\t\t\t}\r\n\r\n\t\t\t// If the alien is small fires a bullet aimed directly at the ship\r\n\t\t\tif (alien.getSize() == 0 && ship != null) {\r\n\t\t\t\tab = new AlienBullet(alien.getX(), alien.getY());\r\n\t\t\t\tab.setSpeed(BULLET_SPEED);\r\n\r\n\t\t\t\t// Aims the alien bullet directly at the ship\r\n\t\t\t\tdouble A = ship.getY() - alien.getY();\r\n\t\t\t\tdouble B = ship.getX() - alien.getX();\r\n\t\t\t\tdouble angle = Math.atan2(A, B);\r\n\t\t\t\tab.setVelocity(BULLET_SPEED, angle);\r\n\r\n\t\t\t\t// Add the alien bullet as a participant and then set it to expire when it\r\n\t\t\t\t// reaches the bullet duration time limit\r\n\t\t\t\taddParticipant(ab);\r\n\t\t\t\tnew ParticipantCountdownTimer(ab, \"expire\", BULLET_DURATION);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public M_Bullet shoot() {\n Point leftCorner = this.getLocation();\n // get the center of the character\n int x = leftCorner.x;\n int y = leftCorner.y;\n Point dim = this.getDimensions();\n int h = dim.y;\n int w = dim.x;\n h = h / 2;\n w = w / 2;\n Point center = new Point(x + w, y + h);\n // get the velocity for the bullet\n Point vel = new Point(this.getDirection() * 3, 0);\n // set the enemy's shot cooldown to its shot interval.\n setShotCooldown(getShotInterval());\n // return the new bullet\n return new M_Bullet(center, this.getStrength(), vel, true);\n }", "@Override\n public void attack(){\n int xBullet=0,yBullet=0;\n switch(direction){\n case 0:\n xBullet=(int)(x+Sprite.python_left.getWidth()/3);\n yBullet=(int)(y+Sprite.python_left.getHeight()*3/4);\n break;\n case 1:\n xBullet=(int)(x+Sprite.python_left.getWidth()*3/4);\n yBullet=(int)(y+Sprite.python_left.getHeight()/4);\n break;\n case 2:\n xBullet=(int)(x+Sprite.python_left.getWidth()/3);\n yBullet=(int)(y+Sprite.python_left.getHeight()/4);\n break;\n case 3:\n xBullet=(int)(x+Sprite.python_left.getWidth()/4);\n yBullet=(int)(y+Sprite.python_left.getHeight()/4);\n break;\n }\n PythonBullet pythonBullet=new PythonBullet(xBullet,yBullet,board,Player.PLAYER_SPEED*1.5);\n pythonBullet.setDirection(direction);\n board.addBullets(pythonBullet);\n\n }", "public void shoot(){\n // boss bullete attract to player\n int bulletPosX = PApplet.parseInt(posX + (speed * cos(angle)));\n int bulletPosY = (int)(posY + hei / 2);\n float bulletAngle = atan2(Main.player.posY - bulletPosY, Main.player.posX - bulletPosX);\n int bulletVelX = (int)(8 * cos(bulletAngle));\n int bulletVelY = (int)(8 * sin(bulletAngle));\n bossBullets.add(new Bullet(bulletPosX,bulletPosY,bulletVelX,bulletVelY,1,attack));\n }", "public void shoot(GraphicsContext graphicsContext) {\n TankBullet bullet = new TankBullet(new FixedCoordinates(getCoordinates().getX() + 17, getCoordinates().getY() + 100), gameEnded, graphicsContext);\n bullet.draw(graphicsContext);\n CoordinatesCache.getInstance().getEnemyBullets().add(bullet);\n }", "public Bullet(float x, float y, int bitmapId, float xDest, float yDest, boolean shootsEnemies)\n {\n super(x, y, bitmapId);\n this.xDest = xDest;\n this.yDest = yDest;\n this.shootsEnemies = shootsEnemies;\n\n this.setAngle(calcAngle(x, y, xDest, yDest));\n }", "public Bullet(double theta, double x, double y){\n\t\t\tmovex = speed*Math.cos(theta); //calculates the move speed based on the angle upon which it is fired from\n\t\t\tmovey = -speed*Math.sin(theta);\t\t\t\t\t\n\t\t\tbx = (int)x;\n\t\t\tby=(int) y;\n\t\t\tthis.setBounds((int)bx,(int)by,10,10);\n\n\t\t}", "public void fireBullet(){\n\t\tBullet bullet = new Bullet(ship);\n\t\tbullets.add(bullet);\n\t\tsoundMan.playBulletSound();\n\t}", "public void fireBullet(int direction , int posX, int posY ){\n if ( clockBullet.getElapsedTime().asMilliseconds() > 100 ){\n int lowestbulletNo = 10;\n for( int i = 9; i > 0; i-- ){\n if ( bulletSpace.get(i).isEnabled() == false){\n lowestbulletNo = i;//find the first bullet in the gun barrol\n }\n }\n\n if ( lowestbulletNo < 10 ){\n bulletSpace.get(lowestbulletNo).setDirection(direction);\n bulletSpace.get(lowestbulletNo).setDistance(0);\n bulletSpace.get(lowestbulletNo).setPosX(posX - map.getX()) ;\n bulletSpace.get(lowestbulletNo).setPosY(posY - map.getY()) ;\n bulletSpace.get(lowestbulletNo).enabled(true);\n bulletSpace.get(lowestbulletNo).setRotation(direction+1);\n }\n }\n clockBullet.restart();\n }", "void spawnEntityAt(String typeName, int x, int y);", "private void moveBullet() {\r\n\t\tif(bullet != null) {\r\n\t\t\tbullet.move(bulletVelocity, 0);\r\n\t\t}\r\n\t}", "boolean testPlaceBullet(Tester t) {\n return t.checkExpect(bullet1.place(this.em),\n em.placeImageXY(new CircleImage(2, OutlineMode.SOLID, Color.PINK), 250, 300))\n && t.checkExpect(bullet2.place(this.em),\n em.placeImageXY(new CircleImage(2, OutlineMode.SOLID, Color.PINK), 600, 600));\n }", "public void onHitByBullet() {\r\n\t\t// Move ahead 100 and in the same time turn left papendicular to the bullet\r\n\t\tturnAheadLeft(100, 90 - hitByBulletBearing);\r\n\t}", "public Bomb(int x, int y){\r\n\t\t\r\n\t\t//Bomb image.\r\n\t\tImageIcon bombIMG = new ImageIcon(\"src/sprites/bullet9.png\");\r\n\t\tsetImage(bombIMG.getImage());\r\n\t\t\r\n\t\t//It just so works out that the bombs drop nicely from the alien sprite so no offset is needed.\r\n\t\tsetx(x);\r\n\t\tsety(y);\r\n\t\t\r\n\t}", "public void shoot(){\r\n \tgame.pending.add(new Bullet(this, bulletlife));\t\r\n }", "@Override\n public void create () {\n batch = new SpriteBatch();\n height = Gdx.graphics.getHeight();\n width = Gdx.graphics.getWidth();\n\n bullets = new ArrayList<Bullet>();\n fondo = new Texture(\"background.png\");\n nave = new Texture(\"space-ship-24px.png\");\n\n spaceship = new SpaceShip();\n Enemy = new Enemy();\n //Enemy = new Sprite(nave);\n //spaceship.setPosition(348, 50);\n Enemy.setPosition(348, 300);\n System.out.println(x);\n }", "public Bullet() {\n\t\t\n\t\tx = 0;\n\t\ty = 0;\n\t\timgBullet = new ImageIcon(getClass().getResource(\"lu.png\"));\n\t\twidth=imgBullet.getIconWidth();\n\t\theight=imgBullet.getIconHeight();\n\t\tshot = false;\n\t\n\t}", "public void shoot(double x, double y) {\n if (magazineCounter > 0 && !reloading) {\n magazineCounter--;\n new WeaponProjectile(new Point2D(x, y), mouseLocation(), projectileSpeed, testing);\n }\n }", "@Override\n public void fireBullet(ArrayList<ScreenObject> level) {\n level.add(new ShipBullet(position.x, position.y, 8, 8, direction));\n }", "private void shootingMotion(final View v, final float x, final float y) {\n setBulletLocation(v, x, y);\n ObjectAnimator animation = ObjectAnimator.ofFloat(v, \"translationY\", -300f);\n animation.setDuration(2000);\n animation.start();\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n checkOnHit(v);\n }\n }, 1300);\n }", "private void shoot(GObject bottom, GObject bottomLeft, GObject topRight, GObject bottomRight, GObject topLeft) {\r\n\t\t//if(bullet == null && bottom != null && bottomLeft == null && topRight == null && bottomRight == null && topLeft == null) {\r\n\t\t\t{bullet = new GRect(BULLET_WIDTH, BULLET_HEIGHT);\r\n\t\t\tbullet.setFilled(true);\r\n\t\t\tbullet.setColor(Color.green);\r\n\t\t\tif(facingEast == true) {\r\n\t\t\t\tbulletVelocity = BULLET_SPEED;\r\n\t\t\t\tadd(bullet, player.getX() + player.getWidth() + 1, player.getY() + player.getHeight() * 3/5.0);\r\n\t\t\t} else {\r\n\t\t\t\tbulletVelocity = -BULLET_SPEED;\r\n\t\t\t\tadd(bullet, player.getX() - BULLET_WIDTH, player.getY() + player.getHeight() * 3/5.0);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void drawBullet(){\n if (classOfObejct == 0){\n colorMode(RGB,255,255,255);\n noStroke();\n fill(255,100,30);\n ellipse(posX, posY, 6, 9);\n fill(255,153,51);\n ellipse(posX,posY, 4, 6);\n fill(255,255,100);\n ellipse(posX,posY, 2, 3);\n fill(255,255,200);\n ellipse(posX,posY, 1, 1);\n stroke(1);\n }\n else{\n colorMode(RGB,255,255,255);\n noStroke();\n fill(51,153,255);\n ellipse(posX, posY, 8, 8);\n fill(102,178,255);\n ellipse(posX,posY, 6, 6);\n fill(204,229,255);\n ellipse(posX,posY, 4, 4);\n fill(255,255,255);\n ellipse(posX,posY, 2, 2);\n stroke(1);\n }\n }", "public void shoot(int bulletLeft) {\n float xValue = canon.getX();\n float yValue = canon.getY();\n bullets.get(bulletLeft).setVisibility(View.VISIBLE);\n shootingMotion(bullets.get(bulletLeft), xValue, yValue);\n\n }", "public void createObject(float posX, float posY)\n\t{\n\t\tdrawableItems.add(new ObjectItem(posX,posY));\n\t}", "@Override\n\tpublic Bullet shoot(int hx, int hy) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void collideWith(Bullet bullet) {\n\t\tbulletMoveForward(bullet);\n\t}", "public void setBullet(Bullet bullet) {\r\n\t\tthis.bullet = bullet;\r\n\t}", "public void place(float x,float y,float z){\n\t\tthis.x=x;\r\n\t\tthis.y=y;\r\n\t\tthis.z=z;\r\n\t\tdx=x;\r\n\t\tdy=y;\r\n\t\tvz=0;\r\n\t\tvx=0;\r\n\t\tvy=0;\r\n\t}", "Item(int x, int y) {\n this.posX = x;\n this.posY = y;\n }", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\tshootBullet(arg0);\r\n\t\t\t}", "PositionedObject(){\n float x = DrawingHelper.getGameViewWidth()/2;\n float y = DrawingHelper.getGameViewHeight()/2;\n _position.set(x,y);\n }", "private void bulletCollisionWithObject() {\r\n\t\tif(bullet != null) {\r\n\t\t\tGObject collider = getElementAt(bullet.getX() -1 , bullet.getY() + 1);\r\n\t\t\tif (dragon1 != null && collider == dragon1) {\r\n\t\t\t\thit(dragon1);\r\n\t\t\t}\r\n\t\t\tif(dragon2 != null && collider == dragon2) {\r\n\t\t\t\thit(dragon2);\r\n\t\t\t}\r\n\t\t\tif(mehran != null && collider == mehran && bullet.getY() > mehran.getY() + mehran.getHeight() / 2.0) {\r\n\t\t\t\thit(mehran);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "GameObject(int x, int y){\n loadSprite();\n this.x = x;\n this.y = y;\n }", "public void shoot() {\n\n //DOWN\n if (moveDown && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (5 + this.getySpeed()) * this.getBulletSpeedMulti());\n\n } else if (moveDown && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (-5 + this.getySpeed() / 2) * this.getBulletSpeedMulti());\n } else if (moveDown && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), -5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n } else if (moveDown && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n }\n\n //UP\n else if (moveUp && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (5 + this.getySpeed() / 2) * this.getBulletSpeedMulti());\n\n } else if (moveUp && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (-5 + this.getySpeed()) * this.getBulletSpeedMulti());\n\n } else if (moveUp && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), -5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n } else if (moveUp && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n }\n\n //LEFT \n else if (moveLeft && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (5) * this.getBulletSpeedMulti());\n } else if (moveLeft && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (-5) * this.getBulletSpeedMulti());\n } else if (moveLeft && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (-5 + this.getxSpeed()) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n } else if (moveLeft && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (5 + this.getxSpeed() / 2) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n }\n\n //RIGHT\n else if (moveRight && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (5) * this.getBulletSpeedMulti());\n } else if (moveRight && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (-5) * this.getBulletSpeedMulti());\n } else if (moveRight && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (-5 + this.getxSpeed() / 2) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n } else if (moveRight && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (5 + this.getxSpeed()) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n } //STANDING STILL\n \n \n if (shootDown && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), 5 * this.getBulletSpeedMulti());\n } else if (shootUp && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), -5 * this.getBulletSpeedMulti());\n\n } else if (shootLeft && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), -5 * this.getBulletSpeedMulti(), 0 * this.getBulletSpeedMulti());\n\n } else if (shootRight && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 5 * this.getBulletSpeedMulti(), 0 * this.getBulletSpeedMulti());\n\n }\n }", "public void shootBullet( ){\n bulletsFired.add(new Bullet((short)(this.xPos + BOX_HEIGHT), (short)((this.getYPos() + (BOX_HEIGHT+15))), this.xPos, this.id, (byte) 0, (byte) 0, shootingDirection, currentWeapon.getKey()));\n\n byte weaponFired = currentWeapon.getKey();\n switch (weaponFired){\n case PISTOL_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(DEFAULT_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(DEFAULT_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.pistolSound);\n break;\n case MACHINEGUN_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(MACHINEGUN_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(MACHINEGUN_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.machineGunSound);\n break;\n case SHOTGUN_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(SHOTGUN_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(SHOTGUN_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.shotgunSound);\n break;\n case SNIPER_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(SNIPER_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(SNIPER_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.machineGunSound);\n break;\n case UZI_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(UZI_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(UZI_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.machineGunSound);\n break;\n case AI_WEAPON_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(AI_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(DEFAULT_RANGE);\n System.out.println(\"Bullet sound \" + audioHandler.getSoundEffectVolume());\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.pistolSound);\n break;\n default: bulletsFired.get(bulletsFired.size()-1).setDmg(DEFAULT_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(DEFAULT_RANGE);\n\n }\n }", "private void quickFireBulletFire() {\n\n\t\tbulletArrayList.add(\n\t\t\t\tnew Bullet(xPosition + ((width / 2) - bulletWidth / 2), bulletYPosition, bulletWidth, bulletHeight, \"Pink\"));\n\t}", "public void setPosition(float x, float y);", "void fire() {\r\n // firing a shot takes energy\r\n if (!expendEnergy(BULLET_ENERGY))\r\n return;\r\n\r\n //create a bullet object so it doesn't hit the ship that's firing it\r\n double xV = getXVel() + BULLET_SPEED * (Math.cos(orientation));\r\n double yV = getYVel() + BULLET_SPEED * (Math.sin(orientation));\r\n\r\n // create the actual bullet\r\n new Bullet(\r\n getGame(),\r\n (getXPos() + ((getSize()/2 + 2) * (Math.cos(orientation))) + xV),\r\n (getYPos() + ((getSize()/2 + 2) * (Math.sin(orientation))) + yV),\r\n xV,\r\n yV);\r\n }", "private void shoot()\n\t{\n\t\t//Speed movement of the bullet\n\t\tint speed = 0;\n\t\t//Damage dealt by the bullet\n\t\tint damage = 0;\n\t\t//Angle used to shoot. Used only by the vulcan weapon\n\t\tdouble angle = 0;\n\t\t\n\t\tif(weapon == PROTON_WEAPON)\n\t\t{\n\t\t\tspeed = 15;\n\t\t\tdamage = 10;\n\t\t\tbulletPool.getBulletPool(weapon).getBullet(getX()+37, getY()-this.getHeight()+30, speed, damage, 0);\n\t\t\tSoundManager.getInstance().playSound(\"protonshoot\", false);\n\t\t}\t\n\t\telse if(weapon == VULCAN_WEAPON)\n\t\t{\n\t\t\tspeed = 15;\n\t\t\tdamage = 2;\n\t\t\tangle = 10;\n\t\t\t\n\t\t\tbulletPool.getBulletPool(weapon).getThreeBullets(getX() +27, getX()+37, getX()+47,\n\t\t\t\t\tgetY()-this.getHeight()+30, speed, damage, (int)angle);\n\t\t\tSoundManager.getInstance().playSound(\"vulcanshoot\", false);\n\t\t}\t\t\n\t\telse\n\t\t{\n\t\t\tspeed = 15;\n\t\t\tdamage = 15;\n\t\t\tangle = 0;\n\t\t\t\n\t\t\tbulletPool.getBulletPool(weapon).getBullet(getX()+37, getY()-this.getHeight()+30,\n\t\t\t\t\t\tspeed, damage, angle);\n\t\t\tSoundManager.getInstance().playSound(\"gammashoot\", false);\n\t\t}\t\n\t}", "public void shoot(Point p, Graphics g, Player player){\r\n if(p.getX() > getXCoord()-20){ //not sure if -20 needed (it is to make cetner by the shoulder of arm)\r\n setFacing(1);\r\n } else{\r\n setFacing(0);\r\n }\r\n this.setAttackSpeedTimer(this.getAttackSpeedTimer() + 1);\r\n if(this.getAttackSpeedTimer() == this.getAttackSpeed()){\r\n\t\t Bullet bullet = new Bullet(this.getXCoord(), \r\n\t\t\t\t\t this.getYCoord(), this.getFacing(), g, findAngle(p), player);\r\n\t\t\t\t\t bullet.setAttack(50);\r\n\t\t bullet.setMouseY(this.getMouseY());\r\n\t\t bullet.setMouseX(this.getMouseX());\r\n\t\t bullet.setMouseAngle(this.getMouseAngle());\r\n\t \t bullet.setPlayerDirection(this.getPlayerDirection());\r\n\t\t this.addProjectile(bullet);\r\n\t\t this.setAttackSpeedTimer(0);\r\n\t\t //System.out.println(findAngle(p)*180/Math.PI);\r\n\t\t this.playSound();\r\n }\r\n }", "public void mousePressed(MouseEvent e){\n\t\t\t t.bullets.add(new Bullet(t.theta, t.lx, t.ly));\t\n\t\t}", "private static void reposition(Bullet blt) {\n\t\tswitch (blt.directory) {\n\t\tcase leftDown:\n blt.setPositionX( blt.getPositionX() + 10);\n blt.setPositionY(blt.getPositionY() + 100);\n\t\t\tbreak;\n\t\tcase left:\n\t\t\tblt.setPositionX( blt.getPositionX() - 10);\n\t blt.setPositionY(blt.getPositionY() + 22);\n\t\t\tbreak;\n\t\tcase down:\n\t\t\tblt.setPositionX( blt.getPositionX() + 24);\n\t blt.setPositionY(blt.getPositionY() + 110);\n\t\t\tbreak;\n\t\tcase up:\n\t\t\tblt.setPositionX( blt.getPositionX() + 20);\n\t blt.setPositionY(blt.getPositionY() - 10);\n\t\t\tbreak;\n\t\tcase right:\n\t\t\tblt.setPositionX( blt.getPositionX() + 110);\n\t blt.setPositionY(blt.getPositionY() + 23);\n\t\t\tbreak;\n\t\tcase rightDown:\n\t\t\tblt.setPositionX( blt.getPositionX() + 100);\n\t blt.setPositionY(blt.getPositionY() + 98);\n\t\t\tbreak;\n\t\tcase leftUp:\n\t\t\tblt.setPositionX( blt.getPositionX() + 10);\n\t blt.setPositionY(blt.getPositionY() + 12);\n\t\t\tbreak;\n\t\tcase rightUp:\n\t\t\tblt.setPositionX( blt.getPositionX() + 100);\n\t blt.setPositionY(blt.getPositionY() + 8);\n\t\t\tbreak;\n\t\t}\n\t\tblt.justCreated = false;\n\t}", "@Spawns(\"Background\")\r\n\tpublic Entity spawnEnemyBullet(SpawnData data) {\n\t\treturn Entities.builder().from(data).type(SpritesTypes.BACKGROUND).viewFromNode(FXGL.getAssetLoader().loadTexture(\"bg.png\"))\r\n\t\t\t\t.renderLayer(RenderLayer.BACKGROUND).build();\r\n\t}", "public Bullet(int bulletsDamage, @NotNull String bulletsType, Coordinate centerPointCoordinate, double angle, TankTroubleMap tankTroubleMap, boolean isUserTank, int tankIndex) {\n this.isUserTank = isUserTank;\n this.tankIndex = tankIndex;\n this.centerPointCoordinate = centerPointCoordinate;\n updateArrayListCoordinates();\n bulletsBlasted = false;\n damage = bulletsDamage;\n this.tankTroubleMap = tankTroubleMap;\n if (bulletsType.equals(\"NORMAL\")) {\n try {\n bulletsImage = ImageIO.read(new File(\"kit/bullet/normal.png\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else if (bulletsType.equals(\"LASER\")) { // ba else nazadam yevakht khastim emtiazi ezafe konim ye golule\n try {\n bulletsImage = ImageIO.read(new File(\"kit/bullet/laser.png\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n this.angle = angle;\n\n fireTime = LocalDateTime.now();\n Thread thread = new Thread(() -> {\n try {\n Thread.sleep(4000);\n bulletsBlasted = true;\n for (Bullet bullet : tankTroubleMap.getBullets()) {\n if (bullet.bulletsBlasted) tankTroubleMap.getBullets().remove(bullet);\n break;\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n });\n thread.start();\n\n }", "public void setBallLocation(int x, int y, int level){\n rect.left = x ;\n rect.top = y-200;\n rect.right = x + width;\n rect.bottom = y - 100 - height;\n\n this.setRandomVelocity(level);\n this.xVelocity = 0;\n }", "public void shoot(ArrayList<Bullet> alienBullets)\r\n\t{\r\n\t\t//do nothing usually\r\n\t}", "public Case(int posX, int posY, LivingBeing lb){\n\t\tthis.posX=posX; \n\t\tthis.posY=posY;\n\t\tthis.lb=lb; \n\t}", "protected Place(float x, float y) {\n position = new PointF(x, y);\n }", "public void placeDust(double x, double y) {\r\n\r\n\t\t// Place 4 dust objects, and add them as participants\r\n\t\tDust du = new Dust(x, y);\r\n\t\tDust du2 = new Dust(x + 5, y);\r\n\t\tDust du3 = new Dust(x + 5, y + 5);\r\n\t\tDust du4 = new Dust(x, y + 5);\r\n\t\taddParticipant(du);\r\n\t\taddParticipant(du2);\r\n\t\taddParticipant(du3);\r\n\t\taddParticipant(du4);\r\n\r\n\t\t// Set the velocities of the 4 dust objects\r\n\t\tdu.setVelocity(RANDOM.nextInt(16) / 10 + 1, 20);\r\n\t\tdu2.setVelocity(RANDOM.nextInt(16) / 10 + 1, 10);\r\n\t\tdu3.setVelocity(RANDOM.nextInt(16) / 10 + 1, -20);\r\n\t\tdu4.setVelocity(RANDOM.nextInt(16) / 10 + 1, -5);\r\n\r\n\t\t// Expire the 4 dust objects\r\n\t\tnew ParticipantCountdownTimer(du, 2000);\r\n\t\tnew ParticipantCountdownTimer(du2, 2100);\r\n\t\tnew ParticipantCountdownTimer(du3, 2200);\r\n\t\tnew ParticipantCountdownTimer(du4, 2300);\r\n\r\n\t\tdisplay.setLegend(\"\");\r\n\r\n\t}", "public Bullet() {\n super();\n }", "public void setPosition(float x, float y) {\n this.x = x;\n this.y = y;\n }", "public void setSpawn (int x, int y) {\n xCord = x;\n yCord = y;\n }", "public void setPosition(float x, float y){\n\t\t\n\t\tsprite.setPosition(x, y);\n\t}", "@Override\r\n\tpublic void onCollisionWithBullet() {\n\t\t\r\n\t}", "@Override\n public Bullet getBullet(Ship theShip) {\n Point speed = new Point(6, 0);\n Point location = theShip.getLocationPoint();\n Bullet b = new Bullet(location, speed, strength, new AngledMotion(), theShip, getImage());\n b.setHeading(theShip.getHeading());\n return b;\n }", "public Bullet(double x,boolean xN, double y,boolean yN, double dir)\r\n\t{\r\n\t\tsuper(x,y,WIDTH,HEIGHT);\t\r\n\t\txVel = SPEED*Math.cos(dir);\r\n\t\tyVel = SPEED*Math.sin(dir);\r\n\t\tif(xN)\r\n\t\t\txVel*=-1;\r\n\t\tif(yN)\r\n\t\t\tyVel*=-1;\r\n\t}", "public Bullet(double angle, int x, int y,boolean update) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tr = 2;\n\n\t\trad = Math.toRadians(angle);\n\t\tspeed = 10;\n\t\tdx = Math.cos(rad) * speed;\n\t\tdy = Math.sin(rad) * speed;\n\n\t\tthis.angle= (float) angle;\n\t\tcolor1 = Color.YELLOW;\n\n\t\tneedToSend=false;\n\t}", "public Bullet(ProximityVector position, double angle, ParticleManager particleManager) {\n //Arguments: ProximityEffect particleEffect, int health, int speed, Sound sound, Image image, ProximityVector position, double angle, Creep target\n super(particleManager.getBulletEffect(), 1, 20, sound, img, position, angle);\n\n }", "public void translate(float x, float y){\n hitBox.offset(x, y);\n }", "Ball create(int xpos, int ypos);", "public enemybullet(int x, int y, int xtank, int ytank) {\n\t\tthis.x=x; \n\t\tthis.y=y; \n\t\txspeed = speed; \n\t\tyspeed = (y-ytank)*speed/(x-xtank); \n\t\tSystem.out.println(xspeed+\" \"+yspeed);\n\t}", "public Entity(String ref,int x,int y) {\n\t\tthis.sprite = SpriteStore.get().getSprite(ref);\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public void shoot(float direction) {\n\t\tif(pause != 0) return;\n\t\tbullets.add(new Bullet(player.getPosition(),direction));\n\t\tpause = cooldown;\n\t}", "public Projectile(Vec2 position, Vec2 direction, Sprite sprite) {\n super(position, direction, sprite);\n allProjectilse.add(this);\n startPosition = transform.getGlobalPosition();\n setCollider(new CircleCollider(this, 30));\n setRenderLayer(RenderLayer.RenderLayerName.HIGH_BLOCKS);\n\n\n collider.setName(\"Bullet\");\n collider.setTag(\"DMG\");\n\n startTime = System.currentTimeMillis();\n startSize = new Vec2(1, 1);\n squareHeightStart = 1;\n squareWithStart = 1;\n }", "void setPos(float x, float y);", "public void avatarShoot()\r\n\t{\r\n\t\tBullet avatarPew = avatar.shoot();\r\n\t\tif (avatarPew!= null)\r\n\t\t{\r\n\t\t\tbullets.add(avatarPew);\r\n\t\t}\r\n\t}", "public Entity(float x, float y) {\n this.position = new Point(0,0);\n realX = x;\n realY = y;\n determinePosition();\n }", "void moveToPoint(float x, float y) {\n _x = x;\n _y = y;\n }", "public void onShootPressed(){\n if(player.getRechargeTimer()<=0) {\n playShootingSound();\n Bullet bullet = new Bullet();\n player.setRechargeTimer(shotRechargeTime);\n bullet.moveCentreTo(player.getCentreX(), player.getCentreY());\n bullet.setRotation(player.getRotation());\n bullet.setSpeed(new Point2D(15 * Math.cos(Math.toRadians(bullet.getRotation() - 90)), 15 * Math.sin(Math.toRadians(bullet.getRotation() - 90))));\n if(player.getTripleShotTimer()>0){\n Bullet bullet1 = new Bullet();\n bullet1.moveCentreTo(player.getCentreX(), player.getCentreY());\n bullet1.setRotation(player.getRotation()+15);\n bullet1.setSpeed(new Point2D(15 * Math.cos(Math.toRadians(bullet1.getRotation() - 90)), 15 * Math.sin(Math.toRadians(bullet1.getRotation() - 90))));\n Bullet bullet2 = new Bullet();\n bullet2.moveCentreTo(player.getCentreX(), player.getCentreY());\n bullet2.setRotation(player.getRotation()-15);\n bullet2.setSpeed(new Point2D(15 * Math.cos(Math.toRadians(bullet2.getRotation() - 90)), 15 * Math.sin(Math.toRadians(bullet2.getRotation() - 90))));\n }\n }\n }", "protected GameObject(double x, double y, double xSize, double ySize, ID id) {\n\t\tthis.pos = new Point2D(x, y);\n\t\tthis.body = new Rectangle2D.Double(pos.getX(), pos.getY(), xSize, ySize);\n\t\tthis.id = id;\n\t}", "@Override\n\tpublic void onCreateBulletEvent() {\n\t\tcreateBullet();\n\t}", "boolean testPlaceAllBullets(Tester t) {\n return t.checkExpect(this.lob3.placeAll(this.em),\n em.placeImageXY(bullet1.draw(), 250, 300).placeImageXY(bullet8.draw(), 50, 50)\n .placeImageXY(bullet9.draw(), 50, 50))\n && t.checkExpect(this.mt.placeAll(this.em), this.em);\n }", "private void shoot(int x, int y, int choice) {\n\t\tif (heroi.getDardos() > 0) {\n\t\t\t//left\n\t\t\tif (x == 1) {\n\t\t\t\tint i = 1;\n\t\t\t\twhile ((heroi.getX_coord()-i) > 0 && (labirinto.getLab()[heroi.getX_coord()-i][heroi.getY_coord()] != 'X')) {\n\t\t\t\t\tfor (int j = 0; j < dragoes.length; j++) {\n\t\t\t\t\t\tif (dragoes[j].getX_coord() == (heroi.getX_coord()-i))\n\t\t\t\t\t\t\tif (dragoes[j].getY_coord() == (heroi.getY_coord())) {\n\t\t\t\t\t\t\t\tif (dragoes[j].isAlive()) {\n\t\t\t\t\t\t\t\t\tdragoes[j].setAlive(false);\n\t\t\t\t\t\t\t\t\tlabirinto.setLabCell(dragoes[j].getX_coord(), dragoes[j].getY_coord(), ' ');\n\t\t\t\t\t\t\t\t\tif (inter == 0)\t\n\t\t\t\t\t\t\t\t\t\tconsole_interface.dragonKilled();\n\t\t\t\t\t\t\t\t\telse if (inter == 3) \n\t\t\t\t\t\t\t\t\t\tMazeDisplay.messageDragonKilled();\n\t\t\t\t\t\t\t\t\telse {}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//-----------------------------------------------------------------\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif (inter == 0)\n\t\t\t\t\tconsole_interface.shotLeft();\n\t\t\t\telse if (inter == 3) {} //shooting function\n\t\t\t\telse {}\n\t\t\t}\n\n\t\t\t//right\n\t\t\telse if (x == -1) {\n\t\t\t\tint i = 1;\n\t\t\t\twhile ((heroi.getX_coord()+i) < labirinto.getSize() && (labirinto.getLab()[heroi.getX_coord()+i][heroi.getY_coord()] != 'X')) {\n\t\t\t\t\tfor (int j = 0; j < dragoes.length; j++) {\n\t\t\t\t\t\tif (dragoes[j].getX_coord() == (heroi.getX_coord()+i))\n\t\t\t\t\t\t\tif (dragoes[j].getY_coord() == (heroi.getY_coord())) {\n\t\t\t\t\t\t\t\tif (dragoes[j].isAlive()) {\n\t\t\t\t\t\t\t\t\tdragoes[j].setAlive(false);\n\t\t\t\t\t\t\t\t\tlabirinto.setLabCell(dragoes[j].getX_coord(), dragoes[j].getY_coord(), ' ');\n\t\t\t\t\t\t\t\t\tif (inter == 0) \n\t\t\t\t\t\t\t\t\t\tconsole_interface.dragonKilled();\n\t\t\t\t\t\t\t\t\telse if (inter == 3) \n\t\t\t\t\t\t\t\t\t\tMazeDisplay.messageDragonKilled();\n\t\t\t\t\t\t\t\t\telse {}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//-----------------------------------------------------------------\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif (inter == 0)\n\t\t\t\t\tconsole_interface.shotRight();\n\t\t\t\telse if (inter == 3) {} //shooting function\n\t\t\t\telse {}\n\t\t\t}\n\n\t\t\t//up\n\t\t\telse if (y == 1) {\n\t\t\t\tint i = 1;\n\t\t\t\twhile ((heroi.getY_coord()-i) > 0 && (labirinto.getLab()[heroi.getX_coord()][heroi.getY_coord()-i] != 'X')) {\n\t\t\t\t\tfor (int j = 0; j < dragoes.length; j++) {\n\t\t\t\t\t\tif (dragoes[j].getY_coord() == (heroi.getY_coord()-i))\n\t\t\t\t\t\t\tif (dragoes[j].getX_coord() == (heroi.getX_coord())) {\n\t\t\t\t\t\t\t\tif (dragoes[j].isAlive()) {\n\t\t\t\t\t\t\t\t\tdragoes[j].setAlive(false);\n\t\t\t\t\t\t\t\t\tlabirinto.setLabCell(dragoes[j].getX_coord(), dragoes[j].getY_coord(), ' ');\n\t\t\t\t\t\t\t\t\tif (inter == 0) console_interface.dragonKilled();\n\t\t\t\t\t\t\t\t\telse if (inter == 3) MazeDisplay.messageDragonKilled();\n\t\t\t\t\t\t\t\t\telse {}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//-----------------------------------------------------------------\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif (inter == 0)\n\t\t\t\t\tconsole_interface.shotUp();\n\t\t\t\telse if (inter == 3) {} //shooting function\n\t\t\t\telse {}\n\t\t\t}\n\n\t\t\t//down\n\t\t\telse { \n\t\t\t\tint i = 1;\n\t\t\t\twhile ((i+heroi.getY_coord()) < labirinto.getSize() && (labirinto.getLab()[heroi.getX_coord()][heroi.getY_coord()+i] != 'X')) {\n\t\t\t\t\tfor (int j = 0; j < dragoes.length; j++) {\n\t\t\t\t\t\tif (dragoes[j].getY_coord() == (heroi.getY_coord()+i))\n\t\t\t\t\t\t\tif (dragoes[j].getX_coord() == (heroi.getX_coord())) {\n\t\t\t\t\t\t\t\tif (dragoes[j].isAlive()) {\n\t\t\t\t\t\t\t\t\tdragoes[j].setAlive(false);\n\t\t\t\t\t\t\t\t\tlabirinto.setLabCell(dragoes[j].getX_coord(), dragoes[j].getY_coord(), ' ');\n\t\t\t\t\t\t\t\t\tif (inter == 0) console_interface.dragonKilled();\n\t\t\t\t\t\t\t\t\telse if (inter == 3) MazeDisplay.messageDragonKilled();\n\t\t\t\t\t\t\t\t\telse {}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//-----------------------------------------------------------------\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif (inter == 0) \n\t\t\t\t\tconsole_interface.shotDown();\n\t\t\t\telse if (inter == 3) {} //shooting function\n\t\t\t\telse {}\n\t\t\t}\n\t\t\theroi.dec_dardos();\n\t\t}\n\t\telse\n\t\t\tif (inter == 0)\n\t\t\t\tconsole_interface.no_darts();\n\t\t\telse if (inter == 3) MazeDisplay.noDarts();\n\t\t\telse {}\n\n\t\tdisplayDragoes();\n\t\tchange_hero_pos();\n\t}", "public void place(Position position) { this.position = position; }", "public void addBomb() \n {\n if (Greenfoot.isKeyDown(\"space\"))\n getWorld().addObject(new Bomb(), getX(), getY()); \n //add a bomb at the place they press space \n }", "@Override\n public void draw(Graphics2D g2d) {\n g2d.drawImage(getBulletImg(), this.getX(), this.getY(), null);\n \n }", "public Entity( int x, int y){\n this.x = x;\n this.y = y;\n }", "private void placeDebris(double x, double y) {\r\n\r\n\t\t// Place three Debris objects\r\n\t\tint variety = RANDOM.nextInt(4);\r\n\t\tDebris d = new Debris(x, y, variety);\r\n\t\td.setVelocity(RANDOM.nextInt(16) / 10 + 1, 20);\r\n\r\n\t\tvariety = RANDOM.nextInt(4);\r\n\t\tDebris d2 = new Debris(x + 5, y + 5, variety);\r\n\t\td2.setVelocity(RANDOM.nextInt(16) / 10 + 1, 10);\r\n\r\n\t\tvariety = RANDOM.nextInt(4);\r\n\t\tDebris d3 = new Debris(x - 5, y - 5, variety);\r\n\t\td3.setVelocity(RANDOM.nextInt(16) / 10 + 1, -20);\r\n\r\n\t\t// Add the Debris objects as participants\r\n\t\taddParticipant(d);\r\n\t\taddParticipant(d2);\r\n\t\taddParticipant(d3);\r\n\r\n\t\t// Expire the three debris objects after 2 seconds\r\n\t\tnew ParticipantCountdownTimer(d, 2000);\r\n\t\tnew ParticipantCountdownTimer(d2, 2100);\r\n\t\tnew ParticipantCountdownTimer(d3, 2200);\r\n\r\n\t\t// Place a dust object at the site of the debris\r\n\t\tplaceDust(x, y);\r\n\t\tdisplay.setLegend(\"\");\r\n\r\n\t}", "@SuppressWarnings(\"unused\")\n void spawn(Entity entity);", "public UpBullet(CopyOnWriteArrayList<Slender> slender,CopyOnWriteArrayList<Slender> slender1,CopyOnWriteArrayList<Slender> slender2,Boss boss,CopyOnWriteArrayList<box> boxes, int x, int y,int width, int height, String img)\r\n\t{\r\n\t\tthis.slender = slender;\r\n\t\tthis.slender1 = slender1;\r\n\t\tthis.slender2 = slender2;\r\n\r\n\t\tthis.boss = boss;\r\n\r\n\t\tthis.boxes = boxes;\r\n\r\n\t\tcurrentx = x;\r\n\t\tcurrenty = y;\r\n\t\tthis.height = height;\r\n\t\tthis.width = width;\r\n\t\tthis.img = getImage(img);\r\n\t\tthis.rect = new Rectangle(x, y,width,height);\r\n\t}", "public void tick() {\n boolean shouldHaltAfterTick = false;\n\n List<Pair<Movement, Bullet>> movements = new ArrayList<>();\n\n //Bullets on nodes\n Map<Coordinate, Bullet> capturedBullets = new HashMap<>(bullets);\n capturedBullets.keySet().retainAll(nodes.keySet());\n\n //Bullets not on nodes\n Map<Coordinate, Bullet> freeBullets = new HashMap<>(bullets);\n freeBullets.keySet().removeAll(capturedBullets.keySet());\n\n //Generate movements for free bullets\n for (Map.Entry<Coordinate, Bullet> entry : freeBullets.entrySet()) {\n Bullet bullet = entry.getValue();\n Coordinate coord = entry.getKey();\n Coordinate newCoord = entry.getKey().plus(bullet.getDirection()).wrap(width, height);\n movements.add(new Pair<>(new Movement(coord, newCoord), bullet));\n }\n\n //Update captured bullets\n for (Map.Entry<Coordinate, Bullet> entry : capturedBullets.entrySet()) {\n Coordinate coordinate = entry.getKey();\n INode node = nodes.get(coordinate);\n\n // special case\n if (node instanceof NodeHalt)\n shouldHaltAfterTick = true;\n\n //TODO this brings great shame onto my family\n Direction bulletDirection = entry.getValue().getDirection();\n Direction dir = Direction.UP;\n while (dir != node.getRotation()) {\n dir = dir.clockwise();\n bulletDirection = bulletDirection.antiClockwise();\n }\n Bullet bullet = new Bullet(bulletDirection, entry.getValue().getValue());\n\n Map<Direction, BigInteger> bulletParams = node.run(bullet);\n\n for (Map.Entry<Direction, BigInteger> newBulletEntry : bulletParams.entrySet()) {\n //TODO this too\n bulletDirection = newBulletEntry.getKey();\n dir = Direction.UP;\n while (dir != node.getRotation()) {\n dir = dir.clockwise();\n bulletDirection = bulletDirection.clockwise();\n }\n\n Bullet newBullet = new Bullet(bulletDirection, newBulletEntry.getValue());\n Coordinate newCoordinate = coordinate.plus(newBullet.getDirection()).wrap(width, height);\n Movement movement = new Movement(coordinate, newCoordinate);\n movements.add(new Pair<>(movement, newBullet));\n }\n }\n\n //Remove swapping bullets\n List<Movement> read = new ArrayList<>();\n Set<Coordinate> toDelete = new HashSet<>();\n for (Pair<Movement, Bullet> pair : movements) {\n Movement movement = pair.getKey();\n Coordinate from = movement.getFrom();\n Coordinate to = movement.getTo();\n boolean foundSwaps = read.stream().anyMatch(other -> from.equals(other.getTo()) && to.equals(other.getFrom()));\n if (foundSwaps) {\n toDelete.add(from);\n toDelete.add(to);\n }\n read.add(movement);\n }\n movements.removeIf(pair -> toDelete.contains(pair.getKey().getFrom()) || toDelete.contains(pair.getKey().getTo()));\n\n //Remove bullets that end in the same place\n read.clear();\n toDelete.clear();\n for (Pair<Movement, Bullet> pair : movements) {\n Movement movement = pair.getKey();\n Coordinate to = movement.getTo();\n boolean foundSameFinal = read.stream().anyMatch(other -> to.equals(other.getTo()));\n if (foundSameFinal) {\n toDelete.add(to);\n }\n read.add(movement);\n }\n movements.removeIf(pair -> toDelete.contains(pair.getKey().getTo()));\n\n //Move bullets\n Map<Coordinate, Bullet> newBullets = new HashMap<>();\n for (Pair<Movement, Bullet> pair : movements) {\n Movement movement = pair.getKey();\n Bullet bullet = pair.getValue();\n newBullets.put(movement.getTo(), bullet);\n }\n\n bullets.clear();\n bullets.putAll(newBullets);\n\n if (shouldHaltAfterTick)\n halt();\n }", "public void Attack(){\n float randomx = (float)(Math.random()-0.5)*attackRange*GameView.instance.cameraSize/10;\n float randomy = (float)(Math.random()-0.5)*attackRange*GameView.instance.cameraSize/5;\n Vector2 target = GameView.instance.player.aimFor();\n float dx = target.x-creationPoint.x;\n float dy =target.y-creationPoint.y;\n float l= (float)Math.sqrt(dx*dx+dy*dy);\n dx = dx/l-((float)Math.random()-0.5f)/2;\n dy = dy/l-(float)(Math.random())/10;\n ProjectilePool.instance.shootArrow(creationPoint.x, creationPoint.y, 1, dx, dy, 3);\n }", "void setPosition(double xPos, double yPos);", "public void dispara()\r\n {\r\n BulletEnemy bala = new BulletEnemy();\r\n getWorld().addObject(bala,getX(),getY()+25);\r\n }", "public void setPosition(int x, int y)\n\t{\n\t\tint w = getSize().width;\n\t\tint h = getSize().height;\n\n\t\tpos.x = x;\n\n\t\tpos.y = y;\n\n\t\trect.setLocation(x - w / 2, y - h / 2);\n\t}", "public void onHitByBullet(HitByBulletEvent e) {\n\t\t// Replace the next line with any behavior you would like\n\t\t\n\t}", "public void place(Object animal, int row, int column) {\n place(animal, new Position(row, column));\n }", "public boolean shoot(float startX, float startY, float touchX, float touchY, int screenX, int screenY) {\n if(!isActive){\n x = (startX+((screenX/5)/2));\n y = (startY+((screenX/10)/2));\n\n LEFT = false;\n BOTTOM = false;\n\n targetX = touchX;\n targetY = touchY;\n\n slopeX = (x/targetX);\n slopeY = (y/targetY);\n\n\n if(targetX < (screenX/2)) {\n LEFT = true;\n }\n\n if(targetY < (screenY/2)) {\n BOTTOM = true;\n }\n\n slope = slopeY/slopeX;\n\n isActive = true;\n return false;\n }\n\n //Bullet is already Active\n return false;\n }", "@Override\n protected void spawnInWorld(float x, float y, float xVel, float yVel)\n {\n PolygonShape hitbox = new PolygonShape();\n hitbox.setAsBox(3.0F, 1.0F, new Vector2(0, 0), 0);\n \n //Set up body definition - Defines the type of physics body that this is\n BodyDef bodyDef = new BodyDef();\n bodyDef.type = BodyDef.BodyType.DynamicBody;\n bodyDef.position.set(x, y);\n \n //Set up physics body - Defines the actual physics body\n this.physBody = this.world.getPhysWorld().createBody(bodyDef);\n this.physBody.setUserData(this); //Store this object into the body so that it isn't lost\n \n //Set up physics fixture - Defines physical properties\n FixtureDef fixtureDef = new FixtureDef();\n fixtureDef.shape = hitbox;\n fixtureDef.density = 100.0F; //About 1 g/cm^2 (2D), which is the density of water, which is roughly the density of humans.\n fixtureDef.friction = 0.1F; //friction with other objects\n fixtureDef.restitution = 0.1F; //Bouncyness\n \n //Set which collision type this object is\n fixtureDef.filter.categoryBits = COL_SEA_CREATURE;\n //Set which collision types this object collides with\n fixtureDef.filter.maskBits = COL_ALL ^ COL_SEA_PROJECTILE; //Collide with everything except sea creature projectiles\n \n this.physBody.createFixture(fixtureDef);\n \n //Set the linear damping\n this.physBody.setLinearDamping(5F);\n \n //Set the angular damping\n this.physBody.setAngularDamping(2.5F);\n \n //Apply impulse\n this.physBody.applyLinearImpulse(xVel, yVel, x, y, true);\n \n //Dispose of the hitbox shape, which is no longer needed\n hitbox.dispose();\n }", "private void placeShip() {\r\n\t\t// Expire the ship ship\r\n\t\tParticipant.expire(ship);\r\n\r\n\t\tclipShip.stop();\r\n\r\n\t\t// Create a new ship\r\n\t\tship = new Ship(SIZE / 2, SIZE / 2, -Math.PI / 2, this);\r\n\t\taddParticipant(ship);\r\n\t\tdisplay.setLegend(\"\");\r\n\t}", "public Position(int x, int y) {\n this.x = x;\n this.y = y;\n }", "public void spawnItem(AItemBase item, WrapperNBT data, Point3d point){\r\n\t\tItemStack stack = item.getNewStack();\r\n\t\tif(data != null){\r\n\t\t\tstack.setTagCompound(data.tag);\r\n\t\t}\r\n\t\t//Spawn 1 block above in case we're right on a block.\r\n\t\tworld.spawnEntity(new EntityItem(world, point.x, point.y + 1, point.z, stack));\r\n\t}" ]
[ "0.7762593", "0.71605015", "0.6864132", "0.67735815", "0.6690345", "0.6605794", "0.652559", "0.6487069", "0.6484469", "0.6478239", "0.64652175", "0.6424205", "0.63862747", "0.6385351", "0.6383703", "0.6351486", "0.63469976", "0.63172597", "0.6290653", "0.6251216", "0.6250608", "0.6202752", "0.6162764", "0.6160824", "0.6149845", "0.6142626", "0.6135794", "0.611521", "0.61098254", "0.6073518", "0.6072127", "0.6054043", "0.6042326", "0.6023923", "0.5953584", "0.59252405", "0.59048563", "0.59026486", "0.5870556", "0.5855071", "0.584832", "0.58299273", "0.5826952", "0.5823112", "0.5799883", "0.576713", "0.5754553", "0.57448477", "0.5718852", "0.57091284", "0.5696574", "0.56931406", "0.5677226", "0.56728405", "0.5660085", "0.56573254", "0.56527656", "0.56302786", "0.5620711", "0.56166404", "0.5615808", "0.56054705", "0.5605425", "0.5603115", "0.559775", "0.558525", "0.5580734", "0.55635446", "0.55507493", "0.55498374", "0.55439407", "0.55427694", "0.5504352", "0.5502677", "0.5500351", "0.54985", "0.5498424", "0.54978156", "0.54916555", "0.54889244", "0.54853153", "0.5482307", "0.5477175", "0.5471992", "0.54712564", "0.54657376", "0.54581624", "0.54523706", "0.5435243", "0.54344326", "0.54336077", "0.5425688", "0.54241157", "0.5419442", "0.53998196", "0.53973395", "0.53844875", "0.5378682", "0.53773546", "0.5377293" ]
0.82025474
0
Places four asteroids near the corners of the screen. Gives them random velocities and rotations.
private void placeAsteroids() { addParticipant(new Asteroid(0, 2, EDGE_OFFSET, EDGE_OFFSET, speed, this)); addParticipant(new Asteroid(1, 2, SIZE - EDGE_OFFSET, EDGE_OFFSET, 3, this)); addParticipant(new Asteroid(2, 2, EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this)); addParticipant(new Asteroid(3, 2, SIZE - EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Asteroid() {\n\t\t// create, seed random number\n\t\trandomNumber = new Random();\n\n\t\t// random location\n\t\tlocation = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE);\n\n\t\t// random movement vector\n\t\tmovement = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED,\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED);\n\t\t\n\t\t// random radius\n\t\tsize = randomNumber.nextInt() % 20 + 1;\n\t\t\n\t\t// create Sphere\n\t\tsphere = new Sphere(size, location);\n\n\t}", "private void addAsteroids(int count)\n {\n int x;\n int y;\n \n for(int i = 0; i < count; i++)\n {\n x = Greenfoot.getRandomNumber(getWidth()/2);\n y = Greenfoot.getRandomNumber(getHeight()/2);\n addObject(new Asteroid(), x, y);\n }\n }", "public void initAsteroids(){\n for (int i = 0; i<field.length; i++){\n //initiate the asteroid with random location\n //NOTE: will need some kind of checking in the future to ensure asteroids don't overlap)\n field[i] = new Asteroid(randFloat(),randFloat(),randFloat());\n }\n }", "private void spawnRandomAsteroid() {\n\t\tRandom r = new Random();\n\n\t\t// The size of the asteroid is randomised.\n\t\tdouble size = r. nextDouble() * (AsteroidsAsteroid.maximumSize - AsteroidsAsteroid.minimumSize) + AsteroidsAsteroid.minimumSize;\n\n\t\t// The spawn distance is a fair distance away from the action.\n\t\tfinal double spawnDistance = cameraZoom * 2 + size;\n\n\t\t// Same with its velocity magnitude.\n\t\tdouble decidedVelocity = r.nextDouble() * (AsteroidsAsteroid.maximumVelocity - AsteroidsAsteroid.minimumVelocity) + AsteroidsAsteroid.minimumVelocity;\n\n\t\t// And the angle.\n\t\tdouble decidedAngle = r.nextDouble() * 360 - 180;\n\n\t\t// The velocity is then converted to a Vector3.\n\t\tVector3 velocity = new Vector3(decidedVelocity * -Math.sin(Math.toRadians(decidedAngle)), decidedVelocity * Math.cos(Math.toRadians(decidedAngle)));\n\n\t\t// Then we pick a random point on the screen.\n\t\tVector3 randomPoint = new Vector3(r.nextDouble() * 2 * cameraZoom - cameraZoom, r.nextDouble() * 2 * cameraZoom - cameraZoom);\n\n\t\t// We then set the asteroid's starting position as that spawn distance away from the point\n\t\t// in the reverse direction to its velocity.\n\t\tVector3 startingPosition = randomPoint.add(new Vector3(spawnDistance * Math.sin(Math.toDegrees(-decidedAngle)), spawnDistance * -Math.cos(Math.toDegrees(-decidedAngle))));\n\n\t\t// Then we just create the asteroid.\n\t\tAsteroidsAsteroid asteroid = new AsteroidsAsteroid(GameObject.ROOT, this, size, velocity);\n\t\tasteroid.translate(startingPosition);\n\t\tasteroids.add(asteroid);\n\n\t}", "public Asteroid()\r\n\t{\r\n\t\tsuper.setDirection(rn.nextInt(360));\r\n\t\tsuper.setSpeed(rn.nextInt(100));\r\n\t\tsuper.setLocalX(rn.nextFloat() * 1024);\r\n\t\tsuper.setLocalY(rn.nextFloat() * 786);\r\n\t\tsuper.setColor(250);\r\n\t\tsize = rn.nextInt(10);\r\n\t\t\r\n\t}", "public Asteroid () {\n\t\tImage asteroid = new Image(getClass().getClassLoader().getResourceAsStream(\"asteroid.png\"));\n\t\timage = new ImageView(asteroid);\n\t\tsetX(Math.random() * (Main.SIZEX - this.getXSize()));\n\t\tsetY(0);\n\t\tvelocityY = -45;\n\t\tvelocityX = 0;\n\t}", "public Asteroid(Asteroids asteroids, int size, MutableDouble2D velocity, Double2D location)\n {\n this.size = size;\n this.velocity = velocity;\n stopper = asteroids.schedule.scheduleRepeating(this);\n shape = shapes[size][asteroids.random.nextInt(shapes[size].length)];\n rotationalVelocity = asteroids.random.nextDouble() * MAXIMUM_ROTATIONAL_VELOCITY *\n (asteroids.random.nextBoolean() ? 1.0 : -1.0);\n orientation = asteroids.random.nextDouble() * Math.PI * 2;\n asteroids.field.setObjectLocation(this, location);\n asteroids.asteroidCount++;\n }", "public static void main(String[]args) {\n\t\t//2. create an array of 5 robots.\n\t\tRobot[] potato = new Robot[3];\n\t\t//3. use a for loop to initialize the robots.\n\t\tfor(int i = 0; i<potato.length; i++) {\n\t\t\tpotato[i]= new Robot();\n\t\t\t//4. make each robot start at the bottom of the screen, side by side, facing up\n\t\t\t//potato[i].setX(i*100+50);\n\t\t\t//potato[i].setY(500);\n\t\t\tpotato[i].setX(250);\n\t\t\tpotato[i].setSpeed(100);\n\t\t}\n\tpotato[0].setPenColor(Color.red);\n\tpotato[1].setPenColor(Color.blue);\n\tpotato[2].setPenColor(Color.green);\n\tpotato[0].penDown();\n\tpotato[1].penDown();\n\tpotato[2].penDown();\n\t\n\t\t//5. use another for loop to iterate through the array and make each robot move \n\t\t// a random amount less than 50.\n\t\tRandom ran = new Random();\n\t\t\n\t\tboolean done = false;\n\tint x =0;\n\tRobot rob = new Robot();\n\trob.penDown();\n\trob.setSpeed(100);\n\trob.setX(300);\n\tfor(int i = 0; i < 360; i++) {\n\t\trob.move(2);\n\t\trob.turn(1);\n\t}\n\trob.penUp();\n\trob.move(1000);\n\tRobot r2 = new Robot();\n\tr2.penDown();\n\tr2.setSpeed(100);\n\tr2.setX(200);\n\tfor(int i = 0; i < 360; i++) {\n\t\tr2.move(4);\n\t\tr2.turn(1);\n\t}\n\tr2.penUp();\n\tr2.move(1000);\n\t\n\twhile(!done) {\n\t\tfor(int i = 0; i<potato.length&&!done; i++) {\t\n\t\t\tint u = ran.nextInt(50)+1;\n\t\t\tfor(int y = 0;y<u ;y++) {\n\t\t\tpotato[i].move(3);\n\t\t\tpotato[i].turn(1);\n\t\t\t}\n\t\t\tx=i+1;\n\t\t\tif(potato[i].getX()<=252) {\n\t\t\t\tdone=true;\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\t//6. use a while loop to repeat step 5 until a robot has reached the top of the screen.\n\n\t//7. declare that robot the winner and throw it a party!\n\t\tSystem.out.println(\"The fastest robot is robot #\" + x);\n\t//8. try different races with different amounts of robots.\n\t\t\n\t//9. make the robots race around a circular track.\n\t\n}", "public Asteroid makeAsteroid() {\r\n\t\tAsteroid asteroid = new AsteroidImpl(startBounds.x, random(startBounds.y,startBounds.height)\r\n\t\t\t\t\t\t\t\t\t\t\t, random(10,40), random(10,40)\r\n\t\t\t\t\t\t\t\t\t\t\t, random(1,4));\r\n\t\treturn asteroid;\r\n\t}", "public void randomWalk(){\r\n int newAngle = (int) ( (double) Math.random() * 360) ;\r\n\r\n super.xVelocity = (velocity * Math.cos(newAngle * Math.PI/180));\r\n super.yVelocity = (velocity * Math.cos(newAngle * Math.PI/180));\r\n }", "public gameWorld()\n { \n // Create a new world with 600x600 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n \n addObject(new winSign(), 310, 300);\n addObject(new obscureDecorative(), 300, 400);\n addObject(new obscureDecorative(), 300, 240);\n \n for(int i = 1; i < 5; i++) {\n addObject(new catchArrow(i * 90), 125 * i, 100);\n }\n for (int i = 0; i < 12; i++) {\n addObject(new damageArrowCatch(), 50 * i + 25, 50); \n }\n \n \n //Spawning Interval\n\n if(timerInterval >= 10) {\n arrowNumber = Greenfoot.getRandomNumber(3);\n }\n if(arrowNumber == 0) {\n addObject(new upArrow(directionOfArrow[0], imageOfArrow[0]), 125, 590);\n arrowNumber = 5;\n }\n if(arrowNumber == 1) {\n addObject(new upArrow(directionOfArrow[1], imageOfArrow[1]), 125 * 2, 590);\n arrowNumber = 5;\n }\n if(arrowNumber == 2) {\n addObject(new upArrow(directionOfArrow[2], imageOfArrow[2]), 125 * 3, 590);\n arrowNumber = 5;\n }\n if( arrowNumber == 3) {\n addObject(new upArrow(directionOfArrow[3], imageOfArrow[3]), 125 * 4, 590);\n arrowNumber = 5;\n }\n \n \n\n \n }", "public Asteroid(){\n\t\t\n\t\t//call Sprite constructor\n\t\tsuper();\n for(int i =0;i<arrowAmount;i++)\n {\n arrows.add(new Arrow(Game.R.nextInt(4),Game.R.nextBoolean()));\n }\n\t\tinitialize();\n\t\tint nDY = Game.R.nextInt(speedLevel);\n\t\tsetDeltaY((double)nDY*0.03*CommandCenter.getLevel()+1);\n\n\n\t\t\n\n\t}", "private void initialize() {\n //Asteroid Shape (8 sided)\n polygon = new Vector2f[]{new Vector2f(400, -800), new Vector2f(-400, -800), new Vector2f(-800, -400),\n new Vector2f(-800, 400), new Vector2f(-400, 800), new Vector2f(400, 800), new Vector2f(800, 400), new Vector2f(800, -400)};\n //Translation variables\n this.tx = spawnX;\n this.ty = spawnY; //Start above screen to gain momentum\n this.velocity = new Vector2f();\n\n //World initialize\n this.world = new Matrix3x3f();\n\n }", "private void addRandomAsteroid() {\n ThreadLocalRandom rng = ThreadLocalRandom.current();\n Point.Double newAsteroidLocation;\n //TODO: dont spawn on top of players\n Point.Double shipLocation = new Point2D.Double(0,0);\n double distanceX, distanceY;\n do { // Iterate until a point is found that is far enough away from the player.\n newAsteroidLocation = new Point.Double(rng.nextDouble(0.0, 800.0), rng.nextDouble(0.0, 800.0));\n distanceX = newAsteroidLocation.x - shipLocation.x;\n distanceY = newAsteroidLocation.y - shipLocation.y;\n } while (distanceX * distanceX + distanceY * distanceY < 50 * 50); // Pythagorean theorem for distance between two points.\n\n double randomChance = rng.nextDouble();\n Point.Double randomVelocity = new Point.Double(rng.nextDouble() * 6 - 3, rng.nextDouble() * 6 - 3);\n AsteroidSize randomSize;\n if (randomChance < 0.333) { // 33% chance of spawning a large asteroid.\n randomSize = AsteroidSize.LARGE;\n } else if (randomChance < 0.666) { // 33% chance of spawning a medium asteroid.\n randomSize = AsteroidSize.MEDIUM;\n } else { // And finally a 33% chance of spawning a small asteroid.\n randomSize = AsteroidSize.SMALL;\n }\n this.game.getAsteroids().add(new Asteroid(newAsteroidLocation, randomVelocity, randomSize));\n }", "public static void main(String[] args) {\n\t\t\n\t//2. create an array of 5 robots.\n\tRobot[] robs = new Robot[5];\n\t//3. use a for loop to initialize the robots.\n\tfor (int i = 0; i < robs.length; i++) {\n\t\t\trobs[i] = new Robot();\n\t\t\trobs[i].setX(100 * i + 100);\n\t\t\trobs[i].setY(500);\n\t\t\trobs[i].setSpeed(10);\n\t}\n\t\t//4. make each robot start at the bottom of the screen, side by side, facing up\n\t\t\n\t//5. use another for loop to iterate through the array and make each robot move \n\t// a random amount less than 50.\n\tfor (int i = 0; i < robs.length; i++) {\n\t\tRandom rnd = new Random();\n\t\trobs[i].move(rnd.nextInt(50)+1);\n\t}\n\t//6. use a while loop to repeat step 5 until a robot has reached the top of the screen.\n\tboolean notwon = true;\n\tint winner = -250;\n\twhile(notwon) {\n\t\tfor (int i = 0; i < robs.length; i++) {\n\t\t\tRandom rnd = new Random();\n\t\t\trobs[i].move(rnd.nextInt(50)+1);\n\t\t}\n\t\tfor (int i = 0; i < robs.length; i++) {\n\t\t\tif (notwon && winner == -250 && robs[i].getY() <= 72) {\n\t\t\t\twinner = i;\n\t\t\t\tnotwon = false;\n\t\t\t}\n\t\t}\n\t}\n\t\n\trobs[winner].sparkle();\n\t//7. declare that robot the winner and throw it a party!\n\t\n\t//8. try different races with different amounts of robots.\n\n\t//9. make the robots race around a circular track.\n}", "public static void main(String[] args) {\n\t\tint x = 120;\n\t\t\n\t\tint rob1 = 0;\n\t\tint rob2 = 0;\n\t\tint rob3 = 0;\n\t\tint rob4 = 0;\n\t\t\n\t\tint[] rob1c = {0, 0};\n\t\tint[] rob2c = {0, 0};\n\t\tint[] rob3c = {0, 0};\n\t\tint[] rob4c = {0, 0};\n\t\t\n\t\tint counts0 = 0;\n\t\tint counts1 = 0;\n\t\tint counts2 = 0;\n\t\tint counts3 = 0;\n\t\t\n\t\tRobot[] rob = new Robot[4];\n\t\tfor (int i = 0; i < rob.length; i++) {\n\t\t\trob[i] = new Robot();\n\t\t\trob[i].miniaturize();\n\t\t\trob[i].setX(x);\n\t\t\trob[i].setSpeed(100);\n\t\t\tif (i == 0) {\n\t\t\t\trob1c[0] = rob[0].getX();\n\t\t\t\trob1c[1] = rob[0].getY();\n\t\t\t}else if (i == 1) {\n\t\t\t\trob2c[0] = rob[1].getX();\n\t\t\t\trob2c[1] = rob[1].getY();\n\t\t\t}else if (i == 2) {\n\t\t\t\trob3c[0] = rob[2].getX();\n\t\t\t\trob3c[1] = rob[2].getY();\n\t\t\t}else if (i == 3) {\n\t\t\t\trob4c[0] = rob[3].getX();\n\t\t\t\trob4c[1] = rob[3].getY();\n\t\t\t}\n\t\t\tx = x - 30;\n\t\t}\n\t\t\n\t\tint dis = 0;\n\t\tboolean win = false;\n\t\twhile (win == false) {\n\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tdis = new Random().nextInt(30);\n\t\t\t\t\tfor (int j = 0; j < dis; j++) {\n\t\t\t\t\t\trob[0].move(1);\n\t\t\t\t\t\trob1++;\n\t\t\t\t\t\tif (rob1 == 30) {\n\t\t\t\t\t\t\trob[0].turn(36);\n\t\t\t\t\t\t\trob1 = 0;\n\t\t\t\t\t\t\tcounts0++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (counts0 == 10) {\n\t\t\t\t\tSystem.out.println(\"Robot 1 wins!!! ^_^\");\n\t\t\t\t\twin = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (i == 1) {\n\t\t\t\t\tdis = new Random().nextInt(60);\n\t\t\t\t\tfor (int j = 0; j < dis; j++) {\n\t\t\t\t\t\trob[1].move(1);\n\t\t\t\t\t\trob2++;\n\t\t\t\t\t\tif (rob2 == 60) {\n\t\t\t\t\t\t\trob[1].turn(36);\n\t\t\t\t\t\t\trob2 = 0;\n\t\t\t\t\t\t\tcounts1++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (counts1 == 10) {\n\t\t\t\t\tSystem.out.println(\"Robot 2 wins!!! ^_^\");\n\t\t\t\t\twin = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (i == 2) {\n\t\t\t\t\tdis = new Random().nextInt(90);\n\t\t\t\t\tfor (int j = 0; j < dis; j++) {\n\t\t\t\t\t\trob[2].move(1);\n\t\t\t\t\t\trob3++;\n\t\t\t\t\t\tif (rob3 == 90) {\n\t\t\t\t\t\t\trob[2].turn(36);\n\t\t\t\t\t\t\trob3 = 0;\n\t\t\t\t\t\t\tcounts2++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (counts2 == 10) {\n\t\t\t\t\tSystem.out.println(\"Robot 3 wins!!! ^_^\");\n\t\t\t\t\twin = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (i == 3) {\n\t\t\t\t\tdis = new Random().nextInt(120);\n\t\t\t\t\tfor (int j = 0; j < dis; j++) {\n\t\t\t\t\t\trob[3].move(1);\n\t\t\t\t\t\trob4++;\n\t\t\t\t\t\tif (rob4 == 120) {\n\t\t\t\t\t\t\trob[3].turn(36);\n\t\t\t\t\t\t\trob4 = 0;\n\t\t\t\t\t\t\tcounts3++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (counts3 == 10) {\n\t\t\t\t\tSystem.out.println(\"Robot 4 wins!!! ^_^\");\n\t\t\t\t\twin = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t}", "public Asteroid() {\n setShape(new Polygon(astx, asty, astx.length));\n setAlive(true);\n setColor(new Color(160, 82, 45));\n }", "public void setupWorld()\r\n\t{\r\n\t\t//build walls\r\n\t\twall1.add(new PointD(-500, 500));\r\n\t\twall1.add(new PointD(-490, 500));\r\n\t\twall1.add(new PointD(-490, -500));\r\n\t\twall1.add(new PointD(-500, -500));\r\n\r\n\t\twall2.add(new PointD(-500, 500));\r\n\t\twall2.add(new PointD(2000, 500));\r\n\t\twall2.add(new PointD(2000, 490));\r\n\t\twall2.add(new PointD(-500, 490));\r\n\t\t\r\n\t\twall3.add(new PointD(2000, 500));\r\n\t\twall3.add(new PointD(1990, 500));\r\n\t\twall3.add(new PointD(1990, -500));\r\n\t\twall3.add(new PointD(2000, -500));\r\n\r\n\t\twall4.add(new PointD(-500, -500));\r\n\t\twall4.add(new PointD(2000, -500));\r\n\t\twall4.add(new PointD(2000, -490));\r\n\t\twall4.add(new PointD(-500, -490));\r\n\r\n\t\tobjects.add(wall1);\r\n\t\tobjects.add(wall2);\r\n\t\tobjects.add(wall3);\r\n\t\tobjects.add(wall4);\r\n\t\t\r\n\t\t\r\n\t\t//add people\r\n\t\tGameVars.people = people;\r\n\t\tGameVars.aSquare = aSquare;\r\n\t\t\r\n\t\tobjects.add(grandson.boundary);\r\n\t\tpeople.add(grandson);\r\n\t\t\r\n\t\tobjects.add(son.boundary);\r\n\t\tpeople.add(son);\r\n\t\t\r\n\t\tobjects.add(triangle.boundary);\r\n\t\tpeople.add(triangle);\r\n\r\n\t\tobjects.add(wife.boundary);\r\n\t\tpeople.add(wife);\r\n\r\n\t\tobjects.add(runaway.boundary);\r\n\t\tpeople.add(runaway);\r\n\t\t\r\n\t\t\r\n\t\t//set aSquare's position\r\n\t\taSquare.rotate(220);\r\n\t\t\r\n\t}", "void moveNorthEast(){\n xpos = xpos + 3;\n ypos = ypos-xspeed;\n if (xpos > width){ // 20\n xpos = random(-width/2, width/2); // 25\n ypos = width; // 30\n }\n }", "public void updateSensors() {\n if(bLCollide && bRCollide) {\n grounded = true;\n }\n else if(bLCollide || bRCollide) {\n grounded = true;\n }\n else if(!bLCollide && !bRCollide) {\n grounded = false;\n }\n if(!collideWithSlopeL && !collideWithSlopeR) {\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,80); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,80); \n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer+28,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer+28,40,4); \n }\n else if(collideWithSlopeL && !collideWithSlopeR) {\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,144); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,80); \n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer-4,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer-4,40,4);\n }\n else if(!collideWithSlopeL && collideWithSlopeR) {\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,80); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,144);\n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer-4,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer-4,40,4); \n }\n else if(collideWithSlopeL && collideWithSlopeR) {\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,144); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,144); \n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer-4,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer-4,40,4);\n }\n if(!grounded) {/*Added this to reset the height of the player sensors if he jumps off a slope (ground == true wouldn't trigger \n early) making the player stop earlier then he should*/\n bottomLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer,4,80); \n bottomRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer,4,80); \n middleLeft = new Rectangle(xDrawCenterPlayer-40,ySpriteCenterPlayer-4,40,4);\n middleRight = new Rectangle(xDrawCenterPlayer+4,ySpriteCenterPlayer-4,40,4); \n }\n topLeft = new Rectangle(xDrawCenterPlayer-36,ySpriteCenterPlayer-84,4,80);\n topRight = new Rectangle(xDrawCenterPlayer+36,ySpriteCenterPlayer-84,4,80); \n //Gets the correct size of interactBox\n if(jumpState != JumpState.STATE_NOJUMP || duckState != DuckState.STATE_NODUCK) {\n intersectBox = new Rectangle(xDrawCenterPlayer-30, ySpriteCenterPlayer-20, 60, 80);\n }\n else {\n intersectBox = new Rectangle(xDrawCenterPlayer-29, ySpriteCenterPlayer-70, 60, 140);\n }\n }", "private AsteroidImpl(int x, int y, int width, int height, int velocity) {\r\n\t\t\tshape = new Ellipse2D.Double(x, y, width, height);\r\n\t\t\tthis.velocity = velocity;\r\n\t\t}", "public static Point[] astShape(){\r\n\t\tRandom random = new Random();\r\n\t\tPoint[] randAsteroid = {\r\n\t\t\t\tnew Point(0,0),\r\n\t\t\t\tnew Point(random.nextInt(11-5)+5, -(random.nextInt(16-10)+10)),\r\n\t\t\t\tnew Point(random.nextInt(21-15)+15, -(random.nextInt(5))),\r\n\t\t\t\tnew Point(random.nextInt(31-25)+25, (random.nextInt(5-(-10)-10))),\r\n\t\t\t\tnew Point(random.nextInt(21-15)+15, (random.nextInt(21-15)+15)),\r\n\t\t\t\tnew Point(random.nextInt(0-(-5))-5, (random.nextInt(15-10)+10))\r\n\t\t};\r\n\t\treturn randAsteroid;\r\n\t}", "public void play(Asteroid[] asteroids,\n\t\t\t\t\t double[] energy, double[] direction) {\n\t\tCollision collision = new Collision(asteroids);\n\t\t// if not yet time to push do nothing\n\t\tif (++time <= time_of_push) return;\n\t\tSystem.out.println(\"Year: \" + (1 + time / 365));\n\t\tSystem.out.println(\"Day: \" + (1 + time % 365));\n\n int a2_index = get_biggest_asteroid_index(asteroids);\n Asteroid a2 = asteroids[a2_index];\n\n\t\tfor (int retry = 1; retry <= retries_per_turn; ++retry) { \n \n if (a2_index ==-1) {\n System.out.println(\"NOOOOOOOOOOO INDEX ERROR\");\n System.exit(0);\n }\n for (int i = 0; i != asteroids.length; ++i) {\n // TODO: to check magnet here!!!!\n if (i == a2_index) continue;\n \t\t\t// pick a random asteroid and get its velocity\n \t\t\t// int i = random.nextInt(asteroids.length);\n \t\t\tPoint v = asteroids[i].orbit.velocityAt(time);\n \t\t\t// add 2-10% of current velocity in magnitude\n \t\t\tSystem.out.println(\"Try: \" + retry + \" / \" + retries_per_turn);\n \t\t\tdouble v1 = v.magnitude();\n \t\t\tdouble v2 = v1 * (random.nextDouble() * 0.08 + 0.02);\n \t\t\tSystem.out.println(\" Speed: \" + v1 + \" +/- \" + v2);\n \t\t\tdouble d1 = v.direction();\n \t\t\t// double d2 = Utils.getPerpendicularAngle(d1);\n double d2 = d1;\n \t\t\tSystem.out.println(\" Angle: \" + d1 + \" -> \" + d2);\n \t\t\t// compute energy\n \t\t\tdouble E = 0.5 * asteroids[i].mass * v2 * v2;\n \t\t\t// try to push asteroid\n \t\t\tAsteroid a1 = null;\n \t\t\ttry {\n \t\t\t\ta1 = Asteroid.push(asteroids[i], time, E, d2);\n \t\t\t} catch (InvalidOrbitException e) {\n \t\t\t\tSystem.out.println(\" Invalid orbit: \" + e.getMessage());\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t// avoid allocating a new Point object for every position\n \t\t\tPoint p1 = v, p2 = new Point();\n\n \t\t\t// search for collision with other asteroids\n\t\t\t\n\t\t\t\t// Asteroid a2 = asteroids[j];\n\n double r = a1.radius() + a2.radius();\n\t\t\t\tfor (long ft = 0; ft != 3650; ++ft) {\n\t\t\t\t\tlong t = time + ft;\n\t\t\t\t\tif (t >= time_limit) break;\n\t\t\t\t\ta1.orbit.positionAt(t - a1.epoch, p1);\n\t\t\t\t\ta2.orbit.positionAt(t - a2.epoch, p2);\n\t\t\t\t\t// if collision, return push to the simulator\n\t\t\t\t\tif (Point.distance(p1, p2) < r) {\n\t\t\t\t\t\tenergy[i] = E;\n\t\t\t\t\t\tdirection[i] = d2;\n\t\t\t\t\t\t// do not push again until collision happens\n\t\t\t\t\t\ttime_of_push = t + 1;\n\t\t\t\t\t\tSystem.out.println(\" Collision prediction !\");\n\t\t\t\t\t\tSystem.out.println(\" Year: \" + (1 + t / 365));\n\t\t\t\t\t\tSystem.out.println(\" Day: \" + (1 + t % 365));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(\" No collision ...\");\n\t\t}\n\t\ttime_of_push = time + turns_per_retry;\n\t}", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n \n Player player = new Player();\n Point point0 = new Point();\n Point point1 = new Point();\n Point point2 = new Point();\n Point point3 = new Point();\n Point point4 = new Point();\n Danger danger0 = new Danger();\n Danger danger1 = new Danger();\n addObject(player, getWidth()/2, getHeight()/2);\n \n addObject(point0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point2,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point3,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point4,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n \n addObject(danger0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(danger1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n }", "public static void main(String[] args) {\n\t\t\t\n\t\t\t//2. create an array of 5 robots.\n\t\t\tRobot[] a = new Robot[5];\n\t\t\t//3. use a for loop to initialize the robots.\n\t\t\tfor(int i = 0; i<a.length; i++) {\n\t\t\t\ta[i] = new Robot();\n\t\t\t\ta[i].setX(800-i*125);\n\t\t\t\ta[i].setY(400);\n\t\t\t}\n\t\t\t\t//4. make each robot start at the bottom of the screen, side by side, facing up\n\t\t\n\t\t\t//5. use another for loop to iterate through the array and make each robot move \n\t\t // a random amount less than 50.\n\t \n\t\t\t//6. use a while loop to repeat step 5 until a robot has reached the top of the screen.\n\t \tboolean top = false;\n\t \twhile(top == false) {\n\t \t\tfor(int x = 0; x<a.length; x++) {\n\t \t\t\tif(a[x].getY() <= 0) {\n\t \t\t\t\ttop = true;\n\t \t\t\t\tint robotNum = 5-x;\n\t \t\t\t\tJOptionPane.showMessageDialog(null, \"robot #\" + robotNum + \" is the winner\");\n\t \t\t\t}\n\t \t\t} \tfor(int j = 0; j < a.length; j++) {\n\t \t\tint r = new Random().nextInt(50);\n\t \t\ta[j].move(r);\n\t \t}\n\t \t}\n\t\t\t//7. declare that robot the winner and throw it a party!\n\t \t\n\t\t\t//8. try different races with different amounts of robots.\n\t \t\n\t\t //9. make the robots race around a circular track.\n\t\t}", "public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }", "public GuaraKinematics() {\n\t\t// TODO Auto-generated constructor stub\n\t\trob = new GuaraRobot();\n\t\ta2 = rob.a2();\n\t\ta3 = rob.a3();\n\t\ta4 = rob.a4();\n\n\t}", "RedSphere() {\n Random random = new Random();\n for (int i = 0; i < 6; i++) {\n value[i] = random.nextInt(33) + 1;\n }\n }", "@Override\n protected void init() {\n lastHorizontalDirection = direction = Math.random() < 0.5 ? Direction.LEFT : Direction.RIGHT;\n lastVerticalDirection = Direction.UP;\n setBody(new PolygonShape(BODY_WIDTH2, BODY_HEIGHT2), Body.Mode.CHARACTER);\n body().restitution = 0.0;\n size().set(WIDTH, HEIGHT);\n\n this.addAnimation(\"walk\")\n .addFrames(\"smick\", 4, 5, 0, 2)\n .setSpeed(10)\n .loop(true);\n this.addAnimation(\"eatRadish\")\n .addFrames(\"smick\", 4, 5, 8, 9)\n .setSpeed(10)\n .loop(true);\n this.addAnimation(\"eatHector\")\n .addFrames(\"smick\", 4, 5, 10, 10)\n .setSpeed(10)\n .loop(true);\n this.addAnimation(\"jump\")\n .addFrames(\"smick\", 4, 5, 11, 11)\n .setSpeed(10)\n .loop(false);\n this.addAnimation(\"climb\")\n .addFrames(\"smick\", 4, 5, 12, 13)\n .setSpeed(10)\n .loop(false);\n this.addAnimation(\"eatHectorOnRope\")\n .addFrames(\"smick\", 4, 5, 14, 14)\n .setSpeed(10)\n .loop(false);\n this.addAnimation(\"crushing\")\n .addFrames(\"smick\", 4, 5, 16, 16)\n .setSpeed(10)\n .loop(false);\n }", "public void populate() { \n \n // make some grounds\n ground1 = new Body(world, PolygonShape.makeBox(100, 5), Body.Type.STATIC);\n ground1.setPosition(new Vec2(-380, -200));\n \n Body ground2 = new Body(world, PolygonShape.makeBox(100, 5), Body.Type.STATIC);\n ground2.setPosition(new Vec2(-0, -200));\n\n Body ground3 = new Body(world, PolygonShape.makeBox(100, 5), Body.Type.STATIC);\n ground3.setPosition(new Vec2(300, -100));\n \n // make a moving platform \n Body movingPlatform = new SlidingPlatform(world, PolygonShape.makeBox(100, 5), new Vec2(130, 0), 2);\n movingPlatform.setPosition(new Vec2(-260, -150));\n \n // make some bottles\n Bottle bottle1 = new Bottle(game);\n bottle1.putOn(ground1);\n bottle1.setName(\"bottle1\");\n \n Bottle bottle2 = new Bottle(game);\n bottle2.putOn(ground2);\n bottle2.setName(\"bottle2\");\n \n Bottle bottle3 = new Bottle(game);\n bottle3.putOn(ground3);\n bottle3.setName(\"bottle3\");\n \n // show dialog with information about level\n JOptionPane.showMessageDialog(frame, \"Press N or M to throw bottles to kill Boxies.\", \"Level instructions:\", JOptionPane.PLAIN_MESSAGE);\n \n // make some boxies\n Boxy boxy1 = new Boxy(game);\n boxy1.setName(\"boxy1\");\n Vec2 vec1 = new Vec2(100, 0);\n boxy1.move(vec1);\n\n Boxy boxy2 = new Boxy(game);\n boxy2.setName(\"boxy2\");\n Vec2 vec2 = new Vec2(-100, 200);\n boxy2.move(vec2);\n\n Boxy boxy3 = new Boxy(game);\n boxy3.setName(\"boxy3\");\n Vec2 vec3 = new Vec2(-400, 200);\n boxy3.move(vec3);\n \n }", "public void init(){\n\t\n\t\t//background init\n\t\tthis.background = new Sprite(this.scene, \"space-backdrop.png\", 1280 * 5, 800 * 5);\n\t\tthis.background.setBoundAction(\"background\");\n\t\tthis.background.setSpeedScale(0.2);\n\t\tthis.background.setSpeed(0);\n\t\tthis.sprites.add(this.background);\n\t\t\n\t\t//compass init\n\t\tthis.compass = new Sprite(this.scene, \"compass.png\", 100, 100);\n\t\tthis.compass.setSpeed(0);\n\t\tthis.compass.setPosition(this.compass.getWidth() / 2, this.scene.getHeight() - this.compass.getHeight() / 2);\n\t\t\n\t\t//earth init\n\t\tthis.earth = new Planet(this.scene, \"earth.png\", 4800, 4800);\n\t\tthis.earth.setSpeed(0);\n\t\tthis.earth.setPosition(0, 7000);\n\t\tthis.earth.setBoundAction(\"continue\");\n\t\tthis.sprites.add(this.earth);\n\t\t\n\t\t//ship init\n\t\tthis.mainSprite = new Ship(this.scene, \"cannon.png\", 50, 50, this.k);\n\t\tthis.mainSprite.keyListen = true;\n\t\tthis.mainSprite.setSpeed(0);\n\t\tthis.mainSprite.setPosition(this.scene.getWidth() / 2, this.scene.getHeight() / 2);\n\t\t\n\t\t//asteroids init\n\t\tthis.asteroids.add(new Body(this.scene, \"asteroid.png\", 250, 250, this));\n\t\tthis.asteroids.get(0).setBoundAction(\"continue\");\n\t\tthis.asteroids.get(0).setSpeed(0);\n\t\tthis.asteroids.get(0).setPosition(0, 0);\n\t\tthis.sprites.add(this.asteroids.get(0));\n\t\t\n\t\tfor(int i = 1; i < 200; i++){\n\t\t\t\n\t\t\tint size = (int) Math.round(Math.random() * 400 + 50);\n\t\t\tlong x = Math.round(Math.random() * this.background.getWidth() - (this.background.getWidth() / 2));\n\t\t\tlong y = Math.round(Math.random() * this.background.getHeight() - (this.background.getHeight() / 2));\n\t\t\t\n\t\t\twhile(x > 0 && x < this.scene.getWidth()){\n\t\t\t\tx = Math.round(Math.random() * this.background.getWidth() - (this.background.getWidth() / 2));\n\t\t\t}\n\t\t\t\n\t\t\twhile(y > 0 && y < this.scene.getHeight()){\n\t\t\t\ty = Math.round(Math.random() * this.background.getHeight() - (this.background.getHeight() / 2));\n\t\t\t}\n\t\t\t\n\t\t\tthis.asteroids.add(new Body(this.scene, \"asteroid.png\", size, size, this));\n\t\t\tthis.asteroids.get(i).setBoundAction(\"continue\");\n\t\t\tthis.asteroids.get(i).setSpeed(0);\n\t\t\tthis.asteroids.get(i).setPosition(x, y);\n\t\t\t\n\t\t\tthis.sprites.add(this.asteroids.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t//chest init\n\t\tthis.chests.add(new Chest(this.scene, \"chest.png\", 100, 50));\n\t\tthis.chests.get(0).setBoundAction(\"continue\");\n\t\tthis.chests.get(0).setSpeed(0);\n\t\tthis.chests.get(0).setPosition(500, 500);\n\t\tthis.sprites.add(this.chests.get(0));\n\t\t\n\t\tfor(int i = 1; i < this.numChests; i++){\n\t\t\t\n\t\t\tthis.chests.add(new Chest(this.scene, \"chest.png\", 100, 50));\n\t\t\tthis.chests.get(i).setBoundAction(\"continue\");\n\t\t\tthis.chests.get(i).setSpeed(0);\n\t\t\t\n\t\t\tboolean keepGoing = true;\n\t\t\tdo{\n\t\t\t\t\n\t\t\t\tlong x = Math.round(Math.random() * this.background.getWidth() - (this.background.getWidth() / 2));\n\t\t\t\tlong y = Math.round(Math.random() * this.background.getHeight() - (this.background.getHeight() / 2));\n\t\t\t\t\n\t\t\t\twhile(x > 0 && x < this.scene.getWidth()){\n\t\t\t\t\tx = Math.round(Math.random() * this.background.getWidth() - (this.background.getWidth() / 2));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twhile(y > 0 && y < this.scene.getHeight()){\n\t\t\t\t\ty = Math.round(Math.random() * this.background.getHeight() - (this.background.getHeight() / 2));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.chests.get(i).setPosition(x, y);\n\t\t\t\t\n\t\t\t\t//check for collisions with asteroids\n\t\t\t\tboolean colliding = false;\n\t\t\t\tfor(int j = 0; j < this.asteroids.size() && colliding == false; j++){\n\t\t\t\t\tif(this.asteroids.get(j).collidesWith(this.chests.get(i))){\n\t\t\t\t\t\tcolliding = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tkeepGoing = colliding;\n\t\t\t\t\n\t\t\t}while(keepGoing);\n\t\t\t\n\t\t\tthis.sprites.add(this.chests.get(i));\n\t\t\t\n\t\t}//end for\n\t\n\t\tthis.scene.start();\n\t\t\n\t\tSystem.out.println(\"==== Welcome to Space Smuggler! ====\");\n\t\tSystem.out.println(\"(WASD to move)\");\n\t\tSystem.out.println(\"Follow your compass in the bottom left corner to find treasure.\");\n\t\tSystem.out.println(\"Collect all of the treasure, then follow your compass to Earth!\");\n\t\tSystem.out.println(\"Watch out for the asteroids though, their gravitational pull is strong!\");\n\t\tSystem.out.println(\"Crashing into one will certainly kill you! D:\");\n\t\tSystem.out.println(\"Good Luck!\");\n\t\t\n\t}", "public SeaUrchin()\n {\n speed = Greenfoot.getRandomNumber(2) +1;\n setRotation(Greenfoot.getRandomNumber(360)); \n }", "public void createWall() { // make case statement?\n\t\tRandom ran = new Random();\n\t\tint range = 6 - 1 + 1; // max - min + min\n\t\tint random = ran.nextInt(range) + 1; // add min\n\n\t\t//each wall is a 64 by 32 chunk \n\t\t//which stack to create different structures.\n\t\t\n\t\tWall w; \n\t\tPoint[] points = new Point[11];\n\t\tpoints[0] = new Point(640, -32);\n\t\tpoints[1] = new Point(640, 0);\n\t\tpoints[2] = new Point(640, 32); // top\n\t\tpoints[3] = new Point(640, 384);\n\t\tpoints[4] = new Point(640, 416);\n\n\t\tif (random == 1) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 288);\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 2) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96); // top\n\t\t\tpoints[7] = new Point(640, 256);\n\t\t\tpoints[8] = new Point(640, 288); // bottom\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 3) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 160);\n\t\t\tpoints[9] = new Point(640, 192); // top\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 4) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 160);\n\t\t\tpoints[9] = new Point(640, 192);\n\t\t\tpoints[10] = new Point(640, 224); // top\n\t\t} else if (random == 5) {\n\t\t\tpoints[5] = new Point(640, 64); // top\n\t\t\tpoints[6] = new Point(640, 224);\n\t\t\tpoints[7] = new Point(640, 256);\n\t\t\tpoints[8] = new Point(640, 288); // bottom\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 6) {\n\t\t\tpoints[5] = new Point(640, 192);\n\t\t\tpoints[6] = new Point(640, 224);\n\t\t\tpoints[7] = new Point(640, 256); // bottom\n\t\t\tpoints[8] = new Point(640, 288);\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t}\n\n\t\tfor (int i = 0; i < points.length; i++) { // adds walls\n\t\t\tw = new Wall();\n\t\t\tw.setBounds(new Rectangle(points[i].x, points[i].y, 64, 32));\n\t\t\twalls.add(w);\n\t\t}\n\t\tWall c; // adds a single checkpoint\n\t\tc = new Wall();\n\t\tcheckPoints.add(c);\n\t\tc.setBounds(new Rectangle(640, 320, 32, 32));\n\t}", "private void init() {\r\n\t\tx = (float) (Math.random() * 2 - 1);\r\n\t\ty = (float) (Math.random() * 2 - 1);\r\n\t\tz[0] = (float) (Math.random() * 3f);\r\n\t\tz[1] = z[0];\r\n\t}", "public static void main(String[] args) {\r\n\t\tRobot tl = new Robot(250, 250);\r\n\t\tRobot tm = new Robot(650, 250);\r\n\t\tRobot tr = new Robot(1050, 250);\r\n\t\tRobot bl = new Robot(450, 450);\r\n\t\tRobot br = new Robot(850, 450);\r\n\t\r\n\t\ttl.setSpeed(100);\r\n\t\ttm.setSpeed(100);\r\n\t\ttr.setSpeed(100);\r\n\t\tbl.setSpeed(100);\r\n\t\tbr.setSpeed(100);\r\n\t\t\r\n\t\ttl.setPenColor(Color.blue);\r\n\t\ttm.setPenColor(Color.black);\r\n\t\ttr.setPenColor(Color.red);\r\n\t\tbl.setPenColor(Color.yellow);\r\n\t\tbr.setPenColor(Color.green);\r\n\t\t\r\n\t\ttl.setPenWidth(3);\r\n\t\ttm.setPenWidth(3);\r\n\t\ttr.setPenWidth(3);\r\n\t\tbl.setPenWidth(3);\r\n\t\tbr.setPenWidth(3);\r\n\t\r\n\t\ttl.penDown();\r\n\t\ttm.penDown();\r\n\t\ttr.penDown();\r\n\t\tbl.penDown();\r\n\t\tbr.penDown();\r\n\t\t\r\n\t\tThread r1 = new Thread(()->tl.move(3));\r\n\t\tThread r2 = new Thread(()->tm.move(3));\r\n\t\tThread r3 = new Thread(()->tr.move(3));\r\n\t\tThread r4 = new Thread(()->bl.move(3));\r\n\t\tThread r5 = new Thread(()->br.move(3));\r\n\t\t\r\n\t\tThread t1 = new Thread(()->tl.turn(1));\r\n\t\tThread t2 = new Thread(()->tm.turn(1));\r\n\t\tThread t3 = new Thread(()->tr.turn(1));\r\n\t\tThread t4 = new Thread(()->bl.turn(1));\r\n\t\tThread t5 = new Thread(()->br.turn(1));\r\n\t\t\r\n\t\tfor(int i=0;i<360;i++) {\r\n\t\t\tr1.run();\r\n\t\t\tr2.run();\r\n\t\t\tr3.run();\r\n\t\t\tr4.run();\r\n\t\t\tr5.run();\r\n\t\t\t\r\n\t\t\tt1.run();\r\n\t\t\tt2.run();\r\n\t\t\tt3.run();\r\n\t\t\tt4.run();\r\n\t\t\tt5.run();\r\n\t\t}\r\n\t\t\r\n\t\ttl.penUp();\r\n\t\ttm.penUp();\r\n\t\ttr.penUp();\r\n\t\tbl.penUp();\r\n\t\tbr.penUp();\r\n\t\t\r\n\t\tThread l1 = new Thread(()->tl.move(2000));\r\n\t\tThread l2 = new Thread(()->tm.move(2000));\r\n\t\tThread l3 = new Thread(()->tr.move(2000));\r\n\t\tThread l4 = new Thread(()->bl.move(2000));\r\n\t\tThread l5 = new Thread(()->br.move(2000));\r\n\t\t\r\n\t\tl1.run();\r\n\t\tl2.run();\r\n\t\tl3.run();\r\n\t\tl4.run();\r\n\t\tl5.run();\r\n\t}", "public void generate() {\n\n enemies.clear();\n\n for (int i = 0; i < (GRID_SIZE * ROOM_WIDTH); i++) {\n for (int j = 0; j < (GRID_SIZE * ROOM_HEIGHT); j++) {\n terrain[i][j] = null;\n }\n }\n\n RoomType[][] rooms = new RoomType[GRID_SIZE][GRID_SIZE];\n for(int i = 0; i < GRID_SIZE; i++) {\n for (int j = 0; j < GRID_SIZE; j++) {\n rooms[i][j] = RoomType.None;\n }\n }\n\n left = down = false;\n int x = random.nextInt(GRID_SIZE), y = 0;\n\n startPosition = new Vector2();\n startPosition.y = 4 * Tile.SIZE;\n startPosition.x = ((x + 1) * ROOM_WIDTH * Tile.SIZE) + 5 * Tile.SIZE;\n\n\n startRoom = true;\n while(true) {\n down = false;\n getDir();\n\n if(left) {\n x--;\n }\n else {\n x++;\n }\n\n if(x >= GRID_SIZE) {\n x--;\n down = true;\n }\n else if(x < 0) {\n x++;\n down = true;\n }\n\n if(down) {\n if(startRoom) {\n startRoomX = x;\n startRoomY = y;\n startRoom = false;\n }\n rooms[x][y] = RoomType.Down;\n y++;\n left = !left;\n if(y >= GRID_SIZE) {\n rooms[x][y - 1] = RoomType.Standard;\n endRoomX = x;\n endRoomY = y - 1;\n break;\n }\n }\n\n if(!down) {\n if(startRoom) {\n startRoomX = x;\n startRoomY = y;\n startRoom = false;\n }\n rooms[x][y] = RoomType.Standard;\n }\n else {\n if(startRoom) {\n startRoomX = x;\n startRoomY = y;\n startRoom = false;\n }\n rooms[x][y] = RoomType.getEnum(random.nextInt(1) + 3);\n }\n }\n\n for (int i = 0; i < GRID_SIZE; i++) {\n for (int j = 0; j < GRID_SIZE; j++) {\n System.out.print(rooms[i][j].VALUE + \" \");\n generateRoom(i, j, rooms[i][j]);\n }\n System.out.println(\"\");\n }\n }", "@Override\n public void start(GameData gameData, World world) {\n asteroids = new ArrayList<>();\n for (int i = 0; i <= random.nextInt(MAX_NUM_ASTEROIDS); i++) {\n asteroid = createAsteroid(gameData);\n System.out.println(\"Build asteroid: \" + (i + 1) + asteroid.getID());\n asteroids.add(asteroid);\n world.addEntity(asteroid);\n }\n }", "public Asteroid(String textureFileName, float x, float y, int sizeX, int sizeY){\r\n super(textureFileName, x, y, sizeX, sizeY);\r\n rotationNumber = randomRotation();\r\n setRotation(rotationNumber);\r\n getSprite().setOriginCenter();\r\n }", "public void setCoords() \r\n {\r\n \tthis.coordX = rand.nextInt(10);\r\n \tthis.coordY = rand.nextInt(10);\r\n }", "public Robots(PApplet p) {\n\t\tbSpeed = 6;\n\t\tbSize = 1;\n\t\tparent = p;\n\t\tx = parent.random (bobWidth, parent.width/2 - bobWidth); // Bob starts in a random place on the screen\n\t\ty = parent.random (bobWidth,parent.width/2 - bobWidth); \n\t}", "public void update(){\n // random move\n if(alive){\n posX += velX * cos(angle);\n posY += velY * sin(PI/4);\n angle += 0.04f*dir;\n if(random(0, 16) < 8){\n dir *= -1;\n }\n }\n }", "private void drawUniverse() {\n Random r = new Random();\n Point lower = getLower();\n Point upper = getUpper();\n lower = new Point(lower.x / (UNIVERSE_SCALE), lower.y / (UNIVERSE_SCALE));\n upper = new Point(upper.x / (UNIVERSE_SCALE), upper.y / (UNIVERSE_SCALE));\n\n universe.generateFrom(lower.x, lower.y, upper.x, upper.y );\n \n //sets scale of star backdrop\n starBackdrop.setScaleX(zoom / 5);\n starBackdrop.setScaleY(zoom / 5);\n gameCanvas.setScaleX(zoom / 10);\n gameCanvas.setScaleY(zoom / 10);\n \n //clears before drawing\n g.clearRect(0, 0, gameCanvas.getWidth(), gameCanvas.getHeight());\n \n //int x = universe.xMin(), y = universe.yMin();\n starBackdrop.setTranslateX((-mapOffsetX - dragOffsetX) * 2);\n starBackdrop.setTranslateY((-mapOffsetY - dragOffsetY) * 2);\n \n //draw non travelable solar systems\n for (SparseSpace.SparseIterator iter = universe.iterateFrom(lower.x, lower.y, upper.x, upper.y); iter.hasNext();) {\n SolarSystem a = iter.next();\n Image starImage = null;\n if (a != null && !travelable.contains(a)) {\n int x = a.getX() * UNIVERSE_SCALE;\n int y = a.getY() * UNIVERSE_SCALE;\n r.setSeed(a.name().hashCode());\n \n //set color of star based on suntype\n if (a.sunType().usesColor()) {\n g.setFill(new Color(a.sunType().getR(), a.sunType().getG(), a.sunType().getB(), 1.0));\n } else {\n starImage = sunImages.get(a.sunType().getName());\n }\n \n //initializes size and position variables\n double size = 20 + a.planets().length * 2;\n double xPosition = (x - mapOffsetX - dragOffsetX) + (512 - mapOffsetX - dragOffsetX) - (size / 2);\n double yPosition = (y - mapOffsetY - dragOffsetY) + (288 - mapOffsetY - dragOffsetY) - (size / 2);\n if (dragFinished) {\n solarSystemLocations.put(new Point((int) (xPosition + (size / 2)), (int) (yPosition + (size / 2))), a);\n }\n if (starImage == null) {\n g.fillOval(xPosition, yPosition, size, size);\n } else {\n Affine old = g.getTransform();\n double angle = r.nextDouble() * 360;\n rotate(angle, xPosition + size / 2, yPosition + size / 2);\n g.drawImage(starImage, xPosition, yPosition, size, size);\n g.setTransform(old);\n }\n g.setFill(Color.WHITE);\n }\n }\n \n //darken non-travelable planets\n g.setFill(new Color(0, 0, 0, 0.7));\n g.fillRect(0, 0, 1024, 512);\n \n //draw travel radius\n double radsize = player.getTravelRadius() * UNIVERSE_SCALE * 2;\n double radx = (((player.getCurrentSolarSystem().getX() * UNIVERSE_SCALE) - mapOffsetX - dragOffsetX)) + (512 - mapOffsetX - dragOffsetX) - (radsize / 2f);\n double rady = (((player.getCurrentSolarSystem().getY() * UNIVERSE_SCALE) - mapOffsetY - dragOffsetY)) + (288 - mapOffsetY - dragOffsetY) - (radsize / 2f);\n g.strokeOval(radx, rady, radsize, radsize);\n g.setFill(new Color(0, 0, 1, 0.1));\n g.fillOval(radx, rady, radsize, radsize);\n \n drawTravelable();\n }", "@Override\n\tprotected ArrayList<ModulePosition> buildRobot() {\n\t\tArrayList<ModulePosition> mPos = new ArrayList<ModulePosition>();\n\t\tmPos.add(new ModulePosition(\"custom 0\", new VectorDescription(0*ATRON.UNIT, -5*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(0, 0, -eigth)));\n\t\tmPos.add(new ModulePosition(\"custom 1\", new VectorDescription(1*ATRON.UNIT, -5*ATRON.UNIT, 1*ATRON.UNIT), ATRON.ROTATION_EW));\n\t\tmPos.add(new ModulePosition(\"custom 2\", new VectorDescription(1*ATRON.UNIT, -5*ATRON.UNIT, -1*ATRON.UNIT), ATRON.ROTATION_EW));\n\t\tmPos.add(new ModulePosition(\"custom 3\", new VectorDescription(2*ATRON.UNIT, -5*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(0, 0, -eigth)));\n\t\tmPos.add(new ModulePosition(\"custom 4\", new VectorDescription(3*ATRON.UNIT, -5*ATRON.UNIT, 1*ATRON.UNIT), ATRON.ROTATION_EW));\n\t\tmPos.add(new ModulePosition(\"custom 5\", new VectorDescription(3*ATRON.UNIT, -5*ATRON.UNIT, -1*ATRON.UNIT), ATRON.ROTATION_EW));\n\t\tmPos.add(new ModulePosition(\"custom 6\", new VectorDescription(4*ATRON.UNIT, -5*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(0, 0, -eigth)));\n\t\treturn mPos;\t\n\n\t\t\n\t\t/*\n\t\tArrayList<ModulePosition> mPos = new ArrayList<ModulePosition>();\n\t\tdouble x0 = 1;\n\t\tdouble y0 = 0;\n\t\tdouble z0 = 0;\n\t\tdouble angle = Math.PI/2 + Math.PI;\n\t\tVector3f moduleOrientationVector = new Vector3f(0, 0, 1);\n\t\tDouble moduleOrientationAngle = 0d;\n\t\tQuaternion moduleOrientationQuaternion = new Quaternion( (float)(moduleOrientationVector.x*Math.sin((moduleOrientationAngle)/2)), (float)(moduleOrientationVector.y*Math.sin((moduleOrientationAngle)/2)), (float)(moduleOrientationVector.z*Math.sin((moduleOrientationAngle)/2)), (float)(Math.cos((moduleOrientationAngle)/2)));\n\t\t//System.out.println(moduleOrientation.x + \" \" + moduleOrientation.y + \" \" + moduleOrientation.z);\n\t\tQuaternion rotation = new Quaternion( (float)(x0*Math.sin((angle)/2)), (float)(y0*Math.sin((angle)/2)), (float)(z0*Math.sin((angle)/2)), (float)(Math.cos((angle)/2)));\n\t\t//Vector3f newModuleOrientation = rotation.mult(moduleOrientation);\n\t\t//System.out.println(newModuleOrientation.x + \" \" + newModuleOrientation.y + \" \" + newModuleOrientation.z);\n\t\t//mPos.add(new ModulePosition(\"custom 0\", new VectorDescription(0*ATRON.UNIT, 0*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(rotation)));\n\t\tmPos.add(new ModulePosition(\"custom 0\", new VectorDescription(0*ATRON.UNIT, 0*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(new Quaternion( (float)(0), (float)(0), (float)(0), (float)(1)))));\n\t\t//x0 = 1; y0 = 0; z0 = 0; angle = 0;\n\t\t//mPos.add(new ModulePosition(\"custom 1\", new VectorDescription(1*ATRON.UNIT, 1*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(new Quaternion( (float)(x0*Math.sin(angle/2)), (float)(y0*Math.sin(angle/2)), (float)(z0*Math.sin(angle/2)), (float)(Math.cos(angle/2))))));\n\t\treturn mPos;\n*/\n\t}", "@Override\n\tpublic void randomRoom() {\n\t\tint randSide = random.nextInt(3) + 1;\n\t\tString side = properties.getSideFromProperties().get(randSide);\n\t\tint randRoom = random.nextInt(6) + 1;\n\t\tthis.room = properties.getRoomFromProperties().get(randRoom);\n\t\tthis.side = this.room.substring(0, 1).toLowerCase() + side;\n\t}", "public Asteroid(double xLoc, double yLoc) {\n\t\tsuper(resource.Constants.SPR_ASTEROID);\n\t\tsetX(xLoc);\n\t\tsetY(yLoc);\n\t\tthis.xLoc = xLoc;\n\t\tthis.yLoc = yLoc;\n\t}", "void reset(){ \n cueX= width/2 -150;\n cueY= height/2;\n \n \n redX = random(right , middle); redY = random(top, bottom);\n bluX = random(left, middle); bluY= random(top, bottom);\n yelX = random(left, right); yelY= random(top, bottom);\n \n //speed\n redDX = random(1,3); redDY = random(1,3);\n bluDX = random(1,3); bluDY = random(1,3);\n yelDX = random(1,3); yelDY = random(1,3);\n cueDX = random(1,3); cueDY = random(1,3);\n}", "public static void main(String[] args) {\n\t\t\n\t\n\t\t//2. create an array of 5 robots.\n\tRobot[] robot = new Robot[5];\n\t\t//3. use a for loop to initialize the robots.\n\tfor (int i = 0; i < robot.length; i++) {\n\t\trobot[i]=new Robot();\n\t}\n\t\t\t//4. make each robot start at the bottom of the screen, side by side, facing up\nrobot[0].moveTo(50, 550);\nrobot[1].moveTo(150, 550);\nrobot[2].moveTo(250, 550);\nrobot[3].moveTo(350, 550);\nrobot[4].moveTo(450, 550);\n\t\t//5. use another for loop to iterate through the array and make each robot move \n\t // a random amount less than 50.\n \n\t\t//6. use a while loop to repeat step 5 until a robot has reached the top of the screen.\nboolean finished=false;\nwhile(!finished) {\n \tfor (int i = 0; i < robot.length; i++) {\n\tRandom random = new Random();\n\t\trandom.nextInt(50);\n\t\trobot[i].move(i);\n\t\tif(robot[i].getY()==0) {\n \t\tfinished=true;\n \t\trobot[i].sparkle();\n \t\tSystem.out.println(\"You are the winner!\");\n \t\t\n \t}\n \t}\n}\n\t}", "private void initialParameters()\n\t{\n\t\tasteroidList = new ArrayList<Asteroid>();\n\t\tfor(int i = 0 ; i < INITIAL_ASTEROIDS ; i++)\n\t\t\tasteroidList.add(new Asteroid(getRandomLocationX(), getRandomLocationY(), SCREEN_WIDTH, SCREEN_HEIGHT));\n\t\t\n\t\t//========== Game Status ===========\n\t\trunning \t= true;\n\t\tisWin \t\t= false;\n\t\tisGameOver \t= false;\n\t\t\n\t\t//========== Game Craft ===========\t\t\n\t\tcraft = new Craft(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH, SCREEN_HEIGHT);\n\t}", "public void shield_random_start() {\n\t\tint randomX;\n\t\tint randomY;\n\t\twhile (true) {\n\t\t\trandomX = (int)(1 + Math.random()*labirinto.getSize());\n\t\t\trandomY = (int)(1 + Math.random()*labirinto.getSize());\n\t\t\trandomX--;\n\t\t\trandomY--;\n\t\t\tif (labirinto.getLab()[randomX][randomY] == ' ')\n\t\t\t\tbreak;\n\t\t}\n\t\tescudo.setX_coord(randomX); \n\t\tescudo.setY_coord(randomY);\n\t\tchange_escudo_pos();\n\t}", "public void render() {\n float theta = velocity.heading2D() + radians(90);\n\n\n fill(255, 0, 0);\n stroke(0, 0, 0);\n strokeWeight(0.5f);\n pushMatrix();\n translate(position.x, position.y);\n rotate(theta);\n beginShape(QUAD);\n fill(130);\n vertex(r, -r*2);\n\n vertex(-r, -r*2);\n vertex(-r, r*2);\n vertex(r, r*2);\n\n endShape();\n strokeWeight(0.5f);\n beginShape(TRIANGLES);\n vertex(r,-r*2);\n vertex(r*2.5f,r);\n vertex(r,r);\n endShape();\n strokeWeight(0.5f);\n beginShape(TRIANGLES);\n vertex(-r, -r*2);\n vertex(r, -r*2);\n vertex(0, -r*4);\n endShape();\n beginShape(TRIANGLES);\n vertex(-r, r*5);\n vertex(r, r*5);\n vertex(0, r*2);\n endShape();\n strokeWeight(1.7f*r);\n stroke(255);\n fill(255);\n point(0, -r*2.5f);\n stroke(0);\n fill(0);\n strokeWeight(0.75f*r);\n point(0, -r*2.5f);\n popMatrix();\n }", "public AsteroidManager(int numInitialAsteroids, ImageLoader imageLoader, AsteroidRunPanel asteroidRunPanel)\n {\n //Create the array of asteroids\n asteroids = new Asteroid[MAX_ASTEROIDS];\n numAsteroids = numInitialAsteroids;\n\n //Create the random number generator and an array of asteroid image names\n rng = new Random();\n String[] imagesNames = {\"Asteroid\", \"Asteroid 2\", \"Asteroid 3\"};\n\n //Populate the asteroids array with new asteroids\n for (int i = 0; i < numAsteroids; i++)\n {\n //Generate a random number to determine the type of asteroid, then create the asteroid\n asteroids[i] = new Asteroid(imagesNames[rng.nextInt(3)], \"Explosion\", imageLoader, this);\n }\n\n //Store the reference to the asteroidRunPanel\n this.asteroidRunPanel = asteroidRunPanel;\n }", "private void createWalls() {\n int environmentWidth = config.getEnvironmentWidth();\n int environmentHeight = config.getEnvironmentHeight();\n // Left\n Double2D pos = new Double2D(0, environmentHeight / 2.0);\n Double2D v1 = new Double2D(0, -pos.y);\n Double2D v2 = new Double2D(0, pos.y);\n WallObject wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n\n // Right\n pos = new Double2D(environmentWidth, environmentHeight / 2.0);\n wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n\n // Top\n pos = new Double2D(environmentWidth / 2.0, 0);\n v1 = new Double2D(-pos.x, 0);\n v2 = new Double2D(pos.x, 0);\n wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n\n // Bottom\n pos = new Double2D(environmentWidth / 2.0, environmentHeight);\n wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n }", "@Override\n public void update() {\n App.updateScore();\n App.updateRocketsCount();\n checkLevel();\n\n if(pickupSpawnCooldown > 0){\n pickupSpawnCooldown--;\n }\n\n player.setSpeed(new Point2D(player.getSpeed().getX()*0.98,player.getSpeed().getY()*0.98));\n int rand = random.nextInt(100);\n if(rand == 0 && asteroidsNumber<asteroidsMaxNumber){\n createAsteroid();\n asteroidsNumber++;\n }\n rand = random.nextInt(500);\n if(rand == 0 && astronautsNumber<astronautsMaxNumber){\n createAstronaut();\n astronautsNumber++;\n }\n }", "@Override public void run()\n {\n robot.angles = robot.imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n robot.gravity = robot.imu.getGravity();\n }", "protected void putMonsters() {\n\t\tRandom rand = new Random();\n\t\tfor (int monsterCount = 0; monsterCount < 4; monsterCount++){\n\t\t\tint x, y;\n\t\t\tdo {\n\t\t\t\tx = rand.nextInt(xSize);\n\t\t\t\ty = rand.nextInt(ySize);\n\t\t\t} while((levelSetup[x][y] instanceof SimpleRoom) && (x == 0 & y == 0) && !levelSetup[x][y].hasItem());\n\t\t\tlevelSetup[x][y].putMonster(new BasicMonster());\n\t\t}\n\t}", "public Critter(){\n\tthis.x_location = (int) (Math.random()*99);\n\tthis.y_location = (int) (Math.random()*99);\n\tthis.wrap();\n\t}", "public void rotateServos() {\n if (gamepad1.x) { //change to y and x\n left.setPosition(.69); //.63 with other arms\n right.setPosition(.24); //.3 with other arms\n }\n \n if (gamepad1.y) {\n left.setPosition(0);\n right.setPosition(1);\n }\n }", "public void randomizePointer(){\n\n pointerPos.set(p.random(BASE_POS.x,BASE_POS.x+300),p.random(BASE_POS.y-300,BASE_POS.y+300));\n while(pointerPos.dist(BASE_POS)>280 || pointerPos.dist(BASE_POS)<80 || p.atan2(pointerPos.y-BASE_POS.y,pointerPos.x - BASE_POS.x)>p.radians(60)){\n pointerPos.set(p.random(BASE_POS.x,BASE_POS.x+300),p.random(BASE_POS.y-300,BASE_POS.y+300));\n }\n }", "public void tick()\n {\n //We have to respawn the circles if they reach the bottom of the screen\n if (hasPassed())\n {\n //Randomly reset the x coordinates.\n this.x = minRandom + new Random().nextFloat()*(maxRandom-minRandom);\n //Fixed Y spawn\n this.y = spawnY;\n //Randomly reset the width,height, and radius of the new asteroid\n int newHeight, newWidth;\n newHeight = 32 + (int) (new Random().nextFloat()*(64.0f-32.0f));\n newWidth = newHeight;\n setWidth(newWidth);\n setHeight(newHeight);\n this.radius = width*0.5f;\n //Create a new Random color\n Random gen = new Random();\n int red, green, blue = 50;\n do\n {\n red = 40 + (int) (gen.nextFloat()*(255.0f-40.0f));\n green = 40 + (int) (gen.nextFloat()*(255.0f-40.0f));\n blue = 40 + (int) (gen.nextFloat()*(255.0f-40.0f));\n } while (red != green && red != blue);\n \n this.color = new Color(red,green,blue);\n }\n else\n {\n fall();\n move();\n }\n }", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "@Override public void onTap () {\n _vx = _rando.nextFloat() * (_rando.nextBoolean() ? -0.25f : 0.25f);\n _vy = _rando.nextFloat() * (_rando.nextBoolean() ? -0.25f : 0.25f);\n }", "@Override\n\n //-----------------\n\n public void init() {\n //test(); // <---------------- Uncomment to TEST!\n\n // %-distribution of RED, BLUE and NONE\n double[] dist = {0.49, 0.49, 0.02};\n\n // Number of locations (places) in world (square)\n int nLocations = 950;\n\n Actor[] distArray = distribution(nLocations, dist); //Generates array with correct distribution.\n distArray = shuffle(distArray); //Shuffles array\n world = toMatrix(distArray, nLocations, world); //Generates the start world.\n // Should be last\n fixScreenSize(nLocations);\n }", "public void cameraRotation() throws InterruptedException {\n\t\tint lowSide = (int)random(1,4);\r\n\t\tint highSide = (int)random(5,10);\r\n\t\tint medLowSide = (int)random(10,15);\r\n\t\tint medHighSide = (int)random(35,60);\r\n\t\tint highLowSide = (int)random(70,100);\r\n\t\tint highHighSide = (int)random(200,300);\r\n\t\tint cameraRotRandom = (int)random(0,1000);\r\n\t\tint cameraAngle = (int)camera.getPitchAngle(); // did we want to do anything with this?\r\n\t\t\r\n\t\t// twitch\r\n\t\tif (cameraRotRandom <= 200) {\r\n\t\t\t//log(\"antiban, move camera, twitch\");\r\n\t\t\tint twitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (twitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(lowSide,highSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (twitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(lowSide,highSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(lowSide,highSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(lowSide,highSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(lowSide,highSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(lowSide,highSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// medium movements\r\n\t\t\r\n\t\telse if (cameraRotRandom <= 900) {\r\n\t\t\t//log(\"antiban, move camera, medium\");\r\n\t\t\tint medtwitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (medtwitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(medLowSide,medHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (medtwitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(medLowSide,medHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(medLowSide,medHighSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(medLowSide,medHighSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(medLowSide,medHighSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(medLowSide,medHighSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// complete rotations\r\n\t\t\r\n\t\telse if (cameraRotRandom <= 1000) {\r\n\t\t\t//log(\"antiban, move camera, long rotation\");\r\n\t\t\tint hightwitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (hightwitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(highLowSide,highHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (hightwitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(highLowSide,highHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(highLowSide,highHighSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(highLowSide,highHighSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(highLowSide,highHighSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(highLowSide,highHighSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\tlog(\"something went wrong with antiban camera rotation\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void update()\n {\n //Update the asteroids\n for (int i = 0; i < numAsteroids; i++)\n {\n asteroids[i].update(i);\n }\n }", "public TriangleBumper(Double x,Double y,Double orientation,List<Gadget>triggeredGadgets){\n this.x = x;\n this.y = y;\n this.collideCirc = new ArrayList<Circle>(); //corner that ball will collide with\n this.collideLine = new ArrayList<LineSegment>(); //side that ball will collide with\n this.orientation = orientation;\n this.triggeredGadgets = new ArrayList<>();\n for (Gadget gadget : triggeredGadgets){\n this.triggeredGadgets.add(gadget);\n }\n //circle at each corner\n //line segment at each side\n if(this.orientation == 0.0){\n this.circles = Arrays.asList(new Circle(x,y,0.0), new Circle(x, y+1, 0.0), new Circle(x+1, y, 0.0));\n this.lines = Arrays.asList(new LineSegment(x+1, y, x, y+1), new LineSegment(x, y, x, y+1), new LineSegment(x,y, x+1, y));\n }else if (this.orientation == 90.0){\n this.circles = Arrays.asList(new Circle(x,y,0.0), new Circle(x+1, y, 0.0), new Circle(x+1, y+1,0.0));\n this.lines = Arrays.asList(new LineSegment(x, y, x+1, y), new LineSegment(x+1, y, x+1, y+1), new LineSegment(x,y, x+1, y+1));\n }else if (this.orientation == 180.0){\n this.circles = Arrays.asList(new Circle(x,y+1, 0.0), new Circle(x+1, y, 0.0), new Circle(x+1, y+1, 0.0));\n this.lines = Arrays.asList(new LineSegment(x, y+1, x+1, y), new LineSegment(x+1, y, x+1, y+1), new LineSegment(x+1, y+1, x, y+1));\n }else{\n this.circles = Arrays.asList(new Circle(x,y,0.0), new Circle(x, y+1, 0.0), new Circle(x+1, y+1, 0.0));\n this.lines = Arrays.asList(new LineSegment(x,y,x, y+1), new LineSegment(x,y+1, x+1, y+1), new LineSegment(x+1, y+1, x, y));\n }\n checkRep();\n\n }", "public Asteroid(int x, int y) {\r\n super(x, y);\r\n speed = 1;\r\n initialY = y;\r\n initAsteroid();\r\n }", "private void setupEnemySpawnPoints() {\n float ring = ProtectConstants.VIEWPORT_WIDTH / 2 + (ProtectConstants.GAME_OBJECT_SIZE * 2);\n float angle = 18; // start angle\n for(int i = 1; i < ProtectConstants.COLUMNS + 1; i++){\n enemySpawnPoints.add(divideCircle(ring, angle));\n angle += 360 / ProtectConstants.COLUMNS;\n }\n enemySpawnPoints.shuffle();\n }", "public void cameraRotation() throws InterruptedException {\n\t\tint lowSide = (int)random(1,4);\r\n\t\tint highSide = (int)random(5,10);\r\n\t\tint medLowSide = (int)random(10,15);\r\n\t\tint medHighSide = (int)random(35,60);\r\n\t\tint highLowSide = (int)random(70,100);\r\n\t\tint highHighSide = (int)random(200,300);\r\n\t\tint cameraRotRandom = (int)random(0,1000);\r\n\t\t//int cameraAngle = (int)camera.getPitchAngle(); // did we want to do anything with this?\r\n\t\t\r\n\t\t// twitch\r\n\t\tif (cameraRotRandom <= 200) {\r\n\t\t\t//log(\"antiban, move camera, twitch\");\r\n\t\t\tint twitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (twitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(lowSide,highSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (twitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(lowSide,highSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(lowSide,highSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(lowSide,highSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(lowSide,highSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(lowSide,highSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// medium movements\r\n\t\t\r\n\t\telse if (cameraRotRandom <= 900) {\r\n\t\t\t//log(\"antiban, move camera, medium\");\r\n\t\t\tint medtwitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (medtwitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(medLowSide,medHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (medtwitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(medLowSide,medHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(medLowSide,medHighSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(medLowSide,medHighSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(medLowSide,medHighSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(medLowSide,medHighSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// complete rotations\r\n\t\t\r\n\t\telse if (cameraRotRandom <= 1000) {\r\n\t\t\t//log(\"antiban, move camera, long rotation\");\r\n\t\t\tint hightwitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (hightwitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(highLowSide,highHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (hightwitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(highLowSide,highHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(highLowSide,highHighSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(highLowSide,highHighSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(highLowSide,highHighSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(highLowSide,highHighSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\tlog(\"something went wrong with antiban camera rotation\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void runRandom()\n\t{\n\t\tinit(); //Scan the area\n\t\t\n\t\twaitForPress();\n\t\twhile(_run)\n\t\t{\n\t\t\tboolean midLine = LS_MIDDLE.getLightValue() >= s_mid.threshold;\n\t\t\tboolean leftLine = LS_LEFT.getLightValue() >= s_left.threshold;\n\t\t\tboolean rightLine = LS_RIGHT.getLightValue() >= s_right.threshold;\n\t\t\t\n\t\t\tif(!leftLine && !rightLine) //INTERSECTION\n\t\t\t{\n\t\t\t\tstop();\n\t\t\t\tgoForward(50);\n\t\t\t\tchooseRandomDirection();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (midLine && leftLine && rightLine) turnAround();\n\t\t\t\telse followLine();\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\r\n\tOlympicRings_Threaded ort = new OlympicRings_Threaded();\r\n\tort.setup();\r\n//\tRobot rob = new Robot(600,500);\r\n//\trob.hide();\r\n//\trob.setPenColor(Color.BLUE);\r\n//\tRobot rob1 = new Robot(700, 500);\r\n//\trob1.hide();\r\n//\trob1.setPenColor(Color.BLACK);\r\n//\tRobot rob2 = new Robot(800, 500);\r\n//\trob2.hide();\r\n//\trob2.setPenColor(Color.RED);\r\n//\tRobot rob3 = new Robot(650, 550);\r\n//\trob3.hide();\r\n//\trob3.setPenColor(Color.YELLOW);\r\n//\tRobot rob4 = new Robot(750,550);\r\n//\trob4.hide();\r\n//\trob4.setPenColor(Color.GREEN);\r\n//\trob.setSpeed(1000000);\r\n//\trob1.setSpeed(1000000);\r\n//\trob2.setSpeed(1000000);\r\n//\trob3.setSpeed(1000000);\r\n//\trob4.setSpeed(1000000);\r\n//\t\r\n//\t\r\n//\trob.penDown();\r\n//\trob1.penDown();\r\n//\trob2.penDown();\r\n//\trob3.penDown();\r\n//\trob4.penDown();\r\n//\t\r\n//\t\r\n//\tfor (int i = 0; i < 360; i++) {\r\n//\trob.move(1);\r\n//\trob.turn(1);\r\n//\t\t\r\n//\trob1.move(1);\r\n//\trob1.turn(1);\r\n//\t\r\n//\trob2.move(1);\r\n//\trob2.turn(1);\r\n//\t\r\n//\trob3.move(1);\r\n//\trob3.turn(1);\r\n//\t\r\n//\trob4.move(1);\r\n//\trob4.turn(1);\r\n//\t\r\n//\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n//\trob1.move(400);\r\n//\trob1.turn(90);\r\n//\trob1.move(400);\r\n//\trob2.move(400);\r\n//\trob2.turn(90);\r\n//\trob2.move(400);\r\n//\trob3.move(400);\r\n//\trob3.turn(90);\r\n//\trob3.move(400);\r\n//\trob4.move(400);\r\n//\trob4.turn(90);\r\n//\trob4.move(400);\r\n//\t\r\n//\trob1.moveTo(150, 700);\r\n//\trob2.moveTo(550, 700);\r\n//\trob3.moveTo(950, 700);\r\n//\trob4.moveTo(1350, 700);\r\n//\t\r\n//\t\r\n//\t\r\n//\t\r\n//\t\r\n//Thread r1 = new Thread(()->rob1.move(400));\r\n//\tThread r2 = new Thread(()->rob2.move(400));\r\n//\tThread r3 = new Thread(()->rob3.move(400));\r\n//\tThread r4 = new Thread(()->rob4.move(400));\r\n//\t\r\n//\tr1.start();\r\n//\tr2.start();\r\n//\tr3.start();\r\n//\tr4.start();\r\n\r\n}", "@Override\n public void relocatedWithinBounds() {\n x = random.nextInt(maxX - width);\n y = random.nextInt(maxY - height);\n }", "public void main() {\n\tvor();\n\tvor();\n\tnimm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tnimm();\n\t\n\t/* get hamster to pick up four grains\n\t(continuation of previous code) */\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tnimm();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tnimm();\n\t\n\t/* get hamster to pick up all grains\n\t(continuation of previous code) */\n\t\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tnimm();\n\tlinksUm();\n\tvor();\n\tnimm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tnimm();\n\tvor();\n\tnimm();\n\tvor();\n\tnimm();\n\tvor();\n\tnimm();\n\tvor();\n\tnimm();\n\t\n\t/* drop all grains in top left corner\n\tand go back to initial position (facing south)\n\t(continuation of previous code) */\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tgib(); // drop all 11 grains\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n}", "public Ant(){ // The position and direction of the ant is completely randomizated in it's creation\n this.position[0] = (int)Math.floor(Math.random() * 20); \n this.position[1] = (int)Math.floor(Math.random() * 20);\n this.image = (int)Math.floor(Math.random() * 4);\n }", "private void populateLevel() {\n\t\t// Make the ragdoll\n\t\tragdoll = new RagdollModel(DOLL_POS.x, DOLL_POS.y);\n\t\tragdoll.setDrawScale(scale.x,scale.y);\n\t\tragdoll.setPartTextures(bodyTextures);\n\t\tragdoll.getBubbleGenerator().setTexture(bubbleTexture);\n\t\taddObject(ragdoll);\n\n\t\t// Create ground pieces\n\t\tPolygonObstacle obj;\n\t\tobj = new PolygonObstacle(WALL1, 0, 0);\n\t\tobj.setBodyType(BodyDef.BodyType.StaticBody);\n\t\tobj.setDensity(BASIC_DENSITY);\n\t\tobj.setFriction(BASIC_FRICTION);\n\t\tobj.setRestitution(BASIC_RESTITUTION);\n\t\tobj.setDrawScale(scale);\n\t\tobj.setTexture(earthTile);\n\t\tobj.setName(\"wall1\");\n\t\taddObject(obj);\n\n\t\tobj = new PolygonObstacle(WALL2, 0, 0);\n\t\tobj.setBodyType(BodyDef.BodyType.StaticBody);\n\t\tobj.setDensity(BASIC_DENSITY);\n\t\tobj.setFriction(BASIC_FRICTION);\n\t\tobj.setRestitution(BASIC_RESTITUTION);\n\t\tobj.setDrawScale(scale);\n\t\tobj.setTexture(earthTile);\n\t\tobj.setName(\"wall2\");\n\t\taddObject(obj);\n\n\t\tselector = new ObstacleSelector(world);\n\t\tselector.setTexture(crosshairTexture);\n\t\tselector.setDrawScale(scale);\n\t\t\n\t\t/*\n\t\tBodyDef groundDef = new BodyDef();\n\t\tgroundDef.type = BodyDef.BodyType.StaticBody;\n\t\tEdgeShape groundShape = new EdgeShape();\n\t\tgroundShape.set(-500.0f, 0.0f, 500.0f, 0.0f);\n\t\tground = world.createBody(groundDef);\n\t\tground.createFixture(groundShape,0);\n\t\t*/\n\t}", "public SnowmanShape(int x, int y, int width) {\n\t\tsuper(x, y);\n\t\tthis.width = width;\n\t\tUNIT = width/3;\n\t\tfinal double ARM_OFFSET = 5;\n\t\tdouble diameter = UNIT;\n\t\tdouble topLeft = x + ((width / 2) - (UNIT / 2));\n\t\tdouble topTop = y;\n\t\tEllipse2D.Double topBall = \n\t\t\t\tnew Ellipse2D.Double(topLeft, topTop, diameter, diameter);\n\n\t\ttopTop = topTop + diameter;\n\t\tEllipse2D.Double midBall = \n\t\t\t\tnew Ellipse2D.Double(topLeft, topTop, diameter, diameter);\n\t\tPoint2D.Double armLeftStart = new Point2D.Double(topLeft, topTop + (diameter/2));\n\t\tPoint2D.Double armRightStart = new Point2D.Double(topLeft + diameter, topTop + (diameter/2));\n\t\tPoint2D.Double armLeftEnd = new Point2D.Double(x, topTop + (diameter/2) - ARM_OFFSET);\n\t\tPoint2D.Double armRightEnd = new Point2D.Double(x + width, topTop + (diameter/2) - ARM_OFFSET);\n\t\t\n\t\ttopTop = topTop + diameter;\n\t\tEllipse2D.Double botBall = \n\t\t\t\tnew Ellipse2D.Double(topLeft, topTop, diameter, diameter);\n\t\t\n\t\t\n\t\tLine2D.Double armLeft = new Line2D.Double(armLeftStart, armLeftEnd);\n\t\tLine2D.Double armRight = new Line2D.Double(armRightStart, armRightEnd);\n\t\t\n\t\tadd(topBall);\n\t\tadd(midBall);\n\t\tadd(botBall);\n\t\tadd(armLeft);\n\t\tadd(armRight);\n\t\t\n\t}", "public void sunAndPlanet()\n {\n removeAllObjects();\n addObject (new Body (50, 240.0, new Vector(270, 0.03), new Color(255, 216, 0)), 460, 270);\n addObject (new Body (20, 4.2, new Vector(90, 2.2), new Color(0, 124, 196)), 695, 260);\n }", "@Override\n\tpublic void move() {\n\t\theading = Heading.randHeading();\n\t\tif (heading == Heading.NORTH) {\n\t\t\tthis.location.y -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.EAST) {\n\t\t\tthis.location.x += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.SOUTH) {\n\t\t\tthis.location.y += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.WEST) {\n\t\t\tthis.location.x -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t}\n\t\tadjustPos();\n\t\tinfect();\n\t}", "private void newGame() {\n\t\t// Firstly, we spawn the player.\n\t\tplayer = new AsteroidsPlayer(GameObject.ROOT, this);\n\t\tspawnPlayer();\n\n\t\t// Make sure that no other objects exist.\n\t\tasteroids.clear();\n\t\tlaserShots.clear();\n\t\totherObjects.clear();\n\n\t\t// Then we create the score text using two strings.\n\t\tAsteroidsString scoreText = new AsteroidsString(GameObject.ROOT, \"SCORE\", true, false);\n\t\tscoreText.translate(new Vector3(-cameraZoom, cameraZoom - 1));\n\t\totherObjects.add(scoreText);\n\t\tscoreString = new AsteroidsString(GameObject.ROOT, Integer.toString(score), true, false);\n\t\tscoreString.translate(new Vector3(-cameraZoom, cameraZoom - 3));\n\t\totherObjects.add(scoreString);\n\n\t\t// We set our starting lives to 3.\n\t\tlives = 3;\n\n\t\t//And we also create the lives text.\n\t\tAsteroidsString livesText = new AsteroidsString(GameObject.ROOT, \"LIVES\", false, true);\n\t\tlivesText.translate(new Vector3(cameraZoom, cameraZoom - 1));\n\t\totherObjects.add(livesText);\n\t\tlivesString = new AsteroidsString(GameObject.ROOT, Integer.toString(lives), false, true);\n\t\tlivesString.translate(new Vector3(cameraZoom, cameraZoom - 3));\n\t\totherObjects.add(livesString);\n\n\t\t// Then we just set the delay to the first asteroid.\n\t\ttimeToNextAsteroid = asteroidDelay;\n\t}", "protected void initialize() {\n finished = false;\n Robot.shooter.Spin();//Spin up wheels\n Timer.delay(3);\n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n //Robot.shooter.Stop();\n Robot.shooter.TriggerExtend();//Reset Trigger\n \n Robot.driveTrain.DriveBack();//Drives backwards from pyramid\n Timer.delay(1.5);\n Robot.driveTrain.TurnAround();//Turns Bob around\n Timer.delay(1);\n Robot.driveTrain.Stop();//Stops Bob\n \n Robot.pneumatics.CompressorOn();//Turns compressor on\n }", "@Override\n public void run() {\n angles = imu.getAngularOrientation().toAxesReference(AxesReference.INTRINSIC).toAxesOrder(AxesOrder.ZYX);\n gravity = imu.getGravity();\n }", "private void createApple() {\r\n Random rnd = new Random();\r\n do {\r\n apple = new Coordinates(rnd.nextInt(gridWidth), rnd.nextInt(gridHeight));\r\n } while (isSnakeAt(apple));\r\n }", "public static void changePosition() {\n int direction;\n int speed;\n int newTopX;\n int newTopY;\n\n for (int i = 0; i < numShapes; ++i) {\n direction = moveDirection[i];\n speed = moveSpeed[i];\n newTopX = xTopLeft[i];\n newTopY = yTopLeft[i];\n\n //the switch uses the direction the speed should be applied to in order to find the new positions\n switch (direction) {\n case 0 -> {\n newTopX = newTopX - (speed);\n xTopLeft[i] = newTopX;\n }\n //upper left 135 degrees\n case 1 -> {\n newTopX = newTopX - (speed);\n xTopLeft[i] = newTopX;\n newTopY = newTopY - (speed);\n yTopLeft[i] = newTopY;\n }\n case 2 -> {\n newTopY = newTopY - (speed);\n yTopLeft[i] = newTopY;\n }\n //upper right 45 degrees\n case 3 -> {\n newTopX = newTopX + (speed);\n xTopLeft[i] = newTopX;\n newTopY = newTopY - (speed);\n yTopLeft[i] = newTopY;\n }\n case 4 -> {\n newTopX = newTopX + (speed);\n xTopLeft[i] = newTopX;\n }\n //bottom right 315 degrees\n case 5 -> {\n newTopX = newTopX + (speed);\n xTopLeft[i] = newTopX;\n newTopY = newTopY + (speed);\n yTopLeft[i] = newTopY;\n }\n case 6 -> {\n newTopY = newTopY + (speed);\n yTopLeft[i] = newTopY;\n }\n //bottom left 225 degrees\n case 7 -> {\n newTopX = newTopX - (speed);\n xTopLeft[i] = newTopX;\n newTopY = newTopY + (speed);\n yTopLeft[i] = newTopY;\n }\n }\n }\n }", "public void generateRandomPosition() {\n\t\tx.set((int)(Math.floor(Math.random()*23+1)));\n\t\ty.set((int)(Math.floor(Math.random()*23+1)));\n\n\t}", "private void initStars()\r\n\t{\r\n\t\tRandom rng = new Random();\r\n\t\tfor (int i = 0; i < amountOfStars; i++)\r\n\t\t{\r\n\t\t\tint x = rng.nextInt(width);\r\n\t\t\tint y = rng.nextInt(height);\r\n\t\t\tstars.add(new Star(x, y));\r\n\t\t}\r\n\t}", "public void RandomOrientation(){\n\n\t\tfor (int i=0;i<population.length;i++){\n\t\t\tpopulation[i].RandomOrientation();\n\t\t}\n\n\t}", "public void robotInit() {\r\n\r\n shootstate = down;\r\n try {\r\n Components.shootermotorleft.setX(0);\r\n Components.shootermotorleft2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n try {\r\n Components.shootermotorright.setX(0);\r\n Components.shootermotorright2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n initialpot = Components.ShooterPot.getAverageVoltage();\r\n //shootpotdown +=initialpot;\r\n //shootpotlow+= initialpot;\r\n //shootpotmiddle+= initialpot;\r\n //shootpothigh+=initialpot;\r\n\r\n }", "public void resetObjects() {\n if (wind1.isOffScreen()) {\n wind1.reset(wind3.getBoundingRectangle().y - buffer - rand.nextInt(AssetHandler.SCREEN_HEIGHT / 4));\n }\n if (wind2.isOffScreen()) {\n wind2.reset(wind1.getBoundingRectangle().y - buffer - rand.nextInt(AssetHandler.SCREEN_HEIGHT / 4));\n }\n if (wind3.isOffScreen()) {\n wind3.reset(wind2.getBoundingRectangle().y - buffer - rand.nextInt(AssetHandler.SCREEN_HEIGHT / 4));\n }\n\n //Again, check if the clouds go off the screen and then reset them.\n cloudBuffer = rand.nextInt(AssetHandler.SCREEN_HEIGHT / 4) + AssetHandler.SCREEN_HEIGHT / 4;\n if (cloud1.isOffScreen()) {\n cloud1.reset(cloud4.y - cloudBuffer);\n }\n if (cloud2.isOffScreen()) {\n cloud2.reset(cloud1.y - cloudBuffer);\n }\n if (cloud3.isOffScreen()) {\n cloud3.reset(cloud2.y - cloudBuffer);\n }\n if (cloud4.isOffScreen()) {\n cloud4.reset(cloud3.y - cloudBuffer);\n }\n\n //Check if birds (drones) go above the screen and reset them\n birdBuffer = rand.nextInt(AssetHandler.SCREEN_HEIGHT / 2 + AssetHandler.SCREEN_HEIGHT / 3) + AssetHandler.SCREEN_HEIGHT / 2;\n if (drone1.isOffScreen()) {\n drone1.reset(drone2.y - birdBuffer);\n }\n birdBuffer = rand.nextInt(AssetHandler.SCREEN_HEIGHT / 2 + AssetHandler.SCREEN_HEIGHT / 3) + AssetHandler.SCREEN_HEIGHT / 2;\n if (drone2.isOffScreen()) {\n drone2.reset(drone1.y - birdBuffer);\n }\n\n }", "public static void setScene() {\n\n Shape ground = new Plane(vec3(0.0, -1.0, 0.0), vec3(0, 1, -0.2), new Diffuse(new Vec3(1,1,1), white));\n \n /* Shape globe1 = new Sphere(vec3(0.0, 2, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n Shape globe2 = new Sphere(vec3(2, 0, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n Shape globe3 = new Sphere(vec3(-2, 0, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n*/\n Shape globe1T = new Sphere(vec3(0.0, 2, -2.0), 0.3, new Diffuse(new Vec3(1,1,1), white));\n // Shape globe2T = new Sphere(vec3(-0.5, -2, -3.0), 0.5, new Diffuse(new Vec3(1,1,1),yellow));\n // Shape globe3T = new Sphere(vec3(0.5, -2, -3.0), 0.5, new Diffuse(new Vec3(1,1,1), yellow));\n\n \n \n Shape globe4 = new Sphere(vec3(0.0, 2, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n Shape globe5 = new Sphere(vec3(2, 0, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n Shape globe6 = new Sphere(vec3(-2, 0, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n \n Shape globe7 = new Sphere(vec3(0.0, 2, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe8 = new Sphere(vec3(2, 0, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe9 = new Sphere(vec3(-2, 0, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe7D = new Sphere(vec3(0.0, -2, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n\n Shape globeC = new Sphere(vec3(0.0, 0.0, -6.0), 1.0, new Diffuse(new Vec3(1,1,1), red));\n \n ArrayList<Shape> shapes = new ArrayList<>();\n shapes.add(bg);\n shapes.add(ground);\n shapes.add(globe1T);\n // shapes.add(globe2T);\n // shapes.add(globe3T);\n //shapes.add(globe4);\n //shapes.add(globe5);\n shapes.add(globe7);\n shapes.add(globe8);\n shapes.add(globe9);\n shapes.add(globe7D);\n shapes.add(globeC);\n gr = new Group(shapes);\n /////////////////////////////--------------------------------------\n \n \n }", "public void draw() {\n\t\tapplyColors();\n\n\t\tfloat halfHeight = height / 2,\n\t\t\t\tdiameter = 2 * radius;\n\n\t\tRobotRun.getInstance().translate(0f, 0f, halfHeight);\n\t\t// Draw top of the cylinder\n\t\tRobotRun.getInstance().ellipse(0f, 0f, diameter, diameter);\n\t\tRobotRun.getInstance().translate(0f, 0f, -height);\n\t\t// Draw bottom of the cylinder\n\t\tRobotRun.getInstance().ellipse(0f, 0f, diameter, diameter);\n\t\tRobotRun.getInstance().translate(0f, 0f, halfHeight);\n\n\t\tRobotRun.getInstance().beginShape(RobotRun.TRIANGLE_STRIP);\n\t\t// Draw a string of triangles around the circumference of the Cylinders top and bottom.\n\t\tfor (int degree = 0; degree <= 360; ++degree) {\n\t\t\tfloat pos_x = RobotRun.cos(RobotRun.DEG_TO_RAD * degree) * radius,\n\t\t\t\t\tpos_y = RobotRun.sin(RobotRun.DEG_TO_RAD * degree) * radius;\n\n\t\t\tRobotRun.getInstance().vertex(pos_x, pos_y, halfHeight);\n\t\t\tRobotRun.getInstance().vertex(pos_x, pos_y, -halfHeight);\n\t\t}\n\n\t\tRobotRun.getInstance().endShape();\n\t}", "public Shooter() {\n fire1 = new Solenoid(1);\n fire2 = new Solenoid(4);\n returnValve = new Solenoid(3);\n latchSolenoid = new Solenoid(2);\n FFM = true;\n m_enabled = true;\n shooting = false;\n reloading = false;\n initShooter();\n }", "public void spawnRobots() {\n\t\tString robotName\t= \"\";\n\t\tPlayer newPlayer\t= null;\n\t\tint numberOfRobots \t= 0;\n\t\tint robotsPerPlayer = server.getRobotsPerPlayer();\n\t\tint numberOfPlayers = server.getPlayerCount();\n\t\tint robotsPerLevel\t= server.getRobotsPerLevel();\n\t\t\n\t\t// calculate how many robots that should be spawned\n\t\trobotsPerPlayer = robotsPerPlayer *\n\t\t\t\t\t\t (robotsPerLevel * \n\t\t\t\t\t\t currentLevel);\n\t\t\n\t\tnumberOfRobots \t= robotsPerPlayer *\n\t\t\t\t\t\t numberOfPlayers;\n\t\t\n\t\tfor(int i = 0; i < numberOfRobots; i++) {\n\t\t\trobotName \t\t\t= \"Robot\" + (i+1);\n\t\t\tnewPlayer = initPlayerToGameplane(robotName, \n\t\t\t\t\t\t\t\t \t\t\t PlayerType.Robot, \n\t\t\t\t\t\t\t\t \t\t\t 0, 0);\n\t\t\t\n\t\t\tHandleCommunication.broadcastToClient(null, \n\t\t\t\t\t\t\t\t\t\t\t\t server.getConnectedClientList(), \n\t\t\t\t\t\t\t\t\t\t\t\t SendSetting.AddPlayer, \n\t\t\t\t\t\t\t\t\t\t\t\t newPlayer, \n\t\t\t\t\t\t\t\t\t\t\t\t null);\n\t\t}\n\t}", "public void randomizeDirection()\n\t{\n\t\txSpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed);\n\t\tySpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed);\n\t}", "public static void main(String[] args) {\n World World1 = new World();\n //Instantiate a turtle. Name it as you wish.\n Turtle wBenny = new Turtle(World1);\n wBenny.forward(60);\n //this let turtle move forward\n wBenny.turnRight();\n //this let turtle turn right\n wBenny.forward(60);\n wBenny.turnRight();\n wBenny.forward(60);\n Turtle qKen = new Turtle(World1);\n //make a turtle named qken\n qKen.turnRight();\n qKen.forward(60);\n qKen.turnRight();\n qKen.forward(60);\n qKen.turnRight();\n qKen.forward(60);\n Turtle iZen = new Turtle(World1);\n iZen.turnRight();\n iZen.turnRight();\n iZen.forward(60);\n iZen.turnRight();\n iZen.forward(60);\n iZen.turnRight();\n iZen.forward(60);\n Turtle oPin = new Turtle(World1);\n oPin.turnRight();\n oPin.turnRight();\n oPin.turnRight();\n oPin.forward(60);\n oPin.turnRight();\n oPin.forward(60);\n oPin.turnRight();\n oPin.forward(60);\n\n /*Have your turtle make 4 boxes in the world. The boxes should be in a 2x2 grid. Similar to this:\n ___ ___ \n | | |\n |___|___|\n | | |\n |___|___|\n\n */\n\n\n\n World1.setVisible(true);\n //Finally, set the world to be visible with a boolean...\n }", "@Override\n public void loop() {\n\n //double armRot = robot.Pivot.getPosition();\n\n double deadzone = 0.2;\n\n double trnSpdMod = 0.5;\n\n float xValueRight = gamepad1.right_stick_x;\n float yValueLeft = -gamepad1.left_stick_y;\n\n xValueRight = Range.clip(xValueRight, -1, 1);\n yValueLeft = Range.clip(yValueLeft, -1, 1);\n\n // Pressing \"A\" opens and closes the claw\n if (gamepad1.a) {\n\n if (robot.Claw.getPosition() < 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(1);}\n else if (robot.Claw.getPosition() > 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(0.4);}\n else\n while(gamepad1.a)\n robot.Claw.setPosition(1);\n }\n\n // Pressing \"B\" changes the wrist position\n if (gamepad1.b) {\n\n if (robot.Wrist.getPosition() == 1)\n while(gamepad1.b)\n robot.Wrist.setPosition(0.5);\n else if (robot.Wrist.getPosition() == 0.5)\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n else\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n }\n\n // Turn left/right, overrides forward/back\n if (Math.abs(xValueRight) > deadzone) {\n\n robot.FL.setPower(xValueRight * trnSpdMod);\n robot.FR.setPower(-xValueRight * trnSpdMod);\n robot.BL.setPower(xValueRight * trnSpdMod);\n robot.BR.setPower(-xValueRight * trnSpdMod);\n\n\n } else {//Forward/Back On Solely Left Stick\n if (Math.abs(yValueLeft) > deadzone) {\n robot.FL.setPower(yValueLeft);\n robot.FR.setPower(yValueLeft);\n robot.BL.setPower(yValueLeft);\n robot.BR.setPower(yValueLeft);\n }\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n\n telemetry.addData(\"Drive Encoder Ticks\", robot.FL.getCurrentPosition());\n telemetry.addData(\"Winch Encoder Ticks\", robot.Winch.getCurrentPosition());\n telemetry.addData(\"ColorArm Position\", robot.ColorArm.getPosition());\n telemetry.addData(\"Wrist Position\", robot.Wrist.getPosition());\n telemetry.addData(\"Claw Position\", robot.Claw.getPosition());\n telemetry.addData(\"Grip Position\", robot.Grip.getPosition());\n telemetry.addData(\"Color Sensor Data Red\", robot.Color.red());\n telemetry.addData(\"Color Sensor Data Blue\", robot.Color.blue());\n\n /*\n\n // This is used for an Omniwheel base\n\n // Group a is Front Left and Rear Right, Group b is Front Right and Rear Left\n float a;\n float b;\n float turnPower;\n if(!gamepad1.x) {\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n\n a = Range.clip(yValueLeft + xValueLeft, -1, 1);\n b = Range.clip(yValueLeft - xValueLeft, -1, 1);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n } else {\n\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n a = Range.clip(yValueLeft + xValueLeft, -0.6f, 0.6f);\n b = Range.clip(yValueLeft - xValueLeft, -0.6f, 0.6f);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n }\n\n\n if (gamepad1.dpad_up) {\n\n robot.Swing.setPower(.6);\n\n } else if (gamepad1.dpad_down) {\n\n robot.Swing.setPower(-.6);\n\n } else {\n\n robot.Swing.setPower(0);\n }\n\n if(gamepad1.a){\n\n robot.Claw.setPosition(.4);\n\n } else if(gamepad1.b){\n\n robot.Claw.setPosition(0);\n }\n\n if(gamepad1.left_bumper) {\n\n robot.Pivot.setPosition(armRot+0.0005);\n\n } else if(gamepad1.right_bumper) {\n\n robot.Pivot.setPosition(armRot-0.0005);\n\n } else{\n\n robot.Pivot.setPosition(armRot);\n }\n\n telemetry.addData(\"position\", position);\n\n */\n\n /*\n * Code to run ONCE after the driver hits STOP\n */\n }", "public static void main(String [] args) \n {\n World world = new World(false);\n \n //creating 2d turtle\n Turtle t = new Turtle(world);\n Turtle t2 = new Turtle(world);\n Turtle t3 = new Turtle(world);\n\n //creating variables that are holding the dimentions for the house\n int width = 250;\n int height = 150;\n int windowWidth = 30;\n int doorWidth = 30;\n int doorHeight = 50;\n int initialY = t.getYPos();\n int grassX = 0;\n int grassY = 479;\n int grassPenWidth = 175;\n int grassPenLength = 639;\n int rectanglePenWidth = 5;\n int garagePenWidth = 5;\n int equialateralRoofPenWidth = 3;\n int equialaterTopOfDoor = 2;\n int garageWidth = height/2;\n \n //Turtle t2 creates green grass\n t2.penUp();\n t2.moveTo(grassX,grassY);\n t2.turnRight();\n t2.setPenWidth(grassPenWidth);\n t2.setPenColor(java.awt.Color.GREEN);\n t2.penDown();\n t2.forward(grassPenLength);\n \n //Turtle t create a rectangular house foundation \n t.setPenColor(java.awt.Color.BLACK);\n t.setPenWidth(rectanglePenWidth);\n t.drawRectangle(width, height);\n \n //Turtle t moved and creates a Equilateral roof\n t.penUp();\n t.turn(30);\n t.forward(width);\n t.turn(-30);\n t.penDown();\n t.setPenWidth(equialateralRoofPenWidth);\n t.drawEquilateral(width);\n t.penUp();\n \n //Turtle t creates the first right window\n t.turn(150);\n t.forward(width);\n t.turn(30);\n t.forward(height/4);\n t.turn(90);\n t.forward(width/4);\n t.turn(90);\n t.penDown();\n t.setPenWidth(3);\n \n //Turlte t changes color of window to red\n t.setPenColor(java.awt.Color.RED);\n t.drawSquare(windowWidth);\n t.penUp();\n \n //move Turtl t to the top left of the left window\n\n t.moveTo(t.getXPos() - width/2 - windowWidth, t.getYPos());\n \n //Turtle t creates left window\n t.penDown();\n t.setPenColor(java.awt.Color.RED);\n t.drawSquare(windowWidth);\n t.penUp();\n \n //Turtle t is moved to the top left of the door and creates it\n t.moveTo(t.getXPos() + doorWidth/2 + width/4, initialY + height - doorHeight);\n t.penDown();\n t.drawRectangle(doorWidth,doorHeight);\n t.penUp();\n \n //Turtle t moves to top left of the door and creates an equilater door accent\n t.turn(30);\n t.forward(doorWidth);\n t.turn(-30);\n t.penDown();\n t.setPenWidth(equialaterTopOfDoor);\n t.setPenColor(java.awt.Color.YELLOW);\n t.drawEquilateral(doorWidth);\n t.penUp();\n \n //Turtle t3 creates garage\n t3.penUp();\n t3.moveTo(t3.getXPos() - garageWidth, t3.getYPos() + height/2);\n t3.penDown();\n t3.setPenColor(java.awt.Color.BLACK);\n t3.setPenWidth(garagePenWidth);\n t3.drawSquare(garageWidth);\n\n //this hides the 2d turtles and shows the 2d world\n t.hide();\n t2.hide();\n t3.hide(); \n world.show();\n \n }", "public void populateGrid() {\n for (int i=0; i<5; i++) {\n int chance = (int) random(10);\n if (chance <= 3) {\n int hh = ((int) random(50) + 1) * pixelSize;\n int ww = ((int) random(30) + 1) * pixelSize;\n\n int x = ((int) random(((width/2)/pixelSize))) * pixelSize + width/4;\n int y = ((int) random((height-topHeight)/pixelSize)) * pixelSize + topHeight;\n\n new Wall(w/2, 190, hh, ww).render();\n }\n }\n\n int fewestNumberOfPowerUps = 3;\n int greatesNumberOfPowerUps = 6;\n int wSize = 2;\n int hSize = 2;\n\n powerUps = new ArrayList <PowerUp> ();\n createPowerUps (fewestNumberOfPowerUps, greatesNumberOfPowerUps, wSize, hSize);\n}", "private void initializeDoorMotors()\n {\n frame = new Rectangle(shaftWidth*.4, location+7, 30, floorHeight*.6);\n leftDoor = new Rectangle(shaftWidth*.4, location+7, 0, floorHeight*.6);\n rightDoor = new Rectangle(shaftWidth*.6, location+7, 0, floorHeight*.6);\n frame.setFill(Color.BLACK);\n leftDoor.setFill(Color.valueOf(\"#C0C0C0\"));\n rightDoor.setFill(Color.valueOf(\"#C0C0C0\"));\n\n openingLeft = false;\n opened = 5;\n doorSpeed = 10;\n\n leftDoorTimeline = new Timeline(new KeyFrame(Duration.millis(doorSpeed), e -> {\n separationL = leftDoor.getWidth();\n\n if (openingLeft && separationL > opened-5) {\n leftDoor.setWidth(separationL - 0.5);\n } else if (!openingLeft && separationL < opened+10) {\n leftDoor.setWidth(separationL + 0.5);\n } else {\n leftDoorTimeline.pause();\n }\n }));\n leftDoorTimeline.setCycleCount(Animation.INDEFINITE);\n leftDoorTimeline.play();\n\n rightDoorTimeline = new Timeline(new KeyFrame(Duration.millis(doorSpeed), e -> {\n x = rightDoor.getLayoutX();\n separationR = rightDoor.getWidth();\n\n if(openingRight && separationR > opened-5) {\n rightDoor.setWidth(separationR - 0.5);\n rightDoor.setLayoutX(x + 0.5);\n }\n else if(!openingRight && separationR < opened+10) {\n rightDoor.setWidth(separationR + 0.5);\n rightDoor.setLayoutX(x - 0.5);\n } else {\n if (openingRight) { //just assuming the doors are closed/and opened at the\n status = DoorStatus.OPEN; // same time so only update door status in right animation\n } else {\n status = DoorStatus.CLOSED;\n }\n rightDoorTimeline.pause();\n }\n }));\n rightDoorTimeline.setCycleCount(Animation.INDEFINITE);\n rightDoorTimeline.play();\n }", "public void basicMotion() {\r\n\t\tPVector v = behavior.behavior(obj.getMotion());\r\n\t\tobj.getMotion().setVelocity(v);\r\n\t\t\r\n\t\tobj.getMotion().kinematicUpdate();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tfloat x = obj.getMotion().getPosition().x;\r\n\t\tfloat y = obj.getMotion().getPosition().y;\r\n\t\tif(y <= turnCornerMin ) {\r\n\t\t\tbehavior.setDest(turnCornerMax,turnCornerMin);\r\n\t\t\t\t\r\n\t\t}\r\n\t\tif(x >= turnCornerMax) {\r\n\t\t\tbehavior.setDest(turnCornerMax, turnCornerMax);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif(y >= turnCornerMax) {\r\n\t\t\tbehavior.setDest(turnCornerMin, turnCornerMax);\r\n\t\t}\r\n\t\t\r\n\t\tif(x < turnCornerMin) {\r\n\t\t\treturn;\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\tobj.updateObjKinematics(x, y, obj.getMotion().getOrientation());\r\n\t}", "private void initializeElevatorMotor()\n {\n Rectangle base = new Rectangle(shaftWidth*.3, location, shaftWidth*.4, floorHeight*.8);\n Rectangle latch = new Rectangle(shaftWidth*.45, location-5, shaftWidth*.1, floorHeight*.2);\n\n elevator = Shape.union(base, latch);\n elevator.setFill(Color.valueOf(\"#C0C0C0\"));\n\n elevatorTranslate = 0;\n elevatorOffset = 0;\n elevatorSpeed = 20;\n\n motorTimeline = new Timeline(new KeyFrame(Duration.millis(elevatorSpeed), e -> {\n if(location+elevatorOffset <= shaftHeight-60 && location+elevatorOffset >= 10) {\n if(location <= destination && location >= destination-10)\n {\n// System.out.println(location + \" OF \" + (destination) + \" / \" + (destination-10) + \" \" + (10 - destination/floorHeight));\n// System.out.println(\"EARLY STOP\");\n motorTimeline.pause();\n }\n\n elevatorTranslate += elevatorOffset;\n location += elevatorOffset;\n\n elevator.setTranslateY(elevatorTranslate);\n frame.setTranslateY(elevatorTranslate);\n leftDoor.setTranslateY(elevatorTranslate);\n rightDoor.setTranslateY(elevatorTranslate);\n }\n else motorTimeline.pause();\n }));\n motorTimeline.setCycleCount(Animation.INDEFINITE);\n }", "private void createPosition() {\n\n switch (new Random().nextInt(4)) {\n\n case 0:\n sendString = enemyPositionX.nextInt(Window.WIDTH) + \":-90\";\n break;\n\n case 1:\n sendString = enemyPositionX.nextInt(Window.WIDTH) + \":\" + (Window.HEIGHT + 90);\n break;\n\n case 2:\n sendString = \"-90:\" + enemyPositionY.nextInt(Window.HEIGHT);\n break;\n\n case 3:\n sendString = (Window.WIDTH + 90) + \":\" + enemyPositionY.nextInt(Window.HEIGHT);\n break;\n }\n sendString += \":\" + new Random().nextInt(4);\n sendString += \":\" + new Random().nextInt(2);\n }" ]
[ "0.6967742", "0.67225474", "0.6664802", "0.66168475", "0.6456423", "0.634778", "0.6310302", "0.61561096", "0.614022", "0.6052253", "0.6027491", "0.60261947", "0.6024037", "0.59510034", "0.5917044", "0.58576137", "0.5847782", "0.57386494", "0.57386154", "0.5726277", "0.57099944", "0.5637264", "0.5605841", "0.5555035", "0.55505186", "0.5480735", "0.54690546", "0.54636735", "0.5461948", "0.544465", "0.54306537", "0.54221356", "0.5418529", "0.5417585", "0.5417267", "0.5401557", "0.5393303", "0.539223", "0.53918594", "0.5359653", "0.5351512", "0.5351003", "0.53408724", "0.5330066", "0.5312376", "0.53116995", "0.53041345", "0.5304112", "0.52994853", "0.52981997", "0.5294275", "0.5286148", "0.52859896", "0.52858466", "0.5281319", "0.5280631", "0.5270105", "0.5262105", "0.5257976", "0.5253201", "0.5246912", "0.52423525", "0.523808", "0.5236326", "0.5236006", "0.5235534", "0.5235373", "0.5232018", "0.523038", "0.5228156", "0.52192", "0.5211065", "0.5195632", "0.51923543", "0.5183353", "0.5180284", "0.5177222", "0.5175947", "0.51634204", "0.5162593", "0.5155028", "0.5154731", "0.51506674", "0.5149073", "0.51430047", "0.5142986", "0.5138634", "0.5136059", "0.51351434", "0.5133964", "0.51326215", "0.513224", "0.513071", "0.5129072", "0.5125256", "0.51196", "0.5119582", "0.51077676", "0.51044005", "0.5101177" ]
0.70508236
0
Clears the screen so that nothing is displayed
private void clear() { pstate.clear(); display.setLegend(""); ship = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clearScreen();", "public void clearScreen()\n {\n showText(\"\", 150, 175);\n List objects = getObjects(null);\n if(objects != null)\n {\n removeObjects(objects);\n }\n }", "public void clearScreen() \n\t{\n\t\tthis.myLineView.clearScreen();\n\t}", "void clear() {\n\t\tthis.theScreen.setColor(Preferences.COLOR_BACKGROUND);\n\t\tthis.theScreen.fillRect(0, 0, this.width, this.height);\n\t\tthis.theScreen.setColor(Preferences.TITLE_COLOR);\n\t\tthis.theScreen.drawRect(0, 0, this.width - 1,\n\t\t\t\tPreferences.GAMEBOARDHEIGHT - 1);\n\t}", "public static void clearScreen() {\r\n\t\tcreateDelay(700);\r\n\t\tcls();\r\n\t\tSystem.out.println(\"\\nProcessing...\");\r\n\t\tcreateDelay(500);\r\n\t\tcls();\r\n\t}", "public static void clearScreen()\r\n\t{\r\n\t\tSystem.out.println(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\");\r\n\t}", "private static void clearScreen() \n {\n Console c = System.console();\n if (c != null) \n {\n // Clear screen for the first time\n System.out.print(\"\\033[H\\033[2J\");\n System.out.flush();\n //c.writer().print(ESC + \"[2J\");\n //c.flush();\n\n // Clear the screen again and place the cursor in the top left\n System.out.print(\"\\033[H\\033[1;1H\");\n System.out.flush();\n //c.writer().print(ESC + \"[1;1H\");\n //c.flush();\n }\n }", "public void clearScreen() { \n\t System.out.print(\"\\033[H\\033[2J\"); \n\t System.out.flush(); \n\t }", "public void clear(){\n\t\tgraphics.setColor(Constants.COLOR_BACKGROUND);\n\t\tgraphics.fillRect(0, 0,setup.getFrameWidth()+12,setup.getFrameHeight()+12);\n\t\tdrawWindowSetup();\n\t}", "private static void clearScreen()\n {\n System.out.print('\\u000C');\n }", "private static void clearScreen() {\n\t\tSystem.out.println(\"\\033[H\\033[2J\"); \n\t\tSystem.out.flush();\n\t}", "public static void clearScreen() { \n \tSystem.out.print(\"\\033[H\\033[2J\"); \n \tSystem.out.flush();\n\t}", "@Override\n\tpublic void clearScreen() {\n\n\t\tmHighCounter.setText(R.string.zero);\n\t\tmHighMissCounter.setText(R.string.zero);\n\t\tmMedCounter.setText(R.string.zero);\n\t\tmMedMissCounter.setText(R.string.zero);\n\t\tmLowCounter.setText(R.string.zero);\n\t\tmLowMissCounter.setText(R.string.zero);\n\t}", "public static void clearScreen() {\n System.out.print(\"\\033[H\\033[2J\");\n System.out.flush();\n }", "public void clear()\n\t{\n\t\tgetGraphics().clearRect(0, 0, canvasWidth, canvasHeight);\n\t}", "@FXML\r\n private void clearScreen() {\n if(flag==1)txtDisplay.setText(\"\");\r\n }", "public static void clrscr() {\n try {\n if (System.getProperty(\"os.name\").contains(\"Windows\")) {\n new ProcessBuilder(\"cmd\", \"/c\", \"cls\").inheritIO().start().waitFor();\n } else {\n Runtime.getRuntime().exec(\"clear\");\n System.out.print(\"\\033[H\\033[2J\");\n System.out.flush();\n }\n } catch (IOException | InterruptedException ex) {\n System.out.println(\"Error while trying to clear the screen\");\n }\n }", "private void clearScreen(Graphics g) {\n g.setColor(0x21519c);\n g.fillRect(0, 0, UISettings.formWidth,UISettings.formHeight);\n }", "public void clear()\n {\n clear(BLACK);\n }", "public void clear() {\n\t\tdesktops.clear();\n\t}", "public static void clearScreen() { // funcao que limpa o ecrã \n System.out.println(\"\\033[H\\033[2J\");\n System.out.flush();\n }", "public void clear() {\n\t\tString cmd = null;\n\t\ttry {\n\t\t\tif (System.getProperty(\"os.name\").startsWith(\"Windows\"))\n\t\t\t\tcmd = \"cls\";\n\t\t\telse\n\t\t\t\tcmd = \"clear\";\n\t\t\tRuntime.getRuntime().exec(cmd);\n\t\t} catch (Exception ignore) {\n\t\t}\n\t}", "public void resetScreen(){\n\t\tGame_Map_Manager.infoVisible= false;\n\t\tGame_PauseMenu.actorManager.open = false;\n\t\tPlayerGoals.open = false;\n\t\tGame_Shop.actorManager.open = false;\n\t\tTrainDepotUI.actorManager.open = false;\n\t\tGameScreenUI.resourcebarexpanded =false;\n\t\tGoalMenu.open= false;\n\t\t\n\t\t//CARDS\n\t\tGame_CardHand.actorManager.open=false;\n\t\tGame_CardHand.actorManager.cardactors.clear();;\n\t\t\n\t\t//Map\n\t\tGame_StartingSequence.reset();\n\t\tGame_Map_Manager.resetMap();\n\t}", "@Override\n\tpublic void clear() {\n\n\t\tDisplay.findDisplay(uiThread).syncExec(new Runnable() {\n\n\t\t\tpublic void run() {\n\t\t\t\tclearInputs();\n\t\t\t\tsetDefaultValues();\n\t\t\t}\n\t\t});\n\n\t}", "void clear() {\n\t\tdispose();\n\t}", "public void clear()\n\t{\n\t\treadout.setText(\"\");\n\t\ttxtArea.setText(\"\");\n\t}", "public void clear()\r\n {\r\n throw new RuntimeException(\"Cannot modify the display data.\");\r\n }", "public void setScreenForGame(){\r\n screen.removeAll();\r\n screen.repaint();\r\n }", "public static void clearViewPort() {\n\t\tSensor.disposeAllSensors();\n\t\tGUIReferences.setConstructEnabled(true);\n\t\tTurnController.clearAll();\n\t\tGUIReferences.updateStatusBar();\n\t}", "public void clearGame() {\n\t\tthis.turnColor = null;\n\t\tthis.inPlay = false;\n\t\tthis.board = new Board();\n\t\tpieces.get(Chess.Color.WHITE).clear();\n\t\tpieces.get(Chess.Color.BLACK).clear();\n\t\tmoveStack.clear();\n\t}", "public void clear()\n\t{\n\t\tstatus.setTextFill(BLACK);\n\t\tstatus.setText(\"awaiting input...\");\n\t\tusername.setText(\"\");\n\t\taddress.setText(\"\");\n\t\tport.setText(\"\");\n\t}", "static void clearScreen() {\n System.out.println(\"Press \\\"ENTER\\\" to continue...\");\n Scanner scan= new Scanner(System.in);\n scan.nextLine();\n for (int i = 0; i < 50; ++i) System.out.println();\n }", "public void clear () {\n\t\treset();\n\t}", "private void clear() {\n\t\tSystem.out.println(\"Calling clear\");\n\t}", "public void clear() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tclearEntries();\r\n\t\t\r\n\t}", "protected void clear() {\n \twhile (!stack.empty()) {\n \t\tstack.pop();\n \t}\n \tcurrent = 0;\n \tshow(current);\n }", "static void clear_console_screen()\n\t{\n\t\tfor (int lines=0; lines<200; lines++)\n\t\t{\n\t\t\tSystem.out.println(\" \");\n\t\t}// end for (int lines=0; lines<200; lines++)\n\t\t\n\t}", "public void removeAllScreens() {\n Gdx.app.log(\"TowerDefence::removeAllScreens()\", \"--\");\n if (screensArray != null) {\n// for(Screen screen : screensArray) {\n// screen.dispose(); // Дич ебаная. с этими скринами у нас точно какие то проблемы...\n// }\n screensArray.clear();\n// int size = screensArray.size;\n// if (size > 0) {\n// for (int i = size - 1; i >= 0; i--) {\n// Screen screen = screensArray.get(i);\n// if (screen != null) {\n//// screen.hide();\n// screensArray.removeIndex(size - 1);\n// }\n// }\n// }\n }\n }", "protected void clearToBack()\n {\n\tGraphics g = getGraphics();\n\tsetRenderColor(g,getBackground());\n\trenderFilledRect(g,0,0,width,height);\n }", "public void clear() {\n doClear( false );\n }", "void clearCanvasAndDraw()\n {\n \tlauncher.clearRect(0, 0, launcherCanvas.getWidth(), launcherCanvas.getHeight());\n \tdrawLauncher(angle);\n \tcanvas.clearRect(0, 0, mainCanvas.getWidth(), mainCanvas.getHeight());\n \tdrawSky();\n \tdrawGrass();\n }", "public static void clear(){\n System.out.print(\"\\033[H\\033[2J\");\n System.out.flush(); // flushes the stream\n }", "public void setClearScreen(boolean state) {\r\n\t\tthis.clearScreen=state;\r\n\t}", "public static void clear() {\n\t\tmouseDelta.set(0, 0);\r\n\t\tmouseDeltaNorm.set(0, 0);\r\n\t\tmouseScrollDirection = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < keys.length; i++) {\r\n\t\t\tkeys[i] = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < buttonsClicked.length; i++) {\r\n\t\t\tbuttonsClicked[i] = false;\r\n\t\t}\r\n\t}", "public void clear() {\r\n\t\tdisplayEntries.clear();\r\n\t\tupdate();\r\n\t}", "public void clearCanvas() {\n \tgc.setFill(Color.BLACK);\r\n //\tSystem.out.println(xCanvasSize+\" \"+ yCanvasSize);\r\n\t\tgc.fillRect(0, 0, xCanvasSize, yCanvasSize);}", "public void clear() {\r\n\tcount = 0;\r\n isDrawn = false;\r\n repaint();\r\n }", "public void clear(){\r\n canvas.getGraphicsContext2D().clearRect(canvas.getWidth(),canvas.getHeight(),1,1);\r\n pane.getChildren().clear();\r\n }", "public static void clrscr() {\n try {\r\n if (System.getProperty(\"os.name\").contains(\"Windows\")) {\r\n new ProcessBuilder(\"cmd\", \"/c\", \"cls\").inheritIO().start().waitFor();\r\n } else {\r\n Runtime.getRuntime().exec(\"clear\");\r\n }\r\n } catch (IOException | InterruptedException ex) {\r\n }\r\n }", "public final void clear() {\n clear(true);\n }", "public void clearOutput ()\n\t{\n\t\toutputArea.setText (\"\");\n\t}", "@Override\n\tpublic void dispose() { if(screen != null) screen.hide(); }", "public double clearScreen() {\n\t\tdouble dist = this.moveTo(0, 0);\n\t\txPos = startingX;\n\t\tyPos = startingY;\n\t\torientation = 0;\n\t\tpathList.clear();\n\t\tscreen.updateBox();\n\t\treturn dist;\n\t}", "public void setEmptyScreen() {\n emptyText.setVisibility(View.VISIBLE);\n todoRecyclerView.setVisibility(View.GONE);\n }", "public Builder clearScreenMode() {\n \n screenMode_ = 0;\n onChanged();\n return this;\n }", "public void hideScreen() {\n\t}", "static void clrscr()\n {\n // ... wrong.\n \n // clearing the screen for a console is system specific.\n String osName = System.getProperty(\"os.name\");\n \n // if it's Windows, simply doing Runtime.getRuntime().exec(\"cls\") doesn't work since \"cls\" is not an executible\n // (getRuntime() runs an executible on the given runtime)\n if (osName.startsWith(\"Windows\"))\n {\n // instead, make a process that refers to the current cmd window and make that do a \"cls\", like so:\n try\n {\n new ProcessBuilder(\"cmd\", \"/c\", \"cls\").inheritIO().start().waitFor();\n }\n // catch any exceptions if thrown (should be an IOException)\n catch (Exception e)\n {\n // print detailed info that helps debug said exception\n e.printStackTrace();\n }\n }\n // if its a Unix-like shell, pass an ANSI escape-code that's composed of\n // \\033 (octal) => ESC as an ASCII character (== \\0x1b (hexadecimal) == \\27 (decimal))\n // [2J => clear the screen, bring position to top of console window\n // [H => display the prompt (sort of) \n else if (osName.contains(\"nix\") || osName.contains(\"nux\") || osName.contains(\"aix\"))\n {\n System.out.print(\"\\033[2J\\033[H\");\n }\n else // do something weird ... which works, somewhat\n {\n System.out.println(\"No screen clearing on this console. Hold enter for some time and then type something.\");\n // inundates whitespace, and any other input isn't stored\n input.next();\n }\n }", "@Override\n public void clear() {\n setSize(0);\n }", "public void clear() {\r\n myCommandLine.clear();\r\n inputPositionX.clear();\r\n inputPositionY.clear();\r\n creatureHomeX = creatureHomeY = 0;\r\n myModelTokenIndex = 0;\r\n commandHistory.getMenus().get(0).getItems().clear();\r\n continuing = false;\r\n if (myAnimation != null) {\r\n myAnimation.stop();\r\n }\r\n }", "public void clearCanvas() {\n bitmap = Bitmap.createBitmap(display.getWidth(), display.getHeight(), Bitmap.Config.ARGB_4444);\n canvas.setBitmap(bitmap);\n mCurrentPathIndex = 0;\n invalidate();\n if (mListener != null) {\n mListener.pathCancelled();\n }\n }", "public void clearPressed() {\n PresentationCtrl.getInstance().clearHistory();\n refreshPressed();\n }", "public int clearScreen () {\n int distance = home();\n myLine.clear();\n return distance;\n }", "public void clear() {\n\t\t// Do nothing\n\t}", "public void clear()\r\n {\r\n \tdisplayUserInput = \" \";\r\n \t\r\n }", "public void clearGame() {\n //loop through piece array erase pieces\n\n //clear piece array\n for (int i = 0; i < 64; i++) {\n ChessBoard.pieces[i] = null;\n }\n\n //remove all piece components from chessboard\n chessboard.removeAll();\n \n //clear game log\n gamelog.clearLog();\n \n //refresh graphics\n frame.update(frame.getGraphics());\n }", "@Override\n public void clear() {\n beginMyTurn();\n }", "public void clear() {\n doClear();\n }", "public void reset() {\n this.displayHasContent = false;\n this.obscured = false;\n this.syswin = false;\n this.preferredRefreshRate = 0.0f;\n this.preferredModeId = 0;\n }", "public void clearAll()\n\t{\n\t\tClearMarks();\n\t\tpop = null;\n\t\tpopSequence = null;\n\t\ti1.killRoi();\n\t\tic.removeMouseListener(this);\n\t\tic.removeKeyListener(this);\n\t\tStackWindow sw1 = new StackWindow(i1, ic);\n\t\ti1.setWindow(sw1);\n\t\tdispose();\n\t}", "private void clear() {\n\t\ttxtId.setText(\"\");\n\t\ttxtAlert.setText(\"\");\n\t\ttxtNbMax.setText(\"\");\n\t\t\n\t}", "public void clear_console() {\n\t\tfor(int i = 0;i<50;i++) {\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public static void clearScreen(int num) {\n for (int i = 0; i < num; i++) {\n System.out.println(); \n System.out.flush();\n } \n }", "private void clearView() {\n\t\tif (this.viewer != null) {\n\t\t\tthis.viewer.getTable().clearAll();\n\t\t}\n\t\tif (this.iException != null) {\n\t\t\tthis.iException.setText(\"\");\n\t\t}\n\t\tif (this.iBrowser != null) {\n\t\t\tthis.iBrowser.setText(iNoHtmlLog);\n\t\t}\n\t}", "private void clearAllUi() {\n /* Clear notification fields. */\n mTxtAuthentication.setText(R.string.noData);\n\n /* Clear card reader's response fields. */\n clearResponseUi();\n }", "public void clearAllGraphics()\r\n {\r\n graphics.clear();\r\n fullExtent = null;\r\n }", "private void clear() {\r\n\t\tareaTexto.setText(\"\");\r\n\t}", "public void clear(){\n\t\tclear(0);\n\t}", "public void clearTerminal(){\n\n System.out.println(\"\\033[2J\\033[1;1H\");\n\n }", "void clear() ;", "private void clearSurface(SurfaceHolder holder) {\n\t\tSurface surface = holder.getSurface();\n\t\tEglCore eglCore = new EglCore();\n\t\tWindowSurface win = new WindowSurface(eglCore, surface, false);\n\t\twin.makeCurrent();\n\t\tGLES20.glClearColor(0, 0, 0, 0);\n\t\tGLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);\n\t\twin.swapBuffers();\n\t\twin.release();\n\t\teglCore.release();\n\t}", "public void clear() {\r\n init();\r\n }", "public void clearCanvas() {\n\n path_draw.reset();\n\n invalidate();\n\n }", "public void clear() {\n\t\ttextArea.setText(\"\");\n\t}", "public void clear() {\n up = false;\n down = false;\n left = false;\n right = false;\n }", "private void clearCanvas() {\n updateImageSize(mScale);\n }", "public void clearConsole() {\n List<SWTBotView> allViews = bot.views();\n for (SWTBotView view : allViews) {\n if (\"Console\".equals(view.getTitle())) {\n view.show();\n if (!view.bot().styledText().getText().isEmpty()) {\n // use the toolbar button instead of .bot().styledText().setText(\"\")\n // which does not seem to work synchronously\n view.toolbarButton(\"Clear Console\").click();\n }\n return;\n }\n }\n }", "public void clearCommand() {\r\n _board = new Board();\r\n _playing = false;\r\n }", "public void clear()\n {\n }", "private void clear() {\n }", "private void clearBackground() {\r\n\t\tg.setColor(Color.WHITE);\r\n\t\tg.fillRect(0,0, TetrisGame.PANEL_WIDTH * TetrisGame.SQUARE_LENGTH,\r\n\t\t\t\t TetrisGame.PANEL_HEIGHT * TetrisGame.SQUARE_LENGTH);\r\n\t}", "public void clear() {\n if (Platform.isFxApplicationThread()) {\n clearImage();\n } else {\n Platform.runLater(() -> clearImage());\n }\n }", "void reset() {\n setVisible(false);\n myJumpedOver = false;\n }", "private void clear() {//将文本框等状态置零\n\t\tusername.setText(\"\");\n\t\tpass.setText(\"\");\n\t\tname.setText(\"\");\n\t\tsex1.setSelected(true);\n\t\ttel.setText(\"\");\n\t\taddr.setText(\"\");\n\t\trole.setSelectedIndex(0);\n\t\tusername.grabFocus();\n\t}", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();" ]
[ "0.8798866", "0.878815", "0.84344447", "0.8301078", "0.81875914", "0.8113565", "0.7965721", "0.79279387", "0.78452843", "0.7842938", "0.78217465", "0.7815092", "0.7807965", "0.77314097", "0.7706308", "0.77004915", "0.7684236", "0.7670814", "0.75632256", "0.75502104", "0.7522265", "0.741771", "0.73941547", "0.73830456", "0.7325102", "0.7295295", "0.7253985", "0.7235484", "0.719872", "0.71786225", "0.7161804", "0.71519643", "0.7144947", "0.71426904", "0.7141975", "0.71377033", "0.71200925", "0.7117895", "0.7101161", "0.7093319", "0.70911527", "0.7087862", "0.7085828", "0.7078387", "0.7070471", "0.7057735", "0.7057006", "0.7048045", "0.70129156", "0.70116687", "0.6990525", "0.69900227", "0.6977822", "0.6977706", "0.6972806", "0.6966532", "0.6963986", "0.6962646", "0.6925335", "0.69219005", "0.6916365", "0.6913199", "0.6908876", "0.6897368", "0.68954045", "0.68933177", "0.6890545", "0.6888435", "0.68728065", "0.6867582", "0.68660843", "0.685431", "0.68474466", "0.68455815", "0.68435836", "0.6839525", "0.6826626", "0.6825745", "0.6822925", "0.68180925", "0.6806177", "0.68034667", "0.67997205", "0.6788336", "0.6783427", "0.6775776", "0.67722976", "0.6764029", "0.67515534", "0.6748501", "0.6744277", "0.6736448", "0.6735076", "0.6734311", "0.6734311", "0.6734311", "0.6734311", "0.6734311", "0.6734311", "0.6734311" ]
0.6750913
89
Sets things up and begins a new game.
private void initialScreen() { // Clear the screen clear(); // Place four asteroids placeAsteroids(); // Place the ship placeShip(); // Reset statistics lives = 3; display.setLives(lives); numLevel = 1; display.setLevel(numLevel); display.setScore(0); speed = 3; // Start listening to events display.removeKeyListener(this); display.addKeyListener(this); // Give focus to the game screen display.requestFocusInWindow(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startGame() {\r\n this.setupGame();\r\n }", "private void startGame() {\n\t\tmain.next_module = new Game(main, inputs, gameSelectionData);\n\t}", "void newGame() {\n logger.log(\"New game starting.\");\n logger.log(divider);\n\n\n // Create the deck.\n createDeck();\n logger.log(\"Deck loaded: \" + deck.toString());\n\t logger.log(divider);\n\n\n // Shuffle the deck.\n shuffleDeck();\n logger.log(\"Deck shuffled: \" + deck.toString());\n logger.log(divider);\n\n // Create the players.\n createPlayers();\n setGameState(GameState.PLAYERS_SPAWNED);\n\n // Deal cards to players' decks.\n deal();\n for (Player player : players) {\n logger.log(\"Hand: \" + player);\n }\n \n\n // Randomly select the active player for the first round.\n selectRandomPlayer();\n\n setGameState(GameState.NEW_GAME_INITIALISED);\n }", "public void startGame() {\n\t\tinitChips();\n\t\tassignAndStartInitialProjects();\n\t}", "public void newGame(){\n\t\tsoundMan.BackgroundMusic1();\n\n\t\tstatus.setGameStarting(true);\n\n\t\t// init game variables\n\t\tbullets = new ArrayList<Bullet>();\n\n\t\tstatus.setShipsLeft(8);\n\t\tstatus.setGameOver(false);\n\n\t\tif (!status.getNewLevel()) {\n\t\t\tstatus.setAsteroidsDestroyed(0);\n\t\t}\n\n\t\tstatus.setNewAsteroid(false);\n\n\t\t// init the ship and the asteroid\n\t\tnewShip(gameScreen);\n\t\tnewAsteroid(gameScreen);\n\n\t\t// prepare game screen\n\t\tgameScreen.doNewGame();\n\t\tsoundMan.StopMusic2();\n\t\tsoundMan.StopMusic3();\n\t\tsoundMan.StopMusic4();\n\t\tsoundMan.StopMusic5();\n\t\tsoundMan.StopMusic6();\n\t\t// delay to display \"Get Ready\" message for 1.5 seconds\n\t\tTimer timer = new Timer(1500, new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tstatus.setGameStarting(false);\n\t\t\t\tstatus.setGameStarted(true);\t\n\n\t\t\t\tstatus.setLevel(1);\n\t\t\t\tstatus.setNumLevel(1);\n\t\t\t\tstatus.setScore(0);\n\t\t\t\tstatus.setYouWin(false);\n\t\t\t\tstatus.setBossLife(0);\n\t\t\t}\n\t\t});\n\t\ttimer.setRepeats(false);\n\t\ttimer.start();\n\t}", "private void startGame() {\r\n setGrid();\r\n setSnake();\r\n newPowerUp();\r\n timer.start();\r\n }", "public void setUpGame() {\n\t\tGameID = sql.getTheCurrentGameID() + 1;\r\n\t\tSystem.err.println(GameID);\r\n\t\ttheModel.shuffleDeck();\r\n\t\ttheModel.createPlayers();\r\n\t\ttheModel.displayTopCard();\r\n\t\t// theModel.chooseFirstActivePlayer();\r\n\t}", "public void start() {\n ArrayList<String> names = new ArrayList<>();\n game.initialize(names);\n //game.play(this.mainPkmn, this.attack);\n\n }", "public void startGame() {\n\t\ttank1.create(20, 530, 0, 0);\n\t\ttank1.setDefaults();\n\t\ttank2.create(960, 530, 0, 0);\n\t\ttank2.setDefaults();\n\t\tobjects.add(tank1);\n\t\tobjects.add(tank2);\n\t\tground = new Groundmod2((int) (Math.random() * 4));\n\t\tturn = Turn.PLAYER1;\n\t\tgrabFocus();\n\t}", "public void startGame(){\n\t\tSystem.out.println(\"UNI: nas2180\\n\" +\n\t\t\t\t\"Hello, lets play Rock Paper Scissors Lizard Spock!\\n\");\n\t\tSystem.out.println(\"Rules:\\n Scissors cuts Paper\\n \" +\n\t\t\t\t\"Paper covers Rock\\n \" +\n\t\t\t\t\"Rock crushes Lizard\\n \" +\n\t\t\t\t\"Lizard poisons Spock\\n \" +\n\t\t\t\t\"Spock smashes Scissors\\n \" +\n\t\t\t\t\"Scissors decapitates Lizard\\n \" +\n\t\t\t\t\"Lizard eats Paper\\n \" +\n\t\t\t\t\"Paper disproves Spock\\n \" +\n\t\t\t\t\"Spock vaporizes Rock\\n \" +\n\t\t\t\t\"(and as it always has) Rock crushes Scissors\\n\");\n\t\tthisGame = new GameResult();\n\t\tplayRound();\n\t}", "public void gameSetUp() {\n if (!running.get()) return;\n if (!setup.compareAndSet(true, false)) return;\n ArrayList<GodController> controllers = new ArrayList<GodController>();\n controllers.add(new ApolloController(this));\n controllers.add(new ArtemisController(this));\n controllers.add(new AthenaController(this));\n controllers.add(new AtlasController(this));\n controllers.add(new DemeterController(this));\n controllers.add(new HephaestusController(this));\n controllers.add(new HestiaController(this));\n controllers.add(new LimusController(this));\n controllers.add(new MedusaController(this));\n controllers.add(new MinotaurController(this));\n controllers.add(new PanController(this));\n controllers.add(new PrometheusController(this));\n controllers.add(new TritonController(this));\n controllers.add(new ZeusController(this));\n\n Deck deck = game.getDeck();\n\n for (GodController godController : controllers) {\n deck.addCard(godController.generateCard());\n }\n\n players = game.getPlayers();\n\n try {\n broadcastGameInfo(\"gameSetup\");\n broadcastMessage(\"Game started!\");\n broadcastMessage(\"Picking cards...\");\n pickCards();\n broadcastGameInfo(\"boardSetup\");\n chooseStartPlayer();\n placeWorkers();\n\n broadcastGameInfo(\"gameStart\");\n playGame();\n } catch (IOExceptionFromController e) {\n handleDisconnection(e.getController());\n }\n }", "public void startNewGame()\n {\n // Display the Banner Page.\n \n System.out.println(\"\\nWelcome to the city of Aaron.\");\n \n // Prompt for and get the user’s name.\n String name;\n System.out.println(\"\\nPlease type in your first name: \");\n name = keyboard.next();\n\n // Call the createNewGame() method in the GameControl class\n \n GameControl.createNewGame(name);\n\n // Display a welcome message\n System.out.println(\"Welcome \" + name + \" have fun!!!\");\n \n //Call the GameMenuView\n GameMenuView gmv = new GameMenuView();\n gmv.displayMenu();\n }", "private void setUpGame() {\n\t\tsetUpBlocks();\n\t\tsetUpBall();\n\t\tsetUpPaddle();\n\t\taddMouseListeners();\n\t}", "public void startGame() {\n\t\timages = new ImageContainer();\n\t\ttimer = new Timer(15, this);\n\t\ttimer.setRepeats(true);\n\t\tlevelStartTimer = new Timer(2000, this);\n\t\thighScore = new HighScore();\n\t\tpacmanAnimation = new PacmanAnimation(images.pacman, new int[] { 3, 2,\n\t\t\t\t0, 1, 2 });\n\t\tactualLevel = 1;\n\t\tinitNewLevel();\n\t}", "public static void setupNewGamePlay() {\r\n\t\tSTATUS = Gamestatus.PREPARED;\r\n\t\tGameplay.getInstance().start();\r\n\t\tgui.setMenu(new GameplayMenu(), true);\r\n\t}", "public void InitGame(){\n System.out.format(\"New game initiated ...\");\n Game game = new Game(client_List);\n SetGame(game);\n }", "public void startGame() {\n\t\t//Start the rendering first\n\t\tgetRenderer().startRendering();\n\t\t\n\t\t//Start the game thread after that.\n\t\tgetGameThread().start();\n\t}", "public static void startGame()\r\n\t{\r\n\t\tnew ModeFrame();\r\n\t}", "private void newGame()\r\n {\r\n //close the current screen\r\n screen.dispose();\r\n //start back at the set up menu\r\n SetupView screen = new SetupView();\r\n SetupController controller = new SetupController(screen);\r\n screen.registerObserver(controller);\r\n }", "private void startGame() {\r\n\t\tthis.gameMap.startGame();\r\n\t}", "void startGame(int gameId) {\n game = new Game(gameId);\n }", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "public SnakeGame() {\n\t\t// game initialy not running\n\t\tgameRunning = false; \n\t\t// init our GUI\n\t\tinitGUI();\n\t}", "public void newGame() {\n init();\n updateScoreBoard();\n Toast.makeText(getContext(), \"New Game started\", Toast.LENGTH_LONG).show();\n }", "public void newGame()\n\t{\n\t\tmap = new World(3, viewSize, playerFactions);\n\t\tview = new WorldView(map, viewSize, this);\n\t\tbar = new Sidebar(map, barSize);\n\t}", "private void newGame() {\n\t\t// Firstly, we spawn the player.\n\t\tplayer = new AsteroidsPlayer(GameObject.ROOT, this);\n\t\tspawnPlayer();\n\n\t\t// Make sure that no other objects exist.\n\t\tasteroids.clear();\n\t\tlaserShots.clear();\n\t\totherObjects.clear();\n\n\t\t// Then we create the score text using two strings.\n\t\tAsteroidsString scoreText = new AsteroidsString(GameObject.ROOT, \"SCORE\", true, false);\n\t\tscoreText.translate(new Vector3(-cameraZoom, cameraZoom - 1));\n\t\totherObjects.add(scoreText);\n\t\tscoreString = new AsteroidsString(GameObject.ROOT, Integer.toString(score), true, false);\n\t\tscoreString.translate(new Vector3(-cameraZoom, cameraZoom - 3));\n\t\totherObjects.add(scoreString);\n\n\t\t// We set our starting lives to 3.\n\t\tlives = 3;\n\n\t\t//And we also create the lives text.\n\t\tAsteroidsString livesText = new AsteroidsString(GameObject.ROOT, \"LIVES\", false, true);\n\t\tlivesText.translate(new Vector3(cameraZoom, cameraZoom - 1));\n\t\totherObjects.add(livesText);\n\t\tlivesString = new AsteroidsString(GameObject.ROOT, Integer.toString(lives), false, true);\n\t\tlivesString.translate(new Vector3(cameraZoom, cameraZoom - 3));\n\t\totherObjects.add(livesString);\n\n\t\t// Then we just set the delay to the first asteroid.\n\t\ttimeToNextAsteroid = asteroidDelay;\n\t}", "public void startProgram()\r\n\t{\r\n\t\tview.displayPlayerNames();\r\n\t\tview.loadGameData();\r\n\t\tview.displayGame();\r\n\t}", "public void startGame() \n\t{\n\t\tgamePanel.startGame();\n\t}", "void newGame() {\n\t\tstate = new model.State () ; \n\t\tif(host != null ) host.show(state) ; \n\t}", "public void gameStarted() {\n\t\treset();\n\t\tSystem.out.println(\"Game Started\");\n\n\t\t// allow me to manually control units during the game\n\t\tbwapi.enableUserInput();\n\t\t\n\t\t// set game speed to 30 (0 is the fastest. Tournament speed is 20)\n\t\t// You can also change the game speed from within the game by \"/speed X\" command.\n\t\tbwapi.setGameSpeed(20);\n\t\t\n\t\t// analyze the map\n\t\tbwapi.loadMapData(true);\n\t\t\n\n\t\t// This is called at the beginning of the game. You can \n\t\t// initialize some data structures (or do something similar) \n\t\t// if needed. For example, you should maintain a memory of seen \n\t\t// enemy buildings.\n\t\tbwapi.printText(\"This map is called \"+bwapi.getMap().getName());\n\t\tbwapi.printText(\"Enemy race ID: \"+String.valueOf(bwapi.getEnemies().get(0).getRaceID()));\t// Z=0,T=1,P=2\n\t\t\n\t\tmanagers.put(ArmyManager.class.getSimpleName(), ArmyManager.getInstance());\n\t\tmanagers.put(BuildManager.class.getSimpleName(), BuildManager.getInstance());\n\t\tmanagers.put(ResourceManager.class.getSimpleName(), ResourceManager.getInstance());\n\t\tmanagers.put(ScoutManager.class.getSimpleName(), ScoutManager.getInstance());\n\t\tmanagers.put(TrashManager.class.getSimpleName(), TrashManager.getInstance());\n\t\tmanagers.put(UnitManager.class.getSimpleName(), UnitManager.getInstance());\n\t\tfor (Manager manager : managers.values())\n\t\t\tmanager.reset();\n\t}", "public void initGame() {\n this.game = new Game();\n }", "public void run() {\n\t\tprepareVariables(true);\n\t\t\n\t\t// Prepares Map Tables for Song and Key Info.\n\t\tprepareTables();\n\t\t\n\t\t// Selects a Random Song.\n\t\tchooseSong(rgen.nextInt(0, songlist.size()-1));\n\t\t\n\t\t// Generates layout.\n\t\tgenerateLabels();\n\t\tgenerateLines();\n\t\t\n\t\t// Listeners\n\t\taddMouseListeners();\n\t\taddKeyListeners();\n\t\t\n\t\t// Game Starts\n\t\tplayGame();\n\t}", "private void gameSetup(){\n\t\tboard.boardSetup();\n\t\tdirectionArray = setUpDirectionArray();\n\t\tcurrentPlayer = SharedConstants.PlayableItem.BLACK;\n\t\tcurrentState = SharedConstants.GameStatus.PLAYING;\n\t\tgameStateModel = new GameSateModel();\n\t\tloadGame = new GameStateRetriever();\n\t\tsaveGame = new GameStateWrter(connectFourModel.getGameStateModel());\n\t}", "public void startNewGame() {\n\t\tif (this.currentPlayer != -1) {\n\t\t\tthrow new RuntimeException(\"The game has already started.\");\n\t\t}\n\n\t\tif (this.players.size() == 0) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"The game cannot be started with a single player\");\n\t\t}\n\n\t\tthis.currentPlayer = 0;\n\n\t\tstartTurn();\n\t}", "public void newGame()\n\t{\n\t\tplanet.setLevel(0);\n\t\tship.resetScore();\n\t\tstopThreads();\n\t\tplanet = new Planet(750,600);\n\t\tship = new Ship(20.0,750,600,planet);\n\t\tbuttonPanel.update(ship,planet);\n\t\tgamePanel.update(ship,planet);\n\n\t\trestartThreads();\n\t}", "private void startNewGame( ){\n\n mGame.clearBoard();\n mGameOver = false;\n\n // Reset all buttons\n for (int i = 0; i < mBoardButtons.length; i++) {\n mBoardButtons[i].setText(\"\");\n mBoardButtons[i].setEnabled(true);\n mBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n }\n // Human goes first\n mDiffTextView.setText(mGame.dificult);\n mInfoTextView.setText(\"You go first.\");\n\n }", "private void startGame() {\n\t\tentities.clear();\n\t\tinitEntities();\n\t\t\n\t\t// blank out any keyboard settings we might currently have\n\t\tleftPressed = false;\n\t\trightPressed = false;\n\t\tfirePressed = false;\n\t}", "private void startNewGame(Graphics g){\n\t\tclearBoard(g);\n\t\tb.init();\n\t\tgameStarted = true;\n\t\tgameOver = false;\n\t}", "public void initialise_new_game() {\n\n data.read_from_file(\"maxus2.txt\");\n\n mySound.initialise();\n\n pacman.init();\n ghost.init();\n\n score.initialise();\n }", "public void startGame() {\n\t\t\n\t\tPlayer p1;\n\t\tPlayer p2;\n\t\t\n\t\tif(player1.getSelectionModel().getSelectedItem().equals(_HUMAN)) {\n\t\t\tp1 = new Human(1, main);\n\t\t}\n\t\telse {\n\t\t\tString difficulty = player1Diff.getSelectionModel().getSelectedItem();\n\t\t\t\n\t\t\tint diff = difficulty.equals(_DIFFICULTY1) ? 1 : difficulty.equals(_DIFFICULTY2) ? 2 : 3;\n\t\t\t\n\t\t\tp1 = new AI(1, diff, main);\n\t\t}\n\t\t\n\t\t\n\t\tif(player2.getSelectionModel().getSelectedItem().equals(_HUMAN)) {\n\t\t\tp2 = new Human(2, main);\n\t\t}\n\t\telse {\n\t\t\tString difficulty = player2Diff.getSelectionModel().getSelectedItem();\n\t\t\t\n\t\t\tint diff = difficulty.equals(_DIFFICULTY1) ? 1 : difficulty.equals(_DIFFICULTY2) ? 2 : 3;\n\t\t\t\n\t\t\tp2 = new AI(2, diff, main);\n\t\t}\n\t\t\n\t\t\n\t\tmain.startGame(p1, p2);\n\t\t\n\t}", "public void newGame() {\r\n\r\n gameObjects.newGame();\r\n\r\n // Reset the mScore\r\n playState.mScore = 0;\r\n\r\n // Setup mNextFrameTime so an update can triggered\r\n mNextFrameTime = System.currentTimeMillis();\r\n }", "public void startApplication() {\n\t\tgameView = new GameGUI(this);\n\t\t\n\t\t/*\n\t\t * Create bonus GUI now.\n\t\t * TODO: Use swing worker thread to create bonus GUI\n\t\t * \t\t that way if GUI had more bells and whistles to it\n\t\t * \t\t the bonus GUI creation wouldn't take up processing time\n\t\t * \t\t on the main thread.\n\t\t */\n\t\tcreateBonusGUI();\n\t\t\n\t\t//GUI created and ready to show to the user\n\t\tgameView.allowVisibility();\n\t\tGameSounds.startBackgroundMusic();\n\t}", "public void start() {\n\t\t// initialize stuff\n\t\tinitGL();\n\t\tinit();\n\t\t\n\t\t// main game loop\n\t\twhile (true) {\n\t\t\t// display the title screen\n\t\t\tshowTitleScreen();\n\t\t\t\n\t\t\twhile (!gameOver) {\n\t\t\t\tupdateDelta();\n\t\t\t\trender();\n\t\t\t\tpollInput();\n\t\t\t\tupdate();\n\t\t\t\tupdateDisplay();\n\t\t\t}\n\t\t\t// Game Over\n\t\t\ttry {\n\t\t\t\tThread.sleep(2500);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void startNewGame();", "public final void start() {\n logger.info(\"Application started.\");\n try {\n getAttributes();\n\n initSystem();\n\n assertDisplayCreated();\n\n timer = Timer.getTimer();\n \n initGame();\n\n //main loop\n while (!finished && !display.isClosing()) {\n //determine time elapsed since last frame\n updateTime();\n\n //handle input events prior to updating the scene\n // - some applications may want to put this into update of the game state\n InputSystem.update();\n\n //update game state, pass amount of elapsed time\n update(frametime);\n\n //render, do not use interpolation parameter\n render(-1.0f);\n\n //swap buffers\n display.getRenderer().displayBackBuffer();\n\n Thread.yield();\n }\n } catch (Throwable t) {\n logger.logp(Level.SEVERE, this.getClass().toString(), \"start()\", \"Exception in game loop\", t);\n } finally {\n cleanup();\n }\n logger.info(\"Application ending.\");\n\n if (display != null) {\n display.reset();\n }\n quit();\n }", "private void newGame ()\n {\n this.game.abort ();\n try\n {\n Thread.sleep(50);\n }catch (InterruptedException e)\n { \n Logger.getLogger(AsteroidsFrame.class.getName()).log(Level.SEVERE, \"Could not sleep before initialing a new game.\");\n }\n this.game.initGameData ();\n }", "private void prepareGame()\n {\n Rocket rocket = new Rocket();\n \n scoreCounter = new Counter(\"Score: \");\n \n addObject(rocket, getWidth()/2 + 100, getHeight()/2);\n \n addObject(scoreCounter, 60, 480);\n \n //TODO (69): Make a method call to addAsteroids that uses your constant for the number of asteroids\n addAsteroids(START_ASTEROIDS);\n }", "public void gameInit() {\n lobbyRoom.sendPortToAll();\n lobbyRoom.sendPlayers(game.getCars());\n lobbyRoom.sendTrack(game.getTrack());\n lobbyRoom.sendPowerupManager(game.getManager());\n this.running = true;\n }", "public void startNewGame() {\n numOfTurnsLeft = NUMBER_OF_TURNS_ALLOWED;\n decodingBoard.clearBoard();\n }", "void initializeGame() {\n // Initialize players\n // Put the pieces on the board\n }", "public Game() \n {\n parser = new Parser();\n name = new String();\n player = new Player();\n ai = new AI();\n createRooms();\n rand = -1;\n enemyPresent = false;\n wantToQuit = false;\n alive = true;\n createItems();\n createWeapons();\n createEnemy();\n setEnemy();\n setItems();\n setWeapons();\n setExits();\n }", "public void createGame()\n {\n //call Client Controller's setState method with\n //a parameter of new ClientLobbyState()\n clientController.startMultiPlayerGame(\"GameLobby\");\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tGameGrafic game = null;\r\n\t\t\t\tGameState state = new GameState();\r\n\t\t\t\t// if (opt == 2) {\r\n\t\t\t\t// game = SaveGameOptions.load();\r\n\t\t\t\t// } else {\r\n\t\t\t\tgame = new GameGrafic(state);\r\n\t\t\t\t// }\r\n\r\n\t\t\t\tif (game != null) {\r\n\t\t\t\t\tgame.start();\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "@Override\n protected void initGame() {\n getGameWorld().setEntityFactory(new PlatformerFactory());\n getGameWorld().setLevelFromMap(\"Platformergame1.json\");\n\n // Sets spawnloction of the player\n player = getGameWorld().spawn(\"player\", 50, 50);\n }", "public void start_game() throws IOException, JAXBException {\n savetoxml();\n logger.trace(\"starting the game now...\");\n primarystage.setResizable(false);\n primarystage.setScene(game_scene);\n primarystage.show();\n\n }", "public void startGame() {\n\t\tfor(Chess.RowConfiguration rowConfiguration : Chess.getRowConfigurations()) {\n\t\t\tint row = rowConfiguration.row;\n\t\t\tClass[] pieceClasses = rowConfiguration.pieces;\n\t\t\tChess.Color sideColor = rowConfiguration.sideColor;\n\n\t\t\tfor(int col = 0; col < Chess.NUM_COLS; col++) {\n\t\t\t\taddPiece(pieceClasses[col], sideColor, board.getSpot(row, col));\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.inPlay = true;\n\t\t\n\t\tstartNewTurn();\n\t\t\n\t\tif(eventListener != null) {\n\t\t\teventListener.onGameStarted();\n\t\t}\n\t}", "public void setupGame(boolean cl) {\n currentScore = 0;\n GameWorldGenerator.generateWorld(this);\n setup = new GameSetup(this, cl);\n if (!cl) {\n new SetupWindow(this);\n }\n }", "void startGame();", "void startGame();", "void startGame();", "public void initGame() {\n // clear the board contents\n board.init();\n // CROSS speelt eerst\n currentPlayer = Mark.CROSS;\n currentState = GameState.PLAYING;\n // ready for start\n }", "public void setupGame() {\n\t\t// Re-spawn the appropriate number of sheep\n\t\tint numSheep = 31;\n\t\t\n\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\tnumSheep = 1;\n\t\t}\n\t\t\n\t\t// It takes half the sheep to win.\n\t\t_scoreToWin = numSheep / 2;\n\t\tp(\"It takes \" + _scoreToWin + \" sheep to win.\");\n\t\t\n\t\t_hasBeenWon = false;\n\t\t\n\t\t// Non-infrastructural entities.\n\t\t//////////////////////////\n\t\t\n\t\t// Don't create this stuff if I'm replaying.\n\t\tint mod = 1;\n\t\tfor (int i = 0; i < numSheep; i++) {\n\t\t\t//int x = _generator.nextInt(40) - 20;\n\t\t\t//int z = _generator.nextInt(80) - 40;\n\t\t\tmod *= -1;\n\t\t\tint x = i/2 * mod;\n\t\t\tint z = 0;\n\n\t\t\tSheep s = new Sheep(\"sheep-\" + i + \"[\" + _sheepID + \"]\", x, 2, z);\n\t\t\t\n\t\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\t\ts.setBehaviorActive(false);\n\t\t\t}\n\t\t\t\n\t\t\t_sheepID++;\n\t\t}\n\t\t\n\t\t// Add a wubble for testing.\n\t\tif (!_isJimboSpawned && !SheepPhysicsState.PRODUCTION) {\n\t\t\tSystem.out.println(\"Adding Jimbo.\");\n\t\t\t_isJimboSpawned = true;\n\t\t\taddWubble(\"Jimbo\", (short)100, (Integer)1);\n\t\t\taddSidekick(\"Jimbo\");\n\t\t\t//addWubble(\"Bimbo\", (short)101, (Integer)0);\n\t\t}\n\t\t\n\t\t//////////////////////////\n\n\t\t// Add some wrenches in the appropriate spots.\n\t\tnew Wrench(\"blueWrench1\", -8, 5, -20);\n\t\tnew Wrench(\"blueWrench2\", 8, 5, -20);\n\t\tnew Wrench(\"redWrench1\", -8, 5, 20);\n\t\tnew Wrench(\"redWrench2\", 8, 5, 20);\n\t\t\n\t\t// Save the start of the me.\n\t\t_gameStart = System.currentTimeMillis();\n\t\tSystem.out.println(\"Started game at \" + _gameStart);\n\t\t\n\t\t// Make some predicates.\n\t\t//Predicate p = new Predicate(\"baseClassPred\");\n\t\t//GoPred g = new GoPred(\"derivedGoClass\", 1);\n\t\t\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.SPEEDY, new Vector3f(0, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpE\", -1, PowerUpInfo.PowerUpType.EATER, new Vector3f(2, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.STICKY, new Vector3f(2, 0.4f, 2));\n\t}", "public void prepareGame() {\n setInitialPosition();\n\n //Check NickName\n boolean nickNameEstablished = checkNickName();\n if (!nickNameEstablished) {\n Intent intent = new Intent(this, NickNameActivity.class);\n startActivityForResult(intent, NICKNAME_ACTIVITY_REQUEST_CODE);\n } else {\n setDynamicBackground();\n }\n }", "public ConsoleGame() {\n\t\tSystem.out.println(\"Welcome to Quoridor!\");\n\t\twhile (!setUp());\n\t}", "public void startGame() {\n \t\ttimeGameStarted = System.nanoTime();\n \t\tisStarted = true;\n \n \t}", "@Override\n public void beginGame() {\n }", "public Game() {\r\n\r\n\t\tmakeFrame();\r\n\t\tisClicked = false;\r\n\t\tisPlaying = false;\r\n\t\tlevelEasy = true;\r\n\t\tlevelIntermediate = false;\r\n\t\tlevelHard = false;\r\n\t\tplayerScore = 0;\r\n\r\n\t}", "@Override\n\tpublic void newGame() {\n\t\tround = 0;\n\t\tnewRound();\n\t\t\n\t\tgameOverSoundPlayed = false;\n\t\t\n\t\t// Reset player scores\n\t\tfor (Player player : players) {\n\t\t\tsetPlayerScore(player, 0);\n\t\t}\n\t\t\n\t\t// Reset all button press counters\n\t\tfor (IButton button : buttons) {\n\t\t\tbutton.resetPressCounter();\n\t\t}\n\t\t\n\t\t// Start the game timer\n\t\tdeltaTimeAlive = getPhysicsTickMillis();\n\t\tdeltaTimeDead = deltaTimeAlive / 4;\n\t}", "public GameManager(){\r\n init = new Initialisation();\r\n tower=init.getTower();\r\n courtyard=init.getCourtyard();\r\n kitchen=init.getKitchen();\r\n banquetHall=init.getBanquetHall();\r\n stock=init.getStock();\r\n throneHall=init.getThroneHall();\r\n vestibule=init.getVestibule();\r\n stables=init.getStables();\r\n\r\n this.player = new Player(tower);\r\n\r\n push(new IntroductionState());\r\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tGameLauncher gameLauncher = new GameLauncher();\n\t\t\t}", "public void startGame() {\n running = true;\n\n Thread t = new Thread(animator);\n t.start();\n\n }", "public void beginGame() {\r\n data.gameState = 3;\r\n data.gameStartFlag = true;\r\n setChanged();\r\n notifyObservers(data);\r\n data.gameStartFlag = false; //Set the gameStart flag to false so the relevant update lines aren't ever run a second time\r\n }", "public void doNewGame() {\n setGameInProgress(false);\n console(\"New Game\");\n if (gameInProgress() == true) {\n // This should not be possible, but it doens't hurt to check.\n console(\"Finish the current game first!\");\n return;\n }\n\n boardData.setUpGame(); // Set up the pieces.\n currentPlayer = CheckersData.RED; // RED moves first.\n legalMoves = boardData.getLegalMoves(CheckersData.RED); // Get RED's legal moves.\n selectedRow = -1; // RED has not yet selected a piece to move.\n console(\"Red: Make your move.\");\n setGameInProgress(true);\n refreshBoard();\n }", "public void startGame() {\n message.openingWarVariation(gameVariation, iterations);\n setHands(player1, player2, player3, deck);\n while (versus(player1, player2, player3)) {\n }\n determineOutcome(gameVariation);\n }", "public synchronized void startGame() {\n PreGameState preGameState = new PreGameState();\n pickTeamState = preGameState.startGame(players);\n state = State.PICK_TEAM;\n teamSelection = new HashSet<>();\n }", "public void newGame() {\n\n //reset game board before initializing newgame\n clearGame();\n \n whiteplayer = new Player(\"white\", chessboard, this);\n blackplayer = new Player(\"black\", chessboard, this);\n colorsTurn = \"white\";\n gamelog.logCurrentTurn(colorsTurn);\n\n }", "public void GameStart()\n\t\t{\n\t\t\tplayers_in_game++;\n\t\t}", "public void initialize() {\n // create a runner using a function\n this.createScreenBorders();\n // create a keyboard sensor.\n this.keyboard = this.runner.getGUI().getKeyboardSensor();\n //create the environment for the game (game environment and sprites collection)\n this.createEnvironment();\n // BACKGROUND CREATION //\n this.createBackground();\n // create the counters for the game.\n this.createCounters();\n // LISTENERS CREATION //\n //create a message printing listener.\n HitListener phl = new PrintingHitListener();\n //create a new block remover listener.\n HitListener blockrmv = new BlockRemover(this, blockCounter);\n //create a new ball remover listener.\n HitListener ballrmv = new BallRemover(this, ballCounter);\n //create a new score counter listener.\n HitListener scorelstn = new ScoreTrackingListener(this.scoreCounter);\n // BLOCKS CREATION //\n this.createBlocks(phl, blockrmv, scorelstn);\n // SIDE BLOCKS CREATION //\n this.createSideBlocks();\n // DEATH BLOCK CREATION //\n this.createDeathBlock(ballrmv);\n // LEVEL'S NAME //\n LevelsName name = new LevelsName(this.levelInfo.levelName());\n // add the whole-game indicators to the sprites list.\n this.sprites.addSprite(scoreIndi);\n this.sprites.addSprite(lifeIndi);\n this.sprites.addSprite(name);\n }", "public Game() { \n // Create the new environment. Must be done in the same\n // method as the game loop\n env = new Env();\n \n // Sets up the camera\n env.setCameraXYZ(25, 50, 55);\n env.setCameraPitch(pitch);\n\n // Turn off the default controls\n env.setDefaultControl(false);\n\n // Make the room 50 x 50.\n env.setRoom(new Room());\n creatures = new ArrayList<Creature>();\n }", "public void startGame() {\n status = Status.COMPLETE;\n }", "private void setupGame(@NotNull String data) {\n if (game == null) {\n throw new IllegalArgumentException(\"Tried to start game with a null reference to GameGraphics\");\n }\n NewGameDto newGameDto = GameGraphics.gson.fromJson(data, NewGameDto.class);\n RoboRally.scheduleSync(() -> {\n game.setScreen(new GameScreen(game, newGameDto, this));\n writeToServer(ServerAction.FINISHED_SETUP + \"\");\n IPlayerHandler playerHandler = GameGraphics.getRoboRally().getPlayerHandler();\n if (playerHandler instanceof MultiPlayerHandler) {\n this.playerHandler = (MultiPlayerHandler) playerHandler;\n } else {\n throw new IllegalStateException(\"Player handler is not for multiplayer\");\n }\n\n }, 0);\n }", "public Game()\n {\n createRooms();\n parser= new Parser();\n }", "public void startGame() throws IOException\n\t{\n\t\tobjectOutputStream.writeObject(new StartGame());\n\t}", "void game_setup(){\n game_text_setup();\n ship_setup();\n alien_setup();\n timer.start(); // this timer will be stopped automatically by JavaFX when the program terminates\n }", "public GameStart() {\n\t\tsuper(\"First 2D Game\");\n\t}", "public GameLuncher(GameGUI gameGUI) {\n this.gameGUI = gameGUI;\n createGame();\n }", "private void setupGame() {\n \tdrawBricks();\n \tdrawPaddle();\n \tdrawBall(); \t\n \tsetInitialBallVelocity();\n }", "protected void newGame() {\r\n playSound( RESET );\r\n\r\n timeTitle.setText( Msgs.str( \"Time\" ) );\r\n timeMesg.setText( Msgs.str( \"zeroTime\" ) );\r\n infoMesg.setText( Msgs.str( \"Ready\" ) );\r\n scoreTitle.setText( Msgs.str( \"Score\" ) );\r\n\r\n adjustScore();\r\n currentScore = 0;\r\n scoreMesg.setText( \"0\" );\r\n\r\n mineField.newGame();\r\n minesTitle.setText( Msgs.str( \"mines.left\" ) );\r\n setMinesMesg( mineField.getNumHiddenMines() );\r\n\r\n pane.repaint();\r\n }", "public void startGame() {\n loadPlayersIntoQueueOfTurns();\n nextPlayerInTurn();\n eventListener.addEventObject(new RoundEvent(EventNamesConstants.GameStarted));\n }", "public void createGame();", "private void startNewGame()\n {\n \n \t//this.mIsSinglePlayer = isSingle;\n \n \tmGame.clearBoard();\n \n \tfor (int i = 0; i < mBoardButtons.length; i++)\n \t{\n \t\tmBoardButtons[i].setText(\"\");\n \t\tmBoardButtons[i].setEnabled(true);\n \t\tmBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n \t\t//mBoardButtons[i].setBackgroundDrawable(getResources().getDrawable(R.drawable.blank));\n \t}\n \n \t\tmPlayerOneText.setText(\"Player One:\"); \n \t\tmPlayerTwoText.setText(\"Player Two:\"); \n \n \t\tif (mPlayerOneFirst) \n \t{\n \t\t\tmInfoTextView.setText(R.string.turn_player_one); \n \t\tmPlayerOneFirst = false;\n \t}\n \telse\n \t{\n \t\tmInfoTextView.setText(R.string.turn_player_two); \n \t\tmPlayerOneFirst = true;\n \t}\n \t\n \n \tmGameOver = false;\n }", "public void startProgram() {\n this.displayBanner();\n// prompt the player to enter their name Retrieve the name of the player\n String playersName = this.getPlayersName();\n// create and save the player object\n User user = ProgramControl.createPlayer(playersName);\n// Display a personalized welcome message\n this.displayWelcomeMessage(user);\n// Display the Main menu.\n MainMenuView mainMenu = new MainMenuView();\n mainMenu.display();\n }", "public void create() {\n connect();\n batch = new SpriteBatch();\n font = new BitmapFont();\n\n audioManager.preloadTracks(\"midlevelmusic.wav\", \"firstlevelmusic.wav\", \"finallevelmusic.wav\", \"mainmenumusic.wav\");\n\n mainMenuScreen = new MainMenuScreen(this);\n pauseMenuScreen = new PauseMenuScreen(this);\n settingsScreen = new SettingsScreen(this);\n completeLevelScreen = new CompleteLevelScreen(this);\n completeGameScreen = new CompleteGameScreen(this);\n\n setScreen(mainMenuScreen);\n }", "@Override\n\tpublic void startCreateNewGame() \n\t{\t\n\t\tgetNewGameView().setTitle(\"\");\n\t\tgetNewGameView().setRandomlyPlaceHexes(false);\n\t\tgetNewGameView().setRandomlyPlaceNumbers(false);\n\t\tgetNewGameView().setUseRandomPorts(false);\n\t\tif(!getNewGameView().isModalShowing())\n\t\t{\n\t\t\tgetNewGameView().showModal();\n\t\t}\n\t}", "@Override\n public void run(){\n Initialize();\n // Load game files (images, sounds, ...)\n LoadContent();\n \n Framework.gameState = Framework.GameState.PLAYING;\n }", "@Override\n public void run(){\n Initialize();\n // Load game files (images, sounds, ...)\n LoadContent();\n \n Framework.gameState = Framework.GameState.PLAYING;\n }", "private void startGame()\n {\n if (heroPlayer != null && antagonistPlayer != null && location != null && currentPlayerName != \"null\")\n {\n gameStarted = true;\n }\n }", "@Override\n\t public void run() {\n\t \tSnakeGame game = new SnakeGame();\n\t }", "public void start() {\n // set player number\n playerNumber = clientTUI.getInt(\"set player number (2-4):\");\n while (true) {\n try {\n game = new Game();\n game.setPlayerNumber(playerNumber - 1);\n host = this.clientTUI.getString(\"server IP address:\");\n port = this.clientTUI.getInt(\"server port number:\");\n clientName = this.clientTUI.getString(\"your name:\");\n player = clientTUI.getBoolean(\"are you human (or AI): (true/false)\") ?\n new HumanPlayer(clientName) : new ComputerPlayer(clientName);\n game.join(player);\n // initialize the game\n game.init();\n while (clientName.indexOf(' ') >= 0) {\n clientName = this.clientTUI.getString(\"re-input your name without space:\");\n }\n this.createConnection();\n this.sendJoin(clientName);\n this.handleJoin();\n if (handshake) {\n run();\n } else {\n if (!this.clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n } catch (ServerUnavailableException e) {\n clientTUI.showMessage(\"A ServerUnavailableException error occurred: \" + e.getMessage());\n if (!clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n }\n clientTUI.showMessage(\"Exiting...\");\n }", "public void setup() {\r\n\t\thumanCardsPanel.setHumanCards(players.get(0).getCards());\r\n\t\tfor ( Player p : players ) {\r\n\t\t\tp.setBoard(board);\r\n\t\t\tp.setGame(this);\r\n\t\t}\r\n\t\tboard.setGame(this);\r\n\t\tboard.repaint();\r\n\t\tJOptionPane popup = new JOptionPane();\r\n\t\tString message = \"You are Miss Scarlet. Press Next Player to begin.\\n Hint: Use File > Detective Notes to help you win!\";\r\n\t\tpopup.showMessageDialog(this, message, \"Welcome to Clue!\", JOptionPane.INFORMATION_MESSAGE);\r\n\t}", "public void initGame() {\n board.init(); // clear the board contents\n currentPlayer = Seed.CROSS; // CROSS plays first\n currentState = GameState.PLAYING; // ready to play\n }" ]
[ "0.8119174", "0.8103218", "0.79362667", "0.778537", "0.76442075", "0.7637165", "0.76062137", "0.75827724", "0.75456333", "0.7516333", "0.7515288", "0.7511032", "0.74869597", "0.7434312", "0.73813504", "0.73780495", "0.7374256", "0.7364444", "0.7345581", "0.7339582", "0.733758", "0.7319018", "0.7318229", "0.72962576", "0.7253063", "0.7244899", "0.724334", "0.7234586", "0.7210559", "0.72095275", "0.71832025", "0.7141076", "0.7132114", "0.71180576", "0.7109947", "0.71010494", "0.70933217", "0.7083779", "0.7082157", "0.7064926", "0.70446235", "0.7033666", "0.70233536", "0.7018139", "0.7015031", "0.70114976", "0.7008122", "0.6999601", "0.69724715", "0.69684684", "0.6961488", "0.696054", "0.6958562", "0.6947269", "0.6928169", "0.69173574", "0.6909496", "0.6901583", "0.6901583", "0.6901583", "0.6900773", "0.6899717", "0.6899505", "0.68862575", "0.6885637", "0.6884869", "0.6883455", "0.68832266", "0.68700963", "0.686412", "0.6857181", "0.68535215", "0.6844789", "0.68403083", "0.68368655", "0.6834248", "0.68307227", "0.68296653", "0.6828596", "0.68281364", "0.68188274", "0.6811369", "0.6808869", "0.67984045", "0.67887175", "0.67868114", "0.6786593", "0.67829597", "0.6781491", "0.6775007", "0.67687666", "0.6764822", "0.6763311", "0.67626184", "0.676248", "0.676248", "0.67603475", "0.6759834", "0.6759161", "0.67558545", "0.6754777" ]
0.0
-1
Adds a new Participant
public void addParticipant(Participant p) { pstate.addParticipant(p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addParticipant(Participant participant);", "public void onAddParticipant() {\n ParticipantDialog participantDialog = ParticipantDialog.getNewInstance();\n Optional<Participant> result = participantDialog.showAndWait();\n if (!result.isPresent()) {\n return;\n }\n\n if (controller.addParticipant(result.get())) {\n return;\n }\n\n AlertHelper.showError(LanguageKey.ERROR_PARTICIPANT_ADD, null);\n }", "@Override\n public void addParticipant(Participant participant) throws AlfredException {\n this.participantList.add(participant);\n }", "public void addParticipant(String uid) {\n\r\n if (!participants.contains(uid))\r\n participants.add(uid);\r\n }", "public void addParticipant (Participant participantAAjouter){\n if (participantAAjouter != null){\n for (Participant participant :lesParticipants){\n if (participant.getIdParticipant()==participantAAjouter.getIdParticipant()){\n return;\n } \n }\n lesParticipants.add(participantAAjouter);\n }\n }", "private void addParticipant(Node participantsNode, Participant participant) {\r\n try {\r\n jcrom.addNode(participantsNode, participant);\r\n participantsNode.getSession().save();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n public void addParticipantForConnectathon() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"addParticipantForConnectathon\");\n }\n\n if (isEditExistingParticipant()) {\n if (isParticipantEmailChanged()) {\n saveParticipant();\n FacesMessages.instance().add(StatusMessage.Severity.INFO, \"Participant was successfully updated\");\n renderAddPanel = false;\n getAllConnectathonParticipants();\n return;\n }\n }\n // check that the participant is not already registered for this testing session\n String email = selectedConnectathonParticipant.getEmail();\n TestingSession testingSession = selectedConnectathonParticipant.getTestingSession();\n\n List<ConnectathonParticipant> participants = getConnectathonParticipants(email, testingSession);\n\n if ((participants != null) && !participants.isEmpty()) {\n StatusMessages.instance().addFromResourceBundle(StatusMessage.Severity.ERROR, \"gazelle.users.connectaton.participants.ParticipantExists\");\n } else {\n saveParticipant();\n FacesMessages.instance().add(StatusMessage.Severity.INFO, \"Participant was successfully added\");\n }\n renderAddPanel = false;\n getAllConnectathonParticipants();\n }", "@Override\n\tpublic boolean addParticipant(String name) throws IOException {\n\t\tif (!name.trim().equalsIgnoreCase(\"\")) {\n\t\t\tmakeRequest(\"?action=addParticipant&name=\"\n\t\t\t\t\t+ URLEncoder.encode(clientName, \"UTF-8\"));\n\t\t\tgetParticipants();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n public void addParticipantAction() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"addParticipantAction\");\n }\n clearAddPanels();\n\n renderAddPanel = true;\n selectedConnectathonParticipant = new ConnectathonParticipant();\n ConnectathonParticipantStatus cps = new ConnectathonParticipantStatus();\n selectedConnectathonParticipant.setConnectathonParticipantStatus(cps);\n\n if (!Role.isLoggedUserAdmin() && !Role.isLoggedUserProjectManager() && !Role.isLoggedUserMonitor()) {\n selectedConnectathonParticipant.setInstitution(Institution.getLoggedInInstitution());\n }\n selectedConnectathonParticipant.setTestingSession(TestingSession.getSelectedTestingSession());\n\n }", "public void addActivityParticipant(ActivityType activity, String id) {\n\t\tactivity.getParticipant().add(id);\n\t}", "public void setParticipant(Integer participant) {\n this.participant = participant;\n }", "public Builder addParticipants(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureParticipantsIsMutable();\n participants_.add(value);\n onChanged();\n return this;\n }", "@Override\n public void addParticipantToTeam(Id teamId, Participant participant) throws AlfredException {\n if (!this.participantList.contains(participant.getId())) {\n throw new ModelValidationException(\"Participant does not exist in participantList\");\n }\n Team targetTeam;\n try {\n targetTeam = this.getTeam(teamId);\n } catch (MissingEntityException e) {\n throw e;\n }\n try {\n boolean isSuccessful = targetTeam.addParticipant(participant);\n if (!isSuccessful) {\n throw new AlfredModelException(\"Participant is already present in team\");\n }\n } catch (Exception e) {\n throw new AlfredModelException(e.getMessage());\n }\n }", "void addParticipants(@NonNull final String conversationId, @NonNull final List<Participant> participants, @Nullable Callback<ComapiResult<Void>> callback);", "public static String regParticipantsTest() {\n\t\t\t\n\t\t\tlogger.info(\"ParticipantRegistrationPlus:regParticipantsTest\");\t\n\t\t\t\n\t\t\tClientSession cs = ClientSession.getInstance();\n\t\t\t\t\t\t\n\t\t\ttry {\n\t\t\t\tcs.startSession(userName, password);\n\t\t\t} catch (ApplicationException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tboolean isError=false;\n\t\t\tString errorMsg=\"\";\n\t\t\tProperties prop = new Properties();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\tParticipant p = new Participant();\n\t\t\t\t\tp.setLastName(\"patientElement\");\n\t\t\t\t\tp.setFirstName(\"\");\n\t\t\t\t\tp.setMiddleName(\"cpElement\");\n\t\t\t\t\tp.setActivityStatus(\"Active\");\n\t\t\t\t\tp.setBirthDate(dateFormat(\"0000-00-00\"));\n\t\t\t\t\tString gender=\"Male Gender\";\n\t\t\t\t\tp.setGender(gender);\n\t\t\t\t\tp.setVitalStatus(\"Unknown\");\n\t\t\t\t\t\t\n\t\t\t\t\ttry{\n\t\t\t\t\t\tp = (Participant) appService.createObject(p);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tlogger.info(\"while creating participant\");\n\t\t\t\t \te.printStackTrace();\n\t\t\t \n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tlogger.info(\"Participant created successfully\");\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tisError = true;\n\t\t\t\terrorMsg=e.getMessage();\n\t\t\t}\n\t\t\tif(isError)\n\t\t\t\treturn \"Participant registration failed because of an error [\"+errorMsg+\"]\";\n\t\t\telse\n\t\t\t\treturn \"success\";\n\t\t}", "public void addActor(){\n actorProfileList.add(new ActorProfile());\n }", "void addPerson(Player player);", "public void addPerson(Person p);", "void addPeer(Uuid peer) throws RemoteException;", "public Builder addParticipantsBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureParticipantsIsMutable();\n participants_.add(value);\n onChanged();\n return this;\n }", "void loadParticipant();", "public void addActivityParticipant(ActivityType activity, ParticipantType part) {\n\t\taddActivityParticipant(activity, getParticipantId(part));\n\t}", "public Participant getParticipant ()\r\n {\r\n return participant_;\r\n }", "public void setParticipantId(String participantId) {\r\n\t\tthis.participantId = participantId;\r\n\t}", "private static void addPerson(int startFloorIn, int endFloorIn) throws InvalidParameterException {\r\n\r\n\t\t// get person name\r\n\t\tpersonCounter++;\r\n\t\tString name = \"P\" + personCounter;\r\n\r\n\t\t// create a person\r\n\t\tPerson p = new Person(name, startFloorIn, endFloorIn);\r\n\t\tSystem.out.printf(\"%s Person %s created on Floor %d, wants to go %s to Floor %d\\n\",\r\n\t\t\t\tgetTimeStamp(), name, startFloorIn, ElevatorController.getDirection(startFloorIn, endFloorIn), endFloorIn);\r\n\r\n\t\t// add to list for statistics\r\n\t\tpeople.add(p);\r\n\r\n\t\t// send to the building\r\n\t\ttry {\r\n\t\t\tmyBuilding.addPerson(p);\r\n\t\t} catch (EmptyReferenceException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "private DomainParticipant createDomainParticipant(\n final int domainId,\n final String participantName\n ) {\n // create default participant qos marked as routing service entity\n DomainParticipantQos domainParticipantQos = new DomainParticipantQos();\n DomainParticipantFactory.get_instance().get_default_participant_qos(domainParticipantQos);\n domainParticipantQos.service.kind = ServiceQosPolicyKind.ROUTING_SERVICE_QOS;\n domainParticipantQos.participant_name.name = participantName;\n\n // create domain participant for administration interface\n return DomainParticipantFactory.get_instance().create_participant(\n domainId,\n domainParticipantQos,\n null,\n StatusKind.STATUS_MASK_NONE\n );\n }", "@Transactional\n\tpublic Participant createParticipant(String name,Integer isDriver) {\n\t\tParticipant participant = new Participant();\n\t\tparticipant.setName(name);\n\t\tparticipant.setIsDriver(isDriver);\n\t\tentityManager.persist(participant);\n\t\treturn participant;\n\t}", "public void addParticipantPresenceListener(\n AdHocChatRoomParticipantPresenceListener listener)\n {\n synchronized (memberListeners)\n {\n if (!memberListeners.contains(listener))\n memberListeners.add(listener);\n }\n }", "public void addParticipants(Player rating) {\n\t\tparticipants.add(rating);\n\t}", "public void addPerson(Person thePerson) {\r\n staff.add(thePerson);\r\n }", "ParticipantId getId();", "public void setParticipantId(int participantId) {\r\n\t\tthis.participantId = participantId;\r\n\t}", "@RequestMapping(value = \"introduceparticipant\", method = { RequestMethod.POST, RequestMethod.GET })\n\tpublic String introduceParticipant(@RequestParam(value = \"who\", required = false) String mobileNo,\n\t\t\t@RequestParam(value = \"what\", required = false) String smsContent,\n\t\t\t@RequestParam(value = \"operator\", required = false) String operator,\n\t\t\t@RequestParam(value = \"carrier\", required = false) String carrier,\n\t\t\t@RequestParam(value = \"datetime\", required = false) String datetime, HttpServletRequest request) {\n\t\tString response = \"FAILURE\";\n\t\tSMS sms = new SMS(mobileNo, smsContent, operator, carrier, datetime);\n\t\tresponse = smsIntegrationService.updateParticipant(sms);\n\t\treturn response;\n\t}", "void addMember(final PartyMember member);", "@Override\n\tpublic void addPerson(User pUser) {\n\t\t\n\t}", "void accountPeerAdded(String peerId);", "public void ajouterParticipation(Participer uneParticipation)\n\t{\n\t\tthis.lesParticipations.add(uneParticipation);\n\t}", "protected void addMember() {\n\t\tString mPhoneNumber = phoneEditView.getText().toString();\n\t\t\n\t\tApiProxy apiProxy = new ApiProxy(this);\n\t\tapiProxy.addMember(mPhoneNumber);\n\t\t\n\t\tgoToFriendListPage();\n\t}", "public void addAccount(Account account,Person person);", "public void addParticipant()\n {\n boolean addFlg = false;\n do\n {\n Scanner scan = new Scanner(System.in);\n flg = scan.nextLine();\n if(flg.equalsIgnoreCase(\"y\") || flg.equalsIgnoreCase(\"Y\"))\n {\n this.autoAdd();\n addFlg = true;\n } else if(flg.equalsIgnoreCase(\"n\")|| flg.equalsIgnoreCase(\"N\"))\n {\n System.out.println(\"Athletes ID list: \");\n switch (this.getGameType()) // print out every athletes who can join the games\n {\n case 1:\n for(int j = 0; j < swimmers.size(); j++)\n {\n System.out.println(swimmers.get(j).getId());\n }\n break;\n case 2:\n for(int j = 0; j < runners.size(); j++)\n {\n System.out.println(runners.get(j).getId());\n }\n break;\n case 3:\n for(int j = 0; j < cyclists.size(); j++)\n {\n System.out.println(cyclists.get(j).getId());\n }\n break;\n }\n for(int j = 0; j < superAthletes.size(); j++)\n {\n System.out.println(superAthletes.get(j).getId());\n }\n addFlg = true;\n this.manualAdd();\n }else {\n System.out.println(\"Invalid Typing\");\n }\n }while (!addFlg);\n }", "public Builder addParticipant(ParticipantConfig participant) {\n _participantMap.put(participant.getId(), participant);\n return this;\n }", "com.google.protobuf.ByteString getParticipantBytes();", "public void addAccount(Person p, Account a);", "private void createMemberInvitation(User user, Chatroom chatroom) {\n\t\tList<Chatroom> chatrooms = user.getChatroomInvites();\n\t\tList<User> users = chatroom.getMemberInvitees();\n\t\t// create the relation\n\t\tchatrooms.add(chatroom);\n\t\tusers.add(user);\n\t\t// save the chatroom, and its relations\n\t\tchatroomRepository.save(chatroom);\n\t}", "@Multipart\n @POST(\"/api/person_invite\")\n Call<ResponseInvite> addPlayerToTeam(@Header(\"auth\") String authorization, @PartMap Map<String, RequestBody> params);", "public String getParticipantId() {\r\n\t\treturn participantId;\r\n\t}", "@Override\n\tpublic void add() {\n\t\tperson.addRelationship(\"Friend\", friend);\n\t}", "@Override\n\tpublic eu.strasbourg.service.project.model.Participation addParticipation(\n\t\teu.strasbourg.service.project.model.Participation participation) {\n\n\t\treturn _participationLocalService.addParticipation(participation);\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n @Test\n public void registerParticipantSuccess() throws IntegrationException, SOAPFaultException, MalformedURLException,\n JAXBException {\n final Date stTime = new Date(new java.util.Date().getTime());\n\n xsltTransformer.transform(null, null, null);\n EasyMock.expectLastCall().andAnswer(new IAnswer() {\n\n public Object answer() {\n // return the value to be returned by the method (null for void)\n return getParticipantXMLString();\n }\n }).anyTimes();\n\n final CaaersServiceResponse caaersServiceResponse = getRegisterParticipantResponse(SUCCESS);\n EasyMock.expect(wsClient.createParticipant((String) EasyMock.anyObject())).andReturn(caaersServiceResponse);\n EasyMock.replay(wsClient);\n\n final ServiceInvocationMessage serviceInvocationMessage = prepareServiceInvocationMessage(REFMSGID,\n getParticipantInterimMessage(), stTime,\n caAERSRegistrationServiceInvocationStrategy.getStrategyIdentifier());\n\n final ServiceInvocationResult result = caAERSRegistrationServiceInvocationStrategy\n .invoke(serviceInvocationMessage);\n\n Assert.assertNotNull(result);\n }", "public Builder addParticipants(long value) {\n ensureParticipantsIsMutable();\n participants_.add(value);\n onChanged();\n return this;\n }", "public void remove()\n {\n domain.removeParticipant(participant);\n }", "public void addRoom(Chatroom room){\n\n }", "public int getParticipantId() {\r\n\t\treturn participantId;\r\n\t}", "java.lang.String getParticipant();", "public PresencePerson createPresencePerson(String id);", "private void updateParticipant(Node participantsNode, Participant participant) {\r\n try {\r\n String hexName = CodingUtils.encodeToHex(participant.getUsername());\r\n if (participantsNode.hasNode(hexName)) {\r\n Node node = participantsNode.getNode(hexName);\r\n jcrom.updateNode(node, participant);\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Override\r\n\tpublic void add() {\n\t\tif(alreadyAdded()) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Member is already added\");\r\n\t\t}else {\r\n\t\t\t\r\n\t\t\t\ttry(Connection connection= db.getConnection();) {\r\n\t \t\r\n\t\t\t\t\r\n\t\t\t\tString addString=\"INSERT INTO members VALUES(?,?,?,?)\";\r\n\t\t\t\tpreparedStatement=connection.prepareStatement(addString);\r\n\t\t\t\tpreparedStatement.setString(1, super.getIdString());\r\n\t\t\t\tpreparedStatement.setString(2, super.getNameString());\r\n\t\t\t\tpreparedStatement.setString(3, super.getSurnameString());\r\n\t\t\t\tpreparedStatement.setString(4, super.getEmailString());\r\n\t\t\t\t\r\n\t\t\t\tpreparedStatement.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Something went wrong\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t \r\n\t\t\r\n\t}", "public void autoAdd()\n {\n switch (this.getGameType())\n {\n case 1:\n for(int i = 0; i < this.participantNum; i++)\n {\n games.get(count - 1).addParticipant(swimmers.get(i).getId(),swimmers.get(i).compete(),swimmers.get(i).getPoints());\n }\n break;\n case 2:\n for(int i = 0; i < this.participantNum; i++)\n {\n games.get(count - 1).addParticipant(runners.get(i).getId(),runners.get(i).compete(),runners.get(i).getPoints());\n }\n break;\n case 3:\n for(int i = 0; i < this.participantNum; i++)\n {\n games.get(count - 1).addParticipant(cyclists.get(i).getId(),cyclists.get(i).compete(),cyclists.get(i).getPoints());\n }\n break;\n }\n\n }", "public interface Participant {\r\n\tpublic void update();\r\n\tpublic void start();\r\n\tpublic void gameOver();\r\n\tpublic String getPlayerName();\r\n}", "public void addInvolvedPerson( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), INVOLVEDPERSON, value);\r\n\t}", "private void addPerson(){\r\n\t\tpeople.add(new Person(this));\r\n\t\t// fire the listeners so the screen updates\r\n\t\t// when addPerson is called (by the button click)\r\n\t\tpersonTableModel.fireTableRowsInserted(0,0);\r\n\t}", "void AddMeeting (Meeting m) throws Exception;", "public Participant(Account associatedAccount, String name){\r\n\t\tthis.associatedAccount = associatedAccount;\r\n\t\tthis.name = name;\r\n\t\tbalance = 0;\r\n\t\tspent = 0;\r\n\t}", "public static ScheduleOption addParticipantsByScheduleOptionId(String scheduleId, String participantid) {\n Logger.debug(\"Start add new participantsId \" + participantid + \"into scheduleID \" + scheduleId);\n ScheduleOption scheduleOption = findById(scheduleId);\n if (scheduleOption == null) return null;\n\n List<String> participantIds = scheduleOption.participantIds;\n participantIds.add(participantid);\n return updateScheduleOptionParticipants(scheduleOption, participantIds);\n\n }", "public void addRecipient(){\n //mRATable.insert();\n }", "void addNewFriend(String actorId, String objectId, Date eventTime);", "public void addPerson(Person per) {\r\n\t\tthis.persons.put(per.getPersonID(), per);\r\n\t}", "public void add(PeerInt p){\n\t\tMLog.log(\"adding peer\");\n\t\tpeers.add(p);\n\t}", "public void addCommitteeMember(Professor p) {\r\n committee.add(p);\r\n }", "public Integer getParticipant() {\n return participant;\n }", "public void addPrescription(Prescription p){\n prescriptions.add(p);\n }", "public void addMember()\r\n\t{\r\n\t\tlistOfMembers.add(new Member(\r\n\t\t\t\tgetUserString(\"Enter Member's First Name\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Surname\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Email\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Telephone\"),\r\n\t\t\t\tgetUserInt(\"Enter Member's Number\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Type\")\r\n\t\t\t\t));\r\n\t\t\r\n\t}", "void add(Actor actor);", "Client join(Participant participant);", "@Override\n public void onClick(View v) {\n\n String firstName = firstName_et.getText().toString();\n String lastName = lastName_et.getText().toString();\n String emailId = email_et.getText().toString();\n\n addMember(firstName, lastName, emailId);\n\n }", "@Override\r\n\tpublic boolean addActor(String v)\r\n\t{\r\n\t\tActor newActor = new Actor(v);\r\n\t\t\r\n\t\tif(!graph.containsVertex(newActor))\r\n\t\t{\r\n\t\t\tgraph.addVertex(newActor);\r\n\t\t\tactorNames.add(v);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void add(Person person) {\n\t\tteilnehmerListe.add(person);\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void testAddAlreadyRegisteredPeer() {\n replay(participantsConfig);\n\n peerManager.activate();\n\n peerManager.addPeerDetails(newPeer.name().get(),\n IpAddress.valueOf(PEER_IP),\n newPeer.connectPoint(),\n newPeer.interfaceName());\n }", "public CandidateEntity addCandidate(CandidateEntity entity){\n\t\tPartyEntity party =new PartyEntity(\"BJP\", \"PM\", \"Lotus\");\n\t\tentity.setParty(party);\n\t\tentityManager.getTransaction().begin();\n\t\tentityManager.merge(entity);\n\t\tentityManager.getTransaction().commit();\n\t\tlogger.info(\"Candidate with Id\" + entity.getCandidate_id()+ \"is added\");\n\t\treturn entity;\n\t}", "public void addMember(Person person) {\n\t\tmembers.add(person);\n\t}", "public void add (String id, String email, int type, String name);", "@Test\n public void testAddPeerDetailsSuccess() {\n participantsConfig.addPeer(newPeer);\n expectLastCall().once();\n replay(participantsConfig);\n\n peerManager.activate();\n\n peerManager.addPeerDetails(newPeer.name().get(),\n newPeer.ip(),\n newPeer.connectPoint(),\n newPeer.interfaceName());\n verify(participantsConfig);\n }", "@Override\n\tpublic void addMember(User user, UserProfile profileTemplate)\n\t\t\tthrows Exception {\n\n\t}", "@Override\n\tpublic eu.strasbourg.service.project.model.Participation\n\t\tcreateParticipation(long participationId) {\n\n\t\treturn _participationLocalService.createParticipation(participationId);\n\t}", "public void setParticipantCount (byte p) {\n\t\tParticipants = p;\n\t}", "public abstract void addIceCandidate(String candidate);", "public void onEditParticipant() {\n Participant participant = outputParticipants.getSelectionModel().getSelectedItem();\n\n if (participant == null) {\n AlertHelper.showError(LanguageKey.ERROR_PARTICIPANT_NULL, null);\n return;\n }\n\n ParticipantDialog participantDialog = ParticipantDialog.getNewInstance(participant);\n if (participantDialog == null) {\n // Exception already handled\n return;\n }\n Optional<Participant> result = participantDialog.showAndWait();\n if (!result.isPresent()) {\n return;\n }\n\n if (controller.editParticipant(result.get())) {\n return;\n }\n\n AlertHelper.showError(LanguageKey.ERROR_PARTICIPANT_EDIT, null);\n }", "Integer addNew(InviteEntity builder) throws IOException;", "public void addQuestion(Question question);", "public void setParticipantFragment(Fragment fragment) {\n this.room = (RoomActivityParticipantsFragment) fragment;\n }", "void addPerson(Person person) throws UniquePersonList.DuplicatePersonException;", "public AddParticipantsResponseInternal setParticipants(List<AcsCallParticipantInternal> participants) {\n this.participants = participants;\n return this;\n }", "public void addInvolvedPerson(InvolvedPerson value) {\r\n\t\tBase.add(this.model, this.getResource(), INVOLVEDPERSON, value);\r\n\t}", "void add(@Nonnull ResumeIntroduction resumeIntroduction);", "void addpeer(Node p) {\n\t\tpeers.add(p);\n\t}", "public void addMember(String uuid) {\n this.members.add(uuid);\n }", "public void addPerson(Person object)\n\t{\n\t\tthis.peopleList.add(object);\n\t}", "public void add(Person person) {\n\t\t\t\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\n\t\tsession.save(person);\n\t}", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "public static String regParticipants(String fileName) {\n\t\t\n\t\tlogger.info(\"ParticipantRegistrationPlus:regParticipants \" + fileName);\t\n\t\tClientSession cs = ClientSession.getInstance();\n\t\t\t\t\n\t\ttry {\n\t\t\tcs.startSession(userName, password);\n\t\t} catch (ApplicationException e1) {\n\t\t\tlogger.info(\"ApplicationException in ParticipantRegistrationPlus:regParticipants\");\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\tboolean isError=false;\n\t\tString errorMsg=\"\";\n\t\t\n\t\ttry\n\t\t{\n\t\t\tFile fXmlFile = new File(fileName);\n\t\t\tSAXBuilder builder = new SAXBuilder();\n\t\t\tDocument document = builder.build(new ByteArrayInputStream(getFileAsString(fXmlFile).getBytes()));\n\t\t\tElement root = document.getRootElement();\n\n\t\t\tList rows = root.getChild(\"patient_set\").getChildren(\"patient\");\n\t\t\tfor (int i = 0; i < rows.size(); i++) {\n\t\t\t\tElement row = (Element) rows.get(i);\n\t\t\t\tElement patientElement = row.getChild(\"patient_id\");\n\t\t\t\tElement cpElement = row.getChild(\"study_name\");\n\t\t\t\tHashMap<String, String> hashMap = new HashMap<String, String>();\n\t\t\t\tString gender = \"Unknown\", def_vital_status_cd = \"Unknown\", sex_cd=\"\";\n\n\t\t\t\tList params = row.getChildren(\"param\");\n\t\t\t\tfor (int j = 0; j < params.size(); j++) {\n\t\t\t\t\tElement column = (Element) params.get(j);\n\t\t\t\t\tString value = column.getText();\n\t\t\t\t\thashMap.put(j+\"\", value);\n\t\t\t\t}\n\t\t\t\tParticipant p = new Participant();\n\t\t\t\tp.setLastName(patientElement.getText());\n\t\t\t\tp.setFirstName(\"\");\n\t\t\t\tp.setMiddleName(cpElement.getText());\n\t\t\t\tp.setActivityStatus(\"Active\");\n\t\t\t\tp.setBirthDate(dateFormat(hashMap.get(\"1\")));\n\t\t\t\tsex_cd=hashMap.get(\"4\");\n\n\t\t\t\tif(sex_cd.equalsIgnoreCase(\"MALE\"))\n\t\t\t\t\tgender=\"Male Gender\";\n\t\t\t\telse if(sex_cd.equalsIgnoreCase(\"FEMALE\"))\n\t\t\t\t\tgender=\"Female Gender\";\n\n\t\t\t\tp.setGender(gender);\n\t\t\t\tp.setVitalStatus(def_vital_status_cd);\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tp = (Participant) appService.createObject(p);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t \te.printStackTrace();\t\t \n\t\t\t\t}\t\t\t\t\n\t\t\t\tlogger.info(\"ParticipantRegistrationPlus:regParticipants - Participant created successfully\");\t\t\t\t\t\n\t\t\t}\n\t\t} catch (JDOMException e) {\n\t\t\te.printStackTrace();\n\t\t\tisError = true;\n\t\t\terrorMsg=e.getMessage();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\tisError = true;\n\t\t\terrorMsg=e.getMessage();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tisError = true;\n\t\t\terrorMsg=e.getMessage();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tisError = true;\n\t\t\terrorMsg=e.getMessage();\n\t\t}\n\t\t\n\t\tif(isError)\n\t\t\treturn \"Participant registration failed because of an error [\"+errorMsg+\"]\";\n\t\telse\n\t\t\treturn \"success\";\n\t}" ]
[ "0.84297544", "0.7715708", "0.75391906", "0.72550416", "0.7230252", "0.7194476", "0.70931053", "0.70276767", "0.67554694", "0.6476816", "0.6429599", "0.63205004", "0.62394404", "0.61875653", "0.614088", "0.60928935", "0.6043647", "0.60432625", "0.6035196", "0.6012363", "0.59530175", "0.5949147", "0.5925546", "0.59177387", "0.5902833", "0.58946174", "0.58911425", "0.588726", "0.5831337", "0.5817009", "0.5814646", "0.579954", "0.5752667", "0.57436305", "0.57203156", "0.5707693", "0.5707208", "0.5703155", "0.56590754", "0.5605123", "0.5604743", "0.5599166", "0.5592246", "0.55912226", "0.55908614", "0.5577663", "0.5576561", "0.557055", "0.5567795", "0.5555047", "0.55352306", "0.553133", "0.5526841", "0.5520783", "0.55100566", "0.550621", "0.5500276", "0.5488754", "0.5482327", "0.54678625", "0.546432", "0.54616034", "0.54569966", "0.54518163", "0.54408777", "0.54326993", "0.54300165", "0.5429246", "0.54262733", "0.542202", "0.54214907", "0.54195714", "0.5408116", "0.53943884", "0.5388589", "0.5384477", "0.5383362", "0.53804004", "0.5374197", "0.53707933", "0.53679353", "0.53600544", "0.53474694", "0.5345313", "0.53394127", "0.53061104", "0.5301877", "0.5298184", "0.52964306", "0.5291265", "0.5270466", "0.52668303", "0.5260405", "0.5259929", "0.5256566", "0.5256378", "0.5253947", "0.52400863", "0.5234279", "0.5232278" ]
0.76965123
2
The ship has been destroyed
public void shipDestroyed() { placeDebris(ship.getX(), ship.getY()); // Null out the ship ship = null; openShipSound(); // Decrement lives lives--; display.setLives(lives); // Since the ship was destroyed, schedule a transition scheduleTransition(END_DELAY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void decLives()\n\t{\n\t\tlives--;\n\t\tshipSpawned = false;\t\n\t\tif(lives <= 0)\n\t\t{\n\t\t\tSystem.out.println(\"Game over\");\n\t\t\tif(isSound() && !isPaused())\n\t\t\t\tdeath.play();\n\t\t\tsetGameOver(true);\n\t\t\tnotifyObservers();\n\t\t\treturn;\n\t\t}\n\t\tthis.addPlayerShip();\n\t}", "static void RemoveObserver(Ship a_ship){}", "public boolean isShipFullyDestroyed() {\n return this.goodShipParts.size() <= 0;\n }", "public void destroyed() {\n\t\twidth = SIZE_INC * width;\n\t\t// make the end points at the new location\n\t\tthis.makeEndPoints(width, (0 - (xSpeed * width)),\n\t\t\t\t(0 - (ySpeed * width)));\n\n\t}", "void destroy() {\n\t\tdespawnHitbox();\n\t\tinventory.clear();\n\t\texperience = 0;\n\t\tinvalid = true;\n\t}", "public void destroy(){\n destroyed = true;\n }", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tmovingArea = null;\r\n\t}", "public boolean destroyed() {\r\n\t\treturn destroyed;\r\n\t}", "public void destruction()\n\t{\n\t\tremove();\n\t}", "public void isShot() {\r\n\t\tlives -=1;\r\n\t\tif(isDead())\r\n\t\t{\r\n\t\t\tthis.erase();\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void onDeath() {\n\t\ta.remove();\r\n\t}", "public void enemyoff(){\n getWorld().removeObject(this);\n }", "public void kill()\n\t{\n\t\tthis.isDead = true;\n\t\tSystem.out.println(name + \" died!\");\n\t\t//GamePanel.player.playerCombatant.awardXP(this.getXP());\n\n\t\t//TODO: Reload last save or Exit\n\t}", "@Override\n\tpublic void despawn() {\n\t\t\n\t}", "public void alienDestroyed() {\r\n\t\t// Place 6 debris objects where the alien was located\r\n\t\tplaceDebris(alien.getX(), alien.getY());\r\n\t\tplaceDebris(alien.getX() + 1, alien.getY() + 1);\r\n\r\n\t\t// Update the score\r\n\t\tnumScore += ALIENSHIP_SCORE[alien.getSize()];\r\n\t\tdisplay.setScore(numScore);\r\n\r\n\t\t// Expire the alien from the game\r\n\t\tParticipant.expire(alien);\r\n\r\n\t\t// Open the Alien destroyed sound in enhanced mode\r\n\r\n\t\topenAlienDestroyedSound();\r\n\r\n\t\t// Schedule a transition if all aliens have been destroyed\r\n\t\tif (pstate.countAliens() == 0) {\r\n\t\t\tscheduleTransition(END_DELAY);\r\n\t\t}\r\n\t}", "@Override\n public void kill() {\n alive = false;\n Board.getInstance().setPoints(points);\n }", "public void destroy() {\n this.alive = false;\n }", "public void destroy() {\n destroying = true;\n }", "public void checkForRemoval()\n {\n if (life <= 0)\n {\n SideScrollingWorld world = (SideScrollingWorld) getWorld(); \n \n world.isPacmanDead = true;\n getWorld().removeObject(this);\n }\n }", "public void destroy() {\n\t\tgone = true;\n\t}", "public void destroy() {\n this.game.deleteObject(this);\n }", "public void deadPlayer() {\r\n\t\tthis.nbPlayer --;\r\n\t}", "@Override\n public void destroy() {\n super.destroy();\n dungeon.removeEntity(this);\n }", "public void flightDisappear();", "public void die() {\n\t\tsetDead(true);\n\t\tsetHp(0);\n\t\tgetGraphicShapes().get(stats.getBODY()).setLocation((int) getPosition().x(),\n\t\t\t\t(int) getPosition().y() + stats.getHeight() - stats.getWidth());\n\t\tgetGraphicShapes().get(stats.getBODY()).setSize(stats.getHeight(), stats.getWidth());\n\t\tgetPhysicalRectangle().setLocation((int) getPosition().x(),\n\t\t\t\t(int) getPosition().y() + stats.getHeight() - stats.getWidth());\n\t\tgetPhysicalRectangle().setSize(stats.getHeight(), stats.getWidth());\n\t\tgetGraphicShapes().remove(stats.getWEAPON());\n\t}", "public void destroy() {\n\t\tdestroyRadius();\r\n\t\tisDestroyed = true;\r\n\t\ttimer.stop();\r\n\t\tthis.x -= 50;\r\n\t\tthis.y -= 50;\r\n\t\ttimer.setDelay(100);\r\n\t\ttimer.start();\r\n\t}", "@Override\n public void exit() {\n player.steeringBehaviorsManager.removeBehavior(ballPursuit);\n }", "public void destroy()\r\n\t{\r\n\t\tlog.fine(\"destroy\");\r\n\t}", "void ship_respawn() {\n ship.resetPosition();\n ship_image_view.setX(ship.x_position); // Update the ship image position\n }", "public boolean removeShip(int shipId) {\r\n\t\tif (!ships.containsKey(shipId))\r\n\t\t\treturn false;\r\n\t\tships.get(shipId).destroy();\r\n\t\tships.remove(shipId);\t\r\n\t\t--remainingShips;\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onDeath() {\n\t\tsuper.onDeath();\n\n\t\ttentacles.stream().filter(npc -> !npc.isDead()).forEach(npc -> npc.setDead(true));\n\t\trespiratorySystems.stream().filter(npc -> !npc.isDead()).forEach(npc -> npc.setDead(true));\n\t\tspawns.stream().filter(npc -> !npc.isDead()).forEach(npc -> npc.setDead(true));\n\n\t\ttentacles.clear();\n\t\trespiratorySystems.clear();\n\t\tspawns.clear();\n\t}", "@Override\r\n\tpublic void death() {\n\t\tthis.dead = true;\r\n\t\tGamePanel.zigzag=true;\r\n\t\tGamePanel.messages.add(new Messages((int)(this.x),(int)(this.y),\"zigzag\",color2));\r\n\t\tfor(int i = 0; i<GamePanel.blueCircles.size();i++){\r\n\t\tGamePanel.blueCircles.get(i).zigzag=true;\r\n\t\tGamePanel.blueCircles.get(i).color = new Color(236,214,19);\r\n\t\tGamePanel.blueCircles.get(i).color2 = new Color(243,230,112);\r\n\t\tGamePanel.blueCircles.get(i).points = 16;\r\n\t\tGamePanel.blueCircles.get(i).zigzag();\r\n\t\t}\r\n\t\t\r\n\t}", "public void removeShipment(){\n String message = \"Choose one of the shipment to remove\";\n if (printData.checkAndPrintShipment(message,data.getBranchEmployee(ID).getBranchID())){\n subChoice = GetChoiceFromUser.getSubChoice(data.numberOfShipment());\n if (subChoice!=0){\n data.getBranch(data.getShipment(subChoice-1).getBranchID()).removeShipment(data.getShipment(subChoice-1));\n data.removeShipment(data.getShipment(subChoice-1),data.getShipment(subChoice-1).getReceiver());\n System.out.println(\"Your Shipment has removed Successfully!\");\n }\n }\n }", "public void removePawn() {\n lives = 0;\n }", "public void die()\n {\n World world;\n world=getWorld();\n world.removeObject(this);\n }", "@Override\n\tpublic void destroy()\n\t{\n\t\tprojectileCount--;\n\t\trbCount--;\n\t}", "public final void die() {\n this.getLocation().removeUnit(Player.SYSTEM);\n }", "@Override\n public void unInvoke() {\n final Environmental item = affected;\n if (item == null)\n return;\n final Room room = CMLib.map().roomLocation(item);\n if ((canBeUninvoked()) && (room != null))\n room.showHappens(CMMsg.MSG_OK_VISUAL, item, L(\"<S-YOUPOSS> flaming sword is consumed!\"));\n super.unInvoke();\n if ((canBeUninvoked()) && (room != null)) {\n room.recoverRoomStats();\n item.destroy();\n }\n }", "boolean isDestroyed() {\n return destroyed;\n }", "public void destroy() {\n World.getInstance().getTracked().remove(this); // unregister self from World\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n flightViewModel.reset();\n }", "public boolean isDestroyed() {\n\t\treturn gone;\n\t}", "synchronized void destroy() {\n destroyed = true;\n }", "public void lostLife(){\r\n\t\tthis.lives--;\r\n\t}", "public void deleteLaser() {\n shotVisible = false;\n shot.setVisible(false);\n }", "public void terminate(){\n tState.stop();\n tMovement.stop();\n collision.remove(this); \n }", "public void destroy()\n {\n GeneticRobots.rmCollider(this.collider);\n GeneticRobots.rmObject(this);\n }", "public void destroy()\r\n\t{\n\t\t\r\n\t}", "@Override\n \tpublic void collided(Entity x) {\n \t\t\n \t\tx.destroy();\n \t\t\n \t}", "@Override\n\tpublic void closeWindow() {\n\t\tfrmShip.dispose();\n\t}", "public void onPlayerDestroy(World worldIn, BlockPos pos, IBlockState state)\n {\n this.func_180692_a(worldIn, pos, state, (EntityLivingBase)null);\n }", "public void removeFromGame(){\n this.isInGame = false;\n }", "@Override\r\n\tprotected void onDestroy()\r\n\t{\n\t\tGPSLocation.removeLocation();\r\n\t\tsuper.onDestroy();\r\n\t}", "@Override\n protected void onDestroy() {\n Spotify.destroyPlayer(this);\n super.onDestroy();\n }", "public void onImpact() {\n die();\r\n this.getArrow().remove();\r\n }", "public void kill()\r\n {\n if(isTouching(TopDownPlayer.class))\r\n {\r\n health(1);\r\n\r\n getWorld().removeObject(player);\r\n //getWorld().addObject (new Test(), 20, 20);\r\n\r\n }\r\n // if(healthCount >= 1)\r\n // {\r\n // World world;\r\n // world = getWorld();\r\n // getWorld().removeObject(player);\r\n // \r\n // getWorld().addObject (new Test(), 20, 20);\r\n // }\r\n }", "public void Gamefinished()\n\t\t{\n\t\t\tplayers_in_game--;\n\t\t}", "public void leave() throws InterruptedException {\n inship.clear();\n // your code here\n\n }", "private void deathRoom()\n {\n if(currentRoom.equals(deathRoom4))\n {\n alive = false;\n }\n }", "public boolean isDestroyed(){\n return destroyed;\n }", "public void leaveRoom(Person x) {\n\t\toccupant = null;\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void EleaveRoom(Enemy1 x)\n\t{\n\t\toccupant = null;\n\t}", "protected void die()\n\t{\n\t\tdead = true;\n\t\tcurrentCell.setOccupant(null);\n\t\tcurrentCell = null;\n\t}", "public void death(){\n setCoordinate(super.getGameImage().getCoordInit());\n diminueVies();\n super.initAnimation();\n\n }", "public void leaveRoom(Person x)\n {\n occupant = null;\n }", "public void leaveRoom(Person x)\n {\n occupant = null;\n }", "public void lifeLost() {\n\t\t--lives;\n\t\tif (lives == 0) {\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public synchronized void removeLife()\n\t{\n\t\t--lives;\n\n\t\tif (lifeLostListener != null)\n\t\t\tlifeLostListener.onLifeLost();\n\t}", "@Override\r\n public void uncall() {\r\n Player player = MbPets.getInstance().getServer().getPlayer(getOwner());\r\n if (player != null) {\r\n if (getEntity().getInventory().getDecor() != null) {\r\n if (player.getInventory().firstEmpty() >= 0) {\r\n player.getInventory().addItem(getEntity().getInventory().getDecor());\r\n } else {\r\n player.getWorld().dropItemNaturally(player.getLocation(),\r\n getEntity().getInventory().getDecor());\r\n }\r\n }\r\n }\r\n super.uncall();\r\n }", "protected void fireDestroyedState() {\n\t\t\n\t\tif (!stateHandler().waitToWhen(new IsAnyState(), new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tstateHandler().setState(ParentState.DESTROYED);\n\t\t\t\tstateHandler().fireEvent();\n\t\t\t}\n\t\t})) {\n\t\t\tthrow new IllegalStateException(\"[\" + StructuralJob.this + \"] Failed set state DESTROYED\");\n\t\t}\n\t\tlogger().debug(\"[\" + this + \"] Destroyed.\");\t\t\t\t\n\t}", "@Override\r\n\tpublic void onDeath() {\n\t\t\r\n\t}", "public void unassignEnergyToShip(AbstractObject source) {\n\t\tenergyToShip.remove(source.getId());\n\t}", "public void shotShip() {\r\n score -= 20;\r\n System.out.println(\"Current Score = \"+score);\r\n }", "public void kill() {\r\n \t\tthis.isDead = true;\r\n \t}", "boolean isDestroyed();", "boolean isDestroyed();", "@Override\r\n\tpublic void onProjectileDestroyed(Projectile projectile) {\r\n\t\t// Send notification that a movable has been destroyed\r\n\t\tControllerEventSource.notifyMovableDestroyed(projectile);\r\n\t}", "@Override\r\n\tpublic void onExit() {\n\t\tm_zombieTypeArray.removeAll(m_zombieTypeArray);\r\n\t\tm_zombieJointArray.removeAll(m_zombieJointArray);\r\n\t\tsuper.onExit();\r\n\t}", "@Override\r\n\tpublic void destroy()\r\n\t{\n\t\t\r\n\t}", "public void destroy()\r\n\t{\r\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\n\t\t// Log\n\t\tString log_msg = \"Destroying...\";\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\tthis.finish();\n\t\t\n\t\tthis.overridePendingTransition(0, 0);\n\t\t\n\t\tlocationObtained = false;\n\t\t\n\t}", "@Override\n \tpublic void notifyDeath() {\n \t\tGame.GAME_STATE = Game.GAME_STATE_DEAD;\n \t\t\n \t}", "public boolean isDestroyed()\n\t\t{\n\t\t\treturn destroyed;\n\t\t}", "public void updateLife(){\n lifeTime--;\n if(lifeTime <= 0){\n destroyed = true;\n }\n }", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "private void quitarCorazones(){\n if(ramiro.estadoItem== Ramiro.EstadoItem.NORMAL){\n efectoDamage.play();\n vidas--;\n }\n }", "public void die() {\n\t\tdead = true;\n\t\tthis.notifyStatChangeObservers(new StatChange(StatType.LIVES_LEFT, -1));\n\t\tif (getStat(StatType.LIVES_LEFT) == 0) {\n\t\t\tmodel.setState(GameStateType.GAME_OVER);\n\t\t} else {\n\t\t\tthis.setLocation(getStartingLocation());\n\t\t\tdead = false;\n\t\t}\n\t}", "protected void end() {\n\t\tshooter.stopShooter();\n\t}", "public void gameOver() {\r\n\t\t// Clean up the model layer\r\n\t\tModelEventSource.clear();\r\n\t\tStargate.clearStargates();\r\n\r\n\t\t//\r\n\t\tisReplicatorMoving = false;\r\n\t\tplayers.clear();\r\n\t\treplicator = null;\r\n\t\tzpmSet.clear();\r\n\t}", "public void lose(){\n // If this object is not the current arena state obsolete it.\n if(this != battleState) return;\n\n isOver = true;\n battleStateLose();\n }", "public void decreaseLife() {\n this.terminate();\n }" ]
[ "0.69015414", "0.66642547", "0.6660268", "0.65595853", "0.6535525", "0.63165873", "0.6292884", "0.62574303", "0.62554246", "0.6222851", "0.61889017", "0.6183574", "0.61793405", "0.6150211", "0.6147373", "0.6144781", "0.61039114", "0.61028653", "0.6019736", "0.6018219", "0.59674567", "0.5966012", "0.59533685", "0.59528434", "0.59465235", "0.59392655", "0.59298414", "0.5929563", "0.59283286", "0.59147084", "0.58986735", "0.58632576", "0.58592874", "0.5852852", "0.58330786", "0.5831351", "0.582565", "0.58230853", "0.58045596", "0.5800053", "0.57983005", "0.579782", "0.57940984", "0.5781584", "0.5778196", "0.57751334", "0.5771457", "0.5768121", "0.5749214", "0.57471", "0.57462436", "0.574606", "0.57415366", "0.5736837", "0.57301736", "0.572462", "0.57060623", "0.5702643", "0.5701306", "0.5700097", "0.569334", "0.56914383", "0.56914383", "0.56914383", "0.56914383", "0.5688373", "0.5677031", "0.56767106", "0.56747293", "0.56747293", "0.567101", "0.56635207", "0.5651231", "0.565034", "0.5642128", "0.5637524", "0.5634816", "0.56263685", "0.5625468", "0.5625468", "0.5624749", "0.5623639", "0.56227815", "0.5622521", "0.5621671", "0.561914", "0.5610764", "0.5609369", "0.56088287", "0.56088287", "0.56088287", "0.56088287", "0.56088287", "0.56088287", "0.56077546", "0.56055665", "0.5605084", "0.55976987", "0.55968666", "0.5594656" ]
0.8447505
0
An asteroid of the given size has been destroyed
public void asteroidDestroyed(int size) { // Update score based on asteroid size numScore += ASTEROID_SCORE[size]; display.setScore(numScore); // If all the asteroids are gone, schedule a transition if (pstate.countAsteroids() == 0) { scheduleTransition(END_DELAY); } openAsteroidSound(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void shrinkSquare()\n {\n squareSize--;\n }", "public void breakApart(final Asteroids asteroids)\n {\n Double2D location = asteroids.field.getObjectLocation(this);\n int[] sizes = breakMap[size][asteroids.random.nextInt(breakMap[size].length)];\n \n if (sizes.length > 0)\n {\n // break into asteroids\n int sum = 0;\n for(int i = 0; i < sizes.length; i++)\n sum += sizes[i];\n \n // compute velocities\n double explosionForce = asteroids.random.nextDouble() * (MAXIMUM_EXPLOSION_FORCE - MINIMUM_EXPLOSION_FORCE) + MINIMUM_EXPLOSION_FORCE;\n double sumForceX = 0;\n double sumForceY = 0;\n for(int i = 0; i < sizes.length; i++)\n {\n double angle = asteroids.random.nextDouble() * Math.PI * 2;\n double force = explosionForce / sizes.length;\n double forceX = force * Math.cos(angle);\n double forceY = force * Math.sin(angle);\n if (i == sizes.length - 1)\n { forceX = -sumForceX; forceY = -sumForceY; } // last one ought to balance out the others. It's best if it's the biggest one, hence why we list smaller asteroids first\n else { sumForceX += forceX; sumForceY += forceY; }\n // yes, this is a dead store\n Asteroid a = new Asteroid(asteroids, sizes[i], new MutableDouble2D(velocity.x + forceX, velocity.y + forceY), location);\n }\n }\n else\n {\n breakIntoShards(asteroids);\n }\n end(asteroids);\n asteroids.asteroidCount--;\n if (asteroids.asteroidCount <= 0)\n {\n asteroids.schedule.scheduleOnceIn(asteroids.WAIT_PERIOD, new Steppable()\n {\n public void step(SimState state)\n {\n asteroids.createAsteroids();\n }\n });\n }\n }", "public void asteroidCol()\n\t{\n\t\t//collision can only occur if at least 2 asteroids are spawned\n\t\tif(gameObj[0].size() >=2)\n\t\t{\n\t\t\tint ast = new Random().nextInt(gameObj[0].size());\n\t\t\tgameObj[0].remove(ast);\n\t\t\tast = new Random().nextInt(gameObj[0].size());\n\t\t\tgameObj[0].remove(ast);\n\t\t\tSystem.out.println(\"2 asteroids have collided and been removed from the world\");\n\t\t}else\n\t\t\tSystem.out.println(\"2 asteroids are not spawned\");\n\t}", "public void destroyed() {\n\t\twidth = SIZE_INC * width;\n\t\t// make the end points at the new location\n\t\tthis.makeEndPoints(width, (0 - (xSpeed * width)),\n\t\t\t\t(0 - (ySpeed * width)));\n\n\t}", "public void asteroidShot()\n\t{\n\t\t//collision can only occur if at least 1 asteroid\n\t\t//and one missile are currently spawned\n\t\tif(gameObj[0].size() > 0 && gameObj[4].size() > 0)\n\t\t{\n\t\t\tint ast = new Random().nextInt(gameObj[0].size());\n\t\t\tint mis = new Random().nextInt(gameObj[4].size());\n\t\t\tgameObj[0].remove(ast);\n\t\t\tgameObj[4].remove(mis);\n\t\t\tscore += 100;\n\t\t\tSystem.out.println(\"A friendly missile has struck an asteroid! +100 points\");\n\t\t}else\n\t\t\tSystem.out.println(\"An asteroid and a friendly missile are not spawned\");\n\t}", "public void enlargeSquare()\n {\n squareSize++;\n }", "public void wipe(){\n\t \tg2d.setColor(Color.yellow);\n g2d.fillRect(0,0, width, height);\n\t\t\n\n\t }", "public Asteroid()\r\n\t{\r\n\t\tsuper.setDirection(rn.nextInt(360));\r\n\t\tsuper.setSpeed(rn.nextInt(100));\r\n\t\tsuper.setLocalX(rn.nextFloat() * 1024);\r\n\t\tsuper.setLocalY(rn.nextFloat() * 786);\r\n\t\tsuper.setColor(250);\r\n\t\tsize = rn.nextInt(10);\r\n\t\t\r\n\t}", "public Asteroid(Asteroids asteroids, int size, MutableDouble2D velocity, Double2D location)\n {\n this.size = size;\n this.velocity = velocity;\n stopper = asteroids.schedule.scheduleRepeating(this);\n shape = shapes[size][asteroids.random.nextInt(shapes[size].length)];\n rotationalVelocity = asteroids.random.nextDouble() * MAXIMUM_ROTATIONAL_VELOCITY *\n (asteroids.random.nextBoolean() ? 1.0 : -1.0);\n orientation = asteroids.random.nextDouble() * Math.PI * 2;\n asteroids.field.setObjectLocation(this, location);\n asteroids.asteroidCount++;\n }", "void nuke() {\n\t\tfor (int a = 0; a < height; a++) {\n\t\t\tfor (int b = 0; b < width; b++) {\n\t\t\t\tif (FWorld[a][b] != null) {\n\t\t\t\t\tEZ.removeEZElement(FWorld[a][b]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tEZ.removeEZElement(background);\n\t\tEZ.removeEZElement(explosion);\n\t\tturtle.kill();\n\t}", "private JCStatement makeInvalidateSize() {\n // Initialize the singleton synthetic item vars (during IS_VALID phase)\n // Bound sequences don't have a value\n ListBuffer<JCStatement> stmts = ListBuffer.lb();\n for (int i = 0; i < length; ++i) {\n if (!isSequence(i)) {\n stmts.append(SetStmt(vsym(i), CallGetter(i)));\n }\n }\n JCStatement varInits = Block(stmts);\n \n return\n Block(\n If(IsTriggerPhase(),\n setSequenceValid(),\n varInits\n ),\n SetStmt(sizeSymbol, cummulativeSize(length)),\n CallSeqInvalidate(Int(0), Int(0), Get(sizeSymbol))\n );\n }", "@Override\n\tpublic void destroy()\n\t{\n\t\tprojectileCount--;\n\t\trbCount--;\n\t}", "public void deleteAsteroid(AsteroidsAsteroid asteroid) {\n\t\tasteroids.remove(asteroid);\n\t\tasteroid.destroy();\n\t}", "void reset(int size) {\n\t\tpoint[0].position.set(center.x - size, center.y - size);\n\t\tpoint[1].position.set(center.x + size, center.y - size);\n\t\tpoint[2].position.set(center.x + size, center.y + size);\n\t\tpoint[3].position.set(center.x - size, center.y + size);\n\t\trelease();\n\t}", "public void shrinkSnake() {\n\t\tSnakeObj.length--;\n\t\tSnakeArray[xTail][yTail] = 0; \n\t\txTail--;\n\t\tyTail--; \n\t\tthis.repaint(); \n\t}", "void deathHandler(Enemy e) {\n\n if (e != null) {\n Explosion rip = new Explosion();\n rip.kaboom.moveToPoint(e.eTank.getX(), e.eTank.getY());\n // println(\"made enemy\");\n rip.kaboom.frontAngle(90);\n rip.kaboom.turn(90);\n explosion.add(rip);\n }\n for (Explosion exp: explosion) {\n if (exp.kaboomCounter > 1) {\n exp.kaboom.display();\n }\n // if (exp.kaboomCounter < 1) {\n // explosion.remove(exp);\n // }\n // else {\n exp.kaboomCounter -= 3;\n // println(exp.kaboomCounter);\n // println(explosion.size());\n // }\n }\n\n}", "public Asteroid() {\n setShape(new Polygon(astx, asty, astx.length));\n setAlive(true);\n setColor(new Color(160, 82, 45));\n }", "@Override\n void planted() {\n super.planted();\n TimerTask Task = new TimerTask() {\n @Override\n public void run() {\n\n for (Drawable drawables : gameState.getDrawables()) {\n if (drawables instanceof Zombie) {\n int distance = (int) Math.sqrt(Math.pow((drawables.x - x), 2) + Math.pow((drawables.y - y), 2));\n if (distance <= explosionradious) {\n ((Zombie) drawables).hurt(Integer.MAX_VALUE);\n }\n }\n }\n\n life = 0;\n }\n\n };\n\n Timer timer = new Timer();\n timer.schedule(Task, 2000);\n }", "public Asteroid () {\n\t\tImage asteroid = new Image(getClass().getClassLoader().getResourceAsStream(\"asteroid.png\"));\n\t\timage = new ImageView(asteroid);\n\t\tsetX(Math.random() * (Main.SIZEX - this.getXSize()));\n\t\tsetY(0);\n\t\tvelocityY = -45;\n\t\tvelocityX = 0;\n\t}", "@Override\n\tpublic void despawn() {\n\t\t\n\t}", "public void crashAsteroidPS()\n\t{\n\t\t//collision can only occur if at least one asteroid and\n\t\t//a PlayerShip are spawned\n\t\tif(gameObj[1].size() > 0 && gameObj[0].size() > 0)\n\t\t{\n\t\t\tint ast = new Random().nextInt(gameObj[0].size());\n\t\t\tgameObj[0].remove(ast);\n\t\t\tgameObj[1].remove(0);\n\t\t\tlives--;\n\t\t\tSystem.out.println(\"An asteroid has struck the players ship -1 life\");\n\t\t\tif(lives >0) \n\t\t\t\tSystem.out.println(\"you have \" + lives + \" lives left\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Game over\");\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}else\n\t\t\tSystem.out.println(\"A player ship and an asteroid are not spawned\");\n\n\t}", "private void removeDestroyedObjects ()\n {\n Collection<Asteroid> newAsteroids = new ArrayList<>(this.game.getAsteroids().size() * 2); // Avoid reallocation and assume every asteroid spawns successors.\n this.game.getAsteroids().forEach(asteroid -> {\n if (asteroid.isDestroyed()) {\n this.increaseScore();\n newAsteroids.addAll(asteroid.getSuccessors());\n }\n });\n this.game.getAsteroids().addAll(newAsteroids);\n // Remove all asteroids that are destroyed.\n this.game.getAsteroids().removeIf(GameObject::isDestroyed);\n // Remove any bullets that are destroyed.\n this.game.getBullets().removeIf(GameObject::isDestroyed);\n }", "void clear()\n\t\t{\n\t\t\tsides = 0;\n\t\t\td = new Dimension[0];\n\t\t}", "@Override\n\tpublic void update(double dt) {\n\t\tcurrentSurvivalTime += dt;\n\t\texplosionCurrentSize = currentSurvivalTime * explosionFinalSize / survivalTime;\n\t\tif (explosionCurrentSize > explosionFinalSize) {\n\t\t\trules.deleteObject(this);\n\t\t}\n\t}", "public void crashAsteroidNPS()\n\t{\n\t\t//collision can only occur if at least 1 asteroid and\n\t\t//one NPS are spawned\n\t\tif(gameObj[2].size() > 0 && gameObj[0].size() > 0)\n\t\t{\n\t\t\tint ast = new Random().nextInt(gameObj[0].size());\n\t\t\tgameObj[0].remove(ast);\n\t\t\tint nps = new Random().nextInt(gameObj[2].size());\n\t\t\tgameObj[2].remove(nps);\n\t\t\tSystem.out.println(\"An asteroid and a NPS have collided and been removed from the game\");\n\t\t}else\n\t\t\tSystem.out.println(\"An asteroid and a non player ship are not spawned\");\n\t}", "public void destroy() {\n\t\tdestroyRadius();\r\n\t\tisDestroyed = true;\r\n\t\ttimer.stop();\r\n\t\tthis.x -= 50;\r\n\t\tthis.y -= 50;\r\n\t\ttimer.setDelay(100);\r\n\t\ttimer.start();\r\n\t}", "void retract()\n\t\t{\n\t\t\tsides = sides-1;\n\t\t\t\n\t\t\tDimension[] dime2 = new Dimension[d.length - 1];\n\t\t\t\n\t\t\tfor (int i=0; i< d.length-1; i++)\n\t\t\t{\n\t\t\t\tdime2[i]= d[i];\n\t\t\t}\n\t\t\t\n\t\t\td = new Dimension[d.length - 1];\n\t\t\tfor(int i = 0; i< dime2.length; i++)\n\t\t\t{\n\t\t\t\td[i] = dime2[i];\n\t\t\t}\n\t\t\t\t\n\t\t}", "abstract protected boolean clearSquareHitMine(Location m);", "private void placeAsteroids() {\r\n\t\taddParticipant(new Asteroid(0, 2, EDGE_OFFSET, EDGE_OFFSET, speed, this));\r\n\t\taddParticipant(new Asteroid(1, 2, SIZE - EDGE_OFFSET, EDGE_OFFSET, 3, this));\r\n\t\taddParticipant(new Asteroid(2, 2, EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this));\r\n\t\taddParticipant(new Asteroid(3, 2, SIZE - EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this));\r\n\t}", "public Asteroid(String textureFileName, float x, float y, int sizeX, int sizeY){\r\n super(textureFileName, x, y, sizeX, sizeY);\r\n rotationNumber = randomRotation();\r\n setRotation(rotationNumber);\r\n getSprite().setOriginCenter();\r\n }", "private void createAsteroidExplosion(AsteroidsAsteroid asteroid) {\n\t\tAsteroidsExplosion explosion = new AsteroidsExplosion(GameObject.ROOT, this, 25, asteroid.getRadius() * 3.0, 1.0);\n\t\texplosion.translate(asteroid.getPositionVector());\n\t\totherObjects.add(asteroid);\n\t}", "private void addAsteroids(int count)\n {\n int x;\n int y;\n \n for(int i = 0; i < count; i++)\n {\n x = Greenfoot.getRandomNumber(getWidth()/2);\n y = Greenfoot.getRandomNumber(getHeight()/2);\n addObject(new Asteroid(), x, y);\n }\n }", "public void sizeDecrease1() {\n\t\t _size--;\n\t}", "public void drawSquare(double size) {\r\n\t\t\r\n\t\t//if the size is a negative number, throw an error\r\n\t\tif (size <= 0) {\r\n\t\t\tthrow new RuntimeException(\"Errordaniel - invalid size\");\r\n\t\t}\r\n\r\n\t\t//by the saved word 'super' we call to 'tailDown' function in 'SimpleTurtle' class from that we inherit her\r\n\t\t//take the turtle tail down so he will leave traces\r\n\t\tsuper.tailDown();\r\n\r\n\t\t//a square has 4 sides so the turtle should be rotated after 3 sides.\r\n\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\tmoveForward(size);\r\n\t\t\tsuper.turnRight(90);\r\n\t\t}\r\n\r\n\t\t//paint the last side\r\n\t\tmoveForward(size);\r\n\t}", "public void isShot() {\r\n\t\tlives -=1;\r\n\t\tif(isDead())\r\n\t\t{\r\n\t\t\tthis.erase();\r\n\t\t}\r\n\t}", "public void moveTowards(){\n \n \n \n if(!exploded){\n \n \n move(speed);\n \n if(isTouching(Enemy.class)){\n move(explosionRadius); \n \n inRange = (ArrayList) getObjectsInRange(explosionRadius + 25, Enemy.class);\n for(Enemy e : inRange){\n e.hit(damage);\n }\n \n //explode\n exploded = true;\n \n image = new GreenfootImage(\"50x50 aoe.png\");\n image.scale(explosionRadius*2, explosionRadius*2);\n setImage(image);\n //getWorld().removeObject(this);\n }\n else if (isAtEdge())\n {\n getWorld().removeObject(this);\n }\n else if ( radius < distance) {\n getWorld().removeObject(this); \n }\n }\n else{\n setImage(image);\n image.setTransparency(image.getTransparency() - 5);\n if(image.getTransparency() <= 0) getWorld().removeObject(this);\n }\n }", "public void tick() {\n if (alpha > life ){\n alpha -= (life - 0.0001f);\n }else {\n handler.removeObject(this);\n }\n }", "public void placeAlien(int size) {\r\n\r\n\t\tif (pstate.countAliens() == 0) {\r\n\t\t\t// create a random int with a value of either 1 or -1\r\n\t\t\tint a = -1;\r\n\t\t\tint j = RANDOM.nextInt(2);\r\n\t\t\tif (j == 0) {\r\n\t\t\t\ta = -1;\r\n\r\n\t\t\t} else {\r\n\t\t\t\ta = 1;\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Create a random value for the starting y position of the alien\r\n\t\t\tint i = RANDOM.nextInt(SIZE);\r\n\r\n\t\t\t\r\n\t\t\t// Create the alien\r\n\t\t\talien = new Alien(0, i, 0, a * 6, size, this);\r\n\t\t\tnew ParticipantCountdownTimer(alien, \"create\", ALIEN_DELAY);\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic final void purge() {\r\n\t\tthis.members.clear();\r\n\t\tthis.age++;\r\n\t\tthis.gensNoImprovement++;\r\n\t\tthis.spawnsRequired = 0;\r\n\r\n\t}", "void removeAllSpawn();", "boolean placeHogWild(int numberOfArmies)\n\t{\n\tif (! hogWildCheck())\n\t\t{\n\t\treturn false;\n\t\t}\n\n\tplaceToOutnumberEnemies(numberOfArmies);\n\treturn true;\n\t}", "void removeBomb();", "void positionCleared();", "public void removePiece() {\n\t\troot.getChildren().clear();\n\t\tthis.piece = null;\n\t\troot.getChildren().add(rectangle);\n\t}", "public void terminate() {\r\n\t\tsetTerminated(true);\r\n\r\n\t\tTreeMap<Point, Square> oldSquares = new TreeMap<Point, Square>(squares);\r\n\t\tfor (Map.Entry<Point, Square> e : oldSquares.entrySet()) {\r\n\t\t\tremoveAsSquareAt(e.getKey());\r\n\t\t}\r\n\r\n\t\tassert getNbSquares() == 0;\r\n\r\n\t\tif (getParentDungeon() != null) {\r\n\t\t\tgetParentDungeon().removeAsSubDungeon(this);\r\n\t\t}\r\n\r\n\t\t// When this method is left, all invariant are met\r\n\t\tassert hasProperSquares();\r\n\t\tassert hasProperParentDungeon();\r\n\t}", "public void decreaseDiamond() {\r\n\t\tthis.diamondCount--;\r\n\t}", "private void growSnake() { \r\n length++;\r\n snake[length-1].row = snake[length-2].row;\r\n snake[length-1].column = snake[length-2].column;\r\n if (snake[length-2].direction == UP) snake[length-1].row++;\r\n else if (snake[length-2].direction == DOWN) snake[length-1].row--;\r\n else if (snake[length-2].direction == LEFT) snake[length-1].column++;\r\n else if (snake[length-2].direction == RIGHT) snake[length-1].column--; \r\n }", "public void clear(){\r\n currentSize = 0;\r\n }", "public void unassignAsteroidToShip(Asteroid asteroid) {\n\t\tasteroidToShip.remove(asteroid.getId());\n\t}", "public void growSnake() {\n\t\tSnakeObj.length++;\n\t\txHead++;\n\t\tyHead++; \n\t\tSnakeArray[xHead][yHead] = 1; \n\t\tthis.repaint(); \n\t}", "private void reapDeadRabbits() {\n for (int i = (rabbitList.size() - 1); i >= 0; i--) {\n RabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n if (rabbit.getEnergy() <= 0) {\n space.removeRabbitAt(rabbit.getX(), rabbit.getY());\n rabbitList.remove(i);\n }\n }\n }", "private void releaseShape(int x, int y) {\n if (holding == null) return;\n\n double newX = holding.getMinX();\n double newY = holding.getMinY();\n\n holding.moveTo(oldX, oldY);\n model.execute(new MoveShape(model.getWhiteBoard(), holding, x - diffX, y - diffY));\n\n holding = null;\n }", "void removeBall(Coordinates at);", "public Asteroid makeAsteroid() {\r\n\t\tAsteroid asteroid = new AsteroidImpl(startBounds.x, random(startBounds.y,startBounds.height)\r\n\t\t\t\t\t\t\t\t\t\t\t, random(10,40), random(10,40)\r\n\t\t\t\t\t\t\t\t\t\t\t, random(1,4));\r\n\t\treturn asteroid;\r\n\t}", "public void die(){\n\t\tboolean success = false;\n\t\ttile.setAnimal(null);\n\t\treleasePandas();\n\n\t\twhile(!success){\n\t\t\tRandom rng = new Random();\n\t\t\tInteger idx =rng.nextInt(gf.gp.getTiles().size());\n\t\t\tif(gf.gp.getTiles().get(idx).getAnimal() == null && gf.gp.getTiles().get(idx).getEntity() == null) {\n\t\t\t\tsuccess = spawn(gf.gp.getTiles().get(idx)); break;\n\t\t\t}\n\t\t}\n\t}", "public int[] asteroidCollision(int[] asteroids) {\n Stack<Integer> stack = new Stack<>();\n int i = 0;\n while(i < asteroids.length) {\n if(!stack.isEmpty() && stack.peek() > 0 && asteroids[i] < 0) {\n int left = Math.abs(stack.peek());\n int right = Math.abs(asteroids[i]);\n if(left > right) i++; // right asteroid is destroyed\n else if(left < right) stack.pop(); // left is destroyed\n else {\n // both left and right are destroyed\n stack.pop();\n i++;\n }\n }\n else {\n stack.push(asteroids[i]);\n i++;\n }\n }\n // Convert what is in the stack into the array\n int[] result = new int[stack.size()];\n for(int j = result.length-1; j >= 0; j--)\n result[j] = stack.pop();\n return result;\n }", "public void reset()\t{\n\t\tthis.snake.clear();\r\n\t\tdir = 1;\r\n\t\tthis.snake.add(new Dimension(2,5));\r\n\t\tthis.snake.add(new Dimension(2,6));\r\n\t\tthis.snake.add(new Dimension(2,7));\r\n\t}", "public void puke(){\r\n top = null;\r\n size = 0;\r\n \r\n }", "public Asteroid() {\n\t\t// create, seed random number\n\t\trandomNumber = new Random();\n\n\t\t// random location\n\t\tlocation = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE);\n\n\t\t// random movement vector\n\t\tmovement = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED,\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED);\n\t\t\n\t\t// random radius\n\t\tsize = randomNumber.nextInt() % 20 + 1;\n\t\t\n\t\t// create Sphere\n\t\tsphere = new Sphere(size, location);\n\n\t}", "@Override\n\tpublic void tick(Location currentLocation) {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.tick(currentLocation);\n\t\tturnsToZombify--;\n\t\tif(turnsToZombify<=0&&!currentLocation.containsAnActor()) {\n\t\t\tcurrentLocation.removeItem(this);\n\t\t\tcurrentLocation.addActor(new Zombie(\"undead\"+name));\n\t\t\t\n\t\t}\n\t}", "public SmallAsteroid(int angle, int x, int y,FloatBuffer vertexBuffer)\n {\n super(angle, x, y,vertexBuffer);\n this.index = 16;\n this.radius /= 4;\n this.width = 13;\n this.height = 13;\n }", "public void tick()\n {\n //We have to respawn the circles if they reach the bottom of the screen\n if (hasPassed())\n {\n //Randomly reset the x coordinates.\n this.x = minRandom + new Random().nextFloat()*(maxRandom-minRandom);\n //Fixed Y spawn\n this.y = spawnY;\n //Randomly reset the width,height, and radius of the new asteroid\n int newHeight, newWidth;\n newHeight = 32 + (int) (new Random().nextFloat()*(64.0f-32.0f));\n newWidth = newHeight;\n setWidth(newWidth);\n setHeight(newHeight);\n this.radius = width*0.5f;\n //Create a new Random color\n Random gen = new Random();\n int red, green, blue = 50;\n do\n {\n red = 40 + (int) (gen.nextFloat()*(255.0f-40.0f));\n green = 40 + (int) (gen.nextFloat()*(255.0f-40.0f));\n blue = 40 + (int) (gen.nextFloat()*(255.0f-40.0f));\n } while (red != green && red != blue);\n \n this.color = new Color(red,green,blue);\n }\n else\n {\n fall();\n move();\n }\n }", "private void reapDeadRabbits() {\n\t\tfor (int i = (rabbitList.size() - 1); i >= 0; i--) {\n\t\t\tRabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n\t\t\tif (rabbit.getEnergy() < 1) {\n\t\t\t\trabbitSpace.removeRabbitAt(rabbit.getX(), rabbit.getY());\n\t\t\t\trabbitList.remove(i);\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void death() {\n\t\tthis.dead = true;\r\n\t\tGamePanel.zigzag=true;\r\n\t\tGamePanel.messages.add(new Messages((int)(this.x),(int)(this.y),\"zigzag\",color2));\r\n\t\tfor(int i = 0; i<GamePanel.blueCircles.size();i++){\r\n\t\tGamePanel.blueCircles.get(i).zigzag=true;\r\n\t\tGamePanel.blueCircles.get(i).color = new Color(236,214,19);\r\n\t\tGamePanel.blueCircles.get(i).color2 = new Color(243,230,112);\r\n\t\tGamePanel.blueCircles.get(i).points = 16;\r\n\t\tGamePanel.blueCircles.get(i).zigzag();\r\n\t\t}\r\n\t\t\r\n\t}", "public void clearRect(int x, int y, float width, float height);", "public void notAlive() {\n\n for (var i = ownedAnimals.size() - 1; i >= 0; i--) {\n if (ownedAnimals.get(i).healthPoints <= 0) {\n System.out.println(\"The \"\n + ownedAnimals.get(i).type\n + \" \" + ownedAnimals.get(i).animalName\n + \" died\");\n ownedAnimals.remove(i);\n\n\n }\n\n\n }\n }", "public void onImpact() {\n die();\r\n this.getArrow().remove();\r\n }", "public void clearCircle();", "public void shootGun() {\n\t\tammo--;\n\t}", "public void shoot(){\r\n\t\tif(numberOfArrows>0){\r\n\t\t\tnumberOfArrows--;\r\n\t\t\tPosition positionWumpus = b.getWumpus().getPosition();\r\n\t\t\tif (position.checkShoot(positionWumpus))\r\n\t\t\t\tb.getWumpus().kill();\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.out.println(\"There are no more arrows.\");\r\n\t}", "@Override\n\tpublic void clear() \n\t{\n\t\twhile (size!=0)\n\t\t{\n\t\t\t//to check if need to resize\n\t\t\tif(size==myArray.length/4)\n\t\t\t\tresizeDown();\n\t\t\tmyArray[size-1] = null;\n\t\t\tsize--;\n\t\t}\n\t\tsize=0;\n\t}", "public void removePawn() {\n lives = 0;\n }", "public void destroyArea(Entity[][] map, int x, int y){\r\n map[y][x] = null;\r\n //check if the area to destroy is within the map\r\n if ((x > 0) && (y > 0)){\r\n checkIfOtherType(map, y-1, x-1);\r\n map[y-1][x-1] = null;\r\n map[y-1][x-1] = new ExplodedArea(3, x-1, y-1);\r\n }\r\n if ((x + 1 < map.length) && (y + 1< map.length)){\r\n checkIfOtherType(map, y+1, x+1);\r\n map[y+1][x+1] = null;\r\n map[y+1][x+1] = new ExplodedArea(3, x+1, y+1);\r\n }\r\n if ((y > 0)){\r\n checkIfOtherType(map, y-1, x);\r\n map[y-1][x] = null;\r\n map[y-1][x] = new ExplodedArea(3, x, y-1);\r\n }\r\n if ((x +1 < map.length) && (y > 0)){\r\n checkIfOtherType(map, y-1, x+1);\r\n map[y-1][x+1] = null;\r\n map[y-1][x+1] = new ExplodedArea(3, x+1, y-1);\r\n }\r\n if ( x < map.length -1){\r\n checkIfOtherType(map, y, x+1);\r\n map[y][x+1] = null;\r\n map[y][x+1] = new ExplodedArea(3, x+1, y);\r\n }\r\n if(x > 0){\r\n checkIfOtherType(map, y, x-1);\r\n map[y][x-1] = null;\r\n map[y][x-1] = new ExplodedArea(3, x-1, y);\r\n }\r\n if (y < map.length-1){\r\n checkIfOtherType(map, y+1, x);\r\n map[y+1][x] = null;\r\n map[y+1][x] = new ExplodedArea(3, x, y+1);\r\n }\r\n if((x > 0) && (y < map.length -1)){\r\n checkIfOtherType(map, y+1, x-1);\r\n map[y+1][x-1] = null;\r\n map[y+1][x-1] = new ExplodedArea(3, x-1, y+1);\r\n }\r\n }", "public void endTurn() {\r\n\t\tint num = this.hand.size();\r\n\t\tfor (int i = 0; i < num; i++) {\r\n\t\t\tthis.discard.add(this.hand.remove(0));\r\n\t\t}\r\n\t\tint gemHeight = (int) this.totalGemValue() / 3;\r\n\t\tthis.drawFromBag(5 + gemHeight);\r\n\t}", "private void spiral() {\n\t\t// If in top right, increase size and go down right.\n\t\tif(xtraversed == size && ytraversed == size){\n\t\t\tsize++;\n\t\t\tmemory.nextMove = GameConstants.SOUTHEAST;\n\t\t\tytraversed--;\n\t\t\txtraversed++;\n\t\t}\n\t\t\n\t\t// If in top, go right.\n\t\telse if(ytraversed == size){\n\t\t\tmemory.nextMove = GameConstants.EAST;\n\t\t\txtraversed++;\n\t\t}\n\t\t\n\t\t// If in left, go up.\n\t\telse if(xtraversed == -size){\n\t\t\tmemory.nextMove = GameConstants.NORTH;\n\t\t\tytraversed++;\n\t\t}\n\t\t\n\t\t// If in bottom, go left.\n\t\telse if(ytraversed == -size){\n\t\t\tmemory.nextMove = GameConstants.WEST;\n\t\t\txtraversed--;\n\t\t}\n\t\t\n\t\t// If in right, go down.\n\t\telse if(xtraversed == size){\n\t\t\tmemory.nextMove = GameConstants.SOUTH;\n\t\t\tytraversed--;\n\t\t}\n\t\t\n\t\t// Else go right.\n\t\telse {\n\t\t\tmemory.nextMove = GameConstants.EAST;\n\t\t\txtraversed++;\n\t\t}\n\t}", "public void unsetSmallCircle()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(SMALLCIRCLE$2, 0);\n }\n }", "public void updateAsteroid(int height, int width) {\n if (isAlive()) {\n incX(getVelX());\n if (getX() < -20) {\n setX(width + 20);\n } else if (getX() > width + 20) {\n setX(-20);\n }\n\n incY(getVelY());\n if (getY() < -20) {\n setY(height + 20);\n } else if (getY() > height + 20) {\n setY(-20);\n }\n }\n }", "protected void shrink() {\n int cellsToDrop = snakeSize/2;\n this.snakeSize = snakeSize - cellsToDrop;\n // AMD: Reset the tip of the tail to be snake-free\n for (int xCell = 0; xCell < maxX; xCell++) {\n for (int yCell = 0; yCell < maxY; yCell++) {\n if (snakeSquares[xCell][yCell] > snakeSize) {\n snakeSquares[xCell][yCell] = NOT_A_SEGMENT;\n }\n }\n }\n }", "public void empty() {\n\t\tempty.setPosition(sprite.getX(),sprite.getY());\n\t\tsprite = empty;\n\t}", "public void growSnake() {\n grow = true;\n }", "public abstract void clearRect(int x, int y, int width, int height);", "public void clearVelocity();", "void sharpen();", "void sharpen();", "public void checkForRemoval()\n {\n if (life <= 0)\n {\n SideScrollingWorld world = (SideScrollingWorld) getWorld(); \n \n world.isPacmanDead = true;\n getWorld().removeObject(this);\n }\n }", "private void shootMove() {\n for (int i = 0; i < fires.size(); i++) {\n //子弹往上移动\n fires.get(i).move();\n //注意这里remove需要放在下面\n if (fires.get(i).y < -1000) {\n fires.remove(fires.get(i));\n }\n }\n\n }", "public void tick() {\r\n this.platform = new Rectangle(x, y, w, h);\r\n if(y> Java2DGame.SCREENHEIGHT){\r\n delete();\r\n }\r\n if(platform.intersects(Board.darkness.deathZone)){\r\n delete();\r\n }\r\n }", "public void die() {\n\t\tif (this.isGodModeEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.life--;\n\t\tresetPlayerPosition();\n\t\tthis.collisionBox.setRect(this.tilePositionX, this.tilePositionY,\n\t\t\t\tthis.SCALE, this.SCALE);\n\t}", "public Asteroid(){\n\t\t\n\t\t//call Sprite constructor\n\t\tsuper();\n for(int i =0;i<arrowAmount;i++)\n {\n arrows.add(new Arrow(Game.R.nextInt(4),Game.R.nextBoolean()));\n }\n\t\tinitialize();\n\t\tint nDY = Game.R.nextInt(speedLevel);\n\t\tsetDeltaY((double)nDY*0.03*CommandCenter.getLevel()+1);\n\n\n\t\t\n\n\t}", "void mineWave( LogicEngine in_logicEngine,int in_numberOfMines, boolean b_isStaggered,boolean randomX)\r\n\t{\r\n\t\tint i_numberOfMines=in_numberOfMines;\r\n\t\tif(randomX)\r\n\t\t\ti_numberOfMines=1;\r\n\t\t\r\n\t\t\r\n\t\t//String in_spritename, double in_x, double in_y, boolean in_rotateToV,int in_shootEverySteps\r\n\t\tfor(int i=0 ; i< i_numberOfMines ; i++)\r\n\t\t{\r\n\t\t\tGameObject mine = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/mine.png\",((double)i+0.5)* (LogicEngine.SCREEN_WIDTH/i_numberOfMines+1),LogicEngine.SCREEN_HEIGHT+5,5);\r\n\t\t\t\r\n\t\t\t//to do a interleafed pattern\r\n\t\t\tif(b_isStaggered)\r\n\t\t\t\tmine.v.setX(mine.v.getX()+(LogicEngine.SCREEN_WIDTH/((i_numberOfMines+1)*2)));\r\n\t\t\telse\r\n\t\t\t\tif(randomX)\r\n\t\t\t\t\tmine.v.setX(LogicEngine.SCREEN_WIDTH * Math.random());\r\n\t\t\t\r\n\t\t\tmine.i_animationFrame=0;\r\n\t\t\tmine.i_animationFrameSizeWidth=16;\r\n\t\t\tmine.i_animationFrameSizeHeight=16;\r\n\t\t\t\r\n\r\n\t\t\tmine.stepHandlers.add(new FlyStraightStep(new Vector2d(0,-2)));\r\n\t\t\t\r\n\t\t\tHitpointShipCollision c = new HitpointShipCollision(mine,3,10);\r\n\t\t\tc.setSimpleExplosion();\r\n\t\t\t\r\n\t\t\tmine.shotHandler = new ExplodeIfInRange(true);\r\n\t\t\t\r\n\t\t\tmine.collisionHandler =c; \r\n\t\t\tmine.allegiance = GameObject.ALLEGIANCES.LETHAL;\r\n\t\t\t\r\n\t\t\tin_logicEngine.objectsEnemies.add(mine);\r\n\t\t}\r\n\t}", "@Test\n public void testClearTileOccupied()\n {\n try\n {\n Square s = new Square();\n s.setTile(Tile.A);\n s.clearTile();\n assertNull(s.getTile());\n assertFalse(s.isOccupied());\n }\n catch(Exception ex)\n {\n fail(\"No exception should be thrown when removing a tile from an occupeid square.\");\n }\n }", "public boolean waveDestroyed() {\n return map.getHell().getEnemies().size() + map.getEarth().getEnemies().size() + map.getHeaven().getEnemies().size() == 0;\n }", "public void drawCard(Integer cardLocation){\n Random random = new Random();\n boolean isPlayerHandEmpty = false;\n Integer sizeOfPlayerHand = 4;\n //The reason for this is as follows: we are wanting to keep an array size of 4 consistent for playerHand, however\n //using the .remove() function actually shortens the size. Yet .set(index,null) is still counted as an element, hence\n //isEmpty does not work, and the size() is still 4.\n //Is this the most agile way to do this? I don't know, but this worked.\n\n for (Card s:playerHand){\n if(s == null){\n sizeOfPlayerHand--;\n }\n }\n if (sizeOfPlayerHand == 0){\n isPlayerHandEmpty = true;\n }\n\n\n\n if (playerTempDeck.size() > 0 && (sizeOfPlayerHand < 4 || playerHand.size() < 4)){\n //System.out.println(\"Adding cards from deck.\");\n\n Integer n = random.nextInt(playerTempDeck.size()); //0 to the number in the bracket. Pick a random card from the deck and use it here.\n playerHand.set(cardLocation, playerTempDeck.get(n));\n //System.out.println(\"Now the playerHand is: \" + playerHand.toString());\n //System.out.println(\"Size of deck: \" + playerTempDeck.size());\n //System.out.println(\"Trying to remove: \" + playerTempDeck.get(n).getEffect());\n playerTempDeck.remove(playerTempDeck.get(n));\n }\n\n if (playerTempDeck.size() == 0 && (isPlayerHandEmpty || playerHand.size() == 0)){ //deck is empty and no cards left to play, reshuffle.\n //System.out.println(\"Hand and deck are both empty!\");\n playerTempDeck.addAll(discardedCards);\n discardedCards.clear();\n drawCard(0);\n drawCard(1);\n drawCard(2);\n drawCard(3);\n }\n }", "public void clearBalls();", "private void shootLaser() {\n\t\tfor(int i = 0; i<lasers.size(); i++) {\n\t\t\tif(lasers.get(i).getLayoutY() > -lasers.get(i).getBoundsInParent().getHeight() ) { //-37 wenn unterhalb des windows \n\t\t\t\tlasers.get(i).relocate(lasers.get(i).getLayoutX(), lasers.get(i).getLayoutY() - 3); //um 3 pixel nach oben bewegen\n\t\t\t}\n\t\t\telse { //wenn oberhalb des windows \n\t\t\t\t\n\t\t\t\tgamePane.getChildren().remove(lasers.get(i));\n\t\t\t\tlasers.remove(i);\n\t\t\t\tSystem.out.println(lasers.size());\n\t\t\t}\n\t\t}\n\t}", "public void delete() {\r\n\t\t\tif (!isDeleted && handles.remove(this)) {\r\n\t\t\t\telementsUsed -= count;\r\n\t\t\t\tisDeleted = true;\r\n\t\t\t\tif (elementsUsed < numElements / 4) {\r\n\t\t\t\t\tcompact();\r\n\t\t\t\t\tnumElements = Math.max(10, elementsUsed * 2);\r\n\t\t\t\t}\r\n\t\t\t\tshapePeer.vboHandle = null;\r\n\t\t\t}\r\n\t\t}", "public void clear() {\n head = null;\n tail = null;\n size = 0;\n String name = \"aweseome Frok from Father of MC :) :) :) :) :) :): ): ): ):): ):):): :))::):):)\";\n String smileie = ENOUGH SMILES?;\n }", "@Override\n protected void afterKill() {\n if (timeAfterDeath > 0) {\n --timeAfterDeath;\n } else {\n if (finalAnimation > 0) {\n --finalAnimation;\n } else {\n remove();\n }\n }\n }", "@Override\n public void clear() {\n size = 0;\n }", "@Override\n public void clear() {\n size = 0;\n }" ]
[ "0.6084747", "0.6072007", "0.60599893", "0.6058011", "0.59177333", "0.5791641", "0.5785193", "0.57729864", "0.57696575", "0.57447183", "0.570056", "0.5676394", "0.56035227", "0.5584164", "0.5529284", "0.552483", "0.55201", "0.54947746", "0.5460741", "0.539655", "0.53879136", "0.53863305", "0.5382105", "0.5372498", "0.53626", "0.5350277", "0.5340127", "0.53395635", "0.52701426", "0.5217187", "0.52145743", "0.5208549", "0.5208196", "0.5206389", "0.52039045", "0.51956695", "0.51890963", "0.51889116", "0.5160754", "0.5159038", "0.5153981", "0.5149873", "0.51452065", "0.51253074", "0.5104474", "0.51000977", "0.5092676", "0.50898254", "0.5085434", "0.5084386", "0.50824565", "0.5081142", "0.50767285", "0.50736797", "0.5065821", "0.5062729", "0.5046347", "0.5045116", "0.5043012", "0.50346935", "0.50332093", "0.5031349", "0.50136733", "0.5005198", "0.49851766", "0.4979725", "0.49749333", "0.49691758", "0.49684846", "0.49680772", "0.49641395", "0.49625346", "0.4958716", "0.49507573", "0.49478903", "0.49456882", "0.4945017", "0.4934341", "0.4918143", "0.49178764", "0.49162048", "0.49088395", "0.4907006", "0.4907006", "0.4906597", "0.4900021", "0.48994204", "0.48962426", "0.48847172", "0.48843732", "0.48750728", "0.487435", "0.48703384", "0.48695877", "0.4868202", "0.48572868", "0.48524392", "0.48519143", "0.48478857", "0.48478857" ]
0.76389605
0
The alien has been destroyed
public void alienDestroyed() { // Place 6 debris objects where the alien was located placeDebris(alien.getX(), alien.getY()); placeDebris(alien.getX() + 1, alien.getY() + 1); // Update the score numScore += ALIENSHIP_SCORE[alien.getSize()]; display.setScore(numScore); // Expire the alien from the game Participant.expire(alien); // Open the Alien destroyed sound in enhanced mode openAlienDestroyedSound(); // Schedule a transition if all aliens have been destroyed if (pstate.countAliens() == 0) { scheduleTransition(END_DELAY); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void destroy() {\n this.alive = false;\n }", "public void destroy()\r\n\t{\r\n\t\tlog.fine(\"destroy\");\r\n\t}", "@Override\r\n\tpublic void destroy()\r\n\t{\n\t\t\r\n\t}", "public void destroy()\r\n\t{\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy(){\n destroyed = true;\n }", "@Override\n protected void onDestroy() {\n Initialization.exit(this);\n super.onDestroy();\n }", "void destroy() {\n\t\tdespawnHitbox();\n\t\tinventory.clear();\n\t\texperience = 0;\n\t\tinvalid = true;\n\t}", "public void destroy() {\n\t\texcludeItem = null;\r\n\t\tloginPage=null;\r\n\t\tloaginAction=null;\r\n\t\tauthority = null;\r\n\t}", "public void destroy() {\n \t\n }", "@Override\r\n\tpublic void onDeath() {\n\t\ta.remove();\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\n public void destroy() {\n }", "@Override\r\n\t\tpublic void destroy() {\n\t\t\t\r\n\t\t}", "public void cleanUp(){\n\t\tbody.setActive(false);\n\t}", "@Override\n protected void onDestroy() {\n super.onDestroy();\n cleanUp();\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n active = false;\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n active = false;\n }", "public void destroy() {\r\n\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tsuper.destroy();\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tsuper.destroy();\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tsuper.destroy();\r\n\t}", "public void destroy()\r\n\t{\r\n\t}", "public void destroy() {\n destroying = true;\n }", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tLog.e(TAG, \"ondestory\");\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tLog.e(TAG, \"ondestory\");\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tCleanup();\r\n\t}", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tmovingArea = null;\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t}", "@Override\r\n public void destroy() {\n }", "@Override\r\n public void destroy() {\n }", "@Override\t\n\tpublic void destroy() {\n\t\t\n\t}", "public void onDestroy() {\n super.onDestroy();\n }", "public void onDestroy() {\n super.onDestroy();\n }", "public void onDestroy() {\n super.onDestroy();\n }", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destruction()\n\t{\n\t\tremove();\n\t}", "public void destroy() {\n\t\tsuper.destroy(); \n\t\t// Put your code here\n\t}", "@Override\n public void destroy() {\n }", "public void destroy()\n\t{\n\t\tM_log.info(\"destroy()\");\n\t}", "@Override\r\n public void onDestroy() {\n super.onDestroy();\r\n }", "@Override\r\n public void onDestroy() {\n super.onDestroy();\r\n }", "public void destroy()\n\t{\n\t}", "@Override\n\tpublic void destroy(){\n\t\t\n\t}", "public void decreaseLife() {\n this.terminate();\n }", "public void destroy() {\r\n }", "public void onDestroy(){\n\t\tsuper.onDestroy();\n\t\tdoUnbind();\n\t}", "@Override\r\n protected void onDestroy() {\r\n Log.d(LOGTAG, \"onDestroy\");\r\n super.onDestroy();\r\n\r\n try {\r\n vuforiaAppSession.stopAR();\r\n } catch (ArException e) {\r\n Log.e(LOGTAG, e.getString());\r\n }\r\n\r\n // Unload texture:\r\n mTextures.clear();\r\n mTextures = null;\r\n\r\n System.gc();\r\n }", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}" ]
[ "0.7257831", "0.7221231", "0.69920766", "0.69911623", "0.69848055", "0.69848055", "0.69848055", "0.69848055", "0.69743186", "0.69671917", "0.6961373", "0.69589067", "0.6946225", "0.6917121", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6912485", "0.6891014", "0.68901634", "0.68745047", "0.68543553", "0.6825746", "0.6825746", "0.68225515", "0.6804292", "0.6804292", "0.6804292", "0.68035626", "0.679168", "0.6787781", "0.6787781", "0.6787781", "0.6787781", "0.6787781", "0.6787781", "0.6780254", "0.6780254", "0.6768501", "0.6755324", "0.6755324", "0.6755324", "0.6755324", "0.6755324", "0.6754847", "0.67534685", "0.67534685", "0.67534685", "0.67534685", "0.6752738", "0.6752738", "0.6752738", "0.6752738", "0.67435557", "0.67435557", "0.6743047", "0.6738014", "0.6738014", "0.6738014", "0.6728967", "0.6728967", "0.6728967", "0.6728967", "0.6728967", "0.6728967", "0.6728543", "0.6723284", "0.67150044", "0.6709614", "0.6708626", "0.6708626", "0.67083144", "0.67069465", "0.6701928", "0.6699923", "0.6694175", "0.6691925", "0.66905856", "0.66905856", "0.66905856", "0.66905856", "0.66905856", "0.66905856", "0.66905856", "0.66905856", "0.66905856", "0.66905856", "0.66905856", "0.66905856", "0.66905856" ]
0.7656914
0
Places an Alien ship of the given size (size 1 == large alien, size 0 == small alien)
public void placeAlien(int size) { if (pstate.countAliens() == 0) { // create a random int with a value of either 1 or -1 int a = -1; int j = RANDOM.nextInt(2); if (j == 0) { a = -1; } else { a = 1; } // Create a random value for the starting y position of the alien int i = RANDOM.nextInt(SIZE); // Create the alien alien = new Alien(0, i, 0, a * 6, size, this); new ParticipantCountdownTimer(alien, "create", ALIEN_DELAY); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Ship(String name, int size) {\r\n this.name = name;\r\n this.size = size;\r\n this.livesLeft = size;\r\n this.isSunk = false;\r\n }", "public void setSize(int size){\n\t\tthis.shipSize = size;\n\t}", "public void placeShip(int startTileX ,int startTileY , int orient,Tile myTiles[][],int size, boolean verbose)\n {\n if (orient ==0 ){\n for (int i=0; i<size; i++) { \n if (myTiles[startTileX+i][startTileY].getType() == Tile.Type.Sea){\n myTiles[startTileX+i][startTileY].setType(Tile.Type.Ship);\n }\n } \n }\n \n else if ( orient == 1) \n {\n for(int i=0; i<size; i++) { \n if (myTiles[startTileX][startTileY + i].getType() == Tile.Type.Sea){\n myTiles[startTileX][startTileY + i].setType(Tile.Type.Ship);\n }\n }\n }\n }", "public boolean placeShip(int row, int col, int shipSize, char orientation) {\n /* validate the input values before adding the ship */\n if(!checkAddShipParams(row, col, shipSize, orientation))\n return false;\n /* if someone is in the spot already we can't put another ship there */\n else if(spotTaken(row, col, shipSize, orientation))\n return false;\n \n /* We made it this far so everything must be ok, now place the ship */\n if(orientation == 'v' || orientation == 'V') {\n for(int i = 0; i < shipSize; i++)\n this.board[row+i][col] = 'S';\n \n numShips++;\n return true;\n }\n else { // don't need to check if it equals H because it has to if it passed the param check\n for(int i = 0; i < shipSize; i++)\n this.board[row][col+i] = 'S';\n \n numShips++;\n return true;\n }\n }", "private void placeShip() {\r\n\t\t// Expire the ship ship\r\n\t\tParticipant.expire(ship);\r\n\r\n\t\tclipShip.stop();\r\n\r\n\t\t// Create a new ship\r\n\t\tship = new Ship(SIZE / 2, SIZE / 2, -Math.PI / 2, this);\r\n\t\taddParticipant(ship);\r\n\t\tdisplay.setLegend(\"\");\r\n\t}", "public int getSize(){\n\t\treturn shipSize;\n\t}", "public void placeShip(Ship thisShip, String coordinate, int direction){\r\n\t\tthisShip.placed = true;\r\n\t\tint letterCoord = letterToIndex(coordinate.charAt(0));\r\n\t\tint numberCoord = Integer.parseInt(coordinate.substring(1))-1;\r\n\t\t\r\n\t\t\r\n\t\t\tif (direction == 1) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\t\tthisShip.set_position(numberCoord+i, letterCoord);\r\n\t\t\t\t\t}\r\n\t\t\t} else if (direction == 2) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\tthisShip.set_position(numberCoord, letterCoord+i);\r\n\t\t\t\t\t}\r\n\t\t\t} else if (direction == 3) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\tthisShip.set_position(numberCoord-i, letterCoord);\r\n\t\t\t\t}\r\n\t\t\t} else if (direction == 4) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\tthisShip.set_position(numberCoord, letterCoord - i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\tif(thisShip.name == \"Carrier\"){\r\n\t\t\tmyBoard.carrier.placed=thisShip.placed;\r\n\t\t\tmyBoard.carrier.position=thisShip.position;\r\n\t\t\t}\r\n\t\t\t\r\n\t\telse if(thisShip.name == \"Battleship\"){\r\n\t\t\tmyBoard.battleship.placed=thisShip.placed;\r\n\t\t\tmyBoard.battleship.position=thisShip.position;\r\n\t\t}\r\n\t\telse if(thisShip.name == \"Cruiser\"){\r\n\t\t\tmyBoard.cruiser.placed=thisShip.placed;\r\n\t\t\tmyBoard.cruiser.position=thisShip.position;\r\n\t\t}\r\n\t\telse if(thisShip.name == \"Submarine\"){\r\n\t\t\tmyBoard.submarine.placed=thisShip.placed;\r\n\t\t\tmyBoard.submarine.position=thisShip.position;\r\n\t\t}\r\n\t\telse if(thisShip.name == \"Patrol Boat\"){\r\n\t\t\t\tmyBoard.patrolboat.placed=thisShip.placed;\r\n\t\t\t\tmyBoard.patrolboat.position=thisShip.position;\r\n\t\t}\r\n\t\t\t\r\n\t\t}", "public Ship(int size, boolean direction){\n this.size = size;\n this.location = null;\n this.orientation = direction;\n }", "public UmbrellaPowerUp(int xCoord, int yCoord, int size) {\n super(xCoord, yCoord, getImagePath(size));\n powerType = \"umbrella\";\n }", "public Awale(short size) {\r\n\tthis.listeners = new ArrayList<AwaleListener>();\r\n\tthis.currentSide = 0;\r\n\tthis.size = size;\r\n\tthis.territory = new short[2][size];\r\n\tthis.simulateTerritory = new short[2][size];\r\n\tArrays.fill(this.territory[0], INITIAL_SEEDS);\r\n\tArrays.fill(this.territory[1], INITIAL_SEEDS);\r\n\tthis.points = new short[2];\r\n }", "public void enlargeSquare()\n {\n squareSize++;\n }", "public boolean verifShipCoordinates( IPlayer iPlayer, String startCoord,String endCoord, int size) {\n\t\tif (goodCoordinatesForm(startCoord) && goodCoordinatesForm(endCoord) ) {\r\n\r\n\t\t\tCoordinates coord1 = new Coordinates(startCoord);\r\n\t\t\tCoordinates coord2 = new Coordinates(endCoord);\r\n\t\t\tcoordinatesShipConverter(coord1, coord2);\r\n\t\t\tif (inMap(iPlayer,coord1) && inMap(iPlayer,coord2) ) {\r\n\t\t\t\tif (nonDiagonal(coord1,coord2)) {\r\n\t\t\t\t\tif(goodSize(coord1,coord2, size)) {\r\n\t\t\t\t\t\tif (isEmpty(iPlayer, coord1, coord2)) {\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse { System.out.println(\"Another ship is already on it\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse { System.out.println(\"The size of the ship isn't good, try again it should be \"+ size + \" coordinates large\");\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\telse {System.out.println(\"The ship is in diagonal, try again it should be like A-2\");\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse { System.out.println(\"Coordinates out of map, try again it should be between 0 and 10, and A to J\" );// can't do this.height.. because cannot do a static reference to a non static..\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse { System.out.println(\"Wrong coordinates writing, try again it should be like A-2\");\r\n\t\t}\r\n\t\t// is this presentation very clear ?\r\n\t\t\r\n\treturn false;\r\n\t\r\n\t}", "public static void placeShips (Game game) {\n\t\t\n\t\tint dir, x, y, length, width;\n\t\tint[] shipDim;\n\t\tboolean[] success = new boolean[shipSizes.length];\n\t\t\n\t\tfor (int i = 0; i < shipSizes.length; i++) {\n\t\t\tsuccess[i] = false;\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < shipSizes.length; i++) {\n\t\t\t\n\t\t\t// If an attempted ship location is invalid (off-screen or overlapping another ship) then success[i] will be false so it tries again.\n\t\t\twhile (success[i] == false) {\n\t\t\t\tdir = rnd.nextInt(2);\n\t\t\t\tx = rnd.nextInt(Config.BOARD_LENGTH);\n\t\t\t\ty = rnd.nextInt(Config.BOARD_WIDTH);\n\t\t\t\tshipDim = shipSizes[i];\n\t\t\t\tif (dir == 0) {\n\t\t\t\t\t// Across.\n\t\t\t\t\tlength = shipDim[0];\n\t\t\t\t\twidth = shipDim[1];\n\t\t\t\t} else {\n\t\t\t\t\t// Down.\n\t\t\t\t\tlength = shipDim[1];\n\t\t\t\t\twidth = shipDim[0];\n\t\t\t\t}\n\n\t\t\t\tShip ship = new Ship(i*10+5,length,width); // IDs will be 5, 15, 25, etc.\n\t\t\t\tsuccess[i] = game.addShip(ship, x, y);\n\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private void placeEnemyShips() {\n\t\tint s51 = (int) (Math.random() * 6); // mostly random numbers\n\t\tint s52 = (int) (Math.random() * 10);\n\t\tfor (int i = 0; i < 5; i++)\n\t\t\tpgrid[s51 + i][s52] = 1;\n\n\t\t// Places the ship of length 3\n\t\tint s31 = (int) (Math.random() * 10);\n\t\tint s32 = (int) (Math.random() * 8);\n\t\twhile (pgrid[s31][s32] == 1 || pgrid[s31][s32 + 1] == 1 // prevents\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overlaps\n\t\t\t\t|| pgrid[s31][s32 + 2] == 1) {\n\t\t\ts31 = (int) (Math.random() * 10);\n\t\t\ts32 = (int) (Math.random() * 8);\n\t\t}\n\t\tpgrid[s31][s32] = 1;\n\t\tpgrid[s31][s32 + 1] = 1;\n\t\tpgrid[s31][s32 + 2] = 1;\n\n\t\t// Places the ship of length 1\n\t\tint s21 = (int) (Math.random() * 10);\n\t\tint s22 = (int) (Math.random() * 9);\n\t\twhile (pgrid[s21][s22] == 1 || pgrid[s21][s22 + 1] == 1) { // prevents\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overlaps\n\t\t\ts21 = (int) (Math.random() * 10);\n\t\t\ts22 = (int) (Math.random() * 9);\n\t\t}\n\t\tpgrid[s21][s22] = 1;\n\t\tpgrid[s21][s22 + 1] = 1;\n\n\t}", "public void autoPutShip(int padding) {\n for (int l=3; l>=0; l--) {\n// if already have ships of this type go to another length\n if (decks[l] == (4-l)) continue;\n for (int i = 0; i < (4-l); i++) {\n// if already put ships of that type go on..\n if (decks[l] == (4-l)) continue;\n// choice random side of sea\n// (for optimal placing need to place near it)\n int side = (int) (Math.random() * 4);\n// generate random indent from side corner\n// (like you go counter clock wise)\n int indent = (int) (Math.random() * (10 - l));\n int x = 0, y = 0;\n// for side get direction\n Direction dir = Direction.values()[side];\n// calculate coordinates\n switch (side) {\n case 0:\n x = padding;\n y = indent;\n break;\n case 1:\n x = indent;\n y = 9 - padding;\n break;\n case 2:\n x = 9 - padding;\n y = 9 - indent;\n break;\n case 3:\n x = 9 - indent;\n y = padding;\n break;\n }\n// create ship (just for right coordinates)\n Ship ship = new Ship(x, y, l, dir);\n// and if you can put it - put\n if (canPutShip(ship)) putShip(ship);\n }\n }\n if (!isAllShipsOn()&& padding < 9) autoPutShip(padding + 1);\n }", "private void placePlayerShip(int x, int y) {\n\t\tif (shipsToPlace == 3) {\n\t\t\tlongShipCoords = new int[2];\n\t\t\tlongShipCoords[0] = x;\n\t\t\tlongShipCoords[1] = y;\n\n\t\t\t// creates long ship at x,y on egrid\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\tegrid[x + i][y] = 1;\n\n\t\t\t// makes ship tiles blue on enemy's board\n\t\t\tfor (int counter = 0; counter < 5; counter++)\n\t\t\t\tenemyBoard[x + counter][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t}\n\n\t\telse if (shipsToPlace == 2) {\n\t\t\t// create medium ship at x,y on egrid\n\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\t\t\tegrid[x][y + 2] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 2].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t}\n\n\t\telse if (shipsToPlace == 1) {\n\t\t\t// create small ship at x,y on egrid\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t\tstatus.setText(\" Click to attack\");\n\t\t}\n\t\tshipsToPlace--;\n\t\tenableAllTiles();\n\t\tdisableRestrictedTiles(x, y);\n\t}", "public void placeAlienBullet() {\r\n\t\tif (alien != null) {\r\n\t\t\t// If the alien is large fires a bullet in a random direction\r\n\t\t\tif (alien.getSize() == 1 && ship != null) {\r\n\r\n\t\t\t\t// Create the alien bullet\r\n\t\t\t\tab = new AlienBullet(alien.getX(), alien.getY());\r\n\r\n\t\t\t\t// give the alien bullet a random direction and the bullet speed velocity,\r\n\t\t\t\t// then add as participant\r\n\t\t\t\tdouble r = (2 * Math.PI) * RANDOM.nextDouble();\r\n\t\t\t\tab.setVelocity(BULLET_SPEED, r);\r\n\t\t\t\taddParticipant(ab);\r\n\r\n\t\t\t\t// Sets the alien bullet to expire when it reaches the bullet duration time\r\n\t\t\t\t// limit\r\n\t\t\t\tnew ParticipantCountdownTimer(ab, \"expire\", BULLET_DURATION);\r\n\t\t\t}\r\n\r\n\t\t\t// If the alien is small fires a bullet aimed directly at the ship\r\n\t\t\tif (alien.getSize() == 0 && ship != null) {\r\n\t\t\t\tab = new AlienBullet(alien.getX(), alien.getY());\r\n\t\t\t\tab.setSpeed(BULLET_SPEED);\r\n\r\n\t\t\t\t// Aims the alien bullet directly at the ship\r\n\t\t\t\tdouble A = ship.getY() - alien.getY();\r\n\t\t\t\tdouble B = ship.getX() - alien.getX();\r\n\t\t\t\tdouble angle = Math.atan2(A, B);\r\n\t\t\t\tab.setVelocity(BULLET_SPEED, angle);\r\n\r\n\t\t\t\t// Add the alien bullet as a participant and then set it to expire when it\r\n\t\t\t\t// reaches the bullet duration time limit\r\n\t\t\t\taddParticipant(ab);\r\n\t\t\t\tnew ParticipantCountdownTimer(ab, \"expire\", BULLET_DURATION);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void setSize(String size) throws IllegalPizza{\n\t\tif(size == null)\n\t\t\tthrow new IllegalPizza(\"Illegal, pizza size is not null!\");\n\t\tString size1 = size.toLowerCase();\n\t\tif (Objects.equals(size1, \"small\"))\n\t\t\tSize = size1;\n\t\telse if (Objects.equals(size1, \"medium\"))\n\t\t\tSize = size1;\n\t\telse if (Objects.equals(size1, \"large\"))\n\t\t\tSize = size1;\n\t\telse \n\t\t\tthrow new IllegalPizza(\"Illegal pizza size\");\n\t}", "public F2_Ship4() {\n\n setH(100);\n setW(50); //Set the size of the ship\n\n setArt(\"Art/SpaceShips/Faction2/Ship4.png\"); //Set the artwork of the ship\n }", "public void makeShips()\n\t{\n\t\t//The below is firstly to create the five ships \n\t\tint[] shipSizes= {2,3,3,4,5};\n\n\t\t//### Creating battleship to be put in the playerBattleShipsList\n\t\tfor (int x = 0; x < shipSizes.length; x ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newPlayerBattleShip = new BattleShip(shipSizes[x]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\tplayerBattleShipsList[x] = newPlayerBattleShip;\n\t\t}\n\n\t\t//### Creating battleship to be put in the aiBattleShipsList\n\n\t\tfor (int y = 0; y < shipSizes.length; y ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newAIBattleShip = new BattleShip(shipSizes[y]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\taiBattleShipsList[y] = newAIBattleShip;\n\t\t}\n\n\t}", "PlayerShip(int screenLength, int newY, int size, int newSpeed) {\n \tsuper(screenLength/2, newY, size, size);\n setHSpeed(newSpeed);\n }", "public void markEmptyFields(int shipSize){\n\t\tint x = hitLocation3.x;\n\t\tint y = hitLocation3.y;\n\t\t\n\t\tif( hitLocation2==null && hitLocation3 !=null ){\n\t\t\tif(x-1 >= 0 && y - 1 >= 0){\n\t\t\t\topponentShootTable[x-1][y-1] = true;\n\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-1) );\t//po skosie lewy gorny\t\t\t\t\n\t\t\t}\n\t\t\tif(x-1 >= 0){\n\t\t\t\topponentShootTable[x-1][y] = true;\n\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y) );\t\t//gorny\n\t\t\t}\n\t\t\tif(y + 1 <sizeBoard){\n\t\t\t\topponentShootTable[x][y+1] = true;\n\t\t\t\tpossibleshoots.remove( new TabLocation(x, y+1) );\t\t//prawy\t\n\t\t\t}\n\t\t\tif(x+1 < sizeBoard && y +1 < sizeBoard){\n\t\t\t\topponentShootTable[x+1][y+1] = true;\t\t\t\t//po skosie dol prawy\n\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+1) );\t\t\t\t\t\n\t\t\t}\n\t\t\tif(x-1 >= 0 && y + 1 < sizeBoard){\n\t\t\t\topponentShootTable[x-1][y+1] = true;\t\t\t\t//po skosie prawy gora\n\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+1) );\t\t\t\t\t\n\t\t\t}\n\t\t\tif( x +1 < sizeBoard){\n\t\t\t\topponentShootTable[x+1][y] = true;\t\t\t\t// dolny\n\t\t\t\tpossibleshoots.remove(new TabLocation(x+1,y));\t\t\t\t\t\n\t\t\t}\n\t\t\tif(x+1 <sizeBoard && y - 1 >= 0){\n\t\t\t\topponentShootTable[x+1][y-1] = true;\t\t\t//po skosie dol lewy\n\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-1) );\t\t\t\t\t\n\t\t\t}\n\t\t\tif(y - 1 >= 0){\n\t\t\t\topponentShootTable[x][y-1] = true;\t\t\t//lewy\n\t\t\t\tpossibleshoots.remove( new TabLocation(x, y-1) );\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\tboolean orientacja = false;\n\t\t\tif( hitLocation3.x == hitLocation2.x ) orientacja = true;\n\t\t\tint tempshipSize = shipSize;\n\t\t\tif( orientacja ){\n\t\t\t\t\n\t\t\t\tif( hitLocation2.y < hitLocation3.y ){\n\t\t\t\t\ttempshipSize = - shipSize;\n\t\t\t\t\n\t\t\t\t//prawy skrajny\t\n\t\t\t\t\tif(x-1 >= 0 && y + tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation( x-1, y+tempshipSize ) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y+tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation( x, y+tempshipSize ) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 <sizeBoard && y+tempshipSize>=0){\n\t\t\t\t\t\topponentShootTable[x+1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+tempshipSize) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(y+1<sizeBoard ){\n\t\t\t\t\t\topponentShootTable[x][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x, y+1) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y+1<sizeBoard && x-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(y+1<sizeBoard && x+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(x-1 >= 0 && y + tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x-1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+tempshipSize) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x, y+tempshipSize) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 < sizeBoard && y+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+tempshipSize) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(y-1 >= 0 ){\n\t\t\t\t\t\topponentShootTable[x][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x, y-1) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y-1 >= 0 && x-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(y-1 >= 0 && x+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif( x-1 >= 0 ){\n\t\t\t\t\tif( hitLocation2.y < hitLocation3.y ){\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x-1][y-i] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x-1][y+i] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(x + 1 < sizeBoard){\n\t\t\t\t\tif(hitLocation2.y < hitLocation3.y){\n\t\t\t\t\t\tfor(int i=0; i<shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x+1][y-i] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x+1][y+i] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif(hitLocation2.x < hitLocation3.x){\n\t\t\t\t\ttempshipSize = - shipSize;\n\t\t\t\t\n\t\t\t\t//dolny skrajny\t\n\t\t\t\t\tif(y-1 >= 0 && x + tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y-1) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x + tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(y+1 < sizeBoard && x+tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y+1) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(x+1 < sizeBoard ){\n\t\t\t\t\t\topponentShootTable[x+1][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 < sizeBoard && y-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x+1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 < sizeBoard && y+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(y-1 >= 0 && x + tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y-1) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(y+1 < sizeBoard && x+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y+1) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(x-1 >= 0 ){\n\t\t\t\t\t\topponentShootTable[x-1][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x-1 >= 0 && y-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(x-1 >= 0 && y+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x-1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(y-1 >= 0){\n\t\t\t\t\tif(hitLocation2.x < hitLocation3.x){\n\t\t\t\t\t\tfor(int i=0; i < shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x-i][y-1] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-i, y-1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i < shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x+i][y-1] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+i, y-1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(y+1 < sizeBoard){\n\t\t\t\t\tif(hitLocation2.x < hitLocation3.x){\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x-i][y+1] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-i, y+1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i < shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x+i][y+1] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+i, y+1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public boolean verifAIShipCoordinates( IPlayer iPlayer, String startCoord,String endCoord, int size) {\n\t\tif (goodCoordinatesForm(startCoord) && goodCoordinatesForm(endCoord) ) {\r\n\r\n\t\t\tCoordinates coord1 = new Coordinates(startCoord);\r\n\t\t\tCoordinates coord2 = new Coordinates(endCoord);\r\n\t\t\tcoordinatesShipConverter(coord1, coord2);\r\n\t\t\tif (inMap(iPlayer,coord1) && inMap(iPlayer,coord2) ) {\r\n\t\t\t\tif (nonDiagonal(coord1,coord2)) {\r\n\t\t\t\t\tif(goodSize(coord1,coord2, size)) {\r\n\t\t\t\t\t\tif (isEmpty(iPlayer, coord1, coord2)) {\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\t// is this presentation very clear ?\r\n\t\t\r\n\treturn false;\r\n\t\r\n\t}", "public void addShip(Ship ship) {\n\t\tint row = ship.getRow();\n\t\tint column = ship.getColumn();\n\t\tint direction = ship.getDirection();\n\t\tint shipLength = ship.getLength();\n\t\t//0 == Horizontal; 1 == Vertical\n\t\tif (direction == 0) {\n\t\t\tfor (int i = column; i < shipLength + column; i++) {\n\t\t\t\tthis.grid[row][i].setShip(true);\n\t\t\t\tthis.grid[row][i].setLengthOfShip(shipLength);\n\t\t\t\tthis.grid[row][i].setDirectionOfShip(direction);\n\t\t\t}\n\t\t}\n\t\telse if (direction == 1) {\n\t\t\tfor (int i = row; i < shipLength + row; i++) {\n\t\t\t\tthis.grid[i][column].setShip(true);\n\t\t\t\tthis.grid[i][column].setLengthOfShip(shipLength);\n\t\t\t\tthis.grid[i][column].setDirectionOfShip(direction);\n\t\t\t}\n\t\t}\n\t}", "private void addMinigames(){\n Point a = new Point();\n getWindowManager().getDefaultDisplay().getSize(a);\n Log.d(\"XY\", Integer.toString(a.x)+\" \"+Integer.toString(a.y));\n\n\n\n generateMiniGames();\n\n addFlower();\n\n }", "public boolean placeShip(int player, int x, int y) {\n\n Ship ship = null;\n\n for (int i = 0; i < 5; i++) {\n if (playerShips[i].selected) {\n ship = playerShips[i];\n }\n }\n if (ship == null) {\n return false;\n }\n\n if (orientation == 1) {\n if (ship.length + y > 10) {\n return false;\n }\n }\n if (orientation == 0) {\n if (ship.length + x > 10) {\n return false;\n }\n }\n for (int i = 0; i < ship.length; i++) {\n if(orientation == 0) {\n if (humanPlayerBoard[y][x+i] != board.water.ordinal()) {\n return false;\n }\n }\n else{\n if(humanPlayerBoard[y+i][x] != board.water.ordinal()){\n return false;\n }\n }\n }\n for (int i = 0; i < ship.length; i++) {\n if(orientation == 0) {\n humanPlayerBoard[y][x+i] = board.ship.ordinal();\n }\n else{\n humanPlayerBoard[y+i][x] = board.ship.ordinal();\n }\n }\n if(ship.placed){\n if(ship.orientation == 1){\n for(int i = 0; i < ship.length; i++){\n humanPlayerBoard[ship.y+i][ship.x] = board.water.ordinal();\n }\n }\n else{\n for(int j = 0; j < ship.length; j++){\n humanPlayerBoard[ship.y][ship.x+j] = board.water.ordinal();\n }\n }\n }\n ship.setShip(x, y, orientation);\n ship.placed = true;\n\n return true;\n }", "public boolean setUpShip(int noOfShips, List<String> locationSets) throws SizeLimitExceededException {\r\n\r\n\t\tboolean setUpSuccessFully = false;\r\n\t\tif (noOfShips > battleArea.getWidth() * (battleArea.getHeight() - 'A' + 1)) {\r\n\t\t\tthrow new SizeLimitExceededException(\"Number of ships can not exceed width * height of battle area\");\r\n\r\n\t\t}\r\n\r\n\t\tlogger.info(\"No of Ships per player : \" + noOfShips);\r\n\r\n\t\t// Get each ship coordinates from input location sets\r\n\r\n\t\tint i = 0;\r\n\t\twhile (i < noOfShips) {\r\n\t\t\tString result = locationSets.get(i);\r\n\t\t\tString shipType = result.substring(0, 1);\r\n\t\t\tint width = Integer.valueOf(result.substring(2, 3));\r\n\t\t\tint height = Integer.valueOf(result.substring(4, 5));\r\n\t\t\tString startingCell = null;\r\n\r\n\t\t\r\n\r\n\t\t\t\tBattleShip ship = new BattleShip(width, height);\r\n\t\t\t\tstartingCell = result.substring(6, 8);\r\n\t\t\t\tlogger.info(\"Player Name :\" + this.getPlayerName() + \" \" + \"ship type : \" + shipType);\r\n\t\t\t\tlogger.info(\"width of ship: \" + width + \" \" + \"height : \" + height + \" \" + \"starting Cell: \"\r\n\t\t\t\t\t\t+ startingCell);\r\n\r\n\t\t\t\tsetUpSuccessFully = battleArea.addShipsToBattleArea(ship, startingCell, BattleShipType.valueOf(shipType).getVal());\r\n\t\t\t\r\n//\r\n//\t\t\telse if (BattleShipConstants.PType.equals(shipType)) {\r\n//\r\n//\t\t\t\tBattleShip pShip = new PTypeBattleShip(width, height);\r\n//\t\t\t\tstartingCell = result.substring(6, 8);\r\n//\t\t\t\tlogger.info(\"Player Name :\" + this.getPlayerName() + \" \" + \"ship type : \" + shipType);\r\n//\t\t\t\tlogger.info(\"width of ship: \" + width + \" \" + \"height : \" + height + \" \" + \"starting Cell: \"\r\n//\t\t\t\t\t\t+ startingCell);\r\n//\r\n//\t\t\t\tsetUpSuccessFully = battleArea.addShipsToBattleArea(pShip, startingCell, BattleShipConstants.pStrength);\r\n//\t\t\t}\r\n\r\n//\t\t\telse {\r\n//\t\t\t\tSystem.out.println(\"Ships can be either Q-Type or P-Type\");\r\n//\t\t\t}\r\n\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\tif (!setUpSuccessFully) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn setUpSuccessFully;\r\n\r\n\t}", "private Alien spawnAlien() {\n Float[] offset = Util.randomCoordOffset(-((float)Util.TILEWIDTH/2), ((float)Util.TILEWIDTH/2), 0.8f);\n return new Alien(new Coordinate(position.x + (Util.TILEWIDTH/2) + offset[0], position.y + (Util.TILEHEIGHT/2) + offset[1]), this);\n }", "@Test\n public final void testSetSize() {\n int expRes = 5;\n int falseEnter = -4;\n ship.setSize(falseEnter);\n int result = this.ship.getSize();\n assertEquals(expRes, result);\n falseEnter = -1;\n ship.setSize(falseEnter);\n result = this.ship.getSize();\n assertEquals(expRes, result);\n }", "public AlienShip(Point[] inShape, Point inPosition, double inRotation) {\r\n\t\tsuper(inShape, inPosition, inRotation);\r\n\t}", "protected abstract void addBonusToShip(Ship ship);", "public pacman(int size_of_map) {\n this.positionX = (this.positionY = 0);\n this.size_of_map = size_of_map;\n }", "public ShoeInventory(int size)\r\n\t{\r\n\t\tif(size == 0)\r\n\t\t\tSystem.out.println(\"Cannot set array to size 0.\"); \r\n\t\telse\r\n\t\t{\r\n\t\t\tcounter = 0;\r\n\t\t\tarraySize = size;\r\n\t\t\ttypeArray = new ShoeType[arraySize];\r\n\t\t}\r\n\t}", "@Test\n public void testSunkShip() {\n final Ship submarine = new Submarine();\n final String errorMessage = \"There isn't a ship in that position\";\n\n submarine.placeShipAt(0, 0, true, ocean);\n assertTrue(errorMessage, ocean.shootAt(0, 0));\n assertTrue(errorMessage, ocean.shootAt(0, 1));\n assertTrue(errorMessage, ocean.shootAt(0, 2));\n assertEquals(1, ocean.getShipsSunk());\n ocean.print();\n }", "public static void setHotelSize(int size) {\r\n\t\tfor(int count = 0;count< size; count++) {\r\n\t\t\thotel_size.add(count + 1);\r\n\t\t}\r\n\t}", "public void sizeBy(float size) {\n internalGroup.sizeBy(size);\n dataTrait.width = internalGroup.getWidth();\n dataTrait.height = internalGroup.getHeight();\n resetSprite();\n }", "private Ship consoleGetAShip(Ship[] ships, String name, int size) {\n // boolean goodLocation = false;\n boolean vertical;\n int range = 10 - size;\n int row, col;\n String line;\n String in;\n Ship ship;\n \n //This code sometimes places ships outside of graphical grid\n // ¯\\_(\"/)_/¯\n while (true) {\n System.out.println(\"Place your \" + name + \": Will it be vertical? (Y/N) \");\n line = scan.nextLine();\n while (line.length() == 0) {\n line = scan.nextLine();\n }\n in = line.substring(0,1);\n System.out.println(\"input string: \" + in);\n \n if (in.equalsIgnoreCase(\"Y\")) {\n vertical = true;\n break;\n } else if (in.equalsIgnoreCase(\"N\")) {\n vertical = false;\n break;\n }\n // Invalid input; once more through the while loop to try again\n }\n while (true) {\n if (vertical) {\n System.out.print(\"Row (0 through \" + range + \"): \");\n row = scan.nextInt();\n scan.nextLine();\n System.out.print(\"Column (0 through 9): \");\n col = scan.nextInt();\n if (row < 0 || row > range || col < 0 || col > 9) continue;\n } else { // horizontal\n System.out.print(\"Row (0 through 9): \");\n row = scan.nextInt();\n System.out.print(\"Column (0 through \" + range + \"): \");\n col = scan.nextInt();\n if (row < 0 || row > 9 || col < 0 || col > range) continue;\n } \n ship = new Ship(row, col, vertical, size, name);\n if (collide(ship, ships)) {\n System.out.println(\"There's already a ship there! Please try again.\");\n continue;\n }\n break;\n }\n return ship;\n }", "private static StructureElement createCenteredSquare(int size) {\r\n\t\treturn new StructureElement(createSquareMask(size), size / 2, size / 2);\r\n\t}", "private void drawShip(int startX, int startY, int direction, int length) {\n if (direction == 4) { //South\n for (int y = 0; y < length; y++) {\n defendingGrid[startX][startY + y].setHasShip(true);\n\n\n }\n } else if (direction == 2) { //East\n\n for (int y = 0; y < length; y++) {\n defendingGrid[startX + y][startY].setHasShip(true);\n\n }\n } else if (direction == 6) { //West\n for (int y = 0; y < length; y++) {\n defendingGrid[startX - y][startY].setHasShip(true);\n\n }\n } else if (direction == 0) { //North\n for (int y = 0; y < length; y++) {\n defendingGrid[startX][startY - y].setHasShip(true);\n }\n }\n }", "public void setMakingShop(Player owner, Player establisher, Integer x, Integer y, Integer z, World world){\n\t\testablisher.sendMessage(ChatColor.GREEN + getConfig().getString(\"ask-for-item\"));\n\t\tUUID ownerID = owner.getUniqueId();\n\t\tUUID establisherID = establisher.getUniqueId();\n\t\tString blockLocation = x + \",\" + y + \",\" + z + \",\" + world.getName()+\",\"+ownerID.toString()+\",\"+establisherID.toString();\n\t\tdebugOut(\"Marking \" + establisher.getName()+\" as creating a shop at \"+blockLocation);\n\t\tPlayerMakingShop.put(establisher.getName(), blockLocation);\n\t}", "public boolean placeShip(Ship ship, int x, char y, boolean isVertical) {\n Ship s2;\n switch(ship.getShipType()) {\n case \"BATTLESHIP\":\n ship = new Battleship();\n s2 = new Battleship();\n break;\n case \"DESTROYER\":\n ship = new Destroyer();\n s2 = new Destroyer();\n break;\n case \"MINESWEEPER\":\n ship = new Minesweeper();\n s2 = new Minesweeper();\n break;\n default:\n return false;\n }\n\n boolean successful = playersBoard.placeShip(ship, x, y, isVertical);\n if (!successful)\n return false;\n\n boolean opponentPlacedSuccessfully;\n do {\n // AI places random ships, so it might try and place overlapping ships\n // let it try until it gets it right\n opponentPlacedSuccessfully = opponentsBoard.placeShip(s2, randRow(), randCol(), randVertical());\n } while (!opponentPlacedSuccessfully);\n\n return true;\n }", "public void assignAsteroidToShip(Ship ship, Asteroid asteroid) {\n\t\tasteroidToShip.put(asteroid.getId(), ship);\n\t}", "public Ships(ShipTypes type) {\n this.type = type;\n }", "public void putShip(Ship ship) throws OverlapException{\r\n if(this.ship == null){\r\n this.ship = ship;\r\n }else{\r\n throw new OverlapException(row, column);\r\n }\r\n }", "public void placeShip(Board board, Ship ship) {\n\n\n Point startPoint = null;\n boolean validPoint = false;\n while (!validPoint) {\n System.out.printf(\"Place your %s (%d spaces).%n\", ship.getName(), ship.getLength());\n try {\n startPoint = returnPointFromInput(board);\n if (startPoint != null && !startPoint.hasShip()) {\n validPoint = true;\n } else {\n System.out.println(\"Invalid input. Please enter a coordinate pair. Ex: 1A (Case insensitive).\");\n }\n } catch (IllegalArgumentException | NoSuchElementException e) {\n System.out.println(e.getMessage());\n }\n }\n\n int emptySpaces = 0;\n boolean validBranch = false;\n Point[] branch = null;\n while (!validBranch) {\n\n String direction = null;\n boolean validDirection = false;\n while (!validDirection) {\n try {\n direction = directionFromInput();\n validDirection = true;\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n }\n }\n\n branch = makeBranch(board, startPoint, ship.getLength(), direction);\n for (Point point : branch) {\n if (!point.hasShip()) {\n emptySpaces++;\n }\n }\n if (emptySpaces == ship.getLength()) {\n validBranch = true;\n } else {\n System.out.println(\"You can't put a ship there. Not enough room\");\n emptySpaces = 0;\n }\n }\n\n // pass ship to point\n for (Point point : branch) {\n point.setShip(ship);\n point.setHasShip(true);\n }\n }", "public void teleportToAlien() {\n\t\tAlien a;\n\t\tSpaceship sp;\n\t\tif(roamingAliens > 0){\n\t\t\tsp = getTheSpaceship();\n\t\t\ta = getRandomAlien();\n\t\t\tsp.setLocation(a.getLocation());\n\t\t\tSystem.out.println(\"You've teleported to an alien\");\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Error: There were no aliens to jump to.\");\n\t}", "boolean testPlaceShip(Tester t) {\n return t.checkExpect(ship3.place(this.em),\n em.placeImageXY(new CircleImage(10, OutlineMode.SOLID, Color.CYAN), 50, 50))\n && t.checkExpect(ship1.place(this.em),\n em.placeImageXY(new CircleImage(10, OutlineMode.SOLID, Color.CYAN), 0, 150));\n }", "public Player createArmouredShip(int armour,char[] locationIndex,Player player){\n Map<String,Integer> parts = new HashMap<>();\n for(int i=locationIndex[0];i<locationIndex[0]+getShip().getHeight();i++){\n if (!player.getInventory().containsKey(\"\"+(char)i+\"\")){\n player.getInventory().put(\"\"+(char)i+\"\",null);\n }\n int xCoordinate = Integer.parseInt(\"\"+locationIndex[1]);\n for (int j= xCoordinate;j<xCoordinate+getShip().getWidth();j++){\n parts.put(\"\"+j+\"\",armour);\n }\n getShip().setParts(parts);\n player.getInventory().put(\"\"+(char)i+\"\",getShip());\n }\n return player;\n }", "public Ship(int l){\n this.lifePoints=l;\n }", "protected void updateShips(String input) {\n\t\t//System.out.println(\"updateShips \" + input);\n\t\tShip temp = smallShip;\n \tfor(int i = 0; i < 3; i++) {\n \t\t\n// \t\n \tfor(int j = 0; j < temp.getCoordinates().size(); j++) {\n \t\tif(temp.getCoordinates().get(j).equals(input))\n \t\t\ttemp.getCoordinates().set(j, \"X\");\n \t}\n \tif(i == 0)\n \t\ttemp = mediumShip;\n \telse if(i == 1)\n \t\ttemp = largeShip;\n \t}\n\t}", "public static void placeShipHorzMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length - (ship.getLength() - 1) || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n if (!board[indexR][c].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n c = indexC - 1;\r\n }\r\n }\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n board[indexR][c] = symbol;\r\n } \r\n }", "public Ship(int shipSize, Directions direction, Coordinate headPosition) {\n\t\tshipPositions = new ArrayList<Coordinate>();\n\t\theadPosition.setIsHit(false);\n\t\theadPosition.setIsSunk(false);\n\t\t\n\t\tthis.shipSize = shipSize;\n\t\tthis.direction = direction;\n\t\n\t\t//sets the starting point of the ship\n\t\tshipPositions.add(headPosition);\n\t\t\n\t\t//constructs the rest of the ship\n\t\tsetShipPositionsGivenDirectionStartingPoint();\n\n\t}", "private void createShips() {\n //context,size, headLocation, bodyLocations\n Point point;\n Ship scout_One, scout_Two, cruiser, carrier, motherShip;\n if(player) {\n point = new Point(maxN - 1, 0); //row, cell\n scout_One = new Ship(1, point, maxN, \"Scout One\", player);\n ships.add(scout_One);\n point = new Point(maxN - 1, 1);\n scout_Two = new Ship(1, point, maxN, \"Scout Two\", player);\n ships.add(scout_Two);\n point = new Point(maxN - 2, 2);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n ships.add(cruiser);\n point = new Point(maxN - 2, 3);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n ships.add(carrier);\n point = new Point(maxN - 4, 5);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n ships.add(motherShip);\n\n }else{\n Random rand = new Random();\n int rowM = maxN-3;\n int colM = maxN -2;\n int row = rand.nextInt(rowM);\n int col = rand.nextInt(colM);\n point = new Point(row, col);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n updateOccupiedCells(motherShip.getBodyLocationPoints());\n ships.add(motherShip);\n\n rowM = maxN - 1;\n colM = maxN -1;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n updateOccupiedCells(carrier.getBodyLocationPoints());\n ships.add(carrier);\n checkIfOccupiedForSetShip(carrier, row, col, rowM, colM);\n\n\n rowM = maxN - 1;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n updateOccupiedCells(cruiser.getBodyLocationPoints());\n ships.add(cruiser);\n checkIfOccupiedForSetShip(cruiser, row, col, rowM, colM);\n\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_Two = new Ship(1, point, maxN, \"Scout_Two\", player);\n updateOccupiedCells(scout_Two.getBodyLocationPoints());\n ships.add(scout_Two);\n checkIfOccupiedForSetShip(scout_Two, row, col, rowM, colM);\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_One = new Ship(1, point, maxN, \"Scout_One\", player);\n updateOccupiedCells(scout_One.getBodyLocationPoints());\n ships.add(scout_One);\n checkIfOccupiedForSetShip(scout_One, row, col, rowM, colM);\n\n\n\n\n }\n //Need an algorithm to set enemy ship locations at random without overlaps\n }", "public static void placeShipVertMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length - (ship.getLength() - 1) || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n if (!board[r][indexC].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n r = indexR - 1;\r\n }\r\n }\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n board[r][indexC] = symbol;\r\n } \r\n \r\n }", "public void setSize(RMSize aSize) { setSize(aSize.width, aSize.height); }", "private void setShips(){\n\t\t\n\t\tint x,y;\n\t\tboolean orientacja;\n\t\tRandom generator = new Random();\n\t\t\n\t\tint ilosc = 1;\n\t\tint j = 0;\n\t\tfor(int i = 4; i > 0 ; i--){\n\t\t\twhile( j < ilosc ){\n\t\t\t\tx = generator.nextInt( 13 );\t\t\n\t\t\t\ty = generator.nextInt( 13 );\n\t\t\t\torientacja = generator.nextBoolean();\n\t\t\t\tif( isPossibleAddShip(x, y, i, orientacja) ) j++;\t\n\t\t\t}\n\t\tilosc++;\n\t\tj=0;\n\t\t}\n\t\t\n\t}", "@Test\n void should_place_ships_scenario_2() {\n Board board = BoardData.getBoard(15, 15);\n\n List<ShipType> shipConfigs = Arrays.asList(\n ShipType.ONE,\n ShipType.ONE,\n ShipType.ONE,\n ShipType.ONE,\n ShipType.TWO,\n ShipType.TWO\n );\n\n AutomaticShipPlacer automaticShipPlacer = new AutomaticShipPlacer();\n automaticShipPlacer.placeShips(shipConfigs, board);\n\n assertSame(6, board.getShips().size());\n BoardPrinter.print(board);\n }", "@Override\n public void Insert(Ship ship, String start,String end){\n if(start.charAt(0)==end.charAt(0)){\n for(int i = 0;i < ship.getSize(); i++){\n grid[start.charAt(1)+i-'0'][start.charAt(0)-'A'] = \"[\"+ ship.getType() +\"]\";\n ship.updateCoordlist(start.charAt(1)+i-'0',start.charAt(0)-'A');\n }\n }\n else{\n for(int i = 0;i < ship.getSize(); i++){\n grid[start.charAt(1)-'0'][start.charAt(0)-'A'+i] = \"[\"+ ship.getType() +\"]\";\n ship.updateCoordlist(start.charAt(1)-'0',start.charAt(0)-'A'+i);\n\n }\n }\n }", "@Test\n void should_place_ships_scenario_1() {\n Board board = BoardData.getBoard(15, 15);\n\n List<ShipType> shipConfigs = Arrays.asList(\n ShipType.ONE,\n ShipType.ONE,\n ShipType.TWO,\n ShipType.THREE\n );\n\n AutomaticShipPlacer automaticShipPlacer = new AutomaticShipPlacer();\n automaticShipPlacer.placeShips(shipConfigs, board);\n\n assertSame(4, board.getShips().size());\n BoardPrinter.print(board);\n }", "protected final void multiplySize(float size)\n {\n super.setSize(this.bokoblinWidth * size, this.bokoblinHeight * size);\n }", "public void putShips(int nbShips){\n ai.putShips(this.ships);\n }", "public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {\n\t\t\r\n\t\tstats.getDynamic().getMod(Stats.HRS_SENSOR_RANGE_MOD).modifyFlat(id, (Float) mag.get(hullSize));\r\n\t\t\r\n\t\tboolean sMod = isSMod(stats);\r\n\t\tif (sMod) {\r\n\t\t\tfloat mag = ((Float) combatMag.get(hullSize)).intValue();\r\n\t\t\tstats.getSightRadiusMod().modifyFlat(id, mag);\r\n\t\t}\r\n\t}", "public void positionShips(Ship ships[]) {\n ships[0] = new AircraftCarrier(3, true, 'A', 5, 'F');\n ships[1] = new Battleship(6, true, 'B', 4, 'A');\n ships[2] = new Destroyer(2, false, 'D', 3, 'E');\n ships[3] = new Submarine(1, true, 'S', 3, 'J');\n ships[4] = new PatrolBoat(9, false, 'P', 2, 'C');\n }", "public void toggleShipAtTile(int tile) {\r\n if (placedShips < 4 || hasShip(tile)) {\r\n if (hasShip(tile)) {\r\n placedShips -= 1;\r\n } else {\r\n placedShips += 1;\r\n }\r\n tiles[tile] = tiles[tile] ^ 1;\r\n }\r\n }", "public void setSize(int size);", "@POST(\"/AddShip\")\n\tint addShip(@Body Ship ship,@Body int id) throws GameNotFoundException;", "public void size(final int theWidth, final int theHeight);", "public void spawnSateliteShip(LogicEngine in_logicEngine,float in_x)\r\n\t{\n\t\tGameObject ship = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/gravitonlevel.png\",in_x,LogicEngine.SCREEN_HEIGHT,1);\r\n\t\tship.i_animationFrameSizeWidth = 64;\r\n\t\tship.i_animationFrameSizeHeight = 32;\r\n\t\tship.i_animationFrame = 2;\r\n\t\tship.allegiance = GameObject.ALLEGIANCES.ENEMIES;\r\n\t\t\r\n\t\tship.v.setMaxForce(1.0f);\r\n\t\tship.v.setMaxVel(4.0f);\r\n\t\t\r\n\t\t\r\n\t\t//fly down\r\n\t\t//ship.stepHandlers.add( new FlyStraightStep(new Vector2d(0,-1f)));\r\n\t\t\r\n\t\tSimplePathfollowing followPathBehaviour = new SimplePathfollowing();\r\n\t\tfollowPathBehaviour.setInfluence(1);\r\n\t\tfollowPathBehaviour.setAttribute(\"arrivedistance\", \"10\", null);\r\n\t\t\r\n\t\t//add waypoints\r\n\t\tfor(int i=0 ; i< 20 ; i++)\r\n\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t//put in some edge ones too\r\n\t\t\tif(r.nextInt(6)%3==0)\r\n\t\t\t\tship.v.addWaypoint(new Point2d((int) LogicEngine.SCREEN_WIDTH * (i%2), LogicEngine.SCREEN_HEIGHT/1.5 + r.nextInt((int) LogicEngine.SCREEN_HEIGHT/5)));\r\n\t\t\telse\r\n\t\t\t\t//put in some random doublebacks etc\r\n\t\t\t\tship.v.addWaypoint(new Point2d(r.nextInt((int) LogicEngine.SCREEN_WIDTH), LogicEngine.SCREEN_HEIGHT/1.5 + r.nextInt((int) LogicEngine.SCREEN_HEIGHT/5)));\r\n\t\t}\r\n\t\tship.v.addWaypoint(new Point2d(LogicEngine.SCREEN_WIDTH/2, -100));\r\n\t\t\r\n\t\tif(Difficulty.isEasy())\r\n\t\t\tship.shotHandler = new BeamShot(50);\r\n\t\telse\r\n\t\tif(Difficulty.isMedium())\r\n\t\t\tship.shotHandler = new BeamShot(40);\r\n\t\telse\r\n\t\tif(Difficulty.isHard())\r\n\t\t\tship.shotHandler = new BeamShot(30);\r\n\t\t\r\n\t\tCustomBehaviourStep b = new CustomBehaviourStep(followPathBehaviour);\r\n\t\tship.stepHandlers.add(b);\r\n\t\t\r\n\t\t//destroy ships that get too close\r\n\t\tHitpointShipCollision hps = new HitpointShipCollision(ship, 10, 32);\r\n\t\thps.setSimpleExplosion();\r\n\t\t\r\n\t\tship.collisionHandler = hps; \r\n\t\t\r\n\t\tin_logicEngine.objectsEnemies.add(ship);\t\r\n\t\r\n\t}", "private static String placeShip(Request req) {\n BattleshipModel currentModel = getModelFromReq(req);\n\n int rows = Integer.parseInt(req.params(row));\n int col = Integer.parseInt(req.params(col));\n\n BattleshipModel placeModel = getModelFromReq(req);\n\n\n\n return \"SHIP\";\n }", "@POST(\"/IDShip\")\n\tShip IDShip(@Body int id, @Body int shipID);", "private void resizeInternal(int size) {\n // save effort if the size did not change\n if (size == this.inventory.size()) {\n return;\n }\n ItemStackList newInventory = ItemStackList.withSize(size);\n\n for (int i = 0; i < size && i < this.inventory.size(); i++) {\n newInventory.set(i, this.inventory.get(i));\n }\n this.inventory = newInventory;\n }", "public Usable(String name, String description, Point worldLocation, Point tileLocation, int amount, int size) {\r\n\t\tsuper(name, description, worldLocation, tileLocation, amount, size);\r\n\t}", "public abstract void adjustSize(long size);", "public void showMazeSize(int size);", "public void shipPlacer(Board board, ShipTeam fleet){\r\n\r\n\t\tArrayList<Ship> theShips = fleet.getShips();\r\n\r\n\t\tint randomX, randomY;\r\n\t\tfor (Ship s : theShips){\r\n\t\t\tboolean goodPlace = false;\r\n\t\t\twhile (goodPlace == false){\r\n\t\t\t\tRandom randCoords = new Random();\r\n\t\t\t\trandomX = randCoords.nextInt(10);\r\n\t\t\t\trandomY = randCoords.nextInt(10);\r\n\t\t\t\tif (randomX % 2 == 0)\r\n\t\t\t\t\tgoodPlace = board.placeShip(randomX, randomY, s, 1);\r\n\t\t\t\telse\r\n\t\t\t\t\tgoodPlace = board.placeShip(randomX, randomY, s, 2);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@POST(\"/UpdateShip\")\n\tShip updateShip(@Body Ship ship,@Body int id) throws GameNotFoundException;", "public void setSize(int size) {\n\tthis.sizeNumber = sizeNumber;\r\n}", "public GameObject spawnBigBeamer(LogicEngine in_logicEngine) {\n\t\tGameObject ship = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/bigbeamer.png\",((float)LogicEngine.SCREEN_WIDTH/2),LogicEngine.SCREEN_HEIGHT+64,0);\r\n\t\tship.i_animationFrameSizeHeight = 115;\r\n\t\tship.i_animationFrameSizeWidth = 115;\r\n\t\t\r\n\t\t\r\n\t\tship.stepHandlers.add(new FlyStraightStep(new Vector2d(0,-1f)));\r\n\t\t\r\n\t\r\n\t\tship.v.setMaxForce(2.5f);\r\n\t\tship.v.setMaxVel(2.5f);\r\n\t\tship.allegiance = GameObject.ALLEGIANCES.ENEMIES;\r\n\t\t\r\n\t\tint i_shootEvery = 80;\r\n\t\t\r\n\t\tBeamShot b = new BeamShot(i_shootEvery);\r\n\t\t\r\n\t\tb.b_flare=false;\r\n\t\tb.f_offsetX=-40;\r\n\t\tb.f_offsetY=-30;\r\n\t\tb.i_delay = 40;\r\n\t\tb.i_beamWidth = 15;\r\n\t\t\r\n\t\tBeamShot b2 = new BeamShot(i_shootEvery);\r\n\t\tb2.b_flare=false;\r\n\t\tb2.f_offsetX=40;\r\n\t\tb2.f_offsetY=-30;\r\n\t\tb2.i_delay = 40+(i_shootEvery/2);\r\n\t\tb2.i_beamWidth = 15;\r\n\t\tb.nextBeam = b2;\r\n\t\t\r\n\t\tship.shootEverySteps=1;\r\n\t\tship.shotHandler = b;\r\n\t\t\r\n\t\tHitpointShipCollision c = new HitpointShipCollision(ship, 100, 50f);\r\n\t\t\r\n\t\tif(!Difficulty.isHard())\r\n\t\t\tc.f_numberOfHitpoints = 200;\r\n\t\tif(!Difficulty.isMedium())\r\n\t\t\tc.f_numberOfHitpoints = 160;\r\n\t\t\r\n\t\tc.setExplosion(Utils.getBossExplosion(ship));\r\n\t\tship.collisionHandler = c;\r\n\t\t\r\n\t\tin_logicEngine.objectsEnemies.add(ship);\r\n\t\t\r\n\t\treturn ship;\r\n\t}", "public boolean createNewArea(Location location, Player owner, String name, int size) {\n JsonObject areaJSON = new JsonObject();\n areaJSON.addProperty(\"size\", size);\n areaJSON.addProperty(\"owner\", owner.getUniqueId().toString());\n areaJSON.addProperty(\"name\", name);\n areaJSON.addProperty(\"x\", location.getX());\n areaJSON.addProperty(\"z\", location.getZ());\n areaJSON.addProperty(\"uuid\", UUID.randomUUID().toString());\n REDIS.lpush(\"areas\", areaJSON.toString());\n // TODO: Check if redis actually appended the area to list and return the success of the operation\n return true;\n }", "public void setSize(int size){\n this.size = size;\n }", "private void placeAllShips()\n {\n \t\n \t//place 2 aircrafts\n \tfor(int n = 0; n < 2; n++){\n \trandomRow = rnd.nextInt(10); //get random integer from 0-9\n \trandomCol = rnd.nextInt(10);//get random integer from 0-9\n \trandomDir = rnd.nextInt(2);//get random integer from 0-1\n \twhile(!checkOverlap(randomRow,randomCol,AIRCRAFT_CARRIER_LENGTH)){ //check if random integers overlap existing ones\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \t//place aircraft if no overlap\n \tfor(int i = randomRow; i <randomRow + AIRCRAFT_CARRIER_LENGTH ; i++){\n \t\tfor(int j = randomCol; j < randomCol + AIRCRAFT_CARRIER_LENGTH; ++j){\n \t\t\tif(randomDir == DIRECTION_RIGHT)\n \t\t\t\tgrid[i][randomCol] = SHIP;\n \t\t\tif(randomDir == DIRECTION_DOWN)\n \t\t\t\tgrid[randomRow][j] = SHIP;\n \t\t\t}\n \t\t}\n \t}\n \t\n \t\n \t//place battleship\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,BATTLESHIP_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i <randomRow + BATTLESHIP_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + BATTLESHIP_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\t\n \t//place destroyer\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,DESTROYER_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + DESTROYER_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + DESTROYER_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\t\n \t//place submarine\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,SUBMARINE_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + SUBMARINE_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + SUBMARINE_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\n \t//place patrol\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,PATROL_BOAT_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + PATROL_BOAT_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + PATROL_BOAT_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\n }", "public Ship(String shipID, int health, boolean shipHit, int hitCount,\r\n boolean isAShip) {\r\n this.shipID = shipID;\r\n this.health = health;\r\n this.hitCount = hitCount;\r\n this.shipVertical = false;\r\n this.isAShip = isAShip;\r\n }", "public void setShip_address(Integer ship_address) {\n this.ship_address = ship_address;\n }", "public boolean setSize(Size size, boolean force) {\n// if (!force) {\n// Entity intersectsWith = location.getWorld().intersects(this, Util.getRectangle(getLocation(), size));\n//\n// if (intersectsWith != null) {\n// boolean left = intersectsWith.getLocation().getX() + intersectsWith.getSize().getWidth() <= getLocation().getX();\n// boolean right = intersectsWith.getLocation().getX() <= getLocation().getX() + size.getWidth();\n// boolean top = intersectsWith.getLocation().getY() <= getLocation().getY() + size.getHeight() && intersectsWith.getLocation().getY() > getLocation().getY();\n//\n//// if (top && !left && !right)\n//// return false;\n//\n// Location moveTo = null;\n//\n// if (left)\n// moveTo = new Location(getWorld(), intersectsWith.getLocation().getX() + intersectsWith.getSize().getWidth() + size.getWidth(), getLocation().getY());\n// if (right)\n// moveTo = new Location(getWorld(), intersectsWith.getLocation().getX() - size.getWidth() - 1, getLocation().getY());\n// if (top) {\n// this.size.setHeight(intersectsWith.getLocation().getY() - this.location.getY());\n// System.out.println(this.size.getHeight());\n//// return false;\n// }\n//\n// if (moveTo != null) {\n// Entity intersects = location.getWorld().intersects(this, Util.getRectangle(moveTo, size));\n//\n// if (intersects == null && this.location.asVector().distance(moveTo.asVector()) < 15)\n// this.location = moveTo;\n// else return false;\n// }\n// }\n// }\n\n if (interactingWithX != null || interactingWithY != null) {\n boolean left = interactingWithX != null && interactingWithX.getLocation().getX() + interactingWithX.size.width <= getLocation().getX();\n boolean right = interactingWithX != null && interactingWithX.getLocation().getX() <= getLocation().getX() + size.width;\n boolean top = interactingWithY != null && (interactingWithY.getLocation().getY() <= getLocation().getY() + size.height && interactingWithY.getLocation().getY() > getLocation().getY());\n\n// if (top && !left && !right)\n// return false;\n\n Location moveTo = null;\n\n if (left)\n moveTo = new Location(getWorld(), interactingWithX.getLocation().getX() + interactingWithX.size.width + size.width, getLocation().getY());\n if (right)\n moveTo = new Location(getWorld(), interactingWithX.getLocation().getX() - size.width - 1, getLocation().getY());\n if (top) {\n this.size.height = interactingWithY.getLocation().getY() - this.location.getY();\n System.out.println(this.size.height);\n// return false;\n }\n\n if (moveTo != null) {\n Entity intersects = location.getWorld().intersects(this, Util.getRectangle(moveTo, size));\n\n if (intersects == null && this.location.asVector().distance(moveTo.asVector()) < 15)\n this.location = moveTo;\n else return false;\n }\n }\n\n this.size = size;\n return true;\n }", "public Ship(String name) {\r\n this.name = name;\r\n }", "private void addToBag1(GridSquare.Type id, GridSquare.Type N, GridSquare.Type E, GridSquare.Type S, GridSquare.Type W) {\r\n\t\tbag1.add(new PieceTile(new GridSquare(id), new GridSquare[] {\r\n\t\t\t\tnew GridSquare(N),\r\n\t\t\t\tnew GridSquare(E),\r\n\t\t\t\tnew GridSquare(S),\r\n\t\t\t\tnew GridSquare(W)\r\n\t\t}));\r\n\t}", "public void placeShip(Coordinate selected, int orientation) {\r\n HashSet<Coordinate> location = new HashSet<>();\r\n if (orientation == -1) { //user Xed the orientation window\r\n location.add(selected);\r\n data.orientationXedFlag = true;\r\n } \r\n else { //user didnt X the orientation window\r\n Boolean spaceIsFree = false;\r\n if (data.gameState == 1) {\r\n location = game.getPlayerOne().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerOne().checkLegalPlacement(location, orientation);\r\n }\r\n else if (data.gameState == 2) {\r\n location = game.getPlayerTwo().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerTwo().checkLegalPlacement(location, orientation);\r\n }\r\n\r\n if (spaceIsFree) {\r\n if (data.gameState == 1)\r\n game.getPlayerOne().placeShip(location, data.shipToPlace);\r\n else if (data.gameState == 2)\r\n game.getPlayerTwo().placeShip(location, data.shipToPlace);\r\n data.placementSuccessful = true;\r\n data.shipToPlace++;\r\n }\r\n else {\r\n data.placementSuccessful = false; \r\n location.clear();\r\n location.add(selected);\r\n } \r\n }\r\n data.placement = convertPlacementData(location);\r\n setChanged();\r\n notifyObservers(data);\r\n data.orientationXedFlag = false;\r\n data.placementSuccessful = false; //reset flags to false to avoid errornous updates \r\n }", "private void placeAsteroids() {\r\n\t\taddParticipant(new Asteroid(0, 2, EDGE_OFFSET, EDGE_OFFSET, speed, this));\r\n\t\taddParticipant(new Asteroid(1, 2, SIZE - EDGE_OFFSET, EDGE_OFFSET, 3, this));\r\n\t\taddParticipant(new Asteroid(2, 2, EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this));\r\n\t\taddParticipant(new Asteroid(3, 2, SIZE - EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this));\r\n\t}", "public boolean setShip(int x0, int y0, int x1, int y1, int id, int length) {\r\n\t\tif (!fitShip(x0, y0, x1, y1) || ships.containsKey(id) || id == -1)\r\n\t\t\treturn false;\r\n\t\tShip ship = new Ship(length, id, this, getFieldsFromCoordinates(x0, y0, x1, y1));\r\n\t\tships.put(id, ship);\r\n\t\t++remainingShips;\r\n\t\treturn true;\r\n\t\t\r\n\t}", "public void addPlayerShip()\n\t{\n\t\t//if a PlayerShip is already spawned, a new one will not be added\n\t\tif (gameObj[1].size() == 0)\n\t\t{\n\t\t\tgameObj[1].add(new PlayerShip());\n\t\t\tSystem.out.println(\"PlayerShip added\");\n\t\t}else{\n\t\t\tSystem.out.println(\"A player ship is already spawned\");\n\t\t}\n\t\t\n\t}", "private void set_size(int size)\r\n\t{\r\n\t\tthis.size = size;\r\n\t}", "public void setShipType(Point xy, int value) {\r\n\t\tshipTypeMap.put(xy, value);\r\n\t}", "public void spawn(Integer spawnSize) {\n for (Integer i = 0; i < spawnSize; i++) {\n Enemy enemy = new Enemy(mainPlayerPosX, mainPlayerPosY);\n enemies.put(i, enemy);\n }\n initEnemiesSpawned = spawnSize;\n enemiesSize = spawnSize;\n }", "private static String getImagePath(int size) {\n return \"images/umbrella\" + size + \".png\";\n }", "boolean testPlaceAllShips(Tester t) {\n return t.checkExpect(this.los3.placeAll(this.em),\n em.placeImageXY(ship1.draw(), 0, 150).placeImageXY(ship2.draw(), 50, 50)\n .placeImageXY(ship3.draw(), 50, 50))\n && t.checkExpect(this.mt.placeAll(this.em), this.em);\n }", "public void changeSquareSize(){\r\n for(Square i : sqList){\r\n i.setSize(48);\r\n } \r\n }", "private void cp2PlaceShips(){\n\t\tint start = 5, stop = 9, orientation;\n\t\tboolean placed;\n\n\t\tfor(int x = start; x <= stop; x++){\n\t\t\tplaced = false;\n\n\t\t\twhile(!placed)\n\t\t\t{\n\t\t\t\tranX = ranNum.nextInt(600);\n\t\t\t\tranY = ranNum.nextInt(600);\n\t\t\t\torientation = ranNum.nextInt(2);\n\t\t\t\tplaced = true;\n\n\t\t\t\tships[x] = new Ship(x, shipNames[x], 'H', shipPlayer[x], shipWidth[x], shipHeight[x], ranX, ranY, shipSize[x]);\n\t\t\t\tships[x].setLocation(ships[x].getX(), ships[x].getY());\n\t\t\t\tships[x].setSize(ships[x].getWidth(), ships[x].getHeight());\n\n\t\t\t\tif(orientation == 1){\n\t\t\t\t\tchangeOrientation(x);\n\t\t\t\t}\n\n\t\t\t\tif(ships[x].getX() + ships[x].getWidth() < boardTwo.getWidth() && ships[x].getY() + ships[x].getHeight() < boardTwo.getHeight()){\n\t\t\t\t\tfor(int y = start; y < x; y++){\n\t\t\t\t\t\tif(ships[x].getBounds().intersects(ships[y].getBounds())){\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tplaced = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboardTwo.add(ships[x]);\n\t\t}\n\t}", "@Test\n public final void testValidGetSize() {\n int expRes = 5;\n int result = ship.getSize();\n assertEquals(expRes, result);\n expRes = 19;\n ship.setSize(expRes);\n result = ship.getSize();\n assertEquals(expRes, result);\n }", "void createNewContinent(Point2D location, Dimension2D size);", "private void spawnStuff(PlayScreen screen, float delta) {\n if (stageId!=3 && stageId!=5) {\n isCombatEnabled = true;\n int where;\n boolean spawnRight = true;\n float speed;\n\n\n //Alien Spawn\n if (System.currentTimeMillis() - lastASpawn >= SpawnATimer + extraTimer) {\n speed = (float)(Utils.doRandom(250,400));\n lastASpawn = System.currentTimeMillis();\n int count = 3;\n if (stageId==4) count = 1;\n for (int i = 0; i < count; i++) {\n if (stageId==4){\n speed = (float) (speed*0.75);\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - Alien.width, y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player));\n }else{\n int x = 0 - Alien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + Alien.width*2 , y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player,false));\n }\n }\n }\n //AcidAlien Spawn\n if (System.currentTimeMillis() - lastBSpawn >= SpawnBTimer + extraTimer) {\n speed = 200;\n lastBSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - AcidAlien.width, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player));\n }else{\n int x = 0 - AcidAlien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + AcidAlien.width*2, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player,false));\n }\n }\n //FastAlien Spawn\n if (System.currentTimeMillis() - lastCSpawn >= SpawnCTimer + extraTimer) {\n speed= Utils.doRandom(250,400);\n lastCSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - FastAlien.width, y, FastAlien.width, FastAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images,speed, screen.player));\n }else{\n int x = 0 - FastAlien.width;\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x-FastAlien.width*2,y,FastAlien.width,FastAlien.height))) hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images, speed,screen.player,false));\n }\n\n }\n\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n }else{\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width*2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages,false));\n }\n }\n /*if (System.currentTimeMillis() - lastBombSpawn >= SpawnTimerBomb) {\n lastBombSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - PurpleCapsuleItem.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x,y,PurpleCapsuleItem.width,PurpleCapsuleItem.height))) hits = true;\n }\n }\n screen.items.add(new PurpleCapsuleItem(x, y, 500, screen.itemPurpleImages));\n }*/\n }else{\n if (stageId==3) {\n //SPACE STAGE\n ///SPAWN ENEMY SHIP:\n //TODO\n if (PlayScreen.entities.size() == 1) {\n isCombatEnabled = false;\n //no enemy spawned, so spawn:\n if (spawnIterator >= killCount) {\n //TODO END STAGE\n } else {\n System.out.println(\"SPAWNS SHIP\");\n spawnIterator++;\n screen.entities.add(new EnemyShipOne(new Vector2(0, 0), 100, screen.enemyShipOne, true, screen.player));\n\n }\n }\n //Items:\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule) {\n lastCapsuleSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new BlackBulletItem(x, y, 1000, screen.itemBlackImages));\n\n\n }\n }else{\n if (stageId == 5){\n isCombatEnabled = true;\n float speed;\n boolean spawnRight=true;\n int where=0;\n //TODO FINAL STAGE\n if (!isBossSpawned){\n //TODO\n screen.entities.add(new Boss(new Vector2(PlayScreen.gameViewport.getWorldWidth(),PlayScreen.gameViewport.getWorldHeight()/2 - Boss.height/2),screen.player));\n isBossSpawned=true;\n }\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId == 4) {\n speed = speed / 2;\n where = Utils.doRandom(0, 1);\n if (where < 50) {\n spawnRight = true;\n } else {\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n } else {\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width * 2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages, false));\n }\n }\n //TODO\n }\n }\n }\n\n //run .update(delta) on all objects\n for (int i=0; i<screen.entities.size();i++){\n screen.entities.get(i).update(delta);\n }\n\n for (int i=0; i<screen.items.size();i++){\n screen.items.get(i).update(delta);\n }\n\n //labels set:\n screen.labelHealth.setText(\"Health: \" + screen.player.health + \"/\" + screen.player.maxHealth);\n if (scoreBased) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + scoreGoal);\n }else{\n if (killCount>0){\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + killCount);\n }else{\n if (boss){\n screen.labelInfo.setText(\"Boss: \"+screen.player.score + \"/\" + Boss.bossHealth);\n }else{\n screen.labelInfo.setText(\"\");\n }\n\n }\n }\n if (this.stageId == 999) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score);\n }\n\n\n }" ]
[ "0.68594146", "0.67188823", "0.6579163", "0.59909827", "0.5966179", "0.59107417", "0.590301", "0.58749026", "0.58515847", "0.5849936", "0.5816126", "0.5784615", "0.5778846", "0.5757599", "0.5751245", "0.57048607", "0.5665524", "0.5558951", "0.55187815", "0.5491093", "0.5483129", "0.5454718", "0.54448533", "0.5428432", "0.5411325", "0.5401548", "0.53911465", "0.5387764", "0.5386048", "0.5363559", "0.5330211", "0.53300935", "0.5315093", "0.5313633", "0.5310906", "0.5286567", "0.5250533", "0.5229741", "0.52211106", "0.52149767", "0.519639", "0.5180105", "0.5170531", "0.5159945", "0.51586765", "0.5153892", "0.51494175", "0.514105", "0.51401687", "0.5137438", "0.51292354", "0.51285213", "0.5124437", "0.51241016", "0.510943", "0.5108882", "0.51010734", "0.5083639", "0.5082881", "0.5078135", "0.5073635", "0.5060839", "0.5054346", "0.50489783", "0.50392324", "0.50137156", "0.5010266", "0.5003622", "0.49988273", "0.49917933", "0.49916184", "0.49881372", "0.49826202", "0.49755016", "0.49742478", "0.49702996", "0.49533617", "0.49472967", "0.49464312", "0.493838", "0.49338102", "0.49333104", "0.49322394", "0.4929448", "0.4927411", "0.49247557", "0.49174282", "0.49092668", "0.49080923", "0.48999912", "0.4898498", "0.48968634", "0.4895931", "0.4891786", "0.48905128", "0.48902115", "0.4879504", "0.4879353", "0.48761237", "0.48733523" ]
0.72268045
0
Places an Alien ship of the given size (size 1 == large alien, size 0 == small alien)
public void placeAlienBullet() { if (alien != null) { // If the alien is large fires a bullet in a random direction if (alien.getSize() == 1 && ship != null) { // Create the alien bullet ab = new AlienBullet(alien.getX(), alien.getY()); // give the alien bullet a random direction and the bullet speed velocity, // then add as participant double r = (2 * Math.PI) * RANDOM.nextDouble(); ab.setVelocity(BULLET_SPEED, r); addParticipant(ab); // Sets the alien bullet to expire when it reaches the bullet duration time // limit new ParticipantCountdownTimer(ab, "expire", BULLET_DURATION); } // If the alien is small fires a bullet aimed directly at the ship if (alien.getSize() == 0 && ship != null) { ab = new AlienBullet(alien.getX(), alien.getY()); ab.setSpeed(BULLET_SPEED); // Aims the alien bullet directly at the ship double A = ship.getY() - alien.getY(); double B = ship.getX() - alien.getX(); double angle = Math.atan2(A, B); ab.setVelocity(BULLET_SPEED, angle); // Add the alien bullet as a participant and then set it to expire when it // reaches the bullet duration time limit addParticipant(ab); new ParticipantCountdownTimer(ab, "expire", BULLET_DURATION); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void placeAlien(int size) {\r\n\r\n\t\tif (pstate.countAliens() == 0) {\r\n\t\t\t// create a random int with a value of either 1 or -1\r\n\t\t\tint a = -1;\r\n\t\t\tint j = RANDOM.nextInt(2);\r\n\t\t\tif (j == 0) {\r\n\t\t\t\ta = -1;\r\n\r\n\t\t\t} else {\r\n\t\t\t\ta = 1;\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Create a random value for the starting y position of the alien\r\n\t\t\tint i = RANDOM.nextInt(SIZE);\r\n\r\n\t\t\t\r\n\t\t\t// Create the alien\r\n\t\t\talien = new Alien(0, i, 0, a * 6, size, this);\r\n\t\t\tnew ParticipantCountdownTimer(alien, \"create\", ALIEN_DELAY);\r\n\t\t}\r\n\t}", "public Ship(String name, int size) {\r\n this.name = name;\r\n this.size = size;\r\n this.livesLeft = size;\r\n this.isSunk = false;\r\n }", "public void setSize(int size){\n\t\tthis.shipSize = size;\n\t}", "public void placeShip(int startTileX ,int startTileY , int orient,Tile myTiles[][],int size, boolean verbose)\n {\n if (orient ==0 ){\n for (int i=0; i<size; i++) { \n if (myTiles[startTileX+i][startTileY].getType() == Tile.Type.Sea){\n myTiles[startTileX+i][startTileY].setType(Tile.Type.Ship);\n }\n } \n }\n \n else if ( orient == 1) \n {\n for(int i=0; i<size; i++) { \n if (myTiles[startTileX][startTileY + i].getType() == Tile.Type.Sea){\n myTiles[startTileX][startTileY + i].setType(Tile.Type.Ship);\n }\n }\n }\n }", "public boolean placeShip(int row, int col, int shipSize, char orientation) {\n /* validate the input values before adding the ship */\n if(!checkAddShipParams(row, col, shipSize, orientation))\n return false;\n /* if someone is in the spot already we can't put another ship there */\n else if(spotTaken(row, col, shipSize, orientation))\n return false;\n \n /* We made it this far so everything must be ok, now place the ship */\n if(orientation == 'v' || orientation == 'V') {\n for(int i = 0; i < shipSize; i++)\n this.board[row+i][col] = 'S';\n \n numShips++;\n return true;\n }\n else { // don't need to check if it equals H because it has to if it passed the param check\n for(int i = 0; i < shipSize; i++)\n this.board[row][col+i] = 'S';\n \n numShips++;\n return true;\n }\n }", "private void placeShip() {\r\n\t\t// Expire the ship ship\r\n\t\tParticipant.expire(ship);\r\n\r\n\t\tclipShip.stop();\r\n\r\n\t\t// Create a new ship\r\n\t\tship = new Ship(SIZE / 2, SIZE / 2, -Math.PI / 2, this);\r\n\t\taddParticipant(ship);\r\n\t\tdisplay.setLegend(\"\");\r\n\t}", "public int getSize(){\n\t\treturn shipSize;\n\t}", "public void placeShip(Ship thisShip, String coordinate, int direction){\r\n\t\tthisShip.placed = true;\r\n\t\tint letterCoord = letterToIndex(coordinate.charAt(0));\r\n\t\tint numberCoord = Integer.parseInt(coordinate.substring(1))-1;\r\n\t\t\r\n\t\t\r\n\t\t\tif (direction == 1) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\t\tthisShip.set_position(numberCoord+i, letterCoord);\r\n\t\t\t\t\t}\r\n\t\t\t} else if (direction == 2) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\tthisShip.set_position(numberCoord, letterCoord+i);\r\n\t\t\t\t\t}\r\n\t\t\t} else if (direction == 3) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\tthisShip.set_position(numberCoord-i, letterCoord);\r\n\t\t\t\t}\r\n\t\t\t} else if (direction == 4) {\r\n\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\tthisShip.set_position(numberCoord, letterCoord - i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\tif(thisShip.name == \"Carrier\"){\r\n\t\t\tmyBoard.carrier.placed=thisShip.placed;\r\n\t\t\tmyBoard.carrier.position=thisShip.position;\r\n\t\t\t}\r\n\t\t\t\r\n\t\telse if(thisShip.name == \"Battleship\"){\r\n\t\t\tmyBoard.battleship.placed=thisShip.placed;\r\n\t\t\tmyBoard.battleship.position=thisShip.position;\r\n\t\t}\r\n\t\telse if(thisShip.name == \"Cruiser\"){\r\n\t\t\tmyBoard.cruiser.placed=thisShip.placed;\r\n\t\t\tmyBoard.cruiser.position=thisShip.position;\r\n\t\t}\r\n\t\telse if(thisShip.name == \"Submarine\"){\r\n\t\t\tmyBoard.submarine.placed=thisShip.placed;\r\n\t\t\tmyBoard.submarine.position=thisShip.position;\r\n\t\t}\r\n\t\telse if(thisShip.name == \"Patrol Boat\"){\r\n\t\t\t\tmyBoard.patrolboat.placed=thisShip.placed;\r\n\t\t\t\tmyBoard.patrolboat.position=thisShip.position;\r\n\t\t}\r\n\t\t\t\r\n\t\t}", "public Ship(int size, boolean direction){\n this.size = size;\n this.location = null;\n this.orientation = direction;\n }", "public UmbrellaPowerUp(int xCoord, int yCoord, int size) {\n super(xCoord, yCoord, getImagePath(size));\n powerType = \"umbrella\";\n }", "public Awale(short size) {\r\n\tthis.listeners = new ArrayList<AwaleListener>();\r\n\tthis.currentSide = 0;\r\n\tthis.size = size;\r\n\tthis.territory = new short[2][size];\r\n\tthis.simulateTerritory = new short[2][size];\r\n\tArrays.fill(this.territory[0], INITIAL_SEEDS);\r\n\tArrays.fill(this.territory[1], INITIAL_SEEDS);\r\n\tthis.points = new short[2];\r\n }", "public void enlargeSquare()\n {\n squareSize++;\n }", "public boolean verifShipCoordinates( IPlayer iPlayer, String startCoord,String endCoord, int size) {\n\t\tif (goodCoordinatesForm(startCoord) && goodCoordinatesForm(endCoord) ) {\r\n\r\n\t\t\tCoordinates coord1 = new Coordinates(startCoord);\r\n\t\t\tCoordinates coord2 = new Coordinates(endCoord);\r\n\t\t\tcoordinatesShipConverter(coord1, coord2);\r\n\t\t\tif (inMap(iPlayer,coord1) && inMap(iPlayer,coord2) ) {\r\n\t\t\t\tif (nonDiagonal(coord1,coord2)) {\r\n\t\t\t\t\tif(goodSize(coord1,coord2, size)) {\r\n\t\t\t\t\t\tif (isEmpty(iPlayer, coord1, coord2)) {\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse { System.out.println(\"Another ship is already on it\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse { System.out.println(\"The size of the ship isn't good, try again it should be \"+ size + \" coordinates large\");\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\telse {System.out.println(\"The ship is in diagonal, try again it should be like A-2\");\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse { System.out.println(\"Coordinates out of map, try again it should be between 0 and 10, and A to J\" );// can't do this.height.. because cannot do a static reference to a non static..\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse { System.out.println(\"Wrong coordinates writing, try again it should be like A-2\");\r\n\t\t}\r\n\t\t// is this presentation very clear ?\r\n\t\t\r\n\treturn false;\r\n\t\r\n\t}", "public static void placeShips (Game game) {\n\t\t\n\t\tint dir, x, y, length, width;\n\t\tint[] shipDim;\n\t\tboolean[] success = new boolean[shipSizes.length];\n\t\t\n\t\tfor (int i = 0; i < shipSizes.length; i++) {\n\t\t\tsuccess[i] = false;\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < shipSizes.length; i++) {\n\t\t\t\n\t\t\t// If an attempted ship location is invalid (off-screen or overlapping another ship) then success[i] will be false so it tries again.\n\t\t\twhile (success[i] == false) {\n\t\t\t\tdir = rnd.nextInt(2);\n\t\t\t\tx = rnd.nextInt(Config.BOARD_LENGTH);\n\t\t\t\ty = rnd.nextInt(Config.BOARD_WIDTH);\n\t\t\t\tshipDim = shipSizes[i];\n\t\t\t\tif (dir == 0) {\n\t\t\t\t\t// Across.\n\t\t\t\t\tlength = shipDim[0];\n\t\t\t\t\twidth = shipDim[1];\n\t\t\t\t} else {\n\t\t\t\t\t// Down.\n\t\t\t\t\tlength = shipDim[1];\n\t\t\t\t\twidth = shipDim[0];\n\t\t\t\t}\n\n\t\t\t\tShip ship = new Ship(i*10+5,length,width); // IDs will be 5, 15, 25, etc.\n\t\t\t\tsuccess[i] = game.addShip(ship, x, y);\n\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private void placeEnemyShips() {\n\t\tint s51 = (int) (Math.random() * 6); // mostly random numbers\n\t\tint s52 = (int) (Math.random() * 10);\n\t\tfor (int i = 0; i < 5; i++)\n\t\t\tpgrid[s51 + i][s52] = 1;\n\n\t\t// Places the ship of length 3\n\t\tint s31 = (int) (Math.random() * 10);\n\t\tint s32 = (int) (Math.random() * 8);\n\t\twhile (pgrid[s31][s32] == 1 || pgrid[s31][s32 + 1] == 1 // prevents\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overlaps\n\t\t\t\t|| pgrid[s31][s32 + 2] == 1) {\n\t\t\ts31 = (int) (Math.random() * 10);\n\t\t\ts32 = (int) (Math.random() * 8);\n\t\t}\n\t\tpgrid[s31][s32] = 1;\n\t\tpgrid[s31][s32 + 1] = 1;\n\t\tpgrid[s31][s32 + 2] = 1;\n\n\t\t// Places the ship of length 1\n\t\tint s21 = (int) (Math.random() * 10);\n\t\tint s22 = (int) (Math.random() * 9);\n\t\twhile (pgrid[s21][s22] == 1 || pgrid[s21][s22 + 1] == 1) { // prevents\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overlaps\n\t\t\ts21 = (int) (Math.random() * 10);\n\t\t\ts22 = (int) (Math.random() * 9);\n\t\t}\n\t\tpgrid[s21][s22] = 1;\n\t\tpgrid[s21][s22 + 1] = 1;\n\n\t}", "public void autoPutShip(int padding) {\n for (int l=3; l>=0; l--) {\n// if already have ships of this type go to another length\n if (decks[l] == (4-l)) continue;\n for (int i = 0; i < (4-l); i++) {\n// if already put ships of that type go on..\n if (decks[l] == (4-l)) continue;\n// choice random side of sea\n// (for optimal placing need to place near it)\n int side = (int) (Math.random() * 4);\n// generate random indent from side corner\n// (like you go counter clock wise)\n int indent = (int) (Math.random() * (10 - l));\n int x = 0, y = 0;\n// for side get direction\n Direction dir = Direction.values()[side];\n// calculate coordinates\n switch (side) {\n case 0:\n x = padding;\n y = indent;\n break;\n case 1:\n x = indent;\n y = 9 - padding;\n break;\n case 2:\n x = 9 - padding;\n y = 9 - indent;\n break;\n case 3:\n x = 9 - indent;\n y = padding;\n break;\n }\n// create ship (just for right coordinates)\n Ship ship = new Ship(x, y, l, dir);\n// and if you can put it - put\n if (canPutShip(ship)) putShip(ship);\n }\n }\n if (!isAllShipsOn()&& padding < 9) autoPutShip(padding + 1);\n }", "private void placePlayerShip(int x, int y) {\n\t\tif (shipsToPlace == 3) {\n\t\t\tlongShipCoords = new int[2];\n\t\t\tlongShipCoords[0] = x;\n\t\t\tlongShipCoords[1] = y;\n\n\t\t\t// creates long ship at x,y on egrid\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\tegrid[x + i][y] = 1;\n\n\t\t\t// makes ship tiles blue on enemy's board\n\t\t\tfor (int counter = 0; counter < 5; counter++)\n\t\t\t\tenemyBoard[x + counter][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t}\n\n\t\telse if (shipsToPlace == 2) {\n\t\t\t// create medium ship at x,y on egrid\n\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\t\t\tegrid[x][y + 2] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 2].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t}\n\n\t\telse if (shipsToPlace == 1) {\n\t\t\t// create small ship at x,y on egrid\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t\tstatus.setText(\" Click to attack\");\n\t\t}\n\t\tshipsToPlace--;\n\t\tenableAllTiles();\n\t\tdisableRestrictedTiles(x, y);\n\t}", "public void setSize(String size) throws IllegalPizza{\n\t\tif(size == null)\n\t\t\tthrow new IllegalPizza(\"Illegal, pizza size is not null!\");\n\t\tString size1 = size.toLowerCase();\n\t\tif (Objects.equals(size1, \"small\"))\n\t\t\tSize = size1;\n\t\telse if (Objects.equals(size1, \"medium\"))\n\t\t\tSize = size1;\n\t\telse if (Objects.equals(size1, \"large\"))\n\t\t\tSize = size1;\n\t\telse \n\t\t\tthrow new IllegalPizza(\"Illegal pizza size\");\n\t}", "public F2_Ship4() {\n\n setH(100);\n setW(50); //Set the size of the ship\n\n setArt(\"Art/SpaceShips/Faction2/Ship4.png\"); //Set the artwork of the ship\n }", "public void makeShips()\n\t{\n\t\t//The below is firstly to create the five ships \n\t\tint[] shipSizes= {2,3,3,4,5};\n\n\t\t//### Creating battleship to be put in the playerBattleShipsList\n\t\tfor (int x = 0; x < shipSizes.length; x ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newPlayerBattleShip = new BattleShip(shipSizes[x]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\tplayerBattleShipsList[x] = newPlayerBattleShip;\n\t\t}\n\n\t\t//### Creating battleship to be put in the aiBattleShipsList\n\n\t\tfor (int y = 0; y < shipSizes.length; y ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newAIBattleShip = new BattleShip(shipSizes[y]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\taiBattleShipsList[y] = newAIBattleShip;\n\t\t}\n\n\t}", "PlayerShip(int screenLength, int newY, int size, int newSpeed) {\n \tsuper(screenLength/2, newY, size, size);\n setHSpeed(newSpeed);\n }", "public void markEmptyFields(int shipSize){\n\t\tint x = hitLocation3.x;\n\t\tint y = hitLocation3.y;\n\t\t\n\t\tif( hitLocation2==null && hitLocation3 !=null ){\n\t\t\tif(x-1 >= 0 && y - 1 >= 0){\n\t\t\t\topponentShootTable[x-1][y-1] = true;\n\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-1) );\t//po skosie lewy gorny\t\t\t\t\n\t\t\t}\n\t\t\tif(x-1 >= 0){\n\t\t\t\topponentShootTable[x-1][y] = true;\n\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y) );\t\t//gorny\n\t\t\t}\n\t\t\tif(y + 1 <sizeBoard){\n\t\t\t\topponentShootTable[x][y+1] = true;\n\t\t\t\tpossibleshoots.remove( new TabLocation(x, y+1) );\t\t//prawy\t\n\t\t\t}\n\t\t\tif(x+1 < sizeBoard && y +1 < sizeBoard){\n\t\t\t\topponentShootTable[x+1][y+1] = true;\t\t\t\t//po skosie dol prawy\n\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+1) );\t\t\t\t\t\n\t\t\t}\n\t\t\tif(x-1 >= 0 && y + 1 < sizeBoard){\n\t\t\t\topponentShootTable[x-1][y+1] = true;\t\t\t\t//po skosie prawy gora\n\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+1) );\t\t\t\t\t\n\t\t\t}\n\t\t\tif( x +1 < sizeBoard){\n\t\t\t\topponentShootTable[x+1][y] = true;\t\t\t\t// dolny\n\t\t\t\tpossibleshoots.remove(new TabLocation(x+1,y));\t\t\t\t\t\n\t\t\t}\n\t\t\tif(x+1 <sizeBoard && y - 1 >= 0){\n\t\t\t\topponentShootTable[x+1][y-1] = true;\t\t\t//po skosie dol lewy\n\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-1) );\t\t\t\t\t\n\t\t\t}\n\t\t\tif(y - 1 >= 0){\n\t\t\t\topponentShootTable[x][y-1] = true;\t\t\t//lewy\n\t\t\t\tpossibleshoots.remove( new TabLocation(x, y-1) );\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\tboolean orientacja = false;\n\t\t\tif( hitLocation3.x == hitLocation2.x ) orientacja = true;\n\t\t\tint tempshipSize = shipSize;\n\t\t\tif( orientacja ){\n\t\t\t\t\n\t\t\t\tif( hitLocation2.y < hitLocation3.y ){\n\t\t\t\t\ttempshipSize = - shipSize;\n\t\t\t\t\n\t\t\t\t//prawy skrajny\t\n\t\t\t\t\tif(x-1 >= 0 && y + tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation( x-1, y+tempshipSize ) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y+tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation( x, y+tempshipSize ) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 <sizeBoard && y+tempshipSize>=0){\n\t\t\t\t\t\topponentShootTable[x+1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+tempshipSize) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(y+1<sizeBoard ){\n\t\t\t\t\t\topponentShootTable[x][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x, y+1) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y+1<sizeBoard && x-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(y+1<sizeBoard && x+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(x-1 >= 0 && y + tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x-1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+tempshipSize) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x, y+tempshipSize) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 < sizeBoard && y+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+tempshipSize) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(y-1 >= 0 ){\n\t\t\t\t\t\topponentShootTable[x][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x, y-1) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y-1 >= 0 && x-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(y-1 >= 0 && x+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif( x-1 >= 0 ){\n\t\t\t\t\tif( hitLocation2.y < hitLocation3.y ){\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x-1][y-i] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x-1][y+i] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(x + 1 < sizeBoard){\n\t\t\t\t\tif(hitLocation2.y < hitLocation3.y){\n\t\t\t\t\t\tfor(int i=0; i<shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x+1][y-i] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x+1][y+i] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif(hitLocation2.x < hitLocation3.x){\n\t\t\t\t\ttempshipSize = - shipSize;\n\t\t\t\t\n\t\t\t\t//dolny skrajny\t\n\t\t\t\t\tif(y-1 >= 0 && x + tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y-1) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x + tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(y+1 < sizeBoard && x+tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y+1) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(x+1 < sizeBoard ){\n\t\t\t\t\t\topponentShootTable[x+1][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 < sizeBoard && y-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x+1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 < sizeBoard && y+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(y-1 >= 0 && x + tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y-1) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(y+1 < sizeBoard && x+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y+1) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(x-1 >= 0 ){\n\t\t\t\t\t\topponentShootTable[x-1][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x-1 >= 0 && y-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(x-1 >= 0 && y+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x-1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(y-1 >= 0){\n\t\t\t\t\tif(hitLocation2.x < hitLocation3.x){\n\t\t\t\t\t\tfor(int i=0; i < shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x-i][y-1] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-i, y-1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i < shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x+i][y-1] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+i, y-1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(y+1 < sizeBoard){\n\t\t\t\t\tif(hitLocation2.x < hitLocation3.x){\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x-i][y+1] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-i, y+1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i < shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x+i][y+1] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+i, y+1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public boolean verifAIShipCoordinates( IPlayer iPlayer, String startCoord,String endCoord, int size) {\n\t\tif (goodCoordinatesForm(startCoord) && goodCoordinatesForm(endCoord) ) {\r\n\r\n\t\t\tCoordinates coord1 = new Coordinates(startCoord);\r\n\t\t\tCoordinates coord2 = new Coordinates(endCoord);\r\n\t\t\tcoordinatesShipConverter(coord1, coord2);\r\n\t\t\tif (inMap(iPlayer,coord1) && inMap(iPlayer,coord2) ) {\r\n\t\t\t\tif (nonDiagonal(coord1,coord2)) {\r\n\t\t\t\t\tif(goodSize(coord1,coord2, size)) {\r\n\t\t\t\t\t\tif (isEmpty(iPlayer, coord1, coord2)) {\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\t// is this presentation very clear ?\r\n\t\t\r\n\treturn false;\r\n\t\r\n\t}", "public void addShip(Ship ship) {\n\t\tint row = ship.getRow();\n\t\tint column = ship.getColumn();\n\t\tint direction = ship.getDirection();\n\t\tint shipLength = ship.getLength();\n\t\t//0 == Horizontal; 1 == Vertical\n\t\tif (direction == 0) {\n\t\t\tfor (int i = column; i < shipLength + column; i++) {\n\t\t\t\tthis.grid[row][i].setShip(true);\n\t\t\t\tthis.grid[row][i].setLengthOfShip(shipLength);\n\t\t\t\tthis.grid[row][i].setDirectionOfShip(direction);\n\t\t\t}\n\t\t}\n\t\telse if (direction == 1) {\n\t\t\tfor (int i = row; i < shipLength + row; i++) {\n\t\t\t\tthis.grid[i][column].setShip(true);\n\t\t\t\tthis.grid[i][column].setLengthOfShip(shipLength);\n\t\t\t\tthis.grid[i][column].setDirectionOfShip(direction);\n\t\t\t}\n\t\t}\n\t}", "private void addMinigames(){\n Point a = new Point();\n getWindowManager().getDefaultDisplay().getSize(a);\n Log.d(\"XY\", Integer.toString(a.x)+\" \"+Integer.toString(a.y));\n\n\n\n generateMiniGames();\n\n addFlower();\n\n }", "public boolean placeShip(int player, int x, int y) {\n\n Ship ship = null;\n\n for (int i = 0; i < 5; i++) {\n if (playerShips[i].selected) {\n ship = playerShips[i];\n }\n }\n if (ship == null) {\n return false;\n }\n\n if (orientation == 1) {\n if (ship.length + y > 10) {\n return false;\n }\n }\n if (orientation == 0) {\n if (ship.length + x > 10) {\n return false;\n }\n }\n for (int i = 0; i < ship.length; i++) {\n if(orientation == 0) {\n if (humanPlayerBoard[y][x+i] != board.water.ordinal()) {\n return false;\n }\n }\n else{\n if(humanPlayerBoard[y+i][x] != board.water.ordinal()){\n return false;\n }\n }\n }\n for (int i = 0; i < ship.length; i++) {\n if(orientation == 0) {\n humanPlayerBoard[y][x+i] = board.ship.ordinal();\n }\n else{\n humanPlayerBoard[y+i][x] = board.ship.ordinal();\n }\n }\n if(ship.placed){\n if(ship.orientation == 1){\n for(int i = 0; i < ship.length; i++){\n humanPlayerBoard[ship.y+i][ship.x] = board.water.ordinal();\n }\n }\n else{\n for(int j = 0; j < ship.length; j++){\n humanPlayerBoard[ship.y][ship.x+j] = board.water.ordinal();\n }\n }\n }\n ship.setShip(x, y, orientation);\n ship.placed = true;\n\n return true;\n }", "public boolean setUpShip(int noOfShips, List<String> locationSets) throws SizeLimitExceededException {\r\n\r\n\t\tboolean setUpSuccessFully = false;\r\n\t\tif (noOfShips > battleArea.getWidth() * (battleArea.getHeight() - 'A' + 1)) {\r\n\t\t\tthrow new SizeLimitExceededException(\"Number of ships can not exceed width * height of battle area\");\r\n\r\n\t\t}\r\n\r\n\t\tlogger.info(\"No of Ships per player : \" + noOfShips);\r\n\r\n\t\t// Get each ship coordinates from input location sets\r\n\r\n\t\tint i = 0;\r\n\t\twhile (i < noOfShips) {\r\n\t\t\tString result = locationSets.get(i);\r\n\t\t\tString shipType = result.substring(0, 1);\r\n\t\t\tint width = Integer.valueOf(result.substring(2, 3));\r\n\t\t\tint height = Integer.valueOf(result.substring(4, 5));\r\n\t\t\tString startingCell = null;\r\n\r\n\t\t\r\n\r\n\t\t\t\tBattleShip ship = new BattleShip(width, height);\r\n\t\t\t\tstartingCell = result.substring(6, 8);\r\n\t\t\t\tlogger.info(\"Player Name :\" + this.getPlayerName() + \" \" + \"ship type : \" + shipType);\r\n\t\t\t\tlogger.info(\"width of ship: \" + width + \" \" + \"height : \" + height + \" \" + \"starting Cell: \"\r\n\t\t\t\t\t\t+ startingCell);\r\n\r\n\t\t\t\tsetUpSuccessFully = battleArea.addShipsToBattleArea(ship, startingCell, BattleShipType.valueOf(shipType).getVal());\r\n\t\t\t\r\n//\r\n//\t\t\telse if (BattleShipConstants.PType.equals(shipType)) {\r\n//\r\n//\t\t\t\tBattleShip pShip = new PTypeBattleShip(width, height);\r\n//\t\t\t\tstartingCell = result.substring(6, 8);\r\n//\t\t\t\tlogger.info(\"Player Name :\" + this.getPlayerName() + \" \" + \"ship type : \" + shipType);\r\n//\t\t\t\tlogger.info(\"width of ship: \" + width + \" \" + \"height : \" + height + \" \" + \"starting Cell: \"\r\n//\t\t\t\t\t\t+ startingCell);\r\n//\r\n//\t\t\t\tsetUpSuccessFully = battleArea.addShipsToBattleArea(pShip, startingCell, BattleShipConstants.pStrength);\r\n//\t\t\t}\r\n\r\n//\t\t\telse {\r\n//\t\t\t\tSystem.out.println(\"Ships can be either Q-Type or P-Type\");\r\n//\t\t\t}\r\n\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\tif (!setUpSuccessFully) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn setUpSuccessFully;\r\n\r\n\t}", "private Alien spawnAlien() {\n Float[] offset = Util.randomCoordOffset(-((float)Util.TILEWIDTH/2), ((float)Util.TILEWIDTH/2), 0.8f);\n return new Alien(new Coordinate(position.x + (Util.TILEWIDTH/2) + offset[0], position.y + (Util.TILEHEIGHT/2) + offset[1]), this);\n }", "@Test\n public final void testSetSize() {\n int expRes = 5;\n int falseEnter = -4;\n ship.setSize(falseEnter);\n int result = this.ship.getSize();\n assertEquals(expRes, result);\n falseEnter = -1;\n ship.setSize(falseEnter);\n result = this.ship.getSize();\n assertEquals(expRes, result);\n }", "public AlienShip(Point[] inShape, Point inPosition, double inRotation) {\r\n\t\tsuper(inShape, inPosition, inRotation);\r\n\t}", "protected abstract void addBonusToShip(Ship ship);", "public pacman(int size_of_map) {\n this.positionX = (this.positionY = 0);\n this.size_of_map = size_of_map;\n }", "public ShoeInventory(int size)\r\n\t{\r\n\t\tif(size == 0)\r\n\t\t\tSystem.out.println(\"Cannot set array to size 0.\"); \r\n\t\telse\r\n\t\t{\r\n\t\t\tcounter = 0;\r\n\t\t\tarraySize = size;\r\n\t\t\ttypeArray = new ShoeType[arraySize];\r\n\t\t}\r\n\t}", "@Test\n public void testSunkShip() {\n final Ship submarine = new Submarine();\n final String errorMessage = \"There isn't a ship in that position\";\n\n submarine.placeShipAt(0, 0, true, ocean);\n assertTrue(errorMessage, ocean.shootAt(0, 0));\n assertTrue(errorMessage, ocean.shootAt(0, 1));\n assertTrue(errorMessage, ocean.shootAt(0, 2));\n assertEquals(1, ocean.getShipsSunk());\n ocean.print();\n }", "public static void setHotelSize(int size) {\r\n\t\tfor(int count = 0;count< size; count++) {\r\n\t\t\thotel_size.add(count + 1);\r\n\t\t}\r\n\t}", "public void sizeBy(float size) {\n internalGroup.sizeBy(size);\n dataTrait.width = internalGroup.getWidth();\n dataTrait.height = internalGroup.getHeight();\n resetSprite();\n }", "private Ship consoleGetAShip(Ship[] ships, String name, int size) {\n // boolean goodLocation = false;\n boolean vertical;\n int range = 10 - size;\n int row, col;\n String line;\n String in;\n Ship ship;\n \n //This code sometimes places ships outside of graphical grid\n // ¯\\_(\"/)_/¯\n while (true) {\n System.out.println(\"Place your \" + name + \": Will it be vertical? (Y/N) \");\n line = scan.nextLine();\n while (line.length() == 0) {\n line = scan.nextLine();\n }\n in = line.substring(0,1);\n System.out.println(\"input string: \" + in);\n \n if (in.equalsIgnoreCase(\"Y\")) {\n vertical = true;\n break;\n } else if (in.equalsIgnoreCase(\"N\")) {\n vertical = false;\n break;\n }\n // Invalid input; once more through the while loop to try again\n }\n while (true) {\n if (vertical) {\n System.out.print(\"Row (0 through \" + range + \"): \");\n row = scan.nextInt();\n scan.nextLine();\n System.out.print(\"Column (0 through 9): \");\n col = scan.nextInt();\n if (row < 0 || row > range || col < 0 || col > 9) continue;\n } else { // horizontal\n System.out.print(\"Row (0 through 9): \");\n row = scan.nextInt();\n System.out.print(\"Column (0 through \" + range + \"): \");\n col = scan.nextInt();\n if (row < 0 || row > 9 || col < 0 || col > range) continue;\n } \n ship = new Ship(row, col, vertical, size, name);\n if (collide(ship, ships)) {\n System.out.println(\"There's already a ship there! Please try again.\");\n continue;\n }\n break;\n }\n return ship;\n }", "private static StructureElement createCenteredSquare(int size) {\r\n\t\treturn new StructureElement(createSquareMask(size), size / 2, size / 2);\r\n\t}", "private void drawShip(int startX, int startY, int direction, int length) {\n if (direction == 4) { //South\n for (int y = 0; y < length; y++) {\n defendingGrid[startX][startY + y].setHasShip(true);\n\n\n }\n } else if (direction == 2) { //East\n\n for (int y = 0; y < length; y++) {\n defendingGrid[startX + y][startY].setHasShip(true);\n\n }\n } else if (direction == 6) { //West\n for (int y = 0; y < length; y++) {\n defendingGrid[startX - y][startY].setHasShip(true);\n\n }\n } else if (direction == 0) { //North\n for (int y = 0; y < length; y++) {\n defendingGrid[startX][startY - y].setHasShip(true);\n }\n }\n }", "public void setMakingShop(Player owner, Player establisher, Integer x, Integer y, Integer z, World world){\n\t\testablisher.sendMessage(ChatColor.GREEN + getConfig().getString(\"ask-for-item\"));\n\t\tUUID ownerID = owner.getUniqueId();\n\t\tUUID establisherID = establisher.getUniqueId();\n\t\tString blockLocation = x + \",\" + y + \",\" + z + \",\" + world.getName()+\",\"+ownerID.toString()+\",\"+establisherID.toString();\n\t\tdebugOut(\"Marking \" + establisher.getName()+\" as creating a shop at \"+blockLocation);\n\t\tPlayerMakingShop.put(establisher.getName(), blockLocation);\n\t}", "public boolean placeShip(Ship ship, int x, char y, boolean isVertical) {\n Ship s2;\n switch(ship.getShipType()) {\n case \"BATTLESHIP\":\n ship = new Battleship();\n s2 = new Battleship();\n break;\n case \"DESTROYER\":\n ship = new Destroyer();\n s2 = new Destroyer();\n break;\n case \"MINESWEEPER\":\n ship = new Minesweeper();\n s2 = new Minesweeper();\n break;\n default:\n return false;\n }\n\n boolean successful = playersBoard.placeShip(ship, x, y, isVertical);\n if (!successful)\n return false;\n\n boolean opponentPlacedSuccessfully;\n do {\n // AI places random ships, so it might try and place overlapping ships\n // let it try until it gets it right\n opponentPlacedSuccessfully = opponentsBoard.placeShip(s2, randRow(), randCol(), randVertical());\n } while (!opponentPlacedSuccessfully);\n\n return true;\n }", "public void assignAsteroidToShip(Ship ship, Asteroid asteroid) {\n\t\tasteroidToShip.put(asteroid.getId(), ship);\n\t}", "public Ships(ShipTypes type) {\n this.type = type;\n }", "public void putShip(Ship ship) throws OverlapException{\r\n if(this.ship == null){\r\n this.ship = ship;\r\n }else{\r\n throw new OverlapException(row, column);\r\n }\r\n }", "public void placeShip(Board board, Ship ship) {\n\n\n Point startPoint = null;\n boolean validPoint = false;\n while (!validPoint) {\n System.out.printf(\"Place your %s (%d spaces).%n\", ship.getName(), ship.getLength());\n try {\n startPoint = returnPointFromInput(board);\n if (startPoint != null && !startPoint.hasShip()) {\n validPoint = true;\n } else {\n System.out.println(\"Invalid input. Please enter a coordinate pair. Ex: 1A (Case insensitive).\");\n }\n } catch (IllegalArgumentException | NoSuchElementException e) {\n System.out.println(e.getMessage());\n }\n }\n\n int emptySpaces = 0;\n boolean validBranch = false;\n Point[] branch = null;\n while (!validBranch) {\n\n String direction = null;\n boolean validDirection = false;\n while (!validDirection) {\n try {\n direction = directionFromInput();\n validDirection = true;\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n }\n }\n\n branch = makeBranch(board, startPoint, ship.getLength(), direction);\n for (Point point : branch) {\n if (!point.hasShip()) {\n emptySpaces++;\n }\n }\n if (emptySpaces == ship.getLength()) {\n validBranch = true;\n } else {\n System.out.println(\"You can't put a ship there. Not enough room\");\n emptySpaces = 0;\n }\n }\n\n // pass ship to point\n for (Point point : branch) {\n point.setShip(ship);\n point.setHasShip(true);\n }\n }", "public void teleportToAlien() {\n\t\tAlien a;\n\t\tSpaceship sp;\n\t\tif(roamingAliens > 0){\n\t\t\tsp = getTheSpaceship();\n\t\t\ta = getRandomAlien();\n\t\t\tsp.setLocation(a.getLocation());\n\t\t\tSystem.out.println(\"You've teleported to an alien\");\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Error: There were no aliens to jump to.\");\n\t}", "boolean testPlaceShip(Tester t) {\n return t.checkExpect(ship3.place(this.em),\n em.placeImageXY(new CircleImage(10, OutlineMode.SOLID, Color.CYAN), 50, 50))\n && t.checkExpect(ship1.place(this.em),\n em.placeImageXY(new CircleImage(10, OutlineMode.SOLID, Color.CYAN), 0, 150));\n }", "public Player createArmouredShip(int armour,char[] locationIndex,Player player){\n Map<String,Integer> parts = new HashMap<>();\n for(int i=locationIndex[0];i<locationIndex[0]+getShip().getHeight();i++){\n if (!player.getInventory().containsKey(\"\"+(char)i+\"\")){\n player.getInventory().put(\"\"+(char)i+\"\",null);\n }\n int xCoordinate = Integer.parseInt(\"\"+locationIndex[1]);\n for (int j= xCoordinate;j<xCoordinate+getShip().getWidth();j++){\n parts.put(\"\"+j+\"\",armour);\n }\n getShip().setParts(parts);\n player.getInventory().put(\"\"+(char)i+\"\",getShip());\n }\n return player;\n }", "public Ship(int l){\n this.lifePoints=l;\n }", "protected void updateShips(String input) {\n\t\t//System.out.println(\"updateShips \" + input);\n\t\tShip temp = smallShip;\n \tfor(int i = 0; i < 3; i++) {\n \t\t\n// \t\n \tfor(int j = 0; j < temp.getCoordinates().size(); j++) {\n \t\tif(temp.getCoordinates().get(j).equals(input))\n \t\t\ttemp.getCoordinates().set(j, \"X\");\n \t}\n \tif(i == 0)\n \t\ttemp = mediumShip;\n \telse if(i == 1)\n \t\ttemp = largeShip;\n \t}\n\t}", "public static void placeShipHorzMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length - (ship.getLength() - 1) || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n if (!board[indexR][c].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n c = indexC - 1;\r\n }\r\n }\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n board[indexR][c] = symbol;\r\n } \r\n }", "public Ship(int shipSize, Directions direction, Coordinate headPosition) {\n\t\tshipPositions = new ArrayList<Coordinate>();\n\t\theadPosition.setIsHit(false);\n\t\theadPosition.setIsSunk(false);\n\t\t\n\t\tthis.shipSize = shipSize;\n\t\tthis.direction = direction;\n\t\n\t\t//sets the starting point of the ship\n\t\tshipPositions.add(headPosition);\n\t\t\n\t\t//constructs the rest of the ship\n\t\tsetShipPositionsGivenDirectionStartingPoint();\n\n\t}", "private void createShips() {\n //context,size, headLocation, bodyLocations\n Point point;\n Ship scout_One, scout_Two, cruiser, carrier, motherShip;\n if(player) {\n point = new Point(maxN - 1, 0); //row, cell\n scout_One = new Ship(1, point, maxN, \"Scout One\", player);\n ships.add(scout_One);\n point = new Point(maxN - 1, 1);\n scout_Two = new Ship(1, point, maxN, \"Scout Two\", player);\n ships.add(scout_Two);\n point = new Point(maxN - 2, 2);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n ships.add(cruiser);\n point = new Point(maxN - 2, 3);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n ships.add(carrier);\n point = new Point(maxN - 4, 5);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n ships.add(motherShip);\n\n }else{\n Random rand = new Random();\n int rowM = maxN-3;\n int colM = maxN -2;\n int row = rand.nextInt(rowM);\n int col = rand.nextInt(colM);\n point = new Point(row, col);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n updateOccupiedCells(motherShip.getBodyLocationPoints());\n ships.add(motherShip);\n\n rowM = maxN - 1;\n colM = maxN -1;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n updateOccupiedCells(carrier.getBodyLocationPoints());\n ships.add(carrier);\n checkIfOccupiedForSetShip(carrier, row, col, rowM, colM);\n\n\n rowM = maxN - 1;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n updateOccupiedCells(cruiser.getBodyLocationPoints());\n ships.add(cruiser);\n checkIfOccupiedForSetShip(cruiser, row, col, rowM, colM);\n\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_Two = new Ship(1, point, maxN, \"Scout_Two\", player);\n updateOccupiedCells(scout_Two.getBodyLocationPoints());\n ships.add(scout_Two);\n checkIfOccupiedForSetShip(scout_Two, row, col, rowM, colM);\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_One = new Ship(1, point, maxN, \"Scout_One\", player);\n updateOccupiedCells(scout_One.getBodyLocationPoints());\n ships.add(scout_One);\n checkIfOccupiedForSetShip(scout_One, row, col, rowM, colM);\n\n\n\n\n }\n //Need an algorithm to set enemy ship locations at random without overlaps\n }", "public static void placeShipVertMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length - (ship.getLength() - 1) || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n if (!board[r][indexC].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n r = indexR - 1;\r\n }\r\n }\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n board[r][indexC] = symbol;\r\n } \r\n \r\n }", "public void setSize(RMSize aSize) { setSize(aSize.width, aSize.height); }", "private void setShips(){\n\t\t\n\t\tint x,y;\n\t\tboolean orientacja;\n\t\tRandom generator = new Random();\n\t\t\n\t\tint ilosc = 1;\n\t\tint j = 0;\n\t\tfor(int i = 4; i > 0 ; i--){\n\t\t\twhile( j < ilosc ){\n\t\t\t\tx = generator.nextInt( 13 );\t\t\n\t\t\t\ty = generator.nextInt( 13 );\n\t\t\t\torientacja = generator.nextBoolean();\n\t\t\t\tif( isPossibleAddShip(x, y, i, orientacja) ) j++;\t\n\t\t\t}\n\t\tilosc++;\n\t\tj=0;\n\t\t}\n\t\t\n\t}", "@Test\n void should_place_ships_scenario_2() {\n Board board = BoardData.getBoard(15, 15);\n\n List<ShipType> shipConfigs = Arrays.asList(\n ShipType.ONE,\n ShipType.ONE,\n ShipType.ONE,\n ShipType.ONE,\n ShipType.TWO,\n ShipType.TWO\n );\n\n AutomaticShipPlacer automaticShipPlacer = new AutomaticShipPlacer();\n automaticShipPlacer.placeShips(shipConfigs, board);\n\n assertSame(6, board.getShips().size());\n BoardPrinter.print(board);\n }", "@Override\n public void Insert(Ship ship, String start,String end){\n if(start.charAt(0)==end.charAt(0)){\n for(int i = 0;i < ship.getSize(); i++){\n grid[start.charAt(1)+i-'0'][start.charAt(0)-'A'] = \"[\"+ ship.getType() +\"]\";\n ship.updateCoordlist(start.charAt(1)+i-'0',start.charAt(0)-'A');\n }\n }\n else{\n for(int i = 0;i < ship.getSize(); i++){\n grid[start.charAt(1)-'0'][start.charAt(0)-'A'+i] = \"[\"+ ship.getType() +\"]\";\n ship.updateCoordlist(start.charAt(1)-'0',start.charAt(0)-'A'+i);\n\n }\n }\n }", "@Test\n void should_place_ships_scenario_1() {\n Board board = BoardData.getBoard(15, 15);\n\n List<ShipType> shipConfigs = Arrays.asList(\n ShipType.ONE,\n ShipType.ONE,\n ShipType.TWO,\n ShipType.THREE\n );\n\n AutomaticShipPlacer automaticShipPlacer = new AutomaticShipPlacer();\n automaticShipPlacer.placeShips(shipConfigs, board);\n\n assertSame(4, board.getShips().size());\n BoardPrinter.print(board);\n }", "protected final void multiplySize(float size)\n {\n super.setSize(this.bokoblinWidth * size, this.bokoblinHeight * size);\n }", "public void putShips(int nbShips){\n ai.putShips(this.ships);\n }", "public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {\n\t\t\r\n\t\tstats.getDynamic().getMod(Stats.HRS_SENSOR_RANGE_MOD).modifyFlat(id, (Float) mag.get(hullSize));\r\n\t\t\r\n\t\tboolean sMod = isSMod(stats);\r\n\t\tif (sMod) {\r\n\t\t\tfloat mag = ((Float) combatMag.get(hullSize)).intValue();\r\n\t\t\tstats.getSightRadiusMod().modifyFlat(id, mag);\r\n\t\t}\r\n\t}", "public void positionShips(Ship ships[]) {\n ships[0] = new AircraftCarrier(3, true, 'A', 5, 'F');\n ships[1] = new Battleship(6, true, 'B', 4, 'A');\n ships[2] = new Destroyer(2, false, 'D', 3, 'E');\n ships[3] = new Submarine(1, true, 'S', 3, 'J');\n ships[4] = new PatrolBoat(9, false, 'P', 2, 'C');\n }", "public void toggleShipAtTile(int tile) {\r\n if (placedShips < 4 || hasShip(tile)) {\r\n if (hasShip(tile)) {\r\n placedShips -= 1;\r\n } else {\r\n placedShips += 1;\r\n }\r\n tiles[tile] = tiles[tile] ^ 1;\r\n }\r\n }", "public void setSize(int size);", "@POST(\"/AddShip\")\n\tint addShip(@Body Ship ship,@Body int id) throws GameNotFoundException;", "public void size(final int theWidth, final int theHeight);", "public void spawnSateliteShip(LogicEngine in_logicEngine,float in_x)\r\n\t{\n\t\tGameObject ship = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/gravitonlevel.png\",in_x,LogicEngine.SCREEN_HEIGHT,1);\r\n\t\tship.i_animationFrameSizeWidth = 64;\r\n\t\tship.i_animationFrameSizeHeight = 32;\r\n\t\tship.i_animationFrame = 2;\r\n\t\tship.allegiance = GameObject.ALLEGIANCES.ENEMIES;\r\n\t\t\r\n\t\tship.v.setMaxForce(1.0f);\r\n\t\tship.v.setMaxVel(4.0f);\r\n\t\t\r\n\t\t\r\n\t\t//fly down\r\n\t\t//ship.stepHandlers.add( new FlyStraightStep(new Vector2d(0,-1f)));\r\n\t\t\r\n\t\tSimplePathfollowing followPathBehaviour = new SimplePathfollowing();\r\n\t\tfollowPathBehaviour.setInfluence(1);\r\n\t\tfollowPathBehaviour.setAttribute(\"arrivedistance\", \"10\", null);\r\n\t\t\r\n\t\t//add waypoints\r\n\t\tfor(int i=0 ; i< 20 ; i++)\r\n\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t//put in some edge ones too\r\n\t\t\tif(r.nextInt(6)%3==0)\r\n\t\t\t\tship.v.addWaypoint(new Point2d((int) LogicEngine.SCREEN_WIDTH * (i%2), LogicEngine.SCREEN_HEIGHT/1.5 + r.nextInt((int) LogicEngine.SCREEN_HEIGHT/5)));\r\n\t\t\telse\r\n\t\t\t\t//put in some random doublebacks etc\r\n\t\t\t\tship.v.addWaypoint(new Point2d(r.nextInt((int) LogicEngine.SCREEN_WIDTH), LogicEngine.SCREEN_HEIGHT/1.5 + r.nextInt((int) LogicEngine.SCREEN_HEIGHT/5)));\r\n\t\t}\r\n\t\tship.v.addWaypoint(new Point2d(LogicEngine.SCREEN_WIDTH/2, -100));\r\n\t\t\r\n\t\tif(Difficulty.isEasy())\r\n\t\t\tship.shotHandler = new BeamShot(50);\r\n\t\telse\r\n\t\tif(Difficulty.isMedium())\r\n\t\t\tship.shotHandler = new BeamShot(40);\r\n\t\telse\r\n\t\tif(Difficulty.isHard())\r\n\t\t\tship.shotHandler = new BeamShot(30);\r\n\t\t\r\n\t\tCustomBehaviourStep b = new CustomBehaviourStep(followPathBehaviour);\r\n\t\tship.stepHandlers.add(b);\r\n\t\t\r\n\t\t//destroy ships that get too close\r\n\t\tHitpointShipCollision hps = new HitpointShipCollision(ship, 10, 32);\r\n\t\thps.setSimpleExplosion();\r\n\t\t\r\n\t\tship.collisionHandler = hps; \r\n\t\t\r\n\t\tin_logicEngine.objectsEnemies.add(ship);\t\r\n\t\r\n\t}", "private static String placeShip(Request req) {\n BattleshipModel currentModel = getModelFromReq(req);\n\n int rows = Integer.parseInt(req.params(row));\n int col = Integer.parseInt(req.params(col));\n\n BattleshipModel placeModel = getModelFromReq(req);\n\n\n\n return \"SHIP\";\n }", "private void resizeInternal(int size) {\n // save effort if the size did not change\n if (size == this.inventory.size()) {\n return;\n }\n ItemStackList newInventory = ItemStackList.withSize(size);\n\n for (int i = 0; i < size && i < this.inventory.size(); i++) {\n newInventory.set(i, this.inventory.get(i));\n }\n this.inventory = newInventory;\n }", "@POST(\"/IDShip\")\n\tShip IDShip(@Body int id, @Body int shipID);", "public Usable(String name, String description, Point worldLocation, Point tileLocation, int amount, int size) {\r\n\t\tsuper(name, description, worldLocation, tileLocation, amount, size);\r\n\t}", "public abstract void adjustSize(long size);", "public void showMazeSize(int size);", "public void shipPlacer(Board board, ShipTeam fleet){\r\n\r\n\t\tArrayList<Ship> theShips = fleet.getShips();\r\n\r\n\t\tint randomX, randomY;\r\n\t\tfor (Ship s : theShips){\r\n\t\t\tboolean goodPlace = false;\r\n\t\t\twhile (goodPlace == false){\r\n\t\t\t\tRandom randCoords = new Random();\r\n\t\t\t\trandomX = randCoords.nextInt(10);\r\n\t\t\t\trandomY = randCoords.nextInt(10);\r\n\t\t\t\tif (randomX % 2 == 0)\r\n\t\t\t\t\tgoodPlace = board.placeShip(randomX, randomY, s, 1);\r\n\t\t\t\telse\r\n\t\t\t\t\tgoodPlace = board.placeShip(randomX, randomY, s, 2);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@POST(\"/UpdateShip\")\n\tShip updateShip(@Body Ship ship,@Body int id) throws GameNotFoundException;", "public void setSize(int size) {\n\tthis.sizeNumber = sizeNumber;\r\n}", "public GameObject spawnBigBeamer(LogicEngine in_logicEngine) {\n\t\tGameObject ship = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/bigbeamer.png\",((float)LogicEngine.SCREEN_WIDTH/2),LogicEngine.SCREEN_HEIGHT+64,0);\r\n\t\tship.i_animationFrameSizeHeight = 115;\r\n\t\tship.i_animationFrameSizeWidth = 115;\r\n\t\t\r\n\t\t\r\n\t\tship.stepHandlers.add(new FlyStraightStep(new Vector2d(0,-1f)));\r\n\t\t\r\n\t\r\n\t\tship.v.setMaxForce(2.5f);\r\n\t\tship.v.setMaxVel(2.5f);\r\n\t\tship.allegiance = GameObject.ALLEGIANCES.ENEMIES;\r\n\t\t\r\n\t\tint i_shootEvery = 80;\r\n\t\t\r\n\t\tBeamShot b = new BeamShot(i_shootEvery);\r\n\t\t\r\n\t\tb.b_flare=false;\r\n\t\tb.f_offsetX=-40;\r\n\t\tb.f_offsetY=-30;\r\n\t\tb.i_delay = 40;\r\n\t\tb.i_beamWidth = 15;\r\n\t\t\r\n\t\tBeamShot b2 = new BeamShot(i_shootEvery);\r\n\t\tb2.b_flare=false;\r\n\t\tb2.f_offsetX=40;\r\n\t\tb2.f_offsetY=-30;\r\n\t\tb2.i_delay = 40+(i_shootEvery/2);\r\n\t\tb2.i_beamWidth = 15;\r\n\t\tb.nextBeam = b2;\r\n\t\t\r\n\t\tship.shootEverySteps=1;\r\n\t\tship.shotHandler = b;\r\n\t\t\r\n\t\tHitpointShipCollision c = new HitpointShipCollision(ship, 100, 50f);\r\n\t\t\r\n\t\tif(!Difficulty.isHard())\r\n\t\t\tc.f_numberOfHitpoints = 200;\r\n\t\tif(!Difficulty.isMedium())\r\n\t\t\tc.f_numberOfHitpoints = 160;\r\n\t\t\r\n\t\tc.setExplosion(Utils.getBossExplosion(ship));\r\n\t\tship.collisionHandler = c;\r\n\t\t\r\n\t\tin_logicEngine.objectsEnemies.add(ship);\r\n\t\t\r\n\t\treturn ship;\r\n\t}", "public boolean createNewArea(Location location, Player owner, String name, int size) {\n JsonObject areaJSON = new JsonObject();\n areaJSON.addProperty(\"size\", size);\n areaJSON.addProperty(\"owner\", owner.getUniqueId().toString());\n areaJSON.addProperty(\"name\", name);\n areaJSON.addProperty(\"x\", location.getX());\n areaJSON.addProperty(\"z\", location.getZ());\n areaJSON.addProperty(\"uuid\", UUID.randomUUID().toString());\n REDIS.lpush(\"areas\", areaJSON.toString());\n // TODO: Check if redis actually appended the area to list and return the success of the operation\n return true;\n }", "public void setSize(int size){\n this.size = size;\n }", "private void placeAllShips()\n {\n \t\n \t//place 2 aircrafts\n \tfor(int n = 0; n < 2; n++){\n \trandomRow = rnd.nextInt(10); //get random integer from 0-9\n \trandomCol = rnd.nextInt(10);//get random integer from 0-9\n \trandomDir = rnd.nextInt(2);//get random integer from 0-1\n \twhile(!checkOverlap(randomRow,randomCol,AIRCRAFT_CARRIER_LENGTH)){ //check if random integers overlap existing ones\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \t//place aircraft if no overlap\n \tfor(int i = randomRow; i <randomRow + AIRCRAFT_CARRIER_LENGTH ; i++){\n \t\tfor(int j = randomCol; j < randomCol + AIRCRAFT_CARRIER_LENGTH; ++j){\n \t\t\tif(randomDir == DIRECTION_RIGHT)\n \t\t\t\tgrid[i][randomCol] = SHIP;\n \t\t\tif(randomDir == DIRECTION_DOWN)\n \t\t\t\tgrid[randomRow][j] = SHIP;\n \t\t\t}\n \t\t}\n \t}\n \t\n \t\n \t//place battleship\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,BATTLESHIP_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i <randomRow + BATTLESHIP_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + BATTLESHIP_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\t\n \t//place destroyer\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,DESTROYER_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + DESTROYER_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + DESTROYER_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\t\n \t//place submarine\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,SUBMARINE_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + SUBMARINE_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + SUBMARINE_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\n \t//place patrol\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,PATROL_BOAT_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + PATROL_BOAT_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + PATROL_BOAT_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\n }", "public Ship(String shipID, int health, boolean shipHit, int hitCount,\r\n boolean isAShip) {\r\n this.shipID = shipID;\r\n this.health = health;\r\n this.hitCount = hitCount;\r\n this.shipVertical = false;\r\n this.isAShip = isAShip;\r\n }", "public void setShip_address(Integer ship_address) {\n this.ship_address = ship_address;\n }", "public boolean setSize(Size size, boolean force) {\n// if (!force) {\n// Entity intersectsWith = location.getWorld().intersects(this, Util.getRectangle(getLocation(), size));\n//\n// if (intersectsWith != null) {\n// boolean left = intersectsWith.getLocation().getX() + intersectsWith.getSize().getWidth() <= getLocation().getX();\n// boolean right = intersectsWith.getLocation().getX() <= getLocation().getX() + size.getWidth();\n// boolean top = intersectsWith.getLocation().getY() <= getLocation().getY() + size.getHeight() && intersectsWith.getLocation().getY() > getLocation().getY();\n//\n//// if (top && !left && !right)\n//// return false;\n//\n// Location moveTo = null;\n//\n// if (left)\n// moveTo = new Location(getWorld(), intersectsWith.getLocation().getX() + intersectsWith.getSize().getWidth() + size.getWidth(), getLocation().getY());\n// if (right)\n// moveTo = new Location(getWorld(), intersectsWith.getLocation().getX() - size.getWidth() - 1, getLocation().getY());\n// if (top) {\n// this.size.setHeight(intersectsWith.getLocation().getY() - this.location.getY());\n// System.out.println(this.size.getHeight());\n//// return false;\n// }\n//\n// if (moveTo != null) {\n// Entity intersects = location.getWorld().intersects(this, Util.getRectangle(moveTo, size));\n//\n// if (intersects == null && this.location.asVector().distance(moveTo.asVector()) < 15)\n// this.location = moveTo;\n// else return false;\n// }\n// }\n// }\n\n if (interactingWithX != null || interactingWithY != null) {\n boolean left = interactingWithX != null && interactingWithX.getLocation().getX() + interactingWithX.size.width <= getLocation().getX();\n boolean right = interactingWithX != null && interactingWithX.getLocation().getX() <= getLocation().getX() + size.width;\n boolean top = interactingWithY != null && (interactingWithY.getLocation().getY() <= getLocation().getY() + size.height && interactingWithY.getLocation().getY() > getLocation().getY());\n\n// if (top && !left && !right)\n// return false;\n\n Location moveTo = null;\n\n if (left)\n moveTo = new Location(getWorld(), interactingWithX.getLocation().getX() + interactingWithX.size.width + size.width, getLocation().getY());\n if (right)\n moveTo = new Location(getWorld(), interactingWithX.getLocation().getX() - size.width - 1, getLocation().getY());\n if (top) {\n this.size.height = interactingWithY.getLocation().getY() - this.location.getY();\n System.out.println(this.size.height);\n// return false;\n }\n\n if (moveTo != null) {\n Entity intersects = location.getWorld().intersects(this, Util.getRectangle(moveTo, size));\n\n if (intersects == null && this.location.asVector().distance(moveTo.asVector()) < 15)\n this.location = moveTo;\n else return false;\n }\n }\n\n this.size = size;\n return true;\n }", "public Ship(String name) {\r\n this.name = name;\r\n }", "private void addToBag1(GridSquare.Type id, GridSquare.Type N, GridSquare.Type E, GridSquare.Type S, GridSquare.Type W) {\r\n\t\tbag1.add(new PieceTile(new GridSquare(id), new GridSquare[] {\r\n\t\t\t\tnew GridSquare(N),\r\n\t\t\t\tnew GridSquare(E),\r\n\t\t\t\tnew GridSquare(S),\r\n\t\t\t\tnew GridSquare(W)\r\n\t\t}));\r\n\t}", "public void placeShip(Coordinate selected, int orientation) {\r\n HashSet<Coordinate> location = new HashSet<>();\r\n if (orientation == -1) { //user Xed the orientation window\r\n location.add(selected);\r\n data.orientationXedFlag = true;\r\n } \r\n else { //user didnt X the orientation window\r\n Boolean spaceIsFree = false;\r\n if (data.gameState == 1) {\r\n location = game.getPlayerOne().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerOne().checkLegalPlacement(location, orientation);\r\n }\r\n else if (data.gameState == 2) {\r\n location = game.getPlayerTwo().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerTwo().checkLegalPlacement(location, orientation);\r\n }\r\n\r\n if (spaceIsFree) {\r\n if (data.gameState == 1)\r\n game.getPlayerOne().placeShip(location, data.shipToPlace);\r\n else if (data.gameState == 2)\r\n game.getPlayerTwo().placeShip(location, data.shipToPlace);\r\n data.placementSuccessful = true;\r\n data.shipToPlace++;\r\n }\r\n else {\r\n data.placementSuccessful = false; \r\n location.clear();\r\n location.add(selected);\r\n } \r\n }\r\n data.placement = convertPlacementData(location);\r\n setChanged();\r\n notifyObservers(data);\r\n data.orientationXedFlag = false;\r\n data.placementSuccessful = false; //reset flags to false to avoid errornous updates \r\n }", "private void placeAsteroids() {\r\n\t\taddParticipant(new Asteroid(0, 2, EDGE_OFFSET, EDGE_OFFSET, speed, this));\r\n\t\taddParticipant(new Asteroid(1, 2, SIZE - EDGE_OFFSET, EDGE_OFFSET, 3, this));\r\n\t\taddParticipant(new Asteroid(2, 2, EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this));\r\n\t\taddParticipant(new Asteroid(3, 2, SIZE - EDGE_OFFSET, SIZE - EDGE_OFFSET, 3, this));\r\n\t}", "public boolean setShip(int x0, int y0, int x1, int y1, int id, int length) {\r\n\t\tif (!fitShip(x0, y0, x1, y1) || ships.containsKey(id) || id == -1)\r\n\t\t\treturn false;\r\n\t\tShip ship = new Ship(length, id, this, getFieldsFromCoordinates(x0, y0, x1, y1));\r\n\t\tships.put(id, ship);\r\n\t\t++remainingShips;\r\n\t\treturn true;\r\n\t\t\r\n\t}", "public void addPlayerShip()\n\t{\n\t\t//if a PlayerShip is already spawned, a new one will not be added\n\t\tif (gameObj[1].size() == 0)\n\t\t{\n\t\t\tgameObj[1].add(new PlayerShip());\n\t\t\tSystem.out.println(\"PlayerShip added\");\n\t\t}else{\n\t\t\tSystem.out.println(\"A player ship is already spawned\");\n\t\t}\n\t\t\n\t}", "private void set_size(int size)\r\n\t{\r\n\t\tthis.size = size;\r\n\t}", "public void spawn(Integer spawnSize) {\n for (Integer i = 0; i < spawnSize; i++) {\n Enemy enemy = new Enemy(mainPlayerPosX, mainPlayerPosY);\n enemies.put(i, enemy);\n }\n initEnemiesSpawned = spawnSize;\n enemiesSize = spawnSize;\n }", "public void setShipType(Point xy, int value) {\r\n\t\tshipTypeMap.put(xy, value);\r\n\t}", "private static String getImagePath(int size) {\n return \"images/umbrella\" + size + \".png\";\n }", "public void changeSquareSize(){\r\n for(Square i : sqList){\r\n i.setSize(48);\r\n } \r\n }", "boolean testPlaceAllShips(Tester t) {\n return t.checkExpect(this.los3.placeAll(this.em),\n em.placeImageXY(ship1.draw(), 0, 150).placeImageXY(ship2.draw(), 50, 50)\n .placeImageXY(ship3.draw(), 50, 50))\n && t.checkExpect(this.mt.placeAll(this.em), this.em);\n }", "@Test\n public final void testValidGetSize() {\n int expRes = 5;\n int result = ship.getSize();\n assertEquals(expRes, result);\n expRes = 19;\n ship.setSize(expRes);\n result = ship.getSize();\n assertEquals(expRes, result);\n }", "private void cp2PlaceShips(){\n\t\tint start = 5, stop = 9, orientation;\n\t\tboolean placed;\n\n\t\tfor(int x = start; x <= stop; x++){\n\t\t\tplaced = false;\n\n\t\t\twhile(!placed)\n\t\t\t{\n\t\t\t\tranX = ranNum.nextInt(600);\n\t\t\t\tranY = ranNum.nextInt(600);\n\t\t\t\torientation = ranNum.nextInt(2);\n\t\t\t\tplaced = true;\n\n\t\t\t\tships[x] = new Ship(x, shipNames[x], 'H', shipPlayer[x], shipWidth[x], shipHeight[x], ranX, ranY, shipSize[x]);\n\t\t\t\tships[x].setLocation(ships[x].getX(), ships[x].getY());\n\t\t\t\tships[x].setSize(ships[x].getWidth(), ships[x].getHeight());\n\n\t\t\t\tif(orientation == 1){\n\t\t\t\t\tchangeOrientation(x);\n\t\t\t\t}\n\n\t\t\t\tif(ships[x].getX() + ships[x].getWidth() < boardTwo.getWidth() && ships[x].getY() + ships[x].getHeight() < boardTwo.getHeight()){\n\t\t\t\t\tfor(int y = start; y < x; y++){\n\t\t\t\t\t\tif(ships[x].getBounds().intersects(ships[y].getBounds())){\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tplaced = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboardTwo.add(ships[x]);\n\t\t}\n\t}", "void createNewContinent(Point2D location, Dimension2D size);", "private void spawnStuff(PlayScreen screen, float delta) {\n if (stageId!=3 && stageId!=5) {\n isCombatEnabled = true;\n int where;\n boolean spawnRight = true;\n float speed;\n\n\n //Alien Spawn\n if (System.currentTimeMillis() - lastASpawn >= SpawnATimer + extraTimer) {\n speed = (float)(Utils.doRandom(250,400));\n lastASpawn = System.currentTimeMillis();\n int count = 3;\n if (stageId==4) count = 1;\n for (int i = 0; i < count; i++) {\n if (stageId==4){\n speed = (float) (speed*0.75);\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - Alien.width, y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player));\n }else{\n int x = 0 - Alien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + Alien.width*2 , y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player,false));\n }\n }\n }\n //AcidAlien Spawn\n if (System.currentTimeMillis() - lastBSpawn >= SpawnBTimer + extraTimer) {\n speed = 200;\n lastBSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - AcidAlien.width, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player));\n }else{\n int x = 0 - AcidAlien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + AcidAlien.width*2, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player,false));\n }\n }\n //FastAlien Spawn\n if (System.currentTimeMillis() - lastCSpawn >= SpawnCTimer + extraTimer) {\n speed= Utils.doRandom(250,400);\n lastCSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - FastAlien.width, y, FastAlien.width, FastAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images,speed, screen.player));\n }else{\n int x = 0 - FastAlien.width;\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x-FastAlien.width*2,y,FastAlien.width,FastAlien.height))) hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images, speed,screen.player,false));\n }\n\n }\n\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n }else{\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width*2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages,false));\n }\n }\n /*if (System.currentTimeMillis() - lastBombSpawn >= SpawnTimerBomb) {\n lastBombSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - PurpleCapsuleItem.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x,y,PurpleCapsuleItem.width,PurpleCapsuleItem.height))) hits = true;\n }\n }\n screen.items.add(new PurpleCapsuleItem(x, y, 500, screen.itemPurpleImages));\n }*/\n }else{\n if (stageId==3) {\n //SPACE STAGE\n ///SPAWN ENEMY SHIP:\n //TODO\n if (PlayScreen.entities.size() == 1) {\n isCombatEnabled = false;\n //no enemy spawned, so spawn:\n if (spawnIterator >= killCount) {\n //TODO END STAGE\n } else {\n System.out.println(\"SPAWNS SHIP\");\n spawnIterator++;\n screen.entities.add(new EnemyShipOne(new Vector2(0, 0), 100, screen.enemyShipOne, true, screen.player));\n\n }\n }\n //Items:\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule) {\n lastCapsuleSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new BlackBulletItem(x, y, 1000, screen.itemBlackImages));\n\n\n }\n }else{\n if (stageId == 5){\n isCombatEnabled = true;\n float speed;\n boolean spawnRight=true;\n int where=0;\n //TODO FINAL STAGE\n if (!isBossSpawned){\n //TODO\n screen.entities.add(new Boss(new Vector2(PlayScreen.gameViewport.getWorldWidth(),PlayScreen.gameViewport.getWorldHeight()/2 - Boss.height/2),screen.player));\n isBossSpawned=true;\n }\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId == 4) {\n speed = speed / 2;\n where = Utils.doRandom(0, 1);\n if (where < 50) {\n spawnRight = true;\n } else {\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n } else {\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width * 2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages, false));\n }\n }\n //TODO\n }\n }\n }\n\n //run .update(delta) on all objects\n for (int i=0; i<screen.entities.size();i++){\n screen.entities.get(i).update(delta);\n }\n\n for (int i=0; i<screen.items.size();i++){\n screen.items.get(i).update(delta);\n }\n\n //labels set:\n screen.labelHealth.setText(\"Health: \" + screen.player.health + \"/\" + screen.player.maxHealth);\n if (scoreBased) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + scoreGoal);\n }else{\n if (killCount>0){\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + killCount);\n }else{\n if (boss){\n screen.labelInfo.setText(\"Boss: \"+screen.player.score + \"/\" + Boss.bossHealth);\n }else{\n screen.labelInfo.setText(\"\");\n }\n\n }\n }\n if (this.stageId == 999) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score);\n }\n\n\n }" ]
[ "0.7226411", "0.68593556", "0.6719116", "0.65787953", "0.59911627", "0.5966954", "0.59110403", "0.5903163", "0.5874737", "0.58517045", "0.58490723", "0.58168304", "0.5783793", "0.57791656", "0.57575047", "0.5750742", "0.5705062", "0.5558288", "0.55188704", "0.54912305", "0.5482964", "0.5455278", "0.5444081", "0.54295444", "0.54112774", "0.540158", "0.53914195", "0.53877866", "0.5386724", "0.5364219", "0.5330736", "0.53301764", "0.5314858", "0.5313529", "0.53101474", "0.5288681", "0.5250756", "0.52297133", "0.5221462", "0.5214692", "0.51970375", "0.51806056", "0.51702327", "0.5160573", "0.51587385", "0.5152857", "0.51498896", "0.5140677", "0.51398855", "0.513709", "0.5129057", "0.51286703", "0.51241827", "0.5123974", "0.5110347", "0.5108553", "0.51012355", "0.5083714", "0.5083059", "0.50780773", "0.50731087", "0.5062506", "0.5055124", "0.5048617", "0.50391746", "0.50141263", "0.5010853", "0.5003769", "0.49983606", "0.4992124", "0.49916896", "0.49878812", "0.4982995", "0.49746147", "0.49741012", "0.49705797", "0.49534038", "0.49481586", "0.49460834", "0.493822", "0.49338478", "0.49334598", "0.4931523", "0.49293336", "0.4927231", "0.49251574", "0.49168977", "0.49097592", "0.49080384", "0.49005225", "0.48983237", "0.48965263", "0.4896448", "0.48912206", "0.48911327", "0.48910534", "0.48797986", "0.48796967", "0.48746252", "0.48739085" ]
0.5666389
17
Schedules a transition m msecs in the future
private void scheduleTransition(int m) { transitionTime = System.currentTimeMillis() + m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void schedule(Runnable job, long delay, TimeUnit unit);", "public void update(int m) {\r\n\t\tif (this.swit) {\r\n\t\t\tthis.time = time + m;\r\n\t\t\tthis.change = change + m;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.time = time + m; \r\n\t\t}\r\n\t}", "private static void attendre (int tms) {\n try {Thread.currentThread().sleep(tms);} \r\n catch(InterruptedException e){ }\r\n }", "private static void attendre (int tms) {\n try {Thread.currentThread().sleep(tms);} \r\n catch(InterruptedException e){ }\r\n }", "public <T> ValueFuture<T> schedule(Callable<T> job, long delay, TimeUnit unit);", "@Override\n\tpublic void act(float dt){\n\t\t\n\t}", "private synchronized void processWithStateMachine(Message m) {\n dispatchMessageLocked(m);\n\n // Perform transitions\n if (next != null) {\n while (current != next) {\n performTransitionLocked();\n }\n next = null;\n\n // Put deferred messages at the front of queue to ensure they will be replayed before the others.\n while (deferredMessages.size() > 0) {\n sendMessageAtFrontOfQueue(deferredMessages.pop());\n }\n }\n }", "public void scheduleNow(Runnable r) {\n ctx.requireStarted();\n ctx.getRunLoop().scheduleNow(r);\n }", "public void moveDelay ( )\r\n\t{\r\n\t\ttry {\r\n\t\t\tThread.sleep( 1000 );\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void schedule() {\n cancel();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n runnable.run();\n }\n }, delay);\n }", "private void sleepByScheduleTime() throws InterruptedException\n\t{\n\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\tcalendar.setTime(new java.util.Date(System.currentTimeMillis()));\n\t\tint currHour = calendar.get(calendar.HOUR_OF_DAY);\n\t\tif ((24 - currHour) * 60 < 2 * FtpData.SCHEDULE_TIME)\n\t\t{\n\t\t\tsleep((FtpData.SCHEDULE_TIME + 1) * 60000); // 00h:01\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsleep(FtpData.SCHEDULE_TIME * 60000); // n * minutes;\n\t\t}\n\t}", "public static void forMS(Promise<Void> future, long ms) {\r\n Delay.future(future, ms);\r\n }", "public abstract void schedule();", "private void emulateDelay() {\n try {\n Thread.sleep(700);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void setDelay(double clock);", "@Override\n protected void swimAction(long timer){}", "public void schedule(String name, long initialDelay, long period, TimeUnit tunit) {\n\t\tschedule(name, period, period, tunit, opLevel);\n\t}", "public abstract int delay();", "public void warte( int ms )\n {\n try\n {\n Thread.sleep( ms );\n }\n catch ( InterruptedException e )\n {\n e.printStackTrace();\n }\n }", "public void schedule(int color, int delay) {\n defAction.color = color;\n defAction.delay = delay;\n }", "void schedule(long delay, TimeUnit unit) {\r\n\t\tthis.delay = delay;\r\n\t\tthis.unit = unit;\r\n\t\tif (monitor != null) {\r\n\t\t\tmonitor.cancel(false);\r\n\t\t\tmonitor = pool.scheduleWithFixedDelay(sync, delay, delay, unit);\r\n\t\t}\r\n\t}", "public synchronized void scheduleTick(long deltat){\n\t\tscheduler.schedule(tickTask, deltat, TimeUnit.MILLISECONDS);\n\t}", "public void setDelayedTimeout(int seconds);", "@Scheduled(fixedDelay = 3000)\n\tpublic void scheduleTaskWithFixedDelay() {\n\t\tlog.info(\"Fixed Delay Task :: Execution Time - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t\t//Sleep TimeUnit\n//\t\ttry {\n//\t\t\tTimeUnit.SECONDS.sleep(5);\n//\t\t} catch (Exception e) {\n//\t\t\tlog.error(\"Ran into an error {}\", e);\n//\t throw new IllegalStateException(e);\n//\t\t}\n\t}", "void delayForDesiredFPS(){\n delayMs=(int)Math.round(desiredPeriodMs-(float)getLastDtNs()/1000000);\n if(delayMs<0) delayMs=1;\n try {Thread.currentThread().sleep(delayMs);} catch (java.lang.InterruptedException e) {}\n }", "public ScheduleGenerator(int[] tasks, int m) \n\t{\n\t\tif (!Schedule.areValid(tasks, m))\n\t\t{\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tthis.tasks = tasks;\n\t\tthis.m = m;\n\t}", "public void delayNext()\n {\n\tif (toDo.size() > 1)\n\t {\n\t\tTask t = toDo.get(0);\n\t\ttoDo.set(0, toDo.get(1));\n\t\ttoDo.set(1, t);\n\t }\n }", "public void schedule() {\n\t\tnew Timer().schedule(getTask(), TIME);\n\t}", "public final void sleepBetweenActions()\n {\n long numOfMillis = Long\n .parseLong(getProperty(\"wait.between.user.actions.in.millis\"));\n if (numOfMillis > 10000)\n {\n numOfMillis = 10000;\n } else if (numOfMillis < 0)\n {\n numOfMillis = 0;\n }\n try\n {\n Thread.sleep(numOfMillis);\n } catch (InterruptedException e)\n {\n e.printStackTrace();\n }\n }", "private static void timerTest4() {\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 14);\n\t\tcalendar.set(Calendar.MINUTE, 20);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tDate time = calendar.getTime();\n\n\t\tTimer timer = new Timer();\n\t\tSystem.out.println(\"wait ....\");\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tSystem.out.println(\"timertest4\");\n\n\t\t\t}\n\t\t}, time, 24 * 60 * 60 * 1000);\n\n\t}", "private void sleepFor(long t) {\n\t\ttry {\n\t\t\tThread.sleep(t);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void setTimeout() {\r\n\t\tTimeout timeout = new Timeout();\r\n\t\tt.schedule(timeout, TIMEOUT);\r\n\t}", "public void schedule(String name, long period, TimeUnit tunit) {\n\t\tschedule(name, period, period, TimeUnit.MILLISECONDS);\n\t}", "public static void delay(int ms){\r\n\t\t\r\n\t\ttry {\r\n\t\t\tThread.sleep(ms);\r\n\t\t} catch (InterruptedException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\n @DisplayName(\"Scheduled Future\")\n void testScheduledFuture() throws InterruptedException {\n ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);\n ScheduledFuture<String> future = executor.schedule(this::getThreadName, 3, TimeUnit.SECONDS);\n\n TimeUnit.MILLISECONDS.sleep(1337);\n long remainingTime = future.getDelay(TimeUnit.MILLISECONDS);\n\n assertThat(remainingTime).isBetween(1650L, 1670L);\n }", "private void schedule() {\n service.scheduleDelayed(task, schedulingInterval);\n isScheduled = true;\n }", "public final void mo61177g() {\n C6726a.m20843a(new Runnable() {\n public final void run() {\n C33086b.this.mo84807a(true);\n }\n }, VETransitionFilterParam.TransitionDuration_DEFAULT);\n }", "public void actionPerformed(ActionEvent e) {\n PerformTimerTask();\n }", "private void beginSchedule(){\n\t\tDivaApp.getInstance().submitScheduledTask(new RandomUpdater(this), RandomUpdater.DELAY, RandomUpdater.PERIOD);\n\t}", "public final void scheduleNext(long j) {\n Observable d = this.configurationProvider.getServiceConfiguration(serviceTransaction$default(this, false, 1, null), DefaultStreamSampler$scheduleNext$1.INSTANCE).mo30225d((Function<? super T, ? extends ObservableSource<? extends R>>) new DefaultStreamSampler$scheduleNext$2<Object,Object>(this, j));\n Intrinsics.checkReturnedValueIsNotNull((Object) d, \"configurationProvider.ge…ECONDS)\\n }\");\n Disposable a = C11922d.m38477a(d, null, null, new DefaultStreamSampler$scheduleNext$3(this), 3, null);\n C11917a.m38473a(a, compositeDisposable());\n this.timer = a;\n }", "public void m5302a(int i) {\n try {\n Thread.sleep((long) i);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@WithName(\"schedule.delay\")\n @WithDefault(\"5s\")\n Duration scheduleDelay();", "@Override\n public void run() {\n schedule();\n }", "protected abstract void scheduleSuspicions();", "public Integer threadDelay();", "private void delay() {\n\ttry {\n\t\tThread.sleep(500);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\t\n\t}", "private void sleep(long ms) throws InterruptedException {\n Thread.sleep(ms);\n }", "abstract public boolean timedActionPerformed(ActionEvent e);", "private static void addDelay() {\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ignored) {\n }\n }", "public void next( long time );", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tlong diff = ConstantUtil.setThreadStartTimer(\"01\",\"30\",null);\n\t\t\t\n\t\t\tif(diff<0){//凌晨1点30分之前则等待\n\t\t\t\tThread.sleep(0-diff);\n\t\t\t\tupdateMonthKline();\n\t\t\t}else{//凌晨1点30分后则立即启动\n\t\t\t\tupdateMonthKline();\n\t\t\t}\n\t\t\n\t\t\twhile (true){\n\t\t\t\tlong diff11 = ConstantUtil.setThreadStartTimer(\"01\",\"30\",null);\n\t\t\t\tThread.sleep(1000l*60*60*24-diff11);\n\t\t\t\tupdateMonthKline();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public abstract void userActionStarts(long ms);", "@Override\n\tpublic void move() {\n\t\ttry {\n\t\t\tTimeUnit.SECONDS.sleep(new Random().nextInt(5));\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"Tank moving...\");\n\t}", "private static void delay() throws InterruptedException {\n\t\tTimeUnit.MILLISECONDS.sleep((long) (minDelay + (long)(Math.random() * ((maxDelay - minDelay) + 1))));\n\t}", "public void moveForward() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t // 2\n\t\tseconds += tic;\n\t\tif (seconds >= 60.0) {\n\t\t\tseconds -= 60.0;\n\t\t\tminutes++;\n\t\t\tif (minutes == 60) {\n\t\t\t\tminutes = 0;\n\t\t\t\thours++;\n\t\t\t}\n\t\t}\n\t}", "public void schedule(String name, long initialDelay, long period, TimeUnit tunit, OpLevel severity) {\n\t\tif (future == null || future.isCancelled()) {\n\t\t\tactivityTask = newActivityTask(logger, name, severity);\n\t\t\tfuture = scheduler.scheduleAtFixedRate(activityTask, initialDelay, period, tunit);\n\t\t} else {\n\t\t\tthrow new IllegalStateException(\"Already scheduled\");\n\t\t}\n\t}", "private static void sleep(int n) {\n try {\n TimeUnit.MILLISECONDS.sleep(n);\n } catch (InterruptedException e) {\n System.out.print(\"\\ndelay failed\");\n }\n }", "ScheduledFuture<?> scheduleTask(long delay, Runnable runnable) {\n return timeoutTaskExecutor.schedule(runnable, delay, TimeUnit.MILLISECONDS);\n }", "public abstract void animation(double seconds);", "@Override\n\t\tprotected void doTransition() {\n\t\t\t\n\t\t}", "public static void randomDelay() {\n\n Random random = new Random();\n int delay = 500 + random.nextInt(2000);\n try {\n sleep(delay);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@Override\n\t\t\tpublic void update(Observable arg0, Object arg1) {\n\t\t\t\tGioco g =(Gioco)arg0;\n\t\t\t\tTimer t= new Timer();\n\t\t\t\tt.schedule(new NextTurn(g.getPlayerTurnNumber()-1, g.getNumturni()), 120000);\n\t\t\t}", "private void changeDelay() {\n delay = ((int) (Math.random() * 10000) + 1000) / MAX_FRAMES;\n }", "public static void sleep(long milis) {\n\t\ttry {\n\t\t\tThread.sleep(milis);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void action(String action) {\n\n\t\tSystem.out.println(name + \" is \" + action);\n\n\t\ttry {\n\t\t\tThread.sleep(((long)(Math.random() * 150)));\n\t\t} catch (InterruptedException e) {\n\t\t\tThread.currentThread().interrupt();\n\t\t}\n\t}", "public static void wait(int miliseconds){\n\t\ttry {\n\t\t\tThread.sleep(miliseconds);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void walk() throws MyException{\n try{\n Thread.sleep((long)(1+300*Math.random()));\n }catch(InterruptedException e){\n throw new MyException(\"Error: Not walking.\");\n }\n }", "public void setTimeout(int timeout);", "private void rerunAnimation() {\n transition.playFromStart();\r\n}", "Transition createTransition();", "Transition createTransition();", "long getInitialDelayInSeconds();", "public int getDelayedTimeout();", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tTimeUnit.SECONDS.sleep(3);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}", "public void transitionToTimer(boolean isShow) {\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttimer_tick(e);\r\n\t\t\t}", "private void forestIncomeTimerStart(){\n forestIncomeTimer.schedule(new TimerTask() {\n\n @Override\n public void run() {\n\n\n forestModel.setWood(forestModel.getWood()\n .add(forestModel.getElfIncome())\n .add(forestModel.getLumberjackIncome())\n .add(forestModel.getWoodcutterIncome()));\n setWoodLabel();\n setWoodIncomeLabel();\n\n\n\n\n\n }\n\n }, 1, 1000);\n }", "public abstract void systemActionStarts(long ms);", "public void startTransition(Transition transition,Runnable runnable,float duration) {\n\t\tpendingAnimations.add(new Animation(transition, runnable, duration));\n\t\tanimationTimer.start();\n\t}", "@Override\n\tpublic void sleep() {\n\t\t\n\t}", "void threadDelay() {\n saveState();\n if (pauseSimulator) {\n halt();\n }\n try {\n Thread.sleep(Algorithm_Simulator.timeGap);\n\n } catch (InterruptedException ex) {\n Logger.getLogger(RunBFS.class.getName()).log(Level.SEVERE, null, ex);\n }\n if (pauseSimulator) {\n halt();\n }\n }", "private void schedulerSleep() {\n\n\t\ttry {\n\n\t\t\tThread.sleep(timeSlice);\n\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t\t;\n\n\t}", "public void setDelay(int delay) {\n\t\t if (delay != this.delay) logger.info(\"New delay is: \"+getElapsedTimeHoursMinutesSecondsString(delay)); \n\t\t if (delay < this.delay) {\n\t\t\t scheduledFuture.cancel(true);\n\t\t\t reset(delay); \n\t\t }\n\t\t this.delay = delay;\n\t }", "public\tvoid spendTime(int t) {\n\t\tthis.currentAction.spendTime(t);\n\t}", "public static void m2703A() {\n Thread.sleep(100);\n }", "@Override\n public void setSleepTime(int st) {\n this.sleepTime = st;\n\n // notify the update thread so that it can recalculate\n if (updateThread.isRunning())\n updateThread.interrupt();\n }", "private void simulateDelay(long millis) {\n try {\n Thread.sleep(millis);\n } catch (InterruptedException ignored) {\n }\n }", "void executeAsync(long delayMs, Runnable task);", "@Override\n public void timePassed() {\n moveOneStep();\n }", "@Override\n\tpublic void sleeps() {\n\t\t\n\t}", "public abstract void systemTurnStarts(long ms);", "public void startAgentTime() {\n Timer timer = new Timer(SIBAConst.TIME_AGENT_CHANGE_FOR_HOUR, new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n \t\n \tCalendar c = Calendar.getInstance();\n int minutos = c.get(Calendar.MINUTE);\n int hora = c.get( (Calendar.HOUR_OF_DAY)); \n hora = hora * 60;\n if (minutos >= 30 && minutos <= 59)\n {hora +=30;\t\n }\n if (hora > ctrlHours)\n {ctrlHours = hora;\n //activada bandera de modificacion de programacion\n activatedScheduleChange = true;\n }\n else\n { if (hora < ctrlHours)\n \t ctrlHours = 0;\n }\n \t\n \t\n \n }\n });\n timer.start();\n }", "public void nextAction(){\n\t\tif (this.currentAction == this.onAction){\n\t\t\tthis.currentAction = this.offAction;\n\t\t\tthis.currentAction = this.currentAction.next();\n\t\t\tthis.lastOffDelay = this.currentAction.getCurrentLapsTime();\n\t\t}else{\n\t\t\tthis.currentAction = this.onAction;\n\t\t\tthis.currentAction = this.currentAction.next();\n\t\t\tthis.currentAction.spendTime(this.lastOffDelay);\n\t\t}\n\t}", "private synchronized void m16565c() {\n if (!(this.f14719b || this.f14723f.hasMessages(this.f14724g))) {\n this.f14723f.sendMessageDelayed(this.f14723f.obtainMessage(this.f14724g), 2000);\n }\n }", "void updateNextUnblockTime(int t);", "public void schedule(String name, long period) {\n\t\tschedule(name, period, period, TimeUnit.MILLISECONDS);\n\t}", "public void frameForward()\n{\n stop();\n setTime(getTime() + getInterval());\n}", "private void delay() {\n\t\tDelay.msDelay(1000);\n\t}", "public void actionPerformed(ActionEvent e) {\r\n fen.setDelayAffiche();\r\n Princip.setTempsPrec();\r\n temps = temps + getdelay();\r\n boucle_principale();\r\n //testTimer();\r\n\r\n afficheTemps();\r\n }", "@ScheduledMethod(shuffle=false) // Prevent call order shuffling\r\n\tpublic void reschedule()\r\n\t{\r\n\t\t// Reschedule step calls for the object according to the updated parameters\r\n\t\tISchedule schedule = RunEnvironment.getInstance().getCurrentSchedule();\r\n\t double next_tick = stepSchedule.getNextTime();\r\n\t double current_tick = schedule.getTickCount();\r\n\t\t\r\n\t\tif (!schedule.removeAction(stepSchedule))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Couldn't remove the action from the queue. Scheduling another reschedule.\");\r\n\t\t\tScheduleParameters sch_params = ScheduleParameters.createOneTime(current_tick + 0.000001);\r\n\t\t schedule.schedule(sch_params, this, \"reschedule\");\r\n\t\t return;\r\n\t\t}\r\n\t\t\r\n\t ScheduleParameters sch_params = ScheduleParameters.createRepeating(next_tick + 0.000001, Math.round(1 / velocity.speed));\r\n\t stepSchedule = schedule.schedule(sch_params, this, \"step\");\r\n\t}" ]
[ "0.6220094", "0.5881163", "0.56538475", "0.56538475", "0.5640117", "0.5628834", "0.5472976", "0.54724395", "0.5469588", "0.546724", "0.5451718", "0.5447336", "0.5433267", "0.5432565", "0.5424886", "0.53892165", "0.5346839", "0.53411484", "0.53344876", "0.53114784", "0.5264484", "0.5253746", "0.52435803", "0.5240863", "0.5187001", "0.51789635", "0.51654786", "0.5139552", "0.5113079", "0.5110512", "0.50973254", "0.5093554", "0.50919837", "0.5087124", "0.50729436", "0.50726825", "0.50641644", "0.5056637", "0.5050192", "0.5049517", "0.50298333", "0.5022235", "0.5017981", "0.50123787", "0.5008017", "0.49933365", "0.49777552", "0.4974073", "0.49682122", "0.49632725", "0.49607974", "0.4957904", "0.49447614", "0.49360394", "0.49355906", "0.49338344", "0.49133566", "0.49121457", "0.4910416", "0.49019718", "0.49012697", "0.4892165", "0.4889414", "0.48880675", "0.48852512", "0.48850653", "0.48835132", "0.48741546", "0.48618808", "0.4861075", "0.4861075", "0.48597923", "0.48440903", "0.48400253", "0.4839388", "0.48319867", "0.48299217", "0.48273256", "0.48242113", "0.48235485", "0.4815674", "0.48104388", "0.4807636", "0.4807304", "0.48053944", "0.48052016", "0.47992733", "0.4794464", "0.47924766", "0.4782497", "0.47781703", "0.47766677", "0.47645184", "0.47604394", "0.47531295", "0.47505617", "0.47498354", "0.4745547", "0.4736666", "0.47356197" ]
0.854127
0
This method will be invoked because of button presses and timer events.
@Override public void actionPerformed(ActionEvent e) { // The start button has been pressed. Stop whatever we're doing // and bring up the initial screen if (e.getSource() instanceof JButton) { // Initialize the speed, numScore, and numLevel values at the beginning of a new // game speed = 3; numScore = 0; numLevel = 1; display.setLevel(numLevel); initialScreen(); // Update the highScore variable if (numScore > highScore) { highScore = numScore; } // Update the highScore Label in enhanced mode if (enhanced == true) { display.setHighScore(highScore); } } // Time to refresh the screen and deal with keyboard input else if (e.getSource() == refreshTimer) { if (turnLeft == 1 && ship != null) { ship.turnLeft(); } if (turnRight == 1 && ship != null) { ship.turnRight(); } if (accelerate == 1 && ship != null) { ship.accelerate(); flame = !flame; try { if (clipFire.isOpen()) { clipFire.start(); } if (!(clipFire.isActive())) { /* * clip.stop(); clip.flush(); */ clipFire.setFramePosition(0); } } catch (NullPointerException g) { } } } // Update lives in enhanced mode updateLives(); // It may be time to make a game transition performTransition(); // Move the participants to their new locations pstate.moveParticipants(); // Refresh screen display.refresh(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void ipcallButtonPressed() {\n\t\tdialButtonPressed(true) ;\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void on_button_pressed(String button_name) {\n\n\t}", "@Override\n\t\tpublic void buttonStatusChange() {\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttimer_tick(e);\r\n\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e)\n {\n \n }", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile((second--)!=1) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\tPlatform.runLater(new Runnable() {\r\n\t\t\t\t\t\t @Override\r\n\t\t\t\t\t\t public void run() {\r\n\t\t\t\t\t\t\t SetTime();\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t});\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsubmitbtn.setDisable(true);\r\n\t\t\tbackbtn.setDisable(false);\r\n\t\t\t}", "@Override\n\tpublic void CountDownFinish() {\n\t\tcheckButtonsEnable();\n\t}", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\r\n\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t}", "@Override\r\n \t\tpublic void actionPerformed(ActionEvent e) {\n \t\t}", "@Override\n protected void actionPerformed(GuiButton button)\n {\n super.actionPerformed(button);\n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tButtonPress();\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n handleAction();\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n\n }", "@Override //se repita\r\n public void actionPerformed(ActionEvent ae) {\r\n \r\n }", "@Override\n public void onClick(View v) {\n timeBuff += mSecTime;\n\n //removeCallbacks will remove the runnable that are in the message queue\n handler.removeCallbacks(runnable);\n\n //this will enable the reset button\n reset.setEnabled(true);\n }", "@Override\n public void run() {\n nextButtonAction(); // invoking next button //\n }", "protected abstract void pressedOKButton( );", "@Override\r\n public void actionPerformed( ActionEvent e )\r\n {\n }", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\n \r\n }", "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\n\t\t\t\t}", "public void run(){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(10L);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tupdateButtonBounds();\n\t\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t\t\tif (userBTN.getText().equals(\"START\")) {\n\t\t\t\t\t\tgameStart();\n\t\t\t\t\t\tnew OutThread().start();\n\t\t\t\t\t\tnewTableTimer();\n\t\t\t\t\t\tcontrolPanel.add(tableTimer.getStopWatchPanel(), BorderLayout.CENTER);\n\t\t\t\t\t\ttableTimer.getStopWatchPanel().setBackground(new Color(0, 104, 56));\n\t\t\t\t\t\ttableTimer.getChargeLabel().setForeground(Color.WHITE);\n\t\t\t\t\t\ttableTimer.getStopWatchLabel().setFont(new Font(\"NanumGothicBold\", Font.BOLD, 50));\n\t\t\t\t\t\ttableTimer.getChargeLabel().setFont(new Font(\"NanumGothicBold\", Font.BOLD, 30));\n\t\t\t\t\t\ttableTimer.getStopWatchLabel().setForeground(Color.WHITE);\n\t\t\t\t\t\ttableTimer.setDaemon(true);\n\t\t\t\t\t\tuserBTN.setText(\"END\");\n\t\t\t\t\t\ttableTimer.start();\n\t\t\t\t\t} else if (userBTN.getText().equals(\"END\")) {\n\t\t\t\t\t\tgameEnd();\n\t\t\t\t\t\tnew OutThread().start();\n\t\t\t\t\t\tuserBTN.setText(\"RESET\");\n\t\t\t\t\t\ttableTimer.setIsRun(false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgameReset();\n\t\t\t\t\t\tnew OutThread().start();\n\t\t\t\t\t\tuserBTN.setText(\"START\");\n\t\t\t\t\t\ttableTimer.getStopWatchLabel().setText(\"\");\n\t\t\t\t\t\ttableTimer.getChargeLabel().setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) \n\t\t{\n\t\t\t\n\t\t}", "@Override\r\n public void actionPerformed(ActionEvent e)\r\n {\n \r\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\r\n\t\t\t\tnewUpdate1(DeviceNum1);\r\n\r\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "public void click() {\n this.lastActive = System.nanoTime();\n }", "public void onButtonAPressed();", "void actionButton ( ) throws IOException {\n String textOfField = this.gui.wdgInputText.getText();\n this.gui.widgOutput.append(\"Button1 \" + (++this.ctKeyStroke1) + \" time, text=\" + textOfField + \"\\n\");\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tupdate();\n\t\t\t}", "void outOfTime() {\r\n\r\n disableOptionButtons();\r\n }", "@Override\n\tpublic void run() {\n\t\n\t\t\ttry {\n\t\t\t\trouseButton();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tthis.interrupt();\n\t\t\t}\n\t\n\t}", "public void actionPerformed(ActionEvent arg0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tborderSelected(dayNumber -1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//show the event items in the box on the right\n\t\t\t\t\t\t\twriteEvents(dayNumber);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchangeDateLabel(dayNumber);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//make these buttons available for use\n\t\t\t\t\t\t\tnextDay.setEnabled(true);\n\t\t\t\t\t\t\tprevDay.setEnabled(true);\n\t\t\t\t\t\t\tcreateButton.setEnabled(true);\n\t\t\t\t\t\t}", "public void button_time_ok(View view){\n int[] times = new int[4];\n times[0] = getTimeFromSpinner(R.id.spinner_termin1);\n times[1] = getTimeFromSpinner(R.id.spinner_termin2);\n times[2] = getTimeFromSpinner(R.id.spinner_termin3);\n times[3] = getTimeFromSpinner(R.id.spinner_termin4);\n // and update the user data\n _control.updateUserTimes(times);\n _control.saveUserData();\n // then change to main menu\n setContentView(R.layout.mainmenu);\n setButtonDisabled(R.id.goto_question_button, _control.wasLastQuestionAnswered());\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\r\n\t\t\t\tdateClear1(DeviceNum1);\r\n\r\n\t\t\t}", "public static void scheduleButtonListener(ActionEvent evt){\r\n MyButton button = (MyButton) evt.getSource();\r\n button.switchChosen();\r\n if(button.isChosen()){\r\n checkCollisions(button);\r\n }\r\n setButtonsColor();\r\n }", "@Override\n public void actionPerformed(ActionEvent ev) {\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e)\n\t{\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tstart_click(e);\r\n\t\t\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t}", "@Override\n public void onClick(View v) {\n startTime = SystemClock.uptimeMillis();\n\n //postDelayed will have the runnable to be added to the message queue by the specified\n //value which in this case would be 0\n handler.postDelayed(runnable, 0);\n\n //This will make the reset button inactive while the timer is going\n reset.setEnabled(false);\n }", "protected void onReset() {\n\t\t\n\t}", "@Override\n public void actionPerformed(ActionEvent actionEvent) {\n }", "public void clickButton()\n {\n fieldChangeNotify( 0 );\n }", "private void eventhandler() {\n\r\n\t}", "public void handleEvent(Event e)\n \t\t{\n \t\t\tmWindow.getDisplay().timerExec(500, mToggleUPnPEvent);\n \t\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\n }", "@Override\n\tpublic void onClick(View arg0) {\n\t\thandlertv.postDelayed(changeInputSource_thread, 100); //zjd,20140814. delay to change,wait pip_thread finish\n\t}" ]
[ "0.6698537", "0.66858166", "0.66540825", "0.66087157", "0.65992683", "0.6574196", "0.6574196", "0.6574196", "0.656649", "0.6547258", "0.6546252", "0.6534202", "0.6533377", "0.6519003", "0.6516802", "0.6509696", "0.6509696", "0.6509696", "0.6509696", "0.64753854", "0.64753854", "0.644986", "0.6444116", "0.6428581", "0.64268965", "0.6419841", "0.6414726", "0.6412471", "0.6412471", "0.6412471", "0.6412471", "0.6412471", "0.6412471", "0.6412471", "0.6412471", "0.6412471", "0.6412471", "0.64110106", "0.64110106", "0.64110106", "0.6347524", "0.63395685", "0.63353205", "0.63280463", "0.6323832", "0.6321535", "0.63170904", "0.6306709", "0.62987345", "0.6288024", "0.6287777", "0.62761724", "0.62761724", "0.62751377", "0.6274509", "0.62724924", "0.62700605", "0.6262569", "0.6262569", "0.6258887", "0.62570024", "0.62566304", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.6247804", "0.62429", "0.62410736", "0.62377834", "0.62366366", "0.6236302", "0.62344825", "0.62311304", "0.6229155", "0.6227035", "0.6222733", "0.6219097", "0.62178147", "0.6189461", "0.6187807", "0.61840874", "0.61810434", "0.61684704", "0.61677927", "0.6164407" ]
0.0
-1
Returns an iterator over the active participants
public Iterator<Participant> getParticipants() { return pstate.getParticipants(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Iterator<Activity> getActivitiesIterator(){\n\t\treturn activities.iterator();\n\t}", "Collection<Account> listParticipants() {\r\n\t\tupdatePastRelations();\r\n\t\treturn pastRelations;\r\n\t}", "public List<Contact> getParticipants()\n {\n return new LinkedList<Contact>(participants.values());\n }", "public List<AcsCallParticipantInternal> getParticipants() {\n return this.participants;\n }", "public Iterator<Person> iterator() {\r\n return staff.iterator();\r\n }", "public java.util.List<java.lang.Long>\n getParticipantsList() {\n return participants_;\n }", "public java.util.List<java.lang.Long>\n getParticipantsList() {\n return java.util.Collections.unmodifiableList(participants_);\n }", "public int getParticipantsCount() {\n return participants_.size();\n }", "public int getParticipantsCount() {\n return participants_.size();\n }", "private void getParticipantes() {\n mParticipantes = estudioAdapter.getParticipantes(MainDBConstants.estado + \"= '\" + Constants.STATUS_NOT_SUBMITTED+ \"'\", null);\n //ca.close();\n }", "public int getParticipantsCount() {\n return participants_.size();\n }", "public int getParticipantsCount() {\n return participants_.size();\n }", "public Set<Player> getParticipants() { //TODO: not sure the validation needs to happend here\n\t\t// Run through the results and make sure all players have been pushed into the participants set.\n\t\tfor ( Result result : results ) {\n\t\t\tparticipants.add(result.getWinner());\n\t\t\tparticipants.add(result.getLoser());\n\t\t}\n\n\t\treturn participants;\n\t}", "@ManyToMany//(cascade = {CascadeType.PERSIST, CascadeType.MERGE})\n public List<Person> getParticipants() {\n return participants;\n }", "public boolean isActive(){\n return (registeredParticipants.size() == connections().size());\n }", "public List<Individual> getListOfActiveIndividuals(){\n List<Individual> individualList = new ArrayList<>();\n\t\tList<Individual> activeIndividualList = new ArrayList<>();\n\t\tindividualList = (new TeamsJsonReader()).getListOfIndividuals();\n\t\tIndividual individual = null;\n\t\tint size, counter;\n\t\tfor (size = 0; size < individualList.size(); size++) {\n\t\t\tcounter = 0;\n\n\t\t\tindividual = individualList.get(size);\n\n\t\t\tif (individual.isActive()) {\n\t\t\t\tcounter = 1;\n\n\t\t\t\tactiveIndividualList.add(individual);\n\n\t\t\t}\n\t\t}\n\n\t\treturn activeIndividualList;\n\n }", "@Override\r\n public Iterator<User> iterator() {\r\n return user.iterator();\r\n }", "public int getParticipantsCount()\n {\n return participants.size();\n }", "public Iterator getUserIDs()\n {\n ArrayList temp = new ArrayList();\n \n for (int i = 0; i != ids.size(); i++)\n {\n if (ids.get(i) instanceof String)\n {\n temp.add(ids.get(i));\n }\n }\n \n return temp.iterator();\n }", "private void getEncParticipantes() {\n mEncuestasParticipantes = estudioAdapter.getListaEncuestaParticipantesSinEnviar();\n //ca.close();\n }", "public java.util.List<EncounterParticipant> participant() {\n return getList(EncounterParticipant.class, FhirPropertyNames.PROPERTY_PARTICIPANT);\n }", "public ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllInvolvedPerson_asNode() {\r\n\t\treturn Base.getAll_asNode(this.model, this.getResource(), INVOLVEDPERSON);\r\n\t}", "public Participant getParticipant ()\r\n {\r\n return participant_;\r\n }", "@Override\n\tpublic List<ParticipantDTO> getAllEnrolledParticipant() {\n\t\tList<ParticipantDTO> participantList = eManager.createQuery(\n\t\t\t\t\"SELECT p FROM ParticipantDTO p\", ParticipantDTO.class)\n\t\t\t\t.getResultList();\n\n\t\treturn participantList;\n\t}", "public com.google.protobuf.ProtocolStringList\n getParticipantsList() {\n return participants_;\n }", "public ResultSet getAllQuestionnaireParticipants () throws Exception {\r\n String sql = \"SELECT * FROM questionnaireparticipants;\";\r\n return stmt.executeQuery(sql);\r\n }", "@Override\n\tpublic Iterator<E> iterator() {\n\t\treturn vertices.iterator();\n\t}", "public Iterator<Activity> getActivitiesIterator(Filter<Activity> filter){\n\t\treturn activities.iterator(filter);\n\t}", "public TennisPlayerContainerIterator iterator() {\n\n\t\treturn new TennisPlayerContainerIterator(this.root);\n\t}", "@JsonProperty(\"participants\")\n public List<CallsParticipant> getParticipants() {\n return participants;\n }", "public com.google.protobuf.ProtocolStringList\n getParticipantsList() {\n return participants_.getUnmodifiableView();\n }", "public IQuestionIterator iterator() {\n\t\treturn getQuestions().iterator();\n\t}", "java.util.List<java.lang.Long> getParticipantsList();", "public Iterator<Join> iterator()\n {\n return joins.iterator();\n }", "public Iterator<ActivityWorkGroup> iterator() {\r\n \treturn workGroupTable.iterator();\r\n }", "void getParticipants(@NonNull final String conversationId, @Nullable Callback<ComapiResult<List<Participant>>> callback);", "public JSONResponse getCheckedInParticipants() {\n\t\tcheckProvided();\n\t\treturn checkedInParticipants;\n\t}", "public List<User> getParticipants(Long idEvent){\n List<Participation> participations =\n pm.findByIdEvent(idEvent);\n List<User> users = new ArrayList<>();\n \n for (Participation p : participations){\n users.add(p.getUser());\n }\n \n return users;\n }", "@Transactional(propagation = Propagation.REQUIRED, value = \"jamiTransactionManager\", readOnly = true)\n public Iterator<Experiment> iterateAll() {\n return new IntactQueryResultIterator<Experiment>((ExperimentService) ApplicationContextProvider.getBean(\"experimentService\"));\n }", "public Iterator<GPoint> iterator() {\n\t\treturn points.iterator();\n\t}", "Iterator<PendingAccountStatus> iterateFor(Account account);", "public Iterator getLobbies() {\n rrwl_lobbylist.readLock().lock();\n try {\n return lobbyList.iterator();\n } finally {\n rrwl_lobbylist.readLock().unlock();\n }\n }", "public PawnIterator getPawns(){\n\t\treturn new PawnIterator(pawns);\n\t}", "public List<Individual> getListOfInactiveIndividuals(){\n\t \tList<Individual> individualList = new ArrayList<>();\n\t\tList<Individual> inactiveIndividualList = new ArrayList<>();\n\t\tindividualList = (new TeamsJsonReader()).getListOfIndividuals();\n\t\tIndividual individual = null;\n\t\tint size, counter;\n\t\tfor (size = 0; size < individualList.size(); size++) {\n\t\t\tcounter = 0;\n\n\t\t\tindividual = individualList.get(size);\n\n\t\t\tif (!individual.isActive()) {\n\t\t\t\tcounter = 1;\n\n\t\t\t\tinactiveIndividualList.add(individual);\n\n\t\t\t}\n\t\t}\n\n\t\treturn inactiveIndividualList;\n }", "public List<OpenPlayer> getOpenPlayers() {\r\n if(actuelAktionators.isEmpty()){\r\n throw new IllegalStateException(\"In der Liste der Spieler muss mindestens ein Spieler sein (der Hoechtbietende)\");\r\n }\r\n return actuelAktionators;\r\n }", "com.google.protobuf.ProtocolStringList\n getParticipantsList();", "public Iterator<Object> listeners() {\n return Arrays.asList(fListeners).iterator();\n }", "public Collection<Identity> getActorIdentities() {\r\n\t\treturn identities;\r\n\t}", "public List<Event> getParticipatedEvents() {\n return participatedEvents;\n }", "@Override\n public Iterator iterator() {\n\n Iterator<RadarContent> iterator = new Iterator<RadarContent>() {\n\n ProfileQueue pq = new ProfileQueue(arrProfiles);\n int iCursor;\n\n /*\n * Check for next available profile\n */\n @Override\n public boolean hasNext() {\n return !pq.isEmpty() && pq.arrProfiles[iCursor++] != null;\n }\n\n /**\n * Return the next profile and advance the cursor\n */\n @Override\n public RadarContent next() {\n RadarContent p = pq.arrProfiles[iCursor];\n iCursor++;\n return p;\n }\n };\n\n return iterator;\n\n }", "public static HashSet<ParticipantContext> GetCurrentValidParticipant(String rtid) {\n HashSet<ParticipantContext> retSet = new HashSet<>();\n Session session = HibernateUtil.GetLocalSession();\n Transaction transaction = session.beginTransaction();\n boolean cmtFlag = false;\n try {\n RenRuntimerecordEntity runtimeCtx = session.get(RenRuntimerecordEntity.class, rtid);\n String participants = runtimeCtx.getParticipantCache();\n transaction.commit();\n cmtFlag = true;\n if (CommonUtil.IsNullOrEmpty(participants)) {\n return retSet;\n }\n String[] participantPairItem = participants.split(\",\");\n for (String workerIdBRolePair : participantPairItem) {\n String[] workerItem = workerIdBRolePair.split(\":\");\n retSet.add(ParticipantContext.GetContext(rtid, workerItem[0]));\n }\n return retSet;\n }\n catch (Exception ex) {\n if (!cmtFlag) {\n transaction.rollback();\n }\n throw ex;\n }\n finally {\n HibernateUtil.CloseLocalSession();\n }\n }", "public Iterator getUserAttributes()\n {\n ArrayList temp = new ArrayList();\n \n for (int i = 0; i != ids.size(); i++)\n {\n if (ids.get(i) instanceof PGPUserAttributeSubpacketVector)\n {\n temp.add(ids.get(i));\n }\n }\n \n return temp.iterator();\n }", "public java.lang.String getParticipants(int index) {\n return participants_.get(index);\n }", "public java.lang.String getParticipants(int index) {\n return participants_.get(index);\n }", "public ReactorResult<InvolvedPerson> getAllInvolvedPerson_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), INVOLVEDPERSON, InvolvedPerson.class);\r\n\t}", "public long getParticipants(int index) {\n return participants_.get(index);\n }", "long getParticipants(int index);", "public Map<ParticipantId, ParticipantConfig> getParticipantMap() {\n return _participantMap;\n }", "public List<User> getActiveUsers(boolean active);", "public int getParticipantAmount() {\n\t\treturn Participants;\n\t}", "public long getParticipants(int index) {\n return participants_.get(index);\n }", "public Iterator<Appointment> appointments()\n {\n return this.agenda.iterator();\n }", "public synchronized Iterator<E> iterator()\n {\n return iteratorUpAll();\n }", "public ReadOnlyIterator<Relation> getIncomingRelations();", "public ArrayList<Session> getActiveSessions()\r\n\t{\r\n\t\treturn this.activeSessions;\r\n\t}", "int getParticipantsCount();", "int getParticipantsCount();", "@Override\n public void getAllConnectathonParticipants() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"getAllConnectathonParticipants\");\n }\n\n renderAddPanel = false;\n setRenderImportContactPanel(false);\n setRenderImportUserPanel(false);\n\n if (Role.isLoggedUserAdmin() || Role.isLoggedUserProjectManager()) {\n\n EntityManager em = EntityManagerService.provideEntityManager();\n choosenInstitutionForAdmin = (Institution) Component.getInstance(CHOOSEN_INSTITUTION_FOR_ADMIN);\n\n Query query;\n if (choosenInstitutionForAdmin != null) {\n query = em\n .createQuery(\"SELECT cp FROM ConnectathonParticipant cp WHERE cp.testingSession = :inTestingSession AND cp.institution = \" +\n \":inInstitution\");\n query.setParameter(IN_INSTITUTION, choosenInstitutionForAdmin);\n query.setParameter(IN_TESTING_SESSION, TestingSession.getSelectedTestingSession());\n\n } else {\n query = em\n .createQuery(\"SELECT cp FROM ConnectathonParticipant cp WHERE cp.testingSession = :inTestingSession\");\n query.setParameter(IN_TESTING_SESSION, TestingSession.getSelectedTestingSession());\n\n }\n connectathonParticipants = query.getResultList();\n\n } else {\n selectedInstitution = Institution.getLoggedInInstitution();\n EntityManager em = EntityManagerService.provideEntityManager();\n Query query = em\n .createQuery(\"SELECT cp FROM ConnectathonParticipant cp WHERE cp.testingSession = :inTestingSession AND cp.institution = \" +\n \":inInstitution\");\n query.setParameter(IN_TESTING_SESSION, TestingSession.getSelectedTestingSession());\n query.setParameter(IN_INSTITUTION, selectedInstitution);\n connectathonParticipants = query.getResultList();\n\n }\n\n for (ConnectathonParticipant cp : connectathonParticipants) {\n if (cp.getInstitution() == null) {\n if (cp.getInstitutionOld() != null) {\n cp.setInstitution(cp.getInstitutionOld());\n entityManager.merge(cp);\n entityManager.flush();\n LOG.warn(\"Institution patched successfully !\");\n }\n }\n }\n\n }", "Collection<User> players();", "public Set<UUID> getAlivePlayers() {\n return new HashSet<>(players);\n }", "public Set<AndesSubscription> getActiveLocalSubscribersForNode() {\n return localSubscriptionProcessor\n .getActiveSubscribersForNode(ClusterResourceHolder.getInstance().getClusterManager().getMyNodeID());\n }", "List<Uuid> getActivePeers() throws RemoteException;", "private List getActiveEntities() {\n \t\tList<String> chainIds = new ArrayList<String>();\n \t\tbioUnitTransformationsStructAssembly = bioUnitsStructAssembly.getBioUnitTransformationList(initialBioId);\n \t\tif (bioUnitTransformationsStructAssembly != null) {\n \t\t\tfor (ModelTransformationMatrix trans: bioUnitTransformationsStructAssembly) {\n \t\t\t\tchainIds.add(trans.ndbChainId);\n \t\t\t}\n \t\t}\n \t return chainIds;\n \t}", "public Iterator<OpenERPRecord> iterator() {\r\n\t\treturn records.iterator();\r\n\t}", "public ReadOnlyIterator<Relation> getAllIncomingRelations();", "public List<EventCampaignParticipant> getAllEventCampaignParticipants() {\n\n\t\tList<EventCampaignParticipant> list = eventCampaignParticipantDao.getAll();\n\n\t\treturn list;\n\n\t}", "@Override\n\t\t\tpublic Iterator<Team> iterator() {\n\t\t\t\treturn null;\n\t\t\t}", "public Iterator getIterator() {\n return myElements.iterator();\n }", "com.google.protobuf.ByteString getParticipantBytes();", "public Integer getParticipant() {\n return participant;\n }", "public Iterator<K> iterator()\n {\n return (new HashSet<K>(verts)).iterator();\n }", "public Iterator getIterator() {\n\t\t\n\t\treturn blocks.iterator();\n\t\t\n\t}", "public Iterator<Note> iterator() {\n return notes.iterator();\n }", "public Stream<Long> members() {\n\treturn roomMembers.stream();\n }", "public Iterator getTransactions() {\n return (transactions.listIterator());\n }", "public Iterator<Player> iterator ()\n\t{\n\t\tCollections.sort(playerList,(Player p1, Player p2) -> p1.name().compareTo(p2.name()));\n\t\tIterator<Player> it = playerList.iterator();\n\t\treturn it;\n\t}", "public Iterator reachable() {\n Set s = SortedArraySet.FACTORY.makeSet(HashCodeComparator.INSTANCE);\n s.add(IdentityHashCodeWrapper.create(this));\n this.reachable(s);\n return new FilterIterator(s.iterator(), filter);\n }", "public com.google.protobuf.ByteString\n getParticipantsBytes(int index) {\n return participants_.getByteString(index);\n }", "@VTID(11)\r\n java.util.Iterator<Com4jObject> iterator();", "ArrayList<Actor> getActors();", "public Iterator getClients() {\n rrwl_serverclientlist.readLock().lock();\n try {\n return clientList.iterator();\n } finally {\n rrwl_serverclientlist.readLock().unlock();\n }\n }", "public Iterator<T> iterator() {\r\n return byGenerations();\r\n }", "public com.google.protobuf.ByteString\n getParticipantsBytes(int index) {\n return participants_.getByteString(index);\n }", "public Iterator<Appointment> appointments() {\n return appointments.iterator();\n }", "Iterator actionListeners();", "public Iterator<K> iterator()\n {\n\treturn (new HashSet<K>(verts)).iterator();\n }", "private List<QaParticipant> decorate(QaQuiz quiz, List<QaParticipant> participants) {\n for (QaParticipant participant : participants) {\n QaQuiz nextRound = quizDao.findByRound(quiz.getRound() + 1);\n if (null != nextRound && null != participant.getUser()) {\n participant.setSelected(quizDao.isParticipant(nextRound, participant.getUser()));\n }\n }\n return participants;\n }", "List<User> getActivatedUserList();", "public ResultSet getAllWineParticipantAssignment () throws Exception {\r\n String sql = \"SELECT * FROM wineparticipantassignment;\";\r\n return stmt.executeQuery(sql);\r\n }", "public ArrayList<Entity> getPlayers() {\n ArrayList<Entity> players = new ArrayList<>();\n students.forEach(student -> players.add(student.getPlayer()));\n return players;\n }" ]
[ "0.64781815", "0.6328788", "0.63263386", "0.6326267", "0.62729704", "0.6179917", "0.6052968", "0.599004", "0.599004", "0.59813845", "0.5940327", "0.5940327", "0.5938447", "0.59370935", "0.592049", "0.59155583", "0.5892882", "0.58830893", "0.5882551", "0.5860221", "0.5835902", "0.5822346", "0.58054364", "0.57730293", "0.5759212", "0.57291794", "0.5713562", "0.57035226", "0.56980133", "0.5671555", "0.5640199", "0.55962145", "0.55782056", "0.553125", "0.55279106", "0.55145764", "0.5501255", "0.5490166", "0.5461034", "0.5435567", "0.54341567", "0.54079556", "0.5402585", "0.5401952", "0.53974366", "0.5394962", "0.5392026", "0.53875715", "0.53846675", "0.5375798", "0.5374609", "0.5362363", "0.53522336", "0.534215", "0.5330005", "0.5327759", "0.5325911", "0.53256583", "0.5322017", "0.5319125", "0.5315949", "0.53152865", "0.5312652", "0.5310324", "0.53007203", "0.5289734", "0.5289734", "0.52809435", "0.5278949", "0.5278845", "0.5274588", "0.52603346", "0.52560633", "0.52535576", "0.52500564", "0.5226867", "0.52261186", "0.5222039", "0.5216607", "0.5203616", "0.51968896", "0.51803416", "0.5178337", "0.51771444", "0.5177086", "0.51718897", "0.5168242", "0.51580775", "0.5155511", "0.51523286", "0.5146087", "0.5142151", "0.51378286", "0.5133882", "0.5131371", "0.51255214", "0.5118781", "0.51181173", "0.5114781", "0.5110897" ]
0.80193037
0
If the transition time has been reached, transition to a new state
private void performTransition() { // Do something only if the time has been reached if (transitionTime <= System.currentTimeMillis()) { // Clear the transition time transitionTime = Long.MAX_VALUE; // If there are no lives left, the game is over. Show the final // screen. if (lives <= 0) { // Updates the highScore if (numScore > highScore) { highScore = numScore; } // Updates the HighScore label in enhanced mode if (enhanced == true) { display.setHighScore(highScore); } // Brings up the final screen finalScreen(); // JOptionPane.showMessageDialog(null, numLiveUpdated); } // If the ship was destroyed, place a new one and continue else if (ship == null) { placeShip(); } if (pstate.countAsteroids() == 0) { // increase the level and speed markers numLevel += 1; speed += 0.5; // Update the level display display.setLevel(numLevel); Participant.expire(alien); placeAsteroids(); } // Place a new alien when one has been destroyed if (pstate.countAliens() == 0 && ship != null) { if (numLevel == 2) { placeAlien(1); } else if (numLevel >= 3) { placeAlien(0); } clipAlienDestroyed.stop(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean transition() {\n current = new State(ts++, hopper); \n if (terminus.isTerminus(current)) {\n return false;\n } else {\n hopper.sendBall(oneMinute);\n return true;\n }\n }", "public void changeState(int transition) {\n lastState = currentState;\n currentState = nextState[currentState][transition];\n // System.out.println(\" = \" + currentState);\n if (currentState == -2) {\n System.out.println(\"Error [\" + currentState + \"] has occured\");\n terminate();\n }\n else if (currentState == -1) {\n terminate();\n }\n states[currentState].run();\n }", "public void transitionStates () {\n myCurrentState = myNextState;\n myNextState = null;\n }", "private void scheduleTransition(int m) {\r\n\t\ttransitionTime = System.currentTimeMillis() + m;\r\n\t}", "@Override\n\t\tprotected void doTransition() {\n\t\t\t\n\t\t}", "public void finishTransition() {\n animTimer = 0;\n if (gameTransition) playTime = 0.0f;\n roomTransition = false;\n gameTransition = false;\n fadeToBlack = true;\n }", "@Override\n public void timePassed() {\n moveOneStep();\n }", "@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}", "public void transitionIfNotPreviously(T fromState, T toState, Runnable action) {\n Thread previousOwner = takeOwnership();\n try {\n if (achievedStates.contains(toState)) {\n return;\n }\n doTransition(fromState, toState, action);\n } finally {\n releaseOwnership(previousOwner);\n }\n }", "public void maybeTransition(T fromState, T toState, Runnable action) {\n Thread previousOwner = takeOwnership();\n try {\n if (state == toState && currentTarget == null) {\n return;\n }\n doTransition(fromState, toState, action);\n } finally {\n releaseOwnership(previousOwner);\n }\n }", "void nextState();", "public void setStateTime(long newStateTime) {\n _stateTime = newStateTime;\n }", "@Test\n public void stateTransitionsTest() throws ApiException {\n Long loanId = null;\n PostSelfLoansLoanIdRequest body = null;\n String command = null;\n PostSelfLoansLoanIdResponse response = api.stateTransitions(loanId, body, command);\n\n // TODO: test validations\n }", "public void timePassed() {\n this.moveOneStep();\n }", "private void changeState() {\n if (jobs.contains(this.currentFloor)){\n throw new AssertionError(\"Changing state of elevator no \" + ElevatorID + \" on destination floor\");\n }\n\n // empty job set -> going to IDLE state\n if (jobs.size() == 0) {\n this.currentState = IDLE;\n return;\n }\n\n Integer closestFloorDownwards = jobs.floor(this.currentFloor);\n Integer closestFloorUpwards = jobs.ceiling(this.currentFloor);\n\n switch (this.currentState) {\n // if elevator is in idle state then we need to go to the closest job possible\n case IDLE -> {\n Integer closestFloor =\n findClosestFloor(this.currentFloor, closestFloorUpwards, closestFloorDownwards);\n\n if (closestFloor < this.currentFloor) {\n this.currentState = DOWN;\n } else {\n this.currentState = UP;\n }\n }\n case DOWN -> {\n if (closestFloorDownwards != null) { // if there exists a predecessor in `jobs`\n this.currentState = DOWN; // let's continue going down\n } else {\n this.currentState = UP; // otherwise we need to go up\n }\n }\n case UP -> {\n if (closestFloorUpwards != null) { // if there exists a successor in `jobs`\n this.currentState = UP; // let's continue going up\n } else {\n this.currentState = DOWN; // otherwise we need to go down\n }\n }\n }\n }", "public void changeState()\r\n\t{\r\n\t\tfailedNumber=0;\r\n\t\tif(state.equalsIgnoreCase(\"IN PREPARATION\"))\r\n\t\t\tsetState(\"IN TRANSIT\");\r\n\t\telse if(state.equalsIgnoreCase(\"IN TRANSIT\"))\r\n\t\t{\r\n\t\t\tfailedNumber=Math.random();\r\n\t\t\tif(failedNumber<=0.2) setState(\"FAILED\");\r\n\t\t\telse setState(\"RECEIVED\");\r\n\t\t}\r\n\t}", "public void applyNewState() {\n this.setAlive(this.newState);\n }", "@Override\n\tpublic void \t\t\t\t\t\tuserDefinedInternalTransition (\n\t\t\t\t\t\t\t\tDuration elapsedTime)\n\t{\n\t\tDuration d1 = new Duration (\n\t\t\t\tthis.interDayDelay , \n\t\t\t\tthis.getSimulatedTimeUnit()\n\t\t\t) ; \n\t\t\n\t\tassert d1 != null ;\n\t\t\n\t\tTime t = this.getCurrentStateTime().add(d1) ; \n\t\tdouble dur = 2.0 * this.meanRunDuration * this.rg.nextBeta(1.75, 1.75) ; \n\t\tdouble temp = 2.0 * this.meanTemperature * this.rg.nextBeta(1.75, 1.75) ; \n\t\t// impossible to set temperature more than MAX_TEMPERATURE\n\t\ttemp = (temp > OvenModel.MAX_TEMPERATURE)?OvenModel.MAX_TEMPERATURE:temp ;\n\t\tthis.scheduleEvent(new RunOven(t, dur , temp));\n\t}", "public abstract Etat transition();", "public void transition(T fromState, T toState, Runnable action) {\n Thread previousOwner = takeOwnership();\n try {\n doTransition(fromState, toState, action);\n } finally {\n releaseOwnership(previousOwner);\n }\n }", "void changeState(Spreadable spreadable, State from, State to, int count);", "public IFsm transitionTo(Class<? extends IState> p_newState) throws Exception;", "synchronized void advanceState()\n {\n state = state.advance();\n notifyAll();\n }", "void transit();", "@Override\n public State update() {\n if(mRuntime.seconds()<=time) {\n arm.setPosition(pos);\n return this;\n }\n //(1000);\n\n return NextState;\n\n\n\n\n\n }", "@Override\r\n\tpublic void checkState(int delay) {\n\t\tAddAction(new DiceCheckGameStateAction(delay));\r\n\t}", "private void rerunAnimation() {\n transition.playFromStart();\r\n}", "private void addTransition(final State oldState, final State newState) {\n transferFunctionBuilder.addTransition(oldState.getId(), EMPTY_SEQUENCE, newState.getId());\n }", "private final boolean setTime(int newTime) {\n\t\tint oldState = (elapsedTime <= 0) ? SECTION_START_DELAY : getSection();\n\t\tthis.elapsedTime = newTime;\n\t\tint newState = getSection();\n\n\t\tif (newState == SECTION_ANIMATION) {\n\t\t\tint animTime = getAnimTime();\n\t\t\tif (easing != null) {\n\t\t\t\tanimTime = easing.ease(animTime, duration);\n\t\t\t}\n\t\t\tupdateState(animTime);\n\t\t\treturn true;\n\t\t} else if ((newState == SECTION_LOOP_DELAY && oldState != SECTION_LOOP_DELAY)\n\t\t\t\t|| (newState == SECTION_START_DELAY && oldState == SECTION_ANIMATION)) {\n\t\t\tupdateState(duration);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private void updateState() {\n\t while(!isGoodState()) {\n\t\t updateStateOnce();\n\t }\n }", "private void updateTransition(float delta) {\n if (roomTransition || gameTransition && !gameTransitionPause) {\n BLACK_BACKGROUND.setAlpha(Interpolation.pow4.apply(0, 1, animTimer / ANIM_TIME));\n\n if (fadeToBlack) {\n animTimer += delta;\n\n if (animTimer >= ANIM_TIME) {\n \tif (roomTransition) {\n\t game.player.moveRoom();\n\t currentNPCs = game.gameSnapshot.map.getNPCs(game.player.getRoom());\n\t getTileRenderer().setMap(game.player.getRoom().getTiledMap());\n\t getTileRenderer().clearPeople();\n\t getTileRenderer().addPerson((List<AbstractPerson>) ((List<? extends AbstractPerson>) currentNPCs));\n\t getTileRenderer().addPerson(game.player);\n \t} else {\n \tswitchGame();\n gameTransitionPause = true;\n \t}\n fadeToBlack = false;\n }\n } else {\n animTimer -= delta;\n\n if (animTimer <= 0f) {\n finishTransition();\n }\n }\n }\n\n if (game.player.roomChange) {\n initialiseRoomTransition();\n game.player.roomChange = false;\n }\n }", "public NewTransitionRecord(){\r\n fromstate = 0;\r\n tostate = 0;\r\n rate = 0.0;\r\n }", "private boolean transitionRunStateTo(int state) {\n for (;;) {\n int s = runState;\n if (s >= state)\n return false;\n if (_unsafe.compareAndSwapInt(this, runStateOffset, s, state))\n return true;\n }\n }", "@Override\n protected void incrementStates() {\n\n }", "public ExecutionResult<Void> tryTransition(T fromState, T toState, Supplier<ExecutionResult<Void>> action) {\n Thread previousOwner = takeOwnership();\n try {\n return doTransition(fromState, toState, action);\n } finally {\n releaseOwnership(previousOwner);\n }\n }", "public void state(@NotNull State newState) {\n State state = this.state.get();\n\n if (state.ordinal() < newState.ordinal())\n this.state.compareAndSet(state, newState);\n }", "public boolean isTransition() {\n/* 4839 */ return this.isTransition;\n/* */ }", "public void setStateToExpired() {\n state = VALID_STATES[1];\n }", "public void setCameFrom(State n)\r\n\t{\r\n\t\tthis.previousState = new State(n);\r\n\t}", "@Override\n\tpublic MoveState transitionAway() {\n\t\treturn this;\n\n\t}", "@Test\n public void testStateTransitions2()\n {\n theEngine.start();\n letPlayerWin();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Halted\n theEngine.quit();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Player died\n killPlayerByPlayerMove();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Undo from player won state\n theEngine.undoLastMove();\n //didn't throw assertion error, so this is fine\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\n }", "public void act()\n {\n \n if (wait < 75)\n {\n wait = wait + 1;\n }\n \n \n \n \n \n \n if (wait == 75)\n {\n change();\n checkForBounce();\n checkForEdge();\n checkWin(); \n }\n \n \n }", "public void jumpToCurrentState() {\n if (mRunningAnimator != null) {\n mRunningAnimator.end();\n }\n }", "protected DynAction nextStateAfterNonCarTrip(DynAction oldAction, double now) {\n\t\tplanIndex++;\n\t\tthis.currentPlanElement = plan.getPlanElements().get(planIndex);\n\t\tActivity nextPlannedActivity = (Activity) this.currentPlanElement;\n\t\tthis.lastParkActionState = LastParkActionState.ACTIVITY;\n\t\tfinal double endTime;\n\t\tif (nextPlannedActivity.getEndTime().isUndefined()) {\n\t\t\tif (nextPlannedActivity.getMaximumDuration().isUndefined()) {\n endTime = Double.POSITIVE_INFINITY;\n //last activity of a day\n } else {\n\t\t\t\tendTime = now + nextPlannedActivity.getMaximumDuration().seconds();\n }\n\t\t} else {\n\t\t\tendTime = nextPlannedActivity.getEndTime().seconds();\n\t\t}\n\t\treturn new IdleDynActivity(nextPlannedActivity.getType(), endTime);\n\n\t}", "public void showTimeLeft(int time, String state);", "public void transitionToTimer(boolean isShow) {\n }", "public void setAttackState(String state, \n int loadingTime, \n int activeTime, \n int recoveryTime) {\n this.setSpecialState(state, loadingTime+activeTime+recoveryTime);\n this.resetXMovement();\n TimedEventQueue.addTask(new TimedTask(this, \"activeAttackState\", loadingTime));\n TimedEventQueue.addTask(new TimedTask(this, \"activeAttackStateOver\", \n loadingTime+activeTime));\n \n }", "protected Transition addTransitionSteps(Transition transition,\n InternalSystemEntryDelta entryDelta,\n Object fromState,\n Object toState)\n {\n // nothing to do if both states are equal!\n if(LangUtils.isEqual(fromState, toState))\n return transition;\n \n if(fromState == null)\n fromState = StateMachine.NONE;\n \n if(toState == null)\n toState = StateMachine.NONE;\n \n // when no state machine (empty agents) nothing to do...\n StateMachine stateMachine = entryDelta.getStateMachine();\n if(stateMachine == null)\n return transition;\n\n int distance = stateMachine.getDistance(fromState, toState);\n \n @SuppressWarnings(\"unchecked\")\n Collection<Map<String,String>> path =\n (Collection<Map<String,String>>) entryDelta.getStateMachine().findShortestPath(fromState,\n toState);\n for(Map<String, String> p : path)\n {\n Transition newTransition =\n addTransition(entryDelta, p.get(\"action\"), p.get(\"to\"), distance);\n newTransition.executeAfter(transition);\n transition = newTransition;\n }\n \n return transition;\n }", "public void shake(){\n translateTransition.playFromStart();\n }", "public void setState(int newState, float blendTime) {\n _states.get(_currentStateHandler).onExit();\n _currentStateHandler = newState;\n _states.get(_currentStateHandler).onEnter();\n }", "protected abstract int newState();", "public void timePassed(double dt) {\r\n this.moveOneStep(dt);\r\n }", "long getStateChange();", "@Override public void setTime(UpodWorld w)\n{\n StateRepr sr = getState(w);\n sr.checkAgain(0);\n}", "public final void mo99825c() {\n finish();\n overridePendingTransition(0, R.anim.t);\n }", "public void timePassed(double dt) {\r\n moveOneStep(dt);\r\n }", "protected DynAction nextStateAfterWalkToPark(DynAction oldAction, double now) {\n\t\tthis.lastParkActionState = LastParkActionState.UNPARKACTIVITY;\n\t\treturn new IdleDynActivity(this.stageInteractionType, now + configGroup.getUnparkduration());\n\t}", "Transition createTransition();", "Transition createTransition();", "public void setStateOfMovement(int movementState){stateOfMovement = movementState; }", "@Override\n\tpublic void doTimeStep() {\n\t\tint activity = Critter.getRandomInt(3);\n\t\tif(activity == 0) {\n\t\t\twalk(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(activity == 1) {\t\t\t\t\n\t\t\trun(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(this.getEnergy() >= Params.min_reproduce_energy) {\n\t\t\tCritter4 egg = new Critter4();\n\t\t\tthis.reproduce(egg,Critter.getRandomInt(8));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "public TurnState step() {\n ReadOnlyHistory history = board.viewHistory();\n \n if (!isGameOver) {\n Player next = nextPlayer();\n Move move = null;\n \n try {\n final long startTime = System.currentTimeMillis();\n move = next.play(history);\n next.addTime(System.currentTimeMillis() - startTime);\n \n if (next.getTime() >= timeLimit || !board.isValid(move)){\n isGameOver = true;\n }\n else {\n board.set(move);\n }\n }\n catch (IllegalArgumentException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n catch (ArrayIndexOutOfBoundsException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n \n return new TurnState(next, move, isGameOver);\n }\n else {\n return new TurnState(null, null, true);\n }\n }", "@Override\n public void stepUp(Cell currentCell) {\n if(currentCell.getOldNoOfAliveNeighbours()==3)\n {\n currentCell.setState(new Alive());\n }\n }", "@Test\n public void testStateTransitions3()\n {\n //Undo from starting state\n boolean assertionFailed = false;\n try\n {\n theEngine.undoLastMove();\n }\n catch (AssertionError ae)\n {\n assertionFailed = true;\n }\n \n assertTrue(assertionFailed);\n \n //Undo from playing state\n theEngine.start();\n try\n {\n theEngine.undoLastMove();\n }\n catch (AssertionError ae)\n {\n assertionFailed = true;\n }\n \n //Undo from halted state\n theEngine.quit();\n movePlayerToCell(getEmptyCell());\n theEngine.undoLastMove();\n //didn't throw assertion error, so fine\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\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}", "protected void stateChanged(final SpacecraftState state) {\n final AbsoluteDate date = state.getDate();\n final boolean forward = date.durationFrom(getStartDate()) >= 0.0;\n for (final DoubleArrayDictionary.Entry changed : state.getAdditionalStatesValues().getData()) {\n final TimeSpanMap<double[]> tsm = unmanagedStates.get(changed.getKey());\n if (tsm != null) {\n // this is an unmanaged state\n if (forward) {\n tsm.addValidAfter(changed.getValue(), date, false);\n } else {\n tsm.addValidBefore(changed.getValue(), date, false);\n }\n }\n }\n }", "public void timePassed(double dt) {\n this.moveOneStep(dt);\n }", "public void readyToGoAnimation() {\n TranslateTransition leave = new TranslateTransition(Duration.millis(600), syncBox);\n leave.setByY(80.0);\n // Buttons slide in and clickable address appears simultaneously.\n TranslateTransition arrive = new TranslateTransition(Duration.millis(600), controlsBox);\n arrive.setToY(0.0);\n FadeTransition reveal = new FadeTransition(Duration.millis(500), addressControl);\n reveal.setToValue(1.0);\n ParallelTransition group = new ParallelTransition(arrive, reveal);\n // Slide out happens then slide in/fade happens.\n SequentialTransition both = new SequentialTransition(leave, group);\n both.setCycleCount(1);\n both.setInterpolator(Interpolator.EASE_BOTH);\n both.play();\n }", "@Override\n\tpublic void act(float dt){\n\t\t\n\t}", "protected DynAction nextStateAfterCarTrip(DynAction oldAction, double now) {\n\t\tif (this.parkingManager.parkVehicleHere(Id.create(this.agent.getId(), Vehicle.class), agent.getCurrentLinkId(), now)){\n\t\tthis.lastParkActionState = LastParkActionState.PARKACTIVITY;\n\t\tthis.currentlyAssignedVehicleId = null;\n\t\tthis.parkingLogic.reset();\n\t\t\treturn new IdleDynActivity(this.stageInteractionType, now + configGroup.getParkduration());\n\t\t}\n\t\telse throw new RuntimeException (\"No parking possible\");\n\t}", "public void changeState() {\n if (!isDead) {\n Bitmap temp = getBitmap();\n setBitmap(stateBitmap);\n stateBitmap = temp;\n }\n }", "private Transition(State sourceState) {\r\n \t\t\tthis.sourceState = sourceState;\r\n \t\t\tthis.nextStateInfo = new ArrayList<NextStateInfo>();\r\n \t\t}", "public <S> S transition(T fromState, T toState, Supplier<? extends S> action) {\n Thread previousOwner = takeOwnership();\n try {\n return doTransition(fromState, toState, () -> ExecutionResult.succeeded(action.get())).getValueOrRethrow();\n } finally {\n releaseOwnership(previousOwner);\n }\n }", "void stateChanged( final GameState oldState, final GameState newState );", "public void move() {\n\t\tif(right) {\n\t\t\tgoRight();\n\t\t\tstate++;\n\t\t\tif(state > 5) {\n\t\t\t\tstate = 3;\n\t\t\t}\n\t\t}\n\t\telse if(left) {\n\t\t\tgoLeft();\n\t\t\tstate++;\n\t\t\tif(state > 2) {\n\t\t\t\tstate = 0;\n\t\t\t}\n\t\t}\n\t}", "public void action()\n {\n if(timeout > 0 && timeout < 2)\n {\n timeout = 0;\n agent.removeBehaviour(introNegotiation);\n introNegotiation = null;\n counter = 0;\n\n\n }\n //If this is the very first time getting to this state or if the timeout reset the counter to 0\n if(counter < 1)\n {\n //Clean the list of receivers in case there is something\n if(!receivers.isEmpty())\n receivers.removeAllElements();\n //Calculate the duration of the intro\n calculateDurationIntro();\n //Find a receiver\n findAllReceivers();\n constructACLMessage();\n introNegotiation = new IntroNegotiation(agent,msg);\n introNegotiation.setDataStore(getDataStore());\n agent.addBehaviour(introNegotiation);\n }\n\n\n //Handle where I'm heading to from here.\n switch (steps)\n {\n case 0:\n transition = 29;\n break;\n case 1:\n agent.removeBehaviour(introNegotiation);\n introNegotiation = null;\n transition = 17;\n\n }\n\n\n\n }", "public void setState(State newState) {this.state = newState;}", "public boolean advanceTo(long time)\n {\n if (time < startTime)\n {\n return false;\n }\n else if (state == AnimationState.STOPPED)\n {\n return true;\n }\n else if (state == AnimationState.WAITING)\n {\n state = AnimationState.FORWARD;\n dispatchAnimationEvent(animationStarted);\n }\n \n float t = 0;\n long scaledTime = time;\n boolean ended = false;\n \n switch (repeatMode)\n {\n case NONE:\n ended = (time >= startTime + duration);\n t = ended ? 1.0f :\n (float) ((double) (time - startTime) / duration);\n break;\n \n case REPEAT:\n state = AnimationState.FORWARD;\n scaledTime = (time - startTime) % duration;\n t = (float) ((double) scaledTime / duration);\n \n if (scaledTime < lastTime)\n {\n dispatchAnimationEvent(animationRepeated);\n }\n \n break;\n \n case OSCILLATE:\n scaledTime = (time - startTime) % (2 * duration);\n \n if (scaledTime < duration)\n {\n t = (float) ((double) scaledTime / duration);\n }\n else\n {\n t = 1 - (float) ((double) (\n scaledTime - duration) / duration);\n }\n \n if (state == AnimationState.FORWARD\n && scaledTime > duration)\n {\n state = AnimationState.BACKWARD;\n dispatchAnimationEvent(animationRepeated);\n }\n else if (state == AnimationState.BACKWARD\n && scaledTime < duration)\n {\n state = AnimationState.FORWARD;\n dispatchAnimationEvent(animationRepeated);\n }\n \n break;\n }\n \n float y = interpolator.getInterpolation(t);\n \n for (PropertyTransformer transformer : transformers)\n {\n transformer.transform(y);\n }\n \n if (ended)\n {\n if (removeWhenComplete)\n {\n getShape().remove();\n }\n \n dispatchAnimationEvent(animationEnded);\n }\n \n lastTime = scaledTime;\n \n return ended;\n }", "@Override\n\tpublic void adjust() {\n\t\tstate = !state;\n\t}", "protected DynAction nextStateAfterWalkFromPark(DynAction oldAction, double now) {\n\t\treturn nextStateAfterNonCarTrip(oldAction, now);\n\t}", "protected DynAction nextStateAfterActivity(DynAction oldAction, double now) {\n\t\tif (plan.getPlanElements().size() >= planIndex + 1) {\n\t\t\tplanIndex++;\n\t\t\tthis.currentPlanElement = plan.getPlanElements().get(planIndex);\n\t\t\tLeg currentLeg = (Leg) currentPlanElement;\n\t\t\tif (currentLeg.getMode().equals(TransportMode.car)) {\n\t\t\t\tId<Vehicle> vehicleId = Id.create(this.agent.getId(), Vehicle.class);\n\t\t\t\tId<Link> parkLink = this.parkingManager.getVehicleParkingLocation(vehicleId);\n\n\t\t\t\tif (parkLink == null) {\n\t\t\t\t\t//this is the first activity of a day and our parking manager does not provide informations about initial stages. We suppose the car is parked where we are\n\t\t\t\t\tparkLink = agent.getCurrentLinkId();\n\t\t\t\t}\n\n\t\t\t\tFacility fromFacility = new LinkWrapperFacility(network.getLinks().get(agent.getCurrentLinkId()));\n\t\t\t\tId<Link> teleportedParkLink = this.teleportationLogic.getVehicleLocation(agent.getCurrentLinkId(), vehicleId, parkLink, now,\n\t\t\t\t\t\tcurrentLeg.getMode());\n\t\t\t\tFacility toFacility = new LinkWrapperFacility(network.getLinks().get(teleportedParkLink));\n\t\t\t\tList<? extends PlanElement> walkTrip = walkRouter.calcRoute(\n\t\t\t\t\t\tDefaultRoutingRequest.withoutAttributes(fromFacility, toFacility, now, plan.getPerson()));\n\t\t\t\tif (walkTrip.size() != 1 || !(walkTrip.get(0) instanceof Leg)) {\n\t\t\t\t\tString message = \"walkRouter returned something else than a single Leg, e.g. it routes walk on the network with non_network_walk to access the network. Not implemented in parking yet!\";\n\t\t\t\t\tlog.error(message);\n\t\t\t\t\tthrow new RuntimeException(message);\n\t\t\t\t}\n\t\t\t\tLeg walkLeg = (Leg) walkTrip.get(0);\n\t\t\t\tthis.lastParkActionState = LastParkActionState.WALKTOPARK;\n\t\t\t\tthis.currentlyAssignedVehicleId = vehicleId;\n\t\t\t\tthis.stageInteractionType = ParkingUtils.PARKACTIVITYTYPE;\n\t\t\t\treturn new StaticPassengerDynLeg(walkLeg.getRoute(), walkLeg.getMode());\n\t\t\t} else if (currentLeg.getMode().equals(TransportMode.pt)) {\n\t\t\t\tif (currentLeg.getRoute() instanceof TransitPassengerRoute) {\n\t\t\t\t\tthrow new IllegalStateException(\"not yet implemented\");\n\t\t\t\t} else {\n\t\t\t\t\tthis.lastParkActionState = LastParkActionState.NONCARTRIP;\n\t\t\t\t\treturn new StaticPassengerDynLeg(currentLeg.getRoute(), currentLeg.getMode());\n\t\t\t\t}\n\t\t\t\t//teleport or pt route\n\t\t\t} else {\n\t\t\t\t//teleport\n\t\t\t\tthis.lastParkActionState = LastParkActionState.NONCARTRIP;\n\t\t\t\treturn new StaticPassengerDynLeg(currentLeg.getRoute(), currentLeg.getMode());\n\t\t\t}\n\n\t\t} else throw new RuntimeException(\n\t\t\t\t\"no more leg to follow but activity is ending\\nLastPlanElement: \" + currentPlanElement.toString() + \"\\n Agent \" + this.agent.getId() + \"\\nTime: \" + Time.writeTime(\n\t\t\t\t\t\tnow));\n\t}", "public void takeTransition(TransitionImpl transition) {\n if (transition.id!=null || activity.activityType.saveTransitionsTaken()) {\n addTransitionTaken(transition.id);\n }\n ActivityInstanceImpl toActivityInstance = null;\n ActivityImpl to = transition.to;\n if (to!=null) {\n end();\n if (log.isDebugEnabled()) {\n log.debug(\"Taking transition to \"+to);\n }\n toActivityInstance = parent.createActivityInstance(to);\n } else {\n log.debug(\"Dangling transition. Propagating to parent.\");\n end();\n propagateToParent();\n }\n workflow.workflowEngine.notifyTransitionTaken(this, transition, toActivityInstance);\n }", "private void transitionTo(Scene scene) {\n for (EmptyGraphBoardFX g : toAnimate)\n g.stopAnimating();\n toAnimate.clear();\n theStage.setScene(scene);\n if (scene == mainGame)\n toAnimate.add(mGSelfBoard);\n if (scene == attackScene) {\n toAnimate.add(ene1.b);\n toAnimate.add(ene2.b);\n }\n if (scene == setShips)\n toAnimate.add(sSboard);\n if (scene == AIScene) {\n toAnimate.add(selfvsAI);\n toAnimate.add(ai.b);\n }\n for (EmptyGraphBoardFX g : toAnimate)\n g.startAnimating();\n }", "private void showTransition(int duration)\n {\n showMainView(TRANS_PANE_VIEW);\n Timer task = new Timer(duration, (ActionEvent e) ->\n {\n showMainView(VIEW_PANE);\n });\n \n task.setRepeats(false);\n task.start();\n }", "public void compileStates(int timeinterval) {\r\n\t\tif(timeinterval == -1) {\r\n\t\t\t//Add initial State\r\n\t\t\treachableStates.add(initialState);\r\n\t\t\tthis.numReachableState = 1;\r\n\t\t\t\r\n\t\t}else{\t\t\t\t\r\n\t\tState s;\r\n\t\tint index = 0;\r\n\t\treachableStates.clear();\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\ts = grid[timeinterval][i][j][k];\r\n\t\t\t\t\tif(s.getProbability() != 0) {\r\n\t\t\t\t\t\t//If probability of state is not 0, put this state into the reachable list. \r\n\t\t\t\t\t\ts.index = index;\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\treachableStates.add(s);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.numReachableState = index;\r\n\t\t}\r\n\t}", "public void updateState() {\n\t\tfloat uptime = .05f;\t\t\t// Amount of Time the up animation is performed\n\t\tfloat downtime = .35f;\t\t\t// Amount of Time the down animation is performed\n\t\tColor colorUp = Color.YELLOW;\t// Color for when a value is increased\n\t\tColor colorDown = Color.RED;\t// Color for when a value is decreased\n\t\tColor color2 = Color.WHITE;\t\t// Color to return to (Default Color. Its White btw)\n\t\t\n\t\t// Check to see if the Time has changed and we are not initializing the label\n\t\tif(!time.getText().toString().equals(Integer.toString(screen.getState().getHour()) + \":00\") && !level.getText().toString().equals(\"\")) {\n\t\t\t// Set the time label and add the animation\n\t\t\ttime.setText(Integer.toString(screen.getState().getHour()) + \":00\");\n\t\t\ttime.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t} else if(time.getText().toString().equals(\"\")) {\n\t\t\t// First time setting the label, dont add the animation\n\t\t\ttime.setText(Integer.toString(screen.getState().getHour()) + \":00\");\n\t\t}\n\t\t\n\t\t// Check to see if the Level has changed and we are not initializing the label\n\t\tif(!level.getText().toString().equals(screen.getState().getTitle()) && !level.getText().toString().equals(\"\")) {\n\t\t\tlevel.setText(\"Level: \" + screen.getState().getTitle());\n\t\t\tlevel.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t} else if(level.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the level label\n\t\t\tlevel.setText(\"Level: \" + screen.getState().getTitle());\n\t\t}\n\t\t\n\t\t// Check to see if the XP has changed and we are not initializing the label\n\t\tif(!xp.getText().toString().equals(\"XP: \" + Integer.toString(screen.getState().getXp())) && !xp.getText().toString().equals(\"\")) {\n\t\t\txp.setText(\"XP: \" + Integer.toString(screen.getState().getXp()));\n\t\t\txp.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t} else if(xp.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the XP label\n\t\t\txp.setText(\"XP: \" + Integer.toString(screen.getState().getXp()));\n\t\t}\n\t\t\n\t\t// Check to see if the Money has changed and we are not initializing the label\n\t\tif(!money.getText().toString().equals(\"$\" + Double.toString(screen.getState().getMoney()) + \"0\") && !money.getText().toString().equals(\"\")) {\n\t\t\t\n\t\t\t// Check to see if the player's money went up. This is a mess but it works\n\t\t\t// Makes the change animation Yellow or Green depending on the change in money\n\t\t\tif(Double.parseDouble(money.getText().substring(1).toString()) <= screen.getState().getMoney())\n\t\t\t\tmoney.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t\telse\n\t\t\t\tmoney.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorDown)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t\t\n\t\t\t// Set the label to the new money\n\t\t\tmoney.setText(\"$\" + Double.toString(screen.getState().getMoney()) + \"0\");\n\t\t\t\n\t\t} else if(money.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the Money Label\n\t\t\tmoney.setText(\"$\" + Double.toString(screen.getState().getMoney()) + \"0\");\n\t\t}\n\t\t\n\t\t// Check to see if the Energy has changed and we are not initializing the label\n\t\tif(!energy.getText().toString().equals(\"E: \" + Integer.toString(screen.getState().getEnergy()) + \"/100\") && !energy.getText().toString().equals(\"\")) {\n\t\t\t\n\t\t\t// Changes the animation to Yellow or Red depending on the change in the energy value\n\t\t\tif(Integer.parseInt(energy.getText().substring(3).split(\"/\")[0].toString()) < screen.getState().getEnergy())\n\t\t\t\tenergy.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t\telse\n\t\t\t\tenergy.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorDown)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t\t\n\t\t\t// Set the energy label\n\t\t\tenergy.setText(\"E: \" + Integer.toString(screen.getState().getEnergy()) + \"/100\");\n\t\t} else if(energy.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the energy label if it isnt set\n\t\t\tenergy.setText(\"E: \" + Integer.toString(screen.getState().getEnergy()) + \"/100\");\n\t\t}\n\t\t\n\t\t// Get the current date.\n\t\tint[] curDate = screen.getState().getDate();\n\t\t\t\n\t\t// Check to see if the Date has changed and we are not initializing the label\n\t\tif(!date.getText().toString().equals(\"\" + curDate[2] + \"/\" + curDate[1] + \"/\" + curDate[0]) && !date.getText().toString().equals(\"\")) {\n\t\t\t// Set the date label and add the change animation\n\t\t\tdate.setText(\"\" + curDate[2] + \"/\" + curDate[1] + \"/\" + curDate[0]);\n\t\t\tdate.addAction(sequence(parallel(moveBy(0, 4f, uptime), color(colorUp)), parallel(moveBy(0, -4f, .5f), color(color2, downtime))));\n\t\t} else if(date.getText().toString().equals(\"\")) {\n\t\t\t// Initialize the date label\n\t\t\tdate.setText(\"\" + curDate[2] + \"/\" + curDate[1] + \"/\" + curDate[0]);\n\t\t}\n\t\t\n\t\t// Set the log text\n\t\tlogLabel.setText(screen.getState().getLog());\n\t\t\n\t\t// Update the stats\n\t\tState state = screen.getState();\n\t\tstatsLabel.setText(\"XP: \" + state.getXp() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Level: \" + state.getLevel() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Title: \" + state.getTitle() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Popularity: \" + state.getPopularity() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Year \" + state.getDate()[0] + \" Month \" + state.getDate()[1] + \" Day \" + state.getDate()[2] + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Hour: \" + state.getHour() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Energy: \" + state.getEnergy() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Current Funds: \" + state.getMoney() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Money Earned: \" + state.getEarned_money() + \"\\n\" + \"\\n\" +\n\t\t \t\t\"Money Spent: \" + state.getSpent_money());\n\t}", "public void alterState(SimulationState currentState) {\r\n int size = states.size();\r\n states.removeIf(state -> state.getFrameNumber() >= currentState.getFrameNumber());\r\n alteredStates.removeIf(num -> num >= currentState.getFrameNumber());\r\n alteredStates.add(currentState.getFrameNumber());\r\n states.add(currentState.getFrameNumber(), currentState);\r\n for (int i = states.size(); i < size; i++) {\r\n nextState();\r\n }\r\n }", "public NewTransitionRecord(int from, int to, double r, int t) {\r\n fromstate = from;\r\n tostate = to;\r\n rate = r;\r\n transition = t;\r\n }", "private void processStatesAnimation() {\n if(getState() == JUMPING_STATE || getState() == FALLING_STATE) {\n if(getDirection() == DIRECTION_RIGHT)\n setAnim(jumpingRight);\n else if(getDirection() == DIRECTION_LEFT)\n setAnim(jumpingLeft);\n }\n\n if(getState() == NORMAL_STATE) {\n if(getDirection() == DIRECTION_STOPPED_RIGHT)\n setAnim(standingRight);\n else if(getDirection() == DIRECTION_STOPPED_LEFT)\n setAnim(standingLeft);\n else if(getDirection() == DIRECTION_RIGHT)\n setAnim(walkingRight);\n else if(getDirection() == DIRECTION_LEFT)\n setAnim(walkingLeft);\n }\n\n if(getState() == DYING_STATE) \n setAnim(dying);\n }", "public void readyToGoAnimation() {\n TranslateTransition arrive = new TranslateTransition(Duration.millis(1200), controlsBox);\n arrive.setInterpolator(new ElasticInterpolator(EasingMode.EASE_OUT, 1, 2));\n arrive.setToY(0.0);\n FadeTransition reveal = new FadeTransition(Duration.millis(1200), addressControl);\n reveal.setToValue(1.0);\n ParallelTransition group = new ParallelTransition(arrive, reveal);\n group.setDelay(NotificationBarPane.ANIM_OUT_DURATION);\n group.setCycleCount(1);\n group.play();\n }", "public void act() \r\n {\r\n if (startTime > 0) {\r\n startTime--;\r\n }\r\n else {\r\n if (isScared()) {\r\n doScareMode();\r\n }\r\n else {\r\n if (counter == 0 || !canMove(currDirectionStr)) {\r\n counter = CELL_SIZE * 4;\r\n prevDirection = currDirection;\r\n do {\r\n currDirection = (int)(Math.random() * 10);\r\n if (currDirection == 0) {\r\n currDirectionStr = \"up\";\r\n }\r\n else if (currDirection == 1) {\r\n currDirectionStr = \"left\";\r\n }\r\n else if (currDirection == 2) {\r\n currDirectionStr = \"down\";\r\n }\r\n else if (currDirection == 3) {\r\n currDirectionStr = \"right\";\r\n }\r\n } while (!canMove(currDirectionStr));\r\n }\r\n \r\n if (canMove(currDirectionStr)) {\r\n move(currDirectionStr);\r\n }\r\n counter--;\r\n } \r\n }\r\n }", "@Override\r\n public void changeState(final S state) {\r\n if (this.animations.containsKey(state)) {\r\n this.animations.get(state).run();\r\n }\r\n }", "public final void mo61177g() {\n C6726a.m20843a(new Runnable() {\n public final void run() {\n C33086b.this.mo84807a(true);\n }\n }, VETransitionFilterParam.TransitionDuration_DEFAULT);\n }", "private ScanState switchState(ScanState desired,EnumSet<ScanState> allowed) {\n final ScanState old;\n final long timestamp;\n final long sequence;\n synchronized(this) {\n old = state;\n if (!allowed.contains(state))\n throw new IllegalStateException(state.toString());\n state = desired;\n timestamp = System.currentTimeMillis();\n sequence = getNextSeqNumber();\n }\n LOG.fine(\"switched state: \"+old+\" -> \"+desired);\n if (old != desired)\n queueStateChangedNotification(sequence,timestamp,old,desired);\n return old;\n }", "public void arrive() {\r\n\t\tif (creature.getxMove() == 0 && creature.getyMove() == 0){\r\n\t\t\tarriveTimer += System.currentTimeMillis() - lastMoveTimer;\r\n\t\t\tlastMoveTimer = System.currentTimeMillis();\r\n\t\t\tif(arriveTimer < arriveCooldown)\r\n\t\t\t\treturn;\r\n\t\t\tindex++;\r\n\t\t\tif (index > checkpoints.size()){\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void setState(State state) \n\t\t{ current = new PuzzleState(state.getString(state.getState()),\n\t\t\t\t\t\t\t\t\tstate.getString(state.getGoalState())); \n\t\t}", "public void nextAction(){\n\t\tif (this.currentAction == this.onAction){\n\t\t\tthis.currentAction = this.offAction;\n\t\t\tthis.currentAction = this.currentAction.next();\n\t\t\tthis.lastOffDelay = this.currentAction.getCurrentLapsTime();\n\t\t}else{\n\t\t\tthis.currentAction = this.onAction;\n\t\t\tthis.currentAction = this.currentAction.next();\n\t\t\tthis.currentAction.spendTime(this.lastOffDelay);\n\t\t}\n\t}", "public void checkState() {\r\n\t\tout.println(state);\r\n\t\tif(getEnergy() < 80 && getOthers() > 5) {\r\n\t\t\tstate = 1;\r\n\t\t\tturnLeft(getHeading() % 90);\r\n\t\t\tahead(moveAmount);\r\n\t\t}\r\n\t\telse if(getEnergy() < 80 && getOthers() < 5) {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\t\r\n\t}", "public void gotoState(@Nonnull ConnectivityState newState) {\n Preconditions.checkNotNull(newState, \"newState\");\n if (this.state != newState && this.state != ConnectivityState.SHUTDOWN) {\n this.state = newState;\n if (!this.listeners.isEmpty()) {\n ArrayList<Listener> savedListeners = this.listeners;\n this.listeners = new ArrayList<>();\n Iterator<Listener> it = savedListeners.iterator();\n while (it.hasNext()) {\n it.next().runInExecutor();\n }\n }\n }\n }", "@Override\n public void render() {\n float deltaTime = Math.min(Gdx.graphics.getDeltaTime(), 1.0f / 60.0f);\n\n // no ongoing transition\n if (currScreen != null) {\n currScreen.render(deltaTime);\n }\n }" ]
[ "0.71607286", "0.6367681", "0.63076764", "0.6292581", "0.6207107", "0.61732084", "0.6097855", "0.6077221", "0.60631627", "0.6017925", "0.5990135", "0.5967842", "0.596605", "0.5960558", "0.59508777", "0.5946569", "0.59371084", "0.59130037", "0.5909891", "0.58598393", "0.5829869", "0.58132505", "0.58113873", "0.57941467", "0.57885116", "0.57745504", "0.57623124", "0.5743111", "0.5718049", "0.57124764", "0.5707935", "0.5696691", "0.5678839", "0.5678657", "0.56604797", "0.56564176", "0.5627746", "0.5610622", "0.55993533", "0.55945295", "0.5563732", "0.556225", "0.55427605", "0.553903", "0.55329156", "0.55167615", "0.5511075", "0.5506962", "0.5500964", "0.54959404", "0.5487589", "0.54635525", "0.54613996", "0.54586124", "0.5455677", "0.54472667", "0.54415834", "0.5438735", "0.5438735", "0.5434413", "0.54270506", "0.54191273", "0.5414581", "0.54030454", "0.5400814", "0.5385363", "0.53828865", "0.5380769", "0.5379435", "0.53786945", "0.53760904", "0.5367366", "0.5335855", "0.53294516", "0.532842", "0.5326756", "0.53261983", "0.5324203", "0.5323566", "0.53191525", "0.5314423", "0.5307669", "0.53066283", "0.5304606", "0.52989006", "0.5293196", "0.5288954", "0.5288538", "0.52848977", "0.52827966", "0.5281131", "0.52804863", "0.52746147", "0.52730554", "0.52675307", "0.5264904", "0.5263497", "0.5262779", "0.5256515", "0.5251459" ]
0.6920059
1
If a key of interest is pressed, record that it is down.
@Override public void keyPressed(KeyEvent e) { if ((e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_A) && ship != null) { turnLeft = 1; } if ((e.getKeyCode() == KeyEvent.VK_RIGHT || e.getKeyCode() == KeyEvent.VK_D) && ship != null) { turnRight = 1; } if ((e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_W) && ship != null) { accelerate = 1; } if ((e.getKeyCode() == KeyEvent.VK_SPACE || e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_S) && ship != null) { shoot = 1; if (shoot == 1 && ship != null && pstate.countBullets() < BULLET_LIMIT) { placeBullet(ship.getXNose(), ship.getYNose()); } if (clipShoot.isOpen()) { clipShoot.start(); } if (!(clipShoot.isActive())) { /* * clip.stop(); clip.flush(); */ clipShoot.setFramePosition(0); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void keyReleased() {\n if (key == 'z' || key == 'Z') shoot = false;\n if (keyCode == UP) up = false;\n if (keyCode == DOWN) down = false;\n if (keyCode == LEFT) left = false;\n if (keyCode == RIGHT) right = false;\n}", "@Override\r\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\t\t\t\tint key = e.getKeyCode();\r\n\t\t\t\tif(key == KeyEvent.VK_UP)\r\n\t\t\t\t\tisPress01 = false;\r\n\r\n\t\t\t\tif(key == KeyEvent.VK_DOWN)\r\n\t\t\t\t\tisPress02 = false;\r\n\r\n\t\t\t\tif(key == KeyEvent.VK_LEFT)\r\n\t\t\t\t\tisPress03 = false;\r\n\r\n\t\t\t\tif(key == KeyEvent.VK_RIGHT)\r\n\t\t\t\t\tisPress04 = false;\r\n\t\t\t}", "@Override\n public boolean keyDown(int key) {\n if (!keyCodes.containsKey(key)) {\n return false;\n }\n pressed.put(key, keyCodes.get(key));\n return true;\n }", "public void setKeyReleased(int keyCode){\n this.keys[keyCode] = false;\n\n }", "@Override\r\n\tpublic void keyReleased(final KeyEvent keyEvent) {\n\t\tint key = keyEvent.getKeyCode();\r\n\t\tif (key == KeyEvent.VK_Z)\r\n\t\t\tup = false;\r\n\t\tif (key == KeyEvent.VK_D) {\r\n\t\t\tright = false;\r\n\t\t\torderSprint = \"0000\";//if D is released then the sprint is over\r\n\t\t}\r\n\t\tif (key == KeyEvent.VK_S)\r\n\t\t\tdown = false;\r\n\t\tif (key == KeyEvent.VK_Q) {\r\n\t\t\tleft = false;\r\n\t\t\torderSprint = \"0000\"; //if Q is released then the sprint is over\r\n\t\t}\r\n\t\tif (key == KeyEvent.VK_SPACE)\r\n\t\t\torderJump = \"0000\";\r\n\t\tif (key == KeyEvent.VK_B)\r\n\t\t\torderFire = \"0000\";\r\n\t}", "@Override\n public void keyReleased(KeyEvent e) {\n\n keyPressed[e.getKeyCode()] = false;\n\n updateFlags();\n\n }", "boolean onKeyPressed(KeyEvent event);", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\tif(e.getKeyCode()-65>=0&&e.getKeyCode()-65<=25) {\n\t\t\tk1.pressed(e.getKeyCode()-65, false);\n\t\t\tk2.pressed(-1, false);\n\t\t\tif(keyDown==e.getKeyCode()-65) {\n\t\t\t\tkeyDown = -1;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tint key = e.getKeyCode();\r\n\t\t\t\tif(key == KeyEvent.VK_UP)\r\n\t\t\t\t\tisPress01 = true;\r\n\r\n\t\t\t\tif(key == KeyEvent.VK_DOWN)\r\n\t\t\t\t\tisPress02 = true;\r\n\r\n\t\t\t\tif(key == KeyEvent.VK_LEFT)\r\n\t\t\t\t\tisPress03 = true;\r\n\r\n\t\t\t\tif(key == KeyEvent.VK_RIGHT)\r\n\t\t\t\t\tisPress04 = true;\r\n\t\t\t\t\r\n\t\t\t}", "public void keyPressed() { \n\t\twantsFrameBreak = true;\n\t\t//key = e.getKeyChar();\n\t\tkeyPressed = true;\n\t\tif (System.nanoTime() - acted > .033e9f) {\n\t\t\t_keyPressed();\n\t\t}\n\t}", "public void keyReleased (KeyEvent e)\r\n {\r\n \tkeyPressed = false;\r\n \tkeyReleased = true;\r\n \tkey = 0;\r\n }", "protected void keyPressedImpl()\n {\n if (key == 'g') {\n trigger = true;\n triggerCount = 1;\n }\n else if (key == 'h') {\n trigger = !trigger;\n }\n }", "public void keyUp(int keycode){\n this.heldKeys[keycode+1] = -1;\n }", "public void keyReleased(KeyEvent e) {}", "public void keyReleased(KeyEvent e) {}", "public void keyReleased(KeyEvent e) {}", "@DebugLog\n private void keyDownUp(int keyEventCode) {\n getCurrentInputConnection().sendKeyEvent(\n new KeyEvent(KeyEvent.ACTION_DOWN, keyEventCode));\n getCurrentInputConnection().sendKeyEvent(\n new KeyEvent(KeyEvent.ACTION_UP, keyEventCode));\n }", "public boolean keyPressed(KeyEvent e);", "public void keyReleased() {\t\t\r\n \t\t\r\n \t\tkeys[keyCode] = false;\r\n \t}", "public void keyReleased (KeyEvent e){}", "@Override\r\n public void keyPressed (KeyEvent e) {\n if (myLastKeyPressed == e.getKeyCode()) {\r\n myLastKeyPressed = NO_KEY_PRESSED;\r\n }\r\n else {\r\n myLastKeyPressed = e.getKeyCode();\r\n }\r\n myKeys.add(e.getKeyCode());\r\n }", "public void keyReleased(KeyEvent e) \r\n {\r\n \tkeyUser = 0;\r\n }", "@Override\n public void keyPressed(KeyEvent e) {\n keyPressed[e.getKeyCode()] = true;\n updateFlags();\n }", "public static boolean isDown(char key) {\n\t\treturn keyNames.contains(key);\n\t}", "public void keyPressed() {\r\n \t\tkeys[keyCode] = true;\r\n \t}", "public void keyReleased(KeyEvent e){}", "public void keyReleased(KeyEvent ke){}", "public void keyPressed(int key) {\n\t\tif(key==GameSystem.DOWN){\n\t\t\tif(dSelected==DEATH.RESTART){\n\t\t\t\tdSelected=DEATH.BACKTOMENU;\n\t\t\t}\n\t\t}\n\t\telse if(key==GameSystem.UP){\n\t\t\tif(dSelected==DEATH.BACKTOMENU){\n\t\t\t\tdSelected=DEATH.RESTART;\n\t\t\t}\t\n\t\t}\n\t\telse if(key==GameSystem.CONFIRM){\n\t\t\tif(dSelected==DEATH.BACKTOMENU){\n\t\t\t\tGameSystem.TWO_PLAYER_MODE=false;\n\t\t\t\tGameSystem.PLAYER_ONE_CHOSEN=false;\n\t\t\t\tMenu.backToMenu();\n\t\t\t}\n\t\t\telse if(dSelected==DEATH.RESTART){\n\t\t\t\tMenu.toGameMode();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\tif(e.getKeyCode() == e.VK_UP){\n\t\t\tkeys[0] = false;\n\t\t} else if(e.getKeyCode() == e.VK_DOWN){\n\t\t\tkeys[1] = false;\n\t\t}else if(e.getKeyCode() == e.VK_RIGHT){\n\t\t\tkeys[2] = false;\n\t\t}else if(e.getKeyCode() == e.VK_LEFT){\n\t\t\tkeys[3] = false;\n\t\t}\n\t}", "public void keyDown(int keycode){\n this.heldKeys[keycode+1] = 0;\n this.showCursor = true;\n this.frameCount = 0;\n //Keys that should only be pressed once\n if(keycode == Input.Keys.ENTER){\n if(this.enterText != null) {\n this.enterText.action(this.sOut.toString());\n }\n this.sOut = new StringBuilder();\n this.curPos = 0;\n }\n }", "public void setKeyAimDown(KeyCode aimDown) {\n this.aimDown = aimDown;\n }", "public void keyPressed( KeyEvent e ) { }", "public void keyPressed(KeyEvent e) {\n if (e.getKeyCode() == KeyEvent.VK_RIGHT) {\n right = true;\n }\n if (e.getKeyCode() == KeyEvent.VK_LEFT) {\n left = true;\n }\n if (e.getKeyCode() == KeyEvent.VK_UP) {\n up = true;\n }\n if (e.getKeyCode() == KeyEvent.VK_DOWN) {\n down = true;\n }\n // space bar = shoot\n if (e.getKeyCode() == KeyEvent.VK_SPACE) {\n spacebar = true;\n }\n // key 3 = Grenade Launcher\n if (e.getKeyCode() == KeyEvent.VK_3){\n if (SwitchCount > 50) {\n if (three == false){\n ship.counter = 75;\n three = true;\n two = false;\n one = false;\n }\n SwitchCount = 0;\n }\n }\n // key 2 = Energy Blaster\n if (e.getKeyCode() == KeyEvent.VK_2){\n if (SwitchCount > 50) {\n if (two == false){\n ship.counter = 175;\n three = false;\n two = true;\n one = false;\n }\n SwitchCount = 0;\n }\n }\n // key 1 = Bullets\n if (e.getKeyCode() == KeyEvent.VK_1){\n if (SwitchCount > 50) {\n if (one == false){\n ship.counter = 75;\n three = false;\n two = false;\n one = true;\n }\n SwitchCount = 0;\n }\n }\n }", "public void keyPressed(KeyEvent e) {}", "public void keyPressed() {\n\t\tif(key == CODED) {\n\t\t\tif(keyCode == RIGHT) {\n\t\t\t\tc.jumpP1();\n\t\t\t}\n\t\t\tif(keyCode == LEFT) {\n\t\t\t\tc.jumpP2();\n\t\t\t}\n\t\t}\n\t}", "public void keyPressed(KeyEvent e) {\r\n int key = e.getKeyCode();\r\n \r\n if(key == KeyEvent.VK_UP) {\r\n direction = UP;\r\n } else if(key == KeyEvent.VK_DOWN) {\r\n direction = DOWN;\r\n }\r\n }", "public void keyPressed(KeyEvent arg0) {\n\t\tif (arg0.getKeyCode() == 90)\n\t\t\tUp = true;\n\t\tif (arg0.getKeyCode() == 81)\n\t\t\tLeft = true;\n\t\tif (arg0.getKeyCode() == 83)\n\t\t\tDown = true;\n\t\tif (arg0.getKeyCode() == 68)\n\t\t\tRight = true;\n\t}", "void pressKey(int key) {\n \n if (key == KeyEvent.VK_UP) {\n holdingUp = true;\n }\n if (key == KeyEvent.VK_LEFT) {\n holdingLeft = true;\n }\n if (key == KeyEvent.VK_RIGHT) {\n holdingRight = true;\n }\n if (key == KeyEvent.VK_SPACE) {\n holdingSpace = true;\n }\n }", "public static boolean isDown(int keyCode) {\n\t\treturn keyCodes[keyCode];\n\t}", "public void keyReleased(KeyEvent arg0) {}", "public void keyReleased(KeyEvent e)\n {\n \n }", "public boolean keyDown (Event e, int key) \n\t{ \n\t\tif (numClicks == 1)\n\t\t{\n\t\t\t// user presses left cursor key. It only does something if the\n\t\t\t//hSpeed of the PaperAirplane is greater than -5, preventing the\n\t\t\t//PaperAirplane from turning excessively (and going upwards).\n\t\t\tif (key == Event.LEFT && p.getHSpeed () > -5)\n\t\t\t{ \n\t\t\t\tp.turnLeft ();\t//Uses the method turnLeft () in the\n\t\t\t\t\t\t\t\t//PaperAirplane class, which decreases the value\n\t\t\t\t\t\t\t\t//of hSpeed by 1.\n\t\t\t}\n\t\t\t// user presses right cursor key. It only does something if the\n\t\t\t//hSpeed of the PaperAirplane is greater than 5, preventing the\n\t\t\t//PaperAirplane from turning excessively (and going upwards). \n\t\t\telse if (key == Event.RIGHT && p.getHSpeed () < 5)\n\t\t\t{ \n\t\t\t\tp.turnRight ();\t//Uses the method turnRight () in the\n\t\t\t\t\t\t\t\t//PaperAirplane class, which increases the value\n\t\t\t\t\t\t\t\t//of hSpeed by 1.\n\t\t\t}\n\t\t\t//user presses any other key.\n\t\t\telse\n\t\t\t{ \n\t\t\t\t//Pressing any other key causes the method to print out the\n\t\t\t\t//key value of your key (so that it may possibly be used in\n\t\t\t\t//future coding). \n\t\t\t\tSystem.out.println (\"Charakter: \" + (char)key + \" Integer Value: \" + key);\n\t\t\n\t\t\t}\n\t\t}\n\t\treturn true;\t//Is just here to make the method work.\n\t}", "@Override\r\n public void keyReleased(KeyEvent e) {\r\n switchKey(e.getKeyCode(), false);\r\n }", "@Override\n\t\t\tpublic boolean keyDown(int keycode) {\n\t\t\t\treturn false;\n\t\t\t}", "void keyPressed() {\n if (key == 'w') {\n up = true;\n }\n if (key == 's') {\n down = true;\n }\n if (key == 'a') {\n left = true;\n\n }\n if (key == 'd') {\n right = true;\n\n }\n \n if (key == 27) {\n pause = !pause;\n }\n\n // player.turnToDir(0);\n}", "void keyPressed(int keyCode);", "@Override\r\n //used the keyPressed event \r\n public void keyPressed(KeyEvent e) {\n int key = e.getKeyCode();\r\n //If statements works if the key pressed && opposite direction from what it is travelling in \r\n //can't Double back ,should be game over so to avoid it we use the !(not) variable \r\n if ((key == KeyEvent.VK_LEFT) && (!right)) {\r\n left = true;\r\n up = false;\r\n down = false;\r\n }\r\n if ((key == KeyEvent.VK_RIGHT) && (!left)) {\r\n right = true;\r\n up = false;\r\n down = false;\r\n }\r\n if ((key == KeyEvent.VK_UP) && (!down)) {\r\n up= true;\r\n right = false;\r\n left = false;\r\n }\r\n if ((key == KeyEvent.VK_DOWN) && (!up)) {\r\n down= true;\r\n right = false;\r\n left = false;\r\n }\r\n }", "@Override\n\t\t\tpublic boolean onKeyDown (int keycode) {\n\t\t\t\treturn false;\n\t\t\t}", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n\n Log.d(TAG, \"onKeyDown called\");\n Log.v(TAG, event.toString());\n if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {\n FlipOperation.Get().flipperNext();\n return true;\n } else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {\n FlipOperation.Get().flipperPrev();\n return true;\n } else if (keyCode == KeyEvent.KEYCODE_POWER) {\n // Do something here...\n event.startTracking(); // Needed to track long presses\n return true;\n }\n return false;\n }", "public native void onKeyDown( KeyEvent event, long time, int keyCode, int metaState, int unicodeChar, int repeatCount );", "public void keyPressed() {\n\t ackEvent();\n if (key == ' ') {\n pauseTic = !pauseTic;\n EventQueue.getInstance().togglePause();\n }\n if (key == '.') {\n EventQueue.getInstance().beginEvents();\n } else if (key == '\\n') {\n if (pauseTic) { //only let this run if the display is paused\n StringManager.getInstance().ticAllOneCycle();\n }\n }else KeyMap.getInstance().run(key);\n }", "@Override\r\n public void keyReleased(KeyEvent e) {\n keys[e.getKeyCode()] = false;\r\n // if(e.getKeyCode()==KeyEvent.VK_SPACE)\r\n // System.out.println(\"libero\");\r\n }", "@Override\n public void keyReleased(KeyEvent e) {\n\n switch (KeyEvent.getKeyText(e.getKeyCode())) {\n case \"W\":\n wKeyPressed = false;\n break;\n case \"A\":\n aKeyPressed = false;\n break;\n case \"S\":\n sKeyPressed = false;\n break;\n case \"D\":\n dKeyPressed = false;\n break;\n case \"Space\":\n ApplicationStatus.getInstance().setApplicationRunning(!ApplicationStatus.getInstance().isApplicationRunning());\n break;\n case \"F1\":\n ApplicationStatus.getInstance().setStatus(ApplicationStatus.Status.TRAINING);\n break;\n case \"F2\":\n ApplicationStatus.getInstance().setStatus(ApplicationStatus.Status.TESTING);\n break;\n }\n }", "@Override\r\n\tpublic void keyReleased(KeyEvent key) {\r\n\t\t// Invoke method if the key is released. \r\n\t\t// Do nothing, not all three methods need to be used. \r\n\t}", "public void keyReleased(KeyEvent e){\r\n // if A or D released\r\n if (e.getKeyCode() == KeyEvent.VK_A || e.getKeyCode() == KeyEvent.VK_D){\r\n xa = 0;\r\n } \r\n }", "public void keyPressed (KeyEvent e)\r\n {\r\n \tkeyPressed = true;\r\n \tkeyReleased = false;\r\n \tkey = e.getKeyCode();\r\n }", "@Override\n public void keyReleased(KeyEvent e){\n // determine the key\n int key = e.getKeyCode();\n // figure out which key\n if(key == KeyEvent.VK_RIGHT){\n right1 = false;\n }else if(key == KeyEvent.VK_LEFT){\n left1 = false;\n }else if(key == KeyEvent.VK_UP){\n down1 = false;\n }else if(key == KeyEvent.VK_DOWN){\n up1 = false;\n }else if(key == KeyEvent.VK_E){\n dagger1 = false;\n }else if(key == KeyEvent.VK_F){\n grenade1 = false;\n }\n \n \n \n // PLAYER 2\n if(key == KeyEvent.VK_D){\n right2 = false;\n }else if(key == KeyEvent.VK_A){\n left2 = false;\n }else if(key == KeyEvent.VK_W){\n down2 = false;\n }else if(key == KeyEvent.VK_S){\n up2 = false;\n }else if(key == KeyEvent.VK_SHIFT){\n dagger2 = false;\n }else if(key == KeyEvent.VK_CONTROL){\n grenade2 = false;\n }\n }", "@Override\r\n\tpublic boolean onKeyDown(int arg0, KeyEvent arg1) {\n\t\treturn false;\r\n\t}", "@Override\n public void LongPressCb(int key) {\n String keyCode = \"\";\n if (key == 1) {\n keyCode = \"Up\";\n } else if (key == 2) {\n keyCode = \"Down\";\n callBack.down();\n }\n Toast.makeText(getBaseContext(), \"LongPressCb\", 0).show();\n LogFile.writeFile(\"Long Pressed Volume Button: \" + keyCode);\n }", "public void keyPressed(KeyEvent e) \n { \t \t\t \t\n \tif (e.getKeyCode() == KeyEvent.VK_RIGHT)\n \t{\n \t\tRIGHT=true;\n \t}\n \tif (e.getKeyCode() == KeyEvent.VK_LEFT)\n \t{\n \t\tLEFT=true;\n \t}\t \t\n }", "@Override\r\n\tpublic void keyPressed() {\n\t\tl.key();\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\tcdx = 0;\r\n\t}", "void keyPressed(int keycode);", "public static boolean isKeyPressed(int key) {\r\n\t\treturn keysDown.containsKey(key);\r\n\t}", "public void keyPressed(KeyEvent e) {\n System.out.println(\"keyPressed\");\n }", "public void keyReleased(KeyEvent e) \n {\t \t\t \t\n \tif (e.getKeyCode() == KeyEvent.VK_RIGHT)\n \t{\n \t\tRIGHT=false;\n \t}\n \tif (e.getKeyCode() == KeyEvent.VK_LEFT)\n \t{\n \t\tLEFT=false;\n \t}\t \t \n }", "public void keyReleased(KeyEvent e)\n\t\t{\n\t\t\tint keyCode = e.getKeyCode();\n\t\t\t\n\t\t switch( keyCode ) \n\t\t { \n\t\t\t case KeyEvent.VK_UP:\t \tup = false;\t\tbreak;\n\t\t case KeyEvent.VK_LEFT:\t \tleft = false;\t\tbreak;\n\t\t case KeyEvent.VK_RIGHT : \tright = false;\t\tbreak;\n\t\t case KeyEvent.VK_SPACE: \tcraft.fire();\t\tbreak;\n\t\t case KeyEvent.VK_R: \t\tresetGame();\t\tbreak;\n\t\t default: \t\t\t\t \t\t\t\t\t\treturn;\n\t\t }\n\t\t\t \n\t\t}", "public void keyReleased(KeyEvent e) {\r\n\t\t// left arrow\r\n\t\tif (e.getKeyCode() == 37 || e.getKeyCode() == 65) {\r\n\t\t\tleft = false;\r\n\t\t\tif (right) {\r\n\t\t\t\tlastPressed = 1;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// up arrow\r\n\t\tif (e.getKeyCode() == 38 || e.getKeyCode() == 87) {\r\n\r\n\t\t}\r\n\t\t// right arrow\r\n\t\tif (e.getKeyCode() == 39 || e.getKeyCode() == 68) {\r\n\t\t\tright = false;\r\n\t\t\tif (left) {\r\n\t\t\t\tlastPressed = 2;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ((e.getKeyCode() == 27) && (escapePushed)) {\r\n\t\t\tescapePushed = false;\r\n\t\t}\r\n\t}", "boolean _keyReleased(KeyEvent ev) {\n\t\treturn false;\n\t}", "public void keyReleased() {\r\n if (key == '1')\r\n drawMode = 1;\r\n if (key == '2')\r\n drawMode = 2;\r\n if (key == '3')\r\n drawMode = 3;\r\n if (key == '4')\r\n drawMode = 4;\r\n if (key == '5')\r\n drawMode = 5;\r\n }", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\tSystem.out.println(\"keyReleased\");\n\t}", "public void keyReleased(KeyEvent e)\n {\n \t//System.out.println(\"Key Released!\");\n }", "public boolean isKeyDown(int keyCode){\n return keys[keyCode];\n }", "@Override\n public void VolumeButtonReleaseCb(int key) {\n String keyCode = \"\";\n//\t\tif (key == 1) {\n//\t\t\tkeyCode = \"Up\";\n//\t\t} else if(key == 2) {\n//\t\t\tkeyCode = \"Down\";\n//\t\t}\n if (callBack != null) {\n\n callBack.up();\n }\n\n LogFile.writeFile(\"Released Volume Button: \" + keyCode);\n }", "public static boolean isDownOnce(int keyCode) {\n\t\tif(keyCodes[keyCode]) {\n\t\t\tkeyCodes[keyCode] = false;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\tpublic void keyReleased(int k) {\n\n\t}", "public void keyPressed(KeyEvent e) {\n\t\tdepl(e);\n\t}", "@Override\r\n public void keyReleased(KeyEvent e)\r\n {\n }", "@Override\r\n public void keyReleased(KeyEvent e) {\r\n // set false to every key released\r\n keys[e.getKeyCode()] = false;\r\n\r\n }", "@Override\r\n public void keyPressed(KeyEvent e) {\r\n switch(e.getKeyCode()) {\r\n case KeyEvent.VK_UP:\r\n System.out.println(\"Go up\");\r\n this.setRotation(this.getRotation() + 3);\r\n break;\r\n case KeyEvent.VK_DOWN:\r\n System.out.println(\"Go down\");\r\n this.setRotation(this.getRotation() - 3);\r\n break;\r\n\r\n case KeyEvent.VK_SPACE:\r\n \tif(up) {\r\n \t\tthis.setPosition(this.getPosition().getX(), this.getPosition().getY()+1.6f);\r\n \t\tup = false;\r\n \t}\r\n \telse {\r\n \t\t\r\n \t//\tthis.die ++;\r\n \t\tif(checkStatus()) {\r\n \t\t\tthis.setPosition(this.getPosition().getX(), this.getPosition().getY()-1.6f);\r\n \t\t\tup = true;\r\n \t\t}\r\n \t\telse {\r\n \t\t\tthis.setPosition(this.getPosition().getX(), this.getPosition().getY()-3.5f);\r\n \t\t\tthis.die = -1;\r\n \t\t\tSystem.out.println(\"Game over\");\r\n \t\t}\r\n \t}\r\n break;\r\n case KeyEvent.VK_ENTER:\r\n \tif(die == -2) {\r\n \t\tdie = 0;\r\n \t\tbreak;\r\n \t}\r\n }\r\n\r\n }", "public void keyReleased(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "public void keyReleased(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic boolean keyUp(int keycode) {\n\t\t\t\treturn false;\n\t\t\t}", "@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean keyDown(int keycode) {\n\t\treturn false;\n\t}", "@Override\n public boolean keyUp(int key) {\n if (!pressed.containsKey(key)) {\n return false;\n }\n pressed.remove(key);\n return true;\n }", "boolean isDown(int code);", "@Override\n public boolean onKeyDown( int keyCode, KeyEvent event )\n {\n super.onKeyDown( keyCode, event );\n onKeyDown( event, event.getEventTime(), event.getKeyCode(), event.getMetaState(), event.getUnicodeChar(), event.getRepeatCount() );\n return true;\n }", "@Override\r\n public void keyReleased(KeyEvent e) {\n }", "public void keyReleased(KeyEvent e) {\n if (e.getKeyCode() == KeyEvent.VK_RIGHT) {\n right = false;\n }\n if (e.getKeyCode() == KeyEvent.VK_LEFT) {\n left = false;\n }\n if (e.getKeyCode() == KeyEvent.VK_UP) {\n up = false;\n }\n if (e.getKeyCode() == KeyEvent.VK_DOWN) {\n down = false;\n }\n if (e.getKeyCode() == KeyEvent.VK_SPACE) {\n spacebar = false;\n }\n }", "public void keyPressed(KeyEvent e) { }", "@Override\r\n\tpublic void keyReleased(int key, char c)\r\n\t{\n\t\t\r\n\t}", "@Override\n public void keyReleased(KeyEvent ke) {\n switch (ke.getKeyCode()) {\n case KeyEvent.VK_UP:\n upKey = false;\n break;\n case KeyEvent.VK_RIGHT:\n rightKey = false;\n break;\n case KeyEvent.VK_DOWN:\n downKey = false;\n break;\n case KeyEvent.VK_LEFT:\n leftKey = false;\n break;\n case KeyEvent.VK_ENTER:\n enterKey = false;\n break;\n case KeyEvent.VK_W:\n wKey = false;\n break;\n case KeyEvent.VK_D:\n dKey = false;\n break;\n case KeyEvent.VK_S:\n sKey = false;\n break;\n case KeyEvent.VK_A:\n aKey = false;\n break;\n case KeyEvent.VK_F:\n fKey = false;\n break;\n }\n }", "public void keyPressed(KeyEvent e)\n\t\t{\n\t\t\tint keyCode = e.getKeyCode();\n\t\t\t\n\t\t switch( keyCode ) \n\t\t { \n\t\t case KeyEvent.VK_UP:\t \tup = true;\tbreak;\n\t\t case KeyEvent.VK_LEFT:\t \tleft = true;\tbreak;\n\t\t case KeyEvent.VK_RIGHT : \tright = true;\tbreak;\n\t\t default: \t\t\t\t \t\t\t\t\treturn;\n\t\t \n\t\t }\n }", "@Override\n\tpublic void keyReleased(KeyEvent e) { \n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\tif(e.getKeyCode() == e.VK_UP){\n\t\t\tkeys[0] = true;\n\t\t} else if(e.getKeyCode() == e.VK_DOWN){\n\t\t\tkeys[1] = true;\n\t\t}else if(e.getKeyCode() == e.VK_RIGHT){\n\t\t\tkeys[2] = true;\n\t\t}else if(e.getKeyCode() == e.VK_LEFT){\n\t\t\tkeys[3] = true;\n\t\t}\n\n\n\t}", "public void down() {\n \t\t\ttmpkeylisteners.clear();\n \t\t\ttmpkeylisteners.addAll(keylisteners);\n \t\t\tfor (KeyListener l : tmpkeylisteners) {\n \t\t\t\tif (l instanceof Level && ((Level)l) != Shadow.level) {\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tif (l instanceof GameObject && ((GameObject)l).layer.level != Shadow.level) {\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tl.keyDown(this);\n \t\t\t}\n \t\t}" ]
[ "0.72101384", "0.71781343", "0.7112719", "0.69513214", "0.6911567", "0.6868635", "0.6851349", "0.6851089", "0.68128556", "0.6804702", "0.6781248", "0.677281", "0.67586863", "0.67465585", "0.67465585", "0.67465585", "0.67463565", "0.67294157", "0.6723746", "0.6719532", "0.67082655", "0.6699298", "0.66969275", "0.6676974", "0.66746455", "0.6668869", "0.66490006", "0.6643505", "0.66150784", "0.6599496", "0.65881366", "0.65836126", "0.65801287", "0.65785617", "0.65690875", "0.6561106", "0.65581137", "0.655222", "0.6548237", "0.65456694", "0.6543046", "0.653633", "0.65163046", "0.6508732", "0.65015036", "0.64997", "0.6499468", "0.64984924", "0.6496602", "0.6492361", "0.6489723", "0.64854723", "0.648126", "0.64679503", "0.6463306", "0.6461241", "0.64571947", "0.6457112", "0.6455599", "0.64546895", "0.64532393", "0.6440349", "0.6438992", "0.64383525", "0.6437885", "0.6437449", "0.64345443", "0.6431572", "0.6429237", "0.64254814", "0.64249945", "0.6421843", "0.64212066", "0.641917", "0.6415103", "0.6407608", "0.6405265", "0.640241", "0.64000773", "0.63943976", "0.6389732", "0.6389732", "0.63881445", "0.6385984", "0.6385984", "0.6385984", "0.6385984", "0.6385984", "0.6385984", "0.6384505", "0.6380381", "0.63801146", "0.6378645", "0.63736236", "0.63732654", "0.6371796", "0.6371492", "0.6370548", "0.6369413", "0.6369374", "0.6366716" ]
0.0
-1
When the key of interest is released, record that it has been released
@Override public void keyReleased(KeyEvent e) { if ((e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_A)) { turnLeft = 0; } if ((e.getKeyCode() == KeyEvent.VK_RIGHT || e.getKeyCode() == KeyEvent.VK_D)) { turnRight = 0; } if ((e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_W)) { accelerate = 0; flame = false; clipFire.stop(); } if ((e.getKeyCode() == KeyEvent.VK_SPACE || e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_S)) { shoot = 0; try { clipShoot.stop(); } catch (NullPointerException f) { } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void keyReleased(RWTVirtualKey key) {\n\r\n }", "@Override\n\tpublic void keyReleased(int k) {\n\n\t}", "public void keyReleased(KeyEvent e) \r\n {\r\n \tkeyUser = 0;\r\n }", "@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n \t\t\tpublic void keyReleased(KeyEvent arg0) {\n \t\t\t\t\n \t\t\t}", "@Override\n\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t}", "@Override\n\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0)\n\t\t\t{\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\r\n\t\t\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0)\n\t{\n\t\t\n\t}", "@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}", "void releaseWriteLock(E key);", "public void keyReleased() {\t\t\r\n \t\t\r\n \t\tkeys[keyCode] = false;\r\n \t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\tSystem.out.println(\"keyReleased\");\n\t}", "@Override\n public void keyReleased(KeyEvent key) {\n gsm.keyReleased(key.getKeyCode());\n }", "public void keyReleased (KeyEvent arg0) {\n\t}", "@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\n\t}", "public void unlock(int key);", "public void keyReleased(KeyEvent arg0) {}", "@Override\r\n\tpublic void keyReleased(KeyEvent key) {\r\n\t\t// Invoke method if the key is released. \r\n\t\t// Do nothing, not all three methods need to be used. \r\n\t}", "@Override\n\tpublic void nativeKeyReleased(NativeKeyEvent arg0) {\n\n\t}", "public void keyReleased(KeyEvent arg0) {\n\r\n\t}", "public void removeKey() {\n \tthis.key =null;\n \tdungeon.keyLeft().set(\"Key possession: No\\n\");\n }", "@Test\n public void testKeyReleased() {\n System.out.println(\"keyReleased\");\n KeyEvent e = null; \n //instance.keyReleased(e);\n }", "@Override\r\n\tpublic void keyReleased(java.awt.event.KeyEvent arg0) {\n\t\t\r\n\t}", "public void keyReleased(KeyEvent ke) {\n\t\t}", "public void keyReleased(KeyEvent ke){}", "void keyEnd();", "public void keyReleased(KeyEvent arg0) {\n\n }", "public void keyReleased (KeyEvent e)\r\n {\r\n \tkeyPressed = false;\r\n \tkeyReleased = true;\r\n \tkey = 0;\r\n }", "public void keyReleased() {\n ticker.stop();\n }", "@Override\n public void keyReleased(KeyEvent arg0) {\n\n }", "@Override\n public void keyReleased(KeyEvent keyEvent) {\n\n b.keyReleased(keyEvent);\n }", "@Override\n\tpublic void onKeyRelease(KeyEvent e) {\n\t\t\n\t}", "public void keyReleased(KeyEvent e)\t\n\t{\n\t}", "public void keyReleased(KeyEvent arg0) {\n\t\n}", "void releaseReadLock(E key);", "@Override\n\t\t\t\t\tpublic void keyReleased(KeyEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void keyReleased(KeyEvent e) {}", "public void keyReleased(KeyEvent e) {}", "public void keyReleased(KeyEvent e) {}", "@Override\r\n public void keyReleased(KeyEvent e)\r\n {\n }", "public void keyReleased(KeyEvent e)\n {\n \t//System.out.println(\"Key Released!\");\n }", "public abstract void keyReleased(KeyReleasedEvent keyReleasedEvent);", "@Override\n\tpublic void keyReleased(KeyEvent e)\n\t\t{\n\t\t\t\n\t\t}", "public void keyReleased(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\t\n\t}" ]
[ "0.7263499", "0.7094252", "0.6696292", "0.6692753", "0.6692753", "0.6692753", "0.6692753", "0.6692753", "0.6692753", "0.6692753", "0.66344136", "0.658487", "0.658487", "0.6576311", "0.65722716", "0.6568004", "0.65130174", "0.6496063", "0.6496063", "0.6496063", "0.6496063", "0.6496063", "0.6496063", "0.6496063", "0.6496063", "0.6496063", "0.6495045", "0.6495045", "0.6495045", "0.6495045", "0.6495045", "0.6495045", "0.6495045", "0.6495045", "0.6495045", "0.6495045", "0.6493224", "0.64810336", "0.64810336", "0.64810336", "0.64810336", "0.64810336", "0.647886", "0.64780754", "0.6472945", "0.6462839", "0.6438464", "0.6437252", "0.64366955", "0.64366955", "0.64366955", "0.64366955", "0.64366955", "0.6401027", "0.639482", "0.63904214", "0.63738537", "0.6367415", "0.6356816", "0.6351902", "0.63412124", "0.6296922", "0.6295899", "0.6291648", "0.6279153", "0.6264011", "0.6263945", "0.6251363", "0.62492585", "0.6241643", "0.6239532", "0.6220689", "0.62173593", "0.62066716", "0.6203646", "0.6188669", "0.6188669", "0.6188669", "0.61747277", "0.6170001", "0.6167116", "0.61607474", "0.61566925", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553", "0.61553" ]
0.0
-1
Updates the number of lives in enhanced mode, giving the user 1 an extra life for reaching the 4000, 8000, and 12000 point thresholds.
public void updateLives() { if (enhanced == true && (numScore >= 4000 && numLiveUpdated == 0) || (numScore >= 8000 && numLiveUpdated == 1) || (numScore >= 12000 && numLiveUpdated == 2)) { lives += 1; numLiveUpdated += 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void increaseLife() {\n setChanged();\n notifyObservers(new Pair<>(\"increaseLives\", 1));\n }", "@Override\n\tpublic void update() {\n\t\tage++;\n\t\tpoints = Globals.points;\n\t}", "public void setLives(int lives){\n liveCount = lives;\n }", "void gainHealth(int points) {\n this.health += points;\n }", "public static void increaseDifficaulty() {\r\n\t\tif (Enemy._timerTicker > 5)\r\n\t\t\tEnemy._timerTicker -= 2;\r\n\t\tif (Player._timerTicker < 100)\r\n\t\t\tPlayer._timerTicker += 2;\r\n\t}", "public void onLivingUpdate()\n {\n this.updateArmSwingProgress();\n float var1 = this.getBrightness(1.0F);\n\n if (var1 > 0.5F)\n {\n this.entityAge += 2;\n }\n\n super.onLivingUpdate();\n }", "public void train() {\r\n\t\texp += 2;\r\n\t\tenergy -= 5;\r\n\t\tSystem.out.println(\"Gained 2 experience.\");\t\r\n\t}", "public static void adjustScoreIncrement() {\n\t\tint extraPoints = 0;\n\t\tif (!Snake.warpWallOn) {\n\t\t\textraPoints++;\n\t\t}\n\t\tif (Block.blocksOn) {\n\t\t\textraPoints++;\n\t\t}\n\t\tif (Snake.snakeGrowsQuickly) {\n\t\t\textraPoints++;\n\t\t}\n\t\tif (Snake.snakeGrowsReallyQuickly) {\n\t\t\textraPoints+=3;\n\t\t}\n\t\t// increment equals all the bonuses, starting at a minimum of 1. This decreases if user switches to easier modes. Bigness and Fastness are reduced by 1 each here to keep the amount of increase down; it could be pumped up for a really high-scoring game\n\t\tincrement = extraPoints + SnakeGame.getBigness()-1 + SnakeGame.getFastness()-1 + Snake.snakeSize/10 ;\n\t}", "public void updateHp(double amount);", "public void setLives(int lives) {this.lives = lives;}", "public void changeIntelligence(int i) {\n \t\tif (intelligence + i < 1){\n \t\t\tintelligence = 0;\n \t\t\talive = false;\n \t\t}\n \t\tintelligence += i;\n \t}", "private void updatePreferences() {\n\n /* Update preferences of the agent */\n patientAgent.updatePreferredAllocations();\n List<AllocationState> newPreferredAllocations = patientAgent.getAllocationStates();\n preferredAllocationsIterator = patientAgent.getAllocationStates().iterator();\n currentSize = patientAgent.getAllocationStates().size();\n\n if (newPreferredAllocations.isEmpty() || iterationsWithNoImprovementCount >= maxIterationsNum) {\n /* We shut down the behaviour if there are no better appointments\n or we exceeded the possible number of non-improving algorithm iterations\n */\n isHappyWithAppointment = true;\n\n } else if (newPreferredAllocations.size() >= currentSize) {\n\n /* No improvement has been made in our algorithm */\n iterationsWithNoImprovementCount++;\n } else {\n\n /* Improved the appointment, resetting the counter */\n iterationsWithNoImprovementCount = 0;\n }\n\n\n }", "@Override\r\n\tpublic void useSkill() {\n\t\tthis.defense+=20;\r\n\t\tthis.maxHp+=(this.maxHp/2);\r\n\t\tthis.hp+=(this.hp/2);\r\n\t\tthis.skillActive = true;\r\n\t\tthis.skillLast = 2;\r\n\t}", "public void setLives(int lives) {\r\n\t\tthis.lives = lives;\r\n\t}", "public void setBonusScore() {\r\n count = count+50;\r\n }", "@Override\n public void activatePowerUp() {\n myGame.getStatusDisplay().getMyProgress().updateScoreMultiplier(SCORE_MULTIPLIED_COUNTER);\n }", "public void growStats() {\r\n\t\tLIFE += increment;\r\n\t\tSTRENGTH += increment;\r\n\t}", "public void setLifepointsIncrease(int amount) {\r\n this.lifepointsIncrease = amount;\r\n }", "public void setLife(int amount){\r\n\t\tthis.life = amount;\r\n\t}", "private void updateLives() {\n\t\tlivesString.updateString(Integer.toString(lives));\n\t}", "public void addLife() {lives++;}", "public int increaseDefense () {\n return 3;\n }", "public void setExperience(int e) {\n\t\texperience += e;\n\t\twhile(experience >= getExperienceToNextLevel()) {\n\t\t\texperience -= getExperienceToNextLevel();\n\t\t\tlevel++;\n\t\t}\n\t\tMAX_LIFE+= level*100;\n\t\tlife = MAX_LIFE;\n\t}", "void setExtremeSpikeIncrease(VariableAmount increase);", "public void updateScoreEnemies(int enemiesDestroyed) {\n\t\tscore = (int) (score + (enemiesDestroyed * VALUE_ENEMY));\n\t}", "public void updateExp(int amount) {\n exp += amount;\n // todo: change the threshold function to reflect a cross and not an equality.\n if (exp % EXP_THRESHOLD == 0)\n level++;\n }", "protected void incrementAge()\n {\n age++;\n if(age > max_age) {\n setDead();\n }\n }", "private void updateAgilisaurusState() {\n this.age++;\n\n if (this.age == 30 && this.hasCapability(LifeStage.BABY)) {\n // grow up\n this.removeCapability(LifeStage.BABY);\n this.addCapability(LifeStage.ADULT);\n this.displayChar = 'D';\n }\n\n if (this.foodLevel > 0) {\n this.foodLevel--;\n }\n\n if (this.waterLevel > 0) {\n this.waterLevel--;\n }\n\n if (this.foodLevel < 30) {\n this.behaviour = new HungryBehaviour();\n }\n\n if (this.foodLevel > 50) {\n this.behaviour = new BreedBehaviour();\n }\n\n if (this.foodLevel == 0) {\n this.Starving();\n } else {\n this.starvationLevel = 0;\n }\n\n if (this.waterLevel < 30) {\n this.behaviour = new ThirstBehaviour();\n }\n\n if (this.waterLevel == 0) {\n this.Thirsting();\n } else {\n this.thirstLevel = 0;\n }\n }", "public void updateStats( ) {\r\n\t\tperseverance = owner.perseverance;\r\n\t\tobservation = owner.observation;\r\n\t\tintellect = owner.intellect;\r\n\t\tnegotiation = owner.negotiation;\r\n\t\ttact = owner.tact;\r\n\t\tstrength = owner.strength;\r\n\r\n\t\txCoord = owner.xCoord;\r\n\t\tyCoord = owner.yCoord;\r\n\r\n\t\tmaxHealth = 2400 + ( perseverance * 200 );\r\n\r\n\t\thealth = maxHealth;\r\n\r\n\t\tsetDamages( );\r\n\t}", "private void UpdateAdds() {\n Adds = (Level + CurrentHealth)/10;\n }", "private void setHealth() {\n eliteMob.setHealth(maxHealth = (maxHealth > 2000) ? 2000 : maxHealth);\n }", "public void attack() {\n energy = 2;\n redBull = 0;\n gun = 0;\n target = 1;\n // if Player is in range take off a life.\n if (CharacterTask.ghostLocation == GameWindow.playerLocation) {\n playerLives = playerLives - 1;\n System.out.println(\"Player Lives: \" + playerLives);\n }\n }", "private void setEliteMobLevel(int newLevel) {\n if (newLevel < 1)\n newLevel = 1;\n this.eliteMobLevel = newLevel;\n }", "private void updateHighScore() {\n\t\tif (pacman.getCurrentCell().getContainsFood() == true) {\n\t\t\tpacman.getCurrentCell().setContainsFood(false);\n\t\t\thighScore.update(10);\n\t\t}\n\t\tif (highScore.getScore() / 2440 == actualLevel) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(500);\n\t\t\t} catch (InterruptedException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\tinitNewLevel();\n\t\t\t++actualLevel;\n\t\t}\n\t}", "protected void setCurrentLifePoints(int life) {\n\t\tcurrentLifePoints = life;\n\t}", "public void takeLife()\n\t{\n\t\tlives --;\n\t}", "public void setLives(int l) {\r\n\t\tlives = l;\r\n\t}", "public static void experience(){\n PlayerStats.currentEXP += (12*AC + 8*totalHP);\n System.out.println(\"You gained \" +(12*AC + 8*totalHP)+ \" experience!\");\n }", "@Override\n protected int getBonusPoints() {\n return leadership + experience;\n }", "private void increaseScore() {\n this.game.getPlayers().values().forEach(ship -> {\n ship.increaseScore();\n if (ship.getScore() % 5 == 0) {\n this.asteroidsLimit++;\n }\n });\n }", "public void updateScore() {\n\t\tif (pellet.overlapsWith(avatar)) {\n\t\t\tavatar.addScore(1);\n\t\t\tpellet.removePellet(avatar.getLocation());\n\t\t\tSystem.out.println(\"collected pellet\");\n\t\t}\n\t}", "protected void gainEXP(int gain) {\n this.totalEXP += gain;\n }", "void awardPoints(){\n if (currentPoints <= 100 - POINTSGIVEN) {\n currentPoints += POINTSGIVEN;\n feedback = \"Your current rating is: \" + currentPoints + \"%\";\n }\n }", "public void setRevisedPoints(int thePoints)\r\n {\r\n points = points + thePoints;\r\n }", "public void calibrated() {\n weaponDamage = weaponDamage + 10;\r\n }", "public void updateEnergy(boolean up){\n\t\tif (up){\n\t\t\tElement el = nifty.getScreen(\"hud\").findElementByName(\"EnergyOrb\");\n\t\t\tel.startEffect(EffectEventId.onCustom);\n\t\t\tElement elfade = nifty.getScreen(\"hud\").findElementByName(\"EnergyOrbFade\");\n\t\t\telfade.startEffect(EffectEventId.onCustom,null,\"OrbChange\");\n\t\t}\n\t\telse{\n\t\t\tElement elfade = nifty.getScreen(\"hud\").findElementByName(\"EnergyOrbFade\");\n\t\t\telfade.startEffect(EffectEventId.onCustom,null,\"OrbFade\");\n\t\t\tElement el = nifty.getScreen(\"hud\").findElementByName(\"EnergyOrb\");\n\t\t\tel.startEffect(EffectEventId.onCustom);\n\t\t}\n\t}", "public void feed() {\n\t\tif (health + 20 > 100) {\n\t\t\thealth = 100;\n\t\t} else {\n\t\t\thealth += 20;\n\t\t}\n\t}", "private void graduallyChange() {\r\n\t\t\tif(governmentLegitimacy> 0.2) governmentLegitimacy -= 0.01;\r\n\t\t}", "@Override\r\n public void engage(){\r\n isEngaged = true;\r\n Reporter.report(this, Reporter.Msg.ENGAGING);\r\n }", "void increaseScore(){\n\t\t currentScore = currentScore + 10;\n\t\t com.triviagame.Trivia_Game.finalScore = currentScore;\n\t }", "public void gainExp(int exp){\r\n\t\tSystem.out.println(this.getName() + \"'s XP: \" + this.getExperiencePoints() + \" ---> \" + (this.getExperiencePoints()+exp));\r\n\t\tthis.experiencePoints += exp;\r\n\t\t\t//parameters 1 == count, 0 is being used as the xp start point to evaluate\r\n\t\t\t//the intervals in the helper method\r\n\t\tif(this.getExperiencePoints() >= calcLevel(1,0)){\r\n\r\n\t\t\tthis.levelUp();\r\n\t\t}\r\n\r\n\t}", "public void promote() {\r\n\t\tif (exp >= 20) {\r\n\t\t\tstage +=1;\r\n\t\t\texp = 0;\r\n\t\t\thp *= 2;\r\n\t\t\tenergy *= 2;\r\n\t\t\tattackPoint *= 2;\r\n\t\t\tresistancePoint *= 2;\r\n\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.printf(\"Pokemon has evolved!\\n\");\r\n\t}", "public void givePlayerLevelBonus() {\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() == PlayerType.Agent) {\n\t\t\t\tp.addScore(5 * (currentLevel-1));\n\t\t\t}\n\t\t}\n\t\tserver.updateHighscoreList();\n\t\tserver.addTextToLoggingWindow(\"Server gives all players level bonus\");\n\t}", "public void enableSmartImprovement() { this.exec = this.exec.withProperty(\"sm.improve\", true); }", "void setMaxActiveAltitude(double maxActiveAltitude);", "public void addPoints(int earnedPoints) {score = score + earnedPoints;}", "public void upgradeStats()\n {\n reload-=1;\n damage*=2;\n range+=50;\n }", "public void enableSurvivialMode()\n\t{\n\t\tthis.player.useFlyingMode = false;\n\t\tthis.player.setHealth(100f);\n\t}", "private void updateLives(List<Integer> prevLives, boolean lifeLost) {\n lives = new ArrayList<Integer>();\n for (int i = 0; i < numAlive; i++) {\n lives.add(prevLives.get(i));\n }\n \n if (lifeLost) {\n int winnerIndex = trickInfo.getHighestPlayPlayer();\n int winnerPrevLives = lives.get(winnerIndex);\n lives.set(winnerIndex, winnerPrevLives - 1);\n if (winnerPrevLives == 1) {\n numAlive--;\n }\n }\n }", "public void enableFlyingMode()\n\t{\n\t\tthis.player.useFlyingMode = true;\n\t\tif(this.player.healthIn < 100)\n\t\t{\n\t\t\tthis.player.healthIn = 100;\n\t\t}\n\t}", "public void eat(int newEnergy)\n {\n if(energy+newEnergy > maxEnergy)\n {\n newEnergy = maxEnergy - energy;\n }\n\n energy += newEnergy;\n animalHungry = false;\n //no bo zwierzaczek juz nie jest glodny\n }", "private void adjustPlayerLifeLevel(int curPlayerRow, int curPlayerCol){\n gameBoard[curPlayerRow][curPlayerCol].updateLifePoints(PLAYER_POINTS_DEC);\n }", "public void loseLife() {\n\t\tfor (int i = 0; i < game.e.preds.size(); i++) {\n\t\t\tif (game.e.preds.get(i).hitPred(this) > 0) {\n\t\t\t\tlife -= 1;\n\t\t\t\tlifeTime = game.getTime();\n\t\t\t\tRandom rand = new Random();\n\n\t\t\t\tword = rand.nextInt(10) + 1;\n\t\t\t\tif (game.e.preds.get(i).hitPred(this) == 1) {\n\t\t\t\t\tyPos -= 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = true;\n\t\t\t\t\thitLeft = false;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 2){\n\t\t\t\t\tyPos += 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = false;\n\t\t\t\t\thitLeft = false;\n\t\t\t\t\thitDown = true;\n\t\t\t\t} \n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 5) {\n\t\t\t\t\tyPos -= 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = true;\n\t\t\t\t\thitLeft = false;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 3) {\n\t\t\t\t\txPos += 60;\n\t\t\t\t\thitRight = true;\n\t\t\t\t\thitUp = false;\n\t\t\t\t\thitLeft = false;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 4){\n\t\t\t\t\txPos -= 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = false;\n\t\t\t\t\thitLeft = true;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 6) {\n\t\t\t\t\txPos -= 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = false;\n\t\t\t\t\thitLeft = true;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void gainExpHonors(int exp){\r\n\t\tSystem.out.println(this.getName() + \"'s XP: \" + this.getExperiencePoints() + \" ---> \" + (this.getExperiencePoints()+exp));\r\n\r\n\t\t//this.experiencePoints += exp;\r\n\t\t\t//parameters 1 == count, 0 is being used as the xp start point to evaluate\r\n\t\t\t//the intervals in the helper method\r\n\t\twhile(exp >= calcLevel(1,0)){\r\n\t\t\t//System.out.println(calcLevel(1,0));\r\n\t\t\tthis.experiencePoints = calcLevel(1,0);\r\n\t\t\t//System.out.println(this.getExperiencePoints());\r\n\t\t\tthis.levelUp();\r\n\t\t}\r\n\t\t\r\n\t\tthis.experiencePoints += (exp-this.experiencePoints);\r\n\t}", "protected synchronized void updatePoints(double points)\n\t{\n\t\tif(Config.VIT_MAX_PLAYER_LVL > _player.getLevel())\n\t\t{\n\t\t\tif(Config.VIT_CHECK_LUCKY_SKILL)\n\t\t\t{\n\t\t\t\tif(_player.getSkillLevel(LUCKY_SKILL) > 0)\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn;\n\t\t}\n\n\t\tint prevLvl = getLevel();\n\t\tint prevPoints = (int) _vitPoints;\n\n\t\tchangePoints(points);\n\t\tsendChangeMessage(prevPoints, prevLvl);\n\t}", "public void updateFeatures(BoardGame game)\r\n\t{\r\n\t \r\n\t\tdouble feat0 = 0;\r\n\t\tdouble feat1 = 0;\r\n\t\tdouble feat2 = 0;\r\n\t\t\r\n\t\tfor(State s : game.getStateList())\r\n\t\t{\r\n\t\t\tif(s.getValue() == 3)\r\n\t\t\t\tfeat0++;\r\n\t\t\tif(s.getValue() == 2)\r\n\t\t\t\tfeat1++;\r\n\t\t\tif(s.getValue() == 1)\r\n\t\t\t\tfeat2++;\r\n\t\t}\r\n\t\t\r\n\t\tfeat0 = feat0 / game.getStateList().length;\r\n\t\tfeat1 = feat1 / game.getStateList().length;\r\n\t\tfeat2 = feat2 / game.getStateList().length;\r\n\r\n\t\tif(game.gameOver() && game.getWinner().equals(this))\r\n\t\t\trewardEarned = true;\r\n\t\telse\r\n\t\t\trewardEarned = false;\r\n\r\n\t\tfeatureList[0] = feat0;\r\n\t\tfeatureList[1] = feat1;\r\n\t\tfeatureList[2] = feat2;\r\n\t}", "private void sharplyChange(){\r\n\t\t\tgovernmentLegitimacy -= 0.3;\r\n\t\t}", "public void checkScore() {\n\t\tif (this.score != 0 && this.score % 5000 == 0\n\t\t\t\t&& this.life < this.MAX_LIFE) {\n\t\t\tthis.life++;\n\t\t}\n\t}", "public void increseHitCount() {\n\r\n\t}", "public void grow() {\n if (!getIsWilted()) {\n age++;\n }\n }", "void setCurrentHP(final int newHP);", "private void updateActiveChallenge() {\n categories.get(indexOfActiveCategory).increaseIndexOfActiveChallenge();\n }", "public void addExperience(int slot, double experience) {\r\n double mod = ((slot == 0 || slot == 1 || slot == 2 || slot == 3 || slot == 4 || slot == 6 || slot == 18) ?\r\n Constants.COMBAT_EXP_MODIFIER : Constants.NON_COMBAT_EXP_MODIFIER);\r\n if (entity instanceof Player) {\r\n Player player = (Player) entity;\r\n if (player.getSavedData().getGlobalData().getExperienceModifierTime() > 0 && player.getSavedData().getGlobalData().getExperienceModifier() > 1) {\r\n mod = (mod * player.getSavedData().getGlobalData().getExperienceModifier());\r\n }\r\n }\r\n if (entity instanceof Player) {\r\n Player p = (Player) entity;\r\n p.getAntiMacroHandler().registerExperience(slot, experience);\r\n }\r\n this.experience[slot] += (experience * mod);\r\n if (this.experience[slot] > 200_000_000) {\r\n this.experience[slot] = 200_000_000;\r\n }\r\n experienceGained = experienceGained + (int) (experience * mod);\r\n int newLevel = getStaticLevelByExperience(slot);\r\n if (newLevel > staticLevels[slot]) {\r\n if (dynamicLevels[slot] < newLevel) {\r\n dynamicLevels[slot] += newLevel - staticLevels[slot];\r\n }\r\n staticLevels[slot] = newLevel;\r\n if (entity instanceof Player) {\r\n Player p = (Player) entity;\r\n if (updateCombatLevel()) {\r\n if (!p.getSavedData().getGlobalData().hasAnnouncedCombat() && p.getProperties().getCurrentCombatLevel() == Constants.MAX_COMBAT_LEVEL) {\r\n p.getSavedData().getGlobalData().setCombatAnnounced(true);\r\n p.sendGlobalNewsMessage(\"ff8c38\", \" has reached the max combat level of \" + Constants.MAX_COMBAT_LEVEL + \"!\", 5);\r\n }\r\n p.getUpdateMasks().register(new AppearanceFlag(p));\r\n }\r\n handleMilestones(p);\r\n if (getExperience(slot) == 200_000_000) {\r\n if (!p.getSavedData().getGlobalData().getExperienceMilestone(slot)) {\r\n p.getSavedData().getGlobalData().setExperienceMilestone(slot);\r\n p.sendGlobalNewsMessage(\"ff0000\", \" has just reached 200,000,000 experience in \" + TextUtils.formatDisplayName(SKILL_NAME[slot]), 6);\r\n }\r\n }\r\n LevelUp.levelUp(p, slot);\r\n }\r\n }\r\n if (entity instanceof Player) {\r\n if (entity.asPlayer().getInterfaceState().get(InterfaceConfiguration.XP_DROP_LOCK) == 0) {\r\n entity.asPlayer().getSavedData().getGlobalData().increaseXpDrops((long) (experience * mod));\r\n }\r\n PacketRepository.send(XPDrop.class, new XPDropContext((Player) entity, slot, (int) (experience * mod)));\r\n PacketRepository.send(SkillLevel.class, new SkillContext((Player) entity, slot));\r\n }\r\n }", "public void hitAlienScore() {\r\n //Add 5 to the score\r\n score += 5;\r\n System.out.println(\"Current Score = \"+score);\r\n }", "public void updateScore(){\n scoreChange++;\n if(scoreChange % 2 == 0){\n if(score_val < 999999999)\n score_val += 1;\n if(score_val > 999999999)\n score_val = 999999999;\n score.setText(\"Score:\" + String.format(\"%09d\", score_val));\n if(scoreChange == 10000)\n scoreChange = 0;\n }\n }", "public void incrementNumAttacked( ){\n this.numAttacked++;\n }", "public void update() {\n setAge(getAge() - 1);\n }", "public void increaseEnergy(int energy){\r\n\t\tthis.energy = this.energy + energy;\r\n\t}", "public void addHealthLevel(int points)\n {\n healthLevel = healthLevel + points;\n showHealthLevel();\n if (healthLevel < 0) \n {\n Greenfoot.playSound(\"game-over.wav\");\n Greenfoot.stop();\n }\n }", "public void setDecayRate(double newDecayRate ){\n\n decayRate= newDecayRate;\n}", "public static void updateAge() {\n\t\tfor (int i =0; i < data.size(); i++){\n\t\t\tdata.get(i).setAge(data.get(i).getAge()+1);\n\t\t}\n\t}", "public void update(int count){\n\t\tthis.count += count;\n\n\t\tif(this.count >= totalCount)\n\t\t\tachieved = true;\n\t}", "public void update() {\r\n\t\tdiffuse();\r\n\t\tdecay();\r\n\t}", "@Override\n protected void doUpdate(long now) {\n eyeCandy.update();\n }", "private static int gainIntelligence(int intelligence){\r\n intelligence++;\r\n System.out.println(\"You gain 1 intelligence\");\r\n return intelligence;\r\n }", "public void addExperienceNoMod(int slot, double experience) {\r\n this.experience[slot] += (experience);\r\n if (this.experience[slot] > 200_000_000) {\r\n this.experience[slot] = 200_000_000;\r\n }\r\n experienceGained = experienceGained + (int) (experience);\r\n int newLevel = getStaticLevelByExperience(slot);\r\n if (newLevel > staticLevels[slot]) {\r\n if (dynamicLevels[slot] < newLevel) {\r\n dynamicLevels[slot] += newLevel - staticLevels[slot];\r\n }\r\n if (slot == HITPOINTS) {\r\n lifepoints += newLevel - staticLevels[slot];\r\n }\r\n staticLevels[slot] = newLevel;\r\n if (entity instanceof Player) {\r\n Player p = (Player) entity;\r\n if (updateCombatLevel()) {\r\n if (!p.getSavedData().getGlobalData().hasAnnouncedCombat() && p.getProperties().getCurrentCombatLevel() == Constants.MAX_COMBAT_LEVEL) {\r\n p.getSavedData().getGlobalData().setCombatAnnounced(true);\r\n p.sendGlobalNewsMessage(\"ff8c38\", \" has reached the max combat level of \" + Constants.MAX_COMBAT_LEVEL + \"!\", 5);\r\n }\r\n p.getUpdateMasks().register(new AppearanceFlag(p));\r\n }\r\n handleMilestones(p);\r\n if (getExperience(slot) == 200_000_000) {\r\n if (!p.getSavedData().getGlobalData().getExperienceMilestone(slot)) {\r\n p.getSavedData().getGlobalData().setExperienceMilestone(slot);\r\n p.sendGlobalNewsMessage(\"ff0000\", \" has just reached 200,000,000 experience in \" + TextUtils.formatDisplayName(SKILL_NAME[slot]), 6);\r\n }\r\n }\r\n LevelUp.levelUp(p, slot);\r\n }\r\n }\r\n if (entity instanceof Player) {\r\n if (entity.asPlayer().getInterfaceState().get(InterfaceConfiguration.XP_DROP_LOCK) == 0) {\r\n entity.asPlayer().getSavedData().getGlobalData().increaseXpDrops((long) experience);\r\n }\r\n PacketRepository.send(XPDrop.class, new XPDropContext((Player) entity, slot, (int) experience));\r\n PacketRepository.send(SkillLevel.class, new SkillContext((Player) entity, slot));\r\n }\r\n }", "public void update() {\n\t\tfor(String key : actives.keys()) {\n\t\t\tActiveSound snd = actives.get(key);\n\t\t\tsnd.lifespan++;\n\t\t\tif (snd.lifespan > timeLimit) {\n\t\t\t\tcollection.add(key);\n\t\t\t\tsnd.sound.setLooping(snd.id,false); // Will eventually garbage collect\n\t\t\t\tsnd.sound.setVolume(snd.id, 0.0f); \n\t\t\t}\n\t\t}\n\t\tfor(String key : collection) {\n\t\t\tactives.remove(key);\n\t\t}\n\t\tcollection.clear();\n\t\tcurrent = 0;\n\t}", "public void setNewLoyaltyScale(int value) {\n this.newLoyaltyScale = value;\n }", "public void updatePatience(){\n Patience = Patience - 1;\n }", "private void updateDifficulty(){\n if(GameManager.getInstance().isMaxDifficulty()){\n return;\n }\n\n Difficulty currentDifficulty = GameManager.getInstance().getDifficulty();\n\n //Difficulty changes every 10 seconds\n if(totalTimePassed - (10 * currentDifficulty.getLevel()) > 0){\n int nextDifficulty = currentDifficulty.getLevel() + 1;\n String difficultyName = \"DIFFICULTY_\" + nextDifficulty;\n GameManager.getInstance().setDifficulty(Difficulty.valueOf(difficultyName));\n\n penguin.changeDifficulty(GameManager.getInstance().getDifficulty());\n score.setMultiplier(GameManager.getInstance().getDifficulty().getScoreMultiplier());\n }\n }", "public void setUpdateOften(int i){\n countNum = i;\n }", "public void update() {\r\n \t\tif(regenerateHealth && !isDead) {\r\n \t\t\tthis.health += healthRegen*1000*(\r\n \t\t\t\t\tSystem.currentTimeMillis()-lastRegTime);\r\n \t\t}\r\n \t}", "public void toilette() {\n if (!autoriseOperation()) {\n return;\n }\n incrSale(-3);\n incrHumeur(1);\n incrXp(1);\n\n setChanged();\n notifyObservers();\n }", "protected void adjustScore() {\r\n scoreMultiplier = (int) (mineField.getDensity() * 100);\r\n maxScore = scoreMultiplier * (int) Math.pow( mineField.getFieldLength(), 2.0 );\r\n }", "@Override\n public void updateEnergy(int p, Racer player) {\n\n super.updateEnergy(p, player);\n player.setEnergy(player.getEnergy() * 2);\n }", "public void changeHealthCoefficient(double delta) {\n if (this.healthCoefficient + delta < MINIMUM_HEALTH_COEFFICIENT) {\n this.healthCoefficient = MINIMUM_HEALTH_COEFFICIENT;\n this.isAlive = false;\n } else {\n this.healthCoefficient = Math.min(this.healthCoefficient + delta, MAXIMUM_HEALTH_COEFFICIENT);\n }\n }", "public void PointCount(int timeremain)\n\t{\n\n\t\tLog.e(\"Time\",\"\"+timeremain);\n\n\t\tif(timeremain<29 && timeremain>=25)\n\t\t{\n\t\t\tpoints=5;\n\t\t\ttxtpoint.setText(\"\" + points);\n\t\t\tdb.AddtoFavorite(new Pojo(allArrayQid[currentPosition], String.valueOf(points),Constant.ADD_LEVEL_IDD));\n\t\t}\n\t\telse if(timeremain<25 && timeremain>=20)\n\t\t{\n\t\t\tpoints=3;\n\t\t\ttxtpoint.setText(\"\" + points);\n\t\t\tdb.AddtoFavorite(new Pojo(allArrayQid[currentPosition], String.valueOf(points),Constant.ADD_LEVEL_IDD));\n\t\t}\n\n\t\telse if(timeremain<20 && timeremain>=1)\n\t\t{\n\t\t\tpoints=1;\n\t\t\ttxtpoint.setText(\"\" + points);\n\t\t\tdb.AddtoFavorite(new Pojo(allArrayQid[currentPosition], String.valueOf(points),Constant.ADD_LEVEL_IDD));\n\t\t}\n\t}", "public void setEatPoints(int param) {\n // setting primitive attribute tracker to true\n localEatPointsTracker = param != java.lang.Integer.MIN_VALUE;\n\n this.localEatPoints = param;\n }", "public void increaseSpeed() {\r\n\tupdateTimer.setDelay((int)Math.floor(updateTimer.getDelay()*0.95));\r\n\t\t}", "@Override\n\tpublic void handleSpecificActivity() {\n\t\tdouble expIncrease = (double) params.getParamValue(\"traineeDefaultExpIncrease\");\n\t\tint grade = this.getGrade();\n\t\t\n\t\tdouble modifier = getGradeModifier(70, grade);\n\t\texpIncrease *= modifier;\n\t\t\n\t\tthis.experience += expIncrease;\t\t\n\t}" ]
[ "0.6976118", "0.6727578", "0.6389452", "0.61888367", "0.6152126", "0.6004888", "0.5994735", "0.5989757", "0.59834206", "0.59727603", "0.5949288", "0.5914534", "0.5877704", "0.5838136", "0.58169657", "0.58115894", "0.5775172", "0.5760408", "0.5734211", "0.57257223", "0.5714115", "0.5710428", "0.5706648", "0.5703651", "0.57018244", "0.57012326", "0.5693213", "0.5679668", "0.56615955", "0.56583416", "0.5652163", "0.56515247", "0.565094", "0.56399536", "0.5617377", "0.56145644", "0.55864114", "0.5581871", "0.55809724", "0.55794436", "0.5570053", "0.5563277", "0.55376285", "0.5532246", "0.552762", "0.55266374", "0.5522913", "0.55214137", "0.5521294", "0.55202496", "0.5514341", "0.5510911", "0.54900765", "0.5482363", "0.54736996", "0.546468", "0.546146", "0.5453929", "0.5431239", "0.54270935", "0.5421066", "0.54103464", "0.54062116", "0.54034185", "0.5402377", "0.54009736", "0.540064", "0.5398532", "0.5397575", "0.53939354", "0.53935266", "0.538684", "0.5377453", "0.5377333", "0.5370448", "0.5367362", "0.53450835", "0.53393155", "0.53346926", "0.53346837", "0.5330887", "0.5324474", "0.53171444", "0.531702", "0.5314853", "0.53129786", "0.53094035", "0.53043574", "0.5298759", "0.52967453", "0.52927476", "0.52901363", "0.528919", "0.52884334", "0.52856326", "0.52856135", "0.52826995", "0.5282067", "0.52817917", "0.52756643" ]
0.7815896
0
Open and initialize the clips to be used for sounds in enhanced mode
public void initializeSounds() { try { sound a = new sound(); // Fire sound effect clipFire = a.getSound(); streamFire = a.getStream(); // Shooting sound effect clipShoot = a.getSound2(); streamShoot = a.getStream2(); // Sound when an alien is destroyed clipAlienDestroyed = a.getSoundAlienDestroyed(); streamAlienDestroyed = a.getStreamAlienDestroyed(); // Sound when a ship has been destroyed clipShip = a.getSoundShip(); streamShip = a.getStreamShip(); // Sound when an asteroid has been destroyed clipAsteroid = a.getSoundAsteroid(); streamAsteroid = a.getStreamAsteroid(); // Sound when AlienShip appears clipAlienShip = a.getClipAlienShip(); streamAlienShip = a.getStreamAlienShip(); // Open the sound clips clipFire.open(streamFire); clipShoot.open(streamShoot); clipAlienDestroyed.open(streamAlienDestroyed); clipShip.open(streamShip); clipAsteroid.open(streamAsteroid); clipAlienShip.open(streamAlienShip); } catch (NullPointerException e) { } catch (LineUnavailableException f) { } catch (UnsupportedAudioFileException f) { } catch (IOException f) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cenaSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n //URL url = this.getClass().getClassLoader().getResource(\"gameover.wav\");\n //AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39603-John_Cena_Msg_Alert_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n \n //You can change this URL to be whatever .wav file you want\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "public void foodSound(){\n if (enableSound){\r\n\t clip.play();\r\n }\r\n\t\t\r\n\t}", "private void initSounds() {\n\n\n\t}", "public void theRockSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39627-The_Rock_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "public void startSound() {\n\t\ttry {\n\t\t\t// Open an audio input stream.\n\t\t\tURL url = this.getClass().getResource(\"/\"+wavMusicFile);\n\t\t\t//System.out.println(\"url: \" + url);\n\t\t\tAudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\t\t\t// Get a sound clip resource.\n\t\t\tclip = AudioSystem.getClip();\n\t\t\t// Open audio clip and load samples from the audio input stream.\n\t\t\tclip.open(audioIn);\n\t\t\tclip.start();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void setupSounds() {\n soundSwitch = new Switch(Switch.CHILD_NONE);\n soundSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);\n\n // Set up the sound media container\n java.net.URL soundURL = null;\n String soundFile = \"res/sounds/Get_up_on_your_feet_mixdown2.wav\";\n try {\n soundURL = new java.net.URL(codeBaseString + soundFile);\n } catch (java.net.MalformedURLException ex) {\n System.out.println(ex.getMessage());\n System.exit(1);\n }\n if (soundURL == null) { // application, try file URL\n try {\n soundURL = new java.net.URL(\"file:./\" + soundFile);\n } catch (java.net.MalformedURLException ex) {\n System.out.println(ex.getMessage());\n System.exit(1);\n }\n }\n //System.out.println(\"soundURL = \" + soundURL);\n MediaContainer soundMC = new MediaContainer(soundURL);\n\n // set up the Background Sound\n soundBackground = new BackgroundSound();\n soundBackground.setCapability(Sound.ALLOW_ENABLE_WRITE);\n soundBackground.setSoundData(soundMC);\n soundBackground.setSchedulingBounds(infiniteBounds);\n soundBackground.setEnable(false);\n soundBackground.setLoop(Sound.INFINITE_LOOPS);\n soundSwitch.addChild(soundBackground);\n\n // set up the point sound\n soundPoint = new PointSound();\n soundPoint.setCapability(Sound.ALLOW_ENABLE_WRITE);\n soundPoint.setSoundData(soundMC);\n soundPoint.setSchedulingBounds(infiniteBounds);\n soundPoint.setEnable(false);\n soundPoint.setLoop(Sound.INFINITE_LOOPS);\n soundPoint.setPosition(-5.0f, 5.0f, 0.0f);\n Point2f[] distGain = new Point2f[2];\n // set the attenuation to linearly decrease volume from max at\n // source to 0 at a distance of 15m\n distGain[0] = new Point2f(0.0f, 1.0f);\n distGain[1] = new Point2f(15.0f, 0.0f);\n soundPoint.setDistanceGain(distGain);\n soundSwitch.addChild(soundPoint);\n\n // Create the chooser GUI\n String[] soundNames = { \"None\", \"Background\", \"Point\", };\n\n soundChooser = new IntChooser(\"Sound:\", soundNames);\n soundChooser.addIntListener(new IntListener() {\n public void intChanged(IntEvent event) {\n int value = event.getValue();\n // Should just be able to use setWhichChild on\n // soundSwitch, have to explictly enable/disable due to\n // bug.\n switch (value) {\n case 0:\n soundSwitch.setWhichChild(Switch.CHILD_NONE);\n soundBackground.setEnable(false);\n soundPoint.setEnable(false);\n break;\n case 1:\n soundSwitch.setWhichChild(0);\n soundBackground.setEnable(true);\n soundPoint.setEnable(false);\n break;\n case 2:\n soundSwitch.setWhichChild(1);\n soundBackground.setEnable(false);\n soundPoint.setEnable(true);\n break;\n }\n }\n });\n soundChooser.setValue(Switch.CHILD_NONE);\n\n }", "public void soundClipTest()\n {\n //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n //this.setTitle(\"Test Sound Clip\");\n //this.setSize(300, 200);\n //this.setVisible(true);\n \n try {\n // Open an audio input stream.\n URL url = this.getClass().getClassLoader().getResource(\"Silence.wav\");\n if(difficult.equals(\"YOU WILL NOT SURVIVE\")) \n url = this.getClass().getClassLoader().getResource(\"Koopa Bros.wav\"); \n else if(difficult.equals(\"HARD\"))\n url = this.getClass().getClassLoader().getResource(\"Epic One Piece.wav\");//\"Stand Up Be Strong.wav\"); \"Halo.wav\" \n else if(difficult.equals(\"MEDIUM\"))\n url = this.getClass().getClassLoader().getResource(\"Epic One Piece.wav\");\n else if(difficult.equals(\"EASY\"))\n url = this.getClass().getClassLoader().getResource(\"Bowsers Castle.wav\");\n else if(difficult.equals(\"GHOST\"))\n url = this.getClass().getClassLoader().getResource(\"Paper Mario- Crystal Palace Crawl.wav\");\n else if(difficult.equals(\"TROLL\"))\n url = this.getClass().getClassLoader().getResource(\"Troll Song.wav\"); //\"Mario Kart 64.wav\"\n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n bclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n bclip.open(audioIn);\n \n \n //try{Thread.sleep(2000);} catch(InterruptedException e) {}\n if(!mute)\n {\n bclip.start();\n //clip.loop(Clip.LOOP_CONTINUOUSLY);\n bclip.loop(Clip.LOOP_CONTINUOUSLY);\n \n }\n if(pause)\n {\n try{bclip.wait();} catch(InterruptedException e) {}\n \n URL url2 = this.getClass().getClassLoader().getResource(\"Refreshing Elevator Music.wav\");\n \n AudioInputStream audioIn2 = AudioSystem.getAudioInputStream(url2);\n // Get a sound clip resource.\n Clip pclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n pclip.open(audioIn2);\n \n if(!mute)\n pclip.start(); \n }\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n \n }", "public void play() {\n\t\ttry {\n\t\t\taudioInput = AudioSystem.getAudioInputStream(this.music);\n\t\t\tclip.open(audioInput);\n\t\t\tclip.start();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void startSound()\n \n {try\n { \n URL url = this.getClass().getClassLoader().getResource(\"Mario Kart Start 2.wav\");\n \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n startClip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n startClip.open(audioIn); \n \n startClip.start();\n \n \n } \n catch (UnsupportedAudioFileException e)\n {\n e.printStackTrace();\n } \n catch (IOException e) \n {\n e.printStackTrace();\n } \n catch (LineUnavailableException e) \n {\n e.printStackTrace();\n } \n \n }", "public void run() {\n\t\t try {\n\t\t Clip clip = AudioSystem.getClip();\n\t\t //AudioInputStream inputStream = AudioSystem.getAudioInputStream(\n\t\t //Main.class.getResourceAsStream(\"/path/to/sounds/\" + url));\n\t\t //clip.open(inputStream);\n\t\t clip.start(); \n\t\t } catch (Exception e) {\n\t\t System.err.println(e.getMessage());\n\t\t }\n\t\t }", "public void playLaneSounds(){\r\n try {\r\n File mFile = new File(Filepath5);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput6 = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip6 = AudioSystem.getClip();\r\n clip6.open(audioInput6);\r\n FloatControl gainControl6 = (FloatControl) clip6.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl6.setValue(-10.0f); //reduces the volume by 10 decibels\r\n clip6.start();\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public void run() \n {\n try\n {\n Clip clip = AudioSystem.getClip();\n AudioInputStream inputStream = AudioSystem.getAudioInputStream(getClass().getResource(sound));\n clip = AudioSystem.getClip();\n clip.open(inputStream);\n clip.start(); \n } catch (UnsupportedAudioFileException e) {\n \t\t\te.printStackTrace();\n } catch (IOException e) {\n \t\t\te.printStackTrace();\n } catch (LineUnavailableException e) {\n \t\t\te.printStackTrace();\n }\n }", "public void undertakerSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39633-Undertaker_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "public void playWinSounds(){\r\n try {\r\n File mFile = new File(Filepath3);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput4 = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip4 = AudioSystem.getClip();\r\n clip4.open(audioInput4);\r\n FloatControl gainControl4 = (FloatControl) clip4.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl4.setValue(-10.0f); //reduces the volume by 10 decibels\r\n clip4.start();\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public static void playSound(){\r\n try{\r\n Clip clip = AudioSystem.getClip();\r\n clip.open(AudioSystem.getAudioInputStream(new File(\"Cheering.wav\")));\r\n clip.start();\r\n }\r\n catch (Exception exc){\r\n exc.printStackTrace(System.out);\r\n } \r\n }", "void InitSound() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n //Use the newer SoundPool.Builder\n //Set the audio attributes, SONIFICATION is for interaction events\n //uses builder pattern\n AudioAttributes aa = new AudioAttributes.Builder()\n .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)\n .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)\n .build();\n\n //default max streams is 1\n //also uses builder pattern\n dice_sound= new SoundPool.Builder().setAudioAttributes(aa).build();\n\n } else {\n // Running on device earlier than Lollipop\n //Use the older SoundPool constructor\n dice_sound=PreLollipopSoundPool.NewSoundPool();\n }\n //Load the dice sound\n sound_id=dice_sound.load(this,R.raw.shake_dice,1);\n alarm_sound_id=dice_sound.load(this,R.raw.on_time,1);\n }", "public Sounds() {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n }", "public void bigShowSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39586-Big_Show_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "void Init(int sfxVolume, int musicVolume);", "private void setUpSound() {\n\t\tAssetManager am = getActivity().getAssets();\n\t\t// activity only stuff\n\t\tgetActivity().setVolumeControlStream(AudioManager.STREAM_MUSIC);\n\n\t\tAudioManager audioManager = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);\n\t\tsp = new SPPlayer(am, audioManager);\n\t}", "public void specialSong()\n {\n if(!mute)\n {\n try {\n \n bclip.stop();\n \n // Open an audio input stream.\n //URL url = this.getClass().getClassLoader().getResource(\"Glitzville.wav\"); \n //if(lastpowerUp.equals(\"RAINBOW\"))\n URL url = this.getClass().getClassLoader().getResource(\"Mario Kart Starman.wav\");\n \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n sclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n sclip.open(audioIn); \n \n sclip.start();\n \n \n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n } \n }\n }", "public void playDonkeySounds(){\r\n try {\r\n File mFile = new File(Filepath2);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput3 = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip3 = AudioSystem.getClip();\r\n clip3.open(audioInput3);\r\n FloatControl gainControl3 = (FloatControl) clip3.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl3.setValue(-10.0f); //reduces the volume by 10 decibels\r\n clip3.start();\r\n\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public void openAsteroidSound() {\r\n\t\tsound a;\r\n\t\ttry {\r\n\t\t\ta = new sound();\r\n\t\t\tClip asteroidSound = a.getSoundAsteroid();\r\n\t\t\tasteroidSound.open(streamAsteroid);\r\n\t\t\tif (clipAsteroid.isOpen()) {\r\n\t\t\t\tclipAsteroid.start();\r\n\t\t\t}\r\n\r\n\t\t\tif (!(clipAsteroid.isActive())) {\r\n\t\t\t\t/*\r\n\t\t\t\t * clip.stop(); clip.flush();\r\n\t\t\t\t */\r\n\t\t\t\tclipAsteroid.setFramePosition(0);\r\n\t\t\t}\r\n\t\t} catch (LineUnavailableException e) {\r\n\t\t} catch (UnsupportedAudioFileException e) {\r\n\t\t} catch (IOException e) {\r\n\t\t}\r\n\r\n\t}", "public static void Init() throws UnsupportedAudioFileException, IOException, LineUnavailableException {\n enemyHurt = new SoundEffect(\"/sounds/enemy_hurt.wav\");\n dragonShoot = new SoundEffect(\"/sounds/dragon_shoot.wav\");\n enemySpawn = new SoundEffect(\"/sounds/enemy_spawn.wav\");\n fireShoot = new SoundEffect(\"/sounds/fire_shoot.wav\");\n frostShoot = new SoundEffect(\"/sounds/frost_shoot.wav\");\n arcaneShoot = new SoundEffect(\"/sounds/arcane_shoot.wav\");\n winSFX = new SoundEffect(\"/sounds/win_sfx.wav\");\n oof = new SoundEffect(\"/sounds/oof.wav\");\n buttonPress = new SoundEffect(\"/sounds/button_press.wav\");\n }", "public CoreJavaSound() throws Exception{\n\t\tInputStream wav = CoreJavaSound.class.getResourceAsStream(\"res/dun_dun_1.wav\");\n\t\tInputStream bufferedIn = new BufferedInputStream(wav);\n\t\t\n\t\tLine.Info linfo = new Line.Info(Clip.class);\n\t\tLine line = AudioSystem.getLine(linfo);\n\t\tclip = (Clip)line;\n\t\tclip.addLineListener(this);\n\t\tAudioInputStream ais = AudioSystem.getAudioInputStream(bufferedIn);\n\t\tclip.open(ais);\n\t\t\t\t\n\t}", "public void openAlienDestroyedSound() {\r\n\t\tif (clipAlienDestroyed.isOpen()) {\r\n\t\t\tclipAlienDestroyed.start();\r\n\t\t}\r\n\r\n\t\tif (!(clipAlienDestroyed.isActive())) {\r\n\t\t\t/*\r\n\t\t\t * clip.stop(); clip.flush();\r\n\t\t\t */\r\n\t\t\tclipAlienDestroyed.setFramePosition(0);\r\n\t\t}\r\n\r\n\t}", "private SoundController() {\n\t\tsoundbank = new HashMap<String, Sound>();\n\t\tmusicbank = new HashMap<String, Music>();\n\t\tactives = new IdentityMap<String,ActiveSound>();\n\t\tcollection = new Array<String>();\n\t\tcooldown = DEFAULT_COOL;\n\t\ttimeLimit = DEFAULT_LIMIT;\n\t\tframeLimit = DEFAULT_FRAME;\n\t\tcurrent = 0;\n\t}", "public void start()\n\t{\n\t\tString name = getAudioFileName();\n\t\ttry\n\t\t{\t\t\t\n\t\t\tInputStream in = getAudioStream();\n\t\t\tAudioDevice dev = getAudioDevice();\n\t\t\tplay(in, dev);\n\t\t}\n\t\tcatch (JavaLayerException ex)\n\t\t{\n\t\t\tsynchronized (System.err)\n\t\t\t{\n\t\t\t\tSystem.err.println(\"Unable to play \"+name);\n\t\t\t\tex.printStackTrace(System.err);\n\t\t\t}\n\t\t}\n\t}", "public static void InitLoadAudioCtl() {\n LoadCurAudioVolume();\r\n // Get Current Audio Balance\r\n LoadCurAudioBalance();\r\n\r\n // Get Current Supper Bass Switch\r\n LoadCurAudioSupperBassSwitch();\r\n // Get Current Supper Bass Volume\r\n LoadCurAudioSupperBassVolume();\r\n\r\n SetAudioMainVolume();\r\n\r\n // Get Current SRSSurround\r\n LoadCurAudioSrsSurround();\r\n\r\n // Get Current SRS DialogClarity\r\n LoadCurAudioSrsDialogClarity();\r\n\r\n // Get Current SRS TruBass\r\n LoadCurAudioSrsTruBass();\r\n\r\n // Get Current Audio Sound Mode\r\n LoadCurAudioSoundMode();\r\n LoadCurAudioWallEffect();\r\n // Get Custom Audio Bass and Treble\r\n LoadCustomBassVolume();\r\n LoadCustomTrebleVolume();\r\n if (disableEQ) {\r\n SetSpecialModeBTVolume(GetCurAudioSoundMode());\r\n } else {\r\n // Load Custom EQ Gain Values\r\n LoadCustomEQGain(GetEQMinGainVal(), GetEQMaxGainVal());\r\n SetSpecialModeEQGain(GetCurAudioSoundMode());\r\n SetCurAudioBassVolume(mCurAudioBassVolume);\r\n SetCurAudioTrebleVolume(mCurAudioTrebleVolume);\r\n }\r\n\r\n // Get Current EQ mode\r\n // LoadCurAudioEQMode();\r\n // SetSpecialModeEQGain(GetCurAudioEQMode());\r\n }", "public void tripleHSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39629-Triple_H_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "static void soundsEZ() {\n\t\tapplauseSound = EZ.addSound(\"applause.wav\");\n\t\twallSound = EZ.addSound(\"stone1.wav\");\n\t\tdiamondSound = EZ.addSound(\"glass1.wav\");\n\t}", "@Override\r\n protected void playGameStartAudio() {\n\taudio.playClip();\r\n }", "public static void playSoundOOSrc(String path, boolean loop) {\r\n\t\t\r\n\t\tif (debugMode) {\r\n\t\t\tSystem.out.println(\"Try to play sound...\");\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (!debugMode) {\r\n\t\t\t AudioInputStream audioInput = AudioSystem.getAudioInputStream(new File(path));\r\n\t\t\t\tClip clip = AudioSystem.getClip();\r\n\t\t\t\t\r\n\t\t\t\t//stopAllClips();\r\n\t\t\t\tclips.add(clip);\r\n\t\t\t\tclip.open(audioInput);\r\n\t\t\t\tif (loop) {\r\n\t\t\t\t\tclip.loop(Clip.LOOP_CONTINUOUSLY);\r\n\t\t\t\t}\r\n\t\t\t\tclip.start();\r\n\t\t\t\tif (debugMode) {\r\n\t\t\t\t\tSystem.out.println(\"Successfully played sound!\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (debugMode) {\r\n\t\t\t\t\tSystem.out.println(\"Can't find sound file.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tif (debugMode) {\r\n\t\t\t\tSystem.out.println(\"Can't play sound.\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void init() {\n\n if (Gdx.app.getPreferences(\"properties\").contains(\"MasterVolume\")) {\n MasterVolume = Gdx.app.getPreferences(\"properties\").getFloat(\"MasterVolume\");\n } else {\n Gdx.app.getPreferences(\"properties\").putFloat(\"MasterVolume\", MasterVolume);\n }\n\n if (Gdx.app.getPreferences(\"properties\").contains(\"MusicVolume\")) {\n MusicVolume = Gdx.app.getPreferences(\"properties\").getFloat(\"MusicVolume\");\n } else {\n Gdx.app.getPreferences(\"properties\").putFloat(\"MusicVolume\", MusicVolume);\n }\n\n if (Gdx.app.getPreferences(\"properties\").contains(\"SoundVolume\")) {\n SoundVolume = Gdx.app.getPreferences(\"properties\").getFloat(\"SoundVolume\");\n } else {\n Gdx.app.getPreferences(\"properties\").putFloat(\"SoundVolume\", SoundVolume);\n }\n\n Gdx.app.getPreferences(\"properties\").flush();\n\n Click = Gdx.audio.newSound(Gdx.files.internal(\"Music/Sound/menu-clik.wav\"));\n\n }", "public void playLoseSounds(){\r\n try {\r\n File mFile = new File(Filepath4);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput5 = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip5 = AudioSystem.getClip();\r\n clip5.open(audioInput5);\r\n FloatControl gainControl5 = (FloatControl) clip5.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl5.setValue(-8.0f); //reduces the volume by 8 decibels\r\n clip5.start();\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "@Override\r\n \tpublic void play() {\n \t\tFile file = new File(location);\r\n \t\tlong audioFileLength = file.length();\r\n \t\tAudioInputStream audioInputStream;\r\n \t\ttry {\r\n \t\t\taudioInputStream = AudioSystem.getAudioInputStream(file);\r\n \r\n \t\t\tAudioFormat format = audioInputStream.getFormat();\r\n \r\n \t\t\tint frameSize = format.getFrameSize();\r\n \t\t\tfloat frameRate = format.getFrameRate();\r\n \t\t\tdurationInSeconds = (audioFileLength / (frameSize * frameRate));\r\n \r\n \r\n \t\t\tLine.Info linfo = new Line.Info(Clip.class);\r\n \t\t\tLine line = AudioSystem.getLine(linfo);\r\n \t\t\tclip = (Clip) line;\r\n \t\t\t//clip.addLineListener(this);\r\n \t\t\tclip.open(audioInputStream);\r\n \t\t\tclip.start();\r\n \r\n \t\t} catch (UnsupportedAudioFileException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t} catch (IOException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t} catch (LineUnavailableException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t}\t\r\n \r\n \t}", "private void playYouWinSound()\n {\n try\n {\n java.io.File soundFile = new java.io.File(\n \"C:\\\\Windows\\\\Media\\\\tada.wav\");\n javax.sound.sampled.AudioInputStream audioIn =\n javax.sound.sampled.AudioSystem.getAudioInputStream(\n soundFile);\n javax.sound.sampled.Clip clip =\n javax.sound.sampled.AudioSystem.getClip();\n\n clip.open(audioIn);\n clip.start();\n }\n catch (Exception ex)\n {\n System.out.println(ex);\n }\n }", "public SoundLoader(String path)\n {\n //inputStream = SoundLoader.class.getResourceAsStream(\"/resources/\"+path);\n inputStream = getClass().getResourceAsStream(\"/resources/\" + path);\n// inputStream =\n// ClassLoader.getSystemResourceAsStream(\"/resources/\" + path);\n\n try\n {\n BufferedInputStream buffered = new BufferedInputStream(inputStream);\n AudioInputStream audioStream =\n AudioSystem.getAudioInputStream(buffered);\n AudioFormat format = audioStream.getFormat();\n DataLine.Info info = new DataLine.Info(Clip.class, format);\n audioClip = (Clip) AudioSystem.getLine(info);\n\n audioClip.addLineListener(SoundLoader.this);\n\n audioClip.open(audioStream);\n\n }\n catch (UnsupportedAudioFileException e)\n {\n e.printStackTrace();\n }\n catch (LineUnavailableException e)\n {\n e.printStackTrace();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "public void open() throws LineUnavailableException {\n/* 301 */ synchronized (this.mixer) {\n/* */ \n/* 303 */ if (!isOpen()) {\n/* */ \n/* */ \n/* 306 */ this.mixer.open(this);\n/* */ \n/* */ try {\n/* 309 */ implOpen();\n/* */ \n/* */ \n/* 312 */ setOpen(true);\n/* 313 */ } catch (LineUnavailableException lineUnavailableException) {\n/* */ \n/* 315 */ this.mixer.close(this);\n/* 316 */ throw lineUnavailableException;\n/* */ } \n/* */ } \n/* */ } \n/* */ }", "private void reproducirAudio() {\n try{\n audioInputStream = AudioSystem.getAudioInputStream(new File(\"Sonidos/Inicio.wav\").getAbsoluteFile());\n clip = AudioSystem.getClip();\n clip.open(audioInputStream);\n clip.start();\n }\n catch (UnsupportedAudioFileException | IOException | LineUnavailableException ex){\n ex.printStackTrace();\n }\n }", "public SimpleAudioPlayer(String filePath) \r\n throws UnsupportedAudioFileException, \r\n IOException, LineUnavailableException \r\n { \r\n // create AudioInputStream object \r\n audioInputStream = \r\n AudioSystem.getAudioInputStream(new File(filePath).getAbsoluteFile()); \r\n \r\n // create clip reference \r\n clip = AudioSystem.getClip(); \r\n \r\n // open audioInputStream to the clip \r\n clip.open(audioInputStream); \r\n \r\n clip.loop(Clip.LOOP_CONTINUOUSLY); \r\n }", "@Override\r\n public void loadPianoAudioStart() {\n }", "public static void clic_sound() {\n\t\tm_player_clic.start();\n\t\tm_player_clic.setMediaTime(new Time(0));\n\t}", "public void initialise_new_game() {\n\n data.read_from_file(\"maxus2.txt\");\n\n mySound.initialise();\n\n pacman.init();\n ghost.init();\n\n score.initialise();\n }", "public static void play(String filename) {\r\n javax.sound.sampled.Clip sonido;\r\n InputStream path=load(filename);\r\n \r\n try\r\n {\r\n sonido=AudioSystem.getClip();\r\n sonido.open(AudioSystem.getAudioInputStream(new BufferedInputStream(path)));\r\n sonido.start();\r\n\r\n }catch(Exception fallo)\r\n {\r\n \r\n }\r\n }", "public void setUpSound() {\n try {\n generateTone();\n setFrequencyLabel();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "private void initAudioIn(){\n ArrayList<String> actived = new ArrayList<String>();\n ArrayList<String> mAudioInputChannels = mAudioManagerEx.getAudioDevices(AudioManagerEx.AUDIO_INPUT_TYPE);\n int i = 0;\n for(i = 0; i < mAudioInputChannels.size(); i++){\n String device = mAudioInputChannels.get(i);\n if(device.contains(\"USB\")){\n actived.add(device);\n break;\n }\n }\n //otherwise use codec by default\n if(i == mAudioInputChannels.size()){\n actived.add(AudioManagerEx.AUDIO_NAME_CODEC);\n }\n mAudioManagerEx.setAudioDeviceActive(actived, AudioManagerEx.AUDIO_INPUT_ACTIVE);\n }", "public void playSoundtrack() {\n if(this.musicEnabled) {\n try {\n Clip soundtrackClip = AudioSystem.getClip();\n AudioInputStream inputStream = AudioSystem.getAudioInputStream(new BufferedInputStream(Assets.soundTrack));\n soundtrackClip.open(inputStream);\n soundtrackClip.start();\n soundtrackClip.loop(Clip.LOOP_CONTINUOUSLY);\n } catch (Exception e) {\n e.printStackTrace();\n System.err.println(e.getMessage());\n }\n }\n }", "public void openMixerSave() {\n\n\t\ttry {\n\t\t\tFXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/SaveMixerSettings.fxml\"));\n\t\t\tfxmlLoader.setResources(bundle);\n\t\t\tParent root1 = (Parent) fxmlLoader.load();\n\t\t\tSaveMixerSettingsController smsc = fxmlLoader.getController();\n\t\t\tsmsc.setMainController(this);\n\t\t\tsmsc.getSettings(sliderPitch.getValue(), sliderEchoLength.getValue(), sliderDecay.getValue(),\n\t\t\t\t\tsliderGain.getValue(), sliderFlangerLength.getValue(), sliderWetness.getValue(),\n\t\t\t\t\tsliderLfoFrequency.getValue(), (float) sliderLowPass.getValue());\n\t\t\tStage stage = new Stage();\n\t\t\tstage.initModality(Modality.APPLICATION_MODAL);\n\t\t\t// stage.initStyle(StageStyle.UNDECORATED);\n\t\t\tstage.setTitle(bundle.getString(\"mSTitle\"));\n\t\t\tstage.setScene(new Scene(root1));\n\t\t\tstage.show();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public SoundController() {\r\n // initialize the module libraries\r\n this.initModuleLibraries();\r\n\r\n // in this moment no sonification map is defined\r\n this.sonificationMap = new HashMap<String, SonificationMap>();\r\n\r\n // in this moment we have an empty soundMap\r\n this.soundsMap = new HashMap<String, Sound>();\r\n\r\n // in this moment no type names are defined\r\n this.soundEventsTypeNameMap = new HashMap<String, String>();\r\n\r\n // create the GUI component\r\n this.tabSound = new TabSound(this);\r\n\r\n // create the sounds-events active state empty map\r\n this.soundEventActiveStateMap = new HashMap<String, Boolean>();\r\n\r\n // enable sound\r\n this.setEnabled(true);\r\n\r\n // the sound is active by default\r\n soundOn = true;\r\n\r\n // empty events queue\r\n eventQ = new ConcurrentLinkedQueue<EnvironmentEvent>();\r\n\r\n // the module thread is not running yet\r\n running = false;\r\n\r\n this.soundThread = new Thread(this);\r\n }", "public AudioController(){\n\t sounds = new LinkedList<>();\n\t removables = new LinkedList<>();\n\t availableIds = new HashSet<>();\n\t populateIds();\n\t}", "public void enableSound() {\n soundToggle = true;\n }", "public SCSoundControl(SCSoundControlNotifiable listener, String propertiesFilename) {\n\t\t_propertiesFilename = propertiesFilename;\n\t\tshowDebugOutput(false);\n\n\t\t//load properties from a file\n\t\tloadPropertiesFile(_propertiesFilename);\n\t\t\n\t\t//setup synth launcher so that scsynth properties are handled and defaults are setup as needed.\n _scsynthLauncher = new ScsynthLauncher(this, _props);\n\t\t_maxPolyphony = _scsynthLauncher.getMaxPolyphony();\n\t\t//TODO: use maxPolyphony to check before new soundNode creation...\n\t\t\n\t\t_scsclogger = new SCSCConnectionLogger();\n\n\t\t// find the minimum id of a private audio bus.\n\t\t// if certain properties are unset, use the scsynth defaults\n\t\t_inChannels = Integer.valueOf(_props.getProperty(\"SuperCollider_NumberOfInputChannels\", \"8\"));\n\t\t_outChannels = Integer.valueOf(_props.getProperty(\"SuperCollider_NumberOfOutputChannels\", \"8\"));\n\t\t_minAudioBus = _inChannels + _outChannels;\n\n\t\t_minNodeID = 2; //We're following the scsynth convention of allocating 0 as the \n\t\t\t\t\t\t//root node and 1 as the default group. The rest are up for grabs.\n\n\t\t// initialize id data structures\n\t\t_bufferMap = new ConcurrentHashMap<Integer, String>();\n\t\t_busList = new Vector<Integer>();\n\t\t_nodeIdList = new Vector<Integer>();\n\t\t_soundNodes = new ConcurrentHashMap<Integer, SoundNode>();\n\n\t\t//grab the scsynth udp port for the socket:\n\t\tint udpport = Integer.valueOf(_props.getProperty(\"SuperCollider_UDPportNumber\", \"57110\"));\n\t\t\n\t\t// open the port for sending\n\t\ttry { _sender = new OSCPortOut(InetAddress.getLocalHost(), udpport); }\n\t\tcatch (Exception e) { e.printStackTrace();}\n\n\t\t// begin by listening for messages:\n\t\ttry {\n\t\t\t_receiver = new OSCPortIn(_sender.getSocket());\n\t\t\t_receiver.addListener(\".*\", this); // receive all notify info\n\t\t\t_receiver.startListening();\n\t\t} catch (Exception e1) { e1.printStackTrace(); }\n\n\t\t//state variables\n\t\t_prevPingResponseTime = _prevPingRequestTime = new Date();\n\t\t_notifyListener = listener;\n\t\t_serverLive = false;\n\t\t_serverBooted = false;\n\t\t\t\t\n\t\t//create the GUI: the control panel\n\t\t_controlPanel = new SCSoundControlPanel();\n _controlPanel.setOpaque(true); //content panes must be opaque\n\n //TODO: maybe we don't want to create a frame, but rather hand off the panel.\n\t\t//setup a window to display the control panel\n JFrame frame = new JFrame(\"SuperColliderSoundControl\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setContentPane(_controlPanel);\n frame.pack();\n frame.setSize(400, 300);\n frame.setVisible(true);\n \n\t\t//start the server.\n\t\tbootScsynth();\n \n\t\t//start the thread that will ping scsynth\n\t\t_serverPingThread = new Thread(this);\n\t\t_serverPingThread.setPriority(Thread.MIN_PRIORITY);\n\t\t_serverPingThread.start();\n\n\t}", "@Override\n public void makeSound() {\n\n }", "@Override\n public void makeSound() {\n\n }", "private void initialize() {\n\t\t// play music\n\t\ttry (AudioInputStream audioIn = AudioSystem.getAudioInputStream(new File(\"music.wav\"))) {\n\t\t\tclip = AudioSystem.getClip();\n\t\t\t// Open audio clip and load samples from the audio input stream.\n\t\t\tclip.open(audioIn);\n\t\t\tclip.loop(LOOP_CONTINUOUSLY);\n\t\t} catch (IOException | LineUnavailableException | UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t}\n//\t\tMedia media = new Media(getClass().getResource(\"music.mp3\").toExternalForm());\n//\t\tMediaPlayer player = new MediaPlayer(media);\n//\t\tplayer.play();\n\n\t\t\n\t\tframe = new JFrame();\n\t\tframe.getLayeredPane().setLayout(null);\n\t\tframe.setIconImage(Toolkit.getDefaultToolkit().getImage(\"icon.jpg\"));\n\t\tframe.setTitle(\"\\u5403\\u9E21666\");\n\t\tframe.setBounds(100, 100, 600, 800);\n\t\tframe.setLocationRelativeTo(null);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(new CardLayout(0, 0));\n\n\t\tfinal JPanel pnlMain = new JPanel();\n\t\tframe.getContentPane().add(pnlMain, \"name_48851763736285\");\n\t\tpnlMain.setLayout(null);\n\t\tpnlMain.setVisible(true);\n\n\t\tfinal JPanel pnlDifficulty = new JPanel();\n\t\tframe.getContentPane().add(pnlDifficulty, \"name_48859887106064\");\n\t\tpnlDifficulty.setLayout(null);\n\t\tpnlDifficulty.setVisible(false);\n\n\t\tfinal JPanel pnlOption = new JPanel();\n\t\tframe.getContentPane().add(pnlOption, \"name_48861624405630\");\n\t\tpnlOption.setLayout(null);\n\t\tpnlOption.setVisible(false);\n\n\t\tfinal JPanel pnlBackgrounds = new JPanel();\n\t\tframe.getContentPane().add(pnlBackgrounds, \"name_48861624405631\");\n pnlBackgrounds.setLayout(new GridLayout(3,2));\n pnlBackgrounds.setVisible(false);\n\n\t\tJButton btnOpt = new JButton(\"Options\");\n\t\tbtnOpt.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tpnlMain.setVisible(false);\n\t\t\t\tpnlOption.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tbtnOpt.setBounds(134, 89, 97, 25);\n\t\tpnlMain.add(btnOpt);\n\n\t\tJButton btnExit = new JButton(\"Exit\");\n\t\tbtnExit.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t});\n\t\tbtnExit.setBounds(134, 150, 97, 25);\n\t\tpnlMain.add(btnExit);\n\n\t\tJButton btnDdiff = new JButton(\"Difficulty\");\n\t\tbtnDdiff.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tpnlDifficulty.setVisible(true);\n\t\t\t\tpnlMain.setVisible(false);\n\t\t\t}\n\t\t});\n\t\tbtnDdiff.setBounds(134, 38, 97, 25);\n\t\tpnlMain.add(btnDdiff);\n\n\n\t\tJButton btnHard = new JButton(\"Hard\");\n\t\tbtnHard.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t//FOR GLORIA\n\t\t\t\t//frame.dispose();\n\t\t\t\tframe.setVisible(false);\n//\t\t\t\tnew Main(\"src/board3.txt\");\n\t\t\t\ttry {\n\t\t\t\t\tnew Generator(\"Hard\");\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tnew Main(\"src/project/boards/Hard.txt\", frame);\n\t\t\t}\n\t\t});\n\t\tbtnHard.setBounds(159, 146, 97, 25);\n\t\tpnlDifficulty.add(btnHard);\n\n\t\tJButton btnMedium = new JButton(\"Normal\");\n\t\tbtnMedium.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t//FOR GLORIA\n\t\t\t\t//frame.dispose();\n\t\t\t\tframe.setVisible(false);\n//\t\t\t\tnew Main(\"src/board2.txt\");\n\t\t\t\ttry {\n\t\t\t\t\tnew Generator(\"Normal\");\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tnew Main(\"src/project/boards/Normal.txt\", frame);\n\t\t\t}\n\t\t});\n\t\tbtnMedium.setBounds(159, 91, 97, 25);\n\t\tpnlDifficulty.add(btnMedium);\n\n\t\tJButton btnEasy = new JButton(\"Easy\");\n\t\tbtnEasy.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t//FOR GLORIA\n\t\t\t\t//frame.dispose();\n\t\t\t\tframe.setVisible(false);\n\t\t\t\ttry {\n\t\t\t\t\tnew Generator(\"Easy\");\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tnew Main(\"src/project/boards/Easy.txt\", frame);\n\t\t\t}\n\t\t});\n\t\tbtnEasy.setBounds(159, 41, 97, 25);\n\t\tpnlDifficulty.add(btnEasy);\n\n\t\tJButton btnHome = new JButton(\"Home\");\n\t\tbtnHome.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tpnlDifficulty.setVisible(false);\n\t\t\t\tpnlMain.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tbtnHome.setBounds(159, 200, 97, 25);\n\t\tpnlDifficulty.add(btnHome);\n\n\t\tJButton btnMute = new JButton(\"Music off\");\n\t\tbtnMute.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (clip.isRunning()) {\n\t\t\t\t\tclip.stop();\n\t\t\t\t\tbtnMute.setText(\"Music On\");\n\t\t\t\t} else {\n\t\t\t\t\tclip.start();\n\t\t\t\t\tbtnMute.setText(\"Music Off\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tbtnMute.setBounds(152, 34, 97, 25);\n\t\tpnlOption.add(btnMute);\n\t\t\n\t\t//Zheng's bg 1 button start\n\t\tJButton btnBackground1 = new JButton();\n\t\tfinal String name1 = \"1.jpg\";\n\t\ttry {\n\t\t\tbtnBackground1.setIcon(new ImageIcon(ImageIO.read(getClass().getResource(name1)).getScaledInstance(100, 70, Image.SCALE_SMOOTH)));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tbtnBackground1.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tBoard.backgroundImage = \"1.jpg\";\n pnlBackgrounds.setVisible(false);\n pnlOption.setVisible(true);\n }\n\t\t});\n\t\tpnlBackgrounds.add(btnBackground1);\n\t\t//Zheng's bg 1 button ends\n\t\t\n\t\t\n\t\t//Zheng's bg 2 button start\n\t\tJButton btnBackground2 = new JButton();\n\t\tfinal String name2 = \"2.jpg\";\n\t\ttry {\n\t\t\tbtnBackground2.setIcon(new ImageIcon(ImageIO.read(getClass().getResource(name2)).getScaledInstance(100, 70, Image.SCALE_SMOOTH)));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tbtnBackground2.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tBoard.backgroundImage = \"2.jpg\";\n pnlBackgrounds.setVisible(false);\n pnlOption.setVisible(true);\n }\n\t\t});\n\t\tpnlBackgrounds.add(btnBackground2);\n\t\t//Zheng's bg 2 button ends\n\n\t\t//Zheng's bg 3 button start\n\t\tJButton btnBackground3 = new JButton();\n\t\tfinal String name3 = \"3.jpg\";\n\t\ttry {\n\t\t\tbtnBackground3.setIcon(new ImageIcon(ImageIO.read(getClass().getResource(name3)).getScaledInstance(100, 70, Image.SCALE_SMOOTH)));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tbtnBackground3.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tBoard.backgroundImage = \"3.jpg\";\n pnlBackgrounds.setVisible(false);\n pnlOption.setVisible(true);\n }\n\t\t});\n\t\tpnlBackgrounds.add(btnBackground3);\n\t\t//Zheng's bg 3 button ends\n\t\t\n\t\t//Zheng's bg 3 button start\n\t\tJButton btnBackground4 = new JButton();\n\t\tfinal String name4 = \"4.jpg\";\n\t\ttry {\n\t\t\tbtnBackground4.setIcon(new ImageIcon(ImageIO.read(getClass().getResource(name4)).getScaledInstance(100, 70, Image.SCALE_SMOOTH)));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tbtnBackground4.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tBoard.backgroundImage = \"4.jpg\";\n pnlBackgrounds.setVisible(false);\n pnlOption.setVisible(true);\n }\n\t\t});\n\t\tpnlBackgrounds.add(btnBackground4);\n\t\t//Zheng's bg 3 button ends\n\t\t\n\n\n\t\tJButton btnHome_3 = new JButton(\"Back\");\n\t\tbtnHome_3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tpnlBackgrounds.setVisible(false);\n\t\t\t\tpnlOption.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tpnlBackgrounds.add(btnHome_3); \n\t\t\n\n\t\tJButton btnOption2 = new JButton(\"Background\");\n\t\tbtnOption2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tpnlOption.setVisible(false);\n\t\t\t\tpnlBackgrounds.setVisible(true);\n\t\t\t}\n\t\t});\n\n\t\tbtnOption2.setBounds(152, 80, 97, 25);\n\t\tpnlOption.add(btnOption2);\n\n\t\tJButton btnHome_1 = new JButton(\"Home\");\n\t\tbtnHome_1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tpnlOption.setVisible(false);\n\t\t\t\tpnlMain.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tbtnHome_1.setBounds(152, 140, 97, 25);\n\t\tpnlOption.add(btnHome_1);\n\t}", "public void diskAddedsound()\n {\n InputStream pathSoundFile = getClass().getResourceAsStream(\"diskplacement.wav\");\n playSound(pathSoundFile);\n }", "public void start() {\n ToneControl control = null;\n try {\n myPlayer = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);\n // do the preliminary set-up:\n myPlayer.realize();\n // set a listener to listen for the end of the tune:\n myPlayer.addPlayerListener(this);\n // get the ToneControl object in order to set the tune data:\n control = (ToneControl) myPlayer.getControl(\"ToneControl\");\n control.setSequence(myTune);\n // set the volume to the highest possible volume:\n VolumeControl vc = (VolumeControl) myPlayer\n .getControl(\"VolumeControl\");\n vc.setLevel(100);\n } catch (Exception e) {\n // the music isn't necessary, so we ignore exceptions.\n }\n }", "public void setSoundClip(String strURL) {\n socSound = new SoundClip(strURL);\n }", "public void initMusic() {\r\n mSoundPool = new SoundPool(3, AudioManager.STREAM_MUSIC, 0);\r\n mSoundClick = mSoundPool.load(getActivity(), R.raw.click, 1);\r\n mSoundCorrect = mSoundPool.load(getActivity(), R.raw.correct, 1);\r\n mSoundIncorrect = mSoundPool.load(getActivity(), R.raw.wrong, 1);\r\n }", "public static void loadAudio()\n\t{\n\t\ttry\n\t\t{\n\t\t\tmusic = Applet.newAudioClip(new URL(\"file:\" + System.getProperty(\"user.dir\") + \"/sound/Pamgaea.wav\"));\n\t\t\tlaser = Applet.newAudioClip(new URL(\"file:\" + System.getProperty(\"user.dir\") + \"/sound/laser.wav\"));\n\t\t\tlaserContinuous = Applet.newAudioClip(new URL(\"file:\" + System.getProperty(\"user.dir\") + \"/sound/laser_continuous.wav\"));\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void startShower(){\n Log.d(LOGTAG,\"Shower is on.\");\n playSound();\n\n\n }", "public void setSoundClipId(int clip){\n \tthis.soundClipId = clip;\n }", "public static void enableSound() {\n\t\tvelocity = 127;\n\t}", "public GameSoundPlayer() {\r\n mainThemeSoundPlayer = new SoundPlayer(\"src/main/resources/sounds/menu.mp3\", 0.7, -1);\r\n newGameThemeSoundPlayer = new SoundPlayer(\"src/main/resources/sounds/newMenu.mp3\", 1, 1);\r\n\r\n playBack1 = new SoundPlayer(\"src/main/resources/sounds/play1.mp3\", 1, -1);\r\n playBack2 = new SoundPlayer(\"src/main/resources/sounds/play2.mp3\", 1, -1);\r\n playBack3 = new SoundPlayer(\"src/main/resources/sounds/play3.mp3\", 1, -1);\r\n playBack4 = new SoundPlayer(\"src/main/resources/sounds/play4.mp3\", 1, -1);\r\n playBack5 = new SoundPlayer(\"src/main/resources/sounds/play5.mp3\", 1, -1);\r\n endGame = new SoundPlayer(\"src/main/resources/sounds/endGame.mp3\", 1, 1);\r\n\r\n for (BONUSES_SOUNDS sound : BONUSES_SOUNDS.values()) {\r\n switch (sound) {\r\n case ALLDIE:\r\n allDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case EXTRASPEED:\r\n extraSpeedPlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case MAKESLOWER:\r\n makeSlowerPlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONUSFIRE:\r\n bonusFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONUSJUMP:\r\n bonusJumpPlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONUSJUMPSTART:\r\n jumpStartPlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n }\r\n }\r\n for (FIRE_SOUNDS sound : FIRE_SOUNDS.values()) {\r\n switch (sound) {\r\n case DARK:\r\n darkFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case FENIX:\r\n fenixFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONE:\r\n boneFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case GHOST:\r\n ghostFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case ARCHANGEL:\r\n archFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BEHEMOTH:\r\n begemFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case CHAMPION:\r\n champFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case PEGASUS:\r\n pegasFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case THUNDERBIRD:\r\n thunderFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case TROGLODYTE:\r\n troglFirePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n }\r\n }\r\n for (DIE_SOUNDS sound : DIE_SOUNDS.values()) {\r\n switch (sound) {\r\n case DARK:\r\n darkDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case FENIX:\r\n fenixDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BONE:\r\n boneDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case GHOST:\r\n ghostDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case ARCHANGEL:\r\n archDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case BEHEMOTH:\r\n begemDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case CHAMPION:\r\n champDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case PEGASUS:\r\n pegasDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case THUNDERBIRD:\r\n thunderDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n case TROGLODYTE:\r\n troglDiePlayer = new SoundPlayer(sound.getUrl(), sound.getVolume(), sound.getCycleCount());\r\n break;\r\n }\r\n }\r\n }", "static void PlaySound(File Sound)\n {\n try{\n Clip clip = AudioSystem.getClip();\n clip.open(AudioSystem.getAudioInputStream(Sound));\n clip.start();\n //BGM = new AudioStream(new FileInputStream(\"OST.WAV\"));\n //MD = BGM.getData();\n //loop = new ContinuousAudioDataStream(MD);\n }catch(Exception e) {}\n //MGP.start(loop); \n }", "@Override\r\n\tpublic void setup(){\n\t\tmidiIO = CCMidiIO.getInstance();\r\n\t\tmidiIO.printDevices();\r\n\r\n\t\t// print a list with all available devices\r\n\t\tmidiIO.printDevices();\r\n\r\n\t\t// open an midiout using the first device and the first channel\r\n\t\tmidiOut = midiIO.midiOut(0, 1);\r\n\r\n\t\tbowl = new Bowl[10];\r\n\t\tfor (int i = 0; i < bowl.length; i++){\r\n\t\t\tbowl[i] = new Bowl(i);\r\n\t\t}\r\n\t}", "public MainScreen() {\r\n\t\tthis.playSound(\"assets/audios/1.wav\");\r\n\t}", "private void init() {\n if (!isInitiated) {\n //Voices use by freeTTS, we define where they are, currently in the java en_us.jar\n //add the package\n addToSystemesPropetites(this.configurator.getLocation());\n\n // The VoiceManager manages all the voices for FreeTTS.\n voiceManager = VoiceManager.getInstance();\n\n this.defaultVoice = voiceManager.getVoice(this.configurator.getName());\n\n configureVoice(this.defaultVoice);\n\n // Allocates the resources for the voice.\n this.defaultVoice.allocate();\n isInitiated = true;\n }\n }", "private void playSound(String sound) {\r\n try {\r\n BufferedInputStream soundFileStream = new BufferedInputStream(this\r\n .getClass().getResourceAsStream(sound));\r\n AudioInputStream audioInputStream = AudioSystem\r\n .getAudioInputStream(soundFileStream);\r\n AudioFormat audioFormat = audioInputStream.getFormat();\r\n DataLine.Info dataLineInfo = new DataLine.Info(Clip.class, audioFormat);\r\n Clip clip = (Clip) AudioSystem.getLine(dataLineInfo);\r\n clip.open(audioInputStream);\r\n clip.start();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void initCapes() {}", "@Override\n\tpublic void start() {\n\t\t\n\t\t_mode.init();\n\t\t\n\t\t_mode.start();\n\t}", "public AudioPlayer() {\n\t\tselectMixer(0);\n\n\t\tcreateListenerOnCondition(onFinishRunnables, (event) -> \n\t\t\tevent.getType() == LineEvent.Type.STOP && getRemainingTime() <= 0.0 && !isRepeating\n\t\t);\n\t\tcreateListenerOnCondition(onEndRunnables, (event) -> \n\t\t\tevent.getType() == LineEvent.Type.STOP && getRemainingTime() <= 0.0\n\t\t);\n\t\tcreateListenerOnCondition(onLoadRunnables, (event) -> \n\t\t\tevent.getType() == LineEvent.Type.OPEN\n\t\t);\n\t\tcreateListenerOnCondition(onPlayRunnables, (event) -> \n\t\t\tevent.getType() == LineEvent.Type.START\n\t\t);\n\t}", "public void start() {\n AudioPlayer.player.start(cas);\n playing = true;\n }", "public void continueSound() {\n\t\tclip.start();\n\t}", "public CNAlarmSoundCfgExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public static void AlertaSimples(File file) {\n try {\n Clip clip = AudioSystem.getClip();\n clip.open(AudioSystem.getAudioInputStream(file));\n clip.start();\n \n \n } catch (Exception e) {\n \n \n }\n }", "public static void openPCSCR() {\r\n if (enaComp == null || enaSpec == null) {\r\n PCNMClientStart.switchPanels(new PCSCR());\r\n return;\r\n }\r\n ArrayList<String>compList = new ArrayList<String>();\r\n ArrayList<String>specList = new ArrayList<String>();\r\n for (Component cmp : enaComp)\r\n compList.add(cmp.toString());\r\n for (PCSpec spec : enaSpec)\r\n specList.add(spec.toString());\r\n PCNMClientStart.switchPanels(new PCSCR(compList, specList));\r\n }", "public void keepLooping() {\n\t\tif(!clip.isActive()) {\n\t\t\tstartSound();\n\t\t}\n\t}", "public static void loadSounds()\n {\n combust = new SoundLoader(\"explosion.wav\");\n zWalk = new SoundLoader(\"zWalk.wav\");\n bite = new SoundLoader(\"zBite.wav\");\n hitObst = new SoundLoader(\"zHitObst.wav\");\n runSound = new SoundLoader(\"pRunSound.wav\");\n walkSound = new SoundLoader(\"pWalkSound.wav\");\n scream = new SoundLoader(\"pScream.wav\");\n\n zWalk.makeBalanceControlled();\n hitObst.makeBalanceControlled();\n\n }", "private void initPlayMode() {\n initPlayModeView();\n initPlayModeController();\n }", "public void init() {\n startMenuActionListener = new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n if (e.getActionCommand().equals(\"START\")) {\n startMenu = false;\n LevelIntermission = true;\n LevelIntermissionCount = 0;\n reset();\n requestFocusInWindow();\n }\n else if (e.getActionCommand().equals(\"EXIT\")){\n System.exit(0);\n }\n }\n };\n \n // Activating the Key Listener to listen to the applet\n this.addKeyListener(this);\n startButton = new Button(\"START\");\n exitButton = new Button(\"EXIT\");\n startButton.addActionListener(startMenuActionListener);\n exitButton.addActionListener(startMenuActionListener);\n startMenu = true;\n LevelIntermission = false;\n \n // default weapon is bullets\n one = true;\n two = false;\n three = false;\n \n // Setteing the length and width of the User Imterface\n backgroundX = 1200;\n backgroundY = 650;\n this.setSize(backgroundX, backgroundY);\n \n // Creating backround image\n offScreen = createImage(backgroundX, backgroundY);\n offG = offScreen.getGraphics();\n \n // Starting the timer - 50 frames a seconds\n timer = new Timer(20, this);\n }", "protected void implOpen() throws LineUnavailableException {\n/* 161 */ this.id = nOpen(getMixerIndex());\n/* */ }", "private SoundClip createStream(String audioFilename){\n SoundClip audio = null;\n try {\n // IDE\n //AudioInputStream ais = AudioSystem.getAudioInputStream(new File(audioFilename).getAbsoluteFile());\n // JAR\n AudioInputStream ais = AudioSystem.getAudioInputStream(ClassLoader.getSystemResource(audioFilename));\n DataLine.Info info = new DataLine.Info(Clip.class, ais.getFormat());\n Clip c = (Clip) AudioSystem.getLine(info);\n audio = new SoundClip(null,c,ais);\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return audio;\n }", "public void reloadSoundDevices();", "void player(){\n InputStream in; ////apabila merah -> ALT+ENTER ->input stream ->TOP\n try { ////try {}catch(Exception e){}\n in = new FileInputStream(new File(vpath.getText()));\n AudioStream audios = new AudioStream(in);\n AudioPlayer.player.start(audios);\n } catch (Exception e) {\n e.printStackTrace();\n } \n }", "@Override\n public void initialize() {\n //talonOrchestra.playMusic();\n }", "public SoundEffects(String soundPath)\n\t{\n\t\ttry \n\t\t{\n\t\t\tFile url = new File(soundPath);\n\t\t\tthis.audioIn = AudioSystem.getAudioInputStream(url);\n\t\t\tthis.clip = AudioSystem.getClip();\n\t\t\tthis.clip.open(audioIn);\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void StartSound(ISoundOrigin origin, int sound_id);", "public static void play(String filename) {\n\t\ttry {\n\t\t\tClip clip = AudioSystem.getClip();\n\t\t\tclip.open(AudioSystem.getAudioInputStream(new File(filename)));\n\t\t\tclip.start();\n\t\t} catch (Exception exc) {\n\t\t\texc.printStackTrace(System.out);\n\t\t}\n\t}", "public void start(){\n\t\tif (host.getGameSettings().isMusicOn()) {\r\n\t\t\tspr_btnMute.setFrame(0);\r\n\t\t}else{\r\n\t\t\tspr_btnMute.setFrame(1);\r\n\t\t}\r\n\t}", "public interface IDoomSound {\n\n\tclass channel_t{\n\n\t\t // sound information (if null, channel avail.)\n\t\t sfxinfo_t\tsfxinfo;\n\n\t\t // origin of sound\n\t\t ISoundOrigin\torigin;\n\n\t\t // handle of the sound being played\n\t\t int\t\thandle;\n\t\t\t}\n\t\n\t/** Convenience hack */\n\tpublic static final int NUMSFX=sfxenum_t.NUMSFX.ordinal();\n\t\n\t// Purpose?\n\tpublic static final char snd_prefixen[]\n\t = { 'P', 'P', 'A', 'S', 'S', 'S', 'M', 'M', 'M', 'S', 'S', 'S' };\n\n\tpublic static final int S_MAX_VOLUME=127;\n\n\t// when to clip out sounds\n\t// Does not fit the large outdoor areas.\n\tpublic static final int S_CLIPPING_DIST\t=\t(1200*0x10000);\n\n\t// Distance tp origin when sounds should be maxed out.\n\t// This should relate to movement clipping resolution\n\t// (see BLOCKMAP handling).\n\t// Originally: (200*0x10000).\n\tpublic static final int S_CLOSE_DIST\t=(160*0x10000);\n\n\tpublic static final int S_ATTENUATOR\t=((S_CLIPPING_DIST-S_CLOSE_DIST)>>m.fixed_t.FRACBITS);\n\n\t// Adjustable by menu.\n\t//protected final int NORM_VOLUME \t\tsnd_MaxVolume\n\n\tpublic static final int NORM_PITCH = \t\t128;\n\tpublic final static int NORM_PRIORITY\t=\t64;\n\tpublic final static int NORM_SEP\t\t=128;\n\n\tpublic final static int S_PITCH_PERTURB\t=\t1;\n\tpublic final static int S_STEREO_SWING\t=\t(96*0x10000);\n\n\t// percent attenuation from front to back\n\tpublic final static int S_IFRACVOL\t=\t30;\n\n\tpublic final static int NA\t=\t\t0;\n\tpublic final static int S_NUMCHANNELS=\t\t2;\n\n\t/**\n\t * Initializes sound stuff, including volume Sets channels, SFX and music\n\t * volume, allocates channel buffer, sets S_sfx lookup.\n\t */\n\n\tvoid Init(int sfxVolume, int musicVolume);\n\n\t/**\n\t * Per level startup code. Kills playing sounds at start of level,\n\t * determines music if any, changes music.\n\t */\n\tpublic void Start();\n\n\t/**\n\t * Start sound for thing at <origin> using <sound_id> from sounds.h\n\t */\n\tpublic void StartSound(ISoundOrigin origin, int sound_id);\n\n\t/**\n\t * Start sound for thing at <origin> using <sound_id> from sounds.h\n\t * Convenience method using sfxenum_t instead. Delegated to int version.\n\t * \n\t */\n\tpublic void StartSound(ISoundOrigin origin, sfxenum_t sound_id);\n\t\n\t/** Will start a sound at a given volume. */\n\tpublic void StartSoundAtVolume(ISoundOrigin origin, int sound_id, int volume);\n\n\t/** Stop sound for thing at <origin> */\n\tpublic void StopSound(ISoundOrigin origin);\n\n\t/**\n\t * Start music using <music_id> from sounds.h, and set whether looping\n\t * \n\t * @param musicnum\n\t * @param looping\n\t */\n\tpublic void ChangeMusic(int musicnum, boolean looping);\n\t\n\tpublic void ChangeMusic(musicenum_t musicnum, boolean looping);\n\n\t/** Stops the music fer sure. */\n\tpublic void StopMusic();\n\n\t/** Stop and resume music, during game PAUSE. */\n\tpublic void PauseSound();\n\n\tpublic void ResumeSound();\n\n\t/**\n\t * Updates music & sounds\n\t * \n\t * @param listener\n\t */\n\tpublic void UpdateSounds(mobj_t listener);\n\n\tpublic void SetMusicVolume(int volume);\n\n\tpublic void SetSfxVolume(int volume);\n\n\n\t/** Start music using <music_id> from sounds.h */\n\tpublic void StartMusic(int music_id);\n\t\n\t/** Start music using <music_id> from sounds.h \n\t * Convenience method using musicenum_t.\n\t */\n\tpublic void StartMusic(musicenum_t music_id);\n\t\n\t//\n\t// Internals. \n\t// \n\t// MAES: these appear to be only of value for internal implementation,\n\t// and are never called externally. Thus, they might as well\n\t// not be part of the interface, even though it's convenient to reuse them.\n\t//\n\t\n\t/*\n\tint\n\tS_getChannel\n\t( mobj_t\t\torigin,\n\t sfxinfo_t\tsfxinfo );\n\n\n\tint\n\tS_AdjustSoundParams\n\t( mobj_t\tlistener,\n\t mobj_t\tsource,\n\t int\t\tvol,\n\t int\t\tsep,\n\t int\t\tpitch );\n\n\tvoid S_StopChannel(int cnum);\n\t*/\n\n}", "public AudioSettings() {\n this.emulator = NEmuSUnified.getInstance().getEmulator();\n }", "public void activateVolume(boolean on){\n\n\t\tif(prevPitch != cow.getPitch()) {\n\t\t\tcow.setIsPlaying(on);\n\n\t\t\t//if(sequencer.isRunning()) {\n\t\t\t\tcow.stopNote(synthesizer);\n\t\t\t//-}\n\n\t\t\tif (cow.getIsPlaying()) {\n\t\t\t\tsynthesizer = cow.playNote();\n\t\t\t}\n\n\t\t\tprevPitch = cow.getPitch();\n\t\t}\n\t\t\n\t}", "public void pauseSong()\n {\n if(!mute)\n {\n try{ \n //bclip.stop();\n \n URL url = this.getClass().getClassLoader().getResource(\"Refreshing Elevator Music.wav\");\n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n pclip = AudioSystem.getClip();\n \n // Open audio clip and load samples from the audio input stream.\n pclip.open(audioIn); \n pclip.start();\n pclip.loop(Clip.LOOP_CONTINUOUSLY);\n }catch(Exception e){}\n }\n }", "public void playMusic() {\r\n try {\r\n File mFile = new File(Filepath);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip = AudioSystem.getClip();\r\n clip.open(audioInput);\r\n FloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl.setValue(-25.0f); //reduces the volume by 25 decibels\r\n clip.start();\r\n clip.loop(Clip.LOOP_CONTINUOUSLY);\r\n\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "@SuppressWarnings(\"deprecation\")\n\tprivate void setControllerVariables() {\n\t\tcontrollerVars.setAudioManager((AudioManager) act.getSystemService(Context.AUDIO_SERVICE));\n\t\tcontrollerVars.setActVolume((float) controllerVars.getAudioManager().getStreamVolume(AudioManager.STREAM_MUSIC));\n\t\tcontrollerVars.setMaxVolume((float) controllerVars.getAudioManager().getStreamMaxVolume(AudioManager.STREAM_MUSIC));\n\t\tcontrollerVars.setVolume(controllerVars.getActVolume() / controllerVars.getMaxVolume());\n\n\t\t//Hardware buttons setting to adjust the media sound\n\t\tact.setVolumeControlStream(AudioManager.STREAM_MUSIC);\n\n\t\t// the counter will help us recognize the stream id of the sound played now\n\t\tcontrollerVars.setCounter(0);\n\n\t\t// Load the sounds\n\t\tcontrollerVars.setSoundPool(new SoundPool(20, AudioManager.STREAM_MUSIC, 0));\n\t\tcontrollerVars.getSoundPool().setOnLoadCompleteListener(new OnLoadCompleteListener() {\n\t\t @Override\n\t\t public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {\n\t\t \tcontrollerVars.setLoaded(true);\n\t\t }\n\t\t});\t\t\n\t}", "private void initPlayModeController() {\n playMode.setOnMouseClicked(event -> {\n MasterMindMain mm = null;\n try { mm = new MasterMindMain(); }\n catch (Exception e) { e.printStackTrace(); }\n mm.start(SimulatorMain.stage);\n });\n playMode.setOnMouseEntered(event -> { playMode.setGraphic(new Circle(5)); });\n playMode.setOnMouseExited(event -> { playMode.setGraphic(null); });\n }", "public void StartSound(ISoundOrigin origin, sfxenum_t sound_id);", "@Override\n\tpublic void loadSounds() {\n\t\ttry {\n\t\t\tSoundPlayer.load(\"bounce.wav\");\n\t\t\tSoundPlayer.load(\"laser1.wav\");\n\t\t\tSoundPlayer.load(\"hit1.wav\");\n\t\t\tSoundPlayer.load(\"speedup.wav\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}" ]
[ "0.6482026", "0.6406029", "0.6399498", "0.63841057", "0.6369378", "0.6360663", "0.6353228", "0.6306813", "0.630272", "0.6299845", "0.62788916", "0.6272984", "0.6264893", "0.6243724", "0.62343264", "0.62132555", "0.62054807", "0.6067419", "0.60350573", "0.6027657", "0.5989917", "0.59574074", "0.5956561", "0.59436595", "0.5937315", "0.5922508", "0.59127855", "0.59048504", "0.589819", "0.5803199", "0.5761472", "0.57469887", "0.5739885", "0.573159", "0.5714576", "0.57096916", "0.57068175", "0.56999815", "0.56894976", "0.56821257", "0.5681496", "0.567345", "0.5669554", "0.56376237", "0.5632669", "0.5625953", "0.56069946", "0.5575708", "0.5575226", "0.55736303", "0.55706733", "0.5563761", "0.5560686", "0.55494165", "0.55494165", "0.55453366", "0.55388975", "0.55276525", "0.55213225", "0.5516997", "0.55137163", "0.5505015", "0.5501873", "0.55008125", "0.5500475", "0.5495264", "0.5484101", "0.5474216", "0.54632324", "0.5435399", "0.5419279", "0.54148096", "0.5408657", "0.5408121", "0.5406872", "0.5388067", "0.53879476", "0.5386073", "0.53797865", "0.53694946", "0.536604", "0.5361997", "0.535056", "0.5348938", "0.53473", "0.53449816", "0.53377736", "0.53307635", "0.5315991", "0.53134435", "0.53029853", "0.5298693", "0.5295678", "0.5286653", "0.52668905", "0.5257858", "0.52539426", "0.52380824", "0.52255815", "0.52231807" ]
0.68019307
0
Start the alienDestroyed sound
public void openAlienDestroyedSound() { if (clipAlienDestroyed.isOpen()) { clipAlienDestroyed.start(); } if (!(clipAlienDestroyed.isActive())) { /* * clip.stop(); clip.flush(); */ clipAlienDestroyed.setFramePosition(0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stopSound(){\n p.stop(as);\n }", "protected void stopTheSound(){\n mp.stop();\n }", "public void alienDestroyed() {\r\n\t\t// Place 6 debris objects where the alien was located\r\n\t\tplaceDebris(alien.getX(), alien.getY());\r\n\t\tplaceDebris(alien.getX() + 1, alien.getY() + 1);\r\n\r\n\t\t// Update the score\r\n\t\tnumScore += ALIENSHIP_SCORE[alien.getSize()];\r\n\t\tdisplay.setScore(numScore);\r\n\r\n\t\t// Expire the alien from the game\r\n\t\tParticipant.expire(alien);\r\n\r\n\t\t// Open the Alien destroyed sound in enhanced mode\r\n\r\n\t\topenAlienDestroyedSound();\r\n\r\n\t\t// Schedule a transition if all aliens have been destroyed\r\n\t\tif (pstate.countAliens() == 0) {\r\n\t\t\tscheduleTransition(END_DELAY);\r\n\t\t}\r\n\t}", "public void playDeadSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, DEAD);\n\t}", "public void StopSound(ISoundOrigin origin);", "public synchronized void stopSound() {\r\n running = false;\r\n }", "public void stopSound() {\n metaObject.stopSound();\n }", "@Override\n public void stopSound(){\n gameMusic.stop();\n }", "public void stop() {\n\t\tsound.stop();\n\t}", "private void stopAudio() {\r\n // stop playback if possible here!\r\n }", "@Override\n protected void onDestroy() {\n unBoundAudioService();\n super.onDestroy();\n }", "public void unloadSoundSystem() {\n/* 205 */ if (this.loaded) {\n/* */ \n/* 207 */ stopAllSounds();\n/* 208 */ this.sndSystem.cleanup();\n/* 209 */ this.loaded = false;\n/* */ } \n/* */ }", "@Override\r\n public void onDestroy() {\n if (tts != null) {\r\n tts.stop();\r\n tts.shutdown();\r\n }\r\n super.onDestroy();\r\n }", "@Override\n public void onDestroy() {\n if(speaker != null) {\n\n speaker.destroy();\n Log.d(TAG, \"TTS Destroyed\");\n }\n Process.killProcess(Process.myPid());\n super.onDestroy();\n\n\n }", "@Override\n public void onCatalystInstanceDestroy() {\n super.onCatalystInstanceDestroy();\n\n Set<Map.Entry<Integer, PlayerInfo>> entries = playerPool.entrySet();\n for (Map.Entry<Integer, PlayerInfo> entry : entries) {\n PlayerInfo info = entry.getValue();\n if (info == null) {\n continue;\n }\n AudioPlayer player = info.audioPlayer;\n if (player == null) {\n continue;\n }\n try {\n player.setOnCompletionListener(null);\n player.setOnPreparedListener(null);\n player.setOnErrorListener(null);\n if (player.isPlaying()) {\n player.pause();\n }\n player.reset();\n player.release();\n } catch (Exception ex) {\n Log.e(\"RNSoundModule\", \"Exception when closing audios during app exit. \", ex);\n }\n }\n entries.clear();\n }", "void stopHelloSender();", "@Override\n public void onDestroy() {\n super.onDestroy();\n final Intent audioEffectsIntent = new Intent(\n AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);\n audioEffectsIntent.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());\n audioEffectsIntent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());\n sendBroadcast(audioEffectsIntent);\n mPlayerHandler.removeCallbacksAndMessages(null);\n mPlayer.release();\n mPlayer = null;\n mAudioManager.abandonAudioFocus(mOnAudioFocusChangeListener);\n mPlayerHandler.removeCallbacksAndMessages(null);\n mWakeLock.release();\n }", "@Override\n public void onDestroy() {\n if (tts != null) {\n tts.stop();\n tts.shutdown();\n }\n super.onDestroy();\n }", "@Override\n public void onDestroy() {\n if (tts != null) {\n tts.stop();\n tts.shutdown();\n }\n super.onDestroy();\n }", "@Override\n public void onDestroy() {\n if (tts != null) {\n tts.stop();\n tts.shutdown();\n }\n super.onDestroy();\n }", "@Override\n public void onDestroy() {\n if (tts != null) {\n tts.stop();\n tts.shutdown();\n }\n super.onDestroy();\n }", "public void doMyStartupStuffDestroy() {\n System.out.println(\"destroy method\");\n }", "public void onDestroytts() {\n\t\tif (tts != null) {\n\t\t\ttts.stop();\n\t\t\ttts.shutdown();\n\t\t}\n\t\t//super.onDestroy();\n\t}", "public void playAmbientSound() {\n if (!this.isClosed()) {\n super.playAmbientSound();\n }\n\n }", "@Override\n protected void onDestroy() {\n if (m_tts!=null) {\n m_tts.stop();\n m_tts.shutdown();\n }\n super.onDestroy();\n }", "public void stopRandomSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.stopSound(MUSIC_FOLDER, SOUND_FILES[SOUND_FILES.length - 1]);\n\t}", "protected void onDestroy() {\n\t\t if (com.example.main_project.MainActivity.tts!=null) {\n\t\tcom.example.main_project.MainActivity.tts.stop();\n\n\n\t\tcom.example.main_project.MainActivity.tts.shutdown();\n\t\t}\n\t\t super.onDestroy();\n\t\t}", "public void endSound()\n {\n if(!mute)\n {\n try {\n if(lastpowerUp.equals(\"RAINBOW\"))\n {\n sclip.stop();\n bclip.start();\n bclip.loop(Clip.LOOP_CONTINUOUSLY);\n }\n // Open an audio input stream.\n URL url = this.getClass().getClassLoader().getResource(\"Silence.wav\"); \n \n if(lastpowerUp.equals(\"BLUE\"))\n url = this.getClass().getClassLoader().getResource(\"Out Of Bounds Stop.wav\");\n else if(lastpowerUp.equals(\"YELLOW\")||lastpowerUp.equals(\"DOUBLE\") || lastpowerUp.equals(\"WHITE\") || (lastpowerUp.equals(\"TROLL\") && modeT))\n url = this.getClass().getClassLoader().getResource(\"Mushroom Down.wav\") ;\n else if(lastpowerUp.equals(\"BLACK\") || lastpowerUp.equals(\"TROLL\"))\n url = this.getClass().getClassLoader().getResource(\"Invisible Off.wav\");\n \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn); \n \n clip.start();\n \n \n \n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n \n } \n }\n }", "public void onDestroy() {\n if (tts != null) {\n tts.stop();\n tts.shutdown();\n }\n super.onDestroy();\n }", "@Override\n public void playStop() {\n }", "@Override\n public void makeSound() {\n\n }", "@Override\n public void makeSound() {\n\n }", "public static void portail_sound() {\n\t\tm_player_portail.start();\n\t\tm_player_portail.setMediaTime(new Time(0));\n\t}", "@Override\n public void onDestroy() {\n unregisterReceiver(mNoisyAudioStreamReceiver);\n\n // Cancel our Notification\n mNotificationManager.cancel(NotificationTarget.NOTIFICATION_ID);\n\n // Set preference to indication not playing.\n PreferenceManager.getDefaultSharedPreferences(getApplicationContext())\n .edit()\n .putBoolean(MainActivity.PREF_IS_PLAYING, false)\n .commit();\n\n super.onDestroy();\n }", "public static void stop() {\r\n\r\n if (soundLoop!=null)\r\n {\r\n soundLoop.stop();\r\n }\r\n }", "@Override\r\n\tpublic void onDeath() {\n\t\tplaySound(Sound.BLOCK_CONDUIT_DEACTIVATE,caster.getLocation(),5,1F);\r\n\t}", "public void foodSound(){\n if (enableSound){\r\n\t clip.play();\r\n }\r\n\t\t\r\n\t}", "public void StartSound(ISoundOrigin origin, sfxenum_t sound_id);", "public void stop()\n {\n audioClip.stop();\n }", "public void agentDestroyed(ShellLaunchEvent ev);", "public static void stopSound() {\n if(mAudioManager != null) {\n mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, originalVolume, 0);\n }\n if (mp != null) {\n mp.stop();\n Log.d(TAG, \"Stop Sound\");\n }\n }", "default void free() {\n setState(Audio.AudioState.STOPPED);\n }", "void stopMusic();", "public void StopMusic();", "private void stopSounds(){\n\t\tsoundPool.autoPause();\n\t\tsoundPool.release();\n\t}", "private void stop(){ player.stop();}", "public void destroy() throws RemoteException {\n Thread thread = new Thread() {\n public void run() {\n //System.setProperty(\"terminatingHello\", \"true\");\n //System.err.println(\"Shutting down service\");\n //System.err.println(\"Terminating - checking activation ID\");\n\n try {\n AdmActFilterImpl.super.destroy();\n\n activatableFactory.unregister(activationAdapter.getActivationID());\n\n System.out.println(\"destroyed!\");\n\n/* while (!Activatable.inactive(id)) {\n Thread.yield();\n }\n\n ActivationSystem activationSystem = ActivationGroup.getSystem();\n\n ActivationDesc activationDesc = activationSystem.getActivationDesc(id);\n\n ActivationGroupID gid = activationDesc.getGroupID();\n\n activationSystem.unregisterGroup(gid);\n*/\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n }\n };\n\n thread.setDaemon(false);\n thread.start();\n }", "public void release()\n {\n audioEffect.release();\n }", "public void release() {\n stop();\n\n Intent i = new Intent(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);\n i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, getAudioSessionId());\n i.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, mContext.getPackageName());\n mContext.sendBroadcast(i);\n\n mPlayer.release();\n mWakeLock.release();\n }", "public void stop() {\n AudioPlayer.player.stop(cas);\n playing = false;\n }", "public void destroy()\r\n\t{\r\n\t\tlog.fine(\"destroy\");\r\n\t}", "protected void foo()\n\t\t{\n\t\t\tplayer.stop();\n\t\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tbookCache.clear();\n\n stopService(new Intent(this , AudioService.class));\n\n Global.RemoveTmp();\n\t}", "public void stop() {\n\t\tplaybin.stop();\n\t}", "@Override\n public void onDestroy() {\n super.onDestroy();\n releasePlayer();\n mMediaSession.setActive(false);\n }", "@Override\n\tpublic void onDestroy() {\n\t\tif (tts != null) {\n\t\t\tLog.e(TAG, \"Shutting down tts\");\n\t\t\ttts.stop();\n\t\t\ttts.shutdown();\n\t\t}\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tContext context = this.getApplicationContext();\n\t\t//Toast.makeText(context, \"Avslutter service\", Toast.LENGTH_LONG).show();\n\n\t\t//Fjerner notification:\n\t\tnotificationManager.cancel(0); //.cancelAll();\n\t\tsuper.onDestroy();\n\t}", "public void onDestroy() {\n super.onDestroy();\n C0938a.m5006c(\"SR/SoundRecorder\", \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~onDestroy\");\n m6659t();\n ServiceConnection serviceConnection = this.f5403W;\n if (serviceConnection != null) {\n unbindService(serviceConnection);\n }\n }", "private void onResume(){\n\t\tfj.timer.start();\n\t\tfj.audio.resumeAudio();\n\t\tthis.dispose();\n\t}", "public void stopThemeSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.stopSound(MUSIC_FOLDER, THEME);\n\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tLog.i(\"dservice\", \"stop!\");\n\t\tstopSelf();\n\t\tam.cancel(sender);\t\t// 알람 취소\n\t\tsuper.onDestroy();\n\t}", "public void cancel() {\n\t\tif(hasStarted) {\n\t\t\ttimer.cancel();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"An alarm has not been started\");\n\t\t}\n\t}", "public static void GameOverCrashSound(){\n if(soundActivated) {\n if(!crashSoundDone) {\n AudioManager audioManager = (AudioManager) mActivity.getSystemService(AUDIO_SERVICE);\n float actualVolume = (float) audioManager\n .getStreamVolume(AudioManager.STREAM_MUSIC);\n float maxVolume = (float) audioManager\n .getStreamMaxVolume(AudioManager.STREAM_MUSIC);\n float volume = actualVolume / maxVolume;\n mSound.play(soundCrash, volume, volume, 1, 0, 1f);\n\n crashSoundDone = true;\n\n }\n }\n }", "@Override\r\n public void onDestroy() {\n mSensorManager.unregisterListener(mShakeDetector);\r\n running = false;\r\n }", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tMediaPlayUtil.getInstance().release();\n\t\tMediaPlayUtil.getInstance().stop();\n\n\t}", "@Override\r\n\tpublic String doSound() {\n\t\treturn null;\r\n\t}", "private void detener() {\n player.stop();\n player.release();\n player = null;\n }", "public void shutDown() {\n isStarted = false;\n logger.info(\"[GAME] shut down\");\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tMediaPlayUtil.getInstance().stop();\n\t\tMediaPlayUtil.getInstance().release();\n\t}", "@Override\n public void onDestroy() {\n super.onDestroy();\n releasePlayer();\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n if(player != null){\n\n player.stop();\n }\n }", "public void continueSound() {\n\t\tclip.start();\n\t}", "public void PauseSound();", "public void StartSound(ISoundOrigin origin, int sound_id);", "@Override\n\tpublic void destroy() {\n\t\tSystem.out.println(\"Passage dans destroy\");\n\t}", "public void onStop();", "public void destroy() {\r\n // applet is going away...\r\n }", "@Override\n public void onDestroy(){\n\tandroid.widget.Toast.makeText(getApplicationContext(), \"done \", android.widget.Toast.LENGTH_SHORT).show();\n\tmediaPlayer.release();\n\tmediaPlayer = null;\n\tsuper.onDestroy();\n }", "public void onStop () {\t\t\n\t\t\n\t}", "@Override\n public void onSpeakResumed() throws RemoteException {\n Log.d(TAG, \"onSpeakResumed\");\n }", "public void AudioMuerte() {\r\n\t\ttry {\r\n\t\t\tdeath.AbrirFichero(\"C:\\\\Temp\\\\Sonidos\\\\golpe.wav\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Error: \" + e);\r\n\t\t}\r\n\t}", "void beforeStop();", "@Override\n\tpublic void destroy() {\n\t\tSystem.out.println(\"destroy\");\n\t}", "public void pauseSound() {\n\t\tclip.stop();\n\t}", "protected void onStarted() throws ExoPlaybackException {\n // Do nothing.\n }", "public void act() \n {\n if(timer > 0){\n timer--;\n }else{\n Greenfoot.playSound(\"explosionSound.wav\");\n getWorld().removeObject(this);\n }\n }", "@Override\n\tprotected void onPause() {\n\t\tsuper.onPause();\n\t\tsound.release();\n\t\tfinish();\n\t}", "boolean isDestroyed();", "boolean isDestroyed();", "public static void pop_sound() {\n\t\tm_player_pop.start();\n\t\tm_player_pop.setMediaTime(new Time(0));\n\t}", "public void stop(String key) {\n\t\t// Get the active sound for the key\n\t\tif (!actives.containsKey(key)) {\n\t\t\t//System.out.println(\"Returned\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tActiveSound snd = actives.get(key);\n\t\t\n\t\t// This is a workaround for the OS X sound bug\n\t\t//snd.sound.stop(snd.id);\n\t\tsnd.sound.setLooping(snd.id,false); // Will eventually garbage collect\n\t\tsnd.sound.setVolume(snd.id, 0.0f); \n\t\tactives.remove(key);\n\t}", "@Override\n protected void appStop() {\n }", "@Override\n protected void onStop() {\n super.onStop();\n stopMusic();\n }", "private void stop() {\n Log.i(\"TTS\", \"Stopping\");\n mSpeechQueue.clear();\n \n nativeSynth.stop();\n mIsSpeaking = false;\n if (mPlayer != null) {\n try {\n mPlayer.stop();\n } catch (IllegalStateException e) {\n // Do nothing, the player is already stopped.\n }\n }\n Log.i(\"TTS\", \"Stopped\");\n }", "public void run() {\n\n try {\n AdmActFilterImpl.super.destroy();\n\n activatableFactory.unregister(activationAdapter.getActivationID());\n\n System.out.println(\"destroyed!\");\n\n/* while (!Activatable.inactive(id)) {\n Thread.yield();\n }\n\n ActivationSystem activationSystem = ActivationGroup.getSystem();\n\n ActivationDesc activationDesc = activationSystem.getActivationDesc(id);\n\n ActivationGroupID gid = activationDesc.getGroupID();\n\n activationSystem.unregisterGroup(gid);\n*/\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n if (mSpeechRecognizer != null) {\n mSpeechRecognizer.destroy();\n }\n if(tts != null){\n tts.shutdown();\n }\n }", "public boolean isDestroyed();", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tstop();\n\t}", "@Override\r\n public void simulationEnded() {\n this.soundThread = null;\r\n\r\n // end the module thread\r\n this.running = false;\r\n\r\n // the simulation is not running\r\n this.runSimulationState = false;\r\n\r\n // play the background sound\r\n this.playBackgroundSound(true);\r\n }", "@Test\n\tpublic void stopTest() throws IllegalArgumentException, IllegalAccessException {Configuration.featureamp=true;\n//\t\tConfiguration.playengine=true;\n//\t\tConfiguration.choosefile=true;\n//\t\tConfiguration.mp3=true;\n//\t\tConfiguration.gui=true;\n//\t\tConfiguration.skins=true;\n//\t\tConfiguration.light=true;\n//\t\tConfiguration.filesupport=true;\n//\t\tConfiguration.showtime=true;\n//\t\tConfiguration.tracktime=true;\n//\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.mp3 &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showtime &&\n\t\t\t\tConfiguration.tracktime) {\n\t\t\tstart();\n\t\t\tdemo.menuItemWithPath(\"Datei\", \"Datei \\u00F6ffnen\").click();\n\t\t\tdemo.fileChooser().setCurrentDirectory(new File(\"media/\"));\n\t\t\tFile file = new File(\"note.mp3\");\n\t\t\tdemo.fileChooser().selectFile(file);\n\t\t\tdemo.fileChooser().approveButton().click();\n\t\t\tdemo.button(\"play\").click();\n\t\t\tdemo.button(\"stop\").click();\n\t\t}\n\n\t}" ]
[ "0.6651281", "0.64293283", "0.6369453", "0.6330372", "0.63122857", "0.631097", "0.6189342", "0.61527365", "0.6119517", "0.60682666", "0.60056335", "0.5979664", "0.5970681", "0.5952448", "0.59054995", "0.5901957", "0.58859897", "0.586326", "0.586326", "0.586326", "0.586326", "0.58535445", "0.58337516", "0.58235425", "0.581966", "0.58194405", "0.58104575", "0.58003116", "0.57778406", "0.5761629", "0.5759138", "0.5759138", "0.574579", "0.5724224", "0.56918246", "0.568077", "0.5670484", "0.56688184", "0.56683075", "0.5648109", "0.5646178", "0.5633212", "0.5627855", "0.5625799", "0.5621076", "0.56127226", "0.56106937", "0.55874664", "0.55658674", "0.55627495", "0.55618036", "0.55598223", "0.55583125", "0.55487007", "0.5547008", "0.5546967", "0.55446225", "0.55413467", "0.55399245", "0.553854", "0.5525993", "0.5523745", "0.5515334", "0.55137396", "0.5510766", "0.5498666", "0.54948163", "0.54858446", "0.5483736", "0.5481007", "0.54643", "0.5456769", "0.54544204", "0.54536575", "0.54503477", "0.54483914", "0.54419816", "0.5439935", "0.54394454", "0.5438132", "0.54366946", "0.54283875", "0.5427776", "0.5419854", "0.541838", "0.5417799", "0.5411908", "0.5411783", "0.5411783", "0.54106414", "0.540625", "0.54052246", "0.54035866", "0.5401683", "0.5400381", "0.5399703", "0.53955424", "0.5394518", "0.5383498", "0.53824157" ]
0.79321903
0
Start the asteroidDestroyed sound
public void openAsteroidSound() { sound a; try { a = new sound(); Clip asteroidSound = a.getSoundAsteroid(); asteroidSound.open(streamAsteroid); if (clipAsteroid.isOpen()) { clipAsteroid.start(); } if (!(clipAsteroid.isActive())) { /* * clip.stop(); clip.flush(); */ clipAsteroid.setFramePosition(0); } } catch (LineUnavailableException e) { } catch (UnsupportedAudioFileException e) { } catch (IOException e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void openAlienDestroyedSound() {\r\n\t\tif (clipAlienDestroyed.isOpen()) {\r\n\t\t\tclipAlienDestroyed.start();\r\n\t\t}\r\n\r\n\t\tif (!(clipAlienDestroyed.isActive())) {\r\n\t\t\t/*\r\n\t\t\t * clip.stop(); clip.flush();\r\n\t\t\t */\r\n\t\t\tclipAlienDestroyed.setFramePosition(0);\r\n\t\t}\r\n\r\n\t}", "public void playDeadSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, DEAD);\n\t}", "public void stopSound(){\n p.stop(as);\n }", "public synchronized void stopSound() {\r\n running = false;\r\n }", "public void asteroidDestroyed(int size) {\r\n\t\t// Update score based on asteroid size\r\n\t\tnumScore += ASTEROID_SCORE[size];\r\n\t\tdisplay.setScore(numScore);\r\n\r\n\t\t// If all the asteroids are gone, schedule a transition\r\n\t\tif (pstate.countAsteroids() == 0) {\r\n\t\t\tscheduleTransition(END_DELAY);\r\n\t\t}\r\n\r\n\t\topenAsteroidSound();\r\n\r\n\t}", "public void stopSound() {\n metaObject.stopSound();\n }", "protected void stopTheSound(){\n mp.stop();\n }", "public void StopSound(ISoundOrigin origin);", "public static void playExplosion()\n {\n combust.play();\n if (combust.audioClip.getFramePosition() ==\n combust.audioClip.getFrameLength())\n {\n combust.audioClip.setFramePosition(0);\n combust.audioClip.stop();\n }\n }", "public void explosion(){\n explosionEffect.play(pitch, volume);\n }", "public void playAmbientSound() {\n if (!this.isClosed()) {\n super.playAmbientSound();\n }\n\n }", "public static void game_sound() {\n\t\tm_player_game.start();\n\t\tm_player_game.setMediaTime(new Time(0));\n\t}", "public void foodSound(){\n if (enableSound){\r\n\t clip.play();\r\n }\r\n\t\t\r\n\t}", "@Override\n public void stopSound(){\n gameMusic.stop();\n }", "public void playSoundGameLost() {\n\t\tlostGameSound.play();\n\t}", "public static void GameOverCrashSound(){\n if(soundActivated) {\n if(!crashSoundDone) {\n AudioManager audioManager = (AudioManager) mActivity.getSystemService(AUDIO_SERVICE);\n float actualVolume = (float) audioManager\n .getStreamVolume(AudioManager.STREAM_MUSIC);\n float maxVolume = (float) audioManager\n .getStreamMaxVolume(AudioManager.STREAM_MUSIC);\n float volume = actualVolume / maxVolume;\n mSound.play(soundCrash, volume, volume, 1, 0, 1f);\n\n crashSoundDone = true;\n\n }\n }\n }", "@Override\n public void makeSound() {\n\n }", "@Override\n public void makeSound() {\n\n }", "public void playSoundFail() {\n\t\tfailSound.play();\n\t}", "public static void pop_sound() {\n\t\tm_player_pop.start();\n\t\tm_player_pop.setMediaTime(new Time(0));\n\t}", "protected String getDeathSound()\n {\n return null;\n }", "protected String getDeathSound()\n {\n return null;\n }", "public void PauseSound();", "public void playGameOverSound() {\n\t\ttry {\n\t\t\tAudioInputStream audioStream = AudioSystem.getAudioInputStream(new File(\"Musik/DeadSound.wav\"));\n\t\t\t\n\t\t\tClip clip = AudioSystem.getClip(); \n\t\t\tclip.open(audioStream);\n\t\t\t\n\t\t\tboolean oldStatus = settings.isPlaying(); \n\t\t\t\n\t\t\tstopMusik();\n\t\t\t\n\t\t\t\n\t\t\tthis.settings.setPlaying(oldStatus);\n\t\t\tclip.start();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public static void portail_sound() {\n\t\tm_player_portail.start();\n\t\tm_player_portail.setMediaTime(new Time(0));\n\t}", "private void playCollisionSound()\n {\n try\n {\n if (checkCollisions())\n {\n lives--;\n this.livesTextField.setText(\"\" + lives);\n java.io.File soundFile = new java.io.File(\n \"C:\\\\Windows\\\\Media\\\\ir_end.wav\");\n javax.sound.sampled.AudioInputStream audioIn =\n javax.sound.sampled.AudioSystem.getAudioInputStream(\n soundFile);\n javax.sound.sampled.Clip clip =\n javax.sound.sampled.AudioSystem.getClip();\n\n clip.open(audioIn);\n clip.start();\n }\n }\n catch (Exception ex)\n {\n System.out.println(ex);\n }\n }", "public void act() \n {\n if(timer > 0){\n timer--;\n }else{\n Greenfoot.playSound(\"explosionSound.wav\");\n getWorld().removeObject(this);\n }\n }", "@Override\r\n\tpublic String doSound() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void playLivingSound() {\n\t\tgetSoundManager().playLivingSound();\n\t}", "public void stopRandomSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.stopSound(MUSIC_FOLDER, SOUND_FILES[SOUND_FILES.length - 1]);\n\t}", "public void StartSound(ISoundOrigin origin, int sound_id);", "private void playGameOverSound()\n {\n try\n {\n java.io.File soundFile = new java.io.File(\n \"C:\\\\Windows\\\\Media\\\\ringout.wav\");\n javax.sound.sampled.AudioInputStream audioIn =\n javax.sound.sampled.AudioSystem.getAudioInputStream(\n soundFile);\n javax.sound.sampled.Clip clip =\n javax.sound.sampled.AudioSystem.getClip();\n\n clip.open(audioIn);\n clip.start();\n }\n catch (Exception ex)\n {\n System.out.println(ex);\n }\n }", "public static void charge_sound() {\n\t\tm_player_charge.start();\n\t\tm_player_charge.setMediaTime(new Time(0));\n\t}", "public void stop() {\n\t\tsound.stop();\n\t}", "public void StartSound(ISoundOrigin origin, sfxenum_t sound_id);", "public static void enableSound() {\n\t\tvelocity = 127;\n\t}", "public void unloadSoundSystem() {\n/* 205 */ if (this.loaded) {\n/* */ \n/* 207 */ stopAllSounds();\n/* 208 */ this.sndSystem.cleanup();\n/* 209 */ this.loaded = false;\n/* */ } \n/* */ }", "@Override\r\n\tpublic void onDeath() {\n\t\tplaySound(Sound.BLOCK_CONDUIT_DEACTIVATE,caster.getLocation(),5,1F);\r\n\t}", "public void continueSound() {\n\t\tclip.start();\n\t}", "@Override\n\tpublic void sound() {\n\t\tSystem.out.println(\"Dog2..sound.\");\n\t\t\n\t}", "@Override\n\tprotected SoundEvent getDeathSound() {\n\t\treturn getSoundManager().getDeathSound();\n\t}", "public void endSound()\n {\n if(!mute)\n {\n try {\n if(lastpowerUp.equals(\"RAINBOW\"))\n {\n sclip.stop();\n bclip.start();\n bclip.loop(Clip.LOOP_CONTINUOUSLY);\n }\n // Open an audio input stream.\n URL url = this.getClass().getClassLoader().getResource(\"Silence.wav\"); \n \n if(lastpowerUp.equals(\"BLUE\"))\n url = this.getClass().getClassLoader().getResource(\"Out Of Bounds Stop.wav\");\n else if(lastpowerUp.equals(\"YELLOW\")||lastpowerUp.equals(\"DOUBLE\") || lastpowerUp.equals(\"WHITE\") || (lastpowerUp.equals(\"TROLL\") && modeT))\n url = this.getClass().getClassLoader().getResource(\"Mushroom Down.wav\") ;\n else if(lastpowerUp.equals(\"BLACK\") || lastpowerUp.equals(\"TROLL\"))\n url = this.getClass().getClassLoader().getResource(\"Invisible Off.wav\");\n \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn); \n \n clip.start();\n \n \n \n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n \n } \n }\n }", "public static void playShootingSound(){\n String musicFile = \"Sounds\\\\Shoot.mp3\";\n Media sound = new Media(new File(musicFile).toURI().toString());\n MediaPlayer mediaPlayer = new MediaPlayer(sound);\n mediaPlayer.setVolume(App.getVolume());\n mediaPlayer.play();\n }", "public void OnStart(){\n\t\t//create the random space background and put its priority behind everything else\n\t\tswitch ((int) (Math.random() * 3)){\n\t\t\tcase 0:\n\t\t\t\tbackground = new Background(R.drawable.spaceback_med,new Point(0,0),-1);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tbackground = new Background(R.drawable.spaceback_asteroids,new Point(0,0),-1);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tbackground = new Background(R.drawable.spaceback_nebula,new Point(0,0),-1);\n\t\t\t\tbreak;\n\t\t}\n\t\t//generate asteroids\n\t\tinitAsteroids((int)(Math.random()*3));\n\t\t//create a border for the background (draw on top)\n\t\tnew Border(background,1000);\n\t\t//create the player\n\t\tplayer = new Player(new Point(-300,300), 1);\n\t\t//create a target reticule for the player\n\t\ttarget = new Target(player);\n\t\t\n\t\t//load sounds\n\t\tGameState.State().LoadSound(R.raw.shoot, \"shoot\");\n\t\tGameState.State().LoadSound(R.raw.accelerate, \"accelerate\");\n\t\tGameState.State().LoadSound(R.raw.engine, \"engine\");\n\t\tGameState.State().LoadSound(R.raw.explosion, \"explosion\");\n\t\tGameState.State().LoadSound(R.raw.death, \"death\");\n\t\t\n\t\thasStarted = true;\n\t\t\n\t\trespawnCount = 0.0f;\n\t\trespawnTime = 4f;\n\t}", "public void startShower(){\n Log.d(LOGTAG,\"Shower is on.\");\n playSound();\n\n\n }", "@Override\r\n protected void playGameStartAudio() {\n\taudio.playClip();\r\n }", "public void pauseSound() {\n\t\tclip.stop();\n\t}", "static void soundsEZ() {\n\t\tapplauseSound = EZ.addSound(\"applause.wav\");\n\t\twallSound = EZ.addSound(\"stone1.wav\");\n\t\tdiamondSound = EZ.addSound(\"glass1.wav\");\n\t}", "public void playSoundGameWon() {\n\t\tcompletedGameSound.play();\n\t}", "public void birdDeath(){\n birdDeath[(int)(Math.random()*3)].play(1f);\n }", "public void playHitWall() {\r\n hitWall.play(soundFxVol);\r\n }", "protected String getDeathSound() {\n return \"mob.zombie.woodbreak\";\n }", "public static void playRandomDeath() {\n\t\t\n\t\tString[] deathSoundArray = {\"death1\", \"death2\", \"death3\"};\n\t\t\n\t\tint rnd = new Random().nextInt(deathSoundArray.length);\n\t\tplaySound(deathSoundArray[rnd], 0.4f);\n\t}", "@Override\n public void playStop() {\n }", "void gameResumed();", "public void keepLooping() {\n\t\tif(!clip.isActive()) {\n\t\t\tstartSound();\n\t\t}\n\t}", "@Override\n\tpublic void OnAttackCommand() {\n\t\tsuper.OnAttackCommand();\n\t\tSoundManage.playSound(atkSound1);\n\t}", "void tick() {\n\t\tif (playing) {\n\t\t\tdeadcannon = null;\n\t\t\t// sets general output message\n\t\t\tstatus.setText(\"Engaging alien wave \" + Integer.toString(level)+ \" \");\n\n\t\t\t// controls the first shot fired by the aliens\n\t\t\tif (shot1 == null) {\n\t\t\t\tint count1 = 0;\n\t\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\t\tif (alien3[i]!=null) {if (!alien3[i].Destroyed) count1++ ;}\n\t\t\t\t}\n\t\t\t\tif (count1 > 1) shot1 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\tshootbottom().pos_x + 18, shootbottom().pos_y); \n\t\t\t\telse {\n\t\t\t\t\tint count2 = 0;\n\t\t\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\t\t\tif (alien2[i]!=null) {if(!alien2[i].Destroyed)count2++;}\n\t\t\t\t\t}\n\t\t\t\t\tif (count2 > 1) shot1 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\tshootmiddle().pos_x + 18, shootmiddle().pos_y);\n\t\t\t\t\telse {\n\t\t\t\t\t\tint count3 = 0;\n\t\t\t\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\t\t\t\tif (alien1[i]!=null) {if(!alien1[i].Destroyed)count3++;}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (count3 != 0) shot1 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\t\tshoottop().pos_x + 18, shoottop().pos_y);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// controls the second shot fired by the aliens\n\t\t\tif (shot2 == null) {\n\t\t\t\tint count4 = 0;\n\t\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\t\tif (alien3[i]!=null) {if (!alien3[i].Destroyed) count4++ ;}\n\t\t\t\t}\n\t\t\t\tif (count4 != 0) {shot2 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\tshootbottom().pos_x + 18, shootbottom().pos_y); \n\t\t\t\tStdAudio.play(\"zap.wav\"); }\n\t\t\t\telse {\n\t\t\t\t\tint count5 = 0;\n\t\t\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\t\t\tif (alien2[i]!=null) {if(!alien2[i].Destroyed)count5++;}\n\t\t\t\t\t}\n\t\t\t\t\tif (count5 != 0) { shot2 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\tshootmiddle().pos_x + 18, shootmiddle().pos_y);\n\t\t\t\t\tStdAudio.play(\"zap.wav\"); }\n\t\t\t\t\telse {\n\t\t\t\t\t\tint count6 = 0;\n\t\t\t\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\t\t\t\tif (alien1[i]!=null) {if(!alien1[i].Destroyed)count6++;}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (count6 != 0) {shot2 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\t\tshoottop().pos_x + 18, shoottop().pos_y);\n\t\t\t\t\t\tStdAudio.play(\"zap.wav\");}\n\t\t\t\t\t\telse {level = level + 1; \n\t\t\t\t\t\tnewlevel();\n\t\t\t\t\t\tthescore=thescore + 100;\n\t\t\t\t\t\tStdAudio.play(\"up.wav\");}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move bullet and delete if it reaches the roof\n\t\t\tif (bullet!= null) {\n\t\t\t\tbullet.move();\n\t\t\t\tif (bullet.pos_y == 0) bullet = null;\n\t\t\t}\n\n\t\t\t// controls movement of first shot\n\t\t\tif (shot1 != null) {\n\t\t\t\tshot1.move();\n\t\t\t\tif (shot1.pos_y > 435) shot1 = null;\n\t\t\t}\n\t\t\t// controls movement of second shot\n\t\t\tif (shot2 != null) {\n\t\t\t\tshot2.move();\n\t\t\t\tif (shot2.pos_y > 435) shot2 = null;\n\t\t\t}\n\n\t\t\t// For Top Row\n\n\t\t\t// change alien direction if a wall is reached\n\t\t\tif (alien1[0] != null && alien1[9] != null){\n\t\t\t\tif (alien1[0].pos_x == 0 || alien1[9].pos_x == 730) {\n\t\t\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\t\t\tif (alien1[i]!=null){alien1[i].v_x = -alien1[i].v_x;\n\t\t\t\t\t\talien1[i].pos_y=alien1[i].pos_y+15;\n\t\t\t\t\t\tif (alien1[i].pos_y >= 385 && !alien1[i].Destroyed){\n\t\t\t\t\t\t\tplaying = false;\n\t\t\t\t\t\t\tstatus.setText(\"You have been overrun and Earth \"+\n\t\t\t\t\t\t\t\t\t\"has been destroyed. You are a terrible \"+\n\t\t\t\t\t\t\t\t\t\"defender of humanity. \");\t \n\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// move the aliens as group\n\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\tif (alien1[i] != null) \n\t\t\t\t\talien1[i].move();\n\t\t\t}\n\n\t\t\t// destroy both bullet and aliens if bullet hits\n\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\tif (alien1[i] != null && bullet != null) {\n\t\t\t\t\tif (alien1[i].intersects(bullet) && !alien1[i].Destroyed) { \n\t\t\t\t\t\talien1[i].Destroyed=true;\n\t\t\t\t\t\tthescore += 20;\n\t\t\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\t\t\tbullet = null;\n\t\t\t\t\t\tif (i == 0 || i == 10 ) {\n\t\t\t\t\t\t\talien1[i].img_file = \"black.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For Second Row\n\n\t\t\t// change alien direction if a wall is reached\n\t\t\tif (alien2[0] != null && alien2[9] != null){\n\t\t\t\tif (alien2[0].pos_x == 0 || alien2[9].pos_x == 730) {\n\t\t\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\t\t\tif (alien2[i]!=null){alien2[i].v_x = -alien2[i].v_x;\n\t\t\t\t\t\talien2[i].pos_y=alien2[i].pos_y+15;\n\t\t\t\t\t\tif (alien2[i].pos_y >= 385 && !alien2[i].Destroyed){\n\t\t\t\t\t\t\tplaying = false; \n\t\t\t\t\t\t\tstatus.setText(\"You have been ovverun and Earth \"+\n\t\t\t\t\t\t\t\t\t\"has been destroyed. You are a terrible \"+\n\t\t\t\t\t\t\t\t\t\"defender of humanity. \");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move the aliens as group\n\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\tif (alien2[i] != null) \n\t\t\t\t\talien2[i].move();\n\t\t\t}\n\n\t\t\t// destroy both bullet and aliens if bullet hits\n\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\tif (alien2[i] != null && bullet != null) {\n\t\t\t\t\tif (alien2[i].intersects(bullet) && !alien2[i].Destroyed) { \n\t\t\t\t\t\talien2[i].Destroyed=true;\n\t\t\t\t\t\tthescore +=15;\n\t\t\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\t\t\tbullet = null;\n\t\t\t\t\t\tif (i == 0 || i == 10 ) {\n\t\t\t\t\t\t\talien2[i].img_file = \"black.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//For third row\n\n\t\t\t//change alien direction if a wall is reached\n\t\t\tif (alien3[0] != null && alien3[9] != null){\n\t\t\t\tif (alien3[0].pos_x == 0 || alien3[9].pos_x == 730) {\n\t\t\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\t\t\tif (alien3[i]!=null){alien3[i].v_x = -alien3[i].v_x;\n\t\t\t\t\t\talien3[i].pos_y=alien3[i].pos_y+15;\n\t\t\t\t\t\tif (alien3[i].pos_y >= 385 && !alien3[i].Destroyed){\n\t\t\t\t\t\t\tplaying = false;\n\t\t\t\t\t\t\tstatus.setText(\"You have been ovverrun and Earth \"+\n\t\t\t\t\t\t\t\t\t\"has been destroyed. You are a terrible \"+\n\t\t\t\t\t\t\t\t\t\"defender of humanity. \");\n\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move the aliens as group\n\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\tif (alien3[i] != null) \n\t\t\t\t\talien3[i].move();\n\t\t\t}\n\n\t\t\t// destroy both bullet and aliens if bullet hits\n\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\tif (alien3[i] != null && bullet != null) {\n\t\t\t\t\tif (alien3[i].intersects(bullet) && !alien3[i].Destroyed) { \n\t\t\t\t\t\talien3[i].Destroyed=true;\n\t\t\t\t\t\tthescore += 10;\n\t\t\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\t\t\tbullet = null;\n\t\t\t\t\t\tif (i == 0 || i == 10) {\n\t\t\t\t\t\t\talien3[i].img_file = \"black.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// destroy cannon if shot\n\t\t\tif (shot1 != null) {\n\t\t\t\tif (shot1.intersects(cannon)){ dead = true; \n\t\t\t\tthelives = thelives - 1;\n\t\t\t\tStdAudio.play(\"bigboom.wav\");\n\t\t\t\tcannon.img_file = \"dead.jpg\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (shot2 != null) {\n\t\t\t\tif (shot2.intersects(cannon)){ dead = true; \n\t\t\t\tthelives = thelives - 1;\n\t\t\t\tStdAudio.play(\"bigboom.wav\");}\n\t\t\t\tcannon.img_file = \"dead.jpg\";\n\t\t\t}\n\n\t\t\t// ends the game when all lives are lost\n\t\t\tif (thelives <= 0) {\n\t\t\t\tplaying = false; \n\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\tstatus.setText(\"You have been killed and Earth has been \" +\n\t\t\t\t\t\t\"destroyed. You are a terrible defender \" +\n\t\t\t\t\t\t\"of humanity. \");\n\t\t\t}\n\n\t\t\t//makes sure lives cannot become negative\n\t\t\tif (thelives <= 0) {\n\t\t\t\tthelives = 0;\n\t\t\t\tdeadcannon = new DeadCannon(COURT_WIDTH, COURT_HEIGHT);\n\t\t\t\tdeadcannon.pos_x = cannon.pos_x;\n\t\t\t\tStdAudio.play(\"loss.wav\");\n\t\t\t}\n\n\t\t\t//set the text labels at the bottom of the screen\n\t\t\tmyscore.setText(\"Score = \"+ Integer.toString(thescore)+ \" \");\n\t\t\tmylives.setText(\"Lives = \"+ Integer.toString(thelives));\n\t\t\trepaint();\n\t\t\n\t\t\t//move cannon\n\t\t\tcannon.move();\n\t\t} \n\t}", "private void generateAudio() {\n soundHandler.generateTone();\n }", "public synchronized void playExclaimSound()\n {\n if (PLAY_EXCLAIM_SOUND_RUNNABLE == null)\n {\n PLAY_EXCLAIM_SOUND_RUNNABLE = (Runnable)Toolkit.getDefaultToolkit().getDesktopProperty(EXCLAIM_SOUND_PROPERTY_NAME);\n }\n if (PLAY_EXCLAIM_SOUND_RUNNABLE != null)\n {\n PLAY_EXCLAIM_SOUND_RUNNABLE.run();\n }\n }", "protected String getDeathSound()\n {\n return \"mob.spider.death\";\n }", "public static void playerRun()\n {\n runSound.playLooped();\n }", "public void monsterSound(){\n System.out.println(\"\\n\\nYou hear gutteral moans and the shambling of a creature nearby.\\n\\n\");\n }", "@Override\n\tpublic void OnFailCommand() {\n\t\tSoundManage.playSound(failSound);\n\t\tsuper.OnFailCommand();\n\t}", "public void stopShooting() {\n\t\tgetWeapon().releaseMain();\n\t\tsetShooting(false);\n\t}", "@Override\n\tprotected String getDeathSound() {\n\t\treturn \"mob.endermen.death\";\n\t}", "@Override\n protected String produceSound(){\n return \"BauBau\";\n\n }", "@Override\n\tpublic String makeSound() {\n\t\treturn ANIMAL_SOUND;\n\t}", "private void stopAudio() {\r\n // stop playback if possible here!\r\n }", "protected SoundEvent getDeathSound()\n {\n return MCSoundEvents.ENTITY_BUM_DEATH;\n }", "@Override\r\n\tpublic void sound() {\r\n\t\tsuper.sound();\r\n\t\tSystem.out.println(\"SportsCar sound: Vutututututu\");\r\n\t}", "@Override\n public void playSound(int soundId) {\n\n }", "public void playGoombaSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, GOOMBA);\n\t}", "public void stopShoot(){\n\t\tshoot.set(0);\n\t}", "public abstract void makeSound();", "public void gameComplete() {\n if (soundToggle == true) {\n gameComplete.start();\n } // if\n }", "public void playHoomans() {\r\n System.out.println(\"Thanks for killing each other, human!\");\r\n }", "public void beep() {\n\t\tif (Tuna.isSoundAllowed()) {\n\t\t\tjava.awt.Toolkit.getDefaultToolkit().beep();\n\t\t}\n\t}", "public void errorSound()\n {\n InputStream pathSoundFile = getClass().getResourceAsStream(\"Error.wav\");\n playSound(pathSoundFile);\n }", "public void AudioMuerte() {\r\n\t\ttry {\r\n\t\t\tdeath.AbrirFichero(\"C:\\\\Temp\\\\Sonidos\\\\golpe.wav\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Error: \" + e);\r\n\t\t}\r\n\t}", "public void cowSound() {\n System.out.println(\"The cow sounds : meeee\");\n }", "public void stopPlaying() {\n seq.stop();\n }", "private void createAsteroidExplosion(AsteroidsAsteroid asteroid) {\n\t\tAsteroidsExplosion explosion = new AsteroidsExplosion(GameObject.ROOT, this, 25, asteroid.getRadius() * 3.0, 1.0);\n\t\texplosion.translate(asteroid.getPositionVector());\n\t\totherObjects.add(asteroid);\n\t}", "public static void stop() {\r\n\r\n if (soundLoop!=null)\r\n {\r\n soundLoop.stop();\r\n }\r\n }", "public void crashAsteroidPS()\n\t{\n\t\t//collision can only occur if at least one asteroid and\n\t\t//a PlayerShip are spawned\n\t\tif(gameObj[1].size() > 0 && gameObj[0].size() > 0)\n\t\t{\n\t\t\tint ast = new Random().nextInt(gameObj[0].size());\n\t\t\tgameObj[0].remove(ast);\n\t\t\tgameObj[1].remove(0);\n\t\t\tlives--;\n\t\t\tSystem.out.println(\"An asteroid has struck the players ship -1 life\");\n\t\t\tif(lives >0) \n\t\t\t\tSystem.out.println(\"you have \" + lives + \" lives left\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Game over\");\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}else\n\t\t\tSystem.out.println(\"A player ship and an asteroid are not spawned\");\n\n\t}", "private void gameSound(int attack){\n switch (attack){\n case 1:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_lightattack);\n break;\n case 2:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_strongattack);\n break;\n case 3:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_brutalattack);\n break;\n }\n mediaPlayer.start();\n }", "protected void onTick() {\n//Count down\nif (w > 0) {\nSystem.out.println(w + \" seconds left.\");\n\nw--;\n} else {\nSystem.out.println(\"Bye, bye\");\nmyAgent.doDelete(); //Delete this agent\n}\n}", "private void playCameraShootSound()\n {\n AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);\n int volume = audioManager.getStreamVolume( AudioManager.STREAM_NOTIFICATION);\n if (volume > 0) {\n if (mCameraShootPlayer == null) {\n mCameraShootPlayer = MediaPlayer.create(this, Uri.parse(CAMERA_SOUND_FILE));\n }\n if (mCameraShootPlayer != null) {\n mCameraShootPlayer.start();\n }\n }\n }", "public void play() {\n\t\t\r\n\t}", "public static void playSound(){\r\n try{\r\n Clip clip = AudioSystem.getClip();\r\n clip.open(AudioSystem.getAudioInputStream(new File(\"Cheering.wav\")));\r\n clip.start();\r\n }\r\n catch (Exception exc){\r\n exc.printStackTrace(System.out);\r\n } \r\n }", "@Override\n\t\tpublic void run() {\n\t\t\tgenTone();\n\t\t\tplaySound();\n\t\t}", "public void playBeep(){\n //https://stackoverflow.com/questions/2618182/how-to-play-ringtone-alarm-sound-in-android\n try{\n //gets notification sound then plays it.\n Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);\n\n r.play();\n TimeUnit.MILLISECONDS.sleep(300);\n r.stop();\n\n }catch (Exception e){\n e.printStackTrace();\n }\n\n }", "@Override\n\tprotected String getDeathSound() {\n\t\treturn ZollernModInfo.MODID + \":hellduck.die\";\n\t}", "public void alienDestroyed() {\r\n\t\t// Place 6 debris objects where the alien was located\r\n\t\tplaceDebris(alien.getX(), alien.getY());\r\n\t\tplaceDebris(alien.getX() + 1, alien.getY() + 1);\r\n\r\n\t\t// Update the score\r\n\t\tnumScore += ALIENSHIP_SCORE[alien.getSize()];\r\n\t\tdisplay.setScore(numScore);\r\n\r\n\t\t// Expire the alien from the game\r\n\t\tParticipant.expire(alien);\r\n\r\n\t\t// Open the Alien destroyed sound in enhanced mode\r\n\r\n\t\topenAlienDestroyedSound();\r\n\r\n\t\t// Schedule a transition if all aliens have been destroyed\r\n\t\tif (pstate.countAliens() == 0) {\r\n\t\t\tscheduleTransition(END_DELAY);\r\n\t\t}\r\n\t}", "public void onKilled(AI ai) {\n\t\n}", "void stopMusic();", "public void onImpact() {\r\n die();\r\n }", "@Override\n public void playEnd() {\n }", "public void StopSound() {\r\n\t\tif (this.mp.isPlaying()) {\r\n\t\t\tmp.pause();\r\n\t\t}\r\n\t}", "private void quitarCorazones(){\n if(ramiro.estadoItem== Ramiro.EstadoItem.NORMAL){\n efectoDamage.play();\n vidas--;\n }\n }" ]
[ "0.735395", "0.67437726", "0.6050794", "0.60296065", "0.60185784", "0.6005829", "0.59573334", "0.5956544", "0.5908495", "0.58753866", "0.5870914", "0.5761995", "0.5754261", "0.57491213", "0.57159317", "0.57111245", "0.56878805", "0.56878805", "0.5663228", "0.5649813", "0.5640617", "0.5640617", "0.5605732", "0.5605313", "0.5595788", "0.55779713", "0.55597174", "0.5558934", "0.553734", "0.55337876", "0.5533439", "0.55280524", "0.552131", "0.5516182", "0.55146843", "0.55103844", "0.5482062", "0.5475871", "0.5464537", "0.54630035", "0.5445205", "0.5429699", "0.5428335", "0.54274106", "0.54113543", "0.54087514", "0.5405881", "0.54031974", "0.5402014", "0.538842", "0.5388014", "0.53815484", "0.5375484", "0.5370767", "0.5367255", "0.5350611", "0.5346431", "0.5341561", "0.53375065", "0.5334015", "0.53331745", "0.5331632", "0.5320676", "0.5317226", "0.5309405", "0.53022045", "0.5300284", "0.5296788", "0.52808595", "0.52604824", "0.52600104", "0.5259933", "0.5258872", "0.52579826", "0.5245115", "0.5238829", "0.5233104", "0.5230441", "0.5224465", "0.52199656", "0.5212307", "0.5203691", "0.52000606", "0.5197656", "0.51966417", "0.5191331", "0.51818115", "0.5173199", "0.51719093", "0.51660633", "0.5158539", "0.5151289", "0.5151201", "0.5148486", "0.5148379", "0.51377517", "0.5135131", "0.51313573", "0.5114829", "0.5106899" ]
0.6022481
4
Return the asteroid destroyed sound
public Clip getClipAsteroid() { return clipAsteroid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected String getDeathSound()\n {\n return null;\n }", "protected String getDeathSound()\n {\n return null;\n }", "protected String getLivingSound()\n {\n return null;\n }", "protected String getLivingSound()\n {\n return null;\n }", "public void playDeadSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, DEAD);\n\t}", "protected String getHurtSound()\n {\n return null;\n }", "protected String getHurtSound()\n {\n return null;\n }", "protected String getDeathSound() {\r\n\t\treturn \"mob.chicken.hurt\";\r\n\t}", "public void openAlienDestroyedSound() {\r\n\t\tif (clipAlienDestroyed.isOpen()) {\r\n\t\t\tclipAlienDestroyed.start();\r\n\t\t}\r\n\r\n\t\tif (!(clipAlienDestroyed.isActive())) {\r\n\t\t\t/*\r\n\t\t\t * clip.stop(); clip.flush();\r\n\t\t\t */\r\n\t\t\tclipAlienDestroyed.setFramePosition(0);\r\n\t\t}\r\n\r\n\t}", "String sound();", "protected String getDeathSound() {\n return \"mob.zombie.woodbreak\";\n }", "@Override\r\n\tpublic String doSound() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic String makeSound() {\n\t\treturn ANIMAL_SOUND;\n\t}", "protected SoundEvent getDeathSound()\n {\n return MCSoundEvents.ENTITY_BUM_DEATH;\n }", "protected String getHurtSound() {\n return \"dig.stone\";\n }", "@Override\n\tprotected SoundEvent getDeathSound() {\n\t\treturn getSoundManager().getDeathSound();\n\t}", "public String getSound()\r\n\t{\r\n\t\treturn \"Squeak Squeak Squeak\";\r\n\t}", "public void stopRandomSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.stopSound(MUSIC_FOLDER, SOUND_FILES[SOUND_FILES.length - 1]);\n\t}", "protected String getDeathSound()\n {\n return \"mob.spider.death\";\n }", "protected String getLivingSound() {\r\n\t\treturn \"mob.chicken.say\";\r\n\t}", "public void stopSound() {\n metaObject.stopSound();\n }", "public void birdDeath(){\n birdDeath[(int)(Math.random()*3)].play(1f);\n }", "public String getSound();", "@Override\n\tprotected String getLivingSound() {\n\t\treturn ZollernModInfo.MODID + \":hellduck.say\";\n\t}", "public void stopSound(){\n p.stop(as);\n }", "@Override\n protected String produceSound(){\n return \"BauBau\";\n\n }", "public void StopSound(ISoundOrigin origin);", "@Override\n\tprotected String getDeathSound() {\n\t\treturn ZollernModInfo.MODID + \":hellduck.die\";\n\t}", "public String sounds(){\n return (\"Moooooo :o\");\n }", "@Override\n\tprotected SoundEvent getAmbientSound() {\n\t\treturn getSoundManager().getLivingSound();\n\t}", "@Override\n\tprotected String getDeathSound() {\n\t\treturn \"mob.endermen.death\";\n\t}", "public void endSound()\n {\n if(!mute)\n {\n try {\n if(lastpowerUp.equals(\"RAINBOW\"))\n {\n sclip.stop();\n bclip.start();\n bclip.loop(Clip.LOOP_CONTINUOUSLY);\n }\n // Open an audio input stream.\n URL url = this.getClass().getClassLoader().getResource(\"Silence.wav\"); \n \n if(lastpowerUp.equals(\"BLUE\"))\n url = this.getClass().getClassLoader().getResource(\"Out Of Bounds Stop.wav\");\n else if(lastpowerUp.equals(\"YELLOW\")||lastpowerUp.equals(\"DOUBLE\") || lastpowerUp.equals(\"WHITE\") || (lastpowerUp.equals(\"TROLL\") && modeT))\n url = this.getClass().getClassLoader().getResource(\"Mushroom Down.wav\") ;\n else if(lastpowerUp.equals(\"BLACK\") || lastpowerUp.equals(\"TROLL\"))\n url = this.getClass().getClassLoader().getResource(\"Invisible Off.wav\");\n \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn); \n \n clip.start();\n \n \n \n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n \n } \n }\n }", "abstract String getSound();", "public static void playRandomDeath() {\n\t\t\n\t\tString[] deathSoundArray = {\"death1\", \"death2\", \"death3\"};\n\t\t\n\t\tint rnd = new Random().nextInt(deathSoundArray.length);\n\t\tplaySound(deathSoundArray[rnd], 0.4f);\n\t}", "@Override\n\tprotected String getHurtSound() {\n\t\treturn ZollernModInfo.MODID + \":hellduck.hurt\";\n\t}", "protected String getHurtSound() {\r\n\t\treturn \"mob.chicken.hurt\";\r\n\t}", "protected SoundEvent getAmbientSound()\n {\n if (timetopee > 0 || bumgave )\n {\n return MCSoundEvents.ENTITY_BUM;\n }\n else\n {\n return MCSoundEvents.ENTITY_BUM_LIVINGPEE;\n }\n }", "@Override\n\tpublic String sing() {\n\t\treturn this.sound;\n\t}", "public Sound getSoundDying() {\n return soundDying;\n }", "public void loseNoise()\n {\n if(!mute)\n {\n try { \n URL url = this.getClass().getClassLoader().getResource(\"Doh.wav\"); \n \n double c = Math.random();\n \n if(crash())\n {\n if(c>.20 && c<.45)\n url = this.getClass().getClassLoader().getResource(\"Doh2.wav\");\n else if(c>=.45 && c<.75)\n url = this.getClass().getClassLoader().getResource(\"Doh3.wav\");\n else if(c>=.75 && c<=1)\n url = this.getClass().getClassLoader().getResource(\"Doh4.wav\");\n }\n \n else if(outOfBounds())\n //else\n {\n url = this.getClass().getClassLoader().getResource(\"MM Game Over.wav\");\n if(c>.50 && c<=.75)\n url = this.getClass().getClassLoader().getResource(\"SM3 Game Over.wav\");\n if(c>.75 && c<=1)\n url = this.getClass().getClassLoader().getResource(\"DK Game Over.wav\");\n }\n if(modeT)\n {\n url = this.getClass().getClassLoader().getResource(\"MM Game Over.wav\");\n if(c>.50 && c<=.75)\n url = this.getClass().getClassLoader().getResource(\"SM3 Game Over.wav\");\n if(c>.75 && c<=1)\n url = this.getClass().getClassLoader().getResource(\"DK Game Over.wav\");\n }\n \n if(difficult.equals(\"GHOST\"))\n {\n //if(outOfBounds())\n url = this.getClass().getClassLoader().getResource(\"PM Game Over.wav\");\n //else if(crash())\n // url = this.getClass().getClassLoader().getResource(\"PM2 Game Over.wav\");\n }\n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n lclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n lclip.open(audioIn); \n \n lclip.start();\n \n \n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n } \n }\n }", "public void explosion(){\n explosionEffect.play(pitch, volume);\n }", "@Override\n\tprotected String getHurtSound() {\n\t\treturn \"mob.creeper.say\";\n\t}", "public static void pop_sound() {\n\t\tm_player_pop.start();\n\t\tm_player_pop.setMediaTime(new Time(0));\n\t}", "public String getBreakSound() {\n\t\treturn \"dig.stone\";\n\t}", "protected String getHurtSound()\n {\n return \"mob.spider.say\";\n }", "public final String getSound( ) {\n\t\treturn sound;\n\t}", "public void openAsteroidSound() {\r\n\t\tsound a;\r\n\t\ttry {\r\n\t\t\ta = new sound();\r\n\t\t\tClip asteroidSound = a.getSoundAsteroid();\r\n\t\t\tasteroidSound.open(streamAsteroid);\r\n\t\t\tif (clipAsteroid.isOpen()) {\r\n\t\t\t\tclipAsteroid.start();\r\n\t\t\t}\r\n\r\n\t\t\tif (!(clipAsteroid.isActive())) {\r\n\t\t\t\t/*\r\n\t\t\t\t * clip.stop(); clip.flush();\r\n\t\t\t\t */\r\n\t\t\t\tclipAsteroid.setFramePosition(0);\r\n\t\t\t}\r\n\t\t} catch (LineUnavailableException e) {\r\n\t\t} catch (UnsupportedAudioFileException e) {\r\n\t\t} catch (IOException e) {\r\n\t\t}\r\n\r\n\t}", "static void soundsEZ() {\n\t\tapplauseSound = EZ.addSound(\"applause.wav\");\n\t\twallSound = EZ.addSound(\"stone1.wav\");\n\t\tdiamondSound = EZ.addSound(\"glass1.wav\");\n\t}", "public void playGameOverSound() {\n\t\ttry {\n\t\t\tAudioInputStream audioStream = AudioSystem.getAudioInputStream(new File(\"Musik/DeadSound.wav\"));\n\t\t\t\n\t\t\tClip clip = AudioSystem.getClip(); \n\t\t\tclip.open(audioStream);\n\t\t\t\n\t\t\tboolean oldStatus = settings.isPlaying(); \n\t\t\t\n\t\t\tstopMusik();\n\t\t\t\n\t\t\t\n\t\t\tthis.settings.setPlaying(oldStatus);\n\t\t\tclip.start();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public static void playExplosion()\n {\n combust.play();\n if (combust.audioClip.getFramePosition() ==\n combust.audioClip.getFrameLength())\n {\n combust.audioClip.setFramePosition(0);\n combust.audioClip.stop();\n }\n }", "public void playSoundGameLost() {\n\t\tlostGameSound.play();\n\t}", "public String getPlaceSound() {\n\t\treturn \"random.anvil_land\";\n\t}", "PlaySound getSound();", "@Override\n\tpublic String sound() {\n\t\treturn \"Roars\";\n\t}", "public Sound getSoundHurt() {\n return soundHurt;\n }", "@Override\n public void stopSound(){\n gameMusic.stop();\n }", "public SoundEvent getFallSound() {\n/* 103 */ return this.fallSound;\n/* */ }", "public void playAmbientSound() {\n if (!this.isClosed()) {\n super.playAmbientSound();\n }\n\n }", "public void monsterSound(){\n System.out.println(\"\\n\\nYou hear gutteral moans and the shambling of a creature nearby.\\n\\n\");\n }", "@Override\n public double getEngineSound() {\n return decoratedEngine.getEngineSound() * .6;\n }", "protected void stopTheSound(){\n mp.stop();\n }", "public String interact() {\n return sound;\n }", "protected SoundEvent getHurtSound()\n {\n return MCSoundEvents.ENTITY_BUM_HURT;\n }", "private void generateAudio() {\n soundHandler.generateTone();\n }", "public String getSoundDescription() {\n if (getSound() == null) {\n return ChatColor.YELLOW + \"none\";\n } else {\n StringBuilder s = new StringBuilder();\n s.append(ChatColor.GOLD).append(\"sound \");\n s.append(ChatColor.YELLOW).append(getSound());\n s.append(ChatColor.GOLD).append(\" range \");\n s.append(ChatColor.YELLOW).append(String.format(\"%1.1fm\", getSoundVolume() * 15));\n s.append(ChatColor.GOLD).append(\" at \");\n s.append(ChatColor.YELLOW).append(String.format(\"%1.1f\", getSoundPitch()));\n s.append(ChatColor.GOLD).append('x');\n return s.toString();\n }\n }", "public synchronized void stopSound() {\r\n running = false;\r\n }", "public void ReproduceAudio() { \r\n\t\ttry {\r\n\t\t\t//en caso de que como nombre pongas \"undertale\" la musica sera diferente.\r\n\t\t\tif (Menu.jugador.equals(\"undertale\") || Menu.jugador.equals(\"Undertale\")) {\r\n\t\t\t\trepro.AbrirFichero(\"C:\\\\Temp\\\\Sonidos\\\\undertale.wav\");\r\n\t\t\t\t//emppieza la musica\r\n\t\t\t\trepro.Play();\r\n\t\t\t//musica por defecto\r\n\t\t\t} else {\r\n\t\t\t\trepro.AbrirFichero(\"C:\\\\Temp\\\\Sonidos\\\\tetris.mp3\");\r\n\t\t\t\trepro.Play();\r\n\t\t\t}\t\r\n\t\t} catch (Exception ex) {\r\n\t\t\tSystem.out.println(\"Error: \" + ex.getMessage());\r\n\t\t}\r\n\t}", "@Override\n public void makeSound() {\n\n }", "@Override\n public void makeSound() {\n\n }", "public boolean getSoundAmbience() { return soundAmbience; }", "private void playCollisionSound()\n {\n try\n {\n if (checkCollisions())\n {\n lives--;\n this.livesTextField.setText(\"\" + lives);\n java.io.File soundFile = new java.io.File(\n \"C:\\\\Windows\\\\Media\\\\ir_end.wav\");\n javax.sound.sampled.AudioInputStream audioIn =\n javax.sound.sampled.AudioSystem.getAudioInputStream(\n soundFile);\n javax.sound.sampled.Clip clip =\n javax.sound.sampled.AudioSystem.getClip();\n\n clip.open(audioIn);\n clip.start();\n }\n }\n catch (Exception ex)\n {\n System.out.println(ex);\n }\n }", "public void highscorenoise()\n {\n if(!mute)\n {\n try\n { \n URL url = this.getClass().getClassLoader().getResource(\"Darkmoon Caverns.wav\");\n double c = Math.random();\n if(c<=.25)\n url = this.getClass().getClassLoader().getResource(\"Mario Kart Win.wav\");\n else if(c<=.50)\n url = this.getClass().getClassLoader().getResource(\"Pirate Lagoon.wav\");\n else if(c<=.75)\n url = this.getClass().getClassLoader().getResource(\"Crescent Island.wav\"); \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n hclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n hclip.open(audioIn); \n \n hclip.start();\n hclip.loop(Clip.LOOP_CONTINUOUSLY);\n \n } \n catch (UnsupportedAudioFileException e)\n {\n e.printStackTrace();\n } \n catch (IOException e) \n {\n e.printStackTrace();\n } \n catch (LineUnavailableException e) \n {\n e.printStackTrace();\n } \n }\n }", "public SoundClip getSound() {\n return socSound;\n }", "@Override\n\tprotected SoundEvent getHurtSound(DamageSource damageSourceIn) {\n\t\treturn getSoundManager().getHurtSound();\n\t}", "private void playGameOverSound()\n {\n try\n {\n java.io.File soundFile = new java.io.File(\n \"C:\\\\Windows\\\\Media\\\\ringout.wav\");\n javax.sound.sampled.AudioInputStream audioIn =\n javax.sound.sampled.AudioSystem.getAudioInputStream(\n soundFile);\n javax.sound.sampled.Clip clip =\n javax.sound.sampled.AudioSystem.getClip();\n\n clip.open(audioIn);\n clip.start();\n }\n catch (Exception ex)\n {\n System.out.println(ex);\n }\n }", "public void pauseSound() {\n\t\tclip.stop();\n\t}", "public void foodSound(){\n if (enableSound){\r\n\t clip.play();\r\n }\r\n\t\t\r\n\t}", "public void PauseSound();", "protected float getSoundVolume()\n {\n return 0.4F;\n }", "private FunctionSoundD getFunctionSound() {\n\t\tif (functionSound == null) {\n\t\t\ttry {\n\t\t\t\tfunctionSound = new FunctionSoundD();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.error(\"Problem in getFunctionSound(): \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\treturn functionSound;\n\t}", "public abstract void makeSound();", "public static AudioPlayer getDEFAULTSHOOTSOUND() {\r\n\t\treturn DEFAULTSHOOTSOUND;\r\n\t}", "public boolean getSoundShot() { return soundShot; }", "public void StopSound() {\r\n\t\tif (this.mp.isPlaying()) {\r\n\t\t\tmp.pause();\r\n\t\t}\r\n\t}", "public String getSoundPath();", "public void warningSound() {\n\t\tSystem.out.println(signal);\n\t}", "public void stopSound(ISound sound) {\n/* 354 */ if (this.loaded) {\n/* */ \n/* 356 */ String s = this.invPlayingSounds.get(sound);\n/* */ \n/* 358 */ if (s != null)\n/* */ {\n/* 360 */ this.sndSystem.stop(s);\n/* */ }\n/* */ } \n/* */ }", "public void stop() {\n\t\tsound.stop();\n\t}", "public static void GameOverCrashSound(){\n if(soundActivated) {\n if(!crashSoundDone) {\n AudioManager audioManager = (AudioManager) mActivity.getSystemService(AUDIO_SERVICE);\n float actualVolume = (float) audioManager\n .getStreamVolume(AudioManager.STREAM_MUSIC);\n float maxVolume = (float) audioManager\n .getStreamMaxVolume(AudioManager.STREAM_MUSIC);\n float volume = actualVolume / maxVolume;\n mSound.play(soundCrash, volume, volume, 1, 0, 1f);\n\n crashSoundDone = true;\n\n }\n }\n }", "@Override\r\n\tpublic void sound() {\r\n\t\tsuper.sound();\r\n\t\tSystem.out.println(\"SportsCar sound: Vutututututu\");\r\n\t}", "public Sound getSound() {\n return _sound;\n }", "public void unloadSoundSystem() {\n/* 205 */ if (this.loaded) {\n/* */ \n/* 207 */ stopAllSounds();\n/* 208 */ this.sndSystem.cleanup();\n/* 209 */ this.loaded = false;\n/* */ } \n/* */ }", "public static void charge_sound() {\n\t\tm_player_charge.start();\n\t\tm_player_charge.setMediaTime(new Time(0));\n\t}", "@Override\n\tpublic void sound() {\n\t\tSystem.out.println(\"Dog2..sound.\");\n\t\t\n\t}", "public static void clearSounds() {\r\n\t\tMain.soundBags = \"\";\r\n\t\tMain.soundSet = \"\";\r\n\t\tMain.soundWin = \"\";\r\n\t\tMain.soundLose = \"\";\r\n\t\tMain.soundGameStart= \"\";\r\n\t}", "public boolean isSound() {\n\t\treturn true;\n\t}", "public void playSoundFail() {\n\t\tfailSound.play();\n\t}", "public static void game_sound() {\n\t\tm_player_game.start();\n\t\tm_player_game.setMediaTime(new Time(0));\n\t}", "public MovieTag streamSound() throws IOException, DataFormatException {\r\n return decoder.streamSound();\r\n\r\n }", "public static void stopSound() {\n if(mAudioManager != null) {\n mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, originalVolume, 0);\n }\n if (mp != null) {\n mp.stop();\n Log.d(TAG, \"Stop Sound\");\n }\n }", "public void gameOver(){\n gameOverMusic.loop(pitch, volume);\n }" ]
[ "0.7028965", "0.7028965", "0.6924754", "0.6924754", "0.6828576", "0.67517585", "0.67517585", "0.6566616", "0.6559704", "0.65368474", "0.6533562", "0.6428394", "0.6404196", "0.6400156", "0.63992", "0.6390415", "0.63157123", "0.63106984", "0.623192", "0.6207044", "0.6182993", "0.6179614", "0.6159425", "0.6156054", "0.6113286", "0.60992455", "0.6082772", "0.60690683", "0.6058878", "0.6056742", "0.59653676", "0.59591484", "0.5951644", "0.59409976", "0.59274167", "0.592522", "0.5917882", "0.59137267", "0.58985573", "0.5893136", "0.58766687", "0.586621", "0.58638257", "0.58564156", "0.58418787", "0.5841574", "0.58268666", "0.581882", "0.5815222", "0.5796797", "0.5793808", "0.5778048", "0.57739013", "0.5772015", "0.57674927", "0.57576907", "0.57522637", "0.57510614", "0.5739641", "0.57243073", "0.57137746", "0.57106906", "0.57075083", "0.5702585", "0.57023144", "0.5695918", "0.56944215", "0.56766343", "0.56766343", "0.5676167", "0.56250274", "0.56172705", "0.56041366", "0.5599988", "0.558854", "0.55833703", "0.5578294", "0.5573378", "0.5573228", "0.557251", "0.5570023", "0.55544233", "0.55464125", "0.55214214", "0.5520863", "0.55153364", "0.5503158", "0.54950595", "0.5488699", "0.54860103", "0.5457738", "0.54454345", "0.5444273", "0.5435166", "0.54219306", "0.5413801", "0.54095274", "0.5378612", "0.5372947", "0.5352174", "0.53464586" ]
0.0
-1
This setter method should only be used by unit tests
protected void setInspectionCategoryMappingService(InspectionCategoryMappingService service) { this.inspectionCategoryMappingService = service; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testSet() {\n\t}", "@Test\r\n public void testSetValor() {\r\n \r\n }", "@Test\r\n public void testSetUserId() {\r\n System.out.println(\"setUserId\");\r\n int userId = 0;\r\n \r\n instance.setUserId(userId);\r\n assertEquals(userId , instance.getUserId());\r\n \r\n }", "protected abstract Set method_1559();", "@Override\n\tpublic void setValue(Object value) {\n\t\t\n\t}", "@Test\r\n\tpublic void testSetDate() {\n\t\tfail(\"Not yet implemented\");\r\n\t}", "@Test\n public void testSetValue() {\n System.out.println(\"setValue\");\n Object value = null;\n Setting instance = null;\n instance.setValue(value);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "protected void setValue(T value) {\r\n this.value = value;\r\n }", "@Test\r\n public void testSetDescription() {\r\n System.out.println(\"setDescription\");\r\n String description = \"\";\r\n \r\n instance.setDescription(description);\r\n assertEquals(description, instance.getDescription());\r\n \r\n }", "private SetProperty(Builder builder) {\n super(builder);\n }", "@Test\r\n public void testSetUsuario() {\r\n System.out.println(\"setUsuario\");\r\n String usuario = \"\";\r\n Usuario instance = new Usuario();\r\n instance.setUsuario(usuario);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }", "@Test\n public void test_setEmail() {\n String value = \"new_value\";\n instance.setEmail(value);\n\n assertEquals(\"'setEmail' should be correct.\",\n value, TestsHelper.getField(instance, \"email\"));\n }", "String setValue();", "@Test\n public void testSetName() {\n System.out.println(\"setName\");\n\n Setting instance = Setting.factory();\n String oldName = instance.getName();\n assertFalse(Setting.isNotUsed(oldName));\n String name = \"newName\";\n instance.setName(name);\n assertEquals(name, instance.getName());\n assertTrue(Setting.isNotUsed(oldName));\n assertFalse(Setting.isNotUsed(name));\n\n }", "@Test\n public void testSetUsuarioId() {\n System.out.println(\"setUsuarioId\");\n long usuarioId = 0L;\n Reserva instance = new Reserva();\n instance.setUsuarioId(usuarioId);\n \n }", "@Test\n public void test_setTelephone() {\n String value = \"new_value\";\n instance.setTelephone(value);\n\n assertEquals(\"'setTelephone' should be correct.\",\n value, TestsHelper.getField(instance, \"telephone\"));\n }", "public void setValue(Object value) { this.value = value; }", "@Override\n\t\tpublic void set(E arg0) {\n\t\t\t\n\t\t}", "void setValue(T value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}", "@Test\r\n public void testSetNombre() {\r\n String nombre = \"Prueba\";\r\n articuloPrueba.setNombre(nombre);\r\n assertEquals(nombre, articuloPrueba.getNombre());\r\n }", "@Test\r\n public void testSetListingTitle() {\r\n System.out.println(\"setListingTitle\");\r\n String listingTitle = \"\";\r\n \r\n instance.setListingTitle(listingTitle);\r\n assertEquals(listingTitle, instance.getListingTitle());\r\n \r\n }", "@Test\r\n public void testSetStudentID() {\r\n System.out.println(\"setStudentID\");\r\n String studentID = \"\";\r\n Student instance = new Student();\r\n instance.setStudentID(studentID);\r\n \r\n }", "public abstract void set(M newValue);", "@Test\n public void testSetPhone() {\n System.out.println(\"setPhone\");\n user.setPhone(\"110\");\n assertEquals(\"110\", user.getPhone());\n }", "@Test\n public void testSetAddress() {\n System.out.println(\"setAddress\");\n user.setAddress(\"Tiquipaya\");\n assertEquals(\"Tiquipaya\", user.getAddress());\n }", "@Test\n @Ignore\n public void testSetValue_Object() {\n System.out.println(\"setValue\");\n Object value = null;\n Setting instance = null;\n instance.setValue(value);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "Object setValue(Object value) throws NullPointerException;", "@Test\n public void test_setFirstName() {\n String value = \"new_value\";\n instance.setFirstName(value);\n\n assertEquals(\"'setFirstName' should be correct.\",\n value, TestsHelper.getField(instance, \"firstName\"));\n }", "@Test\n public void testSetNombre() {\n System.out.println(\"setNombre\");\n String nombre = \"T-3\";\n DboEdificio instance = new DboEdificio(1, \"T-3\");\n instance.setNombre(nombre);\n \n }", "protected void afterPropertiesSetInternal() {\n\t\t// override this method\n\t}", "@Test\n public void testSetUsuarioPaciente() {\n System.out.println(\"setUsuarioPaciente\");\n Usuario usuarioPaciente = null;\n Paciente instance = new Paciente();\n instance.setUsuarioPaciente(usuarioPaciente);\n\n }", "public void setValue(T value) {\n/* 89 */ this.value = value;\n/* */ }", "@Test\n public void testSetTipoSangre() {\n System.out.println(\"setTipoSangre\");\n String tipoSangre = \"\";\n Paciente instance = new Paciente();\n instance.setTipoSangre(tipoSangre);\n \n }", "@Test\r\n public void testSetFoodName()\r\n {\r\n System.out.println(\"setFoodName\");\r\n String foodName = \"Mac and cheese\";\r\n FoodBean instance = new FoodBean(5, \"Beans on toast\", \r\n Date.valueOf(\"2014-04-01\"), Time.valueOf(\"10:00:00\"), \r\n 100, 120, 5, 7, 500, 0, 3);\r\n instance.setFoodName(foodName);\r\n assertEquals(foodName, instance.getFoodName());\r\n }", "public void setValue(T value) {\n/* 134 */ this.value = value;\n/* */ }", "@Test\n public void testSetLostValues() {\n System.out.println(\"setLostValues\");\n }", "public void setEmployee(String employee)\r\n/* 43: */ {\r\n/* 44:47 */ this.employee = employee;\r\n/* 45: */ }", "@Override\n\tpublic void setTest() {\n\t}", "@Test\n public void test_getFirstName() {\n String value = \"new_value\";\n instance.setFirstName(value);\n\n assertEquals(\"'getFirstName' should be correct.\",\n value, instance.getFirstName());\n }", "private void assignment() {\n\n\t\t\t}", "@Test\n public void testSetCategoryDescription() {\n System.out.println(\"setCategoryDescription\");\n String CategoryDescription = \"testDescription\";\n Category instance = new Category();\n instance.setCategoryDescription(CategoryDescription);\n assertEquals(CategoryDescription, instance.getCategoryDescription());\n }", "@Test\r\n public void testSetEndTime() {\r\n System.out.println(\"setEndTime\");\r\n String endTime = \"\";\r\n \r\n instance.setEndTime(endTime);\r\n assertEquals(endTime, instance.getEndTime());\r\n \r\n }", "@Override\n\tpublic void setValue(Object object) {\n\t\t\n\t}", "@Test\n public void test_setUsername() {\n String value = \"new_value\";\n instance.setUsername(value);\n\n assertEquals(\"'setUsername' should be correct.\",\n value, TestsHelper.getField(instance, \"username\"));\n }", "@Test\n public void testSetQuantity() {\n o1.setQuantity(2);\n assertEquals(\"setQuantity failed\", 2, o1.getQuantity());\n }", "@Test\n public void testSetIdPaciente() {\n System.out.println(\"setIdPaciente\");\n Integer idPaciente = null;\n Paciente instance = new Paciente();\n instance.setIdPaciente(idPaciente);\n \n }", "@Test\n public void test_getTelephone() {\n String value = \"new_value\";\n instance.setTelephone(value);\n\n assertEquals(\"'getTelephone' should be correct.\",\n value, instance.getTelephone());\n }", "@Test\n public void testSetTipoFinal() {\n System.out.println(\"setTipoFinal\");\n String tipoFinal = \"\";\n Reserva instance = new Reserva();\n instance.setTipoFinal(tipoFinal);\n \n }", "@Test\n public void testSetBusinessName() {\n \n assertNull(o2.getBusinessName());\n o2.setBusinessName(\"testName2\");\n assertNotNull(o2.getBusinessName());\n assertEquals(\"testName2\", o2.getBusinessName());\n }", "@Test\n public void testSetManagerId() {\n System.out.println(\"setManagerId\");\n int manager_id = 0;\n Manager instance = new Manager();\n instance.setManagerId(manager_id);\n \n fail(\"The test case is a prototype.\");\n }", "@Test\r\n\tpublic void testSetYear() {\r\n\t\tmeetingu1.setYear(3);\r\n\t\tassertTrue(meetingu1.getYear() == 3);\r\n\t}", "@Test\r\n public void testSetCodigo() {\r\n int expResult = 4;\r\n articuloPrueba.setCodigo(expResult);\r\n assertEquals(expResult, articuloPrueba.getCodigo());\r\n }", "@Test\n public void testSetDescription() {\n System.out.println(\"setDescription\");\n \n String description = \"Description\";\n \n instance.setDescription(description);\n \n assertEquals(\"Description unchanged\", description, instance.getDescription());\n // TODO review the generated test code and remove the default call to fail.\n // fail(\"The test case is a prototype.\");\n }", "@Test\n\tpublic void testSetPositionWithoutUpdate() {\n\t}", "@Test\n public void testSetUserId1() {\n user1.setUserId(1);\n assertEquals(\"Id should be 1\", 1, user1.getUserId());\n }", "@Override\n\tpublic void setValue(Object object) {\n\n\t}", "@Override\r\n\t\tpublic void set(E arg0) {\n\r\n\t\t}", "@Test\n public void test_getEmail() {\n String value = \"new_value\";\n instance.setEmail(value);\n\n assertEquals(\"'getEmail' should be correct.\",\n value, instance.getEmail());\n }", "public abstract void setValue(T value);", "@Test\n public void test_getLastName() {\n String value = \"new_value\";\n instance.setLastName(value);\n\n assertEquals(\"'getLastName' should be correct.\",\n value, instance.getLastName());\n }", "@Test\r\n public void testSetMaterial() {\r\n String expResult = \"pruebaMaterial\";\r\n articuloPrueba.setMaterial(expResult);\r\n assertEquals(expResult, articuloPrueba.getMaterial());\r\n }", "public void testSetNewValue_Accuracy() {\r\n String newValue = \"newValue\";\r\n auditDetail.setNewValue(newValue);\r\n assertEquals(\"The newValue value should be set properly.\", newValue,\r\n UnitTestHelper.getPrivateField(AuditDetail.class, auditDetail, \"newValue\").toString());\r\n }", "private void setPropertyInternal(String name, String value) {\n PropertyHelper ph = PropertyHelper.getPropertyHelper(this);\n ph.setProperty(null, name, value, false);\n }", "public void set()\r\n {\r\n isSet = true;\r\n }", "@Test\r\n public void testSetProteinPerHundredGrams()\r\n {\r\n System.out.println(\"setProteinPerHundredGrams\");\r\n double proteinPerHundredGrams = 123.0;\r\n FoodBean instance = new FoodBean(5, \"Beans on toast\", \r\n Date.valueOf(\"2014-04-01\"), Time.valueOf(\"10:00:00\"), \r\n 100, 120, 5, 7, 500, 0, 3);\r\n instance.setProteinPerHundredGrams(proteinPerHundredGrams);\r\n assertEquals(proteinPerHundredGrams, instance.getProteinPerHundredGrams(), 0.0);\r\n }", "@Override\n public void setValue(Object val)\n {\n value = val;\n }", "@Test\n public void test_setLastName() {\n String value = \"new_value\";\n instance.setLastName(value);\n\n assertEquals(\"'setLastName' should be correct.\",\n value, TestsHelper.getField(instance, \"lastName\"));\n }", "@Test\r\n public void testSetlName() {\r\n System.out.println(\"setlName\");\r\n String lName = \"\";\r\n Student instance = new Student();\r\n instance.setlName(lName);\r\n \r\n }", "@Test\r\n public void testSetfName() {\r\n System.out.println(\"setfName\");\r\n String fName = \"\";\r\n Student instance = new Student();\r\n instance.setfName(fName);\r\n \r\n }", "@Test\n public void test_setNetworkId() {\n String value = \"new_value\";\n instance.setNetworkId(value);\n\n assertEquals(\"'setNetworkId' should be correct.\",\n value, TestsHelper.getField(instance, \"networkId\"));\n }", "@Test\n public void testSetPersonaPaciente() {\n System.out.println(\"setPersonaPaciente\");\n Persona personaPaciente = null;\n Paciente instance = new Paciente();\n instance.setPersonaPaciente(personaPaciente);\n\n }", "@Test\n public void test_getUsername() {\n String value = \"new_value\";\n instance.setUsername(value);\n\n assertEquals(\"'getUsername' should be correct.\",\n value, instance.getUsername());\n }", "private void set(){\n resetBuffer();\n }", "public void set(String name, Object value) {\n }", "void setValue(Object value);", "public void setdat()\n {\n }", "@Test\r\n public void testSetSamochod() {\r\n System.out.println(\"setSamochod\");\r\n Samochod samochod = null;\r\n Faktura instance = new Faktura();\r\n instance.setSamochod(samochod);\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 }", "@Test\r\n public void testSetUserOccupation()\r\n {\r\n System.out.println(\"setUserOccupation\");\r\n String userOccupation = \"Nurse\";\r\n String occupation = \"Doctor\";\r\n String[] hobbies = {\"Reading\", \"Cooking\"};\r\n int id = 5;\r\n LifeStyleBean instance = new LifeStyleBean(occupation, hobbies, id);\r\n instance.setUserOccupation(userOccupation);\r\n assertEquals(userOccupation, instance.getUserOccupation());\r\n }", "public void setValue(Object value);", "private void setData() {\n\n }", "@Test\n public void testSetGetEinheit() {\n \n String einheit = \"einheit\";\n messtyp.setEinheit(einheit);\n assertEquals(messtyp.getEinheit(), \"einheit\");\n }", "public void setValue(final Object value) { _value = value; }", "@Test\r\n public void testSetStartTime() {\r\n System.out.println(\"setStartTime\");\r\n String startTime = \"\";\r\n \r\n instance.setStartTime(startTime);\r\n assertEquals(startTime, instance.getStartTime());\r\n \r\n }", "@Test\n public void testSetFechaFin() {\n System.out.println(\"setFechaFin\");\n Date fechaFin = null;\n Reserva instance = new Reserva();\n instance.setFechaFin(fechaFin);\n \n }", "@Test\n public void testSetLugarNac() {\n System.out.println(\"setLugarNac\");\n String lugarNac = \"\";\n Paciente instance = new Paciente();\n instance.setLugarNac(lugarNac);\n \n }", "@Test\n public void testSetValue ()\n {\n System.out.println (\"setValue\");\n String name = \"\";\n QueryDatas instance = new QueryDatas (\"nom\", \"value\");\n instance.setValue (name);\n }", "@Test\r\n public void testSetEmail() {\r\n\r\n }", "public void testSetProperty() {\n rootBlog.setProperty(Blog.NAME_KEY, \"New name\");\n assertEquals(\"New name\", rootBlog.getProperty(Blog.NAME_KEY));\n assertEquals(\"New name\", rootBlog.getName());\n\n // and a new property\n rootBlog.setProperty(\"aNewPropertyKey\", \"A new property value\");\n assertEquals(\"A new property value\", rootBlog.getProperty(\"aNewPropertyKey\"));\n }", "@Test\r\n public void testSetNombreDepto() {\r\n System.out.println(\"setNombreDepto\");\r\n String nombreDepto = \"\";\r\n Departamento instance = new Departamento();\r\n instance.setNombreDepto(nombreDepto);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }", "@Test\n public void testSetUsername() {\n System.out.println(\"setUsername\");\n String username = \"\";\n Manager instance = new Manager();\n instance.setUsername(username);\n \n fail(\"The test case is a prototype.\");\n }", "@Test(expected=AssertionError.class)\n\tpublic void testPassInvalidToSettersAddress() {\n\t\tbeanTester.testSetterForField(\"invalid\");\n\t}", "@Override\n\tpublic void set(T e) {\n\t\t\n\t}", "@Override\n\tpublic void setValue(String arg0, String arg1) {\n\t\t\n\t}", "@Test\n public void test_getNetworkId() {\n String value = \"new_value\";\n instance.setNetworkId(value);\n\n assertEquals(\"'getNetworkId' should be correct.\",\n value, instance.getNetworkId());\n }", "@Test\n public void testSetPattern() {\n System.out.println(\"setPattern\");\n String v = \"___\";\n AbstractBarcodeBean instance = new AbstractBarcodeBeanImpl();\n instance.setPattern(v);\n assertEquals(v, instance.getPattern());\n }", "@Test\r\n public void testSetGenero() {\r\n System.out.println(\"setGenero\");\r\n String genero = \"\";\r\n Usuario instance = new Usuario();\r\n instance.setGenero(genero);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }", "@Test\r\n public void testSetId() {\r\n System.out.println(\"setId\");\r\n int lId = 0;\r\n \r\n instance.setId(lId);\r\n assertEquals(lId, instance.getId());\r\n \r\n }", "private void setValue(Object entity, Field targetField, String targetValue) {\n if ( null == entity || null == targetField || 0 >= targetField.getName().length() ) {\n throw new IllegalStateException();\n }\n final Method[] declaredMethods = entity.getClass().getDeclaredMethods();\n final String fieldName = targetField.getName();\n String expectedMethodName = null;\n if ( fieldName.length() > 1 ) {\n expectedMethodName = \"set\" + fieldName.substring(0).toUpperCase() + fieldName.substring(1, fieldName.length() - 1);\n } else {\n expectedMethodName = \"set\" + fieldName.substring(0).toUpperCase();\n }\n Method expectedMethod = null;\n for ( Method method : declaredMethods ) {\n if ( method.getName().equals(expectedMethodName) ) {\n expectedMethod = method;\n }\n }\n if ( null != expectedMethod ) {\n boolean accessibilityChanged = false;\n try {\n if ( !expectedMethod.isAccessible() ) {\n expectedMethod.setAccessible(true);\n accessibilityChanged = true;\n }\n expectedMethod.invoke(entity, targetValue);\n } catch (Exception e) {\n Logger.getLogger(getClass().getName()).log(Level.SEVERE, e.getMessage(), e);\n } finally {\n if ( accessibilityChanged ) {\n expectedMethod.setAccessible(false);\n }\n }\n } else {\n boolean accessibilityChanged = false;\n if ( !targetField.isAccessible() ) {\n targetField.setAccessible(true);\n accessibilityChanged = true;\n }\n try {\n targetField.set(entity, targetValue);\n } catch (Exception e) {\n Logger.getLogger(getClass().getName()).log(Level.SEVERE, e.getMessage(), e);\n } finally {\n if ( accessibilityChanged ) {\n targetField.setAccessible(false);\n }\n }\n }\n }", "@Test\r\n public void testSetOrigen() {\r\n String expResult = \"pruebaorigen\";\r\n articuloPrueba.setOrigen(expResult);\r\n assertEquals(expResult, articuloPrueba.getOrigen());\r\n }", "@Override\n public void set(T value) throws Exception {\n _curator.setData().forPath(_zkPath, toZkBytes(value));\n }", "@Test\n public void testSetManagerType() {\n System.out.println(\"setManagerType\");\n int manager_type = 0;\n Manager instance = new Manager();\n instance.setManagerType(manager_type);\n\n fail(\"The test case is a prototype.\");\n }" ]
[ "0.68875223", "0.6554926", "0.64401424", "0.64339185", "0.6352214", "0.63388985", "0.6333115", "0.6297015", "0.6244221", "0.6222672", "0.6205271", "0.6198388", "0.61869454", "0.6183002", "0.61795443", "0.61724347", "0.6170356", "0.6158746", "0.6156896", "0.6153949", "0.6151726", "0.6143411", "0.6137092", "0.6134804", "0.61306137", "0.61248785", "0.6124362", "0.6124302", "0.6115167", "0.6107496", "0.61041206", "0.6100021", "0.60946554", "0.6091468", "0.6089031", "0.6072957", "0.60612345", "0.60572547", "0.6047089", "0.60451925", "0.6042729", "0.6042436", "0.6036983", "0.6030837", "0.60274285", "0.6024329", "0.6023161", "0.60228086", "0.60127825", "0.60123986", "0.60104877", "0.6004174", "0.59991556", "0.5993613", "0.5990637", "0.59883165", "0.59835446", "0.598214", "0.5977564", "0.59762967", "0.59721375", "0.5970926", "0.5969097", "0.5961255", "0.596102", "0.5958018", "0.5954863", "0.5953164", "0.5949164", "0.5939806", "0.59345526", "0.5931202", "0.5930752", "0.59271526", "0.5921458", "0.5919834", "0.5916158", "0.5914639", "0.5914442", "0.5903258", "0.5902866", "0.59028643", "0.5891175", "0.5889556", "0.5888932", "0.5888427", "0.58871186", "0.5881988", "0.58796936", "0.58784854", "0.5878218", "0.58743304", "0.58729255", "0.5870176", "0.5869389", "0.5868782", "0.5867284", "0.5863622", "0.586302", "0.5859647", "0.5856158" ]
0.0
-1
Retorna texto formatado para insercao em query
public static String getDadoFormatado(String pDado, TiposDadosQuery pTipo) { String dadoFormatado; if (pDado != null) { switch (pTipo) { case TEXTO: dadoFormatado = "'" + verificaAspaSimples(pDado) + "'"; break; case DATA: dadoFormatado = "'" + pDado + "'"; break; default: dadoFormatado = pDado; break; } } else { dadoFormatado = "null"; } return dadoFormatado; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toInsert() {\r\n return \"(null,'\"+ ref + \"','\" + name + \"','\" + tel + \"','\" + address + \"')\";\r\n }", "public String getInsertSQL()\n\t{\n\t\tString fieldList = \"parametro, dia, valor\";\n\t\treturn String.format(\"insert into alteracs (%s) values (%d, %d, %s)\",\n\t\t\t\tfieldList, parametro, dia, String.format(\"%.3f\", valor).replace(',', '.'));\n\t}", "protected String queryInsert() {\n StringBuilder sb = new StringBuilder(\"INSERT INTO \");\n sb.append(tabla).append(\" (\").append(String.join(\",\", campos)).append(\") VALUES (\");\n\n for (int i = 0; i < campos.length; i++) {\n if (i == campos.length -1) {\n sb.append(\"?)\");\n break;\n }\n sb.append(\"?,\");\n }\n\n return sb.toString();\n }", "public abstract String toSQL();", "protected String createInsert(T t) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(type.getSimpleName());\n\t\tsb.append(\" VALUES \");\n\t\treturn sb.toString();\n\t}", "@Override\n\tprotected String sql() throws OperationException {\n\t\treturn sql.insert(tbObj, fieldValue);\n\t}", "private String createInsertQuery() {\r\n StringBuilder query = new StringBuilder();\r\n query.append(\"insert into \").append(m_tableName)\r\n .append(\"(\").append(m_propertyNames[0]);\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",\").append(m_propertyNames[i]);\r\n }\r\n query.append(\") values (?\");\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",?\");\r\n }\r\n query.append(\")\");\r\n return query.toString();\r\n }", "public abstract String toDBString();", "@Override\r\n\tpublic String generate() {\r\n\t\tStringBuilder query = new StringBuilder();\r\n\r\n\t\tquery.append(\"INSERT INTO \").append(tableName).append(\" (\");\r\n\t\tfor (int i = 0; i < fieldNames.size(); i++) {\r\n\t\t\tquery.append(fieldNames.get(i));\r\n\t\t\tif (i < fieldNames.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\") VALUES (\");\r\n\t\tfor (int i = 0; i < fieldValues.size(); i++) {\r\n\t\t\tquery.append(\"'\").append(fieldValues.get(i)).append(\"'\");\r\n\t\t\tif (i < fieldValues.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\");\");\r\n\t\treturn query.toString();\r\n\t}", "String toSql();", "@Override\n\tpublic String getPreparedInsertText() {\n\t\treturn SQL_Insert;\n\t}", "private String createInsertQuery()\n {\n int i = 0;\n StringBuilder sb = new StringBuilder();\n sb.append(\"INSERT INTO \");\n sb.append(type.getSimpleName());\n sb.append(\" (\");\n for(Field field:type.getDeclaredFields()) {i++; if(i != type.getDeclaredFields().length)sb.append(field.getName() +\", \"); else sb.append(field.getName());}\n sb.append(\")\");\n sb.append(\" VALUES (\");\n i = 0;\n for(Field field:type.getDeclaredFields()) {i++; if(i!= type.getDeclaredFields().length)sb.append(\"?, \"); else sb.append(\"?\");}\n sb.append(\");\");\n return sb.toString();\n }", "public abstract void toSQL(StringBuilder ret);", "String getBarcharDataQuery();", "public String getInsertContentSql(String table)\r\n \t{\r\n \t\treturn \"insert into \" + table + \" (RESOURCE_ID, BODY)\" + \" values (? , ? )\";\r\n \t}", "@Override\n public String saveAsString() {\n return \"D\" + super.saveAsString() + \" | \" + by;\n }", "public String toDBString() {\n return extra1 + DIVIDER + extra2;\n }", "private String getValuesToInsert(int row) {\n List<String> orderedFields = new ArrayList<>(mapFieldsTypes.keySet()); // get ordered list of fields\n StringBuffer insertRowStringBuffer = new StringBuffer();\n insertRowStringBuffer // add first part of query insert string\n .append(SQLFormater.INSERT_INTO)\n .append(\" \")\n .append(tableName)\n .append(\" \")\n .append(\"(\")\n .append(idFieldName) // first inserted field is always row ID\n .append(\",\");\n orderedFields.forEach(field -> insertRowStringBuffer // add names of fields in order they will be inserted\n .append(field)\n .append(\", \")\n );\n insertRowStringBuffer // add another part of string before values\n .append(\")\")\n .append(\" \")\n .append(SQLFormater.VALUES)\n .append(\"(\")\n .append(row); // first field is always row ID\n if (!mapFieldsStrings.isEmpty() || !mapFieldsIntegers.isEmpty()) {\n orderedFields.forEach(field -> { // inserting field values in controlled order\n insertRowStringBuffer.append(\", \");\n if (mapFieldsStrings.containsKey(field)) {\n insertRowStringBuffer\n .append(\"'\")\n .append(mapFieldsStrings.get(field))\n .append(\"'\");\n } else if (mapFieldsIntegers.containsKey(field)) {\n insertRowStringBuffer.append(mapFieldsIntegers.get(field));\n }\n });\n }\n insertRowStringBuffer.append(\")\");\n clearInsertingValues(); // clear fields to insert another row\n return insertRowStringBuffer.toString();\n }", "private String encodeSQL(String text) {\r\n text = text.replaceAll(\"'\", \"''\");\r\n return \"'\" + text + \"'\";\r\n }", "private String getSQLText (CTextField f)\n \t{\n \t\tString s = f.getText().toUpperCase();\n \t\tif (!s.endsWith(\"%\"))\n \t\t\ts += \"%\";\n \t\tlog.fine( \"String=\" + s);\n \t\treturn s;\n \t}", "public String toString() {\n return SQLStringVisitor.getSQLString(this);\n }", "private static String toSql(Object obj) {\n\t\tif(obj==null) {\n\t\t\treturn \"NULL\";\n\t\t}\n\t\tif(obj instanceof String) {\n\t\t\treturn \"'\"+obj+\"'\";\n\t\t}\n\t\treturn obj.toString();\n\t}", "public String insert(DtoEntrprs dto){\n\t\treturn null;\r\n\t}", "public String getDateTimeInsertString(java.sql.Timestamp aTimestamp){\r\n return \"'\" + DBUtil.getDBDateTimeString(aTimestamp) + \"'\";\r\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String getIdentityInsertString() {\n \t\treturn null;\n \t}", "private String getStringToCreateDB(String addings) {\n StringBuffer createDBStringBuffer = new StringBuffer();\n createDBStringBuffer\n .append(SQLFormater.CREATE_TABLE)\n .append(\" \")\n .append(tableName)\n .append(\"(\")\n .append(idFieldName)\n .append(\" \")\n .append(DBCreator.INTEGER_TYPE)\n .append(\" \")\n .append(SQLFormater.PRIMARY_KEY);\n mapFieldsTypes.forEach((kField, vType) -> { // add all table's fields\n createDBStringBuffer\n .append(\", \")\n .append(kField)\n .append(\" \")\n .append(vType);\n if(mapFieldsConstraints.containsKey(kField)) { // add constraint for a field\n createDBStringBuffer\n .append(\" \")\n .append(mapFieldsConstraints.get(kField));\n }\n });\n if (addings != null && !addings.isEmpty()) { // add reference\n createDBStringBuffer\n .append(\", \")\n .append(addings);\n }\n createDBStringBuffer.append(\")\");\n return createDBStringBuffer.toString();\n }", "private static String buildStringFromCursor(Cursor dbCursor)\n {\n String writeString = \"\";\n int columnCount = dbCursor.getColumnCount();\n\n for(int count = 0; count < columnCount; count++)\n {\n writeString += dbCursor.getString(count);\n if(count < columnCount - 1)\n {\n writeString += \"\\t\";\n }\n else\n {\n writeString += \"\\n\";\n }\n }\n return writeString;\n }", "protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }", "String buildInsertQuery(String... args);", "public String toSave() {\n\n return \"D|\" + super.toSave() + \" by: \" + by;\n }", "protected String getInsertionSQL() {\n\t\treturn queryData.getString(\"InsertionSQL\");\n\t}", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getCode()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getBatchId()));\n sb.append(\", \");\n sb.append(f.formatAny(getNestId()));\n return sb.toString();\n }", "protected String getSQLString() {\n \t\treturn queryTranslator.getSQLString();\n \t}", "public String toSQL() {\n\t\tStringBuilder sBuider = new StringBuilder();\n\n\t\t\n\t\t\n\t\t\n\t\tString sTemp = sBuider.toString();\n\t\tSystem.out.println(this.getClass().getName() + \".toSQL(): SQL statements are \\n\" + sTemp);\n\t\t\n\t\tsBuider = null;\n\t\t\n\t\treturn sTemp;\n\t}", "public String makeValue(ResultRow row) {\n\t\tStringBuffer result = new StringBuffer(this.id);\n\t\tfor (ColumnName column: columns) {\n\t\t\tString value = row.get(column);\n\t\t\tif (value == null) {\n\t\t\t\treturn null;\n\t\t }\n\t\t\tresult.append(DELIMITER);\n\t\t\tresult.append(value);\n\t\t}\n return result.toString();\n\t}", "private String createStandardGZFieldTexts()\n\t{\n\t\tStringBuffer result = new StringBuffer();\n\t\tfor (Entry<String, String[]> entry : standardJournalFieldColumns.entrySet())\n\t\t{\n\t\t\tif (result.length() != 0)\n\t\t\t{\n\t\t\t\tresult.append(\", \");\n\t\t\t}\n\t\t\tresult.append(entry.getKey());\n\t\t\tresult.append(\" TEXT IS '\");\n\t\t\tString[] strings = entry.getValue();\n\t\t\tfor (int index = 0; index < strings.length; index++)\n\t\t\t{\n\t\t\t\tresult.append(strings[index]);\n\t\t\t\tif (index < strings.length)\n\t\t\t\t{\n\t\t\t\t\tresult.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.append(\"'\");\n\t\t}\n\t\treturn result.toString();\n\t}", "protected String formatErrorMessage() throws SQLException {\n \tint errCode = SQLite.extendederrcode(getConnection().getSqliteDb());\r\n \tString message = SQLite.errmsg(getConnection().getSqliteDb());\r\n\t\tString s = StringUtil.format(\"Code:{0}\\n{1}\", errCode, message);\r\n\t\treturn s;\r\n\t}", "@Override\n public String databaseString() {\n return \"T | \" + super.databaseString();\n }", "public abstract String toSaveString();", "@Test\n public void testToStringWithSQL() throws SQLException {\n try (PreparedStatement stmt = this.proxy\n .prepareStatement(\"SELECT * FROM country WHERE lang = ? OR callingcode = ?\")) {\n stmt.setString(1, \"de\");\n stmt.setInt(2, 42);\n String sql = stmt.toString();\n assertEquals(\"SELECT * FROM country WHERE lang = 'de' OR callingcode = 42\", sql);\n LOG.info(\"sql = \\\"{}\\\"\", sql);\n }\n }", "public CustomSql getCustomSqlInsert();", "final public static String createPstmtInsert(Class<? extends DotProjectObject> clazz)\n\t{\n\t\tStringBuffer sb = new StringBuffer();\n\t\tString table = null;\n\t\tField[] beanFields = null;\n\t\tString[] dbFields = null;\n\t\t\n\t\ttable = AnnotationUtil.getAnnotationValue(clazz, DbAnnotations.TABLE_ANNOTATION);\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(table);\n\t\t\n\t\tbeanFields = AnnotationUtil.getAnnotatedFields(clazz, DbAnnotations.PROPERTY_ANNOTATION);\n\t\tdbFields = new String[beanFields.length];\n\t\tfor (int i = 0; i < beanFields.length; i++) {\n\t\t\tif (! beanFields[i].isAnnotationPresent(DbAnnotations.IDENTIFICATOR_ANNOTATION)) {\n\t\t\t\tdbFields[i] = AnnotationUtil.getAnnotationValue(beanFields[i], DbAnnotations.PROPERTY_ANNOTATION);\n\t\t\t}\n\t\t}\n\t\tdbFields = (String[])ArrayUtil.clean(dbFields);\n\t\tArrays.sort(dbFields);\n\t\t\t\n\t\tsb.append(\" (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(dbFields[i]);\n\t\t}\n\t\t\n\t\tsb.append(\") values (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(\"?\");\n\t\t}\n\t\tsb.append(\")\");\n\n\t\treturn sb.toString();\n\t}", "static String serializeToString(Object s) throws SQLException {\n\treturn createString(serialize(s));\n }", "private String formatSql(String sql) {\n\t\tString sqlStr = formator.format(sql + \";\");\n\t\tif (sqlStr == null) {\n\t\t\tLOGGER.error(\"The formator.format(sql) is a null.\");\n\t\t\treturn null;\n\t\t}\n\n\t\tString trimmedSql = sqlStr.trim();\n\t\tif (!trimmedSql.endsWith(\";\")) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tString formattedSql = trimmedSql.substring(0, trimmedSql.length() - 1);\n\t\treturn formattedSql;\n\t}", "private static String formatEntry(Object entry){\n return QUOTE + entry.toString() + QUOTE + DELIM;\n }", "private String createFindAll() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"SELECT \");\n\t\tsb.append(\" * \");\n\t\tsb.append(\" FROM \");\n\t\tsb.append(type.getSimpleName());\n\t\treturn sb.toString();\n\t}", "public String insertSelective(Car record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"`basedata_car`\");\n \n if (record.getCarId() != null) {\n sql.VALUES(\"car_id\", \"#{carId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarBrandId() != null) {\n sql.VALUES(\"car_brand_id\", \"#{carBrandId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarModel() != null) {\n sql.VALUES(\"car_model\", \"#{carModel,jdbcType=VARCHAR}\");\n }\n \n if (record.getCarType() != null) {\n sql.VALUES(\"car_type\", \"#{carType,jdbcType=TINYINT}\");\n }\n \n if (record.getAlias() != null) {\n sql.VALUES(\"alias\", \"#{alias,jdbcType=VARCHAR}\");\n }\n \n if (record.getSeatType() != null) {\n sql.VALUES(\"seat_type\", \"#{seatType,jdbcType=TINYINT}\");\n }\n \n if (record.getSeatNum() != null) {\n sql.VALUES(\"seat_num\", \"#{seatNum,jdbcType=TINYINT}\");\n }\n \n if (record.getCarClass() != null) {\n sql.VALUES(\"car_class\", \"#{carClass,jdbcType=INTEGER}\");\n }\n \n if (record.getGuestNum() != null) {\n sql.VALUES(\"guest_num\", \"#{guestNum,jdbcType=INTEGER}\");\n }\n \n if (record.getLuggageNum() != null) {\n sql.VALUES(\"luggage_num\", \"#{luggageNum,jdbcType=INTEGER}\");\n }\n \n if (record.getSpell() != null) {\n sql.VALUES(\"spell\", \"#{spell,jdbcType=VARCHAR}\");\n }\n \n if (record.getEnName() != null) {\n sql.VALUES(\"en_name\", \"#{enName,jdbcType=VARCHAR}\");\n }\n \n if (record.getUpdatedAt() != null) {\n sql.VALUES(\"updated_at\", \"#{updatedAt,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getCreatedAt() != null) {\n sql.VALUES(\"created_at\", \"#{createdAt,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String Analise(String SQL, String Value){\n SQLQuery result = session.createSQLQuery(SQL);\n Value = result.toString();\n return Value;\n}", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "protected String getSQL (Element sql) {\r\n\r\n //local variables\r\n\r\n String SQL = \"\";\r\n\r\n //code description\r\n \r\n NodeList textlist = sql.getChildNodes();\r\n for (int i = 0; i < textlist.getLength(); i++) {\r\n if (textlist.item(i).getNodeType() == Node.TEXT_NODE) {\r\n SQL += textlist.item(i).getNodeValue();\r\n }\r\n }\r\n return SQL;\r\n\r\n }", "public String InsertarAnuncioGeneral(AnuncioGeneralDTO anuncio){\n int status=0;\n String message=\"Funciona bien\";\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is);\n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"insertar.AnuncioGeneral\"));\n \n ps.setString(1, anuncio.getTipoAnuncio().toString());\n ps.setString(2,anuncio.getTitulo());\n ps.setString(3,anuncio.getCuerpo());\n \n java.sql.Date fechaPublicacion=new java.sql.Date(anuncio.getFechaPublicacion().getTime());\n // DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss dd/MM/yyyy\");\n // String fecha = dateFormat.format(anuncio.getFechaPublicacion());\n // java.sql.Date fechaPublicacion=new java.sql.Date(dateFormat.parse(fecha).getTime());\n ps.setDate(4, fechaPublicacion);\n message=\"Cargo bien la fecha\";\n ps.setString(5,anuncio.getPropietario().getEmail());\n ps.setString(6,anuncio.getEstadoAnuncio().toString());\n status=ps.executeUpdate();\n\n \n int idAnuncio=GetMaxID();\n for(Contacto c : anuncio.getDestinatarios()){\n PreparedStatement psDestinatario=conect.prepareStatement(sqlProp.getProperty(\"insertar.Destinatario\"));\n psDestinatario.setInt(1, idAnuncio);\n psDestinatario.setString(2, c.getEmail());\n psDestinatario.executeUpdate();\n }\n message=\"funciona bien\";\n }catch(Exception e){\n e.toString();\n }\n\n return message;\n }", "public String Execomando(String Comsql) {\n String Mensaje = \"\";\n /* sino retorna nada es porque todo esta bien */\n try {\n PreparedStatement pstm = con.prepareStatement(Comsql);\n pstm.execute();\n pstm.close();\n } catch (SQLException e) {\n Mensaje = e.toString();\n }\n return Mensaje;\n }", "public String insertEscuela(Escuela escuela){\n String regInsertado = \"Registro Escuela #\";\n long contador = 0;\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"IDESCUELA\",escuela.getIdentificadorEscuela());\n contentValues.put(\"NOMESCUELA\", escuela.getNombreEscuela());\n contador = db.insert(\"ESCUELA\",null,contentValues);\n db.close();\n\n if(contador == -1 || contador == 0){\n regInsertado = \"Error al insertar Escuela. Registro duplicado.\";\n }else{\n regInsertado = regInsertado + contador;\n }\n return regInsertado;\n }", "protected String formatField() {\n \tif(!updated) return \"No record set.\";\n \t\n \tif(firstFieldP.getText() != null && lastFieldP.getText() != null) {\n\t \tfirstNameString = firstFieldP.getText();\n\t \tlastNameString = lastFieldP.getText();\n \t} else\t{\n \tfirstNameString = firstFieldC.getText();\n \tlastNameString = lastFieldC.getText();\n \ttribeString = tribeField.getText();\t\n \t}\n\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"<html><p align=center>\");\n \tsb.append(firstNameString);\n \tsb.append(\" \");\n \tsb.append(lastNameString);\n \tsb.append(\"<br>\");\n \tsb.append(tribeString);\n \tsb.append(\"</p></html>\");\n \t\n \treturn sb.toString(); \t\n }", "private String insertCommand(Object item)\n\t{\n\t\tif(item instanceof Road)\n\t\t{\n\t\t\tRoad tmp = (Road) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.RoadTable.TABLE_NAME + \" (\" +\n\t\t\t\tDBContract.RoadTable.ROADNAME[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.LENGTH[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.DURATION[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.PRICE[0] + \") VALUES (\" +\n\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + tmp.getLength() + \" ,\" +\n\t\t\t\ttmp.getDuration() + \" ,\" + tmp.getPrice() + \")\";\n \t\t}\n\t\telse if(item instanceof Contact)\n\t\t{\n\t\t\tContact tmp = (Contact) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.ContactTable.TABLE_NAME + \" (\" +\n\t\t\t\t\tDBContract.ContactTable.NAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.SURNAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.BILL[0] + \") VALUES (\" +\n\t\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + \"\\\"\" + tmp.getFirstName() + \"\\\"\" +\n\t\t\t\t\t\" ,\" + tmp.getbill() + \")\";\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "public String getTimestampString() throws SQLException {\n\t\tloadFromDB();\n\t\treturn DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM)\n\t\t\t\t\t.format(rev_timestamp);\n\t}", "public String getSQLstring() {\r\n return typeId.toParsableString(this);\r\n }", "public String toString() {\n\t\t//TODO add your own field name here\t\t\n\t\t//return buffer.append(this.yourFieldName).toString();\n\t\treturn \"\";\n\t}", "public String getSaveString() {\n return \"\" + Value;\n }", "public String getNoColumnsInsertString() {\n \t\treturn \"values ( )\";\n \t}", "public String insertTypesPhone() {\n String query = \"\";\n\n String[] typesPhoneDefault = res.getStringArray(R.array.types_phone);\n for (int i = 0; i < typesPhoneDefault.length; i++) {\n // Script inserting types phone default\n query += \"INSERT INTO \" + TABLE_PHONE_TYPE + \"(\" + ID + \",\" + TITLE + \") VALUES(\" + (i + 1) + \",'\" + typesPhoneDefault[i] + \"');\";\n }\n\n return query;\n }", "public String getEntrySave() {\r\n return \"-\"+getId() + \"|\" + getFavorite() + \"|\" + getSubject() + \"|\" + date(4) + \"|\" + price.getFull() + \"|\" + getNotes();\r\n }", "public String toSQL(boolean fuzzySearch){\n return toSQL();\n }", "public String insertXosoSql(String date, String data) {\n\t\tString sql =\"\";\n\t\tString table_name = db.table_name;\n\t\tif(!db.CheckRecordExisted(date)){\n\t\t\tsql= \"insert into \"+table_name+\" (date, result_json) values ('\"+date+\"','\"+data+\"')\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsql = \"UPDATE \"+table_name+\" SET result_json='\"+data+\"' WHERE date='\"+date+\"'\";\n\t\t}\n\t\tlogger.debug(sql);\n\t\ttry {\n\t\t//\tdb.createPreparedStatement(date, data);\n\t\t\tdb.executeQuery(sql);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t}\n\t\treturn sql;\n\t}", "public String getDBString();", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getLegDepartureLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalDayOffset()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegStopCount()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegEquipment()));\n return sb.toString();\n }", "public String toString()\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\treturn \"columnName: \" + columnName + \"\\n\" +\n\t\t\t\t\"defaultText: \" + defaultText + \"\\n\" +\n\t\t\t\tsuper.toString();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "private String writeNameIdResultSet(ResultSet resultSet) throws SQLException {\n\t\r\n\tString strada_arco=\"\";\r\n\tString arco=\"\";\r\n\t\r\n\tint i=0;\r\n\twhile (resultSet.next()) {\r\n\t\t// It is possible to get the columns via name\r\n\t\t// also possible to get the columns via the column number\r\n\t\t// which starts at 1\r\n\t\t// e.g. resultSet.getSTring(2);\r\n\t\t\r\n\t\t\r\n\t\tstrada_arco=resultSet.getString(1);\r\n\t\tarco=resultSet.getString(2);\r\n\t\t //nome_arco= resultSet.getString(3);\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\treturn strada_arco+\"-\"+arco;\r\n}", "public static String formatQuery( String sqlString ) {\n StringTokenizer st= new StringTokenizer( sqlString, \"'\" );\n StringWriter sw = new StringWriter();\n \n while (st.hasMoreTokens()) {\n sw.write( st.nextToken() );\n if (st.hasMoreTokens())\n sw.write( \"''\" );\n }\n \n return sw.toString();\n }", "public String insertar(Cargo cargo){\n String registrosInser=\"Registro insertado N°= \";\n long contador;\n ContentValues c=new ContentValues();\n //c.put(\"ID_CARGO\",cargo.getIdCargo());\n c.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n c.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,c);\n if(contador==-1||contador==0){\n registrosInser=\"Error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n /* String registrosInser=\"Registro insertado N°= \";\n long contador= 0;\n ContentValues carg = new ContentValues();\n //carg.put(\"ID_CARGO\",cargo.getIdCargo());\n carg.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n carg.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,carg);\n if(contador==-1||contador==0){\n registrosInser=\"error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n return registrosInser;*/\n return registrosInser;\n\n }", "@Override\n public String toSaveString() {\n //D0Finish project@June 6\n return \"D\" + (isDone ? \"1\" : \"0\") + name + \"@\" + getDate();\n }", "public String insertAlum(Alumno alumno) //lo necesitaba\n {\n String regInsertado = \"Alumno: \";\n\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"CARNET\",alumno.getCarnet());\n contentValues.put(\"IDESCUELA\", alumno.getIdEscuela());\n contentValues.put(\"NOMESTUDIANTE\", alumno.getNombre());\n long contador = db.insert(\"ESTUDIANTE\",null,contentValues);\n db.close();\n\n if(contador > 0){\n regInsertado = regInsertado + contador;\n }else{\n regInsertado = \"Ya existe el alumno.\" + alumno.getCarnet();\n }\n return regInsertado;\n }", "public String insertSelective(Userinfo record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"userinfo\");\n \n if (record.getUserid() != null) {\n sql.VALUES(\"userid\", \"#{userid,jdbcType=INTEGER}\");\n }\n \n if (record.getUsername() != null) {\n sql.VALUES(\"username\", \"#{username,jdbcType=VARCHAR}\");\n }\n \n if (record.getSex() != null) {\n sql.VALUES(\"sex\", \"#{sex,jdbcType=BIT}\");\n }\n \n if (record.getTel() != null) {\n sql.VALUES(\"tel\", \"#{tel,jdbcType=VARCHAR}\");\n }\n \n if (record.getLastlogintime() != null) {\n sql.VALUES(\"lastlogintime\", \"#{lastlogintime,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getStatus() != null) {\n sql.VALUES(\"status\", \"#{status,jdbcType=BIT}\");\n }\n \n if (record.getWxopenid() != null) {\n sql.VALUES(\"wxopenid\", \"#{wxopenid,jdbcType=VARCHAR}\");\n }\n \n if (record.getAddr() != null) {\n sql.VALUES(\"addr\", \"#{addr,jdbcType=VARCHAR}\");\n }\n \n if (record.getDelStatus() != null) {\n sql.VALUES(\"del_status\", \"#{delStatus,jdbcType=BIT}\");\n }\n \n if (record.getCreatetime() != null) {\n sql.VALUES(\"createtime\", \"#{createtime,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String databaseToString()\n {\n String dbString = \"\";\n SQLiteDatabase sqLiteDatabase = getWritableDatabase(); // database we writing too\n String query = \"SELECT * FROM \" + TABLE_PRODUCTS + \"WHERE 1\"; // 1 means every row * means every columns\n\n //Cursor points to locations in the results\n Cursor cursor = sqLiteDatabase.rawQuery(query,null);\n //Move to first row in results\n cursor.moveToFirst();\n\n // loops through every product and extracts the productname\n while(!cursor.isAfterLast())\n {\n if(cursor.getString(cursor.getColumnIndex(\"productname\"))!= null)\n {\n dbString += cursor.getString(cursor.getColumnIndex(\"productname\"));\n dbString += \"\\n\";\n }\n }\n sqLiteDatabase.close();\n return dbString;\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getHashKey()));\n return sb.toString();\n }", "public String prepareStatementString() throws SQLException {\n\t\tList<Object> argList = new ArrayList<Object>();\n\t\treturn buildStatementString(argList);\n\t}", "public String getStringRecord() {\n NumberFormat nf = new DecimalFormat(\"0000.00\");\n String delimiter = \",\";\n\n return String.format(\"%05d\", orderLineId) + delimiter + String.format(\"%05d\", orderId) + delimiter\n + String.format(\"%05d\", userId) + delimiter + String.format(\"%05d\", productId) + delimiter\n + String.format(\"%05d\", orderLineQuantity) + delimiter + nf.format(salesPrice)\n + System.getProperty(\"line.separator\");\n }", "private static String adqlCharLiteral( String txt ) {\n return \"'\" + txt.replaceAll( \"'\", \"''\" ) + \"'\";\n }", "private String produceSQL(String[] cols) {\n StringBuffer buffer = new StringBuffer();\n buffer.append('(');\n buffer.append(cols[0]);\n\n for (int i = 1; i < cols.length; i++){\n buffer.append(',');\n buffer.append(cols[i]);\n }\n buffer.append(')');\n return buffer.toString();\n }", "public String agregarCuenta(Cuenta cuenta) {\n String mensaje = \"\";\n try {\n PreparedStatement PrSt;\n String Query = \"INSERT INTO Cuenta VALUES(?,?,?,?)\";\n PrSt = conexion.prepareStatement(Query);\n PrSt.setString(1, cuenta.getCodigo());\n PrSt.setDate(2, cuenta.getCreacion());\n PrSt.setDouble(3, cuenta.getCredito());\n PrSt.setString(4, cuenta.getCodigo_cliente());\n int resultado = PrSt.executeUpdate();\n if (resultado > 0) {\n mensaje = \"Agregada Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n } else {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n }\n PrSt.close();\n } catch (SQLException e) {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente() + \" Error: \" + e.toString();\n }\n return mensaje;\n }", "public static String convertColumn2String(Column column) {\n char type = '\\0';\n String result = \"\";\n\n switch (column.type) {\n case STRING:\n type = 's';\n result = (column.value == null? \"\" : column.value.toString());\n break;\n case INT:\n type = 'i';\n int value;\n if (column.value == null)\n value = INT_OFFSET; // we don't really distinguish between zero and null\n else\n value = ((Integer)column.value).intValue() + INT_OFFSET;\n result = String.format(INT_FORMAT_STRING, value);\n break;\n case DOUBLE:\n type = 'd';\n double value2;\n if (column.value == null)\n value2 = INT_OFFSET;\n else\n value2 = ((Double)column.value).doubleValue() + INT_OFFSET;\n result = String.format(DOUBLE_FORMAT_STRING, value2);\n break;\n }\n\n return type + result;\n }", "public String ToString(){\r\n String Result;\r\n return Result = \"Arco: \"+this.id+\" Dato: \"+String.valueOf(this.Dato)+\" Peso: \"+String.valueOf(this.p)+\" Extremo Inicial: \"+this.Vi.id+\" Extremo Final: \"+this.Vf.id;\r\n }", "public abstract String createDBString();", "public String getRecordText();", "public String getRecordText();", "String getToText();", "private void yas(){\n System.out.println(namn);\n \n try{\n String fraga = \"SELECT TEXT FROM INLAGG WHERE RUBRIK = 'Borttappad strumpa'\";\n String XD = db.fetchSingle(fraga);\n System.out.println(XD);\n txtInlagg.append(XD);\n }\n catch(InfException e){\n JOptionPane.showMessageDialog(null, \"Kunde ej hämta inlägg\");\n }\n }", "String getFormattedString(IRenamable f);", "@Override\n\tpublic String insertStatement() throws Exception {\n\t\treturn null;\n\t}", "public abstract String valueAsText();", "String getInsertStatement(\r\n TypedKeyValue<List<String>, List<String>> fieldsAndValues,\r\n String tableName);", "public String loopDBInfo(ResultSet rs){\n String p = \"\";\n try{\n while (rs.next()) {\n int id_col = rs.getInt(\"ID\");\n String first_name = rs.getString(\"NAME\");\n String phone = rs.getString(\"PHONE\");\n String status = rs.getString(\"STATUS\");\n String prob = rs.getString(\"PROBLEM\");\n \n \n p = p + (id_col + \" \" + first_name + \" \" + phone + \" \"+ status + \" \"+ prob + \"\\n\"); \n // System.out.println(p);\n }\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n \n } return p;\n }", "@Override\n public String getStringFromDatabase(int objectID) {\n return \"From Class one result\"+objectID;\n }" ]
[ "0.72332656", "0.6645996", "0.6531685", "0.6386587", "0.6316747", "0.6265875", "0.621917", "0.6208691", "0.62029773", "0.6154162", "0.6134995", "0.60820025", "0.59232104", "0.579011", "0.57338965", "0.570275", "0.567309", "0.5662722", "0.5660105", "0.5651487", "0.56486756", "0.5626061", "0.56242555", "0.5619859", "0.56078476", "0.56078476", "0.56078476", "0.56078476", "0.56078476", "0.5604503", "0.5582", "0.5580296", "0.5569601", "0.5538234", "0.55242646", "0.54786515", "0.54731727", "0.5463155", "0.5451918", "0.54460627", "0.5401085", "0.53716946", "0.5368335", "0.5359354", "0.535153", "0.5345069", "0.5340157", "0.5332032", "0.5326281", "0.5302725", "0.5300964", "0.5300155", "0.52977496", "0.52956915", "0.5290483", "0.5290483", "0.5285686", "0.52780145", "0.52712643", "0.5270857", "0.5267584", "0.52625895", "0.5258992", "0.5257228", "0.52544725", "0.52529544", "0.5251592", "0.5246511", "0.52446985", "0.52373844", "0.52204514", "0.5211526", "0.52078456", "0.5205468", "0.5202617", "0.5198143", "0.51890844", "0.5182871", "0.5182217", "0.5173992", "0.51693326", "0.51654756", "0.5162951", "0.51620543", "0.515915", "0.5148224", "0.51460505", "0.5145959", "0.51372635", "0.5136895", "0.5125541", "0.5125541", "0.5120276", "0.5117769", "0.51146203", "0.5114011", "0.51112044", "0.5102594", "0.5092712", "0.50926036" ]
0.511289
96
Retorna texto formatado para insercao em query
public static String getDadoFormatado(boolean pDado, TiposDadosQuery pTipo) { StringBuilder dadoFormatado = new StringBuilder(""); if (pDado) { dadoFormatado.append("true"); } else { dadoFormatado.append("false"); } return dadoFormatado.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toInsert() {\r\n return \"(null,'\"+ ref + \"','\" + name + \"','\" + tel + \"','\" + address + \"')\";\r\n }", "public String getInsertSQL()\n\t{\n\t\tString fieldList = \"parametro, dia, valor\";\n\t\treturn String.format(\"insert into alteracs (%s) values (%d, %d, %s)\",\n\t\t\t\tfieldList, parametro, dia, String.format(\"%.3f\", valor).replace(',', '.'));\n\t}", "protected String queryInsert() {\n StringBuilder sb = new StringBuilder(\"INSERT INTO \");\n sb.append(tabla).append(\" (\").append(String.join(\",\", campos)).append(\") VALUES (\");\n\n for (int i = 0; i < campos.length; i++) {\n if (i == campos.length -1) {\n sb.append(\"?)\");\n break;\n }\n sb.append(\"?,\");\n }\n\n return sb.toString();\n }", "public abstract String toSQL();", "protected String createInsert(T t) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(type.getSimpleName());\n\t\tsb.append(\" VALUES \");\n\t\treturn sb.toString();\n\t}", "@Override\n\tprotected String sql() throws OperationException {\n\t\treturn sql.insert(tbObj, fieldValue);\n\t}", "private String createInsertQuery() {\r\n StringBuilder query = new StringBuilder();\r\n query.append(\"insert into \").append(m_tableName)\r\n .append(\"(\").append(m_propertyNames[0]);\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",\").append(m_propertyNames[i]);\r\n }\r\n query.append(\") values (?\");\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",?\");\r\n }\r\n query.append(\")\");\r\n return query.toString();\r\n }", "public abstract String toDBString();", "@Override\r\n\tpublic String generate() {\r\n\t\tStringBuilder query = new StringBuilder();\r\n\r\n\t\tquery.append(\"INSERT INTO \").append(tableName).append(\" (\");\r\n\t\tfor (int i = 0; i < fieldNames.size(); i++) {\r\n\t\t\tquery.append(fieldNames.get(i));\r\n\t\t\tif (i < fieldNames.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\") VALUES (\");\r\n\t\tfor (int i = 0; i < fieldValues.size(); i++) {\r\n\t\t\tquery.append(\"'\").append(fieldValues.get(i)).append(\"'\");\r\n\t\t\tif (i < fieldValues.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\");\");\r\n\t\treturn query.toString();\r\n\t}", "String toSql();", "@Override\n\tpublic String getPreparedInsertText() {\n\t\treturn SQL_Insert;\n\t}", "private String createInsertQuery()\n {\n int i = 0;\n StringBuilder sb = new StringBuilder();\n sb.append(\"INSERT INTO \");\n sb.append(type.getSimpleName());\n sb.append(\" (\");\n for(Field field:type.getDeclaredFields()) {i++; if(i != type.getDeclaredFields().length)sb.append(field.getName() +\", \"); else sb.append(field.getName());}\n sb.append(\")\");\n sb.append(\" VALUES (\");\n i = 0;\n for(Field field:type.getDeclaredFields()) {i++; if(i!= type.getDeclaredFields().length)sb.append(\"?, \"); else sb.append(\"?\");}\n sb.append(\");\");\n return sb.toString();\n }", "public abstract void toSQL(StringBuilder ret);", "String getBarcharDataQuery();", "public String getInsertContentSql(String table)\r\n \t{\r\n \t\treturn \"insert into \" + table + \" (RESOURCE_ID, BODY)\" + \" values (? , ? )\";\r\n \t}", "@Override\n public String saveAsString() {\n return \"D\" + super.saveAsString() + \" | \" + by;\n }", "public String toDBString() {\n return extra1 + DIVIDER + extra2;\n }", "private String getValuesToInsert(int row) {\n List<String> orderedFields = new ArrayList<>(mapFieldsTypes.keySet()); // get ordered list of fields\n StringBuffer insertRowStringBuffer = new StringBuffer();\n insertRowStringBuffer // add first part of query insert string\n .append(SQLFormater.INSERT_INTO)\n .append(\" \")\n .append(tableName)\n .append(\" \")\n .append(\"(\")\n .append(idFieldName) // first inserted field is always row ID\n .append(\",\");\n orderedFields.forEach(field -> insertRowStringBuffer // add names of fields in order they will be inserted\n .append(field)\n .append(\", \")\n );\n insertRowStringBuffer // add another part of string before values\n .append(\")\")\n .append(\" \")\n .append(SQLFormater.VALUES)\n .append(\"(\")\n .append(row); // first field is always row ID\n if (!mapFieldsStrings.isEmpty() || !mapFieldsIntegers.isEmpty()) {\n orderedFields.forEach(field -> { // inserting field values in controlled order\n insertRowStringBuffer.append(\", \");\n if (mapFieldsStrings.containsKey(field)) {\n insertRowStringBuffer\n .append(\"'\")\n .append(mapFieldsStrings.get(field))\n .append(\"'\");\n } else if (mapFieldsIntegers.containsKey(field)) {\n insertRowStringBuffer.append(mapFieldsIntegers.get(field));\n }\n });\n }\n insertRowStringBuffer.append(\")\");\n clearInsertingValues(); // clear fields to insert another row\n return insertRowStringBuffer.toString();\n }", "private String encodeSQL(String text) {\r\n text = text.replaceAll(\"'\", \"''\");\r\n return \"'\" + text + \"'\";\r\n }", "private String getSQLText (CTextField f)\n \t{\n \t\tString s = f.getText().toUpperCase();\n \t\tif (!s.endsWith(\"%\"))\n \t\t\ts += \"%\";\n \t\tlog.fine( \"String=\" + s);\n \t\treturn s;\n \t}", "public String toString() {\n return SQLStringVisitor.getSQLString(this);\n }", "private static String toSql(Object obj) {\n\t\tif(obj==null) {\n\t\t\treturn \"NULL\";\n\t\t}\n\t\tif(obj instanceof String) {\n\t\t\treturn \"'\"+obj+\"'\";\n\t\t}\n\t\treturn obj.toString();\n\t}", "public String insert(DtoEntrprs dto){\n\t\treturn null;\r\n\t}", "public String getDateTimeInsertString(java.sql.Timestamp aTimestamp){\r\n return \"'\" + DBUtil.getDBDateTimeString(aTimestamp) + \"'\";\r\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String getIdentityInsertString() {\n \t\treturn null;\n \t}", "private String getStringToCreateDB(String addings) {\n StringBuffer createDBStringBuffer = new StringBuffer();\n createDBStringBuffer\n .append(SQLFormater.CREATE_TABLE)\n .append(\" \")\n .append(tableName)\n .append(\"(\")\n .append(idFieldName)\n .append(\" \")\n .append(DBCreator.INTEGER_TYPE)\n .append(\" \")\n .append(SQLFormater.PRIMARY_KEY);\n mapFieldsTypes.forEach((kField, vType) -> { // add all table's fields\n createDBStringBuffer\n .append(\", \")\n .append(kField)\n .append(\" \")\n .append(vType);\n if(mapFieldsConstraints.containsKey(kField)) { // add constraint for a field\n createDBStringBuffer\n .append(\" \")\n .append(mapFieldsConstraints.get(kField));\n }\n });\n if (addings != null && !addings.isEmpty()) { // add reference\n createDBStringBuffer\n .append(\", \")\n .append(addings);\n }\n createDBStringBuffer.append(\")\");\n return createDBStringBuffer.toString();\n }", "private static String buildStringFromCursor(Cursor dbCursor)\n {\n String writeString = \"\";\n int columnCount = dbCursor.getColumnCount();\n\n for(int count = 0; count < columnCount; count++)\n {\n writeString += dbCursor.getString(count);\n if(count < columnCount - 1)\n {\n writeString += \"\\t\";\n }\n else\n {\n writeString += \"\\n\";\n }\n }\n return writeString;\n }", "protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }", "String buildInsertQuery(String... args);", "public String toSave() {\n\n return \"D|\" + super.toSave() + \" by: \" + by;\n }", "protected String getInsertionSQL() {\n\t\treturn queryData.getString(\"InsertionSQL\");\n\t}", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getCode()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getBatchId()));\n sb.append(\", \");\n sb.append(f.formatAny(getNestId()));\n return sb.toString();\n }", "protected String getSQLString() {\n \t\treturn queryTranslator.getSQLString();\n \t}", "public String toSQL() {\n\t\tStringBuilder sBuider = new StringBuilder();\n\n\t\t\n\t\t\n\t\t\n\t\tString sTemp = sBuider.toString();\n\t\tSystem.out.println(this.getClass().getName() + \".toSQL(): SQL statements are \\n\" + sTemp);\n\t\t\n\t\tsBuider = null;\n\t\t\n\t\treturn sTemp;\n\t}", "public String makeValue(ResultRow row) {\n\t\tStringBuffer result = new StringBuffer(this.id);\n\t\tfor (ColumnName column: columns) {\n\t\t\tString value = row.get(column);\n\t\t\tif (value == null) {\n\t\t\t\treturn null;\n\t\t }\n\t\t\tresult.append(DELIMITER);\n\t\t\tresult.append(value);\n\t\t}\n return result.toString();\n\t}", "private String createStandardGZFieldTexts()\n\t{\n\t\tStringBuffer result = new StringBuffer();\n\t\tfor (Entry<String, String[]> entry : standardJournalFieldColumns.entrySet())\n\t\t{\n\t\t\tif (result.length() != 0)\n\t\t\t{\n\t\t\t\tresult.append(\", \");\n\t\t\t}\n\t\t\tresult.append(entry.getKey());\n\t\t\tresult.append(\" TEXT IS '\");\n\t\t\tString[] strings = entry.getValue();\n\t\t\tfor (int index = 0; index < strings.length; index++)\n\t\t\t{\n\t\t\t\tresult.append(strings[index]);\n\t\t\t\tif (index < strings.length)\n\t\t\t\t{\n\t\t\t\t\tresult.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.append(\"'\");\n\t\t}\n\t\treturn result.toString();\n\t}", "protected String formatErrorMessage() throws SQLException {\n \tint errCode = SQLite.extendederrcode(getConnection().getSqliteDb());\r\n \tString message = SQLite.errmsg(getConnection().getSqliteDb());\r\n\t\tString s = StringUtil.format(\"Code:{0}\\n{1}\", errCode, message);\r\n\t\treturn s;\r\n\t}", "@Override\n public String databaseString() {\n return \"T | \" + super.databaseString();\n }", "public abstract String toSaveString();", "@Test\n public void testToStringWithSQL() throws SQLException {\n try (PreparedStatement stmt = this.proxy\n .prepareStatement(\"SELECT * FROM country WHERE lang = ? OR callingcode = ?\")) {\n stmt.setString(1, \"de\");\n stmt.setInt(2, 42);\n String sql = stmt.toString();\n assertEquals(\"SELECT * FROM country WHERE lang = 'de' OR callingcode = 42\", sql);\n LOG.info(\"sql = \\\"{}\\\"\", sql);\n }\n }", "public CustomSql getCustomSqlInsert();", "final public static String createPstmtInsert(Class<? extends DotProjectObject> clazz)\n\t{\n\t\tStringBuffer sb = new StringBuffer();\n\t\tString table = null;\n\t\tField[] beanFields = null;\n\t\tString[] dbFields = null;\n\t\t\n\t\ttable = AnnotationUtil.getAnnotationValue(clazz, DbAnnotations.TABLE_ANNOTATION);\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(table);\n\t\t\n\t\tbeanFields = AnnotationUtil.getAnnotatedFields(clazz, DbAnnotations.PROPERTY_ANNOTATION);\n\t\tdbFields = new String[beanFields.length];\n\t\tfor (int i = 0; i < beanFields.length; i++) {\n\t\t\tif (! beanFields[i].isAnnotationPresent(DbAnnotations.IDENTIFICATOR_ANNOTATION)) {\n\t\t\t\tdbFields[i] = AnnotationUtil.getAnnotationValue(beanFields[i], DbAnnotations.PROPERTY_ANNOTATION);\n\t\t\t}\n\t\t}\n\t\tdbFields = (String[])ArrayUtil.clean(dbFields);\n\t\tArrays.sort(dbFields);\n\t\t\t\n\t\tsb.append(\" (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(dbFields[i]);\n\t\t}\n\t\t\n\t\tsb.append(\") values (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(\"?\");\n\t\t}\n\t\tsb.append(\")\");\n\n\t\treturn sb.toString();\n\t}", "static String serializeToString(Object s) throws SQLException {\n\treturn createString(serialize(s));\n }", "private String formatSql(String sql) {\n\t\tString sqlStr = formator.format(sql + \";\");\n\t\tif (sqlStr == null) {\n\t\t\tLOGGER.error(\"The formator.format(sql) is a null.\");\n\t\t\treturn null;\n\t\t}\n\n\t\tString trimmedSql = sqlStr.trim();\n\t\tif (!trimmedSql.endsWith(\";\")) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tString formattedSql = trimmedSql.substring(0, trimmedSql.length() - 1);\n\t\treturn formattedSql;\n\t}", "private String createFindAll() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"SELECT \");\n\t\tsb.append(\" * \");\n\t\tsb.append(\" FROM \");\n\t\tsb.append(type.getSimpleName());\n\t\treturn sb.toString();\n\t}", "private static String formatEntry(Object entry){\n return QUOTE + entry.toString() + QUOTE + DELIM;\n }", "public String insertSelective(Car record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"`basedata_car`\");\n \n if (record.getCarId() != null) {\n sql.VALUES(\"car_id\", \"#{carId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarBrandId() != null) {\n sql.VALUES(\"car_brand_id\", \"#{carBrandId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarModel() != null) {\n sql.VALUES(\"car_model\", \"#{carModel,jdbcType=VARCHAR}\");\n }\n \n if (record.getCarType() != null) {\n sql.VALUES(\"car_type\", \"#{carType,jdbcType=TINYINT}\");\n }\n \n if (record.getAlias() != null) {\n sql.VALUES(\"alias\", \"#{alias,jdbcType=VARCHAR}\");\n }\n \n if (record.getSeatType() != null) {\n sql.VALUES(\"seat_type\", \"#{seatType,jdbcType=TINYINT}\");\n }\n \n if (record.getSeatNum() != null) {\n sql.VALUES(\"seat_num\", \"#{seatNum,jdbcType=TINYINT}\");\n }\n \n if (record.getCarClass() != null) {\n sql.VALUES(\"car_class\", \"#{carClass,jdbcType=INTEGER}\");\n }\n \n if (record.getGuestNum() != null) {\n sql.VALUES(\"guest_num\", \"#{guestNum,jdbcType=INTEGER}\");\n }\n \n if (record.getLuggageNum() != null) {\n sql.VALUES(\"luggage_num\", \"#{luggageNum,jdbcType=INTEGER}\");\n }\n \n if (record.getSpell() != null) {\n sql.VALUES(\"spell\", \"#{spell,jdbcType=VARCHAR}\");\n }\n \n if (record.getEnName() != null) {\n sql.VALUES(\"en_name\", \"#{enName,jdbcType=VARCHAR}\");\n }\n \n if (record.getUpdatedAt() != null) {\n sql.VALUES(\"updated_at\", \"#{updatedAt,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getCreatedAt() != null) {\n sql.VALUES(\"created_at\", \"#{createdAt,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String Analise(String SQL, String Value){\n SQLQuery result = session.createSQLQuery(SQL);\n Value = result.toString();\n return Value;\n}", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "protected String getSQL (Element sql) {\r\n\r\n //local variables\r\n\r\n String SQL = \"\";\r\n\r\n //code description\r\n \r\n NodeList textlist = sql.getChildNodes();\r\n for (int i = 0; i < textlist.getLength(); i++) {\r\n if (textlist.item(i).getNodeType() == Node.TEXT_NODE) {\r\n SQL += textlist.item(i).getNodeValue();\r\n }\r\n }\r\n return SQL;\r\n\r\n }", "public String InsertarAnuncioGeneral(AnuncioGeneralDTO anuncio){\n int status=0;\n String message=\"Funciona bien\";\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is);\n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"insertar.AnuncioGeneral\"));\n \n ps.setString(1, anuncio.getTipoAnuncio().toString());\n ps.setString(2,anuncio.getTitulo());\n ps.setString(3,anuncio.getCuerpo());\n \n java.sql.Date fechaPublicacion=new java.sql.Date(anuncio.getFechaPublicacion().getTime());\n // DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss dd/MM/yyyy\");\n // String fecha = dateFormat.format(anuncio.getFechaPublicacion());\n // java.sql.Date fechaPublicacion=new java.sql.Date(dateFormat.parse(fecha).getTime());\n ps.setDate(4, fechaPublicacion);\n message=\"Cargo bien la fecha\";\n ps.setString(5,anuncio.getPropietario().getEmail());\n ps.setString(6,anuncio.getEstadoAnuncio().toString());\n status=ps.executeUpdate();\n\n \n int idAnuncio=GetMaxID();\n for(Contacto c : anuncio.getDestinatarios()){\n PreparedStatement psDestinatario=conect.prepareStatement(sqlProp.getProperty(\"insertar.Destinatario\"));\n psDestinatario.setInt(1, idAnuncio);\n psDestinatario.setString(2, c.getEmail());\n psDestinatario.executeUpdate();\n }\n message=\"funciona bien\";\n }catch(Exception e){\n e.toString();\n }\n\n return message;\n }", "public String Execomando(String Comsql) {\n String Mensaje = \"\";\n /* sino retorna nada es porque todo esta bien */\n try {\n PreparedStatement pstm = con.prepareStatement(Comsql);\n pstm.execute();\n pstm.close();\n } catch (SQLException e) {\n Mensaje = e.toString();\n }\n return Mensaje;\n }", "public String insertEscuela(Escuela escuela){\n String regInsertado = \"Registro Escuela #\";\n long contador = 0;\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"IDESCUELA\",escuela.getIdentificadorEscuela());\n contentValues.put(\"NOMESCUELA\", escuela.getNombreEscuela());\n contador = db.insert(\"ESCUELA\",null,contentValues);\n db.close();\n\n if(contador == -1 || contador == 0){\n regInsertado = \"Error al insertar Escuela. Registro duplicado.\";\n }else{\n regInsertado = regInsertado + contador;\n }\n return regInsertado;\n }", "protected String formatField() {\n \tif(!updated) return \"No record set.\";\n \t\n \tif(firstFieldP.getText() != null && lastFieldP.getText() != null) {\n\t \tfirstNameString = firstFieldP.getText();\n\t \tlastNameString = lastFieldP.getText();\n \t} else\t{\n \tfirstNameString = firstFieldC.getText();\n \tlastNameString = lastFieldC.getText();\n \ttribeString = tribeField.getText();\t\n \t}\n\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"<html><p align=center>\");\n \tsb.append(firstNameString);\n \tsb.append(\" \");\n \tsb.append(lastNameString);\n \tsb.append(\"<br>\");\n \tsb.append(tribeString);\n \tsb.append(\"</p></html>\");\n \t\n \treturn sb.toString(); \t\n }", "private String insertCommand(Object item)\n\t{\n\t\tif(item instanceof Road)\n\t\t{\n\t\t\tRoad tmp = (Road) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.RoadTable.TABLE_NAME + \" (\" +\n\t\t\t\tDBContract.RoadTable.ROADNAME[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.LENGTH[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.DURATION[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.PRICE[0] + \") VALUES (\" +\n\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + tmp.getLength() + \" ,\" +\n\t\t\t\ttmp.getDuration() + \" ,\" + tmp.getPrice() + \")\";\n \t\t}\n\t\telse if(item instanceof Contact)\n\t\t{\n\t\t\tContact tmp = (Contact) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.ContactTable.TABLE_NAME + \" (\" +\n\t\t\t\t\tDBContract.ContactTable.NAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.SURNAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.BILL[0] + \") VALUES (\" +\n\t\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + \"\\\"\" + tmp.getFirstName() + \"\\\"\" +\n\t\t\t\t\t\" ,\" + tmp.getbill() + \")\";\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "public String getSQLstring() {\r\n return typeId.toParsableString(this);\r\n }", "public String getTimestampString() throws SQLException {\n\t\tloadFromDB();\n\t\treturn DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM)\n\t\t\t\t\t.format(rev_timestamp);\n\t}", "public String toString() {\n\t\t//TODO add your own field name here\t\t\n\t\t//return buffer.append(this.yourFieldName).toString();\n\t\treturn \"\";\n\t}", "public String getSaveString() {\n return \"\" + Value;\n }", "public String getNoColumnsInsertString() {\n \t\treturn \"values ( )\";\n \t}", "public String insertTypesPhone() {\n String query = \"\";\n\n String[] typesPhoneDefault = res.getStringArray(R.array.types_phone);\n for (int i = 0; i < typesPhoneDefault.length; i++) {\n // Script inserting types phone default\n query += \"INSERT INTO \" + TABLE_PHONE_TYPE + \"(\" + ID + \",\" + TITLE + \") VALUES(\" + (i + 1) + \",'\" + typesPhoneDefault[i] + \"');\";\n }\n\n return query;\n }", "public String getEntrySave() {\r\n return \"-\"+getId() + \"|\" + getFavorite() + \"|\" + getSubject() + \"|\" + date(4) + \"|\" + price.getFull() + \"|\" + getNotes();\r\n }", "public String toSQL(boolean fuzzySearch){\n return toSQL();\n }", "public String insertXosoSql(String date, String data) {\n\t\tString sql =\"\";\n\t\tString table_name = db.table_name;\n\t\tif(!db.CheckRecordExisted(date)){\n\t\t\tsql= \"insert into \"+table_name+\" (date, result_json) values ('\"+date+\"','\"+data+\"')\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsql = \"UPDATE \"+table_name+\" SET result_json='\"+data+\"' WHERE date='\"+date+\"'\";\n\t\t}\n\t\tlogger.debug(sql);\n\t\ttry {\n\t\t//\tdb.createPreparedStatement(date, data);\n\t\t\tdb.executeQuery(sql);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t}\n\t\treturn sql;\n\t}", "public String getDBString();", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getLegDepartureLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalDayOffset()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegStopCount()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegEquipment()));\n return sb.toString();\n }", "public String toString()\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\treturn \"columnName: \" + columnName + \"\\n\" +\n\t\t\t\t\"defaultText: \" + defaultText + \"\\n\" +\n\t\t\t\tsuper.toString();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "private String writeNameIdResultSet(ResultSet resultSet) throws SQLException {\n\t\r\n\tString strada_arco=\"\";\r\n\tString arco=\"\";\r\n\t\r\n\tint i=0;\r\n\twhile (resultSet.next()) {\r\n\t\t// It is possible to get the columns via name\r\n\t\t// also possible to get the columns via the column number\r\n\t\t// which starts at 1\r\n\t\t// e.g. resultSet.getSTring(2);\r\n\t\t\r\n\t\t\r\n\t\tstrada_arco=resultSet.getString(1);\r\n\t\tarco=resultSet.getString(2);\r\n\t\t //nome_arco= resultSet.getString(3);\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\treturn strada_arco+\"-\"+arco;\r\n}", "public static String formatQuery( String sqlString ) {\n StringTokenizer st= new StringTokenizer( sqlString, \"'\" );\n StringWriter sw = new StringWriter();\n \n while (st.hasMoreTokens()) {\n sw.write( st.nextToken() );\n if (st.hasMoreTokens())\n sw.write( \"''\" );\n }\n \n return sw.toString();\n }", "public String insertar(Cargo cargo){\n String registrosInser=\"Registro insertado N°= \";\n long contador;\n ContentValues c=new ContentValues();\n //c.put(\"ID_CARGO\",cargo.getIdCargo());\n c.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n c.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,c);\n if(contador==-1||contador==0){\n registrosInser=\"Error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n /* String registrosInser=\"Registro insertado N°= \";\n long contador= 0;\n ContentValues carg = new ContentValues();\n //carg.put(\"ID_CARGO\",cargo.getIdCargo());\n carg.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n carg.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,carg);\n if(contador==-1||contador==0){\n registrosInser=\"error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n return registrosInser;*/\n return registrosInser;\n\n }", "@Override\n public String toSaveString() {\n //D0Finish project@June 6\n return \"D\" + (isDone ? \"1\" : \"0\") + name + \"@\" + getDate();\n }", "public String insertAlum(Alumno alumno) //lo necesitaba\n {\n String regInsertado = \"Alumno: \";\n\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"CARNET\",alumno.getCarnet());\n contentValues.put(\"IDESCUELA\", alumno.getIdEscuela());\n contentValues.put(\"NOMESTUDIANTE\", alumno.getNombre());\n long contador = db.insert(\"ESTUDIANTE\",null,contentValues);\n db.close();\n\n if(contador > 0){\n regInsertado = regInsertado + contador;\n }else{\n regInsertado = \"Ya existe el alumno.\" + alumno.getCarnet();\n }\n return regInsertado;\n }", "public String insertSelective(Userinfo record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"userinfo\");\n \n if (record.getUserid() != null) {\n sql.VALUES(\"userid\", \"#{userid,jdbcType=INTEGER}\");\n }\n \n if (record.getUsername() != null) {\n sql.VALUES(\"username\", \"#{username,jdbcType=VARCHAR}\");\n }\n \n if (record.getSex() != null) {\n sql.VALUES(\"sex\", \"#{sex,jdbcType=BIT}\");\n }\n \n if (record.getTel() != null) {\n sql.VALUES(\"tel\", \"#{tel,jdbcType=VARCHAR}\");\n }\n \n if (record.getLastlogintime() != null) {\n sql.VALUES(\"lastlogintime\", \"#{lastlogintime,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getStatus() != null) {\n sql.VALUES(\"status\", \"#{status,jdbcType=BIT}\");\n }\n \n if (record.getWxopenid() != null) {\n sql.VALUES(\"wxopenid\", \"#{wxopenid,jdbcType=VARCHAR}\");\n }\n \n if (record.getAddr() != null) {\n sql.VALUES(\"addr\", \"#{addr,jdbcType=VARCHAR}\");\n }\n \n if (record.getDelStatus() != null) {\n sql.VALUES(\"del_status\", \"#{delStatus,jdbcType=BIT}\");\n }\n \n if (record.getCreatetime() != null) {\n sql.VALUES(\"createtime\", \"#{createtime,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String databaseToString()\n {\n String dbString = \"\";\n SQLiteDatabase sqLiteDatabase = getWritableDatabase(); // database we writing too\n String query = \"SELECT * FROM \" + TABLE_PRODUCTS + \"WHERE 1\"; // 1 means every row * means every columns\n\n //Cursor points to locations in the results\n Cursor cursor = sqLiteDatabase.rawQuery(query,null);\n //Move to first row in results\n cursor.moveToFirst();\n\n // loops through every product and extracts the productname\n while(!cursor.isAfterLast())\n {\n if(cursor.getString(cursor.getColumnIndex(\"productname\"))!= null)\n {\n dbString += cursor.getString(cursor.getColumnIndex(\"productname\"));\n dbString += \"\\n\";\n }\n }\n sqLiteDatabase.close();\n return dbString;\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getHashKey()));\n return sb.toString();\n }", "public String prepareStatementString() throws SQLException {\n\t\tList<Object> argList = new ArrayList<Object>();\n\t\treturn buildStatementString(argList);\n\t}", "public String getStringRecord() {\n NumberFormat nf = new DecimalFormat(\"0000.00\");\n String delimiter = \",\";\n\n return String.format(\"%05d\", orderLineId) + delimiter + String.format(\"%05d\", orderId) + delimiter\n + String.format(\"%05d\", userId) + delimiter + String.format(\"%05d\", productId) + delimiter\n + String.format(\"%05d\", orderLineQuantity) + delimiter + nf.format(salesPrice)\n + System.getProperty(\"line.separator\");\n }", "private static String adqlCharLiteral( String txt ) {\n return \"'\" + txt.replaceAll( \"'\", \"''\" ) + \"'\";\n }", "private String produceSQL(String[] cols) {\n StringBuffer buffer = new StringBuffer();\n buffer.append('(');\n buffer.append(cols[0]);\n\n for (int i = 1; i < cols.length; i++){\n buffer.append(',');\n buffer.append(cols[i]);\n }\n buffer.append(')');\n return buffer.toString();\n }", "public String agregarCuenta(Cuenta cuenta) {\n String mensaje = \"\";\n try {\n PreparedStatement PrSt;\n String Query = \"INSERT INTO Cuenta VALUES(?,?,?,?)\";\n PrSt = conexion.prepareStatement(Query);\n PrSt.setString(1, cuenta.getCodigo());\n PrSt.setDate(2, cuenta.getCreacion());\n PrSt.setDouble(3, cuenta.getCredito());\n PrSt.setString(4, cuenta.getCodigo_cliente());\n int resultado = PrSt.executeUpdate();\n if (resultado > 0) {\n mensaje = \"Agregada Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n } else {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n }\n PrSt.close();\n } catch (SQLException e) {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente() + \" Error: \" + e.toString();\n }\n return mensaje;\n }", "public static String convertColumn2String(Column column) {\n char type = '\\0';\n String result = \"\";\n\n switch (column.type) {\n case STRING:\n type = 's';\n result = (column.value == null? \"\" : column.value.toString());\n break;\n case INT:\n type = 'i';\n int value;\n if (column.value == null)\n value = INT_OFFSET; // we don't really distinguish between zero and null\n else\n value = ((Integer)column.value).intValue() + INT_OFFSET;\n result = String.format(INT_FORMAT_STRING, value);\n break;\n case DOUBLE:\n type = 'd';\n double value2;\n if (column.value == null)\n value2 = INT_OFFSET;\n else\n value2 = ((Double)column.value).doubleValue() + INT_OFFSET;\n result = String.format(DOUBLE_FORMAT_STRING, value2);\n break;\n }\n\n return type + result;\n }", "public abstract String createDBString();", "public String ToString(){\r\n String Result;\r\n return Result = \"Arco: \"+this.id+\" Dato: \"+String.valueOf(this.Dato)+\" Peso: \"+String.valueOf(this.p)+\" Extremo Inicial: \"+this.Vi.id+\" Extremo Final: \"+this.Vf.id;\r\n }", "public String getRecordText();", "public String getRecordText();", "String getToText();", "private void yas(){\n System.out.println(namn);\n \n try{\n String fraga = \"SELECT TEXT FROM INLAGG WHERE RUBRIK = 'Borttappad strumpa'\";\n String XD = db.fetchSingle(fraga);\n System.out.println(XD);\n txtInlagg.append(XD);\n }\n catch(InfException e){\n JOptionPane.showMessageDialog(null, \"Kunde ej hämta inlägg\");\n }\n }", "@Override\n\tpublic String insertStatement() throws Exception {\n\t\treturn null;\n\t}", "String getFormattedString(IRenamable f);", "public static String getDadoFormatado(String pDado, TiposDadosQuery pTipo) {\n String dadoFormatado;\n if (pDado != null) {\n switch (pTipo)\n {\n case TEXTO:\n dadoFormatado = \"'\" + verificaAspaSimples(pDado) + \"'\";\n break;\n case DATA:\n dadoFormatado = \"'\" + pDado + \"'\";\n break;\n default:\n dadoFormatado = pDado; \n break;\n }\n }\n else {\n dadoFormatado = \"null\";\n }\n \n return dadoFormatado;\n \n }", "public abstract String valueAsText();", "String getInsertStatement(\r\n TypedKeyValue<List<String>, List<String>> fieldsAndValues,\r\n String tableName);", "public String loopDBInfo(ResultSet rs){\n String p = \"\";\n try{\n while (rs.next()) {\n int id_col = rs.getInt(\"ID\");\n String first_name = rs.getString(\"NAME\");\n String phone = rs.getString(\"PHONE\");\n String status = rs.getString(\"STATUS\");\n String prob = rs.getString(\"PROBLEM\");\n \n \n p = p + (id_col + \" \" + first_name + \" \" + phone + \" \"+ status + \" \"+ prob + \"\\n\"); \n // System.out.println(p);\n }\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n \n } return p;\n }", "@Override\n public String getStringFromDatabase(int objectID) {\n return \"From Class one result\"+objectID;\n }" ]
[ "0.7233016", "0.66461235", "0.6532687", "0.63874143", "0.63174", "0.62672967", "0.62202305", "0.62087464", "0.6204161", "0.61547345", "0.61353797", "0.6082596", "0.5925019", "0.5791024", "0.5734974", "0.5702277", "0.5672253", "0.56627274", "0.5660367", "0.56506246", "0.564931", "0.5626197", "0.56242543", "0.5618237", "0.56068087", "0.56068087", "0.56068087", "0.56068087", "0.56068087", "0.56040955", "0.5582747", "0.55795836", "0.55707884", "0.55396575", "0.55236363", "0.54791754", "0.5472296", "0.5462698", "0.5453227", "0.54472536", "0.5400536", "0.53715086", "0.5368121", "0.53596985", "0.5351287", "0.5345429", "0.5340733", "0.53321636", "0.53272164", "0.53025305", "0.5300957", "0.53008366", "0.5298505", "0.5296775", "0.5290115", "0.5290115", "0.5285319", "0.5278022", "0.5271674", "0.5270699", "0.5266978", "0.52628124", "0.525755", "0.5257466", "0.52541727", "0.5252564", "0.5251364", "0.52467024", "0.5244543", "0.5237503", "0.5221646", "0.5211987", "0.5206899", "0.5205768", "0.5202506", "0.5198234", "0.5189697", "0.51831126", "0.51824445", "0.51734805", "0.5169718", "0.5164501", "0.5163555", "0.51619434", "0.5158494", "0.51491463", "0.51469153", "0.514507", "0.5137678", "0.51371235", "0.51257396", "0.51257396", "0.5119635", "0.5117046", "0.51147455", "0.51139927", "0.5112402", "0.5110973", "0.5103027", "0.5093027", "0.509231" ]
0.0
-1
Retorna texto formatado para insercao em query
public static String getDadoFormatado(BigDecimal pDado, TiposDadosQuery pTipo) { StringBuilder dadoFormatado = new StringBuilder(""); if (pDado == null) { dadoFormatado.append("null"); } else { dadoFormatado.append(pDado.toPlainString()); } return dadoFormatado.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toInsert() {\r\n return \"(null,'\"+ ref + \"','\" + name + \"','\" + tel + \"','\" + address + \"')\";\r\n }", "public String getInsertSQL()\n\t{\n\t\tString fieldList = \"parametro, dia, valor\";\n\t\treturn String.format(\"insert into alteracs (%s) values (%d, %d, %s)\",\n\t\t\t\tfieldList, parametro, dia, String.format(\"%.3f\", valor).replace(',', '.'));\n\t}", "protected String queryInsert() {\n StringBuilder sb = new StringBuilder(\"INSERT INTO \");\n sb.append(tabla).append(\" (\").append(String.join(\",\", campos)).append(\") VALUES (\");\n\n for (int i = 0; i < campos.length; i++) {\n if (i == campos.length -1) {\n sb.append(\"?)\");\n break;\n }\n sb.append(\"?,\");\n }\n\n return sb.toString();\n }", "public abstract String toSQL();", "protected String createInsert(T t) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(type.getSimpleName());\n\t\tsb.append(\" VALUES \");\n\t\treturn sb.toString();\n\t}", "@Override\n\tprotected String sql() throws OperationException {\n\t\treturn sql.insert(tbObj, fieldValue);\n\t}", "private String createInsertQuery() {\r\n StringBuilder query = new StringBuilder();\r\n query.append(\"insert into \").append(m_tableName)\r\n .append(\"(\").append(m_propertyNames[0]);\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",\").append(m_propertyNames[i]);\r\n }\r\n query.append(\") values (?\");\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",?\");\r\n }\r\n query.append(\")\");\r\n return query.toString();\r\n }", "public abstract String toDBString();", "@Override\r\n\tpublic String generate() {\r\n\t\tStringBuilder query = new StringBuilder();\r\n\r\n\t\tquery.append(\"INSERT INTO \").append(tableName).append(\" (\");\r\n\t\tfor (int i = 0; i < fieldNames.size(); i++) {\r\n\t\t\tquery.append(fieldNames.get(i));\r\n\t\t\tif (i < fieldNames.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\") VALUES (\");\r\n\t\tfor (int i = 0; i < fieldValues.size(); i++) {\r\n\t\t\tquery.append(\"'\").append(fieldValues.get(i)).append(\"'\");\r\n\t\t\tif (i < fieldValues.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\");\");\r\n\t\treturn query.toString();\r\n\t}", "String toSql();", "@Override\n\tpublic String getPreparedInsertText() {\n\t\treturn SQL_Insert;\n\t}", "private String createInsertQuery()\n {\n int i = 0;\n StringBuilder sb = new StringBuilder();\n sb.append(\"INSERT INTO \");\n sb.append(type.getSimpleName());\n sb.append(\" (\");\n for(Field field:type.getDeclaredFields()) {i++; if(i != type.getDeclaredFields().length)sb.append(field.getName() +\", \"); else sb.append(field.getName());}\n sb.append(\")\");\n sb.append(\" VALUES (\");\n i = 0;\n for(Field field:type.getDeclaredFields()) {i++; if(i!= type.getDeclaredFields().length)sb.append(\"?, \"); else sb.append(\"?\");}\n sb.append(\");\");\n return sb.toString();\n }", "public abstract void toSQL(StringBuilder ret);", "String getBarcharDataQuery();", "public String getInsertContentSql(String table)\r\n \t{\r\n \t\treturn \"insert into \" + table + \" (RESOURCE_ID, BODY)\" + \" values (? , ? )\";\r\n \t}", "@Override\n public String saveAsString() {\n return \"D\" + super.saveAsString() + \" | \" + by;\n }", "public String toDBString() {\n return extra1 + DIVIDER + extra2;\n }", "private String getValuesToInsert(int row) {\n List<String> orderedFields = new ArrayList<>(mapFieldsTypes.keySet()); // get ordered list of fields\n StringBuffer insertRowStringBuffer = new StringBuffer();\n insertRowStringBuffer // add first part of query insert string\n .append(SQLFormater.INSERT_INTO)\n .append(\" \")\n .append(tableName)\n .append(\" \")\n .append(\"(\")\n .append(idFieldName) // first inserted field is always row ID\n .append(\",\");\n orderedFields.forEach(field -> insertRowStringBuffer // add names of fields in order they will be inserted\n .append(field)\n .append(\", \")\n );\n insertRowStringBuffer // add another part of string before values\n .append(\")\")\n .append(\" \")\n .append(SQLFormater.VALUES)\n .append(\"(\")\n .append(row); // first field is always row ID\n if (!mapFieldsStrings.isEmpty() || !mapFieldsIntegers.isEmpty()) {\n orderedFields.forEach(field -> { // inserting field values in controlled order\n insertRowStringBuffer.append(\", \");\n if (mapFieldsStrings.containsKey(field)) {\n insertRowStringBuffer\n .append(\"'\")\n .append(mapFieldsStrings.get(field))\n .append(\"'\");\n } else if (mapFieldsIntegers.containsKey(field)) {\n insertRowStringBuffer.append(mapFieldsIntegers.get(field));\n }\n });\n }\n insertRowStringBuffer.append(\")\");\n clearInsertingValues(); // clear fields to insert another row\n return insertRowStringBuffer.toString();\n }", "private String encodeSQL(String text) {\r\n text = text.replaceAll(\"'\", \"''\");\r\n return \"'\" + text + \"'\";\r\n }", "private String getSQLText (CTextField f)\n \t{\n \t\tString s = f.getText().toUpperCase();\n \t\tif (!s.endsWith(\"%\"))\n \t\t\ts += \"%\";\n \t\tlog.fine( \"String=\" + s);\n \t\treturn s;\n \t}", "public String toString() {\n return SQLStringVisitor.getSQLString(this);\n }", "public String insert(DtoEntrprs dto){\n\t\treturn null;\r\n\t}", "private static String toSql(Object obj) {\n\t\tif(obj==null) {\n\t\t\treturn \"NULL\";\n\t\t}\n\t\tif(obj instanceof String) {\n\t\t\treturn \"'\"+obj+\"'\";\n\t\t}\n\t\treturn obj.toString();\n\t}", "public String getDateTimeInsertString(java.sql.Timestamp aTimestamp){\r\n return \"'\" + DBUtil.getDBDateTimeString(aTimestamp) + \"'\";\r\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String getIdentityInsertString() {\n \t\treturn null;\n \t}", "private String getStringToCreateDB(String addings) {\n StringBuffer createDBStringBuffer = new StringBuffer();\n createDBStringBuffer\n .append(SQLFormater.CREATE_TABLE)\n .append(\" \")\n .append(tableName)\n .append(\"(\")\n .append(idFieldName)\n .append(\" \")\n .append(DBCreator.INTEGER_TYPE)\n .append(\" \")\n .append(SQLFormater.PRIMARY_KEY);\n mapFieldsTypes.forEach((kField, vType) -> { // add all table's fields\n createDBStringBuffer\n .append(\", \")\n .append(kField)\n .append(\" \")\n .append(vType);\n if(mapFieldsConstraints.containsKey(kField)) { // add constraint for a field\n createDBStringBuffer\n .append(\" \")\n .append(mapFieldsConstraints.get(kField));\n }\n });\n if (addings != null && !addings.isEmpty()) { // add reference\n createDBStringBuffer\n .append(\", \")\n .append(addings);\n }\n createDBStringBuffer.append(\")\");\n return createDBStringBuffer.toString();\n }", "private static String buildStringFromCursor(Cursor dbCursor)\n {\n String writeString = \"\";\n int columnCount = dbCursor.getColumnCount();\n\n for(int count = 0; count < columnCount; count++)\n {\n writeString += dbCursor.getString(count);\n if(count < columnCount - 1)\n {\n writeString += \"\\t\";\n }\n else\n {\n writeString += \"\\n\";\n }\n }\n return writeString;\n }", "protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }", "String buildInsertQuery(String... args);", "public String toSave() {\n\n return \"D|\" + super.toSave() + \" by: \" + by;\n }", "protected String getInsertionSQL() {\n\t\treturn queryData.getString(\"InsertionSQL\");\n\t}", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getCode()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getBatchId()));\n sb.append(\", \");\n sb.append(f.formatAny(getNestId()));\n return sb.toString();\n }", "protected String getSQLString() {\n \t\treturn queryTranslator.getSQLString();\n \t}", "public String toSQL() {\n\t\tStringBuilder sBuider = new StringBuilder();\n\n\t\t\n\t\t\n\t\t\n\t\tString sTemp = sBuider.toString();\n\t\tSystem.out.println(this.getClass().getName() + \".toSQL(): SQL statements are \\n\" + sTemp);\n\t\t\n\t\tsBuider = null;\n\t\t\n\t\treturn sTemp;\n\t}", "public String makeValue(ResultRow row) {\n\t\tStringBuffer result = new StringBuffer(this.id);\n\t\tfor (ColumnName column: columns) {\n\t\t\tString value = row.get(column);\n\t\t\tif (value == null) {\n\t\t\t\treturn null;\n\t\t }\n\t\t\tresult.append(DELIMITER);\n\t\t\tresult.append(value);\n\t\t}\n return result.toString();\n\t}", "private String createStandardGZFieldTexts()\n\t{\n\t\tStringBuffer result = new StringBuffer();\n\t\tfor (Entry<String, String[]> entry : standardJournalFieldColumns.entrySet())\n\t\t{\n\t\t\tif (result.length() != 0)\n\t\t\t{\n\t\t\t\tresult.append(\", \");\n\t\t\t}\n\t\t\tresult.append(entry.getKey());\n\t\t\tresult.append(\" TEXT IS '\");\n\t\t\tString[] strings = entry.getValue();\n\t\t\tfor (int index = 0; index < strings.length; index++)\n\t\t\t{\n\t\t\t\tresult.append(strings[index]);\n\t\t\t\tif (index < strings.length)\n\t\t\t\t{\n\t\t\t\t\tresult.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.append(\"'\");\n\t\t}\n\t\treturn result.toString();\n\t}", "protected String formatErrorMessage() throws SQLException {\n \tint errCode = SQLite.extendederrcode(getConnection().getSqliteDb());\r\n \tString message = SQLite.errmsg(getConnection().getSqliteDb());\r\n\t\tString s = StringUtil.format(\"Code:{0}\\n{1}\", errCode, message);\r\n\t\treturn s;\r\n\t}", "@Override\n public String databaseString() {\n return \"T | \" + super.databaseString();\n }", "public abstract String toSaveString();", "@Test\n public void testToStringWithSQL() throws SQLException {\n try (PreparedStatement stmt = this.proxy\n .prepareStatement(\"SELECT * FROM country WHERE lang = ? OR callingcode = ?\")) {\n stmt.setString(1, \"de\");\n stmt.setInt(2, 42);\n String sql = stmt.toString();\n assertEquals(\"SELECT * FROM country WHERE lang = 'de' OR callingcode = 42\", sql);\n LOG.info(\"sql = \\\"{}\\\"\", sql);\n }\n }", "public CustomSql getCustomSqlInsert();", "final public static String createPstmtInsert(Class<? extends DotProjectObject> clazz)\n\t{\n\t\tStringBuffer sb = new StringBuffer();\n\t\tString table = null;\n\t\tField[] beanFields = null;\n\t\tString[] dbFields = null;\n\t\t\n\t\ttable = AnnotationUtil.getAnnotationValue(clazz, DbAnnotations.TABLE_ANNOTATION);\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(table);\n\t\t\n\t\tbeanFields = AnnotationUtil.getAnnotatedFields(clazz, DbAnnotations.PROPERTY_ANNOTATION);\n\t\tdbFields = new String[beanFields.length];\n\t\tfor (int i = 0; i < beanFields.length; i++) {\n\t\t\tif (! beanFields[i].isAnnotationPresent(DbAnnotations.IDENTIFICATOR_ANNOTATION)) {\n\t\t\t\tdbFields[i] = AnnotationUtil.getAnnotationValue(beanFields[i], DbAnnotations.PROPERTY_ANNOTATION);\n\t\t\t}\n\t\t}\n\t\tdbFields = (String[])ArrayUtil.clean(dbFields);\n\t\tArrays.sort(dbFields);\n\t\t\t\n\t\tsb.append(\" (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(dbFields[i]);\n\t\t}\n\t\t\n\t\tsb.append(\") values (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(\"?\");\n\t\t}\n\t\tsb.append(\")\");\n\n\t\treturn sb.toString();\n\t}", "static String serializeToString(Object s) throws SQLException {\n\treturn createString(serialize(s));\n }", "private static String formatEntry(Object entry){\n return QUOTE + entry.toString() + QUOTE + DELIM;\n }", "private String formatSql(String sql) {\n\t\tString sqlStr = formator.format(sql + \";\");\n\t\tif (sqlStr == null) {\n\t\t\tLOGGER.error(\"The formator.format(sql) is a null.\");\n\t\t\treturn null;\n\t\t}\n\n\t\tString trimmedSql = sqlStr.trim();\n\t\tif (!trimmedSql.endsWith(\";\")) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tString formattedSql = trimmedSql.substring(0, trimmedSql.length() - 1);\n\t\treturn formattedSql;\n\t}", "private String createFindAll() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"SELECT \");\n\t\tsb.append(\" * \");\n\t\tsb.append(\" FROM \");\n\t\tsb.append(type.getSimpleName());\n\t\treturn sb.toString();\n\t}", "public String insertSelective(Car record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"`basedata_car`\");\n \n if (record.getCarId() != null) {\n sql.VALUES(\"car_id\", \"#{carId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarBrandId() != null) {\n sql.VALUES(\"car_brand_id\", \"#{carBrandId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarModel() != null) {\n sql.VALUES(\"car_model\", \"#{carModel,jdbcType=VARCHAR}\");\n }\n \n if (record.getCarType() != null) {\n sql.VALUES(\"car_type\", \"#{carType,jdbcType=TINYINT}\");\n }\n \n if (record.getAlias() != null) {\n sql.VALUES(\"alias\", \"#{alias,jdbcType=VARCHAR}\");\n }\n \n if (record.getSeatType() != null) {\n sql.VALUES(\"seat_type\", \"#{seatType,jdbcType=TINYINT}\");\n }\n \n if (record.getSeatNum() != null) {\n sql.VALUES(\"seat_num\", \"#{seatNum,jdbcType=TINYINT}\");\n }\n \n if (record.getCarClass() != null) {\n sql.VALUES(\"car_class\", \"#{carClass,jdbcType=INTEGER}\");\n }\n \n if (record.getGuestNum() != null) {\n sql.VALUES(\"guest_num\", \"#{guestNum,jdbcType=INTEGER}\");\n }\n \n if (record.getLuggageNum() != null) {\n sql.VALUES(\"luggage_num\", \"#{luggageNum,jdbcType=INTEGER}\");\n }\n \n if (record.getSpell() != null) {\n sql.VALUES(\"spell\", \"#{spell,jdbcType=VARCHAR}\");\n }\n \n if (record.getEnName() != null) {\n sql.VALUES(\"en_name\", \"#{enName,jdbcType=VARCHAR}\");\n }\n \n if (record.getUpdatedAt() != null) {\n sql.VALUES(\"updated_at\", \"#{updatedAt,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getCreatedAt() != null) {\n sql.VALUES(\"created_at\", \"#{createdAt,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String Analise(String SQL, String Value){\n SQLQuery result = session.createSQLQuery(SQL);\n Value = result.toString();\n return Value;\n}", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "protected String getSQL (Element sql) {\r\n\r\n //local variables\r\n\r\n String SQL = \"\";\r\n\r\n //code description\r\n \r\n NodeList textlist = sql.getChildNodes();\r\n for (int i = 0; i < textlist.getLength(); i++) {\r\n if (textlist.item(i).getNodeType() == Node.TEXT_NODE) {\r\n SQL += textlist.item(i).getNodeValue();\r\n }\r\n }\r\n return SQL;\r\n\r\n }", "public String InsertarAnuncioGeneral(AnuncioGeneralDTO anuncio){\n int status=0;\n String message=\"Funciona bien\";\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is);\n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"insertar.AnuncioGeneral\"));\n \n ps.setString(1, anuncio.getTipoAnuncio().toString());\n ps.setString(2,anuncio.getTitulo());\n ps.setString(3,anuncio.getCuerpo());\n \n java.sql.Date fechaPublicacion=new java.sql.Date(anuncio.getFechaPublicacion().getTime());\n // DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss dd/MM/yyyy\");\n // String fecha = dateFormat.format(anuncio.getFechaPublicacion());\n // java.sql.Date fechaPublicacion=new java.sql.Date(dateFormat.parse(fecha).getTime());\n ps.setDate(4, fechaPublicacion);\n message=\"Cargo bien la fecha\";\n ps.setString(5,anuncio.getPropietario().getEmail());\n ps.setString(6,anuncio.getEstadoAnuncio().toString());\n status=ps.executeUpdate();\n\n \n int idAnuncio=GetMaxID();\n for(Contacto c : anuncio.getDestinatarios()){\n PreparedStatement psDestinatario=conect.prepareStatement(sqlProp.getProperty(\"insertar.Destinatario\"));\n psDestinatario.setInt(1, idAnuncio);\n psDestinatario.setString(2, c.getEmail());\n psDestinatario.executeUpdate();\n }\n message=\"funciona bien\";\n }catch(Exception e){\n e.toString();\n }\n\n return message;\n }", "public String insertEscuela(Escuela escuela){\n String regInsertado = \"Registro Escuela #\";\n long contador = 0;\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"IDESCUELA\",escuela.getIdentificadorEscuela());\n contentValues.put(\"NOMESCUELA\", escuela.getNombreEscuela());\n contador = db.insert(\"ESCUELA\",null,contentValues);\n db.close();\n\n if(contador == -1 || contador == 0){\n regInsertado = \"Error al insertar Escuela. Registro duplicado.\";\n }else{\n regInsertado = regInsertado + contador;\n }\n return regInsertado;\n }", "public String Execomando(String Comsql) {\n String Mensaje = \"\";\n /* sino retorna nada es porque todo esta bien */\n try {\n PreparedStatement pstm = con.prepareStatement(Comsql);\n pstm.execute();\n pstm.close();\n } catch (SQLException e) {\n Mensaje = e.toString();\n }\n return Mensaje;\n }", "protected String formatField() {\n \tif(!updated) return \"No record set.\";\n \t\n \tif(firstFieldP.getText() != null && lastFieldP.getText() != null) {\n\t \tfirstNameString = firstFieldP.getText();\n\t \tlastNameString = lastFieldP.getText();\n \t} else\t{\n \tfirstNameString = firstFieldC.getText();\n \tlastNameString = lastFieldC.getText();\n \ttribeString = tribeField.getText();\t\n \t}\n\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"<html><p align=center>\");\n \tsb.append(firstNameString);\n \tsb.append(\" \");\n \tsb.append(lastNameString);\n \tsb.append(\"<br>\");\n \tsb.append(tribeString);\n \tsb.append(\"</p></html>\");\n \t\n \treturn sb.toString(); \t\n }", "private String insertCommand(Object item)\n\t{\n\t\tif(item instanceof Road)\n\t\t{\n\t\t\tRoad tmp = (Road) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.RoadTable.TABLE_NAME + \" (\" +\n\t\t\t\tDBContract.RoadTable.ROADNAME[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.LENGTH[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.DURATION[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.PRICE[0] + \") VALUES (\" +\n\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + tmp.getLength() + \" ,\" +\n\t\t\t\ttmp.getDuration() + \" ,\" + tmp.getPrice() + \")\";\n \t\t}\n\t\telse if(item instanceof Contact)\n\t\t{\n\t\t\tContact tmp = (Contact) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.ContactTable.TABLE_NAME + \" (\" +\n\t\t\t\t\tDBContract.ContactTable.NAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.SURNAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.BILL[0] + \") VALUES (\" +\n\t\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + \"\\\"\" + tmp.getFirstName() + \"\\\"\" +\n\t\t\t\t\t\" ,\" + tmp.getbill() + \")\";\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "public String getTimestampString() throws SQLException {\n\t\tloadFromDB();\n\t\treturn DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM)\n\t\t\t\t\t.format(rev_timestamp);\n\t}", "public String getSQLstring() {\r\n return typeId.toParsableString(this);\r\n }", "public String toString() {\n\t\t//TODO add your own field name here\t\t\n\t\t//return buffer.append(this.yourFieldName).toString();\n\t\treturn \"\";\n\t}", "public String getSaveString() {\n return \"\" + Value;\n }", "public String getNoColumnsInsertString() {\n \t\treturn \"values ( )\";\n \t}", "public String insertTypesPhone() {\n String query = \"\";\n\n String[] typesPhoneDefault = res.getStringArray(R.array.types_phone);\n for (int i = 0; i < typesPhoneDefault.length; i++) {\n // Script inserting types phone default\n query += \"INSERT INTO \" + TABLE_PHONE_TYPE + \"(\" + ID + \",\" + TITLE + \") VALUES(\" + (i + 1) + \",'\" + typesPhoneDefault[i] + \"');\";\n }\n\n return query;\n }", "public String getEntrySave() {\r\n return \"-\"+getId() + \"|\" + getFavorite() + \"|\" + getSubject() + \"|\" + date(4) + \"|\" + price.getFull() + \"|\" + getNotes();\r\n }", "public String toSQL(boolean fuzzySearch){\n return toSQL();\n }", "public String insertXosoSql(String date, String data) {\n\t\tString sql =\"\";\n\t\tString table_name = db.table_name;\n\t\tif(!db.CheckRecordExisted(date)){\n\t\t\tsql= \"insert into \"+table_name+\" (date, result_json) values ('\"+date+\"','\"+data+\"')\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsql = \"UPDATE \"+table_name+\" SET result_json='\"+data+\"' WHERE date='\"+date+\"'\";\n\t\t}\n\t\tlogger.debug(sql);\n\t\ttry {\n\t\t//\tdb.createPreparedStatement(date, data);\n\t\t\tdb.executeQuery(sql);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t}\n\t\treturn sql;\n\t}", "public String getDBString();", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getLegDepartureLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalDayOffset()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegStopCount()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegEquipment()));\n return sb.toString();\n }", "public String toString()\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\treturn \"columnName: \" + columnName + \"\\n\" +\n\t\t\t\t\"defaultText: \" + defaultText + \"\\n\" +\n\t\t\t\tsuper.toString();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "private String writeNameIdResultSet(ResultSet resultSet) throws SQLException {\n\t\r\n\tString strada_arco=\"\";\r\n\tString arco=\"\";\r\n\t\r\n\tint i=0;\r\n\twhile (resultSet.next()) {\r\n\t\t// It is possible to get the columns via name\r\n\t\t// also possible to get the columns via the column number\r\n\t\t// which starts at 1\r\n\t\t// e.g. resultSet.getSTring(2);\r\n\t\t\r\n\t\t\r\n\t\tstrada_arco=resultSet.getString(1);\r\n\t\tarco=resultSet.getString(2);\r\n\t\t //nome_arco= resultSet.getString(3);\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\treturn strada_arco+\"-\"+arco;\r\n}", "public static String formatQuery( String sqlString ) {\n StringTokenizer st= new StringTokenizer( sqlString, \"'\" );\n StringWriter sw = new StringWriter();\n \n while (st.hasMoreTokens()) {\n sw.write( st.nextToken() );\n if (st.hasMoreTokens())\n sw.write( \"''\" );\n }\n \n return sw.toString();\n }", "public String insertar(Cargo cargo){\n String registrosInser=\"Registro insertado N°= \";\n long contador;\n ContentValues c=new ContentValues();\n //c.put(\"ID_CARGO\",cargo.getIdCargo());\n c.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n c.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,c);\n if(contador==-1||contador==0){\n registrosInser=\"Error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n /* String registrosInser=\"Registro insertado N°= \";\n long contador= 0;\n ContentValues carg = new ContentValues();\n //carg.put(\"ID_CARGO\",cargo.getIdCargo());\n carg.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n carg.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,carg);\n if(contador==-1||contador==0){\n registrosInser=\"error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n return registrosInser;*/\n return registrosInser;\n\n }", "public String insertAlum(Alumno alumno) //lo necesitaba\n {\n String regInsertado = \"Alumno: \";\n\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"CARNET\",alumno.getCarnet());\n contentValues.put(\"IDESCUELA\", alumno.getIdEscuela());\n contentValues.put(\"NOMESTUDIANTE\", alumno.getNombre());\n long contador = db.insert(\"ESTUDIANTE\",null,contentValues);\n db.close();\n\n if(contador > 0){\n regInsertado = regInsertado + contador;\n }else{\n regInsertado = \"Ya existe el alumno.\" + alumno.getCarnet();\n }\n return regInsertado;\n }", "@Override\n public String toSaveString() {\n //D0Finish project@June 6\n return \"D\" + (isDone ? \"1\" : \"0\") + name + \"@\" + getDate();\n }", "public String insertSelective(Userinfo record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"userinfo\");\n \n if (record.getUserid() != null) {\n sql.VALUES(\"userid\", \"#{userid,jdbcType=INTEGER}\");\n }\n \n if (record.getUsername() != null) {\n sql.VALUES(\"username\", \"#{username,jdbcType=VARCHAR}\");\n }\n \n if (record.getSex() != null) {\n sql.VALUES(\"sex\", \"#{sex,jdbcType=BIT}\");\n }\n \n if (record.getTel() != null) {\n sql.VALUES(\"tel\", \"#{tel,jdbcType=VARCHAR}\");\n }\n \n if (record.getLastlogintime() != null) {\n sql.VALUES(\"lastlogintime\", \"#{lastlogintime,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getStatus() != null) {\n sql.VALUES(\"status\", \"#{status,jdbcType=BIT}\");\n }\n \n if (record.getWxopenid() != null) {\n sql.VALUES(\"wxopenid\", \"#{wxopenid,jdbcType=VARCHAR}\");\n }\n \n if (record.getAddr() != null) {\n sql.VALUES(\"addr\", \"#{addr,jdbcType=VARCHAR}\");\n }\n \n if (record.getDelStatus() != null) {\n sql.VALUES(\"del_status\", \"#{delStatus,jdbcType=BIT}\");\n }\n \n if (record.getCreatetime() != null) {\n sql.VALUES(\"createtime\", \"#{createtime,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String databaseToString()\n {\n String dbString = \"\";\n SQLiteDatabase sqLiteDatabase = getWritableDatabase(); // database we writing too\n String query = \"SELECT * FROM \" + TABLE_PRODUCTS + \"WHERE 1\"; // 1 means every row * means every columns\n\n //Cursor points to locations in the results\n Cursor cursor = sqLiteDatabase.rawQuery(query,null);\n //Move to first row in results\n cursor.moveToFirst();\n\n // loops through every product and extracts the productname\n while(!cursor.isAfterLast())\n {\n if(cursor.getString(cursor.getColumnIndex(\"productname\"))!= null)\n {\n dbString += cursor.getString(cursor.getColumnIndex(\"productname\"));\n dbString += \"\\n\";\n }\n }\n sqLiteDatabase.close();\n return dbString;\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getHashKey()));\n return sb.toString();\n }", "public String prepareStatementString() throws SQLException {\n\t\tList<Object> argList = new ArrayList<Object>();\n\t\treturn buildStatementString(argList);\n\t}", "public String getStringRecord() {\n NumberFormat nf = new DecimalFormat(\"0000.00\");\n String delimiter = \",\";\n\n return String.format(\"%05d\", orderLineId) + delimiter + String.format(\"%05d\", orderId) + delimiter\n + String.format(\"%05d\", userId) + delimiter + String.format(\"%05d\", productId) + delimiter\n + String.format(\"%05d\", orderLineQuantity) + delimiter + nf.format(salesPrice)\n + System.getProperty(\"line.separator\");\n }", "private static String adqlCharLiteral( String txt ) {\n return \"'\" + txt.replaceAll( \"'\", \"''\" ) + \"'\";\n }", "private String produceSQL(String[] cols) {\n StringBuffer buffer = new StringBuffer();\n buffer.append('(');\n buffer.append(cols[0]);\n\n for (int i = 1; i < cols.length; i++){\n buffer.append(',');\n buffer.append(cols[i]);\n }\n buffer.append(')');\n return buffer.toString();\n }", "public String agregarCuenta(Cuenta cuenta) {\n String mensaje = \"\";\n try {\n PreparedStatement PrSt;\n String Query = \"INSERT INTO Cuenta VALUES(?,?,?,?)\";\n PrSt = conexion.prepareStatement(Query);\n PrSt.setString(1, cuenta.getCodigo());\n PrSt.setDate(2, cuenta.getCreacion());\n PrSt.setDouble(3, cuenta.getCredito());\n PrSt.setString(4, cuenta.getCodigo_cliente());\n int resultado = PrSt.executeUpdate();\n if (resultado > 0) {\n mensaje = \"Agregada Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n } else {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n }\n PrSt.close();\n } catch (SQLException e) {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente() + \" Error: \" + e.toString();\n }\n return mensaje;\n }", "public static String convertColumn2String(Column column) {\n char type = '\\0';\n String result = \"\";\n\n switch (column.type) {\n case STRING:\n type = 's';\n result = (column.value == null? \"\" : column.value.toString());\n break;\n case INT:\n type = 'i';\n int value;\n if (column.value == null)\n value = INT_OFFSET; // we don't really distinguish between zero and null\n else\n value = ((Integer)column.value).intValue() + INT_OFFSET;\n result = String.format(INT_FORMAT_STRING, value);\n break;\n case DOUBLE:\n type = 'd';\n double value2;\n if (column.value == null)\n value2 = INT_OFFSET;\n else\n value2 = ((Double)column.value).doubleValue() + INT_OFFSET;\n result = String.format(DOUBLE_FORMAT_STRING, value2);\n break;\n }\n\n return type + result;\n }", "public String ToString(){\r\n String Result;\r\n return Result = \"Arco: \"+this.id+\" Dato: \"+String.valueOf(this.Dato)+\" Peso: \"+String.valueOf(this.p)+\" Extremo Inicial: \"+this.Vi.id+\" Extremo Final: \"+this.Vf.id;\r\n }", "public abstract String createDBString();", "public String getRecordText();", "public String getRecordText();", "String getToText();", "private void yas(){\n System.out.println(namn);\n \n try{\n String fraga = \"SELECT TEXT FROM INLAGG WHERE RUBRIK = 'Borttappad strumpa'\";\n String XD = db.fetchSingle(fraga);\n System.out.println(XD);\n txtInlagg.append(XD);\n }\n catch(InfException e){\n JOptionPane.showMessageDialog(null, \"Kunde ej hämta inlägg\");\n }\n }", "String getFormattedString(IRenamable f);", "@Override\n\tpublic String insertStatement() throws Exception {\n\t\treturn null;\n\t}", "public static String getDadoFormatado(String pDado, TiposDadosQuery pTipo) {\n String dadoFormatado;\n if (pDado != null) {\n switch (pTipo)\n {\n case TEXTO:\n dadoFormatado = \"'\" + verificaAspaSimples(pDado) + \"'\";\n break;\n case DATA:\n dadoFormatado = \"'\" + pDado + \"'\";\n break;\n default:\n dadoFormatado = pDado; \n break;\n }\n }\n else {\n dadoFormatado = \"null\";\n }\n \n return dadoFormatado;\n \n }", "public abstract String valueAsText();", "String getInsertStatement(\r\n TypedKeyValue<List<String>, List<String>> fieldsAndValues,\r\n String tableName);", "public String loopDBInfo(ResultSet rs){\n String p = \"\";\n try{\n while (rs.next()) {\n int id_col = rs.getInt(\"ID\");\n String first_name = rs.getString(\"NAME\");\n String phone = rs.getString(\"PHONE\");\n String status = rs.getString(\"STATUS\");\n String prob = rs.getString(\"PROBLEM\");\n \n \n p = p + (id_col + \" \" + first_name + \" \" + phone + \" \"+ status + \" \"+ prob + \"\\n\"); \n // System.out.println(p);\n }\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n \n } return p;\n }", "protected String exportString(JComponent c) {\r\n\t\t JTable table = (JTable) c;\r\n\t\t rows = table.getSelectedRows();\r\n\t\t int colCount = table.getColumnCount();\r\n\r\n\t\t StringBuffer buff = new StringBuffer();\r\n\r\n\t\t for (int i = 0; i < rows.length; i++) \r\n\t\t {\r\n\t\t for (int j = 0; j < colCount; j++) \r\n\t\t {\r\n\t\t Object val = table.getValueAt(rows[i], j);\r\n\t\t buff.append(val == null ? \"\" : val.toString());\r\n\t\t if (j != colCount - 1) {\r\n\t\t buff.append(\",\");\r\n\t\t }\r\n\t\t }\r\n\t\t if (i != rows.length - 1) {\r\n\t\t buff.append(\"\\n\");\r\n\t\t }\r\n\t\t }\r\n\r\n\t\t return buff.toString();\r\n\t\t }" ]
[ "0.72326946", "0.6645976", "0.6531908", "0.6385464", "0.6317184", "0.62667924", "0.6218983", "0.6207176", "0.6202967", "0.6152886", "0.6135076", "0.6081536", "0.5923255", "0.579022", "0.57346797", "0.57026523", "0.5672184", "0.56620204", "0.5659483", "0.5651444", "0.56477576", "0.56249183", "0.56243765", "0.5618473", "0.56068754", "0.56068754", "0.56068754", "0.56068754", "0.56068754", "0.5604246", "0.55820274", "0.55804074", "0.55693233", "0.5539447", "0.5524054", "0.5478542", "0.5472598", "0.5462452", "0.54514855", "0.5445088", "0.5400342", "0.5372391", "0.5369502", "0.5359758", "0.5351185", "0.5344748", "0.5339789", "0.533093", "0.532519", "0.5302089", "0.5302036", "0.53000987", "0.5297874", "0.52958375", "0.5290388", "0.5290388", "0.5285315", "0.52778065", "0.52722317", "0.5272126", "0.5267739", "0.5264016", "0.52581507", "0.5255825", "0.5254278", "0.52524865", "0.52512264", "0.52465665", "0.52449936", "0.52367854", "0.5221264", "0.52107775", "0.52073276", "0.5205304", "0.5202913", "0.51975673", "0.5190336", "0.5183605", "0.5183436", "0.5173913", "0.5169164", "0.51648945", "0.51626694", "0.5161634", "0.5158923", "0.5148456", "0.5147201", "0.51449883", "0.5138118", "0.51370806", "0.5125805", "0.5125805", "0.5121675", "0.51194465", "0.51150084", "0.51138896", "0.5112314", "0.5111203", "0.5101658", "0.50935006", "0.5092977" ]
0.0
-1
Retorna texto formatado para insercao em query
public static String getDadoFormatado(int pDado, TiposDadosQuery pTipo) { StringBuilder dadoFormatado = new StringBuilder(""); dadoFormatado.append(Integer.toString(pDado).toString()); return dadoFormatado.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toInsert() {\r\n return \"(null,'\"+ ref + \"','\" + name + \"','\" + tel + \"','\" + address + \"')\";\r\n }", "public String getInsertSQL()\n\t{\n\t\tString fieldList = \"parametro, dia, valor\";\n\t\treturn String.format(\"insert into alteracs (%s) values (%d, %d, %s)\",\n\t\t\t\tfieldList, parametro, dia, String.format(\"%.3f\", valor).replace(',', '.'));\n\t}", "protected String queryInsert() {\n StringBuilder sb = new StringBuilder(\"INSERT INTO \");\n sb.append(tabla).append(\" (\").append(String.join(\",\", campos)).append(\") VALUES (\");\n\n for (int i = 0; i < campos.length; i++) {\n if (i == campos.length -1) {\n sb.append(\"?)\");\n break;\n }\n sb.append(\"?,\");\n }\n\n return sb.toString();\n }", "public abstract String toSQL();", "protected String createInsert(T t) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(type.getSimpleName());\n\t\tsb.append(\" VALUES \");\n\t\treturn sb.toString();\n\t}", "@Override\n\tprotected String sql() throws OperationException {\n\t\treturn sql.insert(tbObj, fieldValue);\n\t}", "private String createInsertQuery() {\r\n StringBuilder query = new StringBuilder();\r\n query.append(\"insert into \").append(m_tableName)\r\n .append(\"(\").append(m_propertyNames[0]);\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",\").append(m_propertyNames[i]);\r\n }\r\n query.append(\") values (?\");\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",?\");\r\n }\r\n query.append(\")\");\r\n return query.toString();\r\n }", "public abstract String toDBString();", "@Override\r\n\tpublic String generate() {\r\n\t\tStringBuilder query = new StringBuilder();\r\n\r\n\t\tquery.append(\"INSERT INTO \").append(tableName).append(\" (\");\r\n\t\tfor (int i = 0; i < fieldNames.size(); i++) {\r\n\t\t\tquery.append(fieldNames.get(i));\r\n\t\t\tif (i < fieldNames.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\") VALUES (\");\r\n\t\tfor (int i = 0; i < fieldValues.size(); i++) {\r\n\t\t\tquery.append(\"'\").append(fieldValues.get(i)).append(\"'\");\r\n\t\t\tif (i < fieldValues.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\");\");\r\n\t\treturn query.toString();\r\n\t}", "String toSql();", "@Override\n\tpublic String getPreparedInsertText() {\n\t\treturn SQL_Insert;\n\t}", "private String createInsertQuery()\n {\n int i = 0;\n StringBuilder sb = new StringBuilder();\n sb.append(\"INSERT INTO \");\n sb.append(type.getSimpleName());\n sb.append(\" (\");\n for(Field field:type.getDeclaredFields()) {i++; if(i != type.getDeclaredFields().length)sb.append(field.getName() +\", \"); else sb.append(field.getName());}\n sb.append(\")\");\n sb.append(\" VALUES (\");\n i = 0;\n for(Field field:type.getDeclaredFields()) {i++; if(i!= type.getDeclaredFields().length)sb.append(\"?, \"); else sb.append(\"?\");}\n sb.append(\");\");\n return sb.toString();\n }", "public abstract void toSQL(StringBuilder ret);", "String getBarcharDataQuery();", "public String getInsertContentSql(String table)\r\n \t{\r\n \t\treturn \"insert into \" + table + \" (RESOURCE_ID, BODY)\" + \" values (? , ? )\";\r\n \t}", "@Override\n public String saveAsString() {\n return \"D\" + super.saveAsString() + \" | \" + by;\n }", "public String toDBString() {\n return extra1 + DIVIDER + extra2;\n }", "private String getValuesToInsert(int row) {\n List<String> orderedFields = new ArrayList<>(mapFieldsTypes.keySet()); // get ordered list of fields\n StringBuffer insertRowStringBuffer = new StringBuffer();\n insertRowStringBuffer // add first part of query insert string\n .append(SQLFormater.INSERT_INTO)\n .append(\" \")\n .append(tableName)\n .append(\" \")\n .append(\"(\")\n .append(idFieldName) // first inserted field is always row ID\n .append(\",\");\n orderedFields.forEach(field -> insertRowStringBuffer // add names of fields in order they will be inserted\n .append(field)\n .append(\", \")\n );\n insertRowStringBuffer // add another part of string before values\n .append(\")\")\n .append(\" \")\n .append(SQLFormater.VALUES)\n .append(\"(\")\n .append(row); // first field is always row ID\n if (!mapFieldsStrings.isEmpty() || !mapFieldsIntegers.isEmpty()) {\n orderedFields.forEach(field -> { // inserting field values in controlled order\n insertRowStringBuffer.append(\", \");\n if (mapFieldsStrings.containsKey(field)) {\n insertRowStringBuffer\n .append(\"'\")\n .append(mapFieldsStrings.get(field))\n .append(\"'\");\n } else if (mapFieldsIntegers.containsKey(field)) {\n insertRowStringBuffer.append(mapFieldsIntegers.get(field));\n }\n });\n }\n insertRowStringBuffer.append(\")\");\n clearInsertingValues(); // clear fields to insert another row\n return insertRowStringBuffer.toString();\n }", "private String encodeSQL(String text) {\r\n text = text.replaceAll(\"'\", \"''\");\r\n return \"'\" + text + \"'\";\r\n }", "private String getSQLText (CTextField f)\n \t{\n \t\tString s = f.getText().toUpperCase();\n \t\tif (!s.endsWith(\"%\"))\n \t\t\ts += \"%\";\n \t\tlog.fine( \"String=\" + s);\n \t\treturn s;\n \t}", "public String toString() {\n return SQLStringVisitor.getSQLString(this);\n }", "private static String toSql(Object obj) {\n\t\tif(obj==null) {\n\t\t\treturn \"NULL\";\n\t\t}\n\t\tif(obj instanceof String) {\n\t\t\treturn \"'\"+obj+\"'\";\n\t\t}\n\t\treturn obj.toString();\n\t}", "public String insert(DtoEntrprs dto){\n\t\treturn null;\r\n\t}", "public String getDateTimeInsertString(java.sql.Timestamp aTimestamp){\r\n return \"'\" + DBUtil.getDBDateTimeString(aTimestamp) + \"'\";\r\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String getIdentityInsertString() {\n \t\treturn null;\n \t}", "private String getStringToCreateDB(String addings) {\n StringBuffer createDBStringBuffer = new StringBuffer();\n createDBStringBuffer\n .append(SQLFormater.CREATE_TABLE)\n .append(\" \")\n .append(tableName)\n .append(\"(\")\n .append(idFieldName)\n .append(\" \")\n .append(DBCreator.INTEGER_TYPE)\n .append(\" \")\n .append(SQLFormater.PRIMARY_KEY);\n mapFieldsTypes.forEach((kField, vType) -> { // add all table's fields\n createDBStringBuffer\n .append(\", \")\n .append(kField)\n .append(\" \")\n .append(vType);\n if(mapFieldsConstraints.containsKey(kField)) { // add constraint for a field\n createDBStringBuffer\n .append(\" \")\n .append(mapFieldsConstraints.get(kField));\n }\n });\n if (addings != null && !addings.isEmpty()) { // add reference\n createDBStringBuffer\n .append(\", \")\n .append(addings);\n }\n createDBStringBuffer.append(\")\");\n return createDBStringBuffer.toString();\n }", "private static String buildStringFromCursor(Cursor dbCursor)\n {\n String writeString = \"\";\n int columnCount = dbCursor.getColumnCount();\n\n for(int count = 0; count < columnCount; count++)\n {\n writeString += dbCursor.getString(count);\n if(count < columnCount - 1)\n {\n writeString += \"\\t\";\n }\n else\n {\n writeString += \"\\n\";\n }\n }\n return writeString;\n }", "protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }", "String buildInsertQuery(String... args);", "public String toSave() {\n\n return \"D|\" + super.toSave() + \" by: \" + by;\n }", "protected String getInsertionSQL() {\n\t\treturn queryData.getString(\"InsertionSQL\");\n\t}", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getCode()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getBatchId()));\n sb.append(\", \");\n sb.append(f.formatAny(getNestId()));\n return sb.toString();\n }", "protected String getSQLString() {\n \t\treturn queryTranslator.getSQLString();\n \t}", "public String toSQL() {\n\t\tStringBuilder sBuider = new StringBuilder();\n\n\t\t\n\t\t\n\t\t\n\t\tString sTemp = sBuider.toString();\n\t\tSystem.out.println(this.getClass().getName() + \".toSQL(): SQL statements are \\n\" + sTemp);\n\t\t\n\t\tsBuider = null;\n\t\t\n\t\treturn sTemp;\n\t}", "public String makeValue(ResultRow row) {\n\t\tStringBuffer result = new StringBuffer(this.id);\n\t\tfor (ColumnName column: columns) {\n\t\t\tString value = row.get(column);\n\t\t\tif (value == null) {\n\t\t\t\treturn null;\n\t\t }\n\t\t\tresult.append(DELIMITER);\n\t\t\tresult.append(value);\n\t\t}\n return result.toString();\n\t}", "private String createStandardGZFieldTexts()\n\t{\n\t\tStringBuffer result = new StringBuffer();\n\t\tfor (Entry<String, String[]> entry : standardJournalFieldColumns.entrySet())\n\t\t{\n\t\t\tif (result.length() != 0)\n\t\t\t{\n\t\t\t\tresult.append(\", \");\n\t\t\t}\n\t\t\tresult.append(entry.getKey());\n\t\t\tresult.append(\" TEXT IS '\");\n\t\t\tString[] strings = entry.getValue();\n\t\t\tfor (int index = 0; index < strings.length; index++)\n\t\t\t{\n\t\t\t\tresult.append(strings[index]);\n\t\t\t\tif (index < strings.length)\n\t\t\t\t{\n\t\t\t\t\tresult.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.append(\"'\");\n\t\t}\n\t\treturn result.toString();\n\t}", "protected String formatErrorMessage() throws SQLException {\n \tint errCode = SQLite.extendederrcode(getConnection().getSqliteDb());\r\n \tString message = SQLite.errmsg(getConnection().getSqliteDb());\r\n\t\tString s = StringUtil.format(\"Code:{0}\\n{1}\", errCode, message);\r\n\t\treturn s;\r\n\t}", "@Override\n public String databaseString() {\n return \"T | \" + super.databaseString();\n }", "public abstract String toSaveString();", "@Test\n public void testToStringWithSQL() throws SQLException {\n try (PreparedStatement stmt = this.proxy\n .prepareStatement(\"SELECT * FROM country WHERE lang = ? OR callingcode = ?\")) {\n stmt.setString(1, \"de\");\n stmt.setInt(2, 42);\n String sql = stmt.toString();\n assertEquals(\"SELECT * FROM country WHERE lang = 'de' OR callingcode = 42\", sql);\n LOG.info(\"sql = \\\"{}\\\"\", sql);\n }\n }", "public CustomSql getCustomSqlInsert();", "final public static String createPstmtInsert(Class<? extends DotProjectObject> clazz)\n\t{\n\t\tStringBuffer sb = new StringBuffer();\n\t\tString table = null;\n\t\tField[] beanFields = null;\n\t\tString[] dbFields = null;\n\t\t\n\t\ttable = AnnotationUtil.getAnnotationValue(clazz, DbAnnotations.TABLE_ANNOTATION);\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(table);\n\t\t\n\t\tbeanFields = AnnotationUtil.getAnnotatedFields(clazz, DbAnnotations.PROPERTY_ANNOTATION);\n\t\tdbFields = new String[beanFields.length];\n\t\tfor (int i = 0; i < beanFields.length; i++) {\n\t\t\tif (! beanFields[i].isAnnotationPresent(DbAnnotations.IDENTIFICATOR_ANNOTATION)) {\n\t\t\t\tdbFields[i] = AnnotationUtil.getAnnotationValue(beanFields[i], DbAnnotations.PROPERTY_ANNOTATION);\n\t\t\t}\n\t\t}\n\t\tdbFields = (String[])ArrayUtil.clean(dbFields);\n\t\tArrays.sort(dbFields);\n\t\t\t\n\t\tsb.append(\" (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(dbFields[i]);\n\t\t}\n\t\t\n\t\tsb.append(\") values (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(\"?\");\n\t\t}\n\t\tsb.append(\")\");\n\n\t\treturn sb.toString();\n\t}", "static String serializeToString(Object s) throws SQLException {\n\treturn createString(serialize(s));\n }", "private String formatSql(String sql) {\n\t\tString sqlStr = formator.format(sql + \";\");\n\t\tif (sqlStr == null) {\n\t\t\tLOGGER.error(\"The formator.format(sql) is a null.\");\n\t\t\treturn null;\n\t\t}\n\n\t\tString trimmedSql = sqlStr.trim();\n\t\tif (!trimmedSql.endsWith(\";\")) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tString formattedSql = trimmedSql.substring(0, trimmedSql.length() - 1);\n\t\treturn formattedSql;\n\t}", "private static String formatEntry(Object entry){\n return QUOTE + entry.toString() + QUOTE + DELIM;\n }", "private String createFindAll() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"SELECT \");\n\t\tsb.append(\" * \");\n\t\tsb.append(\" FROM \");\n\t\tsb.append(type.getSimpleName());\n\t\treturn sb.toString();\n\t}", "public String insertSelective(Car record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"`basedata_car`\");\n \n if (record.getCarId() != null) {\n sql.VALUES(\"car_id\", \"#{carId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarBrandId() != null) {\n sql.VALUES(\"car_brand_id\", \"#{carBrandId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarModel() != null) {\n sql.VALUES(\"car_model\", \"#{carModel,jdbcType=VARCHAR}\");\n }\n \n if (record.getCarType() != null) {\n sql.VALUES(\"car_type\", \"#{carType,jdbcType=TINYINT}\");\n }\n \n if (record.getAlias() != null) {\n sql.VALUES(\"alias\", \"#{alias,jdbcType=VARCHAR}\");\n }\n \n if (record.getSeatType() != null) {\n sql.VALUES(\"seat_type\", \"#{seatType,jdbcType=TINYINT}\");\n }\n \n if (record.getSeatNum() != null) {\n sql.VALUES(\"seat_num\", \"#{seatNum,jdbcType=TINYINT}\");\n }\n \n if (record.getCarClass() != null) {\n sql.VALUES(\"car_class\", \"#{carClass,jdbcType=INTEGER}\");\n }\n \n if (record.getGuestNum() != null) {\n sql.VALUES(\"guest_num\", \"#{guestNum,jdbcType=INTEGER}\");\n }\n \n if (record.getLuggageNum() != null) {\n sql.VALUES(\"luggage_num\", \"#{luggageNum,jdbcType=INTEGER}\");\n }\n \n if (record.getSpell() != null) {\n sql.VALUES(\"spell\", \"#{spell,jdbcType=VARCHAR}\");\n }\n \n if (record.getEnName() != null) {\n sql.VALUES(\"en_name\", \"#{enName,jdbcType=VARCHAR}\");\n }\n \n if (record.getUpdatedAt() != null) {\n sql.VALUES(\"updated_at\", \"#{updatedAt,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getCreatedAt() != null) {\n sql.VALUES(\"created_at\", \"#{createdAt,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String Analise(String SQL, String Value){\n SQLQuery result = session.createSQLQuery(SQL);\n Value = result.toString();\n return Value;\n}", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "protected String getSQL (Element sql) {\r\n\r\n //local variables\r\n\r\n String SQL = \"\";\r\n\r\n //code description\r\n \r\n NodeList textlist = sql.getChildNodes();\r\n for (int i = 0; i < textlist.getLength(); i++) {\r\n if (textlist.item(i).getNodeType() == Node.TEXT_NODE) {\r\n SQL += textlist.item(i).getNodeValue();\r\n }\r\n }\r\n return SQL;\r\n\r\n }", "public String InsertarAnuncioGeneral(AnuncioGeneralDTO anuncio){\n int status=0;\n String message=\"Funciona bien\";\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is);\n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"insertar.AnuncioGeneral\"));\n \n ps.setString(1, anuncio.getTipoAnuncio().toString());\n ps.setString(2,anuncio.getTitulo());\n ps.setString(3,anuncio.getCuerpo());\n \n java.sql.Date fechaPublicacion=new java.sql.Date(anuncio.getFechaPublicacion().getTime());\n // DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss dd/MM/yyyy\");\n // String fecha = dateFormat.format(anuncio.getFechaPublicacion());\n // java.sql.Date fechaPublicacion=new java.sql.Date(dateFormat.parse(fecha).getTime());\n ps.setDate(4, fechaPublicacion);\n message=\"Cargo bien la fecha\";\n ps.setString(5,anuncio.getPropietario().getEmail());\n ps.setString(6,anuncio.getEstadoAnuncio().toString());\n status=ps.executeUpdate();\n\n \n int idAnuncio=GetMaxID();\n for(Contacto c : anuncio.getDestinatarios()){\n PreparedStatement psDestinatario=conect.prepareStatement(sqlProp.getProperty(\"insertar.Destinatario\"));\n psDestinatario.setInt(1, idAnuncio);\n psDestinatario.setString(2, c.getEmail());\n psDestinatario.executeUpdate();\n }\n message=\"funciona bien\";\n }catch(Exception e){\n e.toString();\n }\n\n return message;\n }", "public String Execomando(String Comsql) {\n String Mensaje = \"\";\n /* sino retorna nada es porque todo esta bien */\n try {\n PreparedStatement pstm = con.prepareStatement(Comsql);\n pstm.execute();\n pstm.close();\n } catch (SQLException e) {\n Mensaje = e.toString();\n }\n return Mensaje;\n }", "public String insertEscuela(Escuela escuela){\n String regInsertado = \"Registro Escuela #\";\n long contador = 0;\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"IDESCUELA\",escuela.getIdentificadorEscuela());\n contentValues.put(\"NOMESCUELA\", escuela.getNombreEscuela());\n contador = db.insert(\"ESCUELA\",null,contentValues);\n db.close();\n\n if(contador == -1 || contador == 0){\n regInsertado = \"Error al insertar Escuela. Registro duplicado.\";\n }else{\n regInsertado = regInsertado + contador;\n }\n return regInsertado;\n }", "protected String formatField() {\n \tif(!updated) return \"No record set.\";\n \t\n \tif(firstFieldP.getText() != null && lastFieldP.getText() != null) {\n\t \tfirstNameString = firstFieldP.getText();\n\t \tlastNameString = lastFieldP.getText();\n \t} else\t{\n \tfirstNameString = firstFieldC.getText();\n \tlastNameString = lastFieldC.getText();\n \ttribeString = tribeField.getText();\t\n \t}\n\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"<html><p align=center>\");\n \tsb.append(firstNameString);\n \tsb.append(\" \");\n \tsb.append(lastNameString);\n \tsb.append(\"<br>\");\n \tsb.append(tribeString);\n \tsb.append(\"</p></html>\");\n \t\n \treturn sb.toString(); \t\n }", "private String insertCommand(Object item)\n\t{\n\t\tif(item instanceof Road)\n\t\t{\n\t\t\tRoad tmp = (Road) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.RoadTable.TABLE_NAME + \" (\" +\n\t\t\t\tDBContract.RoadTable.ROADNAME[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.LENGTH[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.DURATION[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.PRICE[0] + \") VALUES (\" +\n\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + tmp.getLength() + \" ,\" +\n\t\t\t\ttmp.getDuration() + \" ,\" + tmp.getPrice() + \")\";\n \t\t}\n\t\telse if(item instanceof Contact)\n\t\t{\n\t\t\tContact tmp = (Contact) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.ContactTable.TABLE_NAME + \" (\" +\n\t\t\t\t\tDBContract.ContactTable.NAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.SURNAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.BILL[0] + \") VALUES (\" +\n\t\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + \"\\\"\" + tmp.getFirstName() + \"\\\"\" +\n\t\t\t\t\t\" ,\" + tmp.getbill() + \")\";\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "public String getTimestampString() throws SQLException {\n\t\tloadFromDB();\n\t\treturn DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM)\n\t\t\t\t\t.format(rev_timestamp);\n\t}", "public String getSQLstring() {\r\n return typeId.toParsableString(this);\r\n }", "public String toString() {\n\t\t//TODO add your own field name here\t\t\n\t\t//return buffer.append(this.yourFieldName).toString();\n\t\treturn \"\";\n\t}", "public String getSaveString() {\n return \"\" + Value;\n }", "public String getNoColumnsInsertString() {\n \t\treturn \"values ( )\";\n \t}", "public String insertTypesPhone() {\n String query = \"\";\n\n String[] typesPhoneDefault = res.getStringArray(R.array.types_phone);\n for (int i = 0; i < typesPhoneDefault.length; i++) {\n // Script inserting types phone default\n query += \"INSERT INTO \" + TABLE_PHONE_TYPE + \"(\" + ID + \",\" + TITLE + \") VALUES(\" + (i + 1) + \",'\" + typesPhoneDefault[i] + \"');\";\n }\n\n return query;\n }", "public String getEntrySave() {\r\n return \"-\"+getId() + \"|\" + getFavorite() + \"|\" + getSubject() + \"|\" + date(4) + \"|\" + price.getFull() + \"|\" + getNotes();\r\n }", "public String toSQL(boolean fuzzySearch){\n return toSQL();\n }", "public String insertXosoSql(String date, String data) {\n\t\tString sql =\"\";\n\t\tString table_name = db.table_name;\n\t\tif(!db.CheckRecordExisted(date)){\n\t\t\tsql= \"insert into \"+table_name+\" (date, result_json) values ('\"+date+\"','\"+data+\"')\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsql = \"UPDATE \"+table_name+\" SET result_json='\"+data+\"' WHERE date='\"+date+\"'\";\n\t\t}\n\t\tlogger.debug(sql);\n\t\ttry {\n\t\t//\tdb.createPreparedStatement(date, data);\n\t\t\tdb.executeQuery(sql);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t}\n\t\treturn sql;\n\t}", "public String getDBString();", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getLegDepartureLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalDayOffset()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegStopCount()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegEquipment()));\n return sb.toString();\n }", "public String toString()\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\treturn \"columnName: \" + columnName + \"\\n\" +\n\t\t\t\t\"defaultText: \" + defaultText + \"\\n\" +\n\t\t\t\tsuper.toString();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "private String writeNameIdResultSet(ResultSet resultSet) throws SQLException {\n\t\r\n\tString strada_arco=\"\";\r\n\tString arco=\"\";\r\n\t\r\n\tint i=0;\r\n\twhile (resultSet.next()) {\r\n\t\t// It is possible to get the columns via name\r\n\t\t// also possible to get the columns via the column number\r\n\t\t// which starts at 1\r\n\t\t// e.g. resultSet.getSTring(2);\r\n\t\t\r\n\t\t\r\n\t\tstrada_arco=resultSet.getString(1);\r\n\t\tarco=resultSet.getString(2);\r\n\t\t //nome_arco= resultSet.getString(3);\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\treturn strada_arco+\"-\"+arco;\r\n}", "public static String formatQuery( String sqlString ) {\n StringTokenizer st= new StringTokenizer( sqlString, \"'\" );\n StringWriter sw = new StringWriter();\n \n while (st.hasMoreTokens()) {\n sw.write( st.nextToken() );\n if (st.hasMoreTokens())\n sw.write( \"''\" );\n }\n \n return sw.toString();\n }", "public String insertar(Cargo cargo){\n String registrosInser=\"Registro insertado N°= \";\n long contador;\n ContentValues c=new ContentValues();\n //c.put(\"ID_CARGO\",cargo.getIdCargo());\n c.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n c.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,c);\n if(contador==-1||contador==0){\n registrosInser=\"Error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n /* String registrosInser=\"Registro insertado N°= \";\n long contador= 0;\n ContentValues carg = new ContentValues();\n //carg.put(\"ID_CARGO\",cargo.getIdCargo());\n carg.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n carg.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,carg);\n if(contador==-1||contador==0){\n registrosInser=\"error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n return registrosInser;*/\n return registrosInser;\n\n }", "@Override\n public String toSaveString() {\n //D0Finish project@June 6\n return \"D\" + (isDone ? \"1\" : \"0\") + name + \"@\" + getDate();\n }", "public String insertAlum(Alumno alumno) //lo necesitaba\n {\n String regInsertado = \"Alumno: \";\n\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"CARNET\",alumno.getCarnet());\n contentValues.put(\"IDESCUELA\", alumno.getIdEscuela());\n contentValues.put(\"NOMESTUDIANTE\", alumno.getNombre());\n long contador = db.insert(\"ESTUDIANTE\",null,contentValues);\n db.close();\n\n if(contador > 0){\n regInsertado = regInsertado + contador;\n }else{\n regInsertado = \"Ya existe el alumno.\" + alumno.getCarnet();\n }\n return regInsertado;\n }", "public String insertSelective(Userinfo record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"userinfo\");\n \n if (record.getUserid() != null) {\n sql.VALUES(\"userid\", \"#{userid,jdbcType=INTEGER}\");\n }\n \n if (record.getUsername() != null) {\n sql.VALUES(\"username\", \"#{username,jdbcType=VARCHAR}\");\n }\n \n if (record.getSex() != null) {\n sql.VALUES(\"sex\", \"#{sex,jdbcType=BIT}\");\n }\n \n if (record.getTel() != null) {\n sql.VALUES(\"tel\", \"#{tel,jdbcType=VARCHAR}\");\n }\n \n if (record.getLastlogintime() != null) {\n sql.VALUES(\"lastlogintime\", \"#{lastlogintime,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getStatus() != null) {\n sql.VALUES(\"status\", \"#{status,jdbcType=BIT}\");\n }\n \n if (record.getWxopenid() != null) {\n sql.VALUES(\"wxopenid\", \"#{wxopenid,jdbcType=VARCHAR}\");\n }\n \n if (record.getAddr() != null) {\n sql.VALUES(\"addr\", \"#{addr,jdbcType=VARCHAR}\");\n }\n \n if (record.getDelStatus() != null) {\n sql.VALUES(\"del_status\", \"#{delStatus,jdbcType=BIT}\");\n }\n \n if (record.getCreatetime() != null) {\n sql.VALUES(\"createtime\", \"#{createtime,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String databaseToString()\n {\n String dbString = \"\";\n SQLiteDatabase sqLiteDatabase = getWritableDatabase(); // database we writing too\n String query = \"SELECT * FROM \" + TABLE_PRODUCTS + \"WHERE 1\"; // 1 means every row * means every columns\n\n //Cursor points to locations in the results\n Cursor cursor = sqLiteDatabase.rawQuery(query,null);\n //Move to first row in results\n cursor.moveToFirst();\n\n // loops through every product and extracts the productname\n while(!cursor.isAfterLast())\n {\n if(cursor.getString(cursor.getColumnIndex(\"productname\"))!= null)\n {\n dbString += cursor.getString(cursor.getColumnIndex(\"productname\"));\n dbString += \"\\n\";\n }\n }\n sqLiteDatabase.close();\n return dbString;\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getHashKey()));\n return sb.toString();\n }", "public String prepareStatementString() throws SQLException {\n\t\tList<Object> argList = new ArrayList<Object>();\n\t\treturn buildStatementString(argList);\n\t}", "public String getStringRecord() {\n NumberFormat nf = new DecimalFormat(\"0000.00\");\n String delimiter = \",\";\n\n return String.format(\"%05d\", orderLineId) + delimiter + String.format(\"%05d\", orderId) + delimiter\n + String.format(\"%05d\", userId) + delimiter + String.format(\"%05d\", productId) + delimiter\n + String.format(\"%05d\", orderLineQuantity) + delimiter + nf.format(salesPrice)\n + System.getProperty(\"line.separator\");\n }", "private static String adqlCharLiteral( String txt ) {\n return \"'\" + txt.replaceAll( \"'\", \"''\" ) + \"'\";\n }", "private String produceSQL(String[] cols) {\n StringBuffer buffer = new StringBuffer();\n buffer.append('(');\n buffer.append(cols[0]);\n\n for (int i = 1; i < cols.length; i++){\n buffer.append(',');\n buffer.append(cols[i]);\n }\n buffer.append(')');\n return buffer.toString();\n }", "public String agregarCuenta(Cuenta cuenta) {\n String mensaje = \"\";\n try {\n PreparedStatement PrSt;\n String Query = \"INSERT INTO Cuenta VALUES(?,?,?,?)\";\n PrSt = conexion.prepareStatement(Query);\n PrSt.setString(1, cuenta.getCodigo());\n PrSt.setDate(2, cuenta.getCreacion());\n PrSt.setDouble(3, cuenta.getCredito());\n PrSt.setString(4, cuenta.getCodigo_cliente());\n int resultado = PrSt.executeUpdate();\n if (resultado > 0) {\n mensaje = \"Agregada Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n } else {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n }\n PrSt.close();\n } catch (SQLException e) {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente() + \" Error: \" + e.toString();\n }\n return mensaje;\n }", "public static String convertColumn2String(Column column) {\n char type = '\\0';\n String result = \"\";\n\n switch (column.type) {\n case STRING:\n type = 's';\n result = (column.value == null? \"\" : column.value.toString());\n break;\n case INT:\n type = 'i';\n int value;\n if (column.value == null)\n value = INT_OFFSET; // we don't really distinguish between zero and null\n else\n value = ((Integer)column.value).intValue() + INT_OFFSET;\n result = String.format(INT_FORMAT_STRING, value);\n break;\n case DOUBLE:\n type = 'd';\n double value2;\n if (column.value == null)\n value2 = INT_OFFSET;\n else\n value2 = ((Double)column.value).doubleValue() + INT_OFFSET;\n result = String.format(DOUBLE_FORMAT_STRING, value2);\n break;\n }\n\n return type + result;\n }", "public String ToString(){\r\n String Result;\r\n return Result = \"Arco: \"+this.id+\" Dato: \"+String.valueOf(this.Dato)+\" Peso: \"+String.valueOf(this.p)+\" Extremo Inicial: \"+this.Vi.id+\" Extremo Final: \"+this.Vf.id;\r\n }", "public abstract String createDBString();", "public String getRecordText();", "public String getRecordText();", "String getToText();", "private void yas(){\n System.out.println(namn);\n \n try{\n String fraga = \"SELECT TEXT FROM INLAGG WHERE RUBRIK = 'Borttappad strumpa'\";\n String XD = db.fetchSingle(fraga);\n System.out.println(XD);\n txtInlagg.append(XD);\n }\n catch(InfException e){\n JOptionPane.showMessageDialog(null, \"Kunde ej hämta inlägg\");\n }\n }", "String getFormattedString(IRenamable f);", "@Override\n\tpublic String insertStatement() throws Exception {\n\t\treturn null;\n\t}", "public static String getDadoFormatado(String pDado, TiposDadosQuery pTipo) {\n String dadoFormatado;\n if (pDado != null) {\n switch (pTipo)\n {\n case TEXTO:\n dadoFormatado = \"'\" + verificaAspaSimples(pDado) + \"'\";\n break;\n case DATA:\n dadoFormatado = \"'\" + pDado + \"'\";\n break;\n default:\n dadoFormatado = pDado; \n break;\n }\n }\n else {\n dadoFormatado = \"null\";\n }\n \n return dadoFormatado;\n \n }", "public abstract String valueAsText();", "String getInsertStatement(\r\n TypedKeyValue<List<String>, List<String>> fieldsAndValues,\r\n String tableName);", "public String loopDBInfo(ResultSet rs){\n String p = \"\";\n try{\n while (rs.next()) {\n int id_col = rs.getInt(\"ID\");\n String first_name = rs.getString(\"NAME\");\n String phone = rs.getString(\"PHONE\");\n String status = rs.getString(\"STATUS\");\n String prob = rs.getString(\"PROBLEM\");\n \n \n p = p + (id_col + \" \" + first_name + \" \" + phone + \" \"+ status + \" \"+ prob + \"\\n\"); \n // System.out.println(p);\n }\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n \n } return p;\n }", "@Override\n public String getStringFromDatabase(int objectID) {\n return \"From Class one result\"+objectID;\n }" ]
[ "0.72332656", "0.6645996", "0.6531685", "0.6386587", "0.6316747", "0.6265875", "0.621917", "0.6208691", "0.62029773", "0.6154162", "0.6134995", "0.60820025", "0.59232104", "0.579011", "0.57338965", "0.570275", "0.567309", "0.5662722", "0.5660105", "0.5651487", "0.56486756", "0.5626061", "0.56242555", "0.5619859", "0.56078476", "0.56078476", "0.56078476", "0.56078476", "0.56078476", "0.5604503", "0.5582", "0.5580296", "0.5569601", "0.5538234", "0.55242646", "0.54786515", "0.54731727", "0.5463155", "0.5451918", "0.54460627", "0.5401085", "0.53716946", "0.5368335", "0.5359354", "0.535153", "0.5345069", "0.5340157", "0.5332032", "0.5326281", "0.5302725", "0.5300964", "0.5300155", "0.52977496", "0.52956915", "0.5290483", "0.5290483", "0.5285686", "0.52780145", "0.52712643", "0.5270857", "0.5267584", "0.52625895", "0.5258992", "0.5257228", "0.52544725", "0.52529544", "0.5251592", "0.5246511", "0.52446985", "0.52373844", "0.52204514", "0.5211526", "0.52078456", "0.5205468", "0.5202617", "0.5198143", "0.51890844", "0.5182871", "0.5182217", "0.5173992", "0.51693326", "0.51654756", "0.5162951", "0.51620543", "0.515915", "0.5148224", "0.51460505", "0.5145959", "0.51372635", "0.5136895", "0.5125541", "0.5125541", "0.5120276", "0.5117769", "0.51146203", "0.5114011", "0.511289", "0.51112044", "0.5102594", "0.5092712", "0.50926036" ]
0.0
-1
Retorna texto formatado para insercao em query
public static String getDadoFormatado(long pDado, TiposDadosQuery pTipo) { ConversorTipos conv = new ConversorTipos(); conv.setValorBase(pDado); return conv.getString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toInsert() {\r\n return \"(null,'\"+ ref + \"','\" + name + \"','\" + tel + \"','\" + address + \"')\";\r\n }", "public String getInsertSQL()\n\t{\n\t\tString fieldList = \"parametro, dia, valor\";\n\t\treturn String.format(\"insert into alteracs (%s) values (%d, %d, %s)\",\n\t\t\t\tfieldList, parametro, dia, String.format(\"%.3f\", valor).replace(',', '.'));\n\t}", "protected String queryInsert() {\n StringBuilder sb = new StringBuilder(\"INSERT INTO \");\n sb.append(tabla).append(\" (\").append(String.join(\",\", campos)).append(\") VALUES (\");\n\n for (int i = 0; i < campos.length; i++) {\n if (i == campos.length -1) {\n sb.append(\"?)\");\n break;\n }\n sb.append(\"?,\");\n }\n\n return sb.toString();\n }", "public abstract String toSQL();", "protected String createInsert(T t) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(type.getSimpleName());\n\t\tsb.append(\" VALUES \");\n\t\treturn sb.toString();\n\t}", "@Override\n\tprotected String sql() throws OperationException {\n\t\treturn sql.insert(tbObj, fieldValue);\n\t}", "private String createInsertQuery() {\r\n StringBuilder query = new StringBuilder();\r\n query.append(\"insert into \").append(m_tableName)\r\n .append(\"(\").append(m_propertyNames[0]);\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",\").append(m_propertyNames[i]);\r\n }\r\n query.append(\") values (?\");\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",?\");\r\n }\r\n query.append(\")\");\r\n return query.toString();\r\n }", "public abstract String toDBString();", "@Override\r\n\tpublic String generate() {\r\n\t\tStringBuilder query = new StringBuilder();\r\n\r\n\t\tquery.append(\"INSERT INTO \").append(tableName).append(\" (\");\r\n\t\tfor (int i = 0; i < fieldNames.size(); i++) {\r\n\t\t\tquery.append(fieldNames.get(i));\r\n\t\t\tif (i < fieldNames.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\") VALUES (\");\r\n\t\tfor (int i = 0; i < fieldValues.size(); i++) {\r\n\t\t\tquery.append(\"'\").append(fieldValues.get(i)).append(\"'\");\r\n\t\t\tif (i < fieldValues.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\");\");\r\n\t\treturn query.toString();\r\n\t}", "String toSql();", "@Override\n\tpublic String getPreparedInsertText() {\n\t\treturn SQL_Insert;\n\t}", "private String createInsertQuery()\n {\n int i = 0;\n StringBuilder sb = new StringBuilder();\n sb.append(\"INSERT INTO \");\n sb.append(type.getSimpleName());\n sb.append(\" (\");\n for(Field field:type.getDeclaredFields()) {i++; if(i != type.getDeclaredFields().length)sb.append(field.getName() +\", \"); else sb.append(field.getName());}\n sb.append(\")\");\n sb.append(\" VALUES (\");\n i = 0;\n for(Field field:type.getDeclaredFields()) {i++; if(i!= type.getDeclaredFields().length)sb.append(\"?, \"); else sb.append(\"?\");}\n sb.append(\");\");\n return sb.toString();\n }", "public abstract void toSQL(StringBuilder ret);", "String getBarcharDataQuery();", "public String getInsertContentSql(String table)\r\n \t{\r\n \t\treturn \"insert into \" + table + \" (RESOURCE_ID, BODY)\" + \" values (? , ? )\";\r\n \t}", "@Override\n public String saveAsString() {\n return \"D\" + super.saveAsString() + \" | \" + by;\n }", "public String toDBString() {\n return extra1 + DIVIDER + extra2;\n }", "private String getValuesToInsert(int row) {\n List<String> orderedFields = new ArrayList<>(mapFieldsTypes.keySet()); // get ordered list of fields\n StringBuffer insertRowStringBuffer = new StringBuffer();\n insertRowStringBuffer // add first part of query insert string\n .append(SQLFormater.INSERT_INTO)\n .append(\" \")\n .append(tableName)\n .append(\" \")\n .append(\"(\")\n .append(idFieldName) // first inserted field is always row ID\n .append(\",\");\n orderedFields.forEach(field -> insertRowStringBuffer // add names of fields in order they will be inserted\n .append(field)\n .append(\", \")\n );\n insertRowStringBuffer // add another part of string before values\n .append(\")\")\n .append(\" \")\n .append(SQLFormater.VALUES)\n .append(\"(\")\n .append(row); // first field is always row ID\n if (!mapFieldsStrings.isEmpty() || !mapFieldsIntegers.isEmpty()) {\n orderedFields.forEach(field -> { // inserting field values in controlled order\n insertRowStringBuffer.append(\", \");\n if (mapFieldsStrings.containsKey(field)) {\n insertRowStringBuffer\n .append(\"'\")\n .append(mapFieldsStrings.get(field))\n .append(\"'\");\n } else if (mapFieldsIntegers.containsKey(field)) {\n insertRowStringBuffer.append(mapFieldsIntegers.get(field));\n }\n });\n }\n insertRowStringBuffer.append(\")\");\n clearInsertingValues(); // clear fields to insert another row\n return insertRowStringBuffer.toString();\n }", "private String encodeSQL(String text) {\r\n text = text.replaceAll(\"'\", \"''\");\r\n return \"'\" + text + \"'\";\r\n }", "private String getSQLText (CTextField f)\n \t{\n \t\tString s = f.getText().toUpperCase();\n \t\tif (!s.endsWith(\"%\"))\n \t\t\ts += \"%\";\n \t\tlog.fine( \"String=\" + s);\n \t\treturn s;\n \t}", "public String toString() {\n return SQLStringVisitor.getSQLString(this);\n }", "private static String toSql(Object obj) {\n\t\tif(obj==null) {\n\t\t\treturn \"NULL\";\n\t\t}\n\t\tif(obj instanceof String) {\n\t\t\treturn \"'\"+obj+\"'\";\n\t\t}\n\t\treturn obj.toString();\n\t}", "public String insert(DtoEntrprs dto){\n\t\treturn null;\r\n\t}", "public String getDateTimeInsertString(java.sql.Timestamp aTimestamp){\r\n return \"'\" + DBUtil.getDBDateTimeString(aTimestamp) + \"'\";\r\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String getIdentityInsertString() {\n \t\treturn null;\n \t}", "private String getStringToCreateDB(String addings) {\n StringBuffer createDBStringBuffer = new StringBuffer();\n createDBStringBuffer\n .append(SQLFormater.CREATE_TABLE)\n .append(\" \")\n .append(tableName)\n .append(\"(\")\n .append(idFieldName)\n .append(\" \")\n .append(DBCreator.INTEGER_TYPE)\n .append(\" \")\n .append(SQLFormater.PRIMARY_KEY);\n mapFieldsTypes.forEach((kField, vType) -> { // add all table's fields\n createDBStringBuffer\n .append(\", \")\n .append(kField)\n .append(\" \")\n .append(vType);\n if(mapFieldsConstraints.containsKey(kField)) { // add constraint for a field\n createDBStringBuffer\n .append(\" \")\n .append(mapFieldsConstraints.get(kField));\n }\n });\n if (addings != null && !addings.isEmpty()) { // add reference\n createDBStringBuffer\n .append(\", \")\n .append(addings);\n }\n createDBStringBuffer.append(\")\");\n return createDBStringBuffer.toString();\n }", "private static String buildStringFromCursor(Cursor dbCursor)\n {\n String writeString = \"\";\n int columnCount = dbCursor.getColumnCount();\n\n for(int count = 0; count < columnCount; count++)\n {\n writeString += dbCursor.getString(count);\n if(count < columnCount - 1)\n {\n writeString += \"\\t\";\n }\n else\n {\n writeString += \"\\n\";\n }\n }\n return writeString;\n }", "protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }", "String buildInsertQuery(String... args);", "public String toSave() {\n\n return \"D|\" + super.toSave() + \" by: \" + by;\n }", "protected String getInsertionSQL() {\n\t\treturn queryData.getString(\"InsertionSQL\");\n\t}", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getCode()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getBatchId()));\n sb.append(\", \");\n sb.append(f.formatAny(getNestId()));\n return sb.toString();\n }", "protected String getSQLString() {\n \t\treturn queryTranslator.getSQLString();\n \t}", "public String toSQL() {\n\t\tStringBuilder sBuider = new StringBuilder();\n\n\t\t\n\t\t\n\t\t\n\t\tString sTemp = sBuider.toString();\n\t\tSystem.out.println(this.getClass().getName() + \".toSQL(): SQL statements are \\n\" + sTemp);\n\t\t\n\t\tsBuider = null;\n\t\t\n\t\treturn sTemp;\n\t}", "public String makeValue(ResultRow row) {\n\t\tStringBuffer result = new StringBuffer(this.id);\n\t\tfor (ColumnName column: columns) {\n\t\t\tString value = row.get(column);\n\t\t\tif (value == null) {\n\t\t\t\treturn null;\n\t\t }\n\t\t\tresult.append(DELIMITER);\n\t\t\tresult.append(value);\n\t\t}\n return result.toString();\n\t}", "private String createStandardGZFieldTexts()\n\t{\n\t\tStringBuffer result = new StringBuffer();\n\t\tfor (Entry<String, String[]> entry : standardJournalFieldColumns.entrySet())\n\t\t{\n\t\t\tif (result.length() != 0)\n\t\t\t{\n\t\t\t\tresult.append(\", \");\n\t\t\t}\n\t\t\tresult.append(entry.getKey());\n\t\t\tresult.append(\" TEXT IS '\");\n\t\t\tString[] strings = entry.getValue();\n\t\t\tfor (int index = 0; index < strings.length; index++)\n\t\t\t{\n\t\t\t\tresult.append(strings[index]);\n\t\t\t\tif (index < strings.length)\n\t\t\t\t{\n\t\t\t\t\tresult.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.append(\"'\");\n\t\t}\n\t\treturn result.toString();\n\t}", "protected String formatErrorMessage() throws SQLException {\n \tint errCode = SQLite.extendederrcode(getConnection().getSqliteDb());\r\n \tString message = SQLite.errmsg(getConnection().getSqliteDb());\r\n\t\tString s = StringUtil.format(\"Code:{0}\\n{1}\", errCode, message);\r\n\t\treturn s;\r\n\t}", "@Override\n public String databaseString() {\n return \"T | \" + super.databaseString();\n }", "public abstract String toSaveString();", "@Test\n public void testToStringWithSQL() throws SQLException {\n try (PreparedStatement stmt = this.proxy\n .prepareStatement(\"SELECT * FROM country WHERE lang = ? OR callingcode = ?\")) {\n stmt.setString(1, \"de\");\n stmt.setInt(2, 42);\n String sql = stmt.toString();\n assertEquals(\"SELECT * FROM country WHERE lang = 'de' OR callingcode = 42\", sql);\n LOG.info(\"sql = \\\"{}\\\"\", sql);\n }\n }", "public CustomSql getCustomSqlInsert();", "final public static String createPstmtInsert(Class<? extends DotProjectObject> clazz)\n\t{\n\t\tStringBuffer sb = new StringBuffer();\n\t\tString table = null;\n\t\tField[] beanFields = null;\n\t\tString[] dbFields = null;\n\t\t\n\t\ttable = AnnotationUtil.getAnnotationValue(clazz, DbAnnotations.TABLE_ANNOTATION);\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(table);\n\t\t\n\t\tbeanFields = AnnotationUtil.getAnnotatedFields(clazz, DbAnnotations.PROPERTY_ANNOTATION);\n\t\tdbFields = new String[beanFields.length];\n\t\tfor (int i = 0; i < beanFields.length; i++) {\n\t\t\tif (! beanFields[i].isAnnotationPresent(DbAnnotations.IDENTIFICATOR_ANNOTATION)) {\n\t\t\t\tdbFields[i] = AnnotationUtil.getAnnotationValue(beanFields[i], DbAnnotations.PROPERTY_ANNOTATION);\n\t\t\t}\n\t\t}\n\t\tdbFields = (String[])ArrayUtil.clean(dbFields);\n\t\tArrays.sort(dbFields);\n\t\t\t\n\t\tsb.append(\" (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(dbFields[i]);\n\t\t}\n\t\t\n\t\tsb.append(\") values (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(\"?\");\n\t\t}\n\t\tsb.append(\")\");\n\n\t\treturn sb.toString();\n\t}", "static String serializeToString(Object s) throws SQLException {\n\treturn createString(serialize(s));\n }", "private String formatSql(String sql) {\n\t\tString sqlStr = formator.format(sql + \";\");\n\t\tif (sqlStr == null) {\n\t\t\tLOGGER.error(\"The formator.format(sql) is a null.\");\n\t\t\treturn null;\n\t\t}\n\n\t\tString trimmedSql = sqlStr.trim();\n\t\tif (!trimmedSql.endsWith(\";\")) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tString formattedSql = trimmedSql.substring(0, trimmedSql.length() - 1);\n\t\treturn formattedSql;\n\t}", "private static String formatEntry(Object entry){\n return QUOTE + entry.toString() + QUOTE + DELIM;\n }", "private String createFindAll() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"SELECT \");\n\t\tsb.append(\" * \");\n\t\tsb.append(\" FROM \");\n\t\tsb.append(type.getSimpleName());\n\t\treturn sb.toString();\n\t}", "public String insertSelective(Car record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"`basedata_car`\");\n \n if (record.getCarId() != null) {\n sql.VALUES(\"car_id\", \"#{carId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarBrandId() != null) {\n sql.VALUES(\"car_brand_id\", \"#{carBrandId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarModel() != null) {\n sql.VALUES(\"car_model\", \"#{carModel,jdbcType=VARCHAR}\");\n }\n \n if (record.getCarType() != null) {\n sql.VALUES(\"car_type\", \"#{carType,jdbcType=TINYINT}\");\n }\n \n if (record.getAlias() != null) {\n sql.VALUES(\"alias\", \"#{alias,jdbcType=VARCHAR}\");\n }\n \n if (record.getSeatType() != null) {\n sql.VALUES(\"seat_type\", \"#{seatType,jdbcType=TINYINT}\");\n }\n \n if (record.getSeatNum() != null) {\n sql.VALUES(\"seat_num\", \"#{seatNum,jdbcType=TINYINT}\");\n }\n \n if (record.getCarClass() != null) {\n sql.VALUES(\"car_class\", \"#{carClass,jdbcType=INTEGER}\");\n }\n \n if (record.getGuestNum() != null) {\n sql.VALUES(\"guest_num\", \"#{guestNum,jdbcType=INTEGER}\");\n }\n \n if (record.getLuggageNum() != null) {\n sql.VALUES(\"luggage_num\", \"#{luggageNum,jdbcType=INTEGER}\");\n }\n \n if (record.getSpell() != null) {\n sql.VALUES(\"spell\", \"#{spell,jdbcType=VARCHAR}\");\n }\n \n if (record.getEnName() != null) {\n sql.VALUES(\"en_name\", \"#{enName,jdbcType=VARCHAR}\");\n }\n \n if (record.getUpdatedAt() != null) {\n sql.VALUES(\"updated_at\", \"#{updatedAt,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getCreatedAt() != null) {\n sql.VALUES(\"created_at\", \"#{createdAt,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String Analise(String SQL, String Value){\n SQLQuery result = session.createSQLQuery(SQL);\n Value = result.toString();\n return Value;\n}", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "protected String getSQL (Element sql) {\r\n\r\n //local variables\r\n\r\n String SQL = \"\";\r\n\r\n //code description\r\n \r\n NodeList textlist = sql.getChildNodes();\r\n for (int i = 0; i < textlist.getLength(); i++) {\r\n if (textlist.item(i).getNodeType() == Node.TEXT_NODE) {\r\n SQL += textlist.item(i).getNodeValue();\r\n }\r\n }\r\n return SQL;\r\n\r\n }", "public String InsertarAnuncioGeneral(AnuncioGeneralDTO anuncio){\n int status=0;\n String message=\"Funciona bien\";\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is);\n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"insertar.AnuncioGeneral\"));\n \n ps.setString(1, anuncio.getTipoAnuncio().toString());\n ps.setString(2,anuncio.getTitulo());\n ps.setString(3,anuncio.getCuerpo());\n \n java.sql.Date fechaPublicacion=new java.sql.Date(anuncio.getFechaPublicacion().getTime());\n // DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss dd/MM/yyyy\");\n // String fecha = dateFormat.format(anuncio.getFechaPublicacion());\n // java.sql.Date fechaPublicacion=new java.sql.Date(dateFormat.parse(fecha).getTime());\n ps.setDate(4, fechaPublicacion);\n message=\"Cargo bien la fecha\";\n ps.setString(5,anuncio.getPropietario().getEmail());\n ps.setString(6,anuncio.getEstadoAnuncio().toString());\n status=ps.executeUpdate();\n\n \n int idAnuncio=GetMaxID();\n for(Contacto c : anuncio.getDestinatarios()){\n PreparedStatement psDestinatario=conect.prepareStatement(sqlProp.getProperty(\"insertar.Destinatario\"));\n psDestinatario.setInt(1, idAnuncio);\n psDestinatario.setString(2, c.getEmail());\n psDestinatario.executeUpdate();\n }\n message=\"funciona bien\";\n }catch(Exception e){\n e.toString();\n }\n\n return message;\n }", "public String Execomando(String Comsql) {\n String Mensaje = \"\";\n /* sino retorna nada es porque todo esta bien */\n try {\n PreparedStatement pstm = con.prepareStatement(Comsql);\n pstm.execute();\n pstm.close();\n } catch (SQLException e) {\n Mensaje = e.toString();\n }\n return Mensaje;\n }", "public String insertEscuela(Escuela escuela){\n String regInsertado = \"Registro Escuela #\";\n long contador = 0;\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"IDESCUELA\",escuela.getIdentificadorEscuela());\n contentValues.put(\"NOMESCUELA\", escuela.getNombreEscuela());\n contador = db.insert(\"ESCUELA\",null,contentValues);\n db.close();\n\n if(contador == -1 || contador == 0){\n regInsertado = \"Error al insertar Escuela. Registro duplicado.\";\n }else{\n regInsertado = regInsertado + contador;\n }\n return regInsertado;\n }", "protected String formatField() {\n \tif(!updated) return \"No record set.\";\n \t\n \tif(firstFieldP.getText() != null && lastFieldP.getText() != null) {\n\t \tfirstNameString = firstFieldP.getText();\n\t \tlastNameString = lastFieldP.getText();\n \t} else\t{\n \tfirstNameString = firstFieldC.getText();\n \tlastNameString = lastFieldC.getText();\n \ttribeString = tribeField.getText();\t\n \t}\n\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"<html><p align=center>\");\n \tsb.append(firstNameString);\n \tsb.append(\" \");\n \tsb.append(lastNameString);\n \tsb.append(\"<br>\");\n \tsb.append(tribeString);\n \tsb.append(\"</p></html>\");\n \t\n \treturn sb.toString(); \t\n }", "private String insertCommand(Object item)\n\t{\n\t\tif(item instanceof Road)\n\t\t{\n\t\t\tRoad tmp = (Road) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.RoadTable.TABLE_NAME + \" (\" +\n\t\t\t\tDBContract.RoadTable.ROADNAME[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.LENGTH[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.DURATION[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.PRICE[0] + \") VALUES (\" +\n\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + tmp.getLength() + \" ,\" +\n\t\t\t\ttmp.getDuration() + \" ,\" + tmp.getPrice() + \")\";\n \t\t}\n\t\telse if(item instanceof Contact)\n\t\t{\n\t\t\tContact tmp = (Contact) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.ContactTable.TABLE_NAME + \" (\" +\n\t\t\t\t\tDBContract.ContactTable.NAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.SURNAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.BILL[0] + \") VALUES (\" +\n\t\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + \"\\\"\" + tmp.getFirstName() + \"\\\"\" +\n\t\t\t\t\t\" ,\" + tmp.getbill() + \")\";\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "public String getTimestampString() throws SQLException {\n\t\tloadFromDB();\n\t\treturn DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM)\n\t\t\t\t\t.format(rev_timestamp);\n\t}", "public String getSQLstring() {\r\n return typeId.toParsableString(this);\r\n }", "public String toString() {\n\t\t//TODO add your own field name here\t\t\n\t\t//return buffer.append(this.yourFieldName).toString();\n\t\treturn \"\";\n\t}", "public String getSaveString() {\n return \"\" + Value;\n }", "public String getNoColumnsInsertString() {\n \t\treturn \"values ( )\";\n \t}", "public String insertTypesPhone() {\n String query = \"\";\n\n String[] typesPhoneDefault = res.getStringArray(R.array.types_phone);\n for (int i = 0; i < typesPhoneDefault.length; i++) {\n // Script inserting types phone default\n query += \"INSERT INTO \" + TABLE_PHONE_TYPE + \"(\" + ID + \",\" + TITLE + \") VALUES(\" + (i + 1) + \",'\" + typesPhoneDefault[i] + \"');\";\n }\n\n return query;\n }", "public String getEntrySave() {\r\n return \"-\"+getId() + \"|\" + getFavorite() + \"|\" + getSubject() + \"|\" + date(4) + \"|\" + price.getFull() + \"|\" + getNotes();\r\n }", "public String toSQL(boolean fuzzySearch){\n return toSQL();\n }", "public String insertXosoSql(String date, String data) {\n\t\tString sql =\"\";\n\t\tString table_name = db.table_name;\n\t\tif(!db.CheckRecordExisted(date)){\n\t\t\tsql= \"insert into \"+table_name+\" (date, result_json) values ('\"+date+\"','\"+data+\"')\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsql = \"UPDATE \"+table_name+\" SET result_json='\"+data+\"' WHERE date='\"+date+\"'\";\n\t\t}\n\t\tlogger.debug(sql);\n\t\ttry {\n\t\t//\tdb.createPreparedStatement(date, data);\n\t\t\tdb.executeQuery(sql);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t}\n\t\treturn sql;\n\t}", "public String getDBString();", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getLegDepartureLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalDayOffset()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegStopCount()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegEquipment()));\n return sb.toString();\n }", "public String toString()\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\treturn \"columnName: \" + columnName + \"\\n\" +\n\t\t\t\t\"defaultText: \" + defaultText + \"\\n\" +\n\t\t\t\tsuper.toString();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "private String writeNameIdResultSet(ResultSet resultSet) throws SQLException {\n\t\r\n\tString strada_arco=\"\";\r\n\tString arco=\"\";\r\n\t\r\n\tint i=0;\r\n\twhile (resultSet.next()) {\r\n\t\t// It is possible to get the columns via name\r\n\t\t// also possible to get the columns via the column number\r\n\t\t// which starts at 1\r\n\t\t// e.g. resultSet.getSTring(2);\r\n\t\t\r\n\t\t\r\n\t\tstrada_arco=resultSet.getString(1);\r\n\t\tarco=resultSet.getString(2);\r\n\t\t //nome_arco= resultSet.getString(3);\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\treturn strada_arco+\"-\"+arco;\r\n}", "public static String formatQuery( String sqlString ) {\n StringTokenizer st= new StringTokenizer( sqlString, \"'\" );\n StringWriter sw = new StringWriter();\n \n while (st.hasMoreTokens()) {\n sw.write( st.nextToken() );\n if (st.hasMoreTokens())\n sw.write( \"''\" );\n }\n \n return sw.toString();\n }", "public String insertar(Cargo cargo){\n String registrosInser=\"Registro insertado N°= \";\n long contador;\n ContentValues c=new ContentValues();\n //c.put(\"ID_CARGO\",cargo.getIdCargo());\n c.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n c.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,c);\n if(contador==-1||contador==0){\n registrosInser=\"Error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n /* String registrosInser=\"Registro insertado N°= \";\n long contador= 0;\n ContentValues carg = new ContentValues();\n //carg.put(\"ID_CARGO\",cargo.getIdCargo());\n carg.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n carg.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,carg);\n if(contador==-1||contador==0){\n registrosInser=\"error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n return registrosInser;*/\n return registrosInser;\n\n }", "@Override\n public String toSaveString() {\n //D0Finish project@June 6\n return \"D\" + (isDone ? \"1\" : \"0\") + name + \"@\" + getDate();\n }", "public String insertAlum(Alumno alumno) //lo necesitaba\n {\n String regInsertado = \"Alumno: \";\n\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"CARNET\",alumno.getCarnet());\n contentValues.put(\"IDESCUELA\", alumno.getIdEscuela());\n contentValues.put(\"NOMESTUDIANTE\", alumno.getNombre());\n long contador = db.insert(\"ESTUDIANTE\",null,contentValues);\n db.close();\n\n if(contador > 0){\n regInsertado = regInsertado + contador;\n }else{\n regInsertado = \"Ya existe el alumno.\" + alumno.getCarnet();\n }\n return regInsertado;\n }", "public String insertSelective(Userinfo record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"userinfo\");\n \n if (record.getUserid() != null) {\n sql.VALUES(\"userid\", \"#{userid,jdbcType=INTEGER}\");\n }\n \n if (record.getUsername() != null) {\n sql.VALUES(\"username\", \"#{username,jdbcType=VARCHAR}\");\n }\n \n if (record.getSex() != null) {\n sql.VALUES(\"sex\", \"#{sex,jdbcType=BIT}\");\n }\n \n if (record.getTel() != null) {\n sql.VALUES(\"tel\", \"#{tel,jdbcType=VARCHAR}\");\n }\n \n if (record.getLastlogintime() != null) {\n sql.VALUES(\"lastlogintime\", \"#{lastlogintime,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getStatus() != null) {\n sql.VALUES(\"status\", \"#{status,jdbcType=BIT}\");\n }\n \n if (record.getWxopenid() != null) {\n sql.VALUES(\"wxopenid\", \"#{wxopenid,jdbcType=VARCHAR}\");\n }\n \n if (record.getAddr() != null) {\n sql.VALUES(\"addr\", \"#{addr,jdbcType=VARCHAR}\");\n }\n \n if (record.getDelStatus() != null) {\n sql.VALUES(\"del_status\", \"#{delStatus,jdbcType=BIT}\");\n }\n \n if (record.getCreatetime() != null) {\n sql.VALUES(\"createtime\", \"#{createtime,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String databaseToString()\n {\n String dbString = \"\";\n SQLiteDatabase sqLiteDatabase = getWritableDatabase(); // database we writing too\n String query = \"SELECT * FROM \" + TABLE_PRODUCTS + \"WHERE 1\"; // 1 means every row * means every columns\n\n //Cursor points to locations in the results\n Cursor cursor = sqLiteDatabase.rawQuery(query,null);\n //Move to first row in results\n cursor.moveToFirst();\n\n // loops through every product and extracts the productname\n while(!cursor.isAfterLast())\n {\n if(cursor.getString(cursor.getColumnIndex(\"productname\"))!= null)\n {\n dbString += cursor.getString(cursor.getColumnIndex(\"productname\"));\n dbString += \"\\n\";\n }\n }\n sqLiteDatabase.close();\n return dbString;\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getHashKey()));\n return sb.toString();\n }", "public String prepareStatementString() throws SQLException {\n\t\tList<Object> argList = new ArrayList<Object>();\n\t\treturn buildStatementString(argList);\n\t}", "public String getStringRecord() {\n NumberFormat nf = new DecimalFormat(\"0000.00\");\n String delimiter = \",\";\n\n return String.format(\"%05d\", orderLineId) + delimiter + String.format(\"%05d\", orderId) + delimiter\n + String.format(\"%05d\", userId) + delimiter + String.format(\"%05d\", productId) + delimiter\n + String.format(\"%05d\", orderLineQuantity) + delimiter + nf.format(salesPrice)\n + System.getProperty(\"line.separator\");\n }", "private static String adqlCharLiteral( String txt ) {\n return \"'\" + txt.replaceAll( \"'\", \"''\" ) + \"'\";\n }", "private String produceSQL(String[] cols) {\n StringBuffer buffer = new StringBuffer();\n buffer.append('(');\n buffer.append(cols[0]);\n\n for (int i = 1; i < cols.length; i++){\n buffer.append(',');\n buffer.append(cols[i]);\n }\n buffer.append(')');\n return buffer.toString();\n }", "public String agregarCuenta(Cuenta cuenta) {\n String mensaje = \"\";\n try {\n PreparedStatement PrSt;\n String Query = \"INSERT INTO Cuenta VALUES(?,?,?,?)\";\n PrSt = conexion.prepareStatement(Query);\n PrSt.setString(1, cuenta.getCodigo());\n PrSt.setDate(2, cuenta.getCreacion());\n PrSt.setDouble(3, cuenta.getCredito());\n PrSt.setString(4, cuenta.getCodigo_cliente());\n int resultado = PrSt.executeUpdate();\n if (resultado > 0) {\n mensaje = \"Agregada Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n } else {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n }\n PrSt.close();\n } catch (SQLException e) {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente() + \" Error: \" + e.toString();\n }\n return mensaje;\n }", "public static String convertColumn2String(Column column) {\n char type = '\\0';\n String result = \"\";\n\n switch (column.type) {\n case STRING:\n type = 's';\n result = (column.value == null? \"\" : column.value.toString());\n break;\n case INT:\n type = 'i';\n int value;\n if (column.value == null)\n value = INT_OFFSET; // we don't really distinguish between zero and null\n else\n value = ((Integer)column.value).intValue() + INT_OFFSET;\n result = String.format(INT_FORMAT_STRING, value);\n break;\n case DOUBLE:\n type = 'd';\n double value2;\n if (column.value == null)\n value2 = INT_OFFSET;\n else\n value2 = ((Double)column.value).doubleValue() + INT_OFFSET;\n result = String.format(DOUBLE_FORMAT_STRING, value2);\n break;\n }\n\n return type + result;\n }", "public String ToString(){\r\n String Result;\r\n return Result = \"Arco: \"+this.id+\" Dato: \"+String.valueOf(this.Dato)+\" Peso: \"+String.valueOf(this.p)+\" Extremo Inicial: \"+this.Vi.id+\" Extremo Final: \"+this.Vf.id;\r\n }", "public abstract String createDBString();", "public String getRecordText();", "public String getRecordText();", "String getToText();", "private void yas(){\n System.out.println(namn);\n \n try{\n String fraga = \"SELECT TEXT FROM INLAGG WHERE RUBRIK = 'Borttappad strumpa'\";\n String XD = db.fetchSingle(fraga);\n System.out.println(XD);\n txtInlagg.append(XD);\n }\n catch(InfException e){\n JOptionPane.showMessageDialog(null, \"Kunde ej hämta inlägg\");\n }\n }", "String getFormattedString(IRenamable f);", "@Override\n\tpublic String insertStatement() throws Exception {\n\t\treturn null;\n\t}", "public static String getDadoFormatado(String pDado, TiposDadosQuery pTipo) {\n String dadoFormatado;\n if (pDado != null) {\n switch (pTipo)\n {\n case TEXTO:\n dadoFormatado = \"'\" + verificaAspaSimples(pDado) + \"'\";\n break;\n case DATA:\n dadoFormatado = \"'\" + pDado + \"'\";\n break;\n default:\n dadoFormatado = pDado; \n break;\n }\n }\n else {\n dadoFormatado = \"null\";\n }\n \n return dadoFormatado;\n \n }", "public abstract String valueAsText();", "String getInsertStatement(\r\n TypedKeyValue<List<String>, List<String>> fieldsAndValues,\r\n String tableName);", "public String loopDBInfo(ResultSet rs){\n String p = \"\";\n try{\n while (rs.next()) {\n int id_col = rs.getInt(\"ID\");\n String first_name = rs.getString(\"NAME\");\n String phone = rs.getString(\"PHONE\");\n String status = rs.getString(\"STATUS\");\n String prob = rs.getString(\"PROBLEM\");\n \n \n p = p + (id_col + \" \" + first_name + \" \" + phone + \" \"+ status + \" \"+ prob + \"\\n\"); \n // System.out.println(p);\n }\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n \n } return p;\n }", "@Override\n public String getStringFromDatabase(int objectID) {\n return \"From Class one result\"+objectID;\n }" ]
[ "0.72332656", "0.6645996", "0.6531685", "0.6386587", "0.6316747", "0.6265875", "0.621917", "0.6208691", "0.62029773", "0.6154162", "0.6134995", "0.60820025", "0.59232104", "0.579011", "0.57338965", "0.570275", "0.567309", "0.5662722", "0.5660105", "0.5651487", "0.56486756", "0.5626061", "0.56242555", "0.5619859", "0.56078476", "0.56078476", "0.56078476", "0.56078476", "0.56078476", "0.5604503", "0.5582", "0.5580296", "0.5569601", "0.5538234", "0.55242646", "0.54786515", "0.54731727", "0.5463155", "0.5451918", "0.54460627", "0.5401085", "0.53716946", "0.5368335", "0.5359354", "0.535153", "0.5345069", "0.5340157", "0.5332032", "0.5326281", "0.5302725", "0.5300964", "0.5300155", "0.52977496", "0.52956915", "0.5290483", "0.5290483", "0.5285686", "0.52780145", "0.52712643", "0.5270857", "0.5267584", "0.52625895", "0.5258992", "0.5257228", "0.52544725", "0.52529544", "0.5251592", "0.5246511", "0.52446985", "0.52373844", "0.52204514", "0.5211526", "0.52078456", "0.5205468", "0.5202617", "0.5198143", "0.51890844", "0.5182871", "0.5182217", "0.5173992", "0.51693326", "0.51654756", "0.5162951", "0.51620543", "0.515915", "0.5148224", "0.51460505", "0.5145959", "0.51372635", "0.5136895", "0.5125541", "0.5125541", "0.5120276", "0.5117769", "0.51146203", "0.5114011", "0.511289", "0.51112044", "0.5102594", "0.5092712", "0.50926036" ]
0.0
-1
Retorna texto formatado para insercao em query
public static String getDadoFormatado(Date pDado, TiposDadosQuery pTipo) { StringBuilder dadoFormatado = new StringBuilder(""); if (pDado == null) { dadoFormatado.append("null"); } else { dadoFormatado.append("'"); dadoFormatado.append(new SimpleDateFormat("yyyy-MM-dd").format(pDado)); dadoFormatado.append("'"); } return dadoFormatado.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toInsert() {\r\n return \"(null,'\"+ ref + \"','\" + name + \"','\" + tel + \"','\" + address + \"')\";\r\n }", "public String getInsertSQL()\n\t{\n\t\tString fieldList = \"parametro, dia, valor\";\n\t\treturn String.format(\"insert into alteracs (%s) values (%d, %d, %s)\",\n\t\t\t\tfieldList, parametro, dia, String.format(\"%.3f\", valor).replace(',', '.'));\n\t}", "protected String queryInsert() {\n StringBuilder sb = new StringBuilder(\"INSERT INTO \");\n sb.append(tabla).append(\" (\").append(String.join(\",\", campos)).append(\") VALUES (\");\n\n for (int i = 0; i < campos.length; i++) {\n if (i == campos.length -1) {\n sb.append(\"?)\");\n break;\n }\n sb.append(\"?,\");\n }\n\n return sb.toString();\n }", "public abstract String toSQL();", "protected String createInsert(T t) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(type.getSimpleName());\n\t\tsb.append(\" VALUES \");\n\t\treturn sb.toString();\n\t}", "@Override\n\tprotected String sql() throws OperationException {\n\t\treturn sql.insert(tbObj, fieldValue);\n\t}", "private String createInsertQuery() {\r\n StringBuilder query = new StringBuilder();\r\n query.append(\"insert into \").append(m_tableName)\r\n .append(\"(\").append(m_propertyNames[0]);\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",\").append(m_propertyNames[i]);\r\n }\r\n query.append(\") values (?\");\r\n for (int i = 1; i < m_propertyNames.length; i++) {\r\n query.append(\",?\");\r\n }\r\n query.append(\")\");\r\n return query.toString();\r\n }", "public abstract String toDBString();", "@Override\r\n\tpublic String generate() {\r\n\t\tStringBuilder query = new StringBuilder();\r\n\r\n\t\tquery.append(\"INSERT INTO \").append(tableName).append(\" (\");\r\n\t\tfor (int i = 0; i < fieldNames.size(); i++) {\r\n\t\t\tquery.append(fieldNames.get(i));\r\n\t\t\tif (i < fieldNames.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\") VALUES (\");\r\n\t\tfor (int i = 0; i < fieldValues.size(); i++) {\r\n\t\t\tquery.append(\"'\").append(fieldValues.get(i)).append(\"'\");\r\n\t\t\tif (i < fieldValues.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\");\");\r\n\t\treturn query.toString();\r\n\t}", "String toSql();", "@Override\n\tpublic String getPreparedInsertText() {\n\t\treturn SQL_Insert;\n\t}", "private String createInsertQuery()\n {\n int i = 0;\n StringBuilder sb = new StringBuilder();\n sb.append(\"INSERT INTO \");\n sb.append(type.getSimpleName());\n sb.append(\" (\");\n for(Field field:type.getDeclaredFields()) {i++; if(i != type.getDeclaredFields().length)sb.append(field.getName() +\", \"); else sb.append(field.getName());}\n sb.append(\")\");\n sb.append(\" VALUES (\");\n i = 0;\n for(Field field:type.getDeclaredFields()) {i++; if(i!= type.getDeclaredFields().length)sb.append(\"?, \"); else sb.append(\"?\");}\n sb.append(\");\");\n return sb.toString();\n }", "public abstract void toSQL(StringBuilder ret);", "String getBarcharDataQuery();", "public String getInsertContentSql(String table)\r\n \t{\r\n \t\treturn \"insert into \" + table + \" (RESOURCE_ID, BODY)\" + \" values (? , ? )\";\r\n \t}", "@Override\n public String saveAsString() {\n return \"D\" + super.saveAsString() + \" | \" + by;\n }", "public String toDBString() {\n return extra1 + DIVIDER + extra2;\n }", "private String getValuesToInsert(int row) {\n List<String> orderedFields = new ArrayList<>(mapFieldsTypes.keySet()); // get ordered list of fields\n StringBuffer insertRowStringBuffer = new StringBuffer();\n insertRowStringBuffer // add first part of query insert string\n .append(SQLFormater.INSERT_INTO)\n .append(\" \")\n .append(tableName)\n .append(\" \")\n .append(\"(\")\n .append(idFieldName) // first inserted field is always row ID\n .append(\",\");\n orderedFields.forEach(field -> insertRowStringBuffer // add names of fields in order they will be inserted\n .append(field)\n .append(\", \")\n );\n insertRowStringBuffer // add another part of string before values\n .append(\")\")\n .append(\" \")\n .append(SQLFormater.VALUES)\n .append(\"(\")\n .append(row); // first field is always row ID\n if (!mapFieldsStrings.isEmpty() || !mapFieldsIntegers.isEmpty()) {\n orderedFields.forEach(field -> { // inserting field values in controlled order\n insertRowStringBuffer.append(\", \");\n if (mapFieldsStrings.containsKey(field)) {\n insertRowStringBuffer\n .append(\"'\")\n .append(mapFieldsStrings.get(field))\n .append(\"'\");\n } else if (mapFieldsIntegers.containsKey(field)) {\n insertRowStringBuffer.append(mapFieldsIntegers.get(field));\n }\n });\n }\n insertRowStringBuffer.append(\")\");\n clearInsertingValues(); // clear fields to insert another row\n return insertRowStringBuffer.toString();\n }", "private String encodeSQL(String text) {\r\n text = text.replaceAll(\"'\", \"''\");\r\n return \"'\" + text + \"'\";\r\n }", "private String getSQLText (CTextField f)\n \t{\n \t\tString s = f.getText().toUpperCase();\n \t\tif (!s.endsWith(\"%\"))\n \t\t\ts += \"%\";\n \t\tlog.fine( \"String=\" + s);\n \t\treturn s;\n \t}", "public String toString() {\n return SQLStringVisitor.getSQLString(this);\n }", "private static String toSql(Object obj) {\n\t\tif(obj==null) {\n\t\t\treturn \"NULL\";\n\t\t}\n\t\tif(obj instanceof String) {\n\t\t\treturn \"'\"+obj+\"'\";\n\t\t}\n\t\treturn obj.toString();\n\t}", "public String insert(DtoEntrprs dto){\n\t\treturn null;\r\n\t}", "public String getDateTimeInsertString(java.sql.Timestamp aTimestamp){\r\n return \"'\" + DBUtil.getDBDateTimeString(aTimestamp) + \"'\";\r\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getId()));\n return sb.toString();\n }", "public String getIdentityInsertString() {\n \t\treturn null;\n \t}", "private String getStringToCreateDB(String addings) {\n StringBuffer createDBStringBuffer = new StringBuffer();\n createDBStringBuffer\n .append(SQLFormater.CREATE_TABLE)\n .append(\" \")\n .append(tableName)\n .append(\"(\")\n .append(idFieldName)\n .append(\" \")\n .append(DBCreator.INTEGER_TYPE)\n .append(\" \")\n .append(SQLFormater.PRIMARY_KEY);\n mapFieldsTypes.forEach((kField, vType) -> { // add all table's fields\n createDBStringBuffer\n .append(\", \")\n .append(kField)\n .append(\" \")\n .append(vType);\n if(mapFieldsConstraints.containsKey(kField)) { // add constraint for a field\n createDBStringBuffer\n .append(\" \")\n .append(mapFieldsConstraints.get(kField));\n }\n });\n if (addings != null && !addings.isEmpty()) { // add reference\n createDBStringBuffer\n .append(\", \")\n .append(addings);\n }\n createDBStringBuffer.append(\")\");\n return createDBStringBuffer.toString();\n }", "private static String buildStringFromCursor(Cursor dbCursor)\n {\n String writeString = \"\";\n int columnCount = dbCursor.getColumnCount();\n\n for(int count = 0; count < columnCount; count++)\n {\n writeString += dbCursor.getString(count);\n if(count < columnCount - 1)\n {\n writeString += \"\\t\";\n }\n else\n {\n writeString += \"\\n\";\n }\n }\n return writeString;\n }", "protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }", "String buildInsertQuery(String... args);", "public String toSave() {\n\n return \"D|\" + super.toSave() + \" by: \" + by;\n }", "protected String getInsertionSQL() {\n\t\treturn queryData.getString(\"InsertionSQL\");\n\t}", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getCode()));\n return sb.toString();\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getBatchId()));\n sb.append(\", \");\n sb.append(f.formatAny(getNestId()));\n return sb.toString();\n }", "protected String getSQLString() {\n \t\treturn queryTranslator.getSQLString();\n \t}", "public String toSQL() {\n\t\tStringBuilder sBuider = new StringBuilder();\n\n\t\t\n\t\t\n\t\t\n\t\tString sTemp = sBuider.toString();\n\t\tSystem.out.println(this.getClass().getName() + \".toSQL(): SQL statements are \\n\" + sTemp);\n\t\t\n\t\tsBuider = null;\n\t\t\n\t\treturn sTemp;\n\t}", "public String makeValue(ResultRow row) {\n\t\tStringBuffer result = new StringBuffer(this.id);\n\t\tfor (ColumnName column: columns) {\n\t\t\tString value = row.get(column);\n\t\t\tif (value == null) {\n\t\t\t\treturn null;\n\t\t }\n\t\t\tresult.append(DELIMITER);\n\t\t\tresult.append(value);\n\t\t}\n return result.toString();\n\t}", "private String createStandardGZFieldTexts()\n\t{\n\t\tStringBuffer result = new StringBuffer();\n\t\tfor (Entry<String, String[]> entry : standardJournalFieldColumns.entrySet())\n\t\t{\n\t\t\tif (result.length() != 0)\n\t\t\t{\n\t\t\t\tresult.append(\", \");\n\t\t\t}\n\t\t\tresult.append(entry.getKey());\n\t\t\tresult.append(\" TEXT IS '\");\n\t\t\tString[] strings = entry.getValue();\n\t\t\tfor (int index = 0; index < strings.length; index++)\n\t\t\t{\n\t\t\t\tresult.append(strings[index]);\n\t\t\t\tif (index < strings.length)\n\t\t\t\t{\n\t\t\t\t\tresult.append(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.append(\"'\");\n\t\t}\n\t\treturn result.toString();\n\t}", "protected String formatErrorMessage() throws SQLException {\n \tint errCode = SQLite.extendederrcode(getConnection().getSqliteDb());\r\n \tString message = SQLite.errmsg(getConnection().getSqliteDb());\r\n\t\tString s = StringUtil.format(\"Code:{0}\\n{1}\", errCode, message);\r\n\t\treturn s;\r\n\t}", "@Override\n public String databaseString() {\n return \"T | \" + super.databaseString();\n }", "public abstract String toSaveString();", "@Test\n public void testToStringWithSQL() throws SQLException {\n try (PreparedStatement stmt = this.proxy\n .prepareStatement(\"SELECT * FROM country WHERE lang = ? OR callingcode = ?\")) {\n stmt.setString(1, \"de\");\n stmt.setInt(2, 42);\n String sql = stmt.toString();\n assertEquals(\"SELECT * FROM country WHERE lang = 'de' OR callingcode = 42\", sql);\n LOG.info(\"sql = \\\"{}\\\"\", sql);\n }\n }", "public CustomSql getCustomSqlInsert();", "final public static String createPstmtInsert(Class<? extends DotProjectObject> clazz)\n\t{\n\t\tStringBuffer sb = new StringBuffer();\n\t\tString table = null;\n\t\tField[] beanFields = null;\n\t\tString[] dbFields = null;\n\t\t\n\t\ttable = AnnotationUtil.getAnnotationValue(clazz, DbAnnotations.TABLE_ANNOTATION);\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(table);\n\t\t\n\t\tbeanFields = AnnotationUtil.getAnnotatedFields(clazz, DbAnnotations.PROPERTY_ANNOTATION);\n\t\tdbFields = new String[beanFields.length];\n\t\tfor (int i = 0; i < beanFields.length; i++) {\n\t\t\tif (! beanFields[i].isAnnotationPresent(DbAnnotations.IDENTIFICATOR_ANNOTATION)) {\n\t\t\t\tdbFields[i] = AnnotationUtil.getAnnotationValue(beanFields[i], DbAnnotations.PROPERTY_ANNOTATION);\n\t\t\t}\n\t\t}\n\t\tdbFields = (String[])ArrayUtil.clean(dbFields);\n\t\tArrays.sort(dbFields);\n\t\t\t\n\t\tsb.append(\" (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(dbFields[i]);\n\t\t}\n\t\t\n\t\tsb.append(\") values (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(\"?\");\n\t\t}\n\t\tsb.append(\")\");\n\n\t\treturn sb.toString();\n\t}", "static String serializeToString(Object s) throws SQLException {\n\treturn createString(serialize(s));\n }", "private String formatSql(String sql) {\n\t\tString sqlStr = formator.format(sql + \";\");\n\t\tif (sqlStr == null) {\n\t\t\tLOGGER.error(\"The formator.format(sql) is a null.\");\n\t\t\treturn null;\n\t\t}\n\n\t\tString trimmedSql = sqlStr.trim();\n\t\tif (!trimmedSql.endsWith(\";\")) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tString formattedSql = trimmedSql.substring(0, trimmedSql.length() - 1);\n\t\treturn formattedSql;\n\t}", "private String createFindAll() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"SELECT \");\n\t\tsb.append(\" * \");\n\t\tsb.append(\" FROM \");\n\t\tsb.append(type.getSimpleName());\n\t\treturn sb.toString();\n\t}", "private static String formatEntry(Object entry){\n return QUOTE + entry.toString() + QUOTE + DELIM;\n }", "public String insertSelective(Car record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"`basedata_car`\");\n \n if (record.getCarId() != null) {\n sql.VALUES(\"car_id\", \"#{carId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarBrandId() != null) {\n sql.VALUES(\"car_brand_id\", \"#{carBrandId,jdbcType=INTEGER}\");\n }\n \n if (record.getCarModel() != null) {\n sql.VALUES(\"car_model\", \"#{carModel,jdbcType=VARCHAR}\");\n }\n \n if (record.getCarType() != null) {\n sql.VALUES(\"car_type\", \"#{carType,jdbcType=TINYINT}\");\n }\n \n if (record.getAlias() != null) {\n sql.VALUES(\"alias\", \"#{alias,jdbcType=VARCHAR}\");\n }\n \n if (record.getSeatType() != null) {\n sql.VALUES(\"seat_type\", \"#{seatType,jdbcType=TINYINT}\");\n }\n \n if (record.getSeatNum() != null) {\n sql.VALUES(\"seat_num\", \"#{seatNum,jdbcType=TINYINT}\");\n }\n \n if (record.getCarClass() != null) {\n sql.VALUES(\"car_class\", \"#{carClass,jdbcType=INTEGER}\");\n }\n \n if (record.getGuestNum() != null) {\n sql.VALUES(\"guest_num\", \"#{guestNum,jdbcType=INTEGER}\");\n }\n \n if (record.getLuggageNum() != null) {\n sql.VALUES(\"luggage_num\", \"#{luggageNum,jdbcType=INTEGER}\");\n }\n \n if (record.getSpell() != null) {\n sql.VALUES(\"spell\", \"#{spell,jdbcType=VARCHAR}\");\n }\n \n if (record.getEnName() != null) {\n sql.VALUES(\"en_name\", \"#{enName,jdbcType=VARCHAR}\");\n }\n \n if (record.getUpdatedAt() != null) {\n sql.VALUES(\"updated_at\", \"#{updatedAt,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getCreatedAt() != null) {\n sql.VALUES(\"created_at\", \"#{createdAt,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String Analise(String SQL, String Value){\n SQLQuery result = session.createSQLQuery(SQL);\n Value = result.toString();\n return Value;\n}", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "public String getFechaInsercion() { return (this.fechaInsercion == null) ? \"\" : this.fechaInsercion; }", "protected String getSQL (Element sql) {\r\n\r\n //local variables\r\n\r\n String SQL = \"\";\r\n\r\n //code description\r\n \r\n NodeList textlist = sql.getChildNodes();\r\n for (int i = 0; i < textlist.getLength(); i++) {\r\n if (textlist.item(i).getNodeType() == Node.TEXT_NODE) {\r\n SQL += textlist.item(i).getNodeValue();\r\n }\r\n }\r\n return SQL;\r\n\r\n }", "public String InsertarAnuncioGeneral(AnuncioGeneralDTO anuncio){\n int status=0;\n String message=\"Funciona bien\";\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is);\n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"insertar.AnuncioGeneral\"));\n \n ps.setString(1, anuncio.getTipoAnuncio().toString());\n ps.setString(2,anuncio.getTitulo());\n ps.setString(3,anuncio.getCuerpo());\n \n java.sql.Date fechaPublicacion=new java.sql.Date(anuncio.getFechaPublicacion().getTime());\n // DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss dd/MM/yyyy\");\n // String fecha = dateFormat.format(anuncio.getFechaPublicacion());\n // java.sql.Date fechaPublicacion=new java.sql.Date(dateFormat.parse(fecha).getTime());\n ps.setDate(4, fechaPublicacion);\n message=\"Cargo bien la fecha\";\n ps.setString(5,anuncio.getPropietario().getEmail());\n ps.setString(6,anuncio.getEstadoAnuncio().toString());\n status=ps.executeUpdate();\n\n \n int idAnuncio=GetMaxID();\n for(Contacto c : anuncio.getDestinatarios()){\n PreparedStatement psDestinatario=conect.prepareStatement(sqlProp.getProperty(\"insertar.Destinatario\"));\n psDestinatario.setInt(1, idAnuncio);\n psDestinatario.setString(2, c.getEmail());\n psDestinatario.executeUpdate();\n }\n message=\"funciona bien\";\n }catch(Exception e){\n e.toString();\n }\n\n return message;\n }", "public String Execomando(String Comsql) {\n String Mensaje = \"\";\n /* sino retorna nada es porque todo esta bien */\n try {\n PreparedStatement pstm = con.prepareStatement(Comsql);\n pstm.execute();\n pstm.close();\n } catch (SQLException e) {\n Mensaje = e.toString();\n }\n return Mensaje;\n }", "public String insertEscuela(Escuela escuela){\n String regInsertado = \"Registro Escuela #\";\n long contador = 0;\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"IDESCUELA\",escuela.getIdentificadorEscuela());\n contentValues.put(\"NOMESCUELA\", escuela.getNombreEscuela());\n contador = db.insert(\"ESCUELA\",null,contentValues);\n db.close();\n\n if(contador == -1 || contador == 0){\n regInsertado = \"Error al insertar Escuela. Registro duplicado.\";\n }else{\n regInsertado = regInsertado + contador;\n }\n return regInsertado;\n }", "protected String formatField() {\n \tif(!updated) return \"No record set.\";\n \t\n \tif(firstFieldP.getText() != null && lastFieldP.getText() != null) {\n\t \tfirstNameString = firstFieldP.getText();\n\t \tlastNameString = lastFieldP.getText();\n \t} else\t{\n \tfirstNameString = firstFieldC.getText();\n \tlastNameString = lastFieldC.getText();\n \ttribeString = tribeField.getText();\t\n \t}\n\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"<html><p align=center>\");\n \tsb.append(firstNameString);\n \tsb.append(\" \");\n \tsb.append(lastNameString);\n \tsb.append(\"<br>\");\n \tsb.append(tribeString);\n \tsb.append(\"</p></html>\");\n \t\n \treturn sb.toString(); \t\n }", "private String insertCommand(Object item)\n\t{\n\t\tif(item instanceof Road)\n\t\t{\n\t\t\tRoad tmp = (Road) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.RoadTable.TABLE_NAME + \" (\" +\n\t\t\t\tDBContract.RoadTable.ROADNAME[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.LENGTH[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.DURATION[0] + \" ,\" +\n\t\t\t\tDBContract.RoadTable.PRICE[0] + \") VALUES (\" +\n\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + tmp.getLength() + \" ,\" +\n\t\t\t\ttmp.getDuration() + \" ,\" + tmp.getPrice() + \")\";\n \t\t}\n\t\telse if(item instanceof Contact)\n\t\t{\n\t\t\tContact tmp = (Contact) item;\n\t\t\treturn \"INSERT INTO \" + DBContract.ContactTable.TABLE_NAME + \" (\" +\n\t\t\t\t\tDBContract.ContactTable.NAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.SURNAME[0] + \" ,\" +\n\t\t\t\t\tDBContract.ContactTable.BILL[0] + \") VALUES (\" +\n\t\t\t\t\t\"\\\"\" + tmp.getName() + \"\\\"\" + \" ,\" + \"\\\"\" + tmp.getFirstName() + \"\\\"\" +\n\t\t\t\t\t\" ,\" + tmp.getbill() + \")\";\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "public String getSQLstring() {\r\n return typeId.toParsableString(this);\r\n }", "public String getTimestampString() throws SQLException {\n\t\tloadFromDB();\n\t\treturn DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM)\n\t\t\t\t\t.format(rev_timestamp);\n\t}", "public String toString() {\n\t\t//TODO add your own field name here\t\t\n\t\t//return buffer.append(this.yourFieldName).toString();\n\t\treturn \"\";\n\t}", "public String getSaveString() {\n return \"\" + Value;\n }", "public String getNoColumnsInsertString() {\n \t\treturn \"values ( )\";\n \t}", "public String insertTypesPhone() {\n String query = \"\";\n\n String[] typesPhoneDefault = res.getStringArray(R.array.types_phone);\n for (int i = 0; i < typesPhoneDefault.length; i++) {\n // Script inserting types phone default\n query += \"INSERT INTO \" + TABLE_PHONE_TYPE + \"(\" + ID + \",\" + TITLE + \") VALUES(\" + (i + 1) + \",'\" + typesPhoneDefault[i] + \"');\";\n }\n\n return query;\n }", "public String getEntrySave() {\r\n return \"-\"+getId() + \"|\" + getFavorite() + \"|\" + getSubject() + \"|\" + date(4) + \"|\" + price.getFull() + \"|\" + getNotes();\r\n }", "public String toSQL(boolean fuzzySearch){\n return toSQL();\n }", "public String insertXosoSql(String date, String data) {\n\t\tString sql =\"\";\n\t\tString table_name = db.table_name;\n\t\tif(!db.CheckRecordExisted(date)){\n\t\t\tsql= \"insert into \"+table_name+\" (date, result_json) values ('\"+date+\"','\"+data+\"')\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsql = \"UPDATE \"+table_name+\" SET result_json='\"+data+\"' WHERE date='\"+date+\"'\";\n\t\t}\n\t\tlogger.debug(sql);\n\t\ttry {\n\t\t//\tdb.createPreparedStatement(date, data);\n\t\t\tdb.executeQuery(sql);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t}\n\t\treturn sql;\n\t}", "public String getDBString();", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getLegDepartureLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalLocalTm()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegArrivalDayOffset()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegStopCount()));\n sb.append(\", \");\n sb.append(f.formatAny(getLegEquipment()));\n return sb.toString();\n }", "public String toString()\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\treturn \"columnName: \" + columnName + \"\\n\" +\n\t\t\t\t\"defaultText: \" + defaultText + \"\\n\" +\n\t\t\t\tsuper.toString();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "private String writeNameIdResultSet(ResultSet resultSet) throws SQLException {\n\t\r\n\tString strada_arco=\"\";\r\n\tString arco=\"\";\r\n\t\r\n\tint i=0;\r\n\twhile (resultSet.next()) {\r\n\t\t// It is possible to get the columns via name\r\n\t\t// also possible to get the columns via the column number\r\n\t\t// which starts at 1\r\n\t\t// e.g. resultSet.getSTring(2);\r\n\t\t\r\n\t\t\r\n\t\tstrada_arco=resultSet.getString(1);\r\n\t\tarco=resultSet.getString(2);\r\n\t\t //nome_arco= resultSet.getString(3);\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\treturn strada_arco+\"-\"+arco;\r\n}", "public static String formatQuery( String sqlString ) {\n StringTokenizer st= new StringTokenizer( sqlString, \"'\" );\n StringWriter sw = new StringWriter();\n \n while (st.hasMoreTokens()) {\n sw.write( st.nextToken() );\n if (st.hasMoreTokens())\n sw.write( \"''\" );\n }\n \n return sw.toString();\n }", "public String insertar(Cargo cargo){\n String registrosInser=\"Registro insertado N°= \";\n long contador;\n ContentValues c=new ContentValues();\n //c.put(\"ID_CARGO\",cargo.getIdCargo());\n c.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n c.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,c);\n if(contador==-1||contador==0){\n registrosInser=\"Error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n /* String registrosInser=\"Registro insertado N°= \";\n long contador= 0;\n ContentValues carg = new ContentValues();\n //carg.put(\"ID_CARGO\",cargo.getIdCargo());\n carg.put(\"NOMBRE_CARGO\",cargo.getNombreCargo());\n carg.put(\"DESCRIPCION_CARGO\",cargo.getDescripcionCargo());\n contador=db.insert(\"CARGO\",null,carg);\n if(contador==-1||contador==0){\n registrosInser=\"error al insertar\";\n }\n else{\n registrosInser=registrosInser+contador;\n }\n return registrosInser;*/\n return registrosInser;\n\n }", "@Override\n public String toSaveString() {\n //D0Finish project@June 6\n return \"D\" + (isDone ? \"1\" : \"0\") + name + \"@\" + getDate();\n }", "public String insertAlum(Alumno alumno) //lo necesitaba\n {\n String regInsertado = \"Alumno: \";\n\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"CARNET\",alumno.getCarnet());\n contentValues.put(\"IDESCUELA\", alumno.getIdEscuela());\n contentValues.put(\"NOMESTUDIANTE\", alumno.getNombre());\n long contador = db.insert(\"ESTUDIANTE\",null,contentValues);\n db.close();\n\n if(contador > 0){\n regInsertado = regInsertado + contador;\n }else{\n regInsertado = \"Ya existe el alumno.\" + alumno.getCarnet();\n }\n return regInsertado;\n }", "public String insertSelective(Userinfo record) {\n SQL sql = new SQL();\n sql.INSERT_INTO(\"userinfo\");\n \n if (record.getUserid() != null) {\n sql.VALUES(\"userid\", \"#{userid,jdbcType=INTEGER}\");\n }\n \n if (record.getUsername() != null) {\n sql.VALUES(\"username\", \"#{username,jdbcType=VARCHAR}\");\n }\n \n if (record.getSex() != null) {\n sql.VALUES(\"sex\", \"#{sex,jdbcType=BIT}\");\n }\n \n if (record.getTel() != null) {\n sql.VALUES(\"tel\", \"#{tel,jdbcType=VARCHAR}\");\n }\n \n if (record.getLastlogintime() != null) {\n sql.VALUES(\"lastlogintime\", \"#{lastlogintime,jdbcType=TIMESTAMP}\");\n }\n \n if (record.getStatus() != null) {\n sql.VALUES(\"status\", \"#{status,jdbcType=BIT}\");\n }\n \n if (record.getWxopenid() != null) {\n sql.VALUES(\"wxopenid\", \"#{wxopenid,jdbcType=VARCHAR}\");\n }\n \n if (record.getAddr() != null) {\n sql.VALUES(\"addr\", \"#{addr,jdbcType=VARCHAR}\");\n }\n \n if (record.getDelStatus() != null) {\n sql.VALUES(\"del_status\", \"#{delStatus,jdbcType=BIT}\");\n }\n \n if (record.getCreatetime() != null) {\n sql.VALUES(\"createtime\", \"#{createtime,jdbcType=TIMESTAMP}\");\n }\n \n return sql.toString();\n }", "public String databaseToString()\n {\n String dbString = \"\";\n SQLiteDatabase sqLiteDatabase = getWritableDatabase(); // database we writing too\n String query = \"SELECT * FROM \" + TABLE_PRODUCTS + \"WHERE 1\"; // 1 means every row * means every columns\n\n //Cursor points to locations in the results\n Cursor cursor = sqLiteDatabase.rawQuery(query,null);\n //Move to first row in results\n cursor.moveToFirst();\n\n // loops through every product and extracts the productname\n while(!cursor.isAfterLast())\n {\n if(cursor.getString(cursor.getColumnIndex(\"productname\"))!= null)\n {\n dbString += cursor.getString(cursor.getColumnIndex(\"productname\"));\n dbString += \"\\n\";\n }\n }\n sqLiteDatabase.close();\n return dbString;\n }", "public String formatPrimaryKey()\n {\n StringBuilder sb = new StringBuilder();\n AcFormatter f = new AcFormatter();\n sb.append(f.formatAny(getHashKey()));\n return sb.toString();\n }", "public String prepareStatementString() throws SQLException {\n\t\tList<Object> argList = new ArrayList<Object>();\n\t\treturn buildStatementString(argList);\n\t}", "public String getStringRecord() {\n NumberFormat nf = new DecimalFormat(\"0000.00\");\n String delimiter = \",\";\n\n return String.format(\"%05d\", orderLineId) + delimiter + String.format(\"%05d\", orderId) + delimiter\n + String.format(\"%05d\", userId) + delimiter + String.format(\"%05d\", productId) + delimiter\n + String.format(\"%05d\", orderLineQuantity) + delimiter + nf.format(salesPrice)\n + System.getProperty(\"line.separator\");\n }", "private static String adqlCharLiteral( String txt ) {\n return \"'\" + txt.replaceAll( \"'\", \"''\" ) + \"'\";\n }", "private String produceSQL(String[] cols) {\n StringBuffer buffer = new StringBuffer();\n buffer.append('(');\n buffer.append(cols[0]);\n\n for (int i = 1; i < cols.length; i++){\n buffer.append(',');\n buffer.append(cols[i]);\n }\n buffer.append(')');\n return buffer.toString();\n }", "public String agregarCuenta(Cuenta cuenta) {\n String mensaje = \"\";\n try {\n PreparedStatement PrSt;\n String Query = \"INSERT INTO Cuenta VALUES(?,?,?,?)\";\n PrSt = conexion.prepareStatement(Query);\n PrSt.setString(1, cuenta.getCodigo());\n PrSt.setDate(2, cuenta.getCreacion());\n PrSt.setDouble(3, cuenta.getCredito());\n PrSt.setString(4, cuenta.getCodigo_cliente());\n int resultado = PrSt.executeUpdate();\n if (resultado > 0) {\n mensaje = \"Agregada Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n } else {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente();\n }\n PrSt.close();\n } catch (SQLException e) {\n mensaje = \"Fallo al agregar Cuenta Codigo No.\" + cuenta.getCodigo() + \" Para el cliente con codigo: \" + cuenta.getCodigo_cliente() + \" Error: \" + e.toString();\n }\n return mensaje;\n }", "public static String convertColumn2String(Column column) {\n char type = '\\0';\n String result = \"\";\n\n switch (column.type) {\n case STRING:\n type = 's';\n result = (column.value == null? \"\" : column.value.toString());\n break;\n case INT:\n type = 'i';\n int value;\n if (column.value == null)\n value = INT_OFFSET; // we don't really distinguish between zero and null\n else\n value = ((Integer)column.value).intValue() + INT_OFFSET;\n result = String.format(INT_FORMAT_STRING, value);\n break;\n case DOUBLE:\n type = 'd';\n double value2;\n if (column.value == null)\n value2 = INT_OFFSET;\n else\n value2 = ((Double)column.value).doubleValue() + INT_OFFSET;\n result = String.format(DOUBLE_FORMAT_STRING, value2);\n break;\n }\n\n return type + result;\n }", "public abstract String createDBString();", "public String ToString(){\r\n String Result;\r\n return Result = \"Arco: \"+this.id+\" Dato: \"+String.valueOf(this.Dato)+\" Peso: \"+String.valueOf(this.p)+\" Extremo Inicial: \"+this.Vi.id+\" Extremo Final: \"+this.Vf.id;\r\n }", "public String getRecordText();", "public String getRecordText();", "String getToText();", "private void yas(){\n System.out.println(namn);\n \n try{\n String fraga = \"SELECT TEXT FROM INLAGG WHERE RUBRIK = 'Borttappad strumpa'\";\n String XD = db.fetchSingle(fraga);\n System.out.println(XD);\n txtInlagg.append(XD);\n }\n catch(InfException e){\n JOptionPane.showMessageDialog(null, \"Kunde ej hämta inlägg\");\n }\n }", "@Override\n\tpublic String insertStatement() throws Exception {\n\t\treturn null;\n\t}", "String getFormattedString(IRenamable f);", "public static String getDadoFormatado(String pDado, TiposDadosQuery pTipo) {\n String dadoFormatado;\n if (pDado != null) {\n switch (pTipo)\n {\n case TEXTO:\n dadoFormatado = \"'\" + verificaAspaSimples(pDado) + \"'\";\n break;\n case DATA:\n dadoFormatado = \"'\" + pDado + \"'\";\n break;\n default:\n dadoFormatado = pDado; \n break;\n }\n }\n else {\n dadoFormatado = \"null\";\n }\n \n return dadoFormatado;\n \n }", "public abstract String valueAsText();", "String getInsertStatement(\r\n TypedKeyValue<List<String>, List<String>> fieldsAndValues,\r\n String tableName);", "public String loopDBInfo(ResultSet rs){\n String p = \"\";\n try{\n while (rs.next()) {\n int id_col = rs.getInt(\"ID\");\n String first_name = rs.getString(\"NAME\");\n String phone = rs.getString(\"PHONE\");\n String status = rs.getString(\"STATUS\");\n String prob = rs.getString(\"PROBLEM\");\n \n \n p = p + (id_col + \" \" + first_name + \" \" + phone + \" \"+ status + \" \"+ prob + \"\\n\"); \n // System.out.println(p);\n }\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n \n } return p;\n }", "@Override\n public String getStringFromDatabase(int objectID) {\n return \"From Class one result\"+objectID;\n }" ]
[ "0.7233016", "0.66461235", "0.6532687", "0.63874143", "0.63174", "0.62672967", "0.62202305", "0.62087464", "0.6204161", "0.61547345", "0.61353797", "0.6082596", "0.5925019", "0.5791024", "0.5734974", "0.5702277", "0.5672253", "0.56627274", "0.5660367", "0.56506246", "0.564931", "0.5626197", "0.56242543", "0.5618237", "0.56068087", "0.56068087", "0.56068087", "0.56068087", "0.56068087", "0.56040955", "0.5582747", "0.55795836", "0.55707884", "0.55396575", "0.55236363", "0.54791754", "0.5472296", "0.5462698", "0.5453227", "0.54472536", "0.5400536", "0.53715086", "0.5368121", "0.53596985", "0.5351287", "0.5345429", "0.5340733", "0.53321636", "0.53272164", "0.53025305", "0.5300957", "0.53008366", "0.5298505", "0.5296775", "0.5290115", "0.5290115", "0.5285319", "0.5278022", "0.5271674", "0.5270699", "0.5266978", "0.52628124", "0.525755", "0.5257466", "0.52541727", "0.5252564", "0.5251364", "0.52467024", "0.5244543", "0.5237503", "0.5221646", "0.5211987", "0.5206899", "0.5205768", "0.5202506", "0.5198234", "0.5189697", "0.51831126", "0.51824445", "0.51734805", "0.5169718", "0.5164501", "0.5163555", "0.51619434", "0.5158494", "0.51491463", "0.51469153", "0.514507", "0.5137678", "0.51371235", "0.51257396", "0.51257396", "0.5119635", "0.5117046", "0.51147455", "0.51139927", "0.5112402", "0.5110973", "0.5103027", "0.5093027", "0.509231" ]
0.0
-1
Convert formal type name for an array (i.e. java.lang.Object[] to the jni format (i.e. [Ljava.lang.Object;) This is used when a name is passed in from the IDE side. The VM side uses the jni format, and all of proxy uses the jni format.
public static String getJNIFormatName(String classname) { if (classname.length() == 0 || !classname.endsWith("]")) //$NON-NLS-1$ return classname; // Not an array,or invalid StringBuffer jni = new StringBuffer(classname.length()); int firstOpenBracket = classname.indexOf('['); int ob = firstOpenBracket; while (ob > -1) { int cb = classname.indexOf(']', ob); if (cb == -1) break; jni.append('['); ob = classname.indexOf('[', cb); } String finalType = classname.substring(0, firstOpenBracket).trim(); if (finalType != null) { String shortSig = (String) MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(finalType); if (shortSig == null) { jni.append('L'); jni.append(finalType); jni.append(';'); } else { jni.append(shortSig); } } return jni.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getFormalTypeName(String jniName) {\n \t\tif (jniName.charAt(0) == '[') {\n \t\t\t// It is an array\n \t\t\tint dims = jniName.lastIndexOf('[')+1;\t// Number of dimensions\n \t\t\tint startType = dims;\n \t\t\tStringBuffer fName = new StringBuffer(jniName.length()+(2*dims)); \n\t\t\tif (jniName.charAt(startType) == 'L')\n\t\t\t\tfName.append(jniName.substring(startType+1, jniName.length()-1));\t// For \"[Ljava.lang.String;\" return \"java.lang.String\"\n \t\t\telse if (jniName.length() == startType+1) {\n \t\t\t\t// Possible primitive\n \t\t\t\tClass type = (Class) MAP_SHORTSIG_TO_TYPE.get(jniName.substring(startType, startType+1));\n \t\t\t\tif (type != null) {\n \t\t\t\t\tfName.append(type.getName());\n \t\t\t\t} else\n \t\t\t\t\treturn \"\";\t// Invalid if no 'L' and not a primitive. //$NON-NLS-1$\n \t\t\t} else\n \t\t\t\treturn \"\";\t// Invalid, must be either a primitive or 'L' type. //$NON-NLS-1$\n \t\t\twhile(dims-- > 0) {\n \t\t\t\tfName.append(\"[]\"); //$NON-NLS-1$\n \t\t\t}\n \t\t\treturn fName.toString();\n \t\t} else if (jniName.length() == 1) {\n \t\t\t// Possible primitive.\n \t\t\tClass type = (Class) MAP_SHORTSIG_TO_TYPE.get(jniName);\n \t\t\tif (type != null) {\n \t\t\t\treturn type.getName();\n \t\t\t}\n \t\t}\n \t\t\n \t\t// If got here then just a name as is.\n \t\treturn jniName;\n \t}", "public String jniTypeName() {\n if (isCompoundTypeWrapper()) {\n // These are sent down as Buffers (e.g., jobject)\n return \"jobject\";\n }\n\n if (isArrayOfCompoundTypeWrappers()) {\n // These are returned as arrays of ByteBuffers (e.g., jobjectArray)\n return \"jobjectArray /* of ByteBuffer */\";\n }\n\n if (clazz == null) {\n return null;\n }\n\n if (isVoid()) {\n return \"void\";\n }\n\n if (isPrimitive()) {\n return \"j\" + clazz.getName();\n }\n\n if (isPrimitiveArray() || isNIOBuffer()) {\n // We now pass primitive arrays and buffers uniformly down to native code as java.lang.Object.\n return \"jobject\";\n }\n\n if (isArray()) {\n if (isStringArray()) {\n return \"jobjectArray /*elements are String*/\";\n }\n\n Class<?> componentType = clazz.getComponentType();\n\n if (isNIOBufferArray()) {\n return \"jobjectArray /*elements are \" + componentType.getName() + \"*/\";\n }\n\n if (componentType.isArray()) {\n // Type is array-of-arrays-of-something\n \n if (componentType.getComponentType().isPrimitive()) {\n // Type is an array-of-arrays-of-primitive \n return \"jobjectArray /* elements are \" + componentType.getComponentType() + \"[]*/\";\n //return \"jobjectArray\";\n } else {\n throw new RuntimeException(\"Multi-dimensional arrays of types that are not primitives or Strings are not supported.\"); \n }\n }\n\n // Some unusual type that we don't handle\n throw new RuntimeException(\"Unexpected and unsupported array type: \\\"\" + this + \"\\\"\");\n }\n\n if (isString()) {\n return \"jstring\";\n }\n\n return \"jobject\";\n }", "@Nonnull\n private static String getJavaClassName( AnyType arrayType ) {\n if( !arrayType.isRefType() ) {\n switch( (ValueType)arrayType ) {\n case bool:\n return \"[Z\";\n case i8:\n return \"[B\";\n case i16:\n return \"[S\";\n case u16:\n return \"[C\";\n case f64:\n return \"[D\";\n case f32:\n return \"[F\";\n case i32:\n return \"[I\";\n case i64:\n return \"[J\";\n case eqref:\n case externref:\n return \"[Ljava.lang.Object;\";\n default:\n throw new WasmException( \"Not supported array type: \" + arrayType, -1 );\n }\n }\n if( arrayType instanceof ArrayType ) {\n return \"[\" + getJavaClassName( ((ArrayType)arrayType).arrayType );\n }\n return \"[L\" + ((StructType)arrayType).getName() + \";\";\n }", "public interface ArrayAccessReplacementMethodNames{\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)B</code> to replace reading from a byte[].\n */\n String byteOrBooleanRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IB)V</code> to replace writing to a byte[].\n */\n String byteOrBooleanWrite();\n\n /**\n * @return the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)C</code> to replace reading from a char[].\n */\n String charRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IC)V</code> to replace writing to a byte[].\n */\n String charWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)D</code> to replace reading from a double[].\n */\n String doubleRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;ID)V</code> to replace writing to a double[].\n */\n String doubleWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)F</code> to replace reading from a float[].\n */\n String floatRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IF)V</code> to replace writing to a float[].\n */\n String floatWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)I</code> to replace reading from a int[].\n */\n String intRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;II)V</code> to replace writing to a int[].\n */\n String intWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)J</code> to replace reading from a long[].\n */\n String longRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IJ)V</code> to replace writing to a long[].\n */\n String longWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)Ljava/lang/Object;</code>\n * to replace reading from a Object[] (or any subclass of object).\n */\n String objectRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;ILjava/lang/Object;)V</code>\n * to replace writing to a Object[] (or any subclass of object).\n */\n String objectWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)S</code> to replace reading from a short[].\n */\n String shortRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IS)V</code> to replace writing to a short[].\n */\n String shortWrite();\n }", "private String prepareType(String smaliType) {\n int arrayDimensions = 0;\n \n String typeWithoutBrackets = smaliType;\n \n while (typeWithoutBrackets.startsWith(\"[\")) {\n arrayDimensions++;\n typeWithoutBrackets = typeWithoutBrackets.substring(1);\n }\n \n if(SmaliNameConverter.isPrimitiveSmaliType(typeWithoutBrackets)) {\n return (typeWithoutBrackets.equals(\"V\")) ? \"\" : smaliType ; \n }\n \n String classOfType = SmaliNameConverter.convertTypeFromSmali(typeWithoutBrackets);\n String packageOfType = SmaliNameConverter.extractPackageNameFromClassName(classOfType);\n\n StringBuilder type = new StringBuilder();\n\n for(int i = 0; i < arrayDimensions; i++) {\n type.append(\"[\");\n }\n\n boolean isCurrentClassObject = (classOfType.equals(currentClassType)); \n boolean isInternalObject = (packageOfType.equals(currentPackage)); \n \n char typeChar = isCurrentClassObject? 'T' : \n isInternalObject? 'O' : 'E' ;\n \n type.append(typeChar);\n\n return type.toString();\n }", "public native java.lang.String[] __StringArrayMethod( long __swiftObject, java.lang.String[] arg );", "private String getNativeNameForJavaType(TypeName typeName) {\n\n if (isNumber(typeName)) {\n return \"Number\";\n } else if (isBoolean(typeName)) {\n return \"Boolean\";\n } else if (isString(typeName)) {\n return \"String\";\n } else if (isArray(typeName)) {\n return \"Array\";\n } else {\n return \"Object\";\n }\n }", "public String visit(ArrayType n, String argu) {\n return \"ArrayType\"; \n }", "@jdk.Exported\npublic interface ArrayType extends ReferenceType {\n\n /**\n * Creates a new instance of this array class in the target VM.\n * The array is created with the given length and each component\n * is initialized to is standard default value.\n *\n * @param length the number of components in the new array\n * @return the newly created {@link ArrayReference} mirroring\n * the new object in the target VM.\n *\n * @throws VMCannotBeModifiedException if the VirtualMachine is read-only - see {@link VirtualMachine#canBeModified()}.\n */\n ArrayReference newInstance(int length);\n\n /**\n * Gets the JNI signature of the components of this\n * array class. The signature\n * describes the declared type of the components. If the components\n * are objects, their actual type in a particular run-time context\n * may be a subclass of the declared class.\n *\n * @return a string containing the JNI signature of array components.\n */\n String componentSignature();\n\n /**\n * Returns a text representation of the component\n * type of this array.\n *\n * @return a text representation of the component type.\n */\n String componentTypeName();\n\n /**\n * Returns the component type of this array,\n * as specified in the array declaration.\n * <P>\n * Note: The component type of a array will always be\n * created or loaded before the array - see\n * <cite>The Java&trade; Virtual Machine Specification</cite>,\n * section 5.3.3 - Creating Array Classes.\n * However, although the component type will be loaded it may\n * not yet be prepared, in which case the type will be returned\n * but attempts to perform some operations on the returned type\n * (e.g. {@link ReferenceType#fields() fields()}) will throw\n * a {@link ClassNotPreparedException}.\n * Use {@link ReferenceType#isPrepared()} to determine if\n * a reference type is prepared.\n *\n * @see Type\n * @see Field#type() Field.type() - for usage examples\n * @return the {@link Type} of this array's components.\n */\n Type componentType() throws ClassNotLoadedException;\n}", "private static final String getArrayTypeName(String typeName) {\n final String arrayTypeName = builtInArrayComponentName2ArrayTypeName.get(typeName);\n return (null == arrayTypeName) ? typeName + ARRAY_TYPE_SUFFIX : arrayTypeName;\n }", "private static String getClassNameAfterWrapperArrayOf(Class<?> clazz) {\n if(clazz.isPrimitive()) {\n String baseTypeDescriptor = DescriptorUtils.primitiveClass2BaseTypeDescriptor(clazz);\n return \"[\" + baseTypeDescriptor;\n } else if(clazz.isArray()) {\n return \"[\" + clazz.getName();\n } else {\n // normal object\n return \"[L\" + clazz.getName() + \";\";\n }\n }", "private Object arrayToSPLArray(String name, JSONArray jarr, Type ptype) throws Exception {\n\t\tif(l.isLoggable(TraceLevel.DEBUG)) {\n\t\t\tl.log(TraceLevel.DEBUG, \"Creating Array: \" + name);\n\t\t}\n\t\tCollectionType ctype = (CollectionType) ptype;\n\t\tint cnt=0;\n\t\tString cname = \"List: \" + name;\n\n\t\tswitch(ctype.getElementType().getMetaType()) {\n\t\tcase INT8:\n\t\tcase UINT8: \n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tbyte[] arr= new byte[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Byte)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT16:\n\t\tcase UINT16:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tshort[] arr= new short[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Short)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT32:\n\t\tcase UINT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tint[] arr= new int[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Integer)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase INT64:\n\t\tcase UINT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tlong[] arr= new long[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Long)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase BOOLEAN:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tboolean[] arr= new boolean[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Boolean)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tfloat[] arr= new float[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Float)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tdouble[] arr= new double[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Double)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase USTRING:\n\t\t{\n\t\t\tList<String> lst = new ArrayList<String>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((String)obj);\n\t\t\t}\n\t\t\treturn lst.toArray(new String[lst.size()]);\n\t\t} \n\n\t\tcase BSTRING:\n\t\tcase RSTRING:\n\t\t{\n\t\t\tList<RString> lst = new ArrayList<RString>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((RString)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase TUPLE:\n\t\t{\n\t\t\tList<Tuple> lst = new ArrayList<Tuple>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Tuple)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase LIST:\n\t\tcase BLIST:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase SET:\n\t\tcase BSET:\n\t\t{\n\t\t\tSet<Object> lst = new HashSet<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase DECIMAL32:\n\t\tcase DECIMAL64:\n\t\tcase DECIMAL128:\n\t\t{\n\t\t\tList<BigDecimal> lst = new ArrayList<BigDecimal>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((BigDecimal)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase TIMESTAMP:\n\t\t{\n\t\t\tList<Timestamp> lst = new ArrayList<Timestamp>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Timestamp)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\n\t\t//TODO -- not yet supported types\n\t\tcase BLOB:\n\t\tcase MAP:\n\t\tcase BMAP:\n\t\tcase COMPLEX32:\n\t\tcase COMPLEX64:\n\t\tdefault:\n\t\t\tthrow new Exception(\"Unhandled array type: \" + ctype.getElementType().getMetaType());\n\t\t}\n\n\t}", "JAVATYPE [] convertArray(JAVATYPE [] oldArray, final METATYPE meta);", "HRESULT SafeArrayGetVartype(SAFEARRAY psa, VARTYPEByReference pvt);", "public static String toJavaType( String type ) {\n StringBuffer nat = new StringBuffer( 30 );\n int arraydim = 0;\n while ( type.charAt( arraydim ) == '[' ) arraydim++;\n type = type.substring( arraydim );\n switch ( type.charAt( 0 ) ) {\n default:\n throw new IllegalArgumentException( \"unknown native type:\" + type );\n case 'B':\n nat.append( \"byte\" );\n break;\n case 'C':\n nat.append( \"char\" );\n break;\n case 'D':\n nat.append( \"double\" );\n break;\n case 'F':\n nat.append( \"float\" );\n break;\n case 'I':\n nat.append( \"int\" );\n break;\n case 'J':\n nat.append( \"long\" );\n break;\n case 'S':\n nat.append( \"short\" );\n break;\n case 'Z':\n nat.append( \"boolean\" );\n break;\n case 'V':\n nat.append( \"void\" );\n break;\n case 'L':\n String className = type.substring( 1, type.length() - 1 );\n if ( className.indexOf( '<' ) >= 0 ) {\n String parameters = type.substring( className.indexOf( '<' ) + 2, className.lastIndexOf( '>' ) - 1 );\n className = className.substring( 0, className.indexOf( '<' ) );\n nat.append( className.replace( '/', '.' ) );\n nat.append( '<' );\n nat.append( toJavaParameters( parameters ) );\n nat.append( '>' );\n } else {\n nat.append( className.replace( '/', '.' ) );\n }\n break;\n }\n for ( int i = 0; i < arraydim; i++ ) {\n nat.append( \"[]\" );\n }\n return nat.toString();\n }", "char[][] getTypeParameterNames();", "public static final String verboseToNativeType( String type ) {\n\n if ( type == \"\" ) return null;\n\n Pattern p = Pattern.compile( \"\\\\s*\\\\[\\\\s*\\\\]\\\\s*\" );\n Matcher m = p.matcher( type );\n\n int arrayDim = 0;\n while ( m.find() ) {\n arrayDim++;\n }\n\n return toNativeType( type.substring( 0, type.length()-(arrayDim*2)), arrayDim );\n }", "public native java.lang.String[][] __String2dArrayMethod( long __swiftObject, java.lang.String[][] arg );", "static String[] getAllTypeNames()\n\t{\n\t\treturn new String[] {\"String\", \"int\", \"double\", \"long\", \"boolean\", \"String[]\", \"int[]\", \"double[]\", \"long[]\"};\n\t}", "@Override\n public String getTypeName(String name) {\n boolean isArray = true;\n if (name.startsWith(\"$\")) {\n isArray = false;\n name = name.substring(1);\n }\n int col = Util.findColumn(model, name);\n if (col == -1) {\n return null;\n }\n\n if (!isArray && Number.class.isAssignableFrom(model.getColumnClass(col))) {\n return \"Number\";\n }\n if (isArray && Number.class.isAssignableFrom(model.getColumnClass(col))) {\n return \"NumberArray\";\n }\n if (!isArray && model.getColumnClass(col) == String.class) {\n return \"String\";\n }\n if (isArray && model.getColumnClass(col) == String.class) {\n return \"StringArray\";\n }\n return null;\n }", "public static final String[] toNativeMethod( String javaMethod ) {\n StringTokenizer tokenizer = new StringTokenizer( javaMethod, \"(,[]) \", true );\n String tmp = tokenizer.nextToken();\n ;\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n String returnType = tmp;\n tmp = tokenizer.nextToken();\n int retarraydim = 0;\n while ( tmp.equals( \"[\" ) ) {\n tmp = tokenizer.nextToken();\n if ( !tmp.equals( \"]\" ) ) throw new IllegalArgumentException( \"']' expected but found \" + tmp );\n retarraydim++;\n tmp = tokenizer.nextToken();\n }\n if ( tmp.trim().length() != 0 ) {\n throw new IllegalArgumentException( \"space expected but found \" + tmp );\n }\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n String name = tmp;\n StringBuffer nativeMethod = new StringBuffer( 30 );\n nativeMethod.append( '(' );\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n if ( !tmp.equals( \"(\" ) ) throw new IllegalArgumentException( \"'(' expected but found \" + tmp );\n tmp = tokenizer.nextToken();\n while ( !tmp.equals( \")\" ) ) {\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n String type = tmp;\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n int arraydim = 0;\n while ( tmp.equals( \"[\" ) ) {\n tmp = tokenizer.nextToken();\n if ( !tmp.equals( \"]\" ) ) throw new IllegalArgumentException( \"']' expected but found \" + tmp );\n arraydim++;\n tmp = tokenizer.nextToken();\n }\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n\n nativeMethod.append( toNativeType( type, arraydim ) );\n if ( tmp.equals( \",\" ) ) {\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n continue;\n }\n }\n nativeMethod.append( ')' );\n nativeMethod.append( toNativeType( returnType, retarraydim ) );\n String[] result = new String[]{ name, nativeMethod.toString() };\n return result;\n }", "public String getName(){\n\t\treturn arr.getClass().getSimpleName();\n\t}", "public native JsArrayString getTypes()/*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\treturn jso.types;\n }-*/;", "public static String name2desc(String name)\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint c = 0,index = name.indexOf('[');\n\t\tif( index > 0 )\n\t\t{\n\t\t\tc = ( name.length() - index ) / 2;\n\t\t\tname = name.substring(0,index);\n\t\t}\n\t\t\n\t\tfor( ; c-- > 0; )\n\t\t{\n\t\t\tsb.append(\"[\");\n\t\t}\n\t\t\n\t\tif( \"void\".equals(name) )\n\t\t{\n\t\t\tsb.append(JVM_VOID);\n\t\t}\n\t\telse if( \"boolean\".equals(name) )\n\t\t{\n\t\t\tsb.append(JVM_BOOLEAN);\n\t\t}\n\t\telse if( \"byte\".equals(name) )\n\t\t{\n\t\t\tsb.append(JVM_BYTE);\n\t\t}\n\t\telse if( \"char\".equals(name) )\n\t\t{\n\t\t\tsb.append(JVM_CHAR);\n\t\t}\n\t\telse if( \"double\".equals(name) )\n\t\t{\n\t\t\tsb.append(JVM_DOUBLE);\n\t\t}\n\t\telse if( \"float\".equals(name) )\n\t\t{\n\t\t\tsb.append(JVM_FLOAT);\n\t\t}\n\t\telse if( \"int\".equals(name) )\n\t\t{\n\t\t\tsb.append(JVM_INT);\n\t\t}\n\t\telse if( \"long\".equals(name) )\n\t\t{\n\t\t\tsb.append(JVM_LONG);\n\t\t}\n\t\telse if( \"short\".equals(name) )\n\t\t{\n\t\t\tsb.append(JVM_SHORT);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsb.append('L');\n\t\t\tsb.append(name.replace('.', '/'));\n\t\t\tsb.append(';');\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\t}", "@Test public void getBaseTypeNameShouldReturnCorrectType() throws SQLException {\n\t\tList<Object> list = new ArrayList<>();\n\t\tArray array = new ListArray(list, Types.VARCHAR);\n\t\tassertEquals(\"VARCHAR\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.INTEGER);\n\t\tassertEquals(\"INTEGER\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.DOUBLE);\n\t\tassertEquals(\"DOUBLE\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.BOOLEAN);\n\t\tassertEquals(\"BOOLEAN\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.JAVA_OBJECT);\n\t\tassertEquals(\"JAVA_OBJECT\", array.getBaseTypeName());\n\t}", "void mo3807a(C0985po[] poVarArr);", "@Override\n public String visit(ArrayType n, Object arg) {\n return null;\n }", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSGeneralNameType getGeneralNameArray(int i);", "public native String passingDataToJni(float[] audio_data, int array_length);", "public static String formatNameForClassLoading(String name) {\n if (name == null) {\n return \"java.lang.Object;\";\n }\n\n if (name.equals(\"int\")\n || name.equals(\"long\")\n || name.equals(\"short\")\n || name.equals(\"float\")\n || name.equals(\"double\")\n || name.equals(\"byte\")\n || name.equals(\"char\")\n || name.equals(\"boolean\")\n || name.equals(\"void\")\n ) {\n return name;\n }\n\n if (name.startsWith(\"[\")) {\n return name.replace('/', '.');\n }\n\n if (name.startsWith(\"L\")) {\n name = name.substring(1);\n if (name.endsWith(\";\")) {\n name = name.substring(0, name.length() - 1);\n }\n return name.replace('/', '.');\n }\n\n String prefix = \"\";\n if (name.endsWith(\"[]\")) { // todo need process multi\n prefix = \"[\";\n name = name.substring(0, name.length() - 2);\n if (name.equals(\"int\")) {\n return prefix + \"I\";\n } else if (name.equals(\"long\")) {\n return prefix + \"J\";\n } else if (name.equals(\"short\")) {\n return prefix + \"S\";\n } else if (name.equals(\"float\")) {\n return prefix + \"F\";\n } else if (name.equals(\"double\")) {\n return prefix + \"D\";\n } else if (name.equals(\"byte\")) {\n return prefix + \"B\";\n } else if (name.equals(\"char\")) {\n return prefix + \"C\";\n } else if (name.equals(\"boolean\")) {\n return prefix + \"Z\";\n } else {\n return prefix + \"L\" + name.replace('/', '.') + \";\";\n }\n }\n return name.replace('/', '.');\n\n }", "static private PowerlessArray<String>\n types(final Class<?> actual) {\n final Class<?> end =\n Struct.class.isAssignableFrom(actual) ? Struct.class : Object.class;\n final PowerlessArray.Builder<String> r = PowerlessArray.builder(4);\n for (Class<?> i=actual; end!=i; i=i.getSuperclass()) { ifaces(i, r); }\n return r.snapshot();\n }", "private static void improveArrayMethodTyping(Method m, TypeReference arrayTypeParameter) {\n checkState(\"Array\".equals(m.getEnclosingType().getNativeFqn()));\n checkState(m.getParameters().size() == 1);\n Parameter firstParameter = m.getParameters().get(0);\n checkState(PredefinedTypeReference.OBJECT.equals(firstParameter.getType()));\n m.getParameters()\n .set(0, firstParameter.toBuilder().setName(\"items\").setType(arrayTypeParameter).build());\n }", "public String getClassName(){\r\n\t\treturn \"ValueArray\";\r\n\t}", "private String resolveRawTypeName(String typeName) {\n\t\tif (typeName == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tboolean isArray = typeName.startsWith(StringPool.LEFT_SQ_BRACKET);\n\t\tif (isArray) {\n\t\t\ttypeName = typeName.substring(1);\n\t\t}\n\n\t\tString rawTypeName;\n\n\t\tif (generics.containsKey(typeName)) {\n\t\t\trawTypeName = generics.get(typeName);\n\t\t}\n\t\telse {\n\t\t\trawTypeName = targetClassInfo.getGenerics().getOrDefault(typeName, typeName);\n\t\t}\n\n\t\tif (isArray) {\n\t\t\trawTypeName = '[' + rawTypeName;\n\t\t}\n\n\t\treturn rawTypeName;\n\t}", "public static String getWrapperCommentArgument(String argType) {\n String replacedArgType = argType.replace(\"[]\", \"\");\n\n if (argType.equals(\"Object\"))\n return \"_java_lang_Object\";\n else if (Advisor.isNativeType(argType))\n return \"_\" + argType;\n else if (argType.equals(\"String\"))\n return \"_java_lang_String\";\n else if (argType.contains(\"String\") && argType.contains(\"[][]\"))\n return \"_java_lang_String_2ARRAY\";\n else if (argType.contains(\"String\") && argType.contains(\"[]\"))\n return \"_java_lang_String_1ARRAY\";\n else if (Advisor.isNativeType(replacedArgType) && argType.contains(\"[][]\"))\n return \"_\" + replacedArgType + \"_2ARRAY\";\n else if (Advisor.isNativeType(replacedArgType) && argType.contains(\"[]\"))\n return \"_\" + replacedArgType + \"_1ARRAY\";\n else if (CStruct.isStruct(argType))\n return \"_\" + COut.packageName + argType;\n else if (argType.equals(\"List\"))\n return \"_java_util_List\";\n else if (argType.equals(\"Map\"))\n return \"_java_util_Map\";\n else if (argType.equals(\"Set\"))\n return \"_java_util_Set\";\n else if (argType.matches(\"Class<.*>\"))\n return \"_java_lang_Class\";\n else if (CMethodHelper.isDoublePointer(argType))\n return \"_\" + COut.packageName + argType.substring(0, argType.indexOf(\"<\"));\n else if (!argType.contains(\"[]\") || !argType.contains(\"...\"))\n return \"_\" + COut.packageName + argType;\n else\n return null;\n }", "public String visit(ArrayLookup n, Object argu) \n\t{\n\t\tString _ret=null;\n\t String e0 = n.f0.accept(this, argu);\n\t String e1 = n.f2.accept(this, argu);\n\t \n\t if (e0.equals(\"int[]\") && e1.equals(\"int\"))\n\t {\n\t \t_ret = \"int\";\n\t }\n\t return _ret;\n\t}", "public Object invokeArrayArgs(String name, Object[] argsArray) throws Exception;", "public String visit(IntegerArrayType n, LLVMRedux argu) {\n return \"i32*\";\n }", "private static void mapArgumentsToJava(Object[] args) {\n if (null != args) {\n for (int a = 0; a < args.length; a++) {\n args[a] = mapValueToJava(args[a]);\n }\n }\n }", "public native char[] __charArrayMethod( long __swiftObject, char[] arg );", "protected static String translateObject(EditorDataType type, String value)\r\n\t{\r\n\t\tif (type.isArrayType())\r\n\t\t\treturn \"New \" + EditorLanguage.VB.getName(type) + EditorLanguage.VB.fixLiteral(value, type);\r\n\t\telse\r\n\t\t\treturn EditorLanguage.VB.fixLiteral(value, type);\r\n\t}", "public static ClassReference arrayFromName(String name, int dimension) {\n\t\treturn new ClassReference(Primitive.REFERENCE, name.replace('/', '.'), dimension);\n\t}", "public native float[] __floatArrayMethod( long __swiftObject, float[] arg );", "public static String getJNITypeName(String finalComponent, int dimensions) {\n \t\tStringBuffer jni = new StringBuffer(finalComponent.length()+dimensions+2);\n \t\twhile (dimensions-- > 0) {\n \t\t\tjni.append('[');\n \t\t}\n \t\t\n \t\tString shortSig = (String) MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(finalComponent);\n \t\tif (shortSig == null) {\n \t\t\tjni.append('L');\n \t\t\tjni.append(finalComponent);\n \t\t\tjni.append(';');\n \t\t} else {\n \t\t\tjni.append(shortSig);\n \t\t}\n \t\t\n \t\treturn jni.toString();\n \t}", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSGeneralNameType[] getGeneralNameArray();", "char[][] getInterfaceNames();", "public Object[] toRawArray();", "Datatype[] internalize(Datatype[] args) throws CCAException;", "public native com.johnholdsworth.swiftbindings.SwiftHelloTest.TestListener[][] __TestListener2dArrayMethod( long __swiftObject, com.johnholdsworth.swiftbindings.SwiftHelloTest.TestListener[][] arg );", "public native short[] __shortArrayMethod( long __swiftObject, short[] arg );", "public String visit(ArrayAllocationExpression n, Object argu) \n\t{\n\t\tString _ret=null;\n\t\t\n\t if (n.f3.accept(this, argu).equals(\"int\"))\n\t {\n\t \t_ret = \"int[]\";\n\t }\n\n\t return _ret;\n\t}", "public interface NativeStringArray extends CanBeNativeCapableArray\n{\n /**\n * Returns the String element at the specified index synchronized \n * with the native memory if instance is native.\n * <p>\n * Current implementation is:\n * <blockquote><code>\n * return (String)getObject(index);\n * </code></blockquote>\n *\n * @param index the zero-based index of the element.\n * @return the String element at the specified index.\n * @see NativeArray#getElement(int)\n */ \n public String getString(int index);\n \n /**\n * Sets the String element at the specified index synchronizing\n * the native memory with the new value if instance is native.\n * <p>\n * Current implementation is:\n * <blockquote><code>\n * setObject(index,value);\n * </code></blockquote>\n *\n * @param index the zero-based index of the element.\n * @param value the new value.\n */ \n public void setString(int index,String value);\n \n /**\n * Returns the internal String array synchronized \n * with the native memory if instance is native.\n * <p>\n * Current implementation is:\n * <blockquote><code>\n * return (String[])getObjectArray();\n * </code></blockquote>\n *\n * @return the internal String array.\n * @see NativeObjectArray#getObjectArray()\n */ \n public String[] getStringArray();\n \n /**\n * Sets the internal String array synchronizing\n * the native memory with the new value if instance is native.\n * <p>\n * Current implementation is:\n * <blockquote><code>\n * setObjectArray(value);\n * </code></blockquote>\n *\n * @param value the new array value.\n * @see NativeObjectArray#setObjectArray(Object[])\n */ \n public void setStringArray(String[] value);\n}", "@Override\n public Content visitArray(ArrayType type, LinkInfo linkInfo) {\n currentDepth++;\n linkInfo.type = type.getComponentType();\n visit(linkInfo.type, linkInfo);\n currentDepth--;\n if (utils.isAnnotated(type)) {\n linkInfo.type = type;\n link.add(\" \");\n link.add(getTypeAnnotationLinks(linkInfo));\n }\n // use vararg if required\n if (linkInfo.isVarArg && currentDepth == 0) {\n link.add(\"...\");\n } else {\n link.add(\"[]\");\n }\n return link;\n }", "void setGeneralNameArray(org.apache.geronimo.corba.xbeans.csiv2.tss.TSSGeneralNameType[] generalNameArray);", "static public TypeRef[] getTypeRefArray(ExecInterface pInterface) {\n\t\t\tTypeRef[] TRefs = new TypeRef[pInterface.getParamCount()];\n\t\t\tfor(int i = pInterface.getParamCount(); --i >= 0; ) { TRefs[i] = pInterface.getParamTypeRef(i); }\n\t\t\treturn TRefs;\n\t\t}", "void visitArray(Object array, Type componentType);", "public native com.johnholdsworth.swiftbindings.SwiftHelloTest.TestListener[] __TestListenerArrayMethod( long __swiftObject, com.johnholdsworth.swiftbindings.SwiftHelloTest.TestListener[] arg );", "private static String classArrayToString(Class[] pts) {\n StringBuilder result = new StringBuilder();\n for (int i = 0; i < pts.length; i++) {\n result.append(getTypeName(pts[i]));\n if (i < pts.length - 1)\n result.append(\",\");\n }\n return result.toString();\n }", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSGssExportedNameType getGssExportedNameArray(int i);", "public /* bridge */ /* synthetic */ java.lang.Object[] newArray(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.telephony.SmsCbCmasInfo.1.newArray(int):java.lang.Object[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telephony.SmsCbCmasInfo.1.newArray(int):java.lang.Object[]\");\n }", "public static String getJavaDatatype(Object object){\n\t\treturn object.getClass().toString().split(\" \")[1]; \n\t}", "@Override\r\n\t\tpublic Array createArrayOf(String typeName, Object[] elements)\r\n\t\t\t\tthrows SQLException {\n\t\t\treturn null;\r\n\t\t}", "private String arrayToString(TOP fsIn, int arrayType) throws SAXException {\n if (fsIn == null) {\n return null;\n }\n\n StringBuilder buf = new StringBuilder();\n CommonArrayFS fs = (CommonArrayFS) fsIn;\n String elemStr = null;\n\n // FS arrays: handle shared data items\n if (fs instanceof FSArray) {\n List<XmiArrayElement> ootsArrayElementsList = cds.sharedData == null ? null\n : cds.sharedData.getOutOfTypeSystemArrayElements((FSArray) fs);\n int ootsIndex = 0;\n\n int j = -1;\n for (TOP elemFS : ((FSArray) fs)._getTheArray()) {\n j++;\n if (elemFS == null) { // null case\n // special NULL object with xmi:id=0 is used to represent\n // a null in an FSArray\n elemStr = \"0\";\n // However, this null array element might have been a reference to an\n // out-of-typesystem FS, so check the ootsArrayElementsList\n if (ootsArrayElementsList != null) {\n\n while (ootsIndex < ootsArrayElementsList.size()) {\n XmiArrayElement arel = ootsArrayElementsList.get(ootsIndex++);\n if (arel.index == j) {\n elemStr = arel.xmiId;\n break;\n }\n }\n }\n\n } else { // not null\n String xmiId = cds.getXmiId(elemFS);\n if (cds.isFiltering) { // return as null any references to types not in target TS\n String typeName = elemFS._getTypeImpl().getName();\n if (cds.filterTypeSystem_inner.getType(typeName) == null) {\n xmiId = \"0\";\n }\n }\n elemStr = xmiId;\n }\n\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(elemStr);\n } // end of loop over FS Array elements\n\n return buf.toString();\n\n } else if (fs instanceof ByteArray) {\n\n // special case for byte arrays: serialize as hex digits\n byte[] ba = ((ByteArray) fs)._getTheArray();\n\n char[] r = new char[ba.length * 2];\n\n int i = 0;\n for (byte b : ba) {\n r[i++] = INT_TO_HEX[(b & 0xF0) >>> 4];\n r[i++] = INT_TO_HEX[b & 0x0F];\n }\n return new String(r);\n } else {\n // is not FSarray, is not ByteArray, is not String Array\n // CommonArrayFS fs;\n // String[] fsvalues;\n //\n // switch (arrayType) {\n // case LowLevelCAS.TYPE_CLASS_INTARRAY:\n // fs = new IntArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_FLOATARRAY:\n // fs = new FloatArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BOOLEANARRAY:\n // fs = new BooleanArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_SHORTARRAY:\n // fs = new ShortArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_LONGARRAY:\n // fs = new LongArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_DOUBLEARRAY:\n // fs = new DoubleArrayFSImpl(addr, cds.cas);\n // break;\n // case LowLevelCAS.TYPE_CLASS_BYTEARRAY:\n // fs = new ByteArrayFSImpl(addr, cds.cas);\n // break;\n // default: {\n // return \"\";\n // }\n // }\n\n // if (arrayType == LowLevelCAS.TYPE_CLASS_STRINGARRAY) { // this method never called for\n // StringArrays\n // StringArrayFS strFS = new StringArrayFSImpl(addr, cds.cas);\n // fsvalues = strFS.toArray();\n // } else {\n String[] fsvalues = fs.toStringArray();\n // }\n\n for (String s : fsvalues) {\n if (buf.length() > 0) {\n buf.append(' ');\n }\n buf.append(s);\n }\n return buf.toString();\n }\n }", "public void putArray(String str, A1e a1e) {\n boolean z;\n if (a1e != null) {\n z = false;\n }\n z = true;\n AnonymousClass0FY.A03(z, \"Illegal type provided\");\n putNativeArray(str, (WritableNativeArray) a1e);\n }", "public void setReturnTypeName(char[] name) {\n returnTypeName = name;\n }", "public String visit(ArrayLength n, Object argu) \n\t{\n\t\tString _ret=null;\n\t String e0 = n.f0.accept(this, argu);\n\t \n\t if (e0.equals(\"int[]\"))\n\t {\n\t \t_ret = \"int\";\n\t }\n\t return _ret;\n\t}", "public Object toBean(Object[] array) throws ManagedTypeException, MissingMarkerNameException {\n\n String typeMarker = String.valueOf(array[0]);\n Class aClass = managedTypes.get(typeMarker);\n\n if (aClass == null) {\n throw new ManagedTypeException();\n } else {\n return toBean(aClass, array);\n }\n }", "public native double[] __doubleArrayMethod( long __swiftObject, double[] arg );", "private native int getIndexType(long cObject);", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "private String[] buildTypeRegistrations(String[] baseKeys, boolean noSQLrecurse) {\n\t\tClassLoaderService cls = registry.getService(ClassLoaderService.class);\n\t\tArrayList<String> keys = new ArrayList<>( baseKeys.length << 1 );\n\t\tfor ( String bk : baseKeys ) {\n\t\t\tString className;\n\t\t\tboolean addSQL = true;\n\t\t\ttry {\n\t\t\t\tClass c;\n\t\t\t\tswitch ( bk ) {\n\t\t\t\t\tcase \"boolean\":\n\t\t\t\t\t\tc = boolean.class;\n\t\t\t\t\t\tclassName = \"Z\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"byte\":\n\t\t\t\t\t\tc = byte.class;\n\t\t\t\t\t\tclassName = \"B\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"char\":\n\t\t\t\t\t\tc = char.class;\n\t\t\t\t\t\tclassName = \"C\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\t\tc = double.class;\n\t\t\t\t\t\tclassName = \"D\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"float\":\n\t\t\t\t\t\tc = float.class;\n\t\t\t\t\t\tclassName = \"F\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"int\":\n\t\t\t\t\t\tc = int.class;\n\t\t\t\t\t\tclassName = \"I\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"long\":\n\t\t\t\t\t\tc = long.class;\n\t\t\t\t\t\tclassName = \"J\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"short\":\n\t\t\t\t\t\tc = short.class;\n\t\t\t\t\t\tclassName = \"S\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// load to make sure it exists\n\t\t\t\t\t\tc = cls.classForName( bk );\n\t\t\t\t\t\tclassName = c.getName();\n\t\t\t\t\t\taddSQL = false;\n\t\t\t\t}\n\t\t\t\tif ( c.isPrimitive() ) {\n\t\t\t\t\t// disallow. \n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( c.isArray() ) {\n\t\t\t\t\tkeys.add( \"[\" + className );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tkeys.add( \"[L\" + className + \";\" );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch ( ClassLoadingException ex ) {\n\t\t\t\t// just ignore. It means we won't be adding that key\n\t\t\t}\n\t\t\tif ( addSQL ) {\n\t\t\t\t// Not all type names given are Java classes, so assume the others are Database types\n\t\t\t\tif ( noSQLrecurse ) {\n\t\t\t\t\t// type is just \"basetype ARRAY\", never \"basetype ARRAY ARRAY ARRAY\"\n\t\t\t\t\tkeys.add( bk );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// PostgreSQL type names\n\t\t\t\t\tkeys.add( bk + \"[]\" );\n\t\t\t\t\t// standard SQL\n\t\t\t\t\tkeys.add( bk + \" ARRAY\" );\n\t\t\t\t\t// also possible\n\t\t\t\t\tkeys.add( bk + \" array\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn keys.toArray( new String[keys.size()] );\n\t}", "public PyObject[] convertArgs2Python(final Object... args) {\n\t\tfinal PyObject[] convertedArgs = new PyObject[args.length];\n\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tconvertedArgs[i] = Py.java2py(args[i]);\n\t\t}\n\n\t\treturn convertedArgs;\n\t}", "public abstract CallAdapter<?, ?> mo38628a(Type type, Annotation[] annotationArr, C13430i iVar);", "public native char[][] __char2dArrayMethod( long __swiftObject, char[][] arg );", "void decodeObjectArray();", "public void setArrayType(String arrayType) {\n this.arrayType = arrayType;\n }", "public native int[] __intArrayMethod( long __swiftObject, int[] arg );", "private final <T> Object parseTypeArr(Converter<T> converter, Class<T> valType, String[] arr) throws Exception {\n\t\tObject objArr = Array.newInstance(valType, arr.length);\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tT item = converter.parseFromString(valType, null, null, arr[i]);\n\t\t\tArray.set(objArr, i, item);\n\t\t}\n\t\treturn objArr;\n\t}", "public XmlsonArray(String name) {\n\t\tsuper(name);\n\t}", "private static int getType(Class<?>[] type_name) {\n\t\tif (type_name.length==1) {\n\t\t\tif (type_name[0].getName().equalsIgnoreCase(\"boolean\") ||\n\t\t\t\ttype_name[0].getName().equalsIgnoreCase(\"int\") ||\n\t\t\t\ttype_name[0].getName().equalsIgnoreCase(\"double\") ||\n\t\t\t\ttype_name[0].getName().equalsIgnoreCase(\"float\")) \n\t\t\t\treturn 1;\n\t\t\telse if (type_name[0].getName().equalsIgnoreCase(\"java.lang.String\"))\n\t\t\t\treturn 2;\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t} else\n\t\t\treturn 0;\n\t}", "@Override\n public Void visitTypeVariable(TypeVariable t, Void aVoid) {\n reflectClass.setName(t.asElement().getSimpleName().toString());\n return super.visitTypeVariable(t, aVoid);\n }", "public Object convertArgs2Java(final PyObject... args) {\n\t\tObject ret = null;\n\n\t\tif (args.length == 1) {\n\t\t\tret = args[0].__tojava__(Object.class);\n\t\t} else {\n\t\t\tfinal Object[] convertedArgs = new Object[args.length];\n\n\t\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\t\tconvertedArgs[i] = args[i].__tojava__(Object.class);\n\t\t\t}\n\n\t\t\tret = convertedArgs;\n\t\t}\n\n\t\treturn ret;\n\t}", "private String getTypeName(int idx){\r\n String[] types = {\"C-SVC\",\"nu-SVC\",\"one-class SVM\",\"epsilon-SVR\",\"nu-SVR\"};\r\n return types[idx];\r\n }", "@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/lib/IR/Type.cpp\", line = 545,\n FQN=\"llvm::Module::getTypeByName\", NM=\"_ZNK4llvm6Module13getTypeByNameENS_9StringRefE\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/Type.cpp -nm=_ZNK4llvm6Module13getTypeByNameENS_9StringRefE\")\n //</editor-fold>\n public StructType /*P*/ getTypeByName(StringRef Name) /*const*/ {\n return getContext().pImpl.NamedStructTypes.lookup(new StringRef(Name));\n }", "public String[] getDataTypes(T2 ob) {\n\t\tString[] s = null;\t\t\r\n\t\tjava.lang.reflect.Field[] f1=ob.getClass().getDeclaredFields(); \r\n\t\ts=new String[f1.length];\r\n\t\tfor(int i=1;i<f1.length;i++)\r\n\t\t{\r\n\t\tSystem.out.println(f1[i].getType().toString());\t\r\n\t\ts[i]=f1[i].getType().toString();\t\t\r\n\t\t}\t\r\n\t\treturn s;\r\n\t}", "public /* bridge */ /* synthetic */ java.lang.Object[] newArray(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.location.GpsClock.1.newArray(int):java.lang.Object[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.location.GpsClock.1.newArray(int):java.lang.Object[]\");\n }", "public native long[] __longArrayMethod( long __swiftObject, long[] arg );", "void setGeneralNameArray(int i, org.apache.geronimo.corba.xbeans.csiv2.tss.TSSGeneralNameType generalName);", "private static String nativeArrayToJSONString(NativeArray nativeArray) throws Exception \n { \n Object[] propIds = nativeArray.getIds(); \n if (isArray(propIds) == true) \n {\n \tList<String> jsonArray = new ArrayList<String>();\n \tClass typeClass = null;\n for (int i=0; i<propIds.length; i++) \n { \n Object propId = propIds[i]; \n if (propId instanceof Integer) \n { \n Object value = nativeArray.get((Integer)propId, nativeArray);\n Object json = toJson(value);\n jsonArray.add(json+\"\");\n if(typeClass==null) typeClass = json.getClass();\n } \n } \n return HAPUtilityJson.buildArrayJson(jsonArray.toArray(new String[0]), typeClass);\n } \n else \n { \n \tMap<String, String> mapJson = new LinkedHashMap<String, String>();\n \tMap<String, Class<?>> mapTypeJson = new LinkedHashMap<String, Class<?>>();\n for (Object propId : propIds) \n { \n \tString key = propId.toString();\n Object value = nativeArray.get(key, nativeArray);\n Object json = toJson(value);\n mapJson.put(key, json+\"\");\n mapTypeJson.put(key, json.getClass()); \n } \n return HAPUtilityJson.buildMapJson(mapJson, mapTypeJson); \n }\n }", "public entity.APDExposure_Name_L10N getName_L10N_ARRAYByLanguage(com.guidewire.commons.entity.type2.IAssociativeArrayPropertyInfo property);", "public AnyType getNativeArrayType() {\n return nativeArrayType;\n }", "public Class<?>[] getTypes(Object[] input){\n\n Class<?>[] parameters = new Class<?>[input.length];\n for (int i = 0; i < parameters.length; i++){\n if (isNumeric(input[i].toString())){\n parameters[i] = int.class;\n }else{\n parameters[i] = String.class;\n }\n }\n return parameters;\n }", "static public Object[] coerceJavaArray(JSObject arr) throws Exception {\r\n\t\t// actual arrays\r\n\t\tif (arr instanceof JSArray)\r\n\t\t\treturn ((JSArray) arr).toArray();\r\n\t\t// array-like objects\r\n\t\tint len = (int) JSUtils.asNumber(arr.get(\"length\"));\r\n\t\tObject[] out = new Object[len];\r\n\t\tfor (int j = 0; j < len; j++)\r\n\t\t\tout[j] = arr.get(j);\r\n\t\treturn out;\r\n\t}", "public IClass getType() {\n IClass result = null;\n if (_javaMethod.getReturnType().isArray()) {\n result = new ArrayDef(new ExternalClass(_javaMethod.getReturnType().getComponentType()));\n }\n else {\n result = new ExternalClass(_javaMethod.getReturnType());\n }\n\n return result;\n }", "public static JavaType createForCArray(Type elementType) {\n return new JavaType(elementType);\n }", "public native short[][] __short2dArrayMethod( long __swiftObject, short[][] arg );", "public interface IPrimitiveArray extends IArray {\n /**\n * Primitive signatures.\n */\n public static final byte[] SIGNATURES = {\n -1, -1, -1, -1, (byte) 'Z', (byte) 'C', (byte) 'F', (byte) 'D', (byte) 'B', (byte) 'S',\n (byte) 'I', (byte) 'J'\n };\n\n /**\n * Element sizes inside the array.\n */\n public static final int[] ELEMENT_SIZE = { -1, -1, -1, -1, 1, 2, 4, 8, 1, 2, 4, 8 };\n\n /**\n * Display string of the type.\n */\n @SuppressWarnings(\"nls\") public static final String[] TYPE = {\n null, null, null, null, \"boolean[]\", \"char[]\", \"float[]\", \"double[]\", \"byte[]\", \"short[]\",\n \"int[]\", \"long[]\"\n };\n\n /**\n * Java component type of the primitive array.\n */\n public static final Class<?>[] COMPONENT_TYPE = {\n null, null, null, null, boolean.class, char.class, float.class, double.class, byte.class,\n short.class, int.class, long.class\n };\n\n /**\n * Returns the {@link Type} of the primitive array.\n */\n public int getType();\n\n /**\n * Returns the component type of the array.\n */\n public Class<?> getComponentType();\n\n /**\n * Returns the Object at a given index.\n */\n public Object getValueAt(int index);\n\n /**\n * Get the primitive Java array. The return value can be casted into the\n * correct component type, e.g.\n *\n * <pre>\n * if (char.class == array.getComponentType())\n * {\n * char[] content = (char[]) array.getValueArray();\n * System.out.println(content.length);\n * }\n * </pre>\n *\n * The return value must not be modified because it is cached by the heap\n * dump adapter. This method does not return a copy of the array for\n * performance reasons.\n */\n public Object getValueArray();\n\n /**\n * Get the primitive Java array, beginning at <code>offset</code> and\n * <code>length</code> number of elements.\n * <p>\n * The return value must not be modified because it is cached by the heap\n * dump adapter. This method does not return a copy of the array for\n * performance reasons.\n */\n public Object getValueArray(int offset, int length);\n}", "void visitArrayField(FieldAttributes f, Type typeOfF, Object obj);", "@Override\n\tpublic void VisitArrayLiteralNode(BunArrayNode Node) {\n\n\t}", "public boolean isArrayType()\n/* */ {\n/* 138 */ return true;\n/* */ }" ]
[ "0.71666497", "0.67398417", "0.66788006", "0.6390963", "0.6320471", "0.6107335", "0.6027111", "0.5952324", "0.5947285", "0.5914571", "0.581782", "0.5789807", "0.5701808", "0.5689977", "0.5680456", "0.5673143", "0.5630919", "0.56302434", "0.5626407", "0.56204396", "0.5599816", "0.55987304", "0.55358", "0.55155426", "0.5406815", "0.5364473", "0.5337799", "0.5331704", "0.5293127", "0.528683", "0.52516645", "0.52379835", "0.52346593", "0.5214853", "0.5199434", "0.5196607", "0.5178154", "0.5172385", "0.51643443", "0.514593", "0.51382935", "0.5130609", "0.5125162", "0.51059324", "0.51052916", "0.508297", "0.5077382", "0.5060429", "0.5024928", "0.5024925", "0.5010806", "0.5007286", "0.49964952", "0.4990567", "0.4976995", "0.49731416", "0.49533907", "0.49496496", "0.49488848", "0.4941077", "0.49362162", "0.49336708", "0.4931839", "0.4928799", "0.49260095", "0.49054784", "0.48979667", "0.48975408", "0.48775256", "0.4859669", "0.48491767", "0.48482597", "0.48459503", "0.48448378", "0.48423088", "0.48331842", "0.48301387", "0.48297188", "0.48167837", "0.47962984", "0.47908357", "0.4784443", "0.47759888", "0.4772465", "0.47640842", "0.47576725", "0.47522545", "0.47352126", "0.4730711", "0.47267532", "0.47255278", "0.47243556", "0.4722119", "0.47180125", "0.4717817", "0.47121817", "0.47087127", "0.47037935", "0.47014943", "0.46904534" ]
0.62989724
5
This converts from the JNI format to the formal typename.
public static String getFormalTypeName(String jniName) { if (jniName.charAt(0) == '[') { // It is an array int dims = jniName.lastIndexOf('[')+1; // Number of dimensions int startType = dims; StringBuffer fName = new StringBuffer(jniName.length()+(2*dims)); if (jniName.charAt(startType) == 'L') fName.append(jniName.substring(startType+1, jniName.length()-1)); // For "[Ljava.lang.String;" return "java.lang.String" else if (jniName.length() == startType+1) { // Possible primitive Class type = (Class) MAP_SHORTSIG_TO_TYPE.get(jniName.substring(startType, startType+1)); if (type != null) { fName.append(type.getName()); } else return ""; // Invalid if no 'L' and not a primitive. //$NON-NLS-1$ } else return ""; // Invalid, must be either a primitive or 'L' type. //$NON-NLS-1$ while(dims-- > 0) { fName.append("[]"); //$NON-NLS-1$ } return fName.toString(); } else if (jniName.length() == 1) { // Possible primitive. Class type = (Class) MAP_SHORTSIG_TO_TYPE.get(jniName); if (type != null) { return type.getName(); } } // If got here then just a name as is. return jniName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String jniTypeName() {\n if (isCompoundTypeWrapper()) {\n // These are sent down as Buffers (e.g., jobject)\n return \"jobject\";\n }\n\n if (isArrayOfCompoundTypeWrappers()) {\n // These are returned as arrays of ByteBuffers (e.g., jobjectArray)\n return \"jobjectArray /* of ByteBuffer */\";\n }\n\n if (clazz == null) {\n return null;\n }\n\n if (isVoid()) {\n return \"void\";\n }\n\n if (isPrimitive()) {\n return \"j\" + clazz.getName();\n }\n\n if (isPrimitiveArray() || isNIOBuffer()) {\n // We now pass primitive arrays and buffers uniformly down to native code as java.lang.Object.\n return \"jobject\";\n }\n\n if (isArray()) {\n if (isStringArray()) {\n return \"jobjectArray /*elements are String*/\";\n }\n\n Class<?> componentType = clazz.getComponentType();\n\n if (isNIOBufferArray()) {\n return \"jobjectArray /*elements are \" + componentType.getName() + \"*/\";\n }\n\n if (componentType.isArray()) {\n // Type is array-of-arrays-of-something\n \n if (componentType.getComponentType().isPrimitive()) {\n // Type is an array-of-arrays-of-primitive \n return \"jobjectArray /* elements are \" + componentType.getComponentType() + \"[]*/\";\n //return \"jobjectArray\";\n } else {\n throw new RuntimeException(\"Multi-dimensional arrays of types that are not primitives or Strings are not supported.\"); \n }\n }\n\n // Some unusual type that we don't handle\n throw new RuntimeException(\"Unexpected and unsupported array type: \\\"\" + this + \"\\\"\");\n }\n\n if (isString()) {\n return \"jstring\";\n }\n\n return \"jobject\";\n }", "private String getNativeNameForJavaType(TypeName typeName) {\n\n if (isNumber(typeName)) {\n return \"Number\";\n } else if (isBoolean(typeName)) {\n return \"Boolean\";\n } else if (isString(typeName)) {\n return \"String\";\n } else if (isArray(typeName)) {\n return \"Array\";\n } else {\n return \"Object\";\n }\n }", "private String prepareType(String smaliType) {\n int arrayDimensions = 0;\n \n String typeWithoutBrackets = smaliType;\n \n while (typeWithoutBrackets.startsWith(\"[\")) {\n arrayDimensions++;\n typeWithoutBrackets = typeWithoutBrackets.substring(1);\n }\n \n if(SmaliNameConverter.isPrimitiveSmaliType(typeWithoutBrackets)) {\n return (typeWithoutBrackets.equals(\"V\")) ? \"\" : smaliType ; \n }\n \n String classOfType = SmaliNameConverter.convertTypeFromSmali(typeWithoutBrackets);\n String packageOfType = SmaliNameConverter.extractPackageNameFromClassName(classOfType);\n\n StringBuilder type = new StringBuilder();\n\n for(int i = 0; i < arrayDimensions; i++) {\n type.append(\"[\");\n }\n\n boolean isCurrentClassObject = (classOfType.equals(currentClassType)); \n boolean isInternalObject = (packageOfType.equals(currentPackage)); \n \n char typeChar = isCurrentClassObject? 'T' : \n isInternalObject? 'O' : 'E' ;\n \n type.append(typeChar);\n\n return type.toString();\n }", "public static String getJavaDatatype(Object object){\n\t\treturn object.getClass().toString().split(\" \")[1]; \n\t}", "public static String toJavaType( String type ) {\n StringBuffer nat = new StringBuffer( 30 );\n int arraydim = 0;\n while ( type.charAt( arraydim ) == '[' ) arraydim++;\n type = type.substring( arraydim );\n switch ( type.charAt( 0 ) ) {\n default:\n throw new IllegalArgumentException( \"unknown native type:\" + type );\n case 'B':\n nat.append( \"byte\" );\n break;\n case 'C':\n nat.append( \"char\" );\n break;\n case 'D':\n nat.append( \"double\" );\n break;\n case 'F':\n nat.append( \"float\" );\n break;\n case 'I':\n nat.append( \"int\" );\n break;\n case 'J':\n nat.append( \"long\" );\n break;\n case 'S':\n nat.append( \"short\" );\n break;\n case 'Z':\n nat.append( \"boolean\" );\n break;\n case 'V':\n nat.append( \"void\" );\n break;\n case 'L':\n String className = type.substring( 1, type.length() - 1 );\n if ( className.indexOf( '<' ) >= 0 ) {\n String parameters = type.substring( className.indexOf( '<' ) + 2, className.lastIndexOf( '>' ) - 1 );\n className = className.substring( 0, className.indexOf( '<' ) );\n nat.append( className.replace( '/', '.' ) );\n nat.append( '<' );\n nat.append( toJavaParameters( parameters ) );\n nat.append( '>' );\n } else {\n nat.append( className.replace( '/', '.' ) );\n }\n break;\n }\n for ( int i = 0; i < arraydim; i++ ) {\n nat.append( \"[]\" );\n }\n return nat.toString();\n }", "public static String getJNIFormatName(String classname) {\n \t\tif (classname.length() == 0 || !classname.endsWith(\"]\")) //$NON-NLS-1$\n \t\t\treturn classname;\t// Not an array,or invalid\n \t\t\n \t\tStringBuffer jni = new StringBuffer(classname.length());\n \t\tint firstOpenBracket = classname.indexOf('[');\n \t\tint ob = firstOpenBracket;\n \t\twhile (ob > -1) {\n \t\t\tint cb = classname.indexOf(']', ob);\n \t\t\tif (cb == -1)\n \t\t\t\tbreak;\n \t\t\tjni.append('[');\n \t\t\tob = classname.indexOf('[', cb);\n \t\t}\n \t\t\n \t\tString finalType = classname.substring(0, firstOpenBracket).trim();\n \t\tif (finalType != null) {\n \t\t\tString shortSig = (String) MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(finalType);\n \t\t\tif (shortSig == null) {\n \t\t\t\tjni.append('L');\n \t\t\t\tjni.append(finalType);\n \t\t\t\tjni.append(';');\n \t\t\t} else {\n \t\t\t\tjni.append(shortSig);\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn jni.toString();\n \t}", "public static String getJNITypeName(String finalComponent, int dimensions) {\n \t\tStringBuffer jni = new StringBuffer(finalComponent.length()+dimensions+2);\n \t\twhile (dimensions-- > 0) {\n \t\t\tjni.append('[');\n \t\t}\n \t\t\n \t\tString shortSig = (String) MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(finalComponent);\n \t\tif (shortSig == null) {\n \t\t\tjni.append('L');\n \t\t\tjni.append(finalComponent);\n \t\t\tjni.append(';');\n \t\t} else {\n \t\t\tjni.append(shortSig);\n \t\t}\n \t\t\n \t\treturn jni.toString();\n \t}", "@Nonnull\n private static String getJavaClassName( AnyType arrayType ) {\n if( !arrayType.isRefType() ) {\n switch( (ValueType)arrayType ) {\n case bool:\n return \"[Z\";\n case i8:\n return \"[B\";\n case i16:\n return \"[S\";\n case u16:\n return \"[C\";\n case f64:\n return \"[D\";\n case f32:\n return \"[F\";\n case i32:\n return \"[I\";\n case i64:\n return \"[J\";\n case eqref:\n case externref:\n return \"[Ljava.lang.Object;\";\n default:\n throw new WasmException( \"Not supported array type: \" + arrayType, -1 );\n }\n }\n if( arrayType instanceof ArrayType ) {\n return \"[\" + getJavaClassName( ((ArrayType)arrayType).arrayType );\n }\n return \"[L\" + ((StructType)arrayType).getName() + \";\";\n }", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "static String javaWrappedType(int javaType) {\n switch (javaType) {\n case SchemaProperty.JAVA_BOOLEAN:\n return \"java.lang.Boolean\";\n case SchemaProperty.JAVA_FLOAT:\n return \"java.lang.Float\";\n case SchemaProperty.JAVA_DOUBLE:\n return \"java.lang.Double\";\n case SchemaProperty.JAVA_BYTE:\n return \"java.lang.Byte\";\n case SchemaProperty.JAVA_SHORT:\n return \"java.lang.Short\";\n case SchemaProperty.JAVA_INT:\n return \"java.lang.Integer\";\n case SchemaProperty.JAVA_LONG:\n return \"java.lang.Long\";\n\n // anything else is not a java primitive\n default:\n assert false;\n throw new IllegalStateException();\n }\n }", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String type();", "String typeName();", "private String getSqLiteType(Class<?> value){\r\n\t\tString sn = value.getSimpleName();\r\n\t\tif(sn.equalsIgnoreCase(\"String\"))\r\n\t\t\treturn \"text\";\r\n\t\tif(sn.equalsIgnoreCase(\"int\") || sn.equalsIgnoreCase(\"Integer\") || \r\n\t\t sn.equalsIgnoreCase(\"long\") || sn.equalsIgnoreCase(\"Long\") || \r\n\t\t sn.equalsIgnoreCase(\"BigDecimal\")){\r\n\t\t\treturn \"integer\";\r\n\t\t}\r\n\t\tif(sn.equalsIgnoreCase(\"double\") || sn.equalsIgnoreCase(\"Double\") || \r\n\t\t sn.equalsIgnoreCase(\"float\") || sn.equalsIgnoreCase(\"Float\")){\r\n\t\t\treturn \"integer\";\r\n\t\t}\r\n\t\tif(sn.equalsIgnoreCase(\"byte[]\") || sn.equalsIgnoreCase(\"Byte[]\")){\r\n\t\t\treturn \"blob\";\r\n\t\t}\r\n\t\tthrow new NullPointerException(\"type not found \" + sn);\r\n\t}", "Coding getType();", "public static native int GetType(long lpjFbxDataType);", "private String resolveAttrType(String aType){\n\t\tif(aType == \"int\" || aType == \"Int\") return \"int\";\n\t\telse if(aType == \"String\") return \"String\";\n\t\telse if(aType == \"univ\") assertMessage(\"TODO: Map univ with Java type\");\n\t\telse if(aType == \"none\") assertMessage(\"TODO: Map none with Java type\");\n\t\telse if(aType.contains(\"seq\")) assertMessage(\"TODO: Map seqInt with Java type\");\n\n\t\treturn aType;\n\t}", "String getTypeAsString();", "public VarTypeNative getFieldVarType();", "char[][] getTypeParameterNames();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "@Override\r\n\tpublic String typeV() {\n\t\treturn hio.TyreType();\r\n\t}", "private String getTypeName(int idx){\r\n String[] types = {\"C-SVC\",\"nu-SVC\",\"one-class SVM\",\"epsilon-SVR\",\"nu-SVR\"};\r\n return types[idx];\r\n }", "private JavaType(String name) {\n this.name = name;\n }", "public static final String verboseToNativeType( String type ) {\n\n if ( type == \"\" ) return null;\n\n Pattern p = Pattern.compile( \"\\\\s*\\\\[\\\\s*\\\\]\\\\s*\" );\n Matcher m = p.matcher( type );\n\n int arrayDim = 0;\n while ( m.find() ) {\n arrayDim++;\n }\n\n return toNativeType( type.substring( 0, type.length()-(arrayDim*2)), arrayDim );\n }", "private Class<?> resolveBuiltInAttrType(String anAlloyAttrType){\n\t\tif(anAlloyAttrType == \"int\" || anAlloyAttrType == \"Int\") return int.class;\n\t\telse if(anAlloyAttrType == \"String\") return String.class;\n\t\telse if(anAlloyAttrType == \"univ\") assertMessage(\"TODO: Map univ with Java type\");\n\t\telse if(anAlloyAttrType == \"none\") assertMessage(\"TODO: Map none with Java type\");\n\t\telse if(anAlloyAttrType.contains(\"seq\")) assertMessage(\"TODO: Map seqInt with Java type\");\n\t\t\n\t\treturn null;\n\t}", "IJvmTypeReferenceProvider getTypeProvider();", "public static native int getTypeId(long msgArg);", "private static Object getNativeFromString(String type, String text) {\n // could find a way to reuse jna mapping but I didn't managed to :(\n try {\n return stringToNatives.get(type).toNative(text);\n } catch (NullPointerException ex) {\n System.err.println(\"problem with type '\" + type + \"' to interpret '\" + text + \"'\");\n throw ex;\n }\n }", "private static String mapType(final FieldType.Type type) {\n switch (type) {\n case DATE:\n return \"Date\";\n case INTEGER:\n return \"Integer\";\n case REAL:\n return \"Double\";\n case STRING:\n return \"String\";\n default:\n return null;\n }\n }", "public abstract String getTypeName();", "public String getTypeName();", "public String getTypeName();", "public JavaType getType() { return _type; }", "static int type_of_jc(String passed){\n\t\treturn 1;\n\t}", "public abstract String toJavaType(int sqlType);", "public String type();", "public abstract JavaType resolveType(java.lang.reflect.Type jdkType);", "String provideType();", "private String getType( )\n\t{\n\t\treturn this.getModuleName( ) + \"$\" + this.getSimpleName( ) + \"$\" + this.getSystem( );\n\t}", "Class<? extends JavaTypeMapping> getMappingType(String javaTypeName);", "private native int getIndexType(long cObject);", "public IDLType getSpecialCaseIDLTypeMapping(Class<Object> paramClass) {\n/* 411 */ if (paramClass == null) {\n/* 412 */ throw new IllegalArgumentException();\n/* */ }\n/* */ \n/* 415 */ if (paramClass == Object.class) {\n/* 416 */ return new IDLType(paramClass, new String[] { \"java\", \"lang\" }, \"Object\");\n/* */ }\n/* 418 */ if (paramClass == String.class) {\n/* 419 */ return new IDLType(paramClass, new String[] { \"CORBA\" }, \"WStringValue\");\n/* */ }\n/* 421 */ if (paramClass == Class.class) {\n/* 422 */ return new IDLType(paramClass, new String[] { \"javax\", \"rmi\", \"CORBA\" }, \"ClassDesc\");\n/* */ }\n/* 424 */ if (paramClass == Serializable.class) {\n/* 425 */ return new IDLType(paramClass, new String[] { \"java\", \"io\" }, \"Serializable\");\n/* */ }\n/* 427 */ if (paramClass == Externalizable.class) {\n/* 428 */ return new IDLType(paramClass, new String[] { \"java\", \"io\" }, \"Externalizable\");\n/* */ }\n/* 430 */ if (paramClass == Remote.class) {\n/* 431 */ return new IDLType(paramClass, new String[] { \"java\", \"rmi\" }, \"Remote\");\n/* */ }\n/* 433 */ if (paramClass == Object.class) {\n/* 434 */ return new IDLType(paramClass, \"Object\");\n/* */ }\n/* 436 */ return null;\n/* */ }", "public String getJavaType() throws IOException {\n return JDeserialize.resolveJavaType(this.type, this.classname == null ? null : this.classname.value, true, false);\n }", "DatatypesType createDatatypesType();", "public static String type(String s)\n {\n read_if_needed_();\n \n UmlBuiltin b = (UmlBuiltin) UmlSettings._map_builtins.get(s);\n \n return (b != null) ? b.java : s;\n }" ]
[ "0.70238656", "0.652517", "0.65158826", "0.6441474", "0.6385542", "0.61345965", "0.61223614", "0.6009561", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5869033", "0.5859904", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5759111", "0.5753382", "0.5679602", "0.5674518", "0.56149894", "0.5602717", "0.5570378", "0.553489", "0.5520264", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5498182", "0.5490048", "0.54858285", "0.5481087", "0.54635704", "0.544648", "0.5436935", "0.5434269", "0.5423826", "0.5395942", "0.5389115", "0.5384005", "0.5384005", "0.5375453", "0.5367613", "0.5357568", "0.5348944", "0.53486323", "0.5335635", "0.5332359", "0.5313864", "0.5307374", "0.5300185", "0.5299771", "0.52991635", "0.52875006" ]
0.7008111
1
Convert the formal type name, with the given number of dimensions, to an array JNI type.
public static String getJNITypeName(String finalComponent, int dimensions) { StringBuffer jni = new StringBuffer(finalComponent.length()+dimensions+2); while (dimensions-- > 0) { jni.append('['); } String shortSig = (String) MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(finalComponent); if (shortSig == null) { jni.append('L'); jni.append(finalComponent); jni.append(';'); } else { jni.append(shortSig); } return jni.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String toJavaType( String type ) {\n StringBuffer nat = new StringBuffer( 30 );\n int arraydim = 0;\n while ( type.charAt( arraydim ) == '[' ) arraydim++;\n type = type.substring( arraydim );\n switch ( type.charAt( 0 ) ) {\n default:\n throw new IllegalArgumentException( \"unknown native type:\" + type );\n case 'B':\n nat.append( \"byte\" );\n break;\n case 'C':\n nat.append( \"char\" );\n break;\n case 'D':\n nat.append( \"double\" );\n break;\n case 'F':\n nat.append( \"float\" );\n break;\n case 'I':\n nat.append( \"int\" );\n break;\n case 'J':\n nat.append( \"long\" );\n break;\n case 'S':\n nat.append( \"short\" );\n break;\n case 'Z':\n nat.append( \"boolean\" );\n break;\n case 'V':\n nat.append( \"void\" );\n break;\n case 'L':\n String className = type.substring( 1, type.length() - 1 );\n if ( className.indexOf( '<' ) >= 0 ) {\n String parameters = type.substring( className.indexOf( '<' ) + 2, className.lastIndexOf( '>' ) - 1 );\n className = className.substring( 0, className.indexOf( '<' ) );\n nat.append( className.replace( '/', '.' ) );\n nat.append( '<' );\n nat.append( toJavaParameters( parameters ) );\n nat.append( '>' );\n } else {\n nat.append( className.replace( '/', '.' ) );\n }\n break;\n }\n for ( int i = 0; i < arraydim; i++ ) {\n nat.append( \"[]\" );\n }\n return nat.toString();\n }", "public static final String verboseToNativeType( String type ) {\n\n if ( type == \"\" ) return null;\n\n Pattern p = Pattern.compile( \"\\\\s*\\\\[\\\\s*\\\\]\\\\s*\" );\n Matcher m = p.matcher( type );\n\n int arrayDim = 0;\n while ( m.find() ) {\n arrayDim++;\n }\n\n return toNativeType( type.substring( 0, type.length()-(arrayDim*2)), arrayDim );\n }", "private String prepareType(String smaliType) {\n int arrayDimensions = 0;\n \n String typeWithoutBrackets = smaliType;\n \n while (typeWithoutBrackets.startsWith(\"[\")) {\n arrayDimensions++;\n typeWithoutBrackets = typeWithoutBrackets.substring(1);\n }\n \n if(SmaliNameConverter.isPrimitiveSmaliType(typeWithoutBrackets)) {\n return (typeWithoutBrackets.equals(\"V\")) ? \"\" : smaliType ; \n }\n \n String classOfType = SmaliNameConverter.convertTypeFromSmali(typeWithoutBrackets);\n String packageOfType = SmaliNameConverter.extractPackageNameFromClassName(classOfType);\n\n StringBuilder type = new StringBuilder();\n\n for(int i = 0; i < arrayDimensions; i++) {\n type.append(\"[\");\n }\n\n boolean isCurrentClassObject = (classOfType.equals(currentClassType)); \n boolean isInternalObject = (packageOfType.equals(currentPackage)); \n \n char typeChar = isCurrentClassObject? 'T' : \n isInternalObject? 'O' : 'E' ;\n \n type.append(typeChar);\n\n return type.toString();\n }", "public static String getFormalTypeName(String jniName) {\n \t\tif (jniName.charAt(0) == '[') {\n \t\t\t// It is an array\n \t\t\tint dims = jniName.lastIndexOf('[')+1;\t// Number of dimensions\n \t\t\tint startType = dims;\n \t\t\tStringBuffer fName = new StringBuffer(jniName.length()+(2*dims)); \n\t\t\tif (jniName.charAt(startType) == 'L')\n\t\t\t\tfName.append(jniName.substring(startType+1, jniName.length()-1));\t// For \"[Ljava.lang.String;\" return \"java.lang.String\"\n \t\t\telse if (jniName.length() == startType+1) {\n \t\t\t\t// Possible primitive\n \t\t\t\tClass type = (Class) MAP_SHORTSIG_TO_TYPE.get(jniName.substring(startType, startType+1));\n \t\t\t\tif (type != null) {\n \t\t\t\t\tfName.append(type.getName());\n \t\t\t\t} else\n \t\t\t\t\treturn \"\";\t// Invalid if no 'L' and not a primitive. //$NON-NLS-1$\n \t\t\t} else\n \t\t\t\treturn \"\";\t// Invalid, must be either a primitive or 'L' type. //$NON-NLS-1$\n \t\t\twhile(dims-- > 0) {\n \t\t\t\tfName.append(\"[]\"); //$NON-NLS-1$\n \t\t\t}\n \t\t\treturn fName.toString();\n \t\t} else if (jniName.length() == 1) {\n \t\t\t// Possible primitive.\n \t\t\tClass type = (Class) MAP_SHORTSIG_TO_TYPE.get(jniName);\n \t\t\tif (type != null) {\n \t\t\t\treturn type.getName();\n \t\t\t}\n \t\t}\n \t\t\n \t\t// If got here then just a name as is.\n \t\treturn jniName;\n \t}", "public static ClassReference arrayFromName(String name, int dimension) {\n\t\treturn new ClassReference(Primitive.REFERENCE, name.replace('/', '.'), dimension);\n\t}", "private static final String getArrayTypeName(String typeName) {\n final String arrayTypeName = builtInArrayComponentName2ArrayTypeName.get(typeName);\n return (null == arrayTypeName) ? typeName + ARRAY_TYPE_SUFFIX : arrayTypeName;\n }", "char[][] getTypeParameterNames();", "public String visit(ArrayType n, String argu) {\n return \"ArrayType\"; \n }", "public static String getJNIFormatName(String classname) {\n \t\tif (classname.length() == 0 || !classname.endsWith(\"]\")) //$NON-NLS-1$\n \t\t\treturn classname;\t// Not an array,or invalid\n \t\t\n \t\tStringBuffer jni = new StringBuffer(classname.length());\n \t\tint firstOpenBracket = classname.indexOf('[');\n \t\tint ob = firstOpenBracket;\n \t\twhile (ob > -1) {\n \t\t\tint cb = classname.indexOf(']', ob);\n \t\t\tif (cb == -1)\n \t\t\t\tbreak;\n \t\t\tjni.append('[');\n \t\t\tob = classname.indexOf('[', cb);\n \t\t}\n \t\t\n \t\tString finalType = classname.substring(0, firstOpenBracket).trim();\n \t\tif (finalType != null) {\n \t\t\tString shortSig = (String) MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(finalType);\n \t\t\tif (shortSig == null) {\n \t\t\t\tjni.append('L');\n \t\t\t\tjni.append(finalType);\n \t\t\t\tjni.append(';');\n \t\t\t} else {\n \t\t\t\tjni.append(shortSig);\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn jni.toString();\n \t}", "private Object arrayToSPLArray(String name, JSONArray jarr, Type ptype) throws Exception {\n\t\tif(l.isLoggable(TraceLevel.DEBUG)) {\n\t\t\tl.log(TraceLevel.DEBUG, \"Creating Array: \" + name);\n\t\t}\n\t\tCollectionType ctype = (CollectionType) ptype;\n\t\tint cnt=0;\n\t\tString cname = \"List: \" + name;\n\n\t\tswitch(ctype.getElementType().getMetaType()) {\n\t\tcase INT8:\n\t\tcase UINT8: \n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tbyte[] arr= new byte[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Byte)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT16:\n\t\tcase UINT16:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tshort[] arr= new short[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Short)val;\n\t\t\treturn arr;\n\t\t} \n\t\tcase INT32:\n\t\tcase UINT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tint[] arr= new int[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Integer)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase INT64:\n\t\tcase UINT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tlong[] arr= new long[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Long)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase BOOLEAN:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tboolean[] arr= new boolean[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Boolean)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT32:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tfloat[] arr= new float[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Float)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase FLOAT64:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj!=null) lst.add(obj);\n\t\t\t}\n\n\t\t\tdouble[] arr= new double[lst.size()];\n\t\t\tfor(Object val : lst)\n\t\t\t\tarr[cnt++] = (Double)val;\n\t\t\treturn arr;\n\t\t} \n\n\t\tcase USTRING:\n\t\t{\n\t\t\tList<String> lst = new ArrayList<String>();\n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((String)obj);\n\t\t\t}\n\t\t\treturn lst.toArray(new String[lst.size()]);\n\t\t} \n\n\t\tcase BSTRING:\n\t\tcase RSTRING:\n\t\t{\n\t\t\tList<RString> lst = new ArrayList<RString>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((RString)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase TUPLE:\n\t\t{\n\t\t\tList<Tuple> lst = new ArrayList<Tuple>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Tuple)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\t\tcase LIST:\n\t\tcase BLIST:\n\t\t{\n\t\t\tList<Object> lst = new ArrayList<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase SET:\n\t\tcase BSET:\n\t\t{\n\t\t\tSet<Object> lst = new HashSet<Object>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add(obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase DECIMAL32:\n\t\tcase DECIMAL64:\n\t\tcase DECIMAL128:\n\t\t{\n\t\t\tList<BigDecimal> lst = new ArrayList<BigDecimal>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((BigDecimal)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\t\tcase TIMESTAMP:\n\t\t{\n\t\t\tList<Timestamp> lst = new ArrayList<Timestamp>(); \n\t\t\tfor(Object jsonObj : jarr) {\n\t\t\t\tObject obj =jsonToAttribute(cname, ctype.getElementType(), jsonObj, ptype);\n\t\t\t\tif(obj != null) \n\t\t\t\t\tlst.add((Timestamp)obj);\n\t\t\t}\n\t\t\treturn lst;\n\t\t}\n\n\n\t\t//TODO -- not yet supported types\n\t\tcase BLOB:\n\t\tcase MAP:\n\t\tcase BMAP:\n\t\tcase COMPLEX32:\n\t\tcase COMPLEX64:\n\t\tdefault:\n\t\t\tthrow new Exception(\"Unhandled array type: \" + ctype.getElementType().getMetaType());\n\t\t}\n\n\t}", "public native java.lang.String[][] __String2dArrayMethod( long __swiftObject, java.lang.String[][] arg );", "public static TypeArray v(int size) {\n TypeArray newArray = new TypeArray();\n\n newArray.types = new Type[size];\n\n for (int i = 0; i < size; i++) {\n newArray.types[i] = UnusuableType.v();\n }\n\n return newArray;\n }", "public static Object createArray(TypeList type) {\n\t\tList<Integer> listDimensions = type.getDimensions();\n\t\tint[] dimensions = new int[listDimensions.size()];\n\t\tfor (int i = 0; i < dimensions.length; i++) {\n\t\t\tdimensions[i] = listDimensions.get(i);\n\t\t}\n\n\t\tType eltType = type.getInnermostType();\n\t\treturn createArray(eltType, dimensions);\n\t}", "public static JavaType createForCArray(Type elementType) {\n return new JavaType(elementType);\n }", "public static Object createArray(Type type, int... dimensions) {\n\t\tif (type.isBool()) {\n\t\t\treturn Array.newInstance(Boolean.TYPE, dimensions);\n\t\t} else if (type.isFloat()) {\n\t\t\treturn Array.newInstance(Float.TYPE, dimensions);\n\t\t} else if (type.isInt() || type.isUint()) {\n\t\t\tint size = type.getSizeInBits();\n\t\t\tif (size <= 8) {\n\t\t\t\treturn Array.newInstance(Byte.TYPE, dimensions);\n\t\t\t} else if (size <= 16) {\n\t\t\t\treturn Array.newInstance(Short.TYPE, dimensions);\n\t\t\t} else if (size <= 32) {\n\t\t\t\treturn Array.newInstance(Integer.TYPE, dimensions);\n\t\t\t} else if (size <= 64) {\n\t\t\t\treturn Array.newInstance(Long.TYPE, dimensions);\n\t\t\t} else {\n\t\t\t\treturn Array.newInstance(BigInteger.class, dimensions);\n\t\t\t}\n\t\t} else if (type.isString()) {\n\t\t\treturn Array.newInstance(String.class, dimensions);\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"expected scalar type\");\n\t\t}\n\t}", "@Override\r\n\t\tpublic Array createArrayOf(String typeName, Object[] elements)\r\n\t\t\t\tthrows SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n public String getTypeName(String name) {\n boolean isArray = true;\n if (name.startsWith(\"$\")) {\n isArray = false;\n name = name.substring(1);\n }\n int col = Util.findColumn(model, name);\n if (col == -1) {\n return null;\n }\n\n if (!isArray && Number.class.isAssignableFrom(model.getColumnClass(col))) {\n return \"Number\";\n }\n if (isArray && Number.class.isAssignableFrom(model.getColumnClass(col))) {\n return \"NumberArray\";\n }\n if (!isArray && model.getColumnClass(col) == String.class) {\n return \"String\";\n }\n if (isArray && model.getColumnClass(col) == String.class) {\n return \"StringArray\";\n }\n return null;\n }", "public ArrayType getAstArrayType(AST ast, String typeName) {\r\n\t\tType componentType = null;\r\n\t\t// Remove [] for componentType\r\n\t\ttypeName = StringUtils.remove(typeName, \"[]\");\r\n\t\tif (dataTypeUtils.isPrimitiveType(typeName)) {\r\n\t\t\tcomponentType = getAstPrimitiveType(ast, typeName);\r\n\t\t} else {\r\n\t\t\tcomponentType = getAstSimpleType(ast, typeName);\r\n\t\t}\r\n\r\n\t\tArrayType arrayType = ast.newArrayType(componentType);\r\n\t\treturn arrayType;\r\n\t}", "private static int getType(Class<?>[] type_name) {\n\t\tif (type_name.length==1) {\n\t\t\tif (type_name[0].getName().equalsIgnoreCase(\"boolean\") ||\n\t\t\t\ttype_name[0].getName().equalsIgnoreCase(\"int\") ||\n\t\t\t\ttype_name[0].getName().equalsIgnoreCase(\"double\") ||\n\t\t\t\ttype_name[0].getName().equalsIgnoreCase(\"float\")) \n\t\t\t\treturn 1;\n\t\t\telse if (type_name[0].getName().equalsIgnoreCase(\"java.lang.String\"))\n\t\t\t\treturn 2;\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t} else\n\t\t\treturn 0;\n\t}", "public final EObject ruleNamedTypeSpecifier() throws RecognitionException {\n EObject current = null;\n\n EObject lv_typeReference_0_0 = null;\n\n EObject lv_dimensions_2_0 = null;\n\n EObject lv_dimensions_4_0 = null;\n\n\n EObject temp=null; setCurrentLookahead(); resetLookahead(); \n \n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2315:6: ( ( ( (lv_typeReference_0_0= ruleQualifiedName ) ) ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )? ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2316:1: ( ( (lv_typeReference_0_0= ruleQualifiedName ) ) ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2316:1: ( ( (lv_typeReference_0_0= ruleQualifiedName ) ) ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2316:2: ( (lv_typeReference_0_0= ruleQualifiedName ) ) ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2316:2: ( (lv_typeReference_0_0= ruleQualifiedName ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2317:1: (lv_typeReference_0_0= ruleQualifiedName )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2317:1: (lv_typeReference_0_0= ruleQualifiedName )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2318:3: lv_typeReference_0_0= ruleQualifiedName\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getNamedTypeSpecifierAccess().getTypeReferenceQualifiedNameParserRuleCall_0_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleQualifiedName_in_ruleNamedTypeSpecifier4040);\n lv_typeReference_0_0=ruleQualifiedName();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getNamedTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"typeReference\",\n \t \t\tlv_typeReference_0_0, \n \t \t\t\"QualifiedName\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2340:2: ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n int alt37=2;\n int LA37_0 = input.LA(1);\n\n if ( (LA37_0==33) ) {\n alt37=1;\n }\n switch (alt37) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2340:4: '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']'\n {\n match(input,33,FOLLOW_33_in_ruleNamedTypeSpecifier4051); \n\n createLeafNode(grammarAccess.getNamedTypeSpecifierAccess().getLeftSquareBracketKeyword_1_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2344:1: ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2345:1: (lv_dimensions_2_0= ruleArrayDimensionSpecification )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2345:1: (lv_dimensions_2_0= ruleArrayDimensionSpecification )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2346:3: lv_dimensions_2_0= ruleArrayDimensionSpecification\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getNamedTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_1_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleNamedTypeSpecifier4072);\n lv_dimensions_2_0=ruleArrayDimensionSpecification();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getNamedTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"dimensions\",\n \t \t\tlv_dimensions_2_0, \n \t \t\t\"ArrayDimensionSpecification\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2368:2: ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )*\n loop36:\n do {\n int alt36=2;\n int LA36_0 = input.LA(1);\n\n if ( (LA36_0==14) ) {\n alt36=1;\n }\n\n\n switch (alt36) {\n \tcase 1 :\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2368:4: ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) )\n \t {\n \t match(input,14,FOLLOW_14_in_ruleNamedTypeSpecifier4083); \n\n \t createLeafNode(grammarAccess.getNamedTypeSpecifierAccess().getCommaKeyword_1_2_0(), null); \n \t \n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2372:1: ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2373:1: (lv_dimensions_4_0= ruleArrayDimensionSpecification )\n \t {\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2373:1: (lv_dimensions_4_0= ruleArrayDimensionSpecification )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2374:3: lv_dimensions_4_0= ruleArrayDimensionSpecification\n \t {\n \t \n \t \t currentNode=createCompositeNode(grammarAccess.getNamedTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_1_2_1_0(), currentNode); \n \t \t \n \t pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleNamedTypeSpecifier4104);\n \t lv_dimensions_4_0=ruleArrayDimensionSpecification();\n \t _fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = factory.create(grammarAccess.getNamedTypeSpecifierRule().getType().getClassifier());\n \t \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t \t }\n \t \t try {\n \t \t \t\tadd(\n \t \t \t\t\tcurrent, \n \t \t \t\t\t\"dimensions\",\n \t \t \t\tlv_dimensions_4_0, \n \t \t \t\t\"ArrayDimensionSpecification\", \n \t \t \t\tcurrentNode);\n \t \t } catch (ValueConverterException vce) {\n \t \t\t\t\thandleValueConverterException(vce);\n \t \t }\n \t \t currentNode = currentNode.getParent();\n \t \t \n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop36;\n }\n } while (true);\n\n match(input,34,FOLLOW_34_in_ruleNamedTypeSpecifier4116); \n\n createLeafNode(grammarAccess.getNamedTypeSpecifierAccess().getRightSquareBracketKeyword_1_3(), null); \n \n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n resetLookahead(); \n \tlastConsumedNode = currentNode;\n \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "@Nonnull\n private static String getJavaClassName( AnyType arrayType ) {\n if( !arrayType.isRefType() ) {\n switch( (ValueType)arrayType ) {\n case bool:\n return \"[Z\";\n case i8:\n return \"[B\";\n case i16:\n return \"[S\";\n case u16:\n return \"[C\";\n case f64:\n return \"[D\";\n case f32:\n return \"[F\";\n case i32:\n return \"[I\";\n case i64:\n return \"[J\";\n case eqref:\n case externref:\n return \"[Ljava.lang.Object;\";\n default:\n throw new WasmException( \"Not supported array type: \" + arrayType, -1 );\n }\n }\n if( arrayType instanceof ArrayType ) {\n return \"[\" + getJavaClassName( ((ArrayType)arrayType).arrayType );\n }\n return \"[L\" + ((StructType)arrayType).getName() + \";\";\n }", "char[][][] getTypeParameterBounds();", "public String jniTypeName() {\n if (isCompoundTypeWrapper()) {\n // These are sent down as Buffers (e.g., jobject)\n return \"jobject\";\n }\n\n if (isArrayOfCompoundTypeWrappers()) {\n // These are returned as arrays of ByteBuffers (e.g., jobjectArray)\n return \"jobjectArray /* of ByteBuffer */\";\n }\n\n if (clazz == null) {\n return null;\n }\n\n if (isVoid()) {\n return \"void\";\n }\n\n if (isPrimitive()) {\n return \"j\" + clazz.getName();\n }\n\n if (isPrimitiveArray() || isNIOBuffer()) {\n // We now pass primitive arrays and buffers uniformly down to native code as java.lang.Object.\n return \"jobject\";\n }\n\n if (isArray()) {\n if (isStringArray()) {\n return \"jobjectArray /*elements are String*/\";\n }\n\n Class<?> componentType = clazz.getComponentType();\n\n if (isNIOBufferArray()) {\n return \"jobjectArray /*elements are \" + componentType.getName() + \"*/\";\n }\n\n if (componentType.isArray()) {\n // Type is array-of-arrays-of-something\n \n if (componentType.getComponentType().isPrimitive()) {\n // Type is an array-of-arrays-of-primitive \n return \"jobjectArray /* elements are \" + componentType.getComponentType() + \"[]*/\";\n //return \"jobjectArray\";\n } else {\n throw new RuntimeException(\"Multi-dimensional arrays of types that are not primitives or Strings are not supported.\"); \n }\n }\n\n // Some unusual type that we don't handle\n throw new RuntimeException(\"Unexpected and unsupported array type: \\\"\" + this + \"\\\"\");\n }\n\n if (isString()) {\n return \"jstring\";\n }\n\n return \"jobject\";\n }", "public Type CheckType(String type, int arraydimension, int linenum) {\n //////System.out.println(\"CheckType()\");\n if (typeEnv.find(type) == null) {\n CompError.message(linenum, \"Base Type does not exist.\");\n return IntegerType.instance();\n }\n String thisType = type;\n for (int i = 0; i < arraydimension; i++) {\n thisType += \"[]\";\n }\n //I see potential problems here\n //ArrayType entry = new ArrayType(typeEnv.find(thisType));\n Type entry = (Type) typeEnv.find(thisType);\n\n //if type is not in type environment, recursive call to add it\n //will add previous dimensional ones if not in environment either\n if (entry == null && arraydimension != 0) {\n Type prevDimTypeEntry = CheckType(type, arraydimension - 1, linenum);\n ArrayType arrTypeInstance = new ArrayType(prevDimTypeEntry);\n typeEnv.insert(thisType, arrTypeInstance);\n return arrTypeInstance;\n } else {\n return entry;\n }\n }", "private final <T> Object parseTypeArr(Converter<T> converter, Class<T> valType, String[] arr) throws Exception {\n\t\tObject objArr = Array.newInstance(valType, arr.length);\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tT item = converter.parseFromString(valType, null, null, arr[i]);\n\t\t\tArray.set(objArr, i, item);\n\t\t}\n\t\treturn objArr;\n\t}", "public static final String[] toNativeMethod( String javaMethod ) {\n StringTokenizer tokenizer = new StringTokenizer( javaMethod, \"(,[]) \", true );\n String tmp = tokenizer.nextToken();\n ;\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n String returnType = tmp;\n tmp = tokenizer.nextToken();\n int retarraydim = 0;\n while ( tmp.equals( \"[\" ) ) {\n tmp = tokenizer.nextToken();\n if ( !tmp.equals( \"]\" ) ) throw new IllegalArgumentException( \"']' expected but found \" + tmp );\n retarraydim++;\n tmp = tokenizer.nextToken();\n }\n if ( tmp.trim().length() != 0 ) {\n throw new IllegalArgumentException( \"space expected but found \" + tmp );\n }\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n String name = tmp;\n StringBuffer nativeMethod = new StringBuffer( 30 );\n nativeMethod.append( '(' );\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n if ( !tmp.equals( \"(\" ) ) throw new IllegalArgumentException( \"'(' expected but found \" + tmp );\n tmp = tokenizer.nextToken();\n while ( !tmp.equals( \")\" ) ) {\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n String type = tmp;\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n int arraydim = 0;\n while ( tmp.equals( \"[\" ) ) {\n tmp = tokenizer.nextToken();\n if ( !tmp.equals( \"]\" ) ) throw new IllegalArgumentException( \"']' expected but found \" + tmp );\n arraydim++;\n tmp = tokenizer.nextToken();\n }\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n\n nativeMethod.append( toNativeType( type, arraydim ) );\n if ( tmp.equals( \",\" ) ) {\n tmp = tokenizer.nextToken();\n while ( tmp.trim().length() == 0 ) {\n tmp = tokenizer.nextToken();\n }\n continue;\n }\n }\n nativeMethod.append( ')' );\n nativeMethod.append( toNativeType( returnType, retarraydim ) );\n String[] result = new String[]{ name, nativeMethod.toString() };\n return result;\n }", "private String getNativeNameForJavaType(TypeName typeName) {\n\n if (isNumber(typeName)) {\n return \"Number\";\n } else if (isBoolean(typeName)) {\n return \"Boolean\";\n } else if (isString(typeName)) {\n return \"String\";\n } else if (isArray(typeName)) {\n return \"Array\";\n } else {\n return \"Object\";\n }\n }", "static private PowerlessArray<String>\n types(final Class<?> actual) {\n final Class<?> end =\n Struct.class.isAssignableFrom(actual) ? Struct.class : Object.class;\n final PowerlessArray.Builder<String> r = PowerlessArray.builder(4);\n for (Class<?> i=actual; end!=i; i=i.getSuperclass()) { ifaces(i, r); }\n return r.snapshot();\n }", "public final Type array_type() throws RecognitionException {\r\n Type type = null;\r\n\r\n\r\n Token INTEGER155=null;\r\n Type derived_type156 =null;\r\n\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:923:5: ( '[' INTEGER 'x' derived_type ']' )\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:923:7: '[' INTEGER 'x' derived_type ']'\r\n {\r\n match(input,49,FOLLOW_49_in_array_type6533); \r\n\r\n INTEGER155=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_array_type6535); \r\n\r\n match(input,91,FOLLOW_91_in_array_type6537); \r\n\r\n pushFollow(FOLLOW_derived_type_in_array_type6539);\r\n derived_type156=derived_type();\r\n\r\n state._fsp--;\r\n\r\n\r\n match(input,50,FOLLOW_50_in_array_type6541); \r\n\r\n type = typeFactory.getArrayType(Integer.parseInt((INTEGER155!=null?INTEGER155.getText():null)), derived_type156);\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return type;\r\n }", "public native char[][] __char2dArrayMethod( long __swiftObject, char[][] arg );", "public Object createDataType(String typeName) throws BuildException {\n return ComponentHelper.getComponentHelper(this).createDataType(typeName);\n }", "public static ClassReference arrayFromElementType(ClassReference elementType) {\n\t\treturn new ClassReference(elementType.primitive, elementType.className, elementType.arrayDimension + 1);\n\t}", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSGeneralNameType getGeneralNameArray(int i);", "private ArrayType( @Nonnull String name, @Nonnull StructTypeKind kind, @Nonnull TypeManager manager, @Nonnull AnyType arrayType ) {\n super( name, kind, manager );\n this.arrayType = arrayType;\n }", "@jdk.Exported\npublic interface ArrayType extends ReferenceType {\n\n /**\n * Creates a new instance of this array class in the target VM.\n * The array is created with the given length and each component\n * is initialized to is standard default value.\n *\n * @param length the number of components in the new array\n * @return the newly created {@link ArrayReference} mirroring\n * the new object in the target VM.\n *\n * @throws VMCannotBeModifiedException if the VirtualMachine is read-only - see {@link VirtualMachine#canBeModified()}.\n */\n ArrayReference newInstance(int length);\n\n /**\n * Gets the JNI signature of the components of this\n * array class. The signature\n * describes the declared type of the components. If the components\n * are objects, their actual type in a particular run-time context\n * may be a subclass of the declared class.\n *\n * @return a string containing the JNI signature of array components.\n */\n String componentSignature();\n\n /**\n * Returns a text representation of the component\n * type of this array.\n *\n * @return a text representation of the component type.\n */\n String componentTypeName();\n\n /**\n * Returns the component type of this array,\n * as specified in the array declaration.\n * <P>\n * Note: The component type of a array will always be\n * created or loaded before the array - see\n * <cite>The Java&trade; Virtual Machine Specification</cite>,\n * section 5.3.3 - Creating Array Classes.\n * However, although the component type will be loaded it may\n * not yet be prepared, in which case the type will be returned\n * but attempts to perform some operations on the returned type\n * (e.g. {@link ReferenceType#fields() fields()}) will throw\n * a {@link ClassNotPreparedException}.\n * Use {@link ReferenceType#isPrepared()} to determine if\n * a reference type is prepared.\n *\n * @see Type\n * @see Field#type() Field.type() - for usage examples\n * @return the {@link Type} of this array's components.\n */\n Type componentType() throws ClassNotLoadedException;\n}", "ArrayTypeRule createArrayTypeRule();", "public Class<?>[] getTypes(Object[] input){\n\n Class<?>[] parameters = new Class<?>[input.length];\n for (int i = 0; i < parameters.length; i++){\n if (isNumeric(input[i].toString())){\n parameters[i] = int.class;\n }else{\n parameters[i] = String.class;\n }\n }\n return parameters;\n }", "public Object VisitNewArrayExpression(ASTNewArrayExpression newarrayexpression) {\n TypeClass sizetc = (TypeClass) newarrayexpression.elements().Accept(this);\n Type size = sizetc.type(); \n \n if (size != IntegerType.instance()) {\n CompError.message(newarrayexpression.line(), \"Array size must be an integer.\");\n return new TypeClass(IntegerType.instance(), null);\n } else {\n //type is base type (i.e. int for int[][])\n Type arrtyp = CheckType(newarrayexpression.type(), newarrayexpression.arraydimension(), newarrayexpression.line());\n return new TypeClass(arrtyp, bt.allocate(bt.operatorExpression(sizetc.value(), bt.constantExpression(MachineDependent.WORDSIZE), AATOperator.MULTIPLY))); //TODO: Make sure this is in bytes, not words\n } \n }", "public void setArrayType(String arrayType) {\n this.arrayType = arrayType;\n }", "JAVATYPE [] convertArray(JAVATYPE [] oldArray, final METATYPE meta);", "public native short[][] __short2dArrayMethod( long __swiftObject, short[][] arg );", "public String visit(ArrayLength n, Object argu) \n\t{\n\t\tString _ret=null;\n\t String e0 = n.f0.accept(this, argu);\n\t \n\t if (e0.equals(\"int[]\"))\n\t {\n\t \t_ret = \"int\";\n\t }\n\t return _ret;\n\t}", "public String visit(ArrayAllocationExpression n, Object argu) \n\t{\n\t\tString _ret=null;\n\t\t\n\t if (n.f3.accept(this, argu).equals(\"int\"))\n\t {\n\t \t_ret = \"int[]\";\n\t }\n\n\t return _ret;\n\t}", "public static Object get(String name) throws NoSuchElementException {\n Object object = null;\n PersistentRootEntry entry = (PersistentRootEntry)Native.getPersistentMemoryTable();\n while (entry != null) {\n String ename = entry.name;\n if (ename != null && ename.equals(name)) {\n object = entry.value;\n break;\n }\n entry = entry.next;\n }\n\n if (object != null) {\n return object;\n }\n if (name.equals(\"new byte[0]\")) { object = new byte[0];\n } else if (name.equals(\"new byte[0][]\")) { object = new byte[0][];\n } else if (name.equals(\"new char[0]\")) { object = new char[0];\n } else if (name.equals(\"new char[0][]\")) { object = new char[0][];\n } else if (name.equals(\"new int[0]\")) { object = new int[0];\n } else if (name.equals(\"new Object[0]\")) { object = new Object[0];\n } else if (name.equals(\"new byte[] {0}\")) { object = new byte[] {0};\n } else if (name.equals(\"new byte[] {1}\")) { object = new byte[] {1};\n } else if (name.equals(\"new byte[] {3}\")) { object = new byte[] {3};\n } else if (name.equals(\"new byte[] {7}\")) { object = new byte[] {7};\n } else if (name.equals(\"new byte[] {15}\")) { object = new byte[] {15};\n } else if (name.equals(\"new byte[] {31}\")) { object = new byte[] {31};\n } else if (name.equals(\"new short[0]\")) { object = new short[0];\n } else if (name.equals(\"new short[MTYPE_LAST+1][]\")) { object = new short[SquawkConstants.MTYPE_LAST+1][];\n } else {\n throw new NoSuchElementException(name);\n }\n put(name, object);\n return object;\n }", "public VariType visit(ArrayAllocationExpression n, Table argu) { \n\t VariType _ret = new VariType();\n\t n.f0.accept(this, argu);\n\t n.f1.accept(this, argu);\n\t n.f2.accept(this, argu);\n\t VariType t3 = n.f3.accept(this, argu);\n\t n.f4.accept(this, argu);\n\t if(t3.type != \"Integer\") {\n\t \t PrintError.errorexist = true;\n\t \t String emsg = \"array length type does not match type Integer\";\n\t \t PrintError.print(emsg, n.f2.beginLine, n.f2.beginColumn, 1);\n\t }\n\t _ret.type = \"Array\";\n\t if(t3.ifintegerliteral == true) {\n\t \t _ret.ifintegerliteral = true;\n\t \t _ret.integerliteral = t3.integerliteral;\n\t }\n\t return _ret;\n\t }", "private Struct parseType() {\n check(Token.IDENT);\n\n String identName = token.string;\n SymObject object = find(identName);\n assertIsType(object);\n Struct type = object.type;\n\n if (nextToken.kind == Token.LBRACK) {\n check(Token.LBRACK);\n check(Token.RBRACK);\n\n type = new Struct(Struct.KIND_ARRAY, type);\n }\n\n return type;\n }", "public final JavaliParser.arrayType_return arrayType() throws RecognitionException {\n\t\tJavaliParser.arrayType_return retval = new JavaliParser.arrayType_return();\n\t\tretval.start = input.LT(1);\n\n\t\tObject root_0 = null;\n\n\t\tToken id=null;\n\t\tToken char_literal118=null;\n\t\tToken char_literal119=null;\n\t\tToken char_literal120=null;\n\t\tToken char_literal121=null;\n\t\tParserRuleReturnScope pt =null;\n\n\t\tObject id_tree=null;\n\t\tObject char_literal118_tree=null;\n\t\tObject char_literal119_tree=null;\n\t\tObject char_literal120_tree=null;\n\t\tObject char_literal121_tree=null;\n\t\tRewriteRuleTokenStream stream_Identifier=new RewriteRuleTokenStream(adaptor,\"token Identifier\");\n\t\tRewriteRuleTokenStream stream_84=new RewriteRuleTokenStream(adaptor,\"token 84\");\n\t\tRewriteRuleTokenStream stream_85=new RewriteRuleTokenStream(adaptor,\"token 85\");\n\t\tRewriteRuleSubtreeStream stream_primitiveType=new RewriteRuleSubtreeStream(adaptor,\"rule primitiveType\");\n\n\t\ttry {\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:570:2: (id= Identifier '[' ']' -> ^( ArrayType[$id, \\\"ArrayType\\\"] Identifier ) |pt= primitiveType '[' ']' -> ^( ArrayType[$pt.start, \\\"ArrayType\\\"] primitiveType ) )\n\t\t\tint alt41=2;\n\t\t\tint LA41_0 = input.LA(1);\n\t\t\tif ( (LA41_0==Identifier) ) {\n\t\t\t\talt41=1;\n\t\t\t}\n\t\t\telse if ( (LA41_0==86||LA41_0==90||LA41_0==92) ) {\n\t\t\t\talt41=2;\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tNoViableAltException nvae =\n\t\t\t\t\tnew NoViableAltException(\"\", 41, 0, input);\n\t\t\t\tthrow nvae;\n\t\t\t}\n\n\t\t\tswitch (alt41) {\n\t\t\t\tcase 1 :\n\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:570:4: id= Identifier '[' ']'\n\t\t\t\t\t{\n\t\t\t\t\tid=(Token)match(input,Identifier,FOLLOW_Identifier_in_arrayType2689); \n\t\t\t\t\tstream_Identifier.add(id);\n\n\t\t\t\t\tchar_literal118=(Token)match(input,84,FOLLOW_84_in_arrayType2691); \n\t\t\t\t\tstream_84.add(char_literal118);\n\n\t\t\t\t\tchar_literal119=(Token)match(input,85,FOLLOW_85_in_arrayType2693); \n\t\t\t\t\tstream_85.add(char_literal119);\n\n\t\t\t\t\t// AST REWRITE\n\t\t\t\t\t// elements: Identifier\n\t\t\t\t\t// token labels: \n\t\t\t\t\t// rule labels: retval\n\t\t\t\t\t// token list labels: \n\t\t\t\t\t// rule list labels: \n\t\t\t\t\t// wildcard labels: \n\t\t\t\t\tretval.tree = root_0;\n\t\t\t\t\tRewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.getTree():null);\n\n\t\t\t\t\troot_0 = (Object)adaptor.nil();\n\t\t\t\t\t// 571:3: -> ^( ArrayType[$id, \\\"ArrayType\\\"] Identifier )\n\t\t\t\t\t{\n\t\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:571:6: ^( ArrayType[$id, \\\"ArrayType\\\"] Identifier )\n\t\t\t\t\t\t{\n\t\t\t\t\t\tObject root_1 = (Object)adaptor.nil();\n\t\t\t\t\t\troot_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ArrayType, id, \"ArrayType\"), root_1);\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_Identifier.nextNode());\n\t\t\t\t\t\tadaptor.addChild(root_0, root_1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tretval.tree = root_0;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:572:4: pt= primitiveType '[' ']'\n\t\t\t\t\t{\n\t\t\t\t\tpushFollow(FOLLOW_primitiveType_in_arrayType2713);\n\t\t\t\t\tpt=primitiveType();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\tstream_primitiveType.add(pt.getTree());\n\t\t\t\t\tchar_literal120=(Token)match(input,84,FOLLOW_84_in_arrayType2715); \n\t\t\t\t\tstream_84.add(char_literal120);\n\n\t\t\t\t\tchar_literal121=(Token)match(input,85,FOLLOW_85_in_arrayType2717); \n\t\t\t\t\tstream_85.add(char_literal121);\n\n\t\t\t\t\t// AST REWRITE\n\t\t\t\t\t// elements: primitiveType\n\t\t\t\t\t// token labels: \n\t\t\t\t\t// rule labels: retval\n\t\t\t\t\t// token list labels: \n\t\t\t\t\t// rule list labels: \n\t\t\t\t\t// wildcard labels: \n\t\t\t\t\tretval.tree = root_0;\n\t\t\t\t\tRewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.getTree():null);\n\n\t\t\t\t\troot_0 = (Object)adaptor.nil();\n\t\t\t\t\t// 573:3: -> ^( ArrayType[$pt.start, \\\"ArrayType\\\"] primitiveType )\n\t\t\t\t\t{\n\t\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:573:6: ^( ArrayType[$pt.start, \\\"ArrayType\\\"] primitiveType )\n\t\t\t\t\t\t{\n\t\t\t\t\t\tObject root_1 = (Object)adaptor.nil();\n\t\t\t\t\t\troot_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ArrayType, (pt!=null?(pt.start):null), \"ArrayType\"), root_1);\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_primitiveType.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_0, root_1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tretval.tree = root_0;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t\tretval.stop = input.LT(-1);\n\n\t\t\tretval.tree = (Object)adaptor.rulePostProcessing(root_0);\n\t\t\tadaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n\t\t}\n\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\tthrow re;\n\t\t}\n\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn retval;\n\t}", "HRESULT SafeArrayGetVartype(SAFEARRAY psa, VARTYPEByReference pvt);", "public void putArray(String str, A1e a1e) {\n boolean z;\n if (a1e != null) {\n z = false;\n }\n z = true;\n AnonymousClass0FY.A03(z, \"Illegal type provided\");\n putNativeArray(str, (WritableNativeArray) a1e);\n }", "public abstract short[] toShortArray();", "String[][] packData();", "public interface ArrayAccessReplacementMethodNames{\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)B</code> to replace reading from a byte[].\n */\n String byteOrBooleanRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IB)V</code> to replace writing to a byte[].\n */\n String byteOrBooleanWrite();\n\n /**\n * @return the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)C</code> to replace reading from a char[].\n */\n String charRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IC)V</code> to replace writing to a byte[].\n */\n String charWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)D</code> to replace reading from a double[].\n */\n String doubleRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;ID)V</code> to replace writing to a double[].\n */\n String doubleWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)F</code> to replace reading from a float[].\n */\n String floatRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IF)V</code> to replace writing to a float[].\n */\n String floatWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)I</code> to replace reading from a int[].\n */\n String intRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;II)V</code> to replace writing to a int[].\n */\n String intWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)J</code> to replace reading from a long[].\n */\n String longRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IJ)V</code> to replace writing to a long[].\n */\n String longWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)Ljava/lang/Object;</code>\n * to replace reading from a Object[] (or any subclass of object).\n */\n String objectRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;ILjava/lang/Object;)V</code>\n * to replace writing to a Object[] (or any subclass of object).\n */\n String objectWrite();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;I)S</code> to replace reading from a short[].\n */\n String shortRead();\n\n /**\n * Returns the name of a static method with the signature\n * <code>(Ljava/lang/Object;IS)V</code> to replace writing to a short[].\n */\n String shortWrite();\n }", "public ClassType[] getArray(){\n\t\t\tClassType[] temp = new ClassType[count];\n\t\t\tfor (int i = 0; i < count; i++){\n\t\t\t\ttemp[i] = new ClassType(anArray[i]);\n\t\t\t}\n\t\t\treturn temp;\n\t\t}", "private ConfigurationObject createArray(String name, String arrayType, String dimension,\r\n String values) throws Exception {\r\n ConfigurationObject array = new DefaultConfigurationObject(name);\r\n array.setPropertyValue(PROPERTY_ARRAY_TYPE, arrayType);\r\n array.setPropertyValue(PROPERTY_DIMENSION, dimension);\r\n array.setPropertyValue(PROPERTY_VALUES, values);\r\n\r\n return array;\r\n }", "public static String handleNewArrayExpression(Node n, Node currentDeclarator, String type, String variable, boolean is2D, PrintMainFileSummary summary){\n summary.needsSizeCheck = true;\n String fieldDeclaration =\"\" ;\n fieldDeclaration += \" = \";\n\n Node newArray = currentDeclarator.getNode(2);\n String qualifiedIdentifier = newArray.getNode(0).getString(0);\n /*//check if size is negative or positive\n boolean sizeIsNegative = false;\n String negSize=\"\";\n Node sizeMightBeNegative = NodeUtil.dfs(newArray,\"UnaryExpression\");\n if(sizeMightBeNegative!=null){\n if(sizeMightBeNegative.getString(0).equals(\"-\")){\n sizeIsNegative = true;\n negSize = \"-\"+sizeMightBeNegative.getNode(1).getString(0);\n }\n }*/\n\n String size = \"\";\n if (newArray.getNode(1).getNode(0).getName().equals(\"UnaryExpression\"))\n size = newArray.getNode(1).getNode(0).getString(0)+newArray.getNode(1).getNode(0).getNode(1).getString(0);\n else\n size = newArray.getNode(1).getNode(0).getString(0);\n summary.size = new Integer(size);\n /*if(sizeIsNegative){//size is negative\n size = negSize;\n }*/\n if (is2D) {\n String size2 = newArray.getNode(1).getNode(1).getString(0);\n String type2 = n.getNode(1).getNode(0).getString(0);\n if (type2.equals(\"int\"))\n fieldDeclaration += \"new __rt::Array<__rt::Array<\" + type2 + \">*>(\"+size2+\");\\n\";\n else\n fieldDeclaration += \"new __rt::Array<__rt::Array<__\" + type2 + \">*>(\"+size2+\");\\n\";\n\n summary.init2D = variable+\"->__data[%s]\";\n summary.init2DSize = size2;\n summary.init2DType = n.getNode(1).getNode(0).getString(0);\n\n summary.localVariables.put(variable, type+\"[[\");\n }\n else {\n if (!type.equals(qualifiedIdentifier))\n fieldDeclaration += \"(__rt::Array<\" + type + \">*) \";\n\n\n fieldDeclaration += \"new __rt::Array<\" + qualifiedIdentifier + \">(\" + size + \");\\n\";\n\n /*\n //check NegativeArraySizeException()\n if (Integer.parseInt(size) < 0) {\n //need to throw NegativeArraySizeException() BEFORE assigning the array\n String fieldDeclaration_deepCopy = \"\";\n for (int i = 0; i < fieldDeclaration.length(); i++) {\n char c = fieldDeclaration.charAt(i);\n fieldDeclaration_deepCopy += c;\n }\n fieldDeclaration = \"\";\n fieldDeclaration += \"\\tthrow java::lang::NegativeArraySizeException(); //size of array is negative\\n\\t\\t\";\n fieldDeclaration += fieldDeclaration_deepCopy;\n }*/\n summary.localVariables.put(variable, type + \"[\");\n }\n return fieldDeclaration;\n }", "TypeInfo[] typeParams();", "public String visit(IntegerArrayType n, LLVMRedux argu) {\n return \"i32*\";\n }", "private void encodeArray(Encoder encoder, Array type, int size) throws IOException {\n\t\tif (type.isZeroLength()) {\n\t\t\t// TODO: Zero-element arrays not yet supported\n\t\t\tencodeOpaqueDataType(encoder, type, size);\n\t\t\treturn;\n\t\t}\n\t\tencoder.openElement(ELEM_TYPE);\n\t\tencoder.writeString(ATTRIB_NAME, \"\");\n\t\tint sz = type.getLength();\n\t\tif (sz == 0) {\n\t\t\tsz = size;\n\t\t}\n\t\tencoder.writeString(ATTRIB_METATYPE, \"array\");\n\t\tencoder.writeSignedInteger(ATTRIB_SIZE, sz);\n\t\tencoder.writeSignedInteger(ATTRIB_ARRAYSIZE, type.getNumElements());\n\t\tencodeTypeRef(encoder, type.getDataType(), type.getElementLength());\n\t\tencoder.closeElement(ELEM_TYPE);\n\t}", "public static byte[] genAllTypes(){\n byte[] types = { DataType.BAG, DataType.BIGCHARARRAY, DataType.BOOLEAN, DataType.BYTE, DataType.BYTEARRAY,\n DataType.CHARARRAY, DataType.DOUBLE, DataType.FLOAT, DataType.DATETIME,\n DataType.GENERIC_WRITABLECOMPARABLE,\n DataType.INTEGER, DataType.INTERNALMAP,\n DataType.LONG, DataType.MAP, DataType.TUPLE, DataType.BIGINTEGER, DataType.BIGDECIMAL};\n return types;\n }", "public native byte[][] __byte2dArrayMethod( long __swiftObject, byte[][] arg );", "public native float[][] __float2dArrayMethod( long __swiftObject, float[][] arg );", "public native java.lang.String[] __StringArrayMethod( long __swiftObject, java.lang.String[] arg );", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSGssExportedNameType getGssExportedNameArray(int i);", "private static int[][] make_subtypes(Type[] alltypes) {\n int[][] subs = new int[alltypes.length][];\n int[] tmp = new int[alltypes.length];\n for( int i=0; i<subs.length; i++ ) {\n int len=0;\n for( int j=0; j<subs.length; j++ )\n if( i!=j && alltypes[i].isa(alltypes[j]) )\n tmp[len++]=j; // isa numbers are sorted by increasing 'j'\n subs[i] = Arrays.copyOfRange(tmp,0,len);\n }\n return subs;\n }", "static String[] getAllTypeNames()\n\t{\n\t\treturn new String[] {\"String\", \"int\", \"double\", \"long\", \"boolean\", \"String[]\", \"int[]\", \"double[]\", \"long[]\"};\n\t}", "public ArrayVariable getArray(String rootName, int ssaNum) {\n\t\treturn (ArrayVariable)get(rootName,ssaNum);\n\t}", "private String getTypeName(int idx){\r\n String[] types = {\"C-SVC\",\"nu-SVC\",\"one-class SVM\",\"epsilon-SVR\",\"nu-SVR\"};\r\n return types[idx];\r\n }", "public native JsArrayString getTypes()/*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\treturn jso.types;\n }-*/;", "private void encodeUnicodeDataType(Encoder encoder, int size) throws IOException {\n\t\tencoder.openElement(ELEM_TYPE);\n\t\tencoder.writeString(ATTRIB_NAME, \"\");\n\t\tencoder.writeString(ATTRIB_METATYPE, \"array\");\n\t\tencoder.writeSignedInteger(ATTRIB_SIZE, size);\n\t\tencoder.writeSignedInteger(ATTRIB_ARRAYSIZE, size / 2);\n\t\tencodeCharTypeRef(encoder, 2);\n\t\tencoder.closeElement(ELEM_TYPE);\n\t}", "private void encodeStringDataType(Encoder encoder, int size) throws IOException {\n\t\tencoder.openElement(ELEM_TYPE);\n\t\tencoder.writeString(ATTRIB_NAME, \"\");\n\t\tencoder.writeString(ATTRIB_METATYPE, \"array\");\n\t\tencoder.writeSignedInteger(ATTRIB_SIZE, size);\n\t\tencoder.writeSignedInteger(ATTRIB_ARRAYSIZE, size);\n\t\tencodeCharTypeRef(encoder, dataOrganization.getCharSize());\n\t\tencoder.closeElement(ELEM_TYPE);\n\t}", "public XmlsonArray(String name) {\n\t\tsuper(name);\n\t}", "org.apache.geronimo.corba.xbeans.csiv2.tss.TSSGeneralNameType[] getGeneralNameArray();", "private static String getClassNameAfterWrapperArrayOf(Class<?> clazz) {\n if(clazz.isPrimitive()) {\n String baseTypeDescriptor = DescriptorUtils.primitiveClass2BaseTypeDescriptor(clazz);\n return \"[\" + baseTypeDescriptor;\n } else if(clazz.isArray()) {\n return \"[\" + clazz.getName();\n } else {\n // normal object\n return \"[L\" + clazz.getName() + \";\";\n }\n }", "private String[] buildTypeRegistrations(String[] baseKeys, boolean noSQLrecurse) {\n\t\tClassLoaderService cls = registry.getService(ClassLoaderService.class);\n\t\tArrayList<String> keys = new ArrayList<>( baseKeys.length << 1 );\n\t\tfor ( String bk : baseKeys ) {\n\t\t\tString className;\n\t\t\tboolean addSQL = true;\n\t\t\ttry {\n\t\t\t\tClass c;\n\t\t\t\tswitch ( bk ) {\n\t\t\t\t\tcase \"boolean\":\n\t\t\t\t\t\tc = boolean.class;\n\t\t\t\t\t\tclassName = \"Z\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"byte\":\n\t\t\t\t\t\tc = byte.class;\n\t\t\t\t\t\tclassName = \"B\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"char\":\n\t\t\t\t\t\tc = char.class;\n\t\t\t\t\t\tclassName = \"C\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\t\tc = double.class;\n\t\t\t\t\t\tclassName = \"D\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"float\":\n\t\t\t\t\t\tc = float.class;\n\t\t\t\t\t\tclassName = \"F\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"int\":\n\t\t\t\t\t\tc = int.class;\n\t\t\t\t\t\tclassName = \"I\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"long\":\n\t\t\t\t\t\tc = long.class;\n\t\t\t\t\t\tclassName = \"J\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"short\":\n\t\t\t\t\t\tc = short.class;\n\t\t\t\t\t\tclassName = \"S\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// load to make sure it exists\n\t\t\t\t\t\tc = cls.classForName( bk );\n\t\t\t\t\t\tclassName = c.getName();\n\t\t\t\t\t\taddSQL = false;\n\t\t\t\t}\n\t\t\t\tif ( c.isPrimitive() ) {\n\t\t\t\t\t// disallow. \n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( c.isArray() ) {\n\t\t\t\t\tkeys.add( \"[\" + className );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tkeys.add( \"[L\" + className + \";\" );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch ( ClassLoadingException ex ) {\n\t\t\t\t// just ignore. It means we won't be adding that key\n\t\t\t}\n\t\t\tif ( addSQL ) {\n\t\t\t\t// Not all type names given are Java classes, so assume the others are Database types\n\t\t\t\tif ( noSQLrecurse ) {\n\t\t\t\t\t// type is just \"basetype ARRAY\", never \"basetype ARRAY ARRAY ARRAY\"\n\t\t\t\t\tkeys.add( bk );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// PostgreSQL type names\n\t\t\t\t\tkeys.add( bk + \"[]\" );\n\t\t\t\t\t// standard SQL\n\t\t\t\t\tkeys.add( bk + \" ARRAY\" );\n\t\t\t\t\t// also possible\n\t\t\t\t\tkeys.add( bk + \" array\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn keys.toArray( new String[keys.size()] );\n\t}", "public int GetVariableTypes(String plotName)\n {\n Hashtable namestovar = new Hashtable();\n namestovar.put(\"Boundary\", new Integer(MATERIAL));\n namestovar.put(\"Contour\", new Integer(SCALAR | SPECIES));\n namestovar.put(\"Curve\", new Integer(CURVE));\n namestovar.put(\"FilledBoundary\", new Integer(MATERIAL));\n namestovar.put(\"Histogram\", new Integer(SCALAR | ARRAY));\n namestovar.put(\"Kerbel\", new Integer(MESH));\n namestovar.put(\"Label\", new Integer(MESH | SCALAR | VECTOR | MATERIAL | SUBSET | TENSOR | SYMMETRICTENSOR | LABEL | ARRAY));\n namestovar.put(\"Mesh\", new Integer(MESH));\n namestovar.put(\"Molecule\", new Integer(SCALAR));\n namestovar.put(\"MultiCurve\", new Integer(CURVE));\n namestovar.put(\"ParallelCoordinates\", new Integer(0)); //SCALAR | ARRAY));\n namestovar.put(\"Poincare\", new Integer(VECTOR));\n namestovar.put(\"Pseudocolor\", new Integer(SCALAR | SPECIES));\n namestovar.put(\"Scatter\", new Integer(SCALAR));\n namestovar.put(\"Spreadsheet\", new Integer(SCALAR));\n namestovar.put(\"Subset\", new Integer(SUBSET | MESH));\n namestovar.put(\"Surface\", new Integer(SCALAR | SPECIES));\n namestovar.put(\"Tensor\", new Integer(TENSOR | SYMMETRICTENSOR));\n namestovar.put(\"Topology\", new Integer(SCALAR));\n namestovar.put(\"Truecolor\", new Integer(VECTOR));\n namestovar.put(\"Vector\", new Integer(VECTOR));\n namestovar.put(\"Volume\", new Integer(SCALAR | SPECIES));\n namestovar.put(\"WellBore\", new Integer(MESH));\n\n return ((Integer)namestovar.get(plotName)).intValue();\n }", "public String getClassName(){\r\n\t\treturn \"ValueArray\";\r\n\t}", "@Test\r\n public void testGenericArray()\r\n {\r\n Type t0 = Types.create(List.class).withType(Number.class).build();\r\n Type arrayType = Types.createGenericArrayType(t0);\r\n test(arrayType);\r\n }", "public void testCreateArray() {\n System.out.println(\"createArray\");// NOI18N\n \n TypeID type = new TypeID(TypeID.Kind.PRIMITIVE, \"javacode\");// NOI18N\n PrimitiveDescriptor arrayDescriptor = new PrimitiveDescriptor() {\n public Object deserialize(String serialized) {\n return \"array\"; //NOI18N\n }\n public boolean isValidInstance(Object object) {\n return true;\n }\n public String serialize(Object value) {\n return \"array\"; // NOI18N\n }\n };\n \n PropertyValue arrayPropertyValue = PropertyValue.createValue( arrayDescriptor, type, DesignComponentTest.PROPERTY3_VALUE_STRING);// NOI18N\n List<PropertyValue> array = new ArrayList();\n array.add(arrayPropertyValue);\n \n PropertyValue result = PropertyValue.createArray(type, array);\n \n assertEquals(PropertyValue.Kind.ARRAY, result.getKind());\n type = type.getArrayType();\n assertEquals(type,result.getType());\n assertNotNull(result.getArray());\n }", "public MType visit(ArrayAllocationExpression n, MType argu) {\n \tMType _ret = new MArray(argu);\n \t\n \tn.f3.accept(this, argu);\n \t\n \treturn _ret;\n \t}", "public static void arrayCreation() {\n int[] arr = new int[3];\n // as we are using new operator and that is how we create objects hence arrays\n // are called objects\n // every array in java is an object\n System.out.println(arr.getClass()\n .getSimpleName()); // int[]\n System.out.println(arr.getClass()\n .getName()); // [I\n\n int[] a1 = new int[3];\n int[][] a2 = new int[3][3];\n double[] a3 = new double[3];\n short[] a4 = new short[3];\n byte[] a5 = new byte[3];\n boolean[] a6 = new boolean[3];\n long[] a7 = new long[3];\n float[] a8 = new float[3];\n Integer[] a9 = new Integer[3];\n\n System.out.println(a1.getClass()\n .getName()); // [I\n System.out.println(a2.getClass()\n .getName()); // [[I\n System.out.println(a3.getClass()\n .getName()); // [D\n System.out.println(a4.getClass()\n .getName()); // [S\n System.out.println(a5.getClass()\n .getName()); // [B\n System.out.println(a6.getClass()\n .getName()); // [Z\n System.out.println(a7.getClass()\n .getName()); // [J\n System.out.println(a8.getClass()\n .getName()); // [F\n System.out.println(a9.getClass()\n .getName()); // [Ljava.lang.Integer;\n\n // at the time of the array initialization we should compulsory specify the size\n // new int[3] we should specify the size else it will lead to compilation error\n\n // It is legal to have size zero in java\n int[] a = new int[0];\n System.out.println(a);\n\n }", "void mo3807a(C0985po[] poVarArr);", "@Test public void getBaseTypeNameShouldReturnCorrectType() throws SQLException {\n\t\tList<Object> list = new ArrayList<>();\n\t\tArray array = new ListArray(list, Types.VARCHAR);\n\t\tassertEquals(\"VARCHAR\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.INTEGER);\n\t\tassertEquals(\"INTEGER\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.DOUBLE);\n\t\tassertEquals(\"DOUBLE\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.BOOLEAN);\n\t\tassertEquals(\"BOOLEAN\", array.getBaseTypeName());\n\t\tarray = new ListArray(list, Types.JAVA_OBJECT);\n\t\tassertEquals(\"JAVA_OBJECT\", array.getBaseTypeName());\n\t}", "void type() throws IOException {\n\t\tmatch(Tag.BASIC);\n\t\tif (look.tag != '[')\n\t\t\treturn; // Type -> basic\t\t\t\t\t// dims -> epsilon\n\t\telse\n\t\t\tdims(); // parse array type\n\t}", "Array createArray();", "public static native int GetType(long lpjFbxDataType);", "public Type[] types();", "@SuppressWarnings(\"unchecked\")\n private T[] createArray(int size) {\n return (T[]) Array.newInstance(type, size);\n }", "public <Q> Q[] asDataArray(Q[] a);", "public Type type(String name);", "private String resolveRawTypeName(String typeName) {\n\t\tif (typeName == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tboolean isArray = typeName.startsWith(StringPool.LEFT_SQ_BRACKET);\n\t\tif (isArray) {\n\t\t\ttypeName = typeName.substring(1);\n\t\t}\n\n\t\tString rawTypeName;\n\n\t\tif (generics.containsKey(typeName)) {\n\t\t\trawTypeName = generics.get(typeName);\n\t\t}\n\t\telse {\n\t\t\trawTypeName = targetClassInfo.getGenerics().getOrDefault(typeName, typeName);\n\t\t}\n\n\t\tif (isArray) {\n\t\t\trawTypeName = '[' + rawTypeName;\n\t\t}\n\n\t\treturn rawTypeName;\n\t}", "void visitArray(Object array, Type componentType);", "void setGeneralNameArray(org.apache.geronimo.corba.xbeans.csiv2.tss.TSSGeneralNameType[] generalNameArray);", "public native String passingDataToJni(float[] audio_data, int array_length);", "public void set_array(String type){\n while (true){\n\n General_imp construct = new General_imp();\n\n construct.print_type( type);\n String ans = construct.input();\n if (ans.equals(\"EXIT\"))\n break;\n setatribs(ans, type);\n }\n }", "@VisibleForTesting\n public static TagValue[] createTagValues(int size, String name) {\n TagValue[] values = new TagValue[size];\n for (int i = 0; i < size; i++) {\n values[i] = TagValue.create(name + i);\n }\n return values;\n }", "public DynamicArray(){\n\t \n\t array = (E[]) new Object[dim];\n }", "public ArrayVariable getArray(String rootName) {\n\t\treturn (ArrayVariable)get(rootName);\n\t}", "private static void improveArrayMethodTyping(Method m, TypeReference arrayTypeParameter) {\n checkState(\"Array\".equals(m.getEnclosingType().getNativeFqn()));\n checkState(m.getParameters().size() == 1);\n Parameter firstParameter = m.getParameters().get(0);\n checkState(PredefinedTypeReference.OBJECT.equals(firstParameter.getType()));\n m.getParameters()\n .set(0, firstParameter.toBuilder().setName(\"items\").setType(arrayTypeParameter).build());\n }", "public LlvmValue visit(ArrayLength n){\n\t\t\n\t\tint index = 0;\n\t\tchar type_char;\n\t\tSystem.out.format(\"arraylength:******\\n\");\n\n\t\t//System.out.format(\"****n, n.array: %s \\n%s\\n\",n,n.array);\n\t\t\n\t\t//Desce para o array, e pega o registrador que aponta para ela\n\t\tLlvmValue array = n.array.accept(this);\n\t\t\n\t\t//System.out.format(\"array e array.type: %s \\n%s\\n\",array,array.type);\n\t\t\n\t\tStringBuilder type = new StringBuilder();\n\t\ttype.append(array.type.toString());\n\t\t\n\t\t//System.out.format(\"type: %s\\n\",type);\n\t\t\n\t\tStringBuilder lengths = new StringBuilder();\n\t\t\n\t\t//Temos que verificar se a array foi alocada dinamicamente ou estaticamente, para poder\n\t\t//alterar a forma de pegar o length.\n\t\tif(array.type.toString().contains(\"* *\")){\n\t\t\t//Dinamicamente... nesse caso alocamos o primeiro slot da array para colocar o tamanho\n\t\t\t//System.out.format(\"array declarada dinamicamente... carregando tamanho do primeiro endereco\\n\");\n\t\t\t\n\t\t\t//Carregando tamanho do inicio da array\n\t\t\tLinkedList<LlvmValue> offsets = new LinkedList<LlvmValue>();\n\t\t\t\n\t\t\t//Offsets do getelementptr\n\t\t\toffsets.add(new LlvmIntegerLiteral(0));\n\t\t\t\n\t\t\t//Registrador onde receberemos o pointer para o array (**)\n\t\t\tLlvmRegister length_ptr = new LlvmRegister(new LlvmPointer(LlvmPrimitiveType.I32PTR));\n\n\t\t\t//Pegando o endereco da array\n\t\t\tassembler.add(new LlvmGetElementPointer(length_ptr, array, offsets));\n\t\t\t\n\t\t\t//Registrador no qual vamos carregar a array (*)\n\t\t\tLlvmRegister array_reg = new LlvmRegister(new LlvmPointer(LlvmPrimitiveType.I32));\n\t\t\t\n\t\t\t//Array carregada\n\t\t\tassembler.add(new LlvmLoad(array_reg, length_ptr));\n\t\t\t\n\t\t\t//Registrador no qual vamos carregar o primeiro elemento da array\n\t\t\tLlvmRegister array_size = new LlvmRegister(LlvmPrimitiveType.I32);\n\t\t\t\n\t\t\t//Carrega o size do endereco inicial da array.\n\t\t\tassembler.add(new LlvmLoad(array_size, array_reg));\n\t\t\t\n\t\t\treturn array_size;\n\t\t}\n\t\telse{\n\t\t\t//estaticamente. dessa forma conseguimos retirar o tamanho da array pelo tipo dela.\n\t\t\t//agora vamos parsear esse tamanho, em busca do tamanho total da string...\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\ttype_char = type.charAt(index);\n\t\t\t\tif(type_char=='i'){\n\t\t\t\t\t//System.out.format(\"fim\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//System.out.format(\"char atual:%c\\n\",type.charAt(index));\n\t\t\t\tif(type_char=='x'){\n\t\t\t\t\t//System.out.format(\"x\\n\");\n\t\t\t\t\tlengths.append(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Achei um numero...\n\t\t\t\tif(type_char != 'x' && type_char != ' ' && type_char != '['){\n\t\t\t\t\t//System.out.format(\"numero: %c\\n\", type_char);\n\t\t\t\t\tlengths.append(type_char);\n\t\t\t\t}\n\t\t\t\tif(type_char == '['){\n\t\t\t\t\t//System.out.format(\"[\\n\");\n\t\t\t\t}\n\t\t\t\tif(type_char == ' '){\n\t\t\t\t\t//System.out.format(\"space\\n\");\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.format(\"lengths: %s\\n\", lengths);\n\t\t\t//System.out.format(\"lengths.length: %s\\n\", lengths.length());\n\t\t\tindex = 0;\n\t\t\t\n\t\t\tStringBuilder length = new StringBuilder();\n\t\t\tint total_length = 1;\n\t\t\twhile(index < lengths.length()){\n\t\t\t\ttype_char = lengths.charAt(index);\n\t\t\t\tif(type_char == '\\0'){\n\t\t\t\t\t//System.out.format(\"fim\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(type_char!=' '){\n\t\t\t\t\tlength.append(type_char);\n\t\t\t\t}else{\n\t\t\t\t\t//System.out.format(\"space\\n\");\n\t\t\t\t\t//para cada nivel de array, multiplicamos pelo nivel anterior.\n\t\t\t\t\t//por exemplo, se for [10 x [20 x i32]] fica 10x20\n\t\t\t\t\ttotal_length = total_length * Integer.parseInt(length.toString());\n\t\t\t\t\t//System.out.format(\"total_length: %d\\n\",total_length);\n\t\t\t\t\tlength = new StringBuilder();\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\t\n\t\t\tLlvmIntegerLiteral length_final = new LlvmIntegerLiteral(total_length);\n\t\t\t\n\t\t\treturn length_final;\n\t\t}\n\t}", "int sizeOfGeneralNameArray();" ]
[ "0.6039065", "0.60243624", "0.5979487", "0.59394175", "0.57457745", "0.573816", "0.5627873", "0.55761933", "0.5499579", "0.54732233", "0.5464092", "0.54371536", "0.5375558", "0.5352135", "0.5308981", "0.52463216", "0.5233571", "0.52254397", "0.52120763", "0.51918375", "0.5146624", "0.5135359", "0.5083238", "0.50234854", "0.4991832", "0.49583402", "0.49407476", "0.49405408", "0.49335", "0.4923934", "0.4895151", "0.4870239", "0.48696327", "0.48493516", "0.48487535", "0.4845381", "0.48389888", "0.48261797", "0.48070621", "0.48023486", "0.47983325", "0.47660986", "0.47492784", "0.47266376", "0.47070396", "0.4700196", "0.46942496", "0.46913362", "0.4656619", "0.46475586", "0.46338737", "0.46311396", "0.4618359", "0.4617976", "0.46091768", "0.4583052", "0.45688605", "0.45687443", "0.4566995", "0.45566496", "0.45536557", "0.45520836", "0.45514107", "0.45414615", "0.4521492", "0.451921", "0.45154727", "0.45117745", "0.4510291", "0.45095617", "0.45076743", "0.45056814", "0.44925746", "0.44655782", "0.44639546", "0.44623286", "0.44600695", "0.4429707", "0.4422377", "0.4418594", "0.4415799", "0.44108918", "0.43969065", "0.43955064", "0.4392901", "0.43923694", "0.43872282", "0.4386539", "0.43860924", "0.43812054", "0.43775994", "0.43650883", "0.43614948", "0.43537146", "0.435111", "0.434843", "0.43426424", "0.43369564", "0.43368167", "0.43331563" ]
0.49235803
30
ListView Clicked item index
@Override public void onItemClick(AdapterView<?> adapter, View view, int position, long id) { throwActivity(position, (String)listView.getItemAtPosition(position)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onItemClick(int position);", "public void onItemClick(View view, int position);", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n\n Intent intent = new Intent(MainActivity.this, ImageActivity.class);\n intent.putExtra(\"index\", i);\n startActivity(intent);\n\n }", "@Override\n public void onListItemClicked(int position) {\n\n }", "void onItemClick(View view, int position);", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n int itemPosition = position;\n\n // ListView Clicked item value\n String itemValue = (String) listView.getItemAtPosition(position);\n\n // Show Alert\n Toast.makeText(getApplicationContext(),\n \"Position :\" + itemPosition + \" ListItem : \" + itemValue, Toast.LENGTH_LONG)\n .show();\n\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n int itemPosition = position;\n\n // ListView Clicked item value\n String itemValue = (String) listView.getItemAtPosition(position);\n\n // Show Alert\n Toast.makeText(getApplicationContext(), \"Position :\" + itemPosition + \" ListItem : \" + itemValue , Toast.LENGTH_LONG).show();\n }", "void onClick(int index);", "@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }", "public void onListItemClick(ListView list, View v, int position, long id)\n {\n Intent intent = new Intent(MainActivity.this, EventActivities.class);\n intent.putExtra(\"c\", position);\n startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\r\n public void onItemClick(AdapterView<?> parent, View view,\r\n int position, long id) {\n int itemPosition = position;\r\n\r\n // ListView Clicked item value\r\n String itemValue = (String) listView.getItemAtPosition(position);\r\n\r\n // Show Alert\r\n Toast.makeText(getApplicationContext(),\r\n \"Position :\"+itemPosition+\" ListItem : \" +itemValue , Toast.LENGTH_LONG)\r\n .show();\r\n }", "@Override\r\n public void onItemClick(AdapterView<?> parent, View view,\r\n int position, long id) {\n int itemPosition = position;\r\n\r\n // ListView Clicked item value\r\n String itemValue = (String) listView.getItemAtPosition(position);\r\n\r\n // Show Alert\r\n Toast.makeText(getApplicationContext(),\r\n \"Position :\"+itemPosition+\" ListItem : \" +itemValue , Toast.LENGTH_LONG)\r\n .show();\r\n\r\n }", "@Override\n public void onItemClick(int pos) {\n }", "public void onListItemClick( ListView l, View v, int position, long id )\n {\n }", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n super.onListItemClick(l, v, position, id);\n SkillModel md = (SkillModel) l.getAdapter().getItem(position);\n //SkillModel md = ((pro_adapter)getListAdapter()).getItem(position);\n String pos = Integer.toString(position);\n Log.d(\"click\", pos);\n com.itemSelected(md.id);\n\n\n\n }", "@Override\n public void OnItemClick(int position) {\n }", "public void onItemClick(View view, int position) {\n\n }", "void onItemClickListener(View view, int postion);", "void onClick(View item, View widget, int position, int which);", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }", "@Override\n\t\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\t\n\t\t\t\t\t Log.i(\"MyListViewBase\", \"你点击了ListView条目\"+arg2);\n\t\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tif (sACTIVITY_POS == arg2) {\n\t\t\t\t\tsACTIVITY_POS = -1;\n\t\t\t\t} else\n\t\t\t\t\tsACTIVITY_POS = arg2;\n\t\t\t//\tsACTIVITY_POS = arg2;\n\t\t\t\tactivityAdapter.notifyDataSetChanged();\n\t\t\t\t\n\n\t\t\t}", "void onChamaItemClicked(int position);", "public void onItemClick(AdapterView<?> parent,\n View v, int position, long id){\n Intent i = new Intent(getApplicationContext(), SingleViewActivity.class);\n // Pass image index\n i.putExtra(\"id\", position);\n startActivity(i);\n }", "@Override\r\n public void onListItemClick(ListView l, View v, int position, long id) {\n }", "@Override\n public void itemClick(int pos) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }", "void onListInteraction(int index, boolean isLongClicked);", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n Holder holder=new Holder();\n View rowView;\n rowView = inflater.inflate(R.layout.category_listview, null);\n holder.nameTextView=(TextView) rowView.findViewById(R.id.categoryName);\n holder.imgView=(ImageView) rowView.findViewById(R.id.categoryImage);\n holder.nameTextView.setText(categoryNames[position]);\n holder.imgView.setImageResource(categoryImages[position]);\n rowView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n lastSelectedSpotIndex=position;\n Toast.makeText(context, \"You Clicked \"+categoryNames[position], Toast.LENGTH_LONG).show();\n }\n });\n return rowView;\n }", "@Override\n public void onItemClick(Nson parent, View view, int position) {\n }", "@Override\n public void onClick(View v) {\n\n listener.onClickPosition(getAdapterPosition());\n // Log.d(\"TAG\", \"Element \" + getAdapterPosition() + \" clicked. \");\n }", "@Override\n public void onClick(View v) {\n //getAdapterPosition() get's an Integer based on which the position of the current\n //ViewHolder (this) in the Adapter. This is how we get the correct Data.\n ListItem listItem = listOfData.get(\n this.getAdapterPosition()\n );\n\n controller.onListItemClick(\n listItem,\n v\n );\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { //on click listener\n Intent showDetailActivity = new Intent(getApplicationContext(), DetailActivity.class); //create an intent that points to the DetailActivity class\n showDetailActivity.putExtra(\"com.example.listapp.itemIndex\", i); //we put the index of the item clicked in the intent to get the image\n startActivity(showDetailActivity); //we show the activity in DetailActivity and run the onCreate method there\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(View view, int position) {\n\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View v, int pos, long id) {\n\t\t\t\tSystem.out.println(\"Selected \" + pos);\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n int itemPosition = position;\n \n // ListView Clicked item value\n String itemValue = (String) lvView.getItemAtPosition(position);\n \n Intent newActivity;\n switch( position ) {\n case 0: \n \t \t\tnewActivity = new Intent(Recommendations.this, RecJermaineJemmott.class); \n startActivity(newActivity);\n finish();\n break;\n \n case 1: \n \t \t\tnewActivity = new Intent(Recommendations.this, RecFrankBird.class); \n startActivity(newActivity);\n finish();\n break;\n \n case 2: \n \t \t\tnewActivity = new Intent(Recommendations.this, RecLeeAsh.class); \n startActivity(newActivity);\n finish();\n break;\n \n }\n }", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "@Override\n public void onItemClick(View view, int position){\n }", "public int getItemIndex() {\n return this.itemIndex;\n }", "public void onClickNom(Personne item, int position);", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n JobInterviewPreview.this.goToInterview(position);\n }", "void onItemClick(HorizontalGridView parent, View view, int position,\n long id);", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n Intent intent = new Intent(context, CaculateScoreActivity.class);\n intent.putExtra(\"index\", i);\n intent.putExtra(\"player_info\", gameInfoData.getPlayerInfoJsonString(i));\n startActivityForResult(intent, OPEN_CACULATE_SCORE);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }", "public void onItemSelecting(AdapterView<?> parent, View view, int oldPosition, int newPosition);", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\n public long getItemId(int index) {\n return index;\n }", "public void handleListClick(int index) {\n try {\n this.executeCommand(\"view \" + (index + 1));\n } catch (CommandException | ParseException e) {\n logger.info(\"Invalid command: view \" + (index + 1));\n resultDisplay.setFeedbackToUser(e.getMessage());\n }\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void onClick(View v) {\n\t\tTextView selectedIndex = (TextView) v;\n\t\tlistView.setSelection(index.get(selectedIndex.getText()));\n\t}", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tchoosed = pos;\n\t\t\t\t\t\tSingleListAdaper.this.notifyDataSetChanged();\n\t\t\t\t\t}", "@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void onListItemClick(ListView l, View v, int position, long id) {\n\t \n\t }", "@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\n public void onItemClick(View view, int position) {\n Toast.makeText(getContext(), \"You clicked \" + adapter.getItem(position) + \" on row number \" + position, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent intent = new Intent(SearchResultActivity.this, UrbanWordActivity.class);\n intent.putExtra(\"position\", position);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n int mPosition = getLayoutPosition();\n // Use that to access the affected item in cryptoList.\n double idClicked = cryptoList.get(mPosition).market_cap_rank; //[mPosition].market_cap_rank; //get(mPosition);\n\n Intent i = new Intent(v.getContext(), Detail.class);\n i.putExtra(\"rank\", idClicked);\n v.getContext().startActivity(i);\n\n\n }", "@Override\n public void onClick(View view, int position, boolean isLongClick) {\n Intent foodListIntent = new Intent(Home.this,FoodList.class);\n // CategoryId is a key , so we just get the key of the clicked item\n foodListIntent.putExtra(\"categoryId\" , adapter.getRef(position).getKey());\n startActivity(foodListIntent);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "public int getItemIndex() {\n return itemIndex;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n\n clickedValue = teams.get(position).name.toString();\n\n Intent intent = new Intent(teamSelection.this, Signup.class);\n\n intent.putExtra(\"ListViewClickedValue\", clickedValue);\n startActivity(intent);\n\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n posicion_click = position;\n Intent intent = new Intent(getActivity(),select.class);\n startActivity(intent);\n }", "int getItem(int index);", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}", "@Override\n protected void onListItemClick(ListView l, View v, int position, long id) {\n \t\n \t\n }", "private AdapterView.OnItemClickListener onItemClick() {\n return new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent intent = new Intent(MainActivity.this, CustomerActivity.class);\n intent.putExtra(Arguments.CASE_ARG, position); //TODO\n startActivity(intent);\n }\n };\n }", "@Override\r\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\r\n\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t\tif (which == 0) {\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"postion==\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ position);\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"id==\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ items.get(position - 1)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getId());\r\n\t\t\t\t\t\t\t\t\t\tboolean delete = databaseHelper\r\n\t\t\t\t\t\t\t\t\t\t\t\t.deleteNoteById(items.get(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition - 1).getId());\r\n\t\t\t\t\t\t\t\t\t\t// System.out.println(\"position==\"+position+\",\"+\"delete==\"+delete);\r\n\t\t\t\t\t\t\t\t\t\titems = getData();\r\n\t\t\t\t\t\t\t\t\t\tadapter = new NoteAdapter(\r\n\t\t\t\t\t\t\t\t\t\t\t\tNoteListActivity.this, items,\r\n\t\t\t\t\t\t\t\t\t\t\t\tisNull);\r\n\t\t\t\t\t\t\t\t\t\tlistView.setAdapter(adapter);\r\n\t\t\t\t\t\t\t\t\t} else if (which == 1) {\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\r\n\tprotected boolean onTap(int index) {\n\t\tnumber = index;\r\n\t\treturn super.onTap(index);\r\n\t}", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> adapter, View view, int position,\r\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}", "@Override\n public void onClick(View v)\n {\n int adapterPosition = getAdapterPosition();\n mCursor.moveToPosition(adapterPosition);\n int recipeID = mCursor.getInt(MainActivity.INDEX_RECIPE_ID);\n String recipeName = mCursor.getString(MainActivity.INDEX_RECIPE_NAME);\n mClickHandler.onClickRecipeAdapter(recipeID, recipeName);\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}" ]
[ "0.727802", "0.7239286", "0.7165664", "0.71425855", "0.71325344", "0.7130872", "0.71086955", "0.71045315", "0.7103713", "0.71013945", "0.7069466", "0.7047616", "0.7047616", "0.7042995", "0.7031777", "0.70194507", "0.70138186", "0.6987547", "0.6981235", "0.69586766", "0.6954508", "0.69052535", "0.6825144", "0.68039846", "0.6787164", "0.67853576", "0.67853576", "0.67853576", "0.6775374", "0.6775374", "0.6760298", "0.6747565", "0.6726967", "0.6724905", "0.67213935", "0.67197645", "0.67197645", "0.67197645", "0.67197645", "0.67197645", "0.67120796", "0.67046064", "0.67046064", "0.6690368", "0.6690196", "0.66754955", "0.66710263", "0.6669991", "0.66699195", "0.66661173", "0.66622674", "0.665536", "0.66425025", "0.66425025", "0.66324234", "0.66213685", "0.6613417", "0.65987647", "0.65951633", "0.6589196", "0.65834934", "0.65772414", "0.6559117", "0.6544769", "0.6540745", "0.65242267", "0.65226185", "0.65226185", "0.65197426", "0.65192056", "0.6517914", "0.6517783", "0.65164953", "0.65115774", "0.6499083", "0.6498222", "0.6495493", "0.6495334", "0.6493703", "0.6490288", "0.64876306", "0.6482395", "0.6482395", "0.64821064", "0.6479756", "0.647372", "0.64553946", "0.6453518", "0.6453217", "0.64498216", "0.64439636", "0.64419144", "0.6431778", "0.6423636", "0.64214224", "0.64164335", "0.6411513", "0.64021206", "0.6401521", "0.6401521", "0.6398036" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.places, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7246451", "0.7201833", "0.7195169", "0.7176824", "0.71071094", "0.7039687", "0.70379424", "0.7011622", "0.70095545", "0.69799995", "0.6945173", "0.69389343", "0.6933555", "0.69172555", "0.69172555", "0.68906796", "0.688355", "0.687496", "0.6874772", "0.68613136", "0.68613136", "0.68613136", "0.68613136", "0.6852252", "0.6846455", "0.6818823", "0.6816676", "0.68122935", "0.68119055", "0.68119055", "0.6805087", "0.68003947", "0.6797015", "0.67904633", "0.6789411", "0.67871827", "0.6782913", "0.67593676", "0.6756442", "0.6747255", "0.6742987", "0.6742987", "0.6740183", "0.67392707", "0.67249876", "0.67237884", "0.67217875", "0.67217875", "0.6719964", "0.6711429", "0.6706682", "0.67035955", "0.6699167", "0.66980296", "0.6696009", "0.6694031", "0.66855574", "0.66825926", "0.66825926", "0.6682556", "0.66795844", "0.6678825", "0.6676161", "0.66680866", "0.66665506", "0.66625977", "0.6657122", "0.6657122", "0.6657122", "0.6656225", "0.6653723", "0.6653723", "0.6653723", "0.66520125", "0.6651581", "0.6649255", "0.6648212", "0.6646545", "0.6646233", "0.66460145", "0.6645477", "0.6644324", "0.66441935", "0.6642723", "0.66420346", "0.66412085", "0.6638387", "0.6633755", "0.66334134", "0.66321", "0.663127", "0.663127", "0.663127", "0.6628276", "0.6627496", "0.6626989", "0.6625628", "0.6623483", "0.6620039", "0.66181844", "0.66181844" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.79041183", "0.7805934", "0.77659106", "0.7727251", "0.7631684", "0.7621701", "0.75839096", "0.75300384", "0.74873656", "0.7458051", "0.7458051", "0.7438486", "0.742157", "0.7403794", "0.7391802", "0.73870087", "0.7379108", "0.7370295", "0.7362194", "0.7355759", "0.73454577", "0.734109", "0.73295504", "0.7327726", "0.73259085", "0.73188347", "0.731648", "0.73134047", "0.7303978", "0.7303978", "0.7301588", "0.7298084", "0.72932935", "0.7286338", "0.7283324", "0.72808945", "0.72785115", "0.72597474", "0.72597474", "0.72597474", "0.725962", "0.7259136", "0.7249966", "0.7224023", "0.721937", "0.7216621", "0.72045326", "0.7200649", "0.71991026", "0.71923256", "0.71851367", "0.7176769", "0.7168457", "0.71675026", "0.7153402", "0.71533287", "0.71352696", "0.71350807", "0.71350807", "0.7129153", "0.7128639", "0.7124181", "0.7123387", "0.7122983", "0.71220255", "0.711715", "0.711715", "0.711715", "0.711715", "0.7117043", "0.71169263", "0.7116624", "0.71149373", "0.71123946", "0.7109806", "0.7108778", "0.710536", "0.7098968", "0.70981944", "0.7095771", "0.7093572", "0.7093572", "0.70862055", "0.7082207", "0.70808214", "0.7080366", "0.7073644", "0.7068183", "0.706161", "0.7060019", "0.70598614", "0.7051272", "0.70374316", "0.70374316", "0.7035865", "0.70352185", "0.70352185", "0.7031749", "0.703084", "0.7029517", "0.7018633" ]
0.0
-1
.PlainTokenAction plain_action = 1;
boolean hasPlainAction();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction();", "org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder();", "private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Token () { }", "void tokenchange();", "public Builder setPlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n action_ = value;\n onChanged();\n } else {\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public Token() {\n this.clitic = \"none\";\n }", "void token(TokenNode node);", "public void setToken(int value){token = value;}", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n } else {\n if (actionCase_ == 1) {\n return plainActionBuilder_.getMessage();\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "public String getTokenValue() { return tok; }", "public void setToken(java.lang.String param){\n localTokenTracker = true;\n \n this.localToken=param;\n \n\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public String getToken();", "public void setToken(String token) {\r\n this.token = token;\r\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if ((actionCase_ == 1) && (plainActionBuilder_ != null)) {\n return plainActionBuilder_.getMessageOrBuilder();\n } else {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "Token next();", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "public Token() {\n }", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "public Token() {\n }", "public void onSuccess(Token token) {\n\n }", "public void printToken(){\r\n System.out.println(\"Kind: \" + kind + \" , Lexeme: \" + lexeme);\r\n }", "public String token() {\n return this.token;\n }", "public YammerNewPrivateMessageAction(String token) {\n this.token = token;\n }", "public java.lang.String getToken(){\n return localToken;\n }", "Token current();", "public void putToken(Token token)throws Exception;", "public String getToken_type() {\r\n\t\treturn token_type;\r\n\t}", "public void setToken(String token) {\n\t\tthis.token = token;\n\t}", "public String getToken()\n {\n return token;\n }", "public String getToken() {\r\n return token;\r\n }", "public String getToken() {\r\n return token;\r\n }", "@Override\r\n\tpublic Token createToken() {\n\t\tToken token = new Token();\r\n\t\treturn token;\r\n\t}", "public TemplexTokenMaker() {\r\n\t\tsuper();\r\n\t}", "public void alg_PASSTOKEN(){\nTokenOut.value=true;\nSystem.out.println(\"pass\");\n\n}", "@Test\n public void parseToken() {\n }", "public String getToken() {\n return this.token;\n }", "public void alg_HOLDTOKEN(){\nTokenOut.value=false;\nSystem.out.println(\"hold\");\n\n}", "@Override\n protected String getEvaluableToken() {\n return TOKEN;\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder getPlainActionBuilder() {\n return getPlainActionFieldBuilder().getBuilder();\n }", "@Override\n public void onNewToken(String token) {\n Log.e(\"Token:\", token);\n }", "int getTokenStart();", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public void tokenArrived(Object token)\n {\n }", "public String token() {\n return Codegen.stringProp(\"token\").config(config).require();\n }", "@Override\n\tpublic Token getToken() {\n\t\treturn this.token;\n\t\t\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "byte[] token();", "void putToken(String name, String value);", "public LexicalToken(TokenType type) {\n\t\tthis.type = type;\n\t}", "java_cup.runtime.Symbol TOKEN(int code) { return TOKEN(code, yytext()); }", "public T getToken() {\n return this.token;\n }", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "public Token(String tipo, String lexema){\n\t\tthis.tipo = tipo;\n\t\tthis.lexema = lexema;\n\t}", "public void setToken(final String token) {\n this.token = token;\n }", "@Override\n\tprotected String getEvaluableToken() {\n\t\treturn TOKEN;\n\t}", "private Token token(final TermToken tt) {\n return tt.hasLexicalToken() ? tt.token().token() : null;\n }", "public Builder mergePlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1 &&\n action_ != org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_)\n .mergeFrom(value).buildPartial();\n } else {\n action_ = value;\n }\n onChanged();\n } else {\n if (actionCase_ == 1) {\n plainActionBuilder_.mergeFrom(value);\n }\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "@Override\n\tpublic void setToken(Token token) {\n\t\tthis.token = token;\n\t\t\n\t}", "public String getToken() {\n return this.token;\n }", "public void setToken(byte token[]) {\n\t\tthis.token = token;\n\t}", "private com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder> \n getPlainActionFieldBuilder() {\n if (plainActionBuilder_ == null) {\n if (!(actionCase_ == 1)) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n plainActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>(\n (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_,\n getParentForChildren(),\n isClean());\n action_ = null;\n }\n actionCase_ = 1;\n onChanged();;\n return plainActionBuilder_;\n }", "public TYPE tokenType(){\n\n return currentTokenType;\n }", "String getTokenString();", "GetToken.Req getGetTokenReq();", "public String getToken() {\n return token.get();\n }", "public Builder setPlainAction(\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder builderForValue) {\n if (plainActionBuilder_ == null) {\n action_ = builderForValue.build();\n onChanged();\n } else {\n plainActionBuilder_.setMessage(builderForValue.build());\n }\n actionCase_ = 1;\n return this;\n }", "private void tokenStart() {\n tokenStartIndex = zzStartRead;\n }", "public APIToken() {\n super();\n }", "public void setToken(String token) {\r\n hc.setToken(token);\r\n }", "public String getToken() {\n return this.token;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public Token setToken(String token) {\n this.token = token;\n return this;\n }" ]
[ "0.7148013", "0.67840284", "0.64335275", "0.6307667", "0.6277779", "0.6261444", "0.62344927", "0.6230079", "0.6210272", "0.62097347", "0.6113519", "0.6061834", "0.6030614", "0.6025248", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5988666", "0.5978114", "0.596341", "0.5962982", "0.5962982", "0.5962982", "0.5962982", "0.5962982", "0.59460515", "0.59426445", "0.59426445", "0.5914283", "0.5887248", "0.583805", "0.58132994", "0.58067626", "0.57943374", "0.579271", "0.5751333", "0.57444435", "0.5711302", "0.5689569", "0.5679402", "0.5673965", "0.5666845", "0.5666845", "0.5650891", "0.56237483", "0.5618539", "0.56072116", "0.56061184", "0.5577605", "0.5571177", "0.55660874", "0.5561964", "0.55578345", "0.55563086", "0.55563086", "0.55563086", "0.55563086", "0.55563086", "0.5530541", "0.55049074", "0.5504175", "0.5503833", "0.5503833", "0.54967326", "0.5492789", "0.5488745", "0.54884326", "0.5465789", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.5448594", "0.5447304", "0.5442689", "0.54331213", "0.542342", "0.5419929", "0.5415918", "0.54059273", "0.54058194", "0.53980833", "0.53630054", "0.5356992", "0.5354206", "0.5352228", "0.5345044", "0.5342727", "0.53418994", "0.53305274", "0.5330377", "0.53282166" ]
0.0
-1
.PlainTokenAction plain_action = 1;
org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder();", "private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Token () { }", "void tokenchange();", "public Builder setPlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n action_ = value;\n onChanged();\n } else {\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public Token() {\n this.clitic = \"none\";\n }", "void token(TokenNode node);", "public void setToken(int value){token = value;}", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n } else {\n if (actionCase_ == 1) {\n return plainActionBuilder_.getMessage();\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "public String getTokenValue() { return tok; }", "public void setToken(java.lang.String param){\n localTokenTracker = true;\n \n this.localToken=param;\n \n\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public String getToken();", "public void setToken(String token) {\r\n this.token = token;\r\n }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if ((actionCase_ == 1) && (plainActionBuilder_ != null)) {\n return plainActionBuilder_.getMessageOrBuilder();\n } else {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "Token next();", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "public Token() {\n }", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "public Token() {\n }", "public void onSuccess(Token token) {\n\n }", "public void printToken(){\r\n System.out.println(\"Kind: \" + kind + \" , Lexeme: \" + lexeme);\r\n }", "public String token() {\n return this.token;\n }", "public YammerNewPrivateMessageAction(String token) {\n this.token = token;\n }", "public java.lang.String getToken(){\n return localToken;\n }", "Token current();", "public void putToken(Token token)throws Exception;", "public String getToken_type() {\r\n\t\treturn token_type;\r\n\t}", "public void setToken(String token) {\n\t\tthis.token = token;\n\t}", "public String getToken()\n {\n return token;\n }", "public String getToken() {\r\n return token;\r\n }", "public String getToken() {\r\n return token;\r\n }", "@Override\r\n\tpublic Token createToken() {\n\t\tToken token = new Token();\r\n\t\treturn token;\r\n\t}", "public TemplexTokenMaker() {\r\n\t\tsuper();\r\n\t}", "public void alg_PASSTOKEN(){\nTokenOut.value=true;\nSystem.out.println(\"pass\");\n\n}", "@Test\n public void parseToken() {\n }", "public String getToken() {\n return this.token;\n }", "public void alg_HOLDTOKEN(){\nTokenOut.value=false;\nSystem.out.println(\"hold\");\n\n}", "@Override\n protected String getEvaluableToken() {\n return TOKEN;\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder getPlainActionBuilder() {\n return getPlainActionFieldBuilder().getBuilder();\n }", "@Override\n public void onNewToken(String token) {\n Log.e(\"Token:\", token);\n }", "int getTokenStart();", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public void tokenArrived(Object token)\n {\n }", "public String token() {\n return Codegen.stringProp(\"token\").config(config).require();\n }", "@Override\n\tpublic Token getToken() {\n\t\treturn this.token;\n\t\t\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "byte[] token();", "void putToken(String name, String value);", "public LexicalToken(TokenType type) {\n\t\tthis.type = type;\n\t}", "java_cup.runtime.Symbol TOKEN(int code) { return TOKEN(code, yytext()); }", "public T getToken() {\n return this.token;\n }", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "public void setToken(final String token) {\n this.token = token;\n }", "public Token(String tipo, String lexema){\n\t\tthis.tipo = tipo;\n\t\tthis.lexema = lexema;\n\t}", "@Override\n\tprotected String getEvaluableToken() {\n\t\treturn TOKEN;\n\t}", "private Token token(final TermToken tt) {\n return tt.hasLexicalToken() ? tt.token().token() : null;\n }", "public Builder mergePlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1 &&\n action_ != org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_)\n .mergeFrom(value).buildPartial();\n } else {\n action_ = value;\n }\n onChanged();\n } else {\n if (actionCase_ == 1) {\n plainActionBuilder_.mergeFrom(value);\n }\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "@Override\n\tpublic void setToken(Token token) {\n\t\tthis.token = token;\n\t\t\n\t}", "public String getToken() {\n return this.token;\n }", "private com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder> \n getPlainActionFieldBuilder() {\n if (plainActionBuilder_ == null) {\n if (!(actionCase_ == 1)) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n plainActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>(\n (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_,\n getParentForChildren(),\n isClean());\n action_ = null;\n }\n actionCase_ = 1;\n onChanged();;\n return plainActionBuilder_;\n }", "public void setToken(byte token[]) {\n\t\tthis.token = token;\n\t}", "public TYPE tokenType(){\n\n return currentTokenType;\n }", "String getTokenString();", "GetToken.Req getGetTokenReq();", "public String getToken() {\n return token.get();\n }", "public Builder setPlainAction(\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder builderForValue) {\n if (plainActionBuilder_ == null) {\n action_ = builderForValue.build();\n onChanged();\n } else {\n plainActionBuilder_.setMessage(builderForValue.build());\n }\n actionCase_ = 1;\n return this;\n }", "private void tokenStart() {\n tokenStartIndex = zzStartRead;\n }", "public void setToken(String token) {\r\n hc.setToken(token);\r\n }", "public APIToken() {\n super();\n }", "public String getToken() {\n return this.token;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public Token setToken(String token) {\n this.token = token;\n return this;\n }" ]
[ "0.6784173", "0.643421", "0.63084626", "0.6277919", "0.6260859", "0.6235223", "0.62304133", "0.6210552", "0.6209701", "0.6113603", "0.60619324", "0.6030647", "0.60260844", "0.5996384", "0.5996384", "0.5996384", "0.5996384", "0.5996384", "0.5996384", "0.5989664", "0.597915", "0.5963719", "0.5963719", "0.5963719", "0.5963719", "0.5963719", "0.5963296", "0.59459174", "0.59436625", "0.59436625", "0.59148145", "0.5888295", "0.58387554", "0.58140725", "0.58071256", "0.57950443", "0.57936245", "0.5752472", "0.57440686", "0.5712527", "0.56907654", "0.5680503", "0.5675064", "0.56679195", "0.56679195", "0.56517076", "0.56242377", "0.56181556", "0.56074744", "0.5607217", "0.5577309", "0.55716276", "0.55664665", "0.5563448", "0.5557953", "0.5557458", "0.5557458", "0.5557458", "0.5557458", "0.5557458", "0.55309737", "0.55057526", "0.55049443", "0.550489", "0.550489", "0.54964906", "0.54935783", "0.548874", "0.54881054", "0.54666406", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5448467", "0.5448423", "0.5443096", "0.5433633", "0.5422847", "0.5421009", "0.5417083", "0.54060084", "0.5405907", "0.53989285", "0.53639376", "0.5358087", "0.5355444", "0.53517413", "0.5345077", "0.53431237", "0.5342326", "0.53316873", "0.53316194", "0.5329495" ]
0.7148459
0
.PlainTokenAction plain_action = 1;
org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction();", "private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Token () { }", "void tokenchange();", "public Builder setPlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n action_ = value;\n onChanged();\n } else {\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public Token() {\n this.clitic = \"none\";\n }", "void token(TokenNode node);", "public void setToken(int value){token = value;}", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n } else {\n if (actionCase_ == 1) {\n return plainActionBuilder_.getMessage();\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "public String getTokenValue() { return tok; }", "public void setToken(java.lang.String param){\n localTokenTracker = true;\n \n this.localToken=param;\n \n\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public String getToken();", "public void setToken(String token) {\r\n this.token = token;\r\n }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if ((actionCase_ == 1) && (plainActionBuilder_ != null)) {\n return plainActionBuilder_.getMessageOrBuilder();\n } else {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "Token next();", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "public Token() {\n }", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "public Token() {\n }", "public void onSuccess(Token token) {\n\n }", "public void printToken(){\r\n System.out.println(\"Kind: \" + kind + \" , Lexeme: \" + lexeme);\r\n }", "public String token() {\n return this.token;\n }", "public YammerNewPrivateMessageAction(String token) {\n this.token = token;\n }", "public java.lang.String getToken(){\n return localToken;\n }", "Token current();", "public void putToken(Token token)throws Exception;", "public String getToken_type() {\r\n\t\treturn token_type;\r\n\t}", "public void setToken(String token) {\n\t\tthis.token = token;\n\t}", "public String getToken()\n {\n return token;\n }", "public String getToken() {\r\n return token;\r\n }", "public String getToken() {\r\n return token;\r\n }", "@Override\r\n\tpublic Token createToken() {\n\t\tToken token = new Token();\r\n\t\treturn token;\r\n\t}", "public TemplexTokenMaker() {\r\n\t\tsuper();\r\n\t}", "public void alg_PASSTOKEN(){\nTokenOut.value=true;\nSystem.out.println(\"pass\");\n\n}", "@Test\n public void parseToken() {\n }", "public String getToken() {\n return this.token;\n }", "public void alg_HOLDTOKEN(){\nTokenOut.value=false;\nSystem.out.println(\"hold\");\n\n}", "@Override\n protected String getEvaluableToken() {\n return TOKEN;\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder getPlainActionBuilder() {\n return getPlainActionFieldBuilder().getBuilder();\n }", "@Override\n public void onNewToken(String token) {\n Log.e(\"Token:\", token);\n }", "int getTokenStart();", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public void tokenArrived(Object token)\n {\n }", "public String token() {\n return Codegen.stringProp(\"token\").config(config).require();\n }", "@Override\n\tpublic Token getToken() {\n\t\treturn this.token;\n\t\t\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "byte[] token();", "void putToken(String name, String value);", "java_cup.runtime.Symbol TOKEN(int code) { return TOKEN(code, yytext()); }", "public LexicalToken(TokenType type) {\n\t\tthis.type = type;\n\t}", "public T getToken() {\n return this.token;\n }", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "public void setToken(final String token) {\n this.token = token;\n }", "public Token(String tipo, String lexema){\n\t\tthis.tipo = tipo;\n\t\tthis.lexema = lexema;\n\t}", "@Override\n\tprotected String getEvaluableToken() {\n\t\treturn TOKEN;\n\t}", "private Token token(final TermToken tt) {\n return tt.hasLexicalToken() ? tt.token().token() : null;\n }", "@Override\n\tpublic void setToken(Token token) {\n\t\tthis.token = token;\n\t\t\n\t}", "public Builder mergePlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1 &&\n action_ != org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_)\n .mergeFrom(value).buildPartial();\n } else {\n action_ = value;\n }\n onChanged();\n } else {\n if (actionCase_ == 1) {\n plainActionBuilder_.mergeFrom(value);\n }\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public String getToken() {\n return this.token;\n }", "public void setToken(byte token[]) {\n\t\tthis.token = token;\n\t}", "private com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder> \n getPlainActionFieldBuilder() {\n if (plainActionBuilder_ == null) {\n if (!(actionCase_ == 1)) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n plainActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>(\n (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_,\n getParentForChildren(),\n isClean());\n action_ = null;\n }\n actionCase_ = 1;\n onChanged();;\n return plainActionBuilder_;\n }", "public TYPE tokenType(){\n\n return currentTokenType;\n }", "String getTokenString();", "GetToken.Req getGetTokenReq();", "public String getToken() {\n return token.get();\n }", "public Builder setPlainAction(\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder builderForValue) {\n if (plainActionBuilder_ == null) {\n action_ = builderForValue.build();\n onChanged();\n } else {\n plainActionBuilder_.setMessage(builderForValue.build());\n }\n actionCase_ = 1;\n return this;\n }", "private void tokenStart() {\n tokenStartIndex = zzStartRead;\n }", "public void setToken(String token) {\r\n hc.setToken(token);\r\n }", "public APIToken() {\n super();\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public String getToken() {\n return this.token;\n }", "public Token setToken(String token) {\n this.token = token;\n return this;\n }" ]
[ "0.7147269", "0.6434504", "0.6309605", "0.627992", "0.6259949", "0.62356144", "0.62324077", "0.62120783", "0.62077457", "0.6111542", "0.60599285", "0.60309434", "0.60273695", "0.599674", "0.599674", "0.599674", "0.599674", "0.599674", "0.599674", "0.59899175", "0.5980442", "0.5964507", "0.5964507", "0.5964507", "0.5964507", "0.5964507", "0.59612846", "0.5947846", "0.59445477", "0.59445477", "0.59160393", "0.5888457", "0.5839764", "0.58156466", "0.58073556", "0.57953477", "0.5794582", "0.5752361", "0.5745624", "0.57146674", "0.568988", "0.56817555", "0.5674949", "0.5667786", "0.5667786", "0.5652324", "0.5625064", "0.5619562", "0.5608955", "0.5607076", "0.5578553", "0.557215", "0.5565526", "0.55639464", "0.5558818", "0.5557193", "0.5557193", "0.5557193", "0.5557193", "0.5557193", "0.5533201", "0.5505743", "0.55051833", "0.5504641", "0.5504641", "0.549827", "0.54952025", "0.54895806", "0.5488978", "0.54664296", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.544963", "0.54489905", "0.54435587", "0.54334354", "0.54226494", "0.54225564", "0.5416778", "0.5407735", "0.54049945", "0.5398686", "0.5364473", "0.53588057", "0.53549176", "0.5351242", "0.534548", "0.53442335", "0.53440654", "0.5331875", "0.5331361", "0.53302467" ]
0.67828745
1
Use TokenTransaction.newBuilder() to construct.
private TokenTransaction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static com.networknt.taiji.token.TokenTransactions.Builder newBuilder() {\n return new com.networknt.taiji.token.TokenTransactions.Builder();\n }", "public static com.networknt.taiji.token.TokenTransactions.Builder newBuilder(com.networknt.taiji.token.TokenTransactions other) {\n return new com.networknt.taiji.token.TokenTransactions.Builder(other);\n }", "public TokenTransactions() {}", "public static com.networknt.taiji.token.TokenTransactions.Builder newBuilder(com.networknt.taiji.token.TokenTransactions.Builder other) {\n return new com.networknt.taiji.token.TokenTransactions.Builder(other);\n }", "private Builder(com.networknt.taiji.token.TokenTransactions other) {\n super(SCHEMA$);\n if (isValidValue(fields()[0], other.TokenTransactionArray)) {\n this.TokenTransactionArray = data().deepCopy(fields()[0].schema(), other.TokenTransactionArray);\n fieldSetFlags()[0] = true;\n }\n }", "private Builder(com.networknt.taiji.token.TokenTransactions.Builder other) {\n super(other);\n if (isValidValue(fields()[0], other.TokenTransactionArray)) {\n this.TokenTransactionArray = data().deepCopy(fields()[0].schema(), other.TokenTransactionArray);\n fieldSetFlags()[0] = true;\n }\n }", "public Transaction() {\n this(0, 0, null);\n }", "public Token() {\n }", "public Token() {\n }", "@Override\r\n\tpublic Token createToken() {\n\t\tToken token = new Token();\r\n\t\treturn token;\r\n\t}", "public void createTransaction(Transaction trans);", "Transaction createTransaction(Settings settings);", "Transaction createTransaction();", "private SemanticTokens(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public Transaction() {\n }", "public Token() {\n mTokenReceivedDate = new Date();\n }", "public Token newToken() {\r\n\t\tString value = UUID.randomUUID().toString();\r\n\t\treturn new Token(value);\r\n\t}", "public static TokenTransactions fromByteBuffer(\n java.nio.ByteBuffer b) throws java.io.IOException {\n return DECODER.decode(b);\n }", "private Token () { }", "private TokenInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public Builder setTokenBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n token_ = value;\n onChanged();\n return this;\n }", "public Builder setTokenBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n token_ = value;\n onChanged();\n return this;\n }", "public Builder setTokenBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n token_ = value;\n onChanged();\n return this;\n }", "public Builder setTokenBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n token_ = value;\n onChanged();\n return this;\n }", "public Builder setTokenBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n token_ = value;\n onChanged();\n return this;\n }", "public TemplexTokenMaker() {\r\n\t\tsuper();\r\n\t}", "public TransactionsFragment() {\n }", "public com.networknt.taiji.token.TokenTransactions.Builder setTokenTransactionArray(java.util.List<com.networknt.taiji.token.TokenTransaction> value) {\n validate(fields()[0], value);\n this.TokenTransactionArray = value;\n fieldSetFlags()[0] = true;\n return this;\n }", "public Token() {\n token = new Random().nextLong();\n }", "public Builder setTransactionIdBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) { throw new NullPointerException(); }\n checkByteStringIsUtf8(value);\n transactionId_ = value;\n bitField0_ |= 0x00000002;\n onChanged();\n return this;\n }", "public Transaction createTransaction(double amount, long timestamp) {\n Transaction transaction = new Transaction();\n transaction.setAmount(amount);\n transaction.setTimestamp(timestamp);\n return transaction;\n }", "public Token(I2PAppContext ctx) {\n super(null);\n byte[] data = new byte[MY_TOK_LEN];\n ctx.random().nextBytes(data);\n setData(data);\n setValid(MY_TOK_LEN);\n lastSeen = ctx.clock().now();\n }", "com.google.protobuf.ByteString\n getTokenBytes();", "public Token(byte[] identifier, byte[] password, Text kind, Text service) {\n this.identifier = (identifier == null)? new byte[0] : identifier;\n this.password = (password == null)? new byte[0] : password;\n this.kind = (kind == null)? new Text() : kind;\n this.service = (service == null)? new Text() : service;\n }", "public Pokemon.RequestEnvelop.AuthInfo.JWT.Builder getTokenBuilder() {\n bitField0_ |= 0x00000002;\n onChanged();\n return getTokenFieldBuilder().getBuilder();\n }", "public MiradorTransaction(FujabaTransaction fujaba_tx) {\n tx_name_ = fujaba_tx.getName();\n tx_id_ = fujaba_tx.getId();\n merge_side_ = fujaba_tx.getMergeSide();\n initialize(fujaba_tx);\n }", "public StandardTransactionConfig build() {\n Preconditions.checkArgument(null != timestamp || null != timestampProvider);\n\n return new StandardTransactionConfig(metricsPrefix,\n timestampProvider, timestamp, customOptions);\n }", "com.google.protobuf.ByteString\n getTokenBytes();", "com.google.protobuf.ByteString\n getTokenBytes();", "com.google.protobuf.ByteString\n getTokenBytes();", "com.google.protobuf.ByteString\n getTokenBytes();", "com.google.protobuf.ByteString\n getTokenBytes();", "com.google.protobuf.ByteString\n getTokenBytes();", "com.google.protobuf.ByteString\n getTokenBytes();", "com.google.protobuf.ByteString\n getTokenBytes();", "public Builder setTokenBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setTokenBytes(value);\n return this;\n }", "public Builder setTokenBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setTokenBytes(value);\n return this;\n }", "public Builder setTokenBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setTokenBytes(value);\n return this;\n }", "private ThreadLocalTransaction() {\n }", "public PersistentToken() {\n this.owner = \"\";\n this.issuer = \"\";\n this.amount = 0;\n this.linearId = UUID.randomUUID();\n this.listOfPersistentChildTokens = null;\n }", "private Transaction(Engine destination, ByteBuffer bytes) {\n this(destination);\n deserialize(bytes);\n setStatus(Status.COMMITTED);\n\n }", "public TransactionBuilder readOnly();", "public static InitializationTransactionRequest from(UnmarshallingContext context) throws IOException {\n\t\tTransactionReference classpath = TransactionReference.from(context);\n\t\tStorageReference manifest = StorageReference.from(context);\n\n\t\treturn new InitializationTransactionRequest(classpath, manifest);\n\t}", "public Txn() {\n }", "public Token(byte[] data) {\n super(data);\n lastSeen = 0;\n }", "protected abstract Transaction createAndAdd();", "public Transaction createTransaction(Credentials user, TransactionType tt) throws RelationException;", "private TokenSegment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public Builder setTokenBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n token_ = value;\n onChanged();\n return this;\n }", "public Builder clearTransactionId() {\n transactionId_ = getDefaultInstance().getTransactionId();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public Transaction(JsonObject transObj) {\n this.symbol = transObj.get(\"symbol\").getAsString();\n this.price = transObj.get(\"price\").getAsDouble();\n this.volume = transObj.get(\"volume\").getAsInt();\n this.type = transObj.get(\"type\").getAsString(); //buy or sell\n this.date = transObj.get(\"date\").getAsString();\n this.time = transObj.get(\"time\").getAsString();\n this.profitFromSell = transObj.get(\"profitFromSell\").getAsDouble();\n this.averagePurchasePrice = transObj.get(\"averagePurchasePrice\").getAsDouble();\n }", "public Token(T id, SecretManager<T> mgr) {\n password = mgr.createPassword(id);\n identifier = id.getBytes();\n kind = id.getKind();\n service = new Text();\n }", "public long createTransaction(Credentials c, TransactionType tt) throws RelationException;", "public Token(Token other) {\n __isset_bitfield = other.__isset_bitfield;\n this.token_num = other.token_num;\n if (other.isSetToken()) {\n this.token = other.token;\n }\n if (other.isSetOffsets()) {\n Map<OffsetType,Offset> __this__offsets = new HashMap<OffsetType,Offset>();\n for (Map.Entry<OffsetType, Offset> other_element : other.offsets.entrySet()) {\n\n OffsetType other_element_key = other_element.getKey();\n Offset other_element_value = other_element.getValue();\n\n OffsetType __this__offsets_copy_key = other_element_key;\n\n Offset __this__offsets_copy_value = new Offset(other_element_value);\n\n __this__offsets.put(__this__offsets_copy_key, __this__offsets_copy_value);\n }\n this.offsets = __this__offsets;\n }\n this.sentence_pos = other.sentence_pos;\n if (other.isSetLemma()) {\n this.lemma = other.lemma;\n }\n if (other.isSetPos()) {\n this.pos = other.pos;\n }\n if (other.isSetEntity_type()) {\n this.entity_type = other.entity_type;\n }\n this.mention_id = other.mention_id;\n this.equiv_id = other.equiv_id;\n this.parent_id = other.parent_id;\n if (other.isSetDependency_path()) {\n this.dependency_path = other.dependency_path;\n }\n if (other.isSetLabels()) {\n Map<String,List<Label>> __this__labels = new HashMap<String,List<Label>>();\n for (Map.Entry<String, List<Label>> other_element : other.labels.entrySet()) {\n\n String other_element_key = other_element.getKey();\n List<Label> other_element_value = other_element.getValue();\n\n String __this__labels_copy_key = other_element_key;\n\n List<Label> __this__labels_copy_value = new ArrayList<Label>();\n for (Label other_element_value_element : other_element_value) {\n __this__labels_copy_value.add(new Label(other_element_value_element));\n }\n\n __this__labels.put(__this__labels_copy_key, __this__labels_copy_value);\n }\n this.labels = __this__labels;\n }\n if (other.isSetMention_type()) {\n this.mention_type = other.mention_type;\n }\n }", "public static final Transaction createTransaction(Transaction transaction, BasicXmlDocument response) {\r\n\r\n\t\ttransaction.currentResponse = response;\r\n\r\n\t\treturn transaction;\r\n\t}", "protected Token(Parcel in) {\n this.mAccessToken = in.readString();\n this.mRefreshToken = in.readString();\n this.mExpiresIn = (Long) in.readValue(Long.class.getClassLoader());\n this.mTokenType = in.readString();\n long tmpMTokenReceivedDate = in.readLong();\n this.mTokenReceivedDate = new Date(tmpMTokenReceivedDate);\n }", "public JavaTokenMaker() {\n\t}", "public Token(I2PAppContext ctx, byte[] data) {\n super(data);\n // lets not get carried away\n if (data.length > MAX_TOK_LEN)\n throw new IllegalArgumentException();\n lastSeen = ctx.clock().now();\n }", "public Token (String token, int position, int marker) {\n this.tokenString = token;\n this.position = position;\n this.marker = marker; \n }", "public Token(int start)\n {\n this.start = start;\n }", "public Transaction(int somme, int payeur, int receveur) {\r\n\t\tthis.somme = somme;\r\n\t\tthis.payeur = payeur;\r\n\t\tthis.receveur = receveur;\r\n\t}", "public Message build() {\n Objects.requireNonNull(transactionIdBytes);\n\n byte[] messageBytes = new byte[MESSAGE_LEN_HEADER + length];\n\n byte[] messageTypeBytes = createMessageType();\n System.arraycopy(messageTypeBytes, 0, messageBytes, MESSAGE_POS_TYPE, MESSAGE_LEN_TYPE);\n\n byte[] lengthBytes = Bytes.intToBytes(length);\n System.arraycopy(lengthBytes, 2, messageBytes, MESSAGE_POS_LENGTH, MESSAGE_LEN_LENGTH);\n\n byte[] magicCookieBytes = Bytes.intToBytes(MAGIC_COOKIE_FIXED_VALUE);\n System.arraycopy(\n magicCookieBytes, 0, messageBytes, MESSAGE_POS_MAGIC_COOKIE, MESSAGE_LEN_MAGIC_COOKIE);\n\n System.arraycopy(\n transactionIdBytes, 0, messageBytes, MESSAGE_POS_TRANSACTION_ID,\n MESSAGE_LEN_TRANSACTION_ID);\n transactionIdBytes = null;\n\n if (attributeBytes != null && attributeBytes.length > 0) {\n System.arraycopy(\n attributeBytes, 0, messageBytes, MESSAGE_LEN_HEADER, attributeBytes.length);\n attributeBytes = null;\n }\n\n return new Message(messageBytes);\n }", "public OAuthRequestToken(Token token) {\n if (token == null) {\n return;\n }\n this.oauthToken = token.getToken();\n this.oauthTokenSecret = token.getSecret();\n }", "public BStarTokenMaker() {\n\t\tsuper();\n\t}", "public PaymentTransaction() {\n\t\tsuper(\"PAYMENT_TRANSACTION\", edu.uga.csci4050.group3.jooq.team3.Team3.TEAM3);\n\t}", "OBasicTransaction getMicroOrRegularTransaction();", "public Transaction startTransaction(){\n\t\ttr = new Transaction(db);\n\t\treturn tr;\n\t}", "public PTPTransactionManager () {\n transactions = new HashMap<>();\n completeTransactions = new HashSet<>();\n }", "public Builder setTransactionId(\n java.lang.String value) {\n if (value == null) { throw new NullPointerException(); }\n transactionId_ = value;\n bitField0_ |= 0x00000002;\n onChanged();\n return this;\n }", "public Token(int start, int end) {\n startOffset = start;\n endOffset = end;\n }", "private TransactionRequest initTransactionRequest() {\n TransactionRequest transactionRequestNew = new\n TransactionRequest(System.currentTimeMillis() + \"\", 20000);\n\n //set customer details\n transactionRequestNew.setCustomerDetails(initCustomerDetails());\n\n\n // set item details\n ItemDetails itemDetails = new ItemDetails(\"1\", 20000, 1, \"Trekking Shoes\");\n\n // Add item details into item detail list.\n ArrayList<ItemDetails> itemDetailsArrayList = new ArrayList<>();\n itemDetailsArrayList.add(itemDetails);\n transactionRequestNew.setItemDetails(itemDetailsArrayList);\n\n\n // Create creditcard options for payment\n CreditCard creditCard = new CreditCard();\n\n creditCard.setSaveCard(false); // when using one/two click set to true and if normal set to false\n\n// this methode deprecated use setAuthentication instead\n// creditCard.setSecure(true); // when using one click must be true, for normal and two click (optional)\n\n creditCard.setAuthentication(CreditCard.AUTHENTICATION_TYPE_3DS);\n\n // noted !! : channel migs is needed if bank type is BCA, BRI or MyBank\n// creditCard.setChannel(CreditCard.MIGS); //set channel migs\n creditCard.setBank(BankType.BCA); //set spesific acquiring bank\n\n transactionRequestNew.setCreditCard(creditCard);\n\n return transactionRequestNew;\n }", "public io.lightcone.data.types.TokenID.Builder getTokenIdBuilder() {\n \n onChanged();\n return getTokenIdFieldBuilder().getBuilder();\n }", "TransactionType createTransactionType();", "private Transaction setUpTransaction(double amount, Transaction.Operation operation, String username){\n Transaction transaction = new Transaction();\n transaction.setDate(Date.valueOf(LocalDate.now()));\n transaction.setAmount(amount);\n transaction.setOperation(operation);\n transaction.setUserId(userRepository.getByUsername(username).getId());\n return transaction;\n }", "public static Transaction createEntity(EntityManager em) {\n Transaction transaction = new Transaction()\n .date(DEFAULT_DATE);\n return transaction;\n }", "public OpportunisticContainerAllocator(\n BaseContainerTokenSecretManager tokenSecretManager) {\n this.tokenSecretManager = tokenSecretManager;\n }", "public AccountAuthToken() {\n }", "public Tokenizer() {\n tokenInfos = new LinkedList<TokenInfo>();\n tokens = new LinkedList<Token>();\n\n }", "private Token(ISubscriber inSubscriber,\n MarketDataRequest inRequest)\n {\n subscriber = inSubscriber;\n request = inRequest;\n }", "public io.lightcone.data.types.TokenID.Builder getTokenFBuilder() {\n \n onChanged();\n return getTokenFFieldBuilder().getBuilder();\n }", "public Token setToken(String token) {\n this.token = token;\n return this;\n }", "public Token(Token other) {\n __isset_bitfield = other.__isset_bitfield;\n this.tokenIndex = other.tokenIndex;\n if (other.isSetText()) {\n this.text = other.text;\n }\n if (other.isSetTextSpan()) {\n this.textSpan = new edu.jhu.hlt.concrete.TextSpan(other.textSpan);\n }\n if (other.isSetRawTextSpan()) {\n this.rawTextSpan = new edu.jhu.hlt.concrete.TextSpan(other.rawTextSpan);\n }\n if (other.isSetAudioSpan()) {\n this.audioSpan = new edu.jhu.hlt.concrete.AudioSpan(other.audioSpan);\n }\n }", "public VerifyTransactionImpl() {\n super();\n }", "public void setTokenTransactionArray(java.util.List<com.networknt.taiji.token.TokenTransaction> value) {\n this.TokenTransactionArray = value;\n }", "private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "protected Txn createTxn(Txn parent, IsolationLevel level,\r\n int timeout, TimeUnit unit)\r\n throws Exception\r\n {\r\n return createTxn(parent, level);\r\n }", "protected final Transaction createTransaction(TransactionTypeKeys type) {\n\t\tTransaction trans = null;\n\t\tString payee = getForm().getPayFrom();\n\t\tdouble amount = parseAmount();\n\n\t\t// Put amount in proper form.\n\t\tif ((type == INCOME && amount < 0.0)\n\t\t\t\t|| (type == EXPENSE && amount >= 0.0)) {\n\t\t\tamount = -amount;\n\t\t}\n\n\t\t// Put payee in proper form.\n\t\tpayee = purgeIdentifier(payee);\n\n\t\ttrans = new Transaction(getForm().getField(CHECK_NUMBER).getText(),\n\t\t\t\tparseDate(), payee, Money.of(amount,\n\t\t\t\t\t\tUI_CURRENCY_SYMBOL.getCurrency()), getCategory(),\n\t\t\t\tgetForm().getField(NOTES).getText());\n\n\t\t// Set attributes not applicable in the constructor.\n\t\ttrans.setIsReconciled(getForm().getButton(PENDING).isSelected() == false);\n\n\t\tif (isInEditMode() == true) {\n\t\t\ttrans.setLabel(getEditModeTransaction().getLabel());\n\t\t}\n\n\t\treturn trans;\n\t}", "public TokenInfo createToken(TokenCoreInfo coreInfo, String password);", "public Token(int start, int end, int flags){\n startOffset = start;\n endOffset = end;\n this.flags = flags;\n }", "public Builder setTokenIdBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n tokenId_ = value;\n onChanged();\n return this;\n }" ]
[ "0.7681209", "0.74501324", "0.7395263", "0.7177733", "0.64302176", "0.63667244", "0.6200909", "0.61605203", "0.61262035", "0.599569", "0.5958303", "0.5850402", "0.58090955", "0.5783736", "0.5774434", "0.56826234", "0.56749845", "0.5579479", "0.55555147", "0.5546618", "0.55320257", "0.55320257", "0.55320257", "0.55320257", "0.55320257", "0.5507332", "0.548575", "0.5475059", "0.5451677", "0.5432938", "0.5402957", "0.5395638", "0.5391584", "0.53778607", "0.53746146", "0.5357768", "0.53396034", "0.53348213", "0.53348213", "0.53348213", "0.5321271", "0.5321271", "0.5321271", "0.5321271", "0.5321271", "0.53073984", "0.53073984", "0.53073984", "0.5305314", "0.530359", "0.5296242", "0.52860606", "0.5260066", "0.5259105", "0.5243728", "0.5226153", "0.52102065", "0.52050316", "0.518476", "0.51663905", "0.51527643", "0.5152531", "0.51507807", "0.5138026", "0.5120679", "0.5105878", "0.5095597", "0.509059", "0.508202", "0.5080167", "0.50567657", "0.504916", "0.50479645", "0.5047361", "0.5038603", "0.50369394", "0.5033663", "0.5025949", "0.50182194", "0.50125414", "0.50052464", "0.5002005", "0.50004226", "0.49970233", "0.49924597", "0.4991455", "0.49867266", "0.49849156", "0.49836087", "0.49793303", "0.4970951", "0.49698767", "0.4965888", "0.49627325", "0.49618205", "0.49310762", "0.49269134", "0.4925873", "0.4922415", "0.49191365" ]
0.784716
0
.PlainTokenAction plain_action = 1;
public boolean hasPlainAction() { return actionCase_ == 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction();", "org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder();", "private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Token () { }", "void tokenchange();", "public Builder setPlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n action_ = value;\n onChanged();\n } else {\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public Token() {\n this.clitic = \"none\";\n }", "void token(TokenNode node);", "public void setToken(int value){token = value;}", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n } else {\n if (actionCase_ == 1) {\n return plainActionBuilder_.getMessage();\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "public String getTokenValue() { return tok; }", "public void setToken(java.lang.String param){\n localTokenTracker = true;\n \n this.localToken=param;\n \n\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public String getToken();", "public void setToken(String token) {\r\n this.token = token;\r\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if ((actionCase_ == 1) && (plainActionBuilder_ != null)) {\n return plainActionBuilder_.getMessageOrBuilder();\n } else {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "Token next();", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "public Token() {\n }", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "public Token() {\n }", "public void onSuccess(Token token) {\n\n }", "public void printToken(){\r\n System.out.println(\"Kind: \" + kind + \" , Lexeme: \" + lexeme);\r\n }", "public String token() {\n return this.token;\n }", "public YammerNewPrivateMessageAction(String token) {\n this.token = token;\n }", "public java.lang.String getToken(){\n return localToken;\n }", "Token current();", "public void putToken(Token token)throws Exception;", "public String getToken_type() {\r\n\t\treturn token_type;\r\n\t}", "public void setToken(String token) {\n\t\tthis.token = token;\n\t}", "public String getToken()\n {\n return token;\n }", "public String getToken() {\r\n return token;\r\n }", "public String getToken() {\r\n return token;\r\n }", "@Override\r\n\tpublic Token createToken() {\n\t\tToken token = new Token();\r\n\t\treturn token;\r\n\t}", "public TemplexTokenMaker() {\r\n\t\tsuper();\r\n\t}", "public void alg_PASSTOKEN(){\nTokenOut.value=true;\nSystem.out.println(\"pass\");\n\n}", "@Test\n public void parseToken() {\n }", "public String getToken() {\n return this.token;\n }", "public void alg_HOLDTOKEN(){\nTokenOut.value=false;\nSystem.out.println(\"hold\");\n\n}", "@Override\n protected String getEvaluableToken() {\n return TOKEN;\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder getPlainActionBuilder() {\n return getPlainActionFieldBuilder().getBuilder();\n }", "@Override\n public void onNewToken(String token) {\n Log.e(\"Token:\", token);\n }", "int getTokenStart();", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public void tokenArrived(Object token)\n {\n }", "public String token() {\n return Codegen.stringProp(\"token\").config(config).require();\n }", "@Override\n\tpublic Token getToken() {\n\t\treturn this.token;\n\t\t\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "byte[] token();", "void putToken(String name, String value);", "public LexicalToken(TokenType type) {\n\t\tthis.type = type;\n\t}", "java_cup.runtime.Symbol TOKEN(int code) { return TOKEN(code, yytext()); }", "public T getToken() {\n return this.token;\n }", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "public Token(String tipo, String lexema){\n\t\tthis.tipo = tipo;\n\t\tthis.lexema = lexema;\n\t}", "public void setToken(final String token) {\n this.token = token;\n }", "@Override\n\tprotected String getEvaluableToken() {\n\t\treturn TOKEN;\n\t}", "private Token token(final TermToken tt) {\n return tt.hasLexicalToken() ? tt.token().token() : null;\n }", "public Builder mergePlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1 &&\n action_ != org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_)\n .mergeFrom(value).buildPartial();\n } else {\n action_ = value;\n }\n onChanged();\n } else {\n if (actionCase_ == 1) {\n plainActionBuilder_.mergeFrom(value);\n }\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "@Override\n\tpublic void setToken(Token token) {\n\t\tthis.token = token;\n\t\t\n\t}", "public String getToken() {\n return this.token;\n }", "public void setToken(byte token[]) {\n\t\tthis.token = token;\n\t}", "private com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder> \n getPlainActionFieldBuilder() {\n if (plainActionBuilder_ == null) {\n if (!(actionCase_ == 1)) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n plainActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>(\n (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_,\n getParentForChildren(),\n isClean());\n action_ = null;\n }\n actionCase_ = 1;\n onChanged();;\n return plainActionBuilder_;\n }", "public TYPE tokenType(){\n\n return currentTokenType;\n }", "String getTokenString();", "GetToken.Req getGetTokenReq();", "public String getToken() {\n return token.get();\n }", "public Builder setPlainAction(\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder builderForValue) {\n if (plainActionBuilder_ == null) {\n action_ = builderForValue.build();\n onChanged();\n } else {\n plainActionBuilder_.setMessage(builderForValue.build());\n }\n actionCase_ = 1;\n return this;\n }", "private void tokenStart() {\n tokenStartIndex = zzStartRead;\n }", "public APIToken() {\n super();\n }", "public void setToken(String token) {\r\n hc.setToken(token);\r\n }", "public String getToken() {\n return this.token;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public Token setToken(String token) {\n this.token = token;\n return this;\n }" ]
[ "0.7148013", "0.67840284", "0.64335275", "0.6307667", "0.6277779", "0.6261444", "0.62344927", "0.6230079", "0.6210272", "0.62097347", "0.6113519", "0.6061834", "0.6030614", "0.6025248", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5988666", "0.5978114", "0.596341", "0.5962982", "0.5962982", "0.5962982", "0.5962982", "0.5962982", "0.59460515", "0.59426445", "0.59426445", "0.5914283", "0.5887248", "0.583805", "0.58132994", "0.58067626", "0.57943374", "0.579271", "0.5751333", "0.57444435", "0.5711302", "0.5689569", "0.5679402", "0.5673965", "0.5666845", "0.5666845", "0.5650891", "0.56237483", "0.5618539", "0.56072116", "0.56061184", "0.5577605", "0.5571177", "0.55660874", "0.5561964", "0.55578345", "0.55563086", "0.55563086", "0.55563086", "0.55563086", "0.55563086", "0.5530541", "0.55049074", "0.5504175", "0.5503833", "0.5503833", "0.54967326", "0.5492789", "0.5488745", "0.54884326", "0.5465789", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.5448594", "0.5447304", "0.5442689", "0.54331213", "0.542342", "0.5419929", "0.5415918", "0.54059273", "0.54058194", "0.53980833", "0.53630054", "0.5356992", "0.5354206", "0.5352228", "0.5345044", "0.5342727", "0.53418994", "0.53305274", "0.5330377", "0.53282166" ]
0.0
-1
.PlainTokenAction plain_action = 1;
public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() { if (actionCase_ == 1) { return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_; } return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction();", "org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder();", "private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Token () { }", "void tokenchange();", "public Builder setPlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n action_ = value;\n onChanged();\n } else {\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public Token() {\n this.clitic = \"none\";\n }", "void token(TokenNode node);", "public void setToken(int value){token = value;}", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n } else {\n if (actionCase_ == 1) {\n return plainActionBuilder_.getMessage();\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "public String getTokenValue() { return tok; }", "public void setToken(java.lang.String param){\n localTokenTracker = true;\n \n this.localToken=param;\n \n\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public String getToken();", "public void setToken(String token) {\r\n this.token = token;\r\n }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if ((actionCase_ == 1) && (plainActionBuilder_ != null)) {\n return plainActionBuilder_.getMessageOrBuilder();\n } else {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "Token next();", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "public Token() {\n }", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "public Token() {\n }", "public void onSuccess(Token token) {\n\n }", "public void printToken(){\r\n System.out.println(\"Kind: \" + kind + \" , Lexeme: \" + lexeme);\r\n }", "public String token() {\n return this.token;\n }", "public YammerNewPrivateMessageAction(String token) {\n this.token = token;\n }", "public java.lang.String getToken(){\n return localToken;\n }", "Token current();", "public void putToken(Token token)throws Exception;", "public String getToken_type() {\r\n\t\treturn token_type;\r\n\t}", "public void setToken(String token) {\n\t\tthis.token = token;\n\t}", "public String getToken()\n {\n return token;\n }", "public String getToken() {\r\n return token;\r\n }", "public String getToken() {\r\n return token;\r\n }", "@Override\r\n\tpublic Token createToken() {\n\t\tToken token = new Token();\r\n\t\treturn token;\r\n\t}", "public TemplexTokenMaker() {\r\n\t\tsuper();\r\n\t}", "public void alg_PASSTOKEN(){\nTokenOut.value=true;\nSystem.out.println(\"pass\");\n\n}", "@Test\n public void parseToken() {\n }", "public String getToken() {\n return this.token;\n }", "public void alg_HOLDTOKEN(){\nTokenOut.value=false;\nSystem.out.println(\"hold\");\n\n}", "@Override\n protected String getEvaluableToken() {\n return TOKEN;\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder getPlainActionBuilder() {\n return getPlainActionFieldBuilder().getBuilder();\n }", "@Override\n public void onNewToken(String token) {\n Log.e(\"Token:\", token);\n }", "int getTokenStart();", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public void tokenArrived(Object token)\n {\n }", "public String token() {\n return Codegen.stringProp(\"token\").config(config).require();\n }", "@Override\n\tpublic Token getToken() {\n\t\treturn this.token;\n\t\t\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "byte[] token();", "void putToken(String name, String value);", "public LexicalToken(TokenType type) {\n\t\tthis.type = type;\n\t}", "java_cup.runtime.Symbol TOKEN(int code) { return TOKEN(code, yytext()); }", "public T getToken() {\n return this.token;\n }", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "public void setToken(final String token) {\n this.token = token;\n }", "public Token(String tipo, String lexema){\n\t\tthis.tipo = tipo;\n\t\tthis.lexema = lexema;\n\t}", "@Override\n\tprotected String getEvaluableToken() {\n\t\treturn TOKEN;\n\t}", "private Token token(final TermToken tt) {\n return tt.hasLexicalToken() ? tt.token().token() : null;\n }", "public Builder mergePlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1 &&\n action_ != org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_)\n .mergeFrom(value).buildPartial();\n } else {\n action_ = value;\n }\n onChanged();\n } else {\n if (actionCase_ == 1) {\n plainActionBuilder_.mergeFrom(value);\n }\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "@Override\n\tpublic void setToken(Token token) {\n\t\tthis.token = token;\n\t\t\n\t}", "public String getToken() {\n return this.token;\n }", "private com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder> \n getPlainActionFieldBuilder() {\n if (plainActionBuilder_ == null) {\n if (!(actionCase_ == 1)) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n plainActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>(\n (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_,\n getParentForChildren(),\n isClean());\n action_ = null;\n }\n actionCase_ = 1;\n onChanged();;\n return plainActionBuilder_;\n }", "public void setToken(byte token[]) {\n\t\tthis.token = token;\n\t}", "public TYPE tokenType(){\n\n return currentTokenType;\n }", "String getTokenString();", "GetToken.Req getGetTokenReq();", "public String getToken() {\n return token.get();\n }", "public Builder setPlainAction(\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder builderForValue) {\n if (plainActionBuilder_ == null) {\n action_ = builderForValue.build();\n onChanged();\n } else {\n plainActionBuilder_.setMessage(builderForValue.build());\n }\n actionCase_ = 1;\n return this;\n }", "private void tokenStart() {\n tokenStartIndex = zzStartRead;\n }", "public void setToken(String token) {\r\n hc.setToken(token);\r\n }", "public APIToken() {\n super();\n }", "public String getToken() {\n return this.token;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public Token setToken(String token) {\n this.token = token;\n return this;\n }" ]
[ "0.7148459", "0.6784173", "0.643421", "0.63084626", "0.6277919", "0.6260859", "0.6235223", "0.62304133", "0.6210552", "0.6209701", "0.60619324", "0.6030647", "0.60260844", "0.5996384", "0.5996384", "0.5996384", "0.5996384", "0.5996384", "0.5996384", "0.5989664", "0.597915", "0.5963719", "0.5963719", "0.5963719", "0.5963719", "0.5963719", "0.5963296", "0.59459174", "0.59436625", "0.59436625", "0.59148145", "0.5888295", "0.58387554", "0.58140725", "0.58071256", "0.57950443", "0.57936245", "0.5752472", "0.57440686", "0.5712527", "0.56907654", "0.5680503", "0.5675064", "0.56679195", "0.56679195", "0.56517076", "0.56242377", "0.56181556", "0.56074744", "0.5607217", "0.5577309", "0.55716276", "0.55664665", "0.5563448", "0.5557953", "0.5557458", "0.5557458", "0.5557458", "0.5557458", "0.5557458", "0.55309737", "0.55057526", "0.55049443", "0.550489", "0.550489", "0.54964906", "0.54935783", "0.548874", "0.54881054", "0.54666406", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5453972", "0.5448467", "0.5448423", "0.5443096", "0.5433633", "0.5422847", "0.5421009", "0.5417083", "0.54060084", "0.5405907", "0.53989285", "0.53639376", "0.5358087", "0.5355444", "0.53517413", "0.5345077", "0.53431237", "0.5342326", "0.53316873", "0.53316194", "0.5329495" ]
0.6113603
10
.PlainTokenAction plain_action = 1;
public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() { if (actionCase_ == 1) { return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_; } return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction();", "org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder();", "private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Token () { }", "void tokenchange();", "public Builder setPlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n action_ = value;\n onChanged();\n } else {\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public Token() {\n this.clitic = \"none\";\n }", "void token(TokenNode node);", "public void setToken(int value){token = value;}", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n } else {\n if (actionCase_ == 1) {\n return plainActionBuilder_.getMessage();\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "public String getTokenValue() { return tok; }", "public void setToken(java.lang.String param){\n localTokenTracker = true;\n \n this.localToken=param;\n \n\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public String getToken();", "public void setToken(String token) {\r\n this.token = token;\r\n }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if ((actionCase_ == 1) && (plainActionBuilder_ != null)) {\n return plainActionBuilder_.getMessageOrBuilder();\n } else {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "Token next();", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "public Token() {\n }", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "public Token() {\n }", "public void onSuccess(Token token) {\n\n }", "public void printToken(){\r\n System.out.println(\"Kind: \" + kind + \" , Lexeme: \" + lexeme);\r\n }", "public String token() {\n return this.token;\n }", "public YammerNewPrivateMessageAction(String token) {\n this.token = token;\n }", "public java.lang.String getToken(){\n return localToken;\n }", "Token current();", "public void putToken(Token token)throws Exception;", "public String getToken_type() {\r\n\t\treturn token_type;\r\n\t}", "public void setToken(String token) {\n\t\tthis.token = token;\n\t}", "public String getToken()\n {\n return token;\n }", "public String getToken() {\r\n return token;\r\n }", "public String getToken() {\r\n return token;\r\n }", "@Override\r\n\tpublic Token createToken() {\n\t\tToken token = new Token();\r\n\t\treturn token;\r\n\t}", "public TemplexTokenMaker() {\r\n\t\tsuper();\r\n\t}", "public void alg_PASSTOKEN(){\nTokenOut.value=true;\nSystem.out.println(\"pass\");\n\n}", "@Test\n public void parseToken() {\n }", "public String getToken() {\n return this.token;\n }", "public void alg_HOLDTOKEN(){\nTokenOut.value=false;\nSystem.out.println(\"hold\");\n\n}", "@Override\n protected String getEvaluableToken() {\n return TOKEN;\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder getPlainActionBuilder() {\n return getPlainActionFieldBuilder().getBuilder();\n }", "@Override\n public void onNewToken(String token) {\n Log.e(\"Token:\", token);\n }", "int getTokenStart();", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public void tokenArrived(Object token)\n {\n }", "public String token() {\n return Codegen.stringProp(\"token\").config(config).require();\n }", "@Override\n\tpublic Token getToken() {\n\t\treturn this.token;\n\t\t\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "byte[] token();", "void putToken(String name, String value);", "java_cup.runtime.Symbol TOKEN(int code) { return TOKEN(code, yytext()); }", "public LexicalToken(TokenType type) {\n\t\tthis.type = type;\n\t}", "public T getToken() {\n return this.token;\n }", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "public void setToken(final String token) {\n this.token = token;\n }", "public Token(String tipo, String lexema){\n\t\tthis.tipo = tipo;\n\t\tthis.lexema = lexema;\n\t}", "@Override\n\tprotected String getEvaluableToken() {\n\t\treturn TOKEN;\n\t}", "private Token token(final TermToken tt) {\n return tt.hasLexicalToken() ? tt.token().token() : null;\n }", "@Override\n\tpublic void setToken(Token token) {\n\t\tthis.token = token;\n\t\t\n\t}", "public Builder mergePlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1 &&\n action_ != org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_)\n .mergeFrom(value).buildPartial();\n } else {\n action_ = value;\n }\n onChanged();\n } else {\n if (actionCase_ == 1) {\n plainActionBuilder_.mergeFrom(value);\n }\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public String getToken() {\n return this.token;\n }", "public void setToken(byte token[]) {\n\t\tthis.token = token;\n\t}", "private com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder> \n getPlainActionFieldBuilder() {\n if (plainActionBuilder_ == null) {\n if (!(actionCase_ == 1)) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n plainActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>(\n (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_,\n getParentForChildren(),\n isClean());\n action_ = null;\n }\n actionCase_ = 1;\n onChanged();;\n return plainActionBuilder_;\n }", "public TYPE tokenType(){\n\n return currentTokenType;\n }", "String getTokenString();", "GetToken.Req getGetTokenReq();", "public String getToken() {\n return token.get();\n }", "public Builder setPlainAction(\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder builderForValue) {\n if (plainActionBuilder_ == null) {\n action_ = builderForValue.build();\n onChanged();\n } else {\n plainActionBuilder_.setMessage(builderForValue.build());\n }\n actionCase_ = 1;\n return this;\n }", "private void tokenStart() {\n tokenStartIndex = zzStartRead;\n }", "public void setToken(String token) {\r\n hc.setToken(token);\r\n }", "public APIToken() {\n super();\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public String getToken() {\n return this.token;\n }", "public Token setToken(String token) {\n this.token = token;\n return this;\n }" ]
[ "0.7147269", "0.67828745", "0.6434504", "0.6309605", "0.627992", "0.6259949", "0.62356144", "0.62324077", "0.62120783", "0.6111542", "0.60599285", "0.60309434", "0.60273695", "0.599674", "0.599674", "0.599674", "0.599674", "0.599674", "0.599674", "0.59899175", "0.5980442", "0.5964507", "0.5964507", "0.5964507", "0.5964507", "0.5964507", "0.59612846", "0.5947846", "0.59445477", "0.59445477", "0.59160393", "0.5888457", "0.5839764", "0.58156466", "0.58073556", "0.57953477", "0.5794582", "0.5752361", "0.5745624", "0.57146674", "0.568988", "0.56817555", "0.5674949", "0.5667786", "0.5667786", "0.5652324", "0.5625064", "0.5619562", "0.5608955", "0.5607076", "0.5578553", "0.557215", "0.5565526", "0.55639464", "0.5558818", "0.5557193", "0.5557193", "0.5557193", "0.5557193", "0.5557193", "0.5533201", "0.5505743", "0.55051833", "0.5504641", "0.5504641", "0.549827", "0.54952025", "0.54895806", "0.5488978", "0.54664296", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.5455132", "0.544963", "0.54489905", "0.54435587", "0.54334354", "0.54226494", "0.54225564", "0.5416778", "0.5407735", "0.54049945", "0.5398686", "0.5364473", "0.53588057", "0.53549176", "0.5351242", "0.534548", "0.53442335", "0.53440654", "0.5331875", "0.5331361", "0.53302467" ]
0.62077457
9
.PlainTokenAction plain_action = 1;
public boolean hasPlainAction() { return actionCase_ == 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction();", "org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder();", "private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Token () { }", "void tokenchange();", "public Builder setPlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n action_ = value;\n onChanged();\n } else {\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public Token() {\n this.clitic = \"none\";\n }", "void token(TokenNode node);", "public void setToken(int value){token = value;}", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n } else {\n if (actionCase_ == 1) {\n return plainActionBuilder_.getMessage();\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "public String getTokenValue() { return tok; }", "public void setToken(java.lang.String param){\n localTokenTracker = true;\n \n this.localToken=param;\n \n\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public String getToken();", "public void setToken(String token) {\r\n this.token = token;\r\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if ((actionCase_ == 1) && (plainActionBuilder_ != null)) {\n return plainActionBuilder_.getMessageOrBuilder();\n } else {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "Token next();", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "public Token() {\n }", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "public Token() {\n }", "public void onSuccess(Token token) {\n\n }", "public void printToken(){\r\n System.out.println(\"Kind: \" + kind + \" , Lexeme: \" + lexeme);\r\n }", "public String token() {\n return this.token;\n }", "public YammerNewPrivateMessageAction(String token) {\n this.token = token;\n }", "public java.lang.String getToken(){\n return localToken;\n }", "Token current();", "public void putToken(Token token)throws Exception;", "public String getToken_type() {\r\n\t\treturn token_type;\r\n\t}", "public void setToken(String token) {\n\t\tthis.token = token;\n\t}", "public String getToken()\n {\n return token;\n }", "public String getToken() {\r\n return token;\r\n }", "public String getToken() {\r\n return token;\r\n }", "@Override\r\n\tpublic Token createToken() {\n\t\tToken token = new Token();\r\n\t\treturn token;\r\n\t}", "public TemplexTokenMaker() {\r\n\t\tsuper();\r\n\t}", "public void alg_PASSTOKEN(){\nTokenOut.value=true;\nSystem.out.println(\"pass\");\n\n}", "@Test\n public void parseToken() {\n }", "public String getToken() {\n return this.token;\n }", "public void alg_HOLDTOKEN(){\nTokenOut.value=false;\nSystem.out.println(\"hold\");\n\n}", "@Override\n protected String getEvaluableToken() {\n return TOKEN;\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder getPlainActionBuilder() {\n return getPlainActionFieldBuilder().getBuilder();\n }", "@Override\n public void onNewToken(String token) {\n Log.e(\"Token:\", token);\n }", "int getTokenStart();", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public void tokenArrived(Object token)\n {\n }", "public String token() {\n return Codegen.stringProp(\"token\").config(config).require();\n }", "@Override\n\tpublic Token getToken() {\n\t\treturn this.token;\n\t\t\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "byte[] token();", "void putToken(String name, String value);", "public LexicalToken(TokenType type) {\n\t\tthis.type = type;\n\t}", "java_cup.runtime.Symbol TOKEN(int code) { return TOKEN(code, yytext()); }", "public T getToken() {\n return this.token;\n }", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "public Token(String tipo, String lexema){\n\t\tthis.tipo = tipo;\n\t\tthis.lexema = lexema;\n\t}", "public void setToken(final String token) {\n this.token = token;\n }", "@Override\n\tprotected String getEvaluableToken() {\n\t\treturn TOKEN;\n\t}", "private Token token(final TermToken tt) {\n return tt.hasLexicalToken() ? tt.token().token() : null;\n }", "public Builder mergePlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1 &&\n action_ != org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_)\n .mergeFrom(value).buildPartial();\n } else {\n action_ = value;\n }\n onChanged();\n } else {\n if (actionCase_ == 1) {\n plainActionBuilder_.mergeFrom(value);\n }\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "@Override\n\tpublic void setToken(Token token) {\n\t\tthis.token = token;\n\t\t\n\t}", "public String getToken() {\n return this.token;\n }", "public void setToken(byte token[]) {\n\t\tthis.token = token;\n\t}", "private com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder> \n getPlainActionFieldBuilder() {\n if (plainActionBuilder_ == null) {\n if (!(actionCase_ == 1)) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n plainActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>(\n (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_,\n getParentForChildren(),\n isClean());\n action_ = null;\n }\n actionCase_ = 1;\n onChanged();;\n return plainActionBuilder_;\n }", "public TYPE tokenType(){\n\n return currentTokenType;\n }", "String getTokenString();", "GetToken.Req getGetTokenReq();", "public String getToken() {\n return token.get();\n }", "public Builder setPlainAction(\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder builderForValue) {\n if (plainActionBuilder_ == null) {\n action_ = builderForValue.build();\n onChanged();\n } else {\n plainActionBuilder_.setMessage(builderForValue.build());\n }\n actionCase_ = 1;\n return this;\n }", "private void tokenStart() {\n tokenStartIndex = zzStartRead;\n }", "public APIToken() {\n super();\n }", "public void setToken(String token) {\r\n hc.setToken(token);\r\n }", "public String getToken() {\n return this.token;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public Token setToken(String token) {\n this.token = token;\n return this;\n }" ]
[ "0.7148013", "0.67840284", "0.64335275", "0.6307667", "0.6277779", "0.6261444", "0.62344927", "0.6230079", "0.6210272", "0.62097347", "0.6113519", "0.6061834", "0.6030614", "0.6025248", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5988666", "0.5978114", "0.596341", "0.5962982", "0.5962982", "0.5962982", "0.5962982", "0.5962982", "0.59460515", "0.59426445", "0.59426445", "0.5914283", "0.5887248", "0.583805", "0.58132994", "0.58067626", "0.57943374", "0.579271", "0.5751333", "0.57444435", "0.5711302", "0.5689569", "0.5679402", "0.5673965", "0.5666845", "0.5666845", "0.5650891", "0.56237483", "0.5618539", "0.56072116", "0.56061184", "0.5577605", "0.5571177", "0.55660874", "0.5561964", "0.55578345", "0.55563086", "0.55563086", "0.55563086", "0.55563086", "0.55563086", "0.5530541", "0.55049074", "0.5504175", "0.5503833", "0.5503833", "0.54967326", "0.5492789", "0.5488745", "0.54884326", "0.5465789", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.5448594", "0.5447304", "0.5442689", "0.54331213", "0.542342", "0.5419929", "0.5415918", "0.54059273", "0.54058194", "0.53980833", "0.53630054", "0.5356992", "0.5354206", "0.5352228", "0.5345044", "0.5342727", "0.53418994", "0.53305274", "0.5330377", "0.53282166" ]
0.0
-1
.PlainTokenAction plain_action = 1;
public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() { if (plainActionBuilder_ == null) { if (actionCase_ == 1) { return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_; } return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance(); } else { if (actionCase_ == 1) { return plainActionBuilder_.getMessage(); } return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction();", "org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder();", "private PlainTokenAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Token () { }", "void tokenchange();", "public Builder setPlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n action_ = value;\n onChanged();\n } else {\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "public Token() {\n this.clitic = \"none\";\n }", "void token(TokenNode node);", "public void setToken(int value){token = value;}", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction getPlainAction() {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }", "public String getTokenValue() { return tok; }", "public void setToken(java.lang.String param){\n localTokenTracker = true;\n \n this.localToken=param;\n \n\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public String getToken();", "public void setToken(String token) {\r\n this.token = token;\r\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder getPlainActionOrBuilder() {\n if ((actionCase_ == 1) && (plainActionBuilder_ != null)) {\n return plainActionBuilder_.getMessageOrBuilder();\n } else {\n if (actionCase_ == 1) {\n return (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_;\n }\n return org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "Token next();", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "@Test\n public void tokenTest() {\n // TODO: test token\n }", "public Token() {\n }", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "public Token() {\n }", "public void onSuccess(Token token) {\n\n }", "public void printToken(){\r\n System.out.println(\"Kind: \" + kind + \" , Lexeme: \" + lexeme);\r\n }", "public String token() {\n return this.token;\n }", "public YammerNewPrivateMessageAction(String token) {\n this.token = token;\n }", "public java.lang.String getToken(){\n return localToken;\n }", "Token current();", "public void putToken(Token token)throws Exception;", "public String getToken_type() {\r\n\t\treturn token_type;\r\n\t}", "public void setToken(String token) {\n\t\tthis.token = token;\n\t}", "public String getToken()\n {\n return token;\n }", "public String getToken() {\r\n return token;\r\n }", "public String getToken() {\r\n return token;\r\n }", "@Override\r\n\tpublic Token createToken() {\n\t\tToken token = new Token();\r\n\t\treturn token;\r\n\t}", "public TemplexTokenMaker() {\r\n\t\tsuper();\r\n\t}", "public void alg_PASSTOKEN(){\nTokenOut.value=true;\nSystem.out.println(\"pass\");\n\n}", "@Test\n public void parseToken() {\n }", "public String getToken() {\n return this.token;\n }", "public void alg_HOLDTOKEN(){\nTokenOut.value=false;\nSystem.out.println(\"hold\");\n\n}", "@Override\n protected String getEvaluableToken() {\n return TOKEN;\n }", "public org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder getPlainActionBuilder() {\n return getPlainActionFieldBuilder().getBuilder();\n }", "@Override\n public void onNewToken(String token) {\n Log.e(\"Token:\", token);\n }", "int getTokenStart();", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public void tokenArrived(Object token)\n {\n }", "public String token() {\n return Codegen.stringProp(\"token\").config(config).require();\n }", "@Override\n\tpublic Token getToken() {\n\t\treturn this.token;\n\t\t\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "byte[] token();", "void putToken(String name, String value);", "public LexicalToken(TokenType type) {\n\t\tthis.type = type;\n\t}", "java_cup.runtime.Symbol TOKEN(int code) { return TOKEN(code, yytext()); }", "public T getToken() {\n return this.token;\n }", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "String getShortToken();", "public Token(String tipo, String lexema){\n\t\tthis.tipo = tipo;\n\t\tthis.lexema = lexema;\n\t}", "public void setToken(final String token) {\n this.token = token;\n }", "@Override\n\tprotected String getEvaluableToken() {\n\t\treturn TOKEN;\n\t}", "private Token token(final TermToken tt) {\n return tt.hasLexicalToken() ? tt.token().token() : null;\n }", "public Builder mergePlainAction(org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction value) {\n if (plainActionBuilder_ == null) {\n if (actionCase_ == 1 &&\n action_ != org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance()) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.newBuilder((org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_)\n .mergeFrom(value).buildPartial();\n } else {\n action_ = value;\n }\n onChanged();\n } else {\n if (actionCase_ == 1) {\n plainActionBuilder_.mergeFrom(value);\n }\n plainActionBuilder_.setMessage(value);\n }\n actionCase_ = 1;\n return this;\n }", "@Override\n\tpublic void setToken(Token token) {\n\t\tthis.token = token;\n\t\t\n\t}", "public String getToken() {\n return this.token;\n }", "public void setToken(byte token[]) {\n\t\tthis.token = token;\n\t}", "private com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder> \n getPlainActionFieldBuilder() {\n if (plainActionBuilder_ == null) {\n if (!(actionCase_ == 1)) {\n action_ = org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.getDefaultInstance();\n }\n plainActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction, org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder, org.hyperledger.fabric.protos.token.Transaction.PlainTokenActionOrBuilder>(\n (org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction) action_,\n getParentForChildren(),\n isClean());\n action_ = null;\n }\n actionCase_ = 1;\n onChanged();;\n return plainActionBuilder_;\n }", "public TYPE tokenType(){\n\n return currentTokenType;\n }", "String getTokenString();", "GetToken.Req getGetTokenReq();", "public String getToken() {\n return token.get();\n }", "public Builder setPlainAction(\n org.hyperledger.fabric.protos.token.Transaction.PlainTokenAction.Builder builderForValue) {\n if (plainActionBuilder_ == null) {\n action_ = builderForValue.build();\n onChanged();\n } else {\n plainActionBuilder_.setMessage(builderForValue.build());\n }\n actionCase_ = 1;\n return this;\n }", "private void tokenStart() {\n tokenStartIndex = zzStartRead;\n }", "public APIToken() {\n super();\n }", "public void setToken(String token) {\r\n hc.setToken(token);\r\n }", "public String getToken() {\n return this.token;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public Token setToken(String token) {\n this.token = token;\n return this;\n }" ]
[ "0.7148013", "0.67840284", "0.64335275", "0.6307667", "0.6277779", "0.6261444", "0.62344927", "0.6230079", "0.6210272", "0.62097347", "0.6113519", "0.6030614", "0.6025248", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5995282", "0.5988666", "0.5978114", "0.596341", "0.5962982", "0.5962982", "0.5962982", "0.5962982", "0.5962982", "0.59460515", "0.59426445", "0.59426445", "0.5914283", "0.5887248", "0.583805", "0.58132994", "0.58067626", "0.57943374", "0.579271", "0.5751333", "0.57444435", "0.5711302", "0.5689569", "0.5679402", "0.5673965", "0.5666845", "0.5666845", "0.5650891", "0.56237483", "0.5618539", "0.56072116", "0.56061184", "0.5577605", "0.5571177", "0.55660874", "0.5561964", "0.55578345", "0.55563086", "0.55563086", "0.55563086", "0.55563086", "0.55563086", "0.5530541", "0.55049074", "0.5504175", "0.5503833", "0.5503833", "0.54967326", "0.5492789", "0.5488745", "0.54884326", "0.5465789", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.54535025", "0.5448594", "0.5447304", "0.5442689", "0.54331213", "0.542342", "0.5419929", "0.5415918", "0.54059273", "0.54058194", "0.53980833", "0.53630054", "0.5356992", "0.5354206", "0.5352228", "0.5345044", "0.5342727", "0.53418994", "0.53305274", "0.5330377", "0.53282166" ]
0.6061834
11