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
Created by Zenger on 2019/6/10.
public interface WorkSpaceShareService { WorkSpaceShareDTO baseCreate(WorkSpaceShareDTO workSpaceShareDTO); WorkSpaceShareDTO baseUpdate(WorkSpaceShareDTO workSpaceShareDTO); WorkSpaceShareDTO baseQueryById(Long id); void deleteByWorkSpaceId(Long workSpaceId); WorkSpaceShareDTO selectByWorkSpaceId(Long workSpaceId); WorkSpaceShareVO queryShare(Long organizationId, Long projectId, Long workSpaceId); WorkSpaceShareVO updateShare(Long organizationId, Long projectId, Long id, WorkSpaceShareUpdateVO workSpaceShareUpdateVO); Map<String, Object> queryTree(String token); WorkSpaceInfoVO queryWorkSpaceInfo(Long workSpaceId, String token); List<PageAttachmentVO> queryPageAttachment(Long workSpaceId, String token); void exportMd2Pdf(Long pageId, String token, HttpServletResponse response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\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}", "public final void mo51373a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "public void mo38117a() {\n }", "Petunia() {\r\n\t\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n void init() {\n }", "private void poetries() {\n\n\t}", "public Pitonyak_09_02() {\r\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "public void mo4359a() {\n }", "private UsineJoueur() {}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public int getSize() {\n return 1;\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private TMCourse() {\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 }", "protected MetadataUGWD() {/* intentionally empty block */}", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void init() {}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\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}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "Consumable() {\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void mo6081a() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public String toString() {\n return \"\";\n }", "@Override\n public void initialize() {\n \n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n public void initialize() { \n }", "private Singletion3() {}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void create() {\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}", "private void m50366E() {\n }", "private void init() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n protected void init() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "private MApi() {}", "@Override\n public int getSize() {return 0;}" ]
[ "0.59442925", "0.5867009", "0.55257124", "0.5510672", "0.54901105", "0.54901105", "0.5457272", "0.5447343", "0.5444495", "0.54229885", "0.5394521", "0.5368527", "0.53569895", "0.5324024", "0.5321505", "0.5320849", "0.5318095", "0.5315258", "0.53081787", "0.53013796", "0.53013796", "0.53013796", "0.53013796", "0.53013796", "0.53013796", "0.5300302", "0.52956873", "0.5291491", "0.5287385", "0.5286743", "0.52698445", "0.5262398", "0.5261825", "0.52599186", "0.52575386", "0.52550334", "0.5246183", "0.5238202", "0.5227387", "0.52161807", "0.5211981", "0.521138", "0.5197172", "0.5194804", "0.517476", "0.517476", "0.517476", "0.517476", "0.517476", "0.517476", "0.517476", "0.51733446", "0.5164662", "0.51634914", "0.51631653", "0.51558805", "0.5150104", "0.5150104", "0.5144202", "0.514268", "0.51414764", "0.513936", "0.5130312", "0.5130312", "0.5130312", "0.51247704", "0.5120247", "0.5116828", "0.5116828", "0.5116828", "0.5116828", "0.5116828", "0.511449", "0.5112129", "0.5103952", "0.5101254", "0.5099288", "0.5094429", "0.50869143", "0.50844574", "0.50844574", "0.5078455", "0.5078455", "0.507415", "0.5072389", "0.5072389", "0.5072389", "0.5070125", "0.5070083", "0.50680214", "0.50579876", "0.5052991", "0.503699", "0.5036918", "0.5027158", "0.5025432", "0.5025432", "0.5025432", "0.5021541", "0.5015822", "0.5013054" ]
0.0
-1
creates a binary number of length, length, and only has zeros
public BinaryNumber(int length){ data = new int[length]; for (int i=0; i<length; i++){ data[i] = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BinaryNumber(int length) {\n\t\tdata = new int[length];\n\t\tfor(int i = 0;i < length;i++) {\n\t\t\tdata[i] = 0;\n\t\t}\n\t}", "public String conformBinaryLength(int data, int length){\n String binaryParameter = Integer.toBinaryString(data);\n binaryParameter = (StringUtils.repeat('0', length) + binaryParameter).substring(binaryParameter.length());\n return binaryParameter;\n }", "private String padZeros(String binary, int size) {\n String outString = binary;\n for (int i = 0; i < size - binary.length(); i++) {\n outString = \"0\" + outString;\n }\n return outString;\n }", "Length createLength();", "public Binary() { \n\t_decNum = 0;\n\t_binNum = \"0\";\n }", "private static String zeroPaddedBitString(int value) {\n String bitString = Integer.toBinaryString(value);\n return String.format(\"%32s\", bitString).replace(\" \", \"0\");\n }", "public static int[] createZeroBasedSequence(int length) {\n\t\tint[] sequence = new int[length];\n\t\tfor (int i = 0; i < sequence.length; i++) {\n\t\t\tsequence[i] = i;\n\t\t}\n\t\treturn sequence;\n\t}", "private static String create50DigitString(){\n StringBuilder sb = new StringBuilder(\"1\");\n for(int i = 1; i < 50; i++){\n sb.append(\"0\");\n }\n return sb.toString();\n }", "public static numero getZero()\n {\n return new numero(ZERO);\n }", "@Override\r\n\tprotected Integer zero() {\n\t\treturn 0;\r\n\t}", "public static String zeroPrefix(int value, int length) {\n return new String(zeroPrefixChars(value, length));\n }", "String getZeroString()\n {\n return \"\"+0;\n }", "public static String addLeadingZeros(Number numeric,int nbLength)\n {\n Double theNumerDbl = toDoubleObj(numeric);\n Integer theNumerInt = theNumerDbl.intValue();\n String thePattern = \"%0\"+nbLength+\"d\";\n return String.format(thePattern, theNumerInt);\n }", "static int ones()\n {\n char[] binArray = binary.toCharArray();\n int count = 0;\n int max = 0; \n for(int i = 0; i < binary.length(); i++)\n {\n if(binArray[i] == '0'){\n count = 0;\n }else {\n count++;\n max = Math.max(max, count);\n }\n }\n return max;\n }", "public void setZero() {\n\t\tset((byte) (get() | (1 << 7)));\n\t}", "CompT zero();", "int createMaskWord(int num_mask, int word_len) {\r\n\t\tint a, b;\r\n\r\n\t\ta = 0;\r\n\t\tfor (int i = 0; i < num_mask; i++) {\r\n\t\t\tb = 1 << (word_len / 2);\r\n\t\t\t// b = 1 << (rand.nextInt()%word_len); //generate a random number\r\n\t\t\t// between 0 and the word_len\r\n\t\t\ta = a | b;\r\n\t\t}\r\n\t\treturn a;\r\n\t}", "public String generateNumber(int length) {\n int maxNumber = Integer.parseInt(new String(new char[length]).replace(\"\\0\", \"9\"));\n int intAccountNumber = ThreadLocalRandom.current().nextInt(0, maxNumber + 1);\n int accountNumberLength = String.valueOf(intAccountNumber).length();\n StringBuilder stringBuilder = new StringBuilder();\n if (accountNumberLength < length) {\n stringBuilder.append(new String(new char[length - accountNumberLength]).replace(\"\\0\", \"0\"));\n }\n stringBuilder.append(intAccountNumber);\n return stringBuilder.toString();\n }", "@Field(offset=23, length=1, paddingChar='0', align=Align.RIGHT)\n\tpublic int getZeros1() {\n\t\treturn 0;\n\t}", "public String padding(String binary, int length, boolean back) {\n\t\twhile (length > 0) {\n\t\t\tif (!back)\n\t\t\t\tbinary = \"0\" + binary;\n\t\t\telse\n\t\t\t\tbinary = binary + \"0\";\n\t\t\tlength--;\n\t\t}\n\t\treturn binary;\n\n\t}", "private static String convertP(int value)\n {\n String output = Integer.toBinaryString(value);\n\n for(int i = output.length(); i < 6; i++) // pad zeros\n output = \"0\" + output;\n\n return output;\n }", "@Test\n public void testZeroB() {\n assertEquals(1, PiGenerator.powerMod(5, 0, 42));\n }", "int getLowBitLength();", "public FormatInteger zeroFill(){\n fillCharacter = ZERO_CHAR;\n return this;\n }", "public String O0000o0o() {\r\n int i = this.O00000oO;\r\n while (this.O00000oO < this.O00000o) {\r\n char c = this.O00000o0[this.O00000oO];\r\n if (c < '0' || c > '9') {\r\n break;\r\n }\r\n this.O00000oO++;\r\n }\r\n return O000000o(i, this.O00000oO - i);\r\n }", "public static String addLeadingZeros(String number, int length){\n\t\t\n\t\tString SaleOrderStr = number;\n\t\tif(SaleOrderStr.length() < length){\n\t\t\tint MissingDigits = length - SaleOrderStr.length();\n\t\t\tfor(int i = 0; i < MissingDigits; i++){\n\t\t\t\tSaleOrderStr = \"0\"+SaleOrderStr;\n\t\t\t}\n\t\t}\n\t\treturn SaleOrderStr;\n\t\t\n\t}", "public static String addLeadingZerosToNumber (long number, int length){\n //the digits in the \"number\" is greater than or equal to the \"length\"\n if (length<= ((int) Math.log10(number) + 1)) return String.valueOf( number );\n \n return String.format(\"%0\"+ length +\"d\", number) ;\n }", "public ByteBuf writeZero(int length)\r\n/* 631: */ {\r\n/* 632:640 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 633:641 */ return super.writeZero(length);\r\n/* 634: */ }", "public static Integer length() {\n return 0;\n }", "int getHighBitLength();", "public static String toBinary(int number)\n\t{\n\t\tString total = \"\";\n\t\tint a;\n\t\twhile (number > 0) {\n\n\t\t\ta = number % 2;\n\n\t\t\ttotal = total + \"\" + a;\n// divide number by 2 \n\t\t\tnumber = number / 2;\n\n\t\t\t}\n\n// return value \n\t\treturn (new StringBuilder(total)).reverse().toString();\n\t\t\n\t}", "private byte[] intToBits(int number, int n) {\n\t\tbyte[] bits = new byte[n];\n\t\t\n\t\tString bitString = Integer.toBinaryString(number);\n\t\twhile (bitString.length() < n) {\n\t\t\tbitString = \"0\" + bitString;\n\t\t}\n\t\t\n\t\tfor(int i = 0, maxLen = bits.length; i < maxLen; i++) {\n\t\t\tbits[i] = (byte) (bitString.charAt(i) == 1 ? 1 : 0);\n\t\t}\n\t\t\n\t\treturn bits;\n\t}", "private static String padWithZeros(int i, int len) {\r\n\t\tString s = Integer.toString(i);\r\n\t\tif (s.length() > len) {\r\n\t\t\treturn s.substring(0, len);\r\n\t\t}\r\n\t\telse if (s.length() < len) {\t// pad on left with zeros\r\n\t\t\treturn \"000000000000000000000000000\".substring(0, len - s.length()) + s;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn s;\r\n\t\t}\r\n\t}", "public Unsigned128BitType()\n\t{\n\t\tthis( 0, 0 );\n\t}", "private static String showCompleteBinaryNumber(String binaryNumber, int binaryNumberDesignedLength) {\n while (binaryNumber.length() < binaryNumberDesignedLength) {\n binaryNumber = \"0\" + binaryNumber;\n }\n return binaryNumber;\n }", "public static String zeroPrefix(long value, int length) {\n return new String(zeroPrefixChars(value, length));\n }", "public Binary( int n ) {\n\t_decNum = n;\n\t_binNum = decToBin(n);\n }", "public String O0000Oo0() {\r\n char[] cArr = this.O00000o0;\r\n int i = this.O00000oO;\r\n this.O00000oO = i + 1;\r\n return new String(cArr, i, 1);\r\n }", "String getZero_or_more();", "public static char[] zeroPrefixChars(int value, int length) {\n Checks.nonNegative(\"length\", length);\n if (value >= 0 && value < 10 && length > 0) {\n char[] result = new char[length];\n Arrays.fill(result, 0, length - 1, '0');\n result[length - 1] = (char) ('0' + value);\n return result;\n }\n return writeInto(value, new char[length]);\n }", "public ByteArray(final int length)\n\t{\n\t\t// initialize the byte array\n\t\tbytes = new byte[length];\n\t\t\n\t\t// fill the array with byte 0\n\t\tArrays.fill(bytes, (byte) 0);\n\t}", "public static void main(String[] args) {\n\t\tBigInteger a = f(9999);\n\t\tString n = Integer.toBinaryString(a.intValue());\n\t\tSystem.out.println(a.bitLength());\n\t}", "static void initBin(int[] binToInt)\n {\n for(int i = 0; i < 32; i++)\n {\n binToInt[i] = 0;\n }\n }", "public Binary suma1(){\n\n java.lang.String tosum1to;\n if (!this.toString().equals(\"0\")){\n if (java.lang.String.valueOf(this.getValue().charAt(0)).equals(\"1\") && java.lang.String.valueOf(this.getValue().charAt(1)).equals(\"1\")){\n tosum1to= this.toString().substring(1);\n }\n else {\n tosum1to= this.toString();\n }\n }\n else {\n tosum1to= this.toString();\n }\n int sumlength= tosum1to.length();\n java.lang.String retstring= \"\";\n int i=1;\n for (; i<= sumlength; i++){\n if (java.lang.String.valueOf(tosum1to.charAt(sumlength - i)).equals(\"1\")) {\n retstring+= \"0\";\n }\n else {\n retstring+= \"1\";\n i++;\n break;\n }\n }\n for (; i<= sumlength; i++){\n retstring+= java.lang.String.valueOf(tosum1to.charAt(sumlength-i));\n }\n if (this.sign().equals(\"0\") && java.lang.String.valueOf(retstring.charAt(sumlength-1)).equals(\"1\")) {\n retstring+= \"0\";\n }\n return new Binary(reverse(retstring));\n }", "private TinyMT32 getZero() {\n TinyMT32 that = new TinyMT32(this);\n that.st0 = 0;\n that.st1 = 0;\n that.st2 = 0;\n that.st3 = 0;\n return that;\n }", "public static String num2Bin(int a) {\n StringBuilder sb = new StringBuilder();\n for (int bitPow2 = 1, i = 0; i < Integer.SIZE; bitPow2 <<= 1,\n ++i) {\n if ((a & bitPow2) == bitPow2) {\n sb.append(\"1\");\n } else {\n sb.append(\"0\");\n }\n }\n return sb.reverse().toString();\n }", "int next(int bits);", "private void createHammed()\n\t{\n\t\tint j=0;\n\t\tboolean skip = false;\n\t\t\n\t\t\n\t\tfor (int i=0;i<binaryCode.length; i++)\n\t\t{\t\n\t\t\t//checks to see if the bit is a parity bit\n\t\t\tfor (int k=0; k<PARITY.length;k++)\n\t\t\t{\n\t\t\t\t//if it is a parity bit, it skips\n\t\t\t\tif (i==PARITY[k])\n\t\t\t\t{\n\t\t\t\t\tskip=true;\n\t\t\t\t} \n\n\t\t\t}\n\t\t\t\n\t\t\tif (skip)\n\t\t\t{\n\t\t\t\tskip=false;\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//if it is not a parity bit, it places the value into the bit position\n\t\t\t\tbinaryCode[i]=binaryNumber.getBitValue(j);\n\t\t\t\tj++;\n\t\t\t}\n\n\t\t}\n\t}", "static BigInteger randomNonNegativeBigInteger(int numBits) {\n int digits = RANDOM_SOURCE.nextInt(numBits);\n if (digits == 0) {\n return new BigInteger(1, RANDOM_SOURCE);\n } else {\n return new BigInteger(digits, RANDOM_SOURCE).setBit(digits);\n }\n }", "public void resetZero() {\n\t\tset((byte) (get() & ~(1 << 7)));\n\t}", "public String asBinary() {\n String binaryString = \"\";\n\n for (; this.decimalValue > 0; decimalValue /= 2) {\n if (this.decimalValue % 2 == 0) {\n binaryString += \"0\";\n } else {\n binaryString += \"1\";\n }\n }\n\n return new StringBuilder(binaryString).reverse().toString();\n }", "private static ByteBuffer _zeroBuffer( int size, BufferType type )\n {\n ByteBuffer zeroBuf = zeroTL(type).get();\n zeroBuf.clear();\n zeroBuf.limit(size);\n return zeroBuf;\n }", "public char O00000o() {\r\n char c = this.O00000oO >= this.O00000o ? O000000o : this.O00000o0[this.O00000oO];\r\n this.O00000oO++;\r\n return c;\r\n }", "@Override\n public char getTypeCode() {\n return '0';\n }", "LengthAdd createLengthAdd();", "public static String addLeadingZerosToString (String number, int length){\n //the length of the \"number\" is greater than or equal to the \"length\"\n if ( StrUtil.isEmpty( number ) || length <=number.length()) return number;\n \n return (addLeadingZerosToNumber(0, length) + number).substring(number.length());\n }", "@Override public Type make_nil(byte nil) { return make(nil,_any); }", "public static char[] zeroPrefixChars(long value, int length) {\n Checks.nonNegative(\"length\", length);\n if (value >= 0 && value < 10 && length > 0) {\n char[] result = new char[length];\n Arrays.fill(result, 0, length - 1, '0');\n result[length - 1] = (char) ('0' + value);\n return result;\n }\n return writeInto(value, new char[length]);\n }", "@Test\n public void testSizeRandomBinaryData() throws Exception {\n /* Test with valid value */\n int[] result = NoiseGenerator.randomBinaryData(5,0.50);\n Assert.assertFalse(result == null);\n\n /* Test with invalid value */\n result = NoiseGenerator.randomBinaryData(-1,0.50);\n Assert.assertTrue(result == null);\n }", "public String O0000o0() {\r\n char c;\r\n int i = this.O00000oO;\r\n while (this.O00000oO < this.O00000o) {\r\n c = this.O00000o0[this.O00000oO];\r\n if ((c < 'A' || c > 'Z') && ((c < 'a' || c > 'z') && !Character.isLetter(c))) {\r\n break;\r\n }\r\n this.O00000oO++;\r\n }\r\n while (!O00000Oo()) {\r\n c = this.O00000o0[this.O00000oO];\r\n if (c < '0' || c > '9') {\r\n break;\r\n }\r\n this.O00000oO++;\r\n }\r\n return O000000o(i, this.O00000oO - i);\r\n }", "private static void spacesToBinary() {\n\t\tString stringBinary = \"\"; \n\t\tfor(int i = 0; i < spaces.length; i++) {\n\t\t\tif(spaces[i].length() % 2 == 0) { stringBinary += \"1\"; }\n\t\t\telse if(spaces[i].length() % 2 == 1) { stringBinary += \"0\"; }\n\n\t\t\tif(i != 0 && (i+1) % 5 == 0) {\n\t\t\t\tbinary.add(stringBinary);\n\t\t\t\tstringBinary = \"\";\n\t\t\t} \n\t\t\telse if(i+1 == spaces.length) {\n\t\t\t\tfor(int k = (i+1)%5; k < 5; k++) {\n\t\t\t\t\tstringBinary += \"0\";\n\t\t\t\t}\n\t\t\t\tbinary.add(stringBinary);\n\t\t\t\tstringBinary = \"\";\n\t\t\t}\n\t\t}\n\t}", "public int length() {\n int counter = 0;\n while (bitAt(counter) == '1' || bitAt(counter) == '0') {\n counter = counter + 1;\n }\n return counter;\n }", "public void zero();", "public boolean getZeroFlag() {\n // PROGRAM 1: Student must complete this method\n // return value is a placeholder, student should replace with correct return\n int zero = 0; //integer to keep track of how many '1's are in the output array\n for (int i = 0; i < output.length; i++) {\n if (output[i]) { //when we come across a 1, add 1 to the zero integer.\n zero += 1;\n }\n }\n if (zero > 0) { //if the method caught any '1's, then the output binary number is not 0.\n zeroFlag = false;\n } else {\n zeroFlag = true; //otherwise, it is\n }\n return zeroFlag; //return the zeroFlag\n }", "static int bitLengthForInt(int n) {\n return 32 - Integer.numberOfLeadingZeros(n);\n }", "static int addZero(int num, int n) {\n\t\t\t\n\t\t\treturn 0;\n\t\t}", "static int findBinaryStringBrutForce(int[] arr){\n int numOfZeros;\n int numOfOnes;\n int maxLength = 0;\n for(int i=0; i<arr.length; i++) {\n numOfZeros=0;\n numOfOnes=0;\n for(int j=i; j<arr.length; j++) {\n if(arr[j] == 0)\n numOfZeros++;\n else\n numOfOnes++;\n if( numOfZeros == numOfOnes )\n maxLength = Math.max(maxLength, numOfZeros*2 );\n }\n }\n return maxLength;\n }", "public ZeroCountDataWriter() {\n\t\tsuper(DataWriterType.ZEROCNTType);\n\t}", "public boolean isZero() {return false;}", "private static int bitLength(int[] val, int len) {\n if (len == 0)\n return 0;\n return ((len - 1) << 5) + bitLengthForInt(val[0]);\n }", "public String toString()\n\t{\n\t\tString binary = \"\"; //string to store the binary number\n\t\t\n\t\t//loops through each of the bit positions\n\t\tfor (int i=binaryCode.length-1; i>=0; i--)\n\t\t{\n\t\t\t\n\t\t\t//checks the value of the bit\n\t\t\tif (binaryCode[i]==false)\n\t\t\t{\n\t\t\t\t//if the boolean is false, then the bit is a 0\n\t\t\t\tbinary+=\"0\";\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//since there are only two states, if it is not 0, then it is 1\n\t\t\t\tbinary+=\"1\";\t\t\n\t\t\t}\n\t\t}\t\t\n\t\t//returns the binary number as a string\n\t\treturn binary;\n\t}", "private static void create(int num1, int num2) {\n\t\tlong result = (~(~0<<num1)) << num2;\n\t\tSystem.out.println(result);\n\t}", "public static int BIASED_ONE_OR_ZERO()\n\t{\n\t}", "UnsignedValue createUnsignedValue();", "public boolean isZeroLength() {\r\n return value.length() == 0;\r\n }", "boolean isZero();", "private int[] getBinaryFormReversed(int number, int length) {\n StringBuilder binaryRepresentation = new StringBuilder(Integer.toBinaryString(number));\n int[] array = new int[length];\n\n while (binaryRepresentation.length() != length) {\n binaryRepresentation.insert(0, \"0\");\n }\n for (int i = 0; i < binaryRepresentation.length(); i++) {\n array[length - 1 - i] = Character.getNumericValue(binaryRepresentation.charAt(i));\n }\n return array;\n }", "private String zxt (long inp, int length) {\n String result = Long.toString(inp);\n int dist = (length - result.length());\n for (int i = 0; i < dist; i++) {\n result = \"0\" + result;\n }\n return result;\n }", "String intToBinaryNumber(int n){\n return Integer.toBinaryString(n);\n }", "public int toByte(){\n return toByte(0);\n }", "@Test\n public void testZeroA() {\n assertEquals(0, PiGenerator.powerMod(0, 5, 42));\n }", "public Happy_Number()\r\n\t{\r\n\t\tnumberHolder = new int[20];\r\n\t\tfor(int ii = 0; ii < numberHolder.length; ii++)\r\n\t\t{\r\n\t\t\tnumberHolder[ii] = 0;\r\n\t\t}\r\n\t}", "protected Word(int length) {\n\t\t// check if the length of is reasonable\n\t\tif(length > 0) {\n\t\t\t// initial the instance variables\n\t\t\tthis.length = length;\n\t\t\tthis.unrevealedSlots = this.length;\n\t\t\tthis.mask = new boolean[this.length];\n\t\t\t//each slots in the mask should be true (masked) by default\n\t\t\tfor (int i = 0; i < this.length; i++) {\n\t\t\t\tthis.mask[i] = true;\n\t\t\t}\n\t\t}else {\n\t\t\t// throw a exception if the length is not allowed\n\t\t\tthrow new RuntimeException(\"Non-positive value is unacceptable.\");\n\t\t}\n\t}", "default BitStream bitStream() {\n return bitStream(0);\n }", "public static final BigInteger generateRandomNumber(int bitLength, Random random)\r\n\t{\r\n\t\tBigInteger base = ElGamalKeyParameters.TWO.pow(bitLength-1);\r\n\t\tBigInteger r = new BigInteger(bitLength-1, random); //random value in [0, 2^(bitLength-1)[ \r\n\t\treturn base.add(r);\r\n\t}", "public static void main(int a) {\n// System.out.println(~43);\n int bit []=new int[8];\n for (int i = 7; i >=0;){\n\n\n\n }\n\n}", "static BigInteger randomNonZeroBigInteger(int numBits) {\n BigInteger result = randomPositiveBigInteger(numBits);\n return RANDOM_SOURCE.nextBoolean() ? result : result.negate();\n }", "public static void main(String[] args) {\n\t\tint x = ~0;\r\n\t\tSystem.out.println(Integer.toBinaryString(x));\r\n\t\tint y = x>>>8;\r\n\t\tSystem.out.println(Integer.toBinaryString(y));\r\n\t\tSystem.out.println(x+\" \"+y);\r\n\t\t\r\n\t\tint N = 1<<31;\r\n\t\tint M = 0b11;\r\n\t\tint j=2;\r\n\t\tint i=1;\r\n\t\tSystem.out.println(Integer.toBinaryString(N));\r\n\t\tSystem.out.println(Integer.toBinaryString(M));\r\n\t\tSystem.out.println(Integer.toBinaryString(insertMIntoNFromJtoI(M, N, j, i)));\r\n\t\t\r\n\t}", "public int defaultLength() {\r\n return 0;\r\n }", "public static void setZero() {\r\n\t\tint i = 0;\r\n\t\twhile(i < memSize / 4) {\r\n\t\t\tbank0[i] = \"000000000000000000000000\";\r\n\t\t\tbank1[i] = \"000000000000000000000000\";\r\n\t\t\tbank2[i] = \"000000000000000000000000\";\r\n\t\t\tbank3[i] = \"000000000000000000000000\";\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public static Value makeAnyNumUInt() {\n return theNumUInt;\n }", "public Token zero() {\n\t\ttry {\n\t\t\treturn new LongMatrixToken(new long[_rowCount * _columnCount],\n\t\t\t\t\t_rowCount, _columnCount, DO_NOT_COPY);\n\t\t} catch (IllegalActionException illegalAction) {\n\t\t\t// should not happen\n\t\t\tthrow new InternalErrorException(\"LongMatrixToken.zero: \"\n\t\t\t\t\t+ \"Cannot create zero matrix.\");\n\t\t}\n\t}", "public String getLeadingZero(int num) {\n String leading0s = \"\";\n for (int k = 0; k < num; k++)\n leading0s = leading0s + \"0\";\n return leading0s;\n }", "com.google.protobuf.ByteString\n getNum1Bytes();", "public MyInteger( )\n {\n this( 0 );\n }", "static public String zeroPad(int intIn, int len)\n {\n String str = String.valueOf(intIn);\n\n int curlen = str.length();\n StringBuffer sb = new StringBuffer(len);\n \n for (int i=0; i<(len-curlen); i++)\n {\n sb.append(\"0\");\n }\n sb.append(str);\n \n //System.out.println(\"Str len= \" + curlen + \" new len= \" + len);\n return sb.toString();\n }", "public String O0000o0O() {\r\n int i = this.O00000oO;\r\n while (this.O00000oO < this.O00000o) {\r\n char c = this.O00000o0[this.O00000oO];\r\n if ((c < '0' || c > '9') && ((c < 'A' || c > 'F') && (c < 'a' || c > 'f'))) {\r\n break;\r\n }\r\n this.O00000oO++;\r\n }\r\n return O000000o(i, this.O00000oO - i);\r\n }", "public static void toBinary (int number) {\r\n String binary = \"\";\r\n \r\n if (number > 0) {\r\n toBinary(number / 2); \r\n System.out.print(number % 2 + binary);\r\n }\r\n }", "@Override\r\n\tpublic int getLength() {\n\t\treturn 0;\r\n\t}", "BigInteger getLength();" ]
[ "0.75435597", "0.6453969", "0.6272443", "0.6184193", "0.6100292", "0.6015772", "0.59756935", "0.59636617", "0.56955916", "0.5693534", "0.56803733", "0.5678921", "0.5653396", "0.56042933", "0.55939627", "0.5588097", "0.55648804", "0.55377686", "0.553248", "0.552315", "0.5505683", "0.5477981", "0.5475879", "0.54549015", "0.5451286", "0.544705", "0.5446653", "0.54457986", "0.54437363", "0.5435144", "0.54263806", "0.5422862", "0.5418707", "0.5417082", "0.53919065", "0.53892", "0.5388681", "0.53856754", "0.53855646", "0.53853166", "0.5382252", "0.5372782", "0.5372062", "0.53713053", "0.5367757", "0.536737", "0.53577954", "0.5356371", "0.5344191", "0.5341345", "0.5328015", "0.5325881", "0.53222376", "0.531812", "0.5315872", "0.53060675", "0.53048944", "0.53019613", "0.5301006", "0.52957696", "0.5295661", "0.52933615", "0.52901334", "0.528755", "0.52869815", "0.5286457", "0.5282643", "0.52802753", "0.5279911", "0.5276241", "0.52713174", "0.5265818", "0.52489424", "0.5237206", "0.5219325", "0.52144647", "0.5213814", "0.5212772", "0.5207497", "0.5203636", "0.5202767", "0.5200918", "0.5198714", "0.51870334", "0.51767415", "0.5175995", "0.5168154", "0.51669466", "0.5162159", "0.51615506", "0.51587045", "0.51378834", "0.513418", "0.5127954", "0.5123707", "0.5120045", "0.5119946", "0.51173776", "0.51145786", "0.5107444" ]
0.7607741
0
creates a binary number out of a string
@SuppressWarnings("null") public BinaryNumber(String str){ if ((str==null)&&(str.length()<1)){ System.out.println("The string is empty"); return; } data = new int[str.length()]; for (int i = 0; i <str.length(); i++){ data[i] = Character.getNumericValue(str.charAt(i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BinaryNumber(String str) {\n\t\tint length = str.length();\n\t\tdata = new int[length];\n\t\tfor(int i = 0;i < str.length();i++) {\n\t\t\tint number = Character.getNumericValue(str.charAt(i));\n\t\t\tif (number == 0||number == 1) {\n\t\t\t\tdata[i] = number;\n\t\t\t}\n\t\t}\n\t}", "public int hexToBin(String input) {\r\n\t\treturn Integer.valueOf(new BigInteger(input, 16).toString(2));\t\t\r\n\t}", "public static String fakeBin(String numberString) {\n numberString = numberString.replaceAll(\"[0-4]\", \"0\");\n numberString = numberString.replaceAll(\"[5-9]\", \"1\");\n return numberString;\n }", "public static String binaryCode(String n)\n\t{\n\t\tString retValue = \"\";\n\n\t\tint num = Integer.parseInt(n);\t//convert the input string into int\n\n\t\twhile(num>0)\n\t\t{\n\t\t\tif(num==1)\n\t\t\t\tretValue += num;\n\t\t\telse\n\t\t\t\tretValue += Integer.toString(num%2);\t//resto della divisione\n\t\t\t\tnum = num/2;\t\t\t\t\t\t\t//divide the number by 2\n\t\t}\n\n\t\treturn new StringBuilder(retValue).reverse().toString();\n\t}", "public static int BinaryToNumber(String numberInput) {\r\n\r\n\t\t//Varibales are given values.\r\n\t\tdouble temp = 0, binary_number = 0;\r\n\t\tint j = numberInput.length();\r\n\t\tint i = 0;\r\n\t\t\r\n\t\t//Every Char is cycled through\r\n\t\twhile (i < numberInput.length()) {\r\n\t\t\tint z = Character.digit(numberInput.charAt(i), 10);\r\n\r\n\t\t\t//If there is a 1 it is translated into a base 10 value\r\n\t\t\tif (z == 1) {\r\n\t\t\t\ttemp = Math.pow(2, j - 1.0);\r\n\t\t\t\tbinary_number += temp;\r\n\t\t\t}\r\n\r\n\t\t\ti++;\r\n\t\t\tj--;\r\n\t\t}\r\n\t\t//the final base 10 value is passed into x and returned. \r\n\t\tint x = (int) binary_number;\r\n\t\treturn x;\r\n\t}", "public static String TextToBinary(String input){\n\t\tString output = \"\";\n\t\tfor(int i = 0; i < input.length(); i++){\n\t\t\toutput += Integer.toBinaryString(0x100 | input.charAt(i)).substring(1);\n\t\t}\n\t\treturn output;\n\t}", "public static Symbol binary(String text)\r\n\t{\r\n\t\treturn number(text, 2);\r\n\t}", "public int stringBinaryToInteger(String str)\n\t{\n\t\tif(str!=null)\n\t\t{\n\t\t\tint result = 0;\n\t\t\tint power = 0;\n\t\t\tfor(int i=str.length()-1; i>=0;i--)//Decrementing since we need to go from right to left\n\t\t\t{\n\t\t\t\t//\t\t\tSystem.out.println(\"str.charAt(i):\"+str.charAt(i));\n\t\t\t\tresult += Integer.parseInt(\"\"+str.charAt(i))*Math.pow(2, power++);\n\t\t\t}\n\t\t\tSystem.out.println(\"Result:\"+result);\n\t\t\treturn result;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Empty String\");\n\t\t\treturn 0;\n\t\t}\n\t}", "static int beautifulBinaryString(String b) {\n int index = b.indexOf(\"010\", 0) ;\n int change = 0;\n while (index != -1) {\n change++;\n index = b.indexOf(\"010\", index + 3) ;\n }\n return change;\n }", "@Test\n public void test2(){\n\n String s =\"1000000000000001\";\n //s = BinaryCalculate.BinaryArithmeticalRightShift(s,1);\n s = BinaryCalculate.BinaryLogicRightShift(s,1);\n int a = BitConversion.fromBinaryStringToInt(s);\n System.out.println(a);\n }", "public static int stringToBits(String s) {\n if (s.length() > 32) throw new RuntimeException(\"Cannot handle more than 32 bits. input='\" + s + \"'\");\n\n int retVal = 0;\n for (int i = 0; i <= (s.length() - 1); i++) {\n if (s.charAt(i) == '1') {\n retVal = retVal + 1;\n }\n if (i < (s.length() - 1))\n retVal <<= 1;\n }\n return retVal;\n }", "static String hexToBin(String s) {\n\t\treturn new BigInteger(s, 16).toString(2);\n\t}", "private int convertstringtobyte(String string) {\n return Integer.parseInt(string, 16);\n }", "public Number(final String theNum, final boolean isBinary)\n {\n if (isBinary) {\n long decimal = 0;\n int n = 0;\n for (int i = theNum.length() - 1; i >= 0; i--) {\n if (theNum.charAt(i) == '1') {\n decimal += Math.pow(2, n);\n }\n n++;\n }\n myBinaryString = theNum;\n myLong = decimal;\n } else {\n myLong = Long.parseLong(theNum);\n myHexString = theNum;\n isHex = true;\n }\n }", "private int toInt(String binary){\n if (bitToInt(binary.charAt(0)) == 0){\n return positiveBinToInt(binary);\n }\n else{\n return negativeBinaryToInt(binary);\n }\n }", "public int binaryToInt(String binary){\n return Integer.parseInt(binary, 2);\n }", "String intToBinaryNumber(int n){\n return Integer.toBinaryString(n);\n }", "public static String getCheckNumber(String paramString){\n int i =paramString.substring(0, 1).getBytes()[0];\n for(int j=1;;j++){\n if(j>=paramString.length())\n return intToHex(Integer.valueOf(i));\n i=(byte)(i^paramString.substring(j, j+1).getBytes()[0]);\n\n }\n }", "public static int getInt(String str){\n int num=0;\n int count = 0;\n if (str.length() == 7)\n return 0;\n for (int i = str.length()-8; i >= 0; i --){\n if (str.charAt(i) == '1') {\n num += Math.pow(2, count);\n }\n count ++;\n }\n return num;\n }", "public static byte str2byte(String s) {\r\n byte b = (byte) 0;\r\n int i;\r\n if (s.length() == 8 && s.matches(regex)) {\r\n i = Integer.parseInt(s, 2);\r\n if (i >= 0 && i <= 255) {\r\n b = (byte) i;\r\n } else {\r\n System.out.println(\"string out of range\");\r\n }\r\n }\r\n return b;\r\n }", "private static int createBitVector(String str) {\n\t\tint bitVector = 0;\n\t\tfor(char c : str.toCharArray()) {\n\t\t\tint x = getCharNum(c);\n\t\t\tbitVector = toggle(bitVector, x);\n\t\t}\n\t\treturn bitVector;\n\t}", "public int decToBin(int input) {\r\n\t String Binary = Integer.toBinaryString(input);\t\r\n\t\treturn Integer.valueOf(Binary);\t\t\r\n\t}", "@Test\n public void decodeString()\n {\n final BinaryEncoder encoder = new BinaryEncoder(16);\n assertThat(encoder.decode(\"0011\"), is(3.0));\n }", "public static Base64Binary valueOf(String stringValue)\r\n\t\t\tthrows NumberFormatException {\r\n\t\tif (stringValue == null) {\r\n\t\t\tthrow new NumberFormatException(\r\n\t\t\t\t\t\"parameter can not be null for Base64Binary\");\r\n\t\t}\r\n\t\treturn new Base64Binary(Base64.decode(stringValue));\r\n\t}", "public static int stringBinaryToDecimal(String s) {\n int sum = 0;\n for (int i = s.length(); i > 0; i--) {\n int num = new Integer(s.substring(i-1,i)).intValue();\n sum += num*Math.pow(2, s.length()-i);\n }\n return sum;\n }", "public static String binaryToDec(String binary) {\n boolean isnegative = false;\n if (binary.startsWith(\"1\")) {\n isnegative = true;\n char[] c = binary.toCharArray();\n for (int i = 0; i < binary.length(); i++) {\n if (Character.getNumericValue(c[i]) == 0) {\n c[i] = '1';\n } else {\n c[i] = '0';\n }\n }\n\n boolean finded = false;\n for (int i = binary.length() - 1; i >= 0 && !finded; i--) {\n if (Character.getNumericValue(c[i]) == 0) {\n c[i] = '1';\n finded = true;\n } else {\n c[i] = '0';\n }\n }\n binary = String.valueOf(c);\n }\n String dec = \"\";\n if (binary.equals(\"10000000000000000000000000000000\")) {\n dec = Integer.toString(Integer.MIN_VALUE);\n isnegative = false;\n } else {\n dec = Integer.toString(Integer.parseInt(binary, 2));\n }\n\n if (isnegative) {\n dec = \"-\" + dec;\n }\n return dec;\n }", "public static BigInteger binaryToBI(String binStr) throws UnsignedBigIntUtilsException {\n BigInteger biResult = new BigInteger(UnsignedBigIntUtils.validateBinaryStr(binStr), 2);\n return biResult;\n }", "public static StringBuilder stringtoBinary(final String text)\n\t{\n\t\tfinal StringBuilder builder = new StringBuilder();\n\t\tbuilder.append(Long.toBinaryString(text.charAt(0)));\n\t\tfor(int i = 1; i < text.length(); i ++)\n\t\t\tbuilder.append(BYTE_DELIMITER+Long.toBinaryString(text.charAt(i)));\n\t\treturn builder;\n\t}", "private StringBuilder binConversion(StringBuilder input) {\n\t\tStringBuilder finalres = new StringBuilder();\n\t\tString currentVal = \"\";\n\t\tchar tempVal = ' ';\n\t\t\n\t\tfor(int i = 0; i < input.length(); i++)\n\t\t{\n\t\t\t\n\t\t\ttempVal = input.charAt(i);\n\t\t\t\n\t\t\tif(isOperator(input.charAt(i)) == false)\n\t\t\t{\n\t\t\t\tcurrentVal = currentVal + Character.toString(tempVal);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\t\t\n\t\t\t\tfinalres.append(val + Character.toString(tempVal));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// converting the last currentVal\n\t\t\n\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\n\t\tfinalres.append(val);\n\t\t\n\t\treturn finalres;\n\t}", "private int getNumberBase(String n1){\n return Integer.parseUnsignedInt(n1, base);\n }", "public Number fromString(String s){\n\n return 0;\n }", "public String addBinary(String a, String b) {\n\t\tint alen = a.length();\n\t\tint blen = b.length();\n int rslen = alen;\n\t\tif(blen > rslen)\n\t\t\trslen = blen;\n\t\trslen++;\n\t\tint[] rs = new int[rslen];\n\t\tfor(int i = 0; i < rslen; i++){\n\t\t\trs[i] = 0;\n\t\t}\n\t\tint next = 0;\n\t\tString result;\n\t\tfor(int i = rslen-1; i >= 0; i--){\n\t\t\talen--;\n\t\t\tblen--;\n\t\t\tint ae = 0;\n\t\t\tint be = 0;\n\t\t\t\n\t\t\tif(alen >= 0)\n\t\t\t\tae = (a.charAt(alen) - '0');\n\t\t\t\n\t\t\tif(blen >= 0)\n\t\t\t\tbe = (b.charAt(blen) - '0');\n\t\t\t\n\t\t\tint curr = ae + be + next;\n\t\t\tif(curr >= 2){\n\t\t\t\tnext = 1;\n\t\t\t\tcurr = curr - 2;\n\t\t\t} else\n\t\t\t\tnext = 0;\n\t\t\trs[i] = curr;\n\t\t}\n\t\t\n\t\tStringBuilder st = new StringBuilder();\n\t\tfor(int i = 0; i < rslen; i++){\n\t\t\tst.append(rs[i]);\n\t\t}\n\t\tresult = st.toString();\n\t\tif(rs[0] == 0){\n\t\t\tresult = result.substring(1);\n\t\t}\n\t\t\n\t\treturn result;\n\t\t\n }", "public int binToDec (String input) {\r\n\t int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn decimal;\t\t\r\n\t}", "java.lang.String getNumb();", "public String addBinary(String a, String b) {\n StringBuilder result = new StringBuilder();\n int carr = 0;\n for (int i = a.length() - 1, j = b.length() - 1; i >= 0 || j >= 0; i--, j--) {\n int ai = i >= 0 ? a.charAt(i) - '0' : 0;\n int bi = j >= 0 ? b.charAt(j) - '0' : 0;\n int sum = carr + ai + bi;\n result.append(sum & 1);\n carr = (sum >>> 1) & 1;\n }\n result.append(carr > 0 ? carr : \"\");\n return result.reverse().toString();\n }", "public static int binaryToDecimal(String text)\r\n {\n int sign = 1;\r\n if (text.charAt(0) == '-')\r\n {\r\n sign = -1;\r\n text = text.substring(1);\r\n }\r\n int result = 0;\r\n String digits = \"01\";\r\n for (int i = 0; i < text.length(); i++)\r\n {\r\n String c = text.substring(i, i+1);\r\n int digit = digits.indexOf(c);\r\n if (digit == -1)\r\n {\r\n System.out.printf(\"Error: invalid binary number %s, exiting...\\n\", text);\r\n System.exit(0);\r\n }\r\n int power = (int) (Math.pow(2, text.length() - i - 1));\r\n result = result + digit * power;\r\n }\r\n \r\n // if the first character of text was a minus, then negate the result.\r\n result = sign * result;\r\n return result;\r\n }", "public static int binary_to_int(String chars){\n\t\tint decimal_number=0,i,j=1;\n\t\tfor(i=(chars.length()-1);i>=0;i--){\n\t\t\tdecimal_number+=(j*char_to_int(chars.charAt(i)));\n\t\t\tj=j*2;\n\t\t}\n\t\treturn decimal_number;\n\t}", "public static BigInteger toBI(String hexStr) throws UnsignedBigIntUtilsException {\n // The \"1\" sets unsigned bit. \n BigInteger biResult = new BigInteger(1, UnsignedBigIntUtils.toByteArray(hexStr));\n return (biResult);\n }", "private void toDec(){\n\t\tlong temp = Long.parseLong(binary.substring(binary.length()/2, binary.length()));\n\t\tlong tempbin = 0;\n\t\tint j = 0;//splits the string in half with 2 for loops \n\t\tfor (int i = 0; i < binary.length()/2;i++){//second half of string\n\t\t\ttempbin+=((long)(Math.pow(2,j))*(temp%10));//convert binary to dec adding as it runs\n\t\t\ttemp/=10;\n\t\t\tj++;\n\t\t}\n\t\ttemp = Long.parseLong(binary.substring(0, binary.length()/2));//first half of string\n\t\tfor (int i = 0; i <= binary.length()/2;i++){\n\t\t\ttempbin+=((long)(Math.pow(2,j))*(temp%10));\n\t\t\ttemp/=10;\n\t\t\tj++;\n\t\t}\n\t\tbinary = Long.toString(tempbin);\n\t}", "private int binaryToDecimal(String revStr){\n String tempStr ;\n int tempInt;\n int result = 0;\n \n for(int i =0; i < revStr.length(); i++)\n {\n tempStr = String.valueOf(revStr.charAt(i));\n tempInt = Integer.parseInt(tempStr);\n \n //if the integer number is not 1 or 0, the number inputed by user is not a bianry number \n //so return -1;\n if(tempInt != 1 && tempInt != 0)\n {\n return -1;\n }\n \n //if the integer number is 0, skip this number\n if(tempInt == 0)\n {\n continue;\n }\n \n //if the integer number is 1 (tempInt = 1), calculate the power\n result = result + (int)(tempInt * Math.pow(2.0, (double)i));\n }\n \n return result;\n }", "boolean isBinary(String str)\n\t{\n\t if(str.length() < 1) return false;\n\t \n\t for(int i=0; i<str.length(); i++){\n\t char t = str.charAt(i);\n\t if(t=='1' || t=='0') continue;\n\t else return false;\n\t }\n\t \n\t return true;\n\t}", "public Binary() { \n\t_decNum = 0;\n\t_binNum = \"0\";\n }", "public static String num2Bin(int a) {\n StringBuilder sb = new StringBuilder();\n for (int bitPow2 = 1, i = 0; i < Integer.SIZE; bitPow2 <<= 1,\n ++i) {\n if ((a & bitPow2) == bitPow2) {\n sb.append(\"1\");\n } else {\n sb.append(\"0\");\n }\n }\n return sb.reverse().toString();\n }", "public int stringToInt(String bytesStr) {\r\n int result = 0;\r\n for(char b : bytesStr.toCharArray())\r\n result = (result << 8) + (int)b;\r\n return result;\r\n }", "public static String binConvertInt(long num) {\n\t\tString binString = \"\";\n\n\t\t// ORIGINAL CODE FOR INT BINCONVERT\n\n\t\tlong binary = 0;\n\t\tint count = 0;\n\n\t\tif (num >= 0) {\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t}\n\n\t\telse {\n\n\t\t\tnum = -1 * num;\n\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t\t// flip the binary to negative conversion\n\n\t\t\tchar ch[] = binString.toCharArray();\n\t\t\tboolean addedOne = false;\n\n\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\tif (ch[i] == '0') {\n\t\t\t\t\tch[i] = '1';\n\t\t\t\t} else {\n\t\t\t\t\tch[i] = '0';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (ch[binString.length() - 1] == '0') {\n\n\t\t\t\tch[binString.length() - 1] = '1';\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tch[binString.length() - 1] = '0';\n\t\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\t\tif(ch[i] == '1') {\n\t\t\t\t\t\tch[i] = '0';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tch[i] = '1';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\tbinString = new String(ch);\n\t\t}\n\n\t\t\n\t\treturn binString;\n\t}", "private static int toDecimal(String binary) {\n\t\tint decimal = 0;\n\n\t\tfor(int i = binary.length()-1; i >= 0; i--) {\n\t\t\tif(i == 4) {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 1;}\n\t\t\t}\n\t\t\telse if(i == 3) {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 2;}\n\t\t\t}\n\t\t\telse if(i == 2) {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 4;}\n\t\t\t}\n\t\t\telse if(i == 1) {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 8;}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 16;}\n\t\t\t}\n\t\t}\n\n\t\treturn decimal;\n\t}", "public static String toBinary(int number)\n\t{\n\t\tString total = \"\";\n\t\tint a;\n\t\twhile (number > 0) {\n\n\t\t\ta = number % 2;\n\n\t\t\ttotal = total + \"\" + a;\n// divide number by 2 \n\t\t\tnumber = number / 2;\n\n\t\t\t}\n\n// return value \n\t\treturn (new StringBuilder(total)).reverse().toString();\n\t\t\n\t}", "public static Binary integer_to_binary_1(Integer integer) {\n return new Binary(integer.toString().getBytes(ISO_8859_1));\n }", "public static int decimalToBinary(int s){\n\t\tString result=\"\";\n\t\tif (s<=0){\n\t\t\treturn 0;\n\t\t}\n\t\tfor (int i = 2; s> 0; s/=2){\n\t\t\tresult=result + s%2; \n\t\t}\n\t\tString p1= \"\";\n\t\tfor (int i=0; i<result.length(); i++){\n\t\t\tString l=result.substring(i, i+1);\n\t\t\tp1=p1+l;\n\t\t}\n\t\t\n\t\treturn lib.Change.StringToInt(p1, -1);\n\t\n\t}", "public static String addBinary(String a, String b) {\r\n\r\n \r\n \tlong a1=0,b1=0;\r\n \tString s2 = \"\";\r\n \tfor(int i =a.length()-1, j=0 ; (a.length()-j)!=0;i--,j++) {\r\n \t\tint d = a.charAt(i);\r\n \t\tif(d==48)\r\n \t\t\td = 0;\r\n \t\telse\r\n \t\t\td = 50-d;\r\n \t\r\n \t\ta1 = (long) (a1+d*(Math.pow(2, j)));\r\n \t\t\r\n \t}\r\n \tfor(int i =b.length()-1, j=0 ; (b.length()-j)!=0;i--,j++) {\r\n \t\tint d = b.charAt(i);\r\n \t\tif(d==48)\r\n \t\t\td=0;\r\n \t\telse\r\n \t\t\td=50-d;\r\n \t\tb1 = (long) (b1+d*(Math.pow(2, j)));\r\n \t\t\r\n \t}\r\n \tSystem.out.println(a1+\" \"+b1);\r\n \tlong ans1 = a1+b1;\r\n \tif(ans1 == 0)\r\n \t\ts2 = \"0\";\r\n \telse\r\n \twhile(ans1>0) {\r\n \t\tlong rem = ans1%2;\r\n \t\ts2 = rem+s2;\r\n \t\tans1=ans1/2;\r\n \t}\r\n \t\r\n return s2;\r\n }", "public static int bin2dec(String bri) {\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "@Override\n\t\tpublic java.math.BigInteger convert(String s) {\n\t\t\treturn new java.math.BigInteger(s);\n\t\t}", "public static int convertToBinary(int input)\n {\n /*create a variable for remainder of input divided by 2 (will be either 0 or 1);\n this is the least significant digit of the binary string\n */\n int remainder = input % 2; \n \n //base case, return input if input is 0 or 1 (smallest two possibilities)\n if (input == 0 || input == 1) \n return input; \n \n /* if input is not 0 or 1, then return remainder + (value returned by \n convertToBinary(input/2) multiplied by ten); note that if there are n \n recursive method calls, then the return value of the final recursive \n method call is the value of the bit in the 2^ns place; when the stack is \n popped, that value is then multiplied by ten in order to move it one position\n leftward (because this method technically returns a base ten integer, and we\n are simply interpreting it as a binary string), and then the remainder is added to \n give the value of the least significant bit, and this process repeats until\n the initial method call is reached, at which point the remainder is the \n least significant bit\n */\n \n else\n { \n //System.out.println(\"\\nreturn \" + remainder + \" + convert(\"+input/2+\") * 10\");\n return remainder + (convertToBinary(input/2)*10);\n }\n \n }", "int decodeInt();", "public static String toBinaryString(int number) {\r\n\t\tString result = \"\";\r\n\t\tint origin = Math.abs(number);\r\n\r\n\t\twhile (origin > 0) {\r\n\t\t\tif (origin % 2 == 0)\r\n\t\t\t\tresult = \"0\" + result;\r\n\t\t\telse\r\n\t\t\t\tresult = \"1\" + result;\r\n\t\t\torigin = origin / 2;\r\n\t\t}\r\n\t\twhile (result.length() < 16)\r\n\t\t\tresult = \"0\" + result;\r\n\r\n\t\tif (number > 0)\r\n\t\t\treturn result;\r\n\t\telse {\r\n\t\t\tString result2 = \"\";\r\n\t\t\tfor (int i = 0; i < result.length(); i++)\r\n\t\t\t\tresult2 += result.charAt(i) == '1' ? \"0\" : \"1\";\r\n\t\t\tchar[] result2Array = result2.toCharArray();\r\n\t\t\tfor (int i = result2Array.length - 1; i >= 0; i--)\r\n\t\t\t\tif (result2Array[i] == '0') {\r\n\t\t\t\t\tresult2Array[i] = '1';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult2Array[i] = '0';\r\n\t\t\tresult2 = \"\";\r\n\t\t\tfor (int i = 0; i < result2Array.length; i++)\r\n\t\t\t\tresult2 += String.valueOf(result2Array[i]);\r\n\t\t\treturn result2;\r\n\t\t}\r\n\t}", "public BigNum( String s)\r\n { \r\n int i = 0;\r\n myArray = new int[SIZE];\r\n for ( int j = s.length()-1; j >= 0 ; j--)\r\n {\r\n \r\n myArray[i] = s.charAt(j)- '0';\r\n i++;\r\n }\r\n }", "C12000e mo41087c(String str);", "public static String toBinary(int n){\n int length = (int)Math.ceil(Math.log(n)/Math.log(2));\n int[] bits = new int[length];\n for(int x = 0; x < length; x++){\n double val = Math.pow(2, length - x);\n if(n >= val){\n bits[x] = 1;\n n -= val;\n }\n else{\n bits[x] = 0;\n }\n }\n String convert = \"\";\n for(int x = 0; x < length; x++){\n convert += bits[x];\n }\n return convert;\n }", "private static int getIntValue(String s) {\n try {\n return Integer.parseInt(s, 16);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n return -1;\n }\n }", "public String addBinString(String s1, String s2) {\r\n // not invalid input, only 0 and 1, no leading 0, \r\n // first char is the most significant\r\n // no perf requirement\r\n // formal api requirement ( documentations, comments, meaningful names), or focus on correctness of the implementation first.\r\n if(s1==null || s1.length() ==0)\r\n return s2;\r\n if(s2==null || s2.length() ==0)\r\n return s1;\r\n \r\n StringBuffer buf1 = new StringBuffer(s1);\r\n StringBuffer buf2 = new StringBuffer(s2);\r\n if(s1.length()<s2.length()) {\r\n StringBuffer tmp = buf1;\r\n buf1 = buf2;\r\n buf2 = tmp;\r\n }\r\n \r\n buf1.reverse();\r\n buf2.reverse();\r\n StringBuffer res = new StringBuffer(); \r\n int carry = 0;\r\n for(int i=0;i< buf1.length();i++) {\r\n char c1 = buf1.charAt(i);\r\n char c2 = '0';\r\n if(i<buf2.length())\r\n c2 = buf2.charAt(i);\r\n int sum = (c1 -'0') + (c2 -'0') + carry;\r\n if(sum%2 ==1)\r\n res.append('1');\r\n else\r\n res.append('0');\r\n carry = sum / 2;\r\n }\r\n if(carry ==1)\r\n res.append(\"1\");\r\n return res.reverse().toString();\r\n\r\n }", "public static Bits fromBinaryString(String binaryString) {\n final int length = binaryString.length();\n final boolean bitsFit = (length % 8) == 0;\n final Bits bits = new Bits(new byte[length / 8 + (bitsFit ? 0 : 1)]);\n\n for (int i = 0; i < length; i++)\n if (binaryString.charAt(i) == '1')\n bits.setBit(i);\n else\n bits.unsetBit(i);\n\n return bits;\n }", "public int pid_0101(String str) \n {\n \n int num_of_TC; \n char ON_OFF; \n String first_byte;\n first_byte=new String(str.substring(0,1));\n MathLib operations= new MathLib(); \n ON_OFF=operations.HexToBin(first_byte).charAt(0);//Bit 0\n if (ON_OFF=='1')//Then the lamp is ON\n {\n double d = Double.valueOf(operations.calculatorXF(str,\"AA\",\"A-128\"));\n num_of_TC= (int)d;\n if (num_of_TC<0) num_of_TC=0;\n }\n else \n num_of_TC=0; \n \n return num_of_TC;\n }", "public static String dexToBin(int value) {\n\tString binVal = Integer.toBinaryString(value);\n\t\treturn binVal;\n\t\t\n\t}", "public String digit(String digit);", "public static byte[] NumStringToBytes(String in) {\n BigInteger num = new BigInteger(in);\n byte[] bytes = num.toByteArray();\n if (bytes.length > 0) {\n if (bytes[0] == 0) {\n byte[] cuttedByte = new byte[bytes.length - 1];\n System.arraycopy(bytes, 1, cuttedByte, 0, bytes.length - 1);\n return cuttedByte;\n }\n\n }\n return num.toByteArray();\n }", "static StringBuilder convert_to_binary(String msg) {\n byte[] bytes = msg.getBytes();\r\n StringBuilder binary = new StringBuilder();\r\n for (byte b : bytes) {\r\n int val = b;\r\n for (int i = 0; i < 8; i++) {\r\n binary.append((val & 128) == 0 ? 0 : 1);\r\n val <<= 1;\r\n }\r\n binary.append(\"\");\r\n }\r\n return binary;\r\n }", "@Override\n\tpublic String convert2Binary(int num) {\n\t\treturn null;\n\t}", "public String binToHex(String input) {\r\n int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn Integer.toString(decimal,16);\t\r\n\t}", "private int positiveBinToInt(String binary) {\n int w = 0;\n for (int i = binary.length() - 1, j = 0; i > 0; i--, j++) {\n w += (int) Math.pow(2, j) * bitToInt(binary.charAt(i));\n }\n return w;\n }", "private void convertToNum(String s)\n\t{\n\t\tchar charArray[] = s.toCharArray();\n\t\tmyMessage = new BigInteger[(int)Math.ceil(s.length()/(double)BLOCK_SIZE)];\n\t\tfor(int i = 0; i < myMessage.length; i++)\n\t\t{\n\t\t\tString chars = \"\";\n\t\t\tfor(int j = 0; j < BLOCK_SIZE; j++)\n\t\t\t{\n\t\t\t\tif(charArray.length > j+(i*BLOCK_SIZE))\n\t\t\t\t{\n\t\t\t\t\tchars += (int)charArray[j+(i*BLOCK_SIZE)];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tchars += \"256\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tmyMessage[i] = new BigInteger(chars);\n\t\t}\n\t}", "C1111j mo5881f(String str);", "public static C8512b m51357a(String str) {\n C8512b bVar = new C8512b();\n bVar.f36547e = 1000;\n bVar.f36549g = 1001;\n bVar.f36548f = str;\n return bVar;\n }", "private String decimalToBinary(int num) {\n String result = \"\";\n \n while(num > 0 ) \n {\n \n \n //get the remainder\n result = num % 2 + result;\n \n // Divide the positive decimal number by two( then divide the quotient by two)\n num = num /2;\n }\n \n return result;\n }", "public static String addBinary(String a, String b){\n\t\tint size_a = a.length(), size_b = b.length();\n\t\tint i = size_a-1, j = size_b-1, carryon = 0;\n\t\tint aa, bb;\n\t\tString result = \"\";\n\t\twhile(i > -1 || j > -1 || carryon != 0){\n\t\t\taa = (i > -1) ? Integer.parseInt(a.substring(i,i+1)) : 0;\n\t\t\tbb = (j > -1) ? Integer.parseInt(b.substring(j,j+1)) : 0;\n\t\t\tresult = (aa+bb+carryon)%2 + result;\n\t\t\tcarryon = (aa+bb+carryon)/2;\n\t\t\ti--;\n\t\t\tj--;\n\t\t}\n\t\treturn result;\n\t}", "public static int convertStringToInt(String input){\n\t if(input.length()==0)\n\t return 0;\n\t \n\t int m=(int)input.charAt(0)-48;\n\t int n=input.length();\n\t \n\t while(n!=1)\n\t {\n\t m*=10;\n\t n--;\n\t }\n\t \n\t return m+convertStringToInt(input.substring(1,input.length()));\n\t \n\t \n\t\t\n\t}", "public static int[] convertToBinary(String[] str)\n {\n int binaryArr[] = new int[32];\n int a, b, c, d, i, remainder;\n a = b = c = d = 1;\n Stack<Integer> st = new Stack<Integer>();\n\n // Separate each number of the IP address e.g. for 10.0.0.1 => a=10, b=0, c=0, d=1\n if (str != null)\n {\n a = Integer.parseInt(str[0]);\n b = Integer.parseInt(str[1]);\n c = Integer.parseInt(str[2]);\n d = Integer.parseInt(str[3]);\n }\n\n // convert first number to binary\n for (i = 0; i <= 7; i++)\n {\n remainder = a % 2;\n st.push(remainder);\n a = a / 2;\n }\n\n // Obtain First octet\n for (i = 0; i <= 7; i++) {\n binaryArr[i] = st.pop();\n }\n\n // convert second number to binary\n for (i = 8; i <= 15; i++) {\n remainder = b % 2;\n st.push(remainder);\n b = b / 2;\n }\n\n // Obtain Second octet\n for (i = 8; i <= 15; i++) {\n binaryArr[i] = st.pop();\n }\n\n // convert Third number to binary\n for (i = 16; i <= 23; i++) {\n remainder = c % 2;\n st.push(remainder);\n c = c / 2;\n }\n\n // Obtain Third octet\n for (i = 16; i <= 23; i++) {\n binaryArr[i] = st.pop();\n }\n\n // convert fourth number to binary\n for (i = 24; i <= 31; i++) {\n remainder = d % 2;\n st.push(remainder);\n d = d / 2;\n }\n\n // Obtain Fourth octet\n for (i = 24; i <= 31; i++) {\n binaryArr[i] = st.pop();\n }\n\n return (binaryArr);\n }", "public static int stringToInt(String numb) {\r\n\t\tint temp = 0;\r\n\t\t\r\n\t\t//Convert the string to an int. Set it to a value of zero if not a number.\r\n\t\ttry {\r\n\t\t\ttemp = Integer.parseInt(numb);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\ttemp = 0;\r\n\t\t}\r\n\t\t\r\n\t\treturn temp;\r\n\t}", "public static void main(String[] args) {\n\t @SuppressWarnings(\"resource\")\r\n\t\tScanner scan=new Scanner(System.in);\r\n\t //2-for binary conversion\r\n\t System.out.println(\"enter the no in binary format\");\r\n\t String s=scan.nextLine();\r\n\t int b = Integer.parseInt(s,2);\r\n\t //(\"to be converted\",to the base)\r\n\t // int l = Integer.parseInt(\"444\",10);\r\n\r\n\t // System.out.println(x);\r\n\t //System.out.println(c);\r\n\t //System.out.println(b);\r\n\t System.out.println(b);\r\n\r\n\t}", "String getIndexBits();", "public static String bytesToPositiveNumString(byte[] in) {\n BigInteger num = new BigInteger(1, in);\n return num.toString();\n }", "private static String getBinaryFromDecimal(int decimal)\n\t{\n\n\t\tif( decimal == 0 )\n\t\t{\n\t\t\treturn \"00000000\";\n\t\t}\n\n\t\tif( decimal == 1 )\n\t\t{\n\t\t\treturn \"00000001\";\n\t\t}\n\n\t\tchar[] binary = {'0', '0', '0', '0', '0', '0', '0', '0'};\n\t\tint exponent, value;\n\n\t\tdo\n\t\t{\n\t\t\texponent = getNearestPowerOfTwo(decimal);\n\t\t\tbinary[7-exponent] = '1';\n\t\t\tvalue = (int)Math.pow(2, exponent);\n\t\t\tdecimal = decimal - value;\n\t\t}\n\t\twhile( decimal > 0 );\n\n\t\treturn new String(binary);\n\t}", "public int bitAt(int i) {\n return Integer.parseInt(String.valueOf(lfsr1.charAt(i)));\n }", "public static String printBinary (String n){\n\t\tint intPart = Integer.parseInt(n.substring(0, n.indexOf(\".\")));\n\t\tdouble decPart = Double.parseDouble(n.substring(n.indexOf(\".\")));\n\t\tString iPart = \"\";\n\t\tint bit;\n\t\twhile(intPart > 0){\n\t\t\tbit = intPart %2; //take mod result as the last digit.\n\t\t\tintPart >>= 1;\n\t\t\tiPart = bit + iPart;\n\t\t}\n\t\t\n\t\tString dPart = \"\";\n\t\tdouble val;\n\t\twhile (decPart > 0) {//any left over value?\n\t\t\tif(dPart.length() > 32) return \"Error\";//too long to represent\n\t\t\tval = decPart * 2;\n\t\t\tif(val >= 1) {\n\t\t\t\tdecPart = val - 1;\n\t\t\t\tdPart += 1;\n\t\t\t} else {\n\t\t\t\tdecPart = val;\n\t\t\t\tdPart += 0;\n\t\t\t}\n\t\t}\n\t\treturn iPart + \".\" + dPart;\n\t}", "public int stringIntegerEncoding(String str) {\n if (!str.matches(\"[0-9-]+\"))\n return -1;\n\n char[] strArr = str.toCharArray();\n int number = (strArr[0] != '-') ? Character.getNumericValue(strArr[0]) : 0;\n for (int i =1; i < strArr.length; i++) {\n number = 10*number + Character.getNumericValue(strArr[i]);\n }\n return (strArr[0] == '-')? -number : number;\n }", "private byte[] toByteArray(String s)\r\n\t\t{\n\t\t\tlong l = 0;\r\n\t\t\tif (s.startsWith(\"0x\") || s.startsWith(\"0X\")) {\r\n\t\t\t\tfinal byte[] d = new byte[(s.length() - 1) / 2];\r\n\t\t\t\tint k = (s.length() & 0x01) != 0 ? 3 : 4;\r\n\t\t\t\tfor (int i = 2; i < s.length(); i = k, k += 2)\r\n\t\t\t\t\td[(i - 1) / 2] = (byte) Short.parseShort(s.substring(i, k), 16);\r\n\t\t\t\treturn d;\r\n\t\t\t}\r\n\t\t\telse if (s.length() > 1 && s.startsWith(\"0\"))\r\n\t\t\t\tl = Long.parseLong(s, 8);\r\n\t\t\telse if (s.startsWith(\"b\"))\r\n\t\t\t\tl = Long.parseLong(s.substring(1), 2);\r\n\t\t\telse\r\n\t\t\t\tl = Long.parseLong(s);\r\n\t\t\tint i = 0;\r\n\t\t\tfor (long test = l; test != 0; test /= 0x100)\r\n\t\t\t\t++i;\r\n\t\t\tfinal byte[] d = new byte[i == 0 ? 1 : i];\r\n\t\t\tfor (; i-- > 0; l /= 0x100)\r\n\t\t\t\td[i] = (byte) (l & 0xff);\r\n\t\t\treturn d;\r\n\t\t}", "public int Converter(String string)\r\n {\r\n if(string.equals(\"0\"))\r\n return 0;\r\n else\r\n if(string.equals(\"1\"))\r\n return 1;\r\n else if(string.equals(\"2\"))\r\n {\r\n return 2;\r\n }else if(string.equals(\"3\"))\r\n {\r\n return 3;\r\n }else if(string.equals(\"4\"))\r\n {\r\n return 4;\r\n }\r\n \r\n return 1;\r\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tString s = \"9123401\";\r\n\tint a =\tInteger.parseInt(String.valueOf(s.charAt(0)));\r\n\t\r\n\tint b = s.charAt(0) -'0';\r\n//\tSystem.out.println((int)'0');\r\n\tSystem.out.println(b);\r\n//\tSystem.out.println(a);\r\n\r\n\t}", "public static String decToBinR( int n ) { \n\tif (n == 0)\n\t return \"0\";\n\telse if (n == 1)\n\t return \"1\";\n\telse\n\t return n % 2 + decToBin(n / 2);\n }", "public static int VersionToNumber(String str) {\n boolean error = false ;\n int i = 0;\n int result = 0;\n int digitsAfterDecimal = 0;\n boolean afterDecimal = false;\n while ((!error) && i < str.length()) {\n char c = str.charAt(i);\n if (('0' <= c) && (c <= '9')) {\n result = 10 * result + (c - '0');\n if (afterDecimal) {\n digitsAfterDecimal++;\n if (digitsAfterDecimal > 3) {\n error = true;\n }\n }\n } else if (c == '.') {\n afterDecimal = true;\n } else {\n error = true;\n }\n i++;\n }\n if (error) {\n return -1;\n }\n for (int j = 0; j < 3 - digitsAfterDecimal; j++) {\n result = 10 * result;\n }\n return result;\n }", "private static String getBinaryDigit(int iter, int seed)\r\n {\r\n if(iter == 0) {return \"\";}\r\n String result = seed % 2 == 0 ? \"0\" : \"1\";\r\n return result + getBinaryDigit(iter - 1, (int)Math.pow(seed,2) % (p * q));\r\n }", "public static int stringToInt(String aKey){\r\n\t\t\r\n\t\tint pseudoKey = 0;\r\n\t\tint n = 1;\r\n\t\tint cn = 0;\r\n\t\tchar c[] = aKey.toCharArray();\r\n\t\tint grouping = 0;\r\n\t\t\r\n\t\twhile(cn < aKey.length()){\r\n\t\t\t\r\n\t\t\tgrouping = grouping << 8;\r\n\t\t\tgrouping += c[cn];\r\n\t\t\tcn++;\r\n\t\t\t\r\n\t\t\tif(n == 4 || cn == aKey.length()){\r\n\t\t\t\tpseudoKey += grouping;\r\n\t\t\t\tn = 0;\r\n\t\t\t\tgrouping = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tn++;\r\n\t\t\t\r\n\t\t}// End of while loop\r\n\t\treturn Math.abs(pseudoKey);\r\n\t\t\r\n\t}", "private String toBinary(byte caracter){\n byte byteDeCaracter = (byte)caracter;\n String binario=\"\";\n for( int i = 7; i>=0; i--){\n binario += ( ( ( byteDeCaracter & ( 1<<i ) ) > 0 ) ? \"1\" : \"0\" ) ;\n }\n return binario;\n }", "public static String BitStringToText(String s) {\n StringBuffer sb = new StringBuffer();\n int begIndex = 0;\n int endIndex = 8;\n for (int i = 0; i < s.length() / 8; i++) {\n String chunk = s.substring(begIndex, endIndex);\n int charCode = Integer.parseInt(chunk, 2);\n String y = new Character((char) charCode).toString();\n sb.append(y);\n begIndex += 8;\n endIndex += 8;\n }\n return sb.toString();\n }", "int toInt(String a){\n\t\tint name=0;\r\n\t\tfor(int i=0;i<a.length();i++){\r\n\t\t\tname+=(int)a.charAt(i);\r\n\t\t}\r\n\t\treturn name;\r\n\t}", "public int strToDec(String str){\n int decimal = 0;\n Stack<Integer> hexStack = new Stack<>();\n\n for(int i = 0; i < str.length(); i++)\n {\n hexStack.push(this.hexabet.indexOf(str.charAt(i)));\n }\n\n for(int i = 0; hexStack.size() > 0; i++)\n {\n decimal += hexStack.pop() * Math.pow(16, i);\n }\n return decimal;\n }", "private static int parseInt(String sn) {\n\t\treturn Integer.parseInt(sn.substring(2), 16);\n\t}", "static String convert(String bits) {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tstringBuilder.append(String.valueOf(hexLookUp.charAt(Integer.parseInt(bits, 2))));\n\t\tString hex = stringBuilder.toString();\n\t\treturn hex;\n\t}", "public static int makeID(String id) {\r\n if (id.length() != 4) {\r\n throw new IllegalArgumentException(\"String must be exactly 4 characters long\");\r\n }\r\n\r\n byte[] bytes = id.getBytes();\r\n return (bytes[3] << 24) | (bytes[2] << 16) | (bytes[1] << 8) | bytes[0];\r\n }", "public static int m2197ao(String str) {\n try {\n return Integer.valueOf(str).intValue();\n } catch (Exception e) {\n return -1;\n }\n }", "public String addBinary(String a, String b) {\n StringBuilder ans = new StringBuilder();\n int carry = 0, tempRes = 0;\n int indexA = a.length() - 1, indexB = b.length() - 1;\n while (indexA >= 0 || indexB >= 0) {\n int digitA = 0, digitB = 0;\n if (indexA >= 0) digitA = a.charAt(indexA) - '0';\n if (indexB >= 0) digitB = b.charAt(indexB) - '0';\n tempRes = digitA + digitB + carry;\n carry = tempRes / 2;\n char ch = (char) (tempRes % 2 + '0');\n ans.insert(0, ch);\n indexA--;\n indexB--;\n }\n if (carry > 0) {\n char ch = (char) (carry + '0');\n ans.insert(0, ch);\n }\n return ans.toString();\n }" ]
[ "0.7425193", "0.6940353", "0.69399565", "0.6885391", "0.6834162", "0.6780789", "0.6700142", "0.6636742", "0.660616", "0.6519596", "0.6506363", "0.6478306", "0.6473261", "0.64099056", "0.6343886", "0.63096774", "0.62012786", "0.6199108", "0.6182392", "0.6132805", "0.611962", "0.61137646", "0.6105439", "0.6091887", "0.60910815", "0.5969268", "0.59531933", "0.5935754", "0.59066814", "0.5904412", "0.58918864", "0.58662057", "0.5848258", "0.58466107", "0.58256686", "0.5823018", "0.5794647", "0.5779048", "0.5771013", "0.5754286", "0.5745237", "0.57396483", "0.57384133", "0.5738261", "0.5716744", "0.5715181", "0.5688821", "0.56880504", "0.56877047", "0.56583625", "0.5657427", "0.56465846", "0.56270295", "0.56210965", "0.5617246", "0.56112456", "0.5606976", "0.5596831", "0.5591305", "0.5575491", "0.5571824", "0.5560506", "0.5552806", "0.5549257", "0.55477685", "0.5529839", "0.552918", "0.55184543", "0.5517329", "0.5482205", "0.54807186", "0.54748565", "0.5471505", "0.54704285", "0.5469489", "0.5469141", "0.5460328", "0.5458555", "0.5454848", "0.54456586", "0.54383504", "0.5427721", "0.5423478", "0.5422463", "0.54221207", "0.5420052", "0.54173106", "0.54025584", "0.5398307", "0.53967005", "0.5387951", "0.5384837", "0.53829813", "0.537852", "0.53782207", "0.5377168", "0.53750765", "0.53737503", "0.5370635", "0.53644574" ]
0.69306356
3
determines the length of a binary number
public int getLength(){ return data.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getHighBitLength();", "static int bitLengthForInt(int n) {\n return 32 - Integer.numberOfLeadingZeros(n);\n }", "private int intLength() {\n return (bitLength() >>> 5) + 1;\n }", "BigInteger getLength();", "public int length() {\n int counter = 0;\n while (bitAt(counter) == '1' || bitAt(counter) == '0') {\n counter = counter + 1;\n }\n return counter;\n }", "int getLowBitLength();", "private static int bitLength(int[] val, int len) {\n if (len == 0)\n return 0;\n return ((len - 1) << 5) + bitLengthForInt(val[0]);\n }", "public int bitLength() {\n \tif (bitLength == -1) {\n \t if (signum == 0) {\n \t \tbitLength = 0;\n \t } else {\n \t\t// Calculate the bit length of the magnitude\n \t\tint magBitLength = ((magnitude.length-1) << 5) + bitLen(magnitude[0]);\n\n \t\tif (signum < 0) {\n \t\t // Check if magnitude is a power of two\n \t\t boolean pow2 = (bitCnt(magnitude[0]) == 1);\n \t\t for(int i=1; i<magnitude.length && pow2; i++)\n \t\t\tpow2 = (magnitude[i]==0);\n\n \t\t bitLength = (pow2 ? magBitLength-1 : magBitLength);\n \t\t} else {\n \t\t bitLength = magBitLength;\n \t\t}\n \t }\n \t}\n \treturn bitLength;\n }", "public int getLengthInBytes()\n \t{\n \t\treturn FormatableBitSet.numBytesFromBits(lengthAsBits);\n \t}", "public int getLength() {\n \t\treturn lengthAsBits;\n \t}", "public String conformBinaryLength(int data, int length){\n String binaryParameter = Integer.toBinaryString(data);\n binaryParameter = (StringUtils.repeat('0', length) + binaryParameter).substring(binaryParameter.length());\n return binaryParameter;\n }", "int getIntBitLength() {\r\n\t\treturn intBitLength;\r\n\t}", "public static int sizeBits_length() {\n return 8;\n }", "private static int bitLen(int w)\n {\n int t = w >>> 24;\n if (t != 0)\n {\n return 24 + bitLengths[t];\n }\n t = w >>> 16;\n if (t != 0)\n {\n return 16 + bitLengths[t];\n }\n t = w >>> 8;\n if (t != 0)\n {\n return 8 + bitLengths[t];\n }\n return bitLengths[w];\n }", "protected String getBitLength()\n {\n return bitLength;\n }", "public int getLength() {\n\t\treturn length & 0xffff;\n\t}", "public abstract int getBitSize();", "final int lengthInBits(final K key) {\n\tif (key == null) {\n\t return 0;\n\t}\n\n\treturn keyAnalyzer.lengthInBits(key);\n }", "public static int sizeBits_estLength() {\n return 8;\n }", "private static int readBinaryLength(ObjectInput in) throws IOException {\n\t\t\n\t\tint bl = in.read();\n\t\tif (bl == -1)\n\t\t\tthrow new java.io.EOFException();\n \n byte li = (byte) bl;\n\n int len;\n\t\tif ((li & ((byte) 0x80)) != 0)\n\t\t{\n\t\t\tif (li == ((byte) 0xC0))\n\t\t\t{ \n\t\t\t\tlen = in.readInt();\n \t\t\t}\n\t\t\telse if (li == ((byte) 0xA0))\n\t\t\t{\n\t\t\t\tlen = in.readUnsignedShort();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlen = li & 0x1F;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n \n\t\t\t// old length in bits\n\t\t\tint v2 = in.read();\n\t\t\tint v3 = in.read();\n\t\t\tint v4 = in.read();\n\t\t\tif (v2 == -1 || v3 == -1 || v4 == -1)\n\t\t\t\tthrow new java.io.EOFException();\n int lenInBits = (((bl & 0xff) << 24) | ((v2 & 0xff) << 16) | ((v3 & 0xff) << 8) | (v4 & 0xff));\n\n\t\t\tlen = lenInBits / 8;\n\t\t\tif ((lenInBits % 8) != 0)\n\t\t\t\tlen++;\n \t\t}\n\t\treturn len;\n\t}", "short digits();", "static int ones()\n {\n char[] binArray = binary.toCharArray();\n int count = 0;\n int max = 0; \n for(int i = 0; i < binary.length(); i++)\n {\n if(binArray[i] == '0'){\n count = 0;\n }else {\n count++;\n max = Math.max(max, count);\n }\n }\n return max;\n }", "static int bitLen(int w)\n {\n // Binary search - decision tree (5 tests, rarely 6)\n return (w < 1 << 15 ? (w < 1 << 7\n ? (w < 1 << 3 ? (w < 1 << 1\n ? (w < 1 << 0 ? (w < 0 ? 32 : 0) : 1)\n : (w < 1 << 2 ? 2 : 3)) : (w < 1 << 5\n ? (w < 1 << 4 ? 4 : 5)\n : (w < 1 << 6 ? 6 : 7)))\n : (w < 1 << 11\n ? (w < 1 << 9 ? (w < 1 << 8 ? 8 : 9) : (w < 1 << 10 ? 10 : 11))\n : (w < 1 << 13 ? (w < 1 << 12 ? 12 : 13) : (w < 1 << 14 ? 14 : 15)))) : (w < 1 << 23 ? (w < 1 << 19\n ? (w < 1 << 17 ? (w < 1 << 16 ? 16 : 17) : (w < 1 << 18 ? 18 : 19))\n : (w < 1 << 21 ? (w < 1 << 20 ? 20 : 21) : (w < 1 << 22 ? 22 : 23))) : (w < 1 << 27\n ? (w < 1 << 25 ? (w < 1 << 24 ? 24 : 25) : (w < 1 << 26 ? 26 : 27))\n : (w < 1 << 29 ? (w < 1 << 28 ? 28 : 29) : (w < 1 << 30 ? 30 : 31)))));\n }", "default int getCompositeBitLength() {\n return getHighBitLength() + getLowBitLength();\n }", "public static int size_length() {\n return (8 / 8);\n }", "public org.python.types.Int __len__();", "public static int sizeInByte(int val) {\n return sizeInByte(NekoDataType.INTEGER) + NekoIOConstants.INT_LENGTH;\n }", "private static short\n \tnumBitsInLastByte(int bits)\n \t{\n \t\tint modulo = bits % 8;\n \t\treturn (short)((modulo == 0) ?\n \t\t\t\t((bits == 0) ? 0 : 8) :\n \t\t\t\tmodulo);\n \t}", "public static int sizeBits_counter() {\n return 32;\n }", "public static int bitCount(long i) {\r\n // HD, Figure 5-14\r\n\t\ti = i - ((i >>> 1) & 0x5555555555555555L);\r\n\t\ti = (i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L);\r\n\t\ti = (i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL;\r\n\t\ti = i + (i >>> 8);\r\n\t\ti = i + (i >>> 16);\r\n\t\ti = i + (i >>> 32);\r\n\t\treturn (int)i & 0x7f;\r\n }", "public int length();", "public int length();", "public int length();", "public int length();", "public int length();", "public int int_length() {\n return int_size();\n }", "public int get_length();", "protected abstract int decodeLength ();", "public long length() {\n\tint nBits;\n\tlong x, y;\n\tlong length = 7 + Math.max(minBitsS(toFixed(getTranslateX())),\n\t\t\t\t minBitsS(toFixed(getTranslateY())));\n\tif (hasScale()) {\n\t length += 5 + Math.max(minBitsS(toFixed(getScaleX())),\n\t\t\t\t minBitsS(toFixed(getScaleY())));\n\t}\n\tif (hasRotate()) {\n\t length += 5 + Math.max(minBitsS(toFixed(getRotate1())),\n\t\t\t\t minBitsS(toFixed(getRotate2())));\n\t}\n\treturn length;\n }", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int getLength();", "int length();", "int length();", "int length();", "int length();", "int length();", "int length();", "int length();", "public long getLength();", "public long getLength();", "public short get_length() {\n return (short)getUIntElement(offsetBits_length(), 8);\n }", "BigInteger getWidth();", "public abstract int length();", "public abstract int length();", "public static int sizeBits_count() {\n return 16;\n }", "public static int length(int n)\n {\n int w = n;\n if(w == 1)\n {\n return 1;\n } \n else\n {\n return 1 + length(next(w));\n }\n }", "int getIntLength() {\r\n\t\treturn intLength;\r\n\t}", "public static int sizeBits_seqnum() {\n return 8;\n }", "int len();", "public int getLength()\n\t{\n\t\treturn (int) length;\n\t}", "public final int getNumCodedBytes(){\n // NOTE: testing these algorithms for correctness is quite\n // difficult. One way is to modify the rate allocator so that not all\n // bit-planes are output if the distortion estimate for last passes is\n // the same as for the previous ones.\n\n switch (ltype) {\n case LENGTH_LAZY_GOOD:\n // This one is a bit better than LENGTH_LAZY.\n int bitsInN3Bytes; // The minimum amount of bits that can be stored\n // in the 3 bytes following the current byte\n // buffer 'b'.\n if (b >= 0xFE) {\n // The byte after b can have a bit stuffed so ther could be\n // one less bit available\n bitsInN3Bytes = 22; // 7 + 8 + 7\n }\n else {\n // We are sure that next byte after current byte buffer has no\n // bit stuffing\n bitsInN3Bytes = 23; // 8 + 7 + 8\n }\n if ((11-cT+16) <= bitsInN3Bytes) {\n return nrOfWrittenBytes+(delFF ? 1 : 0)+1+3;\n }\n else {\n return nrOfWrittenBytes+(delFF ? 1 : 0)+1+4;\n }\n case LENGTH_LAZY:\n // This is the very basic one that appears in the VM text\n if ((27-cT) <= 22) {\n return nrOfWrittenBytes+(delFF ? 1 : 0)+1+3;\n }\n else {\n return nrOfWrittenBytes+(delFF ? 1 : 0)+1+4;\n }\n case LENGTH_NEAR_OPT:\n // This is the best length calculation implemented in this class.\n // It is almost always optimal. In order to calculate the length\n // it is necessary to know which bytes will follow in the MQ\n // bit stream, so we need to wait until termination to perform it.\n // Save the state to perform the calculation later, in\n // finishLengthCalculation()\n saveState();\n // Return current number of output bytes to use it later in\n // finishLengthCalculation()\n return nrOfWrittenBytes;\n default:\n throw new Error(\"Illegal length calculation type code\");\n }\n }", "public int sizeInBits() {\n\t\treturn this.sizeinbits;\n\t}", "public abstract long getLength();", "public abstract long getLength();", "public static int digits(ByteReader r, int length) {\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < length; i++)\n\t\t\tsum = sum * DECIMAL_RADIX + digit(r);\n\t\treturn sum;\n\t}", "static int findBinaryStringBrutForce(int[] arr){\n int numOfZeros;\n int numOfOnes;\n int maxLength = 0;\n for(int i=0; i<arr.length; i++) {\n numOfZeros=0;\n numOfOnes=0;\n for(int j=i; j<arr.length; j++) {\n if(arr[j] == 0)\n numOfZeros++;\n else\n numOfOnes++;\n if( numOfZeros == numOfOnes )\n maxLength = Math.max(maxLength, numOfZeros*2 );\n }\n }\n return maxLength;\n }", "public static int getByteLength() {\n return RRCLASS_BYTE_LEN;\n }", "public int getSize()\n\t{\n\t\treturn bits.size();\n\t}", "public int getLength();", "public int getLength();", "public int getLength();", "public int numberOfBits() {\n return 8 * this.data.size();\n }", "public int howManyBits(int value) {\n\t\t// TODO: Implement this method.\n\t\treturn 0;\n\t}", "public int bitCount() {\n @SuppressWarnings(\"deprecation\") int bc = bitCount - 1;\n if (bc == -1) { // bitCount not initialized yet\n bc = 0; // offset by one to initialize\n // Count the bits in the magnitude\n for (int i=0; i < mag.length; i++)\n bc += Integer.bitCount(mag[i]);\n if (signum < 0) {\n // Count the trailing zeros in the magnitude\n int magTrailingZeroCount = 0, j;\n for (j=mag.length-1; mag[j] == 0; j--)\n magTrailingZeroCount += 32;\n magTrailingZeroCount += Integer.numberOfTrailingZeros(mag[j]);\n bc += magTrailingZeroCount - 1;\n }\n bitCount = bc + 1;\n }\n return bc;\n }", "public static int offsetBits_length() {\n return 32;\n }", "public BinaryNumber(int length){\n\t\tdata = new int[length];\n\t\tfor (int i=0; i<length; i++){\n\t\t\tdata[i] = 0;\n\t\t}\n\t}", "public static int size_estLength() {\n return (8 / 8);\n }", "private int getLength() throws IOException {\n\n\t\t\tint i = this.in.read();\n\t\t\tif (i == -1) {\n\t\t\t\tthrow new IllegalStateException(\"Invalid DER: length missing\");\n\t\t\t}\n\n\t\t\t// A single byte short length\n\t\t\tif ((i & ~0x7F) == 0) {\n\t\t\t\treturn i;\n\t\t\t}\n\n\t\t\tint num = i & 0x7F;\n\n\t\t\t// We can't handle length longer than 4 bytes\n\t\t\tif (i >= 0xFF || num > 4) {\n\t\t\t\tthrow new IllegalStateException(\"Invalid DER: length field too big (\" + i + \")\");\n\t\t\t}\n\n\t\t\tbyte[] bytes = new byte[num];\n\t\t\tint n = this.in.read(bytes);\n\t\t\tif (n < num) {\n\t\t\t\tthrow new IllegalStateException(\"Invalid DER: length too short\");\n\t\t\t}\n\n\t\t\treturn new BigInteger(1, bytes).intValue();\n\t\t}", "Length createLength();", "public static void main(String[] args) {\n\t\tBigInteger a = f(9999);\n\t\tString n = Integer.toBinaryString(a.intValue());\n\t\tSystem.out.println(a.bitLength());\n\t}", "private int rcInstrLen(int bci) {\n int bc = bytecodes[bci] & 0xFF;\n\n switch (bc) {\n // In the case of switch instructions, see if we have the original padding recorded.\n case opc_tableswitch:\n case opc_lookupswitch: {\n int pad = getOrigSwitchPadding(bci, (bc == opc_lookupswitch));\n\n if (pad == -1) {\n return opcodeLength(bci);\n }\n\n // Otherwise, depends on the switch type.\n switch (bc) {\n case opc_tableswitch: {\n int lo = getInt(bci + 1 + pad + (4 * 1));\n int hi = getInt(bci + 1 + pad + (4 * 2));\n int n = hi - lo + 1;\n\n return 1 + pad + (4 * (3 + n));\n }\n case opc_lookupswitch: {\n int npairs = getInt(bci + 1 + pad + (4 * 1));\n\n return 1 + pad + (4 * (2 + (2 * npairs)));\n }\n }\n }\n }\n\n return opcodeLength(bci);\n }", "public BinaryNumber(int length) {\n\t\tdata = new int[length];\n\t\tfor(int i = 0;i < length;i++) {\n\t\t\tdata[i] = 0;\n\t\t}\n\t}", "public int solution(int N) {\n int totalMax = 0;\n int zeroLength = 0;\n\n StringBuffer binaryNum = makeBinaryNum(N);\n\n for (int i=0; i<binaryNum.length(); i++) {\n if ('0' == binaryNum.charAt(i)) {\n zeroLength ++;\n } else {\n if (i!=0 && binaryNum.charAt(i-1)=='0') {\n totalMax = totalMax < zeroLength ? zeroLength : totalMax;\n }\n\n zeroLength = 0;\n }\n }\n return totalMax;\n }", "protected abstract int getLength();", "private int calcFadcLength(int nFadc) {\n return 2*nFadc;\n }", "public abstract int getLength();", "public abstract int getLength();", "public int my_length();", "public java.lang.Integer getNumberLength() {\r\n return numberLength;\r\n }", "public static int sizeBits_dataType() {\n return 8;\n }", "public static int sizeBits_crc() {\n return 16;\n }", "public static int sizeBits_nodeid() {\n return 8;\n }", "public int getBinCapicityFilled() {\n int binCapicity = 0;\n for( Packet p: packets) {\n binCapicity += p.getPacketHeight();\n }\n return binCapicity;\n\n }" ]
[ "0.7486747", "0.7476336", "0.74191296", "0.73428655", "0.72398615", "0.72322005", "0.714359", "0.69219977", "0.69133645", "0.68763214", "0.68730366", "0.68549216", "0.68443173", "0.68195933", "0.6793141", "0.6686853", "0.6580271", "0.65569943", "0.652291", "0.648377", "0.6467912", "0.6423786", "0.64128447", "0.6388167", "0.63796574", "0.62803584", "0.6277651", "0.6263382", "0.62600344", "0.62344617", "0.62068033", "0.62068033", "0.62068033", "0.62068033", "0.62068033", "0.6195885", "0.61935496", "0.61835796", "0.61834186", "0.61807626", "0.61807626", "0.61807626", "0.61807626", "0.61807626", "0.61807626", "0.61807626", "0.61807626", "0.61807626", "0.61807626", "0.616144", "0.616144", "0.616144", "0.616144", "0.616144", "0.616144", "0.616144", "0.6160102", "0.6160102", "0.61465603", "0.6117804", "0.6109847", "0.6109847", "0.6097297", "0.6081619", "0.6081442", "0.60812104", "0.60745555", "0.60728675", "0.60725796", "0.6060205", "0.602642", "0.602642", "0.6021866", "0.6018598", "0.6018281", "0.60067844", "0.60026866", "0.60026866", "0.60026866", "0.59843695", "0.597844", "0.5970775", "0.59571624", "0.5948569", "0.5942122", "0.5917836", "0.5907908", "0.5906699", "0.59057105", "0.58902806", "0.58834624", "0.5876228", "0.5862694", "0.5852073", "0.5852073", "0.585205", "0.583515", "0.5825547", "0.58155364", "0.5807957", "0.5806687" ]
0.0
-1
obtains a digit of the binary number from the given index
public int getDigit(int index){ if (index+1 > data.length){ System.out.println("index out of bounds"); } return index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getDigit(int index) {\n return getDigit(number, index);\n }", "public int getDigit(int index) {\n\t\tif(index >= 0&&index < data.length) {\n\t\t\treturn data[index];\n\t\t}else {\n\t\t\tSystem.out.println(\" the index is out of bounds\");\n\t\t\treturn 0;\n\t\t}\n\t}", "int getBitAsInt(int index);", "private static int getDigit(ArrayList<Integer> num, int index) {\n return index < num.size() ? num.get(index) : 0;\n }", "public int getDigit(int index) {\n\t\tif (index < 0 || index > data.length - 1) {\n\t\t\tSystem.out.println(\"cease this buffoonery.\");\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\treturn data[index];\n\t}", "private static int getDigit(int position, int value, int radix) {\n return value / (int) Math.pow(radix,position) % radix;\n }", "public static BigInteger getElement(int index) {\n return getElement(index, new BigInteger(\"0\"), new BigInteger(\"1\"));\n }", "public int getInteger(int index)\r\n\t{\r\n\t\tint i = 0;\r\n\r\n\t\t// Calculate the needed size and offset of the int within the binary string.\r\n\t\tint size = intSize - (signedInt ? 1 : 0);\r\n\t\tint offset = intSize * index;\r\n\r\n\t\t// This loop uses simple bit operations to turn the boolean array into an int.\r\n\t\tfor (int a = 0; a < size; a++)\r\n\t\t\ti |= (binary[a + offset] ? 1 : 0) << a;\r\n\r\n\t\t// If the int is signed, flip the value based on the state of the last binary\r\n\t\t// bit.\r\n\t\tif (signedInt)\r\n\t\t\tif (binary[intSize - 1 + offset])\r\n\t\t\t\ti = -i;\r\n\r\n\t\treturn i;\r\n\t}", "public int bitAt(int i) {\n // PUT YOUR CODE HERE\n }", "String getIndexBits();", "private String getByAsc(int index) {\n int asc = 0;\n for (int i = 7; i >= 0; i--) {\n int tempInt = this.code[++index] - 48;\n asc += tempInt * Math.pow(2, i);\n }\n char ret = (char) asc;\n return String.valueOf(ret);\n }", "public static int getIntAt(int number, int index){\n\n String numberString = Integer.toString(number);\n int digitAtIndex = Integer.parseInt(Character.toString(numberString.charAt(index)));\n return digitAtIndex;\n }", "public static int getInt(byte bc[], int index) {\n int i, bhh, bhl, blh, bll;\n bhh = (((bc[index])) << 24) & 0xff000000;\n bhl = (((bc[index + 1])) << 16) & 0xff0000;\n blh = (((bc[index + 2])) << 8) & 0xff00;\n bll = ((bc[index + 3])) & 0xff;\n i = bhh | bhl | blh | bll;\n return i;\n }", "public long getIndex(long number) {\r\n\t\tlong digit;\r\n\t\tlong divide=number/div;\r\n\t\tdigit=divide%radix;\r\n\t\treturn digit;\r\n\t}", "public int findNthDigit(int n) {\n int len = 1, i = 1;\n long range = 9;\n while (n > len * range) {\n n -= len * range;\n len++;\n range *= 10;\n i *= 10;\n }\n i += (n - 1) / len;\n String s = Integer.toString(i);\n return Character.getNumericValue(s.charAt((n - 1) % len));\n }", "boolean getBit(int index);", "public int bitAt(int i) {\n return Integer.parseInt(String.valueOf(lfsr1.charAt(i)));\n }", "byte get(int index);", "public int getDigit(int position) {\r\n return array[position];\r\n }", "public int getInt(int index) {\n if (index < 0 || index >= size) {\n throw new IndexOutOfBoundsException(\"Invalid index: \" + index);\n }\n\n int startIndex = index * bitNum;\n int blockIndex = startIndex / BLOCK_SIZE;\n int bitIndex = startIndex % BLOCK_SIZE;\n int x = vector[blockIndex];\n\n x >>>= bitIndex;\n int b = Math.min(bitNum, BLOCK_SIZE - bitIndex);\n x &= (1 << b) - 1;\n\n if (b < bitNum) {\n x |= vector[blockIndex + 1] << b;\n x &= (1 << bitNum) - 1;\n }\n\n return x;\n }", "public int getIndex() {\n\t\treturn index & 0xffff;\n\t}", "public static int getBit(byte input,int position){\n return (input >> position) & 1;\n }", "protected int realIndex(int index) {\n return index & (buf.length -1);\n }", "private static String getBinaryDigit(int iter, int seed)\r\n {\r\n if(iter == 0) {return \"\";}\r\n String result = seed % 2 == 0 ? \"0\" : \"1\";\r\n return result + getBinaryDigit(iter - 1, (int)Math.pow(seed,2) % (p * q));\r\n }", "private int next(int index) {\n return (index + 2) & mask;\n }", "public int get(final int index) {\n return mFactorBase[index];\n }", "private int getRightOf(int index) {\n // TODO: YOUR CODE HERE\n return index * 2 + 1;\n }", "private static int getRight(int index) {\n\t\treturn getLeft(index) + 1;\n\t}", "public String digit(String digit);", "private static int getNodeIndex(int index, int depth) {\n return (index >>> depth) & 0x1F;\n }", "int get(int i) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n long val = values[numPosition] & (1 << intPosition);\n return (int) (val >> intPosition);\n }", "public static String decToBinR( int n ) { \n\tif (n == 0)\n\t return \"0\";\n\telse if (n == 1)\n\t return \"1\";\n\telse\n\t return n % 2 + decToBin(n / 2);\n }", "String intToBinaryNumber(int n){\n return Integer.toBinaryString(n);\n }", "public abstract int parse(byte bc[], int index);", "public int getKthDigit(int v, int k) {\n for (int i = 0; i < k; i++)\n v /= 10;\n return v % 10;\n }", "public static int getDigit(int number){\r\n int j = 0 ;\r\n j = number % 10;\r\n j += number / 10;\r\n return j;\r\n }", "private int getNext(int index) {\n return index + (index & -index);\n }", "int getNibble(int num, int which)\n {\n return 0b1111 & num >> (which << 2);\n }", "public static Integer getBit(byte input, int position){\n return ((input >> position) & 1);\n }", "private int convertBinaryToDecimal(int binaryValueOfBitMap){\r\n\t\r\n\tint decimalValue = 0;\r\n\ttry {\r\n\t\t int num = binaryValueOfBitMap; \r\n\t\t int dec_value = 0; \t\t \r\n\t\t // Initializing base \r\n\t\t // value to 1, i.e 2^0 \r\n\t\t int base = 1; \r\n\t\t \r\n\t\t int temp = num; \r\n\t\t while (temp > 0) \r\n\t\t { \r\n\t\t int last_digit = temp % 10; \r\n\t\t temp = temp / 10; \r\n\t\t \r\n\t\t dec_value += last_digit * base; \r\n\t\t \r\n\t\t base = base * 2; \r\n\t\t } \r\n\t\t decimalValue = dec_value;\r\n\t}\r\n\tcatch(Exception e) {\r\n\t\tSystem.out.println(\"Exception occurred \"+e);\r\n\r\n\t}\r\n\treturn decimalValue;\r\n\t\t\r\n}", "public SudokuDigit getDigit(int x, int y){\n\t\t//System.out.println(\"getDigit\");\n\t\tif (x >= 0 && x <= 8 && y >= 0 && y <= 8)\n\t\t\treturn table[x][y];\n\t\telse\n\t\t\tthrow new IndexOutOfBoundsException(\"Table x and y values are integers from 0 to 8\");\n\t}", "public final int getUByte(int index) { return bb.get(index) & 0xff; }", "public int getBit(int columnIndex) {\n BitVector vector = (BitVector) table.getVector(columnIndex);\n return vector.get(rowNumber);\n }", "private static int getDigit(final int input, final int n) {\n if (n <= 0) {\n return N_TOO_LOW;\n }\n if (input < Math.pow(10, n - 1)) {\n return DIGIT_NOT_FOUND;\n }\n return (int) Math.floor((input % (int) Math.pow(10, n)) / Math.pow(10, n - 1));\n }", "public Byte getByte(final int index) {\n Object returnable = this.get(index);\n if (returnable == null) {\n return null;\n }\n if (returnable instanceof String) {\n /* A String can be used to construct a BigDecimal. */\n returnable = new BigDecimal((String) returnable);\n }\n return ((Number) returnable).byteValue();\n }", "public static int getBit(byte b,int position)\n\t{\n\t return ((b >> position) & 1);\n\t}", "PACKET getIndex(int index);", "public static byte getMybit(byte val, int pos){\n return (byte) ((val >> pos) & 1);\n }", "private byte getIndex(int n) {\r\n\t\tint originalN = n;\r\n\t\tif (n < Constants.DIMENSION - 1) {\r\n\t\t\tdo {\r\n\t\t\t\tn = Constants.getRandom().nextInt(Constants.DIMENSION);\r\n\t\t\t//} while (n > Constants.FIELD_DIMENSION - 1);\r\n\t\t\t//} while ((n < originalN) || (n > Constants.FIELD_DIMENSION - 1));\r\n\t\t\t} while ((n == originalN) || (n > Constants.DIMENSION - 1));\r\n\t\t}\r\n\t\treturn (byte) n;\r\n\t}", "private int positiveBinToInt(String binary) {\n int w = 0;\n for (int i = binary.length() - 1, j = 0; i > 0; i--, j++) {\n w += (int) Math.pow(2, j) * bitToInt(binary.charAt(i));\n }\n return w;\n }", "public int binaryToInt(String binary){\n return Integer.parseInt(binary, 2);\n }", "@Override\n\tpublic int ConvertDigit(byte[][] data, int digitPosition) {\n\t\tint hash = hashDigit(data,digitPosition);\n\t\treturn numbers.getOrDefault(hash,NA);\n\t}", "private int bitToInt(char bit) {\n return bit == '0' ? 0 : 1;\n }", "java.lang.String getNumb();", "private int right(int index) {\r\n\t\treturn 2 * index + 2;\r\n\t}", "short digits();", "public int decToBin(int input) {\r\n\t String Binary = Integer.toBinaryString(input);\t\r\n\t\treturn Integer.valueOf(Binary);\t\t\r\n\t}", "public int getValue(BitChromosome bitChromosome, int index) {\n return (int)((bitChromosome.genes >> (shift * index)) & mask);\n }", "public int getIndexGegenueber(int index) {\n\t\tindex -= 13;\n\t\tif(index < 0)\n\t\t\tindex*= (-1);\n\t\treturn index;\n\t}", "private int getBit(int value, int k) {\r\n\t\treturn (value >> k) & 1;\r\n\t}", "public int getNumero(int index){\n\t\treturn numeros.get(index);\n\t}", "public int get(int index);", "public final long getUInt(int index) {\r\n return bb.getInt(index) & 0xffff_ffffL;\r\n }", "protected byte _getByte(int index)\r\n/* 323: */ {\r\n/* 324:337 */ return HeapByteBufUtil.getByte(this.array, index);\r\n/* 325: */ }", "public static int getValueAt(char[] parleValues, char index) {\t\n\t\treturn parleValues[binarySearchLeft(parleValues, index)+2];\n\t}", "public int getNumero(int index){\r\n\t\treturn numeros.get(index);\r\n\t}", "private int negativeBinaryToInt(String binary) {\n int n = binary.length() - 1;\n int w = -bitToInt(binary.charAt(0)) * (int) Math.pow(2, n);\n for (int i = n, j = 0; i > 0; i--, j++) {\n w += (int) Math.pow(2, j) * (binary.charAt(i) == '1' ? 1 : 0);\n }\n return w;\n }", "public static int getDigit(int cnumber) {\n if (cnumber < 9)\n return cnumber;\n return cnumber / 10 + cnumber % 10;\n }", "public static BigInteger getNth(long n)\n {\n if (n == 0 || n == 1) { return BigInteger.valueOf(n); }\n else { return power(atom, n - 1)[0][0]; } \n }", "public int getE04(final int digitNumber);", "private int getIndex(int val){\n return val%bucket;\n }", "public int getBit(int pos) {\r\n\t\treturn flagBits[pos];\r\n\t\t\r\n\t}", "public byte getByte(int index)\r\n/* 317: */ {\r\n/* 318:331 */ ensureAccessible();\r\n/* 319:332 */ return _getByte(index);\r\n/* 320: */ }", "public int getInt(int index) throws ArrayIndexOutOfBoundsException\n\t{\n\t\treturn bytes[index] & 0xFF;\n\t}", "abstract public int getFromU16SingleLead(char c);", "private int getCharacterIndex(Character c, int index) {\r\n if (c instanceof CommonInfected) {\r\n return (index % cInfectedNum);\r\n\t\t}\r\n else if (c instanceof Tank) {\r\n return (index % tankNum);\r\n\t\t}\r\n else if (c instanceof Child) {\r\n return (index % childNum);\r\n\t\t}\r\n else if (c instanceof Teacher) {\r\n return (index % teacherNum);\r\n\t\t}\r\n else if (c instanceof Soldier) {\r\n return (index % soldierNum);\r\n\t\t}\r\n else {\r\n return -1;\r\n\t\t}\r\n }", "private int decode(int index) {\n return (encoded[index] - 32) & 0x3F;\n }", "public int getInstruction(int index){\n \tif (index % 4 != 0){ //check to see if the index is aligned\n\t\t\tSystem.out.println(\"Wrong number for PC\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\treturn memory[(index / 4)];\n }", "private int toInt(String binary){\n if (bitToInt(binary.charAt(0)) == 0){\n return positiveBinToInt(binary);\n }\n else{\n return negativeBinaryToInt(binary);\n }\n }", "public static String decToBin( int n ) {\n\tString x = \"\";\n\twhile(n != 0){\n\t x = n % 2 + x;\n\t n /= 2;\n\t}\n\treturn x;\n }", "static int beautifulBinaryString(String b) {\n int index = b.indexOf(\"010\", 0) ;\n int change = 0;\n while (index != -1) {\n change++;\n index = b.indexOf(\"010\", index + 3) ;\n }\n return change;\n }", "int next(int bits);", "private static int getBinaryCode(ArrayList<ArrayList<Integer>> tMat, int row){\r\n\t\tArrayList<Integer> currRow = tMat.get(row);\r\n\t\tString rowStr = currRow.toString().replaceAll(\"[^0-9]\", \"\");\r\n\t\treturn Integer.parseInt(rowStr, 2);\r\n\t}", "private boolean getBit(int index) {\n int blockIndex = index / 32;\n int bitIndex = index % 32;\n return (data[blockIndex] & (1 << bitIndex)) != 0;\n }", "public static double getHaltonNumberForGivenBase(long index, final int base) {\n\t\tindex += 1;\n\n\t\tdouble x = 0.0;\n\t\tdouble factor = 1.0 / base;\n\t\twhile(index > 0) {\n\t\t\tx += (index % base) * factor;\n\t\t\tfactor /= base;\n\t\t\tindex /= base;\n\t\t}\n\n\t\treturn x;\n\t}", "public int get(int index) {\n\t\treturn r[index];\n\t}", "public int ConvertToDecimalInt() {\n int result = 0;\n int cont = 0;\n for (int index = binaries.length - 1; index > 0; index--) {\n result = result + ((int) (Math.pow(base, cont)) * binaries[index]);\n cont++;\n }\n return result;\n }", "private int getIndex(int key) {\n\t\treturn key % MAX_LEN;\n\t}", "public int getIndex(byte[] value);", "public static int getTwosComplement(String binaryInt) {\r\n\t\t// Check if the number is negative.\r\n\t\t// We know it's negative if it starts with a 1\r\n\t\tif (binaryInt.charAt(0) == '1') {\r\n\t\t\t// Call our invert digits method\r\n\t\t\tString invertedInt = invertDigits(binaryInt);\r\n\t\t\t// Change this to decimal format.\r\n\t\t\tint decimalValue = Integer.parseInt(invertedInt, 2);\r\n\t\t\t// Add 1 to the current decimal and multiply it by -1\r\n\t\t\t// because we know it's a negative number\r\n\t\t\tdecimalValue = (decimalValue + 1) * -1;\r\n\t\t\t// return the final result\r\n\t\t\treturn decimalValue;\r\n\t\t} else {\r\n\t\t\t// Else we know it's a positive number, so just convert\r\n\t\t\t// the number to decimal base.\r\n\t\t\treturn Integer.parseInt(binaryInt, 2);\r\n\t\t}\r\n\t}", "private int binaryToDecimal(String revStr){\n String tempStr ;\n int tempInt;\n int result = 0;\n \n for(int i =0; i < revStr.length(); i++)\n {\n tempStr = String.valueOf(revStr.charAt(i));\n tempInt = Integer.parseInt(tempStr);\n \n //if the integer number is not 1 or 0, the number inputed by user is not a bianry number \n //so return -1;\n if(tempInt != 1 && tempInt != 0)\n {\n return -1;\n }\n \n //if the integer number is 0, skip this number\n if(tempInt == 0)\n {\n continue;\n }\n \n //if the integer number is 1 (tempInt = 1), calculate the power\n result = result + (int)(tempInt * Math.pow(2.0, (double)i));\n }\n \n return result;\n }", "private int getCol(int index) {\n return index & (chunkSize - 1);\n }", "protected boolean bitAt(final int bitIndex) {\n return _getBit(_bitMap,\n \t\t\t (Numbers.INTEGER_WIDTH*8-1)-bitIndex-1);\n }", "private static int getBit(int pack, int pos) {\n\t\treturn (pack & (1 << pos)) != 0 ? 1 : 0;\n\t}", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();" ]
[ "0.7533911", "0.69327104", "0.6853154", "0.677155", "0.6683413", "0.6650371", "0.6464953", "0.6434834", "0.64242893", "0.62522054", "0.6239789", "0.62332183", "0.61879903", "0.61556363", "0.6099339", "0.6093584", "0.6090924", "0.6088703", "0.60371405", "0.59840584", "0.59252816", "0.5897875", "0.58119845", "0.57885474", "0.5778452", "0.5751943", "0.5748829", "0.57099783", "0.5696149", "0.5691948", "0.56901366", "0.56654197", "0.5656613", "0.5654967", "0.5649382", "0.56438035", "0.56370556", "0.56261367", "0.56183237", "0.5607204", "0.5600302", "0.55961025", "0.55944294", "0.558872", "0.55473286", "0.553981", "0.5535896", "0.55297196", "0.5528653", "0.55260664", "0.5522099", "0.55198944", "0.5517002", "0.55074024", "0.54959804", "0.5493593", "0.54901326", "0.5482952", "0.54801965", "0.5477128", "0.546839", "0.54598767", "0.5458296", "0.54507095", "0.5444216", "0.54426414", "0.5440807", "0.5439812", "0.543419", "0.54266566", "0.54256755", "0.5420734", "0.5411607", "0.5407963", "0.5406617", "0.54040015", "0.54009664", "0.5397136", "0.5381342", "0.535668", "0.5349311", "0.5326164", "0.5325678", "0.53121394", "0.53098017", "0.53056365", "0.5304216", "0.530389", "0.53015673", "0.52952063", "0.5292098", "0.52917176", "0.5283717", "0.5279135", "0.52786595", "0.52786595", "0.52786595", "0.52786595", "0.52786595", "0.52786595" ]
0.6977136
1
determines if the binary number is in overflow
public boolean isInOverflow() { if (overflow == true){ return true; } else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean getOverflowFlag() {\n // PROGRAM 1: Student must complete this method\n // return value is a placeholder, student should replace with correct return\n if (Binary.binToSDec(inputA) > 0 && Binary.binToSDec(inputB) > 0) { //if the decimal rep of both inputs are positive,\n if (Binary.binToSDec(output) < 0) { // and the output is negative,\n overflowFlag = true; //overflow has occured\n }\n } else if (Binary.binToSDec(inputA) < 0 && Binary.binToSDec(inputB) < 0) { //if the decimal rep of both inputs are negative,\n if (Binary.binToSDec(output) > 0) { //and the output is positive\n overflowFlag = true; //overflow has occured\n }\n } else {\n overflowFlag = false; //otherwise, overflow has not occured.\n }\n return overflowFlag; //return the value of overflowFlag\n }", "abstract boolean isOverflow();", "boolean isOverflow() {\r\n\r\n if (values.size() > branchingFactor - 1) {\r\n return true;\r\n }\r\n return false;\r\n }", "private boolean isPowerOfTwo(int x) {\n return (x & (x - 1)) == 0;\n }", "static boolean overflowInParse(long current, int digit, int radix) {\n if (current >= 0) {\n if (current < maxValueDivs[radix]) {\n return false;\n }\n if (current > maxValueDivs[radix]) {\n return true;\n }\n // current == maxValueDivs[radix]\n return (digit > maxValueMods[radix]);\n }\n\n // current < 0: high bit is set\n return true;\n }", "private boolean isPowerOfTwo(int i){\n return (i & (i - 1)) == 0;\n }", "private boolean Overflow(int dvalue, int rvalue, int result)\n {\n return ((Utils.bit7(dvalue) && Utils.bit7(rvalue) && !Utils.bit7(result)) || (!Utils.bit7(dvalue) && !Utils.bit7(rvalue) && Utils.bit7(result)));\n }", "public boolean checkOverflow() {\n\t\tfor(int i = 0; i < hand.size(); i++) {\n\t\t\tif(hand.get(i).getValue() == 11) {\n\t\t\t\thand.get(i).makeSoft();\n\t\t\t\tSystem.out.println(\"The value of the \" + hand.get(i) +\" was changed to 1\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "private static void checkOverflow(short value1, short value2) {\n \tif ((value1 > 0 && value2 > 0) && (value1 + value2 < 0)) {\n \t\toverflowFlag = true;\n \t} else if ((value1 < 0 && value2 < 0) && (value1 + value2 > 0)) {\n \t\toverflowFlag = true;\n \t} else {\n \t\toverflowFlag = false;\n \t}\n }", "boolean multipleOf64(int num)\n {\n return (num & 0b111111) == 0;\n }", "static boolean isPowerOfTwo(int n) \n{\n\tif (n==0) return false;\n \treturn (n & (n-1)) == 0;\n}", "boolean multipleOf2(int num)\n {\n return (num & 0b1) != 1;\n }", "int canon_has_lowbits()\n{\n BytePtr test = new BytePtr(0x4000);\n int ret=1, i;\n\n CTOJ.fseek (ifp, 0, CTOJ.SEEK_SET);\n CTOJ.fread (test, 1, /*sizeof test*/0x4000, ifp);\n for (i=540; i < /*sizeof test*/0x4000 - 1; i++)\n if ( CTOJ.toUnsigned(test.at(i)) == 0xff) {\n if (test.at(i+1) != 0) return 1;\n ret=0;\n }\n return ret;\n}", "public abstract boolean testRightmostBit();", "boolean hasIntSize();", "private boolean checkInteger(byte buffer[], int sindex, int findex)\n {\n \t\t// 첫 글자를 체크한다. (+, -가 올수 있다.)\n \t\tbyte b = buffer[sindex];\n \t\tif ((b < 48) || (b > 57)) {\n \t\t\tif (b != 45)\n \t\t\t\tif (b != 43) return false;\n \t\t}\n \t\tfor (int i=sindex+1; i<findex; i++) {\n \tif ((buffer[i] < 48) || (buffer[i] > 57)) return false;\n \t\t}// end of for\n \t\treturn true;\n \t}", "public static void main(String[] args) {\n\t\t\n\t\tbyte a = 20;\n\t\tint b = a >> 8;\n\n\t\tSystem.out.println(b == 0);\n\t\t\n\t\tlong c = 131060;\n\n\t\tSystem.out.println(c >= 1 << 17);\n\t\t\n\n\t}", "public boolean isUnderflow() {\n\t\treturn (dataSize() < Math.ceil(degree / 2.0) - 1);\n\t}", "boolean isOverflow() {\r\n\r\n if (children.size() > branchingFactor) {\r\n return true;\r\n }\r\n return false;\r\n }", "boolean hasInt();", "public static final boolean isPowerOfTwo(final int value) {\r\n return BitHacks.IsPowerOfTwo(value);\r\n }", "public boolean isPowerOfTwo(int n) {\n return n > 0 && ((n & (-n)) == n);\n }", "private boolean checkInt(String str) {\n\t\ttry {\n\t\t\tint integer = Integer.parseInt(str);\n\t\t\tif(integer>=0&&integer<100000){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean testMonobit(byte[] data) \r\n {\r\n if( data.length != 2500 )\r\n throw new IllegalArgumentException(\"2500 bytes expected\");\r\n \r\n int total = 0;\r\n for(int i=0; i<2500; i++) {\r\n int hi = ONE_COUNT[ (data[i]>>4) & 0xF ];\r\n int lo = ONE_COUNT[ (data[i] ) & 0xF ];\r\n total += hi + lo;\r\n }\r\n \r\n return (9654 < total) && (total < 10346);\r\n }", "@Test\n public void testCheckIsPowerOfTwoNormal_1() {\n assertTrue(checkerNumber.checkIsPowerOfTwo(1024));\n }", "private boolean isPowerOfTwo(int num) {\n if (num == 0) {\n return false;\n }\n \n // check using modulus\n else {\n while (num != 1) {\n if (num % 2 != 0) {\n return false;\n }\n num /= 2;\n }\n return true;\n }\n }", "public boolean hasOverflow() {\r\n\t\t\treturn (data.size() > 3);\r\n\t\t}", "private boolean inBitRange(int k) {\n try {\n if (k < 0 || k >= this.numberOfBits())\n throw new Exception(\"Data: bit index is out of range (0<=\" + k + \"<\" + this.numberOfBits() + \")\");\n } catch (Exception e) {\n e.printStackTrace();\n System.exit(1);\n }\n return true;\n }", "private boolean isPackable(int val) {\r\n\t\tint lead = Integer.numberOfLeadingZeros(val);\r\n\t\tlead -= lead % 2;\t// make even, immediate operands can be shifted by an even number only\r\n\t\treturn lead + Integer.numberOfTrailingZeros(val) >= 24;\t\t\r\n\t}", "static int check(int x, int a, int b) \n\t{ \n\t\t// sum of digits is 0 \n\t\tif (x == 0) \n\t\t{ \n\t\t\treturn 0; \n\t\t} \n\n\t\twhile (x > 0) \n\t\t{ \n\n\t\t\t// if any of digits in sum is \n\t\t\t// other than a and b \n\t\t\tif (x % 10 != a & x % 10 != b) \n\t\t\t{ \n\t\t\t\treturn 0; \n\t\t\t} \n\n\t\t\tx /= 10; \n\t\t} \n\n\t\treturn 1; \n\t}", "boolean isBinary();", "static boolean boolFrBit(int input){\n return input!=0;\n }", "public static boolean isPowerOfTwo(int n) {\n\t\t if (n < 1) return false;\n\t\t return (n & (n - 1)) == 0;\n\t\t }", "public boolean isPowerOfTwo(int n) {\n\t\tint count1 = 0;\n\t\tfor (; n > 0;) {\n\t\t\tint tmp = n & 1;\n\t\t\tcount1 += tmp;\n\t\t\tn = n >> 1;\n\t\t}\n\t\tboolean is = (count1 == 1);\n\t\treturn is;\n\t}", "private static boolean verify(int value, int size) {\r\n return size > 0 && size < Integer.SIZE\r\n && Integer.SIZE - Integer.numberOfLeadingZeros(value) <= size;\r\n }", "public static boolean isPowerOfTwo(int n) {\n\t\treturn (n > 0) && (n & (n - 1)) == 0;\n\t}", "public boolean isPowerOfTwo(int n) {\n\t\tif(n <= 0) return false;\n\t\tfor(int max = 1<<30,i = 1; 1 <= max ; i<<=1 ){\n\t\t\tif((n & i) != 0){\n\t\t\t\tif(n == i) return true;\n\t\t\t\telse return false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static int negative(int b) {\n return (b >> 8) & 1;\n }", "boolean hasNumb();", "private static boolean isValue(long x) {\n return x >= 0L; // 1\n }", "private boolean method_263(int var1) {\n return (this.method_244() & 1L << var1) != 0L;\n }", "private boolean checkValue(){\n\t\tfor (int i = 0; i <binary.length();i++){\n\t\t\tif(Character.getNumericValue(binary.charAt(i))>'1' || binary.length()>32 || binary.length()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t%4 != 0){\n\t\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t\t\tpw.println(\"Invalid Input\");\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\t\t\n\t}", "public static boolean isPowerOfTwo(Expression expr) {\n\t\tint n;\n\t\ttry {\n\t\t\tn = new ExpressionEvaluator().evaluateAsInteger(expr);\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn isPowerOfTwo(n);\n\t}", "@Test(expected = IOException.class)\n\tpublic void testUint32Overflow() throws IOException {\n\t\tBinaryReader br = br(true, 0xff, 0xff, 0xff, 0xff, 0xff);\n\t\tint value = br.readNextUnsignedIntExact();\n\t\tAssert.fail(\n\t\t\t\"Should not be able to read a value that is larger than what can fit in java 32 bit int: \" +\n\t\t\t\tInteger.toUnsignedString(value));\n\t}", "private int negativeBinaryToInt(String binary) {\n int n = binary.length() - 1;\n int w = -bitToInt(binary.charAt(0)) * (int) Math.pow(2, n);\n for (int i = n, j = 0; i > 0; i--, j++) {\n w += (int) Math.pow(2, j) * (binary.charAt(i) == '1' ? 1 : 0);\n }\n return w;\n }", "int getHighBitLength();", "boolean hasIntValue();", "protected final void operationBIT(final int data) {\r\n this.signFlag = data >= 0x80;\r\n this.overflowFlag = (data & 0x40) > 0;\r\n this.zeroFlag = (this.ac & data) == 0;\r\n }", "public boolean isPowerTwo(int A){\n\t\treturn ((A&(A-1)) == 0) ? true : false;\n\t}", "public boolean mo38107b(int i) {\n return i != 0 && (i & 1) == 0;\n }", "public static void checkErrorCode(byte[] buffer)throws TopicException{\n byte curr = buffer[1];\n StringBuilder string = new StringBuilder();\n for(int i = 7; i > -1; i--){\n string.append(getMybit(curr, i));\n }\n\n int val = Integer.parseInt(String.valueOf(string), Constants.TWO);\n if(0 != val){\n throw new TopicException(ErrorCode.UNEXPECTEDERRORCODE);\n }\n }", "static boolean checkNumber(int number) {\r\n\t\t\r\n\t\tint lastDigit= number%10;\r\n\t\tnumber/=10;\r\n\t\tboolean flag= false;\r\n\t\t\r\n\t\twhile(number>0) {\r\n\t\t\tif(lastDigit<=number%10) {\r\n\t\t\t\tflag=true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tlastDigit= number%10;\r\n\t\t\tnumber/=10;\r\n\t\t\t\t\r\n\t\t}\r\n\t\tif(flag) \r\n\t\t\treturn false;\r\n\t\telse {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "private final boolean m28065d(Number number) {\n return (number instanceof Integer) || (number instanceof Short) || (number instanceof Byte);\n }", "public boolean illegalMove(int bin)\n {\n \treturn (state[bin] == 0 || bin < 0 || bin == 6 || bin > 12);\n }", "private int positiveBinToInt(String binary) {\n int w = 0;\n for (int i = binary.length() - 1, j = 0; i > 0; i--, j++) {\n w += (int) Math.pow(2, j) * bitToInt(binary.charAt(i));\n }\n return w;\n }", "private int getLowTenBitNumber(int num) {\n return num & 1023;\n }", "public boolean isPowerOfTwo2(int n) {\n return n>0 && Integer.bitCount(n) == 1;\n }", "@Test(timeout = 4000)\n public void test075() throws Throwable {\n int int0 = JavaCharStream.hexval('b');\n assertEquals(11, int0);\n }", "public long getLeastSignificantBits() { throw new RuntimeException(\"Stub!\"); }", "int getLowBitLength();", "private final boolean m28064c(Number number) {\n return (number instanceof Short) || (number instanceof Byte);\n }", "static int ones()\n {\n char[] binArray = binary.toCharArray();\n int count = 0;\n int max = 0; \n for(int i = 0; i < binary.length(); i++)\n {\n if(binArray[i] == '0'){\n count = 0;\n }else {\n count++;\n max = Math.max(max, count);\n }\n }\n return max;\n }", "private boolean outOfBounds(long n) {\n return n < 0 || n >= getSize();\n }", "public boolean isPowerOfThree(int n) {\n return ( n>0 && 1162261467%n==0);\n\n }", "public boolean isPowerOfTwo2(int n) {\n\t\tboolean is = false;\n\t\tif (n > 0) {\n\t\t\tis = ((n - 1) & n) == 0;\n\t\t}\n\t\treturn is;\n\t}", "public boolean isPowerOfThree(int n) {\n return (n > 0 && 1162261467 % n == 0);\n }", "static boolean bigint_gt(bigint a, bigint b)\n {\n if (a.bigint_sign && !b.bigint_sign)\n return true;\n else if (!a.bigint_sign && b.bigint_sign)\n return false;\n else\n {\n if (a.bigint_len > b.bigint_len)\n return a.bigint_sign;\n else if (a.bigint_len < b.bigint_len)\n return !a.bigint_sign;\n else\n for (int i = 0; i < a.bigint_len; i++)\n {\n int j = a.bigint_len - 1 - i;\n if (a.bigint_chiffres[j] > b.bigint_chiffres[j])\n return a.bigint_sign;\n else if (a.bigint_chiffres[j] < b.bigint_chiffres[j])\n return !a.bigint_sign;\n }\n return true;\n }\n }", "private static int batoi(byte[] inp) {\n int len = inp.length>4?4:inp.length;\n int total = 0;\n for (int i = 0; i < len; i++) {\n total += (inp[i]<0?256+inp[i]:(int)inp[i]) << (((len - 1) - i) * 8);\n }\n return total;\n }", "private boolean m10268c(byte b) {\r\n int i = b & 15;\r\n if (i == 1 || i == 2) {\r\n return true;\r\n }\r\n return false;\r\n }", "private int byteRangeCheck(int i){\r\n if (i < 0){\r\n return -1;\r\n } else if (i > 255){\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n }", "@Ignore\n @Test\n public void testgetMostSignificantSevenBits() {\n final int v = MidiReceiver.getMsbOf14ValidBits(0b11111111);\n assertEquals(0b1, v);\n }", "public static boolean isInt(Object value) {\n\t\treturn value instanceof BigInteger;\n\t}", "@Test\n public void calculationOfNoRedundantBitsIsCorrect() {\n final int length = 10;\n final int expectedNoRedundantBits = 5;\n\n // When performing calculation of noRedundantBits\n final int noRedundantBits = HammingAlgorithm.calculateNoRedundantBits(length);\n\n // Then check if noRedundantBits is as expected\n assertThat(noRedundantBits).isEqualTo(expectedNoRedundantBits);\n }", "public final boolean ec_dec_bit_logp(final int _logp) {\r\n\t\tfinal long r = this.rng;\r\n\t\tfinal long d = this.val;\r\n\t\tfinal long s = r >>> _logp;\r\n\t\tfinal boolean ret = d < s;\r\n\t\tif( ! ret ) {\r\n\t\t\tthis.val = d - s;\r\n\t\t}\r\n\t\tthis.rng = ret ? s : r - s;\r\n\t\tec_dec_normalize();\r\n\t\treturn ret;\r\n\t}", "public boolean isOverflow() {\n\t\treturn (children.size() >= degree + 1) || (data.size() >= degree);\n\t}", "public synchronized void overflow() {\n overflowCountStat.received();\n overflowCount++;\n }", "public boolean isPowerOfThree(int n){\n\t\treturn (n > 0) && (1162261467 % n == 0);\n\t}", "public static boolean isPerfectSquareUpTo64(int number) {\n\t\tswitch (number) {\n\t\tcase 0:\n\t\tcase 1:\n\t\tcase 4:\n\t\tcase 9:\n\t\tcase 16:\n\t\tcase 25:\n\t\tcase 36:\n\t\tcase 49:\n\t\tcase 64:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasNum();", "boolean hasNum();", "boolean hasNum();", "boolean isLittleEndian();", "@Test\n public void test2(){\n\n String s =\"1000000000000001\";\n //s = BinaryCalculate.BinaryArithmeticalRightShift(s,1);\n s = BinaryCalculate.BinaryLogicRightShift(s,1);\n int a = BitConversion.fromBinaryStringToInt(s);\n System.out.println(a);\n }", "static boolean isPowerOfTwo(int testNum)\r\n\t{\r\n\t\t//set ret to false\r\n\t\tboolean ret = false;\r\n\t\tfor (int i = 9; i < 15 || ret==false; i++)\r\n\t\t{\r\n\t\t\t//if 2 to the i power is equal to testNum (systemPage)\r\n\t\t\tif (Math.pow(2, i) == testNum)\r\n\t\t\t{\r\n\t\t\t\t//set ret to true\r\n\t\t\t\tret = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public static final boolean even(short x) {\n \t\treturn ((x & 0x1) == 0);\n \t}", "public boolean isArmstrongNumber(int input) {\n\t\tint size = Integer.toString(input).length();\n\t\tint sum = 0;\n\t\tList<Integer> numList = new ArrayList<Integer>();\n\t\tString num_string = Integer.toString(input);\n\t\tfor(int i =0; i < num_string.length(); i++) {\n\t\t\tchar num_char = num_string.charAt(i);\n\t\t\tint chartonum = num_char - '0';\n\t\t\tnumList.add(chartonum);\n\t\t}\n\t\tfor(Integer i : numList) {\n\t\t\t//System.out.println(i);\n\t\t\tsum += (int)(Math.pow(i, size));\n\t\t}\n\t\t//System.out.println(sum);\n\t\tif(sum == input) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean checkLen(int epcbytes)\n {\n return true;\n }", "int bv(byte b) {\n\t\tint out = b;\n\t\tif (b < 0)\n\t\t\tout = out + 256;\n\t\treturn out;\n\t}", "boolean hasPower();", "public static boolean ipot(long n) {\n\t\treturn n+(n-1) == (n^(n-1));\n\t}", "boolean hasByteCode();", "public int errorChecker()\n\t{\n\t\tboolean error = false;\n\t\tint checker=0; //variable to determine how many 1's in the number\n\t\tint row;\n\t\t\n\t\t//loops through the array identifying parity coverage\n\t\tfor (row=0;row<PARITYCOVERAGE.length; row++)\n\t\t{\n\t\t\t\n\t\t\t//calls the method to count the number of parity bits\n\t\t\tchecker = counter(row, true); \n\t\n\t\t\tint compare = 0; //the default value (odd parity)\n\t\t\t\n\t\t\t//checks whether it is even or odd parity\n\t\t\tif (parityType.contentEquals(\"e\"))\n\t\t\t{\n\t\t\t\t//value for even parity\n\t\t\t\tcompare=1;\n\t\t\t}\n\n\t\t\t//checks to see if the result is even or odd\n\t\t\tif (checker%2 ==compare) \n\t\t\t{\n\t\t\t\terror=true;\n\t\t\t\t\n\t\t\t\t//sets parity bit to 1, if parity is even/odd\n\t\t\t\terrorCode[row]=true;\n\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t//otherwise the bit is 0\n\t\t\t\terrorCode[row]=false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if an error has been detected\n\t\tif (error)\n\t\t{\n\t\t\t\n\t\t\t//passes the binary code to the covertor\n\t\t\t//and returns the location of the error\n\t\t\treturn (binaryNumber.decimalConverter(errorCode)-1);\n\t\t\t\t\n\t\t}\n\t\t\n\t\t//if there is no error, returns a negative value\n\t\treturn -1;\n\t\t\t\t\t\n\t}", "private static boolean isTag(long x) {\n return x < 0L; // 1\n }", "public boolean m21281OooO00o(int i) {\n if (i < 0) {\n throw new RuntimeException();\n } else if (i > this.f22758OooO00o - 1) {\n return false;\n } else {\n return (OooO0O0[i & 31] & this.f22759OooO00o[i >>> 5]) != 0;\n }\n }", "public static int zzb(byte b) {\n return b & UByte.MAX_VALUE;\n }", "@Override\n\t\t\tpublic boolean test(Integer t) {\n\t\t\t\treturn false;\n\t\t\t}", "public static boolean binaryNum(int n)\n {\n if(n<10) //stop condition - the end case, if only a single number is left\n return n==1||n==0;\n return (n%10==0||n%10==1)&&binaryNum(n/10); // check if the last digit is 0 or 1 and re-call the method without it(and return the result at the end)\n }", "private void checkResetOverflow(int register) {\r\n\t\t/* register values greater than 1024*/\r\n\t\tif(sim40.memory[register] >= 1024) \r\n\t\t\tsetRegToMax(register);\r\n\t}", "public boolean hasUnderflow() {\r\n\t\t\treturn (data.size() <= 0);\r\n\t\t}", "public static int check() {\r\n\t\tint num = 0;\r\n\t\tboolean check = true;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0) {\r\n\t\t\t\t\tnum = Math.abs(num);\r\n\t\t\t\t}\r\n\t\t\t\tcheck = false;\r\n\t\t\t}\r\n\t\t\tcatch (Exception e) {\t\t\t\t\t\t// hvatanje greske i ispis da je unos pogresan\r\n\t\t\t\tSystem.out.println(\"You know it's wrong input, try again mate:\");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t} while (check);\r\n\t\treturn num;\r\n\t}" ]
[ "0.673054", "0.64575624", "0.64514256", "0.6420932", "0.6082429", "0.6030495", "0.59460115", "0.59353113", "0.5891744", "0.5816277", "0.5814667", "0.57838327", "0.57222956", "0.5694073", "0.5678354", "0.56381565", "0.5636765", "0.5621953", "0.5612877", "0.5582616", "0.5562844", "0.55474836", "0.55473155", "0.5546663", "0.5541378", "0.5538358", "0.55118024", "0.5506243", "0.5505247", "0.5459609", "0.54536676", "0.5450775", "0.54284304", "0.5393998", "0.5391725", "0.53843474", "0.5360871", "0.534386", "0.5339544", "0.53333175", "0.5331738", "0.53265226", "0.5324408", "0.52978003", "0.5296985", "0.52918905", "0.52887607", "0.52730656", "0.52716863", "0.5271183", "0.5267429", "0.52580774", "0.5256511", "0.52514404", "0.5239412", "0.5238956", "0.523394", "0.5220616", "0.52110106", "0.52008593", "0.5192829", "0.51909935", "0.51881206", "0.51866525", "0.51813495", "0.51794076", "0.51499516", "0.5141935", "0.5133613", "0.5130518", "0.51304233", "0.5123317", "0.5119572", "0.51140255", "0.5109709", "0.51059806", "0.50916535", "0.5089262", "0.5078459", "0.5078459", "0.5078459", "0.50769204", "0.50759214", "0.5073598", "0.5069681", "0.5062609", "0.50560427", "0.5049193", "0.50459695", "0.50409603", "0.50407785", "0.50392383", "0.5035541", "0.5030373", "0.5028818", "0.5027196", "0.500904", "0.50067055", "0.50043863", "0.5002958" ]
0.62217087
4
transforms a binary number to its decimal form
public int toDecimal() { double bidecimal = 0; for(int i = 0; i < data.length; i++){ bidecimal = bidecimal+(data[i]*Math.pow(2, i)); } return (int) bidecimal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int convertBinaryToDecimal(int binaryValueOfBitMap){\r\n\t\r\n\tint decimalValue = 0;\r\n\ttry {\r\n\t\t int num = binaryValueOfBitMap; \r\n\t\t int dec_value = 0; \t\t \r\n\t\t // Initializing base \r\n\t\t // value to 1, i.e 2^0 \r\n\t\t int base = 1; \r\n\t\t \r\n\t\t int temp = num; \r\n\t\t while (temp > 0) \r\n\t\t { \r\n\t\t int last_digit = temp % 10; \r\n\t\t temp = temp / 10; \r\n\t\t \r\n\t\t dec_value += last_digit * base; \r\n\t\t \r\n\t\t base = base * 2; \r\n\t\t } \r\n\t\t decimalValue = dec_value;\r\n\t}\r\n\tcatch(Exception e) {\r\n\t\tSystem.out.println(\"Exception occurred \"+e);\r\n\r\n\t}\r\n\treturn decimalValue;\r\n\t\t\r\n}", "public static int binaryToDecimal(long number){\n int result = 0;\n int length = String.valueOf(number).length();\n for (int i = 0; i < length; i++) {\n //take the last number and multiply it by 2^(0,1,2,3,4,5)\n result+=(number%10)*Math.pow(2,i);\n //just make it less by one point dividing by 10\n number/=10;\n }\n return result;\n }", "private void toDec(){\n\t\tlong temp = Long.parseLong(binary.substring(binary.length()/2, binary.length()));\n\t\tlong tempbin = 0;\n\t\tint j = 0;//splits the string in half with 2 for loops \n\t\tfor (int i = 0; i < binary.length()/2;i++){//second half of string\n\t\t\ttempbin+=((long)(Math.pow(2,j))*(temp%10));//convert binary to dec adding as it runs\n\t\t\ttemp/=10;\n\t\t\tj++;\n\t\t}\n\t\ttemp = Long.parseLong(binary.substring(0, binary.length()/2));//first half of string\n\t\tfor (int i = 0; i <= binary.length()/2;i++){\n\t\t\ttempbin+=((long)(Math.pow(2,j))*(temp%10));\n\t\t\ttemp/=10;\n\t\t\tj++;\n\t\t}\n\t\tbinary = Long.toString(tempbin);\n\t}", "public static long binaryToDecimal(long binaryNumber) {\n long d = binaryNumber;\n int c;\n for (c = 0; d != 0; c++) {\n d /= 10;\n }\n long e = binaryNumber;\n long N[];\n N = new long[c];\n for (int i = 0; i < c; i++) {\n N[i] = e % 10;\n e /= 10;\n }\n boolean w = true;\n for (int i = 0; i < N.length; i++) {\n if (N[i] != 1 && N[i] != 0) {\n w = false;\n }\n }\n int b = 0;\n if (w) {\n for (int i = 0; i < N.length; i++) {\n b = (int) (b + (N[i] * Math.pow(2, i)));\n }\n //System.out.print(binaryNumber+\" = \"+b+\"\\n\");\n return b;\n } else {\n return -1;\n }\n //System.out.print(\"The number is not binary \\n\");\n }", "public int ConvertToDecimalInt() {\n int result = 0;\n int cont = 0;\n for (int index = binaries.length - 1; index > 0; index--) {\n result = result + ((int) (Math.pow(base, cont)) * binaries[index]);\n cont++;\n }\n return result;\n }", "public static String binaryToDec(String binary) {\n boolean isnegative = false;\n if (binary.startsWith(\"1\")) {\n isnegative = true;\n char[] c = binary.toCharArray();\n for (int i = 0; i < binary.length(); i++) {\n if (Character.getNumericValue(c[i]) == 0) {\n c[i] = '1';\n } else {\n c[i] = '0';\n }\n }\n\n boolean finded = false;\n for (int i = binary.length() - 1; i >= 0 && !finded; i--) {\n if (Character.getNumericValue(c[i]) == 0) {\n c[i] = '1';\n finded = true;\n } else {\n c[i] = '0';\n }\n }\n binary = String.valueOf(c);\n }\n String dec = \"\";\n if (binary.equals(\"10000000000000000000000000000000\")) {\n dec = Integer.toString(Integer.MIN_VALUE);\n isnegative = false;\n } else {\n dec = Integer.toString(Integer.parseInt(binary, 2));\n }\n\n if (isnegative) {\n dec = \"-\" + dec;\n }\n return dec;\n }", "public void binToDec(){\n\t\tthis.inputBin();\n\t\tif(checkValue()==true){\n\t\t\tthis.toDec();\n\t\t\tthis.outDec();\n\t\t}\n\t}", "private static int toDecimal(String binary) {\n\t\tint decimal = 0;\n\n\t\tfor(int i = binary.length()-1; i >= 0; i--) {\n\t\t\tif(i == 4) {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 1;}\n\t\t\t}\n\t\t\telse if(i == 3) {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 2;}\n\t\t\t}\n\t\t\telse if(i == 2) {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 4;}\n\t\t\t}\n\t\t\telse if(i == 1) {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 8;}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(binary.charAt(i) == '1') {decimal += 16;}\n\t\t\t}\n\t\t}\n\n\t\treturn decimal;\n\t}", "public static int binaryToDecimal(int s){\n\t\tint multiplier= 1;\t\n\t\tint result=0;\n\t\twhile(s>0){\n\t\t\tint binaryDigit= s%10;\n\t\t\tresult= result+ binaryDigit*multiplier;\n\t\t\tmultiplier= multiplier*2; \n\t\t\ts= s/10;\n\t\t} \n\t\treturn result;\n\t}", "public static int anyBaseToDecimal(int n, int b){\n int val = 0;\n\n int p = 1;\n while(n > 0){\n int d = n % 10;\n n = n / 10;\n val += p * d;\n p = p * b;\n }\n\n return val;\n}", "private String decimalToBinary(int num) {\n String result = \"\";\n \n while(num > 0 ) \n {\n \n \n //get the remainder\n result = num % 2 + result;\n \n // Divide the positive decimal number by two( then divide the quotient by two)\n num = num /2;\n }\n \n return result;\n }", "public int binToDec (String input) {\r\n\t int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn decimal;\t\t\r\n\t}", "public static int binaryToDecimal(String text)\r\n {\n int sign = 1;\r\n if (text.charAt(0) == '-')\r\n {\r\n sign = -1;\r\n text = text.substring(1);\r\n }\r\n int result = 0;\r\n String digits = \"01\";\r\n for (int i = 0; i < text.length(); i++)\r\n {\r\n String c = text.substring(i, i+1);\r\n int digit = digits.indexOf(c);\r\n if (digit == -1)\r\n {\r\n System.out.printf(\"Error: invalid binary number %s, exiting...\\n\", text);\r\n System.exit(0);\r\n }\r\n int power = (int) (Math.pow(2, text.length() - i - 1));\r\n result = result + digit * power;\r\n }\r\n \r\n // if the first character of text was a minus, then negate the result.\r\n result = sign * result;\r\n return result;\r\n }", "public static int decimalToAnyBase(int n, int b){\n int val = 0;\n\n int p = 1;\n while(n > 0){\n int d = n % b;\n n = n / b;\n val += p * d;\n p = p * 10;\n }\n\n return val;\n}", "public int decToBin(int input) {\r\n\t String Binary = Integer.toBinaryString(input);\t\r\n\t\treturn Integer.valueOf(Binary);\t\t\r\n\t}", "private int binaryToDecimal(String revStr){\n String tempStr ;\n int tempInt;\n int result = 0;\n \n for(int i =0; i < revStr.length(); i++)\n {\n tempStr = String.valueOf(revStr.charAt(i));\n tempInt = Integer.parseInt(tempStr);\n \n //if the integer number is not 1 or 0, the number inputed by user is not a bianry number \n //so return -1;\n if(tempInt != 1 && tempInt != 0)\n {\n return -1;\n }\n \n //if the integer number is 0, skip this number\n if(tempInt == 0)\n {\n continue;\n }\n \n //if the integer number is 1 (tempInt = 1), calculate the power\n result = result + (int)(tempInt * Math.pow(2.0, (double)i));\n }\n \n return result;\n }", "public static int decimalToBinary(int s){\n\t\tString result=\"\";\n\t\tif (s<=0){\n\t\t\treturn 0;\n\t\t}\n\t\tfor (int i = 2; s> 0; s/=2){\n\t\t\tresult=result + s%2; \n\t\t}\n\t\tString p1= \"\";\n\t\tfor (int i=0; i<result.length(); i++){\n\t\t\tString l=result.substring(i, i+1);\n\t\t\tp1=p1+l;\n\t\t}\n\t\t\n\t\treturn lib.Change.StringToInt(p1, -1);\n\t\n\t}", "public static int binToDec(String bin) {\n\t\tint len = bin.length();\n\t\tif (len == 0)\n\t\t\treturn 0;\n\t\tString now = bin.substring(0, 1);\n\t\tString later = bin.substring(1);\n\t\treturn Integer.parseInt(now) * (int) Math.pow(2, len - 1) + binToDec(later);\n\t}", "public int binaryToDecimal(String binaryCode){\n int decimalNumber = 0;\n String sign = binaryCode.substring(0,1);\n binaryCode = binaryCode.substring(1);\n \n decimalNumber = Integer.parseInt(binaryCode, 2);\n \n if(sign.equals(\"1\")) decimalNumber = decimalNumber * -1;\n \n return decimalNumber;\n }", "public static String binConvertInt(long num) {\n\t\tString binString = \"\";\n\n\t\t// ORIGINAL CODE FOR INT BINCONVERT\n\n\t\tlong binary = 0;\n\t\tint count = 0;\n\n\t\tif (num >= 0) {\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t}\n\n\t\telse {\n\n\t\t\tnum = -1 * num;\n\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t\t// flip the binary to negative conversion\n\n\t\t\tchar ch[] = binString.toCharArray();\n\t\t\tboolean addedOne = false;\n\n\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\tif (ch[i] == '0') {\n\t\t\t\t\tch[i] = '1';\n\t\t\t\t} else {\n\t\t\t\t\tch[i] = '0';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (ch[binString.length() - 1] == '0') {\n\n\t\t\t\tch[binString.length() - 1] = '1';\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tch[binString.length() - 1] = '0';\n\t\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\t\tif(ch[i] == '1') {\n\t\t\t\t\t\tch[i] = '0';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tch[i] = '1';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\tbinString = new String(ch);\n\t\t}\n\n\t\t\n\t\treturn binString;\n\t}", "public int Binary_to_dec(int[] Bin) {//binary transfer to dec\r\n\t\t\tint decAd=0;\r\n\t\t\tfor(int i=0;i<Bin.length;i++) {\r\n\t\t\t\tint exp = (int) Math.pow(2,(Bin.length-1-i));\r\n\t\t\t\tdecAd += Bin[i] * (exp);\r\n\t\t\t}\r\n\t\t\treturn decAd;\r\n\t\t}", "public static void main(String[] args) {\n System.out.println(-14>>>1);\n String bin = \"01111111111111111111111111111001\";\n double res = binToDec(bin);\n System.out.println(res);\n }", "public static int toDecimal(int n, int b){\n\t\tint multiply = 1;\n\t\tint res = 0;\n\t\twhile(n > 0){\n\t\t\tres += n%10 * multiply;\n\t\t\tn /= 10;\n\t\t\tmultiply *= b;\n\t\t}\n\t\treturn res;\n\t}", "public int toDecimal() {\n\t\tdouble len = data.length - 1;\n\t\tdouble dec = 0;\n\t\tfor(int i = 0; i < data.length;i++) {\n\t\t\tif(data[i] == 1) {\n\t\t\t\tdec = dec + Math.pow(2.0, len);\n\t\t\t}\n\t\t\tlen--;\n\t\t}\n\t\treturn (int) dec;\n\t}", "public static int BinaryToNumber(String numberInput) {\r\n\r\n\t\t//Varibales are given values.\r\n\t\tdouble temp = 0, binary_number = 0;\r\n\t\tint j = numberInput.length();\r\n\t\tint i = 0;\r\n\t\t\r\n\t\t//Every Char is cycled through\r\n\t\twhile (i < numberInput.length()) {\r\n\t\t\tint z = Character.digit(numberInput.charAt(i), 10);\r\n\r\n\t\t\t//If there is a 1 it is translated into a base 10 value\r\n\t\t\tif (z == 1) {\r\n\t\t\t\ttemp = Math.pow(2, j - 1.0);\r\n\t\t\t\tbinary_number += temp;\r\n\t\t\t}\r\n\r\n\t\t\ti++;\r\n\t\t\tj--;\r\n\t\t}\r\n\t\t//the final base 10 value is passed into x and returned. \r\n\t\tint x = (int) binary_number;\r\n\t\treturn x;\r\n\t}", "static void BtoD(int []arr) {\n\t\tint sum=0;\n\t\tfor(int i=0;i<4;i++) {\n\t\t\tsum=(int)(sum+arr[i]*(Math.pow(2,4-i-1)));\n\t\t}\n\t\tSystem.out.println(\"Binary to decimal conversion \"+sum);\n\t}", "public static String decimalToBinary(int number)\r\n {\n String start = \"\";\r\n if (number < 0)\r\n {\r\n start = \"-\";\r\n number = -number;\r\n }\r\n \r\n String result = \"\";\r\n while(true)\r\n {\r\n int remainder = number % 2;\r\n String digit = Integer.toString(remainder);\r\n result = digit + result;\r\n number = number / 2;\r\n if (number == 0)\r\n {\r\n break;\r\n }\r\n }\r\n \r\n // if number is negative, put a minus sign in front of the result.\r\n result = start + result;\r\n return result;\r\n }", "static void DtoB(int num,int[] rem) {\n\t\tint j=0,m;\n\t\twhile(num>0) {\n\t\t\tm=num%2;\n\t\t\trem[j++]=m;\n\t\t\tnum=num/2;\n\t\t}\n\t\tj--;\n\t\tSystem.out.println(\"Decimal to Binary Conversion \");\n\t\tfor(int i=j;i>=0;i--) {\n\t\t\tSystem.out.print(rem[i]+\" \");\n\t\t}\n\t}", "public static void toBinary (int number) {\r\n String binary = \"\";\r\n \r\n if (number > 0) {\r\n toBinary(number / 2); \r\n System.out.print(number % 2 + binary);\r\n }\r\n }", "public static int bin2dec(String bri) {\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "public static int stringBinaryToDecimal(String s) {\n int sum = 0;\n for (int i = s.length(); i > 0; i--) {\n int num = new Integer(s.substring(i-1,i)).intValue();\n sum += num*Math.pow(2, s.length()-i);\n }\n return sum;\n }", "private static int decimalToBase(int base, int num) {\n\t\tint pow = 1, rem = 0, i, res = 0;\n\t\tfor (i = num; i > 0; i = i /base) {\n\t\t\trem = i % base;\n\t\t\tres = res + pow*rem;\n\t\t\tpow = pow * 10;\n\t\t}\n\t\treturn res;\n\t}", "public static String decToBin( int n ) {\n\tString x = \"\";\n\twhile(n != 0){\n\t x = n % 2 + x;\n\t n /= 2;\n\t}\n\treturn x;\n }", "public static String num2Bin(int a) {\n StringBuilder sb = new StringBuilder();\n for (int bitPow2 = 1, i = 0; i < Integer.SIZE; bitPow2 <<= 1,\n ++i) {\n if ((a & bitPow2) == bitPow2) {\n sb.append(\"1\");\n } else {\n sb.append(\"0\");\n }\n }\n return sb.reverse().toString();\n }", "public static String toBinary(int number)\n\t{\n\t\tString total = \"\";\n\t\tint a;\n\t\twhile (number > 0) {\n\n\t\t\ta = number % 2;\n\n\t\t\ttotal = total + \"\" + a;\n// divide number by 2 \n\t\t\tnumber = number / 2;\n\n\t\t\t}\n\n// return value \n\t\treturn (new StringBuilder(total)).reverse().toString();\n\t\t\n\t}", "private int positiveBinToInt(String binary) {\n int w = 0;\n for (int i = binary.length() - 1, j = 0; i > 0; i--, j++) {\n w += (int) Math.pow(2, j) * bitToInt(binary.charAt(i));\n }\n return w;\n }", "private int toInt(String binary){\n if (bitToInt(binary.charAt(0)) == 0){\n return positiveBinToInt(binary);\n }\n else{\n return negativeBinaryToInt(binary);\n }\n }", "private StringBuilder binConversion(StringBuilder input) {\n\t\tStringBuilder finalres = new StringBuilder();\n\t\tString currentVal = \"\";\n\t\tchar tempVal = ' ';\n\t\t\n\t\tfor(int i = 0; i < input.length(); i++)\n\t\t{\n\t\t\t\n\t\t\ttempVal = input.charAt(i);\n\t\t\t\n\t\t\tif(isOperator(input.charAt(i)) == false)\n\t\t\t{\n\t\t\t\tcurrentVal = currentVal + Character.toString(tempVal);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\t\t\n\t\t\t\tfinalres.append(val + Character.toString(tempVal));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// converting the last currentVal\n\t\t\n\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\n\t\tfinalres.append(val);\n\t\t\n\t\treturn finalres;\n\t}", "public String decimalToBinario(int numero) {\n\t\tSystem.out.print(\"Convirtiendo decimal (\" + numero + \") a binario >> \");\n\t\treturn Integer.toBinaryString(numero);\n\t}", "public static String toDecimal2(int n, int b){\n\t\tString chars = \"0123456789ABCDEFGHIJ\";\n\t\tString res = \"\";\n\t\twhile(n >0){\n\t\t\tres = chars.charAt(n%b) + res;\n\t\t\tn /= b;\n\t\t}\n\t\treturn res;\n\t}", "String intToBinaryNumber(int n){\n return Integer.toBinaryString(n);\n }", "public static String decToBinR( int n ) { \n\tif (n == 0)\n\t return \"0\";\n\telse if (n == 1)\n\t return \"1\";\n\telse\n\t return n % 2 + decToBin(n / 2);\n }", "private ArrayList<Integer> decToBinary(int decimal)\n {\n\t\tArrayList<Integer> bin_num = new ArrayList<Integer>();\n\t\t\n\t\twhile(decimal != 0) \n\t\t{\n \tbin_num.add(decimal%2) ;//remainder represents one digit in Binary.\n decimal /= 2;//Keep dividing by 2 to reach 0\n }\n\t\treturn bin_num;//returns the arraylist\n }", "public static int binaryToGray(int num) { return (num >>> 1) ^ num; }", "public int binarioToDecimal(String binario) {\n\t\tSystem.out.print(\"Convirtiendo binario (\" + binario + \") a decimal >> \");\n\t\tInteger numero = 0;\n\t\ttry{\n\t\t\tnumero = Integer.valueOf(binario, 2);\n\t\t}catch (NumberFormatException e) {\n\t\t\tSystem.err.print(\"\\nERROR : El numero \" + binario + \" no es binario\");\n\t\t}\n\t\treturn numero.intValue();\n\t}", "private int negativeBinaryToInt(String binary) {\n int n = binary.length() - 1;\n int w = -bitToInt(binary.charAt(0)) * (int) Math.pow(2, n);\n for (int i = n, j = 0; i > 0; i--, j++) {\n w += (int) Math.pow(2, j) * (binary.charAt(i) == '1' ? 1 : 0);\n }\n return w;\n }", "public String decimalToBinary(int decimal){\n String binaryCode = \"\";\n \n if(decimal < 0) {\n binaryCode += \"1\";\n decimal = decimal * -1;\n }\n else binaryCode += \"0\";\n \n String binary = Integer.toBinaryString(decimal);\n if (binary.length() < 7) binaryCode = this.fillWithZeros(binaryCode, binary, 7);\n else binaryCode += binary;\n \n return binaryCode;\n }", "public static int getTwosComplement(String binaryInt) {\r\n\t\t// Check if the number is negative.\r\n\t\t// We know it's negative if it starts with a 1\r\n\t\tif (binaryInt.charAt(0) == '1') {\r\n\t\t\t// Call our invert digits method\r\n\t\t\tString invertedInt = invertDigits(binaryInt);\r\n\t\t\t// Change this to decimal format.\r\n\t\t\tint decimalValue = Integer.parseInt(invertedInt, 2);\r\n\t\t\t// Add 1 to the current decimal and multiply it by -1\r\n\t\t\t// because we know it's a negative number\r\n\t\t\tdecimalValue = (decimalValue + 1) * -1;\r\n\t\t\t// return the final result\r\n\t\t\treturn decimalValue;\r\n\t\t} else {\r\n\t\t\t// Else we know it's a positive number, so just convert\r\n\t\t\t// the number to decimal base.\r\n\t\t\treturn Integer.parseInt(binaryInt, 2);\r\n\t\t}\r\n\t}", "private static String convertP(int value)\n {\n String output = Integer.toBinaryString(value);\n\n for(int i = output.length(); i < 6; i++) // pad zeros\n output = \"0\" + output;\n\n return output;\n }", "public char[] decimalToBinary(int value) {\n\t\t// TODO: Implement this method.\n\t\treturn null;\n\t}", "private int byteToInt(byte b) { int i = b & 0xFF; return i; }", "public static double bitsToBytes(double num) { return (num/8); }", "private static String getBinaryFromDecimal(int decimal)\n\t{\n\n\t\tif( decimal == 0 )\n\t\t{\n\t\t\treturn \"00000000\";\n\t\t}\n\n\t\tif( decimal == 1 )\n\t\t{\n\t\t\treturn \"00000001\";\n\t\t}\n\n\t\tchar[] binary = {'0', '0', '0', '0', '0', '0', '0', '0'};\n\t\tint exponent, value;\n\n\t\tdo\n\t\t{\n\t\t\texponent = getNearestPowerOfTwo(decimal);\n\t\t\tbinary[7-exponent] = '1';\n\t\t\tvalue = (int)Math.pow(2, exponent);\n\t\t\tdecimal = decimal - value;\n\t\t}\n\t\twhile( decimal > 0 );\n\n\t\treturn new String(binary);\n\t}", "public String asBinary() {\n String binaryString = \"\";\n\n for (; this.decimalValue > 0; decimalValue /= 2) {\n if (this.decimalValue % 2 == 0) {\n binaryString += \"0\";\n } else {\n binaryString += \"1\";\n }\n }\n\n return new StringBuilder(binaryString).reverse().toString();\n }", "public static int binarioInteiroParaDecimal(int[] numero) {\n if(numero.length > 32)\n throw new IllegalArgumentException(\"O numero nao pode ter mais do que 32 bits\");\n\n int potencia = 1;\n int soma = 0;\n for(int i = numero.length - 1; i > 0; i--) {\n soma += potencia * numero[i];\n potencia *= 2;\n }\n\n soma -= numero[0] * potencia;\n return soma;\n }", "public int toDecimal() {\n\t\tint length = data.length;\n\t\tint decimal = 0;\n\t\tfor(int i = 0;i < length;i++) {\n\t\t\tint index = length - 1 - i;\n\t\t\tint power = (int)Math.pow(2, index);\n\t\t\tdecimal = decimal + data[i] * power;\n\t\t}\n\t\treturn decimal;\n\t}", "public int binaryToInt(String binary){\n return Integer.parseInt(binary, 2);\n }", "private static int hex2dec(int hex) {\n if (hex > 0x255 || hex < 0) {\n throw new IllegalArgumentException(\"Value must be between 0 and 0x255 (597)\");\n }\n return (hex / 256) * 100 + ((hex % 256) / 16) * 10 + hex % 256 % 16;\n }", "private int bitToInt(char bit) {\n return bit == '0' ? 0 : 1;\n }", "public int numberInverter(int num) {\n\n\t\tint inv = 10 - num;\n\t\treturn inv;\n\t}", "static long flippingBits(long n) {\n\n String strBinary = String.format(\"%32s\", Long.toBinaryString(n)).replace(' ', '0');\n String strBinaryFlip = \"\";\n\n for (int i = 0; i < strBinary.length(); i++) {\n if (strBinary.charAt(i) == '0') {\n strBinaryFlip = strBinaryFlip + '1';\n } else {\n strBinaryFlip = strBinaryFlip + '0';\n }\n }\n\n String result = String.format(\"%32s\", strBinaryFlip).replace(' ', '0');\n long base10 = parseLong(result,2);\n return base10;\n }", "public int octalToDecimal(long octal) {\r\n \tint standardFormExponent = (int) (Math.pow(10, Math.floor(Math.log10(octal))));\r\n \tint output = 0;\r\n \tint currentDigit = 0;\r\n \t\r\n\t\tfor (int digit = standardFormExponent; digit >= 1; digit /= 10) {\r\n\t\t\tcurrentDigit = (int) (octal/digit - (octal/(digit*10))*10);\r\n\t\t\tif (currentDigit == 9 || currentDigit == 8) {\r\n\t\t\t\treturn (int) octal;\r\n\t\t\t} else {\r\n\t\t\t\toutput += currentDigit;\r\n\t\t\t\toutput *= 8;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\toutput /= 8; //because the loop above will *8 one too many times\r\n\t\treturn output;\r\n }", "private void converToDecimalValue(int inputValue, int inputSystemType) {\n\t\t// Adding stack to support string loop\n\t\tStack<Integer> letters = new Stack<Integer>();\n\t\tString inputValueString = Integer.toString(inputValue);\n\t\t// Adding the string loop to push the chars to a stack\n\t\tfor (int index = 0; index < inputValueString.length(); index++) {\n\t\t\tCharacter aChar = new Character(inputValueString.charAt(index));\n\t\t\tString s = aChar.toString();\n\t\t\tint number = Integer.parseInt(s);\n\t\t\tletters.push(number);\n\t\t}\n\t\t// Counter is needed to tell the position of the digit and the number\n\t\tint counter = 0;\n\t\twhile (!letters.empty()) {\n\t\t\tInteger value = ((Integer) letters.pop());\n\t\t\t// Checking the result with a println\n\t\t\t// System.out.println(value.intValue() + \" \" +\n\t\t\t// this.convertedToDecimalValue);\n\t\t\tthis.convertedToDecimalValue += (int) (Math.pow(inputSystemType,\n\t\t\t\t\tcounter++) * value.intValue());\n\n\t\t}\n\t}", "public static int binary_to_int(String chars){\n\t\tint decimal_number=0,i,j=1;\n\t\tfor(i=(chars.length()-1);i>=0;i--){\n\t\t\tdecimal_number+=(j*char_to_int(chars.charAt(i)));\n\t\t\tj=j*2;\n\t\t}\n\t\treturn decimal_number;\n\t}", "@Test\n public void test2(){\n\n String s =\"1000000000000001\";\n //s = BinaryCalculate.BinaryArithmeticalRightShift(s,1);\n s = BinaryCalculate.BinaryLogicRightShift(s,1);\n int a = BitConversion.fromBinaryStringToInt(s);\n System.out.println(a);\n }", "public static double petaBitsToBits(double num) { return gigaBitsToBits(petaBitsToGigaBits(num)); }", "public int hexToDec(String input) {\r\n\t int decimal= Integer.parseInt(input,16); \r\n\t\treturn decimal;\t\t\r\n\t}", "public static int convertToBinary(int input)\n {\n /*create a variable for remainder of input divided by 2 (will be either 0 or 1);\n this is the least significant digit of the binary string\n */\n int remainder = input % 2; \n \n //base case, return input if input is 0 or 1 (smallest two possibilities)\n if (input == 0 || input == 1) \n return input; \n \n /* if input is not 0 or 1, then return remainder + (value returned by \n convertToBinary(input/2) multiplied by ten); note that if there are n \n recursive method calls, then the return value of the final recursive \n method call is the value of the bit in the 2^ns place; when the stack is \n popped, that value is then multiplied by ten in order to move it one position\n leftward (because this method technically returns a base ten integer, and we\n are simply interpreting it as a binary string), and then the remainder is added to \n give the value of the least significant bit, and this process repeats until\n the initial method call is reached, at which point the remainder is the \n least significant bit\n */\n \n else\n { \n //System.out.println(\"\\nreturn \" + remainder + \" + convert(\"+input/2+\") * 10\");\n return remainder + (convertToBinary(input/2)*10);\n }\n \n }", "private static int invertirNumero(int num) {\n\t\tint cifra, inverso = 0;\n\t\twhile (num > 0) {\n\t\t\tcifra = num % 10;\n\t\t\tinverso = cifra + inverso * 10;\n\t\t\tnum /= 10;\n\t\t}\n\t\treturn inverso;\n\t}", "public static String printBinary (String n){\n\t\tint intPart = Integer.parseInt(n.substring(0, n.indexOf(\".\")));\n\t\tdouble decPart = Double.parseDouble(n.substring(n.indexOf(\".\")));\n\t\tString iPart = \"\";\n\t\tint bit;\n\t\twhile(intPart > 0){\n\t\t\tbit = intPart %2; //take mod result as the last digit.\n\t\t\tintPart >>= 1;\n\t\t\tiPart = bit + iPart;\n\t\t}\n\t\t\n\t\tString dPart = \"\";\n\t\tdouble val;\n\t\twhile (decPart > 0) {//any left over value?\n\t\t\tif(dPart.length() > 32) return \"Error\";//too long to represent\n\t\t\tval = decPart * 2;\n\t\t\tif(val >= 1) {\n\t\t\t\tdecPart = val - 1;\n\t\t\t\tdPart += 1;\n\t\t\t} else {\n\t\t\t\tdecPart = val;\n\t\t\t\tdPart += 0;\n\t\t\t}\n\t\t}\n\t\treturn iPart + \".\" + dPart;\n\t}", "int bv(byte b) {\n\t\tint out = b;\n\t\tif (b < 0)\n\t\t\tout = out + 256;\n\t\treturn out;\n\t}", "public static int[] decimalInteiroParaInteiroBinario(int numero, int numeroBits) {\n boolean negativo = (numero < 0);\n\n // Transforma o numero em positivo\n if(negativo) numero *= -1;\n\n long expoente = 0;\n long potencia = 1;\n long soma = 1;\n while(soma < numero) {\n expoente++;\n potencia *= 2;\n soma += potencia;\n }\n\n if(expoente + 2 > numeroBits) if(!negativo) throw new IllegalArgumentException(\"Eh necessario mais bits do que o indicado para criar o numero\");\n else if(potencia != numero) throw new IllegalArgumentException(\"Eh necessario mais bits do que o indicado para criar o numero\");\n if(expoente + 2 > 32) throw new IllegalArgumentException(\"Nao eh possivel converter o numero \" + numero + \" para binario, eh necessario mais do que 32 bits\");\n\n // Incrementa 1 para ajustar o vetor de acordo com o expoente e mais 1 para o bit de sinal\n int[] binario = new int[numeroBits];\n\n // Ajuda o bit de sinal\n binario[0] = (negativo ? 1 : 0);\n\n // Se for negativo armazena o binario em complemento de 2\n if(negativo) {\n // Insere os bits em complemento de 1\n for(int j = binario.length - 1; j >= 0; j--) {\n //binario[j] = ((numero % 2) == 1 ? 0 : 1); // Inverte o valor dos bits\n binario[j] = (int)((numero % 2) + 1) % 2; // Inverte o valor dos bits\n numero /= 2;\n }\n\n // Soma um no binario para virar complemento de dois\n //NumeroBinario.somarUm(binario, true);\n int anterior = 0;\n int excesso = 1;\n for(int i = binario.length - 1; i >= 0 && excesso == 1; i--) {\n anterior = binario[i]; // Salva o valor do bit antes da modificacao\n binario[i] = (binario[i] + excesso) % 2;\n excesso = (anterior + excesso) / 2; // Calcula o excesso usando o valor do bit antes da modificacao\n }\n } else {\n // Insere os bits\n for(int j = binario.length - 1; j > 0; j--) {\n binario[j] = (int)(numero % 2);\n numero /= 2;\n }\n }\n\n return (binario);\n }", "public static String toBinaryString(int number) {\r\n\t\tString result = \"\";\r\n\t\tint origin = Math.abs(number);\r\n\r\n\t\twhile (origin > 0) {\r\n\t\t\tif (origin % 2 == 0)\r\n\t\t\t\tresult = \"0\" + result;\r\n\t\t\telse\r\n\t\t\t\tresult = \"1\" + result;\r\n\t\t\torigin = origin / 2;\r\n\t\t}\r\n\t\twhile (result.length() < 16)\r\n\t\t\tresult = \"0\" + result;\r\n\r\n\t\tif (number > 0)\r\n\t\t\treturn result;\r\n\t\telse {\r\n\t\t\tString result2 = \"\";\r\n\t\t\tfor (int i = 0; i < result.length(); i++)\r\n\t\t\t\tresult2 += result.charAt(i) == '1' ? \"0\" : \"1\";\r\n\t\t\tchar[] result2Array = result2.toCharArray();\r\n\t\t\tfor (int i = result2Array.length - 1; i >= 0; i--)\r\n\t\t\t\tif (result2Array[i] == '0') {\r\n\t\t\t\t\tresult2Array[i] = '1';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult2Array[i] = '0';\r\n\t\t\tresult2 = \"\";\r\n\t\t\tfor (int i = 0; i < result2Array.length; i++)\r\n\t\t\t\tresult2 += String.valueOf(result2Array[i]);\r\n\t\t\treturn result2;\r\n\t\t}\r\n\t}", "public String base10to2(int n) throws Exception {\r\n\r\n\t\t // int n = Integer.valueOf(base10);\r\n\t\t \r\n\t\t if (n < 0 || n > maxValue)\r\n\t\t\t throw new Exception (\"the input number exceeds the allowable limits\");\r\n\t \r\n\t\t String binaryStr = Integer.toBinaryString(n);\r\n\t \r\n\t //pad the above string to make it to 8 bits representation\r\n\t //if positive number, the most significant bit is 0, else 1\r\n\t if (n>0)\r\n\t \tbinaryStr= String.format(\"%8s\", binaryStr).replace(' ', '0');\r\n\t else{\r\n\t \tbinaryStr = Integer.toBinaryString((-1)*n);\r\n\t \t\r\n\t \tbinaryStr= String.format(\"%8s\", binaryStr).replace(' ', '0');\r\n\t \tbinaryStr = get2sComplement(binaryStr);\r\n\t }\r\n\t return binaryStr;\r\n\t }", "public static int grayToBinary(int num) {\r\n\t\tint k = (INTEGER_SIZE >>> 1);\r\n\t\tint temp = num;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp ^= (temp >>> k);\r\n\t\t\tk >>>= 1;\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public static String dexToBin(int value) {\n\tString binVal = Integer.toBinaryString(value);\n\t\treturn binVal;\n\t\t\n\t}", "public int hexToBin(String input) {\r\n\t\treturn Integer.valueOf(new BigInteger(input, 16).toString(2));\t\t\r\n\t}", "private static long convertNumber(String text, int base)\r\n\t{\r\n\t\tlong result = 0;\r\n\t\ttext = text.toLowerCase();\r\n\t\tfor (int i = 2; i < text.length(); i++)\r\n\t\t{\r\n\t\t\tint d;\r\n\t\t\tchar c = text.charAt(i);\r\n\t\t\tif (c > '9')\r\n\t\t\t\td = (int) (c - 'a') + 10;\r\n\t\t\telse\r\n\t\t\t\td = (int) (c - '0');\r\n\t\t\tresult = (result * base) + d;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public double USDtoBit(double d){\n double n;\n n = d * .001616893;\n return n;\n }", "public static int[] integerToBinary(int num)\n\t{\n\t\tint binaryNumber []= new int[3];\n\t\tint finalBinaryNumber []= {0,0,0};\n\t\tint count=2;\n\t\tint k= Math.abs(num);\n\t\twhile(k>0)\n\t\t{\n\t\t\tbinaryNumber[count]= k%2;\n\t\t\tk=k/2;\n\t\t\tcount--;\n\t\t\t\n\t\t}\n\t\tfor(int i=2; i>=0;i--)\n\t\t{\n\t\t\tfinalBinaryNumber[i]= binaryNumber[i];\n\t\t}\n\t\treturn finalBinaryNumber;\n\t}", "public static void swapNibbles(String binary) {\n\n if (binary.length() < 8) {\n while (binary.length() < 8) {\n binary = \"0\" + binary;\n }\n }\n System.out.println(\"Before Swapping Nibbles:\" + binary);\n char arr[] = binary.toCharArray();\n for (int i = 0; i < 4; i++) {\n char ch = arr[i];\n arr[i] = arr[i + 4];\n arr[i + 4] = ch;\n }\n binary = String.valueOf(arr);\n System.out.println(\"After Swapping Nibbles:\" + binary);\n int c = Integer.parseInt(binary);\n int decimal = 0;\n int power = 0;\n // to convert binary to decimal\n while (true) {\n if (c == 0) {\n break;\n } else {\n int tmp = c % 10;\n decimal += tmp * Math.pow(2, power);\n c = c / 10;\n power++;\n }\n }\n System.out.println(\"Number after Swapping Nibbles: \" + decimal);\n }", "public static double petaBytesToBits(double num) { return gigaBitsToBits(petaBytesToGigaBits(num)); }", "static String printBinary(double num) {\n // Check Number is Between 0 to 1 or Not\n if (num >= 1 || num <= 0)\n return \"ERROR\";\n\n StringBuilder binary = new StringBuilder();\n System.out.println(\"binary:\"+binary.toString());\n binary.append(\".\");\n\n while (num > 0) {\n\t\t\t/* Setting a limit on length: 32 characters,\n\t\t\tIf the number cannot be represented\n\t\t\taccurately in binary with at most 32\n\t\t\tcharacter */\n if (binary.length() >= 32)\n return \"ERROR\";\n\n // Multiply by 2 in num to check it 1 or 0\n double r = num * 2;\n if (r >= 1) {\n binary.append(1);\n num = r - 1;\n } else {\n binary.append(0);\n num = r;\n\n\n\n }\n\n }\n return binary.toString();\n }", "public String convertDecimalToBinary(int decimalNumber) {\n StringBuilder binaryInReverse = new StringBuilder();\n\n /* do the operation till the decimal number is greater than 0 */\n while (decimalNumber > 0) {\n /* divide the decimal number and get the remainder and append it to the binaryInReverse */\n binaryInReverse.append(decimalNumber % 2);\n /* after taking the remainder make the decimal number as decimalNumber / 2 for the next iteration */\n decimalNumber /= 2;\n }\n /* return the string representation of the reverse of binaryInReverse */\n return binaryInReverse.reverse().toString();\n }", "public static double teraBytesToBits(double num) { return (num*8*Math.exp(12)); }", "public static String toBinary(int n){\n int length = (int)Math.ceil(Math.log(n)/Math.log(2));\n int[] bits = new int[length];\n for(int x = 0; x < length; x++){\n double val = Math.pow(2, length - x);\n if(n >= val){\n bits[x] = 1;\n n -= val;\n }\n else{\n bits[x] = 0;\n }\n }\n String convert = \"\";\n for(int x = 0; x < length; x++){\n convert += bits[x];\n }\n return convert;\n }", "static void printBinary(String num, int precision) {\n int intPart = Integer.parseInt(num.split(\"\\\\.\")[0]);\n double decPart = Double.parseDouble(\".\" + num.split(\"\\\\.\")[1]);\n\n String intBinary = \"\";\n String decBinary = \"\";\n while (intPart > 0) {\n int rem = intPart % 2;\n intPart >>= 1;\n intBinary = rem + intBinary;\n }\n\n int len = 0;\n while (decPart > 0 && len != precision) {\n decPart *= 2;\n len++;\n if (decPart >= 1) {\n decBinary += 1;\n decPart -= 1;\n } else {\n decBinary += 0;\n }\n }\n\n System.out.println(intBinary + \".\" + decBinary);\n }", "public int octaToDecimal(int octal) {\n\t\tSystem.out.print(\"Convirtiendo octal (\" + octal + \") a decimal >> \");\n\t\tInteger numero = 0;\n\t\ttry{\n\t\t\tnumero = Integer.valueOf(String.valueOf(octal), 8);\n\t\t}catch (NumberFormatException e) {\n\t\t\tSystem.err.print(\"\\nERROR : El numero \" + octal +\" no es octal\");\n\t\t}\n\t\treturn numero.intValue();\n\t}", "BigInteger decodeBigInteger();", "private int hexToDecimal(String s)\n {\n String digits = \"0123456789ABCDEF\";//digits to define value based on position on this string\n s = s.toUpperCase();//changes the parameter value to uppercase\n int val = 0;//value starts with 0\n \n \n //loop for the as many characters as in \"s\"\n for (int i = 0; i < s.length(); i++)\n {\n char c = s.charAt(i);//gets character at position i from user input\n \n int d = digits.indexOf(c);//get index value of character from digits\n \n val = 16 * val + d;//calculates decimal num. Times 16 with itself each loop and adds the value of the character from digits in decimal form\n \n }\n return val;\n }", "public static int HexToInt(int hex) {\n int ret = 0;\n int i = 0;\n\n while (hex > 0) {\n ret += (hex % 10) * Math.pow(BASE, i);\n hex /= 10;\n i++;\n }\n\n return ret;\n }", "private void outDec(){\n\t\tSystem.out.println(binary);\n\t\tpw.println(binary);\n\t\t\n\t}", "final int ec_decode_bin(final int _bits) {\r\n\t\tthis.ext = this.rng >>> _bits;\r\n\t\tlong s = (this.val / this.ext);\r\n\t\t// return (int)((1L << _bits) - EC_MINI( s + 1L, 1L << _bits ));\r\n\t\ts++;\r\n\t\tlong b = 1L << _bits;\r\n\t\tb -= s;\r\n\t\tif( b > 0 ) {\r\n\t\t\tb = 0;\r\n\t\t}\r\n\t\ts += b;\r\n\t\treturn (int)((1L << _bits) - s);\r\n\t}", "private int decToOctal(int decimal)\n {\n\t\t ArrayList<Integer> oct_num = new ArrayList<Integer>();\n\t\t int octal= 0;\n\t\t \n\t\t \n\t \n\t while(decimal != 0)\n\t {\n\t \t oct_num.add(decimal%8);//remainder represents one digit in octal. Adding it to the arraylist.\n\t \t decimal /= 8;//\"%\" does not divide the number, it only gets the remainder, so it requires this division to reach 0.\n\t }\n\t \n\t \n\t \n\t //for loop to combine values of each oct_num array into one integer value\n\t int unit = 1;//first value of the array list represents unit of 1\n\t for(int i = 0; i < oct_num.size(); i++) \n\t { \t\n\t \toctal = octal + (oct_num.get(i) * unit) ;\n\t unit *= 10;//unit is timed by ten after each loop\n\t \n\t }\n\t\t return octal;\n }", "private void convertToDestinationBase(int convertedToDecimalValue,\n\t\t\tint destinationSystemBase) {\n\t\tStack<Integer> numbers = new Stack<Integer>();\n\t\twhile (convertedToDecimalValue > 0) {\n\t\t\tint remain = convertedToDecimalValue % destinationSystemBase;\n\t\t\tnumbers.push(remain);\n\t\t\tconvertedToDecimalValue /= destinationSystemBase;\n\n\t\t}\n\n\t\t// Adding support for the base 16\n\t\tif (destinationSystemBase == 16) {\n\t\t\tString values = \"0123456789ABCDEF\";\n\t\t\twhile (!numbers.empty()) {\n\t\t\t\tint result = numbers.pop();\n\t\t\t\tthis.convertedValue += values.charAt(result);\n\n\t\t\t}\n\n\t\t} else {\n\t\t\twhile (!numbers.empty()) {\n\t\t\t\tthis.convertedValue += numbers.pop();\n\t\t\t}\n\n\t\t}\n\n\t}", "public static Stack<Integer> decToBinary(int dec) {\n Stack<Integer> binary = new Stack<>();//integer stack that stores the binary number\n //converts decimal number into its binary equivalent\n for(int i = 8; i >= 0; i--) {\n binary.push((int) (dec / Math.pow(2,i)));\n dec = dec % (int)Math.pow(2,i); \n }\n return binary;\n }", "public Binary( int n ) {\n\t_decNum = n;\n\t_binNum = decToBin(n);\n }", "public static double exaBitsToBits(double num) { return gigaBitsToBits(exaBitsToGigaBits(num)); }", "public void setInBin(int n) {\n inBin=Translate.decTobinN(n, 4);\n }", "public String negBase2(int n) throws Exception {\r\n\t\t String binaryStr=\"\";\r\n\r\n\t\t int minValue = -256;//allowed min decimal\r\n\t\t// donot allow positive numbers and make sure the \r\n\t\t// input number is > allowed min value for 8 bit representation\r\n\t\t if (n>0 || n < minValue) \r\n\t\t\t throw new Exception (\"the input number exceeds the allowable limits\");\r\n\t\t\t \r\n\t\t binaryStr = Integer.toBinaryString((-1)*n);\r\n\t \t\r\n\t \tbinaryStr= String.format(\"%8s\", binaryStr).replace(' ', '0');\r\n\t \tbinaryStr = get2sComplement(binaryStr);\r\n\t\t return binaryStr;\r\n\t }" ]
[ "0.7359425", "0.7244996", "0.7179886", "0.7150227", "0.7085594", "0.7037888", "0.70093703", "0.6940783", "0.6903058", "0.68851507", "0.6878968", "0.6726722", "0.6713992", "0.6700051", "0.66899055", "0.6585504", "0.65670127", "0.65588224", "0.6541427", "0.63685304", "0.6364017", "0.6330685", "0.6322643", "0.6318633", "0.6309274", "0.6284977", "0.6255844", "0.62327206", "0.61600757", "0.6087643", "0.6086066", "0.60448927", "0.60323167", "0.60322666", "0.60239196", "0.60221416", "0.6003978", "0.6001079", "0.59981143", "0.5994648", "0.59754544", "0.5973278", "0.59314626", "0.59290487", "0.5906533", "0.5905397", "0.59030694", "0.58942056", "0.5883384", "0.5882127", "0.5858949", "0.58556455", "0.5847054", "0.58417106", "0.5840439", "0.5840222", "0.5838082", "0.58353657", "0.57685", "0.5760052", "0.5701513", "0.5700028", "0.56885946", "0.568412", "0.5657743", "0.5646404", "0.5645768", "0.56003076", "0.55624706", "0.555694", "0.5540863", "0.55403095", "0.55350506", "0.5530114", "0.55216396", "0.5486907", "0.54790354", "0.54703873", "0.5469451", "0.5463184", "0.5459945", "0.5449041", "0.54435056", "0.54078346", "0.54039294", "0.53902125", "0.5386378", "0.5384593", "0.53798664", "0.5372824", "0.5372702", "0.53473014", "0.53466564", "0.5339986", "0.53397405", "0.53201646", "0.53114486", "0.52983415", "0.5297666", "0.52949435" ]
0.5846093
53
turns a binary number into a string
public String toString() { int bn = 0; String s = String.valueOf(bn); return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String toBinaryString(int number) {\r\n\t\tString result = \"\";\r\n\t\tint origin = Math.abs(number);\r\n\r\n\t\twhile (origin > 0) {\r\n\t\t\tif (origin % 2 == 0)\r\n\t\t\t\tresult = \"0\" + result;\r\n\t\t\telse\r\n\t\t\t\tresult = \"1\" + result;\r\n\t\t\torigin = origin / 2;\r\n\t\t}\r\n\t\twhile (result.length() < 16)\r\n\t\t\tresult = \"0\" + result;\r\n\r\n\t\tif (number > 0)\r\n\t\t\treturn result;\r\n\t\telse {\r\n\t\t\tString result2 = \"\";\r\n\t\t\tfor (int i = 0; i < result.length(); i++)\r\n\t\t\t\tresult2 += result.charAt(i) == '1' ? \"0\" : \"1\";\r\n\t\t\tchar[] result2Array = result2.toCharArray();\r\n\t\t\tfor (int i = result2Array.length - 1; i >= 0; i--)\r\n\t\t\t\tif (result2Array[i] == '0') {\r\n\t\t\t\t\tresult2Array[i] = '1';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult2Array[i] = '0';\r\n\t\t\tresult2 = \"\";\r\n\t\t\tfor (int i = 0; i < result2Array.length; i++)\r\n\t\t\t\tresult2 += String.valueOf(result2Array[i]);\r\n\t\t\treturn result2;\r\n\t\t}\r\n\t}", "public static String intToBinaryString(int value) {\r\n String bin = \"00000000000000000000000000000000\" + Integer.toBinaryString(value);\r\n\r\n return bin.substring(bin.length() - 32, bin.length() - 24)\r\n + \" \"\r\n + bin.substring(bin.length() - 24, bin.length() - 16)\r\n + \" \"\r\n + bin.substring(bin.length() - 16, bin.length() - 8)\r\n + \" \"\r\n + bin.substring(bin.length() - 8, bin.length());\r\n }", "String intToBinaryNumber(int n){\n return Integer.toBinaryString(n);\n }", "public static String toBinary(int number)\n\t{\n\t\tString total = \"\";\n\t\tint a;\n\t\twhile (number > 0) {\n\n\t\t\ta = number % 2;\n\n\t\t\ttotal = total + \"\" + a;\n// divide number by 2 \n\t\t\tnumber = number / 2;\n\n\t\t\t}\n\n// return value \n\t\treturn (new StringBuilder(total)).reverse().toString();\n\t\t\n\t}", "public static String num2Bin(int a) {\n StringBuilder sb = new StringBuilder();\n for (int bitPow2 = 1, i = 0; i < Integer.SIZE; bitPow2 <<= 1,\n ++i) {\n if ((a & bitPow2) == bitPow2) {\n sb.append(\"1\");\n } else {\n sb.append(\"0\");\n }\n }\n return sb.reverse().toString();\n }", "public static void toBinary (int number) {\r\n String binary = \"\";\r\n \r\n if (number > 0) {\r\n toBinary(number / 2); \r\n System.out.print(number % 2 + binary);\r\n }\r\n }", "public static String binConvertInt(long num) {\n\t\tString binString = \"\";\n\n\t\t// ORIGINAL CODE FOR INT BINCONVERT\n\n\t\tlong binary = 0;\n\t\tint count = 0;\n\n\t\tif (num >= 0) {\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t}\n\n\t\telse {\n\n\t\t\tnum = -1 * num;\n\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t\t// flip the binary to negative conversion\n\n\t\t\tchar ch[] = binString.toCharArray();\n\t\t\tboolean addedOne = false;\n\n\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\tif (ch[i] == '0') {\n\t\t\t\t\tch[i] = '1';\n\t\t\t\t} else {\n\t\t\t\t\tch[i] = '0';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (ch[binString.length() - 1] == '0') {\n\n\t\t\t\tch[binString.length() - 1] = '1';\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tch[binString.length() - 1] = '0';\n\t\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\t\tif(ch[i] == '1') {\n\t\t\t\t\t\tch[i] = '0';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tch[i] = '1';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\tbinString = new String(ch);\n\t\t}\n\n\t\t\n\t\treturn binString;\n\t}", "public static String binValue(byte b) {\n StringBuilder sb = new StringBuilder(8);\n for (int i = 0; i < 8; i++) {\n if ((b & 0x01) == 0x01) {\n sb.append('1');\n } else {\n sb.append('0');\n }\n b >>>= 1;\n }\n return sb.reverse().toString();\n }", "private static String convertP(int value)\n {\n String output = Integer.toBinaryString(value);\n\n for(int i = output.length(); i < 6; i++) // pad zeros\n output = \"0\" + output;\n\n return output;\n }", "public static String dexToBin(int value) {\n\tString binVal = Integer.toBinaryString(value);\n\t\treturn binVal;\n\t\t\n\t}", "public String toBitString (int i) {\n\tint[] result = new int[64];\n\tint counter = 0;\n\twhile (i > 0) {\n\t\tresult[counter] = i % 2;\n\t\ti /= 2;\n\t\tcounter++;\n\t}\n\tString answer = \"\";\n\tfor (int j = 0; j < counter; j++)\n\t\tanswer += \"\" + result[j];\n\treturn answer;\t\n}", "public static void displayAsBinary(int number)\n {\n System.out.println(Integer.toBinaryString(number));\n }", "private String decimalToBinary(int num) {\n String result = \"\";\n \n while(num > 0 ) \n {\n \n \n //get the remainder\n result = num % 2 + result;\n \n // Divide the positive decimal number by two( then divide the quotient by two)\n num = num /2;\n }\n \n return result;\n }", "public static String toBinaryString(BigInteger data) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0b\").append(data.toString(2));\n return sb.toString();\n }", "@Override\n\tpublic String convert2Binary(int num) {\n\t\treturn null;\n\t}", "public static String decimalToBinary(int number)\r\n {\n String start = \"\";\r\n if (number < 0)\r\n {\r\n start = \"-\";\r\n number = -number;\r\n }\r\n \r\n String result = \"\";\r\n while(true)\r\n {\r\n int remainder = number % 2;\r\n String digit = Integer.toString(remainder);\r\n result = digit + result;\r\n number = number / 2;\r\n if (number == 0)\r\n {\r\n break;\r\n }\r\n }\r\n \r\n // if number is negative, put a minus sign in front of the result.\r\n result = start + result;\r\n return result;\r\n }", "public static String byte2str(byte b) {\r\n String s = String.format(\"%8s\", Integer.toBinaryString(b & 0xFF)).replace(\r\n ' ', '0');\r\n return s;\r\n }", "public static String binaryCode(String n)\n\t{\n\t\tString retValue = \"\";\n\n\t\tint num = Integer.parseInt(n);\t//convert the input string into int\n\n\t\twhile(num>0)\n\t\t{\n\t\t\tif(num==1)\n\t\t\t\tretValue += num;\n\t\t\telse\n\t\t\t\tretValue += Integer.toString(num%2);\t//resto della divisione\n\t\t\t\tnum = num/2;\t\t\t\t\t\t\t//divide the number by 2\n\t\t}\n\n\t\treturn new StringBuilder(retValue).reverse().toString();\n\t}", "public static String toBinary(int n){\n int length = (int)Math.ceil(Math.log(n)/Math.log(2));\n int[] bits = new int[length];\n for(int x = 0; x < length; x++){\n double val = Math.pow(2, length - x);\n if(n >= val){\n bits[x] = 1;\n n -= val;\n }\n else{\n bits[x] = 0;\n }\n }\n String convert = \"\";\n for(int x = 0; x < length; x++){\n convert += bits[x];\n }\n return convert;\n }", "private String toBinary(byte caracter){\n byte byteDeCaracter = (byte)caracter;\n String binario=\"\";\n for( int i = 7; i>=0; i--){\n binario += ( ( ( byteDeCaracter & ( 1<<i ) ) > 0 ) ? \"1\" : \"0\" ) ;\n }\n return binario;\n }", "public String decimalToBinario(int numero) {\n\t\tSystem.out.print(\"Convirtiendo decimal (\" + numero + \") a binario >> \");\n\t\treturn Integer.toBinaryString(numero);\n\t}", "public static String printBinary (String n){\n\t\tint intPart = Integer.parseInt(n.substring(0, n.indexOf(\".\")));\n\t\tdouble decPart = Double.parseDouble(n.substring(n.indexOf(\".\")));\n\t\tString iPart = \"\";\n\t\tint bit;\n\t\twhile(intPart > 0){\n\t\t\tbit = intPart %2; //take mod result as the last digit.\n\t\t\tintPart >>= 1;\n\t\t\tiPart = bit + iPart;\n\t\t}\n\t\t\n\t\tString dPart = \"\";\n\t\tdouble val;\n\t\twhile (decPart > 0) {//any left over value?\n\t\t\tif(dPart.length() > 32) return \"Error\";//too long to represent\n\t\t\tval = decPart * 2;\n\t\t\tif(val >= 1) {\n\t\t\t\tdecPart = val - 1;\n\t\t\t\tdPart += 1;\n\t\t\t} else {\n\t\t\t\tdecPart = val;\n\t\t\t\tdPart += 0;\n\t\t\t}\n\t\t}\n\t\treturn iPart + \".\" + dPart;\n\t}", "private static String printBinary(double num){\n\t\tif(num >= 1 || num <= 0)\n\t\t\treturn \"ERROR\";\n\t\t\n\t\tStringBuilder binary = new StringBuilder();\n\t\tbinary.append(\"0.\");\n\t\tdouble r = 0.5;\n\t\twhile(num > 0){\n\t\t\tif(binary.length() >= 32)\n\t\t\t\treturn \"ERROR\";\n\t\t\t\n\t\t\tif(num >= r){\n\t\t\t\tbinary.append(1);\n\t\t\t\tnum -= r;\n\t\t\t}else\n\t\t\t\tbinary.append(0);\n\t\t\t\n\t\t\tr /= 2;\n\t\t}\n\t\treturn binary.toString();\n\t}", "private static String getBinaryFromDecimal(int decimal)\n\t{\n\n\t\tif( decimal == 0 )\n\t\t{\n\t\t\treturn \"00000000\";\n\t\t}\n\n\t\tif( decimal == 1 )\n\t\t{\n\t\t\treturn \"00000001\";\n\t\t}\n\n\t\tchar[] binary = {'0', '0', '0', '0', '0', '0', '0', '0'};\n\t\tint exponent, value;\n\n\t\tdo\n\t\t{\n\t\t\texponent = getNearestPowerOfTwo(decimal);\n\t\t\tbinary[7-exponent] = '1';\n\t\t\tvalue = (int)Math.pow(2, exponent);\n\t\t\tdecimal = decimal - value;\n\t\t}\n\t\twhile( decimal > 0 );\n\n\t\treturn new String(binary);\n\t}", "static String printBinary(double num) {\n // Check Number is Between 0 to 1 or Not\n if (num >= 1 || num <= 0)\n return \"ERROR\";\n\n StringBuilder binary = new StringBuilder();\n System.out.println(\"binary:\"+binary.toString());\n binary.append(\".\");\n\n while (num > 0) {\n\t\t\t/* Setting a limit on length: 32 characters,\n\t\t\tIf the number cannot be represented\n\t\t\taccurately in binary with at most 32\n\t\t\tcharacter */\n if (binary.length() >= 32)\n return \"ERROR\";\n\n // Multiply by 2 in num to check it 1 or 0\n double r = num * 2;\n if (r >= 1) {\n binary.append(1);\n num = r - 1;\n } else {\n binary.append(0);\n num = r;\n\n\n\n }\n\n }\n return binary.toString();\n }", "public String toString()\n\t{\n\t\tString binary = \"\"; //string to store the binary number\n\t\t\n\t\t//loops through each of the bit positions\n\t\tfor (int i=binaryCode.length-1; i>=0; i--)\n\t\t{\n\t\t\t\n\t\t\t//checks the value of the bit\n\t\t\tif (binaryCode[i]==false)\n\t\t\t{\n\t\t\t\t//if the boolean is false, then the bit is a 0\n\t\t\t\tbinary+=\"0\";\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//since there are only two states, if it is not 0, then it is 1\n\t\t\t\tbinary+=\"1\";\t\t\n\t\t\t}\n\t\t}\t\t\n\t\t//returns the binary number as a string\n\t\treturn binary;\n\t}", "public static String decToBinR( int n ) { \n\tif (n == 0)\n\t return \"0\";\n\telse if (n == 1)\n\t return \"1\";\n\telse\n\t return n % 2 + decToBin(n / 2);\n }", "public static String TextToBinary(String input){\n\t\tString output = \"\";\n\t\tfor(int i = 0; i < input.length(); i++){\n\t\t\toutput += Integer.toBinaryString(0x100 | input.charAt(i)).substring(1);\n\t\t}\n\t\treturn output;\n\t}", "public abstract String toString(String bin);", "public String asBinary() {\n String binaryString = \"\";\n\n for (; this.decimalValue > 0; decimalValue /= 2) {\n if (this.decimalValue % 2 == 0) {\n binaryString += \"0\";\n } else {\n binaryString += \"1\";\n }\n }\n\n return new StringBuilder(binaryString).reverse().toString();\n }", "public static String toFormattedBinaryString(BigInteger data, int numBits) {\n //BigInteger.toString(radix) does not pad to full word sizes.\n String tmpStr = UnsignedBigIntUtils.toPaddedBinaryString(data, numBits);\n tmpStr = RegExp.replaceFirst(\"0b\", tmpStr, \"\");\n\n StringBuilder formattedBinaryString = new StringBuilder();\n\n if (RegExp.isMatch(\"^0b\", tmpStr) == false) {\n formattedBinaryString.append(\"0b\");\n }\n\n // If you modify anything in this loop, then you must modify tests.\n for (int ii = 0; ii < tmpStr.length(); ii++) {\n if (ii % 16 == 0 && ii != 0) {\n formattedBinaryString.append(\" | \");\n } else if (ii % 4 == 0 && ii != 0) {\n formattedBinaryString.append(\" \");\n }\n formattedBinaryString.append(tmpStr.charAt(ii));\n }\n\n tmpStr = formattedBinaryString.toString();\n\n return (tmpStr);\n }", "public static String toPaddedBinaryString(BigInteger data, int numBits) {\n String binStr = UnsignedBigIntUtils.toBinaryString(data);\n binStr = RegExp.replaceFirst(\"0b\", binStr, \"\");\n StringBuilder sb = new StringBuilder();\n\n if (RegExp.isMatch(\"^0b\", binStr) == false) {\n sb.append(\"0b\");\n }\n\n if (numBits > binStr.length()) {\n for (int ii = numBits - binStr.length(); ii > 0; ii--) {\n sb.append('0');\n }\n }\n sb.append(binStr);\n return (sb.toString());\n }", "public static String decToBin( int n ) {\n\tString x = \"\";\n\twhile(n != 0){\n\t x = n % 2 + x;\n\t n /= 2;\n\t}\n\treturn x;\n }", "String bsToStr(BitSet bs){\n String s = \"\";\n for(int i=0; i<bitsetLen; i++){\n if(bs.get(i) == true)\n s += '1';\n else\n s += '0';\n }\n \n return new StringBuilder(s).reverse().toString();\n }", "public static String writeBits(byte b) {\n\n StringBuffer stringBuffer = new StringBuffer();\n int bit = 0;\n\n for (int i = 7; i >= 0; i--) {\n\n bit = (b >>> i) & 0x01;\n stringBuffer.append(bit);\n\n }\n\n return stringBuffer.toString();\n\n }", "@Test\n public void encodeAsString()\n {\n int value = 3;\n BinaryEncoder encoder = new BinaryEncoder(16);\n String result = encoder.encodeAsString(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + result);\n }\n assertNotNull(result);\n assertEquals(\"0011\", result);\n\n value = 20; // > 16 outside range\n result = encoder.encodeAsString(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + result);\n }\n assertNotNull(result);\n assertEquals(\"0100\", result); // Best fit into 4 digits; ignores higher bits\n\n encoder = new BinaryEncoder(0.0, 360.0, 1.0);\n assertEquals(9, encoder.getLength());\n assertEquals(\"000000000\", encoder.encodeAsString(0.0));\n assertEquals(\"000000001\", encoder.encodeAsString(1.0));\n assertEquals(\"000101101\", encoder.encodeAsString(45.0));\n assertEquals(\"001011010\", encoder.encodeAsString(90.0));\n assertEquals(\"010110100\", encoder.encodeAsString(180.0));\n assertEquals(\"101101000\", encoder.encodeAsString(360.0));\n }", "public String toBinary(final int n) {\n int[] binary = new int[35];\n int id = 0;\n \n // Number should be positive\n while (n > 0) {\n binary[id++] = n % 2;\n n = n / 2;\n }\n return \"Array.toString(binary)\";\n \n }", "static StringBuilder convert_to_binary(String msg) {\n byte[] bytes = msg.getBytes();\r\n StringBuilder binary = new StringBuilder();\r\n for (byte b : bytes) {\r\n int val = b;\r\n for (int i = 0; i < 8; i++) {\r\n binary.append((val & 128) == 0 ? 0 : 1);\r\n val <<= 1;\r\n }\r\n binary.append(\"\");\r\n }\r\n return binary;\r\n }", "public static String findBinary(int decimalNumber) {\r\n\t\tint mod;\r\n\r\n\t\tString x = \"\";\r\n\t\tif (decimalNumber > 255) {\r\n\t\t\tSystem.out.println(\"Enter Number between 1 to 255\");\r\n\t\t} else {\r\n\r\n\t\t\twhile (decimalNumber > 0) {\r\n\t\t\t\tmod = decimalNumber % 2;\r\n\t\t\t\tx = mod + \"\" + x;\r\n\t\t\t\tdecimalNumber = decimalNumber / 2;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn x;\r\n\t}", "public static Binary integer_to_binary_1(Integer integer) {\n return new Binary(integer.toString().getBytes(ISO_8859_1));\n }", "public String toString() { \n\treturn _binNum;\n }", "private static String FloatToBinaryString(float data){\n int intData = Float.floatToIntBits(data);\n return String.format(\"%32s\", Integer.toBinaryString(intData)).replace(' ', '0');\n }", "public static String toByteString(byte value) {\n String str = String.format(\"%x\", value);\n if (str.length() == 1)\n str = \"0\" + str;\n return str;\n }", "public static String binaryRepresentation(int n){\n\t\tint[] arr = new int[32]; \n\t\tArrays.fill(arr,0); //Filling the entire arrays with a default value of 0.\n\t\tint len = arr.length-1;\n\t\twhile(n > 0){\n\t\t\tint temp = n % 2;\n\t\t\tarr[len] = temp;\n \tlen--;\n\t\t\tn = n/2;\n\t\t}\n\t\tString ans = arrayToString(arr);\n\t\treturn ans;\n\n\t}", "public static void main(String[] args) {\n System.out.println(\"Enter the number\");\n try (Scanner scanner = new Scanner(System.in)) {\n long theNumber = scanner.nextLong();\n\n //Using inBuilt method from the Integer class\n String x = Long.toBinaryString(theNumber);\n System.out.println(x);\n\n System.out.println(x.concat(\"0\".repeat(5)));\n new String(new char[10]);\n\n\n }\n }", "public String base10to2(int n) throws Exception {\r\n\r\n\t\t // int n = Integer.valueOf(base10);\r\n\t\t \r\n\t\t if (n < 0 || n > maxValue)\r\n\t\t\t throw new Exception (\"the input number exceeds the allowable limits\");\r\n\t \r\n\t\t String binaryStr = Integer.toBinaryString(n);\r\n\t \r\n\t //pad the above string to make it to 8 bits representation\r\n\t //if positive number, the most significant bit is 0, else 1\r\n\t if (n>0)\r\n\t \tbinaryStr= String.format(\"%8s\", binaryStr).replace(' ', '0');\r\n\t else{\r\n\t \tbinaryStr = Integer.toBinaryString((-1)*n);\r\n\t \t\r\n\t \tbinaryStr= String.format(\"%8s\", binaryStr).replace(' ', '0');\r\n\t \tbinaryStr = get2sComplement(binaryStr);\r\n\t }\r\n\t return binaryStr;\r\n\t }", "private static String showCompleteBinaryNumber(String binaryNumber, int binaryNumberDesignedLength) {\n while (binaryNumber.length() < binaryNumberDesignedLength) {\n binaryNumber = \"0\" + binaryNumber;\n }\n return binaryNumber;\n }", "java.lang.String getNumb();", "private static String zeroPaddedBitString(int value) {\n String bitString = Integer.toBinaryString(value);\n return String.format(\"%32s\", bitString).replace(\" \", \"0\");\n }", "public String NumberToString(int number){return \"\"+number;}", "public String transferTo2(int zahl) {\n\n return Integer.toBinaryString(zahl);\n\n }", "public static void main(String[] args) {\nint t = 101010101;\n// koden begynner her\nString s = \"\";\nwhile ( t % 10 > 0 ) {\ns = t % 10 + s;\nt = t / 10;\n}\ns = \"s = \" + s;\nout.println(s);\n\n }", "private static String getBinaryDigit(int iter, int seed)\r\n {\r\n if(iter == 0) {return \"\";}\r\n String result = seed % 2 == 0 ? \"0\" : \"1\";\r\n return result + getBinaryDigit(iter - 1, (int)Math.pow(seed,2) % (p * q));\r\n }", "public static String fakeBin(String numberString) {\n numberString = numberString.replaceAll(\"[0-4]\", \"0\");\n numberString = numberString.replaceAll(\"[5-9]\", \"1\");\n return numberString;\n }", "public String octaToBinario(int octal) {\n\t\tSystem.out.print(\"Convirtiendo octal (\" + octal + \") a Binario >> \");\n\t\tInteger numero = 0;\n\t\ttry{\n\t\t\tnumero = Integer.valueOf(String.valueOf(octal), 16);\n\t\t}catch (NumberFormatException e) {\n\t\t\tSystem.err.print(\"\\nERROR : El numero \" + octal +\" no es octal\");\n\t\t}\n\t\treturn Integer.toBinaryString(numero.intValue());\n\t}", "public char[] decimalToBinary(int value) {\n\t\t// TODO: Implement this method.\n\t\treturn null;\n\t}", "public String decimalToBinary(int decimal){\n String binaryCode = \"\";\n \n if(decimal < 0) {\n binaryCode += \"1\";\n decimal = decimal * -1;\n }\n else binaryCode += \"0\";\n \n String binary = Integer.toBinaryString(decimal);\n if (binary.length() < 7) binaryCode = this.fillWithZeros(binaryCode, binary, 7);\n else binaryCode += binary;\n \n return binaryCode;\n }", "static String hexToBin(String s) {\n\t\treturn new BigInteger(s, 16).toString(2);\n\t}", "public static String\n bcdToString(byte[] data, int offset, int length) {\n StringBuilder ret = new StringBuilder(length*2);\n\n for (int i = offset ; i < offset + length ; i++) {\n int v;\n\n v = data[i] & 0xf;\n if (v > 9) break;\n ret.append((char)('0' + v));\n\n v = (data[i] >> 4) & 0xf;\n // Some PLMNs have 'f' as high nibble, ignore it\n if (v == 0xf) continue;\n if (v > 9) break;\n ret.append((char)('0' + v));\n }\n\n return ret.toString();\n }", "public static String BitStringToText(String s) {\n StringBuffer sb = new StringBuffer();\n int begIndex = 0;\n int endIndex = 8;\n for (int i = 0; i < s.length() / 8; i++) {\n String chunk = s.substring(begIndex, endIndex);\n int charCode = Integer.parseInt(chunk, 2);\n String y = new Character((char) charCode).toString();\n sb.append(y);\n begIndex += 8;\n endIndex += 8;\n }\n return sb.toString();\n }", "public String convertDecimalToBinary(int decimalNumber) {\n StringBuilder binaryInReverse = new StringBuilder();\n\n /* do the operation till the decimal number is greater than 0 */\n while (decimalNumber > 0) {\n /* divide the decimal number and get the remainder and append it to the binaryInReverse */\n binaryInReverse.append(decimalNumber % 2);\n /* after taking the remainder make the decimal number as decimalNumber / 2 for the next iteration */\n decimalNumber /= 2;\n }\n /* return the string representation of the reverse of binaryInReverse */\n return binaryInReverse.reverse().toString();\n }", "public String baseConversion(int num, int base) {\n\n if (base > 16 || base < 2)\n return null;\n\n StringBuilder sb = new StringBuilder();\n char[] hexaMapping = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\n\n int numPositive = (num < 0)? -num: num;\n while (numPositive > 0) {\n sb.append(hexaMapping[numPositive % base]);\n numPositive /=base;\n }\n\n return sb.append((num < 0)? \"-\" : \"\").reverse().toString();\n }", "private String toBinary( byte[] bytes )\n\t{\n \t\tStringBuilder sb = new StringBuilder(bytes.length * Byte.SIZE);\n\t\tfor( int i = 0; i < Byte.SIZE * bytes.length; i++ )\n\t\t\tsb.append((bytes[i / Byte.SIZE] << i % Byte.SIZE & 0x80) == 0 ? '0' : '1');\n\t\treturn sb.toString();\n\t}", "static String convert(String bits) {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tstringBuilder.append(String.valueOf(hexLookUp.charAt(Integer.parseInt(bits, 2))));\n\t\tString hex = stringBuilder.toString();\n\t\treturn hex;\n\t}", "public String convert(int num) {\n if (num == 0)\n return ZERO_STRINGS;\n\n long tmpNum = num;\n StringBuilder buffer = new StringBuilder();\n if (tmpNum < 0) { // Negative number\n tmpNum *= -1;\n buffer.append(\"minus \");\n }\n\n for (int i : NUMERIC_INDEXES) {\n long pow = (int)Math.pow(10, i);\n if (tmpNum >= pow) {\n long numberAtIndex = tmpNum/pow; // The number at position 3\n tmpNum -= numberAtIndex*pow;\n buffer.append(convert((int)numberAtIndex)).append(\" \");\n buffer.append(NUMERIC_STRINGS.get(pow)).append(\" \");\n }\n }\n if (tmpNum >= 20) { // second number in the integer\n long numberAtIndex = ((tmpNum % 100)/10)*10; // The number at position 2\n tmpNum -= numberAtIndex;\n buffer.append(NUMERIC_STRINGS.get(numberAtIndex)).append(\" \");\n }\n if (NUMERIC_STRINGS.containsKey(tmpNum))\n buffer.append(NUMERIC_STRINGS.get(tmpNum));\n return buffer.toString().trim();\n }", "private StringBuilder binConversion(StringBuilder input) {\n\t\tStringBuilder finalres = new StringBuilder();\n\t\tString currentVal = \"\";\n\t\tchar tempVal = ' ';\n\t\t\n\t\tfor(int i = 0; i < input.length(); i++)\n\t\t{\n\t\t\t\n\t\t\ttempVal = input.charAt(i);\n\t\t\t\n\t\t\tif(isOperator(input.charAt(i)) == false)\n\t\t\t{\n\t\t\t\tcurrentVal = currentVal + Character.toString(tempVal);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\t\t\n\t\t\t\tfinalres.append(val + Character.toString(tempVal));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// converting the last currentVal\n\t\t\n\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\n\t\tfinalres.append(val);\n\t\t\n\t\treturn finalres;\n\t}", "public static String convertDoubleToBinary1(double num) {\n if (num <= 0 || num >= 1) {\n throw new IllegalArgumentException();\n }\n \n StringBuilder sb = new StringBuilder();\n sb.append(\".\");\n while (Double.compare(num, 0) != 0) {\n if (sb.length() >= 32) {\n return ERROR_MESSAGE;\n }\n num *= 2;\n if (Double.compare(num, 1) >= 0) {\n sb.append(1);\n num = num - 1;\n } else {\n sb.append(0);\n }\n }\n return sb.toString();\n }", "public void encodeBinary(Buf out)\n {\n out.u2(val.length()+1);\n for (int i=0; i<val.length(); ++i)\n out.u1(val.charAt(i));\n out.u1(0);\n }", "byte toStringValue() {\n return (byte) String.valueOf(value).charAt(0);\n }", "public static String toBinaryString(long addr, boolean LP64) {\n\tif (LP64)\n\t return Long.toBinaryString(addr);\n\telse\n\t return Integer.toBinaryString((int) addr); \n }", "public static String byteArrayToBinaryString(byte[] array) {\n\t\tStringBuilder str = new StringBuilder();\n\t\tfor(byte b : array) {\n\t\t\tstr.append((\"00000000\"+Integer.toBinaryString(b)).substring(Integer.toBinaryString(b).length()));\n\t\t\tstr.append(\" \");\n\t\t}\n\t\treturn str.toString();\n\t}", "public static void main(String args[]){\nSystem.out.println(Integer.toOctalString(8)); \nSystem.out.println(Integer.toOctalString(19)); \nSystem.out.println(Integer.toOctalString(81)); \n}", "public static int decimalToBinary(int s){\n\t\tString result=\"\";\n\t\tif (s<=0){\n\t\t\treturn 0;\n\t\t}\n\t\tfor (int i = 2; s> 0; s/=2){\n\t\t\tresult=result + s%2; \n\t\t}\n\t\tString p1= \"\";\n\t\tfor (int i=0; i<result.length(); i++){\n\t\t\tString l=result.substring(i, i+1);\n\t\t\tp1=p1+l;\n\t\t}\n\t\t\n\t\treturn lib.Change.StringToInt(p1, -1);\n\t\n\t}", "public static String toHex(int num) {\n if(num==0) return \"0\";\n StringBuilder sb=new StringBuilder();\n while(num!=0){\n sb.append(intToHex(num&15));\n num >>>= 4; //Its not >> but >>>. >> will copy the sign bit. 10000 will become 11000 with >>, and 01000 with >>>.\n } //>> is called arithmetic shift. >>> is logical shift.\n return sb.reverse().toString();\n }", "private String intString(int n){\r\n String s=\"\";\r\n if(n>9){\r\n s+=(char)(Math.min(n/10,9)+'0');\r\n }\r\n s+=(char)(n%10+'0');\r\n return s; \r\n }", "public int decToBin(int input) {\r\n\t String Binary = Integer.toBinaryString(input);\t\r\n\t\treturn Integer.valueOf(Binary);\t\t\r\n\t}", "public static String asBinary( Grid grid ) {\n StringBuilder string = new StringBuilder();\n for ( int x = 0; x < grid.getRows(); x++ ) {\n for ( int y = 0; y < grid.getColumns(); y++ ) {\n Cell currentCell = grid.getCell( x, y );\n boolean[] currentCellWalls = currentCell.getWallsArray();\n if ( currentCell.isHighlighted() ) {\n string.append(\"0001\");\n } else {\n string.append(\"0000\");\n }\n if (currentCellWalls[0]) {\n string.append(\"1\");\n } else {\n string.append(\"0\");\n }\n if (currentCellWalls[1]) {\n string.append(\"1\");\n } else {\n string.append(\"0\");\n }\n if (currentCellWalls[2]) {\n string.append(\"1\");\n } else {\n string.append(\"0\");\n }\n if (currentCellWalls[3]) {\n string.append(\"1\");\n } else {\n string.append(\"0\");\n }\n }\n if ( x!=grid.getRows()-1 ) {\n string.append(\"\\n\");\n }\n }\n return string.toString();\n }", "private static String twoDigitString(long number) {\n if (number == 0) {\n return \"00\";\n }\n if (number / 10 == 0) {\n return \"0\" + number;\n }\n return String.valueOf(number);\n }", "public String toString()\n\t{\n\t\treturn Integer.toString(bitHolder.getValue());\n\t}", "@Test\n public void encodeAsStringNegative()\n {\n final int value = -5;\n final BinaryEncoder encoder = new BinaryEncoder(-8, 8, 1.0);\n final String result = encoder.encodeAsString(value);\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + result);\n }\n assertNotNull(result);\n assertEquals(\"0011\", result);\n }", "public static String bytesToPositiveNumString(byte[] in) {\n BigInteger num = new BigInteger(1, in);\n return num.toString();\n }", "public static String toString(int n, int base) {\n\t // special case\n\t if (n == 0) return \"0\";\n\n\t String digits = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\t String s = \"\";\n\t while (n > 0) {\n\t int d = n % base;\n\t s = digits.charAt(d) + s;\n\t n = n / base;\n\t }\n\t return s;\n\t }", "public static String intToString(int n) { \n\t if (n == 0) return \"0\";\n\t StringBuilder sb = new StringBuilder();\n\t while (n > 0) { \n\t int curr = n % 10;\n\t n = n/10;\n\t sb.append(curr);\n\t }\n\t String s = sb.substring(0);\n\t sb = new StringBuilder();\n\t for (int i = s.length() -1; i >= 0; i--) { \n\t sb.append(s.charAt(i));\n\t }\n\t return sb.substring(0);\n\t}", "public String covertIng(int num) {\n\t\tchar[] digits = new char[10];\r\n\t\t\r\n\t\tboolean sign = num >= 0 ? true : false;\r\n\t\tint idx = 0;\r\n\t\t\r\n\t\twhile(idx <digits.length){\r\n\t\t\tdigits[idx] = toChar(num % 10);\r\n\t\t\tnum = num /10;\r\n\t\t\tif(num== 0)\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tidx++;\r\n\t\t}\r\n\t\t\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tif(!sign)\r\n\t\t\tsb.append('-');\r\n\t\t\r\n\t\twhile(idx>=0){\r\n\t\t\tsb.append(digits[idx--]);\r\n\t\t}\r\n\t\t\r\n\t\treturn sb.toString();\r\n\t\t\r\n\t}", "public String formatAs32BitString(int i) {\r\n\t\tString retVal = Integer.toBinaryString(i);\r\n\t\tif(i >= 0) {\r\n\t\t\tretVal = \"00000000000000000000000000000000\" + retVal;\r\n\t\t\tretVal = retVal.substring(retVal.length()-32);\r\n\t\t}\r\n\t\treturn retVal;\r\n\t}", "public static int BinaryToNumber(String numberInput) {\r\n\r\n\t\t//Varibales are given values.\r\n\t\tdouble temp = 0, binary_number = 0;\r\n\t\tint j = numberInput.length();\r\n\t\tint i = 0;\r\n\t\t\r\n\t\t//Every Char is cycled through\r\n\t\twhile (i < numberInput.length()) {\r\n\t\t\tint z = Character.digit(numberInput.charAt(i), 10);\r\n\r\n\t\t\t//If there is a 1 it is translated into a base 10 value\r\n\t\t\tif (z == 1) {\r\n\t\t\t\ttemp = Math.pow(2, j - 1.0);\r\n\t\t\t\tbinary_number += temp;\r\n\t\t\t}\r\n\r\n\t\t\ti++;\r\n\t\t\tj--;\r\n\t\t}\r\n\t\t//the final base 10 value is passed into x and returned. \r\n\t\tint x = (int) binary_number;\r\n\t\treturn x;\r\n\t}", "public static String binaryToDec(String binary) {\n boolean isnegative = false;\n if (binary.startsWith(\"1\")) {\n isnegative = true;\n char[] c = binary.toCharArray();\n for (int i = 0; i < binary.length(); i++) {\n if (Character.getNumericValue(c[i]) == 0) {\n c[i] = '1';\n } else {\n c[i] = '0';\n }\n }\n\n boolean finded = false;\n for (int i = binary.length() - 1; i >= 0 && !finded; i--) {\n if (Character.getNumericValue(c[i]) == 0) {\n c[i] = '1';\n finded = true;\n } else {\n c[i] = '0';\n }\n }\n binary = String.valueOf(c);\n }\n String dec = \"\";\n if (binary.equals(\"10000000000000000000000000000000\")) {\n dec = Integer.toString(Integer.MIN_VALUE);\n isnegative = false;\n } else {\n dec = Integer.toString(Integer.parseInt(binary, 2));\n }\n\n if (isnegative) {\n dec = \"-\" + dec;\n }\n return dec;\n }", "private void toHex(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tStringBuilder tempsb = new StringBuilder(binary);\n\t\t\n\t\t\tfor (int i = 0;i<binary.length();i+=4){//maps each nibble to its binary value\n\t\t\t\tif (tempsb.substring(i,i+4).equals(\"0000\")) \n\t\t\t\t\tsb.append('0');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0001\"))\n\t\t\t\t\tsb.append('1');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0010\"))\n\t\t\t\t\tsb.append('2');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0011\"))\n\t\t\t\t\tsb.append('3');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0100\"))\n\t\t\t\t\tsb.append('4');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0101\"))\n\t\t\t\t\tsb.append('5');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0110\"))\n\t\t\t\t\tsb.append('6');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0111\"))\n\t\t\t\t\tsb.append('7');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1000\"))\n\t\t\t\t\tsb.append('8');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1001\"))\n\t\t\t\t\tsb.append('9');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1010\"))\n\t\t\t\t\tsb.append('A');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1011\"))\n\t\t\t\t\tsb.append('B');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1100\"))\n\t\t\t\t\tsb.append('C');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1101\"))\n\t\t\t\t\tsb.append('D');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1110\"))\n\t\t\t\t\tsb.append('E');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1111\"))\n\t\t\t\t\tsb.append('F');\n\t\t\t}\n\t\t\tsb.insert(0,\"0x\");\n\t\t\tbinary = sb.toString();\n\t}", "public String binToHex(String input) {\r\n int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn Integer.toString(decimal,16);\t\r\n\t}", "public void toStr()\r\n {\r\n numar = Integer.toString(read());\r\n while(numar.length() % 3 != 0){\r\n numar = \"0\" + numar; //Se completeaza cu zerouri pana numarul de cifre e multiplu de 3.\r\n }\r\n }", "public static int grayToBinary(int num) {\r\n\t\tint k = (INTEGER_SIZE >>> 1);\r\n\t\tint temp = num;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp ^= (temp >>> k);\r\n\t\t\tk >>>= 1;\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public static String convertToBase(int num, int base2) {\n\n\t\tString str = \"\";\n\t\tif (num == 0) return str;\n\n\t\tstr = convertToBase(num/base2, base2);\n\t\treturn str + (char)((num % base2 >= 10) ? 'A' + num % base2 - 10 : '0' + num % base2);\n\t}", "public String convertToString(int anInt)\n \t{\n \t\treturn Integer.toString(anInt); // return String version of the portnumber.\n \t}", "private static String convertDonnee(String donnee){\n byte[] tableau = convert.toBinaryFromString(donnee);\n StringBuilder sbDonnee = new StringBuilder();\n for (int i =0; i<tableau.length;i++){\n String too=Byte.toString(tableau[i]);\n sbDonnee.append(convert.decimalToBinary(Integer.parseInt(too)));\n }\n return sbDonnee.toString();\n }", "public static String toBinaryString0x(long addr, boolean LP64) {\n\tif (LP64)\n\t return \"0x\" +Long.toBinaryString(addr);//NOI18N\n\telse\n\t return \"0x\" +Integer.toBinaryString((int) addr); //NOI18N \n }", "@Test\n public void test2(){\n\n String s =\"1000000000000001\";\n //s = BinaryCalculate.BinaryArithmeticalRightShift(s,1);\n s = BinaryCalculate.BinaryLogicRightShift(s,1);\n int a = BitConversion.fromBinaryStringToInt(s);\n System.out.println(a);\n }", "private static String DoubleToBinaryString(double data){\n long longData = Double.doubleToLongBits(data);\n //A long is 64-bit\n return String.format(\"%64s\", Long.toBinaryString(longData)).replace(' ', '0');\n }", "public String intToString(String s) {\r\n int x = s.length();\r\n char[] bytes = new char[4];\r\n for(int i = 3; i > -1; --i) {\r\n bytes[3 - i] = (char) (x >> (i * 8) & 0xff);\r\n }\r\n return new String(bytes);\r\n }", "static void printBinary(String num, int precision) {\n int intPart = Integer.parseInt(num.split(\"\\\\.\")[0]);\n double decPart = Double.parseDouble(\".\" + num.split(\"\\\\.\")[1]);\n\n String intBinary = \"\";\n String decBinary = \"\";\n while (intPart > 0) {\n int rem = intPart % 2;\n intPart >>= 1;\n intBinary = rem + intBinary;\n }\n\n int len = 0;\n while (decPart > 0 && len != precision) {\n decPart *= 2;\n len++;\n if (decPart >= 1) {\n decBinary += 1;\n decPart -= 1;\n } else {\n decBinary += 0;\n }\n }\n\n System.out.println(intBinary + \".\" + decBinary);\n }", "public String conformBinaryLength(int data, int length){\n String binaryParameter = Integer.toBinaryString(data);\n binaryParameter = (StringUtils.repeat('0', length) + binaryParameter).substring(binaryParameter.length());\n return binaryParameter;\n }" ]
[ "0.7802226", "0.7450545", "0.7446078", "0.7406958", "0.73192567", "0.73171604", "0.7290068", "0.719327", "0.7021824", "0.69945544", "0.6992492", "0.69787306", "0.69599897", "0.6899302", "0.68580186", "0.68204033", "0.67938685", "0.678448", "0.6771252", "0.6719938", "0.6697145", "0.66060334", "0.65942854", "0.6588639", "0.65772873", "0.65642965", "0.6548539", "0.6542845", "0.6537959", "0.65210176", "0.65144086", "0.6490253", "0.6467648", "0.64285487", "0.64022595", "0.63701266", "0.63695055", "0.6329477", "0.6296548", "0.6292453", "0.62794846", "0.6258014", "0.6255048", "0.6245588", "0.6211846", "0.6184847", "0.6179852", "0.617377", "0.61706436", "0.6166134", "0.61590666", "0.61246085", "0.6106262", "0.609283", "0.608677", "0.6075943", "0.60700244", "0.6032408", "0.59872407", "0.59791416", "0.5972586", "0.5969918", "0.59663194", "0.59574986", "0.59284186", "0.59038335", "0.58937055", "0.5888581", "0.5888344", "0.58857566", "0.58814657", "0.58669996", "0.5864423", "0.5857665", "0.58503956", "0.5841217", "0.58399314", "0.5835768", "0.58154875", "0.5813844", "0.5812029", "0.5803403", "0.5795156", "0.57942873", "0.5772057", "0.57544124", "0.5751507", "0.57424265", "0.57213145", "0.5721198", "0.5721085", "0.57178193", "0.5714452", "0.5709849", "0.5700456", "0.56993777", "0.56880254", "0.56770146", "0.56742495", "0.5667642" ]
0.57259727
88
shifts all digits in a binary number to the right by the given amount, replacing each shift with 0
public BinaryNumber shiftR(int amount) { int[] data1 = new int[amount+data.length]; for (int i = 0; i < amount; i++) { data1[i] = 0; } for (int i = 0; i <data.length; i++) { data1[amount] = data[i]; amount++; } data = data1; String s = new String(); for (int i = 0; i < data.length; i++) { s = s.concat(Integer.toString(data[i])); } return new BinaryNumber(s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void shiftRight(int numberToShift);", "void shiftR(int amount) {\n\t\tint newlength = data.length + amount;\n\t\tint newdata[] = Arrays.copyOf(data, newlength);\n\t\tfor(int i = newdata.length - 1;i >= amount;i--) {\n\t\t\tnewdata[i] = data[i - amount];\n\t\t}\n\t\tfor(int i = 0;i < amount;i++) {\n\t\t\tnewdata[i] = 0;\n\t\t\t\n\t\t}\n\t\tString str = \"\";\n\t\tfor(int i = 0 ;i < newlength;i++) {\n\t\t\tstr = str + newdata[i];\n\t\t}\n\t\tSystem.out.println(\"the result of shifting:\" + str);\n\t}", "static void primitiveRightShift(int[] a, int len, int n) {\n int n2 = 32 - n;\n for (int i=len-1, c=a[i]; i > 0; i--) {\n int b = c;\n c = a[i-1];\n a[i] = (c << n2) | (b >>> n);\n }\n a[0] >>>= n;\n }", "void shiftLeft(int numberToShift);", "@Test\n public void test2(){\n\n String s =\"1000000000000001\";\n //s = BinaryCalculate.BinaryArithmeticalRightShift(s,1);\n s = BinaryCalculate.BinaryLogicRightShift(s,1);\n int a = BitConversion.fromBinaryStringToInt(s);\n System.out.println(a);\n }", "static long flippingBits(long n) {\n\n String strBinary = String.format(\"%32s\", Long.toBinaryString(n)).replace(' ', '0');\n String strBinaryFlip = \"\";\n\n for (int i = 0; i < strBinary.length(); i++) {\n if (strBinary.charAt(i) == '0') {\n strBinaryFlip = strBinaryFlip + '1';\n } else {\n strBinaryFlip = strBinaryFlip + '0';\n }\n }\n\n String result = String.format(\"%32s\", strBinaryFlip).replace(' ', '0');\n long base10 = parseLong(result,2);\n return base10;\n }", "public void bitShift(int direction, int amount) {\n\t\tif(Math.abs(direction)!= 1) {\n\t\t\tSystem.out.println(\"how dare you. postivie or negative one dingus.\");\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\t\t\n\t\tif(direction == 1) {\n\t\t\tint data2[] = new int[(this.data.length) + amount];\n\t\t\tfor (int i = 0; i < data.length;i++) {\n\t\t\t\tdata2[i] = data[i];\n\t\t\t}\n\t\t\tdata = data2.clone();\n\t\t}\n\t\telse {\n\t\t\tif(amount > data.length) {\n\t\t\t\tSystem.out.println(\"aight thats too much m8. There's only so much in the list\");\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\t\t\tint data2[] = new int[(this.data.length) - amount];\n\t\t\tfor (int i = 0; i < data2.length;i++) {\n\t\t\t\tdata2[i] = data[i];\n\t\t\t}\n\t\tdata = data2.clone();\n\t\t}\n\t}", "public static int flipBit(int value, int bitIndex) {\n\n// value = value ^ (1<<(bitIndex-1));\n\n return value ^ (1<<(bitIndex-1)); // put your implementation here\n }", "private static void testShift() {\n for (int a:new int[]{96754441, -206107026, 803362655, Integer.MIN_VALUE+1}) {\n System.out.println(\"<<\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a<<i) + \" \" + (a<<i));\n }\n System.out.println();\n System.out.println(\">>\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a>>i) + \" \" + (a>>i));\n }\n System.out.println();\n System.out.println(\">>>\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a>>>i) + \" \" + (a>>>i));\n }\n System.out.println();\n }\n }", "public static void shifter() {\n\t\t\n\t\tint preshift = 0xFF;\n\t\tint postshift = preshift >> 1;\n\t\t\n\t\tint[] nums = {preshift, postshift};\n\t\t\n\t\tfor (int i: nums) {\n\t\t\t\n\t\t\tSystem.out.println(\"Decimal Representation:\\t\\t\" + i);\n\t\t\tSystem.out.println(\"Hexadecimal Representation:\\t0x\" + Integer.toHexString(i).toUpperCase());\n\t\t\tSystem.out.println(\"Binary Representation:\\t\\t\" + Integer.toBinaryString(i) + \" (length: \" + Integer.toBinaryString(i).length() + \" bits, \" + Integer.toBinaryString(i).length() / 8 + \" bytes)\");\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t}\n\t\t\n\t}", "void shiftAndAddToRight(BitField fieldToAddToTheRight);", "public static int clearBitsUpToLS(int n, int i) {\n return n & ~(-1>>(31-i));\n }", "public static void shift(){\n int[] x= {1, 5, 10, 7, -2};\n \n for (int i =0; i<x.length-1; i++){\n x[i]=x[i+1];\n }\n x[x.length-1]=0;\n for (int j=0; j<x.length; j++){\n System.out.println(x[j]);\n }\n\n\n\n }", "public abstract void shift(int param);", "private static int shiftLeftOneInPlace(int[] x, int carry)\n {\n int pos = x.length;\n while (--pos >= 0)\n {\n int val = x[pos];\n x[pos] = (val << 1) | carry;\n carry = val >>> 31;\n }\n return carry;\n }", "@Override\n public BitvectorFormula shiftRight(\n BitvectorFormula pNumber, BitvectorFormula toShift, boolean signed) {\n TFormulaInfo param1 = extractInfo(pNumber);\n TFormulaInfo param2 = extractInfo(toShift);\n\n return wrap(shiftRight(param1, param2, signed));\n }", "public static int reverseBits(int n) {\n String binary = Integer.toBinaryString(n);\n while (binary.length() < 32) {\n binary = \"0\" + binary;\n }\n\n String reverse = \"\";\n for (int i = binary.length() - 1; i >= 0; i--) {\n reverse += binary.charAt(i);\n }\n\n return (int) Long.parseLong(reverse, 2);\n }", "public static void main(String[] args) {\n\r\n int num = 1234;\r\n\r\n int rev = 0;\r\n\r\n\r\n while (num != 0) {\r\n int sum = num % 10; // 4\r\n rev = rev * 10 + sum;\r\n num = num / 10; // 123\r\n\r\n }\r\n System.out.println(\"Reverse \"+rev);\r\n }", "public int reverseBits(int n) {\n /*\n StringBuilder ans = new StringBuilder();\n for(int i=0; i<32; i++)\n {\n int temp = n&1;\n ans.append(temp);\n n = n>>>1;\n }\n return Integer.parseInt(ans.toString(), 2);\n */\n \n int result = 0;\n for(int i=0; i<32; i++){\n result <<= 1;\n result += n&1;\n n >>>= 1;\n }\n \n return result;\n \n }", "public static int flipBits(int a) {\n if(~a == 0)\n return Integer.SIZE;\n int maxlen=0, currlen=0, prevlen=0;\n\n while(a != 0) {\n if((a&1) == 1) {\n currlen++;\n } else if((a&1) == 0) {\n prevlen = (a&2) == 0 ? 0 : currlen;\n currlen=0;\n }\n maxlen = Math.max(currlen + prevlen + 1, maxlen);\n a >>>= 1;\n }\n return maxlen;\n }", "private int[] intToBinaryReverse(int rule) {\n\n int[] binary = new int[8];\n\n // int[] from int\n for (int i = 0, num = rule; i <= 7; i++, num >>>= 1) {\n binary[i] = num & 1;\n }\n\n return binary;\n }", "public int reverseBits(int n) {\n return Integer.reverse(n);\n }", "public int reverseBits6(int n) {\n return Integer.reverse(n); \n }", "public int reverseBits(int n) {\n \n if(n == 0){\n return 0;\n }\n \n int result = 0;\n \n for(int i=0;i<32;i++){\n \n result = result + (n & 1);// take the last bit from n and also add to result,note:for result we already added a dummy zero at the last so as to perform an add operation\n \n n = n >> 1;// now shift right 1 bit for the next iteration\n \n if(i<31){// need to shift only 31 because we need add a left dummy zero for the last bit\n \n result = (result << 1);// move to the right and add a zero at last so that in next iteration we can add a bit to that last place\n }\n \n \n }\n return result; \n }", "private static int xorShift(int r) {\n r ^= r << 1;\n r ^= r >>> 3;\n r ^= r << 10;\n return r;\n }", "private static void shiftRightInPlace(int start, int[] mag, int n)\n {\n int nInts = (n >>> 5) + start;\n int nBits = n & 0x1f;\n int magEnd = mag.length - 1;\n\n if (nInts != start)\n {\n int delta = (nInts - start);\n\n for (int i = magEnd; i >= nInts; i--)\n {\n mag[i] = mag[i - delta];\n }\n for (int i = nInts - 1; i >= start; i--)\n {\n mag[i] = 0;\n }\n }\n\n if (nBits != 0)\n {\n int nBits2 = 32 - nBits;\n int m = mag[magEnd];\n\n for (int i = magEnd; i >= nInts + 1; i--)\n {\n int next = mag[i - 1];\n\n mag[i] = (m >>> nBits) | (next << nBits2);\n m = next;\n }\n\n mag[nInts] >>>= nBits;\n }\n }", "private static int getRightShiftedNumberBufAsInt(int numberBuf,\n long bitPos, int nrBits, ByteOrder byteOrder) throws BitBufferException {\n\n // number of bits integer buffer needs to be shifted to the right in\n // order to reach the last bit in last byte\n long shiftBits;\n if (byteOrder == ByteOrder.BigEndian)\n shiftBits = 7 - ((nrBits + bitPos + 7) % 8);\n else\n shiftBits = bitPos % 8;\n\n return numberBuf >> shiftBits;\n }", "public int reverseBits(int n) {\n\n return 1;\n }", "@Override\n\tpublic void visit(BitwiseRightShift arg0) {\n\t\t\n\t}", "public String rightShift(String input, int n) {\n if (input.length() <= 1) {\n return input;\n }\n \n int len = input.length();\n n = n % len;\n \n char[] ch = input.toCharArray();\n char[] ans = new char[len];\n \n for (int i=0; i<ch.length; i++) {\n int idx = i + n;\n if (idx >= len) {\n idx -= len;\n }\n \n ans[idx] = ch[i];\n }\n \n return String.valueOf(ans);\n }", "public void flip(int bitIndex);", "static int clearMSBtoI(int num, int pos) {\n\t\t\tint mask = (1<<pos) - 1;\n\t\t\treturn num & mask;\n\t\t}", "public int reverseBits(int n) {\n int rev = 0;\n for(int i = 0; i<32; i++){\n rev = rev << 1;//creating a space of 1 in reverse\n rev = rev | (n & 1);// (n & 1 will give the last bit)\n // | operator will help in entering the last bit into rev\n n = n >> 1;// delete the last bit\n } \n return rev;\n }", "public int reverseBits(int n) {\n // 001011 -> 110100\n // get bits from right to left\n // use & and mask 1 to keep the right most bit\n // 001001 & 000001 -> 000001\n \n // unsigned integer has 32 bits \n int res = 0;\n for (int i = 0; i < 32; i++) {\n // must shift res first otherwise we will lose the first bit\n res <<= 1;\n res = res + (n & 1);\n n >>= 1;\n }\n \n return res;\n }", "public static void main(String[] args) {\n\t\tint x = ~0;\r\n\t\tSystem.out.println(Integer.toBinaryString(x));\r\n\t\tint y = x>>>8;\r\n\t\tSystem.out.println(Integer.toBinaryString(y));\r\n\t\tSystem.out.println(x+\" \"+y);\r\n\t\t\r\n\t\tint N = 1<<31;\r\n\t\tint M = 0b11;\r\n\t\tint j=2;\r\n\t\tint i=1;\r\n\t\tSystem.out.println(Integer.toBinaryString(N));\r\n\t\tSystem.out.println(Integer.toBinaryString(M));\r\n\t\tSystem.out.println(Integer.toBinaryString(insertMIntoNFromJtoI(M, N, j, i)));\r\n\t\t\r\n\t}", "public int reverseBits(int n) {\n int ans = 0;\n for(int i = 0; i < 32; i++){\n ans <<= 1;\n ans += n&1;\n n >>= 1;\n }\n return ans;\n }", "public void removeByRightShift(int pos){\n int nshift=pos+1;\n int from=(start+pos-1)%cir.length;\n int to=(from+1)%cir.length;\n for(int i=0;i<nshift;i++){\n cir[to]=cir[from];\n to=from;\n from--;\n if(from==-1){from=cir.length-1;}\n }\n start++;\n size--;\n }", "public int reverseBits(int n) {\n int answer = 0;\n for(int i =0;i<31;i++){\n answer |= (n&1);\n answer = answer<<1;\n n = n>>1;\n }\n answer |= (n&1);\n return answer;\n }", "public static void main(String[] args) {\n int a = 0b10011;\n int res = Integer.rotateRight( a,2 );\n System.out.println(toBinaryString( a ) + \" RCIRC-2 ->\" + toBinaryString( res ) );\n System.out.println(toBinaryString( a ) + \" RCIRC-2 ->\" + toBinaryString( RCIRC( a,2 ) ) );\n\n //LCIRC-3(01101) = 01011\n //01000 <<3\n // 011 >>>2\n //01011 OR\n a = 0b01101;\n System.out.println(toBinaryString( a ) + \" LCIRC-3 ->\" + toBinaryString( LCIRC( a,3 ) ));\n\n\n String e1 = \"LSHIFT-2(10011 XOR 00110) OR (LCIRC-2(RCIRC-2(10001)))\";\n int res1 = ((0b10011 ^ 0b00110)>>>2) | LCIRC( RCIRC(0b10001 ,2 ), 2);\n System.out.println(e1 + \" = \" + toBinaryString( res1 ) + \", manual = 10101\");\n\n String e2 = \"( (RSHIFT-3(01000) XOR NOT(00110) ) AND (01101 OR RCIRC-2(10011))\";\n int res2 = ((0b01000>>>3) ^ (~0b00110)) & (0b01101 | RCIRC(0b10011, 2 ));\n\n System.out.println(e2 + \" = \" + toBinaryString( res2 ) + \", manual = ?????\");\n\n\n System.out.println(\"X AND 11010 = 01000, find all X\");\n for (byte i = 0; i <= 0b11111; i++) {\n if ((i & 0b11010)== 0b01000) {\n System.out.println(toBinaryString( i ));\n }\n }\n }", "static void primitiveLeftShift(int[] a, int len, int n) {\n if (len == 0 || n == 0)\n return;\n\n int n2 = 32 - n;\n for (int i=0, c=a[i], m=i+len-1; i < m; i++) {\n int b = c;\n c = a[i+1];\n a[i] = (b << n) | (c >>> n2);\n }\n a[len-1] <<= n;\n }", "public int reverseBits(int n) {\n int x = 0;\n for(int i=0;i<32;i++){\n x = x<<1 | (n&1);\n n=n>>1;\n }\n return x;\n }", "public static int reverseBits(int n) {\n\n int res = 0;\n for (int i = 1; i <= 32; i++){\n //结果往左移一位,来空出以为放原数字的最后一位。此时res最后一位为0\n res <<= 1;\n //n&1得到n二进制位的最后一位,通过与res最后一位0进行或运算,放入到res中\n res |= n&1;\n //n向右移动一位,即丢弃已经存入res中的二进制位\n n >>= 1;\n }\n return res;\n }", "public static void swapNibbles(String binary) {\n\n if (binary.length() < 8) {\n while (binary.length() < 8) {\n binary = \"0\" + binary;\n }\n }\n System.out.println(\"Before Swapping Nibbles:\" + binary);\n char arr[] = binary.toCharArray();\n for (int i = 0; i < 4; i++) {\n char ch = arr[i];\n arr[i] = arr[i + 4];\n arr[i + 4] = ch;\n }\n binary = String.valueOf(arr);\n System.out.println(\"After Swapping Nibbles:\" + binary);\n int c = Integer.parseInt(binary);\n int decimal = 0;\n int power = 0;\n // to convert binary to decimal\n while (true) {\n if (c == 0) {\n break;\n } else {\n int tmp = c % 10;\n decimal += tmp * Math.pow(2, power);\n c = c / 10;\n power++;\n }\n }\n System.out.println(\"Number after Swapping Nibbles: \" + decimal);\n }", "private int shift(int x) {\n\tif (x >= upperBound) \n\t return (x%upperBound); \n\telse if (x < 0)\n\t return ((-x)%upperBound);\n\telse\n\t return x; \n }", "public String rightShift(String input, int n) {\n\t\t// Write your solution here.\n\t\tif (input == null || input.length() == 0)\n\t\t\treturn input;\n\t\tchar[] arr = input.toCharArray();\n\t\tint len = input.length();\n\t\t// len - 1 - n + 1 = len - n\n\t\tif (n >= len) {\n\t\t\treturn rightShift(input, n % len);\n\t\t}\n\t\treverse(arr, 0, len - n - 1);\n\t\treverse(arr, len - n, len - 1);\n\t\treverse(arr, 0, len - 1);\n\t\treturn new String(arr);\n\t}", "public static void main(String[] args) {\n // System.out.println(carry);\n // System.out.println(carry <<= 1);\n // System.out.println(carry >>= 1);\n int[] digits = {1,2,3};\n digits = new int[digits.length + 1];\n digits[0] = 1;\n System.out.println(digits[0]);\n System.out.println(digits[1]);\n System.out.println(digits[2]);\n System.out.println(digits[3]);\n\n }", "private static void shiftRightOneInPlace(int start, int[] mag)\n {\n int magEnd = mag.length - 1;\n\n int m = mag[magEnd];\n\n for (int i = magEnd; i > start; i--)\n {\n int next = mag[i - 1];\n\n mag[i] = (m >>> 1) | (next << 31);\n m = next;\n }\n\n mag[start] >>>= 1;\n }", "public static void main(String[] args) {\n\t\tint a = 103217;\n\t\tSystem.out.println(AssortedMethods.toFullBinaryString(a));\n\t\tint b = 13;\n\t\tSystem.out.println(AssortedMethods.toFullBinaryString(b));\t\t\n\t\tint c = updateBits(a, b, 4, 12);\n\t\tSystem.out.println(AssortedMethods.toFullBinaryString(c));\n\t\t\t\n\t}", "private int[] shiftRight(int start, int[] mag, int n)\n {\n int nInts = (n >>> 5) + start;\n int nBits = n & 0x1f;\n int magLen = mag.length;\n\n if (nInts != start)\n {\n int delta = (nInts - start);\n\n for (int i = magLen - 1; i >= nInts; i--)\n {\n mag[i] = mag[i - delta];\n }\n for (int i = nInts - 1; i >= start; i--)\n {\n mag[i] = 0;\n }\n }\n\n if (nBits != 0)\n {\n int nBits2 = 32 - nBits;\n int m = mag[magLen - 1];\n\n for (int i = magLen - 1; i >= nInts + 1; i--)\n {\n int next = mag[i - 1];\n\n mag[i] = (m >>> nBits) | (next << nBits2);\n m = next;\n }\n\n mag[nInts] >>>= nBits;\n }\n\n return mag;\n }", "private int[] shiftRightOne(int start, int[] mag)\n {\n int magLen = mag.length;\n\n int m = mag[magLen - 1];\n\n for (int i = magLen - 1; i >= start + 1; i--)\n {\n int next = mag[i - 1];\n\n mag[i] = (m >>> 1) | (next << 31);\n m = next;\n }\n\n mag[start] >>>= 1;\n\n return mag;\n }", "public static int reverseBitsNaive(int A){\n\t\tint revA = Integer.MAX_VALUE;\n\t\tint count = 32;\n\t\twhile(A != 0){\n\t\t\trevA = (revA << 1) | (A & 1);\n\t\t\tA = A >> 1;\n\t\t\tcount--;\n\t\t}\n\t\treturn revA<<count;\n\t}", "public static long propagateSignBit(long value, int bitsToPad)\n {\n return value << bitsToPad >> bitsToPad;\n }", "public static void main(String[] args) {\nint number=987654,reverse=0;\nwhile(number!=0)\n{\nint remainder=number%10;\nreverse=reverse*10+remainder;\nnumber=number/10;\n}\nSystem.out.println(\"The reverse of given number is\" + reverse);\n\t}", "public void removeByRightShift(int pos) {\r\n if (pos > 0 || pos < size - 1) {\r\n int nshift = pos;\r\n int from = ((start + pos) - 1) % cir.length;\r\n int to = (from + 1) % cir.length;\r\n // int to=from--;\r\n for (int i = 0; i < nshift; i++) {\r\n cir[to % cir.length] = cir[from % cir.length];\r\n to = from;\r\n from--;\r\n if (from < 0) {\r\n from = cir.length - 1;\r\n }\r\n }\r\n cir[start] = \"null\";\r\n start++;\r\n size--;\r\n }\r\n }", "public static short rotateRight(short value) {\n \tshort returnVal = (short) (Integer.rotateRight(value, rotateVal));\n \t//checkCarry------------------------------------------------\n \treturn returnVal;\n }", "public int reverseBits(int n) {\n int a=0;\n for(int i=0;i<=31;i++){\n a=a+((1&(n>>i))<<(31-i));\n }\n return a;\n }", "private void shift(int shift)\n\t{\n\t\tthis.shiftAmount = shift;\n\t}", "static int toggleBit(int n){\n return n & (n-1);\n }", "public int reverseBits(int n) {\n int res = 0;\n for (int i = 0; i < 32; i++){\n res = (res << 1) | (n & 1);\n n = (n >> 1);\n }\n\n return res;\n\n }", "int getNibble(int num, int which)\n {\n return 0b1111 & num >> (which << 2);\n }", "public int reverseBits2(int n) {\n int x=0;\n for(int i=0;i<32;i++)\n x=x<<1 | (n>>i)&1;\n return x;\n }", "public String shiftRight(String text, int x) {\n\t\t\n\t\tString toShift = text.substring(0, x);\n\t\tString newCipher = text += toShift;\n\t\tString result = newCipher.substring(toShift.length(), newCipher.length());\n\t\t\n\t\treturn result;\n\t\t\n\t}", "public HugeUInt shiftRight(int positions) {\r\n HugeUInt result = new HugeUInt(this);\r\n if(positions==0) return result;\r\n for (int i = 0; i < getSize(); i++) {\r\n if(i+positions>=getSize()){\r\n \tresult.array[i] = 0;\r\n }\r\n else result.array[i] = array[i+positions];\r\n }\r\n result.trim();\r\n return result;\r\n }", "public void reverseNumber() {\n\t\tint number = 123456789;\n\t\tint rev = 0;\n\t\twhile (number != 0) {\n\t\t\trev = rev * 10 + number % 10;\n\t\t\tnumber = number / 10;\n\t\t}\n\t\tSystem.out.println(rev);\n\t}", "public void resetZero() {\n\t\tset((byte) (get() & ~(1 << 7)));\n\t}", "private int setNibble(int num, int data, int which, int bitsToReplace) {\n return (num & ~(bitsToReplace << (which * 4)) | (data << (which * 4)));\n }", "static void moveZerosToEnd(int[] arr) {\n // Write your code here\n int n = arr.length;\n int count=0;\n for (int i = 0; i < n; i++)\n if (arr[i] != 0)\n arr[count++] = arr[i];\n while (count < n)\n arr[count++] = 0;\n }", "public static int cleanBitsIthrough0(int num, int i) {\n int mask = (-1 << (i + 1));\n return num & mask;\n }", "private void _setUnshifted ()\r\n {\r\n m_bBase64mode = false;\r\n m_nBitsRead = 0;\r\n m_nTempChar = 0;\r\n }", "static int isolateBit(int n){\n return n & (-n);\n }", "public int step() {\n int lastBit = bitAt(0) ^ bitAt(currentIndex);\n char[] ch = lfsr1.toCharArray();\n for (int i = 0; i < lfsr1.length() - 2; i++) {\n ch[i] = ch[i + 1];\n }\n\n ch[lfsr1.length() - 2] = (char) (lastBit + '0');\n int temporary = lfsr1.length();\n lfsr1 = \"\";\n for (int i = 0; i < temporary; i++) {\n lfsr1 = lfsr1 + ch[i];\n }\n\n return lastBit;\n }", "public static String rightShift(String input, int n) {\n\t\t//how: 1. corner case\n\t\tif (input == null || input.length() <= 1) {\n\t\t\treturn input;\n\t\t}\n\t\tchar[] array = input.toCharArray();\n\t\tn = n % array.length;\n\t\t//2.1 reverse the left part\n\t\treverse(array, 0, array.length - 1 - n);\n\t\t//2.2 reverse the right part\n\t\treverse(array, array.length - n, array.length - 1);\n\t\t//2.3 reverse all;\n\t\treverse(array, 0, array.length - 1);\n\t\treturn new String(array);\n\t}", "public int reverseBits(int n) {\n int result = 0;\n for (int i = 0; i < 32; i++) {\n if ((n & 1) == 1) {\n result = (result << 1) + 1;\n } else {\n result <<= 1;\n }\n n >>= 1;\n }\n return result;\n }", "public void moveShiftRight();", "public int reverse(int x) {\n int r = 0;\n while(x != 0) {\n r = r*10 + x%10;\n x = x/10;\n }\n return r;\n }", "public int reverseBits(int n) {\n int r=0;\n for(int i=0;i<32;i++){\n \tr|=((n>>i)&1)<<(31-i);\n }\n return r;\n }", "public static int clearBitsUpToMS(int n, int i) {\n return n & (1<<i)-1;\n }", "public int reverseBits(int n) {\n int mask = 1;\n int result = 0;\n for (int i = 0; i < 32; i++) {\n result = result << 1;\n if ((n & mask) != 0) {\n result++;\n }\n mask = mask << 1;\n }\n return result;\n }", "private String padZeros(String binary, int size) {\n String outString = binary;\n for (int i = 0; i < size - binary.length(); i++) {\n outString = \"0\" + outString;\n }\n return outString;\n }", "public static int updateBits(int n, int m, int i, int j) {\n\t\tint allOnes = ~0;\r\n\t\tSystem.out.println(\"allOnes: \" +AssortedMethods.toFullBinaryString( allOnes));\r\n\t\t//shift left allOnes j+1 times make all ones from j+1 to the end\r\n\t\t// if the time shift equals 32 result will be 32 bits 0s;\r\n\t\tint left = j < 31 ? allOnes << (j + 1) : 0;\r\n\t\tSystem.out.println(\"left: \" + AssortedMethods.toFullBinaryString(left));\r\n\t\t// shift 1 i times left make 1000000000, then minus 1 make first bit to i-1 bit to be 1111111;\r\n\t\tint right = ((1 << i) - 1);\r\n\t\tSystem.out.println(\"right: \" + AssortedMethods.toFullBinaryString(right));\r\n\t\t// combine left and right to be 1111110000000111111111\r\n\t\tint mask = left | right;\r\n\t\tSystem.out.println(\"mask: \" + AssortedMethods.toFullBinaryString(mask));\r\n\t\t// make int n from i to j to be 0s by and then together to make the mask\r\n\t\tint nWith0s = n & mask;\r\n\t\tSystem.out.println(\"nWith0s: \" + AssortedMethods.toFullBinaryString(nWith0s));\t\r\n\t\t// left shift m j times to make it match with the j to i empty position\r\n\t\tint mShifted = m << i;\r\n\t\tSystem.out.println(\"mShifted: \" + AssortedMethods.toFullBinaryString(mShifted));\r\n\t\t// insert m into n by or them together\r\n\t\treturn mShifted | nWith0s;\r\n\t}", "public int reverseBits5(int n) {\n long x = 0;\n for(int i=0;i<32;i++){\n x+= Math.pow(2,31-i)*(n>>i&1);\n }\n return (int)x;\n }", "public TribitByte shiftRight(int shift){\n if(shift == 0){\n return this;\n } else if(shift < 0){\n TribitByte zeroes = TribitByte.value(0x0);\n if(LENGTH + shift > 0) {\n System.arraycopy(this.value, 0, zeroes.value, -shift, LENGTH + shift);\n }\n return zeroes;\n } else {\n TribitByte zeroes = TribitByte.value(0x0);\n if(LENGTH - shift > 0) {\n System.arraycopy(this.value, shift, zeroes.value, 0, LENGTH - shift);\n }\n return zeroes;\n }\n }", "public static int swap(int nValue)\n\t{\n\t\treturn ((nValue << 24)\n\t\t + (nValue << 8 & 0x00FF0000)\n\t\t + (nValue >>> 8 & 0x0000FF00)\n\t\t + (nValue >>> 24));\n\t}", "public int reverseBits(int n) {\n long res = 0;\n int index = 31;\n \n while (n != 0) {\n res += Math.pow(2, index) * (n & 1);\n n = n >>> 1;\n index--;\n }\n \n return (int)res;\n }", "private static int xorShift(int r) {\n r ^= (r << 13);\n r ^= (r >>> 17);\n return r ^ (r << 5);\n }", "public int reverse(int x) {\n int result=0;\n int temp=x;\n while(temp!=0){\n \tint r=temp%10;\n \ttemp/=10;\n \tresult=result*10+r;\n }\n return result;\n }", "public int reverseBits(int n) {\n int i = 0;\n int tmp = 0;\n while(i<32){\n tmp <<= 1;//tmp左移,为新来元素空出位置,注意tmp刚开始为0,远远到不了32位,所以不存在溢出的情况\n tmp |= (n & 1);//将n的最低位添加到tmp,这里n&1,表示n除了最后一位表示正确值,其他位都被置为0;和tmp 与 操作\n n >>= 1;//n右移 去掉刚刚处理的最低位\n i++;\n }\n return tmp;\n }", "public void shiftLeft(int[] nums, int zeroIndex)\n {\n // shift everything 1 to the left\n for ( int i = zeroIndex; i < nums.length - 1; i++)\n {\n nums[i] = nums[i+1];\n }\n \n // put zero at last\n nums[nums.length-1] = 0;\n }", "public void binToDec(){\n\t\tthis.inputBin();\n\t\tif(checkValue()==true){\n\t\t\tthis.toDec();\n\t\t\tthis.outDec();\n\t\t}\n\t}", "protected final byte operationROR(final byte data) {\r\n int data_ = data & 0xff;\r\n\r\n if (this.carryFlag) {\r\n data_ |= 0x100;\r\n }\r\n this.carryFlag = (data_ & 0x01) != 0;\r\n data_ >>= 1;\r\n this.zeroFlag = data_ == 0;\r\n this.signFlag = data_ >= 0x80;\r\n\r\n return (byte)data_;\r\n }", "private StringBuilder binConversion(StringBuilder input) {\n\t\tStringBuilder finalres = new StringBuilder();\n\t\tString currentVal = \"\";\n\t\tchar tempVal = ' ';\n\t\t\n\t\tfor(int i = 0; i < input.length(); i++)\n\t\t{\n\t\t\t\n\t\t\ttempVal = input.charAt(i);\n\t\t\t\n\t\t\tif(isOperator(input.charAt(i)) == false)\n\t\t\t{\n\t\t\t\tcurrentVal = currentVal + Character.toString(tempVal);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\t\t\n\t\t\t\tfinalres.append(val + Character.toString(tempVal));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// converting the last currentVal\n\t\t\n\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\n\t\tfinalres.append(val);\n\t\t\n\t\treturn finalres;\n\t}", "public static void main(String[] args) {\n\t\tint num = 0B00000101;\t//5의 8비트 2진수\n\t\t\n\t\tSystem.out.println(num<<2);\t//왼쪽으로 2비트 이동 00010100(20)\n\t\tSystem.out.println(num>>2);\t//오른쪽으로 2비트 이동00000001(1)\n\t\tSystem.out.println(num>>>2);\t//오른쪽으로 2비트 이동00000001(1)\n\t\t\n\t\tSystem.out.println(num);\t//num에 아무 값도 대입하지 않았으므로 5 출력\n\t\tnum<<=2;\t//2비트 이동한 값을 num에 대입\n\t\tSystem.out.println(num);\n\t}", "@Override\n\tpublic Procedure3<java.lang.Integer, UnsignedInt6Member, UnsignedInt6Member> bitShiftRight() {\n\t\treturn SHRZ;\n\t}", "public static BinaryExpression leftShift(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public static String toBinary(int number)\n\t{\n\t\tString total = \"\";\n\t\tint a;\n\t\twhile (number > 0) {\n\n\t\t\ta = number % 2;\n\n\t\t\ttotal = total + \"\" + a;\n// divide number by 2 \n\t\t\tnumber = number / 2;\n\n\t\t\t}\n\n// return value \n\t\treturn (new StringBuilder(total)).reverse().toString();\n\t\t\n\t}", "public static int reverse(int x) {\r\n \tSystem.out.println(1<<31);\r\n// \tif(x < 1>>31 || x > (1<<31 - 1) || x == 0)\r\n// \t\treturn 0;\r\n \tif(x > 0){\r\n \t\tString str = String.valueOf(x);\r\n \t\tStringBuilder sb = new StringBuilder(str);\r\n \t\tint result = Integer.valueOf(sb.reverse().toString());\r\n \t\tSystem.out.println(result);\r\n \t\treturn result;\r\n \t}\r\n \tif(x < 0){\r\n \t\tint y = Math.abs(x);\r\n \t\tString str = String.valueOf(y);\r\n \t\tStringBuilder sb = new StringBuilder(str);\r\n \t\tint result = Integer.valueOf(sb.reverse().toString());\r\n \t\tSystem.out.println(0 - result);\r\n \t\treturn 0 - result;\r\n \t}\r\n \treturn x;\r\n }", "static StringBuilder xOrBits(StringBuilder original) {\n\n\t\tfor (int k = 0; k < CRCPOLY.length(); k++) {\n\t\t\tif (original.charAt(k) == CRCPOLY.charAt(k)) {\n\t\t\t\toriginal.replace(k, k + 1, \"0\");\n\t\t\t} else\n\t\t\t\toriginal.replace(k, k + 1, \"1\");\n\t\t}\n\n\t\treturn original;\n\t}", "@Test\n\tpublic void testReverseBits1() {\n\t sut.reverseBits(65536);\n\t\t// ASSERT.that(sut.addBinary(i1, i2)).is(o);\n\t}", "public int reverse(int id)\n {\n int result = 0;\n while (id > 0)\n {\n result <<= Click.BITS;\n result += id & Click.BIT_MASK;\n id >>= Click.BITS;\n }\n return result;\n }", "private static long getRightShiftedNumberBufAsLong(long numberBuf,\n long bitPos, int nrBits, ByteOrder byteOrder) throws BitBufferException {\n\n // number of bits integer buffer needs to be shifted to the right in\n // order to reach the last bit in last byte\n long shiftBits;\n if (byteOrder == ByteOrder.BigEndian)\n shiftBits = 7 - ((nrBits + bitPos + 7) % 8);\n else\n shiftBits = bitPos % 8;\n\n return numberBuf >> shiftBits;\n }" ]
[ "0.67946845", "0.6609397", "0.6165352", "0.61326796", "0.606098", "0.595094", "0.5906389", "0.580947", "0.5779786", "0.5740513", "0.57334906", "0.5624679", "0.5599536", "0.559316", "0.5526409", "0.5510099", "0.5493649", "0.5490497", "0.5473332", "0.5451555", "0.53992474", "0.5397833", "0.5391273", "0.5368192", "0.5360426", "0.5343148", "0.5341374", "0.53413504", "0.5339526", "0.5325378", "0.5308032", "0.53030735", "0.5282812", "0.52819204", "0.52789956", "0.52746797", "0.5271349", "0.5270104", "0.5249948", "0.5245607", "0.5245301", "0.5245251", "0.5244763", "0.524402", "0.52270275", "0.51826394", "0.5158647", "0.5140491", "0.5128322", "0.5126776", "0.5123641", "0.51151097", "0.51119864", "0.5091557", "0.5090014", "0.5089466", "0.5079333", "0.507599", "0.507436", "0.50624144", "0.5060828", "0.5056957", "0.5056113", "0.5053045", "0.50460434", "0.5043574", "0.50412947", "0.5035592", "0.5031169", "0.50253105", "0.5025279", "0.5024138", "0.50152993", "0.50144565", "0.5013366", "0.5006094", "0.500003", "0.49980962", "0.49936157", "0.49770325", "0.49756837", "0.49729386", "0.49700084", "0.4967332", "0.49589485", "0.4956097", "0.49532795", "0.49307436", "0.4928199", "0.49209702", "0.49190304", "0.49165925", "0.49094087", "0.49079442", "0.4896939", "0.4893066", "0.4889997", "0.48801726", "0.4872487", "0.4864639" ]
0.66344225
1
TODO Autogenerated method stub
public static void main(String[] args) { BinaryNumber a = new BinaryNumber("11"); System.out.println(a.toDecimal()); System.out.println(a.getLength()); System.out.println(a.toString()); System.out.println(a.shiftR(3)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
compares two photographs by caption alphabetically in photograph if caption the same, compares by rating in descending order
public int compare(Photograph a, Photograph b) { int returnVal = a.getCaption().compareTo(b.getCaption()); if (returnVal != 0) { return returnVal; } returnVal = b.getRating() - a.getRating(); return returnVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sortRating()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getRating().compareTo(b.getRating());\n if(result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public int compare(Movie a, Movie b) {\n\t\tdouble aRating = a.computeRating();\n\t\tdouble bRating = b.computeRating();\n\t\tif (aRating>bRating)\n\t\t\treturn -1;\n\t\telse if (aRating<bRating)\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n\t}", "@Override\r\n\t\tpublic int compare(Details d1, Details d2) {\n\t\t\tif (d1.rating == d2.rating)\r\n\t\t\t\treturn 0;\r\n\t\t\telse if (d1.rating < d2.rating)\r\n\t\t\t\treturn 1;\r\n\t\t\telse\r\n\t\t\t\treturn -1;\r\n\t\t}", "private void CompareTwoFiles() {\n GetCharactersFromProject prog1Char;\r\n KGram prog1KGram;\r\n HashKGram prog1HashKGram;\r\n FingerPrint prog1FingerPrint;\r\n ArrayList<Integer> fingerprintProg1 = null;\r\n\r\n GetCharactersFromProject prog2Char;\r\n KGram prog2KGram;\r\n HashKGram prog2HashKGram;\r\n FingerPrint prog2FingerPrint;\r\n ArrayList<Integer> fingerprintProg2 = null;\r\n\r\n //for the first file\r\n try {\r\n prog1Char = new GetCharactersFromProject(filepath1);\r\n prog1KGram = new KGram(prog1Char.getCharacters());\r\n prog1HashKGram = new HashKGram(prog1KGram.ReturnProcessedKGram());\r\n prog1FingerPrint = new FingerPrint(prog1HashKGram.ReturnProcessedHashes());\r\n fingerprintProg1 = prog1FingerPrint.ReturnFingerPrint();\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n //this is for the second file\r\n try {\r\n prog2Char = new GetCharactersFromProject(filepath2);\r\n prog2KGram = new KGram(prog2Char.getCharacters());\r\n prog2HashKGram = new HashKGram(prog2KGram.ReturnProcessedKGram());\r\n prog2FingerPrint = new FingerPrint(prog2HashKGram.ReturnProcessedHashes());\r\n fingerprintProg2 = prog2FingerPrint.ReturnFingerPrint();\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n //this is for jaccard index. Jaccard index will be the basis of similarity\r\n float numSimilarity = 0;\r\n boolean isSimilarEncounter = false;\r\n int sizeFingerprint1 = fingerprintProg1.size();\r\n int sizeFingerprint2 = fingerprintProg2.size();\r\n\r\n for (Integer integer : fingerprintProg1) {\r\n\r\n for (Integer value : fingerprintProg2) {\r\n\r\n\r\n if ((integer.intValue() == value.intValue()) && !isSimilarEncounter) {\r\n numSimilarity++;\r\n isSimilarEncounter = true;\r\n }\r\n\r\n }\r\n\r\n\r\n isSimilarEncounter = false;\r\n }\r\n\r\n SimilarityScore = (numSimilarity / (sizeFingerprint1 + sizeFingerprint2 - numSimilarity));\r\n }", "public int compare(identified_crystal a, identified_crystal b) \n\t { \n\n\t \treturn a.rating - b.rating; \n\t }", "@Override\n public int compare(Recognition lhs, Recognition rhs) {\n return Float.compare(rhs.getConfidence(), lhs.getConfidence());\n }", "@Override\r\n\tpublic int compare(Movie o1, Movie o2) {\n\t\t\r\n\t\tif(o1.getRating()<o2.getRating()) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tif(o1.getRating()>o2.getRating()) {\r\n\t\t\treturn 1;\r\n\t\t}else {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "@Override\n public int compare(Suggestion sugg1, Suggestion sugg2) {\n int alteredGrammarWordsDifference = sugg1.getAlteredGrammarWordsCount()\n - sugg2.getAlteredGrammarWordsCount();\n\n if (alteredGrammarWordsDifference != 0) {\n return alteredGrammarWordsDifference;\n }\n\n //if tied: less added info first\n int additionalNamesDifference = sugg1.getAdditionalNamesCount() + sugg1.getAdditionalGrammarWords()\n - (sugg2.getAdditionalNamesCount() + sugg2.getAdditionalGrammarWords());\n\n if (additionalNamesDifference != 0) {\n return additionalNamesDifference;\n }\n\n //if tied: less words first\n int wordCountDifference = sugg1.getWordsCount() - sugg2.getWordsCount();\n\n if (wordCountDifference == 0) {\n return wordCountDifference;\n }\n\n //if tied: shortest text first\n return sugg1.getText().length() - sugg2.getText().length();\n }", "private Comparison compareImages(SimpleNode first, SimpleNode second) {\n if (first instanceof JexlNode) {\n String firstImage = ((JexlNode) first).image;\n String secondImage = ((JexlNode) second).image;\n if (!Objects.equals(firstImage, secondImage)) {\n return Comparison.notEqual(\"Node images differ: \" + firstImage + \" vs \" + secondImage);\n }\n }\n return Comparison.IS_EQUAL;\n }", "public int compare(Dataset object1, Dataset object2){\n if(object1.getAttributeCount() != candidate.getAttributeCount() ||\n object2.getAttributeCount() != candidate.getAttributeCount()){\n return 0;\n }\n\n double dist1 = 0.0, dist2 = 0.0;\n double tmp1 = 0.0, tmp2 = 0.0;\n\n for(int i = 0; i < candidate.getAttributeCount(); i++){\n if(candidate.getOutputColumnCount() == (i+1)){\n continue;\n }\n\n Attribute ac = candidate.getAttribute(i);\n Attribute a1 = object1.getAttribute(i);\n Attribute a2 = object2.getAttribute(i);\n\n if(ac.getType() == AttributeTypes.TEXT){\n dist1 += DatasetEuklidianComparator.unlimitedCompare((String)ac.getValue(), (String)a1.getValue());\n dist2 += DatasetEuklidianComparator.unlimitedCompare((String)ac.getValue(), (String)a2.getValue());\n }else{\n /*\n double acDouble = 0.0;\n double a1Double = 0.0;\n double a2Double = 0.0;\n switch(ac.getType()){\n case INTEGER: acDouble = (double)((Integer)ac.getValue()).intValue(); break;\n case DECIMAL: acDouble = (double)ac.getValue();\n }\n switch(a1.getType()){\n case INTEGER: a1Double = (double)((Integer)a1.getValue()).intValue(); break;\n case DECIMAL: a1Double = (double)a1.getValue();\n }\n switch(a2.getType()){\n case INTEGER: a2Double = (double)((Integer)a2.getValue()).intValue(); break;\n case DECIMAL: a2Double = (double)a2.getValue();\n }*/\n double acDouble = (double)ac.getValue();\n double a1Double = (double)a1.getValue();\n double a2Double = (double)a2.getValue();\n\n tmp1 += Math.pow(a1Double-acDouble, 2);\n tmp2 += Math.pow(a2Double-acDouble, 2);\n }\n }\n\n dist1 += Math.sqrt(tmp1);\n dist2 += Math.sqrt(tmp2);\n\n if (dist1 > dist2) {\n return 1;\n }\n if (dist1 < dist2) {\n return -1;\n }\n return 0;\n }", "public static boolean compare_dictdata(DictionaryData i, DictionaryData j)\r\n {\r\n if( i.frequency == j.frequency)\r\n {\r\n return j.word.compareTo(i.word) < 0; // i < j\r\n }\r\n return i.frequency < j.frequency;\r\n\r\n }", "private int Compare(ResultsClass lhs, ResultsClass rhs) {\n if (lhs.bodyPart > rhs.bodyPart) {\n return 1;\n } else if (lhs.bodyPart > rhs.bodyPart) {\n return -1;\n } else {\n return 0;\n }\n }", "public int compareTo(Review other) {\n if (this.rating < other.rating) {\n return -1;\n } else if (this.rating > other.rating) {\n return 1;\n } else {\n return 0;\n }\n }", "public void winner() {\n\t\tList<String> authors = new ArrayList<String>(scores_authors.keySet());\n\t\tCollections.sort(authors, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_authors.get(o1).compareTo(scores_authors.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des auteurs :\");\n\t\tfor(String a :authors) {\n\t\t\tSystem.out.println(a.substring(0,5)+\" : \"+scores_authors.get(a));\n\t\t}\n\t\t\n\t\tList<String> politicians = new ArrayList<String>(scores_politicians.keySet());\n\t\tCollections.sort(politicians, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_politicians.get(o1).compareTo(scores_politicians.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des politiciens :\");\n\t\tfor(String p :politicians) {\n\t\t\tSystem.out.println(p.substring(0,5)+\" : \"+scores_politicians.get(p));\n\t\t}\n\t}", "@Override\n\n\tpublic int compare(Song o1, Song o2) {\n\t\tif (o1.getAlbumTitle() != null && o2.getAlbumTitle() != null) {\n\t\t/*\n\t\t * determines if the album title is the same then it returns the song\n\t\t * title in alphabetical order\n\t\t * if not it returns the album title\n\t\t */\n\t\tif (o1.getAlbumTitle().compareTo(o2.getAlbumTitle()) == 0 ) {\n\t\t\treturn o1.getSongTitle().compareTo(o2.getSongTitle());\n\t\t}\n\t\telse {\n\t\t\treturn o1.getAlbumTitle().compareTo(o2.getAlbumTitle());\n\t\t}\n\t}\n\t\t/*\n\t\t * if the album obj doesn't match it puts the song at the end\n\t\t */\n\t\treturn o2.getSongTitle().compareTo(o1.getSongTitle());\n\t}", "@Override\npublic int compareTo(ImageForSort newImage) {\n\tif(this.distance==newImage.distance)\n\treturn 0;\n\telse if(this.getDistance()>newImage.getDistance()){\n\t\treturn 1;\n\t}else{\n\t\treturn -1;\n\t}\n}", "public static double similarity(Library a, Library b) {\r\n double sizeA = a.getPhotos().size();\r\n double sizeB = b.getPhotos().size();\r\n\r\n if (sizeA == 0.0 || sizeB == 0.0) { // return 0.0 if either library is empty\r\n return 0.0;\r\n } else {\r\n int size = commonPhotos(a, b).size();\r\n if (sizeA < sizeB) { // return amount of common photos divided by the smaller library\r\n return size / sizeA;\r\n } else {\r\n return size / sizeB;\r\n }\r\n }\r\n\r\n }", "public String printSpeciePairMostSimilar()\n\t{\n\t\tStringBuilder toReturn = new StringBuilder();\n\n\t\ttoReturn.append(\"SPECIES PAIR MOST SIMILAR IN ACTIVITY (FREQUENCY)\\n\");\n\t\ttoReturn.append(\" Consider those species with 25 or more pictures\\n\");\n\n\t\tSpecies lowest = null;\n\t\tSpecies lowestOther = null;\n\t\tdouble lowestFrequency = Double.MAX_VALUE;\n\n\t\tfor (Species species : analysis.getAllImageSpecies())\n\t\t{\n\t\t\tfor (Species other : analysis.getAllImageSpecies())\n\t\t\t{\n\t\t\t\tList<ImageEntry> imagesWithSpecies = new ImageQuery().speciesOnly(species).query(images);\n\t\t\t\tList<ImageEntry> imagesWithSpeciesOther = new ImageQuery().speciesOnly(other).query(images);\n\t\t\t\tint totalImages = imagesWithSpecies.size();\n\t\t\t\tint totalImagesOther = imagesWithSpeciesOther.size();\n\t\t\t\tdouble activitySimilarity = 0;\n\n\t\t\t\tif (totalImages >= 25 && totalImagesOther >= 25 && !species.equals(other))\n\t\t\t\t{\n\t\t\t\t\t// 24 hrs\n\t\t\t\t\tfor (int i = 0; i < 24; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTime = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpecies);\n\t\t\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTimeOther = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpeciesOther);\n\t\t\t\t\t\tdouble numImages = imagesWithSpeciesAtTime.size();\n\t\t\t\t\t\tdouble numImagesOther = imagesWithSpeciesAtTimeOther.size();\n\t\t\t\t\t\tdouble frequency = numImages / totalImages;\n\t\t\t\t\t\tdouble frequencyOther = numImagesOther / totalImagesOther;\n\t\t\t\t\t\tdouble difference = frequency - frequencyOther;\n\t\t\t\t\t\t// Frequency squared\n\t\t\t\t\t\tactivitySimilarity = activitySimilarity + difference * difference;\n\t\t\t\t\t}\n\n\t\t\t\t\tactivitySimilarity = Math.sqrt(activitySimilarity);\n\n\t\t\t\t\tif (lowestFrequency >= activitySimilarity)\n\t\t\t\t\t{\n\t\t\t\t\t\tlowestFrequency = activitySimilarity;\n\t\t\t\t\t\tlowest = species;\n\t\t\t\t\t\tlowestOther = other;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (lowest != null)\n\t\t{\n\t\t\ttoReturn.append(String.format(\"Hour %-28s %-28s\\n\", lowest.getName(), lowestOther.getName()));\n\n\t\t\tList<ImageEntry> imagesWithSpecies = new ImageQuery().speciesOnly(lowest).query(images);\n\t\t\tList<ImageEntry> imagesWithSpeciesOther = new ImageQuery().speciesOnly(lowestOther).query(images);\n\t\t\tint totalImages = imagesWithSpecies.size();\n\t\t\tint totalImagesOther = imagesWithSpeciesOther.size();\n\t\t\tdouble activitySimilarity = 0;\n\n\t\t\t// 24 hrs\n\t\t\tfor (int i = 0; i < 24; i++)\n\t\t\t{\n\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTime = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpecies);\n\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTimeOther = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpeciesOther);\n\t\t\t\tdouble numImages = imagesWithSpeciesAtTime.size();\n\t\t\t\tdouble numImagesOther = imagesWithSpeciesAtTimeOther.size();\n\t\t\t\tdouble frequency = numImages / totalImages;\n\t\t\t\tdouble frequencyOther = numImagesOther / totalImagesOther;\n\t\t\t\tdouble difference = frequency - frequencyOther;\n\t\t\t\t// Frequency squared\n\t\t\t\tactivitySimilarity = activitySimilarity + difference * difference;\n\n\t\t\t\ttoReturn.append(String.format(\"%02d:00-%02d:00 %5.3f %5.3f\\n\", i, i + 1, frequency, frequencyOther));\n\t\t\t}\n\t\t}\n\n\t\ttoReturn.append(\"\\n\");\n\n\t\treturn toReturn.toString();\n\t}", "public double compareImages(ImageSub img1, ImageSub img2) {\n\t\tdouble[] channels = new double[3];\n\t\tdouble sumOfSquares = 0;\n\t\tfor(int i = 0; i < channels.length; i++) {\n\t\t\tchannels[i] = Imgproc.compareHist(img1.cvChannels.get(i), img2.cvChannels.get(i), Imgproc.CV_COMP_BHATTACHARYYA);\n\t\t\t\n\t\t\t//Uncomment this. Comment the line above\n\t\t\t//channels[i] = SSIM.compareImages(img1.cvChannels.get(i), img2.cvChannels.get(i));\n\t\t\tsumOfSquares += channels[i];\n\t\t}\n\t\tsumOfSquares /= channels.length;\n\t\t//System.out.println(sumOfSquares);\n\t\treturn sumOfSquares;\n\t}", "private Pair<String, Double> compare(String[] usernames, Bitmap[] sourceBmps, Bitmap targetBmp) {\n // Convert source and target bitmaps into Mat\n Mat target = toGrayMat(targetBmp);\n\n\n FaceRecognizer model = ((GitZucccdApplication) getApplication()).getModel();\n TreeMap<Double, Friend> confidences = new TreeMap<>();\n\n // Loop through the source bitmaps and train the model with them\n for (int i = 0, len = sourceBmps.length; i < len; i++) {\n Bitmap sourceBmp = sourceBmps[i];\n Mat source = toGrayMat(sourceBmp);\n\n List<Mat> src = new ArrayList<>();\n src.add(source);\n\n // Create an array of size (cols) 1 and scalar value i\n Mat labels = new Mat(1, 1, CvType.CV_32SC1, new Scalar(i));\n // Train the model with the source imageid\n\n try {\n model.update(src, labels);\n } catch (Exception e) {\n model.train(src, labels);\n }\n }\n\n // Create variables for model.predict to store into\n int[] predictedLabel = new int[1];\n double[] confidence = new double[1];\n\n model.predict(target, predictedLabel, confidence);\n\n return new Pair<>(usernames[predictedLabel[0]], confidence[0]);\n }", "@Override\n\t\t\tpublic int compare(Articulo o1, Articulo o2) {\n\t\t\t\tString desc1 = o1.getDescripcion();\n\t\t\t\tString desc2 = o2.getDescripcion();\n\t\t\t\t\n\t\t\t\treturn desc1.compareTo(desc2);\n\t\t\t}", "public int compareTo( Similarity other )\n {\n int diff=this.distance - other.distance;\n if(diff!=0) return diff;\n diff=getID(this.pixels.p) - getID(other.pixels.p);\n if(diff!=0) return diff;\n return getID(this.pixels.q) - getID(other.pixels.q);\n }", "public static double similarity(Library a, Library b) {\n double numerator = commonPhotos(a, b).size();\n if (a.numPhotos() == 0 || b.numPhotos() == 0) { // check if both libraries have 0 photos\n return 0;\n } else if (a.numPhotos() > b.numPhotos()) { // checking to see which number to divide by\n return numerator / b.numPhotos();\n } else {\n return numerator / a.numPhotos();\n }\n }", "public void similar(String tableName, String name) {\n String simName = null;\n float score = 11;\n float val = 0;\n int simCount = 0;\n if (tableName.equals(\"reviewer\")) {\n if (matrix.getReviewers().contains(name) != null) {\n // Node with the reference to the list we are comparing other\n // lists to\n ReviewerList.Node n = matrix.getReviewers().contains(name);\n // Gets the head to the DLList that we are comparing other lists\n // to\n Node<Integer> node = n.getList().getHead();\n // The first node in the reviewer list\n ReviewerList.Node n1 = matrix.getReviewers().getHead();\n // Iterates through the lists we are comparing to this list\n while (n1 != null) {\n if (n.equals(n1)) {\n n1 = n1.getNext();\n }\n else {\n RDLList<Integer> simList = n1.getList();\n Node<Integer> simNode = null;\n node = n.getList().getHead();\n // Going through this list to find matching movies in\n // simList\n while (node != null) {\n simNode = simList.containsMovie(node\n .getMovieName());\n if (simNode != null) {\n simCount++;\n // Compute the score\n // Add the name and score to the array\n val += Math.abs(simNode.getValue() - node\n .getValue());\n }\n node = node.getNextMovie();\n }\n if (simCount != 0 && (val / simCount) < score) {\n simName = simList.getHead().getReviewerName();\n score = val / simCount;\n }\n val = 0;\n simCount = 0;\n n1 = n1.getNext();\n }\n }\n\n printSimilar(\"reviewer\", name, simName, score);\n }\n else {\n System.out.println(\"Reviewer |\" + name\n + \"| not found in the database.\");\n }\n }\n else {\n if (matrix.getMovies().contains(name) != null) {\n // Node with the reference to the list we are comparing\n // other lists to\n MSLList.Node n = matrix.getMovies().contains(name);\n // Gets the head to the DLList that we are comparing other\n // lists\n // to\n Node<Integer> node = n.getList().getHead();\n // The first node in the reviewer list\n MSLList.Node n1 = matrix.getMovies().getHead();\n // Iterates through the lists we are comparing to this list\n while (n1 != null) {\n if (n.equals(n1)) {\n n1 = n1.getNext();\n }\n else {\n MDLList<Integer> simList = n1.getList();\n Node<Integer> simNode = null;\n // Going through this list to find matching movies\n // in simList\n node = n.getList().getHead();\n while (node != null) {\n simNode = simList.containsReviewer(node\n .getReviewerName());\n if (simNode != null) {\n simCount++;\n // Compute the score\n // Add the name and score to the array\n val += Math.abs(simNode.getValue() - node\n .getValue());\n }\n node = node.getNextReviewer();\n }\n if (simCount != 0 && (val / simCount) < score) {\n simName = simList.getHead().getMovieName();\n score = val / simCount;\n }\n val = 0;\n simCount = 0;\n n1 = n1.getNext();\n }\n }\n printSimilar(\"movie\", name, simName, score);\n }\n else {\n System.out.println(\"Movie |\" + name\n + \"| not found in the database.\");\n }\n }\n }", "@Override\n\t//o1 > o2 如果返回正数则 升序。\n\tpublic int compare(Subject o1, Subject o2) {\n\t\tint ret = 1;\n\t\tif(o1.getRatingNum() > o2.getRatingNum()){\n\t\t\t//键入中文的负号,竟然是一个运行时错误。\n\t\t\tret = -1;\n\t\t}else if(o1.getRatingNum() == o2.getRatingNum()){\n\t\t\tret = 0;\n\t\t}\n\t\treturn ret;\n\t\t//下一句有double类型的舍入误差。\n\t\t//return (int) (o1.getRatingNum() - o2.getRatingNum());\n\t}", "@Override\r\n public int compare(HDTV o1, HDTV o2) {\n return o1.getSize() - o2.getSize(); // prints object in ascending order\r\n\r\n }", "private static void compareForIdenticalKeys() {\n Integer[] identical = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n\n Insertion insertion = new Insertion();\n insertion.analyzeSort(identical);\n insertion.getStat().printReport();\n\n Selection selection = new Selection();\n selection.analyzeSort(identical);\n selection.getStat().printReport();\n }", "public int compare(Goods o1,Goods o2) {\n\t\treturn o1.getFav() - o2.getFav();\n\t}", "public int compareTo(ProductWritable o) {\n\t\tint result = -1;\n\t\t if(rating > o.rating) {\n\t\t\t result = 1;\n\t\t }\n\t\t if(rating == o.rating) {\n\t\t\t result = 0;\n\t\t }\n\t\t if(result == 0) {\n\t\t\tresult = productTitle.compareTo(o.productTitle);\n\t\t }\n\t\treturn result;\n\t}", "@Override\n public int compare(Card card1, Card card2) {\n return card1.getCardHeader().getTitle().compareTo\n (card2.getCardHeader().getTitle());\n }", "public int compareGenre(Song other) {\n return this.genre.compareTo(other.getGenre());\n }", "public void findGeoSurfSimilarPhotosWithTagStatistics(\r\n\t\t\tfinal Set<String> allCandidateWords,\r\n\t\t\tfinal Map<String, WordImage> relevantWordImages, boolean tagReq,\r\n\t\t\tboolean techTagReq, boolean compact) {\r\n\r\n\t\ttopImagesURLs = new HashMap<String, Double>();\r\n\t\ttopImagesNames = new HashMap<String, String>();\r\n\t\t// The list of all Photo objects\r\n\t\tphotoList = new HashMap<String, Photo>();\r\n\t\tphotoList = createGeoSimilarPhotoList(PANORAMIO_DEFUALT_NUM_ITERATIONS, tagReq,\r\n\t\t\t\ttechTagReq);\r\n\r\n\t\t// Word Image Relevance Dictionary\r\n\t\t// The statistics consider for each word the set of images annotated\r\n\t\t// with them and similar\r\n\t\t// to the input image and the those which are tagged with it and not\r\n\t\t// similar to the input image\r\n\t\t// Map<String, WordImage> relevantWordImages = new HashMap<String,\r\n\t\t// WordImage>();\r\n\r\n\t\t// Prepare the result output\r\n\r\n\t\tif (!compact) {\r\n\t\t\toutRel.println(\"Image URL , Score , Distance , Point Similarity, Common Keypoints , Iter Point Similariy, Title , Tags , distance, userid\");\r\n\t\t\t// An CSV file for the set of visually irrelevant images\r\n\t\t\toutIrrRel.println(\"Image URL , Title , Tags , distance, userid\");\r\n\t\t}\r\n\r\n\t\t// *** Extract SURF feature for the input image\r\n\r\n\t\tSurfMatcher surfMatcher = new SurfMatcher();\r\n\t\t// The SURF feature of the input image\r\n\t\tList<InterestPoint> ipts1 = surfMatcher.extractKeypoints(inputImageURL,\r\n\t\t\t\tsurfMatcher.p1);\r\n\r\n\t\t// inputImageInterstPoints = ipts1 ;\r\n\r\n\t\t// Add the photo with its interestpoint to the cache\r\n\t\t// this.photoInterestPoints.put(imageName, ipts1);\r\n\r\n\t\t// Find SURF correspondences in the geo-related images\r\n\t\ttotalNumberOfSimilarImages = 0; // R\r\n\r\n\t\tfor (String photoId : photoList.keySet()) {\r\n\r\n\t\t\tPhoto photo = photoList.get(photoId);\r\n\r\n\t\r\n\r\n\t\t\tString toMatchedPhotoURL = photo.getPhotoFileUrl();\r\n\t\t\t// The SURF feature of a geo close image\r\n\t\t\tList<InterestPoint> ipts2 = surfMatcher.extractKeypoints(\r\n\t\t\t\t\ttoMatchedPhotoURL, surfMatcher.p2);\r\n\r\n\t\t\t// this.photoInterestPoints.put(photo.getPhotoId(), ipts2);\r\n\t\t\t// this.cachedImageInterstPoint.put(photo.getPhotoId(), ipts2);\r\n\r\n\t\t\tMatchingResult surfResult = null;\r\n\r\n\t\t\tsurfResult = surfMatcher.matchKeypoints(inputImageURL, photoId,\r\n\t\t\t\t\tipts1, ipts2, MIN_COMMON_IP_COUNT);\r\n\r\n\t\t\tif (surfResult != null) { // the images are visually similar\r\n\r\n\t\t\t\ttopImagesURLs.put(toMatchedPhotoURL,\r\n\t\t\t\t\t\tsurfResult.getPiontSimilarity());\r\n\r\n\t\t\t\ttopImagesNames.put(toMatchedPhotoURL, photo.getPhotoId());\r\n\r\n\t\t\t\ttotalNumberOfSimilarImages += 1;\r\n\t\t\t\tif (!compact) {\r\n\r\n\t\t\t\t\toutRel.println(photo.getPhotoUrl()\r\n\t\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t\t+ surfResult.getScore()\r\n\t\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t\t+ surfResult.getAvgDistance()\r\n\t\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t\t+ surfResult.getPiontSimilarity()\r\n\t\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t\t+ surfResult.getCommonKeyPointsCount()\r\n\t\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t\t+ \"null ,\"\r\n\t\t\t\t\t\t\t+ photo.getPhotoTitle().toString()\r\n\t\t\t\t\t\t\t\t\t.replace(\",\", \" \") + \",\"\r\n\t\t\t\t\t\t\t+ photo.getTags().toString().replace(\",\", \" ; \")\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\tSystem.out.println(\"Downloading Similar Image\");\r\n\t\t\t\t\tString destFileName = similarImagesDir + \"/\" + photoId\r\n\t\t\t\t\t\t\t+ \".jpg\";\r\n\t\t\t\t\tImageUtil.downloadImage(photo.getPhotoFileUrl(), destFileName);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Generate Word Statistics\r\n\t\t\t\t// For the a certain word (tag) add image info to its list if\r\n\t\t\t\t// this image\r\n\t\t\t\t// is visually similar to the input image\r\n\t\t\t\tupdateWordRelatedImageList(allCandidateWords,\r\n\t\t\t\t\t\trelevantWordImages, photo, surfResult);\r\n\t\t\t} else {\r\n\r\n\t\t\t\tif (!compact) {\r\n\t\t\t\t\t// Images are visually not similar\r\n\t\t\t\t\toutIrrRel.println(photo.getPhotoUrl()\r\n\t\t\t\t\t\t\t+ \" ,\"\r\n\t\t\t\t\t\t\t+ photo.getPhotoTitle().toString()\r\n\t\t\t\t\t\t\t\t\t.replace(\",\", \" \") + \",\"\r\n\t\t\t\t\t\t\t+ photo.getTags().toString().replace(\",\", \" ; \")\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t// We also need to get some information if a certain word is\r\n\t\t\t\t\t// also used by visually not similar images\r\n\t\t\t\t\tSystem.out.println(\"Downloading Non Similar Image\");\r\n\t\t\t\t\tString destFileName = dissimilarImagesDir + \"/\" + photoId\r\n\t\t\t\t\t\t\t+ \".jpg\";\r\n\t\t\t\t\tImageUtil.downloadImage(photo.getPhotoFileUrl(), destFileName);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tupdateWordNotRelatedImageList(relevantWordImages, photo);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void compare(BufferedImage bi0, BufferedImage bi1, int biType, Color c) {\n for (int x=0; x<wid; x++) {\n for (int y=0; y<hgt; y++) {\n int rgb0 = bi0.getRGB(x, y);\n int rgb1 = bi1.getRGB(x, y);\n if (rgb0 == rgb1) continue;\n int r0 = (rgb0 & 0xff0000) >> 16;\n int r1 = (rgb1 & 0xff0000) >> 16;\n int rdiff = r0-r1; if (rdiff<0) rdiff = -rdiff;\n int g0 = (rgb0 & 0x00ff00) >> 8;\n int g1 = (rgb1 & 0x00ff00) >> 8;\n int gdiff = g0-g1; if (gdiff<0) gdiff = -gdiff;\n int b0 = (rgb0 & 0x0000ff);\n int b1 = (rgb1 & 0x0000ff);\n int bdiff = b0-b1; if (bdiff<0) bdiff = -bdiff;\n if (rdiff > 1 || gdiff > 1 || bdiff > 1) {\n throw new RuntimeException(\n \"Images differ for type \"+biType + \" col=\"+c +\n \" at x=\" + x + \" y=\"+ y + \" \" +\n Integer.toHexString(rgb0) + \" vs \" +\n Integer.toHexString(rgb1));\n }\n }\n }\n\n }", "private int scoreAuthorMatch(int tag1, int tag2)\n {\n // If they're exactly equal, great.\n if (tag1 == tag2)\n return 100;\n \n // Don't do prefix scanning on short titles.\n String str1 = data.tags.getString(tag1);\n String str2 = data.tags.getString(tag2);\n if (str1.length() < 5 || str2.length() < 5)\n return 0;\n \n // If either is a prefix of the other, we have a match.\n if (str1.startsWith(str2) || str2.startsWith(str1))\n return 100;\n \n // All other cases: fail for now at least.\n return 0;\n }", "@Override\n\t\t\t\tpublic int compare(Pair o1, Pair o2) {\n\t\t\t\t\tif(o1.getAvg() - o2.getAvg() > 0){\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}else if(o1.getAvg() - o2.getAvg() < 0){\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}", "@Override\n public int compare(Box b1, Box b2) { \n return b1.width > b2.width ? 1 :(b1.width == b2.width ? 0 : -1);\n }", "@Override\n public int compareTo(AutocompleteObject o) {\n return Double.compare(o.similarity, similarity);\n }", "public int compare(Card card1, Card card2){ // works the same as a compareTo method thought for suits\n if (card1.getSuit() != card2.getSuit()){ // Sorts spades first, then diamonds, hearts, and finally clubs.\n return card1.getSuit() - card2.getSuit();\n } else {\n return card1.getValue() - card2.getValue();\n }\n }", "public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }", "public void testDifferentDotProducts() {\n List<ISpectrum> spectra = ClusteringTestUtilities.readISpectraFromResource();\n\n ISpectrum[] spectrums = (ISpectrum[]) spectra.toArray();\n\n int total = 0;\n int different = 0;\n ISimilarityChecker checker = new FrankEtAlDotProduct(0.5F, 15, true);\n ISimilarityChecker currentChecker = new FrankEtAlDotProductJohannes();\n\n Set<String> interestingIds = new HashSet<>();\n\n\n for (int i = 0; i < spectrums.length; i++) {\n ISpectrum psm1 = spectrums[i];\n for (int j = i + 1; j < spectrums.length; j++) {\n ISpectrum psm2 = spectrums[j];\n double dotOrg = checker.assessSimilarity(psm1, psm2);\n double dotNew = currentChecker.assessSimilarity(psm1, psm2);\n\n if (Math.abs(dotOrg - dotNew) > 0.00001) {\n different++;\n\n StringBuilder usedPeaksTester = new StringBuilder();\n\n // these are the really interesting cases\n dotOrg = checker.assessSimilarity(psm1, psm2);\n\n double noClosestPeak = dotNew;\n dotNew = currentChecker.assessSimilarity(psm1, psm2);\n String id2 = psm2.getId();\n String id1 = psm1.getId();\n interestingIds.add(id1);\n interestingIds.add(id2);\n\n // System.out.println(usedPeaksTester.toString());\n // System.out.printf(id2 + \":\" + id1 + \" \" + \"Old: %8.3f Newx: %8.3f New: %8.3f\\tDiff: %8.3f\\n\", dotOrg, noClosestPeak, dotNew, dotOrg - dotNew);\n }\n total++;\n\n }\n\n }\n\n List<String> sorted = new ArrayList<>(interestingIds);\n Collections.sort(sorted);\n // System.out.println(\"Interesting Ids\");\n for (String s : sorted) {\n // System.out.println(s);\n }\n\n\n TestCase.assertEquals(0, different);\n }", "public int compareArtist(Song other) {\n return this.artist.compareTo(other.getArtist());\n }", "public void sortMatches();", "@Override\n public int compare(SongInfo o1, SongInfo o2) {\n return o1.getSongName().compareTo(o2.getSongName());\n }", "private void sortSongs(Context context)\n {\n boolean foundArtist;\n for (Song song : songs)\n {\n foundArtist = false;\n for (Artist artist : artists)\n {\n if (song.artistName.equals(artist.name))\n {\n artist.addSong(song);\n foundArtist = true;\n break;\n }\n }\n if (!foundArtist)\n artists.add(new Artist(song));\n }\n\n //sorts all songs\n sortSongs(songs);\n\n //sort artists\n sortArtists(artists);\n\n //sort albums, songs and set cover\n for (Artist artist : artists)\n {\n //albums\n sortAlbums(artist.albums);\n\n for (Album album : artist.albums)\n {\n //sort album songs\n sortSongs(album.songs);\n\n //set cover\n album.cover = ImageLoader.getAlbumart(context, album.songs.get(0).albumId);\n }\n }\n }", "@Override\n\tpublic int compare(MediaMaster em1, MediaMaster em2) {\n\t\tif(em2.getArtist() != null && em1.getArtist() != null){\n\t\t\tif(\"Asc\".equalsIgnoreCase(type)){\n\t\t\t\treturn em2.getArtist().compareTo(em1.getArtist());\n\t\t\t}else{\n\t\t\t\treturn em1.getArtist().compareTo(em2.getArtist());\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public int compare(Candidate a, Candidate b) \n { \n return b.getNoOfVotes() - a.getNoOfVotes(); \n }", "private static void sortPhotosByNumberTags() {\n\t\tCollections.sort(photoList, new Comparator<Photo>() {\n\t\t\tpublic int compare(Photo p1, Photo p2) {\n\n\t\t\t\tInteger s1 = p1.getTagList().size();\n\t\t\t\tInteger s2 = p2.getTagList().size();\n\n\t\t\t\tint sComp = s1.compareTo(s2);\n\n\t\t\t\treturn -1 * sComp;\n\t\t\t}\n\t\t});\n\t}", "public static boolean compareImages(String image1, String image2) {\n \t\tboolean equals = false;\n \t\ttry {\n \t\t\tExifInterface exif1 = new ExifInterface(image1);\n \t\t\tExifInterface exif2 = new ExifInterface(image2);\n \t\t\t\n \t\t\tfinal String datetime1 = exif1.getAttribute(ExifInterface.TAG_DATETIME);\n \t\t\tfinal String datetime2 = exif2.getAttribute(ExifInterface.TAG_DATETIME);\n \t\t\t\n \t\t\tif (!TextUtils.isEmpty(datetime1) && !TextUtils.isEmpty(datetime1)) {\n \t\t\t\tequals = datetime1.equals(datetime2);\n \t\t\t} else {\n \t\t\t\tLog.d(TAG, \"Datetime is null or empty. The MD5 checksum will be compared\");\n \t\t\t\tequals = compareFilesChecksum(image1, image2);\n \t\t\t}\n \t\t} catch (IOException e) {\n \t\t\tLog.e(TAG, e.getMessage());\n \t\t}\n \t\t\n \t\treturn equals;\n \t}", "public int compareTitle(Song other) {\n return this.title.compareTo(other.getTitle());\n }", "public int compare(Key<Double, Double> a, Key<Double, Double> b){\n\t\t\tif (a.getFirst() < b.getFirst()){\n\t\t\t\treturn -1;\n\t\t\t} else if (a.getFirst() == b.getFirst()){\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}", "@Override\n public int compare(Prediction lhs, Prediction rhs) {\n return Float.compare(rhs.getConfidence(), lhs.getConfidence());\n }", "@Override\n\tpublic int compareTo(Photo p) {\n\t\treturn (new Date(this.f.lastModified())).compareTo(new Date(p.getFile().lastModified()));\n\t}", "@Override\r\n\tpublic String getSimilarityExplained(String string1, String string2) {\r\n //todo this should explain the operation of a given comparison\r\n return null; //To change body of implemented methods use File | Settings | File Templates.\r\n }", "public int compareTo(FontMatch match) {\n/* 710 */ return Double.compare(match.score, this.score);\n/* */ }", "@Override\r\n\tpublic int compareTo(Song s1) {\r\n\t\tint comparenum = this.artist.compareTo(s1.artist);\r\n\t\tif (comparenum == 0) {\r\n\t\t\tcomparenum = this.title.compareTo(s1.title);\r\n\t\t}\r\n\t\treturn comparenum;\r\n\t}", "public int compareTo(DocumentPair other) {\r\n return (this.jsDiv - other.jsDiv);\r\n }", "int match(ArrayList<ImageCell> images);", "@Override\n\tpublic int compare(Product p1, Product p2) {\n\t\t\n\t\treturn p2.getReviewCount()*p2.getSaleCount()-p1.getReviewCount()*p1.getSaleCount();\n\t}", "@Override\n\tpublic int compare(Podroz o1, Podroz o2) {\n\t\tif(klucz == \"czas\")\n\t\t{\n\t\t\tif(o1.getCzas()==o2.getCzas())\n\t\t\t\treturn 0;\n\t\t\telse if(o1.getCzas() > o2.getCzas())\n\t\t\t\treturn 1;\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n\t\telse if(klucz == \"dlugosc\")\n\t\t{\n\t\t\tif(o1.getDlugosc() == o2.getDlugosc())\n\t\t\t\treturn 0;\n\t\t\telse if(o1.getDlugosc() > o2.getDlugosc())\n\t\t\t\treturn 1;\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n\t\telse if(klucz == \"data\")\n\t\t{\n\t\t\tif(o1.getData_rozpoczecia().compareTo(o2.getData_rozpoczecia())==0)\n\t\t\t\treturn 0;\n\t\t\telse if(o1.getData_rozpoczecia().compareTo(o2.getData_rozpoczecia())>0)\n\t\t\t\treturn 1;\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(o1.getSrednia_predkosc() == o2.getSrednia_predkosc())\n\t\t\t\treturn 0;\n\t\t\telse if(o1.getSrednia_predkosc() > o2.getSrednia_predkosc())\n\t\t\t\treturn 1;\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n\t}", "@Override\n public int compare(FileNameExtensionFilter ext1, FileNameExtensionFilter ext2)\n {\n return ext1.getDescription().toLowerCase().compareTo(ext2.getDescription().toLowerCase());\n }", "@Override\n public int compare(Item i1,Item i2){\n return i2.mark.compareTo(i1.mark);\n\n // return i1.mark.compareTo(i2,mark);\n //This is the ascending version of the same.\n }", "public int compare (Object object1,Object object2)\r\n {\r\n Map map1 = (Map)object1;\r\n Map map2 = (Map)object2;\r\n\r\n /*Get sort info keys*/\r\n Map sortKeys = getSortKeys();\r\n\r\n String keyName = (String) sortKeys.get(\"name\");\r\n String keyDir = (String) sortKeys.get(\"dir\");\r\n\r\n String stringValue1 = (String) map1.get(keyName); \r\n String stringValue2 = (String) map2.get(keyName);\r\n\r\n boolean str1Empty = isEmpty(stringValue1);\r\n boolean str2Empty = isEmpty(stringValue2);\r\n \r\n /* \r\n * If both values are null or empty diff = 0\r\n * If first string is null or empty diff = -1\r\n * If second string is null or empty diff = 1\r\n * If both the strings are not empty then compare the strings\r\n */ \r\n int diff = str1Empty && str2Empty ? 0 : \r\n str1Empty ? -1 : \r\n str2Empty ? 1 : \r\n compareAnchorDataPart(stringValue1, stringValue2); \r\n \r\n /* If the direction is not ascending, then invert the sign of 'diff' value\r\n * */\r\n return \"ascending\".equals(keyDir)? diff : -diff ;\r\n }", "public int compare(Person a, Person b){\n int aWeight = (int)a.getWeight();\n int bWeight = (int)b.getWeight();\n return aWeight - bWeight;\n }", "private int scoreTitleMatch(int tag1, int tag2)\n {\n // If they're exactly equal, great.\n if (tag1 == tag2)\n return 100;\n \n // Don't do prefix scanning on short titles.\n String str1 = data.tags.getString(tag1);\n String str2 = data.tags.getString(tag2);\n if (str1.length() < 5 || str2.length() < 5)\n return 0;\n \n // If either is a prefix of the other, we have a match.\n if (str1.startsWith(str2) || str2.startsWith(str1))\n return 100;\n \n // All other cases: fail for now at least.\n return 0;\n }", "@Override\r\n public int compare(Element e1, Element e2) {\r\n\t\t//FIXME !!!!\r\n\t\treturn -1;\r\n//\t\t// first try to compare by type:\r\n//\t\tint result = compareType(e1, e2);\r\n//\t\tif(result != 0)\r\n//\t\t\treturn result;\r\n//\t\t\r\n//\t\t// results with matching case before results with different case then searched word\r\n//\t\tresult = compareCase(e1, e2);\r\n//\t\tif(result != 0) {\r\n//\t\t\treturn result;\r\n//\t\t}\r\n//\t\t// when they both do/don't match case, compare by label:\r\n//\t\tresult = compareLabel(e1, e2);\r\n//\t\tif(result != 0) {\r\n//\t\t\treturn result;\r\n//\t\t}\r\n//\r\n//\t\t// if the same label as well, compare by hashcode\r\n//\t\tresult = e1.compareTo(e2);\r\n//\t\treturn result;\r\n\r\n\t}", "public boolean DEBUG_compare(Alphabet other) {\n System.out.println(\"now comparing the alphabets this with other:\\n\"+this+\"\\n\"+other);\n boolean sameSlexic = true;\n for (String s : other.slexic.keySet()) {\n if (!slexic.containsKey(s)) {\n sameSlexic = false;\n break;\n }\n if (!slexic.get(s).equals(other.slexic.get(s))) {\n sameSlexic = false;\n break;\n }\n slexic.remove(s);\n }\n System.out.println(\"the slexic attributes are the same : \" + sameSlexic);\n boolean sameSlexicinv = true;\n for (int i = 0, limit = other.slexicinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = slexicinv.size() + i; j < limit2; j++) {\n int k = j % slexicinv.size();\n if (other.slexicinv.get(i).equals(slexicinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSlexicinv = false;\n break;\n }\n\n }\n boolean sameSpair = true;\n System.out.println(\"the slexicinv attributes are the same : \" + sameSlexicinv);\n for (IntegerPair p : other.spair.keySet()) {\n if(!spair.containsKey(p)) {\n //if (!containsKey(spair, p)) {\n sameSpair = false;\n break;\n }\n //if (!(get(spair, p).equals(get(a.spair, p)))) {\n if (!spair.get(p).equals(other.spair.get(p))) {\n sameSpair = false;\n break;\n }\n }\n System.out.println(\"the spair attributes are the same : \" + sameSpair);\n boolean sameSpairinv = true;\n for (int i = 0, limit = other.spairinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = spairinv.size() + i; j < limit2; j++) {\n int k = j % spairinv.size();\n if (other.spairinv.get(i).equals(spairinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSpairinv = false;\n break;\n }\n }\n System.out.println(\"the spairinv attributes are the same : \" + sameSpairinv);\n return (sameSpairinv && sameSpair && sameSlexic && sameSlexicinv);\n }", "@Override\n\t\t\tpublic int compare(Sprite s1, Sprite s2) {\n\t\t\t\tif(!s1.sort)\n\t\t\t\t\treturn -1;\n\t\t\t\tif(!s2.sort)\n\t\t\t\t\treturn 1;\n\t\n\t\t\t\t\n\t\t if (s1.position.y+s1.height < s2.position.y+s2.height) {\n\t\t return -1;\n\t\t }else {\n\t\t return 1;\n\t\t }\n\t\t\t}", "private static boolean compare(BufferedInputStream b1, BufferedInputStream b2) throws IOException {\n\t\tint cmp1 = 0, cmp2;\r\n\t\tbyte[] i = new byte[100];\r\n\t\tbyte[] j = new byte[100];\r\n\t\t\r\n\t\twhile(cmp1 != -1){\r\n\t\t\tcmp1 = b1.read(i, 0, i.length);\r\n\t\t\tcmp2 = b2.read(j, 0, j.length);\r\n\t\t\tif(cmp1 != cmp2){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(int k = 0; k < cmp1; k++){\r\n\t\t\t\tif(i[k] != j[k]){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public int compareTo(Album other) {\n\t\treturn this.albumName.toLowerCase().compareTo(other.albumName.toLowerCase());\n\t}", "public void ComputeSimilarity() {\n\t\t\n\t\t//first construct the vector space representations for these five reviews\n\t\t// the our smaples vector, finally get the similarity metric \n\t\tanalyzequery(LoadJson(\"./data/samples/query.json\"));\n\t\n\t\t\n\t\tHashMap<String, Double> Similarity = new HashMap<String, Double>();\n\n\t\tfor (int i = 0; i < m_reviews.size(); i++) {\n\t\t\tString content = m_reviews.get(i).getContent();\n\n\t\t\tHashMap<String, Integer> conunttf = new HashMap<String, Integer>();\n\n\t\t\tHashSet<String> biminiset = new HashSet<String>();\n \n\t\t\t//danci means word unit: one or two words\n\t\t\tArrayList danci = new ArrayList();\n\n\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\t\t\t\tif (m_stopwords.contains(token))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (token.isEmpty())\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdanci.add(PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token))));\n\n\t\t\t}\n \n\t\t\t//get word count in a document\n\t\t\tfor (int k = 0; k < danci.size(); k++) {\n\n\t\t\t\tif (conunttf.containsKey(danci.get(k).toString())) {\n\t\t\t\t\tconunttf.put(danci.get(k).toString(),\n\t\t\t\t\t\t\tconunttf.get(danci.get(k).toString()) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tconunttf.put(danci.get(k).toString(), 1);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tArrayList<String> N_gram = new ArrayList<String>();\n\n\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\n\t\t\t\ttoken = PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token)));\n\t\t\t\tif (token.isEmpty()) {\n\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\n\t\t\t\t\tN_gram.add(token);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tString[] fine = new String[N_gram.size()];\n \n\t\t\t//get rid of stopwords\n\t\t\tfor (int p = 0; p < N_gram.size() - 1; p++) {\n\t\t\t\tif (m_stopwords.contains(N_gram.get(p)))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (m_stopwords.contains(N_gram.get(p + 1)))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfine[p] = N_gram.get(p) + \"-\" + N_gram.get(p + 1);\n\n\t\t\t}\n\n\t\t\t\n\t\t\tfor (String str2 : fine) {\n\n\t\t\t\tif (conunttf.containsKey(str2)) {\n\t\t\t\t\tconunttf.put(str2, conunttf.get(str2) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tconunttf.put(str2, 1);\n\t\t\t\t}\n\t\t\t}\n \n\t\t\t//compute tf * idf for each document\n\t\t\tfor (String key : conunttf.keySet()) {\n\t\t\t\tif (m_stats.containsKey(key)) {\n\t\t\t\t\tdouble df = (double) m_stats.get(key);\n\n\t\t\t\t\tdouble idf = (1 + Math.log(102201 / df));\n\n\t\t\t\t\tdouble tf = conunttf.get(key);\n\n\t\t\t\t\tdouble result = tf * idf;\n\n\t\t\t\t\tm_idf.put(key, result);\n\t\t\t\t} else {\n\t\t\t\t\tm_idf.put(key, 0.0);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\tHashMap<String, Double> query = new HashMap<String, Double>();\n\t\t\tHashMap<String, Double> test = new HashMap<String, Double>();\n \n\t\t\t//If query contains this word, store it for future computation \n\t\t\tfor (Map.Entry<String, Double> entry : m_idf.entrySet()) {\n\t\t\t\tString key = entry.getKey();\n\t\t\t\tif (query_idf.containsKey(key)) {\n\t\t\t\t\tquery.put(key, query_idf.get(key));\n\t\t\t\t\ttest.put(key, m_idf.get(key));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdouble dotProduct = 0.00;\n\t\t\tdouble magnitude1 = 0.0;\n\t\t\tdouble magnitude2 = 0.0;\n\t\t\tdouble magnitude3 = 0.0;\n\t\t\tdouble magnitude4 = 0.0;\n\t\t\tdouble cosineSimilarity = 0;\n \n\t\t\t\n\t\t\t//compute Compute similarity between query document and each document in file\n\t\t\tfor (String cal : test.keySet()) {\n\t\t\t\tdotProduct += query.get(cal) * test.get(cal); // a.b\n\t\t\t\tmagnitude1 += Math.pow(query.get(cal), 2); // (a^2)\n\t\t\t\tmagnitude2 += Math.pow(test.get(cal), 2); // (b^2)\n\n\t\t\t\tmagnitude3 = Math.sqrt(magnitude1);// sqrt(a^2)\n\t\t\t\tmagnitude4 = Math.sqrt(magnitude2);// sqrt(b^2)\n\t\t\t}\n\n\t\t\tif (magnitude3 != 0.0 | magnitude4 != 0.0)\n\t\t\t\tcosineSimilarity = dotProduct / (magnitude3 * magnitude4);\n\n\t\t\telse\n\t\t\t\tcosineSimilarity = 0;\n\n\t\t\tSimilarity.put(content, cosineSimilarity);\n\n\t\t\t\t\t\n\n\t\t}\n\n\t\t// sort output to get 3 reviews with the highest similarity with query review\n\t\tList<Map.Entry<String, Double>> infoIds = new ArrayList<Map.Entry<String, Double>>(\n\t\t\t\tSimilarity.entrySet());\n\n\t\tCollections.sort(infoIds, new Comparator<Map.Entry<String, Double>>() {\n\t\t\tpublic int compare(Map.Entry<String, Double> o1,\n\t\t\t\t\tMap.Entry<String, Double> o2) {\n\t\t\t\treturn (int) (o1.getValue() - o2.getValue());\n\t\t\t}\n\t\t});\n\n\t\tfor (int i = infoIds.size() - 1; i > infoIds.size() - 4; i--) {\n\t\t\tEntry<String, Double> ent = infoIds.get(i);\n\t\t\tSystem.out.println(ent.getValue()+\"++\"+ent.getKey()+\"\\n\");\n\n\t\t}\n\n\t}", "@Override\n\tpublic int compare(MediaMaster em1, MediaMaster em2) {\n\t\tif(em2.getAlbum() != null && em1.getAlbum() != null){\n\t\t\tif(\"Asc\".equalsIgnoreCase(type)){\n\t\t\t\treturn em2.getAlbum().compareTo(em1.getAlbum());\n\t\t\t}else{\n\t\t\t\treturn em1.getAlbum().compareTo(em2.getAlbum());\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "@Override\n public int compare(Sample s1, Sample s2) {\n if (s1.positive_features.size() < s2.positive_features.size())\n return -1;\n else if (s1.positive_features.size() > s2.positive_features.size())\n return +1;\n else {\n for (int i = 0; i < s1.positive_features.size(); i++) {\n int v1 = s1.positive_features.get(i);\n int v2 = s2.positive_features.get(i);\n if (v1 < v2) return -1;\n if (v1 > v2) return +1;\n }\n return 0;\n }\n }", "public void compareImageAction() {\n\t\tif (selectedAnimalModel == null) {\n\t\t\tshowDialog(ERROR_MESSAGE, \"Animal needs to be saved first.\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (selectedAnimalModel.getId() == 0L || isImageChangedFlag) {\n\t\t\tshowDialog(ERROR_MESSAGE, \"Animal needs to be saved first.\");\n\t\t\treturn;\n\t\t}\n\n\t\tAsyncTask asyncTask = new AsyncTask() {\n\t\t\tAnimalModel animal1 = null;\n\t\t\tAnimalModel animal2 = null;\n\t\t\tAnimalModel animal3 = null;\n\n\t\t\t@Override\n\t\t\tprotected void onDone(boolean success) {\n\t\t\t\tif (!success) {\n\t\t\t\t\tshowDialog(ERROR_MESSAGE, \"Cannot compare images.\");\n\t\t\t\t} else {\n\t\t\t\t\tCompareImagesDialog dialog = new CompareImagesDialog(multimediaPanel, selectedAnimalModel, animal1, animal2, animal3);\n\t\t\t\t\tdialog.setVisible(true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected Boolean doInBackground() throws Exception {\n\t\t\t\ttry {\n\t\t\t\t\tArrayList<AnimalModel> models;\n\n\t\t\t\t\tmodels = DataManager.getInstance().getThreeSimilarImages(selectedAnimalModel);\n\n\t\t\t\t\tif (models.size() > 0) {\n\t\t\t\t\t\tanimal1 = models.get(0);\n\t\t\t\t\t}\n\t\t\t\t\tif (models.size() > 1) {\n\t\t\t\t\t\tanimal2 = models.get(1);\n\t\t\t\t\t}\n\t\t\t\t\tif (models.size() > 2) {\n\t\t\t\t\t\tanimal3 = models.get(2);\n\t\t\t\t\t}\n\n\t\t\t\t} catch (DataManagerException e1) {\n\t\t\t\t\tLogger.createLog(Logger.ERROR_LOG, e1.getMessage());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\tasyncTask.start();\n\n\t}", "public static boolean compare(String imgPath1, String imgPath2) throws ClassNotFoundException {\n\t\t\n\t\tDistanceEvaluator distanceEvaluator = new DistanceEvaluator(ExtractionParameters.STORAGE_FILE);\n\t \n\t\tFile img1 = new File(imgPath1);\n\t\tFile img2 = new File(imgPath2);\n\t\t\n\t\treturn (distanceEvaluator.evaluateDistance(img1, img2) <= RecognitionParameters.THRESHOLD);\n\t}", "public int compareTo(ResourceCollection other) {\n if (this.brick == other.getBrick() &&\n this.lumber == other.getLumber() &&\n this.wool == other.getWool() &&\n this.grain == other.getGrain() &&\n this.ore == other.getOre()) {\n return 0;\n } else if (this.brick < other.getBrick() ||\n this.lumber < other.getLumber() ||\n this.wool < other.getWool() ||\n this.grain < other.getGrain() ||\n this.ore < other.getOre()) {\n return -1;\n } else return 1;\n }", "@Override\n public int compare(Hive o1, Hive o2) {\n if ((o1 == null) && (o2 != null))\n return -1;\n else if ((o1 != null) && (o2 == null))\n return 1;\n else if ((o1 == null) && (o2 == null))\n return 0;\n\n long d1 = 0;\n long d2 = 0;\n\n if (o1.getCreationDate() != null)\n d1 = o1.getCreationDate().getTime();\n if (o2.getCreationDate() != null)\n d2 = o2.getCreationDate().getTime();\n\n long res = d2-d1;\n\n return ((res > Integer.MAX_VALUE)?Integer.MAX_VALUE:((res < Integer.MIN_VALUE)?Integer.MIN_VALUE:((res==0)?o1.getNameUrl().compareToIgnoreCase(o2.getNameUrl()):(int)res)));\n }", "@Override\n\t\tpublic int compare(ScoreSum lhs, ScoreSum rhs) {\n\t\t\tScoreSum temp1 = lhs;\n\t\t\tScoreSum temp2 = rhs;\n\t\t\tint num = temp1.getScore().compareTo(temp2.getScore());\n\t\t\tif (num == 0)\n\t\t\t\treturn temp1.getAthleteName().compareTo(temp2.getAthleteName());\n\t\t\treturn num;\n\t\t}", "@Override\n public int compare(PublisherInfo lhs, PublisherInfo rhs) {\n if (lhs.lastName != rhs.lastName) {\n return lhs.lastName.compareToIgnoreCase(rhs.lastName);\n\n } else {\n if (lhs.firstName != rhs.firstName) {\n return lhs.firstName.compareToIgnoreCase(rhs.firstName);\n } else {\n return lhs.middleName.compareToIgnoreCase(rhs.middleName);\n }\n }\n\n }", "@Override\n public int compareTo(Record o) {\n if (this.result - o.result > 0) {\n return 1;\n } else if (this.result - o.result < 0) {\n return -1;\n } else {\n // press time: the less, the better.\n if (this.pressTime < o.pressTime) {\n return 1;\n } else if (this.pressTime > o.pressTime) {\n return -1;\n } else {\n // total times: the more, the better.\n if (this.totalTimes > o.totalTimes) {\n return 1;\n } else if (this.totalTimes < o.totalTimes) {\n return -1;\n }\n return 0;\n }\n }\n }", "public static String compareTags(ArrayList<Token> results, ArrayList<Token> goldStandard, String key, String tagType) {\r\n\r\n if (results.size() != goldStandard.size()) {\r\n System.out.println(\"Tokens list lengths differ\");\r\n }\r\n\r\n System.out.println(\"\\n\\n\\nSTARTING COMPARISON\"\r\n + \"\\n\");\r\n\r\n int trueNegatives = 0;\r\n int falseNegatives = 0;\r\n int truePositives = 0;\r\n int falsePositives = 0;\r\n int tokenMismatches = 0;\r\n\r\n //Detect mismatches on tokens which differ between results and standard\r\n //Unless both are tagged \"other\"\r\n for (int i = 0; i < results.size(); i++) {\r\n if (!results.get(i).token.equalsIgnoreCase(goldStandard.get(i).token) // && !results.get(goldIter).tagset.equalsIgnoreCase(\"Other\")\r\n // && !goldStandard.get(goldIter).tagset.equalsIgnoreCase(\"Other\")\r\n ) {\r\n tokenMismatches++;\r\n System.out.println(\"Mismatch: \" + results.get(i).toString() + \" \\t\\t \" + goldStandard.get(i).toString());\r\n System.out.println(\"Warning: Results invalid due to \" + tokenMismatches + \" token mismatches\");\r\n }\r\n\r\n if (results.get(i).tags.get(tagType).equalsIgnoreCase(key)\r\n && goldStandard.get(i).tags.get(tagType).equalsIgnoreCase(key)) {\r\n\r\n truePositives++;\r\n\r\n } else if (goldStandard.get(i).tags.get(tagType).equalsIgnoreCase(key)\r\n && !results.get(i).tags.get(tagType).equalsIgnoreCase(key)) {\r\n\r\n falseNegatives++;\r\n\r\n } else if (results.get(i).tags.get(tagType).equalsIgnoreCase(key)\r\n && !goldStandard.get(i).tags.get(tagType).equalsIgnoreCase(key)) {\r\n falsePositives++;\r\n\r\n } else {\r\n trueNegatives++;\r\n }\r\n\r\n }\r\n\r\n assert results.size() == (trueNegatives + truePositives + falseNegatives + falsePositives);\r\n\r\n double sensitivity = (double) truePositives / (double) (falseNegatives + truePositives);\r\n double specificity = (double) trueNegatives / (double) (falsePositives + trueNegatives);\r\n\r\n String report = key;\r\n report += \"\\nSampleSize = \" + results.size();\r\n report += \"\\nTruePos = \" + truePositives;\r\n report += \"\\nFalseNeg = \" + falseNegatives;\r\n report += \"\\nFalsePos = \" + falsePositives;\r\n report += \"\\nSensitivity = \" + sensitivity;\r\n report += \"\\nSpecificity = \" + specificity;\r\n\r\n return report;\r\n\r\n }", "boolean similarCard(Card c);", "@Override\n public int compareTo(Booking other) {\n // Push new on top\n other.updateNewQuestion(); // update NEW button\n this.updateNewQuestion();\n\n\n String[] arr1 = other.time.split(\":\");\n String[] arr2 = this.time.split(\":\");\n// Date thisDate = new Date(this.getCalendarYear(), this.getCalendarMonth(), this.getCalendarDay(), Integer.getInteger(arr2[0]), Integer.getInteger(arr2[1]));\n// if (this.newQuestion != other.newQuestion) {\n// return this.newQuestion ? 1 : -1; // this is the winner\n// }\n\n\n if (this.calendarYear == other.calendarYear) {\n if (this.calendarMonth == other.calendarMonth) {\n if (this.calendarDay == other.calendarDay) {\n if (Integer.parseInt(arr2[0]) == Integer.parseInt(arr1[0])) { // hour\n if (Integer.parseInt(arr2[1]) == Integer.parseInt(arr1[1])) { // minute\n return 0;\n } else {\n return Integer.parseInt(arr1[1]) > Integer.parseInt(arr2[1]) ? -1 : 1;\n }\n } else {\n return Integer.parseInt(arr1[0]) > Integer.parseInt(arr2[0]) ? -1 : 1;\n }\n }\n else\n return other.calendarDay > this.calendarDay ? -1 : 1;\n }\n else\n return other.calendarMonth > this.calendarMonth ? -1 : 1;\n }\n else\n return other.calendarYear > this.calendarYear ? -1 : 1;\n\n\n// if (this.echo == other.echo) {\n// if (other.calendarMonth == this.calendarMonth) {\n// return 0;\n// }\n// return other.calendarMonth > this.calendarMonth ? -1 : 1;\n// }\n// return this.echo - other.echo;\n }", "@Override\n\tpublic int compare(Person p1, Person p2) {\n\t\tif(p1.getWeight() >p2.getWeight()){\n\t\n\t\treturn 1;\n\t\t}\n\t\telse if(p1.getWeight()==p2.getWeight()){\n\t\t\tif(p1.getHeight() >p2.getHeight()){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "private void compareSecondPass() {\n final int arraySize = this.oldFileNoMatch.size()\r\n + this.newFileNoMatch.size();\r\n this.compareArray = new SubsetElement[arraySize][2];\r\n final Iterator<String> oldIter = this.oldFileNoMatch.keySet()\r\n .iterator();\r\n int i = 0;\r\n while (oldIter.hasNext()) {\r\n final String key = oldIter.next();\r\n final SubsetElement oldElement = this.oldFileNoMatch.get(key);\r\n SubsetElement newElement = null;\r\n if (this.newFileNoMatch.containsKey(key)) {\r\n newElement = this.newFileNoMatch.get(key);\r\n }\r\n this.compareArray[i][0] = oldElement;\r\n this.compareArray[i][1] = newElement;\r\n i++;\r\n }\r\n // now go through the new elements and check for any that have no match.\r\n // these will be new elements with no corresponding old element\r\n final SubsetElement oldElement = null;\r\n final Iterator<String> newIter = this.newFileNoMatch.keySet()\r\n .iterator();\r\n while (newIter.hasNext()) {\r\n final String key = newIter.next();\r\n if (!this.oldFileNoMatch.containsKey(key)) {\r\n final SubsetElement newElement = this.newFileNoMatch.get(key);\r\n this.compareArray[i][0] = oldElement;\r\n this.compareArray[i][1] = newElement;\r\n i++;\r\n }\r\n\r\n }\r\n\r\n }", "public int compare(Movie a, Movie b) {\n\t\tif (a.getTicketSales()>b.getTicketSales())\n\t\t\treturn -1;\n\t\telse if (a.getTicketSales()<b.getTicketSales())\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n\t}", "@Override\n public int compare(Hive o1, Hive o2) {\n if ((o1 == null) && (o2 != null))\n return -1;\n else if ((o1 != null) && (o2 == null))\n return 1;\n else if ((o1 == null) && (o2 == null))\n return 0;\n\n int m1 = 0;\n int m2 = 0;\n\n if ((o1.getPublicChat() != null) && (o1.getPublicChat().getConversation() != null))\n m1 = o1.getPublicChat().getConversation().getCount();\n if ((o2.getPublicChat() != null) && (o2.getPublicChat().getConversation() != null))\n m2 = o2.getPublicChat().getConversation().getCount();\n\n int res = m2-m1;\n\n return ((res==0)?o1.getNameUrl().compareToIgnoreCase(o2.getNameUrl()):res);\n }", "@Override\n public int compare(CostVector o1, CostVector o2) {\n int i = 0;\n while (i < o1.getCosts().length && o1.getCosts()[i] == o2.getCosts()[i]) {\n i++;\n }\n if (i != o1.getCosts().length) {\n return o1.getCosts()[i] > o2.getCosts()[i] ? 1 : -1;\n } else {\n return 0;\n }\n }", "@Override\n public int compareTo(AudioTrackScore other) {\n if (this.isWithinRendererCapabilities != other.isWithinRendererCapabilities) {\n return this.isWithinRendererCapabilities ? 1 : -1;\n }\n if (this.preferredLanguageScore != other.preferredLanguageScore) {\n return compareInts(this.preferredLanguageScore, other.preferredLanguageScore);\n }\n if (this.isWithinConstraints != other.isWithinConstraints) {\n return this.isWithinConstraints ? 1 : -1;\n }\n if (parameters.forceLowestBitrate) {\n int bitrateComparison = compareFormatValues(bitrate, other.bitrate);\n if (bitrateComparison != 0) {\n return bitrateComparison > 0 ? -1 : 1;\n }\n }\n if (this.isDefaultSelectionFlag != other.isDefaultSelectionFlag) {\n return this.isDefaultSelectionFlag ? 1 : -1;\n }\n if (this.localeLanguageMatchIndex != other.localeLanguageMatchIndex) {\n return -compareInts(this.localeLanguageMatchIndex, other.localeLanguageMatchIndex);\n }\n if (this.localeLanguageScore != other.localeLanguageScore) {\n return compareInts(this.localeLanguageScore, other.localeLanguageScore);\n }\n // If the formats are within constraints and renderer capabilities then prefer higher values\n // of channel count, sample rate and bit rate in that order. Otherwise, prefer lower values.\n int resultSign = isWithinConstraints && isWithinRendererCapabilities ? 1 : -1;\n if (this.channelCount != other.channelCount) {\n return resultSign * compareInts(this.channelCount, other.channelCount);\n }\n if (this.sampleRate != other.sampleRate) {\n return resultSign * compareInts(this.sampleRate, other.sampleRate);\n }\n if (Util.areEqual(this.language, other.language)) {\n // Only compare bit rates of tracks with the same or unknown language.\n return resultSign * compareInts(this.bitrate, other.bitrate);\n }\n return 0;\n }", "private void sortAlphabet()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }", "public int compare(PartialAlignment x, PartialAlignment y) {\n\t\t\tint matchDiff = (y.matches1 + y.matches2)\n\t\t\t\t\t- (x.matches1 + x.matches2);\n\t\t\tif (matchDiff > 0) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (matchDiff < 0) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\t// 3 - Total words covered (more)\n\t\t\tint allMatchDiff = (y.allMatches1 + y.allMatches2)\n\t\t\t\t\t- (x.allMatches1 + x.allMatches2);\n\t\t\tif (allMatchDiff > 0) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (allMatchDiff < 0) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\t// 4 - Number of chunks (less)\n\t\t\tint chunkDiff = x.chunks - y.chunks;\n\t\t\tif (chunkDiff != 0)\n\t\t\t\treturn chunkDiff;\n\t\t\t// 5 - Absolute match distance (less)\n\t\t\treturn x.distance - y.distance;\n\t\t}", "public abstract void compare();", "public void spotifyMatchSong(Messenger handler,String res, int playlistPos, Song currentTrack, boolean lastSearch){\n try {\n JSONArray songArray = new JSONObject(res).getJSONObject(\"tracks\").getJSONArray(\"items\");\n int songPos = -1;\n int diffName = 900;\n boolean matched = false;\n\n for(int i = 0; i < songArray.length(); i++){\n //Spotify current track details\n JSONObject songObject = songArray.getJSONObject(i);\n String artistName = \"\";\n for(int j = 0; j < songObject.getJSONArray(\"artists\").length(); j++){\n artistName = artistName + songObject.getJSONArray(\"artists\").getJSONObject(j).getString(\"name\");\n\n if(j + 1 >= songObject.getJSONArray(\"artists\").length()){\n\n } else {\n artistName = artistName + \", \";\n }\n }\n artistName = deAccent(artistName);\n String songName = songObject.getString(\"name\").replace(\"(\", \"\")\n .replace(\")\", \"\").replace(\"-\", \"\");\n songName = deAccent(songName);\n songName = removeFeat(songName);\n String albumName = songObject.getJSONObject(\"album\")\n .getString(\"name\");\n\n\n //source current track details\n String sourceArtist = currentTrack.getArtist();\n sourceArtist = deAccent(sourceArtist);\n sourceArtist = sourceArtist.replace(\"&\", \"\");\n String sourceName = currentTrack.getTrack().replace(\"(\", \"\")\n .replace(\")\", \"\").replace(\"-\", \"\");\n sourceName = deAccent(sourceName);\n sourceName = removeFeat(sourceName);\n String sourceAlbum = currentTrack.getAlbum();\n\n int diff = sourceName.compareToIgnoreCase(songName);\n\n Log.v(TAG,\"Comparison:Source \" + sourceArtist + \" : \" + sourceName +\n \" vs Spotify \" + artistName + \" : \" + songName);\n\n Log.v(TAG, \"Compare Value = Artist Name: \" +\n artistName.compareToIgnoreCase(sourceArtist) + \" song name: \" +\n diff);\n\n if(artistName.toLowerCase().contains(sourceArtist.toLowerCase()) ||\n sourceArtist.toLowerCase().contains(artistName.toLowerCase()) ||\n artistName.compareToIgnoreCase(sourceArtist) >= 0){\n\n if(sourceName.toLowerCase().contains(songName.toLowerCase()) ||\n diff >= 0){\n\n //exact match\n if(sourceName.compareToIgnoreCase(songName) == 0) {\n Log.v(TAG, \"Song Matched! \" + songName);\n Song song = new Song(artistName, songName, albumName);\n song.setId(songObject.getString(\"id\"));\n transferPlaylists.get(playlistPos).addTrack(song);\n matched = true;\n songsFound+=1;\n updateMessage(handler, 2);\n break;\n }\n\n //Not an exact match, search and find the closest to zero.\n else {\n\n //test against last one\n if(diff < diffName) {\n songPos = i;\n diffName = diff;\n }\n\n }\n\n }\n }\n }\n\n //testing results\n if(diffName != 900 && !matched){\n\n //Spotify track details\n JSONObject songObject = songArray.getJSONObject(songPos);\n String artistName = \"\";\n for(int j = 0; j < songObject.getJSONArray(\"artists\").length(); j++){\n artistName = artistName + songObject.getJSONArray(\"artists\").getJSONObject(j).getString(\"name\");\n\n if(j + 1 >= songObject.getJSONArray(\"artists\").length()){\n\n } else {\n artistName = artistName + \", \";\n }\n }\n artistName = deAccent(artistName);\n String songName = songObject.getString(\"name\").replace(\"(\", \"\")\n .replace(\")\", \"\").replace(\"-\", \"\");\n songName = deAccent(songName);\n songName = removeFeat(songName);\n String albumName = songObject.getJSONObject(\"album\")\n .getString(\"name\");\n\n Log.v(TAG, \"Song Matched! \" + songName);\n Song song = new Song(artistName, songName, albumName);\n song.setId(songObject.getString(\"id\"));\n transferPlaylists.get(playlistPos).addTrack(song);\n songsFound+=1;\n updateMessage(handler, 2);\n\n } else if(matched){\n //do nothing, we matched\n } else {\n //retest with another search query\n if(!lastSearch) {\n apiFindSongReverseSearchSpotify(handler,currentTrack, playlistPos);\n } else {\n transferPlaylists.get(playlistPos).addUnMatchedTracks(currentTrack);\n songsNotFound+=1;\n Log.e(TAG, \"NOT FOUND \" + currentTrack.getTrack());\n updateMessage(handler, 2);\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n //array or response body error, retry call artist only\n if(!lastSearch) {\n apiFindSongReverseSearchSpotify(handler,currentTrack, playlistPos);\n } else {\n transferPlaylists.get(playlistPos).addUnMatchedTracks(currentTrack);\n songsNotFound+=1;\n updateMessage(handler, 2);\n }\n }\n }", "static boolean compareArrays(double[] testArray1, double[] testArray2 ) {\n\t\tdouble arrayOneAverage = averageDoubleArray(testArray1); \n\t\tdouble arrayTwoAverage = averageDoubleArray(testArray2); \n\t\t\n\t\tif (arrayOneAverage > arrayTwoAverage)\n\t\t\treturn true;\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n\tpublic int compareTo(Media o) {\n\t\treturn this.title.compareTo(o.title);\n\n\t}", "public int compare(Object a, Object b) {\n if (a == b) {\n return 0;\n }\n CountedObject ca = (CountedObject)a;\n CountedObject cb = (CountedObject)b;\n int countA = ca.count;\n int countB = cb.count;\n if (countA < countB) {\n return 1;\n }\n if (countA > countB) {\n return -1;\n }\n return 0;\n }", "@Test void compareToNaive() {\n\t\tfor (var type : new ImageType[]{ImageType.SB_U8, ImageType.SB_U16, ImageType.SB_F32, ImageType.SB_F64}) {\n\t\t\tvar src = (ImageGray)type.createImage(width, height);\n\t\t\tvar dst = (ImageGray)type.createImage(1, 1);\n\n\t\t\tGImageMiscOps.fillUniform(src, rand, 0, 100);\n\n\t\t\tdouble mean = GImageStatistics.mean(src);\n\t\t\tGeometricMeanFilter.filter(src, radiusX, radiusY, mean, dst);\n\n\t\t\tassertEquals(width, dst.width);\n\t\t\tassertEquals(height, dst.height);\n\n\t\t\tfor (int y = 0; y < dst.height; y++) {\n\t\t\t\tfor (int x = 0; x < dst.width; x++) {\n\t\t\t\t\tdouble found = GeneralizedImageOps.get(dst, x, y);\n\t\t\t\t\tassertEquals(naiveMean(src, x, y, radiusX, radiusY), found, 1.0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public int compareTo(Movie m)\n\t{\n\t\treturn this.year - m.year; //by year\n\t\t//return (int)this.name - m.name; //by name\n\t\t//return (int)(10*(this.rating - m.rating)); //by rating\n\t}", "final int compareMagnitude(BigInteger val) {\n int[] m1 = mag;\n int len1 = m1.length;\n int[] m2 = val.mag;\n int len2 = m2.length;\n if (len1 < len2)\n return -1;\n if (len1 > len2)\n return 1;\n for (int i = 0; i < len1; i++) {\n int a = m1[i];\n int b = m2[i];\n if (a != b)\n return ((a & LONG_MASK) < (b & LONG_MASK)) ? -1 : 1;\n }\n return 0;\n }", "@Override\n\tpublic int compare(HashMap<K, V> a, HashMap<K, V> b) {\n\t\tint comparison = 0;\n\t\tint counter = 0;\n\t\t/*\n\t\t * If the first keyToSortWith is the same in both HashMaps, sort by the\n\t\t * next keyToSortWith\n\t\t */\n\t\twhile ((comparison == 0) && (counter < keysToSortWith.length)) {\n\t\t\tcomparison = a.get(keysToSortWith[counter]).compareTo(\n\t\t\t\t\tb.get(keysToSortWith[counter]));\n\t\t\tcounter++;\n\t\t}\n\t\t/*\n\t\t * If the current keyToSortWith is supposed to be sorted negatively\n\t\t * (according to the reverse array), returns the opposite result\n\t\t */\n\t\tif (reverse[counter - 1] == true) {\n\t\t\treturn comparison * (-1);\n\t\t}\n\t\treturn comparison;\n\t}", "@Override\r\n public int compareTo(final QueryResultEntry comparative) {\r\n return (mScore > comparative.mScore ? -1 : (mScore == comparative.mScore ? 0 : 1));\r\n }" ]
[ "0.6057984", "0.5894393", "0.5823175", "0.57840365", "0.5657731", "0.55345565", "0.5527331", "0.5519055", "0.547205", "0.54630864", "0.5438886", "0.5430906", "0.5426983", "0.5422265", "0.54204756", "0.5406537", "0.5399323", "0.53847736", "0.5383247", "0.53565717", "0.53480446", "0.5313341", "0.5309642", "0.5269091", "0.52618897", "0.52518594", "0.5228806", "0.5225864", "0.52238053", "0.52214813", "0.52177876", "0.52102834", "0.5199495", "0.5192129", "0.51908773", "0.51853496", "0.51768327", "0.516205", "0.51607066", "0.51596606", "0.5159339", "0.5151317", "0.5144863", "0.5121533", "0.5116799", "0.5112675", "0.51078063", "0.50925577", "0.50862366", "0.5082095", "0.5076006", "0.50733984", "0.5060552", "0.5055586", "0.50467527", "0.5045568", "0.5044165", "0.5029108", "0.50261414", "0.5023205", "0.50147384", "0.50074977", "0.5005488", "0.50047517", "0.4993069", "0.49905604", "0.49884143", "0.49825275", "0.49754733", "0.49728906", "0.49639848", "0.49617046", "0.49584523", "0.49574706", "0.49488735", "0.49484855", "0.49482632", "0.49466547", "0.49405044", "0.4939341", "0.49365103", "0.49332917", "0.49321017", "0.49266085", "0.49188703", "0.49170214", "0.49131265", "0.49097696", "0.49070966", "0.49017754", "0.49008575", "0.48943257", "0.48876446", "0.48872632", "0.4886358", "0.48831367", "0.48815477", "0.4879709", "0.48735544", "0.487335" ]
0.76007366
0
Main method to test out the other three methods (Product, Sum, and Average)
public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Input 3 Numbers"); int a = input.nextInt(); int b = input.nextInt(); int c = input.nextInt(); int method; method = Product(a,b,c); System.out.println("The product is: " + method); System.out.println("\nInclude two more numbers"); int o = input.nextInt(); int p = input.nextInt(); int method2; method2 = SumTwo(a,b); System.out.println("\nThe Sum of these numbers are: " + method2); int method3; System.out.println("\nEnter one more number:"); method3 = input.nextInt(); double avg = AverageInt(method3); System.out.println("The average between number" + method3 + " and avg is: " + avg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String... args) {\n sumOfArrayDemo();\n\n //Sum of List Example\n sumOfListDemo();\n\n //Sum of List of Array Example\n sumOfListOfArrayDemo();\n\n //Sum of Map Example\n sumOfMapValues();\n\n }", "@Test\r\n\tpublic void testProduct() {\n\t\tnum1 = 10;\r\n\t\tnum2 = 2;\r\n\t\tresult = calculate.product(num1, num2); //result of the divide is stored\r\n\t\texpected = 5;\r\n\t\t\r\n\t\tassertEquals(expected,result);// compares the expected to the divide, if they are not the same an error occurs\r\n\t}", "public static void main(String[] args) {\r\n ArrayList<Integer> testDataInteger = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5)); // An array of Integer data \r\n ArrayList<Double> testDataDouble = new ArrayList<>(Arrays.asList(2.2, 3.3, 66.2, 17.5, 30.2, 31.1)); // An array of double data\r\n\r\n System.out.printf(\"The sum of the Integer array = %.0f\\n\", computeSum(testDataInteger, true)); // Print result of all Integer data's sum\r\n\r\n System.out.printf(\"The average of the Integer test set = %.0f\\n\", computeAverage(testDataInteger, true)); // Print result of all Integer data's Average\r\n System.out.printf(\"The average of the Double test set = %.2f\\n\", computeAverage(testDataDouble, true)); // Print result of all Double data's Average\r\n\r\n System.out.printf(\"The median value of the Integer data set = %.1f\\n\", computeMedian(testDataInteger)); // Print result of all Integer data's Median\r\n System.out.printf(\"The median value of the Double data set = %.1f\\n\", computeMedian(testDataDouble)); // Print result of all Double data's Median\r\n\r\n System.out.printf(\"The sample standard deviation of the Integer test set = %.2f\\n\", computeStandardDeviation(testDataInteger)); // Print result of all Integer data's Standard Deviation\r\n System.out.printf(\"The sample standard deviation of the Double test set = %.2f\\n\", computeStandardDeviation(testDataDouble)); // Print result of all Double data's Standard Deviation\r\n }", "public static void main(String[] args) {\r\n\t\tcalculateSum(3.4, 1.8);\r\n\t\tcalculation(2, 3);\r\n\t\tcalculation(2, 3, 4);\r\n\t\tcalculation(5, \"7\");\r\n\t\t\r\n\t\t// If you change the number of parameters, or the data type of parameters\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tTest1 obj = new Test1();\n\t\tobj.Mult();\n\t\tobj.Mult(5,5,5);\n\t\tobj.sum();\n\t\tobj.sum(1,2,3);\n\n\t}", "@Test\n void testCalculations() {\n double addition = calculator.add(10, 2);\n double subtraction = calculator.sub(10, 2);\n double multiplication = calculator.mul(10, 2);\n double division = calculator.div(10, 2);\n\n //Then\n assertEquals(12, addition);\n assertEquals(8, subtraction);\n assertEquals(20, multiplication);\n assertEquals(5, division);\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\t\r\n\t\tMath.plus(5, 10);\r\n\t\tMath.plus(2.2, 3.4);\r\n\t\t\r\n\t\t/*\r\n\t\tMath myMath = new Math();\r\n\t\t\r\n\t\tint sum01 = myMath.plus(3,4);\r\n\t\tSystem.out.println(sum01);\r\n\t\t\r\n\t\tdouble sum02 =myMath.plus(2.3,3.2);\r\n\t\tSystem.out.println(sum02);\r\n\t\t*/\r\n\t}", "public static void main(String[] args) {\n\t\tint num1 = 7;\r\n\t\tint num2 = 6;\r\n\t\t\r\n\t\tmathOps ops1 = new mathOps();\r\n\t\tSystem.out.println(\"sum = \" +ops1.addition(num1, num2));\r\n\t\tSystem.out.println(\"sub = \" +ops1.substraction(num1, num2));\r\n\t\tSystem.out.println(\"mul = \" +ops1.multiply(num1, num2));\r\n\t\tSystem.out.println(\"div = \" +ops1.divide(num1, num2));\r\n\t}", "public static void main(String[] args) {\n Math math=new Math();\n System.out.println(math.sum(5, 13));\t\n\t System.out.println(math.sub(13, 5));\n\t System.out.println(math.mult(13, 5));\n\t System.out.println(\"Bölüm :\"+ math.divide(13, 5));\n\t System.out.println(math.getpi());\n\t System.out.println(math.areaOfCircle(5));\n\t System.out.println(math.volumeOfShpere(3));\n\t System.out.println(math.areaOfRectangularPrism(3, 4, 6));\n System.out.println(\"üçgenin Alanı :\"+math.areaOfTriangle(5, 4, 2));\n\t System.out.println(\"Üçgenin Çevresi :\"+math.perimeterOfTriangle(5, 4, 2));\t\n\t System.out.println(math.factoriyel(5));\n\t System.out.println(math.sumOfSmallNumbers(6));\n\t// System.out.println(math.theSumOfTheNumbersBetween(3, 6));\n\t}", "public static void main(String[] args) {\n\t\tCal c = new Cal();\n\t\tc.setOperands(10, 20, 30);\n\t\tSystem.out.println(c.sum());\n\t\tSystem.out.println(c.avg());\n\t}", "public static void main(String[] args) {\r\n\t\tSystem.out.println(\"Testing Calculator\");\r\n\t\ttestConstructors();\r\n\t\ttestSetters();\r\n\t\ttestGetters();\r\n\t\ttestToString();\r\n\t}", "public static void main(String[] args)\n\t{\n\t int sum = Compute.sum(3, 4);\n\t\t//int sum = c.sum(3, 4);\n\t\tSystem.out.println(sum);\n\t\t\n\t\tint sum1 = Compute.sum(5,1,2);\n\t\tSystem.out.println(sum1);\n\t\t\n\t\tdouble sum2 = Compute.sum(4.5,3.9);\n\t\tSystem.out.println(sum2);\n\t}", "public static void main(String [] args) {\r\n\t\ttestOne(); //adds items to WH; tests getNumItems method & toString method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestTwo(); //tests getItem(String) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestThree(); //test getItem(Item) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFour(); //tests total cost method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFive(); //this will test the getRefrigeratedItems method\r\n\t\tSystem.out.print(\"\\n\"); \r\n\t\ttestSix(); //tests getTotalCostRefrigerated method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestSeven(); //tests remove method\r\n\t}", "public static void main(String[] args) {\n\t\tCalculator calculator =new Calculator();\n\n\t\tint add=calculator.add(10, 20);\n\t\tint sub=calculator.sub(10, 20);\n\t\tint mul=calculator.mul(10, 20);\n\t\tdouble div=calculator.div(10, 20);\n\t\t\n\t\tcalculator.displaySum(add, sub, mul, div);\n\t}", "@Test\r\n\tpublic void testSum() { //testing the adding method\r\n\t\tnum1 = 2; \r\n\t\tnum2 = 8;\r\n\t\tresult = calculate.sum(num1, num2); //result stores the method of add\r\n\t\texpected = 10;\r\n\t\t\r\n\t\tassertEquals(expected,result); //compares add to the expected, if no match then error \r\n\t}", "@Test\n public void testMultiplyAll() {\n System.out.println(\"multiplyAll\");\n int multiplier = 0;\n int[] numbers = null;\n int[] expResult = null;\n int[] result = ArrayExerciseB.multiplyAll(multiplier, numbers);\n assertArrayEquals(expResult, result);\n }", "public static void main(String[] args) {\r\n\r\n BasicMath one = new BasicMath();\r\n \r\n System.out.println();\r\n System.out.println(\"Integer calculations:\");\r\n\r\n one.integerAddition();\r\n one.integerSubtraction();\r\n one.integerMultiplication();\r\n one.integerDivisionWrong();\r\n one.integerDivisionRight();\r\n \r\n System.out.println();\r\n System.out.println(\"Floating Point calculations:\");\r\n\r\n one.doubleAddition();\r\n one.doubleSubtraction();\r\n one.doubleMultiplication();\r\n one.doubleDivision();\r\n \r\n System.out.println();\r\n \r\n }", "@Test\n public void testSum() {\n Calculator calculator = new Calculator();\n \n int sumResult = calculator.sum(5, 7);\n \n Assert.assertEquals(12, sumResult);\n }", "public static void main(String[] args) {\n\t\tMyCalculator Mycalculator = new MyCalculator();\n\n added a line in feature 1\n\n\n\n\n\n\t\t// multiply 2 numners\n\t\tint int1 = 5;\n\t\tint int2 = 10;\n\t\tint prod = Mycalculator.Mult(int1, int2);\n\t\tSystem.out.println(\"Product of \" + int1 + \" and \" + int2 + \" is \" + prod);\n\n\t\t// add to numbers\n\t\tint1 = 5;\n\t\tint2 = 10;\n\t\tint sum = Mycalculator.Sum(int1, int2);\n\t\tSystem.out.println(\"Sum of \" + int1 + \" and \" + int2+ \" is \" + sum);\n\n\t\t// calculate quotient\n\t\tdouble d1 = 5;\n\t\tdouble d2 = 10;\n\t\tdouble q = Mycalculator.Quot(d1, d2);\n\t\tSystem.out.println(\"quotient of \" + d1 + \" and \" + d2 + \" is \" + q);\n\n\n\t\t// calculate hypotenuse\n\t\tdouble side1 = 3.0;\n\t\tdouble side2 = 4.0;\n\t\tdouble hypot = Mycalculator.Hypot(side1, side2);\n\t\tSystem.out.println(\"hypot of \" + side1 + \" and \" + side2 + \" is \" + hypot);\n\n\n\t\t// get a random number betewwn 1 and 10\n\t\tint rnd = Mycalculator.Random();\n\t\tSystem.out.println(\"random numner = \" + rnd);\n\n\t\t// calculate square root\n\t\tint1 = 9;\n\t\tdouble sr = Mycalculator.SquareRoot(int1);\n\t\tSystem.out.println(\"square root of \" + int1 +\" is \" + sr);\n\n\t}", "public static void main(String[] args) {\n\n MethodOverloading mo = new MethodOverloading();\n mo.sum();\n int s1 = mo.sum(4,9,7);\n System.out.println(\"With three params sum is : \"+s1);\n int s2 = mo.sum(6,8);\n System.out.println(\"With two params sum is : \"+s2);\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tPolymorphism obj = new Polymorphism();\n\t\tSystem.out.println(obj.sum(10, 20));\n\t\tSystem.out.println(obj.sum(10, 20, 30));\n\t\tSystem.out.println(obj.sum(10.5, 20.5));\n\n\t}", "public static void main(String[] args) {\n\t\tint division = division(60,15);\n\t\tSystem.out.println(\"The result of division is: \" + division);\n\t\t\n\t\tint pow = pow(2,3);\n\t\tSystem.out.println(\"The result of power is: \" + pow);\n\t\t\n\t\tint factorial = factorial(5);\n\t\tSystem.out.println(\"The result of factorial is: \" + factorial);\n\t\t\n\t\tint array[] = {1,3,4};\n\t\tint total = sumValues(array, 0);\n\t\tSystem.out.println(\"The result of sum of values in array is: \" + total);\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\r\n\t\tInterest obj = Calculator.getInterest();\r\n\t\tSystem.out.println(obj.calcSimple(5000, 2, 4));\r\n\t\tSystem.out.println(obj.calcCompound(5000, 4, 3));\r\n\t\tSystem.out.println(obj.convertToBinary(12));\r\n\t\tSystem.out.println(obj.doSum(6,8,15));\r\n\t\tSystem.out.println(obj.doAvg(14,65,87));\r\n\t}", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tProductTest pt = new ProductTest();\r\n\t\tTV tv = new TV(\"좋은 TV\", 1999000, \"정말 좋은 티비입니다\", 1, 32);\r\n\t\tRefrigerator rg = new Refrigerator(\"좋은 냉장고\", 2000000, \"정말 좋은 냉장고입니다.\",2, \"삼성\");\r\n\t\t\r\n\t\tpt.addProduct(tv);\r\n\t\tpt.addProduct(rg);\r\n\t\t\r\n\t\tpt.searchProduct();\r\n\t\tpt.searchProductUsingtag(3);\r\n\t\tpt.searchProductOrderByitem(\"좋은 TV\");\r\n\t\tpt.searchTV();\r\n\t\tpt.searchRefrigerator();\r\n\t\tpt.removeItem(1);\r\n\t\tpt.getSum();\r\n\t}", "public static void main(String[] args) {\n System.out.println(\"Start of code\");\r\n\t\t\r\n\t\tmyAdd();\r\n\t\tmyAdd();\r\n\t\tmyAdd();\r\n\t\tmyMultiple(15,23);\r\n\t\tmyMultiple(15,22);\r\n\t\t\r\n\t\tint a= myDivision(100,5);\r\n\t\tSystem.out.println(\"Value of s is \"+a);\r\n\t\t\r\n\t\tint b= myDivision(100,15);\r\n\t\tSystem.out.println(\"Value of s is \"+b);\r\n \r\n\t\tSystem.out.println(\"End of code\");\r\n\t}", "public static void main(String[] args)//Start of main Class\n\t{\n\t\t\n\t\tsum();//call to no parameter sum()\n\t\tsum(1);//call to one parameter sum(x)\n\t\tsum(6,7);\n\t\tsum(6.0);\n\t}", "public static void main(String[] args) {\n\r\n\t\tMethodCalling_Multiply mul = new MethodCalling_Multiply();\r\n\t\tint result = mul.multiply(10, 20);\r\n\t\tSystem.out.println(result);\t\t\t//OR\r\n\t\t\r\n\t\tSystem.out.println(mul.multiply(5, 6));\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tint[] a = {1,2,3,4,5};\n\t\tint sum = sumArray(a);\n\t\tSystem.out.println(sum);\n\t\tint result = multiply(5,10);\n System.out.println(result);\n\t}", "public void TestMain(){\n SampleStatements();\n TestMyPow();\n }", "public static void main(String... args) {\n bigDecimalSumUsingList();\n\n //BigDecimal Sum Using Array\n bigDecimalSumUsingArray();\n\n //BigDecimal Sum Using Map\n bigDecimalSumUsingMap();\n }", "public static void main(String[] args) {\n\t\tcalculator c=new calculator();\n\t\tc.calculate(2, 3);\n\t\tscientific_calculator sc=new scientific_calculator();\n\t\tsc.calculate(2, 3);\n\t\thybrid_calculator hc=new hybrid_calculator();\n\t\thc.calculate(2, 3);\n\n\t}", "public static void main(String[] args) {\n ArithmeticFunctions functions = new ArithmeticFunctions();\n // IMPLEMENTING THE METHODS FROM THE CHILD CLASS\n System.out.println(\"10 + 5 = \"+functions.addition(10,5));\n System.out.println(\"10 - 5 = \"+functions.subtraction(10,5));\n System.out.println(\"10 * 5 = \"+functions.multiplication(10,5));\n System.out.println(\"10 / 5 = \"+functions.division(10,5)+\"\\n\");\n }", "public void runDemo()\n {\n demoAddProduct(); // test we can add items to the list (test printing all the list)\n demoRemoveProduct(); // this will delete the product in the list, the list now has 0 items\n demoRenameProduct(); // this will add a product to the list and rename it, the list now has 1 items\n demoLowStock(); // this test finds a product which is low on stock\n demoFindId(); // this test does not add any products to the list, the \"findProduct\" method will search through all the list of products\n demoGetMatchingName(); // this test does not add any products to the list, the \"getMatchingName\" method will search through all the list of products\n demoDeliver(); // this test does not add any products to the list, its using the product added in the rename test \n demoSellProducts(); // this test does not add any products to the list, its using the product added in the rename test \n demoAddProductWhenTheresAlreadyOne(); // this test attempts to add a product which is already listed\n demoSellProductsWhensStocksTooLow(); // this test is to sell a product when there isn't enough stock\n demoRemoveProductWhichDoesNotExist(); // this test is to remove a product that doesn't exist\n }", "public static void main(String[] args) {\n NumberFact a, b;\n a = new NumberFact(1_000);\n b = new NumberFact(999);\n\n ArithmeticOperator x, y;\n x = new ArithmeticOperator('*', a, b);\n y = new ArithmeticOperator('+', x, b);\n\n System.out.println(y);\n System.out.println(y.eval());\n }", "public static void main(String[] args) {\n\t\tSum sum_obj = new Sum();\n\t\tSystem.out.println(sum_obj.add(1,1));\n\t\tSystem.out.println(sum_obj.add(1,1,1));\n\t\tSystem.out.println(sum_obj.add(2,2.5));\n\t\tSystem.out.println(sum_obj.add(2.5,3));\n\t}", "public static void main(String[] args) {\n\t\tint[] array = {10,12,13,11,15,16,14};\r\n\t\tfloat total = MyMath.total(array);\r\n\t\tfloat ave = MyMath.ave(array);\r\n\t\tfloat var = MyMath.variance(array);\r\n\t\tfloat stdev = MyMath.stdev(array);\r\n\t\t\r\n\t\tSystem.out.println(\"입력값\\t: \" + Arrays.toString(array));\r\n\t\tSystem.out.println(\"총점\\t: \" + total);\r\n\t\tSystem.out.println(\"평균\\t: \" + ave);\r\n\t\tSystem.out.println(\"분산\\t: \" + var);\r\n\t\tSystem.out.println(\"표준편차\\t: \" + stdev);\r\n\t}", "public static void main(String[] args){\n\t\tSystem.out.println(\"Resultado1: (a + b) = \" + Operaciones.sumar(3,4));\n\t\tSystem.out.println();\n\n\t\t//Metodo int double\n\t\tSystem.out.println(\"Resultado2: (a + b) = \" + Operaciones.sumar(5,4.1));\n\t\tSystem.out.println();\n\n\t\t//Metodo double int\n\t\tSystem.out.println(\"Resultado3: (a + b) = \" + Operaciones.sumar(7.1,6));\n\t\tSystem.out.println();\n\n\t\t//¿Cúal es el metodo que se manda a llamar si utilizamos los siguientes argumentos?\n\t\tSystem.out.println(\"Resultado4: (a + b) = \" + Operaciones.sumar(3,4L)); //Se manda a llamar un (int,double) ya que un double y un long son de 64 bytes\n\t\tSystem.out.println();\n\n\t\t//¿Cúal es el metodo que se manda a llamar si utilizamos los siguientes argumentos?\n\t\tSystem.out.println(\"Resultado4: (a + b) = \" + Operaciones.sumar(5F,'A')); //Se manda a llamar un (double,int) ya que un \"float\" lo soporta un \"double\" y el \"char\" lo soporta el \"int\"\n\t\tSystem.out.println();\n\t}", "@Test\n\tpublic void calculateTest(){\n\t\tAssertions.assertThat(calculate(\"5*5\")).isEqualTo(25);\n\t}", "public static void main(String[] args) {\n\t\t\t\t\t\t\r\n\t\tint num1 = 100;\r\n\t\tint num2 = 50;\r\n\t\t\r\n\t\tCalcOperation calc = new CalcOperation();\r\n\t\t\r\n\t\tSystem.out.println(\"Addition of \"+num1+\" and \"+num2+\" is: \"+calc.addition(num1, num2));\r\n\t\tSystem.out.println(\"Subraction of \"+num1+\" and \"+num2+\" is: \"+calc.subraction(num1, num2));\r\n\t\tSystem.out.println(\"Multiplication of \"+num1+\" and \"+num2+\" is: \"+calc.multipliation(num1, num2));\r\n\t\tSystem.out.println(\"Division of \"+num1+\" and \"+num2+\" is: \"+calc.division(num1, num2));\r\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tProduct item1 = new Product(\"Toaster\", 29.95);\n\t\tSystem.out.print(item1.getName());\n\t\tSystem.out.println(item1.getPrice());\n\t\tProduct item2 = new Product(\"Coffee Maker\", 19.95);\n\t\tSystem.out.print(item2.getName());\n\t\tSystem.out.println(item2.getPrice());\n\t\tSystem.out.println(1+2+3+4);\n\t\t\n\t\tString itemName = JOptionPane.showInputDialog(null, \"Please input the name of the item\");\n\t\tString itemPrice = JOptionPane.showInputDialog(null, \"Please input the price of the item\");\n\t\t\n\t\tdouble item3Price = Double.parseDouble(itemPrice);\n\t\t\n\t\tProduct item3 = new Product(itemName, item3Price);\n\t\titem1.reducePrice(5.00);\n\t\tSystem.out.println(item1.getPrice());\n\t\titem2.reducePrice(5.00);\n\t\tSystem.out.println(item2.getPrice());\n\t\tSystem.out.println(itemName);\n\t\tSystem.out.println(itemPrice);\n\t\titem3.reducePrice(5.00);\n\t\tSystem.out.println(item3.getPrice());\n\t\t\n\n\t}", "public static void main(String[] args) {\n int num1 = 5;\r\n int num2 = 10;\r\n NumOperation opr1 = new NumOperation();\r\n NumOperation opr2 = new NumOperation2();\r\n System.out.println(\"Addition of 5 and 10 is : \" + opr1.numCalc(num1, num2));\r\n System.out.println(\"Multiplication of 5 and 10 is : \" + opr2.numCalc(num1, num2));\t\r\n\t\t\r\n\t}", "@Test //This is integration test\r\n\tpublic void testCalculatePrice01() throws Exception\r\n\t{\n\t\tImportInformation information = new ImportInformation();\r\n\t\tinformation.importMenu(\"Food_Data_Test1\");\r\n\t\tinformation.importUserInput();\t\r\n\t\tCalculation calcPrice = new Calculation();\r\n\t\tcalcPrice.calculatePrice(information.getMenu(),information.getUserInput());\r\n\t\t// compare the object itself and its side effects instead of String output, the string output can be done in main.\r\n\t\tArrayList<Food> exspectedFoodList = new ArrayList<Food>();\r\n\t\tArrayList<Combination> exspectedCombinationList = new ArrayList<Combination>();\r\n\t\tassertEquals(exspectedCombinationList, calcPrice.getResult());\r\n\t}", "@Test //This is integration test\r\n\tpublic void testCalculatePrice02() throws Exception\r\n\t{\n\t\tImportInformation information = new ImportInformation();\r\n\t\tinformation.importMenu(\"Food_Data_Test1\");\r\n\t\tinformation.importUserInput();\t\r\n\t\tCalculation calcPrice = new Calculation();\r\n\t\tcalcPrice.calculatePrice(information.getMenu(),information.getUserInput());\r\n\t\t// compare the object itself and its side effects instead of String output, the string output can be done in main.\r\n\t\tArrayList<Food> exspectedFoodList = new ArrayList<Food>();\r\n\t\texspectedFoodList.add(new Appetizer(\"Salad\",Food.foodType.APPETIZER, \"55\"));\r\n\t\tArrayList<Combination> exspectedCombinationList = new ArrayList<Combination>();\r\n\t\texspectedCombinationList.add(new Combination(exspectedFoodList));\r\n\t\t\r\n\t\tint combinationCounter = 0;\r\n\t\tint foodCounter = 0;\r\n\t\tfor(Combination actualCombination : calcPrice.getResult())\r\n\t\t{\r\n\t\t\tfor(Food actualFood : actualCombination.getFoodCombination())\r\n\t\t\t{\r\n\t\t\t\tassertEquals(exspectedCombinationList.get(combinationCounter).getFoodCombination().get(foodCounter).getFoodName(), actualFood.getFoodName());\r\n\t\t\t\tfoodCounter++;\r\n\t\t\t}\r\n\t\t\tcombinationCounter++;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\r\n TestRunner.run(MathUtilTest.class);\r\n }", "public static final void main(String... strings) {\n\t\tMathematics sum = (x, y) -> x + y;\n\t\t// Uso de interface funcional para resta\n\t\tMathematics subtraction = (x, y) -> x - y;\n\t\t// Uso de interface funcional para multiplicacion\n\t\tMathematics mult = (x, y) -> x * y;\n\t\t// Uso de interface funcional para division\n\t\tMathematics div = (x, y) -> x / y;\n\n\t\tSystem.out.println(\"El resultado de la suma es: \" + sum.operation(15, 10));\n\t\tSystem.out.println(\"El resultado de la suma es: \" + subtraction.operation(15, 10));\n\t\tSystem.out.println(\"El resultado de la suma es: \" + mult.operation(15, 10));\n\t\tSystem.out.println(\"El resultado de la suma es: \" + div.operation(15, 10));\n\n\t}", "public static void main(String[] args) {\n MathOp add=new MathOp() {\n \t \n public int operation(int x, int y)\n {\n \t return x+y;\n }\n\t };\n\t System.out.println(add.operation(1, 2));\n \n\t MathOp sub=new MathOp() {\n \t \n\t public int operation(int x, int y)\n\t {\n\t \t return x-y;\n\t }\n\t\t };\n\t\t System.out.println(sub.operation(1, 2));\n\t \n\t\t MathOp mul=new MathOp() {\n\t \t \n\t\t public int operation(int x, int y)\n\t\t {\n\t\t \t return x*y;\n\t\t }\n\t\t\t };\n\t\t\t System.out.println(mul.operation(1, 2));\n\t\t \n\t\t\t MathOp div=new MathOp() {\n\t\t \t \n\t\t\t public int operation(int x, int y)\n\t\t\t { \n\t\t\t \t return x/y;\n\t\t\t }\n\t\t\t\t };\n\t\t\t\t System.out.println(div.operation(1, 2));\n\t\t\t \n}", "@Test\n\tpublic void testMultiplica2Enteros() {\n\t\tdouble resultado= Producto.multiplica2enteros(10, 10);\n\t\tdouble esperado= 100;\n\t\t\n\t\tassertEquals(esperado, resultado);\n\t}", "public static void main(String[] args) {\n Calculator calc=new Calculator();\r\n double operand1,operand2,result=0;\r\n operand1=calc.getOperand1();\r\n operand2=calc.getOperand2();\r\n String op;\r\n op=calc.getOperator();\r\n try\r\n {\r\n \r\n switch(op)\r\n {\r\n case \"+\": Add add=new Add();\r\n result=add.doOperation(operand1, operand2);\r\n break;\r\n case \"-\": Subract sub=new Subract();\r\n result=sub.doOperation(operand1, operand2);\r\n break;\r\n case \"*\": Multiply mul=new Multiply();\r\n result=mul.doOperation(operand1, operand2);\r\n break;\r\n case \"/\": Division div =new Division();\r\n if(operand2==0)\r\n {\r\n \tthrow new ArithmeticException();\r\n }\r\n result=div.doOperation(operand1, operand2);\r\n break;\r\n default: throw new Exception(\"Invalid operation\");\r\n }\r\n \r\n\t }\r\n catch(ArithmeticException e)\r\n {\r\n \t System.out.println(e);\r\n \t \r\n }\r\n \r\n catch(Exception e)\r\n {\r\n \t System.out.println(e);\r\n \t \r\n } \r\n finally\r\n {\r\n \t System.exit(0);\r\n }\r\n System.out.print(result);\r\n \r\n}", "public static void main(String[] args) {\n testFactorial();\n testFibonacci();\n testMissing();\n testPrime();\n\n\n }", "@Test\r\n public void testGetSum() {\r\n System.out.println(\"getSum\");\r\n int x = 0;\r\n int y = 0;\r\n Calculate instance = new Calculate();\r\n int expResult = 0;\r\n int result = instance.getSum(x, y);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test //This is integration test\r\n\tpublic void testCalculatePrice04() throws Exception\r\n\t{\n\t\tImportInformation information = new ImportInformation();\r\n\t\tinformation.importMenu(\"Food_Data_Test1\");\r\n\t\tinformation.importUserInput();\t\r\n\t\tCalculation calcPrice = new Calculation();\r\n\t\tcalcPrice.calculatePrice(information.getMenu(),information.getUserInput());\r\n\t\t// compare the object itself and its side effects instead of String output, the string output can be done in main.\r\n\t\tArrayList<Food> exspectedFoodList = new ArrayList<Food>();\r\n\t\texspectedFoodList.add(new Appetizer(\"Salad\",Food.foodType.APPETIZER, \"55\"));\r\n\t\texspectedFoodList.add(new Appetizer(\"Beef Enchailada\",Food.foodType.MAINDISH, \"100\"));\t\r\n\t\tArrayList<Combination> exspectedCombinationList = new ArrayList<Combination>();\r\n\t\texspectedCombinationList.add(new Combination(exspectedFoodList));\r\n\t\t\r\n\t\tint combinationCounter = 0;\r\n\t\tint foodCounter = 0;\r\n\t\tfor(Combination actualCombination : calcPrice.getResult())\r\n\t\t{\r\n\t\t\tfor(Food actualFood : actualCombination.getFoodCombination())\r\n\t\t\t{\r\n\t\t\t\tassertEquals(exspectedCombinationList.get(combinationCounter).getFoodCombination().get(foodCounter).getFoodName(), actualFood.getFoodName());\r\n\t\t\t\tfoodCounter++;\r\n\t\t\t}\r\n\t\t\tcombinationCounter++;\r\n\t\t}\r\n\t}", "@Test //This is integration test\r\n\tpublic void testCalculatePrice03() throws Exception\r\n\t{\n\t\tImportInformation information = new ImportInformation();\r\n\t\tinformation.importMenu(\"Food_Data_Test1\");\r\n\t\tinformation.importUserInput();\t\r\n\t\tCalculation calcPrice = new Calculation();\r\n\t\tcalcPrice.calculatePrice(information.getMenu(),information.getUserInput());\r\n\t\t// compare the object itself and its side effects instead of String output, the string output can be done in main.\r\n\t\tArrayList<Food> exspectedFoodList = new ArrayList<Food>();\r\n\t\texspectedFoodList.add(new Appetizer(\"Salad\",Food.foodType.APPETIZER, \"55\"));\r\n\t\texspectedFoodList.add(new Appetizer(\"Beef Enchailada\",Food.foodType.MAINDISH, \"100\"));\t\r\n\t\tArrayList<Combination> exspectedCombinationList = new ArrayList<Combination>();\r\n\t\texspectedCombinationList.add(new Combination(exspectedFoodList));\r\n\t\t\r\n\t\tint combinationCounter = 0;\r\n\t\tint foodCounter = 0;\r\n\t\tfor(Combination actualCombination : calcPrice.getResult())\r\n\t\t{\r\n\t\t\tfor(Food actualFood : actualCombination.getFoodCombination())\r\n\t\t\t{\r\n\t\t\t\tassertEquals(exspectedCombinationList.get(combinationCounter).getFoodCombination().get(foodCounter).getFoodName(), actualFood.getFoodName());\r\n\t\t\t\tfoodCounter++;\r\n\t\t\t}\r\n\t\t\tcombinationCounter++;\r\n\t\t}\r\n\t}", "public static void main(String[] args){\r\n\t\tSystem.out.println(minProductSum(50));\r\n\t}", "@Test\r\n public void testSum() {\r\n int expResult = 5050;\r\n int result = Main.sum();\r\n \r\n assertEquals(expResult, result);\r\n }", "public static void main(String [] args)\n {\n runCalculations();\n }", "public static void main(String[] args) {\n\n\t\tdouble[] numbers = {2.3, 4.7, 5.0, 10.9, 3465.9};\n\t\tSystem.out.println(\"Sum: \" + sum(numbers));\n\t\tSystem.out.println(\"Average: \" + average(numbers));\n\t\t\n\t\tString[] groceryList = {\"eggs\", \"bacon\", \"coffee\", \"water\"};\n\t\tSystem.out.println(\"Does this array have eggs? \" + isInArray(groceryList, \"eggs\"));\n\t\tSystem.out.println(\"Does this array have apples? \" + isInArray(groceryList, \"apples\"));\n\t}", "public static void main(String[] args) {\n Beverage espresso = new Espresso();\n System.out.println(espresso.getDescription()\n +\" $\"+ espresso.cost()+\"\\n\");\n\n // order a houseblend with mocha\n Beverage houseblend = new HouseBlend();\n houseblend = new Mocha(houseblend);\n System.out.println(houseblend.getDescription()\n +\" $\"+ houseblend.cost()+\"\\n\");\n\n //order an american with soy and mocha\n Beverage americano = new Americano();\n americano = new Mocha(americano);\n americano = new SoyMilk(americano);\n System.out.println(americano.getDescription()\n + \" $\"+americano.cost()+\"\\n\");\n }", "public static void main(String[] args) {\n\t\tTestingPerformanceCalculator obj= new TestingPerformanceCalculator(\"./data/gitInfoNew.txt\", \"data/Results/FinalResultSidTest1.txt\");\n\t\t//Read Gold set\n\t\tobj.goldStMap=obj.LoadGoldSet();\n\t\t//MiscUtility.showResult(10, obj.goldStMap);\n\t\t//Resd output file/ test result file\n\t\tobj.finalResult=obj.LoadTestingResult();\n\t\t//MiscUtility.showResult(20, obj.finalResult);\n\t\t\n\t\t\n\t\t//Create a ranked list\n\t\t//obj.produceRankedResult(10);\n\t\tArrayList<String> rankedFinalTestingResult=obj.produceRankedResult(10);\n\t\tContentWriter.writeContent(\"./data/testing1RankedResult.txt\", rankedFinalTestingResult);\n\t\t//call another class BLPerformanceCalc to compute\n\t\t\n\t\t\n\t}", "public static void main( String [] args)\r\n\t{\r\n\t\tDataSet d1 = new DataSet( 1, 2, 4, 5);\r\n\t\td1.addValue(3);\r\n\t\td1.addValue(6);\r\n\t\td1.addValue(7);\r\n\t\td1.addValue(100);\r\n\t\tSystem.out.println(d1.getSum());\r\n\t\tSystem.out.println(d1.getAverage());\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tMethodOverloading m = new MethodOverloading();\r\n\t\tm.sum();\r\n\t\tm.sum(15, 15);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tEX05 test = new EX05();\n\t\tEX05 test1 = new EX05(\"홍길동\");\n\t\t\n\t\ttest.sum(\"홍길동\");\n\t\ttest.sum(100);\n\n\t}", "@Test\r\n\tpublic void sumExample2() {\r\n\t\tOldFashionPound call = new OldFashionPound();\r\n\t\tString result = call.sum(\"5p 17s 8d\", \"3p 4s 10d\");\r\n\t\tString expected = (\"9p 2s 16d\");\r\n\t\tAssert.assertNotEquals(expected, result);\r\n\t}", "public static void main(String[] args) {\n ArithmeticExpression calculation =\n new Operand(\n new Operand(new Number(4), Operation.PLUS, new Number(6)),\n Operation.MULTIPLICATION,\n new Operand(new Number(1), Operation.DIVISION, new Number(2)));\n\n System.out.println(calculation.toString() + \" = \" + calculation.calculate());\n }", "public static void main(String[] args) {\n\t\tAggregateSummaryStatistics aggregate = new AggregateSummaryStatistics();\n\t\tSummaryStatistics setOneStats = aggregate.createContributingStatistics();\n\t\tSummaryStatistics setTwoStats = aggregate.createContributingStatistics();\n\n\t\t \n\t\tfor( int i = 1; i <= 10; i++) {\n\t\t\tsetOneStats.addValue(i);\n\t\t\tsetTwoStats.addValue(i);\n\t\t}\n\t\t\n\t\t// Full sample data is reported by the aggregate\n\t\tdouble totalSampleSum = aggregate.getSum();\n\t\tSystem.out.println(\"totalSampleSum=\"+totalSampleSum);\n\t\tSystem.out.println(\"Count=\"+aggregate.getN());\n\t\tSystem.out.println(\"mean=\"+aggregate.getMean());\n\t\tSystem.out.println(\"std=\"+aggregate.getStandardDeviation());\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Adding: 10+20 = \" + Calculator.add(10, 20));\n\t\tSystem.out.println(\"Subtracting: 20-10 = \" + Calculator.subtract(20, 10));\n\t\tSystem.out.println(\"Multiplying: 2*10 = \"+ Calculator.multiply(2, 10));\n\t\tSystem.out.println(\"Dividing: 10 / 2 = \" + Calculator.divide(10, 2));\n\t\tSystem.out.println(\"Square root of 64 = \" + MagicCalculator.squareRoot(64));\n\t\tSystem.out.println(\"Sine of 0 = \" + MagicCalculator.sin(0));\n\t\tSystem.out.println(\"Cosine of 0 = \" + MagicCalculator.cos(0));\n\t\tSystem.out.println(\"Tangent of 0 = \" + MagicCalculator.tan(0));\n\t\tSystem.out.println(\"5! = \" + MagicCalculator.factorial(5));\n\t}", "public int product() {\n // You'll need to replace this code with something\n // else to make product() work; this is just to make\n // things compile while you work on sum()\n return 1;\n }", "public static void main(String[] args) {\n\t //int[] arr = {1, 3, 9, 7, 5};\n\t int[] arr = {1, 2, 5, 4, 3};\n\t printSum1(arr);\n\t printSum2(arr);\n }", "public static void main(String[] args) {\n\n\t\t\n\t\tint varMult1 = 123;\n\t\tint varMult2 = 123;\n\t\t\n\t\tint varAdc1 = 1234;\n\t\tint varAdc2 = 1234;\n\t\t\n\t\tint varSub1 = 1234;\n\t\tint varSub2 = 9877;\n\t\t\n\t\tint varDiv1 = 25;\n\t\tint varDiv2 = 5;\n\t\t\n\t\tint varRest1 = 25;\n\t\tint varRest2 = 2;\n\t\t\n\t\t\n\t\t\n\t\tint varAdcTotal = varAdc1 + varAdc2;\n\t\tint varMultTotal = varMult1 * varMult2;\n\t\tint varSubTotal = varSub1 - varSub2;\n\t\tint varDivTotal = varDiv1 / varDiv2;\n\t\tint varRestTotal = varRest1 % varRest2;\n\t\t\n\t\tSystem.out.println(\"Soma: \" + varAdcTotal);\n\t\tSystem.out.println(\"Multiplicação: \" + varMultTotal);\n\t\tSystem.out.println(\"Subtração: \" + varSubTotal);\n\t\tSystem.out.println(\"Divisão: \" + varDivTotal);\n\t\tSystem.out.println(\"Resto: \" + varRestTotal);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n Part2_2 part2_2 = new Part2_2();\n part2_2.testHowMany();\n Part2_3 part_23 = new Part2_3();\n part_23.testHowManyGenes();\n Part3_1 part3_1 = new Part3_1();\n part3_1.testCgRatio();\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tProgram20 obj = new Program20();\r\n\t\tSystem.out.println(obj.sum(10,20));\r\n\t\tSystem.out.println(obj.sum(10, 20,30));\r\n\t\tSystem.out.println(obj.sum(10.5, 20.5));\r\n\t}", "public static void main(String[] args) {\n\n\t\tfinal long startTime = System.nanoTime();\n\t\t\n\t\t\n\t\tInteger b = new Integer(1);\n\t\tint array[] = { 1, 2, 4, 3 };\n\t\t\n\t\t\n\t\tSystem.out.println(array.length);\n\t\t\n\t\t//System.out.println(array[5]);\n\t\t\n\t\t//int - Interger\n\t\t//double - Double\n\t\t//char - Character\n\t\t//bool - Boolean\n\t\t//float - Float\n\t\t//long - Long\n\t\t//byte - Byte\n\t\t//short - Short\n\t\t//String\n\t\t\n\t\t\n\t\tList xyz = new ArrayList();\n\t\txyz.add(true);\n\t\txyz.add(1);\n\t\txyz.add(\"sumit\");\n\t\t\n\t\txyz.size();\n\t\t\n\t\tIterator a = xyz.iterator();\n\t\twhile(a.hasNext()) {\n\t\t\tSystem.out.println(a.next());\n\t\t}\n\t\t\n\t\t\n\n\t\tSumProductTimeCheck test = new SumProductTimeCheck();\n\n\t\ttest.runTimeTest(array);\n\n\t\tfinal long duration = System.nanoTime() - startTime;\n\t\tSystem.out.println(duration);\n\n\t}", "@Test\n public void shouldMulTwoNumbers()\n {\n assertEquals(\"2 * 3 should be 6\", 6, Multiplication.mul(2, 3));\n }", "public static void main(String[] args){\n printMessage(\"so\", \"calm..\");\n System.out.println(sum(3,5,6));\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(Calculator.powerInt(2, 5));\r\n\t\tSystem.out.println(Calculator.powerDouble(5.5, 2));\r\n\r\n\t}", "public static void main(String[] args) {\n DecimalFormat decimalFormat = new DecimalFormat(\"#.####\");\n Scanner scanner = new Scanner(System.in);\n int a = 0;\n int b = 0;\n int c = 0;\n\n System.out.println(\" Enter a \");\n a = scanner.nextInt();\n\n System.out.println(\" Enter b\");\n b = scanner.nextInt();\n\n System.out.println(\" Enter c \");\n c = scanner.nextInt();\n\n System.out.println(\"Result 2: \"+product(a,b));\n System.out.println(\"Result 3: \"+product(a,b,c));\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(\"The sum of n numbers are :\"+sum(12));\n\t\t\n\t\t\n\t\tSystem.out.println(\"The power is :\"+pow(3,4));\n\t\t\n\n\t}", "@Test\n\tpublic void testSum() {\n\t\tassertEquals(155, g1.sum(), .0001);\n\t\tassertEquals(226, g2.sum(), .0001);\n\t\tassertEquals(298, g3.sum(), .0001);\n\t}", "public static void main(String[] args){\n //Variables\n Scanner scnr = new Scanner(System.in);\n //Custom test case\n if(scnr.hasNext()){\n String testInput = \"\";\n while(scnr.hasNext()){\n testInput = scnr.nextLine();\n System.out.println(testInput + \" : \" + evaluate(testInput));\n }\n }\n //Default test case\n else{\n String [] sampletests = {\"(1+(2*3))\", \"(2*(4*(6/3)))\",\"(3+(4*2))\"};\n double [] sampleoutput = {7.0, 16.0, 11.0};\n for(int i = 0; i < sampletests.length; i++){\n if(evaluate(sampletests[i]) != sampleoutput[i]){\n System.out.println(\"Failed sample tests\");\n return;\n }\n }\n System.out.println(\"Passed sample tests\");\n }\n }", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\n\t\tProduct2 product1 = buildProduct(in);\n\t\t// new Scanner(System.in).nextLine();\n\t\tProduct2 product2 = buildProduct(in);\n\t\tSystem.out.println(\"Product Details :\");\n\t\tdisplayProduct(product1);\n\n\t\tdisplayProduct(product2);\n\n\t\tSystem.out.println(\"\\n\" + product1.checkPrice(product2));\n\t\tin.close();\n\t}", "public static void main(String[] args) {\n System.out.println(getSum(6, 3));\n }", "public static void main(String[] args) {\n\t\tMyCalc cal = new MyCalc();\n\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"두 정수를 입력하세요.\");\n\t\tSystem.out.print(\"a > \");\n\t\tint a = Integer.parseInt(scan.nextLine());\n\t\tSystem.out.print(\"b > \");\n\t\tint b = Integer.parseInt(scan.nextLine());\n\n\t\tSystem.out.println(a + \" + \" + b + \" = \" + cal.add(a, b));\n\t\tSystem.out.println(a + \" - \" + b + \" = \" + cal.sub(a, b));\n\t\tSystem.out.println(a + \" * \" + b + \" = \" + cal.mul(a, b));\n\t}", "public static void main(String[] args) {\n\t\tsum(4,5);\n\t\t\n\t\t// useful for one-time use\n\t\tSystem.out.println(sum (4, 5));\n\t\t\n\t\t// useful if you want to save the value for future use or multiple uses\n\t\tint mySum = sum(4, 5);\n\t\tSystem.out.println(mySum);\n\t}", "public static void main(String[] args) {\n SPIM.printInt(Formals.sum(1, 2, 3, 4, 5, 6));\n SPIM.printChar('\\n');\n SPIM.printInt(Formals.product(1, 2, 3, 4, 5, 6));\n SPIM.printChar('\\n');\n }", "public static void main (String args[]) {\r\n\t\t\r\n\t\tCalculator calc = new Calculator();\r\n\t\tcalc.add();\r\n\t\tcalc.div();\r\n\t\tcalc.mul();\r\n\t\tcalc.sub();\r\n\t\t\t\t\r\n\t}", "public static void main(String[] args) {\n\t//\tSystem.out.println(add(3,5,7));\n\t\tSystem.out.println(retirementPayment(\"Mary Stone \", 2,3,5,6));\n\n\n\t}", "public static void main(String[] args) {\n System.out.println(\"Respect\");\n Nubbers numbers = new Nubbers();\n int r = numbers.sum(5);\n System.out.println(r);\n }", "public static void main(String[] args) {\n Math2 y = new Math2();\n y.Add(7,2);\n y.Sub(7,2);\n }", "public static void main(String[] args) {\n\t\tProduct product1 =new Product(1,\"lenovo V14\",15000,\"16 GB Ram\",10);\n\t\t\n\t\tProduct product2 =new Product();\n\t\tproduct2.setId(2);\n\t\tproduct2.setName(\"Lenovo V15\");\n\t\tproduct2.setDetail(\"16 GB\");\n\t\tproduct2.setDiscount(10);\n\t\tproduct2.setUnitPrice(16000);\n\t\t\n\t\t\n\t\tProduct product3 =new Product();\n\t\tproduct3.setId(3);\n\t\tproduct3.setName(\"Lenovo V16\");\n\t\tproduct3.setDetail(\"32 GB\");\n\t\tproduct3.setDiscount(10);\n\t\tproduct3.setUnitPrice(19000);\n\n\t\tProduct[] products = {product1, product2, product3};\n\t\t\n\t\tfor (Product product : products) {\n\t\t\t\tSystem.out.println(product.getName());\n\t\t\t\tSystem.out.println(product.getUnitPriceAfterDiscount());\n\t\t\t}\n\t\t \n\t\tSystem.out.println(products.length);\n\t\t\n\t\tCategory category1 = new Category(1,\"Bilgisayar\");\n\t\tCategory category2 = new Category();\n\t\tcategory2.setId(2);\n\t\tcategory2.setName(\"yemek\");\n\t\t\n\t\tCategory[] categories = {category1,category2};\n\t\tfor (Category category : categories) {\n\t\t\tSystem.out.println(category.getName());\n\t\t\tSystem.out.println(category.getName());\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(category1.getName());\n\t\tSystem.out.println(category2.getName());\n\t\t\n\t\tProductManager productManager = new ProductManager();\n\t\tproductManager.addToCart(product1);\n\t\tproductManager.addToCart(product2);\n\t\tproductManager.addToCart(product3);\n\t}", "public static void main(String[] args) {\n\r\n\t\tnew ThisSuperDemo3().calculate();\r\n\t}", "public static void main(String[] args)\n {\n\n System.out.println(sum(3));\n }", "public static void run() {\n testAlgorithmOptimality();\n// BenchmarkGraphSets.testMapLoading();\n //testAgainstReferenceAlgorithm();\n //countTautPaths();\n// other();\n// testLOSScan();\n //testRPSScan();\n }", "public static void main(String[] args) {\n OperationsBetween between =\n new OperationsBetween(Integer.parseInt(args[0]),\n Integer.parseInt(args[1]));\n System.out.println(\"Sum: \" + between.sum());\n System.out.println(\"Product: \" + between.product());\n }", "@Test(priority=3)\n\n\tpublic void multiplicationTest() {\n\n\t\tandroidCalculator = new AndroidCalculator(driver);\n\n\t\tandroidCalculator.inputLeftAndRightFields(\"20\", \"10\");\n\t\tandroidCalculator.multiplication();;\n\n\t\tAssert.assertEquals(androidCalculator.verifyResult(), 20*10);\n\t}", "public static void main(String[] args) {\n\t\talg s1=new alg();\r\n\t\tladd ad=s1;\r\n\t\tlsub sub=s1;\r\n\t\tlmul mul=s1;\r\n\t\tlumul umul=s1;\r\n\t\tSystem.out.println(\"调用对象的方法:\");\r\n\t\tSystem.out.println(\"+:\"+s1.add(9, 3));\r\n\t\tSystem.out.println(\"-:\"+s1.sub(9, 3));\r\n\t\tSystem.out.println(\"x:\"+s1.mul(9, 3));\r\n\t\tSystem.out.println(\"/:\"+s1.umul(9, 3));\r\n\t\t\r\n\t\tSystem.out.println(\"调用接口引用的方法:\");\r\n\t\tSystem.out.println(\"+:\"+ad.add(9, 3));\r\n\t\tSystem.out.println(\"-:\"+sub.sub(9, 3));\r\n\t\tSystem.out.println(\"x:\"+mul.mul(9, 3));\r\n\t\tSystem.out.println(\"/:\"+umul.umul(9, 3));\r\n\t}", "public static void main(String[] args) {\n Addition onion = new Addition(\"Onion\", 1.5);\n Addition potato = new Addition(\"Potato\", 1.5);\n Addition lettuce = new Addition(\"Lettuce\", 0.5);\n Addition ketchup = new Addition(\"Ketchup\", 0.5);\n Addition chips = new Addition(\"Ketchup\", 1.5);\n Addition drink = new Addition(\"Ketchup\", 1.5);\n\n System.out.println(\"---------------Basic------------------\");\n Basic basic = new Basic(\"Basic\", \"Sesame\", \"Beaf\", 12.00,\n onion, potato, lettuce);\n System.out.println(basic.getName() + \" with \" + basic.getBreadRoll() + \" - Total \" + basic.getTotalPrice() + \"\\n\" +\n \" Base Price \" + basic.getBasePrice() + \"$\\n\" + basic.getAdditions() + \"Additions Total \" +\n basic.getAdditionsPrice());\n\n System.out.println(\"---------------Deluxe------------------\");\n Deluxe deluxe = new Deluxe(\"Deluxe\", \"Sumac\", \"Fish\", 8.5);\n System.out.println(deluxe.getName() + \" with \" + deluxe.getBreadRoll() + \"- Total \" + deluxe.getTotalPrice() + \"\\n\" +\n \" Base Price \" + deluxe.getBasePrice() + \"$\\n\" + deluxe.getAdditions()+ \"Additions Total \" +\n deluxe.getAdditionsPrice());\n\n System.out.println(\"---------------Healthy------------------\");\n Healthy healthy = new Healthy(\"Healthy\", \"Chicken\", 10.0, lettuce, onion);\n System.out.println(healthy.getName() + \" with \" + healthy.getBreadRoll() + \"- Total \" + healthy.getTotalPrice() + \"\\n\" +\n \" Base Price \" + healthy.getBasePrice() + \"$\\n\" + healthy.getAdditions()+ \"Additions Total \" +\n healthy.getAdditionsPrice());\n }", "@Test\n public void testMultiplyAllNumbersWithManyNumbers() {\n assertEquals(Integer.valueOf(120), calculator.multiplyAllNumbers(new Integer[]{1, 2, 3, 4, 5}));\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is a test\");\n\t\t\n\t\tMethods m = new Methods();\n\t\tm.ValidateHeader();\n\t\tint s = m.sum();\n\t\tSystem.out.println(\"sum\"+' '+s);\n\t\t\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n//\t\tSystem.out.println(calc.sub(3, 5));\n//\t\tSystem.out.println(calc.add(3, 5));\n\n\t\tSystem.out.println(Calculator.add(3, 5));\n\t\tSystem.out.println(add(3, 5));\n\n\t}", "public static void main(String[] args) {\n\n printResult(2 + 3);\n int a = 2 + 4;\n printResult(a);\n int result = add(2, 5);\n printResult(result);\n printResult(add(2, 6));\n schreibHallo();\n int ten = returnTen();\n System.out.println(ten);\n }", "public static void main(final String[] args) {\n SimpleSummater summater = new SimpleSummater();\n final int[] array = {10, 20, 1, 25};\n System.out.println(summater.sum(array));\n }" ]
[ "0.7293872", "0.708387", "0.69562733", "0.67882776", "0.6787049", "0.67825586", "0.67232525", "0.67039263", "0.669576", "0.6692456", "0.6632972", "0.6627022", "0.66130376", "0.6590918", "0.6570253", "0.65645325", "0.654804", "0.6531506", "0.652374", "0.6482739", "0.646046", "0.6446797", "0.64404416", "0.6430071", "0.64243716", "0.6414493", "0.64144", "0.6413089", "0.6411444", "0.6382723", "0.6370943", "0.63574404", "0.6344851", "0.6330642", "0.6326786", "0.6324595", "0.6323506", "0.63014376", "0.6292822", "0.62916434", "0.6287177", "0.6286265", "0.62825495", "0.6279668", "0.62643266", "0.62557507", "0.620947", "0.61822784", "0.6164028", "0.6161994", "0.6155079", "0.61509675", "0.6140407", "0.6138777", "0.6134493", "0.6134137", "0.61340284", "0.6129398", "0.61278903", "0.61251724", "0.61189324", "0.6104771", "0.6104529", "0.6099181", "0.60985905", "0.6092278", "0.6087753", "0.60867596", "0.6086487", "0.6085023", "0.6081581", "0.60804343", "0.60758215", "0.607553", "0.6060721", "0.60588974", "0.6058555", "0.6051472", "0.6050386", "0.60487247", "0.6047439", "0.6040225", "0.60335195", "0.60325104", "0.6029593", "0.6021903", "0.6021833", "0.6020226", "0.60176265", "0.6016833", "0.6009901", "0.6009275", "0.60019433", "0.60001665", "0.5999488", "0.59991103", "0.59985125", "0.59942824", "0.5987565", "0.5986685" ]
0.6543967
17
Creating Apache Ignite Instance bean.
@Bean public Ignite igniteInstance(){ IgniteConfiguration cfg = new IgniteConfiguration(); // Setting some custom name for the node. cfg.setIgniteInstanceName("springDataNode"); // Enabling peer-class loading feature. cfg.setPeerClassLoadingEnabled(false); // Defining and creating a new cache to be used by Ignite Spring Data repository. CacheConfiguration ccfg = new CacheConfiguration("PersonCache"); // Setting SQL schema for the cache. ccfg.setIndexedTypes(Long.class, Person.class); cfg.setCacheConfiguration(ccfg); cfg.setClientMode(false); return Ignition.start(cfg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Bean\n public Ignite igniteInstance() {\n \tIgniteConfiguration cfg = new IgniteConfiguration();\n\n cfg.setClientMode(true);\n\n return Ignition.start(cfg);\n }", "Instance createInstance();", "@Bean\n public IgniteClient igniteInstanceTWO() {\n return Ignition.startClient(new ClientConfiguration().setAddresses(\"127.0.0.1:10801\"));\n }", "@Bean\n public IgniteClient igniteInstance() {\n return Ignition.startClient(new ClientConfiguration().setAddresses(\"127.0.0.1:\" + CLI_CONN_PORT)\n .setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(false)));\n }", "private IgniteContract() {\n }", "public Instance() {\n }", "DynamicInstance createDynamicInstance();", "SAProcessInstanceBuilder createNewInstance(SProcessInstance processInstance);", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "public void create()\n throws Exception\n {\n super.start();\n\n BeanMetaData md = getContainer().getBeanMetaData();\n ejbName = md.getEjbName();\n\n // Should we log call details\n callLogging = md.getContainerConfiguration().getCallLogging();\n }", "synchronized public void start() throws IOException, InterruptedException {\n createInstanceFromConfig(true);\n }", "public OpticalHopAccessBean(int arg0) throws javax.ejb.CreateException, java.rmi.RemoteException, javax.naming.NamingException {\n ejbRef = ejbHome().create(arg0);\n }", "public SuperRegionAccessBean(int arg0, java.lang.String arg1) throws javax.ejb.CreateException, java.rmi.RemoteException, javax.naming.NamingException {\n ejbRef = ejbHome().create(arg0, arg1);\n }", "@Bean\n public HazelcastInstance hazelcastInstance() throws Exception {\n ClientConfig clientConfig = new XmlClientConfigBuilder(\"hazelcast-client.xml\").build();\n return HazelcastClient.newHazelcastClient(clientConfig);\n }", "public interface InstanceDeployCenter {\r\n\r\n /**\r\n * 启动已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 启动已存在的实例,无需进行redis资源包校验\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstanceWithoutResourceCheck(long appId, int instanceId);\r\n\r\n /**\r\n * 下线已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean shutdownExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * cluster forget\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean forgetInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 清理(cluster forget)集群内所有fail节点\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean clearFailInstances(long appId);\r\n \r\n /**\r\n * 展示实例最近的日志\r\n * @param instanceId\r\n * @param maxLineNum\r\n * @return\r\n */\r\n String showInstanceRecentLog(int instanceId, int maxLineNum);\r\n\r\n /**\r\n * 修改实例配置\r\n * @param appId\r\n * @param appAuditId\r\n * @param host\r\n * @param port\r\n * @param instanceConfigKey\r\n * @param instanceConfigValue\r\n * @return\r\n */\r\n boolean modifyInstanceConfig(long appId, Long appAuditId, String host, int port, String instanceConfigKey,\r\n String instanceConfigValue);\r\n\r\n /**\r\n * 检测pod是否有被调度其他宿主机\r\n * @param ip\r\n */\r\n MachineSyncEnum podChangeStatus(String ip);\r\n\r\n /**\r\n * 检测pod是否有心跳停止实例&启动\r\n * @return\r\n */\r\n List<InstanceAlertValueResult> checkAndStartExceptionInstance(String ip, Boolean isAlert);\r\n\r\n\r\n}", "Reproducible newInstance();", "@Override\n public MemberContext startInstance(MemberContext memberContext, byte[] payload) {\n\n this.setDynamicPayload(payload);\n String group = getIaasProvider().getIaas().getGroupName(memberContext, payload);\n\n try {\n ComputeService computeService = getIaasProvider().getComputeService();\n Template template = getIaasProvider().getTemplate();\n\n if (template == null) {\n String msg = \"Could not start an instance, jclouds template is null for iaas provider [type]: \" +\n getIaasProvider().getType();\n log.error(msg);\n throw new InvalidIaasProviderException(msg);\n }\n\n if (log.isDebugEnabled()) {\n log.debug(\"Cloud controller is delegating request to start an instance for \"\n + memberContext + \" to jclouds\");\n }\n // create and start a node\n Set<? extends NodeMetadata> nodeMetadataSet = computeService.createNodesInGroup(group, 1, template);\n NodeMetadata nodeMetadata = nodeMetadataSet.iterator().next();\n if (log.isDebugEnabled()) {\n log.debug(\"Cloud controller received a response for the request to start \"\n + memberContext + \" from Jclouds layer.\");\n }\n\n if (nodeMetadata == null) {\n String msg = \"Null response received for instance start-up request to Jclouds.\\n\"\n + memberContext.toString();\n log.error(msg);\n throw new IllegalStateException(msg);\n }\n memberContext.setInstanceId(nodeMetadata.getId());\n memberContext.setInstanceMetadata(createInstanceMetadata(nodeMetadata));\n } catch (Exception e) {\n String msg = \"Failed to start an instance. \" + memberContext.toString() + \" Cause: \" + e.getMessage();\n log.error(msg, e);\n throw new IllegalStateException(msg, e);\n }\n return memberContext;\n }", "public Instance() {\n super(Routing.NAMESPACE, \"instance\");\n }", "@SneakyThrows\n public HazelcastInstance ignite () { // nice name for starting HZ))\n if (config == null) {\n config = new Config();\n }\n\n if (discoveryClient != null) {\n val selfAddress = discoveryClient.self().getAddress().getHostAddress();\n\n config.setProperty(\"hazelcast.discovery.enabled\", \"true\");\n config.setProperty(\"hazelcast.socket.server.bind.any\", \"true\");\n config.setProperty(\"hazelcast.socket.bind.any\", \"true\");\n\n val networkingConfig = config.getNetworkConfig();\n networkingConfig.setPublicAddress(selfAddress);\n networkingConfig.setPort(discoveryClient.self().getPort());\n networkingConfig.setPortAutoIncrement(false);\n networkingConfig.setInterfaces(new InterfacesConfig().addInterface(selfAddress));\n\n val joinConfig = networkingConfig.getJoin();\n\n joinConfig.getMulticastConfig().setEnabled(false);\n joinConfig.getTcpIpConfig().setEnabled(false);\n joinConfig.getAwsConfig().setEnabled(false);\n\n val discoveryStrategyFactory = new CustomDiscoveryStrategyFactory(discoveryClient);\n val discoveryStrategyConfig = new DiscoveryStrategyConfig(discoveryStrategyFactory);\n joinConfig.getDiscoveryConfig().addDiscoveryStrategyConfig(discoveryStrategyConfig);\n }\n\n ofNullable(userContext)\n .ifPresent(config::setUserContext);\n\n mapConfigs\n .forEach(config::addMapConfig);\n\n val leaderService = new LeaderService();\n val listener = new ClusterFormationChangeListener(leaderService);\n val listenerConfig = new ListenerConfig(listener);\n config.addListenerConfig(listenerConfig);\n\n onBecomeLeaderMemberActions.forEach(leaderService::addOnBecomeLeaderMemberAction);\n onBecomeRegularMemberActions.forEach(leaderService::addOnBecomeRegularMemberAction);\n\n val result = Hazelcast.newHazelcastInstance(config);\n val cluster = result.getCluster();\n val member = cluster.getLocalMember();\n val members = cluster.getMembers();\n val event = new MembershipEvent(cluster, member, MEMBER_ATTRIBUTE_CHANGED, members);\n if (members.iterator().next().localMember()) {\n leaderService.becomeLeaderMember(result, event);\n } else {\n leaderService.becomeRegularMember(result, event);\n }\n\n return result;\n }", "public SuperRegionAccessBean(int arg0, java.lang.String arg1, int arg2) throws javax.ejb.CreateException, java.rmi.RemoteException, javax.naming.NamingException {\n ejbRef = ejbHome().create(arg0, arg1, arg2);\n }", "private void initInstance() {\n init$Instance(true);\n }", "private INodeInstance createInstances(Config cfg, TaskInstancePlan ip,\n Vertex vertex, OperationMode operationMode,\n Map<String, String> inEdges,\n Map<String, String> outEdges,\n TaskSchedulePlan taskSchedule) {\n // lets add the task\n byte[] taskBytes = Utils.serialize(vertex.getTask());\n INode newInstance = (INode) Utils.deserialize(taskBytes);\n int taskId = taskIdGenerator.generateGlobalTaskId(vertex.getName(),\n ip.getTaskId(), ip.getTaskIndex());\n\n if (operationMode.equals(OperationMode.BATCH)) {\n if (newInstance instanceof ICompute) {\n if (newInstance instanceof ISink) {\n SinkBatchInstance v = new SinkBatchInstance((ICompute) newInstance,\n new LinkedBlockingQueue<>(), cfg, vertex.getName(),\n taskId, ip.getTaskIndex(), vertex.getParallelism(),\n workerId, vertex.getConfig().toMap(), inEdges, taskSchedule);\n batchSinkInstances.put(vertex.getName(), taskId, v);\n return v;\n } else {\n TaskBatchInstance v = new TaskBatchInstance((ICompute) newInstance,\n new LinkedBlockingQueue<>(),\n new LinkedBlockingQueue<>(), cfg,\n vertex.getName(), taskId, ip.getTaskIndex(),\n vertex.getParallelism(), workerId, vertex.getConfig().toMap(),\n inEdges, outEdges, taskSchedule);\n batchTaskInstances.put(vertex.getName(), taskId, v);\n return v;\n }\n } else if (newInstance instanceof ISource) {\n SourceBatchInstance v = new SourceBatchInstance((ISource) newInstance,\n new LinkedBlockingQueue<>(), cfg,\n vertex.getName(), taskId, ip.getTaskIndex(),\n vertex.getParallelism(), workerId, vertex.getConfig().toMap(), outEdges, taskSchedule);\n batchSourceInstances.put(vertex.getName(), taskId, v);\n return v;\n } else {\n throw new RuntimeException(\"Un-known type\");\n }\n } else if (operationMode.equals(OperationMode.STREAMING)) {\n if (newInstance instanceof ICompute) {\n if (newInstance instanceof ISink) {\n SinkStreamingInstance v = new SinkStreamingInstance((ICompute) newInstance,\n new LinkedBlockingQueue<>(), cfg, vertex.getName(),\n taskId, ip.getTaskIndex(), vertex.getParallelism(), workerId,\n vertex.getConfig().toMap(), inEdges, taskSchedule);\n streamingSinkInstances.put(vertex.getName(), taskId, v);\n return v;\n } else {\n TaskStreamingInstance v = new TaskStreamingInstance((ICompute) newInstance,\n new LinkedBlockingQueue<>(),\n new LinkedBlockingQueue<>(), cfg,\n vertex.getName(), taskId, ip.getTaskIndex(),\n vertex.getParallelism(), workerId, vertex.getConfig().toMap(), inEdges,\n outEdges, taskSchedule);\n streamingTaskInstances.put(vertex.getName(), taskId, v);\n return v;\n }\n } else if (newInstance instanceof ISource) {\n SourceStreamingInstance v = new SourceStreamingInstance((ISource) newInstance,\n new LinkedBlockingQueue<>(), cfg,\n vertex.getName(), taskId, ip.getTaskIndex(),\n vertex.getParallelism(), workerId, vertex.getConfig().toMap(), outEdges, taskSchedule);\n streamingSourceInstances.put(vertex.getName(), taskId, v);\n return v;\n } else {\n throw new RuntimeException(\"Un-known type\");\n }\n } else {\n // GRAPH Structures must be implemented here\n return null;\n }\n }", "@Override\n protected T createInstance() throws Exception {\n return this.isSingleton() ? this.builder().build() : XMLObjectSupport.cloneXMLObject(this.builder().build());\n }", "public ProductBean(final Instance _prodInst)\n {\n instance = _prodInst;\n }", "protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {\n super(objRef);\n this.clusterId = software.amazon.jsii.Kernel.get(this, \"clusterId\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.instanceType = software.amazon.jsii.Kernel.get(this, \"instanceType\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.autoscalingPolicy = software.amazon.jsii.Kernel.get(this, \"autoscalingPolicy\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.bidPrice = software.amazon.jsii.Kernel.get(this, \"bidPrice\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.configurationsJson = software.amazon.jsii.Kernel.get(this, \"configurationsJson\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.ebsConfig = software.amazon.jsii.Kernel.get(this, \"ebsConfig\", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(imports.aws.EmrInstanceGroupEbsConfig.class)));\n this.ebsOptimized = software.amazon.jsii.Kernel.get(this, \"ebsOptimized\", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));\n this.instanceCount = software.amazon.jsii.Kernel.get(this, \"instanceCount\", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));\n this.name = software.amazon.jsii.Kernel.get(this, \"name\", software.amazon.jsii.NativeType.forClass(java.lang.String.class));\n this.count = software.amazon.jsii.Kernel.get(this, \"count\", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));\n this.dependsOn = software.amazon.jsii.Kernel.get(this, \"dependsOn\", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.ITerraformDependable.class)));\n this.lifecycle = software.amazon.jsii.Kernel.get(this, \"lifecycle\", software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.TerraformResourceLifecycle.class));\n this.provider = software.amazon.jsii.Kernel.get(this, \"provider\", software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.TerraformProvider.class));\n }", "private static void createInstance() {\n if (mApiInterface == null) {\n synchronized(APIClient.class) {\n if (mApiInterface == null) {\n mApiInterface = buildApiClient();\n }\n }\n }\n }", "public ComputeInstanceVersion() {\n }", "private synchronized static void createInstance() {\n if (INSTANCE == null) { \n INSTANCE = new DataConnection();\n }\n }", "void createComputeInstance(\n String accessKey, String secretKey, LaunchSpecifications launchSpecifications) throws CloudExceptions;", "public T newInstance();", "public InMemoryServiceInstancePersistence() {\n this.serviceInstances = new HashMap<>(); \n }", "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}", "Cloud createCloud();", "private InstanceUtil() {\n }", "public InstrumentedWorkerTask(gw.pl.persistence.core.BundleProvider bundleProvider) {\n this((java.lang.Void)null);\n com.guidewire.pl.system.entity.proxy.BeanProxy.initNewBeanInstance(this, bundleProvider.getBundle(), java.util.Arrays.asList());\n }", "@Override\n \t\tprotected void setup(Context context){\n \t\t\tint port = 5701 + context.getTaskAttemptID().getId()%numInstances;\n \t\t\t//System.out.println(\"Connecting to port \" + port);\n \t\t\tClientConfig clientConfig = new ClientConfig();\n \t\t\tclientConfig.addAddress(\"127.0.0.1:\" + port);\n \t\t\tthis.client = HazelcastClient.newHazelcastClient(clientConfig);\n \t\t\tthis.map = client.getMap(\"kmer\");\n \t\t}", "private static void spawnInstance(){\n\t\tString instanceType = null;\n\t\tString imageId = null; \n\t\tint numInstances = 0;\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Name of key to use?\");\n\t\tkeyname = in.next();\n\t\t\n\t\tSystem.out.println(\"Instance type? (use d for default: t2.micro)\");\n\t\tinstanceType = in.next();\n\t\t\n\t\tif(instanceType.equals(\"d\")){\n\t\t\tinstanceType = INSTANCE_TYPE;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Image id? (use d for default: ami-b5a7ea85, Amazon Linux AMI)\");\n\t\timageId = in.next();\n\t\t\n\t\tif(imageId.equals(\"d\")){\n\t\t\timageId = IMAGE_ID; \n\t\t}\n\t\t\n\t\tSystem.out.println(\"Number of instances?\");\n\t\tnumInstances = in.nextInt();\n\n\t\tin.close();\n\t\n\t\tRunInstancesRequest req = new RunInstancesRequest();\n\t\t\n\t String group = GROUP;\n\t \n\t req.withImageId(imageId)\n\t .withInstanceType(instanceType)\n\t .withMinCount(numInstances)\n\t .withMaxCount(numInstances)\n\t .withKeyName(keyname)\n\t .withSecurityGroups(group);\n\t \n\t RunInstancesResult reqRes = ec2.runInstances(req);\n\t Reservation res = reqRes.getReservation();\n\t System.out.println(\"Reservation number is \" + res.getReservationId());\n\t try {\n \t\tSystem.out.println(\"Just a moment while the instance is spun up...\");\n\t\t\tTimeUnit.SECONDS.sleep(10);\n\t\t} catch (InterruptedException e) {\n\t\t\tSystem.out.println(\"Instantiation failed!\");\n\t\t}\n \t\tString ip = listLiveInstances();\n \t\tSystem.out.println(\"\");\n \t\tSystem.out.println(\"Connect with 'ssh -i \" + keyname + \".pem ec2-user@\" + ip +\"'\");\n \t\tSystem.out.println(\"If connection fails, run with -l option and check status.\");\n \t\tSystem.exit(0);\n\t}", "public static synchronized void constructInstance()\n {\n SmartDashboard.putBoolean( TelemetryNames.Elbow.status, false );\n\n if ( ourInstance != null )\n {\n throw new IllegalStateException( myName + \" Already Constructed\" );\n }\n ourInstance = new ElbowSubsystem();\n\n SmartDashboard.putBoolean( TelemetryNames.Elbow.status, true );\n }", "@Override\r\n public void instantiate() {\r\n }", "public CMObject newInstance();", "CdapServiceInstance createCdapServiceInstance();", "public IndexBeans() {\r\n }", "com.google.cloud.notebooks.v1beta1.Instance getInstance();", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "public static IngestHelperInterface create() {\n ClassLoader cl = SimpleDataTypeHelper.class.getClassLoader();\n return (IngestHelperInterface) Proxy.newProxyInstance(cl, new Class[] {IngestHelperInterface.class}, new SimpleDataTypeHelper());\n }", "@Override\n\tpublic ModIndexedInstance createNewInstance() {\n\t\tModIndexedInstance newInst = new ModIndexedInstance(); // create the new instance\n\t\tnewInst.setRegComp(this); // set component type of new instance\n\t\taddInstanceOf(newInst); // add instance to list for this comp\n\t\treturn newInst;\n\t}", "public PythonProcessManager(Ignite ignite) {\n this(new NativeProcessManager(ignite));\n }", "void create(T instance) throws IOException;", "public HotrodCacheFactory() {\n }", "void createComputeInstance(LaunchSpecifications launchSpecifications)\n throws CloudExceptions;", "public void create(){}", "void instanceCreated(String pid, IDefinition definition);", "public static PoolInfoClient create() {\n return new PoolInfoClient();\n }", "public static void start(){\n int size = 1024;\n int max = 32;\n GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig();\n genericObjectPoolConfig.setMaxTotal(size * max);\n genericObjectPoolConfig.setMaxIdle(size * max);\n genericObjectPoolConfig.setMinIdle(size);\n long time = 1000 * 30;\n genericObjectPoolConfig.setMaxWaitMillis(time);\n genericObjectPoolConfig.setSoftMinEvictableIdleTimeMillis(time);\n\n updateEventCacheFactory = new UpdateEventCacheFactory(new UpdateEventPoolFactory(), genericObjectPoolConfig);\n }", "PlayerBean create(String name);", "public Instance(int instanceId, double weight){\n\t\tif(instanceId==0)\n\t\t\tthrow new RuntimeException(\"The instance id is \"+instanceId);\n\t\tthis._instanceId = instanceId;\n\t\tthis._weight = weight;\n\t}", "InstanceModel createInstanceOfInstanceModel();", "InstAssignIndex createInstAssignIndex();", "public CarAccessBean(int arg0, java.lang.Boolean arg1, java.lang.String arg2, java.lang.String arg3) throws javax.ejb.CreateException, java.rmi.RemoteException, javax.naming.NamingException {\n ejbRef = ejbHome().create(arg0, arg1, arg2, arg3);\n }", "@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "<T> T newInstance(URI description) throws EnvironmentException;", "@RepositoryConfig(cacheName = TENANT_CACHE)\n@Repository\npublic interface TenantRepository extends IgniteRepository<Tenant, Long> {\n\n}", "protected void instantiateEJB() throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n if ( ejbRef() != null )\n return;\n\n com.hps.july.persistence.SuperRegionKey key = keyFromFields(initKey_supregid);\n ejbRef = ejbHome().findByPrimaryKey(key);\n }", "protected void instantiateEJB() throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n if ( ejbRef() != null )\n return;\n\n com.hps.july.persistence.SuperRegionAccKey key = keyFromFields(initKey_accessid);\n ejbRef = ejbHome().findByPrimaryKey(key);\n }", "@Override\n\tpublic void create() {\n\n\t}", "private StripesPMI() {}", "public Bean() {\n\t}", "public ClientMBean() {\n }", "public void makeInstance() {\n\t\t// Create the attributes, class and text\n\t\tFastVector fvNominalVal = new FastVector(2);\n\t\tfvNominalVal.addElement(\"ad1\");\n\t\tfvNominalVal.addElement(\"ad2\");\n\t\tAttribute attribute1 = new Attribute(\"class\", fvNominalVal);\n\t\tAttribute attribute2 = new Attribute(\"text\",(FastVector) null);\n\t\t// Create list of instances with one element\n\t\tFastVector fvWekaAttributes = new FastVector(2);\n\t\tfvWekaAttributes.addElement(attribute1);\n\t\tfvWekaAttributes.addElement(attribute2);\n\t\tinstances = new Instances(\"Test relation\", fvWekaAttributes, 1); \n\t\t// Set class index\n\t\tinstances.setClassIndex(0);\n\t\t// Create and add the instance\n\t\tInstance instance = new Instance(2);\n\t\tinstance.setValue(attribute2, text);\n\t\t// Another way to do it:\n\t\t// instance.setValue((Attribute)fvWekaAttributes.elementAt(1), text);\n\t\tinstances.add(instance);\n \t\tSystem.out.println(\"===== Instance created with reference dataset =====\");\n\t\tSystem.out.println(instances);\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "@Override\n\tpublic void create() {\n\t\t\n\t}", "synchronized public void startWithoutWaiting() throws IOException,\n InterruptedException {\n createInstanceFromConfig(false);\n }", "private static synchronized void createInstance() {\r\n\t\tif (instance == null)\r\n\t\t\tinstance = new LOCFacade();\r\n\t}", "public void ejbCreate() {\n\n }", "private Instantiation(){}", "public static void createInstance()\n {\n if (instance == null) {\n // Create the instance\n instance = new SalesOrderDataSingleton();\n }\n }", "@Override\r\n\tpublic void create() {\n\r\n\t}", "Instance getInstance(String id);", "protected void instantiateEJB() throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n if ( ejbRef() != null )\n return;\n\n com.hps.july.trailcom.beans.OpticalHopKey key = keyFromFields(initKey_hopid_hopsid);\n ejbRef = ejbHome().findByPrimaryKey(key);\n }", "public void create() {\n\t\t\n\t}", "public void createInstance(String className, String instanceName)\r\n\t{\r\n\t\t\r\n\t\tOntClass c = obtainOntClass(className);\r\n\t\t\r\n\t\tString longName;\r\n\t\tif(instanceName.contains(\"#\"))\r\n\t\t\tlongName = instanceName;\r\n\t\tif(instanceName.contains(\":\"))\r\n\t\t\tlongName= ONT_MODEL.expandPrefix(instanceName);\r\n\t\telse\r\n\t\t\tlongName = BASE_NS + instanceName;\r\n\t\t\r\n\t\tc.createIndividual(longName);\r\n\t}", "public abstract T create() throws PoolException;", "private void createInstance(RemoteService remote, Path tmp, String groupName, ProductManifest product, String instanceName,\n String... nodeNames) {\n InstanceConfiguration instanceConfig = TestFactory.createInstanceConfig(instanceName, product);\n try (BHive hive = new BHive(tmp.resolve(\"hive\").toUri(), null, new ActivityReporter.Null())) {\n PushOperation pushOperation = new PushOperation();\n Builder instanceManifest = new InstanceManifest.Builder().setInstanceConfiguration(instanceConfig);\n\n for (String nodeName : nodeNames) {\n InstanceNodeConfiguration nodeConfig = new InstanceNodeConfiguration();\n nodeConfig.id = UuidHelper.randomId();\n nodeConfig.applications.add(TestFactory.createAppConfig(product));\n\n Key instanceNodeKey = new InstanceNodeManifest.Builder().setInstanceNodeConfiguration(nodeConfig)\n .setMinionName(nodeName).insert(hive);\n instanceManifest.addInstanceNodeManifest(nodeName, instanceNodeKey);\n pushOperation.addManifest(instanceNodeKey);\n }\n\n Key instanceKey = instanceManifest.insert(hive);\n pushOperation.addManifest(instanceKey);\n hive.execute(pushOperation.setHiveName(groupName).setRemote(remote));\n }\n }", "private static void makeInstance(){\n\n if(settingsFile==null){\n settingsFile = new MetadataFile(SETTINGS_FILE_PATH);\n }\n\n if(!settingsFile.exists()){\n settingsFile.create();\n }\n\n if(tagListeners==null){\n tagListeners= new HashMap<>();\n }\n\n }", "@Override\n public boolean getInstantiateForClass() throws G2AccessException {\n java.lang.Object retnValue = getStaticAttributeValue (SystemAttributeSymbols.INSTANTIATE_);\n return ((Boolean)retnValue).booleanValue ();\n }", "private void injectGetInstanceMethod(ClassNode cn) {\n MethodNode getInstanceMethod = new MethodNode(ACC_PUBLIC | ACC_STATIC, GET_TESTABLE_REF,\n VOID_ARGS + ClassUtil.toByteCodeClassName(mockClassName), null, null);\n InsnList il = new InsnList();\n il.add(new FieldInsnNode(GETSTATIC, mockClassName, TESTABLE_REF, ClassUtil.toByteCodeClassName(mockClassName)));\n LabelNode label = new LabelNode();\n il.add(new JumpInsnNode(IFNONNULL, label));\n il.add(new TypeInsnNode(NEW, mockClassName));\n il.add(new InsnNode(DUP));\n il.add(new MethodInsnNode(INVOKESPECIAL, mockClassName, ConstPool.CONSTRUCTOR, VOID_ARGS + VOID_RES, false));\n il.add(new FieldInsnNode(PUTSTATIC, mockClassName, TESTABLE_REF, ClassUtil.toByteCodeClassName(mockClassName)));\n il.add(label);\n il.add(new FrameNode(F_SAME, 0, null, 0, null));\n il.add(new FieldInsnNode(GETSTATIC, mockClassName, TESTABLE_REF, ClassUtil.toByteCodeClassName(mockClassName)));\n il.add(new InsnNode(ARETURN));\n getInstanceMethod.instructions = il;\n getInstanceMethod.maxStack = 2;\n getInstanceMethod.maxLocals = 0;\n cn.methods.add(getInstanceMethod);\n }", "@Override\n\tpublic IAlgoInstance createInstance(String id,\n\t\t\tIGenlabWorkflowInstance workflow) {\n\t\treturn null;\n\t}", "public SuperRegionAccAccessBean(int arg0, int arg1, int arg2, boolean arg3, boolean arg4, boolean arg5, boolean arg6) throws javax.ejb.CreateException, java.rmi.RemoteException, javax.naming.NamingException {\n ejbRef = ejbHome().create(arg0, arg1, arg2, arg3, arg4, arg5, arg6);\n }", "@Override\r\n\tpublic ItemInstance createItemInstance() {\n\t\treturn new HpInstance();\r\n\t}", "public void _createInstance() {\n requiredMethod(\"getAvailableServiceNames()\");\n\n if (services.length == 0) {\n services = (String[]) tEnv.getObjRelation(\"XMSF.serviceNames\");\n\n if (services == null) {\n log.println(\"No service to create.\");\n tRes.tested(\"createInstance()\", true);\n\n return;\n }\n }\n\n String needArgs = (String) tEnv.getObjRelation(\"needArgs\");\n\n if (needArgs != null) {\n log.println(\"The \" + needArgs + \n \" doesn't support createInstance without arguments\");\n tRes.tested(\"createInstance()\", true);\n\n return;\n }\n\n boolean res = true; \n\n for (int k = 0; k < services.length; k++) {\n try {\n log.println(\"Creating Instance: \" + services[k]);\n\n Object Inst = oObj.createInstance(services[k]);\n res = (Inst != null);\n } catch (com.sun.star.uno.Exception ex) {\n log.println(\"Exception occurred during createInstance()\");\n ex.printStackTrace(log);\n res = false;\n }\n }\n\n tRes.tested(\"createInstance()\", res);\n }", "public static ByteArrayCache instance() {\n if (_instance == null) try {\n _instance = (ByteArrayCache) ImmortalMemory.instance().newInstance( ByteArrayCache.class);\n ZenProperties.logger.log(Logger.INFO, ByteArrayCache.class, \"instance\", \"ByteArrayCache created\");\n } catch (Exception e) {\n ZenProperties.logger.log(Logger.FATAL, ByteArrayCache.class, \"instance\", e);\n System.exit(-1);\n }\n return _instance;\n }", "CdapServiceInstanceConfiguration createCdapServiceInstanceConfiguration();", "void setInstanceId(int instanceId);", "void setInstanceId(int instanceId);", "void setInstanceId(int instanceId);", "public void initInstance(EntityEnterpriseContext ctx)\n {\n if(!readOnly)\n {\n Object value;\n if(fieldType == boolean.class)\n value = Boolean.FALSE;\n else if(fieldType == byte.class)\n value = new Byte((byte)0);\n else if(fieldType == int.class)\n value = new Integer(0);\n else if(fieldType == long.class)\n value = new Long(0L);\n else if(fieldType == short.class)\n value = new Short((short)0);\n else if(fieldType == char.class)\n value = new Character('\\u0000');\n else if(fieldType == double.class)\n value = new Double(0d);\n else if(fieldType == float.class)\n value = new Float(0f);\n else\n value = null;\n setInstanceValue(ctx, value);\n }\n }", "@Override\n public void run() {\n sh.ignite();\n }", "public SNVAppModuleImpl() {\n }", "public SampleBean() {\n }", "public interface Pie2NriHome extends javax.ejb.EJBHome {\ncom.hps.july.arenda.billing.Pie2Nri create() throws javax.ejb.CreateException, java.rmi.RemoteException;\n}" ]
[ "0.68799436", "0.6522087", "0.61570364", "0.60594356", "0.60236305", "0.5935656", "0.59282815", "0.58772767", "0.583498", "0.5820209", "0.5789947", "0.57564145", "0.57316107", "0.5708382", "0.56822056", "0.5673837", "0.5670905", "0.56581396", "0.56218815", "0.55961317", "0.5514263", "0.54874027", "0.5466824", "0.5456782", "0.5413665", "0.5413362", "0.5381642", "0.5358743", "0.53581566", "0.53287154", "0.5286275", "0.52841794", "0.5279279", "0.52750844", "0.5270553", "0.52660704", "0.5245655", "0.52437276", "0.52290624", "0.52234966", "0.5214935", "0.52026266", "0.5188443", "0.5186619", "0.5182688", "0.51813155", "0.5167109", "0.5166268", "0.51642895", "0.51554626", "0.5145845", "0.5139053", "0.51354754", "0.5134953", "0.51340604", "0.5126675", "0.51260823", "0.5116772", "0.5115394", "0.5113557", "0.5097978", "0.5094295", "0.5076287", "0.50750005", "0.5074915", "0.50674367", "0.5065449", "0.5062434", "0.50447625", "0.50434065", "0.50403917", "0.50387883", "0.5037687", "0.50363666", "0.50204796", "0.5017562", "0.5015963", "0.5015028", "0.5002517", "0.50013053", "0.50006753", "0.49944422", "0.49883464", "0.49864608", "0.49816227", "0.49716568", "0.49678028", "0.4961201", "0.49586877", "0.4956342", "0.49550104", "0.49497217", "0.49439743", "0.49439743", "0.49439743", "0.4937801", "0.4929961", "0.4927336", "0.49253508", "0.4924105" ]
0.66934395
1
Get the appropriate target feature computer for this target feature lister from voice
protected TargetFeatureComputer getTargetFeatureComputer(Voice v) { return v.getHalfphoneTargetFeatureComputer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "FTCommand getFeature();", "iet.distributed.telemetry.Feature getFeature(int index);", "public org.pentaho.pms.cwm.pentaho.meta.core.CwmStructuralFeature getFeature();", "Feature getFeature();", "Feature getFeature();", "String getFeature();", "String getFeature();", "public String feature() {\n return feature;\n }", "public HardwareFacade getHardware() {\n\treturn hf;\n }", "public String getFeature() {\r\n return feature;\r\n }", "public String getPhoneFeature(String phone, String featureName) {\n\treturn null;\n }", "public AbstractMFeature2 getFeature() {\n return feature;\n }", "public Peripheral getHardwareDriverFromSoftwareDriver();", "public Software getSoftware(Software target){\n return products.find (target);\n }", "Import getTechnology();", "String getOscTarget();", "public String getVoice() throws DynamicCallException, ExecutionException {\n return (String)call(\"getVoice\").get();\n }", "@Override\n public String getFeature() {\n return this.exteriorFeature;\n }", "public FighterCharacteristics characteristics();", "String getTarget();", "String getTarget();", "com.google.cloud.speech.v2.Recognizer getRecognizer();", "public Voice getVoice ()\r\n {\r\n return voice;\r\n }", "public FieldActorDescriptor getSelectedActor()\n {\n return (FieldActorDescriptor) selectedDescriptor;\n }", "public SampleProvider getMagneticMode() {\r\n \treturn this;\r\n }", "public static String getPhoneFeature(Item item, String featureName) {\n\t\tVoice voice = item.getUtterance().getVoice();\n\t\tString feature = voice.getPhoneFeature(item.toString(), featureName);\n\t\treturn feature;\n\t}", "PolicyEngineFeatureApi getFeatureProvider(String featureName);", "public Spatial getTarget() {\r\n return target;\r\n }", "public ImageFlavor getTargetFlavor() {\n/* 312 */ if (this.converters.size() > 0)\n/* 313 */ return getConverter(this.converters.size() - 1).getTargetFlavor(); \n/* 314 */ if (this.loader != null) {\n/* 315 */ return this.loader.getTargetFlavor();\n/* */ }\n/* 317 */ return null;\n/* */ }", "public PeripheralHardwareDriverInterface getHardwareDriver();", "AudioProcessor[] mo25073a();", "public String toString() { return tech.getTechName(); }", "Player getSelectedPlayer();", "public java.lang.String getTarget() {\n return target;\n }", "@Override\r\n\tpublic String getFortune() {\n\t\treturn service.getFortuneService();\r\n\t}", "Reference getDevice();", "ITargetMode getCurrentTargetMode();", "public Living getTarget();", "@objid (\"19651663-f981-4f11-802a-d5d7cbd6f88a\")\n Instance getTarget();", "private Target getTarget() {\n Address targetAddress = GenericAddress.parse(mIp);\n CommunityTarget target = new CommunityTarget();\n target.setCommunity(new OctetString(mCommunity));\n target.setAddress(targetAddress);\n target.setRetries(2);\n target.setTimeout(15000);\n target.setVersion(mVersion);\n return target;\n }", "public Future<String> getVoice() throws DynamicCallException, ExecutionException {\n return call(\"getVoice\");\n }", "@Override\n\tpublic java.lang.String getTargetLanguage() {\n\t\treturn _scienceApp.getTargetLanguage();\n\t}", "public Mob getTarget() {\r\n return target.get();\r\n }", "public static String getManufacturer() {\n String mfg = \"unknown\"; //$NON-NLS-1$\n if (apiLevel() > 3) {\n try {\n final Class<?> buildClass = Build.class;\n mfg = (String) buildClass.getField(\"MANUFACTURER\").get(null); //$NON-NLS-1$\n } catch (final Exception ignore) {\n Log.d(TAG, \"Caught exception\", ignore); //$NON-NLS-1$\n }\n }\n return mfg;\n }", "FeatureCall getFec();", "java.lang.String getTarget();", "java.lang.String getTarget();", "public AudioDescriptor getAudioDescriptor();", "com.google.cloud.videointelligence.v1p3beta1.StreamingFeature getFeature();", "public FeatureProcessor getFeatureProcessor(String name) {\n\treturn (FeatureProcessor) featureProcessors.get(name);\n }", "public Player getTarget() {\n return target;\n }", "@Override\n\tpublic Computer getComputer() {\n\t\treturn com;\n\t}", "@Override\r\n\tpublic String getFortune() {\n\t\treturn \"other fortune Service\";\r\n\t}", "public String getTarget()\r\n\t{\r\n\t\treturn _target;\r\n\t}", "java.util.List<iet.distributed.telemetry.Feature> \n getFeatureList();", "public String getTarget() {\n return target;\n }", "public String getTarget() {\n return target;\n }", "public static Mixer getPrimaryCaptureDriver() {\r\n\t\t//final String searchName = \"Microphone (Realtek High Defini\";\r\n\t\t//final String searchName = \"Primary Sound Capture Driver\";\r\n\t\tfinal String searchName = \"Stereo Mix (Realtek High Defini\";// this one for loopback\r\n\t\tMixer.Info infos[] = AudioSystem.getMixerInfo();\r\n\t\t\r\n\t\tfor(Mixer.Info i : infos) {\r\n\t\t\tif(i.getName().equals(searchName)) {\r\n\t\t\t\tif(DEBUG) {\r\n\t\t\t\t\tSystem.out.println(\"Found primary sound capture driver: \" + i);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn AudioSystem.getMixer(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(DEBUG) {\r\n\t\t\tSystem.out.println(\"Failed to find sound capture driver, name=\\\"\" + searchName + \"\\\".\");\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "String getTarget() {\r\n return this.target;\r\n }", "String getMidiTarget();", "@Override\n\tpublic void makeFeatChoices(PlayerCharacter pc) {\n\n\t}", "@Experimental\n @Returns(\"targetInfo\")\n TargetInfo getTargetInfo();", "private ResourceCubeType humanResourceChoice() {\r\n\t\tfinal String[] playerOptions = new String[4];\r\n\r\n\t\t// Options for the JOption Pane\r\n\t\tplayerOptions[ResourceCubeType.FAVOR.getValue()] = ResourceCubeType.FAVOR.getName();\r\n\t\tplayerOptions[ResourceCubeType.FOOD.getValue()] = ResourceCubeType.FOOD.getName();\r\n\t\tplayerOptions[ResourceCubeType.GOLD.getValue()] = ResourceCubeType.GOLD.getName();\r\n\t\tplayerOptions[ResourceCubeType.WOOD.getValue()] = ResourceCubeType.WOOD.getName();\r\n\r\n\t\tfinal JFrame frame = new JFrame();\r\n\t\tfinal String humanResponse = (String) JOptionPane.showInputDialog(frame,\r\n\t\t\t\t\"Please select which type of Resource to gather from.\", \"Select Resource Type\",\r\n\t\t\t\tJOptionPane.QUESTION_MESSAGE, null, playerOptions, playerOptions[0]);\r\n\r\n\t\treturn ResourceCubeType.getTypeForString(humanResponse);\r\n\t}", "public String getTarget() {\n return this.target;\n }", "public Technology getResearchingTechnology(RoleCityAgent agent){\n\t\tif(agent == null){\n\t\t\treturn null;\n\t\t}\n\t\treturn agent.getTechAgent().getTechnology(sTechId);\n\t}", "String getManufacturer();", "public Pair<Byte,Short> getCurrentWeapon(){\n return this.currentWeapon;\n }", "public abstract List<Technique> findTechniqueByName(String technique);", "@Nullable JvmIdentifiableElement getFeature();", "public RaceCar getTarget() {\n return target;\n }", "speech.multilang.Params.DecisionPointParams.Type getType();", "public String getVideoDevice();", "public org.pentaho.pms.cwm.pentaho.meta.expressions.CwmFeatureNode getFeatureNode();", "speech.multilang.Params.ForwardingControllerParams.Type getType();", "public Voice() {\n /* Make the utteranceProcessors a synchronized list to avoid\n * some threading issues.\n */\n utteranceProcessors = Collections.synchronizedList(new ArrayList());\n\tfeatures = new FeatureSetImpl();\n\tfeatureProcessors = new HashMap();\n\n\ttry {\n\t nominalRate = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"speakingRate\",\"150\"));\n\t pitch = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"pitch\",\"100\"));\n\t range = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"range\",\"10\"));\n\t volume = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"volume\",\"1.0\"));\n\t} catch (SecurityException se) {\n\t // can't get properties, just use defaults\n\t}\n outputQueue = null;\n audioPlayer = null;\n defaultAudioPlayer = null;\n }", "private LanguageFeature getLanguageFeatureByLanguageModule(LanguageModule languageModule, ArrayList<LanguageFeature> featuresList) {\n\t\tfor (LanguageFeature languageFeature : featuresList) {\n\t\t\tif(languageFeature.getImplementationModule() != null && languageFeature.getImplementationModule().equals(languageModule))\n\t\t\t\treturn languageFeature;\n\t\t}\n\t\treturn null;\n\t}", "public String getPlaybackDevice();", "speech.multilang.Params.DecisionPointParams getDecisionPointParams();", "public String getSelected()\r\n {\r\n if (selectedIndex == -1)\r\n return null;\r\n \r\n return towerTypes[selectedIndex];\r\n }", "public Hero getHero();", "java.lang.String getFeatures(int index);", "public String getOdlOpenflowManufacturer2() throws SnmpStatusException;", "public Train getSelectedTrain(){\n\n return this.selectedTrain;\n }", "public ComponentFeature getFeature(int index) {\r\n\t\tif (index >= features.length)\r\n\t\t\treturn null;\r\n\r\n\t\treturn features[index];\r\n\t}", "private SpeechRecognitionMode getMode() {\n\n return SpeechRecognitionMode.LongDictation;\n }", "public SVMmodel getSVMmodel(List<ActionVocal> vocalActions) {\n\n for(SVMmodel model : svmModels.values()) {\n if (model.containsTheSounds( false, vocalActions))\n return model;\n }\n\n return null;\n }", "@Override\r\n\tpublic String getFortune() {\n\t\t\r\n\t\treturn fortuneService.getFortune();\r\n\t}", "public Object getUnderlyingObject() {\n return feature;\n }", "public PhysicianParc getSelectedPhysician() {\n if (nextPhysicianAvailableCheckbox.isChecked()) {\n return null;\n }\n\n // iterate the radio-buttons and get the selected physician\n for (int i = 0; i < nearbyPhysicianRadioButtonList.size(); i++) {\n if (nearbyPhysicianRadioButtonList.get(i).isChecked()) {\n return nearbyPhysicianList.get(i);\n }\n }\n\n // no physician was selected and the checkbox was not selected\n // -> handle as if the checkbox is selected\n return null;\n }", "public HardwareProfile hardwareProfile() {\n return this.hardwareProfile;\n }", "public String getShortType() { return \"Tech\"; }", "List<String> getFeatures();", "public boolean getVoiceSearchLaunchRecognizer() {\n/* 186 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public final DodlesActor getSelectedActor() {\n if (selectedActors.size() > 0) {\n return selectedActors.iterator().next();\n }\n\n return null;\n }", "public Target getTarget() {\n return target;\n }", "public Integer getFeature() {\n return feature;\n }", "public String getRHandLocFeatures() {\n double[] angle = new double[] {getAngle(linAccSample)};\n\n // 15 linear accelerometer features (means etc across 3 axes)\n double[] linAccMeans = getMean(linAccSample);\n double[] linAccStdDevs = getStdDev(linAccSample);\n double[] linAccSkewness = getSkewness(linAccSample);\n double[] linAccKurtosis = getKurtosis(linAccSample);\n double linAcc1Norm = getL1Norm(linAccMatrix);\n double linAccInfNorm = getInfNorm(linAccMatrix);\n double linAccFroNorm = getFroNorm(linAccMatrix);\n\n double[] linAccNorms = new double[]{linAcc1Norm, linAccInfNorm, linAccFroNorm};\n\n // 15 gyroscope features\n double[] gyroMeans = getMean(gyroSample);\n double[] gyroStdDevs = getStdDev(gyroSample);\n double[] gyroSkewness = getSkewness(gyroSample);\n double[] gyroKurtosis = getKurtosis(gyroSample);\n double gyro1Norm = getL1Norm(gyroMatrix);\n double gyroInfNorm = getInfNorm(gyroMatrix);\n double gyroFroNorm = getFroNorm(gyroMatrix);\n\n double[] gyroNorms = new double[] {gyro1Norm, gyroInfNorm, gyroFroNorm};\n\n // 9 pearson features\n double[] pearsonCoeffs = getPearsonCoeff(linAccSample, gyroSample);\n\n double[] featureArray = merge(\n angle,\n linAccMeans, linAccStdDevs, linAccSkewness, linAccKurtosis, linAccNorms,\n gyroMeans, gyroStdDevs, gyroSkewness, gyroKurtosis, gyroNorms,\n pearsonCoeffs);\n\n StringBuilder featureString = new StringBuilder();\n for (int i = 0; i < featureArray.length; i++) {\n featureString.append(i+1);\n featureString.append(':');\n featureString.append(featureArray[i]);\n featureString.append(' ');\n }\n return featureString.toString(); }", "String getSelectedDevice() {\n return selectedDevice;\n }", "public com.commercetools.api.models.common.Reference getTarget() {\n return this.target;\n }", "public TechnologyServiceBL getTechnologyServiceBL() {\n return technologyServiceBL;\n }" ]
[ "0.5917833", "0.5423565", "0.54219663", "0.5382339", "0.5382339", "0.5333123", "0.5333123", "0.5282299", "0.5278575", "0.5265537", "0.521576", "0.5165126", "0.5161663", "0.5135216", "0.51327455", "0.51166314", "0.5108825", "0.5089107", "0.50825304", "0.50594443", "0.50594443", "0.50570995", "0.5050058", "0.5009542", "0.4981127", "0.49799722", "0.49764168", "0.49676076", "0.4961816", "0.49421734", "0.49367648", "0.4918197", "0.4898035", "0.4869736", "0.48625714", "0.48585677", "0.4856796", "0.4839935", "0.48315194", "0.48309305", "0.482911", "0.48096535", "0.47947806", "0.47933382", "0.47915435", "0.47897592", "0.47897592", "0.4787059", "0.47800043", "0.47742093", "0.47675908", "0.47611392", "0.4754439", "0.47535133", "0.47514778", "0.47510642", "0.47510642", "0.47462603", "0.4736211", "0.47243857", "0.4721121", "0.4710779", "0.47014967", "0.46970174", "0.46934658", "0.46889848", "0.46879506", "0.4676068", "0.4674507", "0.46679753", "0.46636114", "0.46635628", "0.4650114", "0.4636703", "0.4628169", "0.46268985", "0.46009517", "0.46006915", "0.4596539", "0.4589788", "0.4588692", "0.45787573", "0.45784006", "0.45771137", "0.45725554", "0.45705554", "0.457045", "0.45688418", "0.45622754", "0.45601428", "0.4559455", "0.45576566", "0.4554009", "0.45528296", "0.4550523", "0.4548493", "0.4548366", "0.45483062", "0.4547493", "0.45473662" ]
0.7834314
0
Create the list of targets from the Segments in the utterance.
protected List<Target> createTargets(Relation segs) { List<Target> targets = new ArrayList<Target>(); for (Item s = segs.getHead(); s != null; s = s.getNext()) { Element maryxmlElement = (Element) s.getFeatures().getObject("maryxmlElement"); String segName = s.getFeatures().getString("name"); targets.add(new HalfPhoneTarget(segName+"_L", maryxmlElement, s, true)); // left half targets.add(new HalfPhoneTarget(segName+"_R", maryxmlElement, s, false)); // right half } return targets; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected List<Target> overridableCreateTargetsWithPauses(Relation segs)\r\n {\r\n return HalfPhoneTargetFeatureLister.createTargetsWithPauses(segs);\r\n }", "private List<Category> extractTargets() {\n List<String> names = getNames(\"category\");\n CategorySelectAsyncTask task = new CategorySelectAsyncTask();\n CategoryMapper mapper = new CategoryMapper();\n task.setNames(names);\n List<Category> list = new ArrayList<>();\n try {\n list.addAll(mapper.to(task.execute().get()));\n } catch (ExecutionException | InterruptedException e) {\n Log.e(TAG, \"extractTargets: \" + e.getMessage(), e);\n }\n return list;\n }", "public List<Target> getTargets()\n {\n return targets;\n }", "public static ArrayList<String> getTargets() {\r\n return TARGETS;\r\n }", "public IdentifierListNode getTargets()throws ClassCastException;", "@Returns(\"targetInfos\")\n @ReturnTypeParameter(TargetInfo.class)\n List<TargetInfo> getTargets();", "public static List<Target> createTargetsWithPauses(Relation segs) {\r\n List<Target> targets = new ArrayList<Target>();\r\n \r\n boolean first = true;\r\n Item s = segs.getHead();\r\n Voice v = FreeTTSVoices.getMaryVoice(s.getUtterance().getVoice());\r\n String silenceSymbol = v.sampa2voice(\"_\");\r\n Target lastTarget = null;\r\n Item lastItem = s;\r\n for (; s != null; s = s.getNext()) {\r\n Element maryxmlElement = (Element) s.getFeatures().getObject(\"maryxmlElement\");\r\n //create next target\r\n String segName = s.getFeatures().getString(\"name\");\r\n Target nextLeftTarget = new HalfPhoneTarget(segName+\"_L\", maryxmlElement, s, true); \r\n Target nextRightTarget = new HalfPhoneTarget(segName+\"_R\", maryxmlElement, s, false);\r\n //if first target is not a pause, add one\r\n if (first){\r\n first = false;\r\n //if (! segName.equals(silenceSymbol)){\r\n if (! nextLeftTarget.isSilence()){\r\n //System.out.println(\"Adding two pause targets: \"\r\n // +silenceSymbol+\"_L and \"\r\n // +silenceSymbol+\"_R\");\r\n //build new pause item\r\n Item newPauseItem = s.prependItem(null);\r\n newPauseItem.getFeatures().setString(\"name\", silenceSymbol);\r\n \r\n //add new targets for item\r\n targets.add(new HalfPhoneTarget(silenceSymbol+\"_L\", null, newPauseItem, true)); \r\n targets.add(new HalfPhoneTarget(silenceSymbol+\"_R\", null, newPauseItem, false));\r\n }\r\n }\r\n targets.add(nextLeftTarget);\r\n targets.add(nextRightTarget);\r\n lastTarget = nextRightTarget;\r\n lastItem = s;\r\n } \r\n if (! lastTarget.isSilence()){\r\n //System.out.println(\"Adding pause target \"\r\n // +silenceSymbol);\r\n //build new pause item\r\n Item newPauseItem = lastItem.appendItem(null);\r\n newPauseItem.getFeatures().setString(\"name\", silenceSymbol);\r\n \r\n //add new targets for item\r\n targets.add(new HalfPhoneTarget(silenceSymbol+\"_L\", null, newPauseItem, true)); \r\n targets.add(new HalfPhoneTarget(silenceSymbol+\"_R\", null, newPauseItem, false));\r\n }\r\n return targets;\r\n }", "public void setTargets(IdentifierListNode targets);", "private void parseTargets(EventCollector eventCollector, List<Antfile> importsToProcess, List<Antfile> importsAlreadyProcessed,\n AntScriptPreferences preferences)\n {\n Iterator descendants = rootElement.getDescendants(new ElementFilter(\"target\"));\n\n while (descendants.hasNext())\n {\n Element targetElement = (Element) descendants.next();\n String targetName = targetElement.getAttribute(\"name\").getValue().trim();\n Attribute descriptionElement = targetElement.getAttribute(\"description\");\n String description = (descriptionElement != null) ? descriptionElement.getValue().trim() // todo replace with StringUtils\n : \"\";\n Target target = new Target(targetName, description, this, targetElement); // these could be in an imported ant buildFile -\n // need to find them, maybe later\n\n addTarget(target);\n target.parseDepends();\n\n if (preferences.shouldShowAntcalls())\n {\n target.parseAntCalls(targetElement);\n }\n\n if (preferences.shouldShowAnts())\n {\n target.parseAnts(targetElement, eventCollector, importsToProcess, importsAlreadyProcessed);\n }\n }\n }", "public List<Translation2d> findTranslationsThroughTargets(){\n PhotonPipelineResult result = getLatestResult();\n if(!result.hasTargets()) return new ArrayList<>();\n List<PhotonTrackedTarget> targets = result.getTargets();\n List<Translation2d> translationList = new ArrayList<>();\n\n for(PhotonTrackedTarget target : targets){\n double distance = PhotonUtils.calculateDistanceToTargetMeters(\n kCamHeight, kTargetHeight, kCamPitch, Units.degreesToRadians(target.getPitch()));\n Translation2d translation = PhotonUtils.estimateCameraToTargetTranslation(\n distance, Rotation2d.fromDegrees(-target.getYaw()));\n\n translationList.add(translation);\n }\n\n return translationList;\n }", "public PyList getTargets() {\n\t\treturn (PyList) shadowstr_gettargets();\n\t}", "private <T> void getPossibleTargets(TargetingScheme<T> t, TargetList<T> current, List<? extends T> searchSpace, int startInd,\n List<TargetList<T>> outputList) {\n if (t.isFullyTargeted(current)) {\n outputList.add(current);\n return;\n }\n if (startInd >= searchSpace.size()) {\n System.out.println(\"this shouldn't happen lmao\");\n }\n int numToSelect = Math.min(searchSpace.size(), t.getMaxTargets());\n for (int i = startInd; i < searchSpace.size() - (numToSelect - current.targeted.size() - 1); i++) {\n T c = searchSpace.get(i);\n if (!current.targeted.contains(c)) {\n TargetList<T> copy = current.clone();\n copy.targeted.add(c);\n this.getPossibleTargets(t, copy, searchSpace, i + 1, outputList);\n }\n }\n }", "private void getMyTargetsList() {\n try {\n\n String qryTargets = Constants.Targets+ \"?$filter=\" +Constants.KPIGUID+ \" eq guid'\"\n + mStrBundleKpiGUID+\"'\" ;\n ArrayList<MyTargetsBean> alMyTargets = OfflineManager.getMyTargetsList(qryTargets, mStrParnerGuid,\n mStrBundleKpiName, mStrBundleKpiCode, mStrBundleKpiGUID,\n mStrBundleCalBased, mStrBundleKpiFor,\n mStrBundleCalSource, mStrBundleRollup,mStrBundleKPICat,true);\n\n ArrayList<MyTargetsBean> alOrderValByOrderMatGrp = OfflineManager.getActualTargetByOrderMatGrp(CRSSKUGroupWiseTargetsActivity.this,mStrCPDMSDIV);\n mapMyTargetValByCRSSKU = getALOrderVal(alOrderValByOrderMatGrp);\n mapMyTargetVal = getALMyTargetList(alMyTargets);\n sortingValues();\n } catch (OfflineODataStoreException e) {\n sortingValues();\n LogManager.writeLogError(Constants.strErrorWithColon + e.getMessage());\n }\n }", "List<T> getRuleTargets();", "public ArrayList<LinkedList<Node>> getTargets(){\n\t\treturn targets;\n\t}", "public ArrayList<Habitat> getTargets(Habitat source) {\r\n\t\t// return empty list if the habitat isn't inserted in the target list\r\n\t\tif (!habitatToTargetList.containsKey(source.getID()+\"\")) return new ArrayList<Habitat>();\r\n\t\t\r\n\t\t// return target list\r\n\t\treturn habitatToTargetList.get(\"\"+source.getID());\r\n\t}", "public Hashtable getTargets() {\n return targets;\n }", "public void registerTargets(){\n synchronized(targets){\n while(targets.size()>0){\n Target target= (Target) targets.removeFirst();\n try {\n target.socketChannel.register(selector,SelectionKey.OP_CONNECT,target);\n } catch (ClosedChannelException e) {\n// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n try {\n target.socketChannel.close();\n } catch (IOException e1) {\n e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n target.failure=e;\n addFinishedTarget(target);\n }\n }\n }\n }", "public List<Taskdef> parseForTaskdefs()\n {\n parseElementForTaskdefs(rootElement); // parse outside of targets - most common definition\n\n for (Iterator targetsIterator = rootElement.getDescendants(new ElementFilter(\"target\")); targetsIterator.hasNext();)\n {\n Element targetElement = (Element) targetsIterator.next();\n\n parseElementForTaskdefs(targetElement); // parse inside of targets (such as \"init\"\n }\n\n return localTaskdefs;\n }", "public InsnTarget[] switchTargets() {\n return targetsOp;\n }", "EValidTargetTypes getTargets();", "public List<String> getTargetSubjects(int targetId) {\r\n \t\r\n \tCollection<String> targetNeighbours = jungCompleteGraph.getOutEdges(targetId);\r\n \tList<String> targetSubjects = new ArrayList<>();\r\n \tfor (String edge: targetNeighbours) {\r\n \t\t\r\n \t\tif(edge.contains(\"http://purl.org/dc/terms/subject\")){\r\n \t\t\tList<String> tokens = Arrays.asList(getURI(jungCompleteGraph.getDest(edge)).replace(\"http://dbpedia.org/resource/Category:\", \"\").split(\"_\"));\r\n \t\t\ttargetSubjects.addAll(tokens);\r\n \t\t\t}\r\n \t}\r\n \t\r\n \treturn targetSubjects;\r\n \t\r\n }", "default List<PendingAttestation> get_matching_target_attestations(BeaconState state, EpochNumber epoch) {\n return get_matching_source_attestations(state, epoch).stream()\n .filter(a -> a.getData().getTargetRoot().equals(get_block_root(state, epoch)))\n .collect(toList());\n }", "public static List<SemanticGraphEdge> getTargetEdgesOnTarget(final Iterable<SemanticGraphEdge> edges,\n\t\t\tfinal GeneralPosRelationEnum targetType, final boolean isSource) {\n\t\tfinal List<SemanticGraphEdge> targetEdges = new ArrayList<SemanticGraphEdge>();\n\n\t\tfor (SemanticGraphEdge edge : edges) {\n\t\t\tif (!isSource && targetType.contains(edge.getTarget().tag())) {\n\t\t\t\ttargetEdges.add(edge);\n\t\t\t}\n\t\t\tif (isSource && targetType.contains(edge.getSource().tag())) {\n\t\t\t\ttargetEdges.add(edge);\n\t\t\t}\n\t\t}\n\t\treturn targetEdges;\n\t}", "public java.util.Enumeration getTargets() {\n return targets.elements();\n }", "private void linkTargets(ISequenceComponent seq) throws Exception {\n\t\tif (seq == null) {\n\t\t\tlogger.create().block(\"linkTargets\").info().level(1).msg(\"Group sequence is null, no targets to link\")\n\t\t\t\t\t.send();\n\t\t\treturn;\n\t\t}\n\t\tif (seq instanceof XIteratorComponent) {\n\t\t\t// extract from each sub-element\n\n\t\t\tXIteratorComponent xit = (XIteratorComponent) seq;\n\t\t\tList list = xit.listChildComponents();\n\t\t\tIterator ic = list.iterator();\n\t\t\twhile (ic.hasNext()) {\n\t\t\t\tISequenceComponent cseq = (ISequenceComponent) ic.next();\n\t\t\t\tlinkTargets(cseq);\n\t\t\t}\n\t\t} else if (seq instanceof XBranchComponent) {\n\t\t\t// there should be no targets in here !\n\n\t\t} else {\n\t\t\t// this is an executive - only check slew and target-select\n\n\t\t\tXExecutiveComponent xec = (XExecutiveComponent) seq;\n\t\t\tIExecutiveAction action = xec.getExecutiveAction();\n\n\t\t\tif (action instanceof ITargetSelector) {\n\t\t\t\tITarget target = ((ITargetSelector) action).getTarget();\n\t\t\t\tif (target == null)\n\t\t\t\t\tthrow new Exception(\"TargetSelector:\" + seq.getComponentName() + \" had null target\");\n\t\t\t\t// link the target to one from table\n\t\t\t\tITarget ctarget = targets.get(target.getID());\n\t\t\t\tif (ctarget == null)\n\t\t\t\t\tthrow new Exception(\"Target: \" + target.getName() + \" is not known\");\n\t\t\t\t((XTargetSelector) action).setTarget(ctarget);\n\n\t\t\t} else if (action instanceof ISlew) {\n\t\t\t\tITarget target = ((ISlew) action).getTarget();\n\t\t\t\tif (target == null)\n\t\t\t\t\tthrow new Exception(\"TargetSelector:\" + seq.getComponentName() + \" had null target\");\n\t\t\t\t// link the target to one from table\n\t\t\t\tITarget ctarget = targets.get(target.getID());\n\t\t\t\tif (ctarget == null)\n\t\t\t\t\tthrow new Exception(\"Target: \" + target.getName() + \" is not known\");\n\t\t\t\t((XSlew) action).setTarget(ctarget);\n\t\t\t}\n\t\t}\n\t}", "public String[] getSrcPhrases(ArrayList<String> alignments){\n\t\tString[] phrases = new String[alignments.size()];\n\t\t\n\t\tString patternString = \"\\\\s\\\\|\\\\|\\\\|\"; // pattern for alignment points\n\t\t\n\t\tfor (int i=0; i<alignments.size(); i++){\n\t\t\tString[] items = alignments.get(i).split(patternString);\n\t\t\tphrases[i] = items[0]; // get source phrase\n\t\t\tSystem.out.println(phrases[i]);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn phrases;\n\t}", "static ShardedTargetList batchTargets(\n Set<Label> targets, SyncStrategy syncStrategy, int suggestedShardSize) {\n return Arrays.stream(EP_NAME.getExtensions())\n .map(s -> s.getShardedTargetList(targets, syncStrategy, suggestedShardSize))\n .filter(Objects::nonNull)\n .findFirst()\n .orElse(\n new ShardedTargetList(\n ImmutableList.of(ImmutableList.copyOf(targets)),\n ShardingApproach.ERROR,\n suggestedShardSize));\n }", "public Vector getTargets(){\n return targets;\n }", "public String[] getTrgPhrases(ArrayList<String> alignments){\n\t\tString[] phrases = new String[alignments.size()];\n\t\t\n\t\tString patternString = \"\\\\s\\\\|\\\\|\\\\|\"; // pattern for alignment points\n\t\t\n\t\tfor (int i=0; i<alignments.size(); i++){\n\t\t\tString[] items = alignments.get(i).split(patternString);\n\t\t\tphrases[i] = items[1]; // get source phrase\n\t\t\tSystem.out.println(phrases[i]);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn phrases;\n\t}", "public ArrayList<String> ExtractAlignments(String src, String trg, String moses){\n\t\tArrayList<String> alignPoints = new ArrayList<String>();\n\t\t\n\t\tString patternString = \"\\\\s\\\\|(\\\\d+)\\\\-(\\\\d+)\\\\|\"; // pattern for alignment points, the indexes (ref to source phrase) are grouped\n\t\t\n\t\tPattern pattern = Pattern.compile(patternString);\n\t\tMatcher matcher = pattern.matcher(moses);\n\t\t\n\t\tint count=0; // how many times are we matching the pattern\n\t\tint istart=0; // index of input string\n\t\tString[] sourceWords = src.split(\" \");\n\t\tint src_start = 0;\n\t\tint src_end = 0;\n\t\tString src_phr = new String();\n\t\t\n\t\t// Traverse through each of the matches\n\t\t// the numbers inside the matched pattern will give us the index of the source phrases\n\t\t// the string preceding he matched pattern will give us the corresponding target string translation\n\t\twhile(matcher.find()) {\n\t\t\tcount++;\n\t\t\t//System.out.println(\"found: \" + count + \" : \" + matcher.start() + \" - \" + matcher.end() + \" for \" + matcher.group());\n\t\t\t\n\t\t\tsrc_start = new Integer(matcher.group(1)).intValue();\n\t\t\tsrc_end = new Integer(matcher.group(2)).intValue();\n\t\t\t//System.out.println(\"Srcphr: \" + matcher.group(1) + \" to \" + matcher.group(2) + sourceWords[src_start] + \" \" + sourceWords[src_end]);\n\t\t\t\n\t\t\t//alignPoints.add(moses.substring(istart,matcher.start()) + \" ||| \" + istart + \" ||| \" + matcher.start());\n\t\t\tsrc_phr = new String(sourceWords[src_start]);\n\t\t\tfor(int i=src_start+1; i<=src_end; i++){ // get the source phrases referenced by the alignment points\n\t\t\t\tsrc_phr += \" \" + sourceWords[i];\n\t\t\t}\n\t\t\talignPoints.add(src_phr + \" ||| \" + moses.substring(istart,matcher.start())); // add the source phrase and the corresponding target string translation separated by |||\n\t\t\tistart = matcher.end() + 1;\n\t\t}\n\t\t//System.out.println(\"The number of times we match patterns is \" + count);\n\t\t\n\t\treturn alignPoints;\n\t}", "public List<Antfile> parseForAnts(EventCollector eventCollector) throws IOException, JDOMException\n {\n List<Antfile> antfiles = new UniqueList<Antfile>();\n\n for (Target target : targets)\n {\n for (Iterator targetsIterator = rootElement.getDescendants(new ElementFilter(\"target\")); targetsIterator.hasNext();)\n {\n Element targetElement = (Element) targetsIterator.next();\n\n if (targetElement.getAttribute(\"name\").getValue().equalsIgnoreCase(target.getName())) // parse this target for usages\n // of \"ant\"\n {\n for (Iterator antIterator = targetElement.getDescendants(new ElementFilter(\"ant\")); antIterator.hasNext();) // we found one!\n {\n parseAnt(antIterator, antfiles, eventCollector);\n }\n }\n }\n }\n\n return antfiles;\n }", "public abstract String generateTokens(int targetNumber);", "public void parseForAntcalls()\n {\n for (Target calledFromTarget : targets)\n {\n for (Iterator targetsIterator = rootElement.getDescendants(new ElementFilter(\"calledFromTarget\")); targetsIterator.hasNext();)\n {\n Element targetElement = (Element) targetsIterator.next();\n\n if (targetElement.getAttribute(\"name\").getValue().equalsIgnoreCase(calledFromTarget.getName())) // parse this calledFromTarget\n // for usages of \"ant\"\n {\n for (Iterator antIterator = targetElement.getDescendants(new ElementFilter(\"ant\")); antIterator.hasNext();) // we found one!\n {\n Element antElement = (Element) antIterator.next();\n String antfile = buildFile.getAbsolutePath(); // default value if they don't\n // specify an antfile, then\n // THIS is the\n // antElement buildFile\n String calledTarget = antElement.getAttribute(\"calledFromTarget\").getValue();\n AntCall antCall = new AntCall(calledTarget, calledFromTarget, this);\n\n addAntCall(antCall);\n }\n }\n }\n }\n }", "public DomainTarget[] getDomainTargets() {\n return domainTargets;\n }", "java.util.List<speech_formatting.SegmentedTextOuterClass.TokenSegment> \n getTokenSegmentList();", "public List<GrouperProvisioningTarget> getEditableTargets() {\r\n \r\n GrouperObject grouperObject = null;\r\n \r\n GuiGroup guiGroup = GrouperRequestContainer.retrieveFromRequestOrCreate().getGroupContainer().getGuiGroup();\r\n GuiStem guiStem = GrouperRequestContainer.retrieveFromRequestOrCreate().getStemContainer().getGuiStem();\r\n \r\n if (guiGroup != null) {\r\n grouperObject = guiGroup.getGrouperObject();\r\n }\r\n if (guiStem != null) {\r\n grouperObject = guiStem.getGrouperObject();\r\n }\r\n \r\n Map<String, GrouperProvisioningTarget> targets = GrouperProvisioningSettings.getTargets(true);\r\n Subject loggedInSubject = GrouperUiFilter.retrieveSubjectLoggedIn();\r\n \r\n Set<GrouperProvisioningTarget> editableTargets = new HashSet<GrouperProvisioningTarget>();\r\n \r\n for (GrouperProvisioningTarget target: targets.values()) {\r\n if (GrouperProvisioningService.isTargetEditable(target, loggedInSubject, grouperObject)) {\r\n editableTargets.add(target);\r\n }\r\n }\r\n \r\n List<GrouperProvisioningTarget> editableTargetsSorted = new ArrayList<>(editableTargets);\r\n \r\n editableTargetsSorted.sort(new Comparator<GrouperProvisioningTarget>() {\r\n\r\n @Override\r\n public int compare(GrouperProvisioningTarget o1, GrouperProvisioningTarget o2) {\r\n return o1.getExternalizedName().compareTo(o2.getExternalizedName());\r\n }\r\n });\r\n \r\n return editableTargetsSorted;\r\n }", "private List loadTargetList(HttpServletRequest request) {\n\t\tTargetDao targetDao = (TargetDao) getBean(\"TargetDao\");\n\t\treturn targetDao.getTargets(AgnUtils.getCompanyID(request));\n\t\t\n\t}", "public TargetCollection(TargetCollection targetCollection){\n targets = targetCollection.getTargets();\n }", "private List<RouteInfo> createList() {\r\n\r\n List<RouteInfo> results = new ArrayList<>();\r\n\r\n for (String temp [] : stops) {\r\n\r\n RouteInfo info = new RouteInfo();\r\n info.setTitle(temp[0]);\r\n info.setRouteName(\"Stop ID: \" + temp[1]);\r\n info.setRouteDescription(\"Next bus at: \");\r\n results.add(info);\r\n }\r\n\r\n return results;\r\n }", "@Override\n\tpublic void generateTasks(Workflow workflow, List<Tuple> targets)\n\t{\n\n\t}", "public ArrayList getAddedTargets(String busGroupId) throws Exception {\r\n ArrayList tableName = new ArrayList();\r\n String getAddedTargetMeas = getResourceBundle().getString(\"getAddedTargetMeas\");\r\n String getAddedTargets = getResourceBundle().getString(\"getAddedTargets\");\r\n\r\n Object grpObj[] = new Object[1];\r\n grpObj[0] = busGroupId;\r\n String fgetAddedTargetMeas = buildQuery(getAddedTargetMeas, grpObj);\r\n PbReturnObject tarMeas = execSelectSQL(fgetAddedTargetMeas);\r\n Object measure[] = new Object[1];\r\n String measureId = \"\";\r\n String measureName = \"\";\r\n String targetId = \"\";\r\n String targetName = \"\";\r\n for (int m = 0; m < tarMeas.getRowCount(); m++) {\r\n BusinessGrpsTreeTable table = new BusinessGrpsTreeTable();\r\n measureId = tarMeas.getFieldValueString(m, \"PRG_MEASURE_ID\");\r\n measureName = tarMeas.getFieldValueString(m, \"MEASURE_NAME\");\r\n measure[0] = measureId;\r\n table.setTargetMeasId(measureId);\r\n table.setTargetMeasName(measureName);\r\n String fingetAddedTargets = buildQuery(getAddedTargets, measure);\r\n PbReturnObject tarObj = execSelectSQL(fingetAddedTargets);\r\n if (tarObj.getRowCount() == 0) {\r\n table.setEndTable(\"true\");\r\n }\r\n // tableName.add(table);\r\n tableName.add(table);\r\n for (int y = 0; y < tarObj.getRowCount(); y++) {\r\n BusinessGrpsTreeTable sectable = new BusinessGrpsTreeTable();\r\n targetId = tarObj.getFieldValueString(y, \"TARGET_ID\");\r\n targetName = tarObj.getFieldValueString(y, \"TARGET_NAME\");\r\n sectable.setTargetId(targetId);\r\n sectable.setTargetMinTimeLevel(tarObj.getFieldValueString(y, \"MIN_TIME_LEVEL\"));\r\n sectable.setTargetName(targetName);\r\n\r\n if (y + 1 == tarObj.getRowCount()) {\r\n sectable.setEndTable(\"true\");\r\n }\r\n tableName.add(sectable);\r\n }\r\n\r\n\r\n }\r\n\r\n return tableName;\r\n\r\n }", "List<String> getTargetClassifications(Observation obs);", "public void parseForTaskdefUsage(List<Taskdef> taskdefs)\n {\n for (Iterator targetElements = rootElement.getDescendants(new ElementFilter(\"target\")); targetElements.hasNext();)\n {\n Element targetElement = (Element) targetElements.next();\n Target target = getMatchingTarget(targetElement);\n\n for (Taskdef taskdef : taskdefs)\n {\n Iterator taskdefElements = targetElement.getDescendants(new ElementFilter(taskdef.getName()));\n\n if (taskdefElements.hasNext()) // we found one!\n {\n target.addDependency(taskdef);\n }\n }\n }\n }", "@Override\n public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {\n \n }", "@Nullable\n default ShardedTargetList getShardedTargetList(\n Set<Label> targets, SyncStrategy syncStrategy, int suggestedShardSize) {\n ImmutableList<ImmutableList<Label>> targetBatches =\n calculateTargetBatches(targets, syncStrategy, suggestedShardSize);\n return targetBatches == null\n ? null\n : new ShardedTargetList(targetBatches, getShardingApproach(), suggestedShardSize);\n }", "private ArrayList<QuadNode> getAllTargets(QuadNode node, PrimitiveCuboid c){\n ArrayList<QuadNode> targets = new ArrayList<QuadNode>();\n targets.add(node);\n //Generate the initial shards\n Stack<PrimitiveCuboid> shards = new Stack<PrimitiveCuboid>();\n for(PrimitiveCuboid init : generateShards(node, c)){\n shards.push(init);\n }\n while(!shards.empty()){\n PrimitiveCuboid shard = shards.pop();\n node = descendAndCreate(root, shard);\n ArrayList<PrimitiveCuboid> newShards = generateShards(node, shard);\n //If no shards were made then this is is the bounding node for this shard. Include it.\n if(newShards.size() == 0){\n targets.add(node);\n }\n for(PrimitiveCuboid t : newShards){\n shards.add(t);\n }\n }\n return targets;\n }", "private void getPossibleListTargets(List<List<TargetingScheme<?>>> list, List<List<TargetList<?>>> alreadyTargeted, List<List<List<TargetList<?>>>> outputList) {\n // and the lord said let there be triple nested lists, trust me bro\n if (list.isEmpty()) {\n outputList.add(new ArrayList<>(alreadyTargeted));\n return;\n }\n List<TargetingScheme<?>> schemesForFirstEffect = list.get(0);\n List<List<TargetList<?>>> searchSpace = new LinkedList<>();\n this.getPossibleListTargetsPerEffect(schemesForFirstEffect, new LinkedList<>(), searchSpace);\n if (searchSpace.isEmpty()) {\n // if no targets, add that possibility to our search space\n searchSpace.add(List.of());\n }\n for (List<TargetList<?>> t : searchSpace) {\n alreadyTargeted.add(t);\n this.getPossibleListTargets(list.subList(1, list.size()), alreadyTargeted, outputList);\n alreadyTargeted.remove(alreadyTargeted.size() - 1);\n }\n }", "public Set<GrouperProvisioningTarget> getViewableTargets() {\r\n \r\n GrouperObject grouperObject = null;\r\n \r\n GuiGroup guiGroup = GrouperRequestContainer.retrieveFromRequestOrCreate().getGroupContainer().getGuiGroup();\r\n GuiStem guiStem = GrouperRequestContainer.retrieveFromRequestOrCreate().getStemContainer().getGuiStem();\r\n \r\n if (guiGroup != null) {\r\n grouperObject = guiGroup.getGrouperObject();\r\n }\r\n if (guiStem != null) {\r\n grouperObject = guiStem.getGrouperObject();\r\n }\r\n \r\n Map<String, GrouperProvisioningTarget> targets = GrouperProvisioningSettings.getTargets(true);\r\n Subject loggedInSubject = GrouperUiFilter.retrieveSubjectLoggedIn();\r\n \r\n Set<GrouperProvisioningTarget> viewableTargets = new HashSet<GrouperProvisioningTarget>();\r\n \r\n for (GrouperProvisioningTarget target: targets.values()) {\r\n if (GrouperProvisioningService.isTargetViewable(target, loggedInSubject, grouperObject)) {\r\n viewableTargets.add(target);\r\n }\r\n }\r\n \r\n return viewableTargets;\r\n }", "public static ArrayList<String> getMultipleTargets(PathConnectionType element, String elementName)\n\t{\n\t\tStringBuilder error = new StringBuilder(); \n\t\tboolean hasError = false;\n\t\tArrayList<String> targets = new ArrayList<>(); \n\t\t\n\t\tif (element.getTarget() == null){\n\t\t\terror.append(elementName + \" (\"+ element.getId() + \") must have a Target attribute\").append(\"\\n\"); \n\t\t\thasError = true; \n\t\t}\n\t\telse if (element.getTarget().size() <= 1)\n\t\t{\n\t\t\terror.append(elementName + \" (\"+ element.getId() + \") must have more than one target\").append(\"\\n\"); \n\t\t\thasError = true; \n\t\t\t \n\t\t}\n\t\telse\n\t\t{\t\n\t\t\tEList<StepType> targetList = element.getTarget(); \n\t\t\tfor (ScenarioElementType targetType: targetList)\n\t\t\t{\n\t\t\t\ttargets.add(targetType.getId());\n\t\t\t\tif (checkForMultipleIDs(targetType.getId()) == false)\n\t\t\t\t{\n\t\t\t\t\terror.append(elementName + \" (\"+ element.getId() + \") has multiple same line Targets \" + targets).append(\"\\n\"); \n\t\t\t\t\thasError = true; \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tif (hasError){\n\t\t\tSystem.out.println(error.toString()); \n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn targets; \n\t\t}\n\t}", "public static List<String> getTargetBasedOnRegex(List<String> fileContent, String pattern) {\r\n String content = getLineContents(fileContent, 0, fileContent.size() - 1);\r\n List<String> targets = new ArrayList<>();\r\n Pattern regex = Pattern.compile(pattern);\r\n Matcher matcher = regex.matcher(content);\r\n while (matcher.find()) {\r\n targets.add(matcher.group());\r\n }\r\n if (targets.size() == 0) {\r\n return null;\r\n } else {\r\n return targets;\r\n }\r\n }", "public void buildDestinationsFromIntent() {\n Intent intent = getIntent();\n ArrayList<String> listOfDestNames = intent.getStringArrayListExtra(\"dName\");\n double[] listOfDestLong = intent.getDoubleArrayExtra(\"dLong\");\n double[] listOfDestLat = intent.getDoubleArrayExtra(\"dLat\");\n ArrayList <String> listOfDestAddr = intent.getStringArrayListExtra(\"dAddr\");\n\n for(int i=0; i < listOfDestNames.size(); i++){\n Destination des = new Destination(listOfDestNames.get(i), listOfDestLong[i], listOfDestLat[i]);\n des.address = listOfDestAddr.get(i);\n destinations.add(i, des);\n }\n }", "public ArrayList<Habitat> getNextTargets(Habitat habitat) {\r\n\t\t// return empty list if the habitat isn't inserted in the target list\r\n\t\tif (!habitatToTargetList.containsKey(habitat.getID()+\"\")) return new ArrayList<Habitat>();\r\n\t\t\r\n\t\t// fetch possible targets\r\n\t\tArrayList<Habitat> habitatList = habitatToTargetList.get(habitat.getID()+\"\");\r\n\t\t\r\n\t\t// create empty target list\r\n\t\tArrayList<Habitat> targetList = new ArrayList<Habitat>();\r\n\t\t\r\n\t\t// loop through possible targets\r\n\t\tfor (int i = 0; i < habitatList.size(); ++i) {\r\n\t\t\tif (System.currentTimeMillis()/1000 - attackFrequency > habitatList.get(i).lastAttackTime) targetList.add(habitatList.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t// return next targets\r\n\t\treturn targetList;\r\n\t}", "@PreAuthorize(\"hasPermission('string', 'ALL', new org.jasig.portal.spring.security.evaluator.AuthorizableActivity('UP_PERMISSIONS', 'VIEW_PERMISSIONS'))\")\n @RequestMapping(value=\"/permissions/{activity}/targets.json\", method = RequestMethod.GET)\n public ModelAndView getTargets(@PathVariable(\"activity\") Long activityId,\n @RequestParam(\"q\") String query,\n HttpServletRequest req, HttpServletResponse response)\n throws Exception {\n \n IPermissionActivity activity = permissionOwnerDao.getPermissionActivity(activityId);\n IPermissionTargetProvider provider = targetProviderRegistry.getTargetProvider(activity.getTargetProviderKey());\n \n SortedSet<IPermissionTarget> matchingTargets = new TreeSet<IPermissionTarget>();\n // add matching results for this identifier provider to the set\n Collection<IPermissionTarget> targets = provider.searchTargets(query);\n for (IPermissionTarget target : targets) {\n if ((StringUtils.isNotBlank(target.getName()) && target\n .getName().toLowerCase().contains(query))\n || target.getKey().toLowerCase().contains(query)) {\n matchingTargets.addAll(targets);\n }\n }\n\n ModelAndView mv = new ModelAndView();\n mv.addObject(\"targets\", targets);\n mv.setViewName(\"json\");\n \n return mv;\n }", "private void setupAnts() {\n IntStream.range(0, numberOfAnts)\n .forEach(i -> {\n ants.forEach(ant -> {\n ant.clear();\n ant.visitCity(-1, random.nextInt(numberOfCities));\n });\n });\n currentIndex = 0;\n }", "ArrayList<TTC> generateSegments() {\n if ((START_STATION instanceof Station) && (endStation instanceof Station)) {\n ArrayList<TTC> route = TTC.SUBWAY_LIST.get(NUMBER);\n if (route.contains(START_STATION) && route.contains(endStation)) {\n return generateSegmentsHelper(route);\n } else {\n return new ArrayList<>();\n }\n } else {\n ArrayList<TTC> route = TTC.BUS_MAP.get((START_STATION).getNUMBER());\n if (route.contains(START_STATION) && route.contains(endStation)) {\n return generateSegmentsHelper(route);\n } else {\n return new ArrayList<>();\n }\n }\n }", "public static FeatureList getTranscripts(CurationSet curSet) {\n return getTranscripts(curSet.getAnnots());\n }", "public void markTargets() {\n defaultOp.setBranchTarget();\n for (int i=0; i<targetsOp.length; i++)\n targetsOp[i].setBranchTarget();\n }", "TargetChain createTargetChain();", "public static ResourceCollection selectSources(final ProjectComponent logTo,\n ResourceCollection source,\n final FileNameMapper mapper,\n final ResourceFactory targets,\n final ResourceSelectorProvider selector) {\n if (source.isEmpty()) {\n logTo.log(\"No sources found.\", Project.MSG_VERBOSE);\n return Resources.NONE;\n }\n source = Union.getInstance(source);\n\n final Union result = new Union();\n for (final Resource sr : source) {\n String srName = sr.getName();\n if (srName != null) {\n srName = srName.replace('/', File.separatorChar);\n }\n\n\n String[] targetnames = null;\n try {\n targetnames = mapper.mapFileName(srName);\n } catch (final Exception e) {\n logTo.log(\"Caught \" + e + \" mapping resource \" + sr,\n Project.MSG_VERBOSE);\n }\n if (targetnames == null || targetnames.length == 0) {\n logTo.log(sr + \" skipped - don\\'t know how to handle it\",\n Project.MSG_VERBOSE);\n continue;\n }\n final Union targetColl = new Union();\n for (String targetname : targetnames) {\n if (targetname == null) {\n targetname = \"(no name)\";\n }\n targetColl.add(targets.getResource(\n targetname.replace(File.separatorChar, '/')));\n }\n //find the out-of-date targets:\n final Restrict r = new Restrict();\n r.add(selector.getTargetSelectorForSource(sr));\n r.add(targetColl);\n if (r.size() > 0) {\n result.add(sr);\n final Resource t = r.iterator().next();\n logTo.log(sr.getName() + \" added as \" + t.getName()\n + (t.isExists() ? \" is outdated.\" : \" doesn\\'t exist.\"),\n Project.MSG_VERBOSE);\n continue;\n }\n //log uptodateness of all targets:\n logTo.log(sr.getName()\n + \" omitted as \" + targetColl.toString()\n + (targetColl.size() == 1 ? \" is\" : \" are \")\n + \" up to date.\", Project.MSG_VERBOSE);\n }\n return result;\n }", "public org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup[] getTargetSetupArray()\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(TARGETSETUP$0, targetList);\r\n org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup[] result = new org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "public ArrayList<String> start(String source, String target);", "public Formula encodeTarget() {\n\t\tConjunction result = new Conjunction(\"target\");\n\t\tSet<CArgument> T = CAF.getTarget();\n\t\tfor(CArgument t : T) {\n\t\t\tresult.addSubformula(new Atom(\"acc_\" + t.getName()));\n\t\t}\n\t\treturn result;\n\t}", "@Override\r\n\tpublic List<Targets> getTarget_info(int id) {\n\t\treturn target_infoDao.getTarget_info(id);\r\n\t}", "static DataSource[] _getDataSources () throws Exception {\n SearchOptions opts = new SearchOptions (null, 1, 0, 1000); \n TextIndexer.SearchResult results = _textIndexer.search(opts, null);\n Set<String> labels = new TreeSet<String>();\n for (TextIndexer.Facet f : results.getFacets()) {\n if (f.getName().equals(SOURCE)) {\n for (TextIndexer.FV fv : f.getValues())\n labels.add(fv.getLabel());\n }\n }\n\n Class[] entities = new Class[]{\n Disease.class, Target.class, Ligand.class\n };\n\n List<DataSource> sources = new ArrayList<DataSource>();\n for (String la : labels ) {\n DataSource ds = new DataSource (la);\n for (Class cls : entities) {\n opts = new SearchOptions (cls, 1, 0, 100);\n results = _textIndexer.search(opts, null);\n for (TextIndexer.Facet f : results.getFacets()) {\n if (f.getName().equals(SOURCE)) {\n for (TextIndexer.FV fv : f.getValues())\n if (la.equals(fv.getLabel())) {\n if (cls == Target.class)\n ds.targets = fv.getCount();\n else if (cls == Disease.class)\n ds.diseases = fv.getCount();\n else\n ds.ligands = fv.getCount();\n }\n }\n }\n }\n Logger.debug(\"DataSource: \"+la);\n Logger.debug(\" + targets: \"+ds.targets);\n Logger.debug(\" + ligands: \"+ds.ligands);\n Logger.debug(\" + diseases: \"+ds.diseases);\n \n sources.add(ds);\n }\n\n return sources.toArray(new DataSource[0]);\n }", "public Object getTarget() {\n return this.endpoints;\n }", "@Nullable\n ImmutableList<ImmutableList<Label>> calculateTargetBatches(\n Set<Label> targets, SyncStrategy syncStrategy, int suggestedShardSize);", "@SuppressWarnings(\"unchecked\")\n private void getPossibleListTargetsPerEffect(List<TargetingScheme<?>> list, List<TargetList<?>> alreadyTargeted, List<List<TargetList<?>>> outputList) {\n if (list.isEmpty()) {\n outputList.add(new ArrayList<>(alreadyTargeted));\n return;\n }\n TargetingScheme<Object> scheme = (TargetingScheme<Object>) list.get(0);\n List<TargetList<Object>> searchSpace = new LinkedList<>();\n if (scheme.isApplicable(alreadyTargeted)) {\n this.getPossibleTargets(scheme, scheme.makeList(), scheme.getPossibleChoices(), 0, searchSpace);\n }\n if (searchSpace.isEmpty()) {\n searchSpace.add(scheme.makeList());\n }\n for (TargetList<?> t : searchSpace) {\n alreadyTargeted.add(t);\n this.getPossibleListTargetsPerEffect(list.subList(1, list.size()), alreadyTargeted, outputList);\n alreadyTargeted.remove(alreadyTargeted.size() - 1);\n }\n }", "public void onBtnGenerateClick() {\n taskSpan2s = dataManager.load(TaskSpan2.class)\n .query(\"select t from gantt_TaskSpan2 t\")\n .view(\"taskSpan2-view\")\n .list();\n // prepare the new dataProvider\n ListDataProvider dataProvider = new ListDataProvider();\n\n // fetch the list of -selected- taskSpan\n for (TaskSpan2 taskSpan2: taskSpan2s) {\n // 1. create the list to hold the dynSegments\n List<DynSegment> dynSegments = new ArrayList<>();\n\n // 2. get the list of attached segments\n List<Segment2> segment2s = taskSpan2.getSegments();\n\n // 3. fetch the list of Segments\n for (Segment2 segment2: segment2s) {\n System.out.println(segment2.getTask() + \" \" + segment2.getStart().compareTo(Objects.requireNonNull(dateFrom.getValue())));\n // filters on the dates\n if (\n (segment2.getStart().compareTo(Objects.requireNonNull(dateFrom.getValue())) >= 0)\n &&\n (segment2.getEnd().compareTo(Objects.requireNonNull(dateTo.getValue())) <= 0)\n ) {\n // 3.a create the new dynSegment\n DynSegment dynSegment = new DynSegment(\n segment2.getColor(),\n segment2.getTask(),\n segment2.getStart(),\n segment2.getEnd());\n // 3.b add the new dynSegment to the lis\n dynSegments.add(dynSegment);\n }\n }\n\n // 4. create the dynTaskSpan\n DynTaskSpan dynTaskSpan = new DynTaskSpan(\n taskSpan2.getCategory(),\n dynSegments);\n\n // 5. adds the new dynTaskSpan to the dataProvider\n dataProvider.addItem(new SimpleDataItem(dynTaskSpan));\n }\n\n // sets the dataProvider for the chart\n chart.setDataProvider(dataProvider);\n chart.repaint();\n }", "public List<com.dator.jqtest.dao.model.tables.pojos.Route> fetchByTargetName(String... values) {\n return fetch(Route.ROUTE.TARGET_NAME, values);\n }", "public static List<TuvImpl> getTargetTuvs(TargetPage p_targetPage) throws Exception\n {\n List<Tuv> tuvs = new ArrayList<Tuv>();\n\n Connection conn = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n try\n {\n conn = DbUtil.getConnection();\n long sourcePageId = p_targetPage.getSourcePage().getId();\n String tuvTableName = BigTableUtil.getTuvTableJobDataInBySourcePageId(sourcePageId);\n String tuTableName = BigTableUtil.getTuTableJobDataInBySourcePageId(sourcePageId);\n String sql = GET_TARGET_TUVS_SQL.replace(TUV_TABLE_PLACEHOLDER, tuvTableName)\n .replace(TU_TABLE_PLACEHOLDER, tuTableName);\n\n ps = conn.prepareStatement(sql);\n ps.setLong(1, p_targetPage.getLocaleId());\n ps.setLong(2, p_targetPage.getId());\n rs = ps.executeQuery();\n tuvs.addAll(convertResultSetToTuv(rs, false, p_targetPage.getSourcePage().getJobId()));\n\n // Load xliff_alt data in page level to improve performance.\n if (XliffAltUtil.isGenerateXliffAlt(p_targetPage.getSourcePage()))\n {\n loadXliffAlts2(new ArrayList<Tuv>(tuvs), p_targetPage.getLocaleId(),\n p_targetPage.getId(), tuTableName, tuvTableName);\n }\n\n setHashValues(tuvs);\n\n List<TuvImpl> result = new ArrayList<TuvImpl>();\n for (Tuv tuv : tuvs)\n {\n result.add((TuvImpl) tuv);\n }\n return result;\n }\n catch (Exception e)\n {\n logger.error(\"Error when getTargetTuvs for target page \" + p_targetPage.getId(), e);\n throw e;\n }\n finally\n {\n DbUtil.silentClose(rs);\n DbUtil.silentClose(ps);\n DbUtil.silentReturnConnection(conn);\n }\n }", "public Map<Integer, TargetDef> getTargetQueries();", "@Override\n\t\tpublic List<PointsTarget> getPointTargets(Proposal proposal, PointType pointType, DistributionStrategy distributionStrategy) throws SystemException {\n\t\t\tList<PointsTarget> targets = new ArrayList<>();\n\t\t\tif (distributionStrategy == DistributionStrategy.USER_DEFINED) {\n\t\t\t\tfor (PointsDistributionConfiguration pdc: PointsDistributionConfigurationLocalServiceUtil.findByProposalIdPointTypeId(proposal.getProposalId(), pointType.getId())) {\n\t\t\t\t\tif (pdc.getTargetUserId() > 0) {\n\t\t\t\t\t\tPointsTarget target = new PointsTarget();\n\t\t\t\t\t\ttarget.setUserId(pdc.getTargetUserId());\n\t\t\t\t\t\ttarget.setPercentage(pdc.getPercentage());\n\t\t\t\t\t\ttargets.add(target);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn targets;\n\t\t}", "public void discoverTargets(IProgressMonitor monitor) throws CoreException {\n\r\n }", "private String[] getTarget(XmlNode animationNode) {\n XmlNode channelNode = animationNode.getChild(\"channel\");\n String data = channelNode.getAttribute(\"target\");\n return data.split(\"/\");\n }", "void addPathFromStart() {\n for (String aPathFromStart : pathFromStart) {\n newFutureTargets.push(aPathFromStart);\n }\n }", "private List<String> prepareToPrint(List<String[]> beacon, List<String[]> receiver, String[] destination){\n\n List<String> list = new ArrayList<>();\n boolean destinationAdded = false;\n\n Iterator<String[]> it = receiver.iterator();\n for(String [] oneBeacon : beacon) {\n String s = \"\";\n String[] receiverElementList = it.next();\n //i = 1 to skip the id\n for(int i = 1; i < receiverElementList.length; i++){\n s = s + receiverElementList[i] + \",\";\n }\n\n s += oneBeacon[1].trim()+\",\"+oneBeacon[2].trim();\n if(!destinationAdded){\n s += \",\"+destination[0]+\",\"+destination[1];\n destinationAdded = true;\n }\n list.add(s);\n }\n //adding one more time the position of the first beacon in order to plot a triangle\n if(it.hasNext()){\n String s = \"\";\n String[] receiverElementList = it.next();\n String[] oneBeacon = beacon.get(0);\n for(int i = 1; i < receiverElementList.length; i++){\n s = s + receiverElementList[i] + \",\";\n }\n\n s += oneBeacon[1].trim()+\",\"+oneBeacon[2].trim();\n list.add(s);\n }\n\n while(it.hasNext()){\n String[] receiverElementList = it.next();\n String s = \"\";\n for(int i = 1; i < receiverElementList.length; i++){\n s = s + receiverElementList[i]+\",\";\n }\n\n list.add(s.substring(0,s.length()-1));\n\n }\n return list;\n }", "public static Ani[] to(Object theTarget, float theDuration, String thePropertyList){\n\t\treturn addAnis(false, theTarget, theDuration, 0.0f, thePropertyList, defaultEasing, defaultTimeMode, theTarget, defaultCallback);\n\t}", "public ArrayList getTargetList() {\r\n\t\treturn targetList;\r\n\t}", "public void viewTargets ()\n throws GeneralException\n\t{\n\n throw new UnsupportedOperationException (\"Not supported.\");\n\n\t}", "public Station[] getPathStations(Position startPos, Position targetPos)\r\n {\r\n assert startPos != null;\r\n assert targetPos != null;\r\n assert startPos.column() < metro.numberOfColumns;\r\n assert startPos.line() < metro.numberOfLines;\r\n assert targetPos.column() < metro.numberOfColumns;\r\n assert targetPos.line() < metro.numberOfLines;\r\n\r\n Station[] stations = new Station[2];\r\n\r\n // get the station near to the target.\r\n Station getOffStation = null;\r\n Station getOnStation = null;\r\n Track tmpTrack = null;\r\n double dist = Double.MAX_VALUE;\r\n double distToFirst = Double.MAX_VALUE;\r\n\r\n for (Track track : tracks)\r\n {\r\n LinkedList<Station> stationList = track.getStations();\r\n\r\n for (Station station : stationList)\r\n {\r\n double tmpDist = distance(station.getLocation(), targetPos);\r\n if (tmpDist < dist)\r\n {\r\n dist = tmpDist;\r\n getOffStation = station;\r\n tmpTrack = track;\r\n }\r\n }\r\n }\r\n\r\n // get the fist station to get on\r\n LinkedList<Station> stationList = tmpTrack.getStations();\r\n\r\n for (Station station : stationList)\r\n {\r\n double tmpDist = distance(station.getLocation(), startPos);\r\n if (tmpDist < distToFirst)\r\n {\r\n distToFirst = tmpDist;\r\n getOnStation = station;\r\n }\r\n }\r\n\r\n stations[0] = getOnStation;\r\n stations[1] = getOffStation;\r\n\r\n return stations;\r\n }", "java.util.List<speech_formatting.SegmentedTextOuterClass.SentenceSegment> \n getSentenceSegmentList();", "public void addTargets (Set<GameElement> sprites) {\n myTargets.clear();\n sprites.forEach(s -> myTargets.add(s));\n }", "public IDeploymentTarget[] getTargets(ITMWProject project) {\n return null;\r\n }", "public java.util.List<org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup> getTargetSetupList()\r\n {\r\n final class TargetSetupList extends java.util.AbstractList<org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup>\r\n {\r\n public org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup get(int i)\r\n { return GPSSetupImpl.this.getTargetSetupArray(i); }\r\n \r\n public org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup set(int i, org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup o)\r\n {\r\n org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup old = GPSSetupImpl.this.getTargetSetupArray(i);\r\n GPSSetupImpl.this.setTargetSetupArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup o)\r\n { GPSSetupImpl.this.insertNewTargetSetup(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup remove(int i)\r\n {\r\n org.landxml.schema.landXML11.TargetSetupDocument.TargetSetup old = GPSSetupImpl.this.getTargetSetupArray(i);\r\n GPSSetupImpl.this.removeTargetSetup(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return GPSSetupImpl.this.sizeOfTargetSetupArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new TargetSetupList();\r\n }\r\n }", "public DomainTarget[] getDomainTargets() {\n return (DomainTarget[]) this.domainTargets.clone();\n }", "TrgPlace getTarget();", "public List<T> fromEach(List<?> source) {\n\t\treturn new TranslationSession(configuration, variables)\n\t\t\t\t.getEachTranslation(source, destinationClass);\n\t}", "public TestTarget[] getAll() {\r\n\t\tList<TestTarget> applications = new ArrayList<TestTarget>();\r\n\t\tResult<Record> result = getDbContext().select().from(TESTTARGET).fetch();\r\n\t\tfor (Record r : result) {\r\n\t\t\tTestTarget tp = r.into(TestTarget.class);\r\n\t\t\tapplications.add(tp);\r\n\t\t}\r\n\t\treturn applications.toArray(new TestTarget[applications.size()]);\r\n\t}", "public String getTarget(String inputS){\n\t\tString outputS = new String();\n\t\t\n\t\tString patternString = \"\\\\s\\\\|\\\\d+\\\\-\\\\d+\\\\|\"; // pattern for alignment points\n\t\t\n\t\t// split the sentence on the alignment points and then concatenate array elements into the output string\n\t\t// calling String.split(regex)\n\t\tString[] sentence = inputS.split(patternString);\n\t\tfor(int i=0; i<sentence.length; i++){\n\t\t\toutputS += sentence[i];\n\t\t}\n\t\treturn outputS;\n\t}", "@Override\r\n\tpublic List<Map<String, Object>> selectTargetList(HttpServletRequest request) throws Exception {\n\r\n\t\tString host = request.getParameter(\"host\");\r\n\t\t\r\n\t\treturn dao.selectTargetList(host);\r\n\t}", "private TargetsDescriptor setTargetsDescriptor(TargetsDescriptor td) {\n\t\tTargetsDescriptor previous = getTargetsDescriptor();\r\n\t\t_targetsDescriptor = td;\r\n\t\treturn previous;\r\n\t}", "public List getTargetConnections() {\n return new ArrayList(targetConnections);\n }", "static List<DependencyLink> link(Map<String, List<zipkin2.Span>> spans) {\n DependencyLinker linker = new DependencyLinker();\n spans.values().forEach(trace -> linker.putTrace(trace));\n return linker.link();\n }", "@Override\n public <T> T fromTexts(Class<T> type, Iterable<String> texts) {\n String text = \"[\"+join(\",\", t -> stringify(type, t), texts)+\"]\";\n return fromText(type, text);\n }", "private List<Method> getTargetMethods(Class<? extends Annotation> ann) {\n List<List<Method>> list = mutableCopy(\n removeShadowed(removeOverrides(annotatedWith(allTargetMethods, ann))));\n \n // Reverse processing order to super...clazz for befores\n if (ann == Before.class || ann == BeforeClass.class) {\n Collections.reverse(list);\n }\n \n // Shuffle at class level.\n Random rnd = new Random(runnerRandomness.seed);\n for (List<Method> clazzLevel : list) {\n Collections.shuffle(clazzLevel, rnd);\n }\n \n return flatten(list);\n }", "public List<Tile> findTargets() {\n List<Tile> targets = new ArrayList<>(); // our return value\n int fearDistance = 2; // Ideally we're 2 spots away from their head, increases when we can't do that.\n int foodDistance = 3; // We look at a distance 3 for food.\n\n // If fearDistance gets this big, then its just GG i guess\n while (targets.size() == 0 && fearDistance < 15) {\n // Get the tiles around the Enemy's head\n targets = this.gb.nearByTiles(this.enemy_head_x, this.enemy_head_y, fearDistance);\n fearDistance += 1;\n }\n\n // Get the food tiles near us\n for (int i=0; i < foodDistance; i++) {\n List<Tile> nearBy = this.gb.nearByTiles(this.us_head_x, this.us_head_y, i);\n for (Tile t : nearBy) {\n if (t.isFood() && !targets.contains(t)) targets.add(t);\n }\n }\n return targets;\n }", "ImmutableSet<BuildTarget> getAdditionalCoverageTargets();", "@Nullable\n static ListenableFuture<List<TargetInfo>> getTargetsBuildingSource(LocationContext context) {\n if (!SourceToTargetProvider.hasProvider()) {\n return null;\n }\n // early-out if source is trivially covered by project targets (e.g. because there's a wildcard\n // target pattern for the parent package)\n if (context.getImportRoots().packageInProjectTargets(context.blazePackage)) {\n return null;\n }\n // Finally, query the exact targets building this source file.\n // This is required to handle project targets which failed to build\n return Futures.transform(\n SourceToTargetHelper.findTargetsBuildingSourceFile(\n context.project, context.workspacePath.relativePath()),\n (Function<List<TargetInfo>, List<TargetInfo>>)\n (List<TargetInfo> result) ->\n result == null || sourceInProjectTargets(context, fromTargetInfo(result))\n ? ImmutableList.of()\n : result,\n MoreExecutors.directExecutor());\n }", "private List<String> generateAnnotationList(List<Annotation> queryAnnotations) {\n\n List<String> annotationList = new ArrayList<>();\n AnnotationConfigGenerator annotationConfigGenerator = new AnnotationConfigGenerator();\n for (Annotation queryAnnotation : queryAnnotations) {\n if (!queryAnnotation.getName().equalsIgnoreCase(\"info\")) {\n annotationList.add(annotationConfigGenerator.generateAnnotationConfig(queryAnnotation));\n }\n }\n preserveCodeSegmentsOf(annotationConfigGenerator);\n return annotationList;\n }" ]
[ "0.56868434", "0.56838197", "0.5584297", "0.5555994", "0.5511778", "0.5509309", "0.54863715", "0.54756457", "0.5401182", "0.53438675", "0.5146657", "0.51366335", "0.51347965", "0.5094469", "0.507082", "0.49673072", "0.49141946", "0.4904067", "0.48756164", "0.48740077", "0.4866411", "0.48225644", "0.48146504", "0.47774968", "0.47319198", "0.4693649", "0.46848333", "0.4676646", "0.46602613", "0.46562153", "0.46377775", "0.45989394", "0.4588761", "0.45585334", "0.4558301", "0.4548939", "0.4547838", "0.45350263", "0.45115122", "0.4510842", "0.4506919", "0.45017096", "0.44971162", "0.44951957", "0.44889775", "0.4443869", "0.4429826", "0.43951383", "0.4390275", "0.43893802", "0.43743306", "0.4366184", "0.43544924", "0.43449432", "0.43397617", "0.4328353", "0.43208072", "0.43034846", "0.4293382", "0.4264629", "0.42478955", "0.42464963", "0.42266342", "0.42229196", "0.4221784", "0.42187667", "0.4200154", "0.4196846", "0.4192058", "0.41905388", "0.41877842", "0.4180077", "0.4177423", "0.41692978", "0.41665018", "0.41658384", "0.4162069", "0.4157995", "0.41549462", "0.41526064", "0.41467842", "0.41465288", "0.41398746", "0.41349247", "0.41325474", "0.4132324", "0.4128608", "0.41270268", "0.41166058", "0.4109759", "0.41097483", "0.41094866", "0.4104968", "0.41027915", "0.40975368", "0.40969303", "0.40859574", "0.40824434", "0.40763998", "0.40698856" ]
0.6662534
0
Access the code from within the our own code so that a subclass can override it. Use this rather than the public static method in local code.
protected List<Target> overridableCreateTargetsWithPauses(Relation segs) { return HalfPhoneTargetFeatureLister.createTargetsWithPauses(segs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void thisMethod() {\n }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public static void staticMethod() {\n Log.e(\"LOG_TAG\", \"Company: STATIC Instance method\");\n }", "private stendhal() {\n\t}", "public static void SelfCallForLoading() {\n\t}", "protected void method_3848() {\r\n super.method_3848();\r\n }", "public static void thisDemo() {\n\t}", "private NativeSupport() {\n\t}", "public void method_6349() {\r\n super.method_6349();\r\n }", "public void referToSpecialist(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "static void sm() {\n }", "private CommonMethods() {\n }", "public /* bridge */ /* synthetic */ void mo55096c() {\n super.mo55096c();\n }", "protected abstract void switchOnCustom();", "protected void init() {\n // to override and use this method\n }", "public abstract String use();", "public abstract void mo27386d();", "private SelfShieldingCalc()\n {\n // This class should just contain static methods. Don't let anyone\n // instantiate it.\n }", "private DungeonBotsMain() {\n\t\t// Does nothing.\n\t}", "private static void staticFun()\n {\n }", "private HelperLocation() {}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:58:16.466 -0500\", hash_original_method = \"37AAAAC75A3E4652292E435C97659047\", hash_generated_method = \"DF49315663E2606797D4BA6FB493CF14\")\n \n private int _eglGetCurrentContext(){\n \treturn getTaintInt();\n }", "public void method_1449() {\r\n super.method_1449();\r\n }", "public void method_1449() {\r\n super.method_1449();\r\n }", "public void method_1449() {\r\n super.method_1449();\r\n }", "protected abstract void runPrivate();", "static void init() {}", "public abstract void mo27385c();", "private CodeRef() {\n }", "public static void __init() {\r\n\t\t__name__ = new str(\"code\");\r\n\r\n\t\t/**\r\n\t\t copyright Sean McCarthy, license GPL v2 or later\r\n\t\t*/\r\n\t\tdefault_0 = null;\r\n\t\tcl_Code = new class_(\"Code\");\r\n\t}", "public void method_6191() {\r\n super.method_6191();\r\n }", "public /* bridge */ /* synthetic */ void mo55094a() {\n super.mo55094a();\n }", "public void run() {\r\n\t\t// overwrite in a subclass.\r\n\t}", "private PluginUtils() {\n\t\t//\t\tthrow new IllegalAccessError(\"Don't instantiate me. I'm a utility class!\");\n\t}", "public abstract void mo70713b();", "public static void staticExample() {\n\t\tSystem.out.println(\"I am the static method from the child class\");\n\t}", "public void referToGP(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "private PluginAPI() {\r\n\t\tsuper();\r\n\t}", "protected void additionalProcessing() {\n\t}", "public abstract void mo56925d();", "public void doGeneralThings() {\n logger.debug(\"Overrided or implememted method - doGeneralThings!\");\n }", "public void myPublicMethod() {\n\t\t\n\t}", "protected void onFirstUse() {}", "private Platform() {\n\t\t\n\t}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:58:16.469 -0500\", hash_original_method = \"AF8954095CE356BE495ED3F59D7027C3\", hash_generated_method = \"8A9F04088767B77C663624B119E15A53\")\n \n private int _eglGetCurrentDisplay(){\n \treturn getTaintInt();\n }", "public Methods() {\n // what is this doing? -PMC\n }", "public _CodeBaseStub ()\n {\n super ();\n }", "private ScriptInstanceManager() {\n\t\tsuper();\n\t}", "public abstract void mo27464a();", "protected abstract T self();", "protected abstract T self();", "protected abstract T self();", "private Utils() {\n\t}", "private Utils() {\n\t}", "private PluginsInternal() {}", "public static void getInfo1() {\n\t\tSystem.out.println(\"I am a static Method\");\n\t\t\t\t\t\t\t\t\t\t\t\t // we can not access non static Members within static Method!!\n\t}", "protected CodeStub() {\n entry = new Label();\n continuation = new Label();\n }", "@Override\n protected void prot() {\n }", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "protected void init() {\n\t}", "protected void init() {\n\t}", "public static void Crafting() {\n\n }", "private UtilsCache() {\n\t\tsuper();\n\t}", "protected void doSomethingElse()\r\n {\r\n \r\n }", "protected void initialize() {}", "protected void initialize() {}", "public final /* bridge */ /* synthetic */ void mo43566a() {\n super.mo43566a();\n }", "public String _class_globals() throws Exception{\n_abm = new com.ab.abmaterial.ABMaterial();\r\n //BA.debugLineNum = 4;BA.debugLine=\"End Sub\";\r\nreturn \"\";\r\n}", "private AWTBridge() {\n\t}", "public _CodeBaseStub()\n {\n super();\n }", "protected abstract Self self();", "private Helper() {\r\n // do nothing\r\n }", "private Helper() {\r\n // empty\r\n }", "public abstract void m15813a();", "private Utility() {\n throw new IllegalAccessError();\n }", "public static String _globals() throws Exception{\nmostCurrent._pnloverlay = new anywheresoftware.b4a.objects.PanelWrapper();\n //BA.debugLineNum = 21;BA.debugLine=\"Private txtval As EditText\";\nmostCurrent._txtval = new anywheresoftware.b4a.objects.EditTextWrapper();\n //BA.debugLineNum = 22;BA.debugLine=\"Private btnlogin As Button\";\nmostCurrent._btnlogin = new anywheresoftware.b4a.objects.ButtonWrapper();\n //BA.debugLineNum = 23;BA.debugLine=\"Private btndelete As Button\";\nmostCurrent._btndelete = new anywheresoftware.b4a.objects.ButtonWrapper();\n //BA.debugLineNum = 24;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "protected void _init(){}", "public abstract void mo30696a();", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "public void run() {/* THE CODE HERE IS A THE @OVERRIDE FOR START() METHOD */\n\t}", "private CheckingTools() {\r\n super();\r\n }", "public final void mo19209c() {\n zzi.f56267a.mo31623a(getApplicationContext(), new zyz());\n }", "protected void h() {}", "public abstract void mo6549b();", "@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 }", "protected Doodler() {\n\t}", "public static void initialize(){\r\n\t\tinitialize(new CurrentClassGetter().getClassName());\r\n\t}", "public void base() {\n APIlib.getInstance().addJSLine(jsBase + \".base();\");\n }", "private RunUtils() {\n }", "boolean inStaticContext();", "public /* bridge */ /* synthetic */ void mo55097d() {\n super.mo55097d();\n }", "public abstract void mo35054b();" ]
[ "0.62918377", "0.607953", "0.607953", "0.6006346", "0.5973856", "0.59619284", "0.59376144", "0.5885008", "0.578949", "0.574892", "0.5738555", "0.57344466", "0.56845695", "0.56632805", "0.56608176", "0.5647548", "0.5645661", "0.5620235", "0.5616788", "0.5608523", "0.55939925", "0.55911976", "0.5581715", "0.55706894", "0.55706894", "0.55706894", "0.5555536", "0.55483633", "0.55458987", "0.55413806", "0.55409896", "0.5537075", "0.55330503", "0.55265933", "0.551112", "0.54968405", "0.54883456", "0.54829603", "0.5474706", "0.54606116", "0.54463905", "0.543705", "0.5435545", "0.54286164", "0.54159844", "0.5415967", "0.5409127", "0.54084885", "0.5406777", "0.5405646", "0.53989685", "0.53989685", "0.53989685", "0.53967893", "0.53967893", "0.5388641", "0.5384293", "0.5382076", "0.53808475", "0.53754675", "0.5369971", "0.5369971", "0.5365974", "0.53590614", "0.5341215", "0.5333928", "0.5333928", "0.53320146", "0.5328144", "0.53237647", "0.5319519", "0.53180593", "0.53155875", "0.5313277", "0.530643", "0.53022283", "0.5293036", "0.5292602", "0.52913105", "0.5290915", "0.5290915", "0.5290915", "0.5290915", "0.52897286", "0.52801347", "0.52768856", "0.5276491", "0.5276035", "0.5273294", "0.5273294", "0.5273294", "0.5273294", "0.5273294", "0.5273294", "0.52728504", "0.5269336", "0.5267268", "0.5267241", "0.5264651", "0.5258103", "0.52522254" ]
0.0
-1
Create the list of targets from the Segments in the utterance. Make sure that first item is a pause
public static List<Target> createTargetsWithPauses(Relation segs) { List<Target> targets = new ArrayList<Target>(); boolean first = true; Item s = segs.getHead(); Voice v = FreeTTSVoices.getMaryVoice(s.getUtterance().getVoice()); String silenceSymbol = v.sampa2voice("_"); Target lastTarget = null; Item lastItem = s; for (; s != null; s = s.getNext()) { Element maryxmlElement = (Element) s.getFeatures().getObject("maryxmlElement"); //create next target String segName = s.getFeatures().getString("name"); Target nextLeftTarget = new HalfPhoneTarget(segName+"_L", maryxmlElement, s, true); Target nextRightTarget = new HalfPhoneTarget(segName+"_R", maryxmlElement, s, false); //if first target is not a pause, add one if (first){ first = false; //if (! segName.equals(silenceSymbol)){ if (! nextLeftTarget.isSilence()){ //System.out.println("Adding two pause targets: " // +silenceSymbol+"_L and " // +silenceSymbol+"_R"); //build new pause item Item newPauseItem = s.prependItem(null); newPauseItem.getFeatures().setString("name", silenceSymbol); //add new targets for item targets.add(new HalfPhoneTarget(silenceSymbol+"_L", null, newPauseItem, true)); targets.add(new HalfPhoneTarget(silenceSymbol+"_R", null, newPauseItem, false)); } } targets.add(nextLeftTarget); targets.add(nextRightTarget); lastTarget = nextRightTarget; lastItem = s; } if (! lastTarget.isSilence()){ //System.out.println("Adding pause target " // +silenceSymbol); //build new pause item Item newPauseItem = lastItem.appendItem(null); newPauseItem.getFeatures().setString("name", silenceSymbol); //add new targets for item targets.add(new HalfPhoneTarget(silenceSymbol+"_L", null, newPauseItem, true)); targets.add(new HalfPhoneTarget(silenceSymbol+"_R", null, newPauseItem, false)); } return targets; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected List<Target> createTargets(Relation segs)\r\n {\r\n List<Target> targets = new ArrayList<Target>();\r\n for (Item s = segs.getHead(); s != null; s = s.getNext()) {\r\n Element maryxmlElement = (Element) s.getFeatures().getObject(\"maryxmlElement\");\r\n String segName = s.getFeatures().getString(\"name\");\r\n targets.add(new HalfPhoneTarget(segName+\"_L\", maryxmlElement, s, true)); // left half\r\n targets.add(new HalfPhoneTarget(segName+\"_R\", maryxmlElement, s, false)); // right half\r\n }\r\n return targets;\r\n }", "protected List<Target> overridableCreateTargetsWithPauses(Relation segs)\r\n {\r\n return HalfPhoneTargetFeatureLister.createTargetsWithPauses(segs);\r\n }", "public List<Translation2d> findTranslationsThroughTargets(){\n PhotonPipelineResult result = getLatestResult();\n if(!result.hasTargets()) return new ArrayList<>();\n List<PhotonTrackedTarget> targets = result.getTargets();\n List<Translation2d> translationList = new ArrayList<>();\n\n for(PhotonTrackedTarget target : targets){\n double distance = PhotonUtils.calculateDistanceToTargetMeters(\n kCamHeight, kTargetHeight, kCamPitch, Units.degreesToRadians(target.getPitch()));\n Translation2d translation = PhotonUtils.estimateCameraToTargetTranslation(\n distance, Rotation2d.fromDegrees(-target.getYaw()));\n\n translationList.add(translation);\n }\n\n return translationList;\n }", "private List<Category> extractTargets() {\n List<String> names = getNames(\"category\");\n CategorySelectAsyncTask task = new CategorySelectAsyncTask();\n CategoryMapper mapper = new CategoryMapper();\n task.setNames(names);\n List<Category> list = new ArrayList<>();\n try {\n list.addAll(mapper.to(task.execute().get()));\n } catch (ExecutionException | InterruptedException e) {\n Log.e(TAG, \"extractTargets: \" + e.getMessage(), e);\n }\n return list;\n }", "public List<Target> getTargets()\n {\n return targets;\n }", "public IdentifierListNode getTargets()throws ClassCastException;", "public static ArrayList<String> getTargets() {\r\n return TARGETS;\r\n }", "public InsnTarget[] switchTargets() {\n return targetsOp;\n }", "private <T> void getPossibleTargets(TargetingScheme<T> t, TargetList<T> current, List<? extends T> searchSpace, int startInd,\n List<TargetList<T>> outputList) {\n if (t.isFullyTargeted(current)) {\n outputList.add(current);\n return;\n }\n if (startInd >= searchSpace.size()) {\n System.out.println(\"this shouldn't happen lmao\");\n }\n int numToSelect = Math.min(searchSpace.size(), t.getMaxTargets());\n for (int i = startInd; i < searchSpace.size() - (numToSelect - current.targeted.size() - 1); i++) {\n T c = searchSpace.get(i);\n if (!current.targeted.contains(c)) {\n TargetList<T> copy = current.clone();\n copy.targeted.add(c);\n this.getPossibleTargets(t, copy, searchSpace, i + 1, outputList);\n }\n }\n }", "public void setTargets(IdentifierListNode targets);", "public PyList getTargets() {\n\t\treturn (PyList) shadowstr_gettargets();\n\t}", "default List<PendingAttestation> get_matching_target_attestations(BeaconState state, EpochNumber epoch) {\n return get_matching_source_attestations(state, epoch).stream()\n .filter(a -> a.getData().getTargetRoot().equals(get_block_root(state, epoch)))\n .collect(toList());\n }", "public ArrayList<String> start(String source, String target);", "private String[] getTarget(XmlNode animationNode) {\n XmlNode channelNode = animationNode.getChild(\"channel\");\n String data = channelNode.getAttribute(\"target\");\n return data.split(\"/\");\n }", "public ArrayList<Habitat> getTargets(Habitat source) {\r\n\t\t// return empty list if the habitat isn't inserted in the target list\r\n\t\tif (!habitatToTargetList.containsKey(source.getID()+\"\")) return new ArrayList<Habitat>();\r\n\t\t\r\n\t\t// return target list\r\n\t\treturn habitatToTargetList.get(\"\"+source.getID());\r\n\t}", "public ArrayList<LinkedList<Node>> getTargets(){\n\t\treturn targets;\n\t}", "private void parseTargets(EventCollector eventCollector, List<Antfile> importsToProcess, List<Antfile> importsAlreadyProcessed,\n AntScriptPreferences preferences)\n {\n Iterator descendants = rootElement.getDescendants(new ElementFilter(\"target\"));\n\n while (descendants.hasNext())\n {\n Element targetElement = (Element) descendants.next();\n String targetName = targetElement.getAttribute(\"name\").getValue().trim();\n Attribute descriptionElement = targetElement.getAttribute(\"description\");\n String description = (descriptionElement != null) ? descriptionElement.getValue().trim() // todo replace with StringUtils\n : \"\";\n Target target = new Target(targetName, description, this, targetElement); // these could be in an imported ant buildFile -\n // need to find them, maybe later\n\n addTarget(target);\n target.parseDepends();\n\n if (preferences.shouldShowAntcalls())\n {\n target.parseAntCalls(targetElement);\n }\n\n if (preferences.shouldShowAnts())\n {\n target.parseAnts(targetElement, eventCollector, importsToProcess, importsAlreadyProcessed);\n }\n }\n }", "@Returns(\"targetInfos\")\n @ReturnTypeParameter(TargetInfo.class)\n List<TargetInfo> getTargets();", "private List<RouteInfo> createList() {\r\n\r\n List<RouteInfo> results = new ArrayList<>();\r\n\r\n for (String temp [] : stops) {\r\n\r\n RouteInfo info = new RouteInfo();\r\n info.setTitle(temp[0]);\r\n info.setRouteName(\"Stop ID: \" + temp[1]);\r\n info.setRouteDescription(\"Next bus at: \");\r\n results.add(info);\r\n }\r\n\r\n return results;\r\n }", "public static ArrayList<String> getMultipleTargets(PathConnectionType element, String elementName)\n\t{\n\t\tStringBuilder error = new StringBuilder(); \n\t\tboolean hasError = false;\n\t\tArrayList<String> targets = new ArrayList<>(); \n\t\t\n\t\tif (element.getTarget() == null){\n\t\t\terror.append(elementName + \" (\"+ element.getId() + \") must have a Target attribute\").append(\"\\n\"); \n\t\t\thasError = true; \n\t\t}\n\t\telse if (element.getTarget().size() <= 1)\n\t\t{\n\t\t\terror.append(elementName + \" (\"+ element.getId() + \") must have more than one target\").append(\"\\n\"); \n\t\t\thasError = true; \n\t\t\t \n\t\t}\n\t\telse\n\t\t{\t\n\t\t\tEList<StepType> targetList = element.getTarget(); \n\t\t\tfor (ScenarioElementType targetType: targetList)\n\t\t\t{\n\t\t\t\ttargets.add(targetType.getId());\n\t\t\t\tif (checkForMultipleIDs(targetType.getId()) == false)\n\t\t\t\t{\n\t\t\t\t\terror.append(elementName + \" (\"+ element.getId() + \") has multiple same line Targets \" + targets).append(\"\\n\"); \n\t\t\t\t\thasError = true; \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tif (hasError){\n\t\t\tSystem.out.println(error.toString()); \n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn targets; \n\t\t}\n\t}", "private void getMyTargetsList() {\n try {\n\n String qryTargets = Constants.Targets+ \"?$filter=\" +Constants.KPIGUID+ \" eq guid'\"\n + mStrBundleKpiGUID+\"'\" ;\n ArrayList<MyTargetsBean> alMyTargets = OfflineManager.getMyTargetsList(qryTargets, mStrParnerGuid,\n mStrBundleKpiName, mStrBundleKpiCode, mStrBundleKpiGUID,\n mStrBundleCalBased, mStrBundleKpiFor,\n mStrBundleCalSource, mStrBundleRollup,mStrBundleKPICat,true);\n\n ArrayList<MyTargetsBean> alOrderValByOrderMatGrp = OfflineManager.getActualTargetByOrderMatGrp(CRSSKUGroupWiseTargetsActivity.this,mStrCPDMSDIV);\n mapMyTargetValByCRSSKU = getALOrderVal(alOrderValByOrderMatGrp);\n mapMyTargetVal = getALMyTargetList(alMyTargets);\n sortingValues();\n } catch (OfflineODataStoreException e) {\n sortingValues();\n LogManager.writeLogError(Constants.strErrorWithColon + e.getMessage());\n }\n }", "public Vector getTargets(){\n return targets;\n }", "public java.util.Enumeration getTargets() {\n return targets.elements();\n }", "public Hashtable getTargets() {\n return targets;\n }", "public List<String> getTargetSubjects(int targetId) {\r\n \t\r\n \tCollection<String> targetNeighbours = jungCompleteGraph.getOutEdges(targetId);\r\n \tList<String> targetSubjects = new ArrayList<>();\r\n \tfor (String edge: targetNeighbours) {\r\n \t\t\r\n \t\tif(edge.contains(\"http://purl.org/dc/terms/subject\")){\r\n \t\t\tList<String> tokens = Arrays.asList(getURI(jungCompleteGraph.getDest(edge)).replace(\"http://dbpedia.org/resource/Category:\", \"\").split(\"_\"));\r\n \t\t\ttargetSubjects.addAll(tokens);\r\n \t\t\t}\r\n \t}\r\n \t\r\n \treturn targetSubjects;\r\n \t\r\n }", "public void registerTargets(){\n synchronized(targets){\n while(targets.size()>0){\n Target target= (Target) targets.removeFirst();\n try {\n target.socketChannel.register(selector,SelectionKey.OP_CONNECT,target);\n } catch (ClosedChannelException e) {\n// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n try {\n target.socketChannel.close();\n } catch (IOException e1) {\n e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n target.failure=e;\n addFinishedTarget(target);\n }\n }\n }\n }", "java.util.List<speech_formatting.SegmentedTextOuterClass.TokenSegment> \n getTokenSegmentList();", "public String[] getSrcPhrases(ArrayList<String> alignments){\n\t\tString[] phrases = new String[alignments.size()];\n\t\t\n\t\tString patternString = \"\\\\s\\\\|\\\\|\\\\|\"; // pattern for alignment points\n\t\t\n\t\tfor (int i=0; i<alignments.size(); i++){\n\t\t\tString[] items = alignments.get(i).split(patternString);\n\t\t\tphrases[i] = items[0]; // get source phrase\n\t\t\tSystem.out.println(phrases[i]);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn phrases;\n\t}", "void addPathFromStart() {\n for (String aPathFromStart : pathFromStart) {\n newFutureTargets.push(aPathFromStart);\n }\n }", "public Automaton extractDelaySequence(Automaton automaton, Transition t){\n\t\n\t\tList<DelayElement> DI = ((DelayInformation) t.findExtension(DelayInfoProvider.EXTENSION_ID)).getElements();\n\t\tNewLinkedList result = new NewLinkedList();\n\t\tList<DelayElement> Init = getEdgeInput(DI);\n\n\t\t\n\t\tList<NewLinkedList> dlist = new Vector<NewLinkedList>();\n\t\tList<NewLinkedList> pureList = new Vector<NewLinkedList>();\n\t\tfor(DelayElement a : Init){\n\t\t\tNewLinkedList temp = new NewLinkedList();\n\t\t\tNewLinkedList copy = new NewLinkedList();\n\t\t\ttemp.sequentialInsertion(a);\n\t\t\tcopy.sequentialInsertion(a);\n\t\t\tdlist.add(temp);\n\t\t\tpureList.add(copy);\n\t\t\tList<DelayElement> Pre = new Vector<DelayElement>();\n\t\t\tList<DelayElement> Post = new Vector<DelayElement>();\n\t\t\t\n\t\t\tPre.add(a);\n\t\t\tPost = getNext(DI,Pre);\n\t\t\twhile(!Post.isEmpty()){\n\t\t\t\tfor(DelayElement b : Post){\n\t\t\t\t\ttemp.contains_removes(b);\n\t\t\t\t\tcopy.contains_removes(b);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\ttemp.sequentialInsertion(Post.get(0));\n\t\t\t\tcopy.sequentialInsertion(Post.get(0));\n\t\t\t\tfor(int i=1;i<Post.size();i++){\n\t\t\t\t\ttemp.parallelInsertion(Post.get(i));\n\t\t\t\t\tcopy.parallelInsertion(Post.get(i));\n\t\t\t\t}\n\t\t\t\tPre.clear();\n\t\t\t\tPre.addAll(Post);\n\t\t\t\tPost.clear();\n\t\t\t\tPost = getNext(DI,Pre);\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tList<DelayElement> comTemp = new Vector<DelayElement>();\n\t\tList<DelayElement> com = new Vector<DelayElement>();\n\t\tNewLinkedList Common = new NewLinkedList();\t\t\n\t\t\t\t\n\t\tfor(int j=0;j<Init.size();j++){\n\t\t\tfor(int k=j+1;k<Init.size();k++){\n\t\t\t\tcomTemp.addAll(commonDI(dlist.get(j),dlist.get(k),Common));\n\t\t\t\tfor(DelayElement a : comTemp){\n\t\t\t\t\tif(!com.contains(a))\tcom.add(a);\n\t\t\t\t}\n\t\t\t\tcomTemp.clear();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(Common.isEmpty()){\n\t\t\tfor(int m=0;m<Init.size();m++){\n\t\t\t\tresult = combineParallel(result,dlist.get(m),false);\n\t\t\t}\n\t\t}\n\t\t\n\t\telse{\n\t\t\tresult = arrangeDelaySequence(Common,dlist,false);\n\t\t\t\n\t\t\t/*List<DelayElement> to = new Vector<DelayElement>();\n\t\t\tList<DelayElement> from = new Vector<DelayElement>();\n\t\t\tNewNode<DelayElement> position = Common.getHead().next;\n\t\t\tNewNode<DelayElement> Rposition = position;\n\t\t\twhile(Rposition!=null){\n\t\t\t\tif(!to.contains(Rposition.getData()))\tto.add(Rposition.getData());\n\t\t\t\tRposition = Rposition.right;\n\t\t\t}\n\t\t\t\n\t\t\tfor(int n=0;n<Init.size();n++){\n\t\t\t\tif(dlist.get(n).contains(to)){\n\t\t\t\t\tresult = combineParallel(result,dlist.get(n).subSeq1(to));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tresult.getCurrent().next.setData(to.get(0));\n\t\t\tresult.setCurrent(result.getCurrent().next);\n\t\t\tfor(int i=1;i<to.size();i++)\tresult.addDatatoRight(to.get(i));\n\t\t\t//Set other dummy-tail nodes \n\t\t\tNewNode<DelayElement> settingDummy1 = result.getCurrent();\n\t\t\twhile(settingDummy1!=null){\n\t\t\t\tsettingDummy1.dummyTail = true;\n\t\t\t\tsettingDummy1 = settingDummy1.right;\n\t\t\t}\n\t\t\t\n\t\t\tposition = position.next;\n\t\t\tRposition = position;\n\t\t\tfrom.addAll(to);\n\t\t\tto.clear();\n\t\t\twhile(position!=null){\n\t\t\t\twhile(Rposition!=null){\n\t\t\t\t\tif(!to.contains(Rposition.getData()))\tto.add(Rposition.getData());\n\t\t\t\t\tRposition = Rposition.right;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tNewLinkedList Construction = new NewLinkedList();\n\t\t\t\tfor(int i=0;i<Init.size();i++){\n\t\t\t\t\tif(dlist.get(i).contains(to) && dlist.get(i).contains(from)){\n\t\t\t\t\t\tConstruction = combineParallel(Construction,dlist.get(i).subSeq2(from, to));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tConstruction.getCurrent().next.setData(to.get(0));\n\t\t\t\tConstruction.setCurrent(Construction.getCurrent().next);\n\t\t\t\tfor(int k=1;k<to.size();k++)\tConstruction.addDatatoRight(to.get(k));\n\t\t\t\t//Set other dummy-tail nodes \n\t\t\t\tNewNode<DelayElement> settingDummy2 = Construction.getCurrent();\n\t\t\t\twhile(settingDummy2!=null){\n\t\t\t\t\tsettingDummy2.dummyTail = true;\n\t\t\t\t\tsettingDummy2 = settingDummy2.right;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t \n\t\t\t\tNewNode<DelayElement> Tail = result.getCurrent();\n\t\t\t\tTail.next = Construction.getHead().next;\n\t\t\t\tConstruction.getHead().next.prev = Tail;\n\t\t\t\t//Set \"next\" of dummy-tail nodes\n\t\t\t\tTail = Tail.right;\n\t\t\t\twhile(Tail!=null){\n\t\t\t\t\tTail.next = Construction.getHead().next;\n\t\t\t\t\tTail = Tail.right;\n\t\t\t\t}\n\t\t\t\tresult.setCurrent(Construction.getCurrent());\n\t\t\t\t\n\t\t\t\tposition = position.next;\n\t\t\t\tRposition = position;\n\t\t\t\tfrom.clear();\n\t\t\t\tfrom.addAll(to);\n\t\t\t\tto.clear();\n\t\t\t}\n\t\t\t\n\t\t\tNewLinkedList lastPart = new NewLinkedList();\n\t\t\tfor(int p=0;p<Init.size();p++){\n\t\t\t\tif(dlist.get(p).contains(from)){\n\t\t\t\t\tlastPart = combineParallel(lastPart, dlist.get(p).subSeq3(from));\n\t\t\t\t}\n\t\t\t}\n\t\t\tNewNode<DelayElement> lastTail = new NewNode<DelayElement>();\n\t\t\tif(!lastPart.isEmpty()){\n\t\t\t\tlastTail = result.getCurrent(); \n\t\t\t\tlastTail.next = lastPart.getHead().next;\n\t\t\t\tlastPart.getHead().next.prev = lastTail;\n\t\t\t}*/\n\t\t}\n\t\t\n\t\t// Rearrange the delay-sequence\n\t\t// Check here!!!\n\t\tNewLinkedList done = result;\n\t\tfor(int i=0;i<pureList.size();i++){\n\t\t\tNewLinkedList newComList = new NewLinkedList();\n\t\t\tcommonDI(pureList.get(i),done, newComList);\n\t\t\tif(!newComList.isEmpty()){\n\t\t\t\tList<NewLinkedList> list = new Vector<NewLinkedList>();\n\t\t\t\tlist.add(pureList.get(i));\n\t\t\t\tlist.add(done);\n\t\t\t\tdone = arrangeDelaySequence(newComList, list, true);\n\t\t\t}\n\t\t}\n\t\tif(!com.isEmpty()){\n\t\t\tfor(int j=0;j<pureList.size();j++){\n\t\t\t\tif(!pureList.get(j).contains(com)){\n\t\t\t\t\tdone = combineParallel(done, pureList.get(j),false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSetDummy(done,com);\n//\t\tautomaton = Seq2Automaton.addNewParts(automaton,t, done);\n\t\tautomaton = newSeq2Automaton.addNewParts(automaton, t, done, false);\n\n\t\treturn automaton;\n\t}", "public List<Taskdef> parseForTaskdefs()\n {\n parseElementForTaskdefs(rootElement); // parse outside of targets - most common definition\n\n for (Iterator targetsIterator = rootElement.getDescendants(new ElementFilter(\"target\")); targetsIterator.hasNext();)\n {\n Element targetElement = (Element) targetsIterator.next();\n\n parseElementForTaskdefs(targetElement); // parse inside of targets (such as \"init\"\n }\n\n return localTaskdefs;\n }", "List<T> getRuleTargets();", "public ArrayList<Habitat> getNextTargets(Habitat habitat) {\r\n\t\t// return empty list if the habitat isn't inserted in the target list\r\n\t\tif (!habitatToTargetList.containsKey(habitat.getID()+\"\")) return new ArrayList<Habitat>();\r\n\t\t\r\n\t\t// fetch possible targets\r\n\t\tArrayList<Habitat> habitatList = habitatToTargetList.get(habitat.getID()+\"\");\r\n\t\t\r\n\t\t// create empty target list\r\n\t\tArrayList<Habitat> targetList = new ArrayList<Habitat>();\r\n\t\t\r\n\t\t// loop through possible targets\r\n\t\tfor (int i = 0; i < habitatList.size(); ++i) {\r\n\t\t\tif (System.currentTimeMillis()/1000 - attackFrequency > habitatList.get(i).lastAttackTime) targetList.add(habitatList.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t// return next targets\r\n\t\treturn targetList;\r\n\t}", "public static Ani[] to(Object theTarget, float theDuration, String thePropertyList){\n\t\treturn addAnis(false, theTarget, theDuration, 0.0f, thePropertyList, defaultEasing, defaultTimeMode, theTarget, defaultCallback);\n\t}", "public void discoverTargets(IProgressMonitor monitor) throws CoreException {\n\r\n }", "private void linkTargets(ISequenceComponent seq) throws Exception {\n\t\tif (seq == null) {\n\t\t\tlogger.create().block(\"linkTargets\").info().level(1).msg(\"Group sequence is null, no targets to link\")\n\t\t\t\t\t.send();\n\t\t\treturn;\n\t\t}\n\t\tif (seq instanceof XIteratorComponent) {\n\t\t\t// extract from each sub-element\n\n\t\t\tXIteratorComponent xit = (XIteratorComponent) seq;\n\t\t\tList list = xit.listChildComponents();\n\t\t\tIterator ic = list.iterator();\n\t\t\twhile (ic.hasNext()) {\n\t\t\t\tISequenceComponent cseq = (ISequenceComponent) ic.next();\n\t\t\t\tlinkTargets(cseq);\n\t\t\t}\n\t\t} else if (seq instanceof XBranchComponent) {\n\t\t\t// there should be no targets in here !\n\n\t\t} else {\n\t\t\t// this is an executive - only check slew and target-select\n\n\t\t\tXExecutiveComponent xec = (XExecutiveComponent) seq;\n\t\t\tIExecutiveAction action = xec.getExecutiveAction();\n\n\t\t\tif (action instanceof ITargetSelector) {\n\t\t\t\tITarget target = ((ITargetSelector) action).getTarget();\n\t\t\t\tif (target == null)\n\t\t\t\t\tthrow new Exception(\"TargetSelector:\" + seq.getComponentName() + \" had null target\");\n\t\t\t\t// link the target to one from table\n\t\t\t\tITarget ctarget = targets.get(target.getID());\n\t\t\t\tif (ctarget == null)\n\t\t\t\t\tthrow new Exception(\"Target: \" + target.getName() + \" is not known\");\n\t\t\t\t((XTargetSelector) action).setTarget(ctarget);\n\n\t\t\t} else if (action instanceof ISlew) {\n\t\t\t\tITarget target = ((ISlew) action).getTarget();\n\t\t\t\tif (target == null)\n\t\t\t\t\tthrow new Exception(\"TargetSelector:\" + seq.getComponentName() + \" had null target\");\n\t\t\t\t// link the target to one from table\n\t\t\t\tITarget ctarget = targets.get(target.getID());\n\t\t\t\tif (ctarget == null)\n\t\t\t\t\tthrow new Exception(\"Target: \" + target.getName() + \" is not known\");\n\t\t\t\t((XSlew) action).setTarget(ctarget);\n\t\t\t}\n\t\t}\n\t}", "void addPathToStart() {\n for (int i=0; i<pathFromStart.size(); i++) {\n newFutureTargets.push(composeWebviewBackMessage());\n }\n }", "private void establishPairings() {\n int splineIdx = 0;\n double splineDist = 0.0;\n double seqDist = 0.0;\n Pt pt;\n Pt prevSeq = sequence.get(0);\n Pt prevSpline;\n for (int seqIdx=0; seqIdx < sequence.size(); seqIdx++) {\n\n // part 1: get pt and seqDist set up correctly\n pt = sequence.get(seqIdx);\n seqDist += prevSeq.distance(pt);\n prevSeq = pt;\n\n // part 2: find index of spline point that is just past where we\n // want to be, then find the interpolated point between our\n // known point and that spline point. Set the \"tween\" attribute\n // of the sequence point.\n double additionalDist = 0.0;\n prevSpline = spline.get(splineIdx);\n Pt spt;\n for (int sidx = splineIdx; sidx < spline.size(); sidx++) {\n\tspt = spline.get(sidx);\n\tadditionalDist = spt.distance(prevSpline);\n\tif (additionalDist + splineDist >= seqDist) {\n\t // the target point is between splineIdx and sidx\n\t Pt target = Functions.getPointAtDistance(spline, splineIdx, splineDist, 1, seqDist);\n\t pt.setAttribute(\"tween\", target);\n\t break;\n\t} else if (sidx >= (spline.size() -1)) {\n\t pt.setAttribute(\"tween\", spline.getLast());\n\t}\n\tprevSpline = spt;\n\tsplineIdx = sidx;\n\tsplineDist += additionalDist;\n }\n }\n }", "public static Ani[] to(Object theTarget, float theDuration, float theDelay, String thePropertyList){\n\t\treturn addAnis(false, theTarget, theDuration, theDelay, thePropertyList, defaultEasing, defaultTimeMode, theTarget, defaultCallback);\n\t}", "@Override\n\tpublic void generateTasks(Workflow workflow, List<Tuple> targets)\n\t{\n\n\t}", "public String[] getTrgPhrases(ArrayList<String> alignments){\n\t\tString[] phrases = new String[alignments.size()];\n\t\t\n\t\tString patternString = \"\\\\s\\\\|\\\\|\\\\|\"; // pattern for alignment points\n\t\t\n\t\tfor (int i=0; i<alignments.size(); i++){\n\t\t\tString[] items = alignments.get(i).split(patternString);\n\t\t\tphrases[i] = items[1]; // get source phrase\n\t\t\tSystem.out.println(phrases[i]);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn phrases;\n\t}", "private List<String> prepareToPrint(List<String[]> beacon, List<String[]> receiver, String[] destination){\n\n List<String> list = new ArrayList<>();\n boolean destinationAdded = false;\n\n Iterator<String[]> it = receiver.iterator();\n for(String [] oneBeacon : beacon) {\n String s = \"\";\n String[] receiverElementList = it.next();\n //i = 1 to skip the id\n for(int i = 1; i < receiverElementList.length; i++){\n s = s + receiverElementList[i] + \",\";\n }\n\n s += oneBeacon[1].trim()+\",\"+oneBeacon[2].trim();\n if(!destinationAdded){\n s += \",\"+destination[0]+\",\"+destination[1];\n destinationAdded = true;\n }\n list.add(s);\n }\n //adding one more time the position of the first beacon in order to plot a triangle\n if(it.hasNext()){\n String s = \"\";\n String[] receiverElementList = it.next();\n String[] oneBeacon = beacon.get(0);\n for(int i = 1; i < receiverElementList.length; i++){\n s = s + receiverElementList[i] + \",\";\n }\n\n s += oneBeacon[1].trim()+\",\"+oneBeacon[2].trim();\n list.add(s);\n }\n\n while(it.hasNext()){\n String[] receiverElementList = it.next();\n String s = \"\";\n for(int i = 1; i < receiverElementList.length; i++){\n s = s + receiverElementList[i]+\",\";\n }\n\n list.add(s.substring(0,s.length()-1));\n\n }\n return list;\n }", "Iterable<Callable<?>> getCommands(Class<? extends Annotation> transition);", "public ArrayList<String> ExtractAlignments(String src, String trg, String moses){\n\t\tArrayList<String> alignPoints = new ArrayList<String>();\n\t\t\n\t\tString patternString = \"\\\\s\\\\|(\\\\d+)\\\\-(\\\\d+)\\\\|\"; // pattern for alignment points, the indexes (ref to source phrase) are grouped\n\t\t\n\t\tPattern pattern = Pattern.compile(patternString);\n\t\tMatcher matcher = pattern.matcher(moses);\n\t\t\n\t\tint count=0; // how many times are we matching the pattern\n\t\tint istart=0; // index of input string\n\t\tString[] sourceWords = src.split(\" \");\n\t\tint src_start = 0;\n\t\tint src_end = 0;\n\t\tString src_phr = new String();\n\t\t\n\t\t// Traverse through each of the matches\n\t\t// the numbers inside the matched pattern will give us the index of the source phrases\n\t\t// the string preceding he matched pattern will give us the corresponding target string translation\n\t\twhile(matcher.find()) {\n\t\t\tcount++;\n\t\t\t//System.out.println(\"found: \" + count + \" : \" + matcher.start() + \" - \" + matcher.end() + \" for \" + matcher.group());\n\t\t\t\n\t\t\tsrc_start = new Integer(matcher.group(1)).intValue();\n\t\t\tsrc_end = new Integer(matcher.group(2)).intValue();\n\t\t\t//System.out.println(\"Srcphr: \" + matcher.group(1) + \" to \" + matcher.group(2) + sourceWords[src_start] + \" \" + sourceWords[src_end]);\n\t\t\t\n\t\t\t//alignPoints.add(moses.substring(istart,matcher.start()) + \" ||| \" + istart + \" ||| \" + matcher.start());\n\t\t\tsrc_phr = new String(sourceWords[src_start]);\n\t\t\tfor(int i=src_start+1; i<=src_end; i++){ // get the source phrases referenced by the alignment points\n\t\t\t\tsrc_phr += \" \" + sourceWords[i];\n\t\t\t}\n\t\t\talignPoints.add(src_phr + \" ||| \" + moses.substring(istart,matcher.start())); // add the source phrase and the corresponding target string translation separated by |||\n\t\t\tistart = matcher.end() + 1;\n\t\t}\n\t\t//System.out.println(\"The number of times we match patterns is \" + count);\n\t\t\n\t\treturn alignPoints;\n\t}", "public ArrayList getAddedTargets(String busGroupId) throws Exception {\r\n ArrayList tableName = new ArrayList();\r\n String getAddedTargetMeas = getResourceBundle().getString(\"getAddedTargetMeas\");\r\n String getAddedTargets = getResourceBundle().getString(\"getAddedTargets\");\r\n\r\n Object grpObj[] = new Object[1];\r\n grpObj[0] = busGroupId;\r\n String fgetAddedTargetMeas = buildQuery(getAddedTargetMeas, grpObj);\r\n PbReturnObject tarMeas = execSelectSQL(fgetAddedTargetMeas);\r\n Object measure[] = new Object[1];\r\n String measureId = \"\";\r\n String measureName = \"\";\r\n String targetId = \"\";\r\n String targetName = \"\";\r\n for (int m = 0; m < tarMeas.getRowCount(); m++) {\r\n BusinessGrpsTreeTable table = new BusinessGrpsTreeTable();\r\n measureId = tarMeas.getFieldValueString(m, \"PRG_MEASURE_ID\");\r\n measureName = tarMeas.getFieldValueString(m, \"MEASURE_NAME\");\r\n measure[0] = measureId;\r\n table.setTargetMeasId(measureId);\r\n table.setTargetMeasName(measureName);\r\n String fingetAddedTargets = buildQuery(getAddedTargets, measure);\r\n PbReturnObject tarObj = execSelectSQL(fingetAddedTargets);\r\n if (tarObj.getRowCount() == 0) {\r\n table.setEndTable(\"true\");\r\n }\r\n // tableName.add(table);\r\n tableName.add(table);\r\n for (int y = 0; y < tarObj.getRowCount(); y++) {\r\n BusinessGrpsTreeTable sectable = new BusinessGrpsTreeTable();\r\n targetId = tarObj.getFieldValueString(y, \"TARGET_ID\");\r\n targetName = tarObj.getFieldValueString(y, \"TARGET_NAME\");\r\n sectable.setTargetId(targetId);\r\n sectable.setTargetMinTimeLevel(tarObj.getFieldValueString(y, \"MIN_TIME_LEVEL\"));\r\n sectable.setTargetName(targetName);\r\n\r\n if (y + 1 == tarObj.getRowCount()) {\r\n sectable.setEndTable(\"true\");\r\n }\r\n tableName.add(sectable);\r\n }\r\n\r\n\r\n }\r\n\r\n return tableName;\r\n\r\n }", "public TargetCollection(TargetCollection targetCollection){\n targets = targetCollection.getTargets();\n }", "private void manageGreenTargets(){\n int randGreenTarget = generator.nextInt(100);\n \n while(labelArray[randGreenTarget].getIcon()!=iconSet.getGrayIcon()){\n randGreenTarget = generator.nextInt(100);\n } \n labelArray[randGreenTarget].setIcon(iconSet.getGreenTargetIcon());\n\n if (greenTargetCounter<ACTIVE_GREEN_TARGET_TOTAL){\n activeGreenTarget[greenTargetCounter] = randGreenTarget;\n }\n\n if (greenTargetCounter>=ACTIVE_GREEN_TARGET_TOTAL){\n if(labelArray[activeGreenTarget[0]].getIcon()!=iconSet.getGrayIcon()){\n labelArray[activeGreenTarget[0]].setIcon(iconSet.getGrayIcon());\n }\n for(int i = 0; i < activeGreenTarget.length-1; i++){\n activeGreenTarget[i] = activeGreenTarget[i+1];\n }\n activeGreenTarget[ACTIVE_GREEN_TARGET_TOTAL-1] = randGreenTarget;\n }\n \n greenTargetCounter++;\n }", "ArrayList<TTC> generateSegments() {\n if ((START_STATION instanceof Station) && (endStation instanceof Station)) {\n ArrayList<TTC> route = TTC.SUBWAY_LIST.get(NUMBER);\n if (route.contains(START_STATION) && route.contains(endStation)) {\n return generateSegmentsHelper(route);\n } else {\n return new ArrayList<>();\n }\n } else {\n ArrayList<TTC> route = TTC.BUS_MAP.get((START_STATION).getNUMBER());\n if (route.contains(START_STATION) && route.contains(endStation)) {\n return generateSegmentsHelper(route);\n } else {\n return new ArrayList<>();\n }\n }\n }", "EValidTargetTypes getTargets();", "public static void target() {\n Scanner escaner = new Scanner(System.in);\n Random aleatorio = new Random();\n int cantidadParticipantesTarget;\n int decisionTiro;\n int probabilidadesTiro;\n int[] punteosParticipantesTarget = new int[4];\n String[] nombresParticipantesTarget = new String[4];\n boolean decisionNumeroParticipantes;\n\n do {\n System.out.println(\"Bienvenido al juego de Target\");\n System.out.println(\"El juego consiste en tiros hacia un tablero de 5 zonas\");\n System.out.println(\"Zonas: 0,10,20,30,40 puntos respectivamente\");\n System.out.println(\"El juego se basa en probabilidades y la descripciones del tiro\");\n System.out.println(\"Puedes elegir el tipo que creas mas conveniente para ganar\");\n System.out.println(\"Gana el primero a llegar a 200 puntos, y si ambos llegan al mismo tiempo ambos ganan\");\n System.out.println(\"Intenta jugarlo\");\n System.out.println(\" xxxxxxxxxxxxxxx \");\n System.out.println(\" x x \");\n System.out.println(\" xx xxxxxxxxxxxxx xx \");\n System.out.println(\" xxx x x xxx \");\n System.out.println(\" xxxx x xxxxxxxxx x xxxx \");\n System.out.println(\" xxxxx x x x x xxxxx \");\n System.out.println(\" xxxxx x x x x x xxxxx \");\n System.out.println(\" xxxxx x x x x xxxxx \");\n System.out.println(\" xxxx x xxxxxxxxx x xxxx \");\n System.out.println(\" xxx x x xxx \");\n System.out.println(\" xx xxxxxxxxxxxxx xx \");\n System.out.println(\" x x \");\n System.out.println(\" xxxxxxxxxxxxxxx \");\n System.out.println(\"Cuantos jugadores participaran? (minimo 1 persona, maximo 4 personas)\");\n cantidadParticipantesTarget = Integer.parseInt(escaner.nextLine());\n\n //Ciclo y condicion que nos permite saber si la cantidad de jugadores estan establecidas en el limite\n if ((cantidadParticipantesTarget > 0) && (cantidadParticipantesTarget < 5)) {\n decisionNumeroParticipantes = true;\n } else {\n System.out.println(\"Parece que has salido del rango de participantes admitidos, vuelve a ingresar\");\n decisionNumeroParticipantes = false;\n }\n\n } while (decisionNumeroParticipantes == false);\n\n System.out.println(\"\\n\\n\\n\\n\");\n //ingresamos los nombres y los asignamos a nuestra variable global, depende de cuantos jugadores esten jugando esa sera su magnitud\n for (int contador = 0; contador < cantidadParticipantesTarget; contador++) {\n System.out.println(\"Ingrese el Nombre del Jugador No.-\" + (contador + 1));\n nombresParticipantesTarget[contador] = asignarNombres();\n }\n System.out.println(\"\\n\\n\\n\\n\");\n\n decisionNumeroParticipantes = true;\n\n//Ciclo que empieza el juego en General, no terminara hasta que decisionNumeroParticipantes = false\n while (decisionNumeroParticipantes == true) {\n\n //Este for nos indica los turnos de los participantes, con magnitud de cantidadParticipantesTarget que son los participantes establecidos\n for (int turno = 0; turno < cantidadParticipantesTarget; turno++) {\n System.out.println(\"\\n\\nTURNO DE \" + nombresParticipantesTarget[turno]);\n System.out.println(\"Tipo de Tiro Descripcion Resultado del Tiro\");\n System.out.println(\"(Ingresa el valor mostrado) \\n\");\n System.out.println(\" 1 Rapido con el dardo arriba Al centro o fallo completo\");\n System.out.println(\" del brazo \");\n System.out.println(\" 2 Controlado con el dardo arriba En zonas de 10,20 o 30 puntos\");\n System.out.println(\" del brazo\");\n System.out.println(\" 3 Con el dardo bajo el brazo En cualquier zona incluyendo fallo completo\");\n decisionTiro = Integer.parseInt(escaner.nextLine());\n\n //decision del tipo de tiro segun la descripcion\n //para decidir estos tiros utilizamos la variable probabilidadesTiro para determinar el destino del tiro y lo asignamos segun cada caso\n switch (decisionTiro) {\n\n case 1:\n System.out.println(nombresParticipantesTarget[turno] + \" ha usado tipo de tiro 1\");\n probabilidadesTiro = aleatorio.nextInt(2) + 1;\n if (probabilidadesTiro == 1) {\n System.out.println(\"FUE TIRO AL CENTRO, PERFECTO!\");\n System.out.println(\"Obtienes 40 puntos\");\n punteosParticipantesTarget[turno] += 40;\n } else {\n System.out.println(\"OH NO!, HAS FALLADO POR COMPLETO EL TIRO\");\n System.out.println(\"Obtienes 0 puntos\");\n }\n\n break;\n\n case 2:\n probabilidadesTiro = aleatorio.nextInt(3) + 1;\n System.out.println(nombresParticipantesTarget[turno] + \" ha usado tipo de tiro 2\");\n\n switch (probabilidadesTiro) {\n case 1:\n System.out.println(\"HAS ACERTADO EN LA ZONA DE 10 PUNTOS, BIEN HECHO!\");\n punteosParticipantesTarget[turno] += 10;\n break;\n\n case 2:\n System.out.println(\"HAS ACERTADO EN LA ZONA DE 20 PUNTOS, MUY BIEN HECHO!\");\n punteosParticipantesTarget[turno] += 20;\n break;\n\n default:\n System.out.println(\"HAS ACERTADO EN LA ZONA DE 30 PUNTOS, GENIAL!\");\n punteosParticipantesTarget[turno] += 30;\n }\n break;\n\n default:\n System.out.println(nombresParticipantesTarget[turno] + \" ha usado tipo de tiro 3\");\n probabilidadesTiro = aleatorio.nextInt(5) + 1;\n\n switch (probabilidadesTiro) {\n case 1:\n System.out.println(\"FUE TIRO AL CENTRO, PERFECTO!\");\n System.out.println(\"Obtienes 40 puntos\");\n punteosParticipantesTarget[turno] += 40;\n break;\n\n case 2:\n System.out.println(\"HAS ACERTADO EN LA ZONA DE 30 PUNTOS, GENIAL!\");\n punteosParticipantesTarget[turno] += 30;\n break;\n\n case 3:\n System.out.println(\"HAS ACERTADO EN LA ZONA DE 20 PUNTOS, MUY BIEN HECHO!\");\n punteosParticipantesTarget[turno] += 20;\n break;\n\n case 4:\n System.out.println(\"HAS ACERTADO EN LA ZONA DE 10 PUNTOS, BIEN HECHO!\");\n punteosParticipantesTarget[turno] += 10;\n break;\n\n default:\n System.out.println(\"OH NO!, HAS FALLADO POR COMPLETO EL TIRO\");\n System.out.println(\"Obtienes 0 puntos\");\n }\n }\n }\n\n//Despues de cada turno mostramos la tabla de jugadores, el punteo que llevan , y su estado es decir si han ganado o no\n System.out.println(\"\\n\\n\");\n System.out.println(\" Jugador Punteo Estado\");\n for (int contador = 0; contador < cantidadParticipantesTarget; contador++) {\n System.out.print(nombresParticipantesTarget[contador] + \" \" + punteosParticipantesTarget[contador]);\n\n if (punteosParticipantesTarget[contador] >= 200) {\n System.out.println(\" HA GANADO\");\n decisionNumeroParticipantes = false;\n asignarPunteo(1, nombresParticipantesTarget[contador]);\n } else {\n System.out.println(\" NO HA GANADO\");\n }\n\n }\n escaner.nextLine();\n\n }\n\n System.out.println(\"FIN DEL JUEGO\");\n\n }", "List<String> getTargetClassifications(Observation obs);", "public abstract String generateTokens(int targetNumber);", "private void manageBlueTargets(){\n int randBlueTarget = generator.nextInt(100);\n \n while(labelArray[randBlueTarget].getIcon()!=iconSet.getGrayIcon()){\n randBlueTarget = generator.nextInt(100);\n } \n labelArray[randBlueTarget].setIcon(iconSet.getBlueTargetIcon());\n\n if (blueTargetCounter<ACTIVE_BLUE_TARGET_TOTAL){\n activeBlueTarget[blueTargetCounter] = randBlueTarget;\n }\n\n if (blueTargetCounter>=ACTIVE_BLUE_TARGET_TOTAL){\n if(labelArray[activeBlueTarget[0]].getIcon()!=iconSet.getGrayIcon()){\n labelArray[activeBlueTarget[0]].setIcon(iconSet.getGrayIcon());\n }\n for(int i = 0; i < activeBlueTarget.length-1; i++){\n activeBlueTarget[i] = activeBlueTarget[i+1];\n }\n activeBlueTarget[ACTIVE_BLUE_TARGET_TOTAL-1] = randBlueTarget;\n }\n \n blueTargetCounter++;\n }", "@Override\n protected List<IElementParser<ActImpl>> createParserList() {\n List<IElementParser<ActImpl>> result = new ArrayList<>();\n result.add(new SubElementManeuverGroupsParser());\n result.add(new SubElementStartTriggerParser());\n result.add(new SubElementStopTriggerParser());\n return result;\n }", "java.util.List<speech_formatting.SegmentedTextOuterClass.SentenceSegment> \n getSentenceSegmentList();", "private void utteranceListenerStarter(){\n mTts.setOnUtteranceProgressListener(new UtteranceProgressListener() {\n\n @Override\n public void onStart(String utteranceId) {\n if (utteranceId.equals(FRAGMENT_GENERAL_UTTERANCE_ID)){\n requireActivity().runOnUiThread(()->{\n mHighlightedTextView.setVisibility(View.VISIBLE);\n mFragmentWallpaperTextView.setVisibility(View.INVISIBLE);\n });\n\n }\n }\n\n @Override\n public void onDone(String utteranceId) {\n if (utteranceId.equals(FRAGMENT_GENERAL_UTTERANCE_ID)){\n requireActivity().runOnUiThread(()->{\n mHighlightedTextView.setVisibility(View.INVISIBLE);\n mHighlightedTextView.setText(\"\");\n mFragmentWallpaperTextView.setVisibility(View.VISIBLE);\n\n });\n }\n\n\n }\n\n @Override\n public void onError(String utteranceId) {\n\n if (utteranceId.equals(FRAGMENT_GENERAL_UTTERANCE_ID)){\n requireActivity().runOnUiThread(()->{\n Log.e(\"UTTERANCE_ERROR\", \"An Error occurred while synthesizing the given text...\");\n Activity activity = requireActivity();\n Toast toast = Toast.makeText(activity,\n \"An Error occurred while synthesizing the given text...\",\n Toast.LENGTH_SHORT);\n toast.show();\n mHighlightedTextView.setVisibility(View.INVISIBLE);\n mHighlightedTextView.setText(\"\");\n mFragmentWallpaperTextView.setVisibility(View.VISIBLE);\n\n });\n }\n\n }\n\n @RequiresApi(Build.VERSION_CODES.O)\n @Override\n public void onRangeStart(String utteranceId, int start, int end, int frame) {\n super.onRangeStart(utteranceId, start, end, frame);\n if (utteranceId.equals(FRAGMENT_GENERAL_UTTERANCE_ID)){\n Log.i(\"Current_Synth_Progress\", \"onRangeStart > utteranceId: \" + utteranceId + \", start: \" + start\n + \", end: \" + end + \", frame: \" + frame);\n\n requireActivity().runOnUiThread(()->{\n Spannable textWithHighlights = new SpannableString(fileTextContent);\n\n textWithHighlights.setSpan(new ForegroundColorSpan(Color.BLACK),\n start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);\n textWithHighlights.setSpan(new BackgroundColorSpan(Color.YELLOW),\n start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);\n\n mHighlightedTextView.setText(textWithHighlights);\n });\n }\n }\n });\n }", "Iterable<T> followNodeAndSelef(T start) throws NullPointerException;", "public static Ani[] to(Object theTarget, float theDuration, String thePropertyList, Easing theEasing, String theCallback){\n\t\treturn addAnis(false, theTarget, theDuration, 0.0f, thePropertyList, theEasing, defaultTimeMode, theTarget, theCallback);\n\t}", "public IDeploymentTarget[] getTargets(ITMWProject project) {\n return null;\r\n }", "public Station[] getPathStations(Position startPos, Position targetPos)\r\n {\r\n assert startPos != null;\r\n assert targetPos != null;\r\n assert startPos.column() < metro.numberOfColumns;\r\n assert startPos.line() < metro.numberOfLines;\r\n assert targetPos.column() < metro.numberOfColumns;\r\n assert targetPos.line() < metro.numberOfLines;\r\n\r\n Station[] stations = new Station[2];\r\n\r\n // get the station near to the target.\r\n Station getOffStation = null;\r\n Station getOnStation = null;\r\n Track tmpTrack = null;\r\n double dist = Double.MAX_VALUE;\r\n double distToFirst = Double.MAX_VALUE;\r\n\r\n for (Track track : tracks)\r\n {\r\n LinkedList<Station> stationList = track.getStations();\r\n\r\n for (Station station : stationList)\r\n {\r\n double tmpDist = distance(station.getLocation(), targetPos);\r\n if (tmpDist < dist)\r\n {\r\n dist = tmpDist;\r\n getOffStation = station;\r\n tmpTrack = track;\r\n }\r\n }\r\n }\r\n\r\n // get the fist station to get on\r\n LinkedList<Station> stationList = tmpTrack.getStations();\r\n\r\n for (Station station : stationList)\r\n {\r\n double tmpDist = distance(station.getLocation(), startPos);\r\n if (tmpDist < distToFirst)\r\n {\r\n distToFirst = tmpDist;\r\n getOnStation = station;\r\n }\r\n }\r\n\r\n stations[0] = getOnStation;\r\n stations[1] = getOffStation;\r\n\r\n return stations;\r\n }", "public void printFinishedTarget() {\n try {\n for (; ;) {\n Target target = null;\n synchronized (finishedTargets) {\n while (finishedTargets.size() == 0) {\n finishedTargets.wait();\n }//while\n target= (Target) finishedTargets.removeFirst();\n target.show();\n }\n }//for\n } catch (InterruptedException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }", "public void createMoveAbles(List<String> lines){\n int regelNr = 0;\n int aantalSpelers = Integer.parseInt(lines.get(regelNr));\n while(regelNr<aantalSpelers){\n String[] crds = lines.get(regelNr+1).split(\",\");\n int xCoord = Integer.parseInt(crds[0]);\n int yCoord = Integer.parseInt(crds[1]);\n this.sp = new Speler(new Coordinaat(xCoord,yCoord),this);\n regelNr++;\n }\n\n regelNr += (2);\n int aantalDozen = Integer.parseInt(lines.get(regelNr));\n while(regelNr<(aantalSpelers+aantalDozen+2)){\n String[] crds = lines.get(regelNr+1).split(\",\");\n int xCoord = Integer.parseInt(crds[0]);\n int yCoord = Integer.parseInt(crds[1]);\n new Doos(new Coordinaat(xCoord,yCoord),this);\n regelNr++;\n }\n }", "public List<T> fromEach(List<?> source) {\n\t\treturn new TranslationSession(configuration, variables)\n\t\t\t\t.getEachTranslation(source, destinationClass);\n\t}", "public static Ani[] from(Object theTarget, float theDuration, String thePropertyList){\n\t\treturn addAnis(true, theTarget, theDuration, 0.0f, thePropertyList, defaultEasing, defaultTimeMode, theTarget, defaultCallback);\n\t}", "public static Ani[] to(Object theTarget, float theDuration, String thePropertyList, Easing theEasing){\n\t\treturn addAnis(false, theTarget, theDuration, 0.0f, thePropertyList, theEasing, defaultTimeMode, theTarget, defaultCallback);\n\t}", "TargetChain createTargetChain();", "@objid (\"c8de396e-ab02-483d-b196-1ed35eed0fa2\")\n <T extends Transition> List<T> getSends(java.lang.Class<T> filterClass);", "static Tour sequence() {\r\n\t\tTour tr = new Tour();\r\n\t\tfor (int i = 0; i < tr.length(); i++) {\r\n\t\t\ttr.index[i] = i;\r\n\t\t}\r\n\t\ttr.distance = tr.distance();\r\n\t\treturn tr;\r\n\t}", "public static Ani[] to(Object theTarget, float theDuration, float theDelay, String thePropertyList, Easing theEasing){\n\t\treturn addAnis(false, theTarget, theDuration, theDelay, thePropertyList, theEasing, defaultTimeMode, theTarget, defaultCallback);\n\t}", "public void generateNewTasks(List<CaptureTask> tasks) {\n\t\t\r\n\t}", "public void onBtnGenerateClick() {\n taskSpan2s = dataManager.load(TaskSpan2.class)\n .query(\"select t from gantt_TaskSpan2 t\")\n .view(\"taskSpan2-view\")\n .list();\n // prepare the new dataProvider\n ListDataProvider dataProvider = new ListDataProvider();\n\n // fetch the list of -selected- taskSpan\n for (TaskSpan2 taskSpan2: taskSpan2s) {\n // 1. create the list to hold the dynSegments\n List<DynSegment> dynSegments = new ArrayList<>();\n\n // 2. get the list of attached segments\n List<Segment2> segment2s = taskSpan2.getSegments();\n\n // 3. fetch the list of Segments\n for (Segment2 segment2: segment2s) {\n System.out.println(segment2.getTask() + \" \" + segment2.getStart().compareTo(Objects.requireNonNull(dateFrom.getValue())));\n // filters on the dates\n if (\n (segment2.getStart().compareTo(Objects.requireNonNull(dateFrom.getValue())) >= 0)\n &&\n (segment2.getEnd().compareTo(Objects.requireNonNull(dateTo.getValue())) <= 0)\n ) {\n // 3.a create the new dynSegment\n DynSegment dynSegment = new DynSegment(\n segment2.getColor(),\n segment2.getTask(),\n segment2.getStart(),\n segment2.getEnd());\n // 3.b add the new dynSegment to the lis\n dynSegments.add(dynSegment);\n }\n }\n\n // 4. create the dynTaskSpan\n DynTaskSpan dynTaskSpan = new DynTaskSpan(\n taskSpan2.getCategory(),\n dynSegments);\n\n // 5. adds the new dynTaskSpan to the dataProvider\n dataProvider.addItem(new SimpleDataItem(dynTaskSpan));\n }\n\n // sets the dataProvider for the chart\n chart.setDataProvider(dataProvider);\n chart.repaint();\n }", "public static Ani[] to(Object theTarget, float theDuration, String thePropertyList, Easing theEasing, Object theCallbackObject, String theCallback){\n\t\treturn addAnis(false, theTarget, theDuration, 0.0f, thePropertyList, theEasing, defaultTimeMode, theCallbackObject, theCallback);\n\t}", "public static Ani[] to(Object theTarget, float theDuration, float theDelay, String thePropertyList, Easing theEasing, Object theCallbackObject, String theCallback){\n\t\treturn addAnis(false, theTarget, theDuration, theDelay, thePropertyList, theEasing, defaultTimeMode, theCallbackObject, theCallback);\n\t}", "List<Motion> getMotions();", "default List<PendingAttestation> get_matching_source_attestations(BeaconState state, EpochNumber epoch) {\n assertTrue(epoch.equals(get_current_epoch(state)) || epoch.equals(get_previous_epoch(state)));\n return epoch.equals(get_current_epoch(state)) ?\n state.getCurrentEpochAttestations().listCopy() : state.getPreviousEpochAttestations().listCopy();\n }", "private ArrayList<QuadNode> getAllTargets(QuadNode node, PrimitiveCuboid c){\n ArrayList<QuadNode> targets = new ArrayList<QuadNode>();\n targets.add(node);\n //Generate the initial shards\n Stack<PrimitiveCuboid> shards = new Stack<PrimitiveCuboid>();\n for(PrimitiveCuboid init : generateShards(node, c)){\n shards.push(init);\n }\n while(!shards.empty()){\n PrimitiveCuboid shard = shards.pop();\n node = descendAndCreate(root, shard);\n ArrayList<PrimitiveCuboid> newShards = generateShards(node, shard);\n //If no shards were made then this is is the bounding node for this shard. Include it.\n if(newShards.size() == 0){\n targets.add(node);\n }\n for(PrimitiveCuboid t : newShards){\n shards.add(t);\n }\n }\n return targets;\n }", "public Timeline createLineAnimation(AnchorPane anchor_pane_map, int duration, int stop_duration, ArrayList<Coordinate> affected_points, int slow_duration, int slow_stop_duration, EventHandler<MouseEvent> handler, boolean detour_delay)\r\n {\r\n // coordinates of path for vehicle on transportline\r\n ArrayList<Coordinate> line_coordinates = this.transportLinePath();\r\n // ids of coordinates of path for vehicle on transportline\r\n ArrayList<String> line_coordinates_ids = this.transportLinePathIDs();\r\n // all stops for transportline\r\n List<Stop> line_stops = this.getStopsMap();\r\n // create vehicle for line (circle)\r\n Circle vehicle = new Circle(this.getStopsMap().get(0).getCoordinate().getX(), this.getStopsMap().get(0).getCoordinate().getY(), 10);\r\n vehicle.setStroke(Color.AZURE);\r\n vehicle.setFill(this.getTransportLineColor());\r\n vehicle.setStrokeWidth(5);\r\n addLineVehicles(vehicle);\r\n vehicle.setOnMouseClicked(handler);\r\n\r\n Timeline timeline = new Timeline();\r\n int original_duration = duration;\r\n int original_stop_duration = stop_duration;\r\n\r\n // add all keyframes to timeline - one keyframe means path from one coordinate to another coordinate\r\n // vehicle waits in stop for 1 seconds and go to another coordinate for 2 seconds (in default mode)\r\n int delta_time = 0;\r\n KeyFrame waiting_in_stop = null;\r\n for (int i = 0; i < line_coordinates.size() - 1; i++) {\r\n // if we go through street affected by slow traffic\r\n if (line_coordinates.get(i).isInArray(affected_points) && line_coordinates.get(i+1).isInArray(affected_points))\r\n {\r\n // duration between coordinates and duration of waiting in stop is different\r\n duration = slow_duration;\r\n stop_duration = slow_stop_duration;\r\n }\r\n else\r\n {\r\n // else use default duration\r\n duration = original_duration;\r\n stop_duration = original_stop_duration;\r\n }\r\n\r\n for (Stop s : line_stops) {\r\n // if we are in stop, we wait 'stop_duration' time\r\n if (line_coordinates.get(i).getX() == s.getCoordinate().getX() && line_coordinates.get(i).getY() == s.getCoordinate().getY()) {\r\n waiting_in_stop = new KeyFrame(Duration.seconds(delta_time + stop_duration), // this means waiting in stop for some time\r\n new KeyValue(vehicle.centerXProperty(), line_coordinates.get(i).getX()),\r\n new KeyValue(vehicle.centerYProperty(), line_coordinates.get(i).getY()));\r\n\r\n delta_time = delta_time + stop_duration;\r\n break;\r\n }\r\n }\r\n // we travelled for 'duration' time\r\n KeyFrame end = new KeyFrame(Duration.seconds(delta_time + duration), // this means that the path from one coordinate to another lasts 2 seconds\r\n new KeyValue(vehicle.centerXProperty(), line_coordinates.get(i + 1).getX()),\r\n new KeyValue(vehicle.centerYProperty(), line_coordinates.get(i + 1).getY()));\r\n\r\n if (waiting_in_stop != null) {\r\n timeline.getKeyFrames().addAll(end, waiting_in_stop);\r\n } else {\r\n timeline.getKeyFrames().addAll(end);\r\n }\r\n\r\n delta_time = delta_time + duration;\r\n }\r\n\r\n timeline.setCycleCount(Timeline.INDEFINITE); // infinity number of repetitions\r\n anchor_pane_map.getChildren().add(vehicle);\r\n\r\n if (detour_delay == false)\r\n {\r\n this.setDelay(duration, slow_duration, affected_points.size());\r\n }\r\n else\r\n {\r\n this.delay = this.detour_streets.size() * duration - duration;\r\n }\r\n\r\n return timeline;\r\n }", "public DomainTarget[] getDomainTargets() {\n return domainTargets;\n }", "@Test\n\t\t\tpublic void testTargetsTwoSteps() {\n\t\t\t\t//Length of 2\n\t\t\t\tboard.calcTargets(8, 16, 2);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(4, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(10, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(7, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(9, 15)));\n\t\t\t\t//Length of 2\n\t\t\t\tboard.calcTargets(15, 15, 2);\n\t\t\t\ttargets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(4, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(13, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(17, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(14, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(15, 17)));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t}", "public static Ani[] from(Object theTarget, float theDuration, float theDelay, String thePropertyList){\n\t\treturn addAnis(true, theTarget, theDuration, theDelay, thePropertyList, defaultEasing, defaultTimeMode, theTarget, defaultCallback);\n\t}", "static ShardedTargetList batchTargets(\n Set<Label> targets, SyncStrategy syncStrategy, int suggestedShardSize) {\n return Arrays.stream(EP_NAME.getExtensions())\n .map(s -> s.getShardedTargetList(targets, syncStrategy, suggestedShardSize))\n .filter(Objects::nonNull)\n .findFirst()\n .orElse(\n new ShardedTargetList(\n ImmutableList.of(ImmutableList.copyOf(targets)),\n ShardingApproach.ERROR,\n suggestedShardSize));\n }", "private void pushTrajectory(WPI_TalonSRX _talon, ArrayList<ArrayList<Double>> points) {\n\t\tTrajectoryPoint point = new TrajectoryPoint();\n\t\t_talon.clearMotionProfileTrajectories();\n\n\t\t/* This is fast since it's just into our TOP buffer */\n\t\tint i = 0;\n\t\tfor (ArrayList<Double> arr : points) {\n\t\t\t/* for each point, fill our structure and pass it to API */\n\t\t\t// Double[] a = (Double[]) arr.toArray();\n\t\t\tpoint.position = arr.get(0) * RobotMap.CODES_PER_WHEEL_REV * 3.6;\n\t\t\t\n\t\t\tpoint.velocity = arr.get(1) * RobotMap.CODES_PER_WHEEL_REV * 4/ 600;\n\t\t\tpoint.timeDur = TrajectoryPoint.TrajectoryDuration.Trajectory_Duration_20ms;\n\t\t\t//point.timeDur = (int)(arr.get(2) / multiplier);\n\t\t\t\n\t\t\t//System.out.println(\"DriveByMotionProfile: \" + point.position + \" \" + point.velocity + \" \" + point.timeDur);// + \" \" + point.timeDurMs);\n\t\t\tpoint.profileSlotSelect0 = 0; /*\n\t\t\t\t\t\t\t\t\t\t\t * which set of gains would you like to\n\t\t\t\t\t\t\t\t\t\t\t * use?\n\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t//point.velocityOnly = false; \n\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t * set true to not do any position\n\t\t\t\t\t\t\t\t\t\t * servo, just velocity feedforward\n\t\t\t\t\t\t\t\t\t\t */\n\t\t\tpoint.zeroPos = false;\n\t\t\tif (i == 0)\n\t\t\t\tpoint.zeroPos = true; /* set this to true on the first point */\n\n\t\t\tpoint.isLastPoint = false;\n\t\t\tif ((i + 1) == points.size())\n\t\t\t\tpoint.isLastPoint = true; /*\n\t\t\t\t\t\t\t\t\t\t\t * set this to true on the last point\n\t\t\t\t\t\t\t\t\t\t\t */\n\n\t\t\t_talon.pushMotionProfileTrajectory(point);\n\t\t\ti++;\n\t\t}\n\t}", "@Test\r\n\tpublic void testTargetsTwoSteps() {\r\n\t\tboard.calcTargets(10, 1, 2);\r\n\t\tSet<BoardCell> targets= board.getTargets();\r\n\t\tassertEquals(6, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 0)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 0)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(12, 1)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(10, 3)));\r\n\t\t\r\n\t\tboard.calcTargets(17, 13, 2);\r\n\t\ttargets= board.getTargets();\r\n\t\tassertEquals(5, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(17, 15)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(18, 14)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(16, 14)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(16, 12)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(15, 13)));\r\n\t}", "public static List<TuvImpl> getTargetTuvs(TargetPage p_targetPage) throws Exception\n {\n List<Tuv> tuvs = new ArrayList<Tuv>();\n\n Connection conn = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n try\n {\n conn = DbUtil.getConnection();\n long sourcePageId = p_targetPage.getSourcePage().getId();\n String tuvTableName = BigTableUtil.getTuvTableJobDataInBySourcePageId(sourcePageId);\n String tuTableName = BigTableUtil.getTuTableJobDataInBySourcePageId(sourcePageId);\n String sql = GET_TARGET_TUVS_SQL.replace(TUV_TABLE_PLACEHOLDER, tuvTableName)\n .replace(TU_TABLE_PLACEHOLDER, tuTableName);\n\n ps = conn.prepareStatement(sql);\n ps.setLong(1, p_targetPage.getLocaleId());\n ps.setLong(2, p_targetPage.getId());\n rs = ps.executeQuery();\n tuvs.addAll(convertResultSetToTuv(rs, false, p_targetPage.getSourcePage().getJobId()));\n\n // Load xliff_alt data in page level to improve performance.\n if (XliffAltUtil.isGenerateXliffAlt(p_targetPage.getSourcePage()))\n {\n loadXliffAlts2(new ArrayList<Tuv>(tuvs), p_targetPage.getLocaleId(),\n p_targetPage.getId(), tuTableName, tuvTableName);\n }\n\n setHashValues(tuvs);\n\n List<TuvImpl> result = new ArrayList<TuvImpl>();\n for (Tuv tuv : tuvs)\n {\n result.add((TuvImpl) tuv);\n }\n return result;\n }\n catch (Exception e)\n {\n logger.error(\"Error when getTargetTuvs for target page \" + p_targetPage.getId(), e);\n throw e;\n }\n finally\n {\n DbUtil.silentClose(rs);\n DbUtil.silentClose(ps);\n DbUtil.silentReturnConnection(conn);\n }\n }", "public static List<SemanticGraphEdge> getTargetEdgesOnTarget(final Iterable<SemanticGraphEdge> edges,\n\t\t\tfinal GeneralPosRelationEnum targetType, final boolean isSource) {\n\t\tfinal List<SemanticGraphEdge> targetEdges = new ArrayList<SemanticGraphEdge>();\n\n\t\tfor (SemanticGraphEdge edge : edges) {\n\t\t\tif (!isSource && targetType.contains(edge.getTarget().tag())) {\n\t\t\t\ttargetEdges.add(edge);\n\t\t\t}\n\t\t\tif (isSource && targetType.contains(edge.getSource().tag())) {\n\t\t\t\ttargetEdges.add(edge);\n\t\t\t}\n\t\t}\n\t\treturn targetEdges;\n\t}", "private void getPossibleListTargets(List<List<TargetingScheme<?>>> list, List<List<TargetList<?>>> alreadyTargeted, List<List<List<TargetList<?>>>> outputList) {\n // and the lord said let there be triple nested lists, trust me bro\n if (list.isEmpty()) {\n outputList.add(new ArrayList<>(alreadyTargeted));\n return;\n }\n List<TargetingScheme<?>> schemesForFirstEffect = list.get(0);\n List<List<TargetList<?>>> searchSpace = new LinkedList<>();\n this.getPossibleListTargetsPerEffect(schemesForFirstEffect, new LinkedList<>(), searchSpace);\n if (searchSpace.isEmpty()) {\n // if no targets, add that possibility to our search space\n searchSpace.add(List.of());\n }\n for (List<TargetList<?>> t : searchSpace) {\n alreadyTargeted.add(t);\n this.getPossibleListTargets(list.subList(1, list.size()), alreadyTargeted, outputList);\n alreadyTargeted.remove(alreadyTargeted.size() - 1);\n }\n }", "@Override\n public ControllerViewEvent getTargetEffectTwo() {\n ArrayList<Square> possibleTargets = new ArrayList<>();\n for (int i = 0; i < 4; i++) {\n if (getOwner().getPosition().checkDirection(i) && !getOwner().getPosition().getNextSquare(i).getSquarePlayers().isEmpty())\n possibleTargets.add(getOwner().getPosition().getNextSquare(i));\n }\n return new TargetSquareRequestEvent(getOwner().getUsername(), Encoder.encodeSquareTargetsX(possibleTargets), Encoder.encodeSquareTargetsY(possibleTargets));\n }", "@Override\n public void sendProgramsToReceiveTargets(Program[] progs) {\n \n }", "public Task[] getNextTask(final String pername, final Integer coutas) {\n Task[] task1 = new Task[coutas];\n int size1 = 0;\n for (int i = 0; i < size; i++) {\n if (taskarr[i].getassignedTo().equals(pername)) {\n if (taskarr[i].getStatus().equals(\"todo\")\n && taskarr[i].getImportant().equals(\"Important\")\n && taskarr[i].getUrgent().equals(\"Not Urgent\")) {\n task1[size1] = taskarr[i];\n size1++;\n if (size1 == coutas) {\n break;\n }\n }\n }\n }\n return task1;\n }", "speech_formatting.SegmentedTextOuterClass.TokenSegment getTokenSegment(int index);", "@Test\n\tpublic void testTargetsOneStep() {\n\t\tboard.calcTargets(7, 6, 1);\n\t\tSet<BoardCell> targets= board.getTargets();\n\t\tassertEquals(4, targets.size());\n\t\tassertTrue(targets.contains(board.getCellAt(7, 7)));\n\t\tassertTrue(targets.contains(board.getCellAt(7, 5)));\t\n\t\tassertTrue(targets.contains(board.getCellAt(6, 6)));\t\n\t\tassertTrue(targets.contains(board.getCellAt(8, 6)));\t\n\n\n\t\tboard.calcTargets(14, 24, 1);\n\t\ttargets= board.getTargets();\n\t\tassertEquals(2, targets.size());\n\t\tassertTrue(targets.contains(board.getCellAt(15, 24)));\n\t\tassertTrue(targets.contains(board.getCellAt(14, 23)));\t\t\t\n\t}", "private Sequence makeSequence(String[] sList, int index) {\r\n\t\tSequence s = new Sequence();\r\n\t\tfor(int i = 0; i<sList.length; i++) {\r\n\t\t\ts.addAfter(sList[i]);\r\n\t\t}\r\n\t\ts.start();\r\n\t\tfor(int i=0; i<index; i++) {\r\n\t\t\ts.advance();\r\n\t\t}\r\n\t\treturn s;\r\n\t}", "@Test\r\n\tpublic void testTargetsOneStep() {\r\n\t\tboard.calcTargets(24, 17, 1);\r\n\t\tSet<BoardCell> targets= board.getTargets();\r\n\t\tassertEquals(2, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(23, 17)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(24, 18)));\t\r\n\t\t\r\n\t\tboard.calcTargets(10, 24, 1);\r\n\t\ttargets= board.getTargets();\r\n\t\tassertEquals(2, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 24)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(10, 23)));\t\t\t\r\n\t}", "List<Stopsinlinedb> fetchStopsInLines();", "List<Stop> getStopsPerLine(String line);", "String getSourcesfromUniqueEndpoit(String graph);", "public ArrayList<Utterance> getSplittedUtts(){\n ArrayList<Utterance> result = new ArrayList<Utterance>();\n\n for(Utterance utt : utts){\n String content = utt.getContent().toLowerCase().trim();\n ArrayList<String> subSentences = sp.split(content);\n if(subSentences.size() > 3){\n result.add(utt);\n }\n else if(subSentences.size() > 1){ // sub sentences num : 2 - 3\n for(String s : subSentences){\n Utterance tmp = utt;\n tmp.setContent(s);\n result.add(tmp); // seperate them\n }\n }\n else{\n result.add(utt);\n }\n }\n return result;\n }", "public void setUp() throws Exception {\n\n processDefinition = new ProcessDefinition();\n\n processDefinition.setProcessVariables(new ProcessVariable[]{\n ProcessVariable.forName(\"var1\"),\n ProcessVariable.forName(\"var2\")\n });\n\n Activity theLastJoinActivity = null;\n\n\n for(int i=1; i<20; i++) {\n Activity a1 = new DefaultActivity();\n\n // a1.setQueuingEnabled(true);\n\n if(i == 7 || i==1){\n a1 = new GatewayActivity();\n }\n\n a1.setTracingTag(\"a\" + i);\n processDefinition.addChildActivity(a1);\n\n if(i==7){\n theLastJoinActivity = a1;\n }\n }\n\n {\n Transition t1 = new Transition();\n t1.setSource(\"a9\");\n t1.setTarget(\"a1\");\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a10\");\n t1.setTarget(\"a9\");\n\n processDefinition.addTransition(t1);\n }\n\n {\n Transition t1 = new Transition();\n t1.setSource(\"a1\");\n t1.setTarget(\"a2\");\n t1.setCondition(new Evaluate(\"var1\", \"==\", \"true\"));\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a1\");\n t1.setTarget(\"a5\");\n t1.setCondition(new Evaluate(\"var2\", \"==\", \"true\"));\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a2\");\n t1.setTarget(\"a3\");\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a2\");\n t1.setTarget(\"a4\");\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a5\");\n t1.setTarget(\"a6\");\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a6\");\n t1.setTarget(\"a4\");\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a3\");\n t1.setTarget(\"a7\");\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a4\");\n t1.setTarget(\"a7\");\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a7\");\n t1.setTarget(\"a11\");\n\n processDefinition.addTransition(t1);\n }\n {\n Transition t1 = new Transition();\n t1.setSource(\"a11\");\n t1.setTarget(\"a12\");\n\n processDefinition.addTransition(t1);\n }\n\n processDefinition.afterDeserialization();\n\n ProcessInstance.USE_CLASS = DefaultProcessInstance.class;\n\n\n }", "private void timerAction(){\n \n timerEnd();\n \n if (timerCounter == TEST_TARGET_APPERANCE + testTargetDelay){\n manageTestTarget();\n }\n \n if (timerCounter == TEST_TARGET_DISAPPERANCE + testTargetDelay){\n labelArray[TEST_TARGET_LOCATION].setIcon(iconSet.getGrayIcon());\n //System.out.println(\"Test End\");\n }\n //creates clickable red target in random, non occupied location\n //and handles removal of unclicked, expired targets\n int randRedTarget = generator.nextInt(100);\n while(labelArray[randRedTarget].getIcon()!=iconSet.getGrayIcon()){\n //System.out.println(\"Already a target in place\");\n randRedTarget = generator.nextInt(100);\n }\n labelArray[randRedTarget].setIcon(iconSet.getRedTargetIcon());\n \n if (timerCounter<ACTIVE_RED_TARGET_TOTAL){\n activeRedTarget[timerCounter] = randRedTarget;\n }\n \n if (timerCounter>=ACTIVE_RED_TARGET_TOTAL){\n if(labelArray[activeRedTarget[0]].getIcon()!=iconSet.getGrayIcon()){\n labelArray[activeRedTarget[0]].setIcon(iconSet.getGrayIcon());\n }\n for(int i = 0; i < activeRedTarget.length-1; i++){\n activeRedTarget[i] = activeRedTarget[i+1];\n }\n activeRedTarget[ACTIVE_RED_TARGET_TOTAL-1] = randRedTarget;\n }\n\n if (timerCounter%4==0){\n manageBlueTargets();\n }\n \n timerCounter++;\n \n if (timerCounter%4==0){\n manageGreenTargets();\n }\n \n System.out.println(\"Timer: \" + timerCounter); \n }", "public List<Tile> findTargets() {\n List<Tile> targets = new ArrayList<>(); // our return value\n int fearDistance = 2; // Ideally we're 2 spots away from their head, increases when we can't do that.\n int foodDistance = 3; // We look at a distance 3 for food.\n\n // If fearDistance gets this big, then its just GG i guess\n while (targets.size() == 0 && fearDistance < 15) {\n // Get the tiles around the Enemy's head\n targets = this.gb.nearByTiles(this.enemy_head_x, this.enemy_head_y, fearDistance);\n fearDistance += 1;\n }\n\n // Get the food tiles near us\n for (int i=0; i < foodDistance; i++) {\n List<Tile> nearBy = this.gb.nearByTiles(this.us_head_x, this.us_head_y, i);\n for (Tile t : nearBy) {\n if (t.isFood() && !targets.contains(t)) targets.add(t);\n }\n }\n return targets;\n }" ]
[ "0.6133025", "0.6071273", "0.56114846", "0.54620665", "0.54541713", "0.5372431", "0.52994794", "0.51341045", "0.5123141", "0.5109337", "0.49994472", "0.49958667", "0.49328372", "0.4918463", "0.49057126", "0.48962247", "0.48466554", "0.484454", "0.4814812", "0.47981942", "0.47977203", "0.47898555", "0.474601", "0.47382778", "0.47329357", "0.4727144", "0.4723709", "0.47196767", "0.4683343", "0.467972", "0.46765223", "0.46598104", "0.4644569", "0.4638735", "0.46207634", "0.46041715", "0.46035254", "0.45801753", "0.45723188", "0.45215973", "0.44992766", "0.44682792", "0.44674098", "0.4446788", "0.44365957", "0.441801", "0.44110587", "0.4395513", "0.4374288", "0.43729508", "0.43571725", "0.43564254", "0.4353716", "0.43511003", "0.4343613", "0.4340586", "0.43250865", "0.4314395", "0.43067935", "0.4300644", "0.4296937", "0.429589", "0.42884073", "0.42838913", "0.4268744", "0.42635784", "0.4262496", "0.42554608", "0.4249268", "0.424904", "0.42346266", "0.42343357", "0.42309427", "0.42308375", "0.42307976", "0.4222865", "0.421989", "0.42118227", "0.42093876", "0.42091787", "0.42073682", "0.42034322", "0.41938168", "0.4184579", "0.41817775", "0.4176371", "0.41720098", "0.41700065", "0.41653335", "0.4161855", "0.41556296", "0.4154278", "0.41438568", "0.4143741", "0.41400278", "0.41383764", "0.413766", "0.41360903", "0.41319564", "0.4128387" ]
0.71136034
0
TODO Autogenerated method stub
@Override public void onResponse(JSONObject response) { try { JSONArray data = response.getJSONArray("Data"); for (int i = 0; i < data.length(); i++) { JSONObject info = data.getJSONObject(i); student_id = info.getString("student_id"); username = info.getString("username"); email = info.getString("email"); password = info.getString("password"); arrayList.add(new profile(student_id, username, email, password)); } loading.dismiss(); } catch (JSONException e) { Log.d("Tag", e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onErrorResponse(VolleyError error) { System.out.print(error.toString()); Log.d("TAG", error.toString()); }
{ "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
Interface implemented by test frameworks.
public interface Framework { /** * A human-friendly name of the test framework that this object represents. */ public String name(); /** * An array of <a href="Fingerprint.html"><code>Fingerprint</code></a>s that specify how to identify test classes during * discovery. */ public Fingerprint[] fingerprints(); /** * Initiates a run. * * <p> * If a client invokes this method before a previously initiated run has completed, * the test framework may throw <code>IllegalStateException</code>to indicate it * cannot perform the two runs concurrently. * </p> * * @param args the test-framework-specific arguments for the new run * @param remoteArgs the test-framework-specific remote arguments for the run in a forked JVM * @param testClassLoader a class loader to use when loading test classes during the run * * @return a <code>Runner</code> representing the newly started run. * @throws IllegalStateException if the test framework is unable to initiate a run because it is * already performing a previously initiated run that has not yet completed. */ public Runner runner(String[] args, String[] remoteArgs, ClassLoader testClassLoader); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface PlatformTest {\n\n /* @Before naming convention */\n void setUp() throws CouchbaseLiteException;\n\n /* @After naming convention */\n void tearDown();\n\n /* Set up any test specific logging */\n void setupFileLogging();\n\n /* Gets the directory for storing test databases. */\n String getDatabaseDirectoryPath();\n\n /* Gets the platform specific temp directory. */\n String getScratchDirectoryPath(String name);\n\n /* Gets the assert as InputStream by asset's name */\n InputStream getAsset(String asset) throws IOException;\n\n /* Scheduled to execute a task asynchronously. */\n void executeAsync(long delayMs, Runnable task);\n\n /* Reload the cross-platform error messages. */\n void reloadStandardErrorMessages();\n}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\n\tpublic void testEngine() {\n\t\t\n\t}", "public interface IntegrationTest {\n}", "@Override\n public void runTest() {\n }", "protected abstract TestResult runTestImpl() throws Exception;", "@Override\n public void test() {\n \n }", "static interface JunitTestBody {\n void run(RunNotifier notifier);\n }", "@Override\n\tpublic void test() {\n\t\t\n\t}", "@Override\n public ITestContext getTestContext() {\n return testContext;\n }", "public interface PerformanceTest {}", "public interface KernelAPIReadTestSupport\n{\n /**\n * Setup the test. Called once. Starts a Kernel in the provided store directory, and populates the graph using\n * the provided create method.\n *\n * @param storeDir The directory in which to create the database.\n * @param create Method which populates the database.\n * @throws IOException If database creation failed due to IO problems.\n */\n void setup( File storeDir, Consumer<GraphDatabaseService> create );\n\n /**\n * The Kernel to test. Called before every test.\n * @return The Kernel.\n */\n Kernel kernelToTest();\n\n /**\n * Teardown the Kernel and any other resources once all tests have completed.\n */\n void tearDown();\n}", "public interface TestApi {\n}", "TestTarget createTestTarget();", "@Override\r\npublic void onTestStart(ITestResult arg0) {\n\t\r\n}", "@Test\n\tvoid test() {\n\t\t\n\t}", "public interface MainTestConfig {\n /**\n * hostname for the RabbitMQ server\n * should not be the same machine as the tests runner\n * @return host or ip for the target host\n */\n public String rabbitHost();\n\n /**\n * TCP port for RabbitMQ\n * @return\n */\n public Integer rabbitPort();\n\n /**\n * Should the tests use long lived TCP connections or not\n * @return true or false\n */\n public Boolean tcpReuseConn();\n\n /**\n * Should the tests reuse channels\n * @return true orr false\n */\n public Boolean tcpReuseChannel();\n\n /**\n * specifies the size for the messages enqueued before starting tests\n * @return\n */\n public Integer maxMessages();\n\n /**\n * name of the queue hosting messages\n * @return\n */\n public String queueName();\n\n /**\n * name of the exchange used to publish messages\n * @return\n */\n public String exchangeName();\n\n /**\n * routing key used to deliver messages through the exchange\n * @return\n */\n public String routingKey();\n\n /**\n * should the queue be created as a lazy one?\n * @return\n */\n public Boolean lazyQueue();\n\n /**\n * prefetch size\n * @return\n */\n public Integer prefetch();\n\n /**\n * shoud messages be persisted\n * @return\n */\n public Boolean persistent();\n\n /**\n * is the queue exclusive? shoud le always false\n * @return\n */\n public Boolean exclusive();\n\n /**\n * is the queue flagged as autodelete ? should be false\n * @return\n */\n public Boolean autodelete();\n\n /**\n * delays to sleep while consuming messages\n * @return\n */\n public Integer threadDelay();\n}", "@Override\n\t\tpublic ITestContext getTestContext() {\n\t\t\treturn null;\n\t\t}", "@Override\npublic void onTestStart(ITestResult result) {\n\t\n}", "@Test\n public void simpleUse(){\n }", "@Test\r\n\tpublic void client() {\n\t}", "@Test\r\n\tpublic void test() {\r\n\t}", "private ProtomakEngineTestHelper() {\r\n\t}", "public interface SlowTests {\n \n}", "protected TeststepRunner() {}", "public interface CompilerTestCase {\n\t/**\n * Retrieve the list of files whose compilation would be tested.\n * @return a list of files in relative or absolute position.\n */\n public String[] getClassesToCompile();\n \n /**\n * Perform the test.\n * \n * @param diagnostics the compiler diagnostics for the evaluated files.\n * @param stdoutS the output of the compiler.\n * @param result the result of the compilation. True if succeeded, false if not.\n */\n public void test(List<Diagnostic<? extends JavaFileObject>> diagnostics, String stdoutS, Boolean result);\n\n}", "public TokenControllerTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code\n\t\t * should be placed in the setUp() method instead.\n\t\t */\n\n\t}", "public static void loadTest(){\n }", "@Override\npublic void onStart(ITestContext context) {\n\t\n}", "@Test\r\n public void testGetApiBase() {\r\n // Not required\r\n }", "abstract void setUp() throws Exception;", "public interface TestExtend {\n}", "public void testGetHost() {\n }", "public static Test suite() {\n return new TestSuite(TestLearningAPI.class);\n }", "@Override\r\npublic void onStart(ITestContext arg0) {\n}", "@Override\n\tpublic void homeTestRun() {\n\t\t\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Override\n public void setUp() {\n }", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@Test\n\tpublic void testMain() {\n\t}", "public void junitStarted() { }", "public void junitStarted() { }", "public AppTest(String testName) {\n super(testName);\n }", "public AppTest(String testName) {\n super(testName);\n }", "public AppTest(String testName) {\n super(testName);\n }", "public AppTest(String testName) {\n super(testName);\n }", "@Override\n\tpublic void runTest() throws Throwable {}", "@Test\n\tpublic void getTest() {\n\t}", "public void run(TestCase testCase) {\n }", "@Test\n\tpublic void something() {\n\t}", "public interface TestMethods {\n void pingHost(String url, int times);\n}", "@Override\n\t\tpublic String getTestName() {\n\t\t\treturn null;\n\t\t}", "public void onTestStart(ITestResult arg0) {\n\t\n}", "LoadTest createLoadTest();", "@Test\n public void testBeer() {\n // TODO: test Beer\n }", "public HockeyTeamTest()\n {\n }", "@Override\npublic void onTestSuccess(ITestResult result) {\n\t\n}", "public interface TestRunnerGenerator {\n public void generateTestRunner(final String outputFolder);\n}", "public void testDumbJUnit() {\n }", "TestContainer createTestContainer();", "public AppTest(String testName) {\r\n\t\tsuper(testName);\r\n\t}", "public static junit.framework.Test suite() {\n return new JUnit4TestAdapter(ClientsPrepopulatingBaseActionTest.class);\n }", "public abstract void initializeTestSuite();", "public ApplicationTest( String testName )\n {\n super( testName );\n }", "@Test\n public void init() {\n }", "public void testGetBasedata() {\n }", "@Test\n\tpublic void test(){\n\t}", "public interface ProxyTest {\n\n\tpublic void ping() throws ApplicationException;\n}", "public interface InterfaceTestBase {\n void test1();\n}", "public AppTest( String testName )\r\n {\r\n super( testName );\r\n }", "public AppTest( String testName )\r\n {\r\n super( testName );\r\n }", "public interface TestType {\n /**\n * Marker interface for tests that use the Enterprise data set for use with {@link org.junit.experimental.categories.Category}\n */\n interface DataSetEnterprise {}\n\n /**\n * Marker interface for tests that use the Lite data set for use with {@link org.junit.experimental.categories.Category}\n */\n interface DataSetLite {}\n\n /**\n * Marker interface for tests that use the Premium data set for use with {@link org.junit.experimental.categories.Category}\n */\n interface DataSetPremium {}\n\n /**\n * Marker interface for tests that take a long time\n */\n interface Lengthy {}\n\n /**\n * Marker Interface for API Tests for use with {@link org.junit.experimental.categories.Category}\n */\n interface TypeApi {}\n\n /**\n * Marker Interface for HTTP Header Tests for use with {@link org.junit.experimental.categories.Category}\n */\n interface TypeHttpHeader {}\n\n /**\n * Marker Interface for Memory Tests for use with {@link org.junit.experimental.categories.Category}\n */\n interface TypeMemory {}\n\n /**\n * Marker Interface for Metadata Tests for use with {@link org.junit.experimental.categories.Category}\n */\n interface TypeMetadata {}\n\n /**\n * Marker Interface for Performance Tests for use with {@link org.junit.experimental.categories.Category}\n */\n interface TypePerformance {}\n \n /**\n * Marker Interface for Unit Tests for use with {@link org.junit.experimental.categories.Category}\n */\n interface TypeUnit{}\n}", "public interface FastTest {\n}", "@Test\n void get() {\n }", "public interface ITest {\n}", "@Override\n public void onTestStart(ITestResult result) {\n\n }", "public interface TestSuite extends Suite {\n\n}", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public AppTest(String testName) {\n\t\tsuper(testName);\n\t}", "public static junit.framework.Test suite() {\n\t\treturn new JUnit4TestAdapter(TypeEmbedded.class);\n\t}", "public static InterfaceTestSuite isuite()\n {\n InterfaceTestSuite suite = new InterfaceTestSuite(ServiceContextExtCannedBenchmark.class);\n suite.setName(ServiceContextExt.class.getName());\n suite.addFactory(new CannedServiceContextExtTestFactory());\n return suite;\n }", "public BazaarTests() {\r\n\t\tsuper();\r\n\t}", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "public interface ProcessTest {\n void process();\n}", "public void testDummy() {\n }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Test\n public void instanceTest() {\n // TODO: test instance\n }", "public void testSpock(){\n }", "public AppTest( String testName )\n {\n super( testName );\n }", "public AppTest( String testName )\n {\n super( testName );\n }", "public AppTest( String testName )\n {\n super( testName );\n }", "public AppTest( String testName )\n {\n super( testName );\n }", "public AppTest( String testName )\n {\n super( testName );\n }", "public AppTest( String testName )\n {\n super( testName );\n }", "public AppTest( String testName )\n {\n super( testName );\n }", "public AppTest( String testName )\n {\n super( testName );\n }" ]
[ "0.72970086", "0.68064475", "0.6744587", "0.6741108", "0.6698395", "0.6588175", "0.65831584", "0.65818864", "0.65476525", "0.6497549", "0.64934987", "0.6435812", "0.639918", "0.6396015", "0.63277143", "0.6273261", "0.6272266", "0.6265166", "0.6261095", "0.6258802", "0.6256331", "0.6253308", "0.62530994", "0.62387353", "0.62372893", "0.6229602", "0.6218669", "0.6217744", "0.62109894", "0.6202173", "0.61976606", "0.6196579", "0.61961603", "0.61915267", "0.6189771", "0.61851966", "0.61849296", "0.61849296", "0.61740637", "0.61697894", "0.61666787", "0.6166444", "0.6166444", "0.6164087", "0.6164087", "0.6164087", "0.6164087", "0.6153308", "0.61525", "0.6147706", "0.6137952", "0.6135686", "0.6135089", "0.6134996", "0.6132212", "0.61306363", "0.6129714", "0.61277753", "0.6124439", "0.6112893", "0.61090785", "0.60997415", "0.6096659", "0.6096322", "0.60954076", "0.60930836", "0.6091893", "0.60918176", "0.6090435", "0.6090205", "0.6083604", "0.6083604", "0.6067318", "0.6065059", "0.60614717", "0.60598016", "0.6055566", "0.6051381", "0.60487777", "0.60487777", "0.60487777", "0.60487777", "0.60487777", "0.60458463", "0.6041388", "0.60369754", "0.60359675", "0.602999", "0.60272163", "0.6026084", "0.6019119", "0.6018388", "0.60166895", "0.60166895", "0.60166895", "0.60166895", "0.60166895", "0.60166895", "0.60166895", "0.60166895" ]
0.7294949
1
A humanfriendly name of the test framework that this object represents.
public String name();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected String getName() {\n return testClass.getName();\n }", "public String getShortTestClassName()\r\n {\r\n return target.getClass().getSimpleName();\r\n }", "public String getTestname() {\n return testname;\n }", "@Override\n\t\tpublic String getTestName() {\n\t\t\treturn null;\n\t\t}", "public String getTestSetName() {\n return this.testSetName;\n }", "public String getTestBedName() {\r\n\t\treturn testBedName; \r\n\t}", "public String getTestClassName()\r\n {\r\n return target.getClass().getName();\r\n }", "@Override\n protected String testName(FrameworkMethod method)\n {\n return method.getName() + getName();\n }", "public String getTestName() {\n return testURL;\n }", "public String getTestDefinitionName() {\n return testdefinitionname;\n }", "public String getName() {\n return (\"Regular Factory\");\n }", "public String getName() {\r\n if (target != null) {\r\n return target.getName();\r\n }\r\n\r\n if (benchmark != null) {\r\n return benchmark.getName();\r\n }\r\n\r\n return \"\";\r\n }", "public String getDisplayName() {\n return \"Aggregate build flow test results\";\n }", "private String getEmulatorFriendlyName() {\n return mEmulatorFriendlyName;\n }", "@VisibleForTesting\n String getSuiteName() {\n String suiteName = null;\n if (mModuleContext == null) {\n suiteName = TestSuiteInfo.getInstance().getName().toLowerCase();\n } else {\n List<String> testSuiteTags = mModuleContext.getConfigurationDescriptor().\n getSuiteTags();\n if (!testSuiteTags.isEmpty()) {\n if (testSuiteTags.size() >= 2) {\n CLog.i(\"More than 2 test-suite-tag are defined. test-suite-tag: \" +\n testSuiteTags);\n }\n suiteName = testSuiteTags.get(0).toLowerCase();\n CLog.i(\"Using %s from test suite tags to get value from dynamic config\", suiteName);\n } else {\n suiteName = TestSuiteInfo.getInstance().getName().toLowerCase();\n CLog.i(\"Using %s from TestSuiteInfo to get value from dynamic config\", suiteName);\n }\n }\n return suiteName;\n }", "@ApiModelProperty(required = true, value = \"The name of the test.\")\n public String getName() {\n return name;\n }", "@Override\n\tpublic String getToolName() {\n\t\treturn name;\n\t}", "public String getDisplayName() {\n return \"Test website performance using Rigor Optimization\";\n }", "@Override\n\t\tpublic String getName() {\n\t\t\tSystem.out.println(ITestResult.SUCCESS);\n\t\t\treturn null;\n\t\t}", "@Override\n public String getName() {\n return this.getClass().getSimpleName();\n }", "public String getName() {\r\n \treturn this.getClass().getName();\r\n }", "default String getCheckName() {\n return getClass().getSimpleName();\n }", "public final String getName() {\n /// Since we plan to have only one wizard for each class, we use the name of the class.\n return this.getClass().getSimpleName();\n }", "@ApiModelProperty(required = true, value = \"The programmatic location of the test.\")\n public String getClassname() {\n return classname;\n }", "public static synchronized String getTestProjectName() {\n String retVal;\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.getTestProjectName\");\n if (Utility.isMacintosh()) {\n retVal = \"Test Project\";\n } else if (Utility.isLinux()) {\n retVal = \"Test Project\";\n } else {\n retVal = \"Test ProjectW\";\n }\n return retVal;\n }", "@Override\n public Description getDescription() {\n return suiteDescription;\n }", "public interface Framework {\n\n /**\n * A human-friendly name of the test framework that this object represents.\n */\n public String name();\n\n /**\n * An array of <a href=\"Fingerprint.html\"><code>Fingerprint</code></a>s that specify how to identify test classes during\n * discovery.\n */\n public Fingerprint[] fingerprints();\n\n /**\n * Initiates a run.\n *\n * <p>\n * If a client invokes this method before a previously initiated run has completed,\n * the test framework may throw <code>IllegalStateException</code>to indicate it\n * cannot perform the two runs concurrently.\n * </p>\n *\n * @param args the test-framework-specific arguments for the new run\n * @param remoteArgs the test-framework-specific remote arguments for the run in a forked JVM\n * @param testClassLoader a class loader to use when loading test classes during the run\n *\n * @return a <code>Runner</code> representing the newly started run.\n * @throws IllegalStateException if the test framework is unable to initiate a run because it is\n * already performing a previously initiated run that has not yet completed.\n */\n public Runner runner(String[] args, String[] remoteArgs, ClassLoader testClassLoader);\n}", "@Override\n\tpublic String getName() {\n\t\treturn portmodifytesting.class.getSimpleName();\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name+\" : \"+test;\n\t}", "public void testGetSpecName() {\n assertEquals(mb.getSpecName(), System\n .getProperty(\"java.vm.specification.name\"));\n }", "default String getDisplayName() {\r\n\t\treturn getClass().getSimpleName();\r\n\t}", "@Test\n public void displayNameTest() {\n // TODO: test displayName\n }", "String getPlatformName();", "public String getToolname() {\r\n return toolname;\r\n }", "public String getNameSpace() {\n\t\treturn \"Tealium\";\n\t}", "@Override\r\n\tpublic String getName() {\n\t\treturn \"TF\";\r\n\t}", "public String getName () {\n return impl.getName ();\n }", "public static String currentMethodName() {\n String fm = CURRENT_TEST.get();\n if (fm != null) {\n return fm;\n } else {\n return \"<no current test>\";\n }\n }", "@Test\r\n\tpublic void getName() {\r\n\t\tassertEquals(\"Name was intialized as 'test'\", \"test\", testObj.getName());\r\n\t}", "public String getName() {\r\n\t\treturn GDAssemblerUI.getText(UI_TEXT);\r\n\t}", "String getExternalToolName();", "public String getName() {\n\t\treturn \"Bmw\";\n\t}", "@Override \r\n\tpublic String getName() {\r\n\t\treturn \"Bazooka\";\r\n\t}", "public String getName()\r\n\t{\r\n\t\treturn \"Biggie\";\r\n\t}", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.69695854", "0.670708", "0.65565336", "0.65404326", "0.6415229", "0.6388601", "0.6259733", "0.6235405", "0.6152808", "0.6137206", "0.60371614", "0.6019452", "0.5981923", "0.59801567", "0.5962583", "0.58937436", "0.5888168", "0.58617055", "0.5854078", "0.5848784", "0.58448935", "0.5834021", "0.5833182", "0.58302534", "0.5817176", "0.57895255", "0.57823634", "0.5760044", "0.57385373", "0.5684849", "0.567087", "0.5663581", "0.56573623", "0.56462085", "0.56439966", "0.5608082", "0.56051755", "0.5579404", "0.55763745", "0.5566476", "0.55431694", "0.5543083", "0.5541124", "0.5534846", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735", "0.5530735" ]
0.0
-1
An array of Fingerprints that specify how to identify test classes during discovery.
public Fingerprint[] fingerprints();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static synchronized Set getDescriptorClasses() {\n\tHashSet set = new HashSet();\n\n for (Enumeration e = registryModes.elements(); e.hasMoreElements();) {\n RegistryMode mode = (RegistryMode)e.nextElement();\n\n\t set.add(mode.descriptorClass);\n\t}\n\n\treturn set;\n }", "public FaceRecognitionTests(){\n for(int i = 0; i < 25; i++){\n idsToTest.add(new Long(i + 15));\n }\n }", "public ClassDoc[] specifiedClasses() {\n // System.out.println(\"RootDoc.specifiedClasses() called.\");\n // return specClasses.values().toArray(new ClassDoc[0]);\n\n // index.html lists classes returned from specifiedClasses; return the\n // set of classes in specClasses that are\n // included as per access mod filter\n return classes();\n }", "@Test\n public void testGetDecalredClasses() {\n for (Class clazz : TestClass.class.getDeclaredClasses()) {\n System.out.println(clazz.getName());\n }\n }", "public List<Class<?>> getKnownClasses();", "@Deprecated\r\n private void setDevices() throws ClassNotFoundException {\n\r\n installedDevices = new Device[deviceName.length];\r\n\r\n for (int i = 0; i < deviceName.length; i++) {\r\n\r\n //Class<?> eine = Class.forName(deviceName[0]);\r\n try {\r\n Constructor<?>[] ctors = Class.forName(deviceName[i]).getDeclaredConstructors();\r\n Constructor<?> ctor = null;\r\n for (Constructor<?> c : ctors) {\r\n if (c.getGenericParameterTypes().length == 0) {\r\n ctor = c;\r\n }\r\n }\r\n ctor.setAccessible(true);\r\n Device device = (Device) ctor.newInstance();\r\n\r\n installedDevices[i] = device;\r\n\r\n } catch (Exception e) {\r\n throw new ClassNotFoundException(\r\n \"Ist abgestuerzt, weil Klasse aus Config nicht existiert oder im falschen ordner sich befindet\"\r\n + e + \".\");\r\n }\r\n\r\n }\r\n\r\n }", "Integer[] getClasses() {\n\t\tArrayList<Integer> uniqueClasses = new ArrayList<Integer>();\n\t\tfor(ClassInfo c : preferences) {\n\t\t\tif (uniqueClasses.contains(c.getCourseID()) == false){\n\t\t\t\tuniqueClasses.add(c.getCourseID());\n\t\t\t}\n\t\t}\n\t\treturn uniqueClasses.toArray(new Integer[0]);\n\t}", "protected static DangerousFileType[] getKnownTypes() {\n return new DangerousFileType[] {\n // Add known file types here\n new DangerousFileType(ASF_TYPE, ASF_EXTENSIONS),\n new DangerousFileType(EXE_TYPE, EXE_EXTENSIONS)\n };\n }", "@Test\n public void testGetClasses() throws Exception {\n for (Class clazz : TestClass.class.getClasses()) {\n System.out.println(clazz.getName());\n }\n }", "public String[] readClasses();", "public Collection<TestInfo> listTestInfo() {\n\t\treturn classToInfoMap.values();\n\t}", "@SuppressWarnings(\"unused\")\n\tprivate static Stream<Arguments> sp800_73_4_DiscoveryObjectTestProvider() {\n\n\t\treturn Stream.of(Arguments.of(APDUConstants.DISCOVERY_OBJECT_OID));\n\n\t}", "public Map<Class<?>, Class<?>[]> getCapabilities();", "public abstract Object[] getSimilarityFactors();", "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}", "public abstract List<String> scanAllClassNames();", "private void generalFeatureExtraction () {\n Logger.log(\"Counting how many calls each method does\");\n Chain<SootClass> classes = Scene.v().getApplicationClasses();\n try {\n for (SootClass sclass : classes) {\n if (!isLibraryClass(sclass)) {\n System.out.println(ConsoleColors.RED_UNDERLINED + \"\\n\\n 🔍🔍 Checking invocations in \" +\n sclass.getName() + \" 🔍🔍 \" + ConsoleColors.RESET);\n List<SootMethod> methods = sclass.getMethods();\n for (SootMethod method : methods) {\n featuresMap.put(method, new Features(method));\n }\n }\n }\n } catch (Exception e) { \n }\n System.out.println(\"\\n\");\n }", "public String[] getTestbedClassName() {\r\n\t\treturn testbedClassName;\r\n\t}", "private void onClassesFound(List<UMDClass> classes) {\n\t}", "private List<DiscoverySelector> getClassLevelDiscoverySelectors(List<Class<?>> clazzes,\n List<String> methodNames, List<ArrayList<String>> parametersLists,\n Map<String, List<String>> testfaelleNachKlasseGeordnet) \n {\n List<DiscoverySelector> discoverySelectors = new ArrayList<>();\n for (Map.Entry<String, List<String>> entry : testfaelleNachKlasseGeordnet.entrySet()) \n {\n BasicFrameXmlModel basicFrameXmlModel = null;\n try {\n basicFrameXmlModel = BasicFrameXmlModel\n .loadTestCaseInfo(BasicFrameXmlModel.jarFileName);\n } \n catch (JDOMException | IOException ignored) \n {\n \tSystem.out.println(\n \t\t\"Exception in getClassLevelDiscoverySelectors von testCaseJunit5Runner\" \n + ignored.getMessage()); \t\n }\n assert basicFrameXmlModel != null;\n if(!basicFrameXmlModel.containsAnotherTestCaseFromSameClass(entry.getValue())) \n {\n Class<?> clazzOfWhichAllMethodsAreExecuted\n = clazzes.stream().filter(clazz -> clazz.getCanonicalName()\n .equals(entry.getKey())).findFirst().get();\n if(!discoverySelectors.contains(selectClass(clazzOfWhichAllMethodsAreExecuted)))\n discoverySelectors.add(selectClass(clazzOfWhichAllMethodsAreExecuted));\n for (int i = 0; i < clazzes.size(); i++) \n {\n if(clazzOfWhichAllMethodsAreExecuted.getCanonicalName()\n .equals(clazzes.get(i).getCanonicalName()))\n {\n clazzes.remove(i);\n methodNames.remove(i);\n parametersLists.remove(i);\n i--;\n }\n }\n }\n }\n return discoverySelectors;\n }", "private Set<String> classSet(String whichClass) {\n return subclasses.get(whichClass);\n }", "public void compareClasses() {\n for (User f : friends) {\n compareClassesHelper(thisUser.getArrMatch(), f.getArrMatch(), f);\n }\n }", "public void setFingerprint(String fingerprint) {\n this.fingerprint = fingerprint;\n }", "public String[] getFfTypes(){\n return ffc.getFfTypes();\n }", "public static void main(String[] args) {\n Favorites f = new Favorites();\n f.putFavorite(String.class, \"Java\");\n f.putFavorite(Integer.class, 0xcafebabe);\n f.putFavorite(Class.class, Favorites.class);\n\n String favoriteString = f.getFavorite(String.class);\n int favoriteInteger = f.getFavorite(Integer.class);\n Class<?> favoriteClass = f.getFavorite(Class.class);\n System.out.printf(\"%s %x %s%n\", favoriteString, favoriteInteger,\n favoriteClass.getName());\n\t}", "public byte[] getFingerprint()\n {\n byte[] tmp = new byte[fingerprint.length];\n \n System.arraycopy(fingerprint, 0, tmp, 0, tmp.length);\n \n return tmp;\n }", "public void fizzBuzzTest() {\n FizzBuzz fizzBuzz = new FizzBuzz();\n String[] resultArray = {fizzBuzz.detect(15), fizzBuzz.detect(3), fizzBuzz.detect(5), fizzBuzz.detect(4)};\n\n for (int i = 0; i < resultArray.length ; i++) {\n if (resultArray[i].equals(expectedResultArray[i])) {\n System.out.println(expectedResultArray[i] + \" test = OK\");\n } else {\n System.out.println(expectedResultArray[i] + \" test = FAIL\");\n }\n }\n\n }", "private static /* synthetic */ boolean[] m37843a() {\n boolean[] zArr = f35337a;\n if (zArr != null) {\n return zArr;\n }\n boolean[] probes = Offline.getProbes(2117124487222320605L, \"com/mopub/mobileads/native_video/R$color\", 1);\n f35337a = probes;\n return probes;\n }", "public Object[] getImplementations() {\n\t\tObject[] res = { HackProjectLearner.class };\n\t\treturn res;\n\t}", "public int[] getMagicPicks()\n\t{\n\t\treturn getMagicPicks(false);\n\t}", "List<String> getDefaultGpuInstanceTypes();", "private void printDetectedPuzzles(final String[] DECODED_PUZZLES_DATA) {\n int counter = 1;\n for(String puzzle : DECODED_PUZZLES_DATA) {\n LOGGER.info(counter + \". \" + puzzle + \" \");\n counter++;\n }\n }", "@RestrictTo(Scope.LIBRARY_GROUP)\n @Nullable\n Fingerprint getFingerprint();", "public List<Roi> getExamples(String classKey, String type);", "String [] getSupportedTypes();", "public List<ClassId> getThirdClasses() {\n\t\tList<ClassId> classes = new ArrayList<>();\r\n\r\n\t\t/*\r\n\t\t * classes.add(ClassId.EVAS_SAINT); classes.add(ClassId.SHILLIEN_TEMPLAR);\r\n\t\t * classes.add(ClassId.SPECTRAL_DANCER); classes.add(ClassId.GHOST_HUNTER);\r\n\t\t * \r\n\t\t * classes.add(ClassId.DREADNOUGHT); classes.add(ClassId.PHOENIX_KNIGHT);\r\n\t\t * classes.add(ClassId.HELL_KNIGHT);\r\n\t\t * \r\n\t\t * classes.add(ClassId.HIEROPHANT); classes.add(ClassId.EVAS_TEMPLAR);\r\n\t\t * classes.add(ClassId.SWORD_MUSE);\r\n\t\t * \r\n\t\t * classes.add(ClassId.DOOMCRYER); classes.add(ClassId.FORTUNE_SEEKER);\r\n\t\t * classes.add(ClassId.MAESTRO);\r\n\t\t */\r\n\r\n\t\t// classes.add(ClassId.ARCANA_LORD);\r\n\t\t// classes.add(ClassId.ELEMENTAL_MASTER);\r\n\t\t// classes.add(ClassId.SPECTRAL_MASTER);\r\n\t\t// classes.add(ClassId.SHILLIEN_SAINT);\r\n\r\n\t\tclasses.add(ClassId.SAGGITARIUS);\r\n\t\tclasses.add(ClassId.ARCHMAGE);\r\n\t\tclasses.add(ClassId.SOULTAKER);\r\n\t\tclasses.add(ClassId.MYSTIC_MUSE);\r\n\t\tclasses.add(ClassId.STORM_SCREAMER);\r\n\t\tclasses.add(ClassId.MOONLIGHT_SENTINEL);\r\n\t\tclasses.add(ClassId.GHOST_SENTINEL);\r\n\t\tclasses.add(ClassId.ADVENTURER);\r\n\t\tclasses.add(ClassId.WIND_RIDER);\r\n\t\tclasses.add(ClassId.DOMINATOR);\r\n\t\tclasses.add(ClassId.TITAN);\r\n\t\tclasses.add(ClassId.CARDINAL);\r\n\t\tclasses.add(ClassId.DUELIST);\r\n\r\n\t\tclasses.add(ClassId.GRAND_KHAVATARI);\r\n\r\n\t\treturn classes;\r\n\t}", "public Set<String> getClassKeys();", "public void setDetectorFactoryCollection(DetectorFactoryCollection detectorFactoryCollection) {\n this.detectorFactoryCollection = detectorFactoryCollection;\n }", "public static <T> List<T> instantiateAll(String[] classes, ClassLoader classLoader) {\n List<T> clazzes = new ArrayList<>();\n for (String clazz : classes) {\n if (StringUtils.hasLength(clazz)) {\n clazzes.add(ClassUtils.<T>instantiate(clazz, classLoader));\n }\n }\n return clazzes;\n }", "private HashMap<Class<? extends Annotation>, RuntimeTestGroup> collectGroups(\n List<TestCandidate> testCandidates) {\n final HashMap<Class<? extends Annotation>, RuntimeTestGroup> groups = \n new HashMap<Class<? extends Annotation>, RuntimeTestGroup>();\n \n // Always use @Nightly as a group.\n groups.put(Nightly.class, new RuntimeTestGroup(defaultNightly));\n \n // Collect all groups declared on methods and instance classes.\n HashSet<Class<?>> clazzes = new HashSet<Class<?>>();\n HashSet<Annotation> annotations = new HashSet<Annotation>();\n for (TestCandidate c : testCandidates) {\n if (!clazzes.contains(c.instance.getClass())) {\n clazzes.add(c.instance.getClass());\n annotations.addAll(Arrays.asList(c.instance.getClass().getAnnotations()));\n }\n annotations.addAll(Arrays.asList(c.method.getAnnotations()));\n }\n \n // Check all annotations. \n for (Annotation ann : annotations) {\n if (!groups.containsKey(ann) \n && ann.annotationType().isAnnotationPresent(TestGroup.class)) {\n groups.put(ann.annotationType(), new RuntimeTestGroup(ann));\n }\n }\n \n return groups;\n }", "public Match[] getMale64Winners() {\n return sixts;\n }", "private static /* synthetic */ boolean[] m37845a() {\n boolean[] zArr = f35339a;\n if (zArr != null) {\n return zArr;\n }\n boolean[] probes = Offline.getProbes(8351510718017544634L, \"com/mopub/mobileads/native_video/R$drawable\", 1);\n f35339a = probes;\n return probes;\n }", "public List<AbstractMatcher> getMatchers() {\n\t\tList<AbstractMatcher> list = new LinkedList<AbstractMatcher>();\n\t\tlist.addAll(matcherList);\n\t\t\n\t\t// HACK to show matcher\n\t\tAbstractMatcher partitionMatcher = new PartitionMatcher();\n\t\tlist.add(partitionMatcher);\n\t\t\n\t\treturn list;\n\t}", "@BeforeClass\n\tpublic static void classInformation() {\n\t\tSystem.out.println(\"***\\t \" + InvitationsPostTest.class.getSimpleName()\n\t\t\t\t+ \" ***\");\n\t}", "private static /* synthetic */ boolean[] m37846a() {\n boolean[] zArr = f35340a;\n if (zArr != null) {\n return zArr;\n }\n boolean[] probes = Offline.getProbes(1575301677882808626L, \"com/mopub/mobileads/native_video/R$id\", 1);\n f35340a = probes;\n return probes;\n }", "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 }", "public List<? extends BaseClassInfo> getClasses(HasMetricsFilter filter) {\n if (classLookup == null) {\n buildClassLookupMap();\n }\n List<BaseClassInfo> result = newArrayList();\n for (BaseClassInfo classInfo : classLookup.values()) {\n if (filter.accept(classInfo)) {\n result.add(classInfo);\n }\n }\n return result;\n }", "public Set<Class<?>> getScanClasses();", "public ClassDoc[] classes() {\n // return specClasses.values().toArray(new ClassDoc[0]);\n\n // return the set of classes in specClasses that are \"included\"\n // according to the access modifier filter\n if (includedClasses != null) {\n // System.out.println(\"RootDoc.classes() called.\");\n return includedClasses;\n }\n int size = 0;\n Collection<X10ClassDoc> classes = specClasses.values();\n for (ClassDoc cd : classes) {\n if (cd.isIncluded()) {\n size++;\n }\n }\n includedClasses = new X10ClassDoc[size];\n int i = 0;\n for (X10ClassDoc cd : classes) {\n if (cd.isIncluded()) {\n includedClasses[i++] = cd;\n }\n }\n Comparator<X10ClassDoc> cmp = new Comparator<X10ClassDoc>() {\n public int compare(X10ClassDoc first, X10ClassDoc second) {\n return first.name().compareTo(second.name());\n }\n\n public boolean equals(Object other) {\n return false;\n }\n };\n Arrays.sort(includedClasses, cmp);\n // System.out.println(\"RootDoc.classes() called. result = \" +\n // Arrays.toString(includedClasses));\n return includedClasses;\n }", "public ClassInfo[] getClasses() {\r\n return classes.toArray(new ClassInfo[classes.size()]);\r\n }", "@DISPID(28)\n\t// = 0x1c. The runtime will prefer the VTID if present\n\t@VTID(39)\n\tjava.lang.String checkTestInstances(java.lang.String testIDs);", "public static void main(String[] args) {\n\t\tSystem.out.println(\"fizzArray is-->\"+Arrays.toString(fizzArray(4)));\r\n\r\n\t}", "public ClassAnnotationMetaDataFilter(Class<?>[] annos) {\n _annos = new HashSet<>();\n for (Class<?> anno : annos) {\n _annos.add(Type.getDescriptor(anno));\n }\n }", "public String[] listFc() {\n\t\treturn new String[] { \"component\", \"counterResync\" };\n\t}", "@Test\n public void multidex() throws IOException {\n Set<String> result = classPathScanner.getClassPathEntries(new AcceptAllFilter());\n assertThat(result)\n .containsAtLeast(\n \"androidx.test.multidex.app.MultiDexTestClassA\",\n \"androidx.test.multidex.app.MultiDexTestClassB\",\n \"androidx.test.multidex.app.MultiDexTestClassC\",\n \"androidx.test.multidex.app.MultiDexTestClassD\",\n \"androidx.test.multidex.app.MultiDexApplication\");\n\n // ensure classes from binary under test are not included\n // this relies on build adding \"androidx.test.testing.fixtures.CustomTestFilter\" to target app\n // only\n assertThat(result).doesNotContain(\"androidx.test.testing.fixtures.CustomTestFilter\");\n }", "@Override\n public List<Method> getAllUssdMethodes(String className) {\n\n Class klass = null;\n\n try {\n klass = Class.forName(className);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n List<Method> resultMethods = new ArrayList<Method>();\n if (klass == null)\n return resultMethods;\n Method[] methods = klass.getDeclaredMethods();\n\n\n for (Method method : methods) {\n method.setAccessible(true);\n if (method.isAnnotationPresent(UssdMethod.class)) {\n resultMethods.add(method);\n }\n }\n\n return resultMethods;\n }", "@Ignore\n @Test\n public void discoverSeveralTypes() throws Exception {\n }", "private void compareClassesHelper(List<Integer> arr1, List<Integer> arr2, User f) {\n Collections.sort(arr1);\n Collections.sort(arr2);\n for (int a : arr1) {\n for (int b : arr2) {\n if (a == b) {\n f.incrementCount(\"class\");\n }\n }\n }\n }", "@Nonnull\n List<Telegraf> findTelegrafs();", "public static synchronized String[] getModeNames(Class descriptorClass) {\n\n\tString names[] = new String[registryModes.size()];\n\n\tint i = 0;\n\n for (Enumeration e = registryModes.elements(); e.hasMoreElements();) {\n RegistryMode mode = (RegistryMode)e.nextElement();\n\n\t if (mode.getDescriptorClass() == descriptorClass)\n\t\tnames[i++] = mode.getName();\n\t}\n\n\tif (i <= 0)\n\t return null;\n\n\tString matchedNames[] = new String[i];\n\n\tfor (int j = 0; j < i; j++)\n\t matchedNames[j] = names[j];\n\n\treturn matchedNames;\n }", "@Test\n\tpublic void testClassifier() {\n\t\t// Ensure there are no intermediate files left in tmp directory\n\t\tFile exampleFile = FileUtils.getTmpFile(FusionClassifier.EXAMPLE_FILE_NAME);\n\t\tFile predictionsFile = FileUtils.getTmpFile(FusionClassifier.PREDICTIONS_FILE_NAME);\n\t\texampleFile.delete();\n\t\tpredictionsFile.delete();\n\t\t\n\t\tList<List<Double>> columnFeatures = new ArrayList<>();\n\t\tSet<String> inputRecognizers = new HashSet();\n\t\tList<Map<String, Double>> supportingCandidates = new ArrayList();\n\t\tList<Map<String, Double>> competingCandidates = new ArrayList();\n\t\t\n\t\t// Supporting candidates\n\t\tMap<String, Double> supportingCandidatesTipo = new HashMap();\n\t\tsupportingCandidatesTipo.put(INPUT_RECOGNIZER_ID, TIPO_SIMILARITY_SCORE);\n\t\tsupportingCandidates.add(supportingCandidatesTipo);\n\n\t\tMap<String, Double> supportingCandidatesInsegna = new HashMap();\n\t\tsupportingCandidatesInsegna.put(INPUT_RECOGNIZER_ID, INSEGNA_SIMILARITY_SCORE);\n\t\tsupportingCandidates.add(supportingCandidatesInsegna);\n\t\t\n\t\t// Competing candidates\n\t\tMap<String, Double> competingCandidatesTipo = new HashMap();\n\t\tcompetingCandidatesTipo.put(INPUT_RECOGNIZER_ID, 0.);\n\t\tcompetingCandidates.add(competingCandidatesTipo);\n\t\tMap<String, Double> competingCandidatesInsegna = new HashMap();\n\t\tcompetingCandidatesInsegna.put(INPUT_RECOGNIZER_ID, 0.);\n\t\tcompetingCandidates.add(competingCandidatesInsegna);\n\n\t\t// Two columns: insegna and tipo from osterie_tipiche\n\t\t// A single column feature: uniqueness\n\t\tList<Double> featuresTipo = new ArrayList();\n\t\tfeaturesTipo.add(0.145833);\n\t\tcolumnFeatures.add(featuresTipo);\n\t\t\n\t\tList<Double> featuresInsegna = new ArrayList();\n\t\tfeaturesInsegna.add(1.0);\n\t\tcolumnFeatures.add(featuresInsegna);\n\t\t\n\t\t// A single input recognizer\n\t\tinputRecognizers.add(INPUT_RECOGNIZER_ID);\n\n\t\t// Create the classifier\n\t\tFusionClassifier classifier \n\t\t\t= new FusionClassifier(FileUtils.getSVMModelFile(MINIMAL_FUSION_CR_NAME), \n\t\t\t\t\tcolumnFeatures, \n\t\t\t\t\tRESTAURANT_CONCEPT_ID, \n\t\t\t\t\tinputRecognizers);\n\t\tList<Double> predictions \n\t\t\t= classifier.classifyColumns(supportingCandidates, competingCandidates);\n\t\t\n\t\tboolean tipoIsNegativeExample = predictions.get(0) < -0.5;\n\t\t\n//\t\tTODO This currently doesn't work -- need to investigate\n//\t\tboolean insegnaIsPositiveExample = predictions.get(1) > 0.5;\n\t\t\n\t\tassertTrue(tipoIsNegativeExample);\n//\t\tassertTrue(insegnaIsPositiveExample);\n\t\t\n\ttry {\n\t\tSystem.out.println(new File(\".\").getCanonicalPath());\n\t\tSystem.out.println(getClass().getProtectionDomain().getCodeSource().getLocation());\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t\t\n\t}", "private static /* synthetic */ boolean[] m37849a() {\n boolean[] zArr = f35343a;\n if (zArr != null) {\n return zArr;\n }\n boolean[] probes = Offline.getProbes(-5737089224341627970L, \"com/mopub/mobileads/native_video/R$string\", 1);\n f35343a = probes;\n return probes;\n }", "public static Class<?>[] findTestClasses(Class<?> clazz) throws ClassNotFoundException {\n\t\tFile testDir = findClassDir(clazz);\n\t\treturn findTestClasses(testDir);\n\t}", "private static String [] init(String className, TypeTree tree) {\n // Use a Linked to avoid resizing.\n Collection<String> types = new LinkedList<String>();\n String [] typearray;\n\t if (className.equals(EntryRep.matchAnyClassName())) {\n\t\t// handle \"match any\" specially\" -- search from ROOT\n\t\t// Simplification suggested by \n\t\t// Lutz Birkhahn <lutz.birkhahn@GMX.DE>\n\t\tclassName = ROOT;\n\t } else {\n\t\t// add this class\n\t\ttypes.add(className);\n\t }\n\n\t // add all subclasses\n\t walkTree(tree.classSet(className), types, tree);\n\n\t // Convert it to an array and then randomize\n\t typearray = types.toArray(new String[types.size()]);\n\t int randnum = 0;\n\t String tmpobj = null;\n int length = typearray.length;\n\t for (int i = 0; i < length; i++) {\n\t\trandnum = numgen.nextInt(length - i);\n\t\ttmpobj = typearray[i];\n\t\ttypearray[i] = typearray[randnum];\n\t\ttypearray[randnum] = tmpobj;\n\t }\n return typearray;\n\t}", "@Override\n\tpublic ArrayList<Class<?>> getSupportedClassifier() {\n\t\treturn null;\n\t}", "private String[] detectFeatures() {\n \t\t\tchangeStampIsValid = false;\n \t\t\tfeaturesChangeStampIsValid = false;\n \t\t\tparent.changeStampIsValid = false;\n \t\t\tparent.featuresChangeStampIsValid = false;\n \n \t\t\tfeatures = new ArrayList();\n \n \t\t\tif (!supportsDetection(resolvedURL))\n \t\t\t\treturn new String[0];\n \n \t\t\t// locate feature entries on site\n \t\t\tFile siteRoot = new File(resolvedURL.getFile().replace('/', File.separatorChar));\n \t\t\tFile root = new File(siteRoot, FEATURES);\n \n \t\t\tString[] list = root.list();\n \t\t\tString path;\n \t\t\tFile plugin;\n \t\t\tfor (int i = 0; list != null && i < list.length; i++) {\n \t\t\t\tpath = list[i] + File.separator + FEATURE_XML;\n \t\t\t\tplugin = new File(root, path);\n \t\t\t\tif (!plugin.exists()) {\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tfeatures.add(FEATURES + \"/\" + path.replace(File.separatorChar, '/')); //$NON-NLS-1$\n \t\t\t}\n \t\t\tif (DEBUG) {\n \t\t\t\tdebug(resolvedURL.toString() + \" located \" + features.size() + \" feature(s)\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \n \t\t\treturn (String[]) features.toArray(new String[0]);\n \t\t}", "@Override\n public Set<Class<?>> getClasses() {\n Set<Class<?>> resources = new java.util.HashSet<>();\n resources.add(api.Auth.class);\n resources.add(api.UserApi.class);\n resources.add(api.TicketApi.class);\n resources.add(api.DepartmentApi.class);\n resources.add(api.MessageApi.class);\n resources.add(api.MilestoneApi.class);\n resources.add(api.InvitationApi.class);\n return resources;\n }", "@Test\r\n\tpublic void classifyTest(){\r\n\t\tClassification[] expectedClass = {Classification.First,Classification.UpperSecond,Classification.LowerSecond,Classification.Third,Classification.Fail};\r\n\t\tint[] pointGrades = {3,6,10,13,18};\r\n\t\tfor(int i=0;i<pointGrades.length;i++)\r\n\t\t{\r\n\t\t\tassertEquals(expectedClass[i],new PointGrade(pointGrades[i]).classify());\r\n\t\t}\r\n\t}", "@Test\n @Disabled(\"Not work in Java >=9\")\n void printAllClassJars() {\n var sysClassLoader = org.apache.commons.io.FileUtils.class.getClassLoader();\n var urLs = ((URLClassLoader) sysClassLoader).getURLs();\n for (var url : urLs) {\n System.out.println(url.getFile());\n }\n }", "final Class<?>[] classes() {\n if (classes instanceof Class[]) {\n return (Class[]) classes;\n } else {\n return new Class[] { (Class) classes };\n }\n }", "public static Class<?>[] getClassesInFile(File testsListFile){\n\t\tList<Class<?>> list = null;\n\t\tBufferedReader br = null;\n\t\ttry {\n\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(testsListFile), \"UTF-8\")); //$NON-NLS-1$\n\t\t} catch (UnsupportedEncodingException | FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t} \n\t\ttry {\n\t\t\tString line;\n\t\t\tlist = new ArrayList<Class<?>>();\n\t\t\ttry {\n\t\t\t\twhile ((line= br.readLine()) != null) {\n\t\t\t\t\tlist.add(Class.forName(line));\n\t\t\t\t}\n\t\t\t} catch (ClassNotFoundException | IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tbr.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn list.toArray(new Class<?>[list.size()]);\n\t}", "@Test\r\n\tpublic void testGetClasses() {\r\n\t\tassertTrue(breaku1.getClasses().contains(class1));\r\n\t\tassertTrue(externu1.getClasses().contains(class1));\r\n\t\tassertTrue(meetingu1.getClasses().contains(class1));\r\n\t\tassertTrue(teachu1.getClasses().contains(class1));\r\n\r\n\t\tassertEquals(classes, breaku1.getClasses());\r\n\t\tassertEquals(classes, externu1.getClasses());\r\n\t\tassertEquals(classes, meetingu1.getClasses());\r\n\t\tassertEquals(classes, teachu1.getClasses());\r\n\r\n\t\tassertFalse(classes1 == breaku1.getClasses());\r\n\t\tassertFalse(classes1 == externu1.getClasses());\r\n\t\tassertFalse(classes1 == meetingu1.getClasses());\r\n\t\tassertFalse(classes1 == teachu1.getClasses());\r\n\t}", "public static void main(String[] args) {\n for (FamilyType type : FamilyType.values()) {\n System.out.println(\"Current Type: \" + type);\n ArrayList<String> names = RunXilinxTools.getPartNames(type.toString().toLowerCase(), false);\n if (names == null) continue;\n for (String name : names) {\n System.out.println(\" \" + name + \" \" + getExactFamilyTypeFromPart(name));\n }\n }\n\n String[] testPartNames = {\"xs6slx4ltqg144\", \"xs6slx4tqg144\",\n \"xc7v285tffg484\", \"xc7vh290tffg1155\", \"xc7k30tsbg324\", \"xc7a20cpg236\", \"xc7a175tcsg324\",\n \"xq7v285tffg484\", \"xq7vh290tffg1155\", \"xq7k30tsbg324\", \"xq7a20cpg236\", \"xq7a175tcsg324\",\n \"xqr7v285tffg484\", \"xqr7vh290tffg1155\"};\n for (String name : testPartNames) {\n System.out.println(\" \" + name + \" \" + getExactFamilyTypeFromPart(name));\n }\n }", "@Override\n protected int[] getRegressionInputClassIndex() {\n int value = 8;\n int[] ret = new int[this.numberTests];\n for (int i = 0; i < this.numberTests; i++) {\n ret[i] = value;\n }\n return ret;\n }", "private HashMap<String, Class<?>> getClassNameMap(TestsToRun testsToRun) {\n\t\tHashMap<String, Class<?>> map = new HashMap<>();\n\t\tfor(Class<?> testClass : testsToRun) {\n\t\t\tmap.put(testClass.getName(), testClass);\n\t\t}\n\t\treturn map;\n\t}", "public float testAll(){\n List<Long> allIdsToTest = new ArrayList<>();\n allIdsToTest = idsToTest;\n //allIdsToTest.add(Long.valueOf(11));\n //allIdsToTest.add(Long.valueOf(12));\n //allIdsToTest.add(Long.valueOf(13));\n\n float totalTested = 0;\n float totalCorrect = 0;\n float totalUnrecognized = 0;\n\n for(Long currentID : allIdsToTest) {\n String pathToPhoto = \"photo\\\\testing\\\\\" + currentID.toString();\n File currentPhotosFile = new File(pathToPhoto);\n\n if(currentPhotosFile.exists() && currentPhotosFile.isDirectory()) {\n\n File[] listFiles = currentPhotosFile.listFiles();\n\n for(File file : listFiles){\n if (!file.getName().endsWith(\".pgm\")) { //search how to convert all image to .pgm\n throw new IllegalArgumentException(\"The file of the student \" + currentID + \" contains other files than '.pgm'.\");\n }\n else{\n Mat photoToTest = Imgcodecs.imread(pathToPhoto + \"\\\\\" + file.getName(), Imgcodecs.IMREAD_GRAYSCALE);\n try {\n RecognitionResult testResult = recognize(photoToTest);\n\n if(testResult.label[0] == currentID){\n totalCorrect++;\n }\n }\n catch (IllegalArgumentException e){\n System.out.println(\"One face unrecognized!\");\n totalUnrecognized++;\n }\n\n totalTested++;\n }\n }\n }\n }\n\n System.out.println(totalUnrecognized + \" face unrecognized!\");\n\n System.out.println(totalCorrect + \" face correct!\");\n System.out.println(totalTested + \" face tested!\");\n\n float percentCorrect = totalCorrect / totalTested;\n return percentCorrect;\n }", "private int[] countClasses(List<Instance> instances){\r\n\t\tint[] counters = new int[classes.size()];\r\n\t\tfor(Instance ins : instances){\r\n\r\n\t\t\tfor(String str : classes){\r\n\t\t\t\tif(ins.getClassAttribute().equals(str)){\r\n\t\t\t\t\tcounters[classes.indexOf(str)]++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn counters;\r\n\t}", "ISet<Class<?>> collectAllTypeWiredServices();", "@Test\n public void determine_provider_capabilities() {\n Provider bouncyCastleProvider = Security.getProvider(\"BC\");\n assertThat(bouncyCastleProvider, is(notNullValue()));\n /**\n * Get the KeySet where the provider keep a list of it's\n * capabilities\n */\n Iterator<Object> capabilitiesIterator = bouncyCastleProvider.keySet().iterator();\n while(capabilitiesIterator.hasNext()){\n String capability = (String) capabilitiesIterator.next();\n\n if(capability.startsWith(\"Alg.Alias.\")) {\n capability = capability.substring(\"Alg.Alias.\".length());\n }\n\n String factoryClass = capability.substring(0, capability.indexOf(\".\"));\n String name = capability.substring(factoryClass.length() + 1);\n\n assertThat(factoryClass, is(not(isEmptyOrNullString())));\n assertThat(name, is(not(isEmptyOrNullString())));\n\n System.out.println(String.format(\"%s : %s\", factoryClass, name));\n }\n }", "@NotNull\n List<? extends ClassInfo> getClasses();", "public final TestDevice[] getDeviceList() {\n return mDevices.toArray(new TestDevice[mDevices.size()]);\n }", "java.util.List getClassPathElements();", "private static void printSupers(ClassContainer tempClass, ArrayList<String> whitelist, PrintWriter printFile) {\n\t\tArrowStorage extension = tempClass.getSupers();\n\t\tif (extension == null) {\n\t\t\treturn;\n\t\t}\n\t\tif (whitelist.contains(extension.getTargetType()) && extension.getTargetType().contains(\"_\")\n\t\t\t\t&& !extension.getTargetType().equals(tempClass.getClassName())) {\n\t\t\tprintFile.println(tempClass.getClassName() + \" -> \"\n\t\t\t\t\t+ tempClass.getSupers().getTargetType() + \" [\"\n\t\t\t\t\t+ extension.getColor() + \" \" + extension.getLabel()\n\t\t\t\t\t+ \"arrowhead=\\\"onormal\\\"];\");\n\t\t}\n\t}", "private void generateTestCapabilityFiles() {\n\n String[] ids = {\"cap_1_001\", \"cap_1_002\", \"cap_1_003\", \"cap_1_004\", \"cap_1_005\", \"cap_3_001\", \"cap_3_002\", \"cap_2_001\", \"cap_2_002\"};\n String[] actionNames_en = {\"Go Forward\", \"Reverse\", \"Turn Left\", \"Turn Right\", \"Stop\", \"Light ON\", \"Light OFF\", \"No Object\", \"See Object\"};\n String[] actionNames_si = {\"ඉදිරියට යන්න\", \"පසුපසට යන්න\", \"වමට හැරෙන්න\", \"දකුණට හැරෙන්න\", \"නවතින්න\", \"Light ON\", \"Light OFF\", \"No Object\", \"See Object\"};\n String[] actionCmd = {\"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\"};\n String[] comparaters = {\"\", \"\", \"\", \"\", \"\", \"\", \"\", \">\", \"<\"};\n String[] response = {\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"1\", \"1\"};\n String[] reference = {\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"100\", \"100\"};\n String[] buttonList = {\"true\", \"true\", \"true\", \"true\", \"false\", \"true\", \"false\", \"false\", \"false\"};\n //String[] imageList = {\"forward\", \"reverse\", \"left\", \"right\", \"stop\", \"true\", \"false\"};\n\n for (int i = 0; i < 9; i++) {\n\n String types;\n\n if (i >= 7) {\n types = Capability.CAP_SENSE;\n } else if (i < 2 || i > 5) {\n types = Capability.CAP_ACTION_C;\n } else {\n types = Capability.CAP_ACTION;\n }\n\n Map<String, String> nameList = new HashMap<>();\n nameList.put(\"en_US\", actionNames_en[i]);\n nameList.put(\"si_LK\", actionNames_si[i]);\n\n try {\n\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n\n // root elements\n Document doc = docBuilder.newDocument();\n Element rootElement = doc.createElement(\"Sifeb\");\n doc.appendChild(rootElement);\n\n Element capability = doc.createElement(\"Capability\");\n rootElement.appendChild(capability);\n\n Element id = doc.createElement(\"Id\");\n id.appendChild(doc.createTextNode(ids[i]));\n capability.appendChild(id);\n\n Element names = doc.createElement(\"Names\");\n capability.appendChild(names);\n\n for (Map.Entry<String, String> entry : nameList.entrySet()) {\n Element name = doc.createElement(\"Name\");\n Element locale = doc.createElement(\"Locale\");\n Element nameStr = doc.createElement(\"Value\");\n\n locale.appendChild(doc.createTextNode(entry.getKey()));\n nameStr.appendChild(doc.createTextNode(entry.getValue()));\n\n name.appendChild(locale);\n name.appendChild(nameStr);\n names.appendChild(name);\n }\n\n Element type = doc.createElement(\"Type\");\n type.appendChild(doc.createTextNode(types));\n capability.appendChild(type);\n\n Element testCmd = doc.createElement(\"TestCommand\");\n testCmd.appendChild(doc.createTextNode(\"t\" + actionCmd[i]));\n capability.appendChild(testCmd);\n\n Element button = doc.createElement(\"HasTestButton\");\n button.appendChild(doc.createTextNode(buttonList[i]));\n capability.appendChild(button);\n\n Element exeCmd = doc.createElement(\"ExeCommand\");\n exeCmd.appendChild(doc.createTextNode(\"a\" + actionCmd[i]));\n capability.appendChild(exeCmd);\n\n Element stopCmd = doc.createElement(\"StopCommand\");\n stopCmd.appendChild(doc.createTextNode(\"a5\"));\n capability.appendChild(stopCmd);\n\n Element compType = doc.createElement(\"Comparator\");\n compType.appendChild(doc.createTextNode(comparaters[i]));\n capability.appendChild(compType);\n\n Element respSize = doc.createElement(\"Response\");\n respSize.appendChild(doc.createTextNode(response[i]));\n capability.appendChild(respSize);\n\n Element refVal = doc.createElement(\"Reference\");\n refVal.appendChild(doc.createTextNode(reference[i]));\n capability.appendChild(refVal);\n\n Element image = doc.createElement(\"Image\");\n image.appendChild(doc.createTextNode(ids[i]));\n capability.appendChild(image);\n\n // write the content into xml file\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n DOMSource source = new DOMSource(doc);\n File file = new File(SifebUtil.CAP_FILE_DIR + ids[i] + \".xml\");\n StreamResult result = new StreamResult(file); //new File(\"C:\\\\file.xml\"));\n\n transformer.transform(source, result);\n\n System.out.println(\"File saved!\");\n\n } catch (ParserConfigurationException | TransformerException pce) {\n pce.printStackTrace();\n }\n\n }\n }", "public static void main(String[] args) throws ClassNotFoundException {\n Class<Test.TestD> testDClass = Test.TestD.class;\n Class<Test.TestA> testAClass = Test.TestA.class;\n getClassHierarchy(testDClass);\n getClassHierarchyRecurs(testDClass, true);\n\n getClassInformation(testDClass);\n System.out.println();\n getClassInformation(testAClass);\n }", "public static Verifier[] getVerifiers() {\n Verifier[] vs = new Verifier[hashMap.values().size()];\n // Because vs is big enough, vs is used to store the values into and returned!\n return (Verifier[]) (hashMap.values().toArray(vs));\n }", "@Test\n public void testMultiplePasspointCandidatesWithSameFQDN() {\n // Create a Passpoint WifiConfig\n WifiConfiguration config1 = WifiConfigurationTestUtil.createPasspointNetwork();\n mScanResult2.BSSID = mScanResult1.BSSID.replace('1', '2');\n // Add candidates with different scanDetail for same passpoint WifiConfig.\n assertTrue(mWifiCandidates.add(mScanDetail1, config1, 2, 0.0, false, 100));\n assertTrue(mWifiCandidates.add(mScanDetail2, config1, 2, 0.0, false, 100));\n // Both should survive and no faults.\n assertEquals(2, mWifiCandidates.size());\n assertEquals(0, mWifiCandidates.getFaultCount());\n }", "public String getFingerprint() {\n return fingerprint;\n }", "public void fetchClassInfo() {\n try {\n telephonyClassName = \"android.telephony.TelephonyManager\";\n listofClass = new String[]{\n \"com.mediatek.telephony.TelephonyManagerEx\",\n \"android.telephony.TelephonyManager\",\n \"android.telephony.MSimTelephonyManager\",\n \"android.telephony.TelephonyManager\"};\n for (int index = 0; index < listofClass.length; index++) {\n if (isTelephonyClassExists(listofClass[index])) {\n if (isMethodExists(listofClass[index], \"getDeviceId\")) {\n if (!simVariant.equalsIgnoreCase(\"\")) {\n break;\n }\n }\n if (isMethodExists(listofClass[index], \"getNetworkOperatorName\")) {\n break;\n } else if (isMethodExists(listofClass[index], \"getSimOperatorName\")) {\n break;\n }\n }\n }\n for (int index = 0; index < listofClass.length; index++) {\n try {\n if (slotName1 == null || slotName1.equalsIgnoreCase(\"\")) {\n getValidSlotFields(listofClass[index]);\n // if(slotName1!=null || !slotName1.equalsIgnoreCase(\"\")){\n getSlotNumber(listofClass[index]);\n } else {\n break;\n }\n } catch (Exception e) {\n LOGE(TAG, \"[fetchClassInfo] Unable to get class info\", e);\n }\n }\n } catch (Exception e) {\n LOGE(TAG, \"[fetchClassInfo] Unable to get class info\", e);\n }\n }", "@ApiModelProperty(example = \"null\", value = \"Set of possible classes identified by the classifier\")\n public java.util.List<VbClass> getClasses() {\n return classes;\n }", "protected List<TestData> getTestData() {\n return Arrays.asList(\n new TestData(getClassLoaderResource(\"/pict/test.pct\"), new Dimension(300, 200)),\n new TestData(getClassLoaderResource(\"/pict/food.pct\"), new Dimension(146, 194)),\n new TestData(getClassLoaderResource(\"/pict/carte.pict\"), new Dimension(782, 598)),\n // Embedded QuickTime image... Should at least include the embedded fallback text\n new TestData(getClassLoaderResource(\"/pict/u2.pict\"), new Dimension(160, 159)),\n // Obsolete V2 format with weird header\n new TestData(getClassLoaderResource(\"/pict/FLAG_B24.PCT\"), new Dimension(124, 124)),\n // PixMap\n new TestData(getClassLoaderResource(\"/pict/FC10.PCT\"), new Dimension(2265, 2593)),\n // 1000 DPI with bounding box not matching DPI\n new TestData(getClassLoaderResource(\"/pict/oom.pict\"), new Dimension(1713, 1263)),\n\n // Sample data from http://developer.apple.com/documentation/mac/QuickDraw/QuickDraw-458.html\n new TestData(DATA_V1, new Dimension(168, 108)),\n new TestData(DATA_V2, new Dimension(168, 108)),\n new TestData(DATA_EXT_V2, new Dimension(168, 108)),\n\n // Examples from http://developer.apple.com/technotes/qd/qd_14.html\n new TestData(DATA_V1_COPY_BITS, new Dimension(100, 165)),\n new TestData(DATA_V1_OVAL_RECT, new Dimension(100, 165)),\n new TestData(DATA_V1_OVERPAINTED_ARC, new Dimension(100, 165))\n );\n }", "@Override\n public List<Class> getAllUssdClasses(String packageName) {\n\n List<Class> commands = new ArrayList<Class>();\n List<String> classNames = new ArrayList<String>();\n\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(\n null, null, null);\n\n StandardLocation location = StandardLocation.CLASS_PATH;\n\n Set<JavaFileObject.Kind> kinds = new HashSet<>();\n kinds.add(JavaFileObject.Kind.CLASS);\n boolean recurse = false;\n Iterable<JavaFileObject> list = new ArrayList<>();\n try {\n list = fileManager.list(location, packageName,\n kinds, recurse);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n for (JavaFileObject javaFileObject : list) {\n String path = javaFileObject.toUri().getPath();\n String className = path.substring(path.lastIndexOf(\"/\") + 1, path.indexOf(\".\"));\n classNames.add(className);\n }\n\n for (String className : classNames) {\n Class klass = null;\n try {\n klass = Class.forName(packageName + \".\" + className);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n if (klass != null && klass.isAnnotationPresent(UssdService.class)) {\n commands.add(klass);\n }\n }\n return commands;\n }", "public int[] getMagicPicks(boolean randoms)\n\t{\n\n\t\tint[] picks = {0, 0, 0, 0, 0, 0, 0, 0, 0};\n\t\t\n\t\tdouble prob = 1;\n\t\tif(randoms)\n\t\t\tprob = 0.25;\n\t\t\n\t\tfor(Filter f : appliedFilters)\n\t\t{\n\t\t\tif(f.name.equals(\"MAGICPICKS\") || f.name.equals(\"PRIESTPICKS\"))\n\t\t\t{\n\t\t\t\tMagicFilter m = (MagicFilter)f;\n\t\t\t\tfor(int i = 0; i < picks.length; i++)\n\t\t\t\t{\n\t\t\t\t\tpicks[i] += m.pattern.getPathsWithRandoms(m.prio, prob)[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t\n\t\treturn picks;\n\t}", "public Match[] getFemale64Winners() {\n return wsixts;\n }", "default @NonNull ClassElement[] getClassElements(@NonNull String aPackage, @NonNull String... stereotypes) {\n return new ClassElement[0];\n }", "private List<String> extractCorners ()\n {\n List<String> corners = new ArrayList<String> ();\n for (String sortedClass : sortedClasses)\n {\n ProjectDependenciesAnalyzer.DependencyInfo info = infos.get (sortedClass);\n double x = info.getNormalizedUsing ();\n double y = info.getNormalizedExtending ();\n if ((x < 0.05 || x > 0.95) && (y < 0.05 || y > 0.95))\n {\n corners.add (sortedClass);\n }\n }\n sortedClasses.removeAll (corners);\n return corners;\n }", "public String[][] ResetClasses()\r\n {\r\n String[][] classesR = {\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null },\r\n { null, null, null, null, null }};\r\n \r\n return classesR;\r\n }", "public Feedback findMultipleInstances(ClassOrInterfaceDeclaration classToTest) {\n AtomicBoolean firstInstanceFound = new AtomicBoolean(false);\n List<Feedback> childFeedbacks = new ArrayList<>();\n classToTest.findAll(FieldDeclaration.class).forEach(fieldDeclaration -> {\n if (firstInstanceFound.get()) {\n childFeedbacks.add(Feedback.getNoChildFeedback(\"Found multiple instance fields\",\n new FeedbackTrace(\n fieldDeclaration)));\n }\n firstInstanceFound.set(true);\n });\n if (childFeedbacks.isEmpty()) {\n return Feedback.getSuccessfulFeedback();\n } else {\n return Feedback.getFeedbackWithChildren(new FeedbackTrace(classToTest), childFeedbacks);\n }\n }", "private long [] determineMethodSeeds(Method method) {\n if (testCaseRandomnessOverride != null) {\n return new long [] { testCaseRandomnessOverride.seed };\n }\n \n // We assign each method a different starting hash based on the global seed\n // and a hash of their name (so that the order of methods does not matter, only\n // their names). Take into account global override and method and class level\n // {@link Seed} annotations. \n final long randomSeed = \n runnerRandomness.seed ^ MurmurHash3.hash((long) method.getName().hashCode());\n final HashSet<Long> seeds = new HashSet<Long>();\n \n // Check method-level @Seed and @Seeds annotation first. \n // They take precedence over anything else.\n Seed seed;\n if ((seed = method.getAnnotation(Seed.class)) != null) {\n for (long s : seedFromAnnot(method, randomSeed)) {\n seeds.add(s);\n }\n }\n \n // Check a number of seeds on a single method.\n if (method.isAnnotationPresent(Seeds.class)) {\n for (Seed s : method.getAnnotation(Seeds.class).value()) {\n if (s.value().equals(\"random\"))\n seeds.add(randomSeed);\n else {\n for (long s2 : SeedUtils.parseSeedChain(s.value())) {\n seeds.add(s2);\n }\n }\n }\n }\n \n // Check suite-level override.\n if (seeds.isEmpty()) {\n if ((seed = suiteClass.getAnnotation(Seed.class)) != null) {\n if (!seed.value().equals(\"random\")) {\n long [] seedChain = SeedUtils.parseSeedChain(suiteClass.getAnnotation(Seed.class).value());\n if (seedChain.length > 1)\n seeds.add(seedChain[1]);\n }\n }\n }\n \n // If still empty, add the derived random seed.\n if (seeds.isEmpty()) {\n seeds.add(randomSeed);\n }\n \n long [] result = new long [seeds.size()];\n int i = 0;\n for (Long s : seeds) {\n result[i++] = s;\n }\n return result;\n }", "Map<Long, Object[]> getAllFingerprintsForUser(String user) throws SQLException;" ]
[ "0.5186317", "0.51796854", "0.5173512", "0.51260674", "0.5125346", "0.5081446", "0.50029755", "0.49510217", "0.49244165", "0.4922391", "0.4895104", "0.48747957", "0.48671854", "0.486172", "0.4825704", "0.48198065", "0.481511", "0.47700083", "0.4749684", "0.47389868", "0.47346798", "0.47329587", "0.47212303", "0.47048837", "0.46767688", "0.4674681", "0.46689", "0.46514687", "0.46456954", "0.46434623", "0.46344218", "0.46294737", "0.4616451", "0.4610116", "0.46063182", "0.4599535", "0.4588341", "0.45819068", "0.45643103", "0.45627567", "0.45591757", "0.4556681", "0.45505932", "0.45447648", "0.45442984", "0.4543215", "0.45339155", "0.4531992", "0.4523402", "0.4519194", "0.451829", "0.45172206", "0.4517095", "0.45111713", "0.45096695", "0.4507209", "0.45029956", "0.4500517", "0.44916064", "0.44860515", "0.44835442", "0.4481287", "0.44700068", "0.44655004", "0.4464604", "0.4460062", "0.4451683", "0.4451611", "0.4450189", "0.44481277", "0.44406796", "0.44358218", "0.4435767", "0.4433531", "0.4429661", "0.4423893", "0.44230938", "0.4422173", "0.4409192", "0.44087356", "0.4406451", "0.4401396", "0.4400946", "0.43920204", "0.43913296", "0.43903223", "0.4388399", "0.43877512", "0.43875554", "0.43844908", "0.4384005", "0.43838808", "0.43783927", "0.4368059", "0.4367743", "0.43675897", "0.436122", "0.4355514", "0.43538412", "0.43511704" ]
0.69171566
0
Initiates a run. If a client invokes this method before a previously initiated run has completed, the test framework may throw IllegalStateExceptionto indicate it cannot perform the two runs concurrently.
public Runner runner(String[] args, String[] remoteArgs, ClassLoader testClassLoader);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TestResult run() {\n TestResult result= createResult();\n run(result);\n return result;\n }", "public final void run() {\n //We get a hold on the thread where this unit is going to be executed\n //so shutdown() can interrupt it if called.\n thread = Thread.currentThread();\n running = true;\n \n try {\n init();\n } catch (RuntimeException ex) {\n stop();\n aborted = true;\n onRunAborted(ex);\n }\n\n try {\n if (!isFinished() && !isStopping()) {\n internalRun();\n }\n } catch (RuntimeException ex) {\n aborted = true;\n onRunAborted(ex);\n throw ex;\n } finally {\n try {\n cleanup();\n } catch (RuntimeException ex) {\n onRunAborted(ex);\n }\n\n running = false;\n //Remove the thread reference\n thread = null;\n }\n }", "public void run() {\n RandomizedContext current = RandomizedContext.current();\n try {\n current.push(c.randomness);\n runSingleTest(notifier, c);\n } catch (Throwable t) {\n Rethrow.rethrow(augmentStackTrace(t)); \n } finally {\n current.pop();\n }\n }", "public TestResults run() {\n\t\treturn run(getConfiguredDuration());\n\t}", "@Test\n public void testStartRun() {\n ArgumentCaptor<CreateRun> createRunArgument = ArgumentCaptor.forClass(CreateRun.class);\n MlflowContext mlflow = setupMlflowContext();\n mlflow.setExperimentId(\"123\");\n mlflow.startRun(\"apple\", \"parent-run-id\");\n verify(mockClient).createRun(createRunArgument.capture());\n List<RunTag> tags = createRunArgument.getValue().getTagsList();\n Assert.assertEquals(createRunArgument.getValue().getExperimentId(), \"123\");\n Assert.assertTrue(tags.contains(createRunTag(MlflowTagConstants.RUN_NAME, \"apple\")));\n Assert.assertTrue(tags.contains(createRunTag(MlflowTagConstants.SOURCE_TYPE, \"LOCAL\")));\n Assert.assertTrue(tags.contains(createRunTag(MlflowTagConstants.USER, System.getProperty(\"user.name\"))));\n Assert.assertTrue(tags.contains(createRunTag(MlflowTagConstants.PARENT_RUN_ID, \"parent-run-id\")));\n }", "@org.junit.Test\n public void testRun() {\nSystem.out.println(\"run\");\n final TwitterFeedTask instance = new TwitterFeedTask();\n \n instance.run();\n }", "public void intialRun() {\n }", "public void run() {\n\t\texecuteCommand( client, false );\n\t}", "public void perform() {\n\t\tlog.info(\"begin to play the drum\");\n\t\tthrow new RuntimeException();\n\t}", "@Override\r\n\tpublic void run() {\n\t\trunClient();\r\n\t}", "@Override\n public void run() {\n started.set(!canceled.get());\n if (started.get()) {\n runBuildOperation();\n }\n }", "@Test\n public void testWithActiveRunNoRunName() {\n MlflowContext mlflow = setupMlflowContext();\n mlflow.setExperimentId(\"123\");\n when(mockClient.createRun(any(CreateRun.class)))\n .thenReturn(RunInfo.newBuilder().setRunId(\"test-id\").build());\n mlflow.withActiveRun(activeRun -> {\n Assert.assertEquals(activeRun.getId(), \"test-id\");\n });\n verify(mockClient).createRun(any(CreateRun.class));\n verify(mockClient).setTerminated(any(), any());\n }", "public void run() {\n super.executeStep();\n }", "@Test\n public void testWithActiveRun() {\n MlflowContext mlflow = setupMlflowContext();\n mlflow.setExperimentId(\"123\");\n when(mockClient.createRun(any(CreateRun.class)))\n .thenReturn(RunInfo.newBuilder().setRunId(\"test-id\").build());\n mlflow.withActiveRun(\"apple\", activeRun -> {\n Assert.assertEquals(activeRun.getId(), \"test-id\");\n });\n verify(mockClient).createRun(any(CreateRun.class));\n verify(mockClient).setTerminated(any(), any());\n }", "@Test\n public void constructStartAndStop() {\n kit.setBlockingStartup(false);\n kit.startAsync();\n kit.awaitRunning();\n kit.stopAsync();\n kit.awaitTerminated();\n }", "void runLeaseTaker() throws DependencyException, InvalidStateException;", "@Override\n public void run() {\n assertEquals(3, state.get());\n latch2.countDown();\n }", "public Test TestStart(boolean run){\n Test theTest = new Test(\n \"Test Start\",//Test Title\n CLASSNAME,//Class Name\n \"start()\",//Method Being Tested\n \"A test to seethe slide can start\", //Description\n \"N/A\", //Input Data\n \"True\" //Expected output\n ); \n \n \n \n \n \n if(run){\n theTest.hasRun();\n try{\n sl.start();\n theTest.setPassed(true);\n }catch(Exception e){\n theTest.setPassed(false);\n }\n \n }\n return theTest;\n }", "public void run() throws ClientException {\n taskgraph.getProperties().getEngine().execute(new Runnable() {\n public void run() {\n int result = WorkflowActionManager.CANCEL;\n\n try {\n result = WorkflowActionManager.authorizeWorkflowAction(WorkflowActions.RUN_ACTION, taskgraph,\n scheduler.getExecutionState());\n } catch (WorkflowException except) {\n except.printStackTrace();\n }\n\n try {\n if (result == WorkflowActionManager.AUTHORIZE) {\n scheduler.runTaskGraph();\n } else {\n handleCancel(result, null);\n }\n } catch (SchedulerException except) {\n except.printStackTrace();\n }\n }\n });\n }", "protected void runBeforeStep() {}", "protected abstract void preRun();", "public void run() {\n\t\t\t\tLog.e(\"bc\", \"thread started!\");\n\n\t\t\t\t// UTPDirectTest();\n\t\t\t\t// UDPTest();\n\t\t\t\tUDPBroadcastTest();\n\n\t\t\t}", "public void run() {\n long millis;\n TestCaseImpl tc = _testCase;\n \n // Force GC and record current memory usage\n _memoryBean.gc();\n _heapBytes = _memoryBean.getHeapMemoryUsage().getUsed();\n \n // Get number of threads to adjust iterations\n int nOfThreads = tc.getIntParam(Constants.NUMBER_OF_THREADS);\n \n int runIterations = 0;\n String runTime = tc.getParam(Constants.RUN_TIME);\n if (runTime != null) {\n // Calculate end time\n long startTime = Util.currentTimeMillis();\n long endTime = startTime + Util.parseDuration(runTime);\n \n // Run phase\n do {\n run(tc); // Call run\n runIterations++;\n millis = Util.currentTimeMillis();\n } while (endTime >= millis);\n }\n else {\n // Adjust runIterations based on number of threads\n runIterations = tc.getIntParam(Constants.RUN_ITERATIONS) / nOfThreads;\n \n // Run phase\n for (int i = 0; i < runIterations; i++) {\n run(tc); // Call run\n }\n }\n \n // Accumulate actual number of iterations\n synchronized (tc) {\n int actualRunIterations = \n tc.hasParam(Constants.ACTUAL_RUN_ITERATIONS) ? \n tc.getIntParam(Constants.ACTUAL_RUN_ITERATIONS) : 0;\n tc.setIntParam(Constants.ACTUAL_RUN_ITERATIONS, \n actualRunIterations + runIterations);\n }\n }", "@Override\n public void run() {\n if (experiment.randomSeed != -1) {\n ThreadLocalRandom.current().setSeed(experiment.randomSeed);\n }\n\n // Initialise the environment and agents\n environment.initialise();\n for (Agent agent : agents) {\n agent.initialise();\n }\n\n // Add the agents to the environment\n for (Agent agent : agents) {\n environment.add(agent);\n }\n\n // Run the experiment\n for (int update = 1, episode = 1; update <= experiment.totalUpdates; episode++) {\n // Restart the environment at the beginning of an episode\n environment.restart();\n\n // Play out an episode\n for (int turn = 1; !environment.isTerminal() && (environment.maxTurns() == 0 || turn <= environment.maxTurns()) && update <= experiment.totalUpdates; turn++, update++) {\n // Perform the next turn\n environment.performTurn();\n\n // Increment the task\n task.increment();\n\n // If evaluation point\n if (update % experiment.observationFrequency == 0) {\n evaluate(run, update, episode);\n }\n }\n }\n }", "protected void runBeforeTest() {}", "void start() throws TestFailed\n {\n this.startSkeletons();\n }", "public void run() {\n // The run method should be overridden by the subordinate class. Please\n // see the example applications provided for more details.\n }", "@Test\n public void constructStartSyncAndStop() {\n // blockStartup is true by default, so this will sync the blockchain before awaitRunning completes\n kit.startAsync();\n kit.awaitRunning();\n kit.stopAsync();\n kit.awaitTerminated();\n }", "public void start() {\n if (runner == null) {\n runner = new Thread(this, \"Runner\");\n runner.start();\n }\n }", "void beforeRun();", "public void onTestStart(ITestResult arg0) {\n\t\ttest=rep.startTest(arg0.getName().toUpperCase());\r\n\t\tif(!TestUtils.isTestRunnable(arg0.getName(), excel))\r\n\t\t{\r\n\t\t\tthrow new SkipException(\"Test case skipped due to runnable mode NO\");\r\n\t\t}\r\n\t}", "public AbstractConcurrentTestCase() {\n mainThread = Thread.currentThread();\n }", "public void execute() {\n\t\tlaunch();\n\t}", "public void run() {\n\t\t// Child threads start here to begin testing-- tests are below\n\t\n\t\t// We suggest writing a series of zero-sum tests,\n\t\t// i.e. lists should be empty between tests. \n\t\t// The interimBarr enforces this.\n\t\ttry {\n\t\t\tcontainsOnEmptyListTest();\n\t\t\tinterimBarr.await();\n\t\t\tsentinelsInEmptyListTest();\n\t\t\tprintResBarr.await();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public void execute() {\n if (hasError())\n return;\n\n runLocally();\n runRemotely();\n }", "public void run() {\n run(ErisCasper.create());\n }", "Run createRun();", "public void execute() {\n TestOrchestratorContext context = factory.createContext(this);\n\n PipelinesManager pipelinesManager = context.getPipelinesManager();\n ReportsManager reportsManager = context.getReportsManager();\n TestDetectionOrchestrator testDetectionOrchestrator = context.getTestDetectionOrchestrator();\n TestPipelineSplitOrchestrator pipelineSplitOrchestrator = context.getPipelineSplitOrchestrator();\n\n pipelinesManager.initialize(testTask.getPipelineConfigs());\n reportsManager.start(testTask.getReportConfigs(), testTask.getTestFramework());\n pipelineSplitOrchestrator.start(pipelinesManager);\n\n testDetectionOrchestrator.startDetection();\n testDetectionOrchestrator.waitForDetectionEnd();\n LOGGER.debug(\"test - detection - ended\");\n\n pipelineSplitOrchestrator.waitForPipelineSplittingEnded();\n pipelinesManager.pipelineSplittingEnded();\n LOGGER.debug(\"test - pipeline splitting - ended\");\n\n pipelinesManager.waitForExecutionEnd();\n reportsManager.waitForReportEnd();\n\n LOGGER.debug(\"test - execution - ended\");\n }", "@Test\r\n\tpublic void testRunAllSucceedFirst() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\tString token = \"someToken\";\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(token);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\tverify(call).call();\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).releaseLock(semaphoreKey + \"-1\", token);\r\n\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t}", "public void Run(){\n\t\t_TEST stack = new _TEST();\t\t/* TEST */\n\t\tstack.PrintHeader(ID,\"\", \"\");\t/* TEST */\n\t\t\n\t\tSetStatus(Status.RUNNING);\n\t\t\n\t\tstack.PrintTail(ID,\"\", \"\"); \t/* TEST */\n\t\t\n\t}", "protected TeststepRunner() {}", "public void testExecute() {\n\t\taes.execute();\n\t\t\n\t\tassertTrue(a.wasStopPollingMessagesCalled);\n\t\tassertTrue(osm.wasWriteCalled);\n\t}", "public void runResumeWorkflow() {\n\t\tassert (status == WorkflowStatus.READY\n\t\t\t\t|| status == WorkflowStatus.FINISHED || status == WorkflowStatus.ERROR);\n\n\t\tsetStatus(WorkflowStatus.INITIALIZING);\n\t}", "private void runAsync1(final int attempt) {\n log(\"runAsync1: attempt = \" + attempt);\n GWT.runAsync(new MyRunAsyncCallback() {\n public void onFailure(Throwable caught) {\n // Fail the test if too many attempts have taken place.\n if (attempt > 20) {\n fail();\n }\n \n int token = getToken();\n log(\"onFailure: attempt = \" + attempt + \", token = \" + token\n + \", caught = \" + caught);\n new Timer() {\n @Override\n public void run() {\n runAsync1(attempt + 1);\n }\n }.schedule(100);\n }\n\n public void onSuccess() {\n int token = getToken();\n log(\"onSuccess: attempt = \" + attempt + \", token = \" + token);\n finishTest();\n }\n });\n }", "@Override\n public synchronized void start()\n {\n if (run)\n return;\n run = true;\n super.start();\n }", "@Override\n protected void invokeTestRunnable(final Runnable runnable) throws Exception {\n System.out.println(\"Invoke: \" + runnable);\n runnable.run();\n }", "public void runBlocking() {\n if (!this.stopAction.isDone()) {\n this.tryPerformBeforeAction();\n this.tryCreateTaskAssignment();\n this.startLoadGeneration();\n }\n this.stopAction.join();\n this.stopLoadGeneration();\n this.stopFinished.complete(null);\n }", "private void runTest(final Node me) {\n if (!initialized) {\n initStressTest();\n }\n\n List<Row> runs = engine.getSqlTemplate().query(selectControlSql);\n\n for (Row run : runs) {\n int runId = run.getInt(\"RUN_ID\");\n int payloadColumns = run.getInt(\"PAYLOAD_COLUMNS\");\n int initialSeedSize = run.getInt(\"INITIAL_SEED_SIZE\");\n long duration = run.getLong(\"DURATION_MINUTES\");\n\n String status = engine.getSqlTemplate().queryForString(selectStatusSql, runId, me.getNodeId());\n\n if (isMasterNode(me) && StringUtils.isBlank(status)) {\n initStressTestRowOutgoing(payloadColumns, runId, initialSeedSize);\n initStressTestRowIncoming(payloadColumns);\n long commitRows = run.getLong(\"SERVER_COMMIT_ROWS\");\n long sleepMs = run.getLong(\"SERVER_COMMIT_SLEEP_MS\");\n\n engine.getSqlTemplate().update(insertStatusSql, runId, me.getNodeId(), \"RUNNING\");\n for (Node client : engine.getNodeService().findTargetNodesFor(NodeGroupLinkAction.W)) {\n engine.getSqlTemplate().update(insertStatusSql, runId, client.getNodeId(), \"RUNNING\");\n }\n\n fillOutgoing(runId, duration, commitRows, sleepMs, payloadColumns);\n\n engine.getSqlTemplate().update(updateStatusSql, \"COMPLETE\", runId, me.getNodeId());\n\n } else if (!isMasterNode(me) && !StringUtils.isBlank(status) && status.equals(\"RUNNING\")) {\n long commitRows = run.getLong(\"CLIENT_COMMIT_ROWS\");\n long sleepMs = run.getLong(\"CLIENT_COMMIT_SLEEP_MS\");\n\n fillIncoming(runId, duration, commitRows, sleepMs, payloadColumns);\n\n engine.getSqlTemplate().update(updateStatusSql, \"COMPLETE\", runId, me.getNodeId());\n }\n }\n }", "public static void run() {\n }", "public void testOneRunJudged() throws IOException, ClassNotFoundException, FileSecurityException, RunUnavailableException {\n\n InternalContest contest = new InternalContest();\n \n initContestData(contest);\n \n createJudgedRun(contest, 2, false);\n\n checkOutputXML(contest);\n \n }", "public void run() {\n try {\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n LOG.error(\"Submit: {} - run {}/{}\", topologies.get(jobIndex).name, ((jobCounter - 1) % runs) + 1, runs);\n client.submitTopology(topologies.get(jobIndex), null);\n }", "protected void runBeforeIterations() {}", "public void _run() {\n String[] args = (String[])tEnv.getObjRelation(\"ARGS\");\n\n log.println(\"Running with arguments:\");\n for (int i=0; i< args.length; i++)\n log.println(\"#\" + i + \": \" + args[i]);\n\n oObj.run(args);\n\n tRes.tested(\"run()\", true);\n }", "@Test\n public void restartSystemTest() {\n //Setup\n launcher.launch();\n Game game = launcher.getGame();\n game.start();\n game.stop();\n assertThat(game.isInProgress()).isFalse();\n\n //Execute\n game.start();\n\n //Assert\n assertThat(game.isInProgress()).isTrue();\n }", "public void run() {\n block5 : {\n if (this.testMethod.isIgnored()) {\n this.notifier.fireTestIgnored(this.description);\n return;\n }\n this.notifier.fireTestStarted(this.description);\n try {\n long timeout = this.testMethod.getTimeout();\n if (timeout > 0) {\n this.runWithTimeout(timeout);\n break block5;\n }\n this.runTest();\n }\n finally {\n this.notifier.fireTestFinished(this.description);\n }\n }\n }", "@Override\n protected void executeTest() {\n ClientConnection<Event> harry = register(0, \"Harry\", this.monstertype, \"Active\", 1, 0);\n ClientConnection<Event> statist23 = register(1, \"Statist23\", CreatureType.KOBOLD, \"Passive\", 0, 0);\n\n assertRegisterEvent(harry.nextEvent(), 1, \"Statist23\", CreatureType.KOBOLD, \"Passive\", 0, 0);\n assertRegisterEvent(statist23.nextEvent(), 0, \"Harry\", this.monstertype, \"Active\", 1, 0);\n\n // round 1 begins\n assertRoundBegin(assertAndMerge(harry, statist23), 1);\n\n for (int i = 0; i < this.stepsBeforeTurn; i++) {\n assertActNow(assertAndMerge(harry, statist23), 0);\n harry.sendMove(Direction.EAST);\n assertMoved(assertAndMerge(harry, statist23), 0, Direction.EAST);\n }\n assertActNow(assertAndMerge(harry, statist23), 0);\n harry.sendMove(this.lastDirection);\n assertKicked(assertAndMerge(harry, statist23), 0);\n\n assertActNow(assertAndMerge(harry, statist23), 1);\n statist23.sendDoneActing();\n assertDoneActing(assertAndMerge(harry, statist23), 1);\n\n assertRoundEnd(assertAndMerge(harry, statist23), 1, 0);\n assertWinner(assertAndMerge(harry, statist23), \"Passive\");\n }", "@Override\n public Result call() throws TimeoutException, InterruptedException {\n Request request;\n if (testIsolation) {\n request = Request.method(test.reloadClass(), test.getName());\n } else {\n request = Request.method(test.getTestClass(), test.getName());\n }\n return new JUnitCore().run(request);\n }", "@Test\n public void testInterruption_StartingRunStopped_eventually()\n throws DefensicsRequestException, IOException, InterruptedException {\n final FuzzJobRunner fuzzJobRunner = createFuzzJobRunnerWithMockServices();\n setupMocks();\n\n final AtomicReference<RunState> runState = new AtomicReference<>(RunState.STARTING);\n\n when(suiteInstance.getState()).thenAnswer(invocation -> runState.get());\n\n // Make run state changes happen during stopRun calls.\n doAnswer(invocation -> {\n if (runState.get().equals(RunState.STARTING)) {\n // Starting run gets 409, but let's move run state internally to running.\n // NOTE: These nested exceptions are bit cumbersome here.\n runState.set(RunState.RUNNING);\n throw new DefensicsRequestException(\n \"Plugin exception\",\n new DefensicsClientException(\"409 Conflict API client exception\")\n );\n }\n\n // Second stop for RUNNING run should succeed\n if (runState.get().equals(RunState.RUNNING)) {\n runState.set(RunState.COMPLETED);\n }\n return null;\n }).when(apiService).stopRun(RUN_ID);\n\n // Cause job interrupt in 5th poll\n final AtomicInteger counter = new AtomicInteger();\n when(defensicsRun.getState()).thenAnswer((Answer<?>) invocation -> {\n if (counter.incrementAndGet() == 5) {\n throw new InterruptedException(\"Job interrupted\");\n }\n return runState.get();\n });\n\n Assert.assertThrows(\n AbortException.class,\n () -> fuzzJobRunner.run(\n jenkinsRun,\n workspace,\n launcher,\n logger,\n testplan,\n \"\",\n instanceConfiguration,\n saveResultPackage\n )\n );\n\n // STARTING state gets 409, RUNNING state gets 200\n verify(apiService, times(2)).stopRun(RUN_ID);\n verify(jenkinsRun).setResult(Result.ABORTED);\n }", "public synchronized void start() {\n\t\tstartSuspended();\r\n\t\tsetRunnable(true);\r\n\t}", "protected void runTest() {\n\t\trunTest(getIterations());\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tfor(int i=0; i<5; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1000);\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}\n\t\t\t\tstateTest.open();}\n\t\t\t}", "public void run() {\n\t\tthis.launch( null );\n\t}", "public void testOneRunUnjudged() throws IOException, ClassNotFoundException, FileSecurityException {\n\n InternalContest contest = new InternalContest();\n \n initContestData(contest);\n Run run = getARun(contest);\n // Directory where test data is\n// String testDir = \"testdata\";\n// String projectPath=JUnitUtilities.locate(testDir);\n// if (projectPath == null) {\n// throw new IOException(\"Unable to locate \"+testDir);\n// }\n\n RunFiles runFiles = new RunFiles(run, loadData.getAbsolutePath());\n \n contest.addRun(run, runFiles, null);\n \n checkOutputXML(contest);\n }", "public void testRun() {\n\t\tsolo.waitForActivity(\"StartActivity\", 2000);\n //Wait for activity: 'com.bitdubai.android_core.app.DesktopActivity'\n\t\tassertTrue(\"DesktopActivity is not found!\", solo.waitForActivity(\"DesktopActivity\"));\n //Set default small timeout to 66809 milliseconds\n\t\tTimeout.setSmallTimeout(66809);\n //Click on Next\n\t\tsolo.clickOnView(solo.getView(\"btn_got_it\"));\n //Click on Next\n\t\tsolo.clickOnView(solo.getView(\"btn_got_it\"));\n //Click on Next\n\t\tsolo.clickOnView(solo.getView(\"btn_got_it\"));\n //Click on Next\n\t\tsolo.clickOnView(solo.getView(\"btn_got_it\"));\n //Click on Got it\n\t\tsolo.clickOnView(solo.getView(\"btn_got_it\"));\n //Wait for activity: 'com.bitdubai.android_core.app.DesktopActivity'\n\t\tassertTrue(\"DesktopActivity is not found!\", solo.waitForActivity(\"DesktopActivity\"));\n //Click on ImageView\n\t\tsolo.clickOnView(solo.getView(\"image_view\", 26));\n //Wait for activity: 'com.bitdubai.android_core.app.DesktopActivity'\n\t\tassertTrue(\"DesktopActivity is not found!\", solo.waitForActivity(\"DesktopActivity\"));\n //Click on LinearLayout\n\t\tsolo.clickInRecyclerView(3, 0);\n //Wait for activity: 'com.bitdubai.android_core.app.AppActivity'\n\t\tassertTrue(\"AppActivity is not found!\", solo.waitForActivity(\"AppActivity\"));\n //Wait for dialog\n //Click on Be John Doe\n\t\ttry {\n\t\t\t//assertTrue(\"DesktopActivity is not found!\", solo.waitForDialogToOpen(5000));\n\t\t\tsolo.clickOnView(solo.getView(\"btn_left\"));\n\t\t}catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\ttry {\n\t\t\tsolo.wait(2000);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//Click on ImageView\n\t\tsolo.clickOnView(solo.getView(android.widget.ImageButton.class, 0));\n\t}", "@Test\n public void testRun_mocksWork() throws Exception {\n final FuzzJobRunner fuzzJobRunner = createFuzzJobRunnerWithMockServices();\n setupMocks();\n\n when(suiteInstance.getState()).thenReturn(RunState.LOADED);\n when(defensicsRun.getState()).thenReturn(RunState.COMPLETED);\n when(defensicsRun.getVerdict()).thenReturn(RunVerdict.PASS);\n\n fuzzJobRunner.run(\n jenkinsRun,\n workspace,\n launcher,\n logger,\n testplan,\n \"\",\n instanceConfiguration,\n saveResultPackage\n );\n\n verify(jenkinsRun).setResult(Result.SUCCESS);\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tfor(int i=0; i<5; i++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tstateTest.open();}\n\t\t\t}", "@Before\n public void setUp() {\n spanStore = new BlockingToAsyncSpanStoreAdapter(delegate, new Executor() {\n @Override public void execute(Runnable command) {\n command.run();\n }\n });\n }", "public void run () { run (true); }", "static void test3() {\n\n System.out.println( \"Begin test3. ===============================\\n\" );\n\n Thread init = Thread.currentThread(); // init spawns the Mogwais\n\n System.out.println( \"TODO: write another, more involved test here.\" );\n System.out.println( \"\\n=============================== End test3.\" );\n }", "@Override\n public void run()\n {\n final long expectedTimeBetweenCalls = TimeUnit.SECONDS.toMillis(1) / MAX_EXPECTED_EXECUTIONS_PER_SECOND;\n\n // Calculate the next call time, the first time should be immediate\n long nextCallTime = System.currentTimeMillis();\n\n // Execute the operation the required number of times\n for(int i = 0; i < NUM_EXECUTIONS; i++)\n {\n // Wait until the next call must be sent\n while(System.currentTimeMillis() < nextCallTime);\n\n // TODO Compute latency for each operation in milliseconds\n\n // Execute the operation, it will sleep for 10 milliseconds\n syncOpSimulator.executeOp();\n\n // TODO Record latency into histogram\n\n // TODO Compute accumulated latency and record it\n\n // Calculate the next time to call execute op\n nextCallTime += expectedTimeBetweenCalls;\n }\n\n finished = true;\n }", "public void start() throws ADBServerNeedRestartException {\n mStatus = STATUS.STARTED;\n mSessionLog.setStartTime(System.currentTimeMillis());\n mTestThread = new TestSessionThread(this);\n \n CUIOutputStream.println(\"start test plan \" + getSessionLog().getTestPlanName());\n startImpl();\n }", "public void run() {\n\t\t\tconsole.run();\n\t\t}", "public void setUp() {\n threadName = Thread.currentThread().getName();\n }", "protected void internalRun() {\n work();\n }", "public void begin() {\n /** (Re)initialize the CountDownLatch. */\n mExitBarrier = new CountDownLatch(NUMBER_OF_THREADS);\n }", "public final void run() {\n\t\ttask();\n\t\t_nextTaskHasRan = true;\n\t}", "@Override\n protected void initiateStream() {\n // Execute the test by calling its processStream() entry point\n // and recording how long it takes to run.\n List<List<SearchResults>> results = RunTimer\n .timeRun(this::processStream, TAG);\n\n // Print the results of the test.\n printResults(TAG, results);\n }", "public void testRun() throws Exception {\r\n SeleniumTestBase mySeleniumTestBase = new SeleniumTestBase(selenium);\r\n mySeleniumTestBase.loginToUI(\"admin\", \"admin\");\r\n }", "public void init() {\n Thread run = new Thread(new Run());\n run.start();\n }", "public static void run(){}", "public void run() {\n \ttry { \n \t\tsynchronized (this) {\n\t\t\t\tfor (NegotiationEventListener list: tournamentExecutor.getNegotiationEventListeners()) {\n\t\t\t\t\tsession.addNegotiationEventListener(list);\n\t\t\t\t}\n\n\t\t\t\t// Start the negotiations\n\t\t\t\tsession.setTournamentRunner(this);\n\t\t\t\tsession.startSession(); // note, we can do this because TournamentRunner has no relation with AWT or Swing.\n\t\t\t\t\n\t\t\t\t// Wait for the negotiations to finish (until the session sends a notify)\n\t\t\t\twait();\n\t\t\t\t\n\t\t\t\t// Write the log\n\t\t\t\ttournamentExecutor.writeSessionLog(session.getLog());\n \t\t}\n \t} catch (Exception e) {\n \t\tnew Warning(\"Fatal error in TournamentRunner:\" + e);\n \t\te.printStackTrace(); \n \t}\n }", "public void prePerform() {\n // nothing to do by default\n }", "@Test\r\n\tpublic void testRunAllSucceedSecond() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(null);\r\n\t\tString token = \"someToken\";\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS)).thenReturn(token);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\tverify(call).call();\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).releaseLock(semaphoreKey + \"-0\", token);\r\n\t\tverify(mockSemaphoreDao, never()).releaseLock(eq(semaphoreKey + \"-1\"), anyString());\r\n\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t}", "public final void run() {\r\n }", "public TestInvoker()\n {\n super(new TestClient(), new ThreadPoolExecutorImpl(3));\n }", "public static void runUsual() throws Exception {\r\n\t\ttestRun(0);\r\n\t}", "public void run() {\n\n long now = System.currentTimeMillis();\n //System.out.println(\"1: \" + this.getClass().getName() + \"#\" + id + \", \" + (System.currentTimeMillis()) + \" ms\");\n try {\n\n test.setUp();\n this.testReport = new TestReport(id, this.getClass().getName());\n while (alive.get()) {\n test.test(this.id);\n counter.incrementAndGet();\n }\n //long stop = System.currentTimeMillis();\n //System.out.println(\"2: \" + this.getClass().getName() + \"#\" + id + \", \" + stop + \" \" + (stop - now) + \" ms\");\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n test.tearDown();\n this.testReport.stopTimers();\n //testReport.printInfo();\n } catch (Exception e) {\n // ignore errors in tearDown for now\n }\n }\n\n }", "@Test\n public void testPerformTask1() throws Exception {\n EnableStreamingTaskRunner runner =\n createRunner(createMockS3StorageProviderV2(false),\n createMockS3ClientV3(),\n createMockCFServiceV3());\n\n try {\n runner.performTask(null);\n fail(\"Exception expected\");\n } catch(Exception expected) {\n assertNotNull(expected);\n }\n\n String results = runner.performTask(spaceId);\n assertNotNull(results);\n testResults(results);\n testCapturedProps();\n }", "@Override\n\tpublic void run() {\n\t\tLog.i(tag, \"run\");\n\t}", "@Override\n public void run()\n {\n if(_Running.compareAndSet(IDLE, RUNNING)) {\n _SequenceBarrier.clearAlert();\n\n try {\n if(_Running.get() == RUNNING) {\n processEvents();\n }\n }\n finally {\n _Running.set(IDLE);\n }\n }\n else {\n // This is a little bit of guess work. The running state could of changed to HALTED by\n // this point. However, Java does not have compareAndExchange which is the only way\n // to get it exactly correct.\n if(_Running.get() == RUNNING) {\n throw new IllegalStateException(\"Thread is already running\");\n }\n else {\n halt();\n }\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (!terminateThread.get()) {\n\t\t\t\t\tComponentLogger.getInstance().log(LogMessageType.LOAD_BALANCER_PROMPTED_RE_ELECTION);\n\t\t\t\t\tSystem.out.println(\"Prompting for a re-election\");\n\t\t\t\t\tinitiatePreElection();\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic void run() {\n\t\tSystem.err.println(\"Test:\"+Thread.currentThread());\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n public void run()\n {\n if(!updateWorldState())\n {\n // request spawning player unit\n this.clientUnit = spawn();\n // get worldstates until it contains client unit so we can take actions\n while(!updateWorldState())\n {\n sleep(1000);\n }\n }\n // otherwise enter action loop\n while(true)\n {\n sleep(1000);\n\n if(!updateWorldState())\n {\n LOGGER.info(String.format(\"[%s, %s]: worldState did not contain player unit, should not happen\", clientId, currentWorldState.getWorldStateClock()));\n throw new RuntimeException(\"Worldstate did not contain player unit. should not happen\");\n }\n\n if(!currentWorldState.anyDragonsLeft())\n {\n LOGGER.info(String.format(\"[%s, %s]: all dragons are dead, players win\", clientId, currentWorldState.getWorldStateClock()));\n return;\n }\n\n if (clientUnit.isDead())\n {\n LOGGER.info(String.format(\"[%s, %s]: player died\", clientId, currentWorldState.getWorldStateClock()));\n return;\n }\n\n performAction();\n }\n }", "public void run(TestResult result) {\n result.run(this);\n }", "public void run() {\n\t\ttry {\n\t\t\tif (!connect()){\n\t\t\t\tSystem.err.println(\"Mongo Thread: \"+threadnumber+\" NOT connected\");\n\t\t\t\tPerformance.console.append(\"Mongo Thread: \"+threadnumber+\" NOT connected\\n\");\n\t\t\t\tPerformance.error=true;\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Mongo Thread: \"+threadnumber+\" connected\");\n\t\t\n\t\t\t}\t\t\t\n\t\n\t\t\t//wait for others to connect and generate optional data for testcases.\n\t\t\tif (Performance.EXTERNAL_CONNECTION)\n\t\t\t\tPerformance.threadconnectionbarrierextern.waitForOthers();\n\t\t\telse\n\t\t\t\tPerformance.threadconnectionbarrier.waitForOthers();\t\t\n\t\t\t\t\n\t\t\tPerformance.threadstartbarrierM.waitForOthers(this);\n\t\t\t\n\t\t\tif (!Thread.interrupted()){\n\t\t\t\ttest(testcase);\n\t\t\t\t//wait for other threads to finish\t\n\t\t\t\tif (Performance.EXTERNAL_CONNECTION)\n\t\t\t\t\tPerformance.threadbarrierextern.waitForOthers(this);\n\t\t\t\telse\n\t\t\t\t\tPerformance.threadbarrier.waitForOthers(this);\t\t\n\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t}", "public void execute() {\n setExecuted(true);\n }", "public synchronized void runPreTurtles() {\n\t\tcomputePerceptions();\n\t\tfirePreAgentScheduling();\n\t}", "@Test\n\tpublic void testExecute_fixture_1()\n\t\tthrows Exception {\n\t\tSessionListMsg fixture2 = getFixture();\n\t\tBomberClient bomberClient = BomberClient.getInstance();\n\n\t\tfixture2.execute(bomberClient);\n\n\t\t// add additional test code here\n\t\t// An unexpected exception was thrown in user code while executing this test:\n\t\t// java.lang.ExceptionInInitializerError\n\t\t// at org.apache.log4j.Logger.getLogger(Logger.java:116)\n\t\t// at client.BomberClient.<clinit>(BomberClient.java:36)\n\t}", "public void runBare() throws Throwable {\n Throwable exception= null;\n setUp();\n try {\n runTest();\n } catch (Throwable running) {\n exception= running;\n }\n finally {\n try {\n tearDown();\n } catch (Throwable tearingDown) {\n if (exception == null) exception= tearingDown;\n }\n }\n if (exception != null) throw exception;\n }", "public void train(){\n recoApp.training(idsToTest);\n }", "@Test(groups = {\"rest-commands\"}, dependsOnMethods = {\"createStandaloneInstanceTest\"})\n public void startInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandStartInstance(STANDALONE_INSTANCE);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n //assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandStartInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandStartInstance command execution failed: \" + gfie.getMessage());\n }\n }" ]
[ "0.6076415", "0.5769209", "0.5764942", "0.5711463", "0.5617213", "0.5612596", "0.5611348", "0.56019545", "0.5596851", "0.5596226", "0.5493233", "0.54726726", "0.54686177", "0.5463234", "0.542131", "0.54210144", "0.54203707", "0.5415503", "0.5414003", "0.5409013", "0.54056823", "0.53889495", "0.5388584", "0.53844625", "0.5368377", "0.5368052", "0.5330798", "0.5328099", "0.5322631", "0.53181636", "0.53160983", "0.53136563", "0.5306902", "0.53020984", "0.52910423", "0.52898735", "0.5285849", "0.52841324", "0.5281873", "0.52799827", "0.5279386", "0.5271419", "0.5248465", "0.5242174", "0.5223999", "0.5219426", "0.5218756", "0.5212716", "0.52064794", "0.5190176", "0.51893646", "0.5179044", "0.51739866", "0.5170844", "0.5169091", "0.516879", "0.5166509", "0.51647305", "0.51627487", "0.5160031", "0.51559645", "0.5151135", "0.5147562", "0.5147397", "0.51245457", "0.5117791", "0.51139826", "0.511215", "0.5106532", "0.51002634", "0.5100047", "0.5086152", "0.5081419", "0.50728", "0.5072405", "0.50682354", "0.50644416", "0.50640863", "0.5052038", "0.5046656", "0.5044876", "0.5042766", "0.504244", "0.50407", "0.5037893", "0.5036709", "0.50343144", "0.503243", "0.5030951", "0.5030724", "0.50271255", "0.50224334", "0.502006", "0.5017361", "0.50154394", "0.50150883", "0.50130147", "0.5011535", "0.5010099", "0.50046515", "0.49983412" ]
0.0
-1
This TaskRepository is an interface which extends JpaRepository and performs CRUD operation.
@Repository public interface TaskRepository extends JpaRepository<Task, Long> { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface TaskReporitory extends JpaRepository<Task, Integer>, JpaSpecificationExecutor<Task>, CrudRepository<Task, Integer> {\n}", "@Repository\npublic interface TaskRepository extends JpaRepository<Tasks,Integer>\n{\n Tasks findByUid(int uid);\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface InternshipTaskRepository extends JpaRepository<InternshipTask, Long> {\n\n /**\n * 根据实习表 ID 查询实习任务\n * @param interId\n * @return\n */\n List<InternshipTask> findByInterIdId(Long interId);\n\n}", "@SuppressWarnings(\"unused\")\npublic interface TaskRepository extends JpaRepository<Task,Long>, QueryDslPredicateExecutor<Task> {\n\n Task findByName(String name);\n}", "public interface TaskListRepository extends JpaRepository<TaskList, Long> {\n TaskList findByUserName(String userName);\n}", "@Repository\npublic interface RepositoryOrgTaskTracker extends JpaRepository<OrgTaskTracker, Integer>{\n}", "@Repository\npublic interface TaskRepository extends JpaRepository<TTaskEntity, Integer> {\n @Modifying\n @Transactional\n @Query(\"update TTaskEntity task set \" +\n \"task.title=:title, \" +\n \"task.info=:info,\" +\n \"task.linkUrl=:linkUrl,\" +\n \"task.iconUrl=:iconUrl,\" +\n \"task.bannerUrl=:bannerUrl,\"+\n \"task.bannerTitle=:bannerTitle,\"+\n \"task.bannerLinkUrl=:bannerLinkUrl \"+\n \"where task.id=:id\")\n public void updateTask(@Param(\"title\") String title, @Param(\"info\") String info,\n @Param(\"linkUrl\") String linkUrl, @Param(\"iconUrl\") String iconUrl,\n @Param(\"bannerUrl\") String bannerUrl, @Param(\"bannerTitle\") String bannerTitle,\n @Param(\"bannerLinkUrl\") String bannerLinkUrl,\n @Param(\"id\") Integer id);\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificationExecutor<Task> {\n Optional<Task> findByName(String name);\n}", "public interface TaskRepository extends CrudRepository<Tasks,Long> {\n @Query(\"select t from Tasks t where t.status=:status\")\n List<Tasks> getTasksforStatus(@Param(\"status\") Status status);\n}", "@Repository\npublic interface ProjectGenerationTaskRepository extends JpaRepository<ProjectGenerationTask, String> {\n\tList<ProjectGenerationTask> findAllByStorageLocation(String storageLocation);\n}", "public interface TaskRepository extends JpaRepository<Task, Long> {\n public Task findBySymbol(String symbol);\n}", "@RestResource(path=\"task\")\npublic interface TaskRepository extends CrudRepository<Task,Integer> {\n}", "public interface TaskRepository extends MongoRepository<Task, String> {\n\n List<Task> findByBoardIdAndStatusNot(String boardId, TaskStatus taskStatus);\n\n List<Task> findByStatus(TaskStatus taskStatus);\n}", "@Transactional\npublic interface ProjectStageMovementRepository extends JpaRepository<ProjectStageMovement, Long> {\n}", "public interface TecnicaRepository extends CrudRepository<Tecnica, Long>\n{\n List<Tecnica> findAll();\n\n Tecnica save(Tecnica tecnica);\n\n void delete(Tecnica tecnica);\n\n void removeById(long Id);\n\n Tecnica findTecnicaById(long Id);\n}", "public interface RunnerRepository extends JpaRepository<Runner,Long> {\n}", "@Dao\npublic interface TaskDao {\n\n @Query(\"Select * from Task\")\n List<Task> getAll();\n\n @Query(\"Select * from Task where id = :taskId \")\n Task findById(String taskId);\n\n @Insert(onConflict = OnConflictStrategy.REPLACE)\n void addTask(Task task);\n\n @Update(onConflict = OnConflictStrategy.REPLACE)\n void updateTask(Task task);\n\n @Delete\n void delete(Task byId);\n}", "public interface CmTaskRepository extends PagingAndSortingRepository<CmTask, Integer> {\n // Page<CmTask> findByDeletedFalse(Pageable pageable);\n Page<CmTask> findAll(Pageable pageable);\n}", "@Transactional\npublic interface ModuloRepository extends JpaRepository<Modulo,Long>{\n\n}", "@Transactional\npublic interface ProjectStageActionMovementRepository extends JpaRepository<ProjectStageActionMovement,Long> {\n}", "public interface TPUserRepository extends JpaRepository<TPUser, Long> {\n\n}", "@Repository\npublic interface TeacherRepository extends JpaRepository<Teacher, Long> {\n}", "public interface SchedulerWorkRepository extends JpaRepository<SchedulerWork, Integer> {\n\n SchedulerWork findByUserID(Integer userId);\n}", "public interface RecipeRepository extends CrudRepository<Recipe,Long> {\n}", "public interface TransactionRepository extends CrudRepository<Transaction, Integer> {\n}", "public interface RequirementRepository /*extends CrudRepository<Requirement, Long>*/ {\n}", "public interface TransactionRepository extends CrudRepository<Transaction> {\r\n\r\n}", "public interface PollRepository extends CrudRepository<Poll, Long> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface ProjectHistoryRepository extends JpaRepository<ProjectHistory, Long> {\n\n}", "public interface NoteRepository extends JpaRepository<Note, Integer> {\n\n}", "public interface BulkRequestItemDetailsRepository extends JpaRepository<BulkRequestItemEntity, Integer> {\n}", "@Transactional\npublic interface FoodRepository extends CrudRepository<Food, Long> {\n\n}", "@Repository\npublic interface IOrderRepository extends JpaRepository<Order, Long> {\n}", "@Repository\npublic interface QuestionRepository extends CrudRepository<Question, Long> {\n\n}", "@Repository\npublic interface PersonRepository extends JpaRepository<Person, Long> {\n}", "public interface CommentRepository extends JpaRepository<Comment, Long> {\n}", "public interface AssignmentRepository extends JpaRepository<Assignment, Integer>, JpaSpecificationExecutor<Assignment> {\n}", "public interface EmployeeRepository extends JpaRepository<Employee, Integer> {\r\n\r\n}", "public interface EmployeeRepository extends CrudRepository<Employee, Long>{\n}", "public interface TestCaseRepository extends JpaRepository<TestCase,Integer>{\n\n List<TestCase> getByProjectId(Integer projectId) ;\n\n}", "@Repository\npublic interface TransactionRepository extends JpaRepository<Transaction, Long>, JpaSpecificationExecutor<Transaction> {\n\n}", "public interface IEmployeeRepository extends JpaRepository<Employee,Integer> {\r\n\tEmployee findById(int id);\r\n\r\n\t\r\n\t\r\n\r\n}", "@Repository\n@Transactional\npublic interface JobDescRepository extends CrudRepository<JobDesc, String> {\n\n}", "@Repository\npublic interface MainItemOrderedRepository extends CrudRepository<MainItemOrdered, Long> {\n\n /**\n * Run query like Select * from...\n *\n * @return List of ordered main item\n */\n public List<MainItemOrdered> findAll();\n\n /**\n * Run query like insert into ...\n *\n * @param mainItemOrdered Main item ordered\n * @return Ordered main item saved\n */\n public MainItemOrdered save(MainItemOrdered mainItemOrdered);\n\n /**\n * Run query like Delete from ...\n *\n * @param mainItemOrdered Oredered main item to delete\n */\n public void delete(MainItemOrdered mainItemOrdered);\n}", "@Repository\npublic interface RoomRepository extends JpaRepository<Room, Long> {\n\n\n}", "@Repository\npublic interface QuestionnaireJpaRepository extends SimpleJpaBulkRepository<Questionnaire,Long> {\n\n}", "public interface RoomRepository extends JpaRepository<Room, Long> {\n}", "@Repository\npublic interface DBFileRepository extends JpaRepository<DBFile, Long> {\n\n}", "public interface AccountRepository extends JpaRepository<Account, Integer>{\n}", "@Repository\npublic interface ItemRepository extends JpaRepository<Item, Long>{\n\n}", "@Repository\npublic interface TeacherRepository extends JpaRepository<Teacher, Long> {\n Teacher findOneByUuid(String uuid);\n void deleteByUuid(String uuid);\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface TANoteRepository extends JpaRepository<TANote, Long> {\n\n}", "public interface TaskStorage {\n\n public long addTask(Task task);\n public int removeTask(long id);\n public List<Task> findAllTasks();\n public long numberOfTasks();\n}", "@Repository\npublic interface TicketRepository extends JpaRepository<Ticket, Long> {\n\n}", "@Dao\npublic interface TaskDao {\n /**\n * The name of the table tasks are stored in.\n */\n String TABLE = \"task\";\n\n /**\n * Queries the database for all of its Tasks and returns them in a LiveData object.\n *\n * @return a LiveData containing a List with all of the table's Tasks\n */\n @Query(\"SELECT * FROM \" + TABLE)\n LiveData<List<Task>> getAll();\n\n /**\n * Queries the database for all of its Tasks and returns them in a List, synchronously.\n * Should never be used in the UI, only in tests.\n *\n * @return a List containing all of the table's Tasks\n */\n @Query(\"SELECT * FROM \" + TABLE)\n List<Task> getAllSync();\n\n /**\n * Queries the database for a Task with id id.\n *\n * @param id the id to search for\n * @return a Task with id id or null if none was found\n */\n @Query(\"SELECT * FROM \" + TABLE + \" WHERE mId == :id\")\n @Nullable\n Task get(long id);\n\n /**\n * Inserts task into the database. Returns its id, which is automatically assigned\n * if it didn't already have one.\n *\n * @param task the task to insert into the database\n * @return the id of the task that has been inserted\n */\n @Insert\n long insert(Task task);\n\n /**\n * Inserts all of the tasks into the database.\n *\n * @param tasks the tasks to insert\n * @return an array containing the ids of the tasks that have been inserted\n */\n @Insert\n long[] insertAll(Task... tasks);\n\n /**\n * Deletes all of the Tasks passed in from the database.\n *\n * @param task the tasks to delete\n */\n @Delete\n void delete(Task... task);\n}", "public interface MeetingRepository extends JpaRepository<Meeting, Long> {\n}", "@Transactional\npublic interface StudentRepository extends JpaRepository<Student,Long> {\n}", "@Repository\npublic interface EmployeeRepository extends JpaRepository<Employee, Integer> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface TimetableRepository extends JpaRepository<Timetable, Long>, JpaSpecificationExecutor<Timetable> {\n\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface TemaRepository extends JpaRepository<Tema, Long> {\n\t\n \n}", "@Repository\npublic interface TipPercentRepository extends CrudRepository<TipPercent, Long>{\n}", "public interface PostRepository extends CrudRepository<Post, Long> {\n}", "@Repository\npublic interface ProductRepository extends JpaRepository<Product, Long> {\n\n}", "public interface AdditionRepository extends CrudRepository<Addition, String> {\r\n\r\n}", "@Repository\npublic interface OrderRepository extends JpaRepository<OrderS, String> {\n OrderS findOne(String order_id);\n List<OrderS> findAll();\n OrderS save(OrderS s);\n void deleteAll();\n}", "@Repository(\"emailLogRepository\")\npublic interface EmailLogRepository extends JpaRepository<EmailLogDB, Integer>{\n}", "@Repository\npublic interface TransactionCrudRepository extends CrudRepository<Transaction , Long> {\n\n public List<Transaction> findAll();\n public List<Transaction> findAllByUserId(Long userId);\n}", "public interface TodoRepository extends JpaRepository<Todo,Integer> {\n\t//Service.retrieveTodos(Name). we have to create this \n\tList<Todo> findByUser(String user);\n\t\n\t\n\t\n\t//jpaRepository include these service but not the name above \n\t//Service.deleteTodo(id)\n\t//Service.retrieveTodo(id)\n\t//Service.updateTodo(todo)\n\t//Sevice.addTodo()\n\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface ClassDurationRepository extends JpaRepository<ClassDuration, Long> {\n\n}", "public interface PersonRepository extends JpaRepository<Person, Long>, PersonRepositoryQuery {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface QuestionRepository extends JpaRepository<Question, Long> {\n\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface HorarioDisponivelRepository extends JpaRepository<HorarioDisponivel, Long> {\n\n}", "@Repository\npublic interface PersonaRepository extends JpaRepository<Persona, Integer> {\n \n}", "public interface PersonWashTaskService {\n\n int countTotal(PersonWashTask task);\n\n List<PersonWashTask> findByPage(ParamPage<PersonWashTask> page, PersonWashTask task);\n\n PersonWashTask findById(Integer id);\n\n int countTotalCheckDataByTask(Integer id, Integer clWorkStatus, Integer clReviewStatus);\n\n List<WaitCheckData> findByPageCheckDataByTask(ParamPage<WaitCheckData> page, Integer id, Integer clWorkStatus, Integer clReviewStatus);\n\n void insertOne(PersonWashTask task);\n\n void updateRandomCheckRate(Integer rate, Integer taskId);\n\n List<String> findTemporarySavedFields(Integer irSid);\n\n void saveTemporaryDatasForIntern(Integer irSid, List<String> slist);\n\n void deleteTemporaryDatasByCheckId(Integer irSid);\n\n void deleteTemporaryDatasByTaskId(Integer taskId);\n\n String countTheRateOfAlreadyValidated(Integer id);\n\n void updateCheckDataModifyStatusByTaskId(Integer taskId);\n\n int countTotalNotModifiedRecords(Integer taskId);\n\n void insertOrUpdateData2TargetTableByTaskId(Integer taskId);\n\n Map<String,Object> handTheGiveUpTaskDatasByTaskId(Integer taskId);\n\n void updateTaskWorkCountByTaskId(PersonWashTask task2);\n\n List<PersonWashTask> findAllTaskList();\n}", "public interface FormDataRepository extends CrudRepository<FormData, Integer> {}", "@Repository\r\npublic interface AssignmentRepository extends CrudRepository<Assignment, String> {\r\n\r\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface ShipmentActivityRepository extends JpaRepository<ShipmentActivity, Long> {}", "public interface EntityRepository<T extends GenericEntity, ID extends Serializable> {\n\n T findOne(ID id);\n\n List<T> findAll();\n\n T save(T entity);\n\n void delete(ID id);\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface SuspendedusersRepository extends JpaRepository<Suspendedusers, Long> {\n\n}", "public interface ReminderRepository {\n public void add(ReminderEntity reminderEntity);\n public void update(ReminderEntity reminderEntity);\n public ReminderEntity remove(Integer id);\n public ReminderEntity find(Integer id);\n public List<ReminderEntity> findAll();\n}", "interface ItemRepository extends JpaRepository<Item, Long> {\n\n}", "public interface LabelRepository extends JpaRepository<Label, String> {\n}", "@Repository\npublic interface ItemPedidoRepository extends JpaRepository<ItemPedido, Integer> {\n}", "public interface OrderRepository extends JpaRepository<Order, String> {\n}", "@Repository\n@Transactional\npublic interface EmployeeRepository extends CrudRepository<Employee, Long> {\n\n\tpublic List<Employee> findAll();\n}", "public interface IJpaRepository<T, ID extends Serializable> {\n\n public void persist(T entity);\n\n public void persist(Iterable<? extends T> entities);\n\n public <S extends T> S merge(S entity);\n\n public <S extends T> Iterable<S> merge(Iterable<S> entities);\n\n public List<T> findAll();\n\n public List<T> findAll(String entityName);\n\n public Page<T> findAll(PageRequest pageRequest);\n\n public Page<T> findAllByNamedQuery(String queryName,\n Map<String, Object> parameters,\n PageRequest pageRequest);\n\n public Optional<T> findOneByNamedQuery(String queryName,\n Map<String, Object> parameters);\n\n public Optional<T> findOne(ID id);\n\n public Page<T> findByQuery(HashMap<String, Object> parameters, PageRequest pageRequest);\n\n public Page<T> findByQuery(HashMap<String, Object> parameters, PageRequest pageRequest, String entityName);\n\n public Page<T> findByQuery(HashMap<String, Object> parameters, PageRequest pageRequest, String orderBy, String order);\n\n public Page<T> findByQuery(HashMap<String, Object> parameters, PageRequest pageRequest, String orderBy, String order, String entityName);\n\n public Optional<T> findOneByQuery(HashMap<String,Object> parameters);\n\n public Optional<T> findOneByQuery(HashMap<String,Object> parameters, String entityName);\n\n public void delete(T t);\n\n public void delete(Iterable<? extends T> entities);\n\n @Deprecated\n /**\n * Use entity manager instead.\n *\n * Will be removed in the 2.0 release\n */\n public void flushAndClear();\n\n\n}", "public interface AccountRepository extends JpaRepository<Account, String> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface TribunalRepository extends JpaRepository<Tribunal, Long> {\n\n}", "public interface ItemRepository extends CrudRepository<Item, Long> {\n}", "interface NetworkRepository extends JpaRepository<Network, Long> {\n\n}", "public interface asalariadoRepository\r\nextends Repository<Asalariado,Integer> {\r\n void save(Asalariado asalariado);\r\n List<Asalariado> findAll();\r\n}", "public interface SpringDataJpaOperatorStatusRepository extends OperatorStatusRepository, Repository<OperatorStatus, Integer> {\n}", "public interface FavoriteJourneyRepository extends JpaRepository<FavoriteJourney,Long> {\n}", "@Transactional\npublic interface RouteJPA extends JpaRepository<RouteEntity, String> {\n\n}", "@Repository\npublic interface IndianEmployeeRepository extends JpaRepository<IndianEmployees,Integer> {\n}", "@Repository\npublic interface PlayerRepository extends JpaRepository<Player, Long> {\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface DDbRepository extends JpaRepository<DDb, Long>, JpaSpecificationExecutor<DDb> {}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface WeatherDataRepository extends JpaRepository<WeatherData, Long> {\n\n}", "public interface ReservationRepository extends CrudRepository<Reservation, Integer> {\n\n}", "@Repository\npublic interface ReservationRepository extends CrudRepository<Reservation, Long> {\n}" ]
[ "0.76632136", "0.7599814", "0.72631", "0.71645725", "0.7143228", "0.70790637", "0.70158726", "0.6913936", "0.68940854", "0.68903774", "0.6876292", "0.6668174", "0.6597922", "0.6551299", "0.65326214", "0.64762163", "0.64700365", "0.64442366", "0.64359105", "0.6399892", "0.63471913", "0.6343767", "0.6339435", "0.6334951", "0.63067913", "0.6302034", "0.62998927", "0.6280763", "0.62768734", "0.6263731", "0.6263316", "0.62615156", "0.6260809", "0.62578595", "0.62487024", "0.62458813", "0.621783", "0.6204256", "0.61945844", "0.6187493", "0.6181047", "0.617677", "0.6172701", "0.6171037", "0.61676186", "0.6161961", "0.61609334", "0.61536694", "0.61531496", "0.61525625", "0.61517286", "0.6151249", "0.61405265", "0.613789", "0.61372596", "0.61364925", "0.61364365", "0.6128254", "0.6126135", "0.6122367", "0.6121995", "0.6115752", "0.61107445", "0.61090744", "0.61090577", "0.6108753", "0.61064124", "0.60971993", "0.6095716", "0.6091735", "0.60913163", "0.60857695", "0.6084924", "0.60807985", "0.6073632", "0.6073113", "0.607297", "0.6064225", "0.60636085", "0.6059849", "0.6054856", "0.6054467", "0.6052222", "0.60428643", "0.6038754", "0.6036461", "0.6035954", "0.60319245", "0.6023795", "0.60216016", "0.60152", "0.6012122", "0.6011834", "0.6009001", "0.6008721", "0.6005627", "0.6004328", "0.6003862", "0.60032517", "0.6001321" ]
0.81436247
0
Fills the deprecated OutputFormat interface for streaming.
@Deprecated public void checkOutputSpecs(org.apache.hadoop.fs.FileSystem filesystem, org.apache.hadoop.mapred.JobConf job) throws IOException { bulkOutputFormat.checkOutputSpecs(filesystem, job); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Format setOutputFormat(Format format)\n {\n Format outputFormat = super.setOutputFormat(format);\n \n if (logger.isDebugEnabled() && (outputFormat != null))\n logger.debug(\"SwScaler set to output in \" + outputFormat);\n return outputFormat;\n }", "void setOutputFormat(String outputFormat);", "public void setOutputFormat(OutputFormat format);", "public ClientLoader outputFormat(final String theOutputFormat) {\r\n this.outputFormat = checkNotNull(theOutputFormat,\r\n \"outputFormat is null\");\r\n return this;\r\n }", "protected OutputStream _createDataOutputWrapper(DataOutput out)\n/* */ {\n/* 1520 */ return new DataOutputAsStream(out);\n/* */ }", "@Override\n @Nullable\n public Format getOutputFormat() throws TransformationException {\n maybeDequeueOutputBuffer(/* setOutputBuffer= */ false);\n return outputFormat;\n }", "public Format setOutputFormat(Format output) {\n outputFormat = output;\n return output;\n }", "private native static int shout_set_format(long shoutInstancePtr, int format);", "public interface ObjectOutput extends DataOutput, AutoCloseable {\n /**\n * Write an object to the underlying storage or stream. The class that implements this interface\n * defines how the object is written.\n *\n * @param obj the object to be written\n * @exception IOException Any of the usual Input/Output related exceptions.\n */\n public void writeObject(Object obj) throws IOException;\n\n /**\n * Writes a byte. This method will block until the byte is actually written.\n * \n * @param b the byte\n * @exception IOException If an I/O error has occurred.\n */\n public void write(int b) throws IOException;\n\n /**\n * Writes an array of bytes. This method will block until the bytes are actually written.\n * \n * @param b the data to be written\n * @exception IOException If an I/O error has occurred.\n */\n public void write(byte b[]) throws IOException;\n\n /**\n * Writes a sub array of bytes.\n * \n * @param b the data to be written\n * @param off the start offset in the data\n * @param len the number of bytes that are written\n * @exception IOException If an I/O error has occurred.\n */\n public void write(byte b[], int off, int len) throws IOException;\n\n /**\n * Flushes the stream. This will write any buffered output bytes.\n * \n * @exception IOException If an I/O error has occurred.\n */\n public void flush() throws IOException;\n\n /**\n * Closes the stream. This method must be called to release any resources associated with the\n * stream.\n * \n * @exception IOException If an I/O error has occurred.\n */\n public void close() throws IOException;\n}", "@Override\n protected void doWriteTo(StreamOutput out) throws IOException {\n }", "@Deprecated\n/* */ public COSStream getStream() {\n/* 290 */ return this.stream;\n/* */ }", "public void setFormat(Connector connector, Format format);", "default void refreshStream() {}", "public abstract String getOutputFormat();", "public Format getOutputFormat() {\n return outputFormat;\n }", "public StructureParserOutputStream ()\n {\n this(new NullOutputStream());\n }", "public void streamOutput(String type,Object currentObj);", "@Override\r\n public OwFormat getFormat()\r\n {\n return null;\r\n }", "@SuppressWarnings({\"rawtypes\"})\n @Override\n public Class<? extends OutputFormat> getOutputFormatClass() {\n // Not yet implemented, but if we return null then the create\n // table statement will fail. Return a dummy implementation that'll\n // throw if ever actually used.\n return NotImplementedOutputFormat.class;\n }", "public void set_standard_format () {\n\t\tf_friendly_format = false;\n\n\t\tmainshock_time = 0L;\n\t\tmainshock_mag = 0.0;\n\t\tmainshock_lat = 0.0;\n\t\tmainshock_lon = 0.0;\n\t\tmainshock_depth = 0.0;\n\n\t\treturn;\n\t}", "@Override\n\t\tprotected void writeStreamHeader() throws IOException {\n\t\t}", "protected StreamPrintService(OutputStream out) {\n this.outStream = out;\n }", "@Override\n @Deprecated\n public void write(ObjectOutput output) throws IOException {\n EmulatedFields.ObjectSlot[] slots = emulatedFields.slots();\n for (int i = 0; i < slots.length; i++) {\n EmulatedFields.ObjectSlot slot = slots[i];\n Object fieldValue = slot.getFieldValue();\n Class<?> type = slot.getField().getType();\n // WARNING - default values exist for each primitive type\n if (type == Integer.TYPE) {\n output.writeInt(fieldValue != null ? ((Integer) fieldValue)\n .intValue() : 0);\n } else if (type == Byte.TYPE) {\n output.writeByte(fieldValue != null ? ((Byte) fieldValue)\n .byteValue() : (byte) 0);\n } else if (type == Character.TYPE) {\n output.writeChar(fieldValue != null ? ((Character) fieldValue)\n .charValue() : (char) 0);\n } else if (type == Short.TYPE) {\n output.writeShort(fieldValue != null ? ((Short) fieldValue)\n .shortValue() : (short) 0);\n } else if (type == Boolean.TYPE) {\n output.writeBoolean(fieldValue != null ? ((Boolean) fieldValue)\n .booleanValue() : false);\n } else if (type == Long.TYPE) {\n output.writeLong(fieldValue != null ? ((Long) fieldValue)\n .longValue() : (long) 0);\n } else if (type == Float.TYPE) {\n output.writeFloat(fieldValue != null ? ((Float) fieldValue)\n .floatValue() : (float) 0);\n } else if (type == Double.TYPE) {\n output.writeDouble(fieldValue != null ? ((Double) fieldValue)\n .doubleValue() : (double) 0);\n } else {\n // Either array or Object\n output.writeObject(fieldValue);\n }\n }\n }", "private Format()\n {\n super();\n }", "@Override\n protected void writeStreamHeader() throws IOException {\n reset();\n }", "public OutSupport() {\n super();\n }", "@Provides\r\n public DataOutput provideOutputWriter() {\r\n DataOutput out = null;\r\n final PrintWriter oWriter = outWriter;\r\n if ((oWriter != null) && (outputFormat != null)) {\r\n if (\"csv\".equalsIgnoreCase(outputFormat)) {\r\n out = new CSVDataOutput(oWriter);\r\n } else if (\"json\".equalsIgnoreCase(outputFormat)) {\r\n out = new JSONDataOutput(oWriter);\r\n } else\r\n throw new IllegalArgumentException(\"Output format \"\r\n + outputFormat + \" not supported.\"\r\n + \" Valid types are csv, json\");\r\n out.verboseOptions(verboseStream, verbose);\r\n }\r\n return out;\r\n }", "@Override\n\tpublic void write(OutStream outStream) {\n\t}", "public DefaultOutputWriter() {\n\t\tpublications = null;\n\t\tauthors = null;\n\t\ttopics = null;\n\t}", "public int toStream(OutputStream out,\n RDFFormat format) throws TrippiException {\n TupleWriter writer;\n if (format == RDFFormat.SPARQL) {\n writer = new SparqlTupleWriter(out, m_aliases); \n }else if(format == RDFFormat.SPARQL_W3C){\n \twriter = new SparqlW3CTupleWriter(out,m_aliases);\n } else if (format == RDFFormat.SIMPLE) {\n writer = new SimpleTupleWriter(out, m_aliases); \n } else if (format == RDFFormat.CSV) {\n writer = new CSVTupleWriter(out, m_aliases); \n } else if (format == RDFFormat.TSV) {\n writer = new TSVTupleWriter(out, m_aliases); \n } else if (format == RDFFormat.COUNT) {\n writer = new CountTupleWriter(out); \n } else if (format == RDFFormat.COUNT_JSON) {\n writer = new FormatCountTupleWriter(new JSONTupleWriter(out, m_aliases)); \n } else if (format == RDFFormat.COUNT_SPARQL) {\n writer = new FormatCountTupleWriter(new SparqlTupleWriter(out, m_aliases)); \n } else if (format == RDFFormat.JSON) {\n writer = new JSONTupleWriter(out, m_aliases); \n } else {\n throw new TrippiException(\"Unsupported output format: \" + format.getName());\n }\n return writer.write(this);\n }", "public DefaultFormat() {\n }", "String getOutputFormat();", "@Override\n public final boolean isStreaming() {\n return false;\n }", "private Output() {}", "public WstxOutputFactory() {\n mConfig = WriterConfig.createFullDefaults();\n }", "protected Format doSetFormat(Format format)\n {\n return null;\n }", "public PlaylistWriter(OutputStream outputStream, Format format, Encoding encoding) {\n this(outputStream, format, encoding, false);\n }", "public OutputFormatter( final Jetty jetty, PlatformIO io ) {\n\t\tsuper( jetty );\n\t\t_platform_io = io;\n\t}", "@Override\n protected void writeStreamHeader() throws IOException {\n // metodo honek ez du ezer egiten\n }", "void toXml(OutputStream out, boolean format) throws IOException;", "@Before\n public void changeOutStream() {\n PrintStream printStream = new PrintStream(outContent);\n System.setOut(printStream);\n }", "@Override\n public Format[] getSupportedOutputFormats(Format input)\n {\n if(input == null)\n return supportedOutputFormats;\n \n /* if size is set for element 0 (YUVFormat), it is also set \n * for element 1 (RGBFormat) and so on...\n */\n Dimension size = ((VideoFormat)supportedOutputFormats[0]).getSize();\n \n if(size != null)\n return supportedOutputFormats;\n \n /* no specified size set so return the same size as input\n * in output format supported\n */\n size = ((VideoFormat)input).getSize();\n \n return new Format[] { \n new YUVFormat(size, -1, Format.byteArray, -1.0f,\n YUVFormat.YUV_420, -1, -1, 0, -1, -1),\n new YUVFormat(size, -1, Format.intArray, -1.0f,\n YUVFormat.YUV_420, -1, -1, 0, -1, -1),\n new YUVFormat(size, -1, Format.shortArray, -1.0f,\n YUVFormat.YUV_420, -1, -1, 0, -1, -1),\n new RGBFormat(size, -1, Format.byteArray, -1.0f,\n 32, -1, -1, -1),\n new RGBFormat(size, -1, Format.intArray, -1.0f,\n 32, -1, -1, -1),\n new RGBFormat(size, -1, Format.shortArray, -1.0f,\n 32, -1, -1, -1),\n new RGBFormat(size, -1, Format.byteArray, -1.0f,\n 24, -1, -1, -1),\n new RGBFormat(size, -1, Format.intArray, -1.0f,\n 24, -1, -1, -1),\n new RGBFormat(size, -1, Format.shortArray, -1.0f,\n 24, -1, -1, -1),\n };\n }", "public abstract void writeToStream(java.io.DataOutputStream output) throws java.io.IOException;", "public void setMarshalDateFormat (String format) {\n\t\tthis.outFormat = format;\n }", "public interface Output {\n\n void putString(String string);\n\n // Basic Data Types\n /**\n * Write number\n *\n * @param num\n * Number\n */\n void writeNumber(Number num);\n\n /**\n * Write boolean\n *\n * @param bol\n * Boolean\n */\n void writeBoolean(Boolean bol);\n\n /**\n * Write string\n *\n * @param string\n * String\n */\n void writeString(String string);\n\n /**\n * Write date\n *\n * @param date\n * Date\n */\n void writeDate(Date date);\n\n void writeNull();\n\n /**\n * Write array.\n *\n * @param array\n * Array to write\n */\n void writeArray(Collection<?> array);\n\n /**\n * Write array.\n *\n * @param array\n * Array to write\n */\n void writeArray(Object[] array);\n\n /**\n * Write primitive array.\n *\n * @param array\n * Array to write\n */\n void writeArray(Object array);\n\n /**\n * Write map.\n *\n * @param map\n * Map to write\n */\n void writeMap(Map<Object, Object> map);\n\n /**\n * Write array as map.\n *\n * @param array\n * Array to write\n */\n void writeMap(Collection<?> array);\n\n /**\n * Write object.\n *\n * @param object\n * Object to write\n */\n void writeObject(Object object);\n\n /**\n * Write map as object.\n *\n * @param map\n * Map to write\n */\n void writeObject(Map<Object, Object> map);\n\n /**\n * Write recordset.\n *\n * @param recordset\n * Recordset to write\n */\n void writeRecordSet(RecordSet recordset);\n\n /**\n * Write XML object\n *\n * @param xml\n * XML document\n */\n void writeXML(Document xml);\n\n /**\n * Write ByteArray object (AMF3 only).\n *\n * @param array\n * object to write\n */\n void writeByteArray(ByteArray array);\n\n /**\n * Write a Vector&lt;int&gt;.\n *\n * @param vector\n * vector\n */\n void writeVectorInt(Vector<Integer> vector);\n\n /**\n * Write a Vector&lt;uint&gt;.\n *\n * @param vector\n * vector\n */\n void writeVectorUInt(Vector<Long> vector);\n\n /**\n * Write a Vector&lt;Number&gt;.\n *\n * @param vector\n * vector\n */\n void writeVectorNumber(Vector<Double> vector);\n\n /**\n * Write a Vector&lt;Object&gt;.\n *\n * @param vector\n * vector\n */\n void writeVectorObject(Vector<Object> vector);\n\n /**\n * Write reference to complex data type\n *\n * @param obj\n * Referenced object\n */\n void writeReference(Object obj);\n\n /**\n * Whether object is custom\n *\n * @param custom\n * Object\n * @return true if object is of user type, false otherwise\n */\n boolean isCustom(Object custom);\n\n /**\n * Write custom (user) object\n *\n * @param custom\n * Custom data type object\n */\n void writeCustom(Object custom);\n\n /**\n * Clear references\n */\n void clearReferences();\n}", "void write(StreamOption streamOpt);", "public BioFormatsFormat() {\n\t\tcacheReaderClasses();\n\t}", "public String getWriteFormatDescription(int formatIndex);", "public void setFormat(String format) {\r\n _format = format;\r\n }", "protected Format doGetFormat()\n {\n return null;\n }", "@Override\n public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {\n outputFieldsDeclarer.declareStream(METRONOME_H_STREAM_ID, new Fields(CREATE_DATE, CURRENT_TIMESTAMP));\n outputFieldsDeclarer.declareStream(METRONOME_D_STREAM_ID, new Fields(CREATE_DATE, CURRENT_TIMESTAMP));\n }", "Format internalSetFormat(Format format)\n {\n return doSetFormat(format);\n }", "GorgeousFormatter() {\r\n\t\t}", "@Deprecated\n/* */ public JsonGenerator createJsonGenerator(Writer out)\n/* */ throws IOException\n/* */ {\n/* 1234 */ return createGenerator(out);\n/* */ }", "default StreamBuffering getBuffering() {\n\t\treturn StreamBuffering.UNSUPPORTED;\n\t}", "public void declareOutputFields(OutputFieldsDeclarer declarer) {\n\t\t declarer.declareStream(\"qstream\", new Fields(\"qstream\"));\n\t}", "@Override\r\n\tpublic void setAudioFormat(AudioFormat format) {\r\n\r\n\t}", "private Formats() {\n }", "private interface OutputBuffer {\n String getName();\n\n String getOutput();\n\n PrintWriter getPrintWriter();\n }", "private void openOutputStream() {\n\t\tPrintStreamManagement.openOutputStream();\n\t}", "public void writeObject(OutputStream stream, Object object, int format) throws IOException;", "private Object writeReplace() throws ObjectStreamException {\n return INSTANCE;\n }", "@Deprecated\n/* */ public JsonGenerator createJsonGenerator(OutputStream out)\n/* */ throws IOException\n/* */ {\n/* 1247 */ return createGenerator(out, JsonEncoding.UTF8);\n/* */ }", "public void setSupportFormat(String supportFormat) {\r\n\t\tthis.supportFormat = supportFormat;\r\n\t}", "@Override\r\n public void enableStreamFlow() {\r\n SwitchStates.setEmitOrgEND(true);\r\n }", "@Override\n public IIOMetadata getStreamData() {\n return super.streamData;\n }", "@Deprecated\n public synchronized void splitOutputList() {\n logger.debug3(\"Splitting\");\n listStack.push(new ArrayList());\n }", "public void setFormat(String fmt)\n {\n format = fmt;\n }", "public void setOutputBufferFactory (OutputBufferFactory factory) {\n this.factory = factory;\n }", "@Override\r\n public void disableStreamFlow() {\r\n SwitchStates.setEmitOrgEND(false);\r\n }", "public int getWriteFormatCount();", "public DefOutputStream(OutputStream out) throws IOException {\n\t\t\tthis(out, 512);\n\t\t}", "private String determineStream() {\r\n\t\tif (stream == null) {\r\n\t\t\tCcLsstream lsstream = new CcLsstream();\r\n\t\t\tlsstream.setProject(getProject());\r\n\t\t\tlsstream.setFormat(FMT_EXTENED_NAME);\r\n\t\t\tlsstream.setViewTag(determineViewTag());\r\n\t\t\tlsstream.execute();\r\n\t\t\tstream = lsstream.getCommandOutput();\r\n\t\t\tlog(\"Using derived stream [\" + stream + \"]\", Project.MSG_VERBOSE);\r\n\t\t}\r\n\t\treturn stream;\r\n\t}", "public void setFormat(String format) {\n this.format = format;\n }", "public void setFormat(String format) {\n this.format = format;\n }", "public void setFormat(String format) {\n this.format = format;\n }", "private void ensureStreamVersion() throws UnsupportedOperationException {\n if (streamVersion != 1 && streamVersion != 3) {\n throw new UnsupportedOperationException(\"Unsupported stream version \" + streamVersion);\n }\n }", "public final void setFormat(AdFormat format) {\n\t\timpl.setFormat(format);\n }", "@Override\n\tprotected void write(ObjectOutput out) throws IOException {\n\t\t\n\t}", "default WorkdayEndpointConsumerBuilder format(String format) {\n doSetProperty(\"format\", format);\n return this;\n }", "@Override\n public String getFormatName() throws IOException {\n return input == null? myDefaultFormat.getName() : getInfo().getFormat().getName();\n }", "public StdOutWriter ()\n {\n super (System.out, true);\n }", "public interface StreamsMediator {\n /**\n * Allows the switching to another Stream.\n * @param streamKind The {@link StreamKind} of the stream to switch to.\n */\n default void switchToStreamKind(@StreamKind int streamKind) {}\n\n /**\n * Request the immediate refresh of the contents of the active stream.\n */\n default void refreshStream() {}\n\n /**\n * Disable the follow button, used in case of an error scenario.\n */\n default void disableFollowButton() {}\n }", "public void onEncodeSerialData(StreamWriter streamWriter) {\n }", "@Override\n public Format setInputFormat(Format format)\n {\n Format inputFormat\n = ((format instanceof VideoFormat)\n && (((VideoFormat) format).getSize() == null))\n ? null // size is required\n : super.setInputFormat(format);\n \n if (logger.isDebugEnabled() && (inputFormat != null))\n logger.debug(\"SwScaler set to input in \" + inputFormat);\n return inputFormat;\n }", "public void close() throws FormatException, IOException {\n if (in != null) in.close();\n in = null;\n currentId = null;\n }", "@Override\n public void flush() throws IOException {\n byteBufferStreamOutput.flush();\n }", "public LibraryUpdate(){\n\t\tthis(System.out, System.err);\n\t}", "public void setFormat(Format format) {\n this.format = format.getIndex();\n }", "public void turnOnSystemOutput(){\n if(originalSystemOut == null){\n originalSystemOut = System.out;\n System.setOut(new PrintStream(generalStream));\n //will cause CSS hang up\n// System.setIn(console.getInputStream());\n }\n }", "@Deprecated\n/* */ public JsonGenerator createJsonGenerator(OutputStream out, JsonEncoding enc)\n/* */ throws IOException\n/* */ {\n/* 1214 */ return createGenerator(out, enc);\n/* */ }", "public static void setTheirDefaultFormat(Format fmt)\n {\n theirDefaultFormat = (Format) fmt.clone();\n }", "protected abstract OutputStream getStream() throws IOException;", "public static Serializer getSerializer(Properties format) {\n/* */ Serializer serializer;\n/* */ \n/* 60 */ try { String method = format.getProperty(\"method\");\n/* */ \n/* 62 */ if (method == null) {\n/* 63 */ throw new IllegalArgumentException(\"The output format has a null method name\");\n/* */ }\n/* */ \n/* 66 */ String className = format.getProperty(\"{http://xml.apache.org/xalan}content-handler\");\n/* */ \n/* */ \n/* */ \n/* 70 */ if (null == className) {\n/* */ \n/* */ \n/* 73 */ Properties methodDefaults = OutputPropertiesFactory.getDefaultMethodProperties(method);\n/* */ \n/* 75 */ className = methodDefaults.getProperty(\"{http://xml.apache.org/xalan}content-handler\");\n/* */ \n/* 77 */ if (null == className) {\n/* 78 */ throw new IllegalArgumentException(\"The output format must have a '{http://xml.apache.org/xalan}content-handler' property!\");\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 85 */ ClassLoader loader = ObjectFactory.findClassLoader();\n/* */ \n/* 87 */ Class cls = ObjectFactory.findProviderClass(className, loader, true);\n/* */ \n/* */ \n/* */ \n/* 91 */ Object obj = cls.newInstance();\n/* */ \n/* 93 */ if (obj instanceof SerializationHandler)\n/* */ \n/* */ { \n/* 96 */ serializer = cls.newInstance();\n/* 97 */ serializer.setOutputFormat(format);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* 105 */ else if (obj instanceof ContentHandler)\n/* */ \n/* */ { \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 114 */ className = \"org.apache.xml.serializer.ToXMLSAXHandler\";\n/* 115 */ cls = ObjectFactory.findProviderClass(className, loader, true);\n/* 116 */ SerializationHandler sh = (SerializationHandler)cls.newInstance();\n/* */ \n/* 118 */ sh.setContentHandler((ContentHandler)obj);\n/* 119 */ sh.setOutputFormat(format);\n/* */ \n/* 121 */ serializer = sh;\n/* */ }\n/* */ \n/* */ else\n/* */ \n/* */ { \n/* 127 */ throw new Exception(XMLMessages.createXMLMessage(\"ER_SERIALIZER_NOT_CONTENTHANDLER\", new Object[] { className })); } } catch (Exception e)\n/* */ \n/* */ { \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 137 */ throw new WrappedRuntimeException(e); }\n/* */ \n/* */ \n/* */ \n/* 141 */ return serializer;\n/* */ }", "protected abstract void _write(DataOutput output) throws IOException;", "@Deprecated\n public void sync() throws IOException {\n hflush();\n }", "public void flushStreamSpecs();", "public DLListWithOutput()\n\t{\n\t\tsuper();\n\t}", "public final void setOutput(String sinkName, Object output) throws ConnectException,\n UnsupportedOperationException {\n if (output instanceof ContentHandler) {\n this.result = new SAXResult((ContentHandler) output);\n } else if (output instanceof WritableByteChannel) {\n this.result = new StreamResult(Channels.newOutputStream((WritableByteChannel) output));\n } else if (output instanceof OutputStream) {\n this.result = new StreamResult((OutputStream) output);\n } else if (output instanceof Writer) {\n this.result = new StreamResult((Writer) output);\n } else if (output instanceof File) {\n this.result = new StreamResult((File) output);\n } else if (output instanceof Node) {\n this.result = new DOMResult((Node) output);\n } else {\n throw new ConnectException(i18n.getString(\"unsupportedOutputType\", output.getClass(),\n XMLReaderFilter.class.getName()));\n }\n }", "public OutputStream setAsciiStream(long pos)\n\t{\n\t\tthrow new UnsupportedOperationException();\n\t}" ]
[ "0.6226483", "0.6170517", "0.61094975", "0.6037243", "0.60359126", "0.58539", "0.5682323", "0.56560874", "0.550008", "0.54714495", "0.546222", "0.53765637", "0.537317", "0.5362742", "0.5340911", "0.53400546", "0.5319866", "0.53146017", "0.53133917", "0.5295204", "0.52605665", "0.52604747", "0.52318114", "0.5203174", "0.5193402", "0.5178432", "0.5164671", "0.51490015", "0.514438", "0.51258594", "0.51126534", "0.51035446", "0.5101566", "0.5101021", "0.5079226", "0.50715697", "0.5052362", "0.50505155", "0.5035728", "0.502688", "0.5021935", "0.50168097", "0.4993798", "0.49865824", "0.4977528", "0.4968814", "0.49427223", "0.49279025", "0.49241206", "0.4923168", "0.4923059", "0.49201703", "0.49077526", "0.48999578", "0.48928872", "0.48911923", "0.4888269", "0.48853296", "0.48806345", "0.48680785", "0.48660436", "0.48360342", "0.482278", "0.48163238", "0.4810806", "0.48095128", "0.4790882", "0.47843483", "0.47773418", "0.47765112", "0.47597414", "0.47553486", "0.4754234", "0.4750474", "0.4750474", "0.4750474", "0.47435248", "0.4742508", "0.47405723", "0.474037", "0.473917", "0.47299308", "0.47257915", "0.4719297", "0.47168362", "0.470737", "0.47049853", "0.470343", "0.4702685", "0.47003326", "0.4698911", "0.46981913", "0.46967113", "0.46956336", "0.46943206", "0.46942168", "0.4688553", "0.46829858", "0.46811736", "0.4676951" ]
0.5036204
38
Fills the deprecated OutputFormat interface for streaming.
@Deprecated public CqlFlinkRecordWriter getRecordWriter(org.apache.hadoop.fs.FileSystem filesystem, org.apache.hadoop.mapred.JobConf job, String name, org.apache.hadoop.util.Progressable progress) throws IOException { return new CqlFlinkRecordWriter(job, progress); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Format setOutputFormat(Format format)\n {\n Format outputFormat = super.setOutputFormat(format);\n \n if (logger.isDebugEnabled() && (outputFormat != null))\n logger.debug(\"SwScaler set to output in \" + outputFormat);\n return outputFormat;\n }", "void setOutputFormat(String outputFormat);", "public void setOutputFormat(OutputFormat format);", "public ClientLoader outputFormat(final String theOutputFormat) {\r\n this.outputFormat = checkNotNull(theOutputFormat,\r\n \"outputFormat is null\");\r\n return this;\r\n }", "protected OutputStream _createDataOutputWrapper(DataOutput out)\n/* */ {\n/* 1520 */ return new DataOutputAsStream(out);\n/* */ }", "@Override\n @Nullable\n public Format getOutputFormat() throws TransformationException {\n maybeDequeueOutputBuffer(/* setOutputBuffer= */ false);\n return outputFormat;\n }", "public Format setOutputFormat(Format output) {\n outputFormat = output;\n return output;\n }", "private native static int shout_set_format(long shoutInstancePtr, int format);", "public interface ObjectOutput extends DataOutput, AutoCloseable {\n /**\n * Write an object to the underlying storage or stream. The class that implements this interface\n * defines how the object is written.\n *\n * @param obj the object to be written\n * @exception IOException Any of the usual Input/Output related exceptions.\n */\n public void writeObject(Object obj) throws IOException;\n\n /**\n * Writes a byte. This method will block until the byte is actually written.\n * \n * @param b the byte\n * @exception IOException If an I/O error has occurred.\n */\n public void write(int b) throws IOException;\n\n /**\n * Writes an array of bytes. This method will block until the bytes are actually written.\n * \n * @param b the data to be written\n * @exception IOException If an I/O error has occurred.\n */\n public void write(byte b[]) throws IOException;\n\n /**\n * Writes a sub array of bytes.\n * \n * @param b the data to be written\n * @param off the start offset in the data\n * @param len the number of bytes that are written\n * @exception IOException If an I/O error has occurred.\n */\n public void write(byte b[], int off, int len) throws IOException;\n\n /**\n * Flushes the stream. This will write any buffered output bytes.\n * \n * @exception IOException If an I/O error has occurred.\n */\n public void flush() throws IOException;\n\n /**\n * Closes the stream. This method must be called to release any resources associated with the\n * stream.\n * \n * @exception IOException If an I/O error has occurred.\n */\n public void close() throws IOException;\n}", "@Override\n protected void doWriteTo(StreamOutput out) throws IOException {\n }", "@Deprecated\n/* */ public COSStream getStream() {\n/* 290 */ return this.stream;\n/* */ }", "public void setFormat(Connector connector, Format format);", "default void refreshStream() {}", "public abstract String getOutputFormat();", "public Format getOutputFormat() {\n return outputFormat;\n }", "public StructureParserOutputStream ()\n {\n this(new NullOutputStream());\n }", "public void streamOutput(String type,Object currentObj);", "@Override\r\n public OwFormat getFormat()\r\n {\n return null;\r\n }", "@SuppressWarnings({\"rawtypes\"})\n @Override\n public Class<? extends OutputFormat> getOutputFormatClass() {\n // Not yet implemented, but if we return null then the create\n // table statement will fail. Return a dummy implementation that'll\n // throw if ever actually used.\n return NotImplementedOutputFormat.class;\n }", "public void set_standard_format () {\n\t\tf_friendly_format = false;\n\n\t\tmainshock_time = 0L;\n\t\tmainshock_mag = 0.0;\n\t\tmainshock_lat = 0.0;\n\t\tmainshock_lon = 0.0;\n\t\tmainshock_depth = 0.0;\n\n\t\treturn;\n\t}", "@Override\n\t\tprotected void writeStreamHeader() throws IOException {\n\t\t}", "protected StreamPrintService(OutputStream out) {\n this.outStream = out;\n }", "@Override\n @Deprecated\n public void write(ObjectOutput output) throws IOException {\n EmulatedFields.ObjectSlot[] slots = emulatedFields.slots();\n for (int i = 0; i < slots.length; i++) {\n EmulatedFields.ObjectSlot slot = slots[i];\n Object fieldValue = slot.getFieldValue();\n Class<?> type = slot.getField().getType();\n // WARNING - default values exist for each primitive type\n if (type == Integer.TYPE) {\n output.writeInt(fieldValue != null ? ((Integer) fieldValue)\n .intValue() : 0);\n } else if (type == Byte.TYPE) {\n output.writeByte(fieldValue != null ? ((Byte) fieldValue)\n .byteValue() : (byte) 0);\n } else if (type == Character.TYPE) {\n output.writeChar(fieldValue != null ? ((Character) fieldValue)\n .charValue() : (char) 0);\n } else if (type == Short.TYPE) {\n output.writeShort(fieldValue != null ? ((Short) fieldValue)\n .shortValue() : (short) 0);\n } else if (type == Boolean.TYPE) {\n output.writeBoolean(fieldValue != null ? ((Boolean) fieldValue)\n .booleanValue() : false);\n } else if (type == Long.TYPE) {\n output.writeLong(fieldValue != null ? ((Long) fieldValue)\n .longValue() : (long) 0);\n } else if (type == Float.TYPE) {\n output.writeFloat(fieldValue != null ? ((Float) fieldValue)\n .floatValue() : (float) 0);\n } else if (type == Double.TYPE) {\n output.writeDouble(fieldValue != null ? ((Double) fieldValue)\n .doubleValue() : (double) 0);\n } else {\n // Either array or Object\n output.writeObject(fieldValue);\n }\n }\n }", "private Format()\n {\n super();\n }", "@Override\n protected void writeStreamHeader() throws IOException {\n reset();\n }", "public OutSupport() {\n super();\n }", "@Provides\r\n public DataOutput provideOutputWriter() {\r\n DataOutput out = null;\r\n final PrintWriter oWriter = outWriter;\r\n if ((oWriter != null) && (outputFormat != null)) {\r\n if (\"csv\".equalsIgnoreCase(outputFormat)) {\r\n out = new CSVDataOutput(oWriter);\r\n } else if (\"json\".equalsIgnoreCase(outputFormat)) {\r\n out = new JSONDataOutput(oWriter);\r\n } else\r\n throw new IllegalArgumentException(\"Output format \"\r\n + outputFormat + \" not supported.\"\r\n + \" Valid types are csv, json\");\r\n out.verboseOptions(verboseStream, verbose);\r\n }\r\n return out;\r\n }", "@Override\n\tpublic void write(OutStream outStream) {\n\t}", "public DefaultOutputWriter() {\n\t\tpublications = null;\n\t\tauthors = null;\n\t\ttopics = null;\n\t}", "public int toStream(OutputStream out,\n RDFFormat format) throws TrippiException {\n TupleWriter writer;\n if (format == RDFFormat.SPARQL) {\n writer = new SparqlTupleWriter(out, m_aliases); \n }else if(format == RDFFormat.SPARQL_W3C){\n \twriter = new SparqlW3CTupleWriter(out,m_aliases);\n } else if (format == RDFFormat.SIMPLE) {\n writer = new SimpleTupleWriter(out, m_aliases); \n } else if (format == RDFFormat.CSV) {\n writer = new CSVTupleWriter(out, m_aliases); \n } else if (format == RDFFormat.TSV) {\n writer = new TSVTupleWriter(out, m_aliases); \n } else if (format == RDFFormat.COUNT) {\n writer = new CountTupleWriter(out); \n } else if (format == RDFFormat.COUNT_JSON) {\n writer = new FormatCountTupleWriter(new JSONTupleWriter(out, m_aliases)); \n } else if (format == RDFFormat.COUNT_SPARQL) {\n writer = new FormatCountTupleWriter(new SparqlTupleWriter(out, m_aliases)); \n } else if (format == RDFFormat.JSON) {\n writer = new JSONTupleWriter(out, m_aliases); \n } else {\n throw new TrippiException(\"Unsupported output format: \" + format.getName());\n }\n return writer.write(this);\n }", "public DefaultFormat() {\n }", "String getOutputFormat();", "@Override\n public final boolean isStreaming() {\n return false;\n }", "private Output() {}", "public WstxOutputFactory() {\n mConfig = WriterConfig.createFullDefaults();\n }", "protected Format doSetFormat(Format format)\n {\n return null;\n }", "public PlaylistWriter(OutputStream outputStream, Format format, Encoding encoding) {\n this(outputStream, format, encoding, false);\n }", "public OutputFormatter( final Jetty jetty, PlatformIO io ) {\n\t\tsuper( jetty );\n\t\t_platform_io = io;\n\t}", "@Deprecated\n\t public void checkOutputSpecs(org.apache.hadoop.fs.FileSystem filesystem, org.apache.hadoop.mapred.JobConf job) throws IOException\n\t {\n\t bulkOutputFormat.checkOutputSpecs(filesystem, job);\n\t }", "@Override\n protected void writeStreamHeader() throws IOException {\n // metodo honek ez du ezer egiten\n }", "void toXml(OutputStream out, boolean format) throws IOException;", "@Before\n public void changeOutStream() {\n PrintStream printStream = new PrintStream(outContent);\n System.setOut(printStream);\n }", "@Override\n public Format[] getSupportedOutputFormats(Format input)\n {\n if(input == null)\n return supportedOutputFormats;\n \n /* if size is set for element 0 (YUVFormat), it is also set \n * for element 1 (RGBFormat) and so on...\n */\n Dimension size = ((VideoFormat)supportedOutputFormats[0]).getSize();\n \n if(size != null)\n return supportedOutputFormats;\n \n /* no specified size set so return the same size as input\n * in output format supported\n */\n size = ((VideoFormat)input).getSize();\n \n return new Format[] { \n new YUVFormat(size, -1, Format.byteArray, -1.0f,\n YUVFormat.YUV_420, -1, -1, 0, -1, -1),\n new YUVFormat(size, -1, Format.intArray, -1.0f,\n YUVFormat.YUV_420, -1, -1, 0, -1, -1),\n new YUVFormat(size, -1, Format.shortArray, -1.0f,\n YUVFormat.YUV_420, -1, -1, 0, -1, -1),\n new RGBFormat(size, -1, Format.byteArray, -1.0f,\n 32, -1, -1, -1),\n new RGBFormat(size, -1, Format.intArray, -1.0f,\n 32, -1, -1, -1),\n new RGBFormat(size, -1, Format.shortArray, -1.0f,\n 32, -1, -1, -1),\n new RGBFormat(size, -1, Format.byteArray, -1.0f,\n 24, -1, -1, -1),\n new RGBFormat(size, -1, Format.intArray, -1.0f,\n 24, -1, -1, -1),\n new RGBFormat(size, -1, Format.shortArray, -1.0f,\n 24, -1, -1, -1),\n };\n }", "public abstract void writeToStream(java.io.DataOutputStream output) throws java.io.IOException;", "public void setMarshalDateFormat (String format) {\n\t\tthis.outFormat = format;\n }", "public interface Output {\n\n void putString(String string);\n\n // Basic Data Types\n /**\n * Write number\n *\n * @param num\n * Number\n */\n void writeNumber(Number num);\n\n /**\n * Write boolean\n *\n * @param bol\n * Boolean\n */\n void writeBoolean(Boolean bol);\n\n /**\n * Write string\n *\n * @param string\n * String\n */\n void writeString(String string);\n\n /**\n * Write date\n *\n * @param date\n * Date\n */\n void writeDate(Date date);\n\n void writeNull();\n\n /**\n * Write array.\n *\n * @param array\n * Array to write\n */\n void writeArray(Collection<?> array);\n\n /**\n * Write array.\n *\n * @param array\n * Array to write\n */\n void writeArray(Object[] array);\n\n /**\n * Write primitive array.\n *\n * @param array\n * Array to write\n */\n void writeArray(Object array);\n\n /**\n * Write map.\n *\n * @param map\n * Map to write\n */\n void writeMap(Map<Object, Object> map);\n\n /**\n * Write array as map.\n *\n * @param array\n * Array to write\n */\n void writeMap(Collection<?> array);\n\n /**\n * Write object.\n *\n * @param object\n * Object to write\n */\n void writeObject(Object object);\n\n /**\n * Write map as object.\n *\n * @param map\n * Map to write\n */\n void writeObject(Map<Object, Object> map);\n\n /**\n * Write recordset.\n *\n * @param recordset\n * Recordset to write\n */\n void writeRecordSet(RecordSet recordset);\n\n /**\n * Write XML object\n *\n * @param xml\n * XML document\n */\n void writeXML(Document xml);\n\n /**\n * Write ByteArray object (AMF3 only).\n *\n * @param array\n * object to write\n */\n void writeByteArray(ByteArray array);\n\n /**\n * Write a Vector&lt;int&gt;.\n *\n * @param vector\n * vector\n */\n void writeVectorInt(Vector<Integer> vector);\n\n /**\n * Write a Vector&lt;uint&gt;.\n *\n * @param vector\n * vector\n */\n void writeVectorUInt(Vector<Long> vector);\n\n /**\n * Write a Vector&lt;Number&gt;.\n *\n * @param vector\n * vector\n */\n void writeVectorNumber(Vector<Double> vector);\n\n /**\n * Write a Vector&lt;Object&gt;.\n *\n * @param vector\n * vector\n */\n void writeVectorObject(Vector<Object> vector);\n\n /**\n * Write reference to complex data type\n *\n * @param obj\n * Referenced object\n */\n void writeReference(Object obj);\n\n /**\n * Whether object is custom\n *\n * @param custom\n * Object\n * @return true if object is of user type, false otherwise\n */\n boolean isCustom(Object custom);\n\n /**\n * Write custom (user) object\n *\n * @param custom\n * Custom data type object\n */\n void writeCustom(Object custom);\n\n /**\n * Clear references\n */\n void clearReferences();\n}", "void write(StreamOption streamOpt);", "public BioFormatsFormat() {\n\t\tcacheReaderClasses();\n\t}", "public String getWriteFormatDescription(int formatIndex);", "public void setFormat(String format) {\r\n _format = format;\r\n }", "protected Format doGetFormat()\n {\n return null;\n }", "@Override\n public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {\n outputFieldsDeclarer.declareStream(METRONOME_H_STREAM_ID, new Fields(CREATE_DATE, CURRENT_TIMESTAMP));\n outputFieldsDeclarer.declareStream(METRONOME_D_STREAM_ID, new Fields(CREATE_DATE, CURRENT_TIMESTAMP));\n }", "Format internalSetFormat(Format format)\n {\n return doSetFormat(format);\n }", "GorgeousFormatter() {\r\n\t\t}", "@Deprecated\n/* */ public JsonGenerator createJsonGenerator(Writer out)\n/* */ throws IOException\n/* */ {\n/* 1234 */ return createGenerator(out);\n/* */ }", "default StreamBuffering getBuffering() {\n\t\treturn StreamBuffering.UNSUPPORTED;\n\t}", "public void declareOutputFields(OutputFieldsDeclarer declarer) {\n\t\t declarer.declareStream(\"qstream\", new Fields(\"qstream\"));\n\t}", "@Override\r\n\tpublic void setAudioFormat(AudioFormat format) {\r\n\r\n\t}", "private Formats() {\n }", "private interface OutputBuffer {\n String getName();\n\n String getOutput();\n\n PrintWriter getPrintWriter();\n }", "private void openOutputStream() {\n\t\tPrintStreamManagement.openOutputStream();\n\t}", "public void writeObject(OutputStream stream, Object object, int format) throws IOException;", "private Object writeReplace() throws ObjectStreamException {\n return INSTANCE;\n }", "@Deprecated\n/* */ public JsonGenerator createJsonGenerator(OutputStream out)\n/* */ throws IOException\n/* */ {\n/* 1247 */ return createGenerator(out, JsonEncoding.UTF8);\n/* */ }", "public void setSupportFormat(String supportFormat) {\r\n\t\tthis.supportFormat = supportFormat;\r\n\t}", "@Override\r\n public void enableStreamFlow() {\r\n SwitchStates.setEmitOrgEND(true);\r\n }", "@Override\n public IIOMetadata getStreamData() {\n return super.streamData;\n }", "@Deprecated\n public synchronized void splitOutputList() {\n logger.debug3(\"Splitting\");\n listStack.push(new ArrayList());\n }", "public void setFormat(String fmt)\n {\n format = fmt;\n }", "public void setOutputBufferFactory (OutputBufferFactory factory) {\n this.factory = factory;\n }", "@Override\r\n public void disableStreamFlow() {\r\n SwitchStates.setEmitOrgEND(false);\r\n }", "public int getWriteFormatCount();", "public DefOutputStream(OutputStream out) throws IOException {\n\t\t\tthis(out, 512);\n\t\t}", "private String determineStream() {\r\n\t\tif (stream == null) {\r\n\t\t\tCcLsstream lsstream = new CcLsstream();\r\n\t\t\tlsstream.setProject(getProject());\r\n\t\t\tlsstream.setFormat(FMT_EXTENED_NAME);\r\n\t\t\tlsstream.setViewTag(determineViewTag());\r\n\t\t\tlsstream.execute();\r\n\t\t\tstream = lsstream.getCommandOutput();\r\n\t\t\tlog(\"Using derived stream [\" + stream + \"]\", Project.MSG_VERBOSE);\r\n\t\t}\r\n\t\treturn stream;\r\n\t}", "public void setFormat(String format) {\n this.format = format;\n }", "public void setFormat(String format) {\n this.format = format;\n }", "public void setFormat(String format) {\n this.format = format;\n }", "private void ensureStreamVersion() throws UnsupportedOperationException {\n if (streamVersion != 1 && streamVersion != 3) {\n throw new UnsupportedOperationException(\"Unsupported stream version \" + streamVersion);\n }\n }", "public final void setFormat(AdFormat format) {\n\t\timpl.setFormat(format);\n }", "@Override\n\tprotected void write(ObjectOutput out) throws IOException {\n\t\t\n\t}", "default WorkdayEndpointConsumerBuilder format(String format) {\n doSetProperty(\"format\", format);\n return this;\n }", "@Override\n public String getFormatName() throws IOException {\n return input == null? myDefaultFormat.getName() : getInfo().getFormat().getName();\n }", "public StdOutWriter ()\n {\n super (System.out, true);\n }", "public interface StreamsMediator {\n /**\n * Allows the switching to another Stream.\n * @param streamKind The {@link StreamKind} of the stream to switch to.\n */\n default void switchToStreamKind(@StreamKind int streamKind) {}\n\n /**\n * Request the immediate refresh of the contents of the active stream.\n */\n default void refreshStream() {}\n\n /**\n * Disable the follow button, used in case of an error scenario.\n */\n default void disableFollowButton() {}\n }", "public void onEncodeSerialData(StreamWriter streamWriter) {\n }", "@Override\n public Format setInputFormat(Format format)\n {\n Format inputFormat\n = ((format instanceof VideoFormat)\n && (((VideoFormat) format).getSize() == null))\n ? null // size is required\n : super.setInputFormat(format);\n \n if (logger.isDebugEnabled() && (inputFormat != null))\n logger.debug(\"SwScaler set to input in \" + inputFormat);\n return inputFormat;\n }", "public void close() throws FormatException, IOException {\n if (in != null) in.close();\n in = null;\n currentId = null;\n }", "@Override\n public void flush() throws IOException {\n byteBufferStreamOutput.flush();\n }", "public LibraryUpdate(){\n\t\tthis(System.out, System.err);\n\t}", "public void setFormat(Format format) {\n this.format = format.getIndex();\n }", "public void turnOnSystemOutput(){\n if(originalSystemOut == null){\n originalSystemOut = System.out;\n System.setOut(new PrintStream(generalStream));\n //will cause CSS hang up\n// System.setIn(console.getInputStream());\n }\n }", "@Deprecated\n/* */ public JsonGenerator createJsonGenerator(OutputStream out, JsonEncoding enc)\n/* */ throws IOException\n/* */ {\n/* 1214 */ return createGenerator(out, enc);\n/* */ }", "public static void setTheirDefaultFormat(Format fmt)\n {\n theirDefaultFormat = (Format) fmt.clone();\n }", "protected abstract OutputStream getStream() throws IOException;", "public static Serializer getSerializer(Properties format) {\n/* */ Serializer serializer;\n/* */ \n/* 60 */ try { String method = format.getProperty(\"method\");\n/* */ \n/* 62 */ if (method == null) {\n/* 63 */ throw new IllegalArgumentException(\"The output format has a null method name\");\n/* */ }\n/* */ \n/* 66 */ String className = format.getProperty(\"{http://xml.apache.org/xalan}content-handler\");\n/* */ \n/* */ \n/* */ \n/* 70 */ if (null == className) {\n/* */ \n/* */ \n/* 73 */ Properties methodDefaults = OutputPropertiesFactory.getDefaultMethodProperties(method);\n/* */ \n/* 75 */ className = methodDefaults.getProperty(\"{http://xml.apache.org/xalan}content-handler\");\n/* */ \n/* 77 */ if (null == className) {\n/* 78 */ throw new IllegalArgumentException(\"The output format must have a '{http://xml.apache.org/xalan}content-handler' property!\");\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 85 */ ClassLoader loader = ObjectFactory.findClassLoader();\n/* */ \n/* 87 */ Class cls = ObjectFactory.findProviderClass(className, loader, true);\n/* */ \n/* */ \n/* */ \n/* 91 */ Object obj = cls.newInstance();\n/* */ \n/* 93 */ if (obj instanceof SerializationHandler)\n/* */ \n/* */ { \n/* 96 */ serializer = cls.newInstance();\n/* 97 */ serializer.setOutputFormat(format);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* 105 */ else if (obj instanceof ContentHandler)\n/* */ \n/* */ { \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 114 */ className = \"org.apache.xml.serializer.ToXMLSAXHandler\";\n/* 115 */ cls = ObjectFactory.findProviderClass(className, loader, true);\n/* 116 */ SerializationHandler sh = (SerializationHandler)cls.newInstance();\n/* */ \n/* 118 */ sh.setContentHandler((ContentHandler)obj);\n/* 119 */ sh.setOutputFormat(format);\n/* */ \n/* 121 */ serializer = sh;\n/* */ }\n/* */ \n/* */ else\n/* */ \n/* */ { \n/* 127 */ throw new Exception(XMLMessages.createXMLMessage(\"ER_SERIALIZER_NOT_CONTENTHANDLER\", new Object[] { className })); } } catch (Exception e)\n/* */ \n/* */ { \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 137 */ throw new WrappedRuntimeException(e); }\n/* */ \n/* */ \n/* */ \n/* 141 */ return serializer;\n/* */ }", "protected abstract void _write(DataOutput output) throws IOException;", "@Deprecated\n public void sync() throws IOException {\n hflush();\n }", "public void flushStreamSpecs();", "public DLListWithOutput()\n\t{\n\t\tsuper();\n\t}", "public final void setOutput(String sinkName, Object output) throws ConnectException,\n UnsupportedOperationException {\n if (output instanceof ContentHandler) {\n this.result = new SAXResult((ContentHandler) output);\n } else if (output instanceof WritableByteChannel) {\n this.result = new StreamResult(Channels.newOutputStream((WritableByteChannel) output));\n } else if (output instanceof OutputStream) {\n this.result = new StreamResult((OutputStream) output);\n } else if (output instanceof Writer) {\n this.result = new StreamResult((Writer) output);\n } else if (output instanceof File) {\n this.result = new StreamResult((File) output);\n } else if (output instanceof Node) {\n this.result = new DOMResult((Node) output);\n } else {\n throw new ConnectException(i18n.getString(\"unsupportedOutputType\", output.getClass(),\n XMLReaderFilter.class.getName()));\n }\n }", "public OutputStream setAsciiStream(long pos)\n\t{\n\t\tthrow new UnsupportedOperationException();\n\t}" ]
[ "0.6226483", "0.6170517", "0.61094975", "0.6037243", "0.60359126", "0.58539", "0.5682323", "0.56560874", "0.550008", "0.54714495", "0.546222", "0.53765637", "0.537317", "0.5362742", "0.5340911", "0.53400546", "0.5319866", "0.53146017", "0.53133917", "0.5295204", "0.52605665", "0.52604747", "0.52318114", "0.5203174", "0.5193402", "0.5178432", "0.5164671", "0.51490015", "0.514438", "0.51258594", "0.51126534", "0.51035446", "0.5101566", "0.5101021", "0.5079226", "0.50715697", "0.5052362", "0.50505155", "0.5036204", "0.5035728", "0.502688", "0.5021935", "0.50168097", "0.4993798", "0.49865824", "0.4977528", "0.4968814", "0.49427223", "0.49279025", "0.49241206", "0.4923168", "0.4923059", "0.49201703", "0.49077526", "0.48999578", "0.48928872", "0.48911923", "0.4888269", "0.48853296", "0.48806345", "0.48680785", "0.48660436", "0.48360342", "0.482278", "0.48163238", "0.4810806", "0.48095128", "0.4790882", "0.47843483", "0.47773418", "0.47765112", "0.47597414", "0.47553486", "0.4754234", "0.4750474", "0.4750474", "0.4750474", "0.47435248", "0.4742508", "0.47405723", "0.474037", "0.473917", "0.47299308", "0.47257915", "0.4719297", "0.47168362", "0.470737", "0.47049853", "0.470343", "0.4702685", "0.47003326", "0.4698911", "0.46981913", "0.46967113", "0.46956336", "0.46943206", "0.46942168", "0.4688553", "0.46829858", "0.46811736", "0.4676951" ]
0.0
-1
Returns true if the COLLABORATORS contain the CHECKEDUSER.
private static Boolean isUserACollaborator(User checkedUser, Tasky_Collaborator__c[] collaborators) { for (Integer i = 0; i < collaborators.size(); i++) { if (checkedUser.Id == collaborators[i].User__c) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isCheckedOutByUser() {\r\n \r\n if (vocabularyFolder == null) {\r\n return false;\r\n } else {\r\n return StringUtils.isNotBlank(vocabularyFolder.getWorkingUser()) && !vocabularyFolder.isWorkingCopy()\r\n && StringUtils.equals(getUserName(), vocabularyFolder.getWorkingUser());\r\n }\r\n }", "@Override\n public Boolean isCollegeManger(UserDTO user) {\n return user.getRoles().contains(RoleTypeEnum.COLLEGE);\n }", "private boolean userExists(Utente checkUser) {\n\t\tDB db = getDB();\n\t\tMap<Long, UtenteBase> users = db.getTreeMap(\"users\");\n\t\tfor(Map.Entry<Long, UtenteBase> user : users.entrySet())\n\t\t\tif(user.getValue() instanceof Utente && (((Utente)user.getValue()).getUsername().equals(checkUser.getUsername())))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "private Boolean isInUserBoard() {\n\t\t\tBoolean isInUserBoard;\n\t\t\t//String g = userBoard.getUser().getfName();\n\t\t\tif(userBoard.getUser().getExitCode() != null){\n if(Integer.parseInt(userBoard.getUser().getExitCode()) == 0 ){\n isInUserBoard = true;\n userSingleton.INSTANCE.setfName(userBoard.getUser().getfName());\n userSingleton.INSTANCE.setName(userBoard.getUser().getName());\n userSingleton.INSTANCE.setId(userBoard.getUser().getId());\n userSingleton.INSTANCE.setClasse(userBoard.getUser().getClasse());\n userSingleton.INSTANCE.setPassword(userBoard.getUser().getPassword());\n\n\n }\n else{\n isInUserBoard = false;\n }\n }\n else{\n isInUserBoard = false;\n }\n\n\n\n\t\t\treturn isInUserBoard;\n\t\t}", "public boolean checkUser(User userobj)\n\t\t{\n\t\t\tCursor c = getUser();\n\t\t\tif(c!=null){\n\t\t\t\tc.moveToFirst();\n\t\t\t\tdo{\n\t\t\t\tif(userobj.getUserName().equalsIgnoreCase(c.getString(1))&& userobj.getPassword().equalsIgnoreCase(c.getString(2)))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t}while(c.moveToNext());\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public boolean isActiveUser() {\r\n if (currentProcessInstance == null)\r\n return false;\r\n \r\n String[] states = currentProcessInstance.getActiveStates();\r\n if (states == null)\r\n return false;\r\n \r\n Actor[] users;\r\n for (int i = 0; i < states.length; i++) {\r\n try {\r\n users = currentProcessInstance.getWorkingUsers(states[i]);\r\n for (int j = 0; j < users.length; j++) {\r\n if (getUserId().equals(users[j].getUser().getUserId()))\r\n return true;\r\n }\r\n } catch (WorkflowException ignored) {\r\n // ignore unknown state\r\n continue;\r\n }\r\n }\r\n \r\n return false;\r\n }", "private boolean checkUserData() {\n UserAccount userAccount = new UserAccount(this);\n customer = userAccount.getCustomer();\n return customer != null;\n }", "public static boolean check(User user) {\n\t\tboolean flag = false; \n\t\tResultSet resultSet = null;\n\t\ttry {\n\t\t\t//Register the Driver class\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\t\n\t\t\t//Create connection\n\t\t\tConnection connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/Login2\", \"root\", \"root\");\n\t\t\t\n\t\t\t//Create preparedStatement\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(\"select * from user where username = ? && password = ?\");\n\t\t\tpreparedStatement.setString(1, user.getUserName());\n\t\t\tpreparedStatement.setString(2, user.getUserPassword());\n\t\t\t\n\t\t\t//Execute queries\n\t\t\tresultSet = preparedStatement.executeQuery();\n\t\t\tif(resultSet.next())\n\t\t\t\tflag = true;\n\t\t\telse\n\t\t\t\tflag = false;\n\t\t\t\n\t\t\t//Close connection\n\t\t\tpreparedStatement.close();\n\t\t\tconnection.close();\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn flag;\n\t}", "private boolean userIsInCompetitionAssignedToStakeholder(UserResource userToView, UserResource stakeholder) {\n if (isInnovationLead(userToView)) {\n return true;\n }\n\n List<Application> applicationsWhereThisUserIsInConsortium = getApplicationsRelatedToUserByProcessRoles(userToView.getId(), consortiumProcessRoleFilter);\n List<Project> projectsThisUserIsAMemberOf =\n simpleMap(getFilteredProjectUsers(userToView.getId(), projectUserFilter), ProjectUser::getProject);\n\n List<Competition> stakeholderCompetitions =\n simpleMap(stakeholderRepository.findByStakeholderId(stakeholder.getId()), Stakeholder::getProcess);\n\n List<Competition> userCompetitions = getUserCompetitions(applicationsWhereThisUserIsInConsortium, projectsThisUserIsAMemberOf);\n\n return !disjoint(stakeholderCompetitions, userCompetitions);\n }", "@Override\n public boolean userExists(User user) {\n return DATABASE.getUsers().stream()\n .anyMatch(currentUser -> user.equals(currentUser));\n }", "boolean hasSelectedUser();", "public boolean isSetCompanyUserNamePartical() {\n return this.companyUserNamePartical != null;\n }", "public boolean isCheck()\n {\n Game g = Game.getInstance();\n\n for(Piece[] p1 : g.m_board.m_pieces)\n {\n for(Piece p2 : p1)\n {\n if(p2 == null){ continue; }\n if(g.containsMove(new Move(m_x, m_y), p2.getMoves()))\n return true;\n }\n }\n\n return false;\n }", "boolean hasUserManaged();", "protected boolean isValid() {\n return COLLECTION.getList().contains(this);\n }", "private boolean cekUser(String user){\n return user.equals(Preferences.getRegisteredUser(getBaseContext()));\n }", "private boolean isUserExists() {\n\t\treturn KliqDataStore.isUserExists(this.mobileNumber, null);\r\n\t}", "public void setCollaboratorsInCheckComboBox()\r\n throws DatabaseException, ConnectionFailedException {\r\n List<User> listOfCollaboratorsToCheck =\r\n application.getCollaboratorsInvitedByProject(this.project);\r\n this.viewController.selectCollaboratorCheckComboBox(listOfCollaboratorsToCheck);\r\n }", "boolean hasObjUser();", "public boolean checkUserIsAlreadyPartOfContest(Tickets ticket) {\n String hql = String.format(\"Select * from Tickets where user_id = '%s' and contest = '%s'\",\n ticket.getId(), ticket.getContestName());\n return entityManager.createNativeQuery(hql, Tickets.class).getResultList().size() > 0;\n }", "public boolean searchUserInCourse(User targetUser) {\n\n for (int i = 0; i < getUserListInCourse().size(); ++i) {\n if (getUserInUserCourseList(i).getUserName() == targetUser.getUserName()) {\n return true;\n }\n }\n\n return false;\n }", "public static boolean isUsers() {\n try {\n Engine.getUsers();\n return true;\n } catch (IOException e) {\n MessagePrint.println(MessagePrint.Stream.ERR, e.getMessage());\n return false;\n }\n }", "public boolean hasUsers() {\n\t\treturn !this.userNames.isEmpty();\n\t}", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "public boolean userHasARole(List<String> userRoles) {\n List<String> specifiedRoles = Arrays.asList(Constants.SUPERVISOR_ROLE, Constants.TRAINER_ROLE, Constants.PARTICIPANT_ROLE);\n int roleCount = 0;\n for (String role : userRoles) {\n if (specifiedRoles.contains(role)) {\n roleCount++;\n }\n }\n return (roleCount == 1) ? true : false;\n }", "public boolean isSetUser() {\n return this.user != null;\n }", "public boolean isSetUser() {\n return this.user != null;\n }", "public boolean verifyAccountAgingColums(){\n\t\tboolean isAgingColums=false;\n\t\tDynamicFramePage.dynamicFrameForPanchart();\n\t\tDynamicFramePage.switchtoFraFrame();\n\t\tdriver.switchTo().frame(\"panProfile_Frame\");\n\t\tString col2 =SeleniumUtil.getElementWithFluentWait(accountAgingColum2).getText();\n\t\tString col3 =SeleniumUtil.getElementWithFluentWait(accountAgingColum3).getText();\n\t\tString col4 =SeleniumUtil.getElementWithFluentWait(accountAgingColum4).getText();\n\t\tif(col2.equalsIgnoreCase(\"31-60\") && col3.equalsIgnoreCase(\"61-90\") && col4.equalsIgnoreCase(\"Over 90\")){\n\t\t\tSystem.out.println(\"All the aging colums are present\");\n\t\t\tisAgingColums=true;\n\t\t}\n\t\treturn isAgingColums;\n\t}", "public boolean usersFilled() throws SQLException {\n\t\ttry {\n\t\t\tif (getUsers().last() == true) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn false;\n\t}", "public boolean userExists(String userName) {\r\n String qr = \"from UserCredsTbl where userName like '%\" + userName + \"%'\"\r\n + \"or userName like '%\" + userName + \"%'\";\r\n List userList = crud.getObject(qr);\r\n\r\n if (userList.size() > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean checkAdmin()\r\n\t{\r\n\t\tboolean admin=false;\r\n\t\tint length=user_records.size();\r\n\t\tfor(int i=0;i<length;i++)\r\n\t\t{\r\n\t\t\tif(((User)user_records.get(i)).get_username().equals(\"administrator\"))\r\n\t\t\t{\r\n\t\t\t\tadmin=true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn admin;\r\n\t}", "public boolean hasObjUser() {\n return objUser_ != null;\n }", "public static boolean isMemberOf(Long projectID, String user) {\n\t\treturn find.where().eq(\"id\", projectID).eq(\"members.email\", user).findRowCount() > 0;\n\t}", "public boolean hasObjUser() {\n return instance.hasObjUser();\n }", "public boolean isSetIsComparation()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ISCOMPARATION$2) != null;\n }\n }", "private boolean checkColumn(){\n boolean check = false;\n if (!FormatUtils.isBlankField(user_name) && !FormatUtils.isBlankField(user_id) && !FormatUtils.isBlankField(user_phone) && !FormatUtils.isBlankField(user_password) && !FormatUtils.isBlankField(user_password_confirm))\n {\n //make sure user password the same as user password confirm\n if(user_password.getText().toString().equals(user_password_confirm.getText().toString())) {\n //check format\n check = true;\n }else {\n check = false;\n }\n }else {\n check =false;\n }\n\n return check;\n }", "public boolean hasUser(){\n return numUser < MAX_USER;\n }", "@Override\n public boolean hasAccess(User user) {\n return user.hasRole(RoleValue.APP_ADMIN) || this.equals(user.company);\n }", "boolean hasUserList();", "public boolean isComputerOwned(int row, int column) {\n return getCell(row, column).isComputerOwned();\n }", "public boolean contains(Visit toCheck) {\n requireNonNull(toCheck);\n return internalList.stream().anyMatch(toCheck::equals);\n }", "public boolean isVtkUser( ) {\n\t\treturn chomboSolverSpec != null;\n\t}", "public static boolean userHasAccount(String user) throws Exception {\n\r\n\t\tboolean check = false;\r\n\r\n\t\tFile file = getAccountFile();\r\n\t\tScanner x = new Scanner(file);\r\n\r\n\t\twhile (x.hasNextLine()) {\r\n\t\t\tif (x.nextLine().equals(user)) {\r\n\t\t\t\tcheck = true;\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (x.hasNextLine())\r\n\t\t\t\tx.nextLine();\r\n\t\t}\r\n\t\tx.close();\r\n\t\tfile = null;\r\n\r\n\t\treturn check;\r\n\t}", "public boolean vérification_collab_simp(String username) {\ntry {\n\t\t\t\n\t\t\tjdbc.setConnection();\n\t\t\tStatement stm=jdbc.setConnection().createStatement();\n\t\t\tString strcheck=\"select collaborateur_simple.id from collaborateur_simple,utilisateur where collaborateur_simple.id=utilisateur.id and utilisateur.username=\"+'\"'+username+'\"';\n\t\t\t\n\t\t\t\t\n\t\t\tResultSet res = stm.executeQuery(strcheck);\n\t\t\t\n\t\t\t\n\t\t\twhile (res.next()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tjdbc.setConnection().close();\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 false;\n\t}", "private boolean isCurrentDataWasChanedByAnotherUser(final Monthly_report_revision monthlyReport) {\n Monthly_report_revision currentMonthlyReport = this.monthly_reportRepository.findAndRefresh(monthlyReport);\n return !StringUtils.equalsIgnoreCase(monthlyReport.getShounin_joutai(),\n currentMonthlyReport.getShounin_joutai());\n }", "public boolean isCollaborator(String owner, String repo, String collaborator) {\n return apiClient.get(String.format(\"/repos/%s/%s/collaborators/%s\", owner, repo, collaborator)).isOk();\n }", "public boolean hasRegisteredUser() {\n return registeredUserBuilder_ != null || registeredUser_ != null;\n }", "public boolean checkUser(String user) {\n\t\tint index = 0;\n\t\tfor(int i = 0; i < users.size(); i++) {\n\t\t\tif(users.get(i).getUsername().equals(user)) {\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(index == -1) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.setCurrent(users.get(index));\n\t\tthis.loggedIn = true;\n\t\treturn true;\n\t\t\n\t}", "boolean hasUserName();", "public boolean hasRegisteredUser() {\n return registeredUser_ != null;\n }", "public boolean userExists(TIdentifiable user) {\r\n return (m_users.getIndex(user) >= 0);\r\n }", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasCustomerUserAccess();", "public boolean hasUsers() {\n\n return !realm.where(User.class).findAll().isEmpty();\n }", "public boolean checkUser(String user) {\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(new StringBuilder().append(\"SELECT id FROM \" + TABLE_USERS + \" WHERE username = '\").append(user).append(\"'\").toString(), null);\n\n int count = cursor.getCount();\n cursor.moveToFirst();\n\n cursor.close();\n\n if (count > 0) {\n return true;\n } else {\n return false;\n }\n }", "private boolean checkCredentials(String userName, String password)\n {\n int count = 0;\n for(String user : userNames)\n {\n if(user.contentEquals(userName))\n {\n if(passwords[count].contentEquals(password))\n {\n return true;\n }\n }\n count++;\n }\n\n return false;\n }", "public boolean contains(Group toCheck) {\n requireNonNull(toCheck);\n return internalList.contains(toCheck);\n }", "public boolean contains(Preference toCheck) {\n requireNonNull(toCheck);\n return internalList.contains(toCheck);\n }", "public boolean hasUser() {\n return user_ != null;\n }", "public boolean hasUser() {\n return user_ != null;\n }", "public static boolean alreadyEnrolled(String classCode, int userId)\n\t{\n\t\tString sql = \"SELECT COUNT(*) FROM ClassMember c WHERE c.classCode = ? AND c.studentID = ?;\";\n\t\ttry(Connection conn = DriverManager.getConnection(db, user, pwd);\n\t\t\t\tPreparedStatement ps = conn.prepareStatement(sql);)\n\t\t{\n\t\t\tps.setString(1, classCode);\n\t\t\tps.setInt(2, userId);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint count = 0;\n\t\t\tif(rs.next())\n\t\t\t{\n\t\t\t\tcount = rs.getInt(1);\n\t\t\t}\n\t\t\tif(count > 0)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn false;\n\t}", "public boolean isUser(String user) throws Exception {\n\t\treturn getDataBase().containsKey(user);\n\t}", "public boolean checkCombo(int pointsInRow) {\t\t\r\n\t\tfor(int i : this.comboScores) {\r\n\t\t\tif(i == pointsInRow) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public boolean hasUser() {\n return instance.hasUser();\n }", "public boolean hasAccount(String user);", "private boolean pluginIsAwareOf(ApplicationUser user, SshKey inspectedKey) {\n SshKeyEntity knownKey = enterpriseKeyRepository.findSingleUserKey(user);\n return null != knownKey && knownKey.getText().equals(inspectedKey.getText());\n }", "@Override\n\tpublic boolean hasUser(Account acccount) {\n\n\n\n\n\n\n\n\n\n\t\t\n\t\treturn (usersHashtable.containsKey(acccount));\n\t}", "public boolean containsCustomer(String c){\n\t\tfor (int i = 0; i < this.list.size(); i++){\n\t\t\tif( c.equals(list.get(i).getUsername()) ){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasUser() {\n return user_ != null;\n }", "public boolean isSetUserid() {\n return __isset_bit_vector.get(__USERID_ISSET_ID);\n }", "public boolean hasUser() {\n return userBuilder_ != null || user_ != null;\n }", "public boolean hasUser() {\n return userBuilder_ != null || user_ != null;\n }", "public boolean isSetUserName() {\r\n return this.userName != null;\r\n }", "public boolean isSetUserName() {\r\n return this.userName != null;\r\n }", "public boolean isSetUserName() {\r\n return this.userName != null;\r\n }", "public boolean isSetUserName() {\r\n return this.userName != null;\r\n }", "public boolean isSetUserName() {\r\n return this.userName != null;\r\n }" ]
[ "0.6021976", "0.6017012", "0.5883817", "0.571275", "0.56577367", "0.56014526", "0.5599686", "0.5576911", "0.55626476", "0.55544895", "0.5550803", "0.5541272", "0.55399084", "0.5518521", "0.5511426", "0.5505169", "0.5497618", "0.5495133", "0.5483867", "0.54690254", "0.5467671", "0.5430384", "0.5421409", "0.5408641", "0.5408641", "0.5408641", "0.5408641", "0.5408641", "0.5408641", "0.5408641", "0.53953725", "0.53762054", "0.53762054", "0.53709036", "0.5358769", "0.53434044", "0.5341315", "0.53408915", "0.5337059", "0.5329248", "0.52912545", "0.5283345", "0.52832884", "0.52812773", "0.5268838", "0.52477294", "0.5246041", "0.5227183", "0.52183515", "0.52156115", "0.52103126", "0.5204244", "0.51979065", "0.5194892", "0.51945573", "0.51940954", "0.5192089", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.5190232", "0.51647204", "0.5155954", "0.5153579", "0.51475483", "0.513853", "0.5137902", "0.5136456", "0.5136456", "0.5131488", "0.5125818", "0.5119036", "0.511635", "0.5115316", "0.51120746", "0.51052564", "0.50957906", "0.5088418", "0.5082334", "0.507865", "0.507865", "0.5073904", "0.5073904", "0.5073904", "0.5073904", "0.5073904" ]
0.70974886
0
delete all existing filters
@After public void tearDown() { for (Filter filter : filterService.createTaskFilterQuery().list()) { filterService.deleteFilter(filter.getId()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void clearAllFilter() {\n }", "public void clearFilters() {\n // TODO [assignment_final] vycisteni aktualne nastavenych filtru\n }", "public void removeAllFilters() {\n fileFiltersMap.clear();\n\n // everything should be new inferred\n inferePeptides.clear();\n }", "public void resetFilters() {\r\n\t\t// remove all filters\r\n\t\tviewerBruck.resetFilters();\r\n\t\tviewerGraz.resetFilters();\r\n\t\tviewerWien.resetFilters();\r\n\t\tviewerMariazell.resetFilters();\r\n\t\tviewerKapfenberg.resetFilters();\r\n\t\tviewerLeoben.resetFilters();\r\n\t}", "public void resetFilters() {\n filtersSet.values().stream().forEach((filter) -> {\n filter.reset();\n });\n DatasetPieChartFiltersComponent.this.updateSystem(filterSelectionUnit());\n resetFilterIcon();\n }", "public void removeFilter() {\r\n\t\tfilter = null;\r\n\t}", "public void resetFilter();", "public void resetFilter() {\n filters.clear();\n modifiedSinceLastResult = true;\n }", "public void clearFilter(){\n\t\tthis.filterApplied=false;\n\t\tindex_begin=0;\n\t\tindex_end=models.size()-1;\n\t\tnotifyDataSetChanged();\n\t\tnotifyDataSetInvalidated();\n\t\treturn;\n\t}", "public void clearFilter() {\r\n\t\tignoredAttKeys.clear();\r\n\t\tignorePathKeys = false;\r\n\t}", "@Override\n\tpublic void destroy() {\n\t\tSystem.out.print(\"过滤销毁\");\n\t}", "public void removeContainerAndProtocolFilters()\n {\n clearConditions(CONTAINER_FIELD_KEY);\n clearConditions(PROTOCOL_FIELD_KEY);\n _dontNeedFilterContainer = true;\n }", "public void resetSearchFilters() {\n this.searchFilters.resetToDefaults();\n }", "void removeMatching(MetricFilter filter);", "public INodeFilter[] removeAllFilters ();", "public void destroy() {\r\n final String METHOD_NAME = \"destroy\";\r\n LOGGER.info(\"Entering \" + METHOD_NAME);\r\n\r\n this.filterConfig = null;\r\n\r\n LOGGER.info(\"Exiting \" + METHOD_NAME);\r\n }", "@Override\r\n public void destroy() {\r\n if (timerFilterThread != null) {\r\n timerFilterThread.setStopped();\r\n timerFilterThread = null;\r\n }\r\n\r\n Filter filter = null;\r\n for (int i=0; i<filterFactory.getAllFilter().size(); i++) {\r\n // ZAP: Removed unnecessary cast.\r\n filter = filterFactory.getAllFilter().get(i);\r\n try {\r\n filter.destroy();\r\n } catch (Exception e) {}\r\n }\r\n \r\n \r\n }", "public void resetFilter() {\n searchList.clear();\n mediaCategoryList.clear();\n\n searchList.addAll(viewModel.getMediaList());\n mediaCategoryList.addAll(viewModel.getMediaList());\n }", "public void resetFilters(RecommendationRequest request) {\n for (ResultFilter resultFilter : resultFilterSet) {\n resultFilter.resetFilter(request);\n }\n }", "public void deleteAll();", "public void deleteAll();", "public void deleteAll();", "@FXML\n private void clearFiltersClicked() {\n try {\n // clear every filter and reload the cards\n datePicker.setValue(null);\n buildingComboBox.setValue(null);\n yesCheckBoxFood.setSelected(false);\n noCheckBoxFood.setSelected(false);\n yesCheckBoxTeacherOnly.setSelected(false);\n noCheckBoxTeacherOnly.setSelected(false);\n searchBar.setText(\"\");\n capacityComboBox.setValue(null);\n bikesAvailable.setValue(null);\n loadCards();\n } catch (Exception e) {\n logger.log(Level.SEVERE, e.toString());\n }\n }", "private static void hideFilters(List<HealthDataFilter> allFilters) {\n Set<String> userHideFilterChoices = PreferenceUtility.getUserHideFilterChoices();\n if (userHideFilterChoices==null){\n if (AppConstant.DEBUG) Log.i(\"AppUtility:\"+\">\",\"Was no saved hidden filter\");\n return;\n }\n Iterator<HealthDataFilter> iterator = allFilters.iterator();\n while (iterator.hasNext()) {\n HealthDataFilter next = iterator.next();\n // if (next.getFilterName().equals(\"QUEENS\")){\n if (userHideFilterChoices.contains(next.getFilterName())){\n iterator.remove();\n }\n }\n }", "public void deleteAll() {\n\t\t mongoTemplate.remove(new Query(), COLLECTION);\n\t}", "public void deleteAll() {\n\n\t}", "public void deleteAll() {\n\t\t\n\t}", "public void deleteAll(){\n editor.clear();\n editor.apply();\n }", "public void deleteAll();", "public void deleteAll()\n\t{\n\t}", "public void deleteAll()\n\t{\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tSystem.out.println(\"FirstFilter::destroy\");\r\n\t}", "public void clearAll();", "public void clearAll();", "Ack deleteFilter(ID branchId, String name);", "@Override\r\n\tpublic void destroy() {\r\n\t\tSystem.out.println(\"[\" + Calendar.getInstance().getTime() + \"] Finalizando filter\");\r\n\t}", "@Override\n public void resetFilteredLists() {\n\n }", "void deleteAll();", "void deleteAll();", "void deleteAll();", "public void clear()\n {\n // Clear headlines retrieved\n for( String running : this.running)\n {\n // Clear all retrieved headlines\n this.retrieved.put(running, new HashMap<>());\n this.ui.finishedTasks(running + \" is running\");\n }\n // Clear list of running tasks\n this.running.clear();\n\n // Reset cancelled flag\n synchronized(this.cancelledMonitor)\n {\n this.cancelled = false;\n }\n\n theLogger.info(\"Clearing filter due to user cancel\");\n }", "public void removeFilter(String arg) {\n\t\tqueries = null;\n\t\tsessionBean.removeFilter(arg);\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "private List<MutateOperation> removeAll() {\n return removeDescendantsAndFilter(rootResourceName);\n }", "private final void clearTRFilter() {\r\n\t\tadvanceFilterTRModel.setObjIdFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAirplaneModelFilter(\"\");\r\n\t\tadvanceFilterTRModel.setObjTypeFilter(\"\");\r\n\t\tadvanceFilterTRModel.setObjNoFilter(\"\");\r\n\t\tadvanceFilterTRModel.setObjHeadingFilter(\"\");\r\n\t\tadvanceFilterTRModel.setObjTextFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAssumptionFilter(\"\");\r\n\t\tadvanceFilterTRModel.setOwnerFilter(\"\");\r\n\t\tadvanceFilterTRModel.setDeviationsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setModifiedAplicableFilter(\"\");\r\n\t\tadvanceFilterTRModel.setExpReqMtPhaseFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAssgndToAssyPhaseFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAssgndToFTPhaseFilter(\"\");\r\n\t\tadvanceFilterTRModel.setFocalFilter(\"\");\r\n\t\tadvanceFilterTRModel.setStsAssmblyPhaseFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqFirstFlightFilter(\"\");\r\n\t\tadvanceFilterTRModel.setRationaleForFunctionFilter(\"\");\r\n\t\tadvanceFilterTRModel.setFuncExcepFilter(\"\");\r\n\t\tadvanceFilterTRModel.setFunctionFilter(\"\");\r\n\t\tadvanceFilterTRModel.setApplicableDAASystemsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setDevAssurApplicableFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAllocationsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setTraceReqmtsIDFilter(\"\");\r\n\t\tadvanceFilterTRModel.setDervdReqmtsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setScdChildFilter(\"\");\r\n\t\tadvanceFilterTRModel.setRationaleforDerivedreqmtsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt8reqdFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt8verfCloseOutFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt9reqdFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt9verfCloseOutFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt7reqdFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt7verfCloseOutFilter(\"\");\r\n\t\tadvanceFilterTRModel.setEstWorkFilter(\"\");\r\n\t\tadvanceFilterTRModel.setStatusWithSEFilter(\"\");\r\n\t\tadvanceFilterTRModel.setLinkStatusTRFilter(\"\");\r\n\t\tadvanceFilterTRModel.setMinorModFilter(\"\");\r\n\t\twsrdUtilController.pageSize((long) 0);\r\n\t\twsrdUtilController.getPageNumberByList();\r\n\t}", "@Override\n\tpublic String delete(Set<String> filterField) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void clearFilter() {\n\n\t\t// super.clearFilter();\n\n\t\tSelectOneMenu selectOne = (SelectOneMenu) FacesContext\n\t\t\t\t.getCurrentInstance().getViewRoot()\n\t\t\t\t.findComponent(\"form:uniTable:cmbError\");\n\t\tif (selectOne != null) {\n\t\t\tselectOne.resetValue();\n\t\t}\n\n\t\tcleanDetailFilter();\n\n\t\tRequestContext.getCurrentInstance().execute(\n\t\t\t\t\"PF('uniTableFil').clearFilters()\");\n\n\t}", "void reinitFilters() throws IOException;", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "public static void removeAll() {\n\t\tgetPersistence().removeAll();\n\t}", "void removeFilter(IntentFilter filter);", "void removeAll() throws ModelRuntimeException;", "void clearAllIndexes();", "public void removeFilter (FileFilter filter)\n {\n filters.remove (filter);\n }", "@Override\n\tpublic void deleteAll() {\n\n\t}", "@Override\n\tpublic void deleteAll() {\n\n\t}", "@Override\n\tpublic void deleteAll() {\n\n\t}", "@Override\n public void clear() {\n original.clear();\n filtered.clear();\n notifyDataSetChanged();\n }", "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 }", "@Override\r\n\tpublic void deleteAll() {\n\r\n\t}", "public void clearAllFields(){\n\t\tclearFilter(eleGradePanelUc);\n\t\tclearFilter(middleGradePanelUc);\n\t\tclearFilter(highrGradePanelUc);\n\t\tclearFilter(subjectPanelUc);\n\t}", "public void clean(){\n preprocessorActionsPerFile.clear();\n }", "void clearAll();", "void clearAll();", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "public void limparFiltroOfertas() {\n dataModel = null;\n }", "public void deleteAll() {\n repository.deleteAll();\n }", "@Override\n public void resetFilter() {\n getTableRowSorter().setRowFilter(null);\n }", "public void deleteAllOptset() {\n this.optionSet = new ArrayList<OptionSet>();\n }", "protected void clearFilterControls () {\r\n\t\tfilterMaxEp.setText(\"\");\r\n\t\tfilterMinEp.setText(\"\");\r\n\t\tfilterMaxSeason.setText(\"\");\r\n\t\tfilterMinSeason.setText(\"\");\r\n\t\tfilterName.setText(\"\");\r\n\t\tfilterPattern.setText(\"\");\r\n\t\tfilterDenyPattern.setText(\"\");\r\n\t\tazsmrcUser.setText(\"\");\r\n\t\tfilterUseDownloadHistory.setSelection(false);\r\n\t\tfilterUseDownloadHistoryNone.setSelection(true);\r\n\t\tfilterUseDownloadHistoryHash.setSelection(false);\r\n\t\tcategory.setText(\"\");\r\n\t\tsaveDir.setText(\"\");\r\n\t\trenameTo.setText(\"\");\r\n\t\tfilterMoveAfterCompletion.setSelection(false);\r\n\t\tfilterCustomDHMode = EpisodePatternMatching.Normal;\r\n\t\tfilterDHMode.setText(EpisodePatternMatching.Normal.toString());\r\n\t\tfilterDHPattern.setText(\"\");\r\n\t\tdhHistoryUseHigherVersion.setSelection(false);\r\n\t\tinitialStateCombo.select(0);\r\n\t\tfilterMinSize.setText(\"-1\");\r\n\t\tfilterMaxSize.setText(\"-1\");\r\n\t\tfilterMinUnitSize.select(0);\r\n\t\tfilterMaxUnitSize.select(0);\r\n\t\tsetNormalDownloadHistory(false);\r\n\t}", "public void clearAll() {\n\n realm.beginTransaction();\n realm.clear(PhotoGalleryModel.class);\n realm.commitTransaction();\n }", "void removeRecipeFilter(RecipeFilter recipeFilter);", "public void removeFilter(String id) {\n filters.remove(id);\n modifiedSinceLastResult = true;\n }", "public synchronized void removeAll() {\r\n\t\tif (trackedResources == null)\r\n\t\t\treturn;\r\n\t\tPair<IPath, IResourceChangeHandler>[] entries = (Pair<IPath, IResourceChangeHandler>[]) trackedResources.toArray(new Pair[trackedResources.size()]);\r\n\t\tfor (Pair<IPath, IResourceChangeHandler> entry : entries) {\r\n\t\t\tremoveResource(entry.first, entry.second);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void removeAll() {\n\t\tfor (PhatVay phatVay : findAll()) {\n\t\t\tremove(phatVay);\n\t\t}\n\t}", "public void removeAll();", "public void removeAll();", "public void removeAll();", "public void removeAll();", "public void removeAll();", "public void removeAll();", "public void removeAll();" ]
[ "0.8180065", "0.76854044", "0.7331295", "0.7069439", "0.6900924", "0.6848316", "0.6730527", "0.66785425", "0.66143286", "0.6425192", "0.631514", "0.6274036", "0.62402046", "0.6231058", "0.6219405", "0.6202522", "0.61860454", "0.6163901", "0.6135887", "0.6114035", "0.6114035", "0.6114035", "0.60991", "0.60977906", "0.6069776", "0.6050953", "0.6003157", "0.59716034", "0.5969749", "0.5940228", "0.5940228", "0.5932283", "0.59301883", "0.59301883", "0.59178853", "0.5917668", "0.59075105", "0.59016746", "0.59016746", "0.59016746", "0.5875565", "0.5873292", "0.58654714", "0.58654714", "0.58654714", "0.58654714", "0.5846139", "0.58384234", "0.5810103", "0.5808843", "0.58067703", "0.58039814", "0.58039814", "0.58039814", "0.58039814", "0.58039814", "0.58039814", "0.58039814", "0.58039814", "0.58039814", "0.58039814", "0.58012825", "0.57907087", "0.57881635", "0.5784976", "0.57704836", "0.57704836", "0.57704836", "0.5769436", "0.57649434", "0.5755569", "0.57477605", "0.5746475", "0.57372344", "0.57372344", "0.57364595", "0.57364595", "0.57364595", "0.57364595", "0.57364595", "0.57364595", "0.57364595", "0.57364595", "0.5729246", "0.5704504", "0.5702638", "0.5700563", "0.56979924", "0.5684979", "0.5671318", "0.5666636", "0.56654894", "0.5660109", "0.56596863", "0.56596863", "0.56596863", "0.56596863", "0.56596863", "0.56596863", "0.56596863" ]
0.70956594
3
ImageView imageView = root.findViewById(R.id.imageview);
private void setImage() { BitmapFactory.Options options = new BitmapFactory.Options(); Bitmap originalBm = BitmapFactory.decodeFile(tempFile.getAbsolutePath(), options); // Log.d(TAG, "setImage : " + tempFile.getAbsolutePath()); myImage.setImageBitmap(originalBm); /** * tempFile 사용 후 null 처리를 해줘야 합니다. * (resultCode != RESULT_OK) 일 때 tempFile 을 삭제하기 때문에 * 기존에 데이터가 남아 있게 되면 원치 않은 삭제가 이뤄집니다. */ System.out.println("setImage : " + tempFile.getAbsolutePath()); fileSource = tempFile.getAbsolutePath(); myImageSource = fileSource; check++; tempFile = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setupView() {\n\t\timg=(ImageView) findViewById(R.id.imageView1);\n\t}", "@Override\n protected void findViewById() {\n ivGraffit = (ImageView) findView(R.id.ivGraffit);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater,\n ViewGroup container, Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.profile,\n container, false);\n\n profilePicture = rootView.findViewById(R.id.profileImage);\n\n\n\n\n return rootView;\n }", "public ImageView getImageView() {\n return (ImageView) getView().findViewById(imageViewId);\n }", "ImageView getView() {\n return view;\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n ImageView view = (ImageView) findViewById(R.id.imageView);\n view.setOnTouchListener(this); \n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_dialouge, container, false);\n\n ImageView image = (ImageView) v.findViewById(R.id.imageView);\n DogList myActivity = (DogList) getActivity();\n\n int iconresID = getResources().getIdentifier(myActivity.getClickedImage().toLowerCase(),\"drawable\", myActivity.getPackageName());\n\n image.setImageResource(iconresID);\n\n return v;\n }", "@Override\n protected void initView(View view) {\n super.initView(view);\n picture1 = (ImageView) rootview.findViewById(R.id.picture1);\n picture2=(ImageView) rootview.findViewById(R.id.picture2);\n\n }", "void mo36483b(int i, ImageView imageView, Uri uri);", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n ImageView imgView = new ImageView(getActivity());\n imgView.setImageResource(R.drawable.img1);\n return imgView;\n }", "void mo36481a(int i, ImageView imageView, Uri uri);", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n imgView = (ImageView)findViewById(R.id.ImageView01);\t\n imgView.setImageResource(Imgid[0]);\n \n gallery = (Gallery) findViewById(R.id.examplegallery);\n gallery.setAdapter(new AddImgAdp(this));\n\n gallery.setOnItemClickListener(new OnItemClickListener() {\n public void onItemClick(AdapterView parent, View v, int position, long id) {\n imgView.setImageResource(Imgid[position]); \n }\n });\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n Log.d(TAG, \"onCreate\");\n \n mBtn1 = (Button) findViewById(R.id.button1);\n mBtn1.setOnClickListener(this);\n mBtn2 = (Button) findViewById(R.id.button2);\n mBtn2.setOnClickListener(this);\n mImg1 = (ImageView) findViewById(R.id.imageView1);\n }", "public void getViews() {\n cameraButton = (ImageButton) findViewById(R.id.cameraButton);\n galleryButton = (ImageButton)findViewById(R.id.galleryButton);\n tagText = (TextView) findViewById(R.id.tag_text);\n }", "private void findView() {\n\t\tibtn_trigger = (ImageButton) findViewById(R.id.ibtn_right_menu);\n\t}", "void mo36482a(ImageView imageView, Uri uri);", "@NonNull\r\n @Override\r\n public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {\n\r\n ImageView view = new ImageView(getApplicationContext());\r\n\r\n\r\n return new RecyclerView.ViewHolder(view) {\r\n\r\n };\r\n }", "public void setImageView(ImageView imageView){\r\n _imageView = imageView;\r\n }", "public void setImageView(ImageView imageView){\r\n _imageView = imageView;\r\n }", "protected ImageView getImageView(){\n\t\treturn iv1;\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_image, container, false);\n imageView=view.findViewById(R.id.image);\n imageConf();\n setImage();\n return view;\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\r\n\t\tsetContentView(R.layout.act_imageview_src);\r\n\t\t\r\n\t\tinitLayout();\r\n\t\tinitListener();\r\n\t}", "private void findViews() {\n // Buttons first\n closeBtn = (ImageButton) findViewById(getApplication().getResources().getIdentifier(\"closeBtn\", \"id\", getApplication().getPackageName()));\n shareBtn = (ImageButton) findViewById(getApplication().getResources().getIdentifier(\"shareBtn\", \"id\", getApplication().getPackageName()));\n\n //ProgressBar\n loadingBar = (ProgressBar) findViewById(getApplication().getResources().getIdentifier(\"loadingBar\", \"id\", getApplication().getPackageName()));\n // Image Container\n image = (TouchImageView) findViewById(getApplication().getResources().getIdentifier(\"imageView\", \"id\", getApplication().getPackageName()));\n \n\n // Title TextView\n titleTxt = (TextView) findViewById(getApplication().getResources().getIdentifier(\"titleTxt\", \"id\", getApplication().getPackageName()));\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_tab, container, false);\n\n Drawable myDrawable = getResources().getDrawable(R.drawable.youtube_boton);\n\n Imagen = (ImageView) view.findViewById(R.id.Imagen1);\n Imagen.setImageDrawable(myDrawable);\n\n return view;\n }", "private void initUI() {\n\t\timageview = (ImageView) v.findViewById(R.id.shezhi);\r\n\t\timageview.setOnClickListener(this);\r\n\r\n\t\tmytaobao = (ImageView) v.findViewById(R.id.taobao_go);\r\n\t\tmytaobao.setOnClickListener(this);\r\n\r\n\t\twuliu = (ImageView) v.findViewById(R.id.wuliu);\r\n\t\twuliu.setOnClickListener(this);\r\n\r\n\t\tgouwuche = (ImageView) v.findViewById(R.id.gouwuche);\r\n\t\tgouwuche.setOnClickListener(this);\r\n\r\n\t\tchadingdan = (ImageView) v.findViewById(R.id.dingdan);\r\n\t\tchadingdan.setOnClickListener(this);\r\n\r\n\t\tshoucang = (ImageView) v.findViewById(R.id.shoucang);\r\n\t\tshoucang.setOnClickListener(this);\r\n\t}", "private void findViews() {\n jurgen = (ImageView) findViewById(R.id.jurgen_view);\n jurgen.setTag(JURGEN_VIEW_TAG);\n joost = (ImageView) findViewById(R.id.joost_view);\n joost.setTag(JOOST_VIEW_TAG);\n nick = (ImageView) findViewById(R.id.nick_view);\n nick.setTag(NICK_VIEW_TAG);\n stijn = (ImageView) findViewById(R.id.stijn_view);\n stijn.setTag(STIJN_VIEW_TAG);\n }", "public View getView(int index, View view, ViewGroup viewGroup)\n {\n // TODO Auto-generated method stub\n ImageView i = new ImageView(mContext);\n\n// i.setImageResource(mImageIds.get(index));\n\n if(mImageIds.size() > 0 ){\n Picasso.with(mContext).load(mImageIds.get(index)).into(i);\n }\n\n\n i.setLayoutParams(new Gallery.LayoutParams(200, 200));\n\n i.setScaleType(ImageView.ScaleType.FIT_XY);\n\n\n return i;\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n imginfo=(TextView)super.findViewById(R.id.imginfo);\n img=(ImageView)super.findViewById(R.id.img);\n img.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n imginfo.setText(\"x=\"+event.getX()+\",y=\"+event.getY());\n return false;\n }\n });\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n\t\timageview = (ImageView) findViewById(R.id.image);\n\t\tmContainer = (ViewGroup) findViewById(R.id.container);\n\t\t/**\n\t\t * 设置最新显示的图片 如果是数组,那么可以写成IMAGE[int]\n\t\t * \n\t\t */\n\t\timageview.setImageResource(IMAGE);\n\t\t/**\n\t\t * \n\t\t * 设置ImageView的OnClickListener\n\t\t * \n\t\t */\n\t\timageview.setClickable(true);\n\t\timageview.setFocusable(true);\n\t\timageview.setOnClickListener(this);\n\t}", "void mo36480a(int i, int i2, ImageView imageView, Uri uri);", "public void initView(Context context) {\n this.imageView = new ImageView(context);\n this.imageView.setPadding(22, 22, 22, 22);\n this.imageView.setImageResource(R.mipmap.start_circle3x);\n addView(this.imageView);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t\tsetContentView(R.layout.layout_exemplo3);\n\t\t\n\t\tImageView img2 = (ImageView)findViewById(R.id.imagem2);\n\t\timg2.setImageResource(R.drawable.ic_launcher);\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_sign_up);\n b = (Button) findViewById(R.id.btnSelectPhoto);\n viewImage=(ImageView)findViewById(R.id.viewImage);\n b.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n selectImage();\n }\n });\n }", "private void initView() {\n\t\tmVPImageScanner=(ViewPager) findViewById(R.id.vp_image_scanner);\n\t}", "protected ImageView imageView( final int childViewIndex )\n {\n return updater.imageView( childViewIndex );\n }", "@Override\n protected void loadViewLayout() {\n setContentView(R.layout.ui_imgs_graffit);\n }", "@Override\n protected View onCreateView(ViewGroup parent) {\n View view = super.onCreateView(parent);\n\n image = (ImageView) view.findViewById(R.id.preference_cards_background_imageView);\n updateSummary();\n\n return view;\n }", "ImageViewTouchBase getMainImage();", "@Override\n protected void onFinishInflate() {\n super.onFinishInflate();\n tv_slider_icon = (TextView) findViewById(R.id.slider_icon);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n View myView = inflater.inflate(R.layout.fragment_first, container, false);\n ImageView bck = (ImageView)myView.findViewById(R.id.imgWal);\n int[] rse = new int[] {R.drawable.princi18,R.drawable.homescreen1,R.drawable.coleg,R.drawable.back,R.drawable.bck,R.drawable.screen,R.drawable.volleymen,R.drawable.balsir2,R.drawable.balsir3,R.drawable.colgevent};\n Random rnd = new Random();\n int r = rnd.nextInt(rse.length);\n bck.setImageDrawable(getResources().getDrawable(rse[r]));\n\n return myView;\n\n }", "private void findViews() {\r\n\t\t// Buttons first\r\n\t\tcloseBtn = (ImageButton) findViewById( getApplication().getResources().getIdentifier(\"closeBtn\", \"id\", getApplication().getPackageName()) );\r\n\t\tshareBtn = (ImageButton) findViewById( getApplication().getResources().getIdentifier(\"shareBtn\", \"id\", getApplication().getPackageName()) );\r\n\t\t// Photo Container\r\n\t\tphoto = (ImageView) findViewById( getApplication().getResources().getIdentifier(\"photoView\", \"id\", getApplication().getPackageName()) );\r\n\t\twarning = this.getResources().getIdentifier(\"warning\", \"drawable\", getApplication().getPackageName());\r\n\t\tplace = this.getResources().getIdentifier(\"no_media\", \"drawable\", getApplication().getPackageName());\r\n\t\tmAttacher = new PhotoViewAttacher(photo);\r\n\t\t// Title TextView\r\n\t\t//titleTxt = (TextView) findViewById( getApplication().getResources().getIdentifier(\"titleTxt\", \"id\", getApplication().getPackageName()) );\r\n\t\tprogress = (ProgressBar) findViewById( getApplication().getResources().getIdentifier(\"progressBar\", \"id\", getApplication().getPackageName()));\r\n\t}", "public void initViews(){\n layout_health = (RelativeLayout) findViewById(R.id.layout_health);\n layout_msg = (RelativeLayout) findViewById(R.id.layout_msg);\n layout_usercenter = (RelativeLayout) findViewById(R.id.layout_usercenter);\n\n// img_home = (ImageView) findViewById(R.id.img_home);\n img_health = (ImageView) findViewById(R.id.img_health);\n img_msg = (ImageView) findViewById(R.id.img_msg);\n img_usercenter = (ImageView) findViewById(R.id.img_usercenter);\n\n// tv_home = (TextView) findViewById(R.id.tv_home);\n tv_health = (TextView) findViewById(R.id.tv_health);\n tv_msg = (TextView) findViewById(R.id.tv_msg);\n tv_usercenter = (TextView) findViewById(R.id.tv_usercenter);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater,\n ViewGroup container, Bundle savedInstanceState) {\n Bundle args = getArguments();\n int i = args.getInt(\"ARG_OBJECT\");\n\n View rootView = inflater.inflate(\n R.layout.fragment_collection_object, container, false);\n ImageView imageView = (ImageView) rootView.findViewById(R.id.item_gallery);\n\n if (imageArray.size() > 0) {\n Log.d(\"imageArray i:\", String.valueOf(i));\n imageView.setImageBitmap(imageArray.get(i));\n } else {\n // Insert image to indicate no images present\n Bitmap noImageBitmap = BitmapFactory.decodeResource(getApplicationContext().getResources(),\n R.drawable.no_image_found);\n imageView.setImageBitmap(noImageBitmap);\n }\n\n return rootView;\n\n }", "@Override\n protected int layoutId() {\n return R.layout.activity_appraise_imageshow;\n }", "public void setImageView(ImageView imageView) {\r\n _imageView = imageView;\r\n }", "public void setImageView() {\n \timage = new Image(\"/Model/boss3.png\", true);\n \tboss = new ImageView(image); \n }", "private void initViews() {\n textViewName = (AppCompatTextView) findViewById(R.id.textViewName);\n //appCompatButtonBack= (AppCompatButton) findViewById(R.id.appCompatButtonBack);\n imageView= (ImageView) findViewById(R.id.imageView);\n recyclerViewUsers = (RecyclerView) findViewById(R.id.recyclerViewUsers);\n\n }", "public View getView(int index, View view, ViewGroup viewGroup)\n {\n // TODO Auto-generated method stub\n ImageView img = new ImageView(context);\n\n //imageloader.DisplayImage(GlobalVariable.link+\"files/\"+array_image_id.get(index), R.drawable.ic_temp_logo, img);\n img.setLayoutParams(new Gallery.LayoutParams(200, 200));\n img.setScaleType(ImageView.ScaleType.FIT_XY);\n\n return img;\n }", "ImageView getBadgeView();", "public taskimage(ImageView t134){\n t34=t134;\n\n\n }", "public void drawImage() {\n ImageView imageView = (ImageView) findViewById(R.id.photo);\n imageView.setVisibility(View.VISIBLE);\n Glide.with(MainActivity.this).load(iURI).fitCenter().into(imageView);\n }", "@Nullable\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.camera_preview_image, container, false);\n\n\n pic = view.findViewById(R.id.iv_Pic);\n button_capture = view.findViewById(R.id.button_capture);\n\n button_capture.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (Build.VERSION.SDK_INT >= 23) {\n askCameraPermission();\n } else {\n selectImage();\n }\n\n }\n\n\n });\n\n pic.setImageBitmap(bitmap);\n\n return view;\n\n }", "ImageView getAvatarImageView();", "private void findViewById(){\n\t mDeleteBtn = (Button) findViewById(R.id.poster_delete_btn);\n\t mClearBtn = (Button) findViewById(R.id.poster_clear_btn);\n\t posterGridView = (GridView) findViewById(R.id.file_list_view);\n\t noPoster = (TextView)findViewById(R.id.no_poster);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_image_view, container, false);\n\n ButterKnife.bind(this, view);\n\n\n _imageFile = new File(_imagePath);\n if (PermissionChecker.hasExtStoragePerm(getActivity()) && _imageFile.exists()) {\n _bitmap = ContextUtils.get().loadImageFromFilesystem(_imageFile);\n }\n if (_bitmap == null) {\n _imageFile = null;\n _bitmap = ContextUtils.get().drawableToBitmap(\n ContextCompat.getDrawable(getActivity(), R.drawable.ic_mood_bad_black_256dp));\n }\n _expandedImageView.setImageBitmap(_bitmap);\n\n return view;\n }", "public ViewHolder(View view) {\r\n super(view);\r\n img = (ImageView) view.findViewById(R.id.recycleimg);\r\n// picture_text = (TextView) view.findViewById(R.id.picture_text);\r\n// picture_img = (TextView) view.findViewById(R.id.picture_img);\r\n// picture_heart = (TextView) view.findViewById(R.id.picture_heart);\r\n// picture_date = (TextView) view.findViewById(R.id.picture_date);\r\n// picture_num = (TextView) view.findViewById(R.id.picture_num);\r\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_lihat_gambar);\n mURL = findViewById(R.id.linkImg);\n mImage = findViewById(R.id.imageResult);\n btnImage = findViewById(R.id.btnSearch);\n\n }", "@Override\n\tprotected void initView() {\n\t\tiv_content = (ImageView) findViewById(R.id.music_content);\n\t\tiv_music = (ImageView) findViewById(R.id.music_me_iv);\n\t\tiv_queen = (ImageView) findViewById(R.id.music_queen_iv);\n\t\ttv_music = (TextView) findViewById(R.id.music_me_tv);\n\t\ttv_queen = (TextView) findViewById(R.id.music_queen_tv);\n\t\tiv_music.setOnClickListener(this);\n\t\tiv_queen.setOnClickListener(this);\n\t\t\n\t\tbitmap=DisplayUtil.readBitMap(getApplicationContext(), R.drawable.music_part1);\n\t\tiv_content.setImageBitmap(bitmap);\n\n\t}", "private void init(){\n\t\tmIV = new ImageView(mContext);\r\n\t\tFrameLayout.LayoutParams param1 = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT\r\n\t\t\t\t, FrameLayout.LayoutParams.MATCH_PARENT);\r\n\t\tmIV.setLayoutParams(param1);\r\n\t\tmIV.setScaleType(ScaleType.FIT_XY);\r\n//\t\tmIVs[0] = iv1;\r\n\t\tthis.addView(mIV);\r\n//\t\tImageView iv2 = new ImageView(mContext);\r\n//\t\tFrameLayout.LayoutParams param2 = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT\r\n//\t\t\t\t, FrameLayout.LayoutParams.MATCH_PARENT);\r\n//\t\tiv2.setLayoutParams(param2);\r\n//\t\tiv2.setScaleType(ScaleType.CENTER_CROP);\r\n//\t\tmIVs[1] = iv2;\r\n//\t\tthis.addView(iv2);\r\n\t\tthis.mHandler = new Handler();\r\n\t}", "public ImageView getImageView() {\n View view = this.mCardImage;\n if (view instanceof ImageView) {\n return (ImageView) view;\n }\n return null;\n }", "public MyViewHolder(View view) {\n super(view);\n mb=(PhotoView) view.findViewById(R.id.imageView);\n fullscreen=view.findViewById(R.id.full_screen);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n \n ImageView image = (ImageView) findViewById(R.id.imageView1);\n \n image.setImageURI((Uri) getIntent().getExtras().get(Intent.EXTRA_STREAM)); \n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.home8_day3_secondview);\n Log.i(TAG, \"onCreate: \");\n textView = findViewById(R.id.textview);\n imageView = findViewById(R.id.image);\n\n Intent intent = getIntent();\n if (intent != null){\n String root = intent.getStringExtra(\"root\");\n if (root.equals(\"button1\")){\n String name = intent.getStringExtra(\"name\");\n int age = intent.getIntExtra(\"age\",0);\n textView.setText(\"name=\"+name+\" age=\"+age);\n } else if (root.equals(\"button2\")){\n String name = intent.getStringExtra(\"name\");\n int age = intent.getIntExtra(\"age\",0);\n textView.setText(\"name=\"+name+\" age=\"+age);\n }else if (root.equals(\"button3\")){\n Person person = (Person) intent.getSerializableExtra(\"person\");\n textView.setText(person.toString());\n }else if (root.equals(\"button4\")){\n Bitmap bitmap = (Bitmap) intent.getParcelableExtra(\"bitmap\");\n imageView.setImageBitmap(bitmap);\n }\n }\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n setTitle(\"Books Search\");\n\n img = findViewById(R.id.img);\n rv = findViewById(R.id.rv);\n //etSearch = findViewById(R.id.etSearch);\n }", "AsyncImageView getIconView();", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance){\n View rootView = inflater.inflate(R.layout.fragement_body_layout,container,false);\n // get the reference to imageView in the fragment layout\n ImageView imageView = (ImageView) rootView.findViewById(R.id.body_part_image_view);\n //set the image view to daisplay\n imageView.setImageResource(AndroidImageAssets.getHeads().get(0));\n\n return rootView;\n }", "public RecyclerCardViewHolder(View itemView) {\n super(itemView);\n ivLsPicture = (ImageView) itemView.findViewById(R.id.ivLsPicture);\n tvTitle = (TextView) itemView.findViewById(R.id.tvTitle);\n // textView5 = (TextView) itemView.findViewById(R.id.textView5);\n }", "public View getGraphic(T anItem)\n{\n Image img = getImage(anItem);\n return img!=null? new ImageView(img) : null;\n}", "public void addToGameRoot(){\n Main.getRootPlayGround().getChildren().add(imageView);\n }", "private void showView() {\n\t\tfinal ImageView image = (ImageView) findViewById(R.id.image); \n\t\t//screen.addView(image);\n\t\t//image.setImageResource(images[0]);\n\n\t\tString fileName = getFilesDir().getPath() + \"/\" + FILE_NAME;\n\t\t//System.out.println(fileName);\n\t\tBitmap bm = BitmapFactory.decodeFile(fileName); \n\t\t\n\t\timage.setImageBitmap(bm); \n\t\t\n\t\t//System.out.println(\"show done!\\n\");\t\t\n\t\t\n\t}", "private void findView() {\n\t\tteacher = Teacher.getTeacher(this);\r\n\t\tsaoyisaonan = (ImageView) findViewById(R.id.saoyisaonan);\r\n\t\tsaoyisaonv = (ImageView) findViewById(R.id.saoyisaonv);\r\n\t\tif(teacher.isBoy()){\r\n\t\t\tsaoyisaonan.setVisibility(View.VISIBLE);\r\n\t\t}else{\r\n\t\t\tsaoyisaonv.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tclose = (ImageView) findViewById(R.id.close);\r\n\t\tclose.setOnClickListener(this);\r\n\t\tlogin = (ImageView) findViewById(R.id.login);\r\n\t\tlogin.setOnClickListener(this);\r\n\t\treg = (ImageView) findViewById(R.id.reg);\r\n\t\treg.setOnClickListener(this);\r\n\t}", "private void initView(View view) {\n\t\tif (imageView == null) {\n\t\t\timageView = new MyImageView(getActivity());\n\t\t\tscrollView = (MyScrollView) view.findViewById(R.id.my_scroll_view);\n\t\t}\n\t}", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.template_three_detail, container, false);\n ImageView imageView = (ImageView) view.findViewById(R.id.pagerDetailImage);\n\n Bundle bundle = getArguments();\n String imageString = bundle.getString(\"IMAGE\");\n\n Picasso.with(getActivity()).load(imageString).into(imageView);\n\n return imageView;\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_image, container, false);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n getSupportActionBar().hide();\n\n /*if (imagePath != null){\n Drawable d = Drawable.createFromPath(imagePath);\n ImageView background_image = findViewById(R.id.background_image);\n background_image.setImageDrawable(d);\n //ConstraintLayout main = findViewById(R.id.main);\n //main.setBackground(d);\n }*/\n\n init();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n// setContentView(R.layout.main);\n \n SingleFingerView testView = new SingleFingerView(this, BitmapFactory.decodeResource(getResources(), R.drawable.example));\n setContentView(testView);\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.image_pinch);\r\n\r\n\t\tIntent intent = getIntent();\r\n\t\tString imageUrl = intent.getStringExtra(\"ImageUrl\");\r\n\r\n\t\tTouchImageView imageView = (TouchImageView) findViewById(R.id.imageView);\r\n\r\n\t\ttry {\r\n\t\t\tPicasso.with(this) //\r\n\t\t\t\t\t.load(imageUrl) //\r\n\t\t\t\t\t.placeholder(R.drawable.scan_chexs_logo) //\r\n\t\t\t\t\t.error(R.drawable.app_icon) //\r\n\t\t\t\t\t.into(imageView);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void loadImage1(View view) {\n Intent intent = new Intent(this, SelectImageActivity.class);\n startActivityForResult(intent, REQUEST_SELECT_IMAGE_1);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view= inflater.inflate(R.layout.fragment_short_term_memory, container, false);\n imageView=new ImageView[12][2];\n initialize();\n time=(TextView)view.findViewById(R.id.time);\n return view;\n }", "@Override\n public void onCreate(Bundle savedInstanceState){\n super.onCreate(savedInstanceState);\n uri = getIntent().getStringExtra(\"uri\");\n imageArray = getIntent().getStringArrayListExtra(\"array\");\n getIntent().getParcelableArrayListExtra(\"array\");\n\n setContentView(R.layout.image_view_main);\n\n imageView = (ImageView) findViewById(R.id.imageView);\n Picasso.with(this).load(uri).into(imageView);\n\n index = getIntent().getIntExtra(\"index\", 0);\n\n }", "@Override\r\n\tpublic int rootViewId() {\n\t\treturn R.layout.activity_clip_photo;\r\n\t}", "@Override\n public void imageLoad(ImageView imageView, Bitmap bitmap) {\n imageView.setImageBitmap(bitmap);\n //item.picture = bitmap;\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_image_show);\n\t\tinitView();\n\t\tinitData();\n\t\tinitEvent();\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.circle2, container, false);\n\n TextView flash_header = (TextView) view.findViewById(R.id.flash_header);\n flash_header.setText(\"Identify all the objects which are in the shape of a circle in the living room\");\n\n RelativeLayout flash_question = (RelativeLayout) view.findViewById(R.id.flash_question);\n flash_question.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));\n\n ImageView speaker = (ImageView) view.findViewById(R.id.speaker);\n speaker.setOnClickListener(this);\n\n tv_stand = (ImageView) view.findViewById(R.id.tv_stand);\n wall_clock = (ImageView) view.findViewById(R.id.wall_clock);\n mirror = (ImageView) view.findViewById(R.id.mirror);\n cuboard = (ImageView) view.findViewById(R.id.cuboard);\n television = (ImageView) view.findViewById(R.id.television);\n frame = (ImageView) view.findViewById(R.id.frame);\n ivLamp = (ImageView) view.findViewById(R.id.ivLamp);\n chair = (ImageView) view.findViewById(R.id.chair);\n image1 = (ImageView) view.findViewById(R.id.image1);\n image2 = (ImageView) view.findViewById(R.id.image2);\n image3 = (ImageView) view.findViewById(R.id.image3);\n\n tv_stand.setOnClickListener(this);\n wall_clock.setOnClickListener(this);\n mirror.setOnClickListener(this);\n cuboard.setOnClickListener(this);\n television.setOnClickListener(this);\n frame.setOnClickListener(this);\n ivLamp.setOnClickListener(this);\n chair.setOnClickListener(this);\n\n return view;\n }", "public ViewHolder(View itemView) {\n super(itemView);\n imageView = itemView.findViewById(R.id.ivSomeImage);\n textView = itemView.findViewById(R.id.tvSomeText);\n }", "public void loadIntoView(ImageView image_view, String image_path){\n Picasso.with(main)\n .load(image_path)\n .into(image_view);\n }", "void initializeViews() {\n\n //Initialize the button image views layouts.\n recordButton = (ImageView) findViewById(R.id.record);\n cameraButton = (ImageView) findViewById(R.id.camera);\n archive = (ImageView) findViewById(R.id.archive);\n back = (ImageView) findViewById(R.id.back);\n captureButton = (ImageButton) findViewById(R.id.button_capture);\n }", "private void initialisers() {\n\t\tgear= (ImageView)findViewById(R.id.launchgear);\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n //reconocer los controles\n btn1 = findViewById(R.id.btnnext);\n btn2 = findViewById(R.id.btnant);\n img1 = findViewById(R.id.image1);\n btn1.setOnClickListener(this);\n btn2.setOnClickListener(this);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_good_image, container, false);\n ButterKnife.bind(this, view);\n Glide.with(getActivity())\n .load(imagePath)\n .error(Glide.with(getActivity()).load(R.drawable.goods_default))\n .into(goodImg);\n return view;\n }", "public void onFinishInflate() {\n super.onFinishInflate();\n this.mIconView = (ImageView) findViewById(R.id.icon);\n this.mTitleView = (TextView) findViewById(R.id.title);\n this.mSummaryView = (TextView) findViewById(R.id.summary);\n this.mSlidingButton = findViewById(R.id.sliding_button);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_screen6);\n\n // Connecting the xml screen 6's imageView elements with code\n ImageView image = (ImageView) findViewById(R.id.scr6_imageView);\n String value = \"GJ\";\n\n // extracting the extras from the bundle\n Bundle extras = getIntent().getExtras();\n\n if(extras != null){\n // extracting the string from the extras\n value = extras.getString(\"image\");\n }\n\n // setting up the image according to the string extracted from the bundle\n image.setImageResource(getResources().\n getIdentifier(value, \"drawable\", \"edu.wcu.cs.catamountcharacters\"));\n\n }", "@Override\n protected void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main2);\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n OnClickImage();\n\n\n }", "@Override\r\n\tprotected void findViewById() {\n\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_image, container, false);\n ButterKnife.bind(this, view);\n\n Glide.with(view).load(imageUrl).into(imageViewDetails);\n\n return view;\n }", "public void findViews() {\n titleTextView = findViewById(R.id.song_title_text_view);\n artistTextView = findViewById(R.id.song_artist_text_view);\n albumCoverImg = findViewById(R.id.album_cover_img);\n albumTextView = findViewById(R.id.album_text_view);\n playButton = findViewById(R.id.play_button);\n nextButton = findViewById(R.id.next_button);\n backButton = findViewById(R.id.back_button);\n shuffleButton = findViewById(R.id.shuffle_button);\n repeatButton = findViewById(R.id.repeat_button);\n }", "private void findViews(View view) {\n list = (RecyclerView)view.findViewById(R.id.listview);\n\n GridLayoutManager layoutManager = new GridLayoutManager(getActivity(), 2);\n\n list.setLayoutManager(layoutManager);\n list.setHasFixedSize(true);\n\n// imageView = (PhotoDraweeView) view.findViewById(R.id.imageView);\n// imageGallery = (RelativeLayout) view.findViewById(R.id.imageGallery);\n// imageGallery.setVisibility(View.GONE);\n }", "public View getGraphicAfter(T anItem)\n{\n Image img = getImageAfter(anItem);\n return img!=null? new ImageView(img) : null;\n}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.detailacheivements);\n\n achvImage = findViewById(R.id.detailimage1);\n achvDetails = findViewById(R.id.detailtextview1);\n achvTitle = findViewById(R.id.detailtitle);\n points = findViewById(R.id.pointtextview);\n des1 = findViewById(R.id.des1);\n\n setImage();\n }", "private void initView(View subview) {\n\t\tlay_one = (ImageView) subview.findViewById(R.id.green);\n\t\tlay_four = (ImageView) subview.findViewById(R.id.yelow);\n\t\tlay_two = (ImageView) subview.findViewById(R.id.good);\n\t\tlay_five = (ImageView) subview.findViewById(R.id.red_smiley);\n\t\tlay_three = (ImageView) subview.findViewById(R.id.average);\n\t\tlay_one.setOnClickListener(this);\n\t\tlay_three.setOnClickListener(this);\n\t\tlay_two.setOnClickListener(this);\n\t\tlay_five.setOnClickListener(this);\n\t\tlay_four.setOnClickListener(this);\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view= inflater.inflate(R.layout.fragment_proposition_message_board, container, false);\n image2=view.findViewById(R.id.search_profile_image2);\n Glide.with(view).load(R.drawable.serach_image_avatar).circleCrop().into(image2);\n return view;}" ]
[ "0.7576547", "0.732602", "0.71986115", "0.7185956", "0.6980932", "0.6901277", "0.68770784", "0.6857608", "0.66880447", "0.6678767", "0.6667201", "0.665224", "0.6565165", "0.64373964", "0.6414971", "0.6396923", "0.6363105", "0.6344836", "0.6344836", "0.6337984", "0.63342214", "0.62909603", "0.62850285", "0.62838346", "0.62530637", "0.624623", "0.62396294", "0.6218031", "0.61986065", "0.6196176", "0.61659837", "0.61576337", "0.6137664", "0.61131245", "0.61098564", "0.61088747", "0.6087734", "0.6077031", "0.60678387", "0.6067516", "0.6058446", "0.60563374", "0.60535485", "0.6043538", "0.6037553", "0.6032764", "0.6026648", "0.6018642", "0.6012421", "0.6006246", "0.6001783", "0.5987198", "0.59854835", "0.5983712", "0.59761834", "0.5975894", "0.59721524", "0.5955001", "0.5933934", "0.59309494", "0.59285045", "0.59280354", "0.59271127", "0.59137183", "0.58871824", "0.5884313", "0.5883024", "0.58574533", "0.5855416", "0.58551556", "0.58495253", "0.58448744", "0.5840531", "0.58168846", "0.5816756", "0.5809968", "0.5799091", "0.5792283", "0.57824457", "0.5777539", "0.5774614", "0.57742685", "0.5773197", "0.57637864", "0.57619315", "0.57618904", "0.57609224", "0.5760546", "0.5753569", "0.57528013", "0.57502276", "0.5736148", "0.57357913", "0.57346445", "0.5728426", "0.5723361", "0.5702303", "0.56924665", "0.5687532", "0.56765974", "0.5674894" ]
0.0
-1
This method finds two indices of numbers that add up to a certain target number. The way this algorithm works is that it goes through each of the numbers, then stores its complement (i.e target number) in the complement set then, if we find the complement number later in our array, we know we found the two numbers, otherwise returns null array.
public int[] twoSum(int[] nums, int target) { // Create a complement set to store complements Map<Integer, Integer> comp = new HashMap<>(); // Loop over the array for (int i = 0; i < nums.length; i++) { // Build up the complement set as you go if (comp.containsKey(nums[i])) { // if we find the complement again but in our array, // that means we have a solution! return new int[] { comp.get(nums[i]), i}; } comp.put(target - nums[i], i); } // If we didn't find anything, return null array. return new int[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int[] twoSumBetter(int[] numbers, int target) {\n int[] aux = new int[numbers.length];\n for (int i = 0; i < numbers.length; i++) {\n aux[i] = numbers[i];\n }\n \n int i = 0, j = numbers.length - 1;\n boolean found = false;\n \n Arrays.sort(aux);\n \n while (i != j) {\n if (aux[i] + aux[j] < target) i++;\n else if (aux[i] + aux[j] > target) j--;\n else {\n found = true;\n break;\n }\n }\n \n if (!found) return null;\n int firstTarget = aux[i], secondTarget = aux[j];\n \n int[] result = new int[2];\n boolean foundOne = false;\n int leftOver = -1;\n for (int k = 0; k < numbers.length; k++) {\n \n if (foundOne) {\n if (numbers[k] == leftOver) {\n result[1] = k + 1;\n return result;\n }\n }\n \n if (numbers[k] == firstTarget || numbers[k] == secondTarget) {\n \n foundOne = true;\n leftOver = numbers[k] == firstTarget ? secondTarget : firstTarget;\n result[0] = k + 1;\n }\n }\n \n return result;\n \n }", "public int[] twoSum(int[] numbers, int target) {\n if(numbers.length == 0){\n //empty array\n return new int[0];\n }\n HashMap<Integer,Integer> hashmapHelper = new HashMap<Integer,Integer>();\n for(int i = 0; i < numbers.length; i++){\n hashmapHelper.put(numbers[i],i+1);//put index value into hashtable\n }\n int i = 0;\n while(i<numbers.length){\n if(hashmapHelper.containsKey(target - numbers[i])){\n \n int index1 = i+1;\n int index2 = hashmapHelper.get(target - numbers[i]);\n if(index1 < index2){\n \tint[] index = {index1,index2};\n \treturn index;\n }\n else{\n int[] index = {index2,index1};\n return index;\n }\n }\n i++;\n }\n return new int[0];\n }", "public static int[] twoSum(int[] nums, int target) {\n\n HashMap<Integer, Integer> complementsByIndex = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n if (complementsByIndex.containsKey(nums[i])) {\n Integer complementIndex = complementsByIndex.get(nums[i]);\n return new int[]{complementIndex, i};\n } else\n complementsByIndex.put(target - nums[i], i);\n }\n\n return new int[]{};\n }", "public int[] twoSum(int[] numbers, int target) {\n int output [] = new int [2];\n for(int i = 0; i < numbers.length; i++){\n for(int j = 0; j < numbers.length; j++){\n if(i == j) continue;\n if (numbers[i] + numbers[j] == target){\n output[0] = i+1;\n output[1] = j+1;\n return output;\n }\n }\n }\n return null;\n \n }", "public int[] twoSum2(int[] numbers, int target) {\n HashMap<Integer, Integer> hm = new HashMap<>();\n int[] result = null;\n for (int i = 0; i < numbers.length; i++) {\n if (hm.containsKey(target - numbers[i])) {\n int j = hm.get(target - numbers[i]);\n if (i != j) {\n result = new int[] {j + 1, i + 1};\n return result;\n }\n }\n hm.put(numbers[i], i);\n }\n return result;\n }", "public int[] twoSum(int[] nums, int target) {\n // create a hashtable\n HashMap<Integer, Integer> hashMap = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n // add the element plus corresponding index to the hashtable\n hashMap.put(nums[i], i);\n }\n for (int i = 0; i < nums.length; i++) {\n int compl = target - nums[i];\n // check if the complement exists in our hashtable && its value ins't the index corresponding to nums[i] i.e not a repeat of nums[i]\n if (hashMap.containsKey(compl) && hashMap.get(compl) != i) {\n return new int[] {i, hashMap.get(compl)};\n }\n }\n return new int[]{-1, -1};\n }", "public static int[] twoSum(int[] numbers, int target) {\n // Start typing your Java solution below\n // DO NOT write main() function\n int[] aux = new int[numbers.length];\n HashMap<Integer, Integer> valueToIndex = new HashMap<Integer, Integer>();\n for (int i = 0; i < numbers.length; i++) {\n valueToIndex.put(numbers[i], i);\n aux[i] = numbers[i];\n }\n \n int i = 0, j = numbers.length - 1;\n boolean found = false;\n \n Arrays.sort(aux);\n \n while (i != j) {\n if (aux[i] + aux[j] < target) i++;\n else if (aux[i] + aux[j] > target) j--;\n else {\n found = true;\n break;\n }\n }\n \n if (!found) return null;\n \n int[] result = new int[2];\n if (aux[i] == aux[j]) { /* Handle duplicates */\n int first = -1, second = -1;\n for (int k = 0; k < numbers.length; k++) {\n if (numbers[k] == aux[i]) {\n if (first == -1) {\n first = k;\n } else if (second == -1) {\n second = k;\n break;\n }\n }\n }\n result[0] = first + 1;\n result[1] = second + 1;\n return result;\n }\n \n \n if (valueToIndex.get(aux[i]) < valueToIndex.get(aux[j])) {\n result[0] = valueToIndex.get(aux[i]) + 1;\n result[1] = valueToIndex.get(aux[j]) + 1;\n } else {\n result[0] = valueToIndex.get(aux[j]) + 1;\n result[1] = valueToIndex.get(aux[i]) + 1;\n }\n return result;\n }", "public int[] twoSum(int[] numbers, int target) {\n int pointerA = 0;\n int pointerB = numbers.length - 1;\n int[] result = new int[2];\n while (pointerA <= pointerB) {\n int sum = numbers[pointerA] + numbers[pointerB];\n if (sum > target) {\n pointerB--;\n } else if (sum < target) {\n pointerA++;\n } else { // (sum == target)\n result[0] = pointerA + 1;\n result[1] = pointerB + 1;\n return result;\n }\n }\n return result;\n }", "public int[] twoSum(int[] numbers, int target) { // beats 99.27%\n if (numbers == null || numbers.length == 0) {\n return new int[2];\n }\n int start = 0;\n int end = numbers.length - 1;\n while (start < end) {\n if (numbers[start] + numbers[end] == target) {\n return new int[]{start + 1, end + 1};\n } else if (numbers[start] + numbers[end] > target) {\n // move end forward to the last value that numbers[end] <= target - numbers[start]\n end = largestSmallerOrLastEqual(numbers, start, end, target - numbers[start]);\n } else {\n // move start backward to the first value that numbers[start] >= target - numbers[end]\n start = smallestLargerOrFirstEqual(numbers, start, end, target - numbers[end]);\n }\n }\n return new int[2];\n }", "public int[] twoSum3(int[] numbers, int target) {\n int[] result = new int[2];\n for (int i = 0; i < numbers.length; i++) {\n for (int j = 1; j < numbers.length; j++) {\n if (numbers[i] + numbers[j] == target && i != j) {\n result[0] = i + 1;\n result[1] = j + 1;\n return result;\n }\n }\n }\n return result;\n }", "public int[] twoSum(int[] numbers, int target) {\n int left = 0, right = numbers.length - 1;\n while (left < right) {\n int sum = numbers[left] + numbers[right];\n // we need to return the index starting from 1\n if (sum == target) return new int[]{left+1,right+1};\n if (sum > target) right--;\n else left++;\n }\n return null;\n }", "private static int pairwise(int[] input, int target) {\n\n Set<Integer> set = new HashSet<>();\n int indicesSum = 0;\n for(int i = 0; i < input.length; i++) {\n for(int j = i+1; j < input.length; j++) {\n if(isUseful(input, target, set, i, j)) {\n indicesSum += i + j;\n set.add(i);\n set.add(j);\n }\n }\n }\n return indicesSum;\n }", "public static int[] twoSum(int[] nums, int target) {\n HashMap<Integer, Integer> map = new HashMap<>();\n\n //initialize map with first entry of array\n int[] resultPair = {0,0};\n map.put(nums[0], 0);\n int index = 1;\n\n while (index < nums.length) {\n\n int complement = target - nums[index];\n if(map.containsKey(complement)) {\n resultPair[0] = map.get(complement);\n resultPair[1] = index;\n }\n\n map.put(nums[index], index);\n index++;\n }\n return resultPair;\n }", "public int[] twoSum2(int[] nums, int target) {\n int max = nums[0];\n int min = max;\n // get rank\n for (int e : nums) {\n if (e > max) {\n max = e;\n }\n if (e < min) {\n min = e;\n }\n }\n // show up table\n Integer[] showUpMap = new Integer[max - min + 1];\n LinkedList[] indicesMap = new LinkedList[max - min + 1];\n for (int i = 0; i < nums.length; i++) {\n showUpMap[nums[i] - min] = 1;\n if (indicesMap[nums[i] - min] == null) {\n indicesMap[nums[i] - min] = new LinkedList<Integer>();\n }\n indicesMap[nums[i] - min].add(i);\n }\n System.out.println(Arrays.toString(showUpMap));\n System.out.println(Arrays.toString(indicesMap));\n for (int i = 0; i < showUpMap.length; i++) {\n boolean show = showUpMap[i] != null;\n if (show) {\n int a = i + min;\n int need = target - a;\n if (need - min < showUpMap.length &&\n showUpMap[need - min] != null) {\n int ai = (int) indicesMap[i].get(0);\n int bi = (int) indicesMap[need - min].get(0);\n if (ai == bi) {\n bi = (int) indicesMap[need - min].get(1);\n }\n return new int[]{ai, bi};\n }\n }\n }\n return null;\n }", "public int[] twoSum(int[] numbers, int target) {\n\t\tif (numbers.length == 0) {\n\t\t\treturn null;\n\t\t}\n\t\tHashtable<Integer, Integer> hash = new Hashtable<Integer, Integer>();\n\t\tint[] result = new int[2];\n\t\tint small = 0;\n\t\tint big = 0;\n\t\tfor (int i = 0; i < numbers.length; i++) {\n\t\t\tif (!hash.containsKey(numbers[i])) {\n\t\t\t\thash.put(target - numbers[i], i);\n\t\t\t} else {\n\t\t\t\tsmall = i < hash.get(numbers[i]) ? i : hash.get(numbers[i]);\n\t\t\t\tbig = small == i ? hash.get(numbers[i]) : i;\n\n\t\t\t}\n\t\t}\n\t\tresult[0] = small + 1;\n\t\tresult[1] = big + 1;\n\t\treturn result;\n\n\t}", "public int[] twoSumSorted(int[] numbers, int target) {\n \t\n\t\tint len = numbers.length;\n\t\tif (len < 2) \n\t\t\treturn null;\n\n\t\tint left = 0, right = len - 1;\n\t\twhile(left < right){\n\t\t\tint tmp = numbers[left] + numbers[right];\n\t\t\tif (tmp == target) {\n\t\t\t\treturn new int[] {left + 1, right + 1};\n\t\t\t} else if (tmp > target) {\n\t\t\t\tright--;\n\t\t\t} else {\n\t\t\t\tleft++;\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n \t}", "public static int[] twoSum3(int[] nums, int target){\n Map<Integer, Integer> map = new HashMap<>();\n\n for (int i = 0; i < nums.length; i++){\n int complement = target - nums[i];\n if (map.containsKey(complement) && map.get(complement) != i){\n return new int[] {map.get(complement), i};\n }\n map.put(nums[i], i);\n }\n\n throw new IllegalArgumentException(\"No two sum solution.\");\n\n }", "public int[] twoSum(int[] numbers, int target) {\n\t\tHashMap<Integer, Integer> map = new HashMap<>();\n\t\t\n\t\t//go thru the array\n\t\tfor(int i = 0; i < numbers.length; i++) {\n\t\t\t//if the map contains the other number\n\t\t\tif(map.containsKey(target - numbers[i])) {\n\t\t\t\treturn new int[] { map.get(target-numbers[i]) + 1, i + 1};\n\t\t\t}\n\t\t\t//if not then put\n\t\t\tmap.put(numbers[i], i);\n\t\t}\n\t\t\n\t\tthrow new IllegalArgumentException(\"No two sum solution\");\n\t}", "static int [] twoSums(int [] num, int targets) {\n // Equation with variables: nums[i] + nums[j] == target (return the indices)\n // Visualize an array indices {0,1,2,3,4} my i = nums.length\n // Visualize another array J = i+1 {1,2,3,4};\n // nums [2,7,11,15];\n // NOTE: Visualize J = i + 1; When i=0, j will start at 1\n // The if statement is used to check if the condition matches the target\n\n for(int i=0; i < num.length; i++) {\n for(int j= i+1; j<num.length; j++) {\n if (num[i] + num[j] == targets){\n // return new int array because the return type is Array.toString\n return new int [] {i,j};\n }\n }\n }\n return null;\n }", "public int[] twoSum(int[] numbers, int target) {\n\t\tint[] ans = { 0, 0 };\n\t\tint left = 0;\n\t\tint right = numbers.length - 1;\n\t\tquickSort(numbers, left, right);\n\t\twhile (left < right) {\n\t\t\tif (numbers[left] + numbers[right] == target) {\n\t\t\t\tans[0] = left + 1;\n\t\t\t\tans[1] = right + 1;\n\t\t\t\tbreak;\n\t\t\t} else if (numbers[left] + numbers[right] > target) {\n\t\t\t\tright--;\n\t\t\t} else {\n\t\t\t\tleft++;\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}", "public int[] twoSum(int[] nums, int target) {\n int max = nums[0];\n int min = max;\n // get rank\n for (int e : nums) {\n if (e > max) {\n max = e;\n }\n if (e < min) {\n min = e;\n }\n }\n // show up table\n Integer[] showUpMap = new Integer[max - min + 1];\n Integer[] indicesMap = new Integer[max - min + 1];\n for (int i = 0; i < nums.length; i++) {\n showUpMap[nums[i] - min] = 1;\n indicesMap[nums[i] - min] = i;\n }\n for (int i = 0; i < showUpMap.length; i++) {\n boolean show = showUpMap[i] == 1;\n if (show) {\n int a = i + min;\n int need = target - a;\n if (showUpMap[need - min] == 1) {\n return new int[] {indicesMap[i], indicesMap[need - min]};\n }\n }\n }\n return null;\n }", "private static int[] twoSumMap(int[] nums, int target){\n Map<Integer, Integer> map = new HashMap<>(); //the size of the map expanded as\n //the input take place\n for (int i = 0; i < nums.length; i++){\n map.put(nums[i], i);\n }\n\n for (int i = 0; i < nums.length; i++){\n int complement = target - nums[i];\n if (map.keySet().contains(complement) && map.get(complement) != i){\n return new int[] {i, map.get(complement)};\n }\n }\n\n throw new IllegalArgumentException(\"No two sum solution\");\n\n }", "public static int[] twoNumberSum(int[] array, int targetSum) {\n\t\t\n\t\tHashSet<Integer> lookup = new HashSet<Integer>();\n\t\t\n\t\tfor (int j = 0; j < array.length; j++) {\n\t\t\tint cand = targetSum - array[j];\n\t\t\tif (lookup.contains(cand)) {\n\t\t\t\treturn new int[]{cand, array[j]};\n\t\t\t} else {\n\t\t\t\tlookup.add(array[j]);\n\t\t\t}\n\t\t}\n\t\t\n return new int[]{};\n }", "public int[] twoSumST(int[] nums, int target) {\n HashMap<Integer, Integer> result = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n int complement = target - nums[i];\n if (!result.containsKey(complement)) {\n result.put(nums[i], i);\n }\n else {\n return new int[] { result.get(complement), i};\n }\n }\n throw new IllegalArgumentException(\"No solution\");\n }", "static public int[] twoSum(int[] nums, int target) {\n\n\t\tint[] output=new int[2];\n\t\tArrays.fill(output, -1);\n\n\t\tif(nums.length<=1)\n\t\t\treturn output;\n\n\t\tint n=nums.length;\n\t\tMap<Integer, Integer> map=new HashMap<>();\n\n\n\t\tfor(int i=0; i<n; i++)\n\t\t\tmap.put(nums[i], i);\n\n\t\tfor(int j=0; j<n; j++){\n\t\t\tint a=nums[j];\n\t\t\tif(map.containsKey(target-a)){\n\t\t\t\tif(j != map.get(target-a)){\n\t\t\t\t\toutput[0]=j;\n\t\t\t\t\toutput[1]=map.get(target-a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}", "private static int[] getPairUsingHasing(int[] arr, int target) {\n Set<Integer> hashSet = new HashSet<>();\n int[] result = new int[2];\n for(int ele : arr) {\n if(hashSet.contains(target-ele)) {\n result[0] = ele;\n result[1] = target - ele;\n } else hashSet.add(ele);\n\n }\n return result;\n }", "public boolean existSum(int[] array, int target) {\n Set<Integer> set = new HashSet<>();\n for (int num : array) {\n \tif (set.contains(target - num)) {\n \treturn true;\n }\n set.add(num);\n }\n return false;\n }", "public static List<List<Integer>> combinationSum2(int[] candidates, int target) {\n Arrays.sort(candidates);\n List<List<List<Integer>>> dp = new ArrayList<>();\n Map<Integer, Integer> candMap = new HashMap<>();\n for (int i = 0; i < candidates.length; i++) {\n if (candidates[i] > target) break;\n if(candMap.containsKey(candidates[i])) candMap.put(candidates[i], candMap.get(candidates[i]) + 1);\n else candMap.put(candidates[i], 1);\n }\n for (int i = 1; i <= target; i++) {\n Set<List<Integer>> subCand = new HashSet<>();\n for (int j = 0; j < candidates.length && candidates[j] <= i; j++) {\n if (candidates[j] == i) subCand.add(Arrays.asList(i));\n else for (List<Integer> l : dp.get(i - 1 - candidates[j])) {\n if (candidates[j] <= l.get(0)) {\n List<Integer> cl = new ArrayList<>();\n cl.add(candidates[j]);\n cl.addAll(l);\n int cnt = 1;\n for (int a : l) {\n if(a == candidates[j]) cnt++;\n else break;\n }\n if(cnt <= candMap.get(candidates[j])) subCand.add(cl);\n }\n }\n }\n List<List<Integer>> subCandList = new ArrayList<>();\n subCandList.addAll(subCand);\n dp.add(subCandList);\n }\n return dp.get(target - 1);\n }", "private static void findPair(int[] nums, int target, int start, List<List<Integer>> result) {\n int end = nums.length - 1;\n\n while (start < end) {\n int diff = target - nums[start] - nums[end];\n\n if (diff == 0) {\n ArrayList<Integer> triplet = new ArrayList<>();\n triplet.add(target * -1);\n triplet.add(nums[start]);\n triplet.add(nums[end]);\n result.add(triplet);\n start++;\n end--;\n\n while (start < end && nums[start] == nums[start - 1]) {\n start++;\n }\n\n while (start < end && nums[end] == nums[end + 1]) {\n end--;\n }\n } else if (diff > 0) {\n start++;\n } else {\n end--;\n }\n }\n }", "public int[] twoSumOneHash(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n int complement = target - nums[i];\n if (map.containsKey(complement)) {\n return new int[] { map.get(complement), i };\n }\n map.put(nums[i], i);\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }", "public int[] twoSum(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int a = 0; a < nums.length; a++) {\n int other = target - nums[a];\n if (map.containsKey(other)) {\n int[] solution = new int[2];\n solution[0] = map.get(other);\n solution[1] = a;\n return solution;\n }\n else {\n map.put(nums[a], a);\n }\n }\n return new int[2];\n }", "public static int[] twoSum(int[] nums, int target) {\n for (int i = 0; i < nums.length; i++) {\n for (int j = i + 1; j < nums.length; j++) {\n if (nums[j] == target - nums[i]) {\n return new int[] { i, j };\n }\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n\n }", "private static int[] twoSum(int[] nums, int target){\n int ans[] = {0, 0};\n for (int i = 0; i < nums.length; i++){\n for (int j = i + 1; j < nums.length; j++){\n if (nums[i] + nums[j] == target){\n ans[0] = i;\n ans[1] = j;\n return ans;\n }\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }", "public static int indexOf2(int[] numbers, int target) {\n int i = 0;\n while (i < numbers.length && numbers[i] <= target) {\n if (numbers[i] == target) {\n return i; // found it!\n } else {\n i++;\n }\n }\n \n return -1; // not found\n }", "public int[] twosum(int[] nums, int target){\n for(int i = 0; i < nums.length; i++){\n for(int j = i + 1; j < nums.length; j++){\n if(nums[j] == target - nums[i]){\n return new int[]{i, j};\n }\n }\n }\n throw new IllegalArgumentException(\"no two sum solution\");\n }", "public int[] twoSum1(int[] nums, int target)\n\t{\n\t\tMap<Integer, Integer> map = new HashMap<>();\n\t\tfor(int i = 0 ; i< nums.length ; i++)\n\t\t{\n\t\t\tint compliment = target - nums[i];\n\t\t\tif(map.containsKey(compliment))\n\t\t\t{\n\t\t\t\treturn new int[] {map.get(compliment),i};\n\t\t\t}\n\t\t\t\n\t\t\tmap.put(nums[i], i);\n\t\t}\n\t\t\n\t\t\n\t\treturn null;\n\t}", "public int[] twoSum_1(int[] nums, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n int[] result = new int[2];\n for (int i = 0; i < nums.length; i++) {\n if (map.containsKey(target - nums[i])) {\n result[0] = map.get(target - nums[i]);\n result[1] = i;\n return result;\n } else {\n map.put(nums[i], i);\n }\n }\n return result;\n }", "public static int findSumOfTwoNumbers(int[] input, int numToFind)\n {\n return 0;\n }", "public static int[] sumOfTwo(int[] numArr, int target) {\n\t\tint[] res = new int[2];\n\t\t\n\t\tmyOuterLabel:\n\t\tfor (int i = 0; i < numArr.length; i++) {\n\t\t\t\n\t\t\tfor (int j = i + 1; j < numArr.length; j++) {\n\t\t\t\tif (numArr[i] + numArr[j] == target) {\n\t\t\t\t\tres[0] = numArr[i];\n\t\t\t\t\tres[1] = numArr[j];\n\t\t\t\t\treturn res;\n\t\t\t\t\t// break myOuterLabel;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t}", "public int[] twoSumForce(int[] nums, int target) {\n for (int i = 0; i < nums.length; i++) {\n for (int j = i + 1; j < nums.length; j++) {\n if (nums[j] == target - nums[i]) {\n return new int[] { i, j };\n }\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }", "public int[] twoSum2(int[] nums, int target) {\n int[] res = new int[2];\n int n = nums.length;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < n; i++) {\n map.put(nums[i], i);\n }\n for (int i = 0; i < n; i++) {\n int key = target - nums[i];\n if (map.containsKey(key) && map.get(key) != i) {\n res[0] = i;\n res[1] = map.get(key);\n return res;\n }\n }\n return res;\n }", "public static int threeSumClosest(int[] num, int target) {\n Arrays.sort(num);\n int closestSum = Integer.MAX_VALUE;\n \n int left, right;\n for(int i = 0; i < num.length-2; i++){\n left = i+1;\n right = num.length - 1;\n \n while(left < right){\n \n // we havent found a closestSum yet, just take the first sum\n if(closestSum == Integer.MAX_VALUE){\n closestSum = num[left] + num[right] + num[i];\n }\n \n // checks for the closest of sums\n else if(Math.abs(closestSum - target) > (Math.abs(target - (num[left] + num[right] + num[i])))){\n closestSum = num[left] + num[right] + num[i];\n \n // if you sum up to target, there is no possible closer sum\n if(closestSum == target){\n return target;\n }\n }\n \n \n if(num[left] + num[right] + num[i] < target){\n left++;\n }\n else{\n right--;\n }\n }\n \n }\n return closestSum;\n }", "public static int[] twoSum_2(int[] example, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < example.length; i++) {\n map.put(example[i], i);\n }\n for (int i = 0; i < example.length; i++) {\n int complement = target - example[i];\n if (map.containsKey(complement) && map.get(complement) != i) {\n return new int[]{i, map.get(complement)};\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }", "public static int searchTriplet(int[] arr, int targetSum) {\n\n Arrays.sort(arr); // need to make fiding number easier n * log(n) with qsort\n // we fix one value\n\n // internal array would have: value, left, right, target\n // when sum value+left+right.\n // if exactly target => return result\n // if > than target sum: move right pointer. Calculate absolute difference.\n // if < than target sum: move left pointers. Calculate absolute difference.\n // if at any point absolute difference becomes larger -> there is no point to continue iteratig\n // (^ how true if that?)\n // at the end of one cycle return absolute difference. If it is zero -> early exist,\n // if not, try again with different fixed number\n\n int smallestDifference = Integer.MAX_VALUE;\n for (int i = 0; i < arr.length - 2; i++) {\n int left = i + 1;\n int right = arr.length - 1;\n\n while (left < right) {\n int diffWithTarget = targetSum - arr[i] - arr[left] - arr[right];\n if (diffWithTarget == 0) {\n return diffWithTarget;\n }\n\n if (Math.abs(diffWithTarget) < Math.abs(smallestDifference)) {\n smallestDifference = diffWithTarget;\n }\n\n if (diffWithTarget > 0) {\n left++;\n } else {\n right--;\n }\n }\n }\n return targetSum - smallestDifference;\n }", "public int[] twoSum(int[] nums, int target) {\n\t\tHashMap<Integer, Integer> tracker = new HashMap<Integer, Integer>();\n\t\tint len = nums.length;\n\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tif (tracker.containsKey(nums[i])) {\n\t\t\t\tint left = tracker.get(nums[i]);\n\t\t\t\treturn new int[] { left, i };\n\t\t\t} else {\n\t\t\t\ttracker.put(target - nums[i], i);\n\t\t\t}\n\t\t}\n\n\t\treturn new int[2];\n\t}", "public int threeSumClosest(int[] num, int target) {\n long sum = Integer.MIN_VALUE;\n long diff = Integer.MAX_VALUE;\n Arrays.sort(num);\n for (int i = 0; i <= num.length - 3; i++) {\n int j = i + 1;\n int k = num.length - 1;\n while (j < k) {\n int tempSum = num[i] + num[j] + num[k];\n if (target - tempSum > 0) {\n j++;\n } else if (target - tempSum < 0) {\n k--;\n } else {\n return tempSum;\n }\n long delt = Math.abs(tempSum - target);\n if (delt < diff) {\n diff = delt;\n sum = tempSum;\n }\n }\n }\n return (int)sum;\n }", "static void findTwoMissingNumber(int a[]) {\n int miss1 = 0;\n int miss2;\n int miss1miss2 = 0;\n\n int size = a.length;\n for (int i = 0; i < size; i++) {\n miss1miss2 ^= ((i + 1) ^ a[i]);\n }\n\n miss1miss2 ^= (size + 1);\n miss1miss2 ^= (size + 2);\n\n int diff = miss1miss2 & (-miss1miss2);\n\n for (int i = 0; i < size; i++) {\n if (((i + 1) & diff) > 0)\n miss1 ^= (i + 1);\n\n if ((a[i] & diff) > 0)\n miss1 ^= a[i];\n }\n\n if (((size + 1) ^ diff) > 0)\n miss1 ^= (size + 1);\n\n if (((size + 2) ^ diff) > 0)\n miss1 ^= (size + 2);\n\n miss2 = miss1miss2 ^ miss1;\n\n System.out.println(miss1);\n System.out.println(miss2);\n }", "public int[] twoSum(int[] numbers, int target) {\n HashMap<Integer,Integer> map = new HashMap<>();\n\n for(int i = 0; i < numbers.length; i++){\n if(map.get(numbers[i]) != null){\n int[] res = {map.get(numbers[i]),i};\n return res;\n }\n map.put(target-numbers[i],i);\n }\n\n int[] res={};\n return res;\n}", "public static int[] twoNumberSum_sol2(int[] array, int targetSum) {\n\n\t\tSet<Integer> nums = new HashSet<Integer>();\n\t\tfor (int num : array) {\n\t\t\tint potentialMatch = targetSum - num;\n\t\t\tif (nums.contains(potentialMatch)) {\n\t\t\t\treturn new int[] { num, potentialMatch };\n\t\t\t} else {\n\t\t\t\tnums.add(num);\n\t\t\t}\n\t\t}\n\n\t\treturn new int[0];\n\n\t}", "public static int[] twoSum_3(int[] example, int target) {\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < example.length; i++) {\n int complement = target - example[i];\n if (map.containsKey(complement)) {\n return new int[]{map.get(complement), i};\n }\n map.put(example[i], i);\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }", "private int numOfPairs(int[] nums, int start, int end, int target){\n int res = 0;\n while(start < end){\n int sum = nums[start] + nums[end];\n if(sum < target){\n res += end - start;\n start++;\n }\n else{\n end--;\n }\n }\n return res;\n }", "private Set<List<Integer>> combCount(int[] candidates, int i, int target) {\n int len = candidates.length;\n if (i >= len || (i == len - 1 && candidates[i] != target)) {\n return Collections.emptySet();\n }\n\n Set<List<Integer>> comb = new HashSet<>();\n if (candidates[i] == target) {\n List<Integer> list = new ArrayList<>();\n list.add(candidates[i]);\n comb.add(list);\n }\n\n List<Integer> out = new ArrayList<>();\n if (i != len - 1) {\n out.add(0);\n }\n if (candidates[i] < target) {\n out.add(candidates[i]);\n }\n for (Integer val: out) {\n Set<List<Integer>> lists = combCount(candidates, i + 1, target - val);\n if (val != 0) {\n for (List<Integer> list : lists) {\n list.add(val);\n }\n }\n comb.addAll(lists);\n }\n return comb;\n }", "public static int[] twoSum_1(int[] example, int target) {\n for (int i = 0; i < example.length; i++) {\n for (int j = i + 1; j < example.length; j++) {\n if (example[j] == target - example[i]) {\n return new int[]{i, j};\n }\n }\n }\n throw new IllegalArgumentException(\"No two sum solution\");\n }", "public int[] twoSum3(int[] nums, int target) {\n int[] res = new int[2];\n int n = nums.length;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < n; i++) {\n int key = target - nums[i];\n if (map.containsKey(key) && map.get(key) != i) {\n res[0] = map.get(key);\n res[1] = i;\n return res;\n }\n map.put(nums[i], i);\n }\n return res;\n }", "public int[] twoSum(int[] nums, int target) {\n Map<Integer, Integer> temp = new HashMap<>();\n int sub;\n //loop the int array\n for(int i=0, len=nums.length; i<len; i++){\n //calculate the sub value\n sub = target - nums[i];\n if(temp.containsKey(sub)){ // if the map contains the sub value, then return the index value into new int array\n return new int[]{temp.get(sub), i};\n }\n //if the map not contains the sub values, then store data into map\n temp.put(nums[i], i);\n }\n return new int[]{};\n }", "private static int[] searchRange2(int[] nums, int target) {\n int targetPos = findTargetPosition(nums, target);\n if (targetPos == -1) {\n return new int[] {-1, -1};\n }\n int leftPos = findLeftTargetPos(nums, target, targetPos);\n int rightPos = findRightTargetPos(nums, target, targetPos);\n\n return new int[] {leftPos, rightPos};\n }", "public static void targetSumPair(int[] arr, int target){\n //write your code here\n Arrays.sort(arr); // O(nlogn)\n int i=0, j=arr.length-1;\n while(i < j) {\n if(arr[i]+arr[j] < target) {\n i++;\n }\n else if(arr[i] + arr[j] > target)\n j--;\n else {\n System.out.println(arr[i] + \", \" + arr[j]);\n i++; j--;\n }\n }\n }", "public int twoSumSmaller(int[] array, int target) {\n if (array == null || array.length == 0) {\n return 0;\n }\n Arrays.sort(array);\n int left = 0;\n int right = array.length - 1;\n int count = 0;\n\n while (left < right) {\n int sum = array[left] + array[right];\n if (sum < target) {\n // all the pair that right in the range (left, right]\n // will be smaller than target\n count += right - left;\n left++;\n } else {\n right--;\n }\n }\n return count;\n }", "public static void findSumArrayWithGivenSum2(int[] arr, int target) {\n\n\t\tHashMap<Integer, Integer> hm = new HashMap<>();\n\n\t\tint currSum = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\n\t\t\tcurrSum += arr[i];\n\n\t\t\tif (currSum == target) {\n\t\t\t\tSystem.out.println(0 + \"--\" + i);\n\t\t\t}\n\n\t\t\tif (hm.containsKey(currSum - target)) {\n\t\t\t\tSystem.out.println((hm.get(currSum - target) + 1) + \"--\" + i);\n\t\t\t}\n\n\t\t\thm.put(currSum, i);\n\t\t}\n\t}", "public static int[] sum2(int[] nums,int target){\n\t\tHashMap<Integer,Integer> a=new HashMap<Integer,Integer>();\n\t\tfor(int i=0;i<nums.length;i++){\n\t\t\tif(a.get(nums[i])==null){\n\t\t\t\ta.put(target-nums[i], i);\n\t\t\t}else{\n\t\t\t\treturn new int[]{a.get(nums[i]),i};\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn new int[]{-1,-1};\n\t}", "public static int[] searchRange(int[] nums, int target) {\n int right=nums.length-1;\n int[] result=new int[2];\n if(nums==null || nums.length==0)\n return new int[]{-1,-1};\n\n result[0]= findFirstPosition(nums,target,0,right);\n //if first position itself is -1 it means there is no target in the num\n if(result[0]!=-1)\n result[1]= findLastPosition(nums,target,result[0],right);\n else\n result[1]=-1;\n\n return result;\n }", "public static void main(String[] args){\n // To hold the nums input [array]\n int nums [] = {2,7,11,15};\n // input two {1, 3, 4, 11, 15, 7, 2};\n\n // To hold target (expected sum of two nums)\n int target = 9;\n\n //To return indices which is array[0,1]\n // (If we don't print Arrays.toString we will be given garbage)\n System.out.println(Arrays.toString(twoSums(nums, target)));\n\n sumArray(nums);\n }", "public static int[] twoSum(int[] nums, int target) {\n\t\tint[] value = { 0, 0 };\n\t\tif (nums.length > 2) {\n\n\t\t\tint[][] nums2 = Sort.bubbleSort(nums, true);\n\t\t\t// One Counter starts from one side.\n\t\t\tfor (int i = nums2.length - 1; i > 0; i--) {\n\t\t\t\t// The other from the other side with a max of i-1\n\n\t\t\t\t// If the Current Counter Loop Number is > target, then the sum\n\t\t\t\t// any other other number won't be greater than this\n\t\t\t\tif (Utils.sumCheck(target, nums2[i][0]) > 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = checkRecursive(nums2, target, 0, i - 1, i);\n\t\t\t\t\tif (value[0] != 0 || value[1] != 0) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}", "public static int search(int[] nums, int target) {\n int low=0;\n int high=nums.length-1;\n int middle=(high+low)>>1;\n\n for(int i=0;i<nums.length;i++){\n int num = nums[middle];\n if(target>num){\n low=middle+1;\n middle=(high+low)>>1;\n }else if(target<num){\n high=middle-1;\n middle=(high+low)>>1;\n } else{\n return middle;\n }\n\n }\n\n return -1;\n }", "public int threeSumSmaller(int[] nums, int target) {\n Arrays.sort(nums);\n int len = nums.length;\n int count = 0;\n for (int i = 0; i < len; i++) {\n int start = i + 1, end = len - 1;\n int tar = target - nums[i];\n while (start < end) {\n if (nums[start] + nums[end] < tar) {\n count += end - start;\n start++;\n } else {\n end--;\n }\n }\n }\n return count;\n }", "public static int[] twoNumberSum_sol1(int[] array, int targetSum) {\n\n\t\tfor (int i = 0; i < array.length - 1; i++) {\n\t\t\tint firstElement = array[i];\n\t\t\tfor (int j = i + 1; j < array.length; j++) {\n\t\t\t\tif (targetSum == firstElement + array[j]) {\n\t\t\t\t\treturn new int[] { firstElement, array[j] };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new int[0];\n\n\t}", "public static int sumCheck(int target, int... numberArr) {\n\t\tint sum = 0;\n\t\tfor (int number : numberArr) {\n\t\t\tsum += number;\n\t\t}\n\t\treturn target == sum ? 0 : ((target < sum) ? -1 : 1);\n\t}", "private void twoSum(int[] nums, int i, int j, int target) {\n while(i < j) {\n \n int diff = nums[i] + nums[j] - target;\n if(Math.abs(minDiff) > Math.abs(diff)) {\n minDiff = diff;\n }\n \n if(diff == 0) {\n break;\n } else if (diff > 0) {\n j--;\n } else {\n i++;\n }\n }\n }", "public List<Integer> BruteForce(int target, int[] numbers) {\n if (target == 0)\n return List.of();\n if (target < 0)\n return null;\n\n List<Integer> minCombinationResult = null;\n\n for (int number : numbers) {\n\n List<Integer> potentialResult = BruteForce(target - number, numbers);\n if (potentialResult != null) {\n\n List<Integer> validResult = new ArrayList<Integer>(potentialResult);\n validResult.add(number);\n\n if (minCombinationResult == null || validResult.size() < minCombinationResult.size())\n minCombinationResult = validResult;\n }\n }\n\n return minCombinationResult;\n }", "public List<List<Integer>> allTriples(int[] array, int target) {\n List<List<Integer>> res = new ArrayList<>();\n int n = array.length;\n Arrays.sort(array);\n for (int i = 0; i < n - 2; i++) {\n if (i > 0 && array[i] == array[i - 1]) { // remove dups for the 1st member\n continue;\n }\n int left = i + 1, right = n - 1;\n while (left < right) {\n int subsum = array[left] + array[right];\n if (subsum == target - array[i]) {\n res.add(Arrays.asList(array[i], array[left], array[right]));\n left++; // without this line, you will get infinite loop\n while (left < right && array[left] == array[left - 1]) {\n left++;\n }\n } else if (subsum < target - array[i]) {\n left++;\n } else { \n right--;\n }\n }\n }\n return res;\n }", "public static void findSumArrayWithGivenSum(int[] arr, int target) {\n\n\t\tint sum = 0;\n\t\tint start = 0;\n\t\tfor (int end = 0; end < arr.length; end++) {\n\t\t\tint val = arr[end];\n\t\t\tsum += val;\n\t\t\tif (sum == target) {\n\t\t\t\tSystem.out.println(start + \",\" + end);\n\t\t\t\treturn;\n\t\t\t} else if (sum < target) {\n\t\t\t\t// do nothing\n\t\t\t} else {\n\n\t\t\t\twhile (start <= end && sum > target) {\n\n\t\t\t\t\tsum -= arr[start];\n\t\t\t\t\tstart++;\n\n\t\t\t\t\tif (sum == target) {\n\t\t\t\t\t\tSystem.out.println(start + \",\" + end);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public int reachNumber(int target) {\n target = Math.abs(target);\n int sum = 0;\n int i = 0;\n while(sum < target){\n i++;\n sum += i;\n }\n while((sum - target) % 2 != 0){\n i++;\n sum += i;\n }\n return i;\n }", "static int question2(int target, int[] arr) {\r\n\t\treturn binarySearch(arr, arr[0], arr[arr.length-1], target);\r\n\t}", "public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n ArrayList<ArrayList<Integer>> rst = new ArrayList<ArrayList<Integer>>();\n Arrays.sort(num);\n \n for (int i = 0; i < num.length - 3; i++) {\n if (i != 0 && num[i] == num[i - 1]) {\n continue;\n }\n \n for (int j = i + 1; j < num.length - 2; j++) {\n if (j != i + 1 && num[j] == num[j - 1])\n continue;\n \n int left = j + 1;\n int right = num.length - 1;\n while (left < right) {\n int sum = num[i] + num[j] + num[left] + num[right];\n if (sum < target) {\n left++;\n } else if (sum > target) {\n right--;\n } else {\n ArrayList<Integer> tmp = new ArrayList<Integer>();\n tmp.add(num[i]);\n tmp.add(num[j]);\n tmp.add(num[left]);\n tmp.add(num[right]);\n rst.add(tmp);\n left++;\n right--;\n while (left < right && num[left] == num[left - 1]) {\n left++;\n }\n while (left < right && num[right] == num[right + 1]) {\n right--;\n }\n }\n }\n }\n }\n \n return rst;\n }", "private static int[] getPairUsingSorting(int[] arr, int target) {\n Arrays.sort(arr);\n int low = 0;\n int high = arr.length-1;\n int[] result = new int[2];\n while(low <= high) {\n if(arr[low] + arr[high] == target) {\n result[0] = arr[low++];\n result[1] = arr[high--];\n } else if(arr[low] + arr[high] > target) {\n high--;\n } else {\n low++;\n }\n }\n return result;\n }", "static boolean question3(int target, int[] arr) {\r\n\t\tfor(int i=0;i<arr.length;i++) {\r\n\t\t\tfor(int j=0;j<arr.length;j++) {\r\n\t\t\t\tif(i!=j) {\r\n\t\t\t\t\tif(arr[i]+arr[j]==target) {\r\n\t\t\t\t\t\treturn true;\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 false;\r\n\t}", "public int[] getArrayItemIndices(int[] arrayItems, int target) {\n\n if (Objects.isNull(arrayItems) || arrayItems.length == 0) {\n return null;\n }\n\n for (int i = 0; i < arrayItems.length; i++) {\n for (int j = i + 1; j < arrayItems.length; j++) {\n if (arrayItems[i] + arrayItems[j] == target) {\n return new int[]{i, j};\n }\n }\n }\n return null;\n }", "public static int backPackVI(int[] nums, int target) {\n if(target<0 || nums==null || nums.length==0 ){\n \t\treturn 0;\n \t}\n \tint[] fill=new int[target+1];\n \tfill[0]=1;\n \tfor(int j=0;j<=target;j++){\n \t for(int i=0;i<nums.length;i++){\n \t if(j+nums[i]<=target){\n \t\t\t fill[j+nums[i]]+=fill[j];\n \t }\n \t\t}\n \t}\n \treturn fill[target];\n }", "private int findExtremePosition(int[] nums, int target, boolean left){\n int low = 0, high = nums.length-1, mid, index=-1;\n while(low<=high){\n mid = low + (high-low)/2;\n // target is found\n if(target==nums[mid]){\n // store the index\n index = mid;\n // continue moving left to find leftmost index of target element\n if(left){\n high = mid-1;\n // continue moving right to find rightmost index of target element\n }else {\n low = mid+1;\n }\n } else if(target<nums[mid]) {\n high = mid-1;\n } else {\n low = mid+1;\n }\n }\n //loop breaks when low>high, return the last recorded index\n return index;\n }", "public int solve1(int[] array, int from, int to) {\n HashSet<Integer> seen = new HashSet<>();\n\n for (int e : array) {\n seen.add(e);\n }\n\n for (int i = from; i <= to; i++) {\n if (!seen.contains(i)) {\n return i;\n }\n }\n\n return Integer.MAX_VALUE;\n }", "public List<List<Integer>> fourSum_1(int[] nums, int target) \n {\n \tList<List<Integer>> result = new ArrayList<List<Integer>>();\n \tif(nums==null || nums.length<4) return result;\n \tArrays.sort(nums);\n \tfor(int i=0; i<nums.length-3; i++)\n \t{\n \t\tif(i!=0 && nums[i]==nums[i-1]) continue;\n \t\t//if(nums[i]>target) break; \n \t\t//Revisit!!! Why you cannot do this break here\n \t\tfor(int j=i+1; j<nums.length-2;j++)\n \t\t{\n \t\t\tif(j!=(i+1) && nums[j]==nums[j-1]) continue;\n \t\t\tint cur = nums[i]+nums[j];\n \t\t\t//if(cur>target) break;\n \t\t\t//Revisit!!! Why you cannot do this break here\n \t\t\t\n \t\t\tint k=j+1;\n \t\t\tint l = nums.length-1;\n \t\t\twhile(k<l)\n \t\t\t{\n \t\t\t\tif((cur+nums[k]+nums[l])==target)\n \t\t\t\t{\n \t\t\t\t\tList<Integer> newRes = new ArrayList<Integer>();\n \t\t\t\t\tnewRes.add(nums[i]);\n \t\t\t\t\tnewRes.add(nums[j]);\n \t\t\t\t\tnewRes.add(nums[k]);\n \t\t\t\t\tnewRes.add(nums[l]);\n \t\t\t\t\tresult.add(newRes);\n \t\t\t\t\tk++;\n \t\t\t\t\tl--;\n \t\t\t\t\twhile(k<l && nums[k]==nums[k-1]) k++;\n \t\t\t\t\twhile(k<l && nums[l]==nums[l+1]) l--;\n \t\t\t\t}\n \t\t\t\telse if((cur+nums[k]+nums[l])>target)\n \t\t\t\t{\n \t\t\t\t\tl--;\n \t\t\t\t\twhile(k<l && nums[l]==nums[l+1]) l--;\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tk++;\n \t\t\t\t\twhile(k<l && nums[k]==nums[k-1]) k++;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \treturn result;\n }", "public List<List<Integer>> allTriples(int[] array, int target) {\n List<List<Integer>> res = new ArrayList<>();\n Set<Integer> set = new HashSet<>();\n int n = array.length;\n Arrays.sort(array);\n for(int i = 0; i < n - 2; i++) {\n if (!set.contains(array[i])) {\n set.add(array[i]);\n int tar = target - array[i];\n Map<Integer, Integer> map = new HashMap<>();\n for (int j = i + 1; j < n; j++) {\n Integer count = map.get(tar - array[j]);\n if (count != null) {\n if (count == 1) {\n res.add(Arrays.asList(array[i], tar - array[j], array[j]));\n map.put( tar - array[j], count - 1);\n map.put(array[j], 0);\n }\n } else {\n map.put(array[j], 1);\n }\n }\n } \n }\n return res;\n }", "public static int binarySearch2(int[] numbers, int target) {\n int min = 0;\n int max = numbers.length - 1;\n \n int mid = -1;\n while (min <= max) {\n mid = (max + min) / 2;\n if (numbers[mid] == target) {\n return mid; // found it!\n } else if (numbers[mid] < target) {\n min = mid + 1; // too small\n } else { // numbers[mid] > target\n max = mid - 1; // too large\n }\n mid = (max + min) / 2;\n }\n \n return -min - 1; // not found\n }", "public Boolean check(int[] ints, int target) {\n\n\t\t//store seen sums less than target\n\t\tLinkedHashSet<Integer> seenSums = new LinkedHashSet<>();\n\n\t\tfor (int anInt : ints) { //O(n)\n\n\t\t\t//suppose that target in array fits requirements\n\t\t\tif(anInt == target) return true;\n\n\t\t\t//obviously all ints that larger than target won't work\n\t\t\tif(anInt > target) continue;\n\n\t\t\t//\n\t\t\tint addAnIntToTarget = target - anInt;\n\n\t\t\tif(seenSums.contains(addAnIntToTarget)) //O(1)\n\t\t\t\treturn true;\n\n\t\t\tLinkedHashSet<Integer> newSeenSums = new LinkedHashSet<>();\n\t\t\tnewSeenSums.add(anInt);\n\t\t\tfor (Integer seenSum : seenSums) { //O(n)\n\t\t\t\tInteger newSeenSum = seenSum + anInt;\n\n\t\t\t\tif(!newSeenSums.contains(newSeenSum))\n\t\t\t\t\tnewSeenSums.add(newSeenSum);\n\t\t\t}\n\t\t\tseenSums = newSeenSums;\n\t\t}\n\n\t\treturn false;\n\t}", "public static ArrayList<Integer[]> slower(int[] array, int targetSum)\n {\n ArrayList<Integer[]> solution = new ArrayList<Integer[]>();\n\n Arrays.sort(array);\n for (int i = 0; i < array.length - 1; ++i)\n {\n for (int j = i+1; j < array.length; ++j)\n {\n int first = array[i];\n int second = array[j];\n int newTarget = targetSum - first - second;\n\n int front = j + 1;\n int back = array.length - 1;\n while (front < back)\n {\n if (array[front] + array[back] == newTarget)\n {\n Integer [] fourNums = {first, second, array[front], array[back]};\n solution.add(fourNums);\n front += 1;\n back -= 1;\n }\n else if (array[front] + array[back] < newTarget)\n {\n front += 1;\n }\n else\n {\n back -= 1;\n }\n }\n }\n }\n return solution;\n }", "public static int[] findCandidates (int [] numbers, int sizeN){\r\n /*This stores the resulting candidates*/\r\n int [] candidates = new int[2];\r\n int counter1=1;\r\n int counter2=0;\r\n int mElementIndx1=0;\r\n int mElementIndx2=0;\r\n for(int i=1;i<sizeN;i++){\r\n /*If the number is the same as the previeous number, the counter for\r\n * previuos is incremented*/\r\n if(numbers[mElementIndx1]==numbers[i]){\r\n counter1++;\r\n }\r\n /*This checks to see if the second candidate is available*/\r\n else if(counter2==0){\r\n mElementIndx2=i;\r\n counter2=1;\r\n }\r\n /*if number is the same as candid 2 we increment the counter*/\r\n else if(numbers[mElementIndx2]==numbers[i]){\r\n counter2++;\r\n }\r\n /*If candid one is available we put the current number in this candid*/\r\n else if(counter1==0){\r\n mElementIndx1=i;\r\n counter1=1;\r\n }\r\n /*If the number is not the same as either candid one or 2 we decrease their counter*/\r\n else{\r\n counter1--;\r\n counter2--;\r\n }\r\n\r\n\r\n }\r\n /*Storing the result and retuirning*/\r\n candidates[0]=mElementIndx1;\r\n candidates[1]=mElementIndx2;\r\n return candidates;\r\n\r\n }", "public List<List<Integer>> allTriples(int[] array, int target) {\n List<List<Integer>> rst = new ArrayList<List<Integer>>();\n if (array == null || array.length < 3) {\n return rst;\n }\n Arrays.sort(array);\n int length = array.length;\n for (int i = 0; i < length - 2; i++) {\n if (i != 0 && array[i] == array[i - 1]) {\n continue;\n }\n int left = i + 1;\n\t\t\tint right = length - 1;\n\t\t\twhile (left < right) {\n\t\t\t\tint sum = array[left] + array[right] + array[i];\n\t\t\t\tif (sum == target) {\n\t\t\t\t\tList<Integer> tmp = new ArrayList<Integer>();\n\t\t\t\t\ttmp.add(array[i]);\n\t\t\t\t\ttmp.add(array[left]);\n\t\t\t\t\ttmp.add(array[right]);\n\t\t\t\t\trst.add(tmp);\n\t\t\t\t\tleft++;\n\t\t\t\t\tright--;\n\t\t\t\t\twhile (left < right && array[left] == array[left - 1]) { // to skip duplicates\n\t\t\t\t\t\tleft++;\n\t\t\t\t\t}\n\t\t\t\t\twhile (left < right && array[right] == array[right + 1]) { // to skip duplicates\n\t\t\t\t\t\tright--;\n\t\t\t\t\t}\n\t\t\t\t} else if (sum < target) {\n\t\t\t\t\tleft++;\n\t\t\t\t} else {\n\t\t\t\t\tright--;\n\t\t\t\t}\n\t\t\t}\n }\n return rst;\n }", "public void solve(int[] arr, int target) {\n Arrays.sort(arr);\n\n for (int i = 0; i < arr.length; i++) {\n int newTarget = arr[i] - target;\n\n int index = binarySearch(arr, newTarget);\n if (index != -1) {\n System.out.println(arr[i]);\n System.out.println(arr[index]);\n break;\n }\n }\n }", "public static int[] searchForRange(int[] array, int target) {\n // Write your code here.\n\t\tint[] finalRange = {-1, -1};\n\t\talteredBinarySearch(array, target, 0, array.length-1, \nfinalRange, true);\n\t\talteredBinarySearch(array, target, 0,array.length-1, \nfinalRange, false);\n return finalRange;\n }", "public static ArrayList<Integer[]> faster(int[] array, int targetSum)\n {\n ArrayList<Integer[]> solution = new ArrayList<Integer[]>();\n HashMap<Integer, ArrayList<Integer[]>> sumPairs = new HashMap<>();\n\n for (int i = 0; i < array.length - 1; ++i)\n {\n for (int j = i+1; j < array.length; ++j)\n {\n int findSum = targetSum - array[i] - array[j];\n if (sumPairs.containsKey(findSum))\n {\n ArrayList<Integer []> list = sumPairs.get(findSum);\n for (Integer[] pair : list)\n { solution.add(new Integer[] {pair[0], pair[1], array[i], array[j]} ); }\n }\n }\n\n for (int k = 0; k < i; ++k)\n {\n int currentSum = array[i] + array[k];\n if (sumPairs.containsKey(currentSum))\n {\n ArrayList<Integer []> list = sumPairs.get(currentSum);\n list.add(new Integer[] {array[k], array[i]});\n sumPairs.put(currentSum, list);\n }\n else\n {\n ArrayList<Integer []> list = new ArrayList<>();\n list.add(new Integer[] {array[k], array[i]});\n sumPairs.put(currentSum, list);\n }\n }\n }\n return solution;\n }", "public static boolean find3Numbers(int A[], int n, int X) { \n \n // Your code \n for(int i=0;i<n-2;i++)\n {\n HashSet<Integer> set = new HashSet<>();\n int toFind=X-A[i];\n for(int j=i+1;j<n;j++)\n {\n if(set.contains(toFind-A[j]))\n {\n return true;\n }\n set.add(A[j]);\n }\n }\n return false;\n }", "public int[] searchRange(int[] nums, int target) {\n final int len = null != nums ? nums.length : 0;\n if (len <= 0) {\n return new int[]{-1, -1};\n }\n \n int[] result = new int[2];\n int start = 0, end = len-1, idx = -1;\n int mid = 0;\n while (start <= end) {\n mid = start + ((end - start) >> 1);\n if (nums[mid] == target) {\n idx = mid;\n }\n if(nums[mid] >= target){\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n result[0] = idx;\n \n //reset start and end value\n start = 0;\n end = len-1;\n idx = -1;\n while (start <= end) {\n mid = start + ((end - start) >> 1);\n if (nums[mid] == target) {\n idx = mid;\n }\n if(nums[mid] <= target){\n start = mid + 1;\n }else{\n end = mid - 1;\n }\n }\n result[1] = idx;\n return result;\n }", "public List<Integer> DPTabulation(int target, int[] numbers) {\n\n List<List<Integer>> resultArray = new ArrayList<List<Integer>>();\n\n for (int x = 0; x <= target; x++)\n resultArray.add(new ArrayList<Integer>());\n\n for (int number : numbers)\n resultArray.get(number).add(number);\n\n for (int x = 1; x < target; x++) {\n if (resultArray.get(x).size() != 0) {\n for (int number : numbers) {\n if (x + number < resultArray.size()) {\n\n if (resultArray.get(x + number).size() == 0\n || resultArray.get(x).size() + 1 < resultArray.get(x + number).size()) {\n resultArray.get(x + number).clear();\n resultArray.get(x + number).add(number);\n resultArray.get(x + number).addAll(resultArray.get(x));\n }\n }\n }\n }\n }\n\n return resultArray.get(target);\n }", "public Pair findNumbers(int input[]) {\r\n\t\tPair p = new Pair();\r\n\t\tfor (int i = 0; i < input.length; i++) {\r\n\t\t\tif (input[Math.abs(input[i]) - 1] < 0) {\r\n\t\t\t\tp.repeating = Math.abs(input[i]);\r\n\t\t\t} else {\r\n\t\t\t\tinput[Math.abs(input[i]) - 1] = -input[Math.abs(input[i]) - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < input.length; i++) {\r\n\t\t\tif (input[i] < 0) {\r\n\t\t\t\tinput[i] = -input[i];\r\n\t\t\t} else {\r\n\t\t\t\tp.missing = i + 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}", "public static int binarySearchWithTheClosestNum(int[] num, int target) {\n\t\tint left = 0;\n\t\tint right = num.length - 1;\n\t\twhile (left <= right) {\n\t\t\tint middle = (left+right)/2;\n\t\t\tif (num[middle] == target) {\n\t\t\t\treturn middle;\n\t\t\t} else if (num[middle] < target) {\n\t\t\t\tleft = middle + 1;\n\t\t\t} else {\n\t\t\t\tright = middle - 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// when we reach here, means target is not in the array, so we need to find the closet element from num[left] or num[right]\n\t\t// notice that, right is smailler than left now, according to the while condition, if it breaks, left > right\n\t\treturn Math.abs(target - num[left]) > Math.abs(target - num[right]) ? right : left;\n\t}", "public int[] searchRange(int[] nums, int target) \n{\n return helper(nums, target, 0, nums.length - 1);\n}", "public static int doSearch(int[] array, int targetValue) {\r\n int min = 0;\r\n System.out.println(Arrays.toString(array));\r\n int max = array.length - 1;\r\n return findNumber(array, max, min, targetValue);\r\n }", "static int[] closestNumbers(int[] arr) {\n\t\t\n \tList<Integer> res = new ArrayList<Integer>();\n \tArrays.sort(arr);\n \tint min=arr[1]-arr[0];\n \tres.add(arr[0]);\n \tres.add(arr[1]);\n \tfor(int i=2;i<arr.length;i++) {\n \t\tint nMin = arr[i]-arr[i-1];\n \t\tif(nMin<min) {\n \t\t\tres.clear();\n \t\t\tres.add(arr[i-1]);\n \t\t\tres.add(arr[i]);\n \t\t\tmin=nMin;\n \t\t}else if(nMin==min) {\n \t\t\tres.add(arr[i-1]);\n \t\t\tres.add(arr[i]);\n \t\t}\n \t}\n \tint res_f [] = new int[res.size()];\n \tfor(int j=0; j<res_f.length; j++) {\n \t\tres_f[j]=res.get(j);\n \t} \n \treturn res_f;\n }", "int backTrack(int[] nums, int targetSum, int startIndex, int computedSum, int[][] dp) {\n if (startIndex == nums.length) {\n if (targetSum == computedSum) {\n return 1;\n\n }\n return 0;\n } else {\n\n int add = backTrack(nums, targetSum, startIndex + 1, computedSum + nums[startIndex], dp);\n\n int subtract = backTrack(nums, targetSum, startIndex + 1, computedSum - nums[startIndex], dp);\n dp[startIndex][computedSum] = add + subtract;\n return dp[startIndex][computedSum];\n }\n\n }", "private static int findDuplicateIdeaTwo(int[] array) {\n\t\tArrays.sort(array);\n\t\tfor (int i = 0; i < (array.length-1); i++) {\n\t\t\tif (array[i]==array[i+1]) {\n\t\t\t\treturn array[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Not Found\");\n\t\treturn -1;\n\t}" ]
[ "0.72811556", "0.710227", "0.7094425", "0.7033138", "0.69963354", "0.69683844", "0.69525266", "0.69448036", "0.6925772", "0.6883723", "0.6867473", "0.678054", "0.67530876", "0.67073333", "0.6673329", "0.66281015", "0.66263324", "0.66260904", "0.66056514", "0.65777683", "0.6573249", "0.6570692", "0.6556765", "0.65567434", "0.64629614", "0.6378189", "0.63469833", "0.63402456", "0.6251215", "0.6236519", "0.62306374", "0.62269783", "0.6218707", "0.62100846", "0.6207844", "0.62007993", "0.6163672", "0.6158249", "0.61517996", "0.61503243", "0.6135278", "0.6124514", "0.6105909", "0.6088547", "0.60834694", "0.60804045", "0.6077261", "0.60614103", "0.60305184", "0.6015443", "0.59959036", "0.5973657", "0.59644777", "0.59564716", "0.594861", "0.59466696", "0.59448135", "0.5936142", "0.59286207", "0.5917829", "0.5882961", "0.5874431", "0.58500665", "0.5837222", "0.5824918", "0.5821908", "0.58157074", "0.5812795", "0.5790387", "0.578218", "0.57803994", "0.5766547", "0.57558185", "0.57534885", "0.57530963", "0.57464457", "0.5735925", "0.57033026", "0.57030463", "0.5691437", "0.56795514", "0.5676116", "0.5670504", "0.5663696", "0.5661799", "0.5652244", "0.56477696", "0.5635012", "0.56314117", "0.5631222", "0.5623026", "0.5618639", "0.5612922", "0.5612176", "0.561096", "0.5603123", "0.5592951", "0.55871224", "0.5584201", "0.5584063" ]
0.6959247
6
Inserts a node into the Red Black Tree. After the node is in the right spot and is red, RBFixup is called to recolor the tree and make sure the tree follows the rules. Then recUpdateNode is called to update all of the values.
public void insertNode(Node newNode) { hFlag = 0; if( newNode == null ) { throw new NullPointerException("Inserted node is null"); } //if tree is empty, make this node the root if( size == 0 ) { root = newNode; newNode.parent = nilNode; newNode.left = nilNode; newNode.right = nilNode; newNode.color = 1; height = 1; } else { //otherwise, start at root and climb down tree until a spot is found Node y = nilNode; Node x = root; int count = 1; while(x != nilNode) { y = x; if(newNode.key < x.key || (newNode.key == x.key && newNode.p == 1) ) x = x.left; else x = x.right; count++; } if(height < count) { height = count; hFlag = 1; } newNode.parent = y; if(newNode.key < y.key || (newNode.key == y.key && newNode.p == 1) ) y.left = newNode; else y.right = newNode; newNode.left = nilNode; newNode.right = nilNode; newNode.color = 0; //fix up tree RBFixup(newNode); //Time to update the vaules in each node in O(h) time //after the fix up, newNode may have children who need to be updated,so //if newNode has nonNil children, start updating from either child if( !newNode.right.isNil || !newNode.left.isNil ) { //start from newNode's left child (right would work too) recUpdateNode(newNode.left); } else { //start from newNode recUpdateNode(newNode); } } size++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insertNewNode(int newElement ) \n { \n current = parent = grand = header; //set header value to current, parent, and grand node \n nullNode.element = newElement; //set newElement to the element of the null node \n \n //repeat statements until the element of the current node will not equal to the value of the newElement \n while (current.element != newElement) \n { \n great = grand; \n grand = parent; \n parent = current; \n \n //if the value of the newElement is lesser than the current node element, the current node will point to the current left child else point to the current right child. \n current = newElement < current.element ? current.leftChild : current.rightChild; \n \n // Check whether both the children are RED or NOT. If both the children are RED change them by using handleColors() method \n if (current.leftChild.color == RED && current.rightChild.color == RED) \n handleColors( newElement ); \n } \n \n // insertion of the new node will be fail if will already present in the tree \n if (current != nullNode) \n return; \n \n //create a node having no left and right child and pass it to the current node \n current = new RedBlackNode(newElement, nullNode, nullNode); \n \n //connect the current node with the parent \n if (newElement < parent.element) \n parent.leftChild = current; \n else \n parent.rightChild = current; \n handleColors( newElement ); \n }", "private void insert(RBNode<T> node) {\r\n RBNode<T> current = this.root;\r\n //need to save the information of parentNode\r\n //because need the parentNode to connect the new node to the tree\r\n RBNode<T> parentNode = null;\r\n\r\n //1. find the insert position\r\n while(current != null) {\r\n parentNode = current;//store the parent of current, because current is going to move\r\n int cmp = node.key.compareTo(current.key);\r\n if(cmp < 0)//if insert data is smaller than current data, then go into left subtree\r\n current = current.left;\r\n else//if insert data is bigger than or equal to current data, then go into right subtree\r\n current = current.right;\r\n }\r\n\r\n //find the position, let parentNode as the parent of newNode\r\n node.parent = parentNode;\r\n\r\n //2. connect newNode to parentNode\r\n if(parentNode != null) {\r\n int cmp = node.key.compareTo(parentNode.key);\r\n if(cmp < 0)\r\n parentNode.left = node;\r\n else\r\n parentNode.right = node;\r\n } else {\r\n //if parentNode is null, means tree was empty, let root = newNode\r\n this.root = node;\r\n }\r\n\r\n //3. fix the current tree to be a RBTree again\r\n insertFixUp(node);\r\n }", "private Node<T> enforceRBTreePropertiesAfterInsert(Node<T> newNode) {\n Node<T> parent = newNode.parent;\n \n //Base Case of Recursion: no violation and check if parent is root\n if(parent == null || parent.isBlack) {\n return newNode;\n }\n \n boolean parentLeft = parent.isLeftChild();\n Node<T> grandparent = parent.parent;\n Node<T> parentSibling;\n \n //determine if parentSibling is left or right child\n if(parentLeft) {\n parentSibling = grandparent.rightChild;\n }\n else {\n parentSibling = grandparent.leftChild;\n }\n \n //determine side of parent sibling & new node\n boolean sameSide = false;\n if(newNode.isLeftChild()) {\n if((parentSibling != null && parentSibling.isLeftChild()) || \n (parentSibling == null && !parent.isLeftChild())) {\n sameSide = true;\n }\n }\n else {\n if((parentSibling != null && !parentSibling.isLeftChild()) || \n (parentSibling == null && parent.isLeftChild())) {\n sameSide = true;\n }\n }\n \n //Case 1: parent red, parent sibling red\n //set parents to black and grandparent to red, then recursively percolate up\n if(parentSibling != null && !parentSibling.isBlack) {\n \n //re color\n parent.isBlack = true;\n parentSibling.isBlack = true;\n grandparent.isBlack = false;\n \n //check if root\n if(root.data.compareTo(grandparent.data) == 0) {\n grandparent.isBlack = true;\n return(newNode);\n }\n \n }\n \n //Cases 2 & 3: parent red, parent sibling black\n if(parentSibling == null || parentSibling.isBlack) {\n \n //Case 3: parent sibling on same side as new node\n if(sameSide) {\n rotate(newNode, parent);\n rotate(newNode, grandparent);\n }\n //Case 2: parent sibling opposite side as new node\n else {\n rotate(parent, grandparent);\n }\n \n //re color\n grandparent.isBlack = false;\n parent.isBlack = true;\n }\n \n return null;\n }", "@Override\n protected void rebalanceInsert(Position<Entry<K, V>> p) {\n if (!isRoot(p)) {\n makeRed(p);\n resolveRed(p); // The inserted red node may cause a double-red problem\n }\n }", "boolean insertNode(RBTreeNode curr, RBTreeNode node) {\n int dir1 = curr.getDirection(node);\n int dir2 = dir1 ==0 ? 1 : 0;\n\n if(curr.children[dir1] == null) {\n curr.children[dir1] = node;\n return true;\n }\n\n if(isRedNode(curr)) {\n //Case 1: Case where we can flip colors and black height remains unchanged\n if(isRedNode(curr.children[dir1]) ) {\n if(isRedNode(curr.children[dir2])) {\n curr.children[dir1].isRed = true;\n curr.children[dir2].isRed = true;\n curr.isRed = false;\n return true;\n } else if(isRedNode(curr.children[dir1]) && isRedNode(curr.children[dir1].children[dir1])) { //Case 2 and 3 //single rotation\n //RBTreeNode temp = singleRotate(curr,dir1,dir1); //Java no pointers :( So need to copy the returned val\n //curr.update(temp);\n curr.update(singleRotate(curr,dir1,dir1));\n } else if(isRedNode(curr.children[dir1]) && isRedNode(curr.children[dir1].children[dir2])) { //Case 2 and 3 // double rotation\n //doubleRotate\n\n }\n } else {\n //do nothing as black height is unchanged and red red violation\n }\n }//not sure about braces\n\n return insertNode(curr.children[dir1],node);\n }", "public void RBInsertFixup(Website site) {\r\n\t\tif (site == root) {\t\t\t//catches calling fixup on the root\r\n\t\t\tsite.setIsRed(false);\t//if it is the root, set to black\r\n\t\t} else if (site != root) {\t//iff it is not the root, continue \r\n\t\t\t\r\n\t\t\twhile (site.getParent().getIsRed() == true\r\n\t\t\t\t\t&& site.getParent().getParent() != null) { //while site's parent is red and site's parent's parent is not null\r\n\t\t\t\tif (site.getParent() == site.getParent().getParent().getLeft()) { //z's parent is the left child\r\n\t\t\t\t\tWebsite y = site.getParent().getParent().getRight(); //y is the right uncle\r\n\r\n\t\t\t\t\t//case 1\r\n\t\t\t\t\tif (y != null && y.getIsRed() == true) { \t//if y is not a null, which is counted as black, or if y is red\r\n\t\t\t\t\t\tsite.getParent().setIsRed(false); \t\t//sets site's parent to black\r\n\t\t\t\t\t\tif (site.getParent().getParent() != null) {\t//if it will not cause a null pointer error,\r\n\t\t\t\t\t\t\tsite.getParent().getParent().setIsRed(true); //sets grandparent to red\r\n\t\t\t\t\t\t\tsite=site.getParent().getParent();\t\t\t//sets site to grandparent\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (y != null) { //checks for null pointer exception\r\n\t\t\t\t\t\t\ty.setIsRed(false); //y is black\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t\t//case 2 rotate\r\n\t\t\t\t\telse if (site == site.getParent().getRight()) {\r\n\t\t\t\t\t\tsite = site.getParent();\t//updates site to its parent\r\n\t\t\t\t\t\tleftRotate(root, site);\t\t//roates updated parent\r\n\t\t\t\t\t} else {\t//case 3 rotate\r\n\t\t\t\t\t\tsite.getParent().setIsRed(false);\t\t//parent is black\r\n\t\t\t\t\t\tsite.getParent().getParent().setIsRed(true);\t//grandparent is red\r\n\t\t\t\t\t\trightRotate(root, site.getParent().getParent());\t//rotates to fix tree\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tWebsite y = site.getParent().getParent().getLeft(); //y is the left uncle\r\n\t\t\t\t\t//case 1 simple recoloring\r\n\t\t\t\t\tif (y != null && y.getIsRed() == true) { //if y is not a null, which is counted as black, or if y is red\r\n\t\t\t\t\t\tsite.getParent().setIsRed(false);\t\t//sets site's parent to black\r\n\t\t\t\t\t\tif (site.getParent().getParent() != null) {\t//if it will not cause a null pointer error,\r\n\t\t\t\t\t\t\tsite.getParent().getParent().setIsRed(true); //sets grandparent to red\r\n\t\t\t\t\t\t\tsite=site.getParent().getParent();\t\t\t\t//sets site to grandparent\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (y != null) {\t//checks for null pointer exception\r\n\t\t\t\t\t\t\ty.setIsRed(false);\t//y is black\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t\t\t//case 2 rotate \r\n\t\t\t\t\t\telse if (site == site.getParent().getLeft()) { \r\n\t\t\t\t\t\tsite = site.getParent();\t//update's site to its parent\r\n\t\t\t\t\t\trightRotate(root, site);\t//rotates updated parent\r\n\t\t\t\t\t} \r\n\t\t\t\t\t\t//case 3 rotate\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\tsite.getParent().setIsRed(false);\t//parent is black\r\n\t\t\t\t\t\tsite.getParent().getParent().setIsRed(true);\t//grandparent is red\r\n\t\t\t\t\t\tleftRotate(root, site.getParent().getParent());\t//rotates to fix tree\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif(site==root) { //if site is the root, \r\n\t\t\t\troot.setIsRed(false);\t//sets the root/site to black\r\n\t\t\t\tbreak;\t\t\t\t\t//breaks out of the loop\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\troot.setIsRed(false); //sets root to black just in case\r\n\t}", "private NodeTreeBinary<T> insert(NodeTreeBinary<T> h, T key) {\n\t\tif (h == null)\n\t\t\treturn new NodeTreeRB<T>(key, NodeTreeRB.RED);\n\n\t\tint cmp = comparar(h, key);\n\t\t\n\t\tif (cmp > 0)\n\t\t\th.setLeft(insert(h.getLeft(), key));\n\t\telse if (cmp > 0)\n\t\t\th.setRight(insert(h.getRight(), key));\n\t\telse\n\t\t\th.setData(key);\n\t\t\n\t\tif (isRed(h.getRight()) && !isRed(h.getLeft()))\n\t\t\th = rotateLeft(h);\n\t\tif (isRed(h.getLeft()) && isRed(h.getLeft().getLeft()))\n\t\t\th = rotateRight(h);\n\t\tif (isRed(h.getLeft()) && isRed(h.getRight()))\n\t\t\tflipColors(h);\n\n\t\tsetSize(h, getSize(h.getLeft()) + getSize(h.getRight()) + 1);\n\n\t\treturn h;\n\t}", "public void insert(T data) throws NullPointerException,\n IllegalArgumentException {\n // null references cannot be stored within this tree\n if(data == null) throw new NullPointerException(\n \"This RedBlackTree cannot store null references.\");\n\n Node<T> newNode = new Node<>(data);\n if(root == null) { root = newNode; } // add first node to an empty tree\n else insertHelper(newNode,root); // recursively insert into subtree\n \n //always sets root node of RBT to black\n root.isBlack = true;\n }", "private void adjustColorsInsertion(BSTNode node, BSTNode dad, Ref<Integer> b) {\n\t\tBSTNode grandad = dad.getParent(), uncle;\n\t\tif (grandad.getLeft() == dad)\n\t\t\tuncle = grandad.getRight();\n\t\telse\n\t\t\tuncle = grandad.getLeft();\n\t\tif (uncle != null && uncle.getColor() == Color.RED) {\n\t\t\tb.set(0);\n\t\t\tuncle.setColor(Color.BLACK);\n\t\t\tdad.setColor(Color.BLACK);\n\t\t\tgrandad.setColor(Color.RED);\n\t\t}\n\t\telse {\n\t\t\trotate(node, dad, grandad);\n\t\t\tb.set(2);\n\t\t}\n\t\tif (root.getColor() == Color.RED)\n\t\t\troot.setColor(Color.BLACK);\n\t}", "public void insert(int key, int val){\n\t\tNode add = new Node(key,val,\"Red\");\n\t\tinsertBST(root,add);\n\t\tfixViolation(add);\n\t}", "protected void redBlackFixUp(RedBlackNode<T> node) {\n if(node == _head) {\n node._isRed = false;\n return;\n }\n // node is child. a red node cannot have a red parent.\n while(node.getParent()._isRed) {\n RedBlackNode<T> parent = node.getParent();\n // if the parent is red, then it must have a parent.\n RedBlackNode<T> grandparent = parent.getParent();\n // if parent is left child, check right child *uncle* \n if(grandparent.getLeftChild() == parent) {\n RedBlackNode<T> uncle = grandparent.getRightChild();\n // if uncle is black\n if(uncle == null || !uncle._isRed) {\n // check whether or not there is a triangle\n // between node, parent, and grandparent.\n if (parent.getRightChild() == node) {\n parent = rotateLeft(parent);\n }\n parent._isRed = false;\n grandparent._isRed = true;\n rotateRight(grandparent);\n }\n else {\n // here uncle is red.\n parent._isRed = false;\n uncle._isRed = false;\n grandparent._isRed = true;\n node = grandparent;\n }\n }\n // if parent is right child, check left child *uncle* \n if(grandparent._rightChild == parent) {\n RedBlackNode<T> uncle = grandparent.getLeftChild();\n // if uncle is black\n if(uncle == null || !uncle._isRed) {\n // check whether or not there is a triangle\n // between node, parent, and grandparent.\n if (parent.getLeftChild() == node) {\n parent = rotateRight(parent);\n }\n parent._isRed = false;\n grandparent._isRed = true;\n rotateLeft(grandparent);\n }\n else {\n // here uncle is red.\n parent._isRed = false;\n uncle._isRed = false;\n grandparent._isRed = true;\n node = grandparent;\n }\n }\n\n if(node == _head) {\n node._isRed = false;\n return;\n }\n }\n return;\n }", "public Node insert(Node n, int key, Object object) throws NodeAlreadyExists {\n if (n == null)\n return (new Node(key, null)); //TODO: Determine what type of object to keep\n else {\n if (n.getKey() == key)\n throw new NodeAlreadyExists();\n\n // Insertion\n if (key < n.getKey()) {\n n.setLeft(insert(n.getLeft(), key, object));\n n.getLeft().setParent(n);\n } //if\n else if (key > n.getKey()) {\n n.setRight(insert(n.getRight(), key, object));\n n.getRight().setParent(n);\n } //else-if\n else {\n return n;\n } //else\n } //else\n\n // Right child is RED but left child is BLACK or doesn't exist\n if(isRed(n.getRight()) && !isRed(n.getLeft())){\n n = leftRotate(n);\n swapColors(n, n.getLeft());\n } //if\n\n // Child and parent are REDs\n if(isRed(n.getLeft()) && isRed(n.getLeft().getLeft())){\n n = rightRotate(n);\n swapColors(n, n.getRight());\n } //if\n\n // Both childs are RED\n if(isRed(n.getLeft()) && isRed(n.getRight())){\n n.setColor(!n.isColor());\n n.getLeft().setColor(BLACK);\n n.getRight().setColor(BLACK);\n } //if\n\n root.setColor(BLACK);\n\n return n;\n }", "public void add(Comparable obj)\n { \n \t //TODO\n \t //add code\n \t Node n = new Node(); \n \t n.data = obj;\n \t // \tn.left = null;\n \t // \tn.right = null;\n\n \t Node y = null;\n \t // \tNode x = root;\n \t Node current = root;\n \t while(current != null)\n \t {\n \t\t y = current;\n \t\t if(n.data.compareTo(root.data) < 0)\n \t\t\t current = current.left;\n \t\t else\n \t\t\t current = current.right;\n \t }\n\n\n \t n.parent = y;\n \t if(y == null)\n \t\t root = n;\n \t else\n \t\t if(n.data.compareTo(y.data) < 0)\n \t\t\t y.left = n;\n \t\t else\n \t\t\t y.right = n;\n \t n.left = null;\n \t n.right = null;\n \t n.color = RED;\n \t // \troot = new Node();\n \t // \troot.data = \"k\";\n \t // \tNode test = new Node();\n \t // \ttest.data = \"g\";\n \t // \troot.left= test;\n// \t System.out.println(\"the insertion looks like:\");\n// \t System.out.println(BTreePrinter.printNode(root));\n\n \t fixup(root,n);\n \t /*\n \tThe insert() method places a data item into the tree.\n\n \tInsertions\n \tpseudocode for\n \tRB-Insert(T,z)\n \ty = nil[T]\n \tx = root[T]\n \twhile x != nil[T]\n \ty = x\n \tif key[z] < key[x] then\n \tx = left[x]\n \telse\n \tx = right[x]\n \tp[z] = y\n \tif y = nil[T]\n \troot[T] = z\n \telse\n \tif key[z] < key[y] then\n \tleft[y] = z\n \telse\n \tright[y] = z\n \tleft[z] = nil[T]\n \tright[z] = nil[T]\n \tcolor[z] = RED\n \tRB-Insert-fixup(T,z)\n \t */\n }", "public void insert(T key) {\r\n RBNode<T> node = new RBNode<>(key, RED, null, null, null);\r\n if(node != null)\r\n insert(node);\r\n }", "public void insert(E data){\n \t// Preform a regular insert\n // Check to make sure the tree remains an RBT tree\n\tNode<E> z = new Node<E>(data); //In the book, data is defined as a Node called z so I decided to do the same\n\tNode<E> y = sentinel; //In the book, y is assigned to the sentinel\n\tNode<E> x = root; //Node x is assigned to the root\n\twhile (x != sentinel) { //The first instance of null is replaced by the sentinel\n\t\ty = x;\n\t\tif (z.getData().compareTo(x.getData()) < 0) {\n\t\t\tx = x.getLeftChild();\n\t\t} else {\n\t\t\tx = x.getRightChild();\n\t\t}\n\t}\n\tz.setParent(y);\n\tif (y == sentinel) {\n\t\troot = z;\n\t} else {\n\t\tif (z.getData().compareTo(y.getData()) < 0) {\n\t\t\ty.setLeftChild(z);\n\t\t} else {\n\t\t\ty.setRightChild(z);\n\t\t}\n\t}\n\n\t//This is used to maintain the proper tree structure and RB properties\n\tz.setLeftChild(sentinel); //Set z.left is set to the sentinel\n\tz.setRightChild(sentinel); //Set z.right is set to the sentinel \n\tz.setColor('R');\n\n\t//Going to change z's positioning in the tree with this function, fixInsert()\n\tfixInsert(z);\n }", "public void insert(T d) {\n\t\t// create three new nodes\n\t\tRedBlackBSTNode y = new RedBlackBSTNode();\n\n\t\tRedBlackBSTNode x = new RedBlackBSTNode();\n\t\t// create z and put the parameter as d\n\t\tRedBlackBSTNode z = new RedBlackBSTNode(d);\n\t\t// set x as the root\n\t\tx = root;\n\n\t\t// if the root is null, z should become the root\n\t\tif (root.isNull()) {\n\t\t\t// root should be the parent of z first\n\t\t\tz.setParent(root);\n\t\t\t// then root is set to z\n\t\t\troot = z;\n\n\t\t}\n\t\t// while the root (x) is not null\n\t\twhile (!x.isNull()) {\n\t\t\t// set y as equal to x\n\t\t\ty = x;\n\t\t\t// if z is bigger than z\n\t\t\tif (z.getData().compareTo(x.getData()) < 0) {\n\t\t\t\t// x is its left child\n\t\t\t\tx = x.getLeft();\n\t\t\t} else {\n\t\t\t\t// else x is its right child\n\t\t\t\tx = x.getRight();\n\t\t\t}\n\t\t}\n\t\t// set the parent of z as y\n\t\tz.setParent(y);\n\t\t// if y is null\n\t\tif (y.isNull()) {\n\t\t\t// set the root as z\n\t\t\troot = z;\n\n\t\t}\n\t\t// else if z is bigger than y\n\t\telse if (z.getData().compareTo(y.getData()) < 0) {\n\t\t\t// y becomes the left child of y\n\t\t\ty.setLeft(z);\n\n\t\t}\n\n\t\telse {\n\t\t\t// else y is the right child of z\n\t\t\ty.setRight(z);\n\n\t\t}\n\t\t// create a new temp node that gets the right child of z\n\t\tRedBlackBSTNode temp = z.getRight();\n\t\t// set temp as the left child of z\n\t\ttemp = z.getLeft();\n\t\t// set z as red\n\t\tz.setRed();\n\t\t// call fix up on z\n\t\tfixup(z);\n\n\t}", "private Node insertNode(Node parent, Node curr, EventPair eventPair) {\n\t\tif(curr == null || curr.isNull)\n\t\t{\n\t\t\tif(parent != null)\n\t\t\t{\n\t\t\t\tlastInsertedNode = createNode(eventPair, Color.RED, parent);\n\t\t\t\treturn lastInsertedNode;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlastInsertedNode = createNode(eventPair, Color.BLACK, parent);\n\t\t\t\treturn lastInsertedNode;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tboolean toLeft = false;\n\t\t\tif(curr.ID > eventPair.ID)\n\t\t\t{\n\t\t\t\tNode n = insertNode(curr, curr.left, eventPair);\n\t\t\t\tif (n == curr.parent)\n\t\t\t\t\treturn n;\n\t\t\t\tcurr.left = n;\n\t\t\t\ttoLeft = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tNode n = insertNode(curr, curr.right, eventPair);\n\t\t\t\tif (n == curr.parent)\n\t\t\t\t\treturn n;\n\t\t\t\tcurr.right = n;\n\t\t\t\ttoLeft = false;\n\t\t\t}\n\t\t\tif(toLeft) {\n\t\t\t\tif(curr.color == Color.RED && curr.left.color == Color.RED) {\n\t\t\t\t\tNode sibling = getSibling(curr);\n\t\t\t\t\tif(sibling == null || sibling.color == Color.BLACK) {\n\t if(isLeftChild(curr)) {\n\t rotateRight(curr, true);\n\t } else {\n\t \trotateRight(curr.left, false);\n\t curr = curr.parent;\n\t rotateLeft(curr, true);\n\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tcurr.color = Color.BLACK;\n\t sibling.color = Color.BLACK;\n\t if(curr.parent.parent != null) {\n\t curr.parent.color = Color.RED;\n\t }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(curr.color == Color.RED && curr.right.color == Color.RED) {\n\t Node sibling = getSibling(curr);\n\t if(sibling == null || sibling.color == Color.BLACK) {\n\t if(!isLeftChild(curr)) {\n\t \trotateLeft(curr, true);\n\t } else {\n\t \trotateLeft(curr.right, false);\n\t \tcurr = curr.parent;\n\t rotateRight(curr, true);\n\t }\n\t } else {\n\t \tcurr.color = Color.BLACK;\n\t sibling.color = Color.BLACK;\n\t if(curr.parent.parent != null) {\n\t \tcurr.parent.color = Color.RED;\n\t }\n\t }\n\t }\n\t\t\t}\n\t\t}\n\t\treturn curr;\n\t}", "private void adjustRedParentNode(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n if(deficientNode.parent.color == Color.RED && sibling.color == Color.BLACK && sibling.left.color == Color.BLACK\n && sibling.right.color == Color.BLACK) {\n \tsibling.color = Color.RED;\n \tdeficientNode.parent.color = Color.BLACK;\n return;\n } else {\n \tadjustRedChildBlackSibling(deficientNode, rootRef);\n }\n\t}", "public void insert(TKey key, TValue data) {\n Node n = new Node(key, data, true); // nodes start red\n // normal BST insert; n will be placed into its initial position.\n // returns false if an existing node was updated (no rebalancing needed)\n boolean insertedNew = bstInsert(n, mRoot); \n if (!insertedNew) return;\n // check cases 1-5 for balance violations.\n checkBalance(n);\n }", "public void setRed(RBNode<T> node) {\n if(node != null)\r\n node.color = RED;\r\n }", "private void removeFixUp(RBNode<T> node, RBNode<T> parent) {\r\n RBNode<T> other;\r\n\r\n while((node == null || isBlack(node)) && (node != this.root)) {\r\n if(parent.left == node) { //node is leftChild\r\n other = parent.right; //brother of node\r\n if(isRed(other)) { //case1: brother is red\r\n setBlack(other);\r\n setRed(parent);\r\n leftRotate(parent);\r\n other = parent.right;\r\n }\r\n\r\n //case2: brother is black, both children of brother is black\r\n if((other.left == null || isBlack(other.left)) &&\r\n (other.right == null || isBlack(other.right))) {\r\n setRed(other);\r\n node = parent;\r\n parent = parentOf(node);\r\n } else {\r\n //case3: brother is black, left red right black\r\n if(other.right == null || isBlack(other.right)) {\r\n setBlack(other.left);\r\n setRed(other);\r\n rightRotate(other);\r\n other = parent.right;\r\n }\r\n\r\n //case4: brother is black, right red left any color\r\n setColor(other, colorOf(parent));\r\n setBlack(parent);\r\n setBlack(other.right);\r\n leftRotate(parent);\r\n node = this.root;\r\n break;\r\n }\r\n } else {\r\n other = parent.left;\r\n\r\n if (isRed(other)) {\r\n //case1: brother is red\r\n setBlack(other);\r\n setRed(parent);\r\n rightRotate(parent);\r\n other = parent.left;\r\n }\r\n\r\n if ((other.left==null || isBlack(other.left)) &&\r\n (other.right==null || isBlack(other.right))) {\r\n //case2: brother is black, both children of brother is black\r\n setRed(other);\r\n node = parent;\r\n parent = parentOf(node);\r\n } else {\r\n\r\n if (other.left==null || isBlack(other.left)) {\r\n //case3: brother is black, left red right black\r\n setBlack(other.right);\r\n setRed(other);\r\n leftRotate(other);\r\n other = parent.left;\r\n }\r\n\r\n //case4: brother is black, left red right any color\r\n setColor(other, colorOf(parent));\r\n setBlack(parent);\r\n setBlack(other.left);\r\n rightRotate(parent);\r\n node = this.root;\r\n break;\r\n }\r\n }\r\n }\r\n if (node!=null)\r\n setBlack(node);\r\n }", "static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }", "public void RBFixup(Node n) {\r\n\t\twhile(n.parent.color == 0) {\r\n\t\t\tif(n.parent == n.parent.parent.left) {\r\n\t\t\t\tNode y = n.parent.parent.right;\r\n\t\t\t\tif(y.color == 0) {\r\n\t\t\t\t\tn.parent.color = 1;\r\n\t\t\t\t\ty.color = 1;\r\n\t\t\t\t\tn.parent.parent.color = 0;\r\n\t\t\t\t\tn = n.parent.parent;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif(n == n.parent.right) {\r\n\t\t\t\t\t\tn = n.parent;\r\n\t\t\t\t\t\tleftRotate(n);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tn.parent.color = 1;\r\n\t\t\t\t\tn.parent.parent.color = 0;\r\n\t\t\t\t\t//mark n and n's grandparent, because in the end these two nodes will be the children\r\n\t\t\t\t\t//marking will be handled in recUpdateNode\r\n\t\t\t\t\tn.marked = true;\r\n\t\t\t\t\tn.parent.parent.marked = true;\r\n\t\t\t\t\trightRotate(n.parent.parent);\r\n\t\t\t\t\tif(hFlag == 1)\r\n\t\t\t\t\t\theight--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tNode y = n.parent.parent.left;\r\n\t\t\t\tif(y.color == 0) {\r\n\t\t\t\t\tn.parent.color = 1;\r\n\t\t\t\t\ty.color = 1;\r\n\t\t\t\t\tn.parent.parent.color = 0;\r\n\t\t\t\t\tn = n.parent.parent;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif(n == n.parent.left) {\r\n\t\t\t\t\t\tn = n.parent;\r\n\t\t\t\t\t\trightRotate(n);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tn.parent.color = 1;\r\n\t\t\t\t\tn.parent.parent.color = 0;\r\n\t\t\t\t\t//mark n and n's grandparent, because in the end these two nodes will be the children\r\n\t\t\t\t\t//marking will be handled in recUpdateNode\r\n\t\t\t\t\tn.marked = true;\r\n\t\t\t\t\tn.parent.parent.marked = true;\r\n\t\t\t\t\tleftRotate(n.parent.parent);\r\n\t\t\t\t\tif(hFlag == 1)\r\n\t\t\t\t\t\theight--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\troot.color = 1;\r\n\t}", "protected void addFixup(Node<T> u) {\n\t\twhile (u.colour == red) {\n\t\t\tif (u == r) { // u is the root - done\n\t\t\t\tu.colour = black;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tNode<T> w = u.parent;\n\t\t\tif (w.left.colour == black) { // ensure left-leaning\n\t\t\t\tflipLeft(w);\n\t\t\t\tu = w;\n\t\t\t\tw = u.parent;\n\t\t\t}\n\t\t\tif (w.colour == black)\n\t\t\t\treturn; // no red-red edge = done\n\t\t\tNode<T> g = w.parent; // grandparent of u\n\t\t\tif (g.right.colour == black) {\n\t\t\t\tflipRight(g);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tpushBlack(g);\n\t\t\t\tu = g;\n\t\t\t}\n\t\t}\n\t}", "public void insertElement(int newData)\n {\n if( root == null )\n {\n this.root = new Node(newData);\n this.actualNode = this.root;\n }\n else\n {\n Node newNode = new Node(newData);\n Node loopAux = this.actualNode;\n\n while(true)\n {\n if( !this.altMode )\n {\n if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = true;\n }\n break;\n\n } else if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = true;\n }\n break;\n } else\n {\n if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else\n loopAux = loopAux.getLeftChild();\n }\n }\n else if( this.altMode ) //basically the same, but nodes are added form the right side\n { // and actualNode is set to latest '0' node\n if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = false;\n }\n\n break;\n\n } else if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = false;\n }\n\n break;\n } else\n {\n if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else\n loopAux = loopAux.getRightChild();\n }\n }\n }\n }\n }", "public void fixInsert(Node<E> z) {\n\t\twhile (z.getParent().getColor() == 'R') {\n\t\t\tif (z.getParent() == z.getParent().getParent().getLeftChild()) {\n\t\t\t\tNode<E> y = z.getParent().getParent().getRightChild();\n\t\t\t\t//case 1 if z.p is the root, then z.p is black\n\t\t\t\tif (y.getColor() == 'R') {\n\t\t\t\t\tz.getParent().setColor('B');\n\t\t\t\t\ty.setColor('B');\n\t\t\t\t\tz.getParent().getParent().setColor('R');\n\t\t\t\t\tz = z.getParent().getParent();\n\t\t\t\t} else {\n\t\t\t\t\t//case 2. z’s uncle y is black and z is a right child\n\t\t\t\t\tif (z == z.getParent().getRightChild()) {\n\t\t\t\t\t\tz = z.getParent();\n\t\t\t\t\t\tleftRotate(z);\n\t\t\t\t\t}\n\t\t\t\t\t//case 3. z’s uncle y is black and z is a left child\n\t\t\t\t\tz.getParent().setColor('B');\n\t\t\t\t\tz.getParent().getParent().setColor('R');\n\t\t\t\t\trightRotate(z.getParent().getParent());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//This does the same thing as the code above in the if statement\n\t\t\t\t//However, there we switch the \"left\" and \"right\" from the if statement\n\t\t\t\tNode<E> y = z.getParent().getParent().getLeftChild();\n\t\t\t\t//case 1 if z.p is the root, then z.p is black\n\t\t\t\tif (y.getColor() == 'R') {\n\t\t\t\t\tz.getParent().setColor('B');\n\t\t\t\t\ty.setColor('B');\n\t\t\t\t\tz.getParent().getParent().setColor('R');\n\t\t\t\t\tz = z.getParent().getParent();\n\t\t\t\t} else {\n\t\t\t\t\t//case 2. z’s uncle y is black and z is a right child\n\t\t\t\t\tif (z == z.getParent().getLeftChild()) {\n\t\t\t\t\t\tz = z.getParent();\n\t\t\t\t\t\trightRotate(z);\n\t\t\t\t\t}\n\t\t\t\t\t//case 3. z’s uncle y is black and z is a left child\n\t\t\t\t\tz.getParent().setColor('B');\n\t\t\t\t\tz.getParent().getParent().setColor('R');\n\t\t\t\t\tleftRotate(z.getParent().getParent());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\troot.setColor('B');\n\t\n\t}", "private void insertHelper(Node<T> newNode, Node<T> subtree) {\n int compare = newNode.data.compareTo(subtree.data);\n // do not allow duplicate values to be stored within this tree\n if(compare == 0) throw new IllegalArgumentException(\n \"This RedBlackTree already contains that value.\");\n\n // store newNode within left subtree of subtree\n else if(compare < 0) {\n if(subtree.leftChild == null) { // left subtree empty, add here\n subtree.leftChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.leftChild);\n }\n\n // store newNode within the right subtree of subtree\n else { \n if(subtree.rightChild == null) { // right subtree empty, add here\n subtree.rightChild = newNode;\n newNode.parent = subtree;\n // otherwise continue recursive search for location to insert\n } else insertHelper(newNode, subtree.rightChild);\n }\n \n enforceRBTreePropertiesAfterInsert(newNode);\n }", "Node insertRec(Node node, int data) {\n /* If the tree is empty, return a new node */\n if (node == null) {\n this.root = new Node(data);\n return this.root;\n }\n\n /* Otherwise, recur down the tree */\n if (data < node.data) {\n node.left = this.insertRec(node.left, data);\n } else {\n node.right = this.insertRec(node.right, data);\n }\n return node;\n }", "Node insertRec(T val, Node node, List<Node> path, boolean[] wasInserted) {\n if (node == null) {\n wasInserted[0] = true;\n Node newNode = new Node(val);\n path.add(newNode);\n return newNode;\n }\n\n int comp = val.compareTo(node.val);\n if (comp < 0) {\n node.left = insertRec(val, node.left, path, wasInserted);\n } else if (comp > 0) {\n node.right = insertRec(val, node.right, path, wasInserted);\n }\n\n path.add(node);\n return node;\n }", "private void insertNodeIntoTree(Node node) {\n\t\troot = insert(root,node);\t\n\t}", "public boolean insert(T key, E value) {\r\n\t\t// Creating a Node\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t\t// First Node will be the Root\r\n\t\tif (checkSize(this.size)) {\r\n\t\t\tthis.root = insertedNode;\r\n\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t} else {\r\n\t\t\tRBNode<T, E> parent = nillLeaf;\r\n\t\t\tRBNode<T, E> current = root;\r\n\t\t\twhile (current != nillLeaf) {\r\n\t\t\t\tSystem.out.println(\"Test1\");\r\n\t\t\t\t// add to left\r\n\t\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test2\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.leftChild;\r\n\t\t\t\t}\r\n\t\t\t\t// add to right\r\n\t\t\t\telse if (key.compareTo(current.getUniqueKey()) > 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test3\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.rightChild;\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"Test4\");\r\n\t\t\t\t\t// return if the key is a duplicate\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Add a node to the root.\r\n\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\tSystem.out.println(\"Test5\");\r\n\t\t\t\tparent.leftChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t} else {\r\n\t\t\t\tparent.rightChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.size++;\r\n\t\treturn true;\r\n\t}", "private void adjustDeficientRedSiblingNode(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n if(sibling.color == Color.RED) {\n if(isLeftChild(sibling)) {\n rotateRight(sibling, true);\n } else {\n \trotateLeft(sibling, true);\n }\n if(sibling.parent == null) {\n rootRef.set(sibling);\n }\n }\n adjustDeficientBlackSiblingNode(deficientNode, rootRef);\n\t}", "public void insert(HuffmanTree node);", "private static void rightRightInsert() {\n System.out.println(\"RightRight Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public RedBlackNode(int element, RedBlackNode leftChild, RedBlackNode rightChild) \n { \n this.element = element; \n this.leftChild = leftChild; \n this.rightChild = rightChild; \n color = 1; \n }", "public void insert(Integer key){\r\n\t\tint start=this.root;\r\n\t\tint currentPos=avail;\r\n\t\tint temp=-1;\r\n\t\twhile(increaseCompares() && start!=-1) {\r\n\t\t\ttemp=start;\r\n\t\t\tcompares++;\r\n\t\t\tif(increaseCompares() && key<getKey(start)) {\r\n\t\t\t\tstart=getLeft(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstart=getRight(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Tree is empty. New Node is now root of tree\r\n\t\tif(increaseCompares() && temp==-1) {\r\n\t\t\tsetRoot(0);\r\n\t\t\tcompares++;\r\n\t\t\tsetKey(avail, key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\t//Compare values and place newNode either left or right of previous Node\r\n\t\telse if(increaseCompares() && key<getKey(temp)) {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetLeft(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetRight(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t}", "private static void treeInsert(String newItem) {\n if (root == null) {\n // The tree is empty. Set root to point to a new node containing\n // the new item. This becomes the only node in the tree.\n root = new TreeNode(newItem);\n return;\n }\n TreeNode runner; // Runs down the tree to find a place for newItem.\n runner = root; // Start at the root.\n while (true) {\n if (newItem.compareTo(runner.item) < 0) {\n // Since the new item is less than the item in runner,\n // it belongs in the left subtree of runner. If there\n // is an open space at runner.left, add a new node there.\n // Otherwise, advance runner down one level to the left.\n if (runner.left == null) {\n runner.left = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.left;\n } else {\n // Since the new item is greater than or equal to the item in\n // runner it belongs in the right subtree of runner. If there\n // is an open space at runner.right, add a new node there.\n // Otherwise, advance runner down one level to the right.\n if (runner.right == null) {\n runner.right = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.right;\n }\n } // end while\n }", "private void resolveRed(Position<Entry<K, V>> p) {\n Position<Entry<K, V>> parent = parent(p);\n if (isRed(parent)) {\n Position<Entry<K, V>> uncle = sibling(parent);\n if (isBlack(uncle)) { // Case 1: mis-shaped 4-node\n Position<Entry<K, V>> middle = restructure(p); // trinode restructuring\n makeBlack(middle);\n makeRed(left(middle));\n makeRed(right(middle));\n } else { // Case 2: overfill 5-node\n makeBlack(parent);\n makeBlack(uncle);\n Position<Entry<K, V>> grand = parent(parent);\n if (!isRoot(grand)) {\n makeRed(grand);\n resolveRed(grand);\n }\n }\n }\n }", "@Test\n public void testInsertCaso1() {\n myTree.insert(50);\n Assert.assertTrue(myTree.getRoot().getData() == 50);\n Assert.assertTrue(myTree.getRoot().getParent() == null);\n Assert.assertTrue(myTree.getRoot().getLeft().equals( NIL ));\n Assert.assertTrue(myTree.getRoot().getRight().equals( NIL ));\n Assert.assertTrue(((RBNode<Integer>) myTree.getRoot()).getColour() == Colour.BLACK );\n }", "private void adjustBlackSiblingRedChild(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n\t\tsibling.color = sibling.parent.color;\n\t\tsibling.parent.color = Color.BLACK;\n if(isLeftChild(deficientNode)) {\n \tsibling.right.color = Color.BLACK;\n rotateLeft(sibling, false);\n } else {\n \tsibling.left.color = Color.BLACK;\n rotateRight(sibling, false);\n }\n if(sibling.parent == null) {\n \trootRef.set(sibling);\n }\n\t}", "public void recInsertNode(TriLinkNode curNode)\r\n {\r\n if(curNode.i1==true&&curNode.i2==true)\r\n {\r\n if(temp.v1<curNode.v1)\r\n {\r\n if(curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else\r\n {\r\n curNode.left=temp;\r\n curNode.left.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v2)\r\n {\r\n if(curNode.right!=null)\r\n {\r\n recInsertNode(curNode.right);\r\n }else\r\n {\r\n curNode.right=temp;\r\n curNode.right.up=curNode;\r\n }\r\n }else if(temp.v1>curNode.v1&&temp.v1<curNode.v2)\r\n {\r\n if(curNode.down!=null)\r\n {\r\n recInsertNode(curNode.down);\r\n }else\r\n {\r\n curNode.down=temp;\r\n curNode.down.up=curNode;\r\n }\r\n }\r\n }else if(temp.v1>curNode.v1)\r\n {\r\n curNode.v2=temp.v1;\r\n curNode.d2=false;\r\n curNode.i2=true;\r\n }else if(temp.v1<curNode.v1&&curNode.left!=null)\r\n {\r\n recInsertNode(curNode.left);\r\n }else if(temp.v1<curNode.v1&&curNode.left==null)\r\n {\r\n curNode.left=temp;\r\n }\r\n }", "Node insertRec(Node root, int data) { \n \n // If the tree is empty, \n // return a new node \n if (root == null) { \n root = new Node(data); \n return root; \n } \n \n /* Otherwise, recur down the tree */\n if (data < root.data) \n root.left = insertRec(root.left, data); \n else if (data > root.data) \n root.right = insertRec(root.right, data); \n \n /* return the (unchanged) node pointer */\n return root; \n }", "public void rebalance(NodeRB node){\n \r\n if (node == null){ //failsafe. probably not needed.\r\n return;\r\n }\r\n\r\n NodeRB parent = null, uncle = null, grandparent = null;\r\n parent = fetchParentOf(node); // attempt to fetch the parent. if null, nothing happens.\r\n \r\n if (parent != null){ // must have a parent to have a grandparent. A parent is needed for rebalancing.\r\n \r\n grandparent = fetchParentOf(parent); // attempt to fetch the grandparent. if null, nothing happens.\r\n \r\n if (grandparent != null && parent.color == 'r'){ // grandparent is also required for rebalancing.\r\n \r\n //attempt to find an uncle. can return null. in this case, see the first 'if' statement.\r\n uncle = (grandparent.left == parent) ? grandparent.right : grandparent.left;\r\n\r\n if (uncle == null){ // Phantom, used for reference. assumes the role of a black null leaf.\r\n //System.out.println(\"[i] Uncle is NULL. Assuming as black null leaf.\");\r\n uncle = new NodeRB(0);\r\n uncle.color = 'b';\r\n }\r\n\r\n if (uncle.color == 'r'){ // case 0\r\n System.out.println(\"[i] Case 0: Recolor.\");\r\n recolor(parent);\r\n recolor(uncle);\r\n recolor(grandparent);\r\n return;\r\n }\r\n\r\n if (uncle.color == 'b'){\r\n\r\n //case 1: simple right\r\n if (parent.left == node && grandparent.left == parent){\r\n System.out.println(\"[i]: Simple Right (RR) Rotation...\");\r\n rotateRight(grandparent);\r\n recolor(parent);\r\n recolor(grandparent);\r\n }\r\n\r\n //case 2: simple left\r\n else if (parent.right == node && grandparent.right == parent){\r\n System.out.println(\"[i]: Simple left (LL) Rotation...\");\r\n rotateLeft(grandparent);\r\n recolor(parent);\r\n recolor(grandparent);\r\n }\r\n\r\n //case 3: double left\r\n else if (parent.left == node && grandparent.right == parent){\r\n System.out.println(\"[i]: Double Left (RL) Rotation...\");\r\n rotateRight(parent);\r\n rotateLeft(grandparent);\r\n recolor(node);\r\n recolor(grandparent);\r\n }\r\n\r\n //case 4: double right\r\n else if (parent.right == node && grandparent.left == parent){\r\n System.out.println(\"[i]: Double Right (LR) Rotation...\");\r\n rotateLeft(parent);\r\n rotateRight(grandparent);\r\n recolor(node);\r\n recolor(grandparent);\r\n }\r\n\r\n }\r\n\r\n }\r\n }\r\n \r\n }", "public void run() \n\t{\n\t\tNode currentNode = this.tree.getRoot();\n\t\t\n\t\t//if the tree is empty and set the new node as the root node\n\t\tif (this.tree.getRoot() == null) \n\t\t{\n\t\t\tthis.tree.setRoot(this.node = new Node(this.node));\n\t\t\tthis.node.advanceToTheRoot();\n\t\t\ttree.getNote().setNote(\"Inserting a new root node [\" + node.getData()+\"].\");\n\t\t\twaitOnPause();\n\t\t} \n\t\telse \n\t\t{\n\t\t\t//otherwise go above the node and start to search\n\t\t\tthis.node.advanceToAboveTheRoot();\n\t\t\ttree.getNote().setNote(\"Starting to insert node [\"+this.value+\"].\");\n\t\t\twaitOnPause();\n\t\t\t\n\t\t\twhile (true) \n\t\t\t{\n\t\t\t\tint result = 0;\n\t\t\t\tboolean exit = false;\n\t\t\t\t\n\t\t\t\t//if the new node and the node which is being search are both numbers then \n\t\t\t\t//..convert their values into numbers and compare them.\n\t\t\t\tif(tree.isNumeric(currentNode.getData()) && tree.isNumeric(this.value))\n\t\t\t\t{\n\t\t\t\t\tint current = Integer.parseInt(currentNode.getData());\n\t\t\t\t\tint thisValue = Integer.parseInt(this.value);\n\t\t\t\t\t\n\t\t\t\t\tif (current == thisValue)\n\t\t\t\t\t\tresult = 1;\n\t\t\t\t\t\n\t\t\t\t\t// if the new node comes before the current node, go left\n\t\t\t\t\tif (thisValue < current) \n\t\t\t\t\t\tresult = 2;\n\t\t\t\t\telse if (thisValue > current) \n\t\t\t\t\t\tresult = 3;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//else the node which is being searched is a number so compare\n\t\t\t\t\t//..them both as words.\n\t\t\t\t\tif (currentNode.getData().compareTo(this.value) == 0) \n\t\t\t\t\t\tresult = 1;\n\t\t\t\t\t\n\t\t\t\t\t// if the new node comes before the current node, go left\n\t\t\t\t\tif (this.value.compareTo(currentNode.getData()) < 0) \n\t\t\t\t\t\tresult = 2;\n\t\t\t\t\telse if (this.value.compareTo(currentNode.getData()) > 0)\n\t\t\t\t\t\tresult = 3;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch(result)\n\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t//if the node already exists in the tree then remove the 'Search' node\n\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] already exists in the tree.\");\n\t\t\t\t\t\tif(!mf.getOpenF())\n\t\t\t\t\t\t\tthis.node.bgColor(node.getDeleteColor());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.node.setColor(node.getInvisibleColor(), node.getInvisibleColor());\n\t\t\t\t\t\twaitOnPause();\n\t\t\t\t\t\tthis.node.goDown();\n\t\t\t\t\t\ttree.getNote().setNote(\"\");\n\t\t\t\t\t\twaitOnPause();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t//if the new node is less than the node which is being searched then go to its left\n\t\t\t\t\t\t//...child. If the left child is empty then set the new node as the left child and\n\t\t\t\t\t\t//...connect them both.\n\t\t\t\t\t\ttree.getNote().setNote(\"Checking left side since node [\" + this.value +\n\t\t\t\t\t\t\t\t\"] is less than node [\"+ currentNode.getData()+\"].\");\n\t\t\t\t\t\tif (currentNode.getLeft() != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode.connectNode(this.node = new Node(this.node),\"left\");\n\t\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] inserted since node [\"+currentNode.getData()+\n\t\t\t\t\t\t\t\t\t\"]'s left child is empty.\");\n\t\t\t\t\t\t\texit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t//if the new node is greater than the node which is being searched then go to its right\n\t\t\t\t\t\t//...child. If the right child is empty then set the new node as the right child and\n\t\t\t\t\t\t//...connect them both.\n\t\t\t\t\t\ttree.getNote().setNote(\"Going to right side since node [\" + this.value +\n\t\t\t\t\t\t\t\t\"] is greater than node [\"+ currentNode.getData()+\"].\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (currentNode.getRight() != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// create a new node\n\t\t\t\t\t\t\tthis.node = new Node(this.node);\n\t\t\t\t\t\t\tcurrentNode.connectNode(this.node,\"right\");\n\t\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] inserted since node [\"+currentNode.getData()+\n\t\t\t\t\t\t\t\t\t\"]'s right child is empty.\");\n\t\t\t\t\t\t\texit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(exit)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//go to above the next node which is being searched.\n\t\t\t\tthis.node.advanceToNode(currentNode);\n\t\t\t\twaitOnPause();\t\n\t\t\t}\n\t\t\t\n\t\t\tthis.node = (this.tree.node = null);\n\t\t\t\n\t\t\t//if the tree is not empty then reposition it.\n\t\t\tif(this.tree.getRoot() != null)\n\t\t\t\t\tthis.tree.getRoot().repositionTree();\n\t\t\t\n\t\t\twaitOnPause();\n\t\t\t\n\t\t\t//check if the tree is balanced.\n\t\t\tthis.tree.reBalanceNode(currentNode);\n\t\t}\n\t\ttree.getNote().setNote(\"Insertion Complete.\");\n\t\ttree.getMainFrame().getStack().push(\"i \"+this.value); //add the operation to the stack\n\t}", "public void RBInsert(Website site) {\r\n\t\tWebsite y = null; // makes empty pointer y\r\n\t\tWebsite x = root; // starts at root\r\n\t\twhile (x != null) { // if root is not null\r\n\t\t\ty = x; // points to x\r\n\t\t\tif (site.getPageRank() >= x.getPageRank()) { // if site has a greater pagerank, its value is smaller, and x\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// is on the left\r\n\t\t\t\tx = x.getLeft(); // goes to the left child of x\r\n\t\t\t} else {\r\n\t\t\t\tx = x.getRight(); // goes to the right child of x otherwise\r\n\t\t\t}\r\n\t\t}\r\n\t\tsite.setParent(y); // sets the parent of the inserted Website to y\r\n\t\tif (y == null) { // list is empty\r\n\t\t\tsetRoot(site); // set root to entered website\r\n\t\t} else if (site.getPageRank() >= y.getPageRank()) {// if pageRank is greater, score is smaller, belongs on the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// left\r\n\t\t\ty.setLeft(site); // sets left to site\r\n\t\t} else {\r\n\t\t\ty.setRight(site); // else sets right to the site\r\n\t\t}\r\n\t\tRBInsertFixup(site); //calls fixup to ensure property\r\n\t}", "public void RB_Insert(ArvoreRB A, Node z){\r\n Node y = A.nil;\r\n Node x = A.raiz; \r\n\r\n while (x != A.nil) {\r\n y = x;\r\n if (z.conteudoNo.compareToIgnoreCase(x.conteudoNo) < 0) { \r\n x = x.esq;\r\n } else {\r\n x = x.dir;\r\n }\r\n }\r\n z.pai = y;\r\n if (y == A.nil) {\r\n A.raiz = z;\r\n } else if (z.conteudoNo.compareToIgnoreCase(y.conteudoNo) < 0) {\r\n y.esq = z;\r\n } else {\r\n y.dir = z;\r\n }\r\n z.esq = A.nil;\r\n z.dir = A.nil;\r\n z.cor = \"vermelho\";\r\n insertFixup(A,z);\r\n }", "public void insertRight(Node node, Node newNode) {\n\t\tif(node == tail) {\n\t\t\tthis.insertRear(newNode);\n\t\t} else {\n\t\t\tnewNode.prev = node;\n\t\t\tnewNode.next = node.next;\n\n\t\t\tnode.next.prev = newNode;\n\t\t\tnode.next = newNode;\n\n\t\t\tsize++;\n\t\t}\n\t}", "private Node moveRedRight(Node h) {\n flipColor(h);\n if (isRed(h.left.left)) {\n h = rotateRight(h);\n flipColor(h);\n }\n }", "private Node insert(Node curr, Node node) {\n\t\tif(curr==null){\n\t\t\tcurr = node;\n\t\t\treturn curr;\n\t\t}\n\t\telse if(curr.getId() > node.getId()){\n\t\t\t curr.setLeft(insert(curr.getLeft(),node));\n\t\t}\n\t\telse if(curr.getId() < node.getId()){\n\t\t\t curr.setRight(insert(curr.getRight(),node));\n\t\t}\n\t\treturn curr;\n\t}", "public Node insertAfter(Node node);", "public void InsertNode(int key){\n boolean isRightChild = false;\n boolean isDuplicate = false;\n if(root == null){\n root = new Node(key);\n return;\n }\n Node temp = root;\n while(true){\n if(temp.value == key){\n isDuplicate = true ;\n break;\n }\n if(temp.value > key){\n if(temp.left == null){\n break;\n }\n temp = temp.left ;\n }\n if(temp.value < key){\n if(temp.right == null){\n isRightChild = true;\n break;\n }\n temp = temp.right ;\n }\n }\n if( !isDuplicate && isRightChild)\n temp.right = new Node(key);\n else if(!isDuplicate && !isRightChild)\n temp.left = new Node(key);\n else\n temp.count = temp.count + 1;\n }", "private void adjustRedChildBlackSibling(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n\t\tif(sibling.color == Color.BLACK) {\n if (isLeftChild(deficientNode) && sibling.right.color == Color.BLACK && sibling.left.color == Color.RED) {\n rotateRight(sibling.left, true);\n } else if (!isLeftChild(deficientNode) && sibling.left.color == Color.BLACK && sibling.right.color == Color.RED) {\n rotateLeft(sibling.right, true);\n }\n }\n\t\tadjustBlackSiblingRedChild(deficientNode, rootRef);\n\t}", "private boolean checkAndAddEntry(CompareEntry entry, PointNode node) {\n Rectangle rec = entry.getRec();\n \n // Check if the rectangle doesn't hit any overhanging rectangles.\n if (node.getMaxHeight() < rec.getHeight()) {\n return false;\n }\n \n // Check if the rectangle fits in the bounding box.\n if (dataset.isFixedHeight() &&\n dataset.getHeight() < node.point.y + rec.height) {\n return false;\n }\n \n // The rectangle is allowed to be placed, so place it.\n rec.x = node.point.x;\n rec.y = node.point.y;\n \n // The points for the upper left and lower right corners.\n Point upLeft = new Point(node.point.x, node.point.y + rec.height);\n Point downRight = new Point(node.point.x + rec.width, node.point.y);\n \n LinkAction la;\n \n PointNode upLeftNode = null;\n PointNode downRightNode = null;\n \n // If the rectangle fits the remaining space at the top (it is exactly\n // below the next point) we can ignore the upper left point.\n if (node.next == null || upLeft.y != node.next.point.y) {\n upLeftNode = new PointNode(upLeft);\n }\n \n // If the rectangle fits the space on the left (it is exactly above\n // the previous point), we can ignore the lower right point.\n if (node.prev == null || downRight.x != node.prev.point.x) {\n downRightNode = new PointNode(downRight);\n }\n \n // If the rectangle exactly fits the remaining space at the top and\n // fits the space on the left (it is exactly below the next point),\n // we can additionally replace the next node.\n if (node.next != null && upLeftNode != null &&\n downRight.y == node.next.point.y) {\n if (downRightNode == null) {\n la = new ReplaceLinkAction(node, node.next,\n new PointNode[] {upLeftNode});\n curNode = upLeftNode;\n \n } else {\n la = new ReplaceLinkAction(node, node.next,\n new PointNode[] {downRightNode, upLeftNode});\n curNode = downRightNode;\n }\n \n } else {\n if (downRightNode == null) {\n if (upLeftNode == null) {\n la = new RemoveLinkAction(node);\n // This value is non-null since upLeftNode == null,\n // and the only way for node.next to be null is when\n // node == last, and in that case upLeftNode != null.\n curNode = node.next;\n \n } else {\n la = new ReplaceLinkAction(node, upLeftNode);\n curNode = upLeftNode;\n }\n \n } else {\n if (upLeftNode == null) {\n la = new ReplaceLinkAction(node, downRightNode);\n \n } else {\n la = new ReplaceLinkAction(node,\n new PointNode[] {downRightNode, upLeftNode});\n }\n \n curNode = downRightNode;\n }\n }\n \n nodeActions.add(la);\n \n return true;\n }", "public void insertNode(int data){\r\n\t\troot = insert(data, root);\r\n\t}", "public void testInsert01() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(4);\r\n\r\n\t\t// Growing the leaf\r\n\t\tbt.set(\"010\", 1);\r\n\t\tbt.set(\"020\", 2);\r\n\t\tbt.set(\"030\", 3);\r\n\t\tbt.set(\"040\", 4);\r\n\t\tassertEquals(bt.root.dump(), \"[010=1, 020=2, 030=3, 040=4]\");\r\n\r\n\t\t// Leaf split (middle) and new root created\r\n\t\tbt.set(\"025\", 5);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3, 040=4]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Leaf split (last) and new child added to root\r\n\t\tbt.set(\"050\", 6);\r\n\t\tbt.set(\"060\", 7);\r\n\t\tassertEquals(bt.root.dump(), \"[[010=1, 020=2], [025=5, 030=3], [040=4, 050=6, 060=7]]\");\r\n\r\n\t\t// Growing the left of the right side of the tree\r\n\t\t// Leaf split (first) and new child added to root\r\n\t\tbt.set(\"035\", 8);\r\n\t\tbt.set(\"034\", 9);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[010=1, 020=2], [025=5, 030=3], [034=9, 035=8, 040=4], [050=6, 060=7]]\");\r\n\r\n\t\t// Growing the right of the right side of the tree\r\n\t\t// Node split (last) and new root created\r\n\t\tbt.set(\"070\", 10);\r\n\t\tassertEquals(bt.root.dump(),\r\n\t\t\t\t\"[[[010=1, 020=2], [025=5, 030=3]], [[034=9, 035=8, 040=4], [050=6, 060=7, 070=10]]]\");\r\n\r\n\t\t// Testing key update\r\n\t\tbt.set(\"010\", -1);\r\n\r\n\t\tassertEquals(bt.get(\"010\"), Integer.valueOf(-1));\r\n\t\tassertEquals(bt.get(\"020\"), Integer.valueOf(2));\r\n\t\tassertEquals(bt.get(\"030\"), Integer.valueOf(3));\r\n\t\tassertEquals(bt.get(\"040\"), Integer.valueOf(4));\r\n\t\tassertEquals(bt.get(\"025\"), Integer.valueOf(5));\r\n\t\tassertEquals(bt.get(\"050\"), Integer.valueOf(6));\r\n\t\tassertEquals(bt.get(\"060\"), Integer.valueOf(7));\r\n\t\tassertEquals(bt.get(\"035\"), Integer.valueOf(8));\r\n\t\tassertEquals(bt.get(\"034\"), Integer.valueOf(9));\r\n\t\tassertEquals(bt.get(\"070\"), Integer.valueOf(10));\r\n\t\tassertEquals(bt.get(\"xyz\"), null);\r\n\t}", "public void insertingANode(T key, E value) {\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t}", "private static void rightLeftInsert() {\n System.out.println(\"RightLeft Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void addRightNode(Tree<T> toAdd) {\n if (right != null) {\n throw new IllegalArgumentException(\"Tree already has a right node\");\n }\n this.right = toAdd;\n }", "public void insertNode(int val)\r\n {\r\n temp=new TriLinkNode();\r\n temp.v1=val;\r\n temp.d1=false;\r\n temp.i1=true;\r\n if(root==null)\r\n {\r\n root=temp;\r\n }else\r\n {\r\n recInsertNode(root);\r\n }\r\n \r\n }", "private BSTNode privateInsert(int key, BSTNode node, BSTNode dad, Ref<Integer> b) {\n\t\tif (node == null) {\n\t\t\tnode = new BSTNode(dad, null, null, key);\n\t\t\tif (root == null) {\n\t\t\t\troot = node;\n\t\t\t\tnode.setColor(Color.BLACK);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (key < dad.getKey())\n\t\t\t\t\tdad.setLeft(node);\n\t\t\t\telse\n\t\t\t\t\tdad.setRight(node);\n\t\t\t}\n\t\t\treturn node;\n\t\t}\n\t\telse {\n\t\t\tif (key != node.getKey()) {\n\t\t\t\tdad = node;\n\t\t\t\tif (key < node.getKey())\n\t\t\t\t\tnode = node.getLeft();\n\t\t\t\telse\n\t\t\t\t\tnode = node.getRight();\n\t\t\t\tnode = privateInsert(key, node, dad, b);\n\t\t\t\tif (dad.getColor() == Color.BLACK)\n\t\t\t\t\tb.set(2);\n\t\t\t\telse if (b.get() == 1)\n\t\t\t\t\tadjustColorsInsertion(node, dad, b);\n\t\t\t\telse if (b.get() == 0)\n\t\t\t\t\tb.set(1);\n\t\t\t}\n\t\t\telse\n\t\t\t\tb.set(2);\n\t\t\treturn dad;\n\t\t}\n\t}", "private BTNode insert(BTNode node, T data)\r\n {\r\n if (node == null)\r\n node = new BTNode(data);\r\n else\r\n {\r\n if (node.getLeft() == null)\r\n node.left = insert(node.left, data);\r\n else\r\n node.right = insert(node.right, data); \r\n }\r\n return node;\r\n }", "private static void leftRightInsert() {\n System.out.println(\"LeftRight Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 10, 40, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@Test\n\tpublic void addNodeAfterGiveNode() {\n\t\tSystem.out.println(\"Given a node as prev_node, insert a new node after the given node \");\n\t\tdll.push(4);\n\t\tdll.push(2);\n\t\tdll.push(1);\n\t\tdll.InsertAfter(dll.head.next, 3);\n\t\tdll.print();\n\t}", "public TreeNode insertRec(TreeNode root, int val) {\n /* If the tree is empty, return a new TreeNode */\n if (root == null) {\n root = new TreeNode(val);\n return root;\n }\n\n /* Otherwise, recur down the tree */\n if (val < root.val)\n root.left = insertRec(root.left, val);\n else if (val > root.val)\n root.right = insertRec(root.right, val);\n\n /* return the (unchanged) TreeNode pointer */\n return root;\n }", "static void insert(Node nd, int key)\n\t{\n\t\tif (nd == null) {\n\t\t\troot = new Node(key);\n\t\t\treturn;\n\t\t}\n\t\tQueue<Node> q = new LinkedList<Node>();\n\t\tq.add(nd);\n\n\t\t// Do level order traversal until we find an empty place\n\t\twhile (!q.isEmpty()) {\n\t\t\tnd = q.remove();\n\n\t\t\tif (nd.left == null) {\n\t\t\t\tnd.left = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.left);\n\n\t\t\tif (nd.right == null) {\n\t\t\t\tnd.right = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.right);\n\t\t}\n\t}", "public void insert(Node n);", "private Node put(Node h, int key, PriorityQueue<Integer> val) {\n if (h == null)\n return new Node(key, val, RED, 1);\n\n int cmp = key - h.key;\n if (cmp < 0)\n h.left = put(h.left, key, val);\n else if (cmp > 0)\n h.right = put(h.right, key, val);\n else\n h.val = val;\n\n // fix-up any right-leaning links\n if (isRed(h.right) && !isRed(h.left))\n h = rotateLeft(h);\n if (isRed(h.left) && isRed(h.left.left))\n h = rotateRight(h);\n if (isRed(h.left) && isRed(h.right))\n flipColors(h);\n h.size = size(h.left) + size(h.right) + 1;\n\n return h;\n }", "private Node moveRedRight(Node h) {\n flipColors(h);\n if (isRed(h.left.left)) {\n h = rotateRight(h);\n flipColors(h);\n }\n return h;\n }", "private void handleColors(int newElement) \n { \n // flip the colors of the node \n current.color = RED; //make current node RED \n current.leftChild.color = BLACK; //make leftChild BLACK \n current.rightChild.color = BLACK; //make rightChild BLACK \n \n //check the color of the parent node \n if (parent.color == RED) \n { \n // perform rotation in case when the color of parent node is RED \n grand.color = RED; \n \n if (newElement < grand.element && grand.element != newElement && newElement < parent.element) \n parent = performRotation( newElement, grand ); // Start dbl rotate \n current = performRotation(newElement, great ); \n current.color = BLACK; \n } \n \n // change the color of the root node with BLACK \n header.rightChild.color = BLACK; \n }", "private static <K, V> Node<K, V> makeRightRed(@Var Node<K, V> current) {\n\n current = colorFlip(current);\n if (Node.isRed(current.left.left)) {\n current = rotateClockwise(current);\n current = colorFlip(current);\n }\n return current;\n }", "public void insertNode(int d){\n if(root == null){\n root = new TreeNode(d);\n }\n else{\n root.insert(d);\n }\n }", "static TreeNode insert(TreeNode node, int key) \n\t{ \n\t // if tree is empty return new node \n\t if (node == null) \n\t return newNode(key); \n\t \n\t // if key is less then or grater then \n\t // node value then recur down the tree \n\t if (key < node.key) \n\t node.left = insert(node.left, key); \n\t else if (key > node.key) \n\t node.right = insert(node.right, key); \n\t \n\t // return the (unchanged) node pointer \n\t return node; \n\t}", "public void colourNode(int node, HashMap <Integer, Integer> colours, int nextColour ) {\r\n\t\tcolours.put(node, nextColour);\r\n\t\tcolouredNodes.add(node);\r\n\t}", "public void insert(int key){\n\t\tif(this.root == null){\n\t\t\tNode r = new Node(key);\n\t\t\tthis.root = r;\t\n\t\t}else{\n\t\t\t//if not recursively insert the node\n\t\t\trecInsert(this.root, key);\n\t\t}\n\t\treturn;\n\t}", "private BSTNode<T> insertHelper(BSTNode<T> node, T newData){\n\t\tif (node == null) {\n\t\t\tBSTNode<T> newNode = new BSTNode<T>(newData);\n\t\t\treturn newNode;\n\t\t} else if (newData.compareTo(node.getData()) < 0) {\n\t\t\tnode.setLeft(insertHelper(node.getLeft(), newData));\n\t\t} else {\n\t\t\tnode.setRight(insertHelper(node.getRight(), newData));\n\t\t}\n\t\treturn node;\n\t}", "private void adjustDeficientBlackSiblingNode(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n if(deficientNode.parent.color == Color.BLACK && sibling.color == Color.BLACK && sibling.left.color == Color.BLACK\n && sibling.right.color == Color.BLACK) {\n \tsibling.color = Color.RED;\n adjustRootDeficiency(deficientNode.parent, rootRef);\n } else {\n adjustRedParentNode(deficientNode, rootRef);\n }\n\t}", "static Node BSTInsert(Node tmp,int key)\n {\n //if the tree is empty it will insert the new node as root\n \n if(tmp==null)\n {\n tmp=new Node(key);\n \n return tmp;\n }\n \n else\n \n rBSTInsert(tmp,key);\n \n \n return tmp;\n }", "public static void treeInsert(Node root, int newData) {\r\n if (newData <= root.value) {\r\n if (root.left != null)\r\n treeInsert(root.left, newData);\r\n else\r\n root.left = new Node(newData);\r\n } else {\r\n if (root.right != null)\r\n treeInsert(root.right, newData);\r\n else\r\n root.right = new Node(newData);\r\n }\r\n }", "private BTNode<T> insert(T data, BTNode<T> node){\n\t\t// if the node does not exist, create it\n\t\tinsertCount++;\n\t\tif(node == null) return new BTNode<T>(data, null, null);\n\n\t\t//left placement\n\t\tinsertCount++;\n\t\tif(data.compareTo(node.getData()) <= 0) node.setLeft(insert(data, node.getLeft()));\n\n\t\telse node.setRight(insert(data, node.getRight()));\n\n\t\t//balance the tree after insertion\n\t\treturn balance(node);\n\t}", "private void colorNode(Node root2, Color c) {\r\n pMap.get(root2.getId()).changeColor(\"fillColor\", c, null, null);\r\n }", "void setRight(TreeNode<T> right);", "Node insertBefore(Node newChild, Node refChild);", "Node(K key, V value, \n java.util.Comparator<? super K> c,\n BinarySearchTree<K, V> left,\n BinarySearchTree<K, V> right,\n boolean black) {\n this.key = key;\n this.value = value;\n this.c = c;\n this.left = left;\n this.right = right;\n this.black = black;\n this.size = 1 + this.left.size() + this.right.size();\n }", "public void setRight(BTNode myNode){\n rightleaf = myNode;\r\n }", "static Node insert(Node node, int key) {\n\n // If the tree is empty, return a new node\n if (node == null)\n return newNode(key);\n\n // Otherwise, recur down the tree\n if (key < node.key)\n node.left = insert(node.left, key);\n else\n node.right = insert(node.right, key);\n\n // Return the (unchanged) node pointer\n return node;\n }", "private Node moveRedLeft(Node h) {\n flipColor(h);\n if (isRed(h.right.left)) {\n h.right = rotateRight(h.right);\n h = rotateLeft(h);\n flipColor(h);\n }\n }", "public void insertRandom() {\n // Create new node\n CriteriaNode newNode = generateRandomNonterminalNode();\n\n // Get random leaf node\n Node[] nodes = getRandomTerminalNode();\n Node prev = nodes[PREV];\n Node node = nodes[CURR];\n\n // Replace either left or right with a random CriteriaNode\n if (prev == null) {\n // If tree has only a root node\n if (U.chance()) {\n root.left = newNode;\n } else {\n root.right = newNode;\n }\n } else {\n // Replace the correct reference of prev with the new node\n if (prev.left == node) {\n prev.left = newNode;\n } else {\n prev.right = newNode;\n }\n }\n }", "private long replace(long r, Node change) throws IOException {\n Node current = new Node(r);\r\n if (current.right != 0) {\r\n current.right = replace(current.right, change);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(current.right) > 0) {\r\n current.right = rightRotate(current.right);\r\n current.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(current.left) < 0) {\r\n current.left = leftRotate(current.left);\r\n current.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return r;\r\n }\r\n else {\r\n change.key = current.key;\r\n change.fields = current.fields;\r\n addToFree(r);\r\n return current.left;\r\n }\r\n }", "private TreeNode<K, V> put(TreeNode<K, V> node, K key, V value){\r\n \r\n // If the node is null, create a new node with the information\r\n // passed into the function\r\n if(node == null){\r\n return new TreeNode<>(key, value);\r\n }\r\n \r\n // Compare the keys recursively to find the correct spot to insert\r\n // the new node or if the key already exists\r\n if(node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n node.left = put(node.left, key, value);\r\n }\r\n else if(node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n node.right = put(node.right, key, value);\r\n }\r\n else{\r\n // If the keys are equal, only update the value\r\n node.setValue(value);\r\n }\r\n \r\n // Return the updated or newly inserted node\r\n return node;\r\n }", "private void insertAux2(K key, V val) {\n if(root == null) { //empty tree\n X = new Node(key, val);\n root = X;\n return;\n }\n Node temp = root;\n while(true) {\n int cmp = key.compareTo(temp.key);\n if (cmp < 0 && temp.left != null) { //go left\n comparisons += 1;\n temp = temp.left;\n } else if (cmp < 0 && temp.left == null) { //it goes in the next left\n comparisons += 1;\n X = new Node(key, val);\n temp.left = X;\n X.parent = temp;\n break;\n }\n if (cmp > 0 && temp.right != null) { //go right\n comparisons += 1;\n temp = temp.right;\n } else if (cmp > 0 && temp.right == null) { //it goes in the next right\n comparisons += 1;\n X = new Node(key, val);\n temp.right = X;\n X.parent = temp;\n break;\n }\n if(cmp == 0) { //no doubles, overlap pre-existing node\n comparisons += 1;\n temp.key = key;\n temp.val = val;\n X = temp;\n break;\n }\n }\n }", "private void updateLruWithNewNode(PageId pid, Page retrievedPage) {\n Node node = new Node(pid, retrievedPage);\n changeHead(node);\n bufferedPages.put(pid, node);\n }", "void insert(int data) { \n root = insertRec(root, data); \n }", "private BSTNode insert(BSTNode node, int data) {\r\n \r\n // if the node is null, create a new node\r\n if (node == null) {\r\n \r\n // create new BSTNode node\r\n node = new BSTNode(data);\r\n }\r\n \r\n // if the node is not null, execute\r\n else {\r\n \r\n // if the data < parent, traverse left\r\n if (data < node.getData()) {\r\n \r\n // call the insert method on the left node\r\n node.left = insert(node.left, data); \r\n }\r\n \r\n // if data > parent, traverse right\r\n else if (data > node.getData()) {\r\n \r\n // call the insert method on the right node\r\n node.right = insert(node.right, data);\r\n }\r\n \r\n // if the data == parent, increment intensity count\r\n else {\r\n \r\n // call method to increment the node's intensity count\r\n node.incrementIntensityCount();\r\n }\r\n }\r\n \r\n // return the node\r\n return node;\r\n }", "public void treeInsert(TernaryTreeNode root, int newData) {\n if (newData<=root.data)\n {\n if (root.left!=null) \n treeInsert(root.left, newData);\n else \n root.left = new TernaryTreeNode(newData);\n }\n else \n {\n if (root.right!=null) \n treeInsert(root.right, newData);\n else\n root.right = new TernaryTreeNode(newData);\n }\n }", "public Node insertNode(K key, V value) {\n\t\tNode newNode = new Node(key, value);// first we need to create the new\n\t\t\t\t\t\t\t\t\t\t\t// node\n\t\tNode currentNode = this.getRoot();// then we move to the root ot the\n\t\t\t\t\t\t\t\t\t\t\t// tree that has called the method\n\t\tNode currentNodeParent = mSentinel;// the parent of the root is of\n\t\t\t\t\t\t\t\t\t\t\t// course sentinel\n\t\twhile (currentNode != mSentinel) {// and while the current node(starting\n\t\t\t\t\t\t\t\t\t\t\t// from the root) is not a sentinel\n\t\t\tcurrentNodeParent = currentNode;// then remember this node as a\n\t\t\t\t\t\t\t\t\t\t\t// parent\n\t\t\tif (key.compareTo(currentNode.getKey()) < 0) {// and appropriate its\n\t\t\t\tcurrentNode = currentNode.getLeftChild();// left\n\t\t\t} else {// or\n\t\t\t\tcurrentNode = currentNode.getrightChild();// right child as the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// next current node\n\t\t\t}\n\t\t}\n\t\t// we iterate through the described loop in order to get to the\n\t\t// appropriate place(in respect to the given key) where the new node\n\t\t// should be put\n\t\tnewNode.setParent(currentNodeParent);// we make the new node's parent\n\t\t\t\t\t\t\t\t\t\t\t\t// the last non empty node that\n\t\t\t\t\t\t\t\t\t\t\t\t// we've reached\n\t\tif (currentNodeParent == mSentinel) {\n\t\t\tmRoot = newNode;// if there is no such node then the tree is empty\n\t\t\t\t\t\t\t// and our node is actually going to be the root\n\t\t} else {\n\t\t\tif (key.compareTo(currentNodeParent.getKey()) < 0) {// otherwise we\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// put our new\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// node\n\t\t\t\tcurrentNodeParent.setLeftChild(newNode);// as a left\n\t\t\t} else { // or\n\t\t\t\tcurrentNodeParent.setrightChild(newNode);// right child of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last node we've\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reached\n\t\t\t}\n\t\t}\n\t\treturn newNode;\n\t}", "private BinaryNode<E> _insert(BinaryNode<E> node, E e) {\n\n\t\tif (node == null) {\n\t\t\treturn new BinaryNode<E>(e);\n\t\t} else if (comparator.compare(e, node.getData()) < 0) { // <, so go left\n\t\t\tnode.setLeftChild(_insert(node.getLeftChild(), e));// recursive call\n\t\t} else { // >, so go right\n\t\t\tnode.setRightChild(_insert(node.getRightChild(), e));// recursive call\n\t\t}\n\t\treturn node;\n\t}", "public Node insert(Node node, int key) {\n\t\tif (node == null)\n\t\t\treturn new Node(key);\n\n\t\t/* Otherwise, recur down the tree */\n\t\tif (key < node.data) {\n\t\t\tnode.left = insert(node.left, key);\n\t\t\tnode.left.parent = node;\n\t\t} else if (key > node.data) {\n\t\t\tnode.right = insert(node.right, key);\n\t\t\tnode.right.parent = node;\n\t\t}\n\n\t\t/* return the (unchanged) node pointer */\n\t\treturn node;\n\t}", "public void insert(Node given){\n\t\tlength++;\n\t\tString retVar = \"\";\n\t\tNode curNode = root;\n\t\twhile (!curNode.isLeaf()){\n\t\t\tif (curNode.getData() > given.getData()){\n\t\t\t\tcurNode = curNode.getLeft();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurNode = curNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (curNode.getData() > given.getData()){ \n\t\t\tcurNode.setLeft(given);\n\t\t}\n\t\telse{\n\t\t\tcurNode.setRight(given);\n\t\t}\n\t\tmyLazySearchFunction = curNode;\n\t}", "public void insertAfter(Node prev_node, int new_data) \r\n\t\t{ \r\n\t\t if (prev_node == null) \r\n\t\t { \r\n\t\t System.out.println(\"\\nThe given previous node cannot be null\"); \r\n\t\t return; \r\n\t\t } \r\n\t\t \r\n\t\t Node new_node = new Node(new_data); \r\n\t\t new_node.next = prev_node.next; \r\n\t\t prev_node.next = new_node; \r\n\t\t}", "private Node _insert(Node node, T value) {\n if (node == null) {\n node = new Node(null, null, value);\n }\n /**\n * If the value is less than the current node's value, choose left.\n */\n else if (value.compareTo(node.element) < 0) {\n node.left = _insert(node.left, value);\n }\n /**\n * If the value is greater than the current node's value, choose right.\n */\n else if (value.compareTo(node.element) > 0) {\n node.right = _insert(node.right, value);\n }\n /** \n * A new node is created, or\n * a node with this value already exists in the tree.\n * return this node\n * */\n return node;\n\n }" ]
[ "0.6857241", "0.65847707", "0.6525278", "0.64081347", "0.6305684", "0.6246985", "0.5977832", "0.59703964", "0.59346396", "0.59207207", "0.5916645", "0.5915351", "0.5915116", "0.58805805", "0.5811359", "0.5797498", "0.5792607", "0.57849467", "0.57516956", "0.57495105", "0.56788045", "0.5665525", "0.5662844", "0.56533366", "0.56282675", "0.5537806", "0.55080926", "0.55020344", "0.549922", "0.54712474", "0.5438489", "0.54383665", "0.5438362", "0.543118", "0.5421832", "0.54109794", "0.5408275", "0.5392963", "0.538223", "0.53821707", "0.529149", "0.5291377", "0.52896786", "0.52819765", "0.5280505", "0.5273975", "0.5268538", "0.52532625", "0.52370363", "0.5234217", "0.5228346", "0.52187216", "0.5213533", "0.52098256", "0.5202399", "0.519894", "0.5190911", "0.5189419", "0.517962", "0.51619697", "0.5136645", "0.51246005", "0.5121524", "0.5115994", "0.5113641", "0.511304", "0.5099599", "0.5085466", "0.5074465", "0.50726676", "0.5070996", "0.5066617", "0.50657296", "0.5063515", "0.5059918", "0.5059849", "0.50564045", "0.50492656", "0.5033877", "0.50329053", "0.5030439", "0.5024245", "0.5021767", "0.50159466", "0.5015532", "0.50113654", "0.5010755", "0.5009378", "0.5008761", "0.50048786", "0.49934337", "0.49928978", "0.49907237", "0.4983999", "0.49808908", "0.49694237", "0.49676928", "0.49615765", "0.49542218", "0.49542108" ]
0.6616345
1
This is a recursive function which starts at a leaf node and steps up the tree until the root. Every node this function passes will have it's val, maxval, and emax values updated by the helper function updateSingleNode(Node n). There is the possibility of a rotation when adding a node to the tree. If this happens there will be one node pushed out of the path this algorithm takes. That is why the if( n.marked ) line is included. This will update that node which would have been missed before.
public void recUpdateNode(Node n) { //update this node updateSingleNode(n); //if this node is marked, update the parent node's other child. if( n.marked ) { //unmark both children of this node's parent n.parent.right.marked = n.parent.left.marked = false; //find and update the other child if( n.parent.left == n ) { updateSingleNode(n.parent.right); } else if( n.parent.right == n ){ updateSingleNode(n.parent.left); } } //if this is not the root, go to the next parent if( n.parent != nilNode ) { recUpdateNode(n.parent); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateSingleNode(Node n) {\r\n\t\t//update val\r\n\t\tn.val = n.left.getVal() + n.p + n.right.getVal();\r\n\r\n\t\t//update eval and emax\r\n\t\tint case1 = n.left.getMaxVal();\r\n\t\tint case2 = n.left.getVal() + n.p;\r\n\t\tint case3 = n.left.getVal() + n.p + n.right.getMaxVal();\r\n\t\tif( case1 >= case2 && case1 >= case3 ) {\r\n\t\t\t//case 1\r\n\t\t\tn.maxval = case1;\r\n\t\t\t//if the left node is the nilNode, make emax this node\r\n\t\t\tif( n.left.isNil ) {\r\n\t\t\t\tn.emax = n.getEndpoint();\r\n\t\t\t} else {\r\n\t\t\t\t//otherwise get emax of left\r\n\t\t\t\tn.emax = n.left.getEmax();\r\n\t\t\t}\r\n\t\t} else if( case2 >= case1 && case2 >= case3 ) {\r\n\t\t\t//case 2\r\n\t\t\tn.maxval = case2;\r\n\t\t\tn.emax = n.getEndpoint();\r\n\t\t} else if( case3 >= case1 && case3 >= case2 ) {\r\n\t\t\t//case 3\r\n\t\t\tn.maxval = case3;\r\n\t\t\t//if the left node is the nilNode, make emax this node\r\n\t\t\tif( n.right.isNil ) {\r\n\t\t\t\tn.emax = n.getEndpoint();\r\n\t\t\t} else {\r\n\t\t\t\t//otherwise get emax of right\r\n\t\t\t\tn.emax = n.right.getEmax();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void RecursiveExpansion() throws TreeTooBigException {\r\n int transIndex; //Index to count transitions\r\n int[] newMarkup; //markup used to create new node\r\n boolean aTransitionIsEnabled = false; //To check for deadlock\r\n //Attribute used for assessing whether a node has occured before\r\n boolean repeatedNode = false; \r\n \r\n boolean allOmegas = false;\r\n \r\n boolean[] enabledTransitions = \r\n tree.dataLayer.getTransitionEnabledStatusArray(markup);\r\n\r\n //For each transition\r\n for (int i = 0; i < enabledTransitions.length; i++) {\r\n if (enabledTransitions[i] == true) {\r\n //Set transArray of to true for this index\r\n transArray[i] = true;\r\n \r\n //System.out.println(\"\\n Transition \" + i + \" Enabled\" );\r\n aTransitionIsEnabled = true;\r\n \r\n //print (\"\\n Old Markup is :\", markup);//debug\r\n \r\n //Fire transition to produce new markup vector\r\n newMarkup = fire(i);\r\n \r\n //print (\"\\n New Markup is :\", newMarkup);//debug\r\n \r\n //Check for safeness. If any of places have > 1 token set variable.\r\n for (int j = 0; j < newMarkup.length; j++) {\r\n if (newMarkup[j] > 1 || newMarkup[j] == -1) {\r\n tree.moreThanOneToken = true;\r\n break;\r\n }\r\n } \r\n \r\n //Create a new node using the new markup vector and attach it to\r\n //the current node as a child.\r\n children[i] = \r\n new myNode(newMarkup, this, tree, depth + 1);\r\n \r\n /* Now need to (a) check if any omegas (represented by -1) need to \r\n * be inserted in the markup vector of the new node, and (b) if the \r\n * resulting markup vector has appeared anywhere else in the tree. \r\n * We must do (a) before (b) as we need to know if the new node \r\n * contains any omegas to be able to compare it with existing nodes. \r\n */ \r\n allOmegas = children[i].InsertOmegas();\r\n \r\n //check if the resulting markup vector has occured anywhere else in the tree\r\n repeatedNode = (tree.root).FindMarkup(children[i]);\r\n \r\n if (tree.nodeCount >= Pipe.MAX_NODES && !tree.tooBig) {\r\n tree.tooBig = true;\r\n throw new TreeTooBigException();\r\n }\r\n \r\n if (!repeatedNode && !allOmegas) {\r\n children[i].RecursiveExpansion();\r\n }\r\n }\r\n }\r\n \r\n if (!aTransitionIsEnabled) {\r\n System.err.println(\"No transition enabled\");\r\n if (!tree.noEnabledTransitions || tree.pathToDeadlock.length < depth-1) {\r\n RecordDeadlockPath();\r\n tree.noEnabledTransitions = true;\r\n } else {\r\n System.err.println(\"Deadlocked node found, but path is not shorter\"\r\n + \" than current path.\");\r\n }\r\n } else {\r\n //System.out.println(\"Transitions enabled.\");\r\n }\r\n }", "private void doOneUpdateStep(){\r\n SparseFractalSubTree target = null; //stores the tree which will receive the update\r\n for (int i = 0; i < subTrees.length - 1; i++) { //top tree never receives an update (reason for -1)\r\n SparseFractalSubTree subTree = subTrees[i];\r\n if (!subTree.hasStopped()) { //not permanently or temporary finished\r\n if (target != null) { //are we the first tree who can receive an update\r\n if ((subTree.getTailHeight() < target.getTailHeight())) { //are we a better candidate then the last one?\r\n target = subTree;\r\n }\r\n } else { //we are the first not finished subtree, so we receive the update if no better candidate is found\r\n target = subTree;\r\n }\r\n\r\n }\r\n }\r\n assert (target != null);\r\n assert (check(target)); //check all the assumptions\r\n\r\n measureDynamicSpace(); //measure\r\n\r\n target.updateTreeHashLow(); //apply a update to the target\r\n }", "private void nullLeaf(AVLNode<T> node) {\n AVLNode<T> prev = getParent(root, node);\n int comp = node.getData().compareTo(prev.getData());\n if (comp > 0) {\n prev.setRight(null);\n AVLNode<T> min = findMin(prev.getLeft());\n AVLNode<T> max = findMax(prev.getLeft());\n if (min != null) {\n calcDeterminants(min);\n balanceTree(min);\n calcDeterminants(min);\n }\n if (max != null) {\n calcDeterminants(max);\n balanceTree(max);\n calcDeterminants(max);\n }\n } else {\n prev.setLeft(null);\n AVLNode<T> max = findMax(prev.getRight());\n AVLNode<T> min = findMin(prev.getRight());\n if (max != null) {\n calcDeterminants(max);\n balanceTree(max);\n calcDeterminants(max);\n }\n if (min != null) {\n calcDeterminants(min);\n balanceTree(min);\n calcDeterminants(min);\n }\n }\n }", "private AvlNode deleteNode(AvlNode root, int value) {\n\r\n if (root == null)\r\n return root;\r\n\r\n // If the value to be deleted is smaller than the root's value,\r\n // then it lies in left subtree\r\n if ( value < root.key )\r\n root.left = deleteNode(root.left, value);\r\n\r\n // If the value to be deleted is greater than the root's value,\r\n // then it lies in right subtree\r\n else if( value > root.key )\r\n root.right = deleteNode(root.right, value);\r\n\r\n // if value is same as root's value, then This is the node\r\n // to be deleted\r\n else {\r\n // node with only one child or no child\r\n if( (root.left == null) || (root.right == null) ) {\r\n\r\n AvlNode temp;\r\n if (root.left != null)\r\n temp = root.left;\r\n else\r\n temp = root.right;\r\n\r\n // No child case\r\n if(temp == null) {\r\n temp = root;\r\n root = null;\r\n }\r\n else // One child case\r\n root = temp; // Copy the contents of the non-empty child\r\n\r\n temp = null;\r\n }\r\n else {\r\n // node with two children: Get the inorder successor (smallest\r\n // in the right subtree)\r\n AvlNode temp = minValueNode(root.right);\r\n\r\n // Copy the inorder successor's data to this node\r\n root.key = temp.key;\r\n\r\n // Delete the inorder successor\r\n root.right = deleteNode(root.right, temp.key);\r\n }\r\n }\r\n\r\n // If the tree had only one node then return\r\n if (root == null)\r\n return root;\r\n\r\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\r\n root.height = Math.max(height(root.left), height(root.right)) + 1;\r\n\r\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\r\n // this node became unbalanced)\r\n int balance = balance(root).key;\r\n\r\n // If this node becomes unbalanced, then there are 4 cases\r\n\r\n // Left Left Case\r\n if (balance > 1 && balance(root.left).key >= 0)\r\n return doRightRotation(root);\r\n\r\n // Left Right Case\r\n if (balance > 1 && balance(root.left).key < 0) {\r\n root.left = doLeftRotation(root.left);\r\n return doRightRotation(root);\r\n }\r\n\r\n // Right Right Case\r\n if (balance < -1 && balance(root.right).key <= 0)\r\n return doLeftRotation(root);\r\n\r\n // Right Left Case\r\n if (balance < -1 && balance(root.right).key > 0) {\r\n root.right = doRightRotation(root.right);\r\n return doLeftRotation(root);\r\n }\r\n\r\n return root;\r\n }", "private void GreedySearch(){\n\n Queue<Node> expanded = new LinkedList<>();\n ArrayList<Node> fringe = new ArrayList<>();\n ArrayList<Node> fringeTemp = new ArrayList<>();\n\n\n Node current = startNode;\n\n while(expanded.size() < 1000){\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal is reached.\n solutionPath(current);\n expanded.add(current);\n printExpanded(expanded);\n System.exit(0);\n }\n\n\n boolean b = cycleCheck(current,expanded);\n\n if(!b) {\n expanded.add(current);\n }\n\n if(!b){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n\n }\n }\n\n if(current.getDigit().last_changed != 1){\n\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n }\n\n\n\n for(Node n : fringe){\n heuristicSetter(n);\n\n }\n\n fringeTemp.addAll(fringe);\n //now all the nodes in fringe have the heuristic value.\n //We can get the last added minm\n Node minm;\n if(fringeTemp.size() != 0){\n minm = fringeTemp.get(0);\n }else{\n break;\n }\n for(int i = 1; i<fringeTemp.size(); i++){\n if(fringeTemp.get(i).getHeuristic() <= minm.getHeuristic()){\n minm = fringeTemp.get(i);\n }\n }\n\n //now we have the minm for the next stage.\n current = minm;\n fringeTemp.remove(minm);\n fringe.clear();\n }\n\n //While loop ends\n System.out.println(\"No solution found.\");\n printExpanded(expanded);\n\n\n\n }", "public void returnRecursive(Node<E> node, E val) {\n // Will check if the node already exists and if it doesn't then it will create a new node\n // otherwise will run recursively on the left node\n // node.left is the left node from the Node class.\n if (val.compareTo(node.getInfo()) < 0){\n if(node.left == null)\n node.left = new Node(val);\n else\n returnRecursive(node.left, val);\n\n }\n // Will check if the node already exists and if it doesn't then it will create a new node\n // otherwise will run recursively on the right node\n // node.right is the right node from the Node class.\n if(val.compareTo(node.getInfo()) > 0)\n if(node.right == null)\n node.right = new Node(val);\n else\n returnRecursive(node.right, val);\n\n }", "public void update(GMSSRandom gmssRandom, byte[] leaf)\n {\n\n if (this.isFinished)\n {\n // -DM System.err.println\n System.err\n .println(\"No more update possible for treehash instance!\");\n return;\n }\n if (!this.isInitialized)\n {\n // -DM System.err.println\n System.err\n .println(\"Treehash instance not initialized before update\");\n return;\n }\n\n byte[] help = new byte[this.messDigestTree.getDigestSize()];\n int helpHeight = -1;\n\n gmssRandom.nextSeed(this.seedActive);\n\n // if treehash gets first update\n if (this.firstNode == null)\n {\n this.firstNode = leaf;\n this.firstNodeHeight = 0;\n }\n else\n {\n // store the new node in help array, do not push it on the stack\n help = leaf;\n helpHeight = 0;\n\n // hash the nodes on the stack if possible\n while (this.tailLength > 0\n && helpHeight == ((Integer)heightOfNodes.lastElement())\n .intValue())\n {\n // put top element of the stack and help node in array\n // 'tobehashed'\n // and hash them together, put result again in help array\n byte[] toBeHashed = new byte[this.messDigestTree\n .getDigestSize() << 1];\n\n // pop element from stack\n System.arraycopy(this.tailStack.lastElement(), 0, toBeHashed,\n 0, this.messDigestTree.getDigestSize());\n this.tailStack.removeElementAt(this.tailStack.size() - 1);\n this.heightOfNodes\n .removeElementAt(this.heightOfNodes.size() - 1);\n\n System.arraycopy(help, 0, toBeHashed, this.messDigestTree\n .getDigestSize(), this.messDigestTree\n .getDigestSize());\n messDigestTree.update(toBeHashed, 0, toBeHashed.length);\n help = new byte[messDigestTree.getDigestSize()];\n messDigestTree.doFinal(help, 0);\n\n // increase help height, stack was reduced by one element\n helpHeight++;\n this.tailLength--;\n }\n\n // push the new node on the stack\n this.tailStack.addElement(help);\n this.heightOfNodes.addElement(Integers.valueOf(helpHeight));\n this.tailLength++;\n\n // finally check whether the top node on stack and the first node\n // in treehash have same height. If so hash them together\n // and store them in treehash\n if (((Integer)heightOfNodes.lastElement()).intValue() == this.firstNodeHeight)\n {\n byte[] toBeHashed = new byte[this.messDigestTree\n .getDigestSize() << 1];\n System.arraycopy(this.firstNode, 0, toBeHashed, 0,\n this.messDigestTree.getDigestSize());\n\n // pop element from tailStack and copy it into help2 array\n System.arraycopy(this.tailStack.lastElement(), 0, toBeHashed,\n this.messDigestTree.getDigestSize(),\n this.messDigestTree.getDigestSize());\n this.tailStack.removeElementAt(this.tailStack.size() - 1);\n this.heightOfNodes\n .removeElementAt(this.heightOfNodes.size() - 1);\n\n // store new element in firstNode, stack is then empty\n messDigestTree.update(toBeHashed, 0, toBeHashed.length);\n this.firstNode = new byte[messDigestTree.getDigestSize()];\n messDigestTree.doFinal(this.firstNode, 0);\n this.firstNodeHeight++;\n\n // empty the stack\n this.tailLength = 0;\n }\n }\n\n // check if treehash instance is completed\n if (this.firstNodeHeight == this.maxHeight)\n {\n this.isFinished = true;\n }\n }", "private PersistentLinkedList<T> addHelper(T data) {\n //there's still space in the latest element\n if (this.treeSize == 0 || this.treeSize % branchingFactor != 0) {\n return setHelper(this.treeSize, data);\n }\n\n //there's still space for the new data\n if (this.base * branchingFactor > this.treeSize) {\n Node<T> newRoot = new Node<>(branchingFactor);\n\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n int index = this.treeSize;\n int b;\n for (b = base; b > 0; b = b / branchingFactor) {\n TraverseData traverseData = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, index, b));\n currentNode = traverseData.currentNode;\n currentNewNode = traverseData.currentNewNode;\n index = traverseData.index;\n\n if (currentNode == null) {\n b = b / branchingFactor;\n break;\n }\n }\n\n while (b > 1) {\n currentNewNode.set(0, new Node<>(branchingFactor));\n currentNewNode = currentNewNode.get(0);\n index = index % b;\n b = b / branchingFactor;\n }\n currentNewNode.set(0, new Node<>(branchingFactor, data));\n\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth, this.base,\n this.treeSize + 1, unusedTreeIndices, indexCorrespondingToTheFirstElement,\n indexCorrespondingToTheLatestElement);\n }\n\n //root overflow\n Node<T> newRoot = new Node<>(branchingFactor);\n newRoot.set(0, this.root);\n newRoot.set(1, new Node<>(branchingFactor));\n //newRoot[2..]=null\n Node<T> currentNewNode = newRoot.get(1);\n\n int b = base;\n while (b > 1) {\n currentNewNode.set(0, new Node<>(branchingFactor));\n currentNewNode = currentNewNode.get(0);\n b = b / branchingFactor;\n }\n currentNewNode.set(0, new Node<>(branchingFactor, data));\n\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth + 1,\n this.base * branchingFactor, this.treeSize + 1, unusedTreeIndices,\n indexCorrespondingToTheFirstElement, indexCorrespondingToTheLatestElement);\n }", "public void RBFixup(Node n) {\r\n\t\twhile(n.parent.color == 0) {\r\n\t\t\tif(n.parent == n.parent.parent.left) {\r\n\t\t\t\tNode y = n.parent.parent.right;\r\n\t\t\t\tif(y.color == 0) {\r\n\t\t\t\t\tn.parent.color = 1;\r\n\t\t\t\t\ty.color = 1;\r\n\t\t\t\t\tn.parent.parent.color = 0;\r\n\t\t\t\t\tn = n.parent.parent;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif(n == n.parent.right) {\r\n\t\t\t\t\t\tn = n.parent;\r\n\t\t\t\t\t\tleftRotate(n);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tn.parent.color = 1;\r\n\t\t\t\t\tn.parent.parent.color = 0;\r\n\t\t\t\t\t//mark n and n's grandparent, because in the end these two nodes will be the children\r\n\t\t\t\t\t//marking will be handled in recUpdateNode\r\n\t\t\t\t\tn.marked = true;\r\n\t\t\t\t\tn.parent.parent.marked = true;\r\n\t\t\t\t\trightRotate(n.parent.parent);\r\n\t\t\t\t\tif(hFlag == 1)\r\n\t\t\t\t\t\theight--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tNode y = n.parent.parent.left;\r\n\t\t\t\tif(y.color == 0) {\r\n\t\t\t\t\tn.parent.color = 1;\r\n\t\t\t\t\ty.color = 1;\r\n\t\t\t\t\tn.parent.parent.color = 0;\r\n\t\t\t\t\tn = n.parent.parent;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif(n == n.parent.left) {\r\n\t\t\t\t\t\tn = n.parent;\r\n\t\t\t\t\t\trightRotate(n);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tn.parent.color = 1;\r\n\t\t\t\t\tn.parent.parent.color = 0;\r\n\t\t\t\t\t//mark n and n's grandparent, because in the end these two nodes will be the children\r\n\t\t\t\t\t//marking will be handled in recUpdateNode\r\n\t\t\t\t\tn.marked = true;\r\n\t\t\t\t\tn.parent.parent.marked = true;\r\n\t\t\t\t\tleftRotate(n.parent.parent);\r\n\t\t\t\t\tif(hFlag == 1)\r\n\t\t\t\t\t\theight--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\troot.color = 1;\r\n\t}", "private int treeTraverse (TreeNode root, int previousVal) {\n if (root == null)\n return 0;\n \n // traverse left, then right\n int left = treeTraverse(root.left, root.val);\n int right = treeTraverse(root.right, root.val);\n \n // calculate the longest path\n path = Math.max(left + right, path);\n\n //return\n if (root.val == previousVal) \n return Math.max(left, right) + 1;\n \n return 0;\n }", "abstract void setRoot(Node<T> n);", "public TreeNode resolve(TreeNode root, TreeNode node){\n if (root == null) {\n return node;\n }\n else if(root.val > node.val){ // no replace, keep going down\n root.right = resolve(root.right, node);\n return root;\n }\n else { // new biggest, old root becomes left child\n node.left = root;\n root = null;\n return node;\n }\n }", "private PersistentLinkedList<T> pop() {\n //the latest element won't become empty\n int index = this.treeSize - 1;\n Node<T> newRoot = new Node<>(branchingFactor);\n\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n ArrayList<Node<T>> newNodes = new ArrayList<>();\n newNodes.add(newRoot);\n ArrayList<Integer> newNodesIndices = new ArrayList<>();\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData traverseData = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, index, b));\n currentNode = traverseData.currentNode;\n currentNewNode = traverseData.currentNewNode;\n newNodes.add(currentNewNode);\n newNodesIndices.add(index / b);\n index = traverseData.index;\n }\n newNodesIndices.add(index);\n\n for (int i = 0; i < branchingFactor && i < index; i++) {\n currentNewNode.set(i, currentNode.get(i));\n }\n currentNewNode.set(index, null);\n\n if (index == 0) {\n int latestIndex = newNodes.size() - 2;\n newNodes.get(latestIndex).set(newNodesIndices.get(latestIndex), null);\n\n for (int i = latestIndex; i > 0; i--) {\n if (newNodesIndices.get(i) == 0) {\n newNodes.get(i - 1).set(newNodesIndices.get(i - 1), null);\n } else {\n break;\n }\n }\n }\n\n if (newNodes.size() > 1) {\n int nonNullChildren = 0;\n for (Node<T> child : newRoot.children) {\n if (child != null) {\n nonNullChildren++;\n }\n }\n if (nonNullChildren == 1) { //need new root\n newRoot = newRoot.get(0);\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth - 1,\n this.base / branchingFactor, this.treeSize - 1, unusedTreeIndices,\n indexCorrespondingToTheFirstElement, indexCorrespondingToTheLatestElement);\n }\n }\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth, this.base,\n this.treeSize - 1, unusedTreeIndices, indexCorrespondingToTheFirstElement,\n indexCorrespondingToTheLatestElement);\n }", "private Node removeMax(Node node){\n if(node == null)\n return null;\n else if(node.right == null){ //use its left child to replace this node(max value node)\n if(node.count!=0) { //multiple value in same node\n node.count--;\n return node;\n }\n else {\n decDepth(node.left); //maintain depth when chain in left tree\n return node.left;\n }\n }\n\n //walk through right branch\n node.right = removeMax(node.right);\n if(node!=null) node.size--; // the max value must be removed\n return node;\n }", "private void checkAndSet() {\n if (value == null) {\n throw new IllegalArgumentException(EXC_NodeCannotBeNull());\n }\n\n if (equalNodes(value, selectedNodes)) {\n return;\n }\n\n List<Node> validNodes = null;\n for (int i = 0; i < value.length; i++) {\n if (value[i] == null) {\n throw new IllegalArgumentException(EXC_NoElementOfNodeSelectionMayBeNull());\n }\n \n if (!isUnderRoot(value[i])) {\n if (validNodes == null) {\n validNodes = new ArrayList<Node>(value.length);\n for (int j = 0; j < i; j++) {\n validNodes.add(value[j]);\n }\n }\n } else if (validNodes != null) {\n validNodes.add(value[i]);\n }\n }\n if (validNodes != null) {\n newValue = validNodes.toArray(new Node[validNodes.size()]);\n if (equalNodes(newValue, selectedNodes)) {\n return;\n } \n } else {\n newValue = value;\n }\n\n if ((newValue.length != 0) && (vetoableSupport != null)) {\n try {\n // we send the vetoable change event only for non-empty selections\n vetoableSupport.fireVetoableChange(PROP_SELECTED_NODES, selectedNodes, newValue);\n } catch (PropertyVetoException ex) {\n veto = ex;\n return;\n }\n }\n updateSelection();\n }", "public void run() \n\t{\n\t\tNode currentNode = this.tree.getRoot();\n\t\t\n\t\t//if the tree is empty and set the new node as the root node\n\t\tif (this.tree.getRoot() == null) \n\t\t{\n\t\t\tthis.tree.setRoot(this.node = new Node(this.node));\n\t\t\tthis.node.advanceToTheRoot();\n\t\t\ttree.getNote().setNote(\"Inserting a new root node [\" + node.getData()+\"].\");\n\t\t\twaitOnPause();\n\t\t} \n\t\telse \n\t\t{\n\t\t\t//otherwise go above the node and start to search\n\t\t\tthis.node.advanceToAboveTheRoot();\n\t\t\ttree.getNote().setNote(\"Starting to insert node [\"+this.value+\"].\");\n\t\t\twaitOnPause();\n\t\t\t\n\t\t\twhile (true) \n\t\t\t{\n\t\t\t\tint result = 0;\n\t\t\t\tboolean exit = false;\n\t\t\t\t\n\t\t\t\t//if the new node and the node which is being search are both numbers then \n\t\t\t\t//..convert their values into numbers and compare them.\n\t\t\t\tif(tree.isNumeric(currentNode.getData()) && tree.isNumeric(this.value))\n\t\t\t\t{\n\t\t\t\t\tint current = Integer.parseInt(currentNode.getData());\n\t\t\t\t\tint thisValue = Integer.parseInt(this.value);\n\t\t\t\t\t\n\t\t\t\t\tif (current == thisValue)\n\t\t\t\t\t\tresult = 1;\n\t\t\t\t\t\n\t\t\t\t\t// if the new node comes before the current node, go left\n\t\t\t\t\tif (thisValue < current) \n\t\t\t\t\t\tresult = 2;\n\t\t\t\t\telse if (thisValue > current) \n\t\t\t\t\t\tresult = 3;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//else the node which is being searched is a number so compare\n\t\t\t\t\t//..them both as words.\n\t\t\t\t\tif (currentNode.getData().compareTo(this.value) == 0) \n\t\t\t\t\t\tresult = 1;\n\t\t\t\t\t\n\t\t\t\t\t// if the new node comes before the current node, go left\n\t\t\t\t\tif (this.value.compareTo(currentNode.getData()) < 0) \n\t\t\t\t\t\tresult = 2;\n\t\t\t\t\telse if (this.value.compareTo(currentNode.getData()) > 0)\n\t\t\t\t\t\tresult = 3;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch(result)\n\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t//if the node already exists in the tree then remove the 'Search' node\n\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] already exists in the tree.\");\n\t\t\t\t\t\tif(!mf.getOpenF())\n\t\t\t\t\t\t\tthis.node.bgColor(node.getDeleteColor());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.node.setColor(node.getInvisibleColor(), node.getInvisibleColor());\n\t\t\t\t\t\twaitOnPause();\n\t\t\t\t\t\tthis.node.goDown();\n\t\t\t\t\t\ttree.getNote().setNote(\"\");\n\t\t\t\t\t\twaitOnPause();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t//if the new node is less than the node which is being searched then go to its left\n\t\t\t\t\t\t//...child. If the left child is empty then set the new node as the left child and\n\t\t\t\t\t\t//...connect them both.\n\t\t\t\t\t\ttree.getNote().setNote(\"Checking left side since node [\" + this.value +\n\t\t\t\t\t\t\t\t\"] is less than node [\"+ currentNode.getData()+\"].\");\n\t\t\t\t\t\tif (currentNode.getLeft() != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode.connectNode(this.node = new Node(this.node),\"left\");\n\t\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] inserted since node [\"+currentNode.getData()+\n\t\t\t\t\t\t\t\t\t\"]'s left child is empty.\");\n\t\t\t\t\t\t\texit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t//if the new node is greater than the node which is being searched then go to its right\n\t\t\t\t\t\t//...child. If the right child is empty then set the new node as the right child and\n\t\t\t\t\t\t//...connect them both.\n\t\t\t\t\t\ttree.getNote().setNote(\"Going to right side since node [\" + this.value +\n\t\t\t\t\t\t\t\t\"] is greater than node [\"+ currentNode.getData()+\"].\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (currentNode.getRight() != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// create a new node\n\t\t\t\t\t\t\tthis.node = new Node(this.node);\n\t\t\t\t\t\t\tcurrentNode.connectNode(this.node,\"right\");\n\t\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] inserted since node [\"+currentNode.getData()+\n\t\t\t\t\t\t\t\t\t\"]'s right child is empty.\");\n\t\t\t\t\t\t\texit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(exit)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//go to above the next node which is being searched.\n\t\t\t\tthis.node.advanceToNode(currentNode);\n\t\t\t\twaitOnPause();\t\n\t\t\t}\n\t\t\t\n\t\t\tthis.node = (this.tree.node = null);\n\t\t\t\n\t\t\t//if the tree is not empty then reposition it.\n\t\t\tif(this.tree.getRoot() != null)\n\t\t\t\t\tthis.tree.getRoot().repositionTree();\n\t\t\t\n\t\t\twaitOnPause();\n\t\t\t\n\t\t\t//check if the tree is balanced.\n\t\t\tthis.tree.reBalanceNode(currentNode);\n\t\t}\n\t\ttree.getNote().setNote(\"Insertion Complete.\");\n\t\ttree.getMainFrame().getStack().push(\"i \"+this.value); //add the operation to the stack\n\t}", "static int downToZero(Node root) {\n /*\n * Write your code here.\n */\n Queue<Node> queue = new PriorityQueue<>();\n queue.add(root);\n int min = 100001;\n while (!queue.isEmpty()){\n Node current = queue.poll();\n if(current.value <= 4){\n if (current.value == 4){\n min = current.depth + 3;\n return min;\n }\n min = current.depth+current.value;\n return min;\n }\n Node toAdd1 = new Node(current.value-1, current.depth+1);\n queue.add(toAdd1);\n for(int i = 2; i<=Math.sqrt(current.value); i++){\n if(current.value%i==0){\n Node toAdd = new Node(current.value/i, current.depth+1);\n queue.add(toAdd);\n }\n }\n }\n return min;\n }", "private Node dfsPreAdd(Node cur, int val) {\n if ( cur == null) {\n cur = new Node(val);\n return cur;\n }\n //cur is not null: decide left or right\n if (val <= cur.data) {\n cur.left = dfsPreAdd(cur.left, val); \n } else {\n cur.right = dfsPreAdd(cur.right, val);\n }\n return cur;\n }", "Node minValueNode(Node node) \n { \n Node current = node; \n \n /* loop down to find the leftmost leaf */\n while (current.left != null) \n current = current.left; \n \n return current; \n }", "private void rebalanceLeft(TreeNodeDataType n) {\n left(n);\r\n \r\n \r\n }", "public void setToLeaf() {\r\n isLeaf = true;\r\n }", "private void maximize(Node node) {\n // maximize:\n double max = Tree.MININT;\n List<Node> children = node.getChildren();\n \n// if(children.isEmpty()){\n// return;\n// }\n \n //String values = \"\";\n for (Node child : children) {\n if (child.getMove().getRating() > max) {\n max = child.getMove().getRating();\n }\n // values += \"\" + child.getMove().getRating() + \", \";\n }\n // set value\n // System.out.println(\"setting value for next parent (maximize): \" + max + \" (all values: \" + values + \")\");\n\n node.getMove().setRating(max);\n }", "public void root(Node n) {}", "private boolean helperDFS(Node current){\n\n if(expandedNode.size() == 999){\n //limit has been reached. jump out of recursion.\n expandedNode.add(current);\n System.out.println(\"No solution found.\");\n printExpanded(expandedNode);\n System.exit(0);\n return false;\n }\n\n boolean b = cycleCheck(current,expandedNode);\n\n if(!b){\n expandedNode.add(current);\n }else{\n return false;\n }\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal reached.\n //expandedNode.add(current);\n solutionPath(current);\n printExpanded(expandedNode);\n System.exit(0);\n }\n\n //Now make the children.\n\n if(!forbidden.contains(current.getDigit().getDigitString())){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n }\n\n if(current.getDigit().last_changed != 1){\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n }\n }\n return false;\n }", "public void insertNode(Node newNode) {\r\n\t\thFlag = 0;\r\n\t\tif( newNode == null ) {\r\n\t\t\tthrow new NullPointerException(\"Inserted node is null\");\r\n\t\t}\r\n\t\t//if tree is empty, make this node the root\r\n\t\tif( size == 0 ) {\r\n\t\t\troot = newNode;\r\n\t\t\tnewNode.parent = nilNode;\r\n\t\t\tnewNode.left = nilNode;\r\n\t\t\tnewNode.right = nilNode;\r\n\t\t\tnewNode.color = 1;\r\n\t\t\theight = 1;\r\n\t\t} else {\r\n\t\t\t//otherwise, start at root and climb down tree until a spot is found\r\n\t\t\tNode y = nilNode;\r\n\t\t\tNode x = root;\r\n\t\t\tint count = 1;\r\n\r\n\t\t\twhile(x != nilNode) {\r\n\t\t\t\ty = x;\r\n\t\t\t\tif(newNode.key < x.key || (newNode.key == x.key && newNode.p == 1) )\r\n\t\t\t\t\tx = x.left;\r\n\t\t\t\telse\r\n\t\t\t\t\tx = x.right;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tif(height < count) {\r\n\t\t\t\theight = count;\r\n\t\t\t\thFlag = 1;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tnewNode.parent = y;\r\n\t\t\tif(newNode.key < y.key || (newNode.key == y.key && newNode.p == 1) )\r\n\t\t\t\ty.left = newNode;\r\n\t\t\telse\r\n\t\t\t\ty.right = newNode;\r\n\t\t\tnewNode.left = nilNode;\r\n\t\t\tnewNode.right = nilNode;\r\n\t\t\tnewNode.color = 0;\r\n\r\n\t\t\t//fix up tree\r\n\t\t\tRBFixup(newNode);\r\n\t\t\t\r\n\t\t\t//Time to update the vaules in each node in O(h) time\r\n\t\t\t//after the fix up, newNode may have children who need to be updated,so\r\n\t\t\t//if newNode has nonNil children, start updating from either child\r\n\t\t\tif( !newNode.right.isNil || !newNode.left.isNil ) {\r\n\t\t\t\t//start from newNode's left child (right would work too)\r\n\t\t\t\trecUpdateNode(newNode.left);\r\n\t\t\t} else {\r\n\t\t\t\t//start from newNode\r\n\t\t\t\trecUpdateNode(newNode);\r\n\t\t\t}\n\t\t}\r\n\t\tsize++;\r\n\t}", "protected void scanNodesForRecursion(Cell cell, HashSet<Cell> markCellForNodes, NodeProto [] nil, int start, int end)\n \t{\n \t\tfor(int j=start; j<end; j++)\n \t\t{\n \t\t\tNodeProto np = nil[j];\n \t\t\tif (np instanceof PrimitiveNode) continue;\n \t\t\tCell otherCell = (Cell)np;\n \t\t\tif (otherCell == null) continue;\n \n \t\t\t// subcell: make sure that cell is setup\n \t\t\tif (markCellForNodes.contains(otherCell)) continue;\n \n \t\t\tLibraryFiles reader = this;\n \t\t\tif (otherCell.getLibrary() != cell.getLibrary())\n \t\t\t\treader = getReaderForLib(otherCell.getLibrary());\n \n \t\t\t// subcell: make sure that cell is setup\n \t\t\tif (reader != null)\n \t\t\t\treader.realizeCellsRecursively(otherCell, markCellForNodes, null, 0);\n \t\t}\n \t\tmarkCellForNodes.add(cell);\n \t}", "private int FixAVLtree(IAVLNode node)\r\n\t{\r\n\t\tif (node.isRealNode()) \r\n\t\t{\r\n\t\t\tif(BFCalc(node) == -2) \r\n\t\t\t{\r\n\t\t\t\t//in insert we need to fix if BFCalc(node.getLeft())==-1\r\n\t\t\t\t//in delete we need to fix if BFCalc(node.getLeft())==0 or -1\r\n\t\t\t\tint rightBF=BFCalc(node.getRight());\r\n\t\t\t\tif(rightBF==0||rightBF==-1) {\r\n\t\t\t\t\tRRRotation(node);\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t} \r\n\t\t\t\telse \r\n\t\t\t\t{ \r\n\t\t\t\t\tRLRotation(node);\r\n\t\t\t\t\treturn 2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse //if BFCalc(node) == 2 \r\n\t\t\t{\r\n\t\t\t\t//in insert we need to fix if BFCalc(node.getLeft())==1\r\n\t\t\t\t//in delete we need to fix if BFCalc(node.getLeft())==0 or 1\r\n\t\t\t\tint leftBF=BFCalc(node.getLeft());\r\n\t\t\t\tif(leftBF==1 ||leftBF==0) \r\n\t\t\t\t{\r\n\t\t\t\t\tLLRotation(node);\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{ \r\n\t\t\t\t\tLRRotation(node);\r\n\t\t\t\t\treturn 2;\r\n\t\t\t\t}\t\t\t\t\t\r\n\t\t\t} \r\n\t\t} \r\n\t\t\treturn 0;\r\n\t}", "void updateMax(StockNode a){\n\t\tif(maxNode==null){\r\n\t\t\tmaxNode=a;\r\n\t\t} else { \r\n\t\t\tif(a.stockValue>maxNode.stockValue){\r\n\t\t\t\tmaxNode=a;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private PersistentLinkedList<T> setHelper(int treeIndex, T data) {\n int newSize = this.treeSize;\n if (newSize == treeIndex) {\n newSize++;\n }\n\n TraverseData traverseData = traverse(treeIndex);\n\n traverseData.currentNewNode.set(traverseData.index, new Node<>(branchingFactor, data));\n for (int i = 0; i < branchingFactor; i++) {\n if (i == traverseData.index) {\n continue;\n }\n traverseData.currentNewNode.set(i, traverseData.currentNode.get(i));\n }\n\n return new PersistentLinkedList<>(traverseData.newRoot, branchingFactor, depth, base,\n newSize, unusedTreeIndices, indexCorrespondingToTheFirstElement,\n indexCorrespondingToTheLatestElement);\n }", "private Node<Integer> addRecursive(Node<Integer> current, int value) {\n\t\tif (current == null) {\n\t\t\treturn new Node<Integer>(value);\n\n\t\t}\n\n\t\tif (value < current.value) {\n\t\t\tcurrent.left = addRecursive(current.left, value);\n\n\t\t} else if (value > current.value) {\n\t\t\tcurrent.right = addRecursive(current.right, value);\n\n\t\t} else\n\t\t\treturn current; // value exist\n\t\treturn current;\n\t}", "public static void main(String[] args) {\n\t\tint array[]={2,3,4,6};\n\t\tint n=array.length;\n\t\tint maximum=Integer.MIN_VALUE;\n\t\tint minimum=Integer.MAX_VALUE;\n\t\tfor(int i:array)\n\t\t{\n\t\t\tif(i>maximum)\n\t\t\t\tmaximum=i;\n\t\t\tif(i<minimum)\n\t\t\t\tminimum=i;\n\t\t}\n\t\t\n\t\tint mark[]=new int[maximum+2];\n\t\tint value[]=new int[maximum+2];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tmark[array[i]]=1; // marking ki exist karta hai no need to search in the array.\n\t\t\tvalue[array[i]]=1; //har value se ek fbt to banega hi (1 node ka)\n\t\t}\n\t\tint ans=0;\n\t\tfor(int i=minimum;i<=maximum;i++){\n\t\t\tif(mark[i]==1) // element is present in the array.// we have found the first factor now find 2nd factor.\n\t\t\t{\n\t\t// find the multiples of arr[i] which are less than max value and also less than its square\n\t\t\tfor(int j=i+i ;j<=maximum && j/i<=i;j=j+i)\n\t\t\t{\n\t\t\t\tif(mark[j]==1 && mark[j/i]==1) // i is the first factor and j/i is the 2nd factor.j is the product that serves as root.\n\t\t\t\t{\n\t\t\t\t\t// value =all combination of left child with right child.\n\t\t\t\t\tvalue[j]=value[j] + (value[i] * value[j/i]);\n\t\t\t\t\t\n\t\t\t\t\t// if the 2 child are not same then one more orientation.\n\t\t\t\t\tif(i!=(j/i))\n\t\t\t\t\t\tvalue[j]=value[j] + (value[i] * value[j/i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t\tans=ans+value[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "private int HieghtsUpdating(IAVLNode node) \r\n\t{\r\n\t\tint moneRot = 0;\r\n\t\twhile (node != null) //as long as we didn't reached root's parent\r\n\t\t{\r\n\t\t\tif ((BFCalc(node) < -1) || (BFCalc(node) > 1)) //if AVL isn't balanced \r\n\t\t\t\tmoneRot+= FixAVLtree(node); \r\n \r\n\t\t\tnode.setSize(sizeCalc(node));\r\n\t\t\tif(HeightCalc(node) != node.getHeight()) {\r\n\t\t\t\tmoneRot += Math.abs(HeightCalc(node)-node.getHeight());\r\n\t\t\t\tnode.setHeight(HeightCalc(node));\r\n\t\t\t}\r\n\t\t\tnode = node.getParent();\r\n\t\t}\r\n\t\treturn moneRot;\r\n\t}", "void setRoot(Node<K, V> root) throws IOException;", "private void updateNextNode(SkiNode head, int nextI, int nextJ, int nextId) {\n\t\tif (!MatrixHelper.isPosValid(nextI, nextJ, map)) {\n\t\t\treturn;\n\t\t}\n\t\tif (head.v <= map[nextI][nextJ]) {\n\t\t\treturn;\n\t\t}\n\t\tif (hMap[nextI][nextJ] != 0) {\n\t\t\thead.level = Math.max(head.level, hMap[nextI][nextJ] + 1);\n\t\t} else {\n\t\t\thead.next[nextId] = new SkiNode(map[nextI][nextJ], nextI, nextJ, head);\n\t\t\tbuildSkiTree(head.next[nextId]);\n\t\t}\n\t}", "private void updateHeight(AvlTreeNode<?, ?> n) {\n n.height = 1 + Math.max(height(n.left), height(n.right));\n }", "private void FenwickTree(int n) {\n // Store the actual values in tree[] using update()\n for(int i = 0; i < N; i++)\n updateBIT(down_tree, Max_dis, site_distance[i], raw_tree[site_distance[i]]);\n }", "public void add(int value, String name){\n \n Node newNode = new Node(value, name); //Intialize new node \n \n if(root == null){ //If the root is null \n root = newNode; //Set newNode to the root \n }\n else{ \n Node myNode = root; //Create a second new node\n Node parent; //Crete a parent Node \n\n while (true) { //While true....\n \n parent = myNode;//Set parent node to myNode\n \n if (value < myNode.value) { //If the value is less than my node \n \n myNode = myNode.left; //Set myNode to left \n \n if (myNode == null) { //If the value of myNode is null \n \n parent.left = newNode; //Set the left parent node to newNode\n return; \n \n }\n }else {\n \n myNode = myNode.right; //Set myNode to the right Node\n \n if (myNode == null) {\n \n parent.right = newNode; //Set the right node to the newNode\n return;\n \n }\n\n }\n\n }\n \n }\n \n \n }", "private int alphaBetaMinimax (GameTreeNode node, int alpha, int beta, boolean isMax, Map<GameTreeNode, Integer> visited) {\n\n if(node.remaining == 0) {\n //System.out.println(\"Terminal State: Up : Score \" + node.score);\n return node.score;\n }\n if(visited.containsKey(node)) {\n //System.out.println(\"Memoized State: Up : Score \" + visited.get(node));\n return visited.get(node);\n }\n \n \n if(isMax) {\n int minimaxScore = Integer.MIN_VALUE;\n for(int i = 0; i < MAX_REMOVAL; i++) {\n \n GameTreeNode expandingChild = node.generateChild(1 + i);\n \n if(expandingChild == null) {\n break;\n }\n \n //System.out.println(\"Remaining \" + node.remaining + \" Down\");\n //\n minimaxScore = Math.max(minimaxScore, alphaBetaMinimax(expandingChild, alpha, beta, false, visited));\n alpha = Math.max(alpha, minimaxScore);\n //\n //System.out.println(\"Remaining \" + node.remaining + \" Up : Score: \" + minimaxScore);\n //\n if(beta <= alpha) {\n //System.out.println(\"Pruning: \" + node.remaining + \" child index \" + i+1);\n break;\n }\n }\n visited.put(node, minimaxScore);\n node.score = minimaxScore;\n return minimaxScore;\n }\n else {\n int minimaxScore = Integer.MAX_VALUE;\n for(int i = 0; i < MAX_REMOVAL; i++) {\n \n GameTreeNode expandingChild = node.generateChild(1 + i);\n if(expandingChild == null) {\n break;\n }\n //\n \n //\n //System.out.println(\"Remaining \" + node.remaining + \" Down\");\n //\n minimaxScore = Math.min(minimaxScore, alphaBetaMinimax(expandingChild, alpha, beta, true, visited));\n beta = Math.min(beta, minimaxScore);\n //\n //System.out.println(\"Remaining \" + node.remaining + \" Up : Score: \" + minimaxScore);\n //\n if(beta <= alpha) {\n //System.out.println(\"Pruning: \" + node.remaining + \" child index \" + i+1);\n break;\n }\n }\n visited.put(node, minimaxScore);\n node.score = minimaxScore;\n return minimaxScore;\n }\n }", "private Node removeMin(Node node){\n if(node == null)\n return null;\n else if(node.left == null) {//use right child to replace this node (min value node)\n if(node.count!=0){ //multiple value in same node\n node.count--;\n return node;\n }\n else{\n decDepth(node.right); //maintain depth when chain in right tree\n return node.right;\n }\n }\n\n //walk through left branch\n node.left = removeMin(node.left);\n if(node!=null) node.size--; // the min value must be removed\n return node;\n }", "public void setLeaf(Integer leaf) {\n this.leaf = leaf;\n }", "public void update_height() {\r\n int tmp_height = 0;\r\n int tmp_left = -1;\r\n int tmp_right = -1;\r\n\r\n // set height of null children to -1\r\n if (leftChild != null) {\r\n tmp_left = leftChild.height;\r\n }\r\n if (rightChild != null) {\r\n tmp_right = rightChild.height;\r\n }\r\n\r\n // find highest child\r\n if (tmp_left > tmp_right) {\r\n tmp_height = tmp_left;\r\n }\r\n else {\r\n tmp_height = tmp_right;\r\n }\r\n\r\n // update this node's height\r\n height = tmp_height + 1;\r\n }", "@Override\n\tpublic boolean add(E e) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tStack<Node> stackForParent = new Stack<Node>();\n\t\t\n\t\t\n\t\tNode tempRoot = root;\n\t\tif(root == null) {\n\t\t\tsize += 1;\n\t\t\troot = new Node(e);\n\t\t\troot.height = max(heightOfNode(root.left) , heightOfNode(root.right)) + 1;\n\t\t} else {\n\n\t\t\tNode newNode = new Node(e);\n\n\t\t\tNode y = null;\n\n\t\t\twhile(tempRoot != null){\n\t\t\t\ty = tempRoot;\n\t\t\t\tif(e.compareTo(tempRoot.value) < 0){\n\t\t\t\t\tstack.push(tempRoot);\n\t\t\t\t\tstackForParent.push(tempRoot);\n\t\t\t\t\ttempRoot = tempRoot.left;\n\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(tempRoot);\n\t\t\t\t\tstackForParent.push(tempRoot);\n\t\t\t\t\ttempRoot = tempRoot.right;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(y == null){\n\t\t\t\ty = newNode;\n\t\t\t\tsize += 1;\n\t\t\t\ty.balanceFactor = 0;\n\t\t\t} else if(e.compareTo(y.value) < 0){\n\t\t\t\ty.left = newNode;\n\t\t\t\ty.left.balanceFactor = 0;\n\t\t\t\tsize += 1;\n\t\t\t} else if(e.compareTo(y.value) == 0) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\ty.right = newNode;\n\t\t\t\ty.right.balanceFactor = 0;\n\t\t\t\tsize += 1;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tNode parent = null;\n\t\t\tNode walkBackNode;\n\t\t\tint lHeight,rHeight;\n\t\t\tif(!stackForParent.empty()) {\n\t\t\t\tstackForParent.pop();\n\t\t\t}\n\t\t\t\n//\t\t\tSystem.out.println(stack.pop().value);\n\t\t\twhile(!stack.empty()) {\n\t\t\t\twalkBackNode = stack.pop();\n//\t\t\t\twalkBackNode.height = walkBackNode.height + 1;\n\t\t\t\tif(!stackForParent.empty()) {\n\t\t\t\t\tparent = stackForParent.pop();\n\t\t\t\t}\n\t\t\t\tif(walkBackNode.left == null) {\n\t\t\t\t\tlHeight = -1;\n\t\t\t\t} else {\n\t\t\t\t\tlHeight = walkBackNode.left.height ;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(walkBackNode.right == null) {\n\t\t\t\t\trHeight = -1;\n\t\t\t\t} else {\n\t\t\t\t\trHeight = walkBackNode.right.height;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twalkBackNode.balanceFactor = lHeight - rHeight;\n\t\t\t\t\n\t\t\t\twalkBackNode.height = 1 + max(lHeight,rHeight);\n\t\t\t\t\n\t\t\t\tif((walkBackNode.balanceFactor < -1) || walkBackNode.balanceFactor > 1) {\n\t\t\t\t\t// tree is violating the rules of AVL tree\n\t\t\t\t\tif(walkBackNode.balanceFactor > 1 && e.compareTo(walkBackNode.left.value) < 0) {\n\t\t\t\t\t\tif(walkBackNode.value == this.root.value) {\n\t\t\t\t\t\t\tthis.root = rrRotation(walkBackNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent.right = rrRotation(walkBackNode);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif(walkBackNode.balanceFactor < -1 && e.compareTo(walkBackNode.right.value) > 0) {\n\t\t\t\t\t\tif(walkBackNode.value == this.root.value) {\n\t\t\t\t\t\t\tthis.root = lrRotation(walkBackNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent.left = lrRotation(walkBackNode);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif(walkBackNode.balanceFactor > 1 && e.compareTo(walkBackNode.left.value) > 0) {\n\t\t\t\t\t\twalkBackNode.left = lrRotation(walkBackNode.left);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(walkBackNode.value == this.root.value) {\n\t\t\t\t\t\t\tthis.root = rrRotation(walkBackNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent.left = rrRotation(walkBackNode);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\trrRotation(walkBackNode);\n//\t\t\t\t\t\tSystem.out.println(\"Root value:= \" + values.balanceFactor);\n//\t\t\t\t\t\tSystem.out.println(\"Left value:= \" + values.left.balanceFactor);\n//\t\t\t\t\t\tSystem.out.println(\"Right value:= \" + values.right.balanceFactor);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif(walkBackNode.balanceFactor< -1 && e.compareTo(walkBackNode.right.value) < 0) {\n\t\t\t\t\t\twalkBackNode.right = rrRotation(walkBackNode.right);\n\t\t\t\t\t\tif(walkBackNode.value == this.root.value) {\n\t\t\t\t\t\t\tthis.root = lrRotation(walkBackNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent.right = lrRotation(walkBackNode);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\tlrRotation(walkBackNode); \n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private void update(int v, int from, int to, int value) {\n\t\tNode node = heap[v];\n\n\t\t/**\n\t\t * If the updating-range contains the portion of the current Node We lazily update it. This means We\n\t\t * do NOT update each position of the vector, but update only some temporal values into the Node;\n\t\t * such values into the Node will be propagated down to its children only when they need to.\n\t\t */\n\t\tif (contains(from, to, node.from, node.to)) {\n\t\t\tchange(node, value);\n\t\t}\n\n\t\tif (node.size() == 1)\n\t\t\treturn;\n\n\t\tif (intersects(from, to, node.from, node.to)) {\n\t\t\t/**\n\t\t\t * Before keeping going down to the tree We need to propagate the the values that have been\n\t\t\t * temporally/lazily saved into this Node to its children So that when We visit them the values are\n\t\t\t * properly updated\n\t\t\t */\n\t\t\tpropagate(v);\n\n\t\t\tupdate(2 * v, from, to, value);\n\t\t\tupdate(2 * v + 1, from, to, value);\n\n\t\t\tnode.sum = heap[2 * v].sum + heap[2 * v + 1].sum;\n\t\t\tnode.min = Math.min(heap[2 * v].min, heap[2 * v + 1].min);\n\t\t}\n\t}", "boolean deadEnd(Node root, int min, int max) \n{ \n // if the root is null or the recursion moves \n // after leaf node it will return false \n // i.e no dead end. \n if (root==null) \n return false; \n \n // if this occurs means dead end is present. \n if (min == max) \n return true; \n \n // heart of the recursion lies here. \n return deadEnd(root.left, min, root.data - 1)|| \n deadEnd(root.right, root.data + 1, max); \n}", "private Value update(Node recentNode) {\n Node temp = recentNode.next;\n Value value = temp.val;\n recentNode.next = recentNode.next.next;\n Node node = first;\n while (node.next != null) {\n node = node.next;\n }\n node.next = temp;\n temp.next = null;\n return value;\n }", "int sumRootToLeafNumbers();", "private void fixAVLTree(Node node) {\n\t\tfinal int lf = getLoadFactor(node);\n\t\t//if (lf == -1 || lf == 0 || lf == 1) {\n\t\tif (lf >= -1 && lf <= 1) {\n\t\t\t// do nothing\n\t\t\treturn;\n\t\t}\t\t\n\t\trotateTree(node);\n\t}", "private Node<Value> delMax(Node<Value> x)\r\n {\r\n if (x.right == null) return x.left;\r\n x.right = delMax(x.right);\r\n return x;\r\n }", "private int first_leaf() { return n/2; }", "private void handleUnderflow(Node node) {\n\t\t\r\n\t\tNode parent = node.getParent();\r\n\t\t\r\n\t\t//underflow in parent\r\n\t\tif (parent == null) {\r\n\t\t\t//System.out.println(\"Underflow in root!\");\r\n\t\t\tNode newRoot = new Node();\r\n\t\t\t//copy all data of root children into new root\r\n\t\t\tfor (int i = 0; i < root.getChildren().size(); i++) {\r\n\t\t\t\tfor (int j = 0; j < root.getChild(i).getData().size(); j++) {\r\n\t\t\t\t\tnewRoot.addData(root.getChild(i).getData(j));\r\n\t\t\t\t\tif (!root.getChild(i).isLeaf()) {\r\n\t\t\t\t\t\tnewRoot.addChild(root.getChild(i).getChild(j));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!root.getChild(i).isLeaf())\r\n\t\t\t\t\tnewRoot.addChild(root.getChild(i).getChild(root.getChild(i).getChildren().size()));\r\n\t\t\t}\r\n\t\t\tsize--;\r\n\t\t\troot = newRoot;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tint nodePosInParent = parent.getEmptyChild();\r\n\t\t\t//if right most child of parent, must borrow from left\r\n\t\t\tif (nodePosInParent == parent.getChildren().size() - 1 ) {\r\n\t\t\t\t//take right most data value from parent\r\n\t\t\t\tnode.addData(parent.removeData(parent.getData().size() - 1));\r\n\t\t\t\t\r\n\t\t\t\tif (node.getSibling(\"left\").getData().size() > 1) {\r\n\t\t\t\t\tparent.addData(node.getSibling(\"left\").removeData(node.getSibling(\"left\").getData().size() - 1));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmerge(node.getSibling(\"left\"), node);\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\t//take immediate greater value from parent\r\n\t\t\t\t//node.addData(parent.removeData(nodePosInParent));\r\n\r\n\t\t\t\t//if we can steal from right sibling\r\n\t\t\t\tif (node.getSibling(\"right\").getData().size() > 1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//take immediate greater value from parent\r\n\t\t\t\t\tnode.addData(parent.removeData(nodePosInParent));\r\n\t\t\t\t\t\r\n\t\t\t\t\tparent.addData(node.getSibling(\"right\").removeData(0));\r\n\t\t\t\t\t\r\n\t\t\t\t//otherwise steal from left\r\n\t\t\t\t} else if (nodePosInParent != 0 && node.getSibling(\"left\").getData().size() > 1) {\r\n\r\n\t\t\t\t\t//take immediate lesser value from parent\r\n\t\t\t\t\tnode.addData(parent.removeData(nodePosInParent - 1));\r\n\t\t\t\t\t\r\n\t\t\t\t\tparent.addData(node.getSibling(\"left\").removeData(node.getSibling(\"left\").getData().size() - 1));\r\n\t\t\t\t\t\r\n\t\t\t\t//else, merge\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t//take immediate greater value from parent\r\n\t\t\t\t\tnode.addData(parent.removeData(nodePosInParent));\r\n\t\t\t\t\t\r\n\t\t\t\t\tmerge(node, node.getSibling(\"right\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\t@SuppressWarnings(\"unchecked\")\n\tprotected final void processWhenUpdated(Node node) {\n\t\tboolean first = false;\n\t\tif (!this.safeCurrentSCCNodes.contains(node)) {\n\t\t\tfirst = true;\n\t\t\t// Don't add the node to this set unless its OUT has been populated.\n\t\t}\n\t\tNodeInfo nodeInfo = node.getInfo();\n\t\tCollection<Node> predecessors;\n\t\tpredecessors = nodeInfo.getCFGInfo().getInterProceduralLeafPredecessors();\n\t\tF oldIN = (F) nodeInfo.getIN(analysisName);\n\t\tboolean propagateFurther = false;\n\t\tF newIN;\n\t\tif (oldIN == null) {\n\t\t\t// First processing ever of this node!\n\t\t\tpropagateFurther = true;\n\t\t\tnewIN = (predecessors.isEmpty()) ? newIN = this.getEntryFact() : this.getTop();\n\t\t} else if (first) {\n\t\t\t// First processing in the first round of update.\n\t\t\tnewIN = (predecessors.isEmpty()) ? newIN = this.getEntryFact() : this.getTop();\n\t\t} else {\n\t\t\tnewIN = oldIN; // Use the same object.\n\t\t}\n\n\t\tboolean inChanged = false;\n\t\tif (this.analysisName == AnalysisName.CROSSCALL_PREDICATE_ANALYSIS && node instanceof PostCallNode) {\n\t\t\t// A small hack here.\n\t\t\tPostCallNode postNode = (PostCallNode) node;\n\t\t\tList<FunctionDefinition> funcDef = postNode.getParent().getInfo().getCalledDefinitions();\n\t\t\tif (funcDef.isEmpty() || funcDef.stream().noneMatch(f -> this.functionWithBarrier.contains(f))) {\n\t\t\t\tpredecessors = new HashSet<>();\n\t\t\t\tpredecessors.add(postNode.getParent().getPreCallNode());\n\t\t\t}\n\t\t}\n\t\tboolean anyPredMissed = false;\n\t\tfor (Node predNode : predecessors) {\n\t\t\t/*\n\t\t\t * Ignore a predecessor if:\n\t\t\t * (i) it lies within the SCC, AND\n\t\t\t * (ii) it has not been processed yet.\n\t\t\t */\n\t\t\tSCC predSCC = predNode.getInfo().getCFGInfo().getSCC();\n\t\t\tif (predSCC != null) {\n\t\t\t\t// If null, then pred clearly belongs to some other SCC.\n\t\t\t\tif (node.getInfo().getCFGInfo().getSCC() == predSCC) {\n\t\t\t\t\t// Predecessor lies within the SCC.\n\t\t\t\t\tif (!this.safeCurrentSCCNodes.contains(predNode)) {\n\t\t\t\t\t\tanyPredMissed = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tF predOUT = (F) predNode.getInfo().getOUT(analysisName);\n\t\t\tif (predOUT == null) {\n\t\t\t\t/*\n\t\t\t\t * Here, we do not mark anyPredMissed, as this node would be\n\t\t\t\t * marked for processing whenever the predecessor has been\n\t\t\t\t * processed for the first time. Check the setting of\n\t\t\t\t * propagateFurther above.\n\t\t\t\t */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tF edgeOUT = this.edgeTransferFunction(predOUT, predNode, node);\n\t\t\tinChanged |= newIN.merge(edgeOUT, null);\n\t\t}\n\n\t\tif (node instanceof PostCallNode) {\n\t\t\tPreCallNode preNode = ((CallStatement) node.getParent()).getPreCallNode();\n\t\t\tSCC preSCC = preNode.getInfo().getCFGInfo().getSCC();\n\t\t\tboolean doNotProcess = false;\n\t\t\tif (preSCC != null) {\n\t\t\t\t// If null, then pred clearly belongs to some other SCC.\n\t\t\t\tif (node.getInfo().getCFGInfo().getSCC() == preSCC) {\n\t\t\t\t\t// Predecessor lies within the SCC.\n\t\t\t\t\tif (!this.safeCurrentSCCNodes.contains(preNode)) {\n\t\t\t\t\t\tanyPredMissed = true;\n\t\t\t\t\t\tdoNotProcess = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!doNotProcess) {\n\t\t\t\tinChanged |= processPostCallNodesIN((PostCallNode) node, newIN);\n\t\t\t}\n\n\t\t}\n\t\tif (anyPredMissed) {\n\t\t\tthis.underApproximated.add(node);\n\t\t} else {\n\t\t\tthis.underApproximated.remove(node);\n\t\t}\n\t\tnodeInfo.setIN(analysisName, newIN);\n\n\t\t// Step 2: Apply the flow-function on IN, to obtain the OUT.\n\t\tF newOUT;\n\t\tnewOUT = node.accept(this, newIN);\n\t\tnodeInfo.setOUT(analysisName, newOUT);\n\t\tthis.safeCurrentSCCNodes.add(node); // Mark a node as processed only after its OUT has been \"purified\".\n\n\t\t// Step 3: Process the successors.\n\t\tpropagateFurther |= inChanged;\n\t\tif (propagateFurther) {\n\t\t\tthis.globalWorkList.addAll(nodeInfo.getCFGInfo().getInterProceduralLeafSuccessors());\n\t\t\tif (node instanceof PreCallNode) {\n\t\t\t\tPreCallNode pre = (PreCallNode) node;\n\t\t\t\tthis.globalWorkList.add(pre.getParent().getPostCallNode());\n\t\t\t}\n\t\t\t// If we are adding successors of a BeginNode of a FunctionDefinition, we should\n\t\t\t// add all the ParameterDeclarations.\n\t\t\tif (node instanceof BeginNode && node.getParent() instanceof FunctionDefinition) {\n\t\t\t\tFunctionDefinition func = (FunctionDefinition) node.getParent();\n\t\t\t\tfor (ParameterDeclaration paramDecl : func.getInfo().getCFGInfo().getParameterDeclarationList()) {\n\t\t\t\t\tthis.globalWorkList.add(paramDecl);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic boolean add(T elem) {\n\t\tif (this.contains(elem)) { // no duplicates\n\t\t\treturn false;\n\t\t} else if (valCount < 3) { // if has space for more\n\t\t\tif (childCount == 0) { // add elem as direct descendant\n\t\t\t\tfor (int i = 0; i < valCount; ++i) {\n\t\t\t\t\tif (comp.compare(elem,values[i]) < 0) {\n\t\t\t\t\t\tfor (int j = 2; j > i; --j) { // shifts all other elements by 1\n\t\t\t\t\t\t\tvalues[j] = values[j - 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvalues[i] = elem;\n\t\t\t\t\t++valCount;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else { // add elem as indirect descendant\n\t\t\t\tfor (int i = 0; i < childCount; ++i) { // searching with which child elem belongs\n\t\t\t\t\tif (comp.compare(elem,values[i]) < 0) {\n\t\t\t\t\t\treturn children[i].add(elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn children[childCount].add(elem); // elem is greater than all other children and should be put rightmost\n\t\t\t}\n\t\t} else { // node is 4-tree and should be reduced\n\t\t\tTwoThreeFourTreeSet<T> tempLeft = new TwoThreeFourTreeSet<T>(); // generating new left and right children of reduced node\n\t\t\tTwoThreeFourTreeSet<T> tempRight = new TwoThreeFourTreeSet<T>();\n\t\t\t\n\t\t\ttempLeft.values[0] = values[0];\n\t\t\ttempLeft.valCount = 1;\n\t\t\ttempLeft.children[0] = this.children[0];\n\t\t\ttempLeft.children[1] = this.children[1];\n\t\t\ttempLeft.childCount = 2;\n\t\t\t\n\t\t\ttempRight.values[0] = values[2];\n\t\t\ttempRight.valCount = 1;\n\t\t\ttempRight.children[0] = this.children[2];\n\t\t\ttempRight.children[1] = this.children[3];\n\t\t\ttempRight.childCount = 2;\n\t\t\t\n\t\t\tif (parent == null) { // if no parent, create new node with middle value\n\t\t\t\tTwoThreeFourTreeSet<T> tempParent = new TwoThreeFourTreeSet<T>();\n\t\t\t\ttempParent.values[0] = values[1];\n\t\t\t\t\t\n\t\t\t\ttempParent.children[0] = tempLeft;\n\t\t\t\ttempParent.children[1] = tempRight;\n\t\t\t\ttempParent.childCount = 2;\n\t\t\t\tthis.parent = tempParent;\n\t\t\t} else { // else parent exists, and current node should be added\n\t\t\t\tif (comp.compare(parent.values[0],values[1]) < 0) { // if node belongs leftmost\n\t\t\t\t\tif (parent.valCount > 1) {\n\t\t\t\t\t\t// shift right element by 1\n\t\t\t\t\t\tparent.values[2] = parent.values[1];\n\t\t\t\t\t\tparent.children[3] = parent.children[2];\n\t\t\t\t\t}\n\t\t\t\t\t// shift left element by 1\n\t\t\t\t\tparent.values[1] = parent.values[0];\n\t\t\t\t\tparent.children[2] = parent.children[1];\n\t\t\t\t\t\n\t\t\t\t\t// push left;\n\t\t\t\t\tparent.values[0] = values[1];\n\t\t\t\t\tparent.children[0] = tempLeft;\n\t\t\t\t\tparent.children[1] = tempRight;\n\t\t\t\t} else if (parent.valCount < 2 || comp.compare(parent.values[1],values[1]) < 0) { // if node belongs in center\n\t\t\t\t\tif (parent.valCount > 1) { // should we shift?\n\t\t\t\t\t\tparent.values[2] = parent.values[1];\n\t\t\t\t\t\tparent.children[3] = parent.children[2];\n\t\t\t\t\t}\n\t\t\t\t\t// push center\n\t\t\t\t\tparent.values[1] = values[1];\n\t\t\t\t\tparent.children[1] = tempLeft;\n\t\t\t\t\tparent.children[2] = tempRight;\n\t\t\t\t} else { // if node belongs rightmost\n\t\t\t\t\t// push right\n\t\t\t\t\tparent.values[2] = values[1];\n\t\t\t\t\tparent.children[2] = tempLeft;\n\t\t\t\t\tparent.children[3] = tempRight;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tTwoThreeFourTreeSet<T> newTree = this;\n\t\t\tnewTree = newTree.parent; // changing this indirectly\n\t\t\t++newTree.valCount;\n\t\t\treturn newTree.add(elem);\n\t\t}\n\t\treturn false;\n\t}", "private void adjustRootDeficiency(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tif(deficientNode.parent == null) {\n rootRef.set(deficientNode);\n return;\n }\n adjustDeficientRedSiblingNode(deficientNode, rootRef);\n\t}", "public void recursiveComputeMaxTotal()\r\n {\r\n if (parents.size() == 0)\r\n {\r\n this.maxTotal = this.content;\r\n }\r\n else\r\n {\r\n if (parents.size() == 1)\r\n {\r\n this.maxTotal = this.content + parents.get(0).maxTotal;\r\n }\r\n else\r\n {\r\n this.maxTotal = this.content + Math.max(parents.get(0).maxTotal, parents.get(1).maxTotal);\r\n }\r\n }\r\n \r\n for (P018Node n : children)\r\n {\r\n n.recursiveComputeMaxTotal();\r\n }\r\n }", "private int percolateUpLeaf(){\n\t\treturn percolateUp(heap.size()-1);// TODO: A one-line function that calls percolateUp()\n\t}", "public static Node addNode(Node root, int value) {\n Node newNode = new Node(value);\n // Check if root is null make the new node root\n if (root == null) {\n // return New Node\n return newNode;\n }\n // If root is not null check value against current Node's data to determine which branch to travel\n Node trav = root;\n while (true) {\n\n // If lower\n if (value < trav.data) {\n if (trav.left != null) {\n trav = trav.left;\n continue;\n } else {\n trav.left = newNode;\n break;\n }\n }\n // If there's a current node then travel.\n // repeat line 25\n // else add Node to Current.left = New Node\n // If greater\n if (value > trav.data) {\n if (trav.right != null) {\n trav = trav.right;\n continue;\n } else {\n trav.right = newNode;\n break;\n }\n }\n // If there's a current node then travel.\n // repeat line 25\n // else add Node to Current.right= New Node\n // return root\n }\n return root;\n }", "public void delete(int val){\n Node parent = this.root;\n Node current = this.root;\n boolean isLeftChild = false;\n \n while (current.val != val){\n parent = current;\n if (current.val > val){\n isLeftChild = true;\n current = current.left;\n } else {\n isLeftChild = false;\n current = current.right;\n }\n \n if (current == null){\n return;\n }\n }\n \n // If we are here it means we have found the node\n // Case 1. leaf node\n if (current.left == null && current.right == null){\n if (current == this.root){\n this.root = null;\n }\n \n if (isLeftChild){\n parent.left = null;\n } else {\n parent.right = null;\n }\n }\n \n // Case 2. one child\n else if (current.left == null){\n if (current == this.root){\n this.root = current.right;\n } else if (isLeftChild){\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n } else if (current.right == null){\n if (current == this.root){\n this.root = current.left;\n } else if (isLeftChild){\n parent.left = current.left;\n } else {\n parent.right = current.left;\n }\n }\n \n // Case 3. two children. successor is the smallest node in the right subtree\n else if (current.left != null && current.right != null){\n Node successor = getSuccessor(current);\n if (current == this.root){\n root = successor;\n } else if (isLeftChild){\n parent.left = successor;\n } else {\n parent.right = successor;\n }\n }\n \n }", "@Override\npublic boolean fjern(T verdi) {\n Node<T> curr = hode;\n while (curr != null) {\n if (curr.verdi.equals(verdi)) {\n if (antall == 1) {\n hode = hale = null;\n } else if (curr == hode) {\n hode = hode.neste;\n hode.forrige = null;\n } else if (curr == hale) {\n hale = hale.forrige;\n hale.neste = null;\n } else {\n curr.forrige.neste = curr.neste;\n curr.neste.forrige = curr.forrige;\n }\n antall--;\n endringer++;\n return true;\n }\n curr = curr.neste;\n }\n return false;\n}", "void updateAllParentsBelow();", "public V put(K key, V value){\n\t\tV v=null;\n\t\tNode n;\n\t\t\n\t\t\n\t\tif(root==null){\n\t\t\t\n\t\t\troot=new Node(key,value);\t\t\t\n\t\t\troot.parent=null;\n\t\t\t\n\t\t}\n\t\telse if(get(key)!=null){\n\t\t\t\n\t\t\tv=searchkey(root, key).value;\n\t\t\t\n\t\t\tsearchkey(root, key).value=value;\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tif(root.key.compareTo(key)>0){\n\t\t\t\tn=leftend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){if(t.key.compareTo(key)<0&&t!=root){break;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.left;\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=rightend(n);\n\t\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tn.right.parent=n;\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(root.key.compareTo(key)<0 ){\n\t\t\t\t\n\t\t\t\tn=rightend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){\n\t\t\t\t\tif(t.key.compareTo(key)>0 && t!=root){\n\t\t\t\t\t\tbreak;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.right;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\t\n\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\n\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=leftend(n);\n\t\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\treturn v;\t\n\t}", "void decreasekey(Nodefh node, double newValue){\n\t\t\n\t\tnode.dist = newValue;\n\t\tif(node.Parent == null){\n\t\t\tif(node == min){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t\tnode.Left.Right = node.Right;\n\t\t\tnode.Right.Left = node.Left;\n\t\t\tfhInsert(node);\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t\tCondition varies depending on whether the child is present or not\n\t\t*/\n\t\tif(node.Parent.Child == node){\n\t\t\tif(node.Right != null && node.Right != node){\n\t\t\t\tnode.Parent.Child = node.Right;\n\t\t\t\tif(node.Left!=null && node.Left != node){\n\t\t\t\t\tnode.Left.Right = node.Right;\n\t\t\t\t\tnode.Right.Left = node.Left;\n\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnode.Right.Left = node.Right;\n\t\t\t\t\tnode.Right.Right = node.Right;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnode.Parent.Child = null;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(node.Left != null && node.Left != node){\n\t\t\t\tnode.Left.Right = node.Right;\n\t\t\t\tnode.Right.Left = node.Left;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t\tThe decreased key node is inserted here.\n\t\t*/\n\t\t\n\t\tfhInsert(node);\n\t\tif(node.Parent.ChildCut == true){\n\t\t\tcascadingCut(node.Parent);\n\t\t}\n\t\telse{\n\t\t\tnode.Parent.ChildCut = false;\n\t\t}\n\t\tnode.Parent = null;\n\t}", "public void fixup(Node root, Node z)\n {\n \t //root = this.root;\n// \t System.out.println(\"The starting root is: \" + root.data);\n \t if(z.data == root.data)\n \t {\n \t\t root.color = BLACK;\n \t\t return;\n \t }\n \t //PRINT OUT NUMBER ONE\n// \t System.out.println(\"z.parent.data is \" + z.parent.data);\n// \t System.out.println(\"z.data is \" + z.data);\n// \t \n// \t if(z.parent.right != null)\n// \t\t System.out.println(\"z.parent.right.data is \" + z.parent.right.data);\n\n \t while(z.parent.color == RED)\n \t {\n\n \t\t //System.out.println(root.left.data);\n \t\t if( z.parent == z.parent.parent.left)\n \t\t {\n\n \t\t\t Node y = z.parent.parent.right;\n\n \t\t\t if(y != null &&y.color == RED)\n \t\t\t {\n \t\t\t\t z.parent.color = BLACK;\n \t\t\t\t y.color = BLACK;\n \t\t\t\t z.parent.parent.color = RED;\n \t\t\t\t z = z.parent.parent;\n \t\t\t }\n \t\t\t else {\n \t\t\t\t //PRINT OUT NUMBER ONE IN WHILE\n// \t\t\t\t System.out.println(\"(in while) z.parent.data is \" + z.parent.data);\n// \t\t\t\t System.out.println(\"(in while) z.data is \" + z.data);\n// \t\t\t\t if(z.parent.right != null)\n// \t\t\t\t\t System.out.println(\"(in while) z.parent.right.data is \" + z.parent.right.data);\n \t\t\t\t if(z == z.parent.right)\n \t\t\t\t {\n \t\t\t\t\t z.parent.color = BLACK;\n \t\t\t\t\t z.parent.parent.color = RED;\n \t\t\t\t\t // left rotate\n// \t\t\t\t\t System.out.println(\"I am ready to rotate left around: \" + z.parent.data);\n \t\t\t\t\t rotateLeft(z.parent);\n \t\t\t\t\t root = this.root;\n \t\t\t\t }\n \t\t\t\t else {\n \t\t\t\t\t z.parent.color = BLACK;\n \t\t\t\t\t z.parent.parent.color = RED;\n \t\t\t\t\t // right rotate\n// \t\t\t\t\t System.out.println(\"I am ready to rotate right around : \" + z.parent.data);\n\n \t\t\t\t\t rotateRight(z.parent);\n \t\t\t\t\t root = this.root;\n \t\t\t\t }\n\n \t\t\t }\n \t\t }\n \t\t else\n \t\t {\n \t\t\t //PRINT OUT NUMBER TWO\n// \t\t\t System.out.println(\"z.parent.parent.left's data is: \" +z.parent.parent.left.data);\n// \t\t\t System.out.println(\"z.parent.parent.right data is: \" +z.parent.parent.right.data);\n \t\t\t Node y = z.parent.parent.left;\n \t\t\t if(y != null && y.color == RED)\n \t\t\t {\n \t\t\t\t z.parent.color = BLACK;\n \t\t\t\t y.color = BLACK;\n \t\t\t\t z.parent.parent.color = RED;\n \t\t\t\t z = z.parent.parent;\n\n \t\t\t }\n\n \t\t\t else\n \t\t\t {\n \t\t\t\t if(z == z.parent.left)\n \t\t\t\t {\n \t\t\t\t\t z = z.parent;\n// \t\t\t\t\t System.out.println(\"I entered the right rotate methods at the bottom\");\n \t\t\t\t\t rotateRight(z.parent);\n \t\t\t\t }\n \t\t\t\t z.parent.color = BLACK;\n \t\t\t\t z.parent.parent.color = RED;\n// \t\t\t\t System.out.println(\"I entered the left rotate methods at the bottom\");\n \t\t\t\t rotateLeft(z.parent);\n \t\t\t }\n \t\t }\n \t }\n \t this.root.color = BLACK;\n// \t System.out.println(\"The ending root is: \" + root.data);\n \t //System.out.println(BTreePrinter.printNode(root));\n }", "public Node modify(Node root)\n {\n int s=0;\n //Node temp=root;\n solve(root);\n return root;\n }", "private void minimize(Node node) {\n // minimize:\n double min = Tree.MAXINT;\n List<Node> children = node.getChildren();\n \n// if(children.isEmpty()){\n// return;\n// }\n \n // String values = \"\";\n for (Node child : children) {\n if (child.getMove().getRating() < min) {\n min = child.getMove().getRating();\n }\n // values += \"\" + child.getMove().getRating() + \", \";\n }\n // set value\n // System.out.println(\"setting value for next parent (minimize): \" + min + \" (all values: \" + values + \")\");\n\n node.getMove().setRating(min);\n }", "private long replace(long r, Node change) throws IOException {\n Node current = new Node(r);\r\n if (current.right != 0) {\r\n current.right = replace(current.right, change);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(current.right) > 0) {\r\n current.right = rightRotate(current.right);\r\n current.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(current.left) < 0) {\r\n current.left = leftRotate(current.left);\r\n current.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return r;\r\n }\r\n else {\r\n change.key = current.key;\r\n change.fields = current.fields;\r\n addToFree(r);\r\n return current.left;\r\n }\r\n }", "public static void main(String[] args) {\n LongestUnivaluePath solution = new LongestUnivaluePath();\n // Example 1:\n //Input:\n //\n // 5\n // / \\\n // 4 5\n // / \\ \\\n // 1 1 5\n //Output: 2\n TreeNode root = new TreeNode(5);\n root.left = new TreeNode(4);\n root.left.left = new TreeNode(1);\n root.left.right = new TreeNode(1);\n root.right = new TreeNode(5);\n root.right.right = new TreeNode(5);\n System.out.println(solution.longestUnivaluePath(root));\n\n // Example 2:\n //Input:\n //\n // 1\n // / \\\n // 4 5\n // / \\ \\\n // 4 4 5\n //Output: 2\n root = new TreeNode(1);\n root.left = new TreeNode(4);\n root.left.left = new TreeNode(4);\n root.left.right = new TreeNode(4);\n root.right = new TreeNode(5);\n root.right.right = new TreeNode(5);\n System.out.println(solution.longestUnivaluePath(root));\n\n\n // 1\n // 2 2\n // 2 2 2\n // 2\n // output: 3\n root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.left.left = new TreeNode(2);\n root.left.left.left = new TreeNode(2);\n root.left.right = new TreeNode(2);\n root.right = new TreeNode(2);\n root.right.right = new TreeNode(2);\n System.out.println(solution.longestUnivaluePath(root));\n\n // 1\n root = new TreeNode(1);\n System.out.println(solution.longestUnivaluePath(root));\n\n // empty\n root = new TreeNode(1);\n System.out.println(solution.longestUnivaluePath(null));\n\n\n // 1\n // 3 2\n // 3 2 2\n // 2 2\n // 2 2\n // 4 2\n // output: 4\n root = new TreeNode(1);\n root.left = new TreeNode(3);\n root.left.left = new TreeNode(3);\n root.left.left.left = new TreeNode(2);\n root.left.right = new TreeNode(2);\n root.left.right.right = new TreeNode(2);\n root.left.right.right.left = new TreeNode(2);\n root.left.right.right.left.left = new TreeNode(4);\n root.left.right.right.right = new TreeNode(2);\n root.left.right.right.right.right = new TreeNode(2);\n root.right = new TreeNode(2);\n root.right.right = new TreeNode(2);\n System.out.println(solution.longestUnivaluePath(root));\n\n //Input :\n // 2\n // / \\\n // 7 2\n // / \\ \\\n // 1 1 2\n //Output : 2\n root = new TreeNode(2);\n root.left = new TreeNode(7);\n root.left.left = new TreeNode(1);\n root.left.right = new TreeNode(1);\n root.right = new TreeNode(2);\n root.right.right = new TreeNode(2);\n System.out.println(solution.longestUnivaluePath(root));\n\n //\n //Input :\n // 4\n // / \\\n // 4 4\n // / \\ \\\n // 4 9 5\n //Output : 3\n root = new TreeNode(4);\n root.left = new TreeNode(4);\n root.left.left = new TreeNode(4);\n root.left.right = new TreeNode(9);\n root.right = new TreeNode(4);\n root.right.right = new TreeNode(5);\n System.out.println(solution.longestUnivaluePath(root));\n\n\n //\n //Input :\n // 4\n // / \\\n // 4 4\n // / \\ \\\n // 4 9 5\n // / \\\n // 5 5\n //Output : 3\n root = new TreeNode(4);\n root.left = new TreeNode(4);\n root.left.left = new TreeNode(4);\n root.left.right = new TreeNode(9);\n root.right = new TreeNode(4);\n root.right.right = new TreeNode(5);\n root.right.right.left = new TreeNode(5);\n root.right.right.right = new TreeNode(5);\n System.out.println(solution.longestUnivaluePath(root));\n }", "private Node add(Node root, Integer value) {\n\t\tif(root==null)\n\t\t\troot=new Node(value);\n\t\telse if(value<root.value)\n\t\t\troot.left=add(root.left, value);\n\t\telse if(value>root.value)\n\t\t\troot.right=add(root.right,value);\n\t\telse\n\t\t\tthrow new RuleViolationException();\n\t\treturn root;\n\t}", "private static void helper(TreeNode root, int curSum, int curLen) {\n if (root == null) {\n if (maxLen < curLen) {\n maxLen = curLen;\n maxSum = curSum;\n } else if (maxLen == curLen && maxSum < curSum) {\n maxSum = curSum;\n }\n return;\n }\n\n // do this for left and right\n helper(root.left,curSum + root.val, curLen + 1);\n helper(root.right,curSum + root.val, curLen + 1);\n }", "private IntTreeNode add(IntTreeNode root, int value) {\n if (root == null) {\n root = new IntTreeNode(value);\n } else if (value <= root.data) {\n root.left = add(root.left, value);\n } else {\n root.right = add(root.right, value);\n\t}\n return root;\n }", "@Override\n public void setValue(Node value) throws ValueFormatException,\n VersionException, LockException, ConstraintViolationException,\n RepositoryException {\n \n }", "public void refresh()\n\t{\n\t\tNode master = new Node(\"Tyler\");\n\t\t//master.add(new Node(\"Test\"));\n\t\tmaster.addParent(new Node(\"Clinton\"));\n\t\tmaster.addParent(new Node(\"Terry\"));\n\t\t\n\t\tmaster.add(\"Justin\", \"Terry\"); \n\t\tmaster.add(\"Justin\", \"Clinton\"); \n\t\t//this adds directly under Terry\n\t\t//maybe do this differently...\n\t\t\n\t\t\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"Diana\"));\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"George\"));\n\t\t\n\t\tmaster.add(new Node(\"Tyler 2.0\"));\n\t\tmaster.add(new Node(\"Tyler 3.0\"));\n\t\tmaster.add(new Node(\"Tyler Jr\"));\n\t\t\n\n\t\tmaster.add(\"Tyler Jr Jr\", \"Tyler 2.0\");\n\t\t\n\t\tmaster.add(\"Tyler 3.0\", \"Tyler Jr 2.0\");\n\t\t\n\t\tmaster.findNode(\"Clinton\").addParent(new Node(\"Eric\"));\n\t\tmaster.findNode(\"Eric\").addParent(new Node(\"Eric's Dad\"));\n\t\t\n\t\t\n\t\tmaster.findNode(\"Tyler Jr Jr\", 6).add(new Node(\"Mini Tyler\"));\n\t\t//master.findNode(\"Clinton\", 2).add(new Node(\"Justin\"));\n\t\t\n\t\t\n\t\tmaster.getParent().get(0).findNode(\"Justin\", 3).add(new Node(\"Mini Justin\"));\n\t\t\n\t\tmaster.add(new Node(\"Laptop\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Keyboard\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Mouse\"));\n\t\t\n\t\tmaster.add(\"Touchpad\", \"Laptop\");\n\t\t//master.add(\"Justin\", \"Eric\");\n\t\t\n\t\tmaster.add(\"Hunger\", \"Tyler\");\n\t\t\n\t\tselectedNode = master;\n\t\tselect(selectedNode);\n\t}", "private Node put(Node x, Point2D p, Value val, boolean test) {\n\t\tif (x == null) {\n\t\t\tsize++;\n\t\t\treturn new Node(p, val,\n\t\t\t\t\tnew RectHV(-Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE));\n\t\t}\n\t\t// decides where to place to point\n\t\tdouble comp = comparePoints(x, p, test);\n\t\tif (comp < 0)\n\t\t\tx.left = put(x.left, p, val, !test);\n\t\telse if (comp > 0)\n\t\t\tx.right = put(x.right, p, val, !test);\n\t\telse if (x.point.equals(p))\n\t\t\tx.val = val;\n\t\telse\n\t\t\tx.right = put(x.right, p, val, !test);\n\t\treturn x;\n\n\t}", "private void modify(seg_node root, int l, int r, int a, int b, int v) {\n push_down(root);\n if (l == a && r == b) {\n root._sum += v * root.tot ;\n root._product = root._product * power_mod(root._product_of_di, v) % mod;\n root._lazy_sum += v;\n return;\n }\n int m = (l + r) / 2;\n if (b <= m) {\n modify(root.left, l, m, a, b, v);\n } else if (a >= m + 1) {\n modify(root.right, m + 1, r, a, b, v);\n } else {\n modify(root.left, l, m, a, m, v);\n modify(root.right, m + 1, r, m + 1, b, v);\n }\n push_up(root);\n }", "static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }", "private void updateBIT(int []arr, int n, int index, int val) {\n while(index <= n) {\n // Add 'val' to current node of BIT Tree\n arr[index] += val;\n\n // Update index to that of parent in update View\n index += index & (-index);\n }\n }", "protected void insertFromLeaf(Node node, Page page){\n if(!node.isFull()){\n // basta inserir \n if (node instanceof Leaf){\n Entry e = new Entry<Page>(page.getKey(), page);\n node.inserir(e);\n }else{\n Entry e = new Entry<IntNode>(page.getKey());\n //e.setKey(node.getEntry(node.size-1).getKey());\n node.inserir(e);\n }\n\n }else{\n \n Node nodep;\n if(node instanceof Leaf){\n nodep = new Leaf(n);\n }else{\n nodep = new IntNode(n);\n }\n\n node.split(nodep);\n\n // a chave dessa entrada deve ser o maximo do left\n\n Node pai;\n Entry e1;\n if(!node.hasPai()){\n \n pai = new IntNode(n);\n \n int at = 0;\n if(node.size > 0){\n at = node.size-1;\n } \n\n e1 = new Entry<Node>(node.getEntry(at).getKey(), node, nodep);\n e1.setKey(node.getEntry(node.size-1).getKey());\n \n pai.inserir(e1);\n \n node.setPai((IntNode) pai);\n head = pai;\n \n }else{ \n pai = node.pai;\n e1 = new Entry<Node>(node.getKey(node.size - 1), node, nodep);\n \n pai.inserir(e1);\n }\n nodep.setPai((IntNode) pai);\n\n // decidindo se insere no node ou nodep\n int i = node.find(page.getKey());\n if(i >= node.size){\n nodep.inserir(e1);\n }else{ \n node.inserir(e1);\n }\n\n //down(pai, page);\n //insertFromLeaf(pai, page);\n }\n }", "void pairwiseCombine(){\n\t\t\n\t\tmin.Left.Right = min.Right;\n\t\tmin.Right.Left = min.Left;\n\t\t/**\n\t\tPairwise combine differentiates itself in operation of depending on the presence of a child node\n\t\t*/\n\t\t\n\t\tif(min.Child==null){\n\t\t/*map acts as the table to store similar degree nodes*/\n\t\t\tHashMap<Integer, Nodefh> map = new HashMap<Integer, Nodefh>();\n\t\t\tcurrent = min.Right;\n\t\t\tmin = null;\n\t\t\tmin = current;\n\t\t\tlast = current.Left;\n\t\t\twhile(current!=last){\n\t\t\t\tNodefh check = new Nodefh();\n\t\t\t\tcheck = current.Right;\n\t\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\t\t\n\t\t\t\t\t/*Since a parent node can have only one child node a condition is checked to update its child node*/\n\t\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\t/*If the node stored is less than the incoming node*/\n\t\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\t\tif(temp.Child == temp.Child.Right){\n\t\t\t\t\t\t\t\ttemp.Child.Right = current;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrent = temp;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t/*If the incoming node is lower*/\n\t\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\t\tcurrent.ChildCut = false;\t\n\t\t\t\t\t\tif(current.isChildEmpty()){\n\n\t\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif(min.dist >= current.dist){\n\t\t\t\t\tmin = current;\n\t\t\t\t}\n\t\t\t\tmap.put(current.degree, current);\n\t\t\t\tcurrent = check;\n\n\t\t\t}\n\t\t\tlast = min.Left;\n\t\t\t/*Since our condition is used only till last node and exits during last node the iteration is repeated for the last node*/\n\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = temp;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(min.dist >= current.dist){\n\t\t\t\tmin = current;\n\t\t\t}\n\t\t\tcurrent = min;\n\t\t\tlast = min.Left;\n\n\t\t}\n\t\telse{\n\t\t\tHashMap<Integer, Nodefh> map = new HashMap<Integer, Nodefh>();\n\t\t\tcurrent = min.Child;\n\t\t\tcurrent.Parent = null;\n\t\t\tif(min!=min.Right){\n\t\t\t\tcurrent.Right.Left = min.Left;\n\t\t\t\tmin.Left.Right = current.Right;\n\t\t\t\tcurrent.Right = min.Right;\n\t\t\t\tmin.Right.Left = current;\n\t\t\t\tlast = current.Left;\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tlast = current.Left;\n\n\t\t\t}\n\t\t\tmin =null;\n\t\t\tmin = current;\n\t\t\t/*In the presence of a child the child has to be inserted at the top level*/\n\t\t\twhile(current != last){\n\t\t\t\tNodefh check = new Nodefh();\n\t\t\t\tcheck = current.Right;\n\n\t\t\t\twhile(map.containsKey(current.degree)){\n\n\t\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\t\tif(temp.isChildEmpty()){\n\n\t\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrent = temp;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(min.dist >= current.dist){\n\t\t\t\t\tmin = current;\n\n\t\t\t\t}\n\t\t\t\tmap.put(current.degree, current);\n\t\t\t\tcurrent = check;\n\t\t\t}\n\t\t\tlast = min.Left;\n\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\tif(temp.dist < current.dist && temp.dist!=0){\n\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = temp;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(min.dist >= current.dist){\n\t\t\t\tmin = current;\n\n\t\t\t}\n\t\t\tcurrent = min;\n\t\t\tlast = min.Left;\n\t\t}\n\n\t}", "protected void percolateUp(int leaf){\n int parent = parent(leaf);\n Bloque value = (Bloque)data.get(leaf);\n while (leaf > 0 && (value.compareTo(data.get(parent)) > 0)){\n data.set(leaf,data.get(parent));\n leaf = parent;\n parent = parent(leaf);\n }\n data.set(leaf,value);\n }", "private AvlNode<E> findMax(AvlNode<E> node){\n if(node.right == null){\n return node;\n } else {\n return findMax(node.right);\n }\n }", "public boolean deleteNode(Type val){\n MyBinNode aux = this.root;\n MyBinNode parent = this.root;\n boolean left = true;\n \n while(aux.value.compareTo(val) != 0){\n parent = aux;\n if(aux.value.compareTo(val) > 0){\n left = true;\n aux = aux.left;\n }else{\n left = false;\n aux = aux.right;\n }\n if(aux == null){\n return false;\n }\n }\n \n if(aux.left==null && aux.right==null){\n if(aux == this.root){\n this.root = null;\n }else if(left){\n parent.left = null;\n }else{\n parent.right = null;\n }\n }else if(aux.right == null){\n if(aux == this.root){\n this.root = aux.left;\n }else if(left){\n parent.left = aux.left;\n }else{\n parent.right = aux.left;\n }\n }else if(aux.left == null){\n if(aux == this.root){\n this.root = aux.right;\n }else if(left){\n parent.left = aux.right;\n }else{\n parent.right = aux.right;\n }\n }else{\n MyBinNode replace = getToReplace(aux);\n if(aux == this.root){\n this.root = replace;\n }else if(left){\n parent.left = replace;\n }else{\n parent.right = replace;\n }\n replace.left = aux.left;\n }\n return true;\n }", "Node leftRotate(Node x) { \n Node y = x.right; \n Node T2 = y.left; \n \n // Perform rotation \n y.left = x; \n x.right = T2; \n \n // Update heights \n x.height = maxInt(heightBST(x.left), heightBST(x.right)) + 1; \n y.height = maxInt(heightBST(y.left), heightBST(y.right)) + 1; \n \n // Return new root \n return y; \n }", "private void putInBinaryTree(int val) {\n BinaryTree.Node node = this.binaryTree.getRoot();\n BinaryTree.Node parent = node;\n while (node != null) {\n parent = node;\n if (val < node.data) node = node.left;\n else node = node.right;\n }\n if (val < parent.data) this.binaryTree.addAsLeftChild(parent, val);\n else this.binaryTree.addAsRightChild(parent, val);\n }", "@Test\n public void testIndexNodeRedistribute(){\n LeafNode<Integer, Integer> leaf1 = new LeafNode<Integer, Integer>(2, 2);\n leaf1.insertSorted(3, 3);\n LeafNode<Integer, Integer> leaf2 = new LeafNode<Integer, Integer>(5, 5);\n leaf2.insertSorted(7, 7);\n leaf2.insertSorted(8, 8);\n LeafNode<Integer, Integer> leaf3 = new LeafNode<Integer, Integer>(14, 14);\n leaf3.insertSorted(16, 16);\n LeafNode<Integer, Integer> leaf3_3 = new LeafNode<Integer, Integer>(17, 17);\n leaf3_3.insertSorted(18, 18);\n leaf3_3.insertSorted(19, 19);\n \n LeafNode<Integer, Integer> leaf4 = new LeafNode<Integer, Integer>(22,22);\n leaf4.insertSorted(27, 27);\n leaf4.insertSorted(29, 29);\n LeafNode<Integer, Integer> leaf5 = new LeafNode<Integer, Integer>(33, 33);\n leaf5.insertSorted(34, 34);\n leaf5.insertSorted(38, 38);\n leaf5.insertSorted(39, 39);\n leaf1.nextLeaf = leaf2; leaf2.previousLeaf = leaf1; leaf2.nextLeaf = leaf3;\n leaf3.previousLeaf = leaf2; leaf3.nextLeaf = leaf4; leaf4.previousLeaf = leaf3;\n leaf4.nextLeaf = leaf5; leaf5.previousLeaf = leaf4; \n \n ArrayList<Integer> leftkeys = new ArrayList<>();\n leftkeys.add(5); leftkeys.add(13); leftkeys.add(17);\n ArrayList<Node<Integer, Integer>> leftNodeChilds = new ArrayList<>();\n leftNodeChilds.add(leaf1); leftNodeChilds.add(leaf2); leftNodeChilds.add(leaf3 );\n leftNodeChilds.add(leaf3_3);\n IndexNode<Integer, Integer> left = new IndexNode<>(leftkeys, leftNodeChilds);\n \n IndexNode<Integer, Integer> right = new IndexNode<>(30, leaf4, leaf5);\n \n IndexNode<Integer, Integer> parent = new IndexNode<>(20, left, right);\n left.parent = parent;\n right.parent = parent;\n // -----end construction\n \n BPlusTree<Integer, Integer> tree = new BPlusTree<>();\n tree.root = parent;\n int index = tree.handleIndexNodeUnderflow(left, right, parent);\n System.out.println(index);\n Integer a = tree.search(17);\n System.out.println(a);\n }", "private void updateMax(int next) {\n while (val < next) {\n val = next;\n }\n }", "public static AabbTreeNode updateTree(AabbTreeNode treeRoot) {\n if (treeRoot == null || treeRoot.parent != null) {\n // TODO add log message\n // It is necessary to start from tree root, otherwise the inherited cost will be calculated incorrectly\n return treeRoot;\n }\n if (treeRoot.isLeaf()) {\n AabbTreeNode.calculateEnlargedAabb(treeRoot, treeRoot.shape);\n }\n\n List<AabbTreeNode> invalidNodes = getInvalidLeafs(treeRoot);\n for (AabbTreeNode node : invalidNodes) {\n treeRoot = AabbTreeNode.removeNode(treeRoot, node);\n treeRoot = AabbTreeNode.insertLeaf(treeRoot, node.shape);\n }\n return treeRoot;\n }", "public static TreeNode insertIntoBST(TreeNode root, int val)\n{\n TreeNode droot = root;\n TreeNode par = find(droot, val, null);\n if(par==null)\n return par;\n if(par.val < val)\n par.right = new TreeNode(val);\n else\n par.left = new TreeNode(val);\n return root;\n}", "@Override\n @SuppressWarnings(\"Duplicates\")\n public void define(K key, V value) {\n if(size == 0) {root = new TreeNode<>(new KeyValuePair<>(key, value)); size++;}\n else {\n TreeNode<KeyValuePair<K, V>> previous = root;\n TreeNode<KeyValuePair<K, V>> current = root;\n boolean smaller = false;\n// System.out.println(\"Define while init\");\n while(true) {\n// System.out.println(\"Loop. Current = \" + current);\n if(current == null) {\n// System.out.println(\"Current == null\");\n if(smaller) previous.setLeft(new TreeNode<>(new KeyValuePair<>(key, value)));\n else previous.setRight(new TreeNode<>(new KeyValuePair<>(key, value)));\n size++;\n break;\n }\n previous = current;\n if(key.compareTo(current.getValue().getKey()) < 0) {\n smaller = true;\n current = current.getLeft();\n } else if(key.compareTo(current.getValue().getKey()) > 0) {\n smaller = false;\n current = current.getRight();\n } else if (key.equals(current.getValue().getKey())) {\n// System.out.println(\"Such a key-value pair already exists\");\n current.getValue().setValue(value);\n break;\n }\n }\n }\n }", "public void insertElement(int newData)\n {\n if( root == null )\n {\n this.root = new Node(newData);\n this.actualNode = this.root;\n }\n else\n {\n Node newNode = new Node(newData);\n Node loopAux = this.actualNode;\n\n while(true)\n {\n if( !this.altMode )\n {\n if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = true;\n }\n break;\n\n } else if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = true;\n }\n break;\n } else\n {\n if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else\n loopAux = loopAux.getLeftChild();\n }\n }\n else if( this.altMode ) //basically the same, but nodes are added form the right side\n { // and actualNode is set to latest '0' node\n if (loopAux.getRightChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setRightChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getRightChild();\n this.altMode = false;\n }\n\n break;\n\n } else if (loopAux.getLeftChild() == null)\n {\n newNode.setParent(loopAux);\n loopAux.setLeftChild(newNode);\n loopAux.incrementChildFactor();\n\n if (newData == 0)\n {\n this.actualNode = loopAux.getLeftChild();\n this.altMode = false;\n }\n\n break;\n } else\n {\n if (loopAux.getRightChild().getChildFactor() < 2)\n loopAux = loopAux.getRightChild();\n else if (loopAux.getLeftChild().getChildFactor() < 2)\n loopAux = loopAux.getLeftChild();\n else\n loopAux = loopAux.getRightChild();\n }\n }\n }\n }\n }", "private AvlNode<E> remove(Comparable<E> element, AvlNode<E> node){\n if(node == null) {\n return node;\n } else if(node.value.compareTo((E)element) > 0){\n node.left = remove(element, node.left);\n } else if(node.value.compareTo((E)element) < 0){\n node.right = remove(element, node.right);\n } else {\n if(node.left == null && node.right == null){\n return null;\n } else if(node.left == null){\n return node.right;\n } else if(node.right == null){\n return node.left;\n } else {\n AvlNode<E> replacement = findMax(node.left);\n replacement.left = remove(replacement.value, node.left);\n replacement.right = node.right;\n return replacement;\n }\n }\n\n if(height(node.left) - height(node.right) > 1){\n if(height(node.left.left) > height(node.left.right)){\n node = rotateWithLeftChild(node);\n } else {\n node = doubleWithLeftChild(node);\n }\n } else if(height(node.left) - height(node.right) < -1){\n if(height(node.right.right) > height(node.right.left)){\n node = rotateWithRightChild(node);\n } else {\n node = doubleWithRightChild(node);\n }\n }\n node.height = max(height(node.left), height(node.right)) + 1;\n return node;\n }", "public Node increaseKey(Node root, int key, int incVal){\n\t\tif(root==nil){\n\t\t\treturn nil;\n\t\t}\n\t\t\n\t\tif(root.id == key){\n\t\t\tint temp = root.count+incVal;\n\t\t\troot.count = temp;\n\t\t\treturn root;\n\t\t}\n\t\t\n\t\tif(key<root.id){\n\t\t\troot = increaseKey(root.left,key,incVal);\n\t\t}else{\n\t\t\troot = increaseKey(root.right,key,incVal);\n\t\t}\n\t\t\n\t\treturn root;\n\t}", "private BSTNode<K> insertNode(BSTNode<K> currentNode, K key) \n throws DuplicateKeyException, IllegalArgumentException {\n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n // if currentNode is null, create a new node, because of reaching a leaf\n if (currentNode == null) {\n BSTNode<K> newNode = new BSTNode<K>(key);\n return newNode;\n }\n // otherwise, keep searching through the tree until meet a leaf, or find a duplicated node \n else {\n switch(key.compareTo(currentNode.getId())){\n case -1:\n currentNode.setLeftChild(insertNode(currentNode.getLeftChild(), key));\n break;\n case 1:\n currentNode.setRightChild(insertNode(currentNode.getRightChild(), key));\n break;\n default:\n throw new DuplicateKeyException(\"A node with the same value is already existed\");\n }\n // after update currentNode's left and right childNote, let's check currentNode's balanceValue\n // ancestor two levels away from a lead node, its absolute balanceValue may exceeds 1,\n // so codes below has meaning for it \n int balanceValue = getNodeBalance(currentNode); \n if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree\n switch (key.compareTo(currentNode.getLeftChild().getId())) {\n case -1: // after Left Left Case, balance is updated, so sent currentNode to its ancestor \n return rotateRight(currentNode); \n case 1: // after Left Right Case, balance is updated, so sent currentNode to its ancestor \n currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild()));\n return rotateRight(currentNode);\n }\n }\n else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree\n switch (key.compareTo(currentNode.getRightChild().getId())){\n case 1: // after Right Right Case, balance is updated, so sent currentNode to its ancestor \n return rotateLeft(currentNode);\n case -1: // after Right Left Case, balance is updated, so sent currentNode to its ancestor \n currentNode.setRightChild(rotateRight(currentNode.getRightChild()));\n return rotateLeft(currentNode);\n } \n }\n }\n // for leaf node's balanceValue == 0, and for -1 <= leaf node's first ancestor's balanceValue <= 1,\n // codes above(from balanceValue) has no meaning for it, return currentNode straight forward\n return currentNode;\n }", "public void updateNodeAndParents( TreeNode node )\n {\n viewer.update( node, null );\n TreeNode parent = node.getParent();\n while ( parent != null )\n {\n viewer.update( parent, null );\n parent = parent.getParent();\n }\n }", "private TraverseData traverseOneLevel(TraverseData data) {\n Node<T> currentNode = data.currentNode;\n Node<T> currentNewNode = data.currentNewNode;\n int nextBranch = data.index / data.base;\n\n currentNewNode.set(nextBranch, new Node<>(branchingFactor));\n for (int anotherBranch = 0; anotherBranch < branchingFactor; anotherBranch++) {\n if (anotherBranch == nextBranch) {\n continue;\n }\n currentNewNode.set(anotherBranch, currentNode.get(anotherBranch));\n }\n\n //down\n currentNode = currentNode.get(nextBranch);\n currentNewNode = currentNewNode.get(nextBranch);\n return new TraverseData(currentNode, currentNewNode, data.newRoot, data.index % data.base,\n data.base);\n }", "private void change(Node n, int value) {\n\t\tn.pendingVal = value;\n\t\tn.sum = n.size() * value;\n\t\tn.min = value;\n\t\tarray[n.from] = value;\n\n\t}", "public void grow(Grid[][] map) {\n\t\tBranchNode parent = root;\r\n\t\twhile (parent.children.size() > 0) {\r\n\t\t\tif (parent.children.size() >= max_branch_per_node) {\r\n\t\t\t\t// if no more room at this branch\r\n\t\t\t\tparent = parent.children\r\n\t\t\t\t\t\t.get((int) (Math.random() * parent.children.size()));\r\n\t\t\t} else if (Math.random() < 0.5) {\r\n\t\t\t\t// if there is still room, picks randomly\r\n\t\t\t\tparent = parent.children\r\n\t\t\t\t\t\t.get((int) (Math.random() * parent.children.size()));\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint newX, newY; // X and Y coordinates for the new node.\r\n\t\tint r = (int) (Math.random() * GENE_TOTAL);\r\n\t\tint gene_count = width_gene[0];\r\n\t\tint width_select = 0;\r\n\t\twhile (r > gene_count) {\r\n\t\t\twidth_select += 1;\r\n\t\t\tgene_count += width_gene[width_select];\r\n\t\t}\r\n\t\tr = (int) (Math.random() * WIDTH_VARIATION);\r\n\t\tnewX = parent.x - WIDTH_VARIATION / 2 + (width_select - 2)\r\n\t\t\t\t* WIDTH_VARIATION + r;\r\n\t\tif (newX < 0) {// if goes off the grid, push back.\r\n\t\t\tnewX = 0;\r\n\t\t} else if (newX >= World.WORLD_WIDTH) {\r\n\t\t\tnewX = World.WORLD_WIDTH - 1;\r\n\t\t}\r\n\r\n\t\tr = (int) (Math.random() * GENE_TOTAL);\r\n\t\tgene_count = height_gene[0];\r\n\t\tint height_select = 0;\r\n\t\twhile (r > gene_count) {\r\n\t\t\theight_select += 1;\r\n\t\t\tgene_count += height_gene[height_select];\r\n\t\t}\r\n\t\tr = (int) (Math.random() * HEIGHT_VARIATION);\r\n\t\tnewY = parent.y + height_select * HEIGHT_VARIATION + r;\r\n\t\tif (newY >= World.WORLD_HEIGHT) {\r\n\t\t\tnewY = World.WORLD_HEIGHT - 1;\r\n\t\t}\r\n\r\n\t\t// add the branch to the total body.\r\n\t\tamount_of_tree += (int) Math.sqrt((newX - parent.x) * (newX - parent.x)\r\n\t\t\t\t+ (newY - parent.y) * (newY - parent.y));\r\n\t\tBranchNode child = new BranchNode(parent, newX, newY);\r\n\t\tparent.children.add(child);\r\n\r\n\t\tif (parent.leaf_alive) {\r\n\t\t\t// kill leaf, because branch is growing off of it\r\n\t\t\tparent.killLeaf(this, map);\r\n\t\t}\r\n\r\n\t\t// make new leaf on new branch\r\n\t\tchild.addLeaf(this, map);\r\n\t}", "public MoveNode ab(PentagoBoardState pbs,int myscore, int alpha, int beta,int amimaxplayer, int depth,int requireddepth){\n\n int bestmovescore;\n PentagoMove bestmove;\n\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n Collections.shuffle(legalmoves); //helps avoid worst run time if all good moves are at the end of array list\n\n MoveNode moveNode =new MoveNode(new PentagoMove(0,0,0,0,0),0);\n\n if (depth==requireddepth){\n bestmovescore= evaluate(pbs);\n moveNode.MyMove = null;\n moveNode.value = evaluate(pbs);\n return moveNode;\n\n }\n else if (pbs.getWinner() != Board.NOBODY){ //check win since we are at leafnode\n bestmovescore= evaluate(pbs);\n moveNode.MyMove = null;\n int movescore = evaluate(pbs);\n if (movescore<-1200000){\n moveNode.value = -999999999; //assign loss value\n } //Losing Move\n else if (movescore>1200000){\n moveNode.value = 999999999; //assign win value\n } // Winning Move\n return moveNode;\n\n }\n //do max player\n if (amimaxplayer ==1){\n int currentvalue = -999999999;\n PentagoMove currentmove =legalmoves.get(0);\n MoveNode currentmovenode = new MoveNode(currentmove,currentvalue);\n for (int i = 0; i < legalmoves.size(); i++) {\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n PentagoMove movetoprocess = legalmoves.get(i);\n newboard.processMove(movetoprocess);\n\n\n MoveNode scoreAfterMove = ab(newboard, currentvalue, alpha, beta, 0, depth + 1, requireddepth); // run recursion till leaf node or depth reached\n if (scoreAfterMove.value > currentvalue) { //see if current best value is lower than the new value if so replace\n currentvalue = scoreAfterMove.value;\n currentmove = movetoprocess;\n currentmovenode.value = currentvalue;\n currentmovenode.MyMove = currentmove;\n\n //System.out.println(\"I am max plyaer at depth:\" + depth + \"\\n current move is: \" + currentmove + \"\\ncurrentvalue is: \" + currentvalue);\n\n }\n\n alpha = Math.max(alpha,currentvalue);\n if (alpha>=beta){ // break loop if alpha more than beta\n //System.out.println(\"Get pruned my alpha is \" + alpha + \" my beta is \" + beta );\n break;\n }\n }\n //System.out.println(\"I am max plyaer at depth:\" + depth + \"\\n current move is: \" + currentmove + \"\\ncurrentvalue is: \" + currentvalue+\" my alpha is \" + alpha + \" my beta is \" + beta);\n\n return currentmovenode;\n }\n //do min player\n else if (amimaxplayer==0){\n int currentvalue = 999999999;\n PentagoMove currentmove =legalmoves.get(0);\n MoveNode currentmovenode = new MoveNode(currentmove,currentvalue);\n for (int i = 0; i < legalmoves.size(); i++) {\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n PentagoMove movetoprocess = legalmoves.get(i);\n newboard.processMove(movetoprocess);\n\n MoveNode scoreAfterMove = ab(newboard, currentvalue, alpha, beta, 1, depth + 1, requireddepth);\n if (scoreAfterMove.value < currentvalue) {\n currentvalue = scoreAfterMove.value;\n currentmove = movetoprocess;\n currentmovenode.value = currentvalue;\n currentmovenode.MyMove = currentmove;\n //System.out.println(\"I am min plyaer at depth:\" + depth + \"\\n current move is: \" + currentmove + \"\\ncurrentvalue is: \" + currentvalue);\n }\n beta = Math.min(beta,currentvalue);\n if (alpha>=beta){\n //System.out.println(\"Get pruned my alpha is \" + alpha + \" my beta is \" + beta );\n break;\n }\n }\n return currentmovenode;\n }\n //System.out.println(\"move val \" + moveNode.value);\n return moveNode;\n }", "protected void pushDownRoot(int root){\n int heapSize = data.size();\n Bloque value = (Bloque)data.get(root);\n while (root < heapSize) {\n int childpos = left(root);\n if (childpos < heapSize)\n {\n if ((right(root) < heapSize) && (((Bloque)data.get(childpos+1)).compareTo((Bloque)data.get(childpos)) > 0)){\n childpos++;\n }\n // Assert: childpos indexes smaller of two children\n if (((Bloque)data.get(childpos)).compareTo(value) > 0){\n data.set(root,data.get(childpos));\n root = childpos; // keep moving down\n } else { // found right location\n data.set(root,value);\n return;\n }\n } else { // at a leaf! insert and halt\n data.set(root,value);\n return;\n }\n }\n }", "public void ExtremeValuesTraversal(NodeVisitor action){\n\t\tQueue queue = new Queue();\n\t\tqueue.enqueue(this);\n\t\twhile( ! queue.isEmpty() )\n\t\t{\n\t\t\tBinaryTree tree = (BinaryTree)queue.dequeue();\n\t\t\tif ( ! tree.isEmpty() )\n {\n \t\t\taction.visit(tree.getElement());\n \t\t\tqueue.enqueue(tree.leftTree());\n \t\t\tqueue.enqueue(tree.rightTree());\n }\n\t\t}\n\t\t\n\t}", "private int dfs(TreeNode root, int sum) {\n if (root == null) return sum;\n int rsum = dfs(root.right, sum);\n root.val += rsum;\n return dfs(root.left, root.val);\n }" ]
[ "0.6959157", "0.5567238", "0.55650556", "0.55086637", "0.54978275", "0.54118896", "0.54044837", "0.5396327", "0.53070974", "0.5274923", "0.5266451", "0.5210296", "0.5204164", "0.52038676", "0.51948017", "0.51608694", "0.51557136", "0.5153167", "0.51347494", "0.5129119", "0.51206833", "0.51128197", "0.51031244", "0.508466", "0.5075231", "0.5064291", "0.50444573", "0.5041089", "0.5030275", "0.5027479", "0.501912", "0.50181997", "0.5010744", "0.5008428", "0.50070167", "0.500148", "0.49967414", "0.49790594", "0.4977928", "0.49766192", "0.4975253", "0.4975235", "0.4971508", "0.49708846", "0.49651942", "0.4951893", "0.49480048", "0.49290523", "0.49274826", "0.4924857", "0.49234524", "0.49203378", "0.49177682", "0.491698", "0.49113825", "0.49112746", "0.49111325", "0.4903823", "0.4898233", "0.48946273", "0.48868936", "0.48805347", "0.4876799", "0.48685282", "0.485976", "0.48500884", "0.48404834", "0.4835988", "0.4835347", "0.48315296", "0.4818574", "0.48182878", "0.4817077", "0.48147148", "0.48136178", "0.48069832", "0.4806361", "0.4800757", "0.47986174", "0.47926813", "0.4785409", "0.47846162", "0.47827858", "0.47817436", "0.47788975", "0.47763342", "0.47743368", "0.47726908", "0.47722563", "0.475904", "0.47569165", "0.47564405", "0.4754475", "0.47494888", "0.47475025", "0.4746964", "0.47461045", "0.47318476", "0.47267598", "0.4724935" ]
0.59345996
1
This function updates the val, maxval, emax values in Node n.
public void updateSingleNode(Node n) { //update val n.val = n.left.getVal() + n.p + n.right.getVal(); //update eval and emax int case1 = n.left.getMaxVal(); int case2 = n.left.getVal() + n.p; int case3 = n.left.getVal() + n.p + n.right.getMaxVal(); if( case1 >= case2 && case1 >= case3 ) { //case 1 n.maxval = case1; //if the left node is the nilNode, make emax this node if( n.left.isNil ) { n.emax = n.getEndpoint(); } else { //otherwise get emax of left n.emax = n.left.getEmax(); } } else if( case2 >= case1 && case2 >= case3 ) { //case 2 n.maxval = case2; n.emax = n.getEndpoint(); } else if( case3 >= case1 && case3 >= case2 ) { //case 3 n.maxval = case3; //if the left node is the nilNode, make emax this node if( n.right.isNil ) { n.emax = n.getEndpoint(); } else { //otherwise get emax of right n.emax = n.right.getEmax(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void change(Node n, int value) {\n\t\tn.pendingVal = value;\n\t\tn.sum = n.size() * value;\n\t\tn.min = value;\n\t\tarray[n.from] = value;\n\n\t}", "public void setValue(int n) {\r\n Throwable t = new Throwable();\r\n t.printStackTrace();\r\n int newValue = Math.max(n, min);\r\n if (newValue + getExtent() > max) {\r\n newValue = max - getExtent();\r\n }\r\n\r\n setRangeProperties(newValue, getExtent(), min, max, isAdjusting);\r\n }", "public void setMaximum(int n) {\r\n int newMin = Math.min(n, min);\r\n int newValue = Math.min(n, getValue());\r\n int newExtent = Math.min(n - newValue, getExtent());\r\n setRangeProperties(newValue, newExtent, newMin, n, isAdjusting);\r\n }", "public void setValue(int n) {\n\t\t\tthis.value = n;\n\t}", "private void updateMax(int next) {\n while (val < next) {\n val = next;\n }\n }", "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 }", "private void updateMax(int val) {\n overallMax.updateMax(val);\n for (HistoryItem item : watchers.values()) {\n item.max.updateMax(val);\n }\n }", "private void updateHeight(AvlTreeNode<?, ?> n) {\n n.height = 1 + Math.max(height(n.left), height(n.right));\n }", "public void setNEval (int value) {\r\n n_eval = value; }", "void updateMax(StockNode a){\n\t\tif(maxNode==null){\r\n\t\t\tmaxNode=a;\r\n\t\t} else { \r\n\t\t\tif(a.stockValue>maxNode.stockValue){\r\n\t\t\t\tmaxNode=a;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void update(long n) {\n\t\tif (_interArrivalTimeActivated) {\n\t\t\tTimeInstant t = presentTime();\n\n\t\t\tif (_lastInterArrivalTime != null) {\n\t\t\t\tTimeSpan dt = TimeOperations.diff(_lastInterArrivalTime, t);\n\t\t\t\t_interArrivalTally.update(dt.getTimeAsDouble());\n\t\t\t}\n\n\t\t\t_lastInterArrivalTime = t;\n\t\t}\n\n\t\tincrementObservations(1); // use the method from the Reportable class\n\n\t\tthis._value += n; // update current value\n\n\t\tif (this._value < _min) {\n\t\t\t_min = this._value; // update min\n\t\t}\n\n\t\tif (this._value > _max) {\n\t\t\t_max = this._value; // update max\n\t\t}\n\n\t\ttraceUpdate(); // leave a message in the trace\n\t}", "protected final void setMax() {\n\n\tint prevmax = this.max;\n\n\tint i1 = this.high;\n\tint i2 = left.max;\n\tint i3 = right.max;\n\n\tif ((i1 >= i2) && (i1 >= i3)) {\n\t this.max = i1;\n\t} else if ((i2 >= i1) && (i2 >= i3)) {\n\t this.max = i2;\n\t} else {\n\t this.max = i3;\n\t}\n\t\n\tif ((p != IntervalNode.nullIntervalNode) &&\n\t (prevmax != this.max)) {\n \t p.setMax();\n\t}\n }", "private void updateValues() {\n \n //Find the spaces that can be solved.\n List<Number>updatableNumbers = numbers.stream()\n .filter(n -> n.getUsedValues() != null)\n .filter(n -> n.getUsedValues().size() == 8)\n .filter(n -> n.getValue() == 0)\n .collect(Collectors.toList());\n\n updatableNumbers.forEach(u -> {\n //Create a list of numbers 1-9\n List<Integer> intThrough9 = IntStream.rangeClosed(1, 9)\n .boxed()\n .collect(Collectors.toList());\n\n //Remove the used numbers from the list of 9 \n //to get expected value.\n intThrough9.removeAll(u.getUsedValues());\n u.setValue(intThrough9.get(0));\n }\n );\n }", "private void FenwickTree(int n) {\n // Store the actual values in tree[] using update()\n for(int i = 0; i < N; i++)\n updateBIT(down_tree, Max_dis, site_distance[i], raw_tree[site_distance[i]]);\n }", "@Override\n public void synchronizeMinMaxNFreshs() {\n\t\n }", "public void setMinimum(int n) {\r\n int newMax = Math.max(n, max);\r\n int newValue = Math.max(n, getValue());\r\n int newExtent = Math.min(newMax - newValue, getExtent());\r\n setRangeProperties(newValue, newExtent, n, newMax, isAdjusting);\r\n }", "public void SetMaxVal(int max_val);", "private void setNitrateMaxError (float nitrateMax, Exception e, int error) {\n this.nitrateMax = nitrateMax;\n nitrateMaxErrorMessage = e.toString();\n nitrateMaxError = error;\n }", "public void setNX(int nx){\n newX=nx;\n }", "protected void updateValues(){\n double total = 0;\n for(int i = 0; i < values.length; i++){\n values[i] = \n operation(minimum + i * (double)(maximum - minimum) / (double)numSteps);\n \n total += values[i];\n }\n for(int i = 0; i < values.length; i++){\n values[i] /= total;\n }\n }", "void setNextValue() {\n this.value = this.value * 2;\n }", "public void update() {\n\t\t\tif (!max.getText().isEmpty()) {\n\t\t\t\tInteger maxVal = Integer.parseInt(max.getText());\n\t\t\t\tif (maxVal > 2) {\n\t\t\t\t\tboolean toUpdate = false;\n\t\t\t\t\tPlgProbabilityDistribution distr = null;\n\t\t\t\t\tif (((String)cb.getSelectedItem()).equals(PlgProbabilityDistribution.distributionToName(DISTRIBUTION.UNIFORM))) {\n\t\t\t\t\t\tdistr = PlgProbabilityDistribution.uniformDistributionFactory();\n\t\t\t\t\t\ttoUpdate = true;\n\t\t\t\t\t} else if (((String)cb.getSelectedItem()).equals(PlgProbabilityDistribution.distributionToName(DISTRIBUTION.BETA))) {\n\t\t\t\t\t\tif (!alpha.getText().isEmpty() && !beta.getText().isEmpty()) {\n\t\t\t\t\t\t\tDouble a = Double.parseDouble(alpha.getText());\n\t\t\t\t\t\t\tDouble b = Double.parseDouble(beta.getText());\n\t\t\t\t\t\t\tdistr = PlgProbabilityDistribution.betaDistributionFactory(a, b);\n\t\t\t\t\t\t\ttoUpdate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (((String)cb.getSelectedItem()).equals(PlgProbabilityDistribution.distributionToName(DISTRIBUTION.NORMAL))) {\n\t\t\t\t\t\tdistr = PlgProbabilityDistribution.normalDistributionFactory();\n\t\t\t\t\t\ttoUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (toUpdate) {\n\t\t\t\t\t\tp.updateDistribution(dv, maxVal, distr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "void setMaxValue();", "public void setnbMaxJV(int n) {\n this.maxVirtualPlayer = n;\n }", "public void update() {\n\t\tif (max == null || max.length < info.size())\r\n\t\t\tmax = info.stream().mapToInt(i -> Math.max(1, i[1])).toArray();\r\n\r\n\t\tfull = improve(max);\r\n\t}", "public int getNtoLastValue(int n){\n\tint nodeValue=0, llSize=0, brojac=1,index;\n\tNode current=head;\n\twhile(current!=null){\n\t\tllSize++;\n\t\tcurrent=current.next;\n\t}\n\tindex=llSize-n;\n\tcurrent=head;\n\twhile(brojac!=index){\n\t\tcurrent=current.next;\n\t\tbrojac++;\n\t}\n\tnodeValue=current.value;\n\treturn nodeValue;\n}", "private void maximize(Node node) {\n // maximize:\n double max = Tree.MININT;\n List<Node> children = node.getChildren();\n \n// if(children.isEmpty()){\n// return;\n// }\n \n //String values = \"\";\n for (Node child : children) {\n if (child.getMove().getRating() > max) {\n max = child.getMove().getRating();\n }\n // values += \"\" + child.getMove().getRating() + \", \";\n }\n // set value\n // System.out.println(\"setting value for next parent (maximize): \" + max + \" (all values: \" + values + \")\");\n\n node.getMove().setRating(max);\n }", "public void updateMinMax( ) {\r\n if( (data == null) || (data.size() < 1) ) {\r\n min = 0.0;\r\n max = 0.0;\r\n return;\r\n }\r\n\r\n min = data.get( 0 );\r\n max = data.get( 0 );\r\n\r\n for( int i = 1; i < data.size(); i++ ) {\r\n if( min > data.get( i ) )\r\n min = data.get( i );\r\n if( max < data.get( i ) )\r\n max = data.get( i );\r\n }\r\n\r\n }", "public int setNitrateMax(Integer nitrateMax) {\n try {\n setNitrateMax(nitrateMax.floatValue());\n } catch (Exception e) {\n setNitrateMaxError(FLOATNULL, e, ERROR_SYSTEM);\n } // try\n return nitrateMaxError;\n }", "public void recUpdateNode(Node n) {\r\n\t\t//update this node\r\n\t\tupdateSingleNode(n);\r\n\t\t\r\n\t\t//if this node is marked, update the parent node's other child.\r\n\t\tif( n.marked ) {\r\n\t\t\t//unmark both children of this node's parent\r\n\t\t\tn.parent.right.marked = n.parent.left.marked = false;\r\n\t\t\t//find and update the other child\r\n\t\t\tif( n.parent.left == n ) {\r\n\t\t\t\tupdateSingleNode(n.parent.right);\r\n\t\t\t} else if( n.parent.right == n ){\r\n\t\t\t\tupdateSingleNode(n.parent.left);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//if this is not the root, go to the next parent\r\n\t\tif( n.parent != nilNode ) {\r\n\t\t\trecUpdateNode(n.parent);\r\n\t\t}\r\n\t}", "private void updateBIT(int []arr, int n, int index, int val) {\n while(index <= n) {\n // Add 'val' to current node of BIT Tree\n arr[index] += val;\n\n // Update index to that of parent in update View\n index += index & (-index);\n }\n }", "public void setRangeProperties(\r\n int newValue,\r\n int newExtent,\r\n int newMin,\r\n int newMax,\r\n boolean adjusting) {\r\n\r\n\r\n if (newMin > newMax) {\r\n newMin = newMax;\r\n }\r\n if (newValue > newMax) {\r\n newMax = newValue;\r\n }\r\n if (newValue < newMin) {\r\n newMin = newValue;\r\n }\r\n\r\n /* Convert the addends to long so that extent can be\r\n * Integer.MAX_VALUE without rolling over the sum.\r\n * A JCK test covers this, see bug 4097718.\r\n */\r\n if (((long) newExtent + (long) newValue) > newMax) {\r\n newExtent = newMax - newValue;\r\n\r\n\r\n }\r\n if (newExtent < 0) {\r\n newExtent = 0;\r\n }\r\n boolean isChange =\r\n (newValue != getValue())\r\n || (newExtent != getExtent())\r\n || (newMin != min)\r\n || (newMax != max)\r\n || (adjusting != isAdjusting);\r\n if (isChange) {\r\n setValue0(newValue);\r\n setExtent0(newExtent);\r\n min = newMin;\r\n max = newMax;\r\n isAdjusting = adjusting;\r\n fireStateChanged();\r\n }\r\n }", "public void updateStats(int n1, int n2, int n3, int n4){\n //update values\n this.n1 = n1;\n this.n2 = n2;\n this.n3 = n3;\n this.n4 = n4;\n //repaint graph\n repaint();\n }", "public int setNitrateMax(Float nitrateMax) {\n try {\n setNitrateMax(nitrateMax.floatValue());\n } catch (Exception e) {\n setNitrateMaxError(FLOATNULL, e, ERROR_SYSTEM);\n } // try\n return nitrateMaxError;\n }", "public void setLastCount(double n)\n {\n\n this.lastCount = n;\n }", "private void updateValue() {\n int minValue = 100; //Minimum value to be calculated, initialized to a large number\n value = 0; //Value reinitialized to 0\n for (Integer i : values) {\n if (i > value && i <= 21) {\n value = i; //Sets value to maximum value less than or equal to 21\n }\n if (i < minValue) {\n minValue = i; //Sets minimum value to lowest value in the list\n }\n }\n if (value == 0) {\n value = minValue; //Sets value to minValue if no values 21 or less\n }\n valueLabel.setText(\"Value: \" + value); //Sets text of value label\n if (value > 21) {\n bust(); //Busts if value greater than 21\n }\n }", "public void temperatureMaxChanged(ValueChangeEvent event) {\n temperatureMax = Integer.valueOf(event.getNewValue().toString());\n updateTemperatureNormalisation();\n }", "public void setVarimaxMaximumIterations(int max){\n this.nVarimaxMax = max;\n }", "public final void adjustLimits(int max) {\n this.invalid = false;\n if (this.value < 1) {\n this.value = 1;\n this.invalid = true;\n }\n if (max > 0) {\n if (this.value > max) {\n this.value = max;\n this.invalid = true;\n }\n }\n }", "@Override\n public void setNodeStatesForUpdate(int iNode) {\n }", "public void updatedNumber(String key, Number val) {}", "void setNilMaximum();", "public NodeMDL(int[][] training, int[] max_values, int node_id) {\n\t\tsuper(training, max_values, node_id);\n\t}", "protected void updateSubtreeSize(BSTNode n) {\n\t\tn.size = 1;\n\n\t\tif (n.left != null)\n\t\t\tn.size += n.left.size;\n\n\t\tif (n.right != null)\n\t\t\tn.size += n.right.size;\n\t}", "public void recalculateStatistics() {\n\tthis.resetNodes();\n\tfor (LayoutNode n: this.getNodeList()) \n\t if (!n.isLocked()) \n\t\tupdateMinMax(n.getX(), n.getY());\n }", "public void setPropertyToRefresh(Node aggrNode, Node propertyNode, Node minSelNode, Node maxSelNode) {\n if (aggrNode != null && propertyNode != null) {\n distrName = (String)aggrNode.getProperty(INeoConstants.PROPERTY_DISTRIBUTE_NAME);\n selectName = (String)aggrNode.getProperty(INeoConstants.PROPERTY_SELECT_NAME, null);\n propertyName = (String)aggrNode.getProperty(INeoConstants.PROPERTY_NAME_NAME);\n propertyValueMin = (Double)propertyNode.getProperty(INeoConstants.PROPERTY_NAME_MIN_VALUE);\n propertyValueMax = (Double)propertyNode.getProperty(INeoConstants.PROPERTY_NAME_MAX_VALUE);\n minPropertyValue = (Double)minSelNode.getProperty(INeoConstants.PROPERTY_NAME_MIN_VALUE);\n maxPropertyValue = (Double)maxSelNode.getProperty(INeoConstants.PROPERTY_NAME_MAX_VALUE);\n // propertyAdjacency = adjacency;\n } else {\n propertyName = null;\n minPropertyValue = null;\n maxPropertyValue = null;\n // propertyAdjacency = 0;\n }\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}", "public void addBatchUpdateValue(Node n, double weight) {\n\t\tnextLayerNodesUpdateMap.put(n, weight);\n\t}", "public void setnbMaxJR(int n) {\n // TODO Remove\n //System.err.println(\"MAX PLAYER R \"+n);\n this.maxRealPlayer = n;\n }", "public Builder setN(int value) {\n \n n_ = value;\n onChanged();\n return this;\n }", "public void setMaxVal(double maxVal) {\n this.maxVal = maxVal;\n }", "public void setNumber(int n) {\n if(n<0){\n throw new ArithmeticException(\"Negative Score is not allowed\");\n }else{\n int shift = 0;\n while (n > 0) {\n int d = n / 10;\n int k = n - d * 10;\n n = d;\n background.add(new Digit(k, 30, 360 - shift, 25));\n shift += 30;\n }\n }\n }", "public void setElement(Pair<Integer, Integer> cell, int n){\n\t\tnumbers[cell.getFirst()][cell.getSecond()] = n;\n\t}", "public void increment(double n) {\r\n\t\tthis.value += n;\r\n\t}", "private void changeVlaue(int p1, int p2, int value) {\n if (p1 > count() || p1 < 1) { // range exception\n throw new IllegalArgumentException(\"out of N range\");\n }\n if (p2 > count() || p2 < 1) { // range exception\n throw new IllegalArgumentException(\"out of N range\");\n }\n if (value > 1 || value < 0) { // range exception\n throw new IllegalArgumentException(\"out of N range\");\n }\n\n id[p1 - 1][p2 - 1] = value; // set a node to 1 or 0\n }", "public void setMaxIntRed(int n)\n {\n // since nIntRedMax = {0, 1, 2, ... ,(n-1)},\n // n is the number of reduction, we have to subtract 1 from n\n nIntRedMax = (n > 1) ? (n-1) : (NINTREDMAXDEF-1);\n stoCri = 0; // the stopping criteria\n }", "public Node(int key, Double val, int N) {\n\t this.key = key;\n\t this.val = val;\n\t this.N = N;\n\t }", "private void _update(int nodeNum, int s, int e, final long l, final long r, final int kind){\n if(r<s || e<l)\n return;\n\n // case 2: in range\n if(l<=s && e<=r){\n tree[nodeNum] = kind;\n return;\n }\n\n // case 3-1: overlap range, same value\n if(tree[nodeNum] == kind)\n return;\n\n // case 3-2: overlap range, different value\n if(tree[nodeNum] != -1) {\n tree[nodeNum*2] = tree[nodeNum];\n tree[nodeNum*2+1] = tree[nodeNum];\n tree[nodeNum] = -1;\n }\n\n int mid = (s + e) / 2;\n _update(nodeNum*2, s, mid, l, r, kind);\n _update(nodeNum*2+1, mid+1, e, l, r, kind);\n }", "void setMaximum(int max);", "public static void setNumberOfInputs(int _n)\r\n {\r\n numberOfInputs = _n;\r\n }", "public void setVertexDataMax(Integer numData, Float newValue) {\r\n\t\tif (numData >= listVertexDataMax.size())\r\n\t\t\tlistVertexDataMax.add(numData, newValue);\r\n\t\telse if (newValue > listVertexDataMax.get(numData))\r\n\t\t\tlistVertexDataMax.set(numData, newValue);\r\n\t}", "public void setBoxWeights(float boxVal, int itmin, int itmax, int ixmin, int ixmax, \n int ntf, int nx) {\n float[][] w = zerofloat(ntf,nx);\n for (int ix = ixmin; ix<=ixmax; ++ix) {\n for (int it=itmin; it<=itmax; ++it) { \n w[ix][it] = boxVal;\n }\n }\n _w2D = w;\n _weights = true;\n }", "@Override\n\tpublic void addAt(int n, int index) throws IndexOutOfBoundsException {\n\t\tif(checkIndex(index, size+1)) { //check if index is valid\n\t\t\tfor (int i=size; i>index; i--) {\n\t\t\t\tvalues[i] = values[i-1]; //move every value one step right until index\n\t\t\t}\n\t\t\tvalues[index] = n; //place the new value at index\n\t\t\tsize++; //increment size\n\t\t\tif (size == values.length) { //if the list is full expand it\n\t\t\t\tresize();\n\t\t\t}\t\t\t\n\t\t}else {\n\t\t\tthrow new IndexOutOfBoundsException(\"Highest index: \" + size);\n\t\t}\t\n\t}", "private void update(int v, int from, int to, int value) {\n\t\tNode node = heap[v];\n\n\t\t/**\n\t\t * If the updating-range contains the portion of the current Node We lazily update it. This means We\n\t\t * do NOT update each position of the vector, but update only some temporal values into the Node;\n\t\t * such values into the Node will be propagated down to its children only when they need to.\n\t\t */\n\t\tif (contains(from, to, node.from, node.to)) {\n\t\t\tchange(node, value);\n\t\t}\n\n\t\tif (node.size() == 1)\n\t\t\treturn;\n\n\t\tif (intersects(from, to, node.from, node.to)) {\n\t\t\t/**\n\t\t\t * Before keeping going down to the tree We need to propagate the the values that have been\n\t\t\t * temporally/lazily saved into this Node to its children So that when We visit them the values are\n\t\t\t * properly updated\n\t\t\t */\n\t\t\tpropagate(v);\n\n\t\t\tupdate(2 * v, from, to, value);\n\t\t\tupdate(2 * v + 1, from, to, value);\n\n\t\t\tnode.sum = heap[2 * v].sum + heap[2 * v + 1].sum;\n\t\t\tnode.min = Math.min(heap[2 * v].min, heap[2 * v + 1].min);\n\t\t}\n\t}", "public void setNetNormValue(Double val)\r\n {\r\n \tlong value = Math.round(val * this.getPrecision());\r\n\t\tint intValue = (int)value;\r\n\t\t\r\n\t\tthis.getSlider().setValue(intValue);\r\n }", "void setValues(final T value, final T min, final T max)\n {\n setValue(value, valueLabel);\n setValue(min, minValueLabel);\n setValue(max, maxValueLabel);\n }", "protected void calcMinMax() {\n }", "public void SetComponent(int n_x, int n_y, float f_val) {\n \n\t/*\n\tinputs--\n\t\n\tn_x :\n\t The first index\n\tn_y :\n\t The second index\n\tf_val :\n\t The float value at the indexed location of this\n\t*/\n\t\n\t/*\n\toutputs--\n\t*/\n\t\n\tthis.mat_f_m[n_x][n_y] = f_val;\n \n }", "public void setAttrs(int n) {\r\n\r\n if (attrs != null && n == attrs.length)\r\n return;\r\n attrs = new float[n];\r\n }", "private Type set_value_type(Node n, long xx ) {\n Type[] alltypes = Type.ALL_TYPES();\n _gvn.setype(_ins[0], alltypes[xx(xx,0)]);\n _gvn.setype(_ins[1],((ConNode)_ins[1])._t = alltypes[xx(xx,1)]);\n _gvn.setype(_ins[2],((ConNode)_ins[2])._t = alltypes[xx(xx,2)]);\n _gvn.setype(_ins[3],((ConNode)_ins[3])._t = alltypes[xx(xx,3)]);\n Type vt = n.value(_gvn);\n Type old = _values.put(xx,vt);\n assert old==null;\n return vt;\n }", "public int setNitrateMax(String nitrateMax) {\n try {\n setNitrateMax(new Float(nitrateMax).floatValue());\n } catch (Exception e) {\n setNitrateMaxError(FLOATNULL, e, ERROR_SYSTEM);\n } // try\n return nitrateMaxError;\n }", "public void setValue(int node, Type value) {\n\t\tvalues[node] = value;\n\t}", "public void initProgress(AcceleratorNode nodeDev, int intMaxVal) {\n JProgressBar barDev = this.mdlCtrlr.getProgressBar(nodeDev);\n JComponent cmpMtn = this.mdlCtrlr.getMotionStateDisplay(nodeDev);\n \n if (barDev == null) \n return;\n \n barDev.setMinimum(0);\n barDev.setMaximum(intMaxVal);\n barDev.setValue(0);\n cmpMtn.setBackground(MOTION_STATE.UNKNOWN.getColor());\n \n this.mdlCtrlr.fireTableDataChanged();\n }", "public void setScale(double n) {\n\n\t}", "public void give_score(int n){\n final_score=0.25*(n-m.get_m()+1)+0.2*(n-h.get_h()+1)+0.25*(n-l.get_l()+1)+0.3*(n-a.get_a()+1);\r\n }", "public void setMaxValue(int x) {\r\n\t\tmaxValue = x;\r\n\t}", "public void setNodeVector(final PhylogenyNode n) {\n\t\tassert(n != null);\n\t\tif (vec.size() > 0) {\n\t\t\tn.getNodeData().setVector(vec);\n\t\t} else {\n\t\t\tn.getNodeData().setVector(null);\n\t\t}\n\t}", "private void setNode(int index, Node n) {\n \t\twhile (index + 1 >= contents.size()) {\n \t\t\tcontents.add(null);\n \t\t}\n \t\tcontents.set(index, n);\n \t}", "public void displayMaxValues() {\r\n if (deltaX > deltaXMax) {\r\n deltaXMax = deltaX;\r\n maxX.setText(Float.toString(deltaXMax));\r\n }\r\n if (deltaY > deltaYMax) {\r\n deltaYMax = deltaY;\r\n maxY.setText(Float.toString(deltaYMax));\r\n }\r\n if (deltaZ > deltaZMax) {\r\n deltaZMax = deltaZ;\r\n maxZ.setText(Float.toString(deltaZMax));\r\n }\r\n }", "private void calculateMaxValue(int seriesCount, int catCount) {\r\n double v = 0;\r\n Number nV = null;\r\n\r\n for (int seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {\r\n for (int catIndex = 0; catIndex < catCount; catIndex++) {\r\n nV = getPlotValue(seriesIndex, catIndex);\r\n if (nV != null) {\r\n v = nV.doubleValue();\r\n if (v > getMaxValue()) {\r\n setMaxValue(v);\r\n }\r\n }\r\n }\r\n }\r\n }", "public void grow(int n)\n \t{\n \t\tif (n <= this.getLength())\n \t\t\treturn;\n \n \t\tint delta = n - this.getLength();\n \n \n \t\tint oldNumBytes = getLengthInBytes();\n \n \t\t/*\n \t\t** If we have enough space in the left over bits,\n \t\t** then all we need to do is change the modulo.\n \t\t*/\n \t\tif ((oldNumBytes != 0) &&\n \t\t (8 - this.bitsInLastByte) >= delta)\n \t\t{\n \t\t\tthis.bitsInLastByte += delta;\n \t\t\tlengthAsBits = n;\n \t\t\treturn;\n \t\t}\n \n \t\tint newNumBytes = FormatableBitSet.numBytesFromBits(n);\n \n \t\t// is there enough room in the existing array\n \t\tif (newNumBytes <= value.length) {\n \t\t\t// ensure the bits are zeroed\n \t\t\tfor (int i = oldNumBytes; i < newNumBytes; i++)\n \t\t\t\tvalue[i] = 0;\n \t\t} else {\n \n \n \t\t\t/*\n \t\t\t** We didn't have enough bytes in value, so we need\n \t\t\t** to create a bigger byte array and use that.\n \t\t\t*/\n \t\t\tbyte[] newValue = new byte[newNumBytes];\n \n \t\t\tSystem.arraycopy(value, 0, newValue, 0, oldNumBytes);\n \n \t\t\tvalue = newValue;\n \t\t}\n \t\tbitsInLastByte = numBitsInLastByte(n);\n \t\tlengthAsBits = n;\n \t}", "private void setNext(Node n) {\n\t\t\tnext = n;\n\t\t}", "public void setKoernerImMaul(int n)\n {\n koernerImMaul=n;\n }", "public int getNEval () {\r\n return n_eval; }", "private void setMax(int max) { this.max = new SimplePosition(false,false,max); }", "public static void setEnd(Node n) {\n if (n == null) {\n } else {\n endLabel.setBackground(Color.white);\n n.setBackground(Color.red);\n endLabel = n;\n //endSet = true;\n }\n }", "private void setRight(int index, Node n) {\n \t\t// TODO Complete this method!\n \t\tsetNode(getRightOf(index), n);\n \t}", "protected void giveValueToListeners(String value, MinMaxEvent evt) {\n for(int i = 0; i < listeners.size(); i++) {\n listeners.get(i).setValueOfNode(value, evt);\n }\n }", "@Override\n\tpublic void add(int n) {\n\t\tvalues[size] = n; //add value to the list\n\t\tsize++; //increment size\n\t\tif (size == values.length){ //if the list is full expand it\n\t\t\tresize();\n\t\t}\n\t}", "protected void setRegister(Register r, Node n) {\n int i = r.getNumber();\n s.registers[i] = n;\n if(TRACE_REGISTERS) System.out.println(this.method + \": setting \" + i + \" <- \" + n);\n //if (TRACE_INTRA) out.println(\"Setting register \"+r+\" to \"+n);\n }", "public void updatevaluetosendmap(String nodename, String attname, int newvalue){\n\t\tfor(String dest : this.toSendMap.keySet()) {\n\t\t\tGraph destmap = this.toSendMap.get(dest);\n\t\t\tNode n = destmap.getNode(nodename);\n\t\t\tif(n == null) {\n\t\t\t\tupdatetosendmap_addfromfullgraph(nodename); //on l'a supprimé donc on le recrée comme\n\t\t\t\tn = destmap.getNode(nodename);\n\t\t\t}\n\t\t\tn.setAttribute(attname, newvalue); // add or replace\n\t\t}\n\t}", "public void setMax(){\n for (int i = 0; i < Nodes.size(); i++){\n this.MinDistance.add(Double.MAX_VALUE);\n }\n }", "ChangeObserver<T> setInitialMaxValue(Object value);", "public void setNumErode(int n) {\r\n itersErode = n;\r\n }", "@Override public void setValue(Object newValue) throws XDException {\n preread();\n Long tempValue;\n if (newValue instanceof Long) tempValue = (Long)newValue;\n else if (newValue instanceof Integer) tempValue = ((Integer)newValue).longValue();\n else if (newValue instanceof String) {\n try { tempValue = Long.parseLong((String)newValue); }\n catch (NumberFormatException e) { throw new XDException(Errors.VALUE_FORMAT, this,\"Invalid number format\", newValue); }\n }\n else if (newValue == null) throw new XDError(this, \"setValue() is given a null\");\n else throw new XDError(this, \"setValue() is given an unknown class\");\n if (getBase() == Base.UNSIGNED && tempValue < 0) throw new XDException(Errors.VALUE_OUT_OF_RANGE, this, \"Unsigned data cannot be assigned a negative value\");\n long minimum = longValueOf(Meta.MINIMUM, Long.MIN_VALUE);\n long maximum = longValueOf(Meta.MAXIMUM, Long.MAX_VALUE);\n if (tempValue < minimum) throw new XDException(Errors.VALUE_OUT_OF_RANGE, this, \"Value of \" + tempValue + \" exceeds minimum of \" + minimum);\n if (tempValue > maximum) throw new XDException(Errors.VALUE_OUT_OF_RANGE, this, \"Value of \" + tempValue + \" exceeds maximum of \" + maximum);\n value = tempValue;\n markDirty();\n }", "protected final void setP(IntervalNode x) {\n\tthis.p = x;\n\n\t// recalc max and min\n\tsetMax();\n\tsetMin();\n }", "public void initMaxMin(){\n\t\tmax = dja.max();\n\t\tmin = dja.min();\n\t}", "void setLowNode(Node n){\n low = n;\n }", "void updateMaxTick();", "public void update( long timestamp, Number value );" ]
[ "0.6803857", "0.65506136", "0.639821", "0.6303574", "0.60505104", "0.59940225", "0.5926884", "0.59070295", "0.5889665", "0.57679605", "0.5749417", "0.57162976", "0.5665035", "0.56184214", "0.55377656", "0.5528815", "0.5518399", "0.5497288", "0.5474556", "0.5387524", "0.5387178", "0.5347724", "0.53442484", "0.5330456", "0.5326294", "0.53172195", "0.53167814", "0.5262748", "0.5248681", "0.52478653", "0.52393776", "0.5216474", "0.5214738", "0.5205695", "0.51703143", "0.51493484", "0.51490134", "0.5148277", "0.51393265", "0.5137993", "0.5137844", "0.5129641", "0.5126129", "0.51253676", "0.50952286", "0.5090391", "0.50899696", "0.50824845", "0.50747985", "0.50605595", "0.50595766", "0.50483084", "0.5038607", "0.50385106", "0.50280046", "0.5013461", "0.5008528", "0.49968946", "0.49691895", "0.49531227", "0.49498478", "0.494968", "0.49462867", "0.49359038", "0.49330315", "0.49323553", "0.49248117", "0.491562", "0.49015567", "0.48988548", "0.4896415", "0.48817596", "0.48775223", "0.4875292", "0.48750162", "0.487309", "0.4868885", "0.4867431", "0.48665914", "0.4861427", "0.4857053", "0.48490846", "0.4838211", "0.48363608", "0.48339376", "0.48081818", "0.48015785", "0.47916758", "0.47912636", "0.47837833", "0.4779027", "0.47786033", "0.4776688", "0.47763696", "0.4775872", "0.47729635", "0.47711715", "0.47701055", "0.4764917", "0.47628632" ]
0.7868319
0
This function recursively prints all children nodes of the input node. Mostly meant for debugging.
public void printTree(Node n) { if( !n.isNil ) { System.out.print("Key: " + n.key + " c: " + n.color + " p: " + n.p + " v: "+ n.val + " mv: " + n.maxval + "\t\tleft.key: " + n.left.key + "\t\tright.key: " + n.right.key + "\n"); printTree(n.left); printTree(n.right); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printTreeNodes(){\n logger.trace(\"Name: \"+this.getName());\n for(int i=0;i<this.getChildCount();i++){\n SearchBaseNode node = (SearchBaseNode) this.getChildAt(i);\n node.printTreeNodes();\n }\n }", "public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "public void printTree() {\n printTreeHelper(root);\n }", "public void printAll() {\n\t\tNode node = root;\n\t\twhile (node != null) {\n\t\t\tSystem.out.println(node.data);\n\t\t\tnode = node.left;\n\t\t}\n\t}", "public static void display(Node root){\r\n String str = \"[\"+root.data+\"] -> \";\r\n for(Node child : root.children){\r\n str += child.data + \", \";\r\n }\r\n System.out.println(str + \" . \");\r\n \r\n for(int i=0; i<root.children.size(); i++){\r\n Node child = root.children.get(i);\r\n display(child);\r\n }\r\n }", "public void dumpChildren ()\r\n {\r\n dumpChildren(0);\r\n }", "static void postorderPrint(TreeNode node) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next());\n }\n System.out.print(\" \" + node.data);\n }", "static void preorderPrint(TreeNode node) {\n if (node == null)\n return;\n\n System.out.print(\" \" + node.data);\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n preorderPrint((TreeNode) iter.next());\n }\n }", "static void printTree(AbstractNode root) throws IOException {\n if (root == null) {\n return;\n }\n System.out.println(root.toString());\n if(root.getTypeNode() == 0) {\n ConscellNode nextNode = (ConscellNode)root;\n printTree(nextNode.getFirst());\n printTree(nextNode.getNext());\n }\n }", "public void printOut() {\n\t\tif(root.left != null) {\n\t\t\tprintOut(root.left);\n\t\t}\n\t\t\n\t\tSystem.out.println(root.element);\n\t\t\n\t\tif(root.right != null) {\n\t\t\tprintOut(root.right);\n\t\t}\n\t}", "@Override\r\npublic void Display(int depth) {\n\tSystem.out.println(\"-\"+depth);\r\n children.forEach(com->com.Display(depth+2));\r\n }", "public void printNodes() {\n\t\tprintNodes(root);\n\n\t}", "public void prettyPrintTree() {\r\n\t\tSystem.out.print(\"prettyPrintTree starting\");\r\n\t\tfor (int i = 0; i <= this.getTreeDepth(); i++) {\r\n\t\t\tprettyPrintTree(root, 0, i);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public void print(){\n inorderTraversal(this.root);\n }", "public void print()\r\n {\r\n print(root);\r\n }", "public void tree()\n\t{\n\t\tIterable<Position<FileElement>> toPrint = fileSystem.PreOrder();\n\t\tfor (Position<FileElement> p : toPrint)\n\t\t{\n\t\t\tint depth = fileSystem.getDepth(p);\n\t\t\tfor (int i = 0; i < depth; i++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println(p.getValue());\n\t\t}\n\t}", "private void printTree(AvlNode<E> node){\n if(node != null){\n printTree(node.left);\n System.out.print(node.value);\n System.out.print(\" \");\n printTree(node.right);\n }\n }", "@Override\n protected void prettyPrintChildren(PrintStream s, String prefix) {\n }", "@Override\n protected void prettyPrintChildren(PrintStream s, String prefix) {\n }", "@Override\n protected void prettyPrintChildren(PrintStream s, String prefix) {\n }", "private void print(Node x) {\n\t\tif (x == null) return;\n\t\tprint(x.getLeft());\n\t\tSystem.out.println(x);\n\t\tprint(x.getRight());\n\t}", "void printInorder(Node node) {\n if (node == null)\n return;\n\n /* first recur on left child */\n printInorder(node.left);\n\n /* then print the data of node */\n System.out.print(node.key + \" \");\n\n /* now recur on right child */\n printInorder(node.right);\n }", "public void print() {\n\t\tprint(root);\n\t}", "public void printTree() {\n\t\tSystem.out.println(printHelp(root));\r\n\t\t\r\n\t}", "public void printTree() {\r\n printTree(overallRoot, 0);\r\n }", "public void printTree() {\r\n\t if (expressionRoot == null) {\r\n\t return;\r\n\t }\r\n if (expressionRoot.right != null) {\r\n printTree(expressionRoot.right, true, \"\");\r\n }\r\n System.out.println(expressionRoot.data);\r\n if (expressionRoot.left != null) {\r\n printTree(expressionRoot.left, false, \"\");\r\n }\r\n }", "private static void PrintNode(Node n, String prefix, int depth) {\r\n\r\n\t\ttry {\r\n\t\t\tSystem.out.print(\"\\n\" + Pad(depth) + \"[\" + n.getNodeName());\r\n\t\t\tNamedNodeMap m = n.getAttributes();\r\n\t\t\tfor (int i = 0; m != null && i < m.getLength(); i++) {\r\n\t\t\t\tNode item = m.item(i);\r\n\t\t\t\tSystem.out.print(\" \" + item.getNodeName() + \"=\"\r\n\t\t\t\t\t\t+ item.getNodeValue());\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"] \");\r\n\r\n\t\t\tboolean has_text = false;\r\n\t\t\tif (n.getNodeType() == Node.TEXT_NODE) {\r\n\t\t\t\thas_text = true;\r\n\t\t\t\tString valn = n.getNodeValue().trim();\r\n\t\t\t\tif (valn.length() > 0)\r\n\t\t\t\t\tSystem.out.print(\"\\n\" + Pad(depth) + \" \\\"\" + valn + \"\\\"\");\r\n\t\t\t}\r\n\r\n\t\t\tNodeList cn = n.getChildNodes();\r\n\r\n\t\t\tfor (int i = 0; cn != null && i < cn.getLength(); i++) {\r\n\t\t\t\tNode item = cn.item(i);\r\n\t\t\t\tif (item.getNodeType() == Node.TEXT_NODE) {\r\n\t\t\t\t\tString val = item.getNodeValue().trim();\r\n\t\t\t\t\tif (val.length() > 0)\r\n\t\t\t\t\t\tSystem.out.print(\"\\n\" + Pad(depth) + val + \"\\\"\");\r\n\t\t\t\t} else\r\n\t\t\t\t\tPrintNode(item, prefix, depth + 2);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(Pad(depth) + \"Exception e: \");\r\n\t\t}\r\n\t}", "void printTree(Node root) { \r\n if (root != null) { \r\n \tprintTree(root.leftChild); \r\n System.out.println(\"\\\"\" + root.keyValuePair.getKey() + \"\\\"\" + \" : \" + root.getKeyValuePair().getValue()); \r\n printTree(root.rightChild); \r\n } \r\n }", "public void printNode(Node n);", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\n }", "public void printTree() {\r\n\t\tif (isEmpty())\r\n\t\t\tSystem.out.println(\"Empty tree\");\r\n\t\telse\r\n\t\t\tprintTree(root);\r\n\t}", "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 }", "static void preorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n System.out.println(\" \" + indent + node.data);\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n preorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n }", "public void printDLR() {\n if(!empty()) {\n printDLRNodes(root);\n System.out.println();\n }\n }", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "private void printTree(BinaryNode<AnyType> t) {\r\n\t\tif (t != null) {\r\n\t\t\tprintTree(t.left);\r\n\t\t\tSystem.out.println(t.element);\r\n\t\t\tprintTree(t.right);\r\n\t\t}\r\n\t}", "public void print() {\n\t\tSystem.out.println(\"DECISION TREE\");\n\t\tString indent = \" \";\n\t\tprint(root, indent, \"\");\n\t}", "private void printTree( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t != null )\r\n\t\t{\t\t\t\r\n\t\t\tprintTree( t.left );\r\n\t\t\tSystem.out.print( t.element+\" \");\r\n\t\t\tprintTree( t.right );\r\n\t\t}\r\n\t}", "public void printTree(){ \n System.out.format(\"The suffix tree for S = %s is: %n\",this.text); \n this.print(0, this.root); \n }", "public void printInOrder() { // not to be changed\n\t\tprintInOrder(root);\n\t}", "protected void print(Node<T> root)\r\n {\r\n if (root != null) {\r\n print(root.left);\r\n System.out.print(root.data + \" \");\r\n print(root.right);\r\n }\r\n }", "private static List<Integer> printTree(Tree tree, List values){\n int height = heightOfTree(tree);\n\n for(int i=1;i<=height;i++) {\n System.out.println(\"\");\n printTreeInLevel(tree, i, values);\n }\n return values;\n}", "static void postorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n System.out.println(\" \" + indent + node.data);\n }", "public String printTree() {\n printSideways();\n return \"\";\n }", "@Override\r\n public String toString() {\r\n Queue<List<Node>> queue = new LinkedList<List<Node>>();\r\n queue.add(Arrays.asList(root));\r\n StringBuilder sb = new StringBuilder();\r\n while (!queue.isEmpty()) {\r\n Queue<List<Node>> nextQueue = new LinkedList<List<Node>>();\r\n while (!queue.isEmpty()) {\r\n List<Node> nodes = queue.remove();\r\n sb.append('{');\r\n Iterator<Node> it = nodes.iterator();\r\n while (it.hasNext()) {\r\n Node node = it.next();\r\n sb.append(node.toString());\r\n if (it.hasNext())\r\n sb.append(\", \");\r\n if (node instanceof BPTree.InternalNode)\r\n nextQueue.add(((InternalNode) node).children);\r\n }\r\n sb.append('}');\r\n if (!queue.isEmpty())\r\n sb.append(\", \");\r\n else {\r\n sb.append('\\n');\r\n }\r\n }\r\n queue = nextQueue;\r\n }\r\n return sb.toString();\r\n }", "public void printTree(Node root) {\n Queue<Node> queue = new LinkedList<>();\n queue.offer(root);\n ArrayList<Integer> arrayList = new ArrayList<>();\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n for (int i = 0; i < size; i++) {\n Node node = queue.poll();\n arrayList.add(node.val);\n if (node.children != null) {\n for (Node n : node.children) {\n queue.offer(n);\n }\n }\n }\n arrayList.add(null);\n }\n\n System.out.println(Arrays.toString(arrayList.toArray()));\n }", "public static void printTreeHelper(BinarySearchTreeNode<Integer> node) {\n // base case\n if (node == null) {\n return;\n }\n\n System.out.print(node.data + \": \");\n if (node.left != null) {\n System.out.print(\"L\" + node.left.data + \", \");\n }\n\n if (node.right != null) {\n System.out.print(\"R\" + node.right.data);\n }\n System.out.println();\n\n printTreeHelper(node.left);\n printTreeHelper(node.right);\n }", "void printLevel()\r\n\t {\r\n\t int h = height(root);\r\n\t int i;\r\n\t for (i=1; i<=h+1; i++)\r\n\t printGivenLevel(root, i);\r\n\t }", "public void dumpChildren (final int level)\r\n {\r\n for (TreeNode node : children) {\r\n if (node.dumpNode(level)) {\r\n node.dumpChildren(level + 1);\r\n }\r\n }\r\n }", "void preOrderPrint(Node root, boolean recursion)\n\t{\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrderPrint(root.left, true);\n\t\tpreOrderPrint(root.right, true);\n\t}", "void printPostorder(Node node) {\n\t\t//base case\n\t\tif(node == null)\n\t\t\treturn;\n\t\t// first recur on left subtree\n\t\tprintPostorder(node.left);\n\t\t\t\t\n\t\t// then recur on right subtree\n\t\tprintPostorder(node.right);\n\t\t\t\t\n\t\t// now deal with the node\n\t\tSystem.out.print(node.data + \" \");\n\t}", "public void printNodes(){\n for(int i =0; i<n;i++)\n System.out.print(key[i]+\" \");\n System.out.println(isLeaf);\n if (!isLeaf){\n for(int i =0; i<=n;i++){\n c[i].printNodes();\n }\n }\n }", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "public static void print(Node root) {\n Node temp = root;\n while (temp != null) {\n System.out.print(temp.data + \" \");\n temp = temp.next;\n }\n }", "public void printNode(TrieNode curr) {\n if (curr == null)\n return;\n\n System.out.println(curr.getText());\n\n TrieNode next = null;\n for (Character c : curr.getValidNextCharacters()) {\n next = curr.getChild(c);\n printNode(next);\n }\n }", "private void _printInorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printInorder(root.left);\r\n System.out.print(\" \" + root.data);\r\n _printInorder(root.right);\r\n }\r\n }", "public void printInOrder() {\n printInOrderHelper(root);\n }", "public static void printTree(Node root) {\r\n if (root == null)\r\n return;\r\n printTree(root.left);\r\n System.out.print(Integer.toString(root.value) + \" \");\r\n printTree(root.right);\r\n }", "public void printTree( )\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tSystem.out.println( \"Empty tree\" );\r\n\t\telse\r\n\t\t\tprintTree( root );\r\n\t}", "void\nprintLeaves(Node node) \n\n{ \n\nif\n(node != \nnull\n) { \n\nprintLeaves(node.left); \n\n\n// Print it if it is a leaf node \n\nif\n(node.left == \nnull\n&& node.right == \nnull\n) \n\nSystem.out.print(node.data + \n\" \"\n); \n\nprintLeaves(node.right); \n\n} \n\n}", "private void printInOrderHelper(Node n) {\n if (n != null) {\n printInOrderHelper(n.leftChild);\n System.out.println(n.key + \": \" + n.value + \"\\t\");\n printInOrderHelper(n.rightChild);\n }\n }", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "public void printAllNodes() {\n\t\tNode current = head;\n\n\t\twhile( current != null ) {\n\t\t\tSystem.out.println(current.data);\n\t\t\tcurrent = current.next;\n\t\t}\n\t}", "public void printTree(){\n if(root!=null) // มี node ใน tree\n {\n super.printTree(root); // ปริ้นโดยส่ง node root ไป static fn\n }\n else\n {\n System.out.println(\"Empty tree!!!\");\n }\n }", "@Override\n public void printTree() {\n System.out.println(\"node with char: \" + this.getChar() + \" and key: \" + this.getKey());\n int i = 0;\n for(IABTNode node : this.sons) {\n if(!node.isNull()) {\n System.out.print(\"Son \" + i + \" :\");\n node.printTree();\n }\n i++;\n }\n }", "public void print(){\n NodeD tmp = this.head;\n\n while(tmp!=null){\n System.out.println(tmp.getObject().asString());\n tmp = tmp.getNext();\n }\n }", "private static void print(ArrayList<Node<BinaryTreeNode<Integer>>> n) {\n\t\tfor(int i=0; i<n.size(); i++) {\n\t\t\tNode<BinaryTreeNode<Integer>> head = n.get(i);\n\t\t\twhile(head != null) {\n\t\t\t\tSystem.out.print(head.data.data+\" \");\n\t\t\t\thead = head.next;\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "void printLevelOrder() {\n TreeNode2 nextLevelRoot = this;\n while (nextLevelRoot != null) {\n TreeNode2 current = nextLevelRoot;\n nextLevelRoot = null;\n while (current != null) {\n System.out.print(current.val + \" \");\n if (nextLevelRoot == null) {\n if (current.left != null)\n nextLevelRoot = current.left;\n else if (current.right != null)\n nextLevelRoot = current.right;\n }\n current = current.next;\n }\n System.out.println();\n }\n }", "public void print(Node node) \n{\n PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out), true);\n print(node, w);\n}", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "public void printSubNodes(int depth) {\r\n super.printSubNodes(depth);\r\n\r\n if (orderByList != null) {\r\n printLabel(depth, \"orderByList: \");\r\n orderByList.treePrint(depth + 1);\r\n }\r\n if (offset != null) {\r\n printLabel(depth, \"offset: \");\r\n offset.treePrint(depth + 1);\r\n }\r\n if (fetchFirst != null) {\r\n printLabel(depth, \"fetchFirst: \");\r\n fetchFirst.treePrint(depth + 1);\r\n }\r\n }", "public void printTreeInOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreeInOrder(node.left);\n System.out.print(node.item + \" \");\n\n printTreeInOrder(node.right);\n }", "public void print()\n {\n for (Node curr = first; curr != null; curr = curr.next)\n System.out.print(curr.val + \" \");\n System.out.println();\n }", "public void printIterativePreorderTraversal() {\r\n\t\tprintIterativePreorderTraversal(rootNode);\r\n\t}", "public static String printDFS(final List<DFSTreeNode> nodes) {\n if(nodes == null || nodes.size() <= 0)\n return \"\";\n \n String print = \"\";\n \n List<DFSTreeNode> sorted = new ArrayList<>(nodes);\n List<DFSTreeNode> visited = new ArrayList<>();\n Stack<DFSTreeNode> parents = new Stack<>();\n \n // Find the root node and push it in parents\n sorted.sort(new Comparator<DFSTreeNode>(){\n @Override\n public int compare(DFSTreeNode o1, DFSTreeNode o2) {\n return o1.compareTo(o2);\n }\n });\n DFSTreeNode root = sorted.get(0);\n parents.push(root);\n while(!parents.isEmpty()) {\n DFSTreeNode currNode = parents.pop();\n if(!visited.contains(currNode)) {\n visited.add(currNode);\n print += currNode.printStart(nodes,visited);\n print += currNode.printBeforeChildren(nodes,visited);\n }\n \n // Find all children\n List<DFSTreeNode> children = sorted.stream().filter(n -> n.isChildOf(currNode))\n .collect(Collectors.toList());\n // To indicate if we have already visited all children of the current node\n boolean noMoreChildren = true;\n for(DFSTreeNode child : children){\n // If child was already visited, skip it\n if(visited.contains(child)) continue;\n // If not visited, push it to parents stack together with currNode\n parents.push(currNode);\n parents.push(child);\n // Set noMoreChildren to false if we are going deeper\n noMoreChildren = false;\n // Break as we don't want to visit any siblings until we've completed the current line of descendants\n break;\n }\n \n // If no more children for the current node, close the node\n if(noMoreChildren) {\n print += currNode.printAfterChildren(nodes,visited);\n print += currNode.printEnd(nodes,visited);\n }\n }\n return print;\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 printTreeLevel(AvlNode<E> node){\n if(node == null){\n System.out.print(\"\");\n return;\n }\n Queue<AvlNode<E>> queue = new Queue<AvlNode<E>>();\n queue.enqueue(node);\n while(!queue.isEmpty()){\n AvlNode<E> currentNode = queue.dequeue();\n\n System.out.print(currentNode.value);\n System.out.print(\" \");\n\n if(currentNode.left != null)\n queue.enqueue(currentNode.left);\n if(currentNode.right != null)\n queue.enqueue(currentNode.right);\n }\n }", "public void printInorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printInorder();\n System.out.println();\n }\n }", "public void printInorder() {\n if (myRoot == null) {\n System.out.println(\"(empty tree)\");\n } else {\n myRoot.printInorder();\n System.out.println();\n }\n }", "private void printInorder(IntTreeNode root) {\n if (root != null) {\n printInorder(root.left);\n System.out.print(\" \" + root.data);\n printInorder(root.right);\n }\n }", "private static void traversals(Node root) {\n\t\tSystem.out.println(\"Node Pre \" + root.data);\n\t\tfor(Node child : root.children) {\n\t\t\tSystem.out.println(\"Edge Pre \" + root.data + \"--\" + child.data);\n\t\t\ttraversals(child);\n\t\t\tSystem.out.println(\"Edge Post \" + root.data + \"--\" + child.data);\n\t\t}\n\t\tSystem.out.println(\"Node Post \" + root.data);\n\t}", "private void print(Node nodeToPrint, String indent, String value) {\n\t\tString newIndent = indent + \" \";\n\t\t// if it is a class node\n\t\tif(nodeToPrint instanceof ClassNode){\n\t\t\t// cast to a class node and print it\n\t\t\tClassNode node = (ClassNode) nodeToPrint;\n\t\t\tSystem.out.println(indent + value + \"=\"+ node.className);\n\t\t}else{\n\t\t\t// if it is a decision node, cast it to a decision node\n\t\t\t// and print it.\n\t\t\tDecisionNode node = (DecisionNode) nodeToPrint;\n\t\t\tSystem.out.println(indent + allAttributes[node.attribute] + \"->\");\n\t\t\t// then recursively call the method for subtrees\n\t\t\tfor(int i=0; i< node.nodes.length; i++){\n\t\t\t\tprint(node.nodes[i], newIndent, node.attributeValues[i]);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private void printTree(Tree parse) {\n\t\tparse.pennPrint();\n\t}", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void printStructure() {\n printStructure(mRoot);\n }", "void printZigZagTraversal() {\n\n\t\t// if null then return\n\t\tif (rootNode == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// declare two stacks\n\t\tStack<ZNode> currentLevel = new Stack<>();\n\t\tStack<ZNode> nextLevel = new Stack<>();\n\n\t\t// push the root\n\t\tcurrentLevel.push(rootNode);\n\t\tboolean leftToRight = true;\n\n\t\t// check if stack is empty\n\t\twhile (!currentLevel.isEmpty()) {\n\n\t\t\t// pop out of stack\n\t\t\tZNode node = currentLevel.pop();\n\n\t\t\t// print the data in it\n\t\t\tSystem.out.print(node.data + \" \");\n\n\t\t\t// store data according to current\n\t\t\t// order.\n\t\t\tif (leftToRight) {\n\t\t\t\tif (node.leftChild != null) {\n\t\t\t\t\tnextLevel.push(node.leftChild);\n\t\t\t\t}\n\n\t\t\t\tif (node.rightChild != null) {\n\t\t\t\t\tnextLevel.push(node.rightChild);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (node.rightChild != null) {\n\t\t\t\t\tnextLevel.push(node.rightChild);\n\t\t\t\t}\n\n\t\t\t\tif (node.leftChild != null) {\n\t\t\t\t\tnextLevel.push(node.leftChild);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentLevel.isEmpty()) {\n\t\t\t\tleftToRight = !leftToRight;\n\t\t\t\tStack<ZNode> temp = currentLevel;\n\t\t\t\tcurrentLevel = nextLevel;\n\t\t\t\tnextLevel = temp;\n\t\t\t}\n\t\t}\n\t}", "private void printInorder(IntTreeNode root) {\r\n if (root != null) {\r\n printInorder(root.left);\r\n System.out.print(\" \" + root.data);\r\n printInorder(root.right);\r\n }\r\n }", "private void printContextTree(ContextTreeNode contextNode, String prefix) {\n \n prefix = prefix + \" \";\n for (ContextTreeNode childNode : contextNode.getChildren()) {\n System.out.println(prefix + childNode.getContext().getDescription().name);\n printContextTree(childNode, prefix);\n }\n \n }", "public void printRoot(){\n for(String temp : root){\n System.out.println(temp);\n }\n }", "private void printFullTree()\r\n {\r\n System.out.println(fullXmlTree.toString());\r\n }", "void printPostorder(Node node) {\n if (node == null)\n return;\n\n // first recur on left subtree\n printPostorder(node.left);\n\n // then recur on right subtree\n printPostorder(node.right);\n\n // now deal with the node\n System.out.print(node.key + \" \");\n }", "private static void printlist(Node node) {\n\t\twhile (node != null) {\n\t\t\tSystem.out.print(node.data + \"->\");\n\t\t\tnode = node.next;\n\t\t}\n\t}", "public static void printTree(final Node node, final PrintStream printStream) {\n\t\tprintTree(node, 0, printStream); //if we're called normally, we'll dump starting at the first tab position\n\t}", "private static String printNode(Node node) {\n\t\tif (node instanceof TextNode) {\n\t\t\tTextNode textNode = (TextNode) node;\n\t\t\treturn addEscapes(\n\t\t\t\t\ttextNode.getText(),\n\t\t\t\t\tEscapableArrays.textEscapable(),\n\t\t\t\t\tParserDelimiters.ESCAPE_DELIMITER.getValue()\n\t\t\t);\n\t\t}\n\t\t\n\t\tif (node instanceof ForLoopNode) {\n\t\t\treturn printForLoopNode((ForLoopNode) node);\n\t\t}\n\t\t\n\t\tif (node instanceof EchoNode) {\n\t\t\treturn printEchoNode((EchoNode) node);\n\t\t}\n\t\t\n\t\treturn \"\";\n\t}", "private static void treeList(TreeNode node) {\n if (node != null) {\n treeList(node.left); // Print items in left subtree.\n System.out.println(\" \" + node.item); // Print item in the node.\n treeList(node.right); // Print items in the right subtree.\n }\n }", "protected static void printTree(final Node node, int tabPos, final PrintStream printStream) {\n\t\tswitch(node.getNodeType()) { //see which type of object this is\n\t\t\tcase Node.ELEMENT_NODE: //if this is an element\n\n\t\t\t\t//TODO fix for empty elements\n\n\t\t\t\t//TODO del tabPos+=tabDelta;\t//TODO check this; maybe static classes don't have recursive-aware functions\n\t\t\t\tprintTree((Element)node, tabPos + 1, printStream); //comment, check to see if we need the typecast\n\t\t\t\t//TODO del tabPos-=tabDelta;\t//TODO check this; maybe static classes don't have recursive-aware functions\n\t\t\t\tbreak;\n\t\t\tcase Node.TEXT_NODE: //if this is a text node\n\t\t\t\tfor(int i = 0; i < tabPos + 1; ++i)\n\t\t\t\t\tprintStream.print(TAB_STRING); //TODO fix to adjust automatically to tabDelta, comment\n\t\t\t\tprintStream.print(\"[Text] \"); //TODO fix to adjust automatically to tabDelta, comment\n\t\t\t\tprintStream.println(Strings.replace(node.getNodeValue(), '\\n', \"\\\\n\")); //print the text of this node\n\t\t\t\tbreak;\n\t\t\tcase Node.COMMENT_NODE: //if this is a comment node\n\t\t\t\tfor(int i = 0; i < tabPos + 1; i += ++i)\n\t\t\t\t\tprintStream.print(TAB_STRING); //TODO fix to adjust automatically to tabDelta, comment\n\t\t\t\tprintStream.print(\"[Comment] \"); //TODO fix to adjust automatically to tabDelta, comment\n\t\t\t\tprintStream.println(Strings.replace(node.getNodeValue(), '\\n', \"\\\\n\")); //print the text of this node\n\t\t\t\tbreak;\n\t\t}\n\t}", "public void levelOrderTraversal(TreeNode root){\n int height = height(root);\n for(int i = 0; i <=height; i++){\n System.out.println();\n printNodesInLevel(root,i);\n }\n }", "@Override\n public String print() {\n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n \n System.out.print(\"In ascending order: \");\n for (int i=0; i<inorderTraverse.size(); i++) {\n System.out.print(inorderTraverse.get(i)+\" \");\n }\n System.out.println(\"\");\n return \"\";\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}" ]
[ "0.7336548", "0.72387385", "0.71320397", "0.7108806", "0.70653", "0.7044283", "0.70160174", "0.6940788", "0.6927424", "0.6898082", "0.6874044", "0.68455434", "0.6819574", "0.68028194", "0.6791744", "0.67712766", "0.6741209", "0.67297596", "0.67297596", "0.67297596", "0.6719611", "0.6718089", "0.6710787", "0.66904455", "0.6662997", "0.66409385", "0.6637136", "0.6630416", "0.6622644", "0.6618079", "0.6585434", "0.6571289", "0.6566719", "0.656542", "0.65585023", "0.65501034", "0.65496886", "0.6544117", "0.654029", "0.6539541", "0.649127", "0.648998", "0.648646", "0.647511", "0.6461362", "0.64470816", "0.6436051", "0.64276385", "0.64174867", "0.6416402", "0.6415018", "0.6403062", "0.6388439", "0.63832617", "0.6370791", "0.63514215", "0.63435686", "0.63401675", "0.63364184", "0.63322324", "0.63295245", "0.63291276", "0.63280284", "0.6326739", "0.6315948", "0.6313624", "0.631313", "0.63099563", "0.6309441", "0.6292635", "0.62790614", "0.6276935", "0.62743175", "0.6271295", "0.62569135", "0.6252738", "0.6251421", "0.62497526", "0.62495464", "0.62495464", "0.62486744", "0.62486047", "0.6238033", "0.62324935", "0.62309986", "0.62282777", "0.62189865", "0.6213628", "0.61986905", "0.6198053", "0.6194937", "0.6189411", "0.61877567", "0.6180399", "0.617841", "0.61762697", "0.6175982", "0.6170111", "0.61657554", "0.6160781" ]
0.65350497
40
This function takes a node n and recolors and put it in the right place in the Red Black Tree.
public void RBFixup(Node n) { while(n.parent.color == 0) { if(n.parent == n.parent.parent.left) { Node y = n.parent.parent.right; if(y.color == 0) { n.parent.color = 1; y.color = 1; n.parent.parent.color = 0; n = n.parent.parent; } else { if(n == n.parent.right) { n = n.parent; leftRotate(n); } n.parent.color = 1; n.parent.parent.color = 0; //mark n and n's grandparent, because in the end these two nodes will be the children //marking will be handled in recUpdateNode n.marked = true; n.parent.parent.marked = true; rightRotate(n.parent.parent); if(hFlag == 1) height--; } } else { Node y = n.parent.parent.left; if(y.color == 0) { n.parent.color = 1; y.color = 1; n.parent.parent.color = 0; n = n.parent.parent; } else { if(n == n.parent.left) { n = n.parent; rightRotate(n); } n.parent.color = 1; n.parent.parent.color = 0; //mark n and n's grandparent, because in the end these two nodes will be the children //marking will be handled in recUpdateNode n.marked = true; n.parent.parent.marked = true; leftRotate(n.parent.parent); if(hFlag == 1) height--; } } } root.color = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void colorNode(NodeImpl node) {\n nodeColorizer.color(node);\n }", "private void adjustColorsInsertion(BSTNode node, BSTNode dad, Ref<Integer> b) {\n\t\tBSTNode grandad = dad.getParent(), uncle;\n\t\tif (grandad.getLeft() == dad)\n\t\t\tuncle = grandad.getRight();\n\t\telse\n\t\t\tuncle = grandad.getLeft();\n\t\tif (uncle != null && uncle.getColor() == Color.RED) {\n\t\t\tb.set(0);\n\t\t\tuncle.setColor(Color.BLACK);\n\t\t\tdad.setColor(Color.BLACK);\n\t\t\tgrandad.setColor(Color.RED);\n\t\t}\n\t\telse {\n\t\t\trotate(node, dad, grandad);\n\t\t\tb.set(2);\n\t\t}\n\t\tif (root.getColor() == Color.RED)\n\t\t\troot.setColor(Color.BLACK);\n\t}", "private void createNodeColor(NodeAppearanceCalculator nac) {\r\n\t DiscreteMapping discreteMapping = new DiscreteMapping\r\n\t (Color.WHITE,\r\n\t NODE_TYPE,\r\n\t ObjectMapping.NODE_MAPPING);\r\n\t \r\n\t discreteMapping.putMapValue(\"biochemicalReaction\",\r\n\t new Color (204, 0, 61));\r\n\t discreteMapping.putMapValue(\"catalyst\",\r\n\t new Color(0, 163, 0));\r\n\t discreteMapping.putMapValue(\"protein\",\r\n\t new Color (0, 102, 255));\r\n\t discreteMapping.putMapValue(\"smallMolecule\",\r\n\t new Color (193, 249, 36));\r\n\r\n\t NodeColorCalculator nodeColorCalculator =\r\n\t new GenericNodeColorCalculator(\"SimpleBioMoleculeEditor Node Color Calculator\"\r\n\t , discreteMapping);\r\n\t nac.setNodeFillColorCalculator(nodeColorCalculator);\r\n\t }", "public void setRed(RBNode<T> node) {\n if(node != null)\r\n node.color = RED;\r\n }", "private void adjustColorsRemoval(BSTNode node, boolean b) {\n\t\tif (node != null) {\n\t\t\tBSTNode son;\n\t\t\tif (b)\n\t\t\t\tson = node.getRight();\n\t\t\telse\n\t\t\t\tson = node.getLeft();\n\t\t\tif (son.getColor() == Color.RED) {\n\t\t\t\tson.setColor(Color.BLACK);\n\t\t\t\tnode.setColor(Color.RED);\n\t\t\t\tif (b)\n\t\t\t\t\tleftRotation(node, son);\n\t\t\t\telse\n\t\t\t\t\trightRotation(node, son);\n\t\t\t\tadjustColorsRemoval(node, b);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif((son.getLeft() == null || son.getLeft().getColor() == Color.BLACK) && (son.getRight() == null || son.getRight().getColor() == Color.BLACK)) {\n\t\t\t\t\t\tson.setColor(Color.RED);\n\t\t\t\t\t\tif (node.getColor() == Color.RED)\n\t\t\t\t\t\t\tnode.setColor(Color.BLACK);\n\t\t\t\t\t\telse if (node != root)\n\t\t\t\t\t\t\tadjustColorsRemoval(node.getParent(), node.getKey() < node.getParent().getKey());\n\t\t\t\t}\n\t\t\t\telse if (b) {\n\t\t\t\t\tif (son.getRight() == null || son.getRight().getColor() == Color.BLACK) {\n\t\t\t\t\t\tson.setColor(Color.RED);\n\t\t\t\t\t\tson.getLeft().setColor(Color.BLACK);\n\t\t\t\t\t\trightRotation(son, son.getLeft());\n\t\t\t\t\t\tadjustColorsRemoval(node, true);\n\t\t\t\t\t}\n\t\t\t\t\telse if (son.getRight().getColor() == Color.RED) {\n\t\t\t\t\t\tson.setColor(node.getColor());\n\t\t\t\t\t\tnode.setColor(Color.BLACK);\n\t\t\t\t\t\tson.getRight().setColor(Color.BLACK);\n\t\t\t\t\t\tleftRotation(node, son);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (son.getLeft() == null || son.getLeft().getColor() == Color.BLACK) {\n\t\t\t\t\t\tson.setColor(Color.RED);\n\t\t\t\t\t\tson.getRight().setColor(Color.BLACK);\n\t\t\t\t\t\tleftRotation(son, son.getRight());\n\t\t\t\t\t\tadjustColorsRemoval(node, false);\n\t\t\t\t\t}\n\t\t\t\t\telse if (son.getLeft().getColor() == Color.RED) {\n\t\t\t\t\t\tson.setColor(node.getColor());\n\t\t\t\t\t\tnode.setColor(Color.BLACK);\n\t\t\t\t\t\tson.getLeft().setColor(Color.BLACK);\n\t\t\t\t\t\trightRotation(node, son);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void handleColors(int newElement) \n { \n // flip the colors of the node \n current.color = RED; //make current node RED \n current.leftChild.color = BLACK; //make leftChild BLACK \n current.rightChild.color = BLACK; //make rightChild BLACK \n \n //check the color of the parent node \n if (parent.color == RED) \n { \n // perform rotation in case when the color of parent node is RED \n grand.color = RED; \n \n if (newElement < grand.element && grand.element != newElement && newElement < parent.element) \n parent = performRotation( newElement, grand ); // Start dbl rotate \n current = performRotation(newElement, great ); \n current.color = BLACK; \n } \n \n // change the color of the root node with BLACK \n header.rightChild.color = BLACK; \n }", "private void resolveRed(Position<Entry<K, V>> p) {\n Position<Entry<K, V>> parent = parent(p);\n if (isRed(parent)) {\n Position<Entry<K, V>> uncle = sibling(parent);\n if (isBlack(uncle)) { // Case 1: mis-shaped 4-node\n Position<Entry<K, V>> middle = restructure(p); // trinode restructuring\n makeBlack(middle);\n makeRed(left(middle));\n makeRed(right(middle));\n } else { // Case 2: overfill 5-node\n makeBlack(parent);\n makeBlack(uncle);\n Position<Entry<K, V>> grand = parent(parent);\n if (!isRoot(grand)) {\n makeRed(grand);\n resolveRed(grand);\n }\n }\n }\n }", "protected void seenNode(Node n) {\r\n colorNode(n, seenNodeColor);\r\n colorNode(n.getParent(), nodeHighlightColor);\r\n }", "private void changeColor(int r, int c, Color color) {\n\t\tint location = r*7+c;\n\t\tIterator itr = game.getChildren().iterator();\n\t\tfor (int i = 0; i<game.getChildren().size(); i++) {\n\t\t\tCircle nextChild = (Circle) itr.next();\n\t\t\tif (i == location) {\n\t\t\t\tnextChild.setFill(color);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "protected void redBlackFixUp(RedBlackNode<T> node) {\n if(node == _head) {\n node._isRed = false;\n return;\n }\n // node is child. a red node cannot have a red parent.\n while(node.getParent()._isRed) {\n RedBlackNode<T> parent = node.getParent();\n // if the parent is red, then it must have a parent.\n RedBlackNode<T> grandparent = parent.getParent();\n // if parent is left child, check right child *uncle* \n if(grandparent.getLeftChild() == parent) {\n RedBlackNode<T> uncle = grandparent.getRightChild();\n // if uncle is black\n if(uncle == null || !uncle._isRed) {\n // check whether or not there is a triangle\n // between node, parent, and grandparent.\n if (parent.getRightChild() == node) {\n parent = rotateLeft(parent);\n }\n parent._isRed = false;\n grandparent._isRed = true;\n rotateRight(grandparent);\n }\n else {\n // here uncle is red.\n parent._isRed = false;\n uncle._isRed = false;\n grandparent._isRed = true;\n node = grandparent;\n }\n }\n // if parent is right child, check left child *uncle* \n if(grandparent._rightChild == parent) {\n RedBlackNode<T> uncle = grandparent.getLeftChild();\n // if uncle is black\n if(uncle == null || !uncle._isRed) {\n // check whether or not there is a triangle\n // between node, parent, and grandparent.\n if (parent.getLeftChild() == node) {\n parent = rotateRight(parent);\n }\n parent._isRed = false;\n grandparent._isRed = true;\n rotateLeft(grandparent);\n }\n else {\n // here uncle is red.\n parent._isRed = false;\n uncle._isRed = false;\n grandparent._isRed = true;\n node = grandparent;\n }\n }\n\n if(node == _head) {\n node._isRed = false;\n return;\n }\n }\n return;\n }", "private void adjustRedParentNode(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n if(deficientNode.parent.color == Color.RED && sibling.color == Color.BLACK && sibling.left.color == Color.BLACK\n && sibling.right.color == Color.BLACK) {\n \tsibling.color = Color.RED;\n \tdeficientNode.parent.color = Color.BLACK;\n return;\n } else {\n \tadjustRedChildBlackSibling(deficientNode, rootRef);\n }\n\t}", "private void switchColor(Node node) {\n Circle temp = (Circle) node;\n\n if (isRed) {\n temp.setFill(Paint.valueOf(\"Red\"));\n turnCircle.setFill(Paint.valueOf(\"Blue\"));\n turnDisplay.setText(aiTurn);\n isRed = false;\n } else {\n temp.setFill(Paint.valueOf(\"Blue\"));\n turnCircle.setFill(Paint.valueOf(\"Red\"));\n turnDisplay.setText(humanTurn);\n isRed = true;\n }\n }", "abstract Color nodeColor(String node);", "public RedBlackNode(int element, RedBlackNode leftChild, RedBlackNode rightChild) \n { \n this.element = element; \n this.leftChild = leftChild; \n this.rightChild = rightChild; \n color = 1; \n }", "private void colorNode(Node root2, Color c) {\r\n pMap.get(root2.getId()).changeColor(\"fillColor\", c, null, null);\r\n }", "private void colorNodes() {\n for (NodeImpl n : supervisedNodes) {\n colorNode(n);\n }\n }", "public void colourNode(int node, HashMap <Integer, Integer> colours, int nextColour ) {\r\n\t\tcolours.put(node, nextColour);\r\n\t\tcolouredNodes.add(node);\r\n\t}", "private void checkBalance(Node n) {\n if (n == mRoot) { // case 1: new node is root.\n n.mIsRed = false; // Paint it black.\n }\n // Case 2: Parent is black...\n else if (!n.mParent.mIsRed) {} // nothing will happen.\n // Case 3: Parent and Uncle are red.\n else if (getUncle(n).mIsRed) {\n n.mParent.mIsRed = false;\n getUncle(n).mIsRed = false; // Repaint P, U and G\n getGrandparent(n).mIsRed = true; \n checkBalance(getGrandparent(n)); // Recurse on G\n }\n // Case 4: n is LR or RL grandchild\n else if (n == getGrandparent(n).mLeft.mRight) { // n is LR\n singleRotateLeft(n.mParent); // Rotate on P\n singleRotateRight(n.mParent); // Then on G... which is now n's parent\n n.mIsRed = false; n.mRight.mIsRed = true; // Repaint G and P\n // These two lines were case 5, modified so as to not screw up.\n }\n else if (n == getGrandparent(n).mRight.mLeft) {// n is RL\n singleRotateRight(n.mParent);\n singleRotateLeft(n.mParent); // As above, reversed.\n n.mIsRed = false; n.mLeft.mIsRed = true;\n }\n // Case 5: n is LL or RR grandchild\n else if (n == getGrandparent(n).mLeft.mLeft) {// n is LL\n singleRotateRight(getGrandparent(n));\n n.mParent.mIsRed = false; // Rotate at G, repainting as above\n n.mParent.mRight.mIsRed = true;\n }\n else if (n == getGrandparent(n).mRight.mRight) { // n is RR\n singleRotateLeft(getGrandparent(n));\n n.mParent.mIsRed = false; // Same here.\n n.mParent.mLeft.mIsRed = true;\n }\n }", "private void adjustBlackSiblingRedChild(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n\t\tsibling.color = sibling.parent.color;\n\t\tsibling.parent.color = Color.BLACK;\n if(isLeftChild(deficientNode)) {\n \tsibling.right.color = Color.BLACK;\n rotateLeft(sibling, false);\n } else {\n \tsibling.left.color = Color.BLACK;\n rotateRight(sibling, false);\n }\n if(sibling.parent == null) {\n \trootRef.set(sibling);\n }\n\t}", "protected void applyToPixel(Node n) throws IllegalArgumentException {\n if (n == null) {\n throw new IllegalArgumentException(\"Null node given.\");\n }\n ArrayList<Double> nodeRGB = new ArrayList<Double>(\n Arrays.asList(n.getRed() + 0.0, n.getGreen() + 0.0, n.getBlue() + 0.0));\n Matrix ogRGB = new MatrixImpl(nodeRGB, 1, 3);\n\n Matrix newRGB = this.generateNewColorMatrix(ogRGB);\n\n n.updateColors(new SimplePixel(\n Utils.roundDouble(newRGB.getValue(0, 0)),\n Utils.roundDouble(newRGB.getValue(0, 1)),\n Utils.roundDouble(newRGB.getValue(0, 2))));\n }", "private void colorFoundNode(String s, double x, double y, double delay) {\n Text nn = new Text(x + 18 - s.length(), y + 30, s);\n nn.setFill(Color.WHITE);\n nn.setFont(Font.font(\"Verdana\", FontWeight.EXTRA_BOLD, 14));\n\n Rectangle rect = new Rectangle(x, y, 50, 50); // Draw a node\n rect.setFill(Color.rgb(140, 211, 255));\n rect.setStroke(Color.rgb( 245, 245, 245));\n rect.setArcHeight(15); rect.setArcWidth(20);\n\n //adding the created box to tree's node\n this.getChildren().addAll(rect, nn);\n\n // make fill transition ...this makes node change its colors when it is traversed on\n FillTransition fill = new FillTransition();\n\n\n //Setting auto reverse value to false //The transition will set to be auto reserved by setting this to true\n //Simply it is done so that colour does not turn back to blue.\n fill.setAutoReverse(true);\n\n //setting cycle count for the fill transition\n //making it 1 cause we don't want it ot change again back to blue\n fill.setCycleCount(1);\n //setting the time to be taken for transition\n fill.setDelay(Duration.seconds(delay));\n fill.setDuration(Duration.seconds(.5));\n\n //setting the first colour\n fill.setFromValue(Color.rgb(140, 211, 255));\n //setting the final colour\n fill.setToValue(Color.rgb(255, 206, 10));\n\n //adding the fill \"characteristic\" to rectangular box created before\n fill.setShape(rect);\n\n //starting the transition\n fill.play();\n }", "private void changeColor(List<Node> listToColor, Color red) {\n\t\t\tfor(Node n: listToColor)\n\t\t\t\tn.color = red;\n\t }", "private static final void recursiveColorUsingHeader(TreeDrawerNode node) {\n\t\tif (node.isLeaf()) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tint index = headerInfo.getHeaderIndex(node.getId());\n\t\t\tif (index < 0) {\n\t\t\t\t// CyLogger.getLogger(TreeColorer.class).warn(\"Problem finding node \" +node.getId());\n\t\t\t}\n\t\t\tString [] headers = headerInfo.getHeader(index);\n\t\t\t\n\t\t\tString color = headers[colorInd];\n\t\t\tnode.setColor(parseColor(color));\n\t\t\t\n\t\t\trecursiveColorUsingHeader(node.getLeft());\n\t\t\trecursiveColorUsingHeader(node.getRight());\n\t\t}\n\t}", "private void colorObject(String node, Color color) {\r\n pMap.get(node).changeColor(\"\", color, null, null);\r\n }", "public void insertNewNode(int newElement ) \n { \n current = parent = grand = header; //set header value to current, parent, and grand node \n nullNode.element = newElement; //set newElement to the element of the null node \n \n //repeat statements until the element of the current node will not equal to the value of the newElement \n while (current.element != newElement) \n { \n great = grand; \n grand = parent; \n parent = current; \n \n //if the value of the newElement is lesser than the current node element, the current node will point to the current left child else point to the current right child. \n current = newElement < current.element ? current.leftChild : current.rightChild; \n \n // Check whether both the children are RED or NOT. If both the children are RED change them by using handleColors() method \n if (current.leftChild.color == RED && current.rightChild.color == RED) \n handleColors( newElement ); \n } \n \n // insertion of the new node will be fail if will already present in the tree \n if (current != nullNode) \n return; \n \n //create a node having no left and right child and pass it to the current node \n current = new RedBlackNode(newElement, nullNode, nullNode); \n \n //connect the current node with the parent \n if (newElement < parent.element) \n parent.leftChild = current; \n else \n parent.rightChild = current; \n handleColors( newElement ); \n }", "public void color(Node node, Color color)\n {\n colors[node.nodeId()] = color;\n }", "private void renderNode(Graphics g, Node n)\n {\n\tif (n.ancestor) {\n\t //setRenderColor(g,ancestorcolor);\n\t setRenderColor(g,n.path_color);\n\t}\n\trenderFilledCircle(g,n.x,n.y,n.diameter);\n\n\tsetRenderColor(g,Color.black);\n\trenderCircle(g,n.x,n.y,n.diameter);\n\tif (n.clickable)\n\t renderCircle(g,n.x,n.y,n.diameter+4);\n }", "private static <E extends Comparable> void printNode(TreeNode<E> node, int size, String lineColor) {\r\n String valueString = node != null ? node.getValue().toString() : \"\";\r\n \r\n int spacesBefore = (size - valueString.length()) / 2;\r\n \r\n StringBuilder result = new StringBuilder();\r\n \r\n IntStream.range(0, spacesBefore).forEach(it -> result.append(\" \"));\r\n if(node != null) {\r\n if(node.getMetainfo() == NodeColor.RED) result.append(\"\\u001B[41m\");\r\n else if(node.getMetainfo() == NodeColor.BLACK) result.append(\"\\u001B[40m\");\r\n }\r\n result.append(valueString);\r\n result.append(lineColor);\r\n IntStream.range(spacesBefore + valueString.length(), size).forEach(it -> result.append(\" \"));\r\n \r\n System.err.print(lineColor);\r\n System.err.print(result.toString());\r\n }", "private void adjustRedChildBlackSibling(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n\t\tif(sibling.color == Color.BLACK) {\n if (isLeftChild(deficientNode) && sibling.right.color == Color.BLACK && sibling.left.color == Color.RED) {\n rotateRight(sibling.left, true);\n } else if (!isLeftChild(deficientNode) && sibling.left.color == Color.BLACK && sibling.right.color == Color.RED) {\n rotateLeft(sibling.right, true);\n }\n }\n\t\tadjustBlackSiblingRedChild(deficientNode, rootRef);\n\t}", "private void removeFixUp(RBNode<T> node, RBNode<T> parent) {\r\n RBNode<T> other;\r\n\r\n while((node == null || isBlack(node)) && (node != this.root)) {\r\n if(parent.left == node) { //node is leftChild\r\n other = parent.right; //brother of node\r\n if(isRed(other)) { //case1: brother is red\r\n setBlack(other);\r\n setRed(parent);\r\n leftRotate(parent);\r\n other = parent.right;\r\n }\r\n\r\n //case2: brother is black, both children of brother is black\r\n if((other.left == null || isBlack(other.left)) &&\r\n (other.right == null || isBlack(other.right))) {\r\n setRed(other);\r\n node = parent;\r\n parent = parentOf(node);\r\n } else {\r\n //case3: brother is black, left red right black\r\n if(other.right == null || isBlack(other.right)) {\r\n setBlack(other.left);\r\n setRed(other);\r\n rightRotate(other);\r\n other = parent.right;\r\n }\r\n\r\n //case4: brother is black, right red left any color\r\n setColor(other, colorOf(parent));\r\n setBlack(parent);\r\n setBlack(other.right);\r\n leftRotate(parent);\r\n node = this.root;\r\n break;\r\n }\r\n } else {\r\n other = parent.left;\r\n\r\n if (isRed(other)) {\r\n //case1: brother is red\r\n setBlack(other);\r\n setRed(parent);\r\n rightRotate(parent);\r\n other = parent.left;\r\n }\r\n\r\n if ((other.left==null || isBlack(other.left)) &&\r\n (other.right==null || isBlack(other.right))) {\r\n //case2: brother is black, both children of brother is black\r\n setRed(other);\r\n node = parent;\r\n parent = parentOf(node);\r\n } else {\r\n\r\n if (other.left==null || isBlack(other.left)) {\r\n //case3: brother is black, left red right black\r\n setBlack(other.right);\r\n setRed(other);\r\n leftRotate(other);\r\n other = parent.left;\r\n }\r\n\r\n //case4: brother is black, left red right any color\r\n setColor(other, colorOf(parent));\r\n setBlack(parent);\r\n setBlack(other.left);\r\n rightRotate(parent);\r\n node = this.root;\r\n break;\r\n }\r\n }\r\n }\r\n if (node!=null)\r\n setBlack(node);\r\n }", "public void paintTree(Graphics2D g2, int i) {\n\t\tg2.setColor(new Color(color, color, color));\r\n\r\n\t\tif (i == 0) {\r\n\t\t\tg2.setColor(Color.RED);\r\n\t\t}\r\n\t\tpaintBranch(g2, root);\r\n\t}", "private void adjustDeficientRedSiblingNode(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n if(sibling.color == Color.RED) {\n if(isLeftChild(sibling)) {\n rotateRight(sibling, true);\n } else {\n \trotateLeft(sibling, true);\n }\n if(sibling.parent == null) {\n rootRef.set(sibling);\n }\n }\n adjustDeficientBlackSiblingNode(deficientNode, rootRef);\n\t}", "private void flipColors(Node h){\n\t\th.color = RED;\n\t\th.left.color = BLACK;\n\t\th.right.color = BLACK;\n\t}", "private void highlightNode(Node node) {\r\n // jetzigen Knoten hervorheben\r\n colorNode(node, nodeHighlightColor);\r\n // Elternknoten wieder normal faerben\r\n if (node.getParent() != null) {\r\n colorNode(node.getParent(), nodeColor);\r\n\r\n }\r\n }", "private static <K, V> Node<K, V> makeRightRed(@Var Node<K, V> current) {\n\n current = colorFlip(current);\n if (Node.isRed(current.left.left)) {\n current = rotateClockwise(current);\n current = colorFlip(current);\n }\n return current;\n }", "public void setMaxIntRed(int n)\n {\n // since nIntRedMax = {0, 1, 2, ... ,(n-1)},\n // n is the number of reduction, we have to subtract 1 from n\n nIntRedMax = (n > 1) ? (n-1) : (NINTREDMAXDEF-1);\n stoCri = 0; // the stopping criteria\n }", "public RedBlackNode(int element) \n { \n this( element, null, null ); \n }", "public void nodeColorTreeMapLayout(NodeColor node_color_for_layout) {\n\t// Determine the correct colorer to use\n NodeColorer colorer = null;\n\tswitch (node_color_for_layout) {\n\t case VARY: colorer = new VaryNodeColorer(); break;\n\t case LABEL: colorer = new LabelNodeColorer(); break;\n\t default: System.err.println(\"nodeColorTreeMapLayout() - only works for VARY or LABEL\");\n\t}\n\n\t// If we have a valid colorer, collate nodes by the color into a map\n\tif (colorer != null) {\n\t // Map for color to nodes sets\n Map<Color,Set<String>> map = new HashMap<Color,Set<String>>();\n\n\t // Iterate over the nodes to put them into the correct color bins\n\t Iterator<String> it = node_counter_context.binIterator();\n\t while (it.hasNext()) {\n\t String node_coord_str = it.next();\n\t Color color = colorer.nodeColor(node_coord_str);\n\t if (map.containsKey(color) == false) map.put(color, new HashSet<String>());\n\t map.get(color).add(node_coord_str);\n\t }\n\n\t // Run the treemap algorithm\n\t TreeMap treemap = new TreeMap(map);\n Map<Color,Rectangle2D> layout = treemap.squarifiedTileMapping();\n Iterator<Color> itc = layout.keySet().iterator(); while (itc.hasNext()) {\n Color color = itc.next(); Set<String> set = map.get(color); Rectangle2D rect = layout.get(color);\n // Determine the adjusted rectangle to place them in\n double adj_x = rect.getX() + 0.1 * rect.getWidth(),\n adj_y = rect.getY() + 0.1 * rect.getHeight(),\n adj_w = rect.getWidth() * 0.80,\n adj_h = rect.getHeight() * 0.80;\n\n // Determine the increments\n double x_count = Math.ceil(set.size() / adj_h);\n double y_count = Math.ceil(set.size() / x_count);\n double inc_x = adj_w / x_count,\n inc_y = adj_h / y_count;\n\n // Place the nodes\n Iterator<String> its = set.iterator();\n double x = adj_x, y = adj_y;\n while (its.hasNext()) {\n String node_coord_str = its.next(); Iterator<String> it_nodes = node_coord_set.get(node_coord_str).iterator(); while (it_nodes.hasNext()) {\n entity_to_wxy.put(it_nodes.next(), new Point2D.Double(x,y));\n }\n x += inc_x; if (x > adj_x+adj_w) { x = adj_x; y += inc_y; }\n }\n }\n transform(); zoomToFit(); getRTComponent().render();\n\t}\n }", "private void drawNode(Graphics g, Node n)\n {\n\n\tNode p = n.parent;\n\n\tif (p!=null) {\n\t if (n.paths_passing>0) {\n\t\t//setRenderColor(g,hilitcolor);\n\t\tsetRenderColor(g,n.path_color);\n\t\trenderLine(g,n.x-1,n.y,p.x-1,p.y);\n\t }\n\n// \t setRenderColor(g,(n.paths_passing>0)?hilitcolor:linecolor);\n \t setRenderColor(g,(n.paths_passing>0)?n.path_color:linecolor);\n\t renderLine(g,n.x,n.y,p.x,p.y);\n//\t setRenderColor(g,(p.paths_passing>0)?hilitcolor:normalcolor);\n\t setRenderColor(g,(p.paths_passing>0)?p.path_color:normalcolor);\n \t renderNode(g,p);\n\t}\n// \tsetRenderColor(g,(n.paths_passing>0)?hilitcolor:normalcolor);\n\tsetRenderColor(g,(n.paths_passing>0)?n.path_color:normalcolor);\n\trenderNode(g,n);\n }", "private void colorNodeLabels() {\n for (NodeImpl n : supervisedNodes) {\n if (n.hasLabel()) {\n colorNodeLabel(n.getLabel());\n }\n }\n }", "public void setBlack(RBNode<T> node) {\n if(node != null) {\r\n node.color = BLACK;\r\n }\r\n }", "public void rebalance(NodeRB node){\n \r\n if (node == null){ //failsafe. probably not needed.\r\n return;\r\n }\r\n\r\n NodeRB parent = null, uncle = null, grandparent = null;\r\n parent = fetchParentOf(node); // attempt to fetch the parent. if null, nothing happens.\r\n \r\n if (parent != null){ // must have a parent to have a grandparent. A parent is needed for rebalancing.\r\n \r\n grandparent = fetchParentOf(parent); // attempt to fetch the grandparent. if null, nothing happens.\r\n \r\n if (grandparent != null && parent.color == 'r'){ // grandparent is also required for rebalancing.\r\n \r\n //attempt to find an uncle. can return null. in this case, see the first 'if' statement.\r\n uncle = (grandparent.left == parent) ? grandparent.right : grandparent.left;\r\n\r\n if (uncle == null){ // Phantom, used for reference. assumes the role of a black null leaf.\r\n //System.out.println(\"[i] Uncle is NULL. Assuming as black null leaf.\");\r\n uncle = new NodeRB(0);\r\n uncle.color = 'b';\r\n }\r\n\r\n if (uncle.color == 'r'){ // case 0\r\n System.out.println(\"[i] Case 0: Recolor.\");\r\n recolor(parent);\r\n recolor(uncle);\r\n recolor(grandparent);\r\n return;\r\n }\r\n\r\n if (uncle.color == 'b'){\r\n\r\n //case 1: simple right\r\n if (parent.left == node && grandparent.left == parent){\r\n System.out.println(\"[i]: Simple Right (RR) Rotation...\");\r\n rotateRight(grandparent);\r\n recolor(parent);\r\n recolor(grandparent);\r\n }\r\n\r\n //case 2: simple left\r\n else if (parent.right == node && grandparent.right == parent){\r\n System.out.println(\"[i]: Simple left (LL) Rotation...\");\r\n rotateLeft(grandparent);\r\n recolor(parent);\r\n recolor(grandparent);\r\n }\r\n\r\n //case 3: double left\r\n else if (parent.left == node && grandparent.right == parent){\r\n System.out.println(\"[i]: Double Left (RL) Rotation...\");\r\n rotateRight(parent);\r\n rotateLeft(grandparent);\r\n recolor(node);\r\n recolor(grandparent);\r\n }\r\n\r\n //case 4: double right\r\n else if (parent.right == node && grandparent.left == parent){\r\n System.out.println(\"[i]: Double Right (LR) Rotation...\");\r\n rotateLeft(parent);\r\n rotateRight(grandparent);\r\n recolor(node);\r\n recolor(grandparent);\r\n }\r\n\r\n }\r\n\r\n }\r\n }\r\n \r\n }", "private Node moveRedRight(Node h) {\n flipColor(h);\n if (isRed(h.left.left)) {\n h = rotateRight(h);\n flipColor(h);\n }\n }", "static void changeRed( Tile x ) {\n tiles.get(start).setBackground(white);\n x.setBackground(red);\n start = tiles.indexOf(x);\n }", "protected void colorChildren(Node node) {\r\n int children = node.getChildren().size();\r\n for (int k = 0; k < children; k++) {\r\n colorObject(\"p\" + node.getChildren().get(k).getId(), edgeHighlightColor);\r\n }\r\n }", "private void adjustDeficientBlackSiblingNode(Node deficientNode, AtomicReference<Node> rootRef) {\n\t\tNode sibling = getSibling(deficientNode);\n if(deficientNode.parent.color == Color.BLACK && sibling.color == Color.BLACK && sibling.left.color == Color.BLACK\n && sibling.right.color == Color.BLACK) {\n \tsibling.color = Color.RED;\n adjustRootDeficiency(deficientNode.parent, rootRef);\n } else {\n adjustRedParentNode(deficientNode, rootRef);\n }\n\t}", "private void fixTree(Node node){\n while(node.parent.color == RED){\n Node uncle = nil;\n if (node.parent == node.parent.parent.left){ // parent is to the left of grandparent\n uncle = node.parent.parent.right;\n \n if (uncle != nil && uncle.color == RED){\n // Toggle colours of parent, uncle, and grandparent.\n // Switch node with grandparent\n node.parent.color = BLACK;\n uncle.color = BLACK;\n node.parent.parent.color = RED;\n node = node.parent.parent;\n continue;\n } \n \n // ****LEFT RIGHT CASE (rotate P left)**** // GB GB\n if (node == node.parent.right){ // PR ==> NR\n node = node.parent; // NR PR\n rotateLeft(node); //\n }\n \n // ****LEFT LEFT CASE (rotate G right)****\n // uncle is nil and color = BLACK, or is // GB P\n // not nil and color still is BLACK // PR ==> N G\n node.parent.color = BLACK; // NR\n node.parent.parent.color = RED;\n rotateRight(node.parent.parent);\n \n } else { //parent is to the right of grand parent\n uncle = node.parent.parent.left;\n \n if (uncle != nil && uncle.color == RED){\n // Toggle colours of parent, uncle, and grandparent.\n // Switch node with grandparent\n node.parent.color = BLACK;\n uncle.color = BLACK;\n node.parent.parent.color = RED;\n node = node.parent.parent;\n continue;\n } \n \n // ****RIGHT LEFT CASE (rotate P right)**** // GB GB\n if (node == node.parent.left){ // PR ==> NR\n node = node.parent; // NR PR\n rotateRight(node); //\n }\n \n // **** RIGHT RIGHT CASE (rotate G left) // GR PB\n node.parent.color = BLACK; // PB ==> GR NR\n node.parent.parent.color = RED; // NR\n rotateLeft(node.parent.parent);\n }\n }\n \n root.color = BLACK;\n }", "public void nodeColor(String str) { setSelected(node_colors, str); }", "public void colorRedLastLevel(Node root,int level){\n\t\tif(level==1){\n\t\t\troot.colour = \"Red\";\n\t\t}else if(level>1){\n\t\t\tcolorRedLastLevel(root.left,level-1);\n\t\t\tcolorRedLastLevel(root.right,level-1);\n\t\t}\n\t\t\n\t}", "private Node moveRedRight(Node h) {\n flipColors(h);\n if (isRed(h.left.left)) {\n h = rotateRight(h);\n flipColors(h);\n }\n return h;\n }", "public boolean isRed(Node n){\n if(n == null)\n return false;\n return n.isColor() == RED;\n }", "public void setColor(java.awt.Color c) {\n treeColor = c;\n createTree();\n }", "private void drawNode(Graphics g, Node n) {\r\n\t\tNode n1 = new Node(3, 5);\r\n\t\tSystem.out.println(\"n.x=\" + n.x + \" n.y=\" + n.y);\r\n\t\tg.fillRect(n1.x * nodeWidth, n1.y * nodeHeight, nodeWidth - 1, nodeHeight - 1);\r\n\t}", "public void RBInsertFixup(Website site) {\r\n\t\tif (site == root) {\t\t\t//catches calling fixup on the root\r\n\t\t\tsite.setIsRed(false);\t//if it is the root, set to black\r\n\t\t} else if (site != root) {\t//iff it is not the root, continue \r\n\t\t\t\r\n\t\t\twhile (site.getParent().getIsRed() == true\r\n\t\t\t\t\t&& site.getParent().getParent() != null) { //while site's parent is red and site's parent's parent is not null\r\n\t\t\t\tif (site.getParent() == site.getParent().getParent().getLeft()) { //z's parent is the left child\r\n\t\t\t\t\tWebsite y = site.getParent().getParent().getRight(); //y is the right uncle\r\n\r\n\t\t\t\t\t//case 1\r\n\t\t\t\t\tif (y != null && y.getIsRed() == true) { \t//if y is not a null, which is counted as black, or if y is red\r\n\t\t\t\t\t\tsite.getParent().setIsRed(false); \t\t//sets site's parent to black\r\n\t\t\t\t\t\tif (site.getParent().getParent() != null) {\t//if it will not cause a null pointer error,\r\n\t\t\t\t\t\t\tsite.getParent().getParent().setIsRed(true); //sets grandparent to red\r\n\t\t\t\t\t\t\tsite=site.getParent().getParent();\t\t\t//sets site to grandparent\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (y != null) { //checks for null pointer exception\r\n\t\t\t\t\t\t\ty.setIsRed(false); //y is black\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t\t//case 2 rotate\r\n\t\t\t\t\telse if (site == site.getParent().getRight()) {\r\n\t\t\t\t\t\tsite = site.getParent();\t//updates site to its parent\r\n\t\t\t\t\t\tleftRotate(root, site);\t\t//roates updated parent\r\n\t\t\t\t\t} else {\t//case 3 rotate\r\n\t\t\t\t\t\tsite.getParent().setIsRed(false);\t\t//parent is black\r\n\t\t\t\t\t\tsite.getParent().getParent().setIsRed(true);\t//grandparent is red\r\n\t\t\t\t\t\trightRotate(root, site.getParent().getParent());\t//rotates to fix tree\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tWebsite y = site.getParent().getParent().getLeft(); //y is the left uncle\r\n\t\t\t\t\t//case 1 simple recoloring\r\n\t\t\t\t\tif (y != null && y.getIsRed() == true) { //if y is not a null, which is counted as black, or if y is red\r\n\t\t\t\t\t\tsite.getParent().setIsRed(false);\t\t//sets site's parent to black\r\n\t\t\t\t\t\tif (site.getParent().getParent() != null) {\t//if it will not cause a null pointer error,\r\n\t\t\t\t\t\t\tsite.getParent().getParent().setIsRed(true); //sets grandparent to red\r\n\t\t\t\t\t\t\tsite=site.getParent().getParent();\t\t\t\t//sets site to grandparent\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (y != null) {\t//checks for null pointer exception\r\n\t\t\t\t\t\t\ty.setIsRed(false);\t//y is black\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t\t\t//case 2 rotate \r\n\t\t\t\t\t\telse if (site == site.getParent().getLeft()) { \r\n\t\t\t\t\t\tsite = site.getParent();\t//update's site to its parent\r\n\t\t\t\t\t\trightRotate(root, site);\t//rotates updated parent\r\n\t\t\t\t\t} \r\n\t\t\t\t\t\t//case 3 rotate\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\tsite.getParent().setIsRed(false);\t//parent is black\r\n\t\t\t\t\t\tsite.getParent().getParent().setIsRed(true);\t//grandparent is red\r\n\t\t\t\t\t\tleftRotate(root, site.getParent().getParent());\t//rotates to fix tree\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif(site==root) { //if site is the root, \r\n\t\t\t\troot.setIsRed(false);\t//sets the root/site to black\r\n\t\t\t\tbreak;\t\t\t\t\t//breaks out of the loop\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\troot.setIsRed(false); //sets root to black just in case\r\n\t}", "private void drawNodes(int x, int y, Node node) {\r\n int yS = node.isMax() ? y : (y + nodeSize);\r\n int yD = node.isMax() ? y + nodeSize : y;\r\n Offset s = new Offset(x, yS, code, \"NE\");\r\n Offset dL = new Offset(x - (nodeSize / 2), yD, code, \"NE\");\r\n Offset dR = new Offset(x + (nodeSize / 2), yD, code, \"NE\");\r\n\r\n TriangleProperties nodeProps = new TriangleProperties();\r\n nodeProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n Triangle tNode = lang.newTriangle(s, dL, dR, node.getId(), null, nodeProps);\r\n tNode.changeColor(\"fillColor\", nodeColor, null, null);\r\n pMap.put(node.getId(), tNode);\r\n if (node.getParent() != null) {\r\n Primitive from = pMap.get(node.getParent().getId());\r\n drawLine(from, tNode, node.getId());\r\n }\r\n if (node.isLeaf()) {\r\n int valLength = String.valueOf(node.getValue()).length();\r\n Offset tO;\r\n if (node.isMax()) {\r\n tO = new Offset(-valLength * 3, -nodeSize / 30, tNode, \"C\");\r\n } else {\r\n tO = new Offset(-valLength * 3, -nodeSize / 3, tNode, \"C\");\r\n }\r\n Text tVal = lang.newText(tO, String.valueOf(node.getValue()), \"tVal\"\r\n + node.getId(), null);\r\n tVal.changeColor(\"\", Color.white, null, null);\r\n pMap.put(\"tVal\" + node.getId(), tVal);\r\n }\r\n }", "public boolean getColor(TreeNode node){\n //null node is BLACK because we cannot have a dangling (incomplete) 2-node (RED)\n if (node == null) return BLACK;\n return node.color;\n }", "private void rotateRight(Node curr, boolean colorChangeNeeded) {\n\t\tNode parent = curr.parent;\n\t\tcurr.parent = parent.parent;\n if(parent.parent != null) {\n if(parent.parent.right == parent) {\n \tparent.parent.right = curr;\n } else {\n \tparent.parent.left = curr;\n }\n }\n Node right = curr.right;\n curr.right = parent;\n parent.parent = curr;\n parent.left = right;\n if(right != null) {\n right.parent = parent;\n }\n if(colorChangeNeeded) {\n curr.color = Color.BLACK;\n parent.color = Color.RED;\n }\n\t}", "public Color getNodeColor(N node, int selectionLevel) {\n\t\treturn adjustColorFill(nodeColor, selectionLevel);\n\t}", "public synchronized void black (int i, int j)\n\t// white move at i,j at the end of the main tree\n\t{\n\t\tif (i < 0 || j < 0 || i >= S || j >= S) return;\n\t\tTreeNode p = T.top();\n\t\twhile (p.haschildren())\n\t\t\tp = p.firstChild();\n\t\tAction a = new Action(\"B\", Field.string(i, j));\n\t\tNode n = new Node(p.node().number() + 1);\n\t\tn.addaction(a);\n\t\tp.addchild(new TreeNode(n));\n\t\tn.main(p);\n\t\tGF.yourMove(Pos != p);\n\t\tif (Pos == p) forward();\n\t\tMainColor = -1;\n\t}", "private void flipColors(Node h) {\n h.color = !h.color;\n h.left.color = !h.left.color;\n h.right.color = !h.right.color;\n }", "protected void addFixup(Node<T> u) {\n\t\twhile (u.colour == red) {\n\t\t\tif (u == r) { // u is the root - done\n\t\t\t\tu.colour = black;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tNode<T> w = u.parent;\n\t\t\tif (w.left.colour == black) { // ensure left-leaning\n\t\t\t\tflipLeft(w);\n\t\t\t\tu = w;\n\t\t\t\tw = u.parent;\n\t\t\t}\n\t\t\tif (w.colour == black)\n\t\t\t\treturn; // no red-red edge = done\n\t\t\tNode<T> g = w.parent; // grandparent of u\n\t\t\tif (g.right.colour == black) {\n\t\t\t\tflipRight(g);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tpushBlack(g);\n\t\t\t\tu = g;\n\t\t\t}\n\t\t}\n\t}", "private void colorNodeLabel(NodeLabelImpl nodeLabel) {\n nodeLabelColorizer.color(nodeLabel);\n }", "public void rankColorByDegree( Color[] colors ) {\r\n\t\tlogger.info( \"Ranking Color of Node by Degree\" );\r\n\r\n\t\tRanking degreeRanking = rankingController.getModel().getRanking( Ranking.NODE_ELEMENT, Ranking.DEGREE_RANKING );\r\n\t\tAbstractColorTransformer colorTransformer = (AbstractColorTransformer) rankingController.getModel().getTransformer( Ranking.NODE_ELEMENT,\r\n\t\t\t\tTransformer.RENDERABLE_COLOR );\r\n\t\tcolorTransformer.setColors( colors );\r\n\t\trankingController.transform( degreeRanking, colorTransformer );\r\n\t}", "public final void visit(Node n)\n {\n colors[n.nodeId()] = Color.grey;\n bfsNumbers[n.nodeId()] = bfsNum++;\n queue.addLast(n);\n visitor.discover(n);\n while(queue.size() > 0) {\n if (visitor.done()) break;\n Node u = queue.removeFirst();\n if (filt != null && filt.filter(u)) continue;\n colors[u.nodeId()] = Color.black;\n visitor.start(u);\n for(Edge e = u.out(); e != null; e = e.next()) {\n if (visitor.done()) break;\n if (filt != null && filt.filter(e)) {\n continue;\n }\n Node v = e.target();\n switch (colors[v.nodeId()])\n {\n case white:\n visitor.treeEdge(e);\n if (visitor.done()) break;\n if (visitor.follow(v)) {\n colors[v.nodeId()] = Color.grey;\n bfsNumbers[v.nodeId()] = bfsNum++;\n queue.addLast(v);\n visitor.discover(v);\n }\n break;\n case grey:\n visitor.queueEdge(e);\n case black:\n visitor.crossEdge(e);\n }\n }\n visitor.finish(u);\n }\n }", "public boolean checkCases(RBNode<T, E> node) {\r\n\t\t// case 1\r\n\t\tif (node.uniqueKey.compareTo(this.root.uniqueKey) == 0) {\r\n\t\t\tnode.color = 'b';\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t// case 2\r\n\t\tif (grandPNode(node).color == 'b') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t// case 3\r\n\t\tif ((node.parent.color == 'r') && (uncleNode(node).color == 'r')) {\r\n\t\t\tnode.parent.color = 'b';\r\n\t\t\tuncleNode(node).color = 'b';\r\n\t\t\tgrandPNode(node).color = 'r';\r\n\t\t\tcheckCases(grandPNode(node));\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t// case 4\r\n\t\tif ((node.parent.color == 'r') && (uncleNode(node).color == 'b')) {\r\n\t\t\tif ((node.uniqueKey.compareTo(node.parent.uniqueKey) > 0)\r\n\t\t\t\t\t&& (node.parent.uniqueKey.compareTo(grandPNode(node).uniqueKey) < 0)) {\r\n\t\t\t\t// must be to the right of parent\r\n\t\t\t\tleftRotate(node.parent);\r\n\t\t\t\tnode = node.parent;\r\n\t\t\t}\r\n\t\t\tif ((node.uniqueKey.compareTo(node.parent.uniqueKey) < 0)\r\n\t\t\t\t\t&& (node.parent.uniqueKey.compareTo(grandPNode(node).uniqueKey) > 0)) {\r\n\t\t\t\trightRotate(node.parent);\r\n\t\t\t\tnode = node.parent;\r\n\t\t\t}\r\n\t\t\t// check case 5\r\n\t\t\tif ((node.parent.color == 'r') && (uncleNode(node).color == 'b')) {\r\n\t\t\t\tif ((node.uniqueKey.compareTo(node.parent.uniqueKey) < 0)\r\n\t\t\t\t\t\t&& (node.parent.uniqueKey.compareTo(grandPNode(node).uniqueKey) < 0)) {\r\n\t\t\t\t\tnode.parent.color = 'r';\r\n\t\t\t\t\trightRotate(grandPNode(node));\r\n\t\t\t\t}\r\n\t\t\t\tif ((node.uniqueKey.compareTo(node.parent.uniqueKey) > 0)\r\n\t\t\t\t\t\t&& (node.parent.uniqueKey.compareTo(grandPNode(node).uniqueKey) > 0)) {\r\n\t\t\t\t\tnode.parent.color = 'b';\r\n\t\t\t\t\tleftRotate(grandPNode(node));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void changeColor (Color color){\n ((Label) _node).setTextFill(color);\n }", "public static int VratiCifru(int n, int red)\n\t{\n\t\tint cifra = 0;\n\t\tfor(int i = 0; i < red; i++)\n\t\t{\n\t\t\tcifra = n % 10;\n\t\t\tn /= 10;\n\t\t}\n\t\treturn cifra;\n\t}", "public boolean isRed(RBNode<T> node) {\n return (node != null)&&(node.color == RED)? true : false;\r\n }", "void setGOLabelTextColor(DREM_Timeiohmm.Treenode treeptr, Color newColor) {\n\t\tif (treeptr != null) {\n\t\t\ttreeptr.goText.setTextPaint(newColor);\n\n\t\t\tfor (int nchild = 0; nchild < treeptr.numchildren; nchild++) {\n\t\t\t\tsetGOLabelTextColor(treeptr.nextptr[nchild], newColor);\n\t\t\t}\n\t\t}\n\t}", "protected void pullBlack(Node<T> u) {\n\t\tu.colour++;\n\t\tu.left.colour--;\n\t\tu.right.colour--;\n\t}", "protected void swapColors(Node<T> u, Node<T> w) {\n\t\tbyte tmp = u.colour;\n\t\tu.colour = w.colour;\n\t\tw.colour = tmp;\n\t}", "private void changeColorDirection(boolean up, Node node) {\n\tGeneration gen;\n\n\tif (up != up_color) {\n\t up_color = up;\n\n\t if (up)\n\t\tgen = manim.firstGeneration();\n\t else\n\t\tgen = manim.lastGeneration();\n\n\t hilitcolor = Color.magenta;\n\t VectorIterator vi = new VectorIterator(gen);\n\t while (vi.hasNext()) {\n\t\tNode n = (Node)(vi.next());\n\t\tif (n.paths_passing > 0) {\n\t\t if (up)\n\t\t\trenderDownPaths(n);\n\t\t else\n\t\t\trenderPath(n);\n\t\t}\n\t }\n\n\t if (up)\n\t\thilitcolor = Color.red;\n\t else\n\t\thilitcolor = Color.blue;\n\t}\n }", "public Node insert(Node n, int key, Object object) throws NodeAlreadyExists {\n if (n == null)\n return (new Node(key, null)); //TODO: Determine what type of object to keep\n else {\n if (n.getKey() == key)\n throw new NodeAlreadyExists();\n\n // Insertion\n if (key < n.getKey()) {\n n.setLeft(insert(n.getLeft(), key, object));\n n.getLeft().setParent(n);\n } //if\n else if (key > n.getKey()) {\n n.setRight(insert(n.getRight(), key, object));\n n.getRight().setParent(n);\n } //else-if\n else {\n return n;\n } //else\n } //else\n\n // Right child is RED but left child is BLACK or doesn't exist\n if(isRed(n.getRight()) && !isRed(n.getLeft())){\n n = leftRotate(n);\n swapColors(n, n.getLeft());\n } //if\n\n // Child and parent are REDs\n if(isRed(n.getLeft()) && isRed(n.getLeft().getLeft())){\n n = rightRotate(n);\n swapColors(n, n.getRight());\n } //if\n\n // Both childs are RED\n if(isRed(n.getLeft()) && isRed(n.getRight())){\n n.setColor(!n.isColor());\n n.getLeft().setColor(BLACK);\n n.getRight().setColor(BLACK);\n } //if\n\n root.setColor(BLACK);\n\n return n;\n }", "protected void pushBlack(Node<T> u) {\n\t\tu.colour--;\n\t\tu.left.colour++;\n\t\tu.right.colour++;\n\t}", "abstract public void colorize(TCell c);", "private Node moveRedLeft(Node h) {\n flipColor(h);\n if (isRed(h.right.left)) {\n h.right = rotateRight(h.right);\n h = rotateLeft(h);\n flipColor(h);\n }\n }", "void setRed(int x, int y, int value);", "protected abstract PixelAsColors applyToPixel(Node n) throws IllegalArgumentException;", "private static <K, V> Node<K, V> colorFlip(Node<K, V> current) {\n Node<K, V> newLeft = current.left.withColor(!current.left.getColor());\n Node<K, V> newRight = current.right.withColor(!current.right.getColor());\n return new Node<>(current.getKey(), current.getValue(), newLeft, newRight, !current.getColor());\n }", "public void rankColorByDegree() {\r\n\t\tthis.rankColorByDegree( new Color[] { new Color( 0xff55d0 ), new Color( 0xB30000 ) } );\r\n\t}", "Node<K, V> withColor(boolean color) {\n if (isRed == color) {\n return this;\n } else {\n return new Node<>(getKey(), getValue(), left, right, color);\n }\n }", "private void remedyDoubleBlack(Position<Entry<K, V>> p) {\n Position<Entry<K, V>> z = parent(p);\n Position<Entry<K, V>> y = sibling(p);\n if (isBlack(y)) {\n if (isRed(left(y)) || isRed(right(y))) { // Case 1: trinode restructuring\n Position<Entry<K, V>> x = (isRed(left(y)) ? left(y) : right(y));\n Position<Entry<K, V>> middle = restructure(x);\n setColor(middle, isRed(z));\n makeBlack(left(middle));\n makeBlack(right(middle));\n } else { // Case 2: recoloring\n makeRed(y);\n if (isRed(z)) {\n makeBlack(z); // problem is resolved\n } else if (!isRoot(z)) {\n remedyDoubleBlack(z); // propagate the problem\n }\n }\n } else { // Case 3: reorient 3-node\n rotate(y);\n makeBlack(y);\n makeRed(z);\n remedyDoubleBlack(p); // restart the process at p\n }\n }", "public static void setNodeBackFixedColor( Color color ) { BACK_FIXED_COLOR = color; }", "private static int changeEven(int colorRed) {\n if (colorRed % 2 != 0)\n --colorRed;\n return colorRed;\n }", "public void fixDelete(Node<E> x) {\n \t\twhile (x != root && x.getColor() == 'B') {\n\n\t\t\tif (x == x.getParent().getLeftChild()) {\n\t\t\t\tNode<E> tempNode = x.getParent().getRightChild();\n\t\t\t\tif (tempNode.getColor() == 'R') {\n\t\t\t\t\t// case 1\n\t\t\t\t\ttempNode.setColor('B');\n\t\t\t\t\tx.getParent().setColor('R');\n\t\t\t\t\tleftRotate(x.getParent());\n\t\t\t\t\ttempNode = x.getParent().getRightChild();\n\t\t\t\t}\n\n\t\t\t\tif (tempNode.getLeftChild().getColor() == 'B' && tempNode.getRightChild().getColor() == 'B') {\n\t\t\t\t\t// case 2\n\t\t\t\t\ttempNode.setColor('R');\n\t\t\t\t\tx = x.getParent();\n\t\t\t\t} else {\n\t\t\t\t\tif (tempNode.getRightChild().getColor() == 'B') {\n\t\t\t\t\t\t// case 3\n\t\t\t\t\t\ttempNode.getLeftChild().setColor('B');\n\t\t\t\t\t\ttempNode.setColor('R');\n\t\t\t\t\t\trightRotate(tempNode);\n\t\t\t\t\t\ttempNode = x.getParent().getRightChild();\n\n\t\t\t\t\t}\n\t\t\t\t\t// case 4\n\t\t\t\t\ttempNode.setColor(x.getParent().getColor());\n\t\t\t\t\tx.getParent().setColor('B');\n\t\t\t\t\ttempNode.getRightChild().setColor('B');\n\t\t\t\t\tleftRotate(x.getParent());\n\t\t\t\t\tx = root;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tNode<E> tempNode = x.getParent().getLeftChild();\n\n\t\t\t\tif (tempNode.getColor() == 'R') {\n\t\t\t\t\ttempNode.setColor('B');\n\t\t\t\t\tx.getParent().setColor('R');\n\t\t\t\t\trightRotate(x.getParent());\n\t\t\t\t\ttempNode = x.getParent().getLeftChild();\n\t\t\t\t}\n\t\t\t\tif (tempNode.getRightChild().getColor() == 'B' && (tempNode.getLeftChild().getColor() == 'B')) {\n\t\t\t\t\ttempNode.setColor('R');\n\t\t\t\t\tx = x.getParent();\n\t\t\t\t} else {\n\t\t\t\t\tif (!(tempNode.getLeftChild().getColor() == 'B')) {\n\t\t\t\t\t\ttempNode.getRightChild().setColor('B');\n\t\t\t\t\t\ttempNode.setColor('R');\n\t\t\t\t\t\tleftRotate(tempNode);\n\t\t\t\t\t\ttempNode = x.getParent().getLeftChild();\n\t\t\t\t\t}\n\n\t\t\t\t\ttempNode.setColor(x.getParent().getColor());\n\t\t\t\t\tx.getParent().setColor('B');\n\t\t\t\t\ttempNode.getLeftChild().setColor('B');\n\t\t\t\t\trightRotate(x.getParent());\n\t\t\t\t\tx = root;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tx.setColor('B');\n }", "protected void\nsetPackedElt( SoNode node, int numColors, \n final IntArray colors)\n{\n\tsetPackedElt(node,numColors,colors, false);\n}", "public void dfs(int[][] image, int r, int c, int color, int newColor) {\n\t\tif (image[r][c] == color) {\n\t\t\timage[r][c] = newColor;\n\t\t\tif (r >= 1) dfs(image, r - 1, c, color, newColor);\n\t\t\tif (r < image.length - 1) dfs(image, r + 1, c, color, newColor);\n\t\t\tif (c >= 1) dfs(image, r, c - 1, color, newColor);\n\t\t\t\n\t\t\t//[[0,0,0][0,0,0]] it is not N*N grid. \n\t\t\tif (c < image[0].length - 1) dfs(image, r, c + 1, color, newColor);\n\t\t}\n\t}", "private Node moveRedLeft(Node h) {\n flipColors(h);\n if (isRed(h.right.left)) {\n h.right = rotateRight(h.right);\n h = rotateLeft(h);\n flipColors(h);\n }\n return h;\n }", "protected void uncolorChildren(Node node) {\r\n int children = node.getChildren().size();\r\n for (int k = 0; k < children; k++) {\r\n colorObject(\"p\" + node.getChildren().get(k).getId(), edgeColor);\r\n }\r\n }", "public void recolor(double nr, double ng, double nb){\n ir = (float)nr;\n ig = (float)ng;\n ib = (float)nb;\n }", "private static <K, V> Node<K, V> makeLeftRed(@Var Node<K, V> current) {\n\n current = colorFlip(current);\n if (Node.isRed(current.right.left)) {\n Node<K, V> newRight = rotateClockwise(current.right);\n current =\n new Node<>(\n current.getKey(), current.getValue(), current.left, newRight, current.getColor());\n\n current = rotateCounterclockwise(current);\n current = colorFlip(current);\n }\n return current;\n }", "public boolean colorOf(RBNode<T> node) {\n return node != null? node.color : BLACK;\r\n }", "public CreateRedBlackTree(int header) \n { \n this.header = new RedBlackNode(header); \n this.header.leftChild = nullNode; \n this.header.rightChild = nullNode; \n }", "public static Node twoSumRegulate(Node n) {\n int len = n.getlength();\n for (int i = 0; i < len; i++) {\n int curpos = len - i - 1;\n int curvalue = n.get(curpos);\n\n if (curvalue > 9) {\n if (curpos == 0) {\n n.set(curpos, curvalue - 10);\n n = n.add(1, 0);\n } else {\n n.set(curpos, curvalue - 10);\n n.set(curpos - 1, n.get(curpos - 1) + 1);\n }\n }\n }\n return n;\n }", "private static void addNodesToLegend(ArrayList<LegendEntry> nodeColors,\n\t\t\tJPanel legend) {\n\t\tlegend.add(new JLabel(\"Nodes\"));\n // System.out.println(\"Adding node header\");\n nodeColors.stream().map((entry) -> {\n \tJLabel next = new JLabel(entry.getLabel(), SwingConstants.CENTER);\n next.setFont(LEGEND_FONT);\n next.setOpaque(true);\n next.setBackground(entry.getColor());\n return next;\n }).forEach((next) -> {\n \tlegend.add(next);\n // System.out.println(\"Adding \" + entry.getLabel());\n });\n\t}", "public void\nsetColorIndexElt( SoNode node, int numIndices, \n int[] indices)\n{\n this.coinstate.colorindexarray = new IntArrayPtr(indices);\n this.coinstate.numdiffuse = numIndices;\n this.coinstate.packeddiffuse = false;\n}", "public Color recupColor(int nb){\r\n\t\tColor color;\r\n\t\tif(nb == 1){\r\n\t\t\tcolor = Config.colorJ1;\r\n\t\t}\r\n\t\telse if(nb == 2){\r\n\t\t\tcolor = Config.colorJ2;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tcolor =\tConfig.colorVide;\r\n\t\t}\r\n\t\treturn color;\r\n\t}", "public void fixViolationDelete(Node node){ \n\t\t\n\t while(node!=root && node.colour==\"Black\"){\n\t if(node==node.parent.left){\n\t \t//if the node is the left child and sibling is in the right\n\t Node sibling=node.parent.right;\n\t //check if the color of sibling is red then exchange the color with parent and rotate left \n\t if(sibling.colour == \"Red\"){\n\t \tsibling.colour = \"Black\";\n\t node.parent.colour = \"Red\";\n\t rotateLeft(node.parent);\n\t sibling=node.parent.right;\n\t }\n\t if(sibling.left.colour==\"Black\" && sibling.right.colour ==\"Black\"){\n\t \t//if both the children of sibling are black, change the color of the sibling and transfer the problem up the parent\n\t \tsibling.colour = \"Red\";\n\t node=node.parent;\n\t }\n\t else{ \n\t if(sibling.right.colour==\"Black\"){\n\t \t//if the left child of the sibling in red exchange the color of the sibling's child with sibling and color the child black\n\t \t// and rotate right\n\t \tsibling.left.colour = \"Black\";\n\t \tsibling.colour = \"Red\";\n\t rotateRight(sibling);\n\t sibling=node.parent.right;\n\t }\n\t //followed my the left rotation\n\t sibling.colour = node.parent.colour;\n\t node.parent.colour = \"Black\";\n\t sibling.right.colour = \"Black\";\n\t rotateLeft(node.parent);\n\t node=root;\n\t }\n\t }\n\t else{\n\t \t//node is the right child of the parent and sibling is the left child\n\t Node sibling=node.parent.left;\n\t \n\t if(sibling.colour == \"Red\"){\n\t \tsibling.colour = \"Black\";\n\t node.parent.colour = \"Red\";\n\t rotateRight(node.parent);\n\t sibling=node.parent.left;\n\t }\n\t \n\t if(sibling.right.colour==\"Black\" && sibling.left.colour==\"Black\"){\n\t \tsibling.colour = \"Red\";\n\t node=node.parent;\n\t }else{\n\t if(sibling.left.colour==\"Black\"){\n\t \tsibling.right.colour= \"Black\";\n\t \tsibling.colour = \"Red\";\n\t rotateLeft(sibling);\n\t sibling=node.parent.left;\n\t }\n\t \n\t sibling.colour = node.parent.colour;\n\t node.parent.colour = \"Black\";\n\t sibling.left.colour = \"Black\";\n\t rotateRight(node.parent);\n\t node=root;\n\t }\n\t }\n\t }\n\t //we color the node black\n\t node.colour = \"Black\";\n\t}", "private void dfsVisitRecursive(Node node, MyArrayList<Node> component) {\n t++;\n node.setD(t);\n node.setColor(Color.GRAY);\n component.add(node);\n for (int i = 0; i < node.getAdjacencyList().size(); i++) {\n Node u = node.getAdjacencyList().get(i);\n if (u.getColor() == Color.WHITE) {\n u.setParent(node);\n this.dfsVisitRecursive(u, component);\n }\n }\n node.setColor(Color.BLACK);\n t++;\n node.setF(t);\n }", "private void displayTree(Node<Integer> n, double xCord, double yCord, double horizontalGap, double verticalGap,double treeHeight, String key, Color color){\r\n // base condition \r\n if(n == null)\r\n return;\r\n // recursive call to left sub-tree\r\n displayTree(n.getLeftNode(),xCord-horizontalGap,yCord+verticalGap, horizontalGap/3, verticalGap+1*treeHeight,treeHeight, key, color);\r\n // recursive call to middle sub-tree\r\n if(n.getRightElement() != null)\r\n displayTree(n.getMidNode(),xCord+25,yCord+verticalGap, horizontalGap/3, verticalGap+1*treeHeight,treeHeight, key, color);\r\n else\r\n displayTree(n.getMidNode(),xCord+horizontalGap,yCord+verticalGap, horizontalGap/3,verticalGap+1*treeHeight,treeHeight, key, color);\r\n // recursive call to right sub-tree\r\n displayTree(n.getRightNode(),xCord+horizontalGap,yCord+verticalGap, horizontalGap/3,verticalGap+1*treeHeight,treeHeight, key, color);\r\n // draw single square node\r\n if(n.is2Node()){\r\n if(n.getLeftElement() != null)\r\n draw2Node(n.getLeftElement().toString(),xCord,yCord,n.isLeaf(), horizontalGap, verticalGap, key, color);\r\n }\r\n // draw double square node\r\n if(n.is3Node()){\r\n draw3Node(n.getLeftElement().toString(),n.getRightElement().toString(),xCord,yCord,n.isLeaf(),horizontalGap,verticalGap, key, color);\r\n }\r\n }" ]
[ "0.66944623", "0.66878843", "0.64099795", "0.6337949", "0.6324104", "0.63223314", "0.63033843", "0.63009995", "0.6188398", "0.61742276", "0.61663", "0.6158383", "0.6147727", "0.61450285", "0.6138997", "0.6100422", "0.5982218", "0.5964219", "0.59418285", "0.5924245", "0.59146774", "0.58791393", "0.5828677", "0.58260417", "0.58155215", "0.5805062", "0.57968426", "0.5783224", "0.5767133", "0.5757864", "0.57130575", "0.5712875", "0.56977206", "0.56829923", "0.56785387", "0.5674522", "0.5666813", "0.56479114", "0.56036824", "0.5590014", "0.5567369", "0.5564371", "0.55574435", "0.55163234", "0.55157197", "0.5503543", "0.5484332", "0.5480115", "0.54772544", "0.5462095", "0.54583776", "0.54549634", "0.5406251", "0.5401115", "0.5397003", "0.539684", "0.53957427", "0.5388872", "0.5367834", "0.5349311", "0.5346445", "0.5316286", "0.53068906", "0.5296655", "0.5284949", "0.5280024", "0.52778804", "0.527304", "0.5273037", "0.52726436", "0.5267171", "0.5255674", "0.525296", "0.52431947", "0.5239559", "0.5238961", "0.523462", "0.52320474", "0.5230329", "0.52149206", "0.52130973", "0.52052915", "0.5204942", "0.5202862", "0.5191463", "0.51892054", "0.51876277", "0.5158507", "0.5150733", "0.51452786", "0.5140935", "0.5138172", "0.5133215", "0.5118117", "0.51158667", "0.5103722", "0.5097841", "0.5073283", "0.5067357", "0.5066588" ]
0.6633311
2
Takes a node n and rotates it to the left moving nodes around it.
public void leftRotate(Node n) { Node y = n.right; n.right = y.left; if(!y.left.isNil) y.left.parent = n; y.parent = n.parent; if(n.parent.isNil) root = y; else if(n == n.parent.left) n.parent.left = y; else n.parent.right = y; y.left = n; n.parent = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private long leftRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentRight = current.right;\r\n Node tempN = new Node(current.right);\r\n current.right = tempN.left;\r\n tempN.left = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentRight);\r\n return currentRight;\r\n }", "public Node rotateLeft(Node n)\r\n\t{\r\n\t\tNode target = n.right;//rotate target to node\r\n\t\tNode subTree = target.left;//get its subtree\r\n\t\t\r\n\t\ttarget.left = n;//set targets old sub tree to nodes sub tree\r\n\t\tn.right = subTree;// set old sub tree to nodes subtree\r\n\t\t\r\n\t\t//increment the height of the tree\r\n\t\tn.height = maxHeight(height(n.left),height(n.right))+1;\r\n\t\ttarget.height = maxHeight(height(target.left),height(target.right))+1;\r\n\t\t\r\n\t\treturn target;\r\n\t}", "protected void rotateLeft(BSTNode n) {\n\n\t\tassert (n != null);\n\n\t\tBSTNode pv = n.right;\n\t\tassert (pv != null);\n\n\t\t// promote pv\n\t\tpv.parent = n.parent;\n\n\t\tif (n.parent == null) {\n\t\t\tif (n == _root) {\n\t\t\t\t_root = pv;\n\t\t\t} else {\n\t\t\t\t// do nothing, pv has no parent to notify\n\t\t\t}\n\t\t} else {\n\t\t\tsetParentReference(n, pv);\n\t\t}\n\n\t\t// move pv's left subtree over to n's right\n\t\tn.right = pv.left;\n\t\tif (n.right != null)\n\t\t\tn.right.parent = n;\n\n\t\t// move n to be the left child of pv\n\t\tpv.left = n;\n\t\tn.parent = pv;\n\n\t\t_stats.incRotations();\n\n\t\t/*\n\t\t * Fixup other tree stats\n\t\t */\n\n\t\tn.size = 1 + (n.left != null ? n.left.size : 0)\n\t\t\t\t+ (n.right != null ? n.right.size : 0);\n\n\t\tpv.size = 1 + n.size + (pv.right != null ? pv.right.size : 0);\n\t}", "private void singleRotateLeft(Node n) {\n Node r = n.mRight, rl = r.mLeft, p = n.mParent;\n n.mRight = rl;\n rl.mParent = n;\n r.mLeft = n;\n if (n == mRoot) {\n mRoot = r;\n r.mParent = null;\n }\n else if (p.mRight == n) {\n p.mRight = r;\n r.mParent = p;\n }\n else {\n p.mLeft = r;\n r.mParent = p;\n }\n n.mParent = r;\n }", "private long rightRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentLeft = current.left;\r\n Node tempN = new Node(current.left);\r\n current.left = tempN.right;\r\n tempN.right = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentLeft);\r\n return currentLeft;\r\n }", "public Node<T> leftRotate(Node<T> node){\n\n Node<T> temp = node.right;//a temporary pointer set to the node's right child\n node.right = temp.left;// the node right child set to the left child\n temp.left = node;//temporary pointer left child set to the node who is rotating\n return temp;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n == 0 || head == null) {\r\n return head;\r\n } \r\n ListNode curr = head;\r\n int length = 0;\r\n while(curr!=null) {\r\n length++;\r\n curr = curr.next;\r\n }\r\n n = n % length;\r\n //skip the zero\r\n if(n == 0) {\r\n return head;\r\n }\r\n //do the rotating\r\n ListNode newHead = new ListNode(-1);\r\n newHead.next = head;\r\n \r\n int step = length - n;\r\n curr = newHead;\r\n for(int i = 0; i < step; i++) {\r\n curr = curr.next;\r\n }\r\n \r\n //be aware need to break the loop\r\n ListNode tmp = curr.next;\r\n curr.next = null;\r\n curr = tmp;\r\n \r\n newHead.next = curr;\r\n while(curr.next != null) {\r\n curr = curr.next;\r\n }\r\n curr.next = head;\r\n \r\n return newHead.next;\r\n }", "public ListNode rotateRight(ListNode head, int n) {\n \n int len = 0;\n \n if (head == null) return head;\n \n ListNode node = head;\n ListNode prev = head;\n \n while (node != null) {\n prev = node;\n node = node.next;\n len++;\n }\n \n n = n % len;\n \n if (n == 0) return head;\n \n int current = 1;\n \n prev.next = head;\n \n node = head;\n \n while (current < len - n) {\n node = node.next;\n current++;\n }\n \n prev = node.next;\n node.next = null;\n \n return prev;\n }", "public void rotateLeft(Node node){\n\t\tNode ptrRight = node.right;\n\t\tnode.right = ptrRight.left;\n\t\t\n\t\tif(ptrRight.left != nil){\n\t\t\tptrRight.left.parent = node;\n\t\t}\n\t\tptrRight.parent = node.parent;\n\t\t\n\t\tif(node.parent==nil){\n\t\t\troot = ptrRight;\n\t\t}else if( node == node.parent.left){\n\t\t\tnode.parent.left = ptrRight;\n\t\t}else{\n\t\t\tnode.parent.right = ptrRight;\n\t\t}\n\t\t\n\t\tptrRight.left = node;\n\t\tnode.parent = ptrRight;\n\t}", "private AVLNode<T> rotateLeft(AVLNode<T> node) {\n AVLNode<T> substitute = node.right;\n // donde ponemos los hijos a la izquierda del substituto\n node.right = substitute.left;\n substitute.left = node;\n\n return substitute;\n }", "private Node rotateLeft() {\n Node right = this.rightChild;\n this.rightChild = right.leftChild;\n right.leftChild = this;\n\n this.updateHeight();\n right.updateHeight();\n\n return right;\n }", "public void leftRotate(Node<E> x){\n \n \t/*\n If x is the root of the tree to rotate with left child subtree T1 and right child y, \n where T2 and T3 are the left and right children of y:\n x becomes left child of y and T3 as its right child of y\n T1 becomes left child of x and T2 becomes right child of x\n */\n\t\tNode<E> y = x.getRightChild(); //set y\n\t\tx.setRightChild(y.getLeftChild()); //turn y's subtree into x's right subtree\n\t\ty.getLeftChild().setParent(x);\n\t\ty.setParent(x.getParent());\n\t\tif (x.getParent() == sentinel || x.getParent() == null) {\n\t\t\troot = y;\n\t\t} else if (x == x.getParent().getLeftChild()) { //link x's parent to y\n\t\t\tx.getParent().setLeftChild(y);\n\t\t} else {\n\t\t\tx.getParent().setRightChild(y);\n\t\t}\n\t\ty.setLeftChild(x); //put x on y's left\n\t\tx.setParent(y);\n\t\n }", "public Node rotateleft(Node x) {\n Node y = x.right;\n Node z = y.left;\n\n // Perform rotation\n y.left = x;\n x.right = z;\n\n // Update heights\n x.height = max(height(x.left), height(x.right)) + 1;\n y.height = max(height(y.left), height(y.right)) + 1;\n\n return y;\n }", "protected RedBlackNode<T> rotateLeft(RedBlackNode<T> node) {\n RedBlackNode<T> rightNode = node.getRightChild();\n RedBlackNode<T> parent = node.getParent();\n rightNode._parent = node.getParent();\n node._rightChild = rightNode.getLeftChild();\n if (node._rightChild != null ) {\n node._rightChild._parent = node;\n } \n rightNode._leftChild = node; \n node._parent = rightNode;\n // node had parent.\n if(parent != null) {\n // node was left child\n if(parent._leftChild == node) {\n parent._leftChild = rightNode;\n } else {\n // node was right child\n parent._rightChild = rightNode;\n }\n } else {\n // node was head\n _head = rightNode;\n }\n return rightNode;\n }", "public Node<T> leftRightRotate(Node<T> node){\n\n node.left = leftRotate(node.left);//rotate the parent to the left\n return leftRotate(node);// rotate the grandparent to the right\n }", "private BinaryNode<AnyType> rotateLeft1(BinaryNode<AnyType>t, AnyType x)\r\n\t{\r\n\t\tBinaryNode<AnyType> no=find(t,x);\r\n\t\tBinaryNode<AnyType> parno=findParentNode(t,x);\r\n\r\n\t\tif(no==parno)\r\n\t\t{\r\n\t\t BinaryNode temp1=parno.left;\r\n\t\t BinaryNode temp2=parno.right;\r\n\t\t BinaryNode temp3=parno.right.left;\r\n\t\t parno.left=null;\r\n\t\t parno.right=null;\r\n\t\t temp2.left=null;\r\n\t\t root=temp2;\r\n\t\t root.left=parno;\r\n\t\t root.left.right=temp3;\r\n\t\t root.left.left=temp1;\r\n\t\t}\r\n\r\n\t\t\r\n\t\tif(no.element.compareTo(parno.element)<0)\r\n\t\t{\r\n\t\t\tBinaryNode temp=parno.left;\r\n\t\t\tparno.left=no.right;\r\n\t\t\ttemp.right=null;\r\n\t\t\tBinaryNode templ=parno.left.left;\r\n\t\t\tparno.left.left=temp;\r\n\t\t\tparno.left.left.right=templ;\r\n\t\t}\r\n\t\t\r\n\t\tif(no.element.compareTo(parno.element)>0)\r\n\t\t{\r\n\t\t\tBinaryNode temp=parno.right;\r\n\t\t\tparno.right=no.right;\r\n\t\t\ttemp.right=null;\r\n\t\t\tBinaryNode templ=parno.right.left;\r\n\t\t\tparno.right.left=temp;\r\n\t\t\tparno.right.left.right=templ;\r\n\t\t}\r\n\t\treturn t;\r\n\t}", "public Node<T> rightLeftRotate(Node<T> node){\n\n node.right = rightRotate(node.right);//rotate the parent to the right\n return leftRotate(node);// rotate the grandparent to the left\n }", "public ListNode rotateKplace(ListNode head, int n) {\n if (head == null) return head;\n\n int len = getLen(head);\n int half = n % len;\n if (half == 0) return head;\n\n int index = len - half; // index to rotate\n ListNode curr = head;\n\n for (int i = 0; i < index - 1; i++) {\n curr = curr.next;\n } // curr is last node before rotate\n\n ListNode h1 = curr.next;\n curr.next = null;\n\n ListNode tail = h1;\n while (tail.next != null) {\n tail = tail.next;\n }\n tail.next = head;\n return h1;\n }", "Node leftRotate(Node x) \n { \n Node y = x.right; \n Node T2 = y.left; \n\n // Perform rotation \n y.left = x; \n x.right = T2; \n\n // Update heights \n x.height = Math.max(height(x.left), height(x.right)) + 1; \n y.height = Math.max(height(y.left), height(y.right)) + 1; \n\n // Return new root \n return y; \n }", "private void singleRotateRight(Node n) {\n Node l = n.mLeft, lr = l.mRight, p = n.mParent;\n n.mLeft = lr;\n lr.mParent = n;\n l.mRight = n;\n if (n == mRoot) {\n mRoot = l;\n l.mParent = null;\n }\n else if (p.mLeft == n) {\n p.mLeft = l;\n l.mParent = p;\n }\n else {\n p.mRight = l;\n l.mParent = p;\n }\n n.mParent = l;\n }", "Node leftRotate(Node x) \n { \n Node y = x.right; \n Node T2 = y.left; \n \n // Perform rotation \n y.left = x; \n x.right = T2; \n \n // Update heights \n x.height = max(height(x.left), height(x.right)) + 1; \n y.height = max(height(y.left), height(y.right)) + 1; \n \n // Return new root \n return y; \n }", "Node leftRotate(Node x) { \n Node y = x.right; \n Node T2 = y.left; \n \n // Perform rotation \n y.left = x; \n x.right = T2; \n \n // Update heights \n x.height = maxInt(heightBST(x.left), heightBST(x.right)) + 1; \n y.height = maxInt(heightBST(y.left), heightBST(y.right)) + 1; \n \n // Return new root \n return y; \n }", "public Node rotateRight(Node n)\r\n\t{\r\n\t\tNode target = n.left;//rotate target to node\r\n\t\tNode subTree = target.right;//get its subtree\r\n\t\t\r\n\t\ttarget.right = n; //set targets old sub tree to nodes sub tree\r\n\t\tn.left =subTree;// set old sub tree to nodes subtree\r\n\t\t\r\n\t\t//increment the height of the tree\r\n\t\tn.height = maxHeight(height(n.left),height(n.right))+1;\r\n\t\ttarget.height = maxHeight(height(target.left),height(target.right))+1;\r\n\t\t\r\n\t\treturn target;\r\n\t}", "public static int[] rotateLeft(int[] array, int n) {\n\t\tif(n >= array.length) {\n\t\t\tn = n % array.length; \n\t\t}\n\t\t\n\t\tfor(int i = 0; i < n; ++i) {\n\t\t\t//hold the first element\n\t\t\tint placeholder = array[0];\n\t\t\tfor(int j = 0; j < array.length - 1; ++j) {\n\t\t\t\tarray[j] = array[j + 1];\n\t\t\t}\n\t\t\t//replace last element with first\n\t\t\tarray[array.length - 1] = placeholder;\n\t\t}\n\t\treturn array;\n\t}", "Node leftRotate(Node x) {\n Node y = x.right;\n Node T2 = y.left;\n\n // Perform rotation\n y.left = x;\n x.right = T2;\n\n // Update heights\n x.height = max(height(x.left), height(x.right)) + 1;\n y.height = max(height(y.left), height(y.right)) + 1;\n\n // Return new root\n return y;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(head==null)\n return null;\n ListNode p2=head;\n ListNode p1=head;\n ListNode newhead=head;\n int count=0;\n \n if(n==0)\n return head;\n \n for(int i=0;i<n;i++)\n {\n p1=p1.next;\n count++;\n if(p1==null)\n break;\n }\n \n if(count==1&&p1==null)\n return head;\n \n if(p1==null)\n {\n p1=head;\n n=n%count;\n if(n==0)\n return head;\n for(int i=0;i<n;i++)\n {\n p1=p1.next; \n }\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n tail=tail.next;\n tail.next=head;\n p2.next=null;\n }\n else\n {\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n {\n tail=tail.next;\n }\n tail.next=head;\n p2.next=null;\n }\n \n return newhead;\n }", "public ListNode rotateRight(ListNode head, int n) {\n \n if (head == null || head.next == null)\n return head;\n int i = 0;\n ListNode tail = head;\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode pre = dummy;\n \n // get the length of the list\n int len = 0;\n while (head != null){\n head = head.next;\n len ++;\n if (head != null)\n tail = head;\n }\n head = dummy.next;\n if (n%len == 0)\n\t\t return dummy.next;\n\t n = len - n%len;\n\t ListNode cur = dummy.next;\n while (i < n){\n pre = cur;\n cur = cur.next;\n i++;\n }\n dummy.next = cur;\n tail.next = head;\n pre.next = null;\n return dummy.next;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n==0||head==null)\n return head;\n ListNode fast=head;\n ListNode slow=head;\n ListNode res=new ListNode(0);\n res.next=head;\n \n int count=0;\n for(int i=0;i<n;i++){\n if(fast==null){\n break; \n }else{\n count++;\n fast=fast.next;\n }\n }\n \n if(fast==null)\n return rotateRight(head,n%count);\n \n while(fast.next!=null){\n fast=fast.next;\n slow=slow.next;\n }\n \n ListNode b=slow.next;\n \n res.next=b;\n slow.next=null;\n fast.next=head;\n \n return res.next;\n }", "public void rightRotate(Node n) {\r\n\t\tNode y = n.left;\r\n\t\tn.left = y.right;\r\n\t\tif(!y.right.isNil)\r\n\t\t\ty.right.parent = n;\r\n\t\ty.parent = n.parent;\r\n\t\tif(n.parent.isNil)\r\n\t\t\troot = y;\r\n\t\telse if(n == n.parent.right)\r\n\t\t\tn.parent.right = y;\r\n\t\telse\r\n\t\t\tn.parent.left = y;\r\n\t\ty.right = n;\r\n\t\tn.parent = y;\r\n\t}", "Node leftRotate(Node x)\n\t\t{\n\t\t\tNode y=x.right;\n\t\t\tNode T2=y.left;\n\t\t\t\n\t\t\t//rotate\n\t\t\t\n\t\t\ty.left=x;\n\t\t\tx.right=T2;\n\t\t\t\n\t\t\t//update heights\n\t\t\ty.height=max(height(y.left),height(y.left) +1 ) ;\n\t\t\tx.height=max(height(x.left),height(x.left) +1 ) ;\n\t\t\t\n\t\t\t// new root\n\t\t\treturn y;\n\t\t}", "private Node leftRotate(Node a) {\n Node b = a.getRightChild();\n Node n2 = b.getLeftChild();\n b.setLeftChild(a);\n a.setRightChild(n2);\n setHeights(a, b);\n return b;\n }", "private RedBlackNode rotationWithLeftChild(RedBlackNode node2) \n { \n RedBlackNode node1 = node2.leftChild; \n node2.leftChild = node1.rightChild; \n node1.rightChild = node2; \n return node1; \n }", "void leftRotate(Node<K, V> x) {\n\t\tassert IsNotNil(x.getRight());\n\t\tNode<K, V> y = x.getRight();\n\n\t\t// B in position\n\t\tx.setRight(y.getLeft());\n\n\t\t// Y to root\n\t\tif (x == root) {\n\t\t\troot = y;\n\t\t} else if (x.isLeftChild()) {\n\t\t\tx.getParent().setLeft(y);\n\t\t} else if (x.isRightChild()) {\n\t\t\tx.getParent().setRight(y);\n\t\t}\n\n\t\t// x in position\n\t\ty.setLeft(x);\n\t}", "@Override\r\n\tpublic void rotateLeft() {\n\t\tsetDirection((this.getDirection() + 3) % 4);\r\n\t}", "public ListNode rotateRight(ListNode head, int n) {\r\n\t\t// Note: The Solution object is instantiated only once and is reused by\r\n\t\t// each test case.\r\n\t\tif (null == head) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tListNode p = head;\r\n\t\tint length = 0;\r\n\t\twhile (null != p) {\r\n\t\t\tp = p.next;\r\n\t\t\tlength++;\r\n\t\t}\r\n\t\tif (n % length == 0) {\r\n\t\t\treturn head;\r\n\t\t} else {\r\n\t\t\tn = n % length;\r\n\t\t}\r\n\t\tint num = n;\r\n\t\tListNode first = head;\r\n\t\tListNode second = head;\r\n\t\twhile (num > 0) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tnum--;\r\n\t\t}\r\n\r\n\t\twhile (null != first.next) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tsecond = second.next;\r\n\t\t}\r\n\r\n\t\tListNode newHead = second.next;\r\n\t\tsecond.next = null;\r\n\t\tfirst.next = head;\r\n\t\treturn newHead;\r\n\t}", "public void rotate(int n) {\n\t\t\twhile(n > 0) {\n\t\t\t\tthis.data = rotateGrid(data);\n\t\t\t\tn--;\n\t\t\t}\n\t\t\tcomputeHashes();\n\t\t}", "public void leftRotate(RBNode<T, E> node) {\r\n\t\t// Keep Track of the root and the pivot and roots parent\r\n\t\tRBNode<T, E> root = node;\r\n\t\tRBNode<T, E> pivot = node.rightChild;\r\n\t\tRBNode<T, E> rParent = root.parent;\r\n\t\t// If pivot is not null, then proceed to rotate\r\n\t\tif (pivot != nillLeaf) {\r\n\t\t\t// do this if root has a parent\r\n\t\t\tif (rParent != nillLeaf) {\r\n\t\t\t\t// if root is going left to the root's parent, then set pivot to\r\n\t\t\t\t// left of the root.\r\n\t\t\t\tif (root.uniqueKey.compareTo(rParent.uniqueKey) < 0) {\r\n\t\t\t\t\t// root must be on the left of parent\r\n\t\t\t\t\troot.rightChild = pivot.leftChild;\r\n\t\t\t\t\tpivot.leftChild.parent = root;\r\n\t\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\t\trParent.leftChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\r\n\t\t\t\t}\r\n\t\t\t\t// if root is going right of root's parent, then set pivot to\r\n\t\t\t\t// right of the root.\r\n\t\t\t\telse if (root.uniqueKey.compareTo(rParent.uniqueKey) > 0) {\r\n\t\t\t\t\t// root must be on the right of the parent.\r\n\t\t\t\t\troot.rightChild = pivot.leftChild;\r\n\t\t\t\t\tpivot.leftChild.parent = root;\r\n\t\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\t\trParent.rightChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// else if root has no parent, then rotate with no parent.\r\n\t\t\telse {\r\n\t\t\t\troot.rightChild = pivot.leftChild;\r\n\t\t\t\tpivot.leftChild.parent = root;\r\n\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\troot.parent = pivot;\r\n\t\t\t\tthis.root = pivot;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void rotateLeft() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir - THETA);\r\n\t\t\r\n\t}", "public void splay(SplayNode n) {\n\t\t while(n.parent != null) { //node is not root\n\t\t if(n.parent == this.root) { //node is child of root, one rotation\n\t\t if(n == n.parent.left) {\n\t\t this.rightRotate(n.parent);\n\t\t }\n\t\t else {\n\t\t this.leftRotate(n.parent);\n\t\t }\n\t\t }\n\t\t else {\n\t\t \t SplayNode p = n.parent;\n\t\t \t SplayNode g = p.parent; //grandparent\n\n\t\t if(n.parent.left == n && p.parent.left == p) { //both are left children\n\t\t this.rightRotate(g);\n\t\t this.rightRotate(p);\n\t\t }\n\t\t else if(n.parent.right == n && p.parent.right == p) { //both are right children\n\t\t this.leftRotate(g);\n\t\t this.leftRotate(p);\n\t\t }\n\t\t else if(n.parent.right == n && p.parent.left == p) {\n\t\t this.leftRotate(p);\n\t\t this.rightRotate(g);\n\t\t }\n\t\t else if(n.parent.left == n && p.parent.right == p) {\n\t\t this.rightRotate(p);\n\t\t this.leftRotate(g);\n\t\t }\n\t\t }\n\t\t }\n\t\t }", "public void leftRotate(SplayNode x) {\n\t\t\t SplayNode y = x.right;\n\t\t x.right = y.left;\n\t\t if(y.left != null) {\n\t\t y.left.parent = x;\n\t\t }\n\t\t y.parent = x.parent;\n\t\t if(x.parent == null) { //x is root\n\t\t this.root = y;\n\t\t }\n\t\t else if(x == x.parent.left) { //x is left child\n\t\t x.parent.left = y;\n\t\t }\n\t\t else { //x is right child\n\t\t x.parent.right = y;\n\t\t }\n\t\t y.left = x;\n\t\t x.parent = y;\n\t\t }", "protected Node<E> rotateLeft(Node<E> root) {\r\n\t\tNode<E> temp = root.right;\r\n\t\troot.right = temp.left;\r\n\t\ttemp.left = root;\r\n\t\treturn temp;\t\r\n\t}", "private NodeRB<K, V> rotateLeft(NodeRB<K, V> x) {\n\t\tNodeRB<K, V> xParent = x.parent;\n\n\t\tNodeRB<K, V> y = x.right;\n\t\tx.right = y.left;\n\t\ty.left = x;\n\n\t\t// Parents relations fix\n\t\tif (xParent != null) {\n\t\t\tif (x.isLeftChild()) {\n\t\t\t\txParent.left = y;\n\t\t\t} else {\n\t\t\t\txParent.right = y;\n\t\t\t}\n\t\t}\n\n\t\tx.parent = y;\n\t\ty.parent = xParent;\n\t\tif (x.right != null) {\n\t\t\tx.right.parent = x;\n\t\t}\n\n\t\tx.height = 1 + Math.max(height(x.left), height(x.right));\n\t\ty.height = 1 + Math.max(height(y.left), height(y.right));\n\t\treturn y;\n\t}", "private void leftRotate(RedBlackNode<T> x){\n leftRotateFixup(x);\n\n RedBlackNode<T> y;\n y = x.right;\n x.right = y.left;\n\n // czy istnieje y.left i zamiana referencji\n if (!isNil(y.left))\n y.left.parent = x;\n y.parent = x.parent;\n\n // x.parent jest nil\n if (isNil(x.parent))\n root = y;\n\n // x jest lewym dzieckiem swojego rodzica\n else if (x.parent.left == x)\n x.parent.left = y;\n\n //x jest prawym dzieckiem swojego rodzica\n else\n x.parent.right = y;\n\n y.left = x;\n x.parent = y;\n }", "public Node<T> rightRotate(Node<T> node){\n\n Node<T> temp = node.left;//pointer set to the nodes left child\n node.left = temp.right;//node.left set to the right child\n temp.right = node;//temp.right equal to the node that is rotating\n return temp;\n }", "private Node rotateLeft(Node h) {\n Node x = h.right;\n h.right = x.left;\n x.left = h;\n x.color = x.left.color;\n x.left.color = RED;\n x.size = h.size;\n h.size = size(h.left) + size(h.right) + 1;\n return x;\n }", "private void rotateLeft(RedBlackNode x){\n\t RedBlackNode xParent = x.parent;\n\t RedBlackNode y = x.right;\n\t RedBlackNode BSubTree = y.left;\n\t y.left = x;\n\t x.parent = y;\n\t x.right = BSubTree;\n\t //analyse whether need to have Nil check in this code\n\t BSubTree.parent = x;\n\t if(xParent == this.Nil){\n\t\t this.root = y;\n\t\t y.parent = this.Nil;\n\t }else if(xParent.left == x){\n\t\t xParent.left = y;\n\t\t y.parent = xParent;\n\t }else{\n\t\t xParent.right = y;\n\t\t y.parent = xParent;\n\t }\n\t \n }", "public static String moveLeft(int n) {\n return CSI + n + \"D\";\n }", "static void leftRotate(int arr[], int d, int n) \n\t{\n\t\tint i, j;\n\t\tif (d == 0 || d == n)\n\t\t\treturn;\n\t\ti = d;\n\t\tj = n - d;\n\t\twhile (i != j) {\n\t\t\tif (i < j) /* A is shorter */\n\t\t\t{\n\t\t\t\tswap(arr, d - i, d + j - i, i);\n\t\t\t\tj -= i;\n\t\t\t} else /* B is shorter */\n\t\t\t{\n\t\t\t\tswap(arr, d - i, d, j);\n\t\t\t\ti -= j;\n\t\t\t}\n\t\t\t// printArray(arr, 7);\n\t\t}\n\t\t/* Finally, block swap A and B */\n\t\tswap(arr, d - i, d, i);\n\t}", "public abstract void rotateLeft();", "private BTNode<T> rotateLeft(BTNode<T> p){\n BTNode<T> q = p.getRight();\n p.setRight(q.getLeft());\n q.setLeft(p);\n fixHeight(q);\n fixHeight(p);\n return q;\n }", "public ListNode rotateLeft(ListNode head, int k) {\r\n\t\tif (k <= 0) return head;\r\n\t\tListNode curr = head;\r\n\t\tint count = 1;\r\n\t\twhile (count++ < k && curr != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tif (curr == null) return head;\r\n\t\tListNode nextHead = curr;\r\n\t\twhile (curr.next != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tcurr.next = head;\r\n\t\thead = nextHead.next;\r\n\t\tnextHead.next = null;\r\n\t\treturn head;\r\n\t}", "private void doubleRotateleft(WAVLNode x) {\n\t WAVLNode z=x.right;\r\n\t leftRotate(z);\r\n\t z.rank+=1;\r\n\t rightRotate(z);\r\n }", "private BinaryNode<AnyType> rotateRight1(BinaryNode<AnyType>t, AnyType x)\r\n\t{\r\n\t\tBinaryNode<AnyType> no=find(t,x);\r\n\t\tBinaryNode<AnyType> parno=findParentNode(t,x);\r\n\r\n\t\tif(no==parno)\r\n\t\t{\r\n\t\t\tBinaryNode temp1=parno.left;\r\n\t\t BinaryNode temp2=parno.right;\r\n\t\t BinaryNode temp3=parno.left.right;\r\n\t\t parno.left=null;\r\n\t\t parno.right=null;\r\n\t\t temp1.right=null;\r\n\t\t root=temp1;\r\n\t\t root.right=parno;\r\n\t\t root.right.left=temp3;\r\n\t\t root.right.right=temp2;\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif(no.element.compareTo(parno.element)<0)\r\n\t\t{\r\n\t\t\tBinaryNode temp = parno.left;\r\n\t\t\tparno.left=no.left;\r\n\t\t\ttemp.left=null;\r\n\t\t\tBinaryNode tempr=parno.left.right;\r\n\t\t\tparno.left.right=temp;\r\n\t\t\tparno.left.right.left=tempr;\r\n\t\t}\r\n\r\n\t\tif(no.element.compareTo(parno.element)>0)\r\n\t\t{\r\n\t\t\tBinaryNode temp = parno.right;\t\t\r\n\t\t\tparno.right=no.left;\r\n\t\t\ttemp.left=null;\r\n\t\t\tBinaryNode tempr=parno.right.right;\r\n\t\t\tparno.right.right=temp;\r\n\t\t\tparno.right.right.left=tempr;\r\n\r\n\t\t}\r\n\t\treturn t;\r\n\t}", "public static int rotate_left (int d) {\n\t\treturn d == 0 ? 3 : d - 1;\n\t}", "private Node rotateLeft(Node h){\n\n\t\tNode x = h.right;\n\t\th.right = x.left;\n\t\tx.left = h;\n\t\tx.color = h.color;\n\t\th.color = RED;\n\t\treturn x;\n\t}", "private Node<T> rotateWithLeft(Node<T> b) {\n Node<T> a = b.getLeft();\n b.setLeft(a.getRight());\n a.setRight(b);\n int bH = Math.max(findHeight(b.getLeft()),\n findHeight(b.getRight())) + 1;\n b.setHeight(bH);\n int aH = Math.max(findHeight(a.getLeft()), bH) + 1;\n a.setHeight(aH);\n hAndBF(a);\n hAndBF(b);\n return a;\n }", "public AVLNode rotateLeft(AVLNode x) {\n AVLNode y = x.getRight();\n AVLNode T2 = y.getLeft();\n \n //rotation\n y.setLeft(x);\n x.setRight(T2);\n \n //update heights\n x.setHeight(Math.max(getHeight(x.getLeft()), getHeight(x.getRight())) + 1);\n y.setHeight(Math.max(getHeight(y.getLeft()), getHeight(y.getRight())) + 1);\n \n return y;\n }", "private void rebalanceLeft(TreeNodeDataType n) {\n left(n);\r\n \r\n \r\n }", "private void setLeft(int index, Node n) {\n \t\t// TODO Complete this method!\n \t\tsetNode(getLeftOf(index), n);\n \t}", "private void leftRotate(AVLNode<T> parent, AVLNode<T> node) {\n AVLNode<T> oldLeft = parent.getLeft();\n AVLNode<T> parDat = new AVLNode<>(parent.getData());\n parent.setLeft(parDat);\n if (oldLeft != null) {\n parent.getLeft().setLeft(oldLeft);\n calcDeterminants(parent.getLeft().getLeft());\n }\n if (node.getLeft() != null) {\n parent.getLeft().setRight(node.getLeft());\n calcDeterminants(parent.getLeft().getRight());\n }\n parent.setData(node.getData());\n if (node.getRight() != null) {\n parent.setRight(node.getRight());\n calcDeterminants(parent.getRight());\n } else {\n parent.setRight(null);\n calcDeterminants(parent.getLeft());\n }\n }", "private AVLTreeNode<E> smallRotateLeft(AVLTreeNode<E> node) {\n AVLTreeNode<E> p = node.getRight();\n node.setRight(p.getLeft());\n p.setLeft(node);\n node.fixHeight();\n p.fixHeight();\n return p;\n }", "public static TreapNode leftRotate(TreapNode x)\n {\n TreapNode y = x.right, T2 = y.left;\n\n // Perform rotation\n y.left = x;\n x.right = T2;\n\n // Return new root\n return y;\n }", "public void rotateLeft(int time) {\n\t\tdouble step = 3;\r\n\t\t\r\n\t\tif( rotation - step < 0 )\r\n\t\t\trotation = rotation - step + 360;\r\n\t\telse\r\n\t\t\trotation -= step;\r\n\t\t\t\r\n\t}", "private void LLRotation(IAVLNode node)\r\n\t{\r\n\t\tIAVLNode parent = node.getParent(); \r\n\t\tIAVLNode leftChild = node.getLeft(); \r\n\t\tIAVLNode rightGrandChild = node.getLeft().getRight(); \r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\tif(node != root) \r\n\t\t{\r\n\t\t\tif(node == parent.getLeft()) \r\n\t\t\t\tparent.setLeft(leftChild);\r\n\t\t\telse \r\n\t\t\t\tparent.setRight(leftChild);\r\n\t\t}\r\n\t\tnode.setLeft(rightGrandChild); // rightGrandChild is now node's left child\r\n\t\trightGrandChild.setParent(node); // node becomes rightGrandChild's parent\r\n\t\tleftChild.setRight(node); // node is now leftChild's right child\r\n\t\tnode.setParent(leftChild); // node's parent is now leftChild\r\n\t\tleftChild.setParent(parent); // leftChild's parent is now node's old parent\r\n\t\t\r\n\t\t//updating sizes and heights\r\n\t\tnode.setSize(sizeCalc(node)); // updating node's size \r\n\t\tleftChild.setSize(sizeCalc(leftChild)); //updating leftChild's size\r\n\t\tleftChild.setHeight(HeightCalc(leftChild)); // updating leftChild's height\r\n\t\tnode.setHeight(HeightCalc(node)); // updating node's height\r\n\r\n\t\tif (node == root)\r\n\t\t\tthis.root = leftChild;\r\n\t}", "public void rotateLeft() {\n\t\tif (rotLeft == null) {\n\t\t\tQuaternion quat = new Quaternion();\n\t\t\tquat.fromAngles(0f, (float) Math.toRadians(90), 0f);\n\t\t\trotLeft = quat.toRotationMatrix();\n\t\t}\n\n\t\tgetNode().getLocalRotation().apply(rotLeft);\n\t}", "public void rotateLeft() {\n\t\tthis.direction = this.direction.rotateLeft();\n\t}", "private AvlNode<E> rotateWithLeftChild(AvlNode<E> k1){\n AvlNode<E> k2 = k1.left;\n k1.left = k2.right;\n k2.right = k1;\n k1.height = max(height(k1.left), height(k2.right)) + 1;\n k2.height = max(height(k2.left), k1.height) + 1;\n return k2;\n }", "private Node rotateRight() {\n Node left = this.leftChild;\n this.leftChild = left.rightChild;\n left.rightChild = this;\n\n this.updateHeight();\n left.updateHeight();\n\n return left;\n }", "private void leftRotate(RBNode<T> x) {\r\n // node x must have rightChild\r\n RBNode<T> y = x.right;\r\n\r\n //1. deal with y's leftChild, move it to x's rightChild:\r\n // update x's rightChild as y's leftChild\r\n x.right = y.left;\r\n\r\n // update y.left.parent as x (only y.left is not null)\r\n if(y.left != null)\r\n y.left.parent = x;\r\n\r\n //2. deal with parent of x, move y to x's position\r\n // update y's parent as x's parent\r\n y.parent = x.parent;\r\n // if x.parent = null, set root = y\r\n if(x.parent == null) {\r\n this.root = y;\r\n } else {\r\n //if x is leftChild of parent, assign y as parent's leftChild\r\n if(x == x.parent.left)\r\n x.parent.left = y;\r\n else//if x is rightChild of parent, assign y as parent's rightChild\r\n x.parent.right = y;\r\n }\r\n\r\n //3. update y.left as x, update x.parent as y\r\n y.left = x;\r\n x.parent = y;\r\n }", "protected Node<E> rotateLeft( Node<E> root ) {\n\n if( root == null || root.right == null) {\n return null;\n }\n\n Node<E> tempNode = root.right;\n root.right = tempNode.left;\n tempNode.left = root;\n return tempNode;\n\n }", "public void rotateRight(Node node){\n\t\tNode ptrLeft = node.left;\n\t\tnode.left = ptrLeft.right;\n\t\t\n\t\tif(ptrLeft.right != nil){\n\t\t\tptrLeft.right.parent = node;\n\t\t}\n\t\t\n\t\tptrLeft.parent = node.parent;\n\t\t\n\t\tif(ptrLeft.parent==nil){\n\t\t\troot = ptrLeft;\n\t\t}else if(node == node.parent.left){\n\t\t\tnode.parent.left = ptrLeft;\n\t\t}else{\n\t\t\tnode.parent.right = ptrLeft;\n\t\t}\n\t\t\n\t\tptrLeft.right = node;\n\t\tnode.parent = ptrLeft;\n\t}", "public AVLNode rotateLeft(AVLNode pt) {\n\t\tAVLNode node = pt.getRight();\n\t\t\n\t\tpt.setRight(node.getLeft());\n\t\tnode.setLeft(pt);\n\t\t\n\t\treturn node;\n\t}", "void moveTo(Node n);", "private void RRRotation(IAVLNode node)\r\n\t{\r\n\t\tIAVLNode parent = node.getParent(); \r\n\t\tIAVLNode rightChild = node.getRight() ; \r\n\t\tIAVLNode leftGrandChild = node.getRight().getLeft(); \r\n\t\t\r\n\t\tif(node != root) \r\n\t\t{\r\n\t\t\tif(node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(rightChild);\r\n\t\t\telse \r\n\t\t\t\tparent.setRight(rightChild);\r\n\t\t}\r\n\t\t\r\n\t\tnode.setRight(leftGrandChild); //leftGrandChild is now node's right child\r\n\t\tleftGrandChild.setParent(node); //node is now leftGrandChild's parent\r\n\t\trightChild.setLeft(node); // node is now rightChild's left child\r\n\t\tnode.setParent(rightChild); // node's parent is now leftChild\r\n\t\trightChild.setParent(parent); // leftChild's parent is now node's old parent\r\n\t\t\r\n\t\t//updating sizes and heights\r\n\t\tnode.setSize(sizeCalc(node)); // updating node's size\r\n\t\trightChild.setSize(sizeCalc(rightChild)); //updating rightChild's size\r\n\t\trightChild.setHeight(HeightCalc(rightChild)); // updating rightChild's height\r\n\t\tnode.setHeight(HeightCalc(node)); // updating node's height\r\n\t\t\r\n\t\tif (node == root) \r\n\t\t\tthis.root = rightChild;\r\n\t}", "private AVLNode<T> rotateRight(AVLNode<T> node) {\n AVLNode<T> substiute = node.left;\n node.left = substiute.right;\n substiute.right = node;\n\n // node = substitute;\n\n return substiute;\n }", "public static String moveHorizontal(int n) {\n\n if (n <= 0)\n n = 1;\n\n return CSI + n + 'G';\n }", "private void leftRotate(Entry<T> child, Entry<T> p) {\n\t\tif(p.parent != null) {\n\t\t\tif(p == p.parent.left)\n\t\t\t\tp.parent.left = child;\n\t\t\telse\n\t\t\t\tp.parent.right = child;\n\t\t}\n\t\tif(child.left != null)\n\t\t\tgetSplay(child.left).parent = p;\n\t\t\n\t\tchild.parent = p.parent;\n\t\tp.parent = child;\n\t\tp.right = child.left;\n\t\tchild.left = p;\n\t}", "private void LRRotation(IAVLNode node)\r\n\t{\r\n\r\n\t\tRRRotation(node.getLeft());\r\n\t\tLLRotation(node);\r\n\t}", "private void rotateRight(Node tree) {\n assert tree != null;\n assert tree.left != null;\n\n Node temp = tree.left;\n tree.left = temp.right;\n if(temp.right != null) { //no null pointers\n temp.right.parent = tree;\n }\n temp.parent = tree.parent;\n if(temp.parent != null) { //am i at the root?\n if(temp.parent.left == tree) {\n temp.parent.left = temp;\n } else if (temp.parent.right == tree) {\n temp.parent.right = temp;\n }\n }\n tree.parent = temp;\n temp.right = tree;\n if(tree == root) { root = temp; } //rewrite the root\n rotations += 1;\n }", "private void rotateLeft(Node curr, boolean colorChangeNeeded) {\n\t\tNode parent = curr.parent;\n\t\tcurr.parent = parent.parent;\n if(parent.parent != null) {\n if(parent.parent.right == parent) {\n \tparent.parent.right = curr;\n } else {\n \tparent.parent.left = curr;\n }\n }\n Node left = curr.left;\n curr.left = parent;\n parent.parent = curr;\n parent.right = left;\n if(left != null) {\n left.parent = parent;\n }\n if(colorChangeNeeded) {\n curr.color = Color.BLACK;\n parent.color = Color.RED;\n }\n\t}", "public static void rotate(int [][]matrix, int n){\n for(int layer = 0; layer < n / 2 ; ++layer){\n int first = layer;\n int last = n - 1 - layer;\n for(int i = first; i < last; ++i){\n int offset = i - first;\n //save top\n int top = matrix[first][i];\n //left to top\n matrix[first][i] = matrix[last-offset][first];\n //bottom to left\n matrix[last-offset][first] = matrix[last][last-offset];\n //right to bottom\n matrix[last][last-offset] = matrix[i][last];\n //top to right\n matrix[i][last] = top;\n }\n }\n }", "public static Nodelink rotate(Nodelink node, int k){ 1 2 3 4 5\n //\n\n Nodelink head = node;\n Nodelink temp = null;\n Nodelink temp2 = null;\n\n for(int i = 0; i < k; i++){\n while(node != null){\n\n temp = node;\n temp2 = node.next;\n\n node.next = temp;\n\n\n node = node.next;\n\n }\n\n head = node;\n }\n\n\n return head;\n }", "private void singleRotationLR(BinaryNode node){\n if (node == root) {\n root = node.left;\n root.parent = null;\n root.right = node;\n node.parent = node.left;\n node.left = null;\n } else {\n if (node.parent.right == node) {\n node.parent.right = node.left;\n } else {\n node.parent.left = node.left;\n }\n node.left.parent = node.parent;\n node.left.right = node;\n node.parent = node.left;\n node.left = null;\n }\n }", "private SplayNode rotateWhenXisRightChildOfLeftChild(SplayNode X)\n\t{\n\t\tX = rotateWhenRightOfRoot(X);\n\t\t//G.setLeft(X);\n\t\tX = rotateWhenLeftOfRoot(X);\n\t\treturn X;\n\t}", "private void leftRotate(WAVLNode y) {\n\t WAVLNode x=y.parent;\r\n\t WAVLNode a=x.left;\r\n\t WAVLNode b=y.left;\r\n\t WAVLNode c = y.right;\r\n\t y.left=x;\r\n\t x.right=b;\r\n\t \r\n\t if (x.parent!=null) {\r\n\t\t WAVLNode d=x.parent;\r\n\t\t String side=parentside(d,x);\r\n\r\n\t\t if (side.equals(\"right\")) {\r\n\t\t\t d.right=y;\r\n\t\t\t y.parent=d;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t d.left=y;\r\n\t\t\t y.parent=d;\r\n\t\t }\r\n\t }\r\n\t else {\r\n\t\t y.parent=null;\r\n\t\t this.root=y;\r\n\t }\r\n\t x.parent=y;\r\n\t b.parent=x;\r\n\t x.rank=x.rank-1;\r\n\t x.sizen=a.sizen+b.sizen+1;\r\n\t y.sizen=x.sizen+c.sizen+1;\r\n\t \r\n }", "protected void rotateToNode() {\n\t\tPose pose = poseProvider.getPose();\n\t\tdouble bearing = pose.relativeBearing(node);\n\t\tbindTransition(pilot.rotateComplete(bearing), NavigatorState.TRAVEL);\n\t}", "private NodeTreeBinary<T> rotateLeft(NodeTreeBinary<T> h) {\n\t\tNodeTreeBinary<T> x = h.getRight();\n\n\t\th.setRight(x.getLeft());\n\t\tx.setLeft(h);\n\t\tsetColor(x, getColor(x.getLeft()));\n\t\tsetColor(x.getLeft(), NodeTreeRB.RED);\n\n\t\tsetSize(x, getSize(h));\n\t\tsetSize(h, getSize(h.getLeft()) + getSize(h.getRight()) + 1);\n\n\t\treturn x;\n\t}", "public void rotatePieceLeft(){\r\n if (hasFalling()){\r\n FallingPiece test = falling.rotateLeft();\r\n if (!moveIfNoConflict(test, falling))\r\n Kick(test, falling);\r\n if(isGhostActivated())\r\n \t\t\tgenerateGhost();\r\n }\r\n }", "void moveNode( int from, int to );", "private void leftRotateFixup(RedBlackNode x){\n\n // Przypadek 1: tylko x, x.right i x.right.right są nil.\n if (isNil(x.left) && isNil(x.right.left)){\n x.numLeft = 0;\n x.numRight = 0;\n x.right.numLeft = 1;\n }\n\n // Przypadek 2: x.right.left istnieje w dodatku do przypadku 1\n else if (isNil(x.left) && !isNil(x.right.left)){\n x.numLeft = 0;\n x.numRight = 1 + x.right.left.numLeft +\n x.right.left.numRight;\n x.right.numLeft = 2 + x.right.left.numLeft +\n x.right.left.numRight;\n }\n\n // Przypadek 3: x.left także istnieje w dodatku do przypadku 1\n else if (!isNil(x.left) && isNil(x.right.left)){\n x.numRight = 0;\n x.right.numLeft = 2 + x.left.numLeft + x.left.numRight;\n\n }\n\n // Przypadek 4: x.left i x.right.left istnieją w dodatku do przypadku 1\n else{\n x.numRight = 1 + x.right.left.numLeft +\n x.right.left.numRight;\n x.right.numLeft = 3 + x.left.numLeft + x.left.numRight +\n x.right.left.numLeft + x.right.left.numRight;\n }\n }", "public void leftRotate(Website root, Website x) {\r\n\t\tWebsite y = x.getRight(); \t//set y\r\n\t\tx.setRight(y.getLeft());\t//turn y's left subtree into x's right subtree\r\n\t\tif (y.getLeft() != null) {\t//if y.left exists,\r\n\t\t\ty.getLeft().setParent(x);\t//y.left's parent becomes x\r\n\t\t}\r\n\t\ty.setParent(x.getParent());\t//link x's parent to y\r\n\t\tif (x.getParent() == null) //if x is the root\r\n\t\t\tsetRoot(y);\t\t\t\t//y is now the root\r\n\t\telse if (x == x.getParent().getLeft())\t//if x is the left child\r\n\t\t\tx.getParent().setLeft(y);\t//x's parent sets its left as y\r\n\t\telse {\r\n\t\t\tx.getParent().setRight(y);\t\t//if it is not the left child, it is the right child and x's parent sets its right as y\r\n\t\t}\r\n\t\ty.setLeft(x); \t//x on y's left\r\n\t\tx.setParent(y);\t// link x to y\r\n\t}", "private void rightRotate(int[] nums, int n) {\n\t\tint temp;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttemp = nums[nums.length - 1];\n\t\t\tfor (int j = nums.length - 1; j > 0; j--) {\n\t\t\t\tnums[j] = nums[j - 1];\n\n\t\t\t}\n\n\t\t\tnums[0] = temp;\n\n\t\t}\n\t\tSystem.out.println(Arrays.toString(nums));\n\n\t}", "private void singleRotationRL(BinaryNode node) {\n if (node == root) {\n root = node.right;\n root.parent = null;\n root.left = node;\n node.parent = node.right;\n node.right = null;\n } else {\n if (node.parent.right == node) {\n node.parent.right = node.right;\n } else {\n node.parent.left = node.right;\n }\n node.right.parent = node.parent;\n node.right.left = node;\n node.parent = node.right;\n node.right = null;\n }\n }", "private void rotateLeft() {\n robot.leftBack.setPower(-TURN_POWER);\n robot.leftFront.setPower(-TURN_POWER);\n robot.rightBack.setPower(TURN_POWER);\n robot.rightFront.setPower(TURN_POWER);\n }", "private void RLRotation(IAVLNode node)\r\n\t{\r\n\t\tLLRotation(node.getRight());\r\n\t\tRRRotation(node);\r\n\t}", "public void rotateLeft() {\n // I fucked up? Rotations are reversed, just gonna switch em\n// tileLogic = getRotateLeft();\n tileLogic = getRotateRight();\n// rotateLeftTex();\n rotateRightTex();\n }", "public void rotLeft()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\t((PlayerShip)gameObj[1].get(0)).moveLeft();\n\t\t\tSystem.out.println(\"Heading +10 degrees\");\n\t\t}else {\n\t\t\tSystem.out.println(\"there is not currently a player ship spawned\");\n\t\t}\n\t}", "private void rightLeftRotate(AVLNode<T> parent, AVLNode<T> node) {\n AVLNode<T> child = node.getLeft();\n AVLNode<T> oldNodeRight = node.getRight();\n AVLNode<T> oldChildLeft = child.getLeft();\n AVLNode<T> oldChildRight = child.getRight();\n AVLNode<T> nodeDat = new AVLNode<>(node.getData());\n node.setRight(nodeDat);\n if (oldNodeRight != null) {\n node.getRight().setRight(oldNodeRight);\n calcDeterminants(node.getRight().getRight());\n }\n node.setData(child.getData());\n if (oldChildRight != null) {\n node.getRight().setLeft(oldChildRight);\n calcDeterminants(node.getRight().getLeft());\n } else {\n node.getRight().setLeft(null);\n calcDeterminants(node.getRight());\n }\n if (oldChildLeft != null) {\n node.setLeft(oldChildLeft);\n calcDeterminants(node.getLeft());\n } else {\n node.setLeft(null);\n calcDeterminants(node.getRight());\n }\n\n AVLNode<T> oldLeft = parent.getLeft();\n AVLNode<T> parDat = new AVLNode<>(parent.getData());\n parent.setLeft(parDat);\n if (oldLeft != null) {\n parent.getLeft().setLeft(oldLeft);\n calcDeterminants(parent.getLeft().getLeft());\n }\n if (node.getLeft() != null) {\n parent.getLeft().setRight(node.getLeft());\n calcDeterminants(parent.getLeft().getRight());\n }\n parent.setData(node.getData());\n if (node.getRight() != null) {\n parent.setRight(node.getRight());\n calcDeterminants(parent.getRight());\n } else {\n parent.setRight(null);\n calcDeterminants(parent.getLeft());\n }\n }", "LinkList rotate(int numberOfRotations){\n\t\twhile(numberOfRotations!=0){\n\t\t\tNode temp=this.head;\n\t\t\twhile(temp.getNext()!=null){\n\t\t\t\ttemp=temp.getNext();\n\t\t\t}\n\t\t\ttemp.setNext(head);\n\t\t\thead=head.getNext();\n\t\t\ttemp.getNext().setNext(null);\n\t\t\tnumberOfRotations--;\n\t\t}\n\t\t\n\t\treturn this;\n\t}", "static int[] rotLeft(int[] a, int d) {\n int temp = a[a.length - 1];\n for (int i = a.length - 1; i > 1; i--) {\n if (i > 2) {\n a[i - 2] = temp;\n temp = a[i - 3];\n } else {\n a[0] = a[a.length - 1];\n }\n }\n\n return a;\n }" ]
[ "0.797246", "0.795604", "0.7653221", "0.75190294", "0.72243917", "0.7106012", "0.70547503", "0.7010332", "0.69557065", "0.69270134", "0.6919629", "0.6864989", "0.68434143", "0.6824314", "0.68039703", "0.67798835", "0.67499906", "0.6735392", "0.67123896", "0.6700172", "0.668073", "0.6668722", "0.6642526", "0.66420317", "0.6632711", "0.6631334", "0.66233116", "0.6612824", "0.65722805", "0.65603924", "0.6558101", "0.65100473", "0.6509719", "0.6500629", "0.64683336", "0.64364254", "0.64263034", "0.64180446", "0.64134103", "0.6405951", "0.6399941", "0.637803", "0.6365308", "0.6344566", "0.6339559", "0.6335861", "0.633375", "0.6328004", "0.6325014", "0.6309399", "0.62904716", "0.6268449", "0.6266682", "0.6264088", "0.62571377", "0.6253675", "0.6250651", "0.6249702", "0.62319714", "0.6213175", "0.6207006", "0.62063324", "0.6203918", "0.61987257", "0.61948293", "0.6176725", "0.61585325", "0.612633", "0.6113145", "0.6107076", "0.61029494", "0.6089983", "0.6088717", "0.6087125", "0.6077048", "0.6074123", "0.6071548", "0.6037264", "0.603596", "0.6027067", "0.6022903", "0.60193974", "0.6000426", "0.59944105", "0.5986702", "0.597309", "0.5968712", "0.59651077", "0.59632784", "0.59509903", "0.59129494", "0.59049636", "0.59047407", "0.59012705", "0.5885061", "0.5866961", "0.5865087", "0.58647937", "0.5862857", "0.58519965" ]
0.7657926
2
Takes a node n and rotates it to the right moving nodes around it.
public void rightRotate(Node n) { Node y = n.left; n.left = y.right; if(!y.right.isNil) y.right.parent = n; y.parent = n.parent; if(n.parent.isNil) root = y; else if(n == n.parent.right) n.parent.right = y; else n.parent.left = y; y.right = n; n.parent = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private long rightRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentLeft = current.left;\r\n Node tempN = new Node(current.left);\r\n current.left = tempN.right;\r\n tempN.right = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentLeft);\r\n return currentLeft;\r\n }", "public Node rotateRight(Node n)\r\n\t{\r\n\t\tNode target = n.left;//rotate target to node\r\n\t\tNode subTree = target.right;//get its subtree\r\n\t\t\r\n\t\ttarget.right = n; //set targets old sub tree to nodes sub tree\r\n\t\tn.left =subTree;// set old sub tree to nodes subtree\r\n\t\t\r\n\t\t//increment the height of the tree\r\n\t\tn.height = maxHeight(height(n.left),height(n.right))+1;\r\n\t\ttarget.height = maxHeight(height(target.left),height(target.right))+1;\r\n\t\t\r\n\t\treturn target;\r\n\t}", "public ListNode rotateRight(ListNode head, int n) {\n if(n == 0 || head == null) {\r\n return head;\r\n } \r\n ListNode curr = head;\r\n int length = 0;\r\n while(curr!=null) {\r\n length++;\r\n curr = curr.next;\r\n }\r\n n = n % length;\r\n //skip the zero\r\n if(n == 0) {\r\n return head;\r\n }\r\n //do the rotating\r\n ListNode newHead = new ListNode(-1);\r\n newHead.next = head;\r\n \r\n int step = length - n;\r\n curr = newHead;\r\n for(int i = 0; i < step; i++) {\r\n curr = curr.next;\r\n }\r\n \r\n //be aware need to break the loop\r\n ListNode tmp = curr.next;\r\n curr.next = null;\r\n curr = tmp;\r\n \r\n newHead.next = curr;\r\n while(curr.next != null) {\r\n curr = curr.next;\r\n }\r\n curr.next = head;\r\n \r\n return newHead.next;\r\n }", "public ListNode rotateRight(ListNode head, int n) {\n \n int len = 0;\n \n if (head == null) return head;\n \n ListNode node = head;\n ListNode prev = head;\n \n while (node != null) {\n prev = node;\n node = node.next;\n len++;\n }\n \n n = n % len;\n \n if (n == 0) return head;\n \n int current = 1;\n \n prev.next = head;\n \n node = head;\n \n while (current < len - n) {\n node = node.next;\n current++;\n }\n \n prev = node.next;\n node.next = null;\n \n return prev;\n }", "private void singleRotateRight(Node n) {\n Node l = n.mLeft, lr = l.mRight, p = n.mParent;\n n.mLeft = lr;\n lr.mParent = n;\n l.mRight = n;\n if (n == mRoot) {\n mRoot = l;\n l.mParent = null;\n }\n else if (p.mLeft == n) {\n p.mLeft = l;\n l.mParent = p;\n }\n else {\n p.mRight = l;\n l.mParent = p;\n }\n n.mParent = l;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n==0||head==null)\n return head;\n ListNode fast=head;\n ListNode slow=head;\n ListNode res=new ListNode(0);\n res.next=head;\n \n int count=0;\n for(int i=0;i<n;i++){\n if(fast==null){\n break; \n }else{\n count++;\n fast=fast.next;\n }\n }\n \n if(fast==null)\n return rotateRight(head,n%count);\n \n while(fast.next!=null){\n fast=fast.next;\n slow=slow.next;\n }\n \n ListNode b=slow.next;\n \n res.next=b;\n slow.next=null;\n fast.next=head;\n \n return res.next;\n }", "public ListNode rotateRight(ListNode head, int n) {\n \n if (head == null || head.next == null)\n return head;\n int i = 0;\n ListNode tail = head;\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode pre = dummy;\n \n // get the length of the list\n int len = 0;\n while (head != null){\n head = head.next;\n len ++;\n if (head != null)\n tail = head;\n }\n head = dummy.next;\n if (n%len == 0)\n\t\t return dummy.next;\n\t n = len - n%len;\n\t ListNode cur = dummy.next;\n while (i < n){\n pre = cur;\n cur = cur.next;\n i++;\n }\n dummy.next = cur;\n tail.next = head;\n pre.next = null;\n return dummy.next;\n }", "public ListNode rotateRight(ListNode head, int n) {\r\n\t\t// Note: The Solution object is instantiated only once and is reused by\r\n\t\t// each test case.\r\n\t\tif (null == head) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tListNode p = head;\r\n\t\tint length = 0;\r\n\t\twhile (null != p) {\r\n\t\t\tp = p.next;\r\n\t\t\tlength++;\r\n\t\t}\r\n\t\tif (n % length == 0) {\r\n\t\t\treturn head;\r\n\t\t} else {\r\n\t\t\tn = n % length;\r\n\t\t}\r\n\t\tint num = n;\r\n\t\tListNode first = head;\r\n\t\tListNode second = head;\r\n\t\twhile (num > 0) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tnum--;\r\n\t\t}\r\n\r\n\t\twhile (null != first.next) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tsecond = second.next;\r\n\t\t}\r\n\r\n\t\tListNode newHead = second.next;\r\n\t\tsecond.next = null;\r\n\t\tfirst.next = head;\r\n\t\treturn newHead;\r\n\t}", "private long leftRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentRight = current.right;\r\n Node tempN = new Node(current.right);\r\n current.right = tempN.left;\r\n tempN.left = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentRight);\r\n return currentRight;\r\n }", "public Node<T> rightRotate(Node<T> node){\n\n Node<T> temp = node.left;//pointer set to the nodes left child\n node.left = temp.right;//node.left set to the right child\n temp.right = node;//temp.right equal to the node that is rotating\n return temp;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(head==null)\n return null;\n ListNode p2=head;\n ListNode p1=head;\n ListNode newhead=head;\n int count=0;\n \n if(n==0)\n return head;\n \n for(int i=0;i<n;i++)\n {\n p1=p1.next;\n count++;\n if(p1==null)\n break;\n }\n \n if(count==1&&p1==null)\n return head;\n \n if(p1==null)\n {\n p1=head;\n n=n%count;\n if(n==0)\n return head;\n for(int i=0;i<n;i++)\n {\n p1=p1.next; \n }\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n tail=tail.next;\n tail.next=head;\n p2.next=null;\n }\n else\n {\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n {\n tail=tail.next;\n }\n tail.next=head;\n p2.next=null;\n }\n \n return newhead;\n }", "public Node rotateLeft(Node n)\r\n\t{\r\n\t\tNode target = n.right;//rotate target to node\r\n\t\tNode subTree = target.left;//get its subtree\r\n\t\t\r\n\t\ttarget.left = n;//set targets old sub tree to nodes sub tree\r\n\t\tn.right = subTree;// set old sub tree to nodes subtree\r\n\t\t\r\n\t\t//increment the height of the tree\r\n\t\tn.height = maxHeight(height(n.left),height(n.right))+1;\r\n\t\ttarget.height = maxHeight(height(target.left),height(target.right))+1;\r\n\t\t\r\n\t\treturn target;\r\n\t}", "private void rightRotate(int[] nums, int n) {\n\t\tint temp;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttemp = nums[nums.length - 1];\n\t\t\tfor (int j = nums.length - 1; j > 0; j--) {\n\t\t\t\tnums[j] = nums[j - 1];\n\n\t\t\t}\n\n\t\t\tnums[0] = temp;\n\n\t\t}\n\t\tSystem.out.println(Arrays.toString(nums));\n\n\t}", "private AVLNode<T> rotateRight(AVLNode<T> node) {\n AVLNode<T> substiute = node.left;\n node.left = substiute.right;\n substiute.right = node;\n\n // node = substitute;\n\n return substiute;\n }", "private void rotateRight(Node tree) {\n assert tree != null;\n assert tree.left != null;\n\n Node temp = tree.left;\n tree.left = temp.right;\n if(temp.right != null) { //no null pointers\n temp.right.parent = tree;\n }\n temp.parent = tree.parent;\n if(temp.parent != null) { //am i at the root?\n if(temp.parent.left == tree) {\n temp.parent.left = temp;\n } else if (temp.parent.right == tree) {\n temp.parent.right = temp;\n }\n }\n tree.parent = temp;\n temp.right = tree;\n if(tree == root) { root = temp; } //rewrite the root\n rotations += 1;\n }", "private Node rotateRight() {\n Node left = this.leftChild;\n this.leftChild = left.rightChild;\n left.rightChild = this;\n\n this.updateHeight();\n left.updateHeight();\n\n return left;\n }", "public void rotateRight(Node node){\n\t\tNode ptrLeft = node.left;\n\t\tnode.left = ptrLeft.right;\n\t\t\n\t\tif(ptrLeft.right != nil){\n\t\t\tptrLeft.right.parent = node;\n\t\t}\n\t\t\n\t\tptrLeft.parent = node.parent;\n\t\t\n\t\tif(ptrLeft.parent==nil){\n\t\t\troot = ptrLeft;\n\t\t}else if(node == node.parent.left){\n\t\t\tnode.parent.left = ptrLeft;\n\t\t}else{\n\t\t\tnode.parent.right = ptrLeft;\n\t\t}\n\t\t\n\t\tptrLeft.right = node;\n\t\tnode.parent = ptrLeft;\n\t}", "protected void rotateLeft(BSTNode n) {\n\n\t\tassert (n != null);\n\n\t\tBSTNode pv = n.right;\n\t\tassert (pv != null);\n\n\t\t// promote pv\n\t\tpv.parent = n.parent;\n\n\t\tif (n.parent == null) {\n\t\t\tif (n == _root) {\n\t\t\t\t_root = pv;\n\t\t\t} else {\n\t\t\t\t// do nothing, pv has no parent to notify\n\t\t\t}\n\t\t} else {\n\t\t\tsetParentReference(n, pv);\n\t\t}\n\n\t\t// move pv's left subtree over to n's right\n\t\tn.right = pv.left;\n\t\tif (n.right != null)\n\t\t\tn.right.parent = n;\n\n\t\t// move n to be the left child of pv\n\t\tpv.left = n;\n\t\tn.parent = pv;\n\n\t\t_stats.incRotations();\n\n\t\t/*\n\t\t * Fixup other tree stats\n\t\t */\n\n\t\tn.size = 1 + (n.left != null ? n.left.size : 0)\n\t\t\t\t+ (n.right != null ? n.right.size : 0);\n\n\t\tpv.size = 1 + n.size + (pv.right != null ? pv.right.size : 0);\n\t}", "public void rotateRight(int numberOfTurns);", "public void leftRotate(Node n) {\r\n\t\tNode y = n.right;\r\n\t\tn.right = y.left;\r\n\t\tif(!y.left.isNil)\r\n\t\t\ty.left.parent = n;\r\n\t\ty.parent = n.parent;\r\n\t\tif(n.parent.isNil)\r\n\t\t\troot = y;\r\n\t\telse if(n == n.parent.left)\r\n\t\t\tn.parent.left = y;\r\n\t\telse\r\n\t\t\tn.parent.right = y;\r\n\t\ty.left = n;\r\n\t\tn.parent = y;\r\n\t}", "public void rotate(int n) {\n\t\t\twhile(n > 0) {\n\t\t\t\tthis.data = rotateGrid(data);\n\t\t\t\tn--;\n\t\t\t}\n\t\t\tcomputeHashes();\n\t\t}", "private RedBlackNode rotationWithRightChild(RedBlackNode node1) \n { \n RedBlackNode node2 = node1.rightChild; \n node1.rightChild = node2.leftChild; \n node2.leftChild = node1.leftChild; \n return node2; \n }", "private BinaryNode<AnyType> rotateRight1(BinaryNode<AnyType>t, AnyType x)\r\n\t{\r\n\t\tBinaryNode<AnyType> no=find(t,x);\r\n\t\tBinaryNode<AnyType> parno=findParentNode(t,x);\r\n\r\n\t\tif(no==parno)\r\n\t\t{\r\n\t\t\tBinaryNode temp1=parno.left;\r\n\t\t BinaryNode temp2=parno.right;\r\n\t\t BinaryNode temp3=parno.left.right;\r\n\t\t parno.left=null;\r\n\t\t parno.right=null;\r\n\t\t temp1.right=null;\r\n\t\t root=temp1;\r\n\t\t root.right=parno;\r\n\t\t root.right.left=temp3;\r\n\t\t root.right.right=temp2;\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif(no.element.compareTo(parno.element)<0)\r\n\t\t{\r\n\t\t\tBinaryNode temp = parno.left;\r\n\t\t\tparno.left=no.left;\r\n\t\t\ttemp.left=null;\r\n\t\t\tBinaryNode tempr=parno.left.right;\r\n\t\t\tparno.left.right=temp;\r\n\t\t\tparno.left.right.left=tempr;\r\n\t\t}\r\n\r\n\t\tif(no.element.compareTo(parno.element)>0)\r\n\t\t{\r\n\t\t\tBinaryNode temp = parno.right;\t\t\r\n\t\t\tparno.right=no.left;\r\n\t\t\ttemp.left=null;\r\n\t\t\tBinaryNode tempr=parno.right.right;\r\n\t\t\tparno.right.right=temp;\r\n\t\t\tparno.right.right.left=tempr;\r\n\r\n\t\t}\r\n\t\treturn t;\r\n\t}", "public Node<T> rightLeftRotate(Node<T> node){\n\n node.right = rightRotate(node.right);//rotate the parent to the right\n return leftRotate(node);// rotate the grandparent to the left\n }", "public Node<T> leftRightRotate(Node<T> node){\n\n node.left = leftRotate(node.left);//rotate the parent to the left\n return leftRotate(node);// rotate the grandparent to the right\n }", "public ListNode rotateKplace(ListNode head, int n) {\n if (head == null) return head;\n\n int len = getLen(head);\n int half = n % len;\n if (half == 0) return head;\n\n int index = len - half; // index to rotate\n ListNode curr = head;\n\n for (int i = 0; i < index - 1; i++) {\n curr = curr.next;\n } // curr is last node before rotate\n\n ListNode h1 = curr.next;\n curr.next = null;\n\n ListNode tail = h1;\n while (tail.next != null) {\n tail = tail.next;\n }\n tail.next = head;\n return h1;\n }", "private Node rightRotate(Node a) {\n Node b = a.getLeftChild();\n Node n3 = b.getRightChild();\n b.setRightChild(a);\n a.setLeftChild(n3);\n setHeights(a, b);\n return b;\n }", "private void RRRotation(IAVLNode node)\r\n\t{\r\n\t\tIAVLNode parent = node.getParent(); \r\n\t\tIAVLNode rightChild = node.getRight() ; \r\n\t\tIAVLNode leftGrandChild = node.getRight().getLeft(); \r\n\t\t\r\n\t\tif(node != root) \r\n\t\t{\r\n\t\t\tif(node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(rightChild);\r\n\t\t\telse \r\n\t\t\t\tparent.setRight(rightChild);\r\n\t\t}\r\n\t\t\r\n\t\tnode.setRight(leftGrandChild); //leftGrandChild is now node's right child\r\n\t\tleftGrandChild.setParent(node); //node is now leftGrandChild's parent\r\n\t\trightChild.setLeft(node); // node is now rightChild's left child\r\n\t\tnode.setParent(rightChild); // node's parent is now leftChild\r\n\t\trightChild.setParent(parent); // leftChild's parent is now node's old parent\r\n\t\t\r\n\t\t//updating sizes and heights\r\n\t\tnode.setSize(sizeCalc(node)); // updating node's size\r\n\t\trightChild.setSize(sizeCalc(rightChild)); //updating rightChild's size\r\n\t\trightChild.setHeight(HeightCalc(rightChild)); // updating rightChild's height\r\n\t\tnode.setHeight(HeightCalc(node)); // updating node's height\r\n\t\t\r\n\t\tif (node == root) \r\n\t\t\tthis.root = rightChild;\r\n\t}", "public static String moveRight(int n) {\n return CSI + n + \"C\";\n }", "public void rightRotate(RBNode<T, E> node) {\r\n\t\t// Keep Track of the root and the pivot and roots parent\r\n\t\tRBNode<T, E> root = node;\r\n\t\tRBNode<T, E> pivot = node.leftChild;\r\n\t\tRBNode<T, E> rParent = root.parent;\r\n\t\t// if the pivot is not null, then proceed to rotate\r\n\t\tif (pivot != nillLeaf) {\r\n\t\t\tif (rParent != nillLeaf) {\r\n\t\t\t\tif (root.uniqueKey.compareTo(rParent.uniqueKey) < 0) {\r\n\t\t\t\t\t// root must be to the left of the root's parent\r\n\t\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\t\tpivot.rightChild = root;\r\n\t\t\t\t\trParent.leftChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\r\n\t\t\t\t} else if (root.uniqueKey.compareTo(rParent.uniqueKey) > 0) {\r\n\t\t\t\t\t// root must be to the right of the root's parent\r\n\t\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\t\tpivot.rightChild = root;\r\n\t\t\t\t\trParent.rightChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// else if root has no parent, then rotate with no parent\r\n\t\t\telse {\r\n\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\troot.parent = pivot;\r\n\t\t\t\tthis.root = pivot;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private Node<T> rotateWithRight(Node<T> a) {\n Node<T> b = a.getRight();\n a.setRight(b.getLeft());\n b.setLeft(a);\n int aH = Math.max(findHeight(a.getLeft()),\n findHeight(a.getRight())) + 1;\n a.setHeight(aH);\n int bH = Math.max(findHeight(b.getRight()), aH) + 1;\n b.setHeight(bH);\n hAndBF(a);\n hAndBF(b);\n return b;\n }", "Node rightRotate(Node x)\n\t{\n\t\tNode y=x.left;\n\t\tNode T2=y.right;\n\t\t\n\t\t//rotate\n\t\t\n\t\ty.right=x;\n\t\tx.left=T2;\n\t\t\n\t\t//update heights\n\t\ty.height=max(height(y.left),height(y.left) +1 ) ;\n\t\tx.height=max(height(x.left),height(x.left) +1 ) ;\n\t\t\n\t\t// new root\n\t\treturn y;\n\t}", "private void singleRotateLeft(Node n) {\n Node r = n.mRight, rl = r.mLeft, p = n.mParent;\n n.mRight = rl;\n rl.mParent = n;\n r.mLeft = n;\n if (n == mRoot) {\n mRoot = r;\n r.mParent = null;\n }\n else if (p.mRight == n) {\n p.mRight = r;\n r.mParent = p;\n }\n else {\n p.mLeft = r;\n r.mParent = p;\n }\n n.mParent = r;\n }", "private RedBlackNode rotateRight(RedBlackNode x){\n\t RedBlackNode xParent = x.parent;\n\t RedBlackNode BSubTree = x.left.right;\n\t RedBlackNode y = x.left;\n\t y.right = x;\n\t x.parent = y;\n\t x.left = BSubTree;\n\t //Need to anlayse whether Nil check need to have or Not\n\t BSubTree.parent = x;\n\t if( xParent == this.Nil){\n\t\t this.root = y;\n\t }else if(xParent.left == x){\n\t\t xParent.left = y;\n\t }else{\n\t\t xParent.right = y;\n\t }\n\t y.parent = xParent;\n\t return y;\n }", "@Override\r\n\tpublic void rotateRight() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir + THETA);\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void rotateRight() {\n\t\tsetDirection((this.getDirection() + 1) % 4);\r\n\t}", "public void rightRotate(Node<E> y){\n \t\n /*\n If y is the root of the tree to rotate with right child subtree T3 and left child x, \n where T1 and T2 are the left and right children of x:\n y becomes right child of x and T1 as its left child of x\n T2 becomes left child of y and T3 becomes right child of y\n */\n \tNode<E> x = y.getLeftChild(); //set x \n\t\ty.setLeftChild(x.getRightChild()); //turn x's right subtree into y's left subtree\n\t\tx.getRightChild().setParent(y);\n\t\tx.setParent(y.getParent()); ////link y's parent to x\n\t\tif (y.getParent() == sentinel || y.getParent() == null) {\n\t\t\troot = x;\n\t\t} else if (y == y.getParent().getLeftChild()) { \n\t\t\ty.getParent().setLeftChild(x);\n\t\t} else {\n\t\t\ty.getParent().setRightChild(x);\n\t\t}\n\t\tx.setRightChild(y); //put x on y's left\n\t\ty.setParent(x);\n }", "private NodeRB<K, V> rotateRight(NodeRB<K, V> x) {\n\t\tNodeRB<K, V> xParent = x.parent;\n\n\t\tNodeRB<K, V> y = x.left;\n\t\tx.left = y.right;\n\t\ty.right = x;\n\n\t\t// Parents relations fix\n\t\tif (xParent != null) {\n\t\t\tif (x.isLeftChild()) {\n\t\t\t\txParent.left = y;\n\t\t\t} else {\n\t\t\t\txParent.right = y;\n\t\t\t}\n\t\t}\n\t\tx.parent = y;\n\t\ty.parent = xParent;\n\t\tif (x.left != null) {\n\t\t\tx.left.parent = x;\n\t\t}\n\n\t\tx.height = 1 + Math.max(height(x.left), height(x.right));\n\t\ty.height = 1 + Math.max(height(y.left), height(y.right));\n\t\treturn y;\n\t}", "public void splay(SplayNode n) {\n\t\t while(n.parent != null) { //node is not root\n\t\t if(n.parent == this.root) { //node is child of root, one rotation\n\t\t if(n == n.parent.left) {\n\t\t this.rightRotate(n.parent);\n\t\t }\n\t\t else {\n\t\t this.leftRotate(n.parent);\n\t\t }\n\t\t }\n\t\t else {\n\t\t \t SplayNode p = n.parent;\n\t\t \t SplayNode g = p.parent; //grandparent\n\n\t\t if(n.parent.left == n && p.parent.left == p) { //both are left children\n\t\t this.rightRotate(g);\n\t\t this.rightRotate(p);\n\t\t }\n\t\t else if(n.parent.right == n && p.parent.right == p) { //both are right children\n\t\t this.leftRotate(g);\n\t\t this.leftRotate(p);\n\t\t }\n\t\t else if(n.parent.right == n && p.parent.left == p) {\n\t\t this.leftRotate(p);\n\t\t this.rightRotate(g);\n\t\t }\n\t\t else if(n.parent.left == n && p.parent.right == p) {\n\t\t this.rightRotate(p);\n\t\t this.leftRotate(g);\n\t\t }\n\t\t }\n\t\t }\n\t\t }", "private void RLRotation(IAVLNode node)\r\n\t{\r\n\t\tLLRotation(node.getRight());\r\n\t\tRRRotation(node);\r\n\t}", "public abstract void rotateRight();", "protected void rotateToNode() {\n\t\tPose pose = poseProvider.getPose();\n\t\tdouble bearing = pose.relativeBearing(node);\n\t\tbindTransition(pilot.rotateComplete(bearing), NavigatorState.TRAVEL);\n\t}", "private BTNode<T> rotateRight(BTNode<T> p){\n\t\tBTNode<T> q = p.getLeft();\n\t\tp.setLeft(q.getRight());\n\t\tq.setRight(p);\n\t\tfixHeight(p);\n\t\tfixHeight(q);\n\t\treturn q;\n\t}", "public void rightRotate(SplayNode x) {\n\t\t\t SplayNode y = x.left;\n\t\t x.left = y.right;\n\t\t if(y.right != null) {\n\t\t y.right.parent = x;\n\t\t }\n\t\t y.parent = x.parent;\n\t\t if(x.parent == null) { //x is root\n\t\t this.root = y;\n\t\t }\n\t\t else if(x == x.parent.right) { //x is left child\n\t\t x.parent.right = y;\n\t\t }\n\t\t else { //x is right child\n\t\t x.parent.left = y;\n\t\t }\n\t\t y.right = x;\n\t\t x.parent = y;\n\t\t }", "public static void rotate(int [][]matrix, int n){\n for(int layer = 0; layer < n / 2 ; ++layer){\n int first = layer;\n int last = n - 1 - layer;\n for(int i = first; i < last; ++i){\n int offset = i - first;\n //save top\n int top = matrix[first][i];\n //left to top\n matrix[first][i] = matrix[last-offset][first];\n //bottom to left\n matrix[last-offset][first] = matrix[last][last-offset];\n //right to bottom\n matrix[last][last-offset] = matrix[i][last];\n //top to right\n matrix[i][last] = top;\n }\n }\n }", "public Node<T> leftRotate(Node<T> node){\n\n Node<T> temp = node.right;//a temporary pointer set to the node's right child\n node.right = temp.left;// the node right child set to the left child\n temp.left = node;//temporary pointer left child set to the node who is rotating\n return temp;\n }", "protected Node<E> rotateRight(Node<E> root) {\r\n\t\tNode<E> temp = root.left;\r\n\t\troot.left = temp.right;\r\n\t\ttemp.right = root;\r\n\t\treturn temp;\r\n\t}", "Node rightRotate(Node y) \n { \n Node x = y.left; \n Node T2 = x.right; \n \n // Perform rotation \n x.right = y; \n y.left = T2; \n \n // Update heights \n y.height = max(height(y.left), height(y.right)) + 1; \n x.height = max(height(x.left), height(x.right)) + 1; \n \n // Return new root \n return x; \n }", "private Node rotateRight(Node h) {\n Node x = h.left;\n h.left = x.right;\n x.right = h;\n x.color = x.right.color;\n x.right.color = RED;\n x.size = h.size;\n h.size = size(h.left) + size(h.right) + 1;\n return x;\n }", "private void rightRotate(WAVLNode x) {\n\t WAVLNode a=x.left;\r\n\t WAVLNode b=x.right;\r\n\t WAVLNode y=x.parent;\r\n\t WAVLNode c=y.right;\r\n\t x.right=y;\r\n\t y.left=b;\r\n\t if (y.parent!=null) {\r\n\t\t WAVLNode d=y.parent;\r\n\t\t String side=parentside(d,y);\r\n\r\n\t\t if (side.equals(\"right\")) {\r\n\t\t\t d.right=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t d.left=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t }\r\n\t else {\r\n\t\t x.parent=null;\r\n\t\t this.root=x;\r\n\t }\r\n\t y.parent=x;\r\n\t b.parent=y;\r\n\t y.rank=y.rank-1;\r\n\t \r\n\t y.sizen=b.sizen+c.sizen+1;\r\n\t x.sizen=a.sizen+y.sizen+1;\r\n\t \r\n }", "public void rotateRight() {\n\t\tif (rotRight == null) {\n\t\t\tQuaternion quat = new Quaternion();\n\t\t\tquat.fromAngles(0f, (float) Math.toRadians(-90), 0f);\n\t\t\trotRight = quat.toRotationMatrix();\n\t\t}\n\n\t\tgetNode().getLocalRotation().apply(rotRight);\n\t}", "private void rightRotate(AVLNode<T> parent, AVLNode<T> node) {\n AVLNode<T> oldRight = parent.getRight();\n AVLNode<T> parDat = new AVLNode<>(parent.getData());\n parent.setRight(parDat);\n if (oldRight != null) {\n parent.getRight().setRight(oldRight);\n calcDeterminants(parent.getRight().getRight());\n }\n if (node.getRight() != null) {\n parent.getRight().setLeft(node.getRight());\n calcDeterminants(parent.getRight().getLeft());\n }\n parent.setData(node.getData());\n if (node.getLeft() != null) {\n parent.setLeft(node.getLeft());\n calcDeterminants(parent.getLeft());\n } else {\n parent.setLeft(null);\n calcDeterminants(parent.getRight());\n }\n }", "private Node rotateRight(Node h){\n\t\tNode x = h.left;\n\t\th.left = x.right;\n\t\tx.right = h;\n\t\tx.color = h.color;\n\t\th.color = RED;\n\t\treturn x;\n\t}", "void moveTo(Node n);", "private void LRRotation(IAVLNode node)\r\n\t{\r\n\r\n\t\tRRRotation(node.getLeft());\r\n\t\tLLRotation(node);\r\n\t}", "protected RedBlackNode<T> rotateLeft(RedBlackNode<T> node) {\n RedBlackNode<T> rightNode = node.getRightChild();\n RedBlackNode<T> parent = node.getParent();\n rightNode._parent = node.getParent();\n node._rightChild = rightNode.getLeftChild();\n if (node._rightChild != null ) {\n node._rightChild._parent = node;\n } \n rightNode._leftChild = node; \n node._parent = rightNode;\n // node had parent.\n if(parent != null) {\n // node was left child\n if(parent._leftChild == node) {\n parent._leftChild = rightNode;\n } else {\n // node was right child\n parent._rightChild = rightNode;\n }\n } else {\n // node was head\n _head = rightNode;\n }\n return rightNode;\n }", "void rightRotate(Node<K, V> y) {\n\t\tassert IsNotNil(y.getLeft());\n\t\tNode<K, V> x = y.getLeft();\n\n\t\t// B in postion\n\t\ty.setLeft(x.getRight());\n\n\t\t// X to root\n\t\tif (y == root) {\n\t\t\troot = x;\n\t\t} else if (y.isRightChild()) {\n\t\t\ty.getParent().setRight(x);\n\t\t} else if (y.isLeftChild()) {\n\t\t\ty.getParent().setLeft(x);\n\t\t}\n\n\t\t// y in position\n\t\tx.setRight(y);\n\t}", "private void setRight(int index, Node n) {\n \t\t// TODO Complete this method!\n \t\tsetNode(getRightOf(index), n);\n \t}", "public DancingNode linkRight (DancingNode n)\n {\n n.R = this.R;\n n.R.L = n;\n n.L = this;\n this.R = n;\n return n;\n }", "Node rightRotate(Node y) \n { \n Node x = y.left; \n Node T2 = x.right; \n\n // rotation \n x.right = y; \n y.left = T2; \n\n // heights \n y.height = Math.max(height(y.left), height(y.right)) + 1; \n x.height = Math.max(height(x.left), height(x.right)) + 1; \n\n // Return new root \n return x; \n }", "private Node rotateLeft() {\n Node right = this.rightChild;\n this.rightChild = right.leftChild;\n right.leftChild = this;\n\n this.updateHeight();\n right.updateHeight();\n\n return right;\n }", "void moveNode( int from, int to );", "private void doubleRotateright(WAVLNode x) {\n\t WAVLNode z=x.left;\r\n\t rightRotate(z);\r\n\t z.rank+=1;\r\n\t leftRotate(z);\r\n }", "Node rightRotate(Node y) {\n Node x = y.left;\n Node T2 = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = T2;\n\n // Update heights\n y.height = max(height(y.left), height(y.right)) + 1;\n x.height = max(height(x.left), height(x.right)) + 1;\n\n // Return new root\n return x;\n }", "private void singleRotationRL(BinaryNode node) {\n if (node == root) {\n root = node.right;\n root.parent = null;\n root.left = node;\n node.parent = node.right;\n node.right = null;\n } else {\n if (node.parent.right == node) {\n node.parent.right = node.right;\n } else {\n node.parent.left = node.right;\n }\n node.right.parent = node.parent;\n node.right.left = node;\n node.parent = node.right;\n node.right = null;\n }\n }", "private long replace(long r, Node change) throws IOException {\n Node current = new Node(r);\r\n if (current.right != 0) {\r\n current.right = replace(current.right, change);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(current.right) > 0) {\r\n current.right = rightRotate(current.right);\r\n current.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(current.left) < 0) {\r\n current.left = leftRotate(current.left);\r\n current.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return r;\r\n }\r\n else {\r\n change.key = current.key;\r\n change.fields = current.fields;\r\n addToFree(r);\r\n return current.left;\r\n }\r\n }", "public ListNode rotateRight(ListNode head, int k) {\r\n\t\tint size = listSize(head);\r\n\t\tif (head == null || k <= 0 || k == size) return head;\r\n\t\tif (k > size) k %= size;\r\n\t\tint count = 1;\r\n\t\tListNode curr = head;\r\n\t\tk = size - k;\r\n\t\twhile (count < k && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tListNode nextHead = curr;\r\n\t\twhile (curr.next != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tcurr.next = head;\r\n\t\thead = nextHead.next;\r\n\t\tnextHead.next = null;\r\n\t\treturn head;\r\n\t}", "private RedBlackNode rotationWithLeftChild(RedBlackNode node2) \n { \n RedBlackNode node1 = node2.leftChild; \n node2.leftChild = node1.rightChild; \n node1.rightChild = node2; \n return node1; \n }", "private void rotateRight() {\n robot.leftBack.setPower(TURN_POWER);\n robot.leftFront.setPower(TURN_POWER);\n robot.rightBack.setPower(-TURN_POWER);\n robot.rightFront.setPower(-TURN_POWER);\n }", "public static Nodelink rotate(Nodelink node, int k){ 1 2 3 4 5\n //\n\n Nodelink head = node;\n Nodelink temp = null;\n Nodelink temp2 = null;\n\n for(int i = 0; i < k; i++){\n while(node != null){\n\n temp = node;\n temp2 = node.next;\n\n node.next = temp;\n\n\n node = node.next;\n\n }\n\n head = node;\n }\n\n\n return head;\n }", "protected Node<E> rotateRight( Node<E> root ) {\n\n if( root == null || root.left == null ) {\n return null;\n }\n\n Node<E> tempNode = root.left;\n root.left = tempNode.right;\n tempNode.right = root;\n return tempNode;\n\n }", "Node leftRotate(Node x) \n { \n Node y = x.right; \n Node T2 = y.left; \n \n // Perform rotation \n y.left = x; \n x.right = T2; \n \n // Update heights \n x.height = max(height(x.left), height(x.right)) + 1; \n y.height = max(height(y.left), height(y.right)) + 1; \n \n // Return new root \n return y; \n }", "private AVLNode<T> rotateLeft(AVLNode<T> node) {\n AVLNode<T> substitute = node.right;\n // donde ponemos los hijos a la izquierda del substituto\n node.right = substitute.left;\n substitute.left = node;\n\n return substitute;\n }", "private void rightRotate(Entry<T> child, Entry<T> p) {\n\t\tif(p.parent != null) {\n\t\t\tif(p == p.parent.left)\n\t\t\t\tp.parent.left = child;\n\t\t\telse\n\t\t\t\tp.parent.right = child;\n\t\t}\n\t\tif(child.right != null)\n\t\t\tgetSplay(child.right).parent = p;\n\t\t\n\t\tchild.parent = p.parent;\n\t\tp.parent = child;\n\t\tp.left = child.right;\n\t\tchild.right = p;\n\t\t\t\t\n\t}", "private void doubleRotationRL(BinaryNode node) {\n BinaryNode temp = min(node.right);\n if (node == root) {\n root = temp;\n if (temp.parent.right == temp) { //temp could have a child on the right\n temp.parent.right = temp.right;\n if (temp.right != null) temp.right.parent = temp.parent;\n }\n else {\n temp.parent.left = temp.right;\n if (temp.right != null) temp.right.parent = temp.parent;\n }\n root.parent = null;\n root.left = node;\n root.right = node.right;\n if(node.right != null) node.right.parent = root;\n node.parent = root;\n node.right = null;\n } else {\n if (node.parent.right == node) {\n node.parent.right = temp;\n } else {\n node.parent.left = temp;\n }\n temp.parent = node.parent;\n temp.right = node.right;\n if(node.right != null) node.right.parent = temp;\n temp.left = node;\n node.parent = temp;\n node.right = null;\n }\n }", "public void rotateRight() {\n\t\tthis.direction = this.direction.rotateRight();\n\t}", "public void leftRotate(Node<E> x){\n \n \t/*\n If x is the root of the tree to rotate with left child subtree T1 and right child y, \n where T2 and T3 are the left and right children of y:\n x becomes left child of y and T3 as its right child of y\n T1 becomes left child of x and T2 becomes right child of x\n */\n\t\tNode<E> y = x.getRightChild(); //set y\n\t\tx.setRightChild(y.getLeftChild()); //turn y's subtree into x's right subtree\n\t\ty.getLeftChild().setParent(x);\n\t\ty.setParent(x.getParent());\n\t\tif (x.getParent() == sentinel || x.getParent() == null) {\n\t\t\troot = y;\n\t\t} else if (x == x.getParent().getLeftChild()) { //link x's parent to y\n\t\t\tx.getParent().setLeftChild(y);\n\t\t} else {\n\t\t\tx.getParent().setRightChild(y);\n\t\t}\n\t\ty.setLeftChild(x); //put x on y's left\n\t\tx.setParent(y);\n\t\n }", "public ListNode rotateRight(ListNode head, int k) {\n \tif (head == null || k == 0 || head.next == null)\n \t\treturn head;\n \tint size = 1;\n \tListNode curr = head,end=head;\n \tListNode newHead = new ListNode(0);\n \twhile (end.next != null){\n \t\tend = end.next;\n \t\tsize++;\n \t}\n \tif (k%size == 0)\n\t return head;\n \tint start = 1;\n \twhile(start < size - k%size){\n \t\tcurr = curr.next;\n \t\tstart++;\n \t}\n \tnewHead.next = curr.next;\n \tcurr.next = null;\n \tend.next = head;\n \treturn newHead.next;\n }", "public NodeRB rotateRight(NodeRB y) {\n NodeRB x = y.left;\r\n //System.out.println(\"[...] Left of the pivot: \" + x.value);\r\n NodeRB c = x.right;\r\n NodeRB p = fetchParentOf(y.value);\r\n //System.out.println(y.value + \" is now the right of \" + x.value);\r\n if (y == this.root){\r\n this.root = x;\r\n }\r\n x.right = y;\r\n y.left = c;\r\n if (p != null){\r\n //System.out.print(\"[....] The pivot has a parent \" + p.value + \". Setting \" + x.value + \" to its \");\r\n if (p.getRight() == y){\r\n //System.out.println(\"right.\");\r\n p.right = (x);\r\n }\r\n else{\r\n //System.out.println(\"left.\");\r\n p.left = (x);\r\n }\r\n }\r\n return x;\r\n }", "private AVLTreeNode<E> smallRotateRight(AVLTreeNode<E> node) {\n AVLTreeNode<E> q = node.getLeft();\n node.setLeft(q.getRight());\n q.setRight(node);\n node.fixHeight();\n q.fixHeight();\n return q;\n }", "public static String rightShift(String input, int n) {\n\t\t//how: 1. corner case\n\t\tif (input == null || input.length() <= 1) {\n\t\t\treturn input;\n\t\t}\n\t\tchar[] array = input.toCharArray();\n\t\tn = n % array.length;\n\t\t//2.1 reverse the left part\n\t\treverse(array, 0, array.length - 1 - n);\n\t\t//2.2 reverse the right part\n\t\treverse(array, array.length - n, array.length - 1);\n\t\t//2.3 reverse all;\n\t\treverse(array, 0, array.length - 1);\n\t\treturn new String(array);\n\t}", "public String rightShift(String input, int n) {\n\t\t// Write your solution here.\n\t\tif (input == null || input.length() == 0)\n\t\t\treturn input;\n\t\tchar[] arr = input.toCharArray();\n\t\tint len = input.length();\n\t\t// len - 1 - n + 1 = len - n\n\t\tif (n >= len) {\n\t\t\treturn rightShift(input, n % len);\n\t\t}\n\t\treverse(arr, 0, len - n - 1);\n\t\treverse(arr, len - n, len - 1);\n\t\treverse(arr, 0, len - 1);\n\t\treturn new String(arr);\n\t}", "private Node rotateright(Node y) {\n Node x = y.left;\n Node z = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = z;\n\n // updating the heights for y and x\n y.height = max(height(y.left), height(y.right)) + 1;\n x.height = max(height(x.left), height(x.right)) + 1;\n\n return x;\n }", "Node leftRotate(Node x) { \n Node y = x.right; \n Node T2 = y.left; \n \n // Perform rotation \n y.left = x; \n x.right = T2; \n \n // Update heights \n x.height = maxInt(heightBST(x.left), heightBST(x.right)) + 1; \n y.height = maxInt(heightBST(y.left), heightBST(y.right)) + 1; \n \n // Return new root \n return y; \n }", "private BinaryNode<AnyType> rotateLeft1(BinaryNode<AnyType>t, AnyType x)\r\n\t{\r\n\t\tBinaryNode<AnyType> no=find(t,x);\r\n\t\tBinaryNode<AnyType> parno=findParentNode(t,x);\r\n\r\n\t\tif(no==parno)\r\n\t\t{\r\n\t\t BinaryNode temp1=parno.left;\r\n\t\t BinaryNode temp2=parno.right;\r\n\t\t BinaryNode temp3=parno.right.left;\r\n\t\t parno.left=null;\r\n\t\t parno.right=null;\r\n\t\t temp2.left=null;\r\n\t\t root=temp2;\r\n\t\t root.left=parno;\r\n\t\t root.left.right=temp3;\r\n\t\t root.left.left=temp1;\r\n\t\t}\r\n\r\n\t\t\r\n\t\tif(no.element.compareTo(parno.element)<0)\r\n\t\t{\r\n\t\t\tBinaryNode temp=parno.left;\r\n\t\t\tparno.left=no.right;\r\n\t\t\ttemp.right=null;\r\n\t\t\tBinaryNode templ=parno.left.left;\r\n\t\t\tparno.left.left=temp;\r\n\t\t\tparno.left.left.right=templ;\r\n\t\t}\r\n\t\t\r\n\t\tif(no.element.compareTo(parno.element)>0)\r\n\t\t{\r\n\t\t\tBinaryNode temp=parno.right;\r\n\t\t\tparno.right=no.right;\r\n\t\t\ttemp.right=null;\r\n\t\t\tBinaryNode templ=parno.right.left;\r\n\t\t\tparno.right.left=temp;\r\n\t\t\tparno.right.left.right=templ;\r\n\t\t}\r\n\t\treturn t;\r\n\t}", "private AVLNode<T, U> doubleRotateRightLeft(AVLNode<T, U> node) {\n\t\t node.setRight(rotateRight(node.getRight()));\n\t\t return rotateLeft(node);\n\t}", "public void rotatePieceRight(){\r\n if (hasFalling()){\r\n FallingPiece test =falling.rotateRight();\r\n if (!moveIfNoConflict(test, falling))\r\n Kick(test, falling);\r\n if(isGhostActivated())\r\n \t\t\tgenerateGhost();\r\n }\r\n }", "private AVLNode<T, U> doubleRotateLeftRight(AVLNode<T, U> node) {\n\t\tnode.setLeft(rotateLeft(node.getLeft()));\n\t\treturn rotateRight(node);\n\t}", "public Node rotateleft(Node x) {\n Node y = x.right;\n Node z = y.left;\n\n // Perform rotation\n y.left = x;\n x.right = z;\n\n // Update heights\n x.height = max(height(x.left), height(x.right)) + 1;\n y.height = max(height(y.left), height(y.right)) + 1;\n\n return y;\n }", "private void LLRotation(IAVLNode node)\r\n\t{\r\n\t\tIAVLNode parent = node.getParent(); \r\n\t\tIAVLNode leftChild = node.getLeft(); \r\n\t\tIAVLNode rightGrandChild = node.getLeft().getRight(); \r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\tif(node != root) \r\n\t\t{\r\n\t\t\tif(node == parent.getLeft()) \r\n\t\t\t\tparent.setLeft(leftChild);\r\n\t\t\telse \r\n\t\t\t\tparent.setRight(leftChild);\r\n\t\t}\r\n\t\tnode.setLeft(rightGrandChild); // rightGrandChild is now node's left child\r\n\t\trightGrandChild.setParent(node); // node becomes rightGrandChild's parent\r\n\t\tleftChild.setRight(node); // node is now leftChild's right child\r\n\t\tnode.setParent(leftChild); // node's parent is now leftChild\r\n\t\tleftChild.setParent(parent); // leftChild's parent is now node's old parent\r\n\t\t\r\n\t\t//updating sizes and heights\r\n\t\tnode.setSize(sizeCalc(node)); // updating node's size \r\n\t\tleftChild.setSize(sizeCalc(leftChild)); //updating leftChild's size\r\n\t\tleftChild.setHeight(HeightCalc(leftChild)); // updating leftChild's height\r\n\t\tnode.setHeight(HeightCalc(node)); // updating node's height\r\n\r\n\t\tif (node == root)\r\n\t\t\tthis.root = leftChild;\r\n\t}", "public static double[] rotate(double [] x, int n)\n {\n for(int i = 0; i < n; i++)\n {\n for(int j = 0; j < x.length - 1; j++)\n {\n double temp = x[j];\n x[j] = x[j + 1];\n x[j + 1] = temp;\n }\n }\n\n return x;\n\n }", "private void rightRotate(RedBlackNode<T> y){\n rightRotateFixup(y);\n\n RedBlackNode<T> x = y.left;\n y.left = x.right;\n\n // Czy istnieje x.right\n if (!isNil(x.right))\n x.right.parent = y;\n x.parent = y.parent;\n\n // y.parent jest nil\n if (isNil(y.parent))\n root = x;\n\n // y jest prawym dzieckiem swojego rodzica\n else if (y.parent.right == y)\n y.parent.right = x;\n\n // y jest lewym dzieckiem swojego rodzica\n else\n y.parent.left = x;\n x.right = y;\n\n y.parent = x;\n\n }", "public void rotateRight(int time) {\n\t\tdouble step = 3;\r\n\t\t\r\n\t\tif( rotation + step > 360 )\r\n\t\t\trotation = rotation + step - 360;\r\n\t\telse\r\n\t\t\trotation += step;\r\n\t}", "private void rightRotate(RBNode<T> y) {\r\n\r\n //node y must have leftChild\r\n RBNode<T> x = y.left;\r\n //1. deal with x's rightChild, move it to y's leftChild:\r\n // update y's leftChild as x's rightChild,\r\n y.left = x.right;\r\n\r\n //update x.right.parent as y (only x.right is not null)\r\n if(x.right != null)\r\n x.right.parent = y;\r\n\r\n //2. deal with parent of y, move x to y's position\r\n // update x's parent as y's parent\r\n x.parent = y.parent;\r\n // if y.parent = null, set root = x\r\n if(y.parent == null) {\r\n this.root = x;\r\n } else {\r\n //if y is rightChild of parent, update x as parent's rightChild\r\n if(y == y.parent.right)\r\n y.parent.right = x;\r\n else//if y is leftChild of parent, update x as parent's leftChild\r\n y.parent.left = x;\r\n }\r\n\r\n //3. update x.right as y, update y.parent as x\r\n x.right = y;\r\n y.parent = x;\r\n }", "public String rightShift(String input, int n) {\n if (input.length() <= 1) {\n return input;\n }\n \n int len = input.length();\n n = n % len;\n \n char[] ch = input.toCharArray();\n char[] ans = new char[len];\n \n for (int i=0; i<ch.length; i++) {\n int idx = i + n;\n if (idx >= len) {\n idx -= len;\n }\n \n ans[idx] = ch[i];\n }\n \n return String.valueOf(ans);\n }", "public void turnRight() {\r\n setDirection( modulo( myDirection+1, 4 ) );\r\n }", "public static void main(String[] args) {\r\n RotateList rl = new RotateList();\r\n // test list : 1->2->3->4->5->NULL.\r\n ListNode testList = new ListNode(0);\r\n for (int i = 1; i < 6; i++) {\r\n testList.addNodeTail(new ListNode(i));\r\n }\r\n System.out.println(\"The input list is the following:\");\r\n testList.printList();\r\n ListNode result = rl.rotateRight(testList, 3);\r\n System.out.println(\"And the output is the following:\");\r\n result.printList();\r\n }", "public void rotRight()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\t((PlayerShip)gameObj[1].get(0)).moveRight();\n\t\t\tSystem.out.println(\"Heading -10 degrees\");\n\t\t}else {\n\t\t\tSystem.out.println(\"there is not currently a player ship spawned\");\n\t\t}\n\t}", "public static TreapNode rightRotate(TreapNode y)\n {\n TreapNode x = y.left, T2 = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = T2;\n\n // Return new root\n return x;\n }", "private AvlNode<E> rotateWithRightChild(AvlNode<E> k1){\n AvlNode<E> k2 = k1.right;\n k1.right = k2.left;\n k2.left = k1;\n k1.height = max(height(k1.left), height(k2.right)) + 1;\n k2.height = max(k1.height, height(k2.right)) + 1;\n return k2;\n }" ]
[ "0.7918345", "0.77688235", "0.75670666", "0.753079", "0.7269137", "0.723786", "0.7186499", "0.71811867", "0.7176672", "0.6964053", "0.691043", "0.68984956", "0.68316704", "0.681429", "0.67414206", "0.67070657", "0.67061967", "0.6600248", "0.6577152", "0.65089077", "0.6460768", "0.6448452", "0.6432592", "0.64186454", "0.64168614", "0.6364242", "0.6355514", "0.6343554", "0.62811327", "0.6278364", "0.62777627", "0.6273112", "0.62609196", "0.6238151", "0.62317777", "0.6225811", "0.6204517", "0.6189485", "0.61804897", "0.6179874", "0.6173636", "0.6149688", "0.6141069", "0.61397636", "0.6106544", "0.6106411", "0.60841256", "0.6068644", "0.6063337", "0.6031507", "0.6013537", "0.6005295", "0.5986484", "0.5971844", "0.59647447", "0.59484446", "0.59465325", "0.5933767", "0.5921698", "0.5907314", "0.5893297", "0.5874473", "0.5874394", "0.58724207", "0.58639634", "0.5863756", "0.58592653", "0.5858224", "0.5844374", "0.5843564", "0.5826398", "0.58239937", "0.5815994", "0.5804413", "0.57929534", "0.57901037", "0.57884127", "0.57849944", "0.57847583", "0.57780313", "0.5776606", "0.5774307", "0.5769423", "0.5765063", "0.5761178", "0.5753644", "0.574162", "0.5730204", "0.5724866", "0.57242525", "0.5717689", "0.5707081", "0.57070065", "0.5704387", "0.56917125", "0.5685273", "0.5682525", "0.5681897", "0.5675934", "0.56754917" ]
0.75526214
3
Resets the array to its original configuration and return it.
public int[] reset() { return reset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int[] reset() {\n\t\t\treturn originalArr;\n\t\t}", "public int[] reset() {\n return Arrays.copyOf(origin, origin.length);\n }", "public int[] reset() \n {\n return reset;\n }", "public int[] reset() {\n return store;\n }", "private int[] reset() {\n return data;\n }", "public int[] reset() {\n return nums.clone();\n }", "private T[] modifyArray(T[] array) {\n array[index] = null;\n return array;\n }", "@SuppressWarnings({\"unused\", \"RedundantSuppression\"})\n public void resetArray() {\n Utils.postToMainLoop(new Runnable() {\n @Override\n public void run() {\n mBaseCacheAdapter.resetArray();\n mBaseRecyclerViewAdapter.notifyDataSetChanged();\n }\n\n @NonNull\n @Override\n public String toString() {\n return \"BaseCacheAdapterWrapper.resetArray()\";\n }\n });\n }", "public static int[] reset() {\n nums = Arrays.copyOf(numsBackUp, numsBackUp.length);\n return nums;\n }", "@Override\n public void clear() {\n array.reset();\n }", "public void compact()\n {\n array = toArray();\n }", "void reset() {\n for (int i = 0; i < array.length; i++) {\n array[i] = -1;\n }\n }", "public int[] reset() {\n\t\treturn memos;\n\t}", "private void reset(){\n int j=0;\n for(int i=0; i<array.length; i++){\n if(j == itemCount) {return;}\n if(array[i]!=null){\n temp[j] = array[i];\n j++;\n }\n }\n }", "public int[] reset() {\n System.out.println(Arrays.toString(soluzioneIniziale));\n return soluzioneIniziale;\n }", "private void restartArray() {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n Start.shemaArray[i][j].baseModel.state = 0;\n }\n }\n }", "public int[] reset() {\r\n return nums;\r\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public GoLBoard reset()\n\t{\n\t\treturn reset(new GoLRandomInitializer(setSize));\n\t}", "void reset()\n {\n reset(values);\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}", "public int[] reset() {\r\n\t\t\treturn this.initNums;\r\n\t\t}", "@Override\r\n\tpublic void reset() {\r\n\t\tthis.priorityElements = Lists.newArrayList(originalElements);\r\n\t\tCollections.shuffle(priorityElements);\r\n\t\tthis.currentElements = Lists.newArrayListWithExpectedSize(2 * originalElements.size());\r\n\t\tthis.currentElements.addAll(originalElements);\r\n\t}", "public void restore() {\n currentIm= originalIm.copy();\n }", "public void resetChangeableArrays(int[] reg)\n {\n valList = new LinkedList<Integer>();\n possibilityList = new LinkedList<Point>();\n for(int j = 0; j<accumulator.length; j ++)Arrays.fill(accumulator[j],0);\n //accumulator = zeroAccumulator;\n region = reg;\n \n }", "private int[] cloneArr(final int[] origArr) {\n return Arrays.copyOf(origArr, origArr.length);\n }", "public void reset_array() {\r\n\t\tfor(int i=0;i<9;i++) {\r\n\t\t\ts[i]=\"\";\r\n\t\t}\r\n\t}", "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 }", "public int[] shuffle() {\n\t\t\tif (originalArr == null)\n\t\t\t\treturn null;\n\t\t\tint randomArr[] = originalArr.clone();\n\t\t\tfor (int i = 1; i < originalArr.length; i++) {\n\t\t\t\tint newIndex = random.nextInt(i + 1);\n\t\t\t\tswap(i, newIndex, randomArr);\n\t\t\t}\n\t\t\treturn randomArr;\n\t\t}", "public void reset() {\n for (int i = 0; i < this.numRows; i++) {\n this.rows[i] = new int[0];\n }\n for (int k = 0; k < this.numCols; k++) {\n this.cols[k] = new IntOpenHashSet();\n }\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 OccList reset()\n {\n size = 0;\n return this;\n }", "private void reset() {\n\t\tdata.clear();\n\t}", "public void reSize() {\n int newSize = arr.length * 2;\n arr = Arrays.copyOf(arr, newSize);\n }", "public void reset() {\n this.setIndex(0);\n }", "private void resetMask() {\n maskArray = new int [][]{\n {0,0,0,0},\n {0,0,0,0},\n {0,0,0,0},\n {0,0,0,0}\n };\n }", "public void reset() {\n this.predictor.reset();\n for(int i=0; i<this.predictedIntraday.length; i++) {\n this.predictedIntraday[i] = 0;\n }\n }", "public void reset() {\n\t\tlength = 0;\n\t}", "@Override\n public void resetAllValues() {\n }", "private static void modifyArray(int[] array) {\n\t\t\n\t\tarray[0] = 99;\n\t\t\n\t\tarray = new int[5] ;\n\t\treturn;\n\t}", "public GoLBoard reset(GoLInitializer myInitializer)\n\t{\n \tmyGoLCell = myInitializer.getCellArray();\n \treturn this;\n\t}", "protected void recycleArray(Bitmap[][] array)\n\t{\n\t\tint length = array.length;\n\t\tfor(int i = 0; i < length; i++)\n\t\t{\n\t\t\tif(array[i] != null)\n\t\t\t{\n\t\t\t\tint length2 = array[i].length;\n\t\t\t\tfor(int j = 0; j < length2; j++)\n\t\t\t\t{\n\t\t\t\t\tif(array[i][j] != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray[i][j].recycle();\n\t\t\t\t\t\tarray[i][j] = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void resetGrid() {\n grid = new byte[grid.length];\n }", "public void reset() {\n\t\tinit(0, 0, 1, false);\n\t}", "@Override\n public void clear() {\n array = null;\n }", "@Override\n\tpublic void resetToExisting() {\n\t\t\n\t}", "private void reallocate() {\n capacity = 2 * capacity;\n ElementType[] newData = (ElementType[]) new Object[DEFAULT_INIT_LENGTH];\n System.arraycopy(elements, 0, newData, 0, size);\n elements = newData;\n }", "public static void fillArray() {\r\n\t\tfor (int i = 0; i < myOriginalArray.length - 1; i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tmyOriginalArray[i] = rand.nextInt(250);\r\n\t\t}\r\n\t\t// Copies original array 4 times for algorithm arrays\r\n\t\tmyBubbleArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmySelectionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyInsertionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyQuickArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t}", "public void reset() {\n this.index = this.startIndex;\n }", "protected void recycleArray(Bitmap[] array)\n\t{\n\t\tint length = array.length;\n\t\tfor(int i = 0; i < length; i++)\n\t\t{\n\t\t\tif(array[i] != null)\n\t\t\t{\n\t\t\t\tarray[i].recycle();\n\t\t\t\tarray[i] = null;\n\t\t\t}\n\t\t}\n\t}", "public DynamicArray<E> copy(DynamicArray<E> array) {\n synchronized (this) {\n return this.array;\n }\n }", "public void reset() {\n\t\t\t\t\r\n\t\t\t}", "public void reset() {\n\t\tfor (int i=0; i < this.WAYS; i++) {\n\t\t\tthis.cache[i] = new Line(this.alpha[i], REPL_VAL);\n\t\t}\n\t\t// set mru\n\t\tthis.cache[this.WAYS-1].state = INSERT_VAL;\n\t}", "public int[] cloneMemory(){\n return memory.clone();\n }", "public void reset () {\n\t\topen();\n\t\ttry {\n\t\t\tcontainer.setLength(0);\n\t\t\treservedBitMap.setLength(0);\n\t\t\tupdatedBitMap.setLength(0);\n\t\t\tfreeList.setLength(0);\n\t\t\tsize = 0;\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tthrow new WrappingRuntimeException(ie);\n\t\t}\n\t}", "public void resetField() {\n setFields(new boolean[getLength()][getHeight()]);\n }", "@Override\r\n\t\t\tpublic void reset() {\n\t\t\t\t\r\n\t\t\t}", "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}", "@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 }", "private void trimArray()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"[INFO] <RADIOBUTTON_PANEL_BUILDER> Running trimArray\");\r\n\t\t\t\r\n\t\t\tJRadioButton[] newArray = new JRadioButton[nextRadioButtonLocation]; // Create a new array of the correct size\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < nextRadioButtonLocation; i++) // For each object in the array\r\n\t\t\t{\r\n\t\t\t\tnewArray[i] = radioButtons[i]; // Copy the object\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tradioButtons = newArray; // Store the new trimmed array in components\r\n\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "private void reallocate(){\n capacity = 2 * capacity;\n theData = Arrays.copyOf(theData, capacity);\n }", "public void reset () {}", "public void reset() {\n\n\t}", "@Override\r\n\tpublic void reset()\r\n\t{\r\n\t}", "@Override\n\t\tprotected void reset()\n\t\t{\n\t\t}", "private final void restoreOriginalGraph() {\n // Safeguard against multiple restores\n if (startIndex == -1) return;\n \n markEdgesFrom(startIndex, false);\n markEdgesFrom(endIndex, false);\n markHasEdgeToGoal(false);\n nOutgoingEdgess[endIndex] = endOriginalSize;\n nOutgoingEdgess[startIndex] = startOriginalSize;\n nEdges = originalNEdges;\n\n nNodes = originalSize;\n startIndex = -1;\n endIndex = -1;\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 }", "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}", "public void reset(final byte[] treeData) {\n \t\traw = treeData;\n \t\trawPtr = 0;\n \t}", "protected abstract void reset();", "public void reset() {\r\n\t\tcards.addAll(dealt);\r\n\t\tdealt.clear();\r\n\t}", "public void reset() {\n\n }", "public OpRewriter reset() {\n result = OpSequence.create();\n return this;\n }", "public static int[] copy(int[] theArray) {\n\n return theArray.clone();\n }", "private static void resetGroupLineArrays() {\n // Reset the arrays to make sure that we have uptodate information in them\n itemsArray = null;\n itemsArrayForAlterations = null;\n itemsArrayForOpenDeposit = null;\n }", "public T[] toArray() {\n return null;\n }", "@Override\n public void reset() \n {\n\n }", "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();" ]
[ "0.7683946", "0.697118", "0.68361205", "0.6714145", "0.6640303", "0.64434683", "0.6318128", "0.6288678", "0.62609303", "0.6259935", "0.6196086", "0.6185046", "0.6129283", "0.60915095", "0.601098", "0.60055953", "0.5967921", "0.59418577", "0.59418577", "0.59418577", "0.59418577", "0.59418577", "0.59418577", "0.59418577", "0.5872889", "0.5870918", "0.57786286", "0.5768219", "0.57543355", "0.5716322", "0.5685787", "0.56746763", "0.5663266", "0.5663077", "0.56539774", "0.5636272", "0.56317455", "0.5601983", "0.55621237", "0.5538473", "0.55365205", "0.5524326", "0.55232364", "0.5515195", "0.5507188", "0.54990935", "0.54981965", "0.54725003", "0.54724085", "0.54705334", "0.54596317", "0.54540956", "0.542261", "0.54031897", "0.5390596", "0.53796774", "0.5376527", "0.53748786", "0.53740066", "0.53673774", "0.5346156", "0.5341975", "0.53368694", "0.53350514", "0.5333946", "0.5333095", "0.53167206", "0.53167206", "0.53167206", "0.53167206", "0.5314903", "0.53133017", "0.52908844", "0.5282181", "0.5277244", "0.52719283", "0.52713454", "0.5267086", "0.52567065", "0.5256291", "0.5249986", "0.5246228", "0.5242759", "0.5241111", "0.52362406", "0.52356803", "0.52347755", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565" ]
0.6904059
2
Returns a random shuffling of the array.
public int[] shuffle() { int max = nums.length - 1; for (int i = 0; i < nums.length; i++) { int index = new Random().nextInt(max)%(max - i + 1) + i; int tmp = nums[i]; nums[i] = nums[index]; nums[index] = tmp; } return nums; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int[] shuffle() {\n int len = data_random.length;\n Random rand = new Random();\n for (int i = 0; i < len; i++) {\n int r = rand.nextInt(len);\n int temp = data_random[i];\n data_random[i] = data_random[r];\n data_random[r]=temp;\n }\n return data_random;\n }", "public int[] shuffle() {\n\t\t\tif (originalArr == null)\n\t\t\t\treturn null;\n\t\t\tint randomArr[] = originalArr.clone();\n\t\t\tfor (int i = 1; i < originalArr.length; i++) {\n\t\t\t\tint newIndex = random.nextInt(i + 1);\n\t\t\t\tswap(i, newIndex, randomArr);\n\t\t\t}\n\t\t\treturn randomArr;\n\t\t}", "public int[] shuffle() {\n int[] result = reset();\n\n Random rand = new Random();\n for (int i = 0; i < result.length; i++) {\n int j = rand.nextInt(result.length - i) + i;\n int tmp = result[i];\n result[i] = result[j];\n result[j] = tmp;\n }\n return result;\n }", "private static void shuffleArray(int[] array)\n {\n int index, temp;\n Random random = new Random();\n for (int i = array.length - 1; i > 0; i--)\n {\n index = random.nextInt(i + 1);\n temp = array[index];\n array[index] = array[i];\n array[i] = temp;\n }\n }", "Actor[] shuffle(Actor[] array) {\n for (int i = array.length; i > 0; i--) {\n int k = rand.nextInt(i);\n Actor tmp = array[k];\n array[k] = array[i - 1];\n array[i - 1] = tmp;\n }\n return array;\n }", "public static <T> void shuffle(T[] array){\n Random rnd = ThreadLocalRandom.current();\n for (int i = array.length - 1; i > 0; i--)\n {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n T a = array[index];\n array[index] = array[i];\n array[i] = a;\n }\n }", "public static <T> void shuffle(T[] array){\n Random rnd = ThreadLocalRandom.current();\n for (int i = array.length - 1; i > 0; i--)\n {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n T a = array[index];\n array[index] = array[i];\n array[i] = a;\n }\n }", "private static void shuffleArray(final int[] a) {\n for (int i = 1; i < a.length; i++) {\n int j = random.nextInt(i);\n int temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }\n }", "private static void shuffleArray(int[] ar) {\n Random rnd = ThreadLocalRandom.current();\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n int a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "public void shuffle();", "public int[] shuffle() {\r\n if (nums == null) return nums;\r\n int tmp = 0;\r\n \r\n int[] newNums = nums.clone();\r\n \r\n for (int i=1; i<newNums.length; i++) {\r\n int selectPos = rd.nextInt(i+1);\r\n tmp = newNums[i];\r\n newNums[i] = newNums[selectPos];\r\n newNums[selectPos] = tmp;\r\n }\r\n \r\n return newNums;\r\n }", "public static void shuffle(int[] array)\n {\n int n = array.length;\n for (int i = 0; i < n; i++)\n {\n // choose index uniformly in [0, i]\n //explicit conversion to int\n int r = (int) (Math.random() * (i + 1));\n swap(array,r,i);\n }\n }", "public int[] shuffle() {\n for (int i = nums.length - 1; i >= 0; i--) {\n swap(i, rnd.nextInt(i + 1));\n }\n \n return nums;\n }", "void shuffleArray(String[] ar) {\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n String a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "void shuffle();", "void shuffle();", "private static char[] shuffle(char[] array) {\n\t\tRandom rand = new Random();\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tint randIndex = rand.nextInt(array.length - 1);\n\t\t\tchar temp = array[i];\n\t\t\tarray[i] = array[randIndex];\n\t\t\tarray[randIndex] = temp;\n\t\t}\n\t\treturn array;\n\t}", "public static void shuffle(int[] a) {\r\n int N = a.length;\r\n for (int i = 0; i < N; i++) {\r\n int r = i + uniform(N-i); // between i and N-1\r\n int temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public void shuffle() {\n for (int i = size - 1; i > 0; i--) {\n swap(i, (int)(Math.random() * (i + 1)));\n }\n }", "public static void shuffle( int[] a ) {\n int N = a.length;\n \n for ( int i = 0; i < N; i++ ) {\n int r = i + uniform( N - i ); // between i and N-1\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public static int[] shuffle() {\n Random random = new Random();\n for (int i = 0; i < len; i++) {\n int j = random.nextInt(len);\n int temp = nums[i];\n nums[i] = nums[j];\n nums[j] = temp;\n }\n return nums;\n }", "static void shuffleArray(String[] ar)\r\n {\n Random rnd = ThreadLocalRandom.current();\r\n for (int i = ar.length - 1; i > 0; i--)\r\n {\r\n int index = rnd.nextInt(i + 1);\r\n // Simple swap\r\n String a = ar[index];\r\n ar[index] = ar[i];\r\n ar[i] = a;\r\n }\r\n }", "public int[] shuffle() {\n if (nums == null) {\n return null;\n }\n int[] a = nums.clone();\n for (int j = 1; j < a.length; j++) {\n // 类似蓄水池采样算法\n // i == j -> 1/(1+j)\n // j != j -> (1 - 1/(1+j)) * (1/j) = 1/(1/j)\n int i = random.nextInt(j + 1);\n swap(a, i, j);\n }\n return a;\n }", "public int[] shuffle() {\n int[] shuffle = nums.clone();\n for(int i = 0; i < shuffle.length; i++){\n int index = random.nextInt(i + 1);\n swap(shuffle,i,index);\n }\n return shuffle;\n }", "public int[] shuffle() {\n int i = random.nextInt(nums.length);\n int j = random.nextInt(nums.length);\n swap(temp, i , j);\n return temp;\n }", "public int[] shuffle() {\n int[] shuffle = new int[nums.length];\n int[] clone = nums.clone();\n int last = clone.length - 1;\n for(int i = 0; i < clone.length; i++){\n int index = random.nextInt(last + 1);\n shuffle[i] = clone[index];\n clone[index] = clone[last--];\n }\n return shuffle;\n }", "public int[] shuffle() {\n int[] res = new int[nums.length];\n int r;\n for (int i = 0; i < nums.length; i++) {\n r = random.nextInt(i + 1);\n res[i] = res[r];\n res[r] = nums[i];\n }\n\n\n return res;\n }", "static void shuffleArray(int[] ar) {\n Random rnd = new Random();\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n int a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "public int[] shuffle() {\n int[] random = new int[nums.length];\n for (int i = 0; i < nums.length; i++) {\n // generate a random between 0 ~ i\n int r = (int)(Math.random() * (i + 1));\n random[i] = random[r];\n random[r] = nums[i];\n }\n return random;\n }", "public static void shuffle( Object[] a ) {\n int N = a.length;\n for ( int i = 0; i < N; i++ ) {\n int r = i + uniform( N - i ); // between i and N-1\n Object temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public int[] shuffle() {\n\t\tRandom r = new Random();\n\t\tfor (int i = 0; i < this.nums.length; i++) {\n\t\t\tint index = r.nextInt(this.nums.length);\n\t\t\tif (i != index) {\n\t\t\t\tnums[i] = nums[i] ^ nums[index];\n\t\t\t\tnums[index] = nums[i] ^ nums[index];\n\t\t\t\tnums[i] = nums[i] ^ nums[index];\n\t\t\t}\n\t\t}\n\t\treturn nums;\n\t}", "public void shuffle() {\n for (int i = 0; i < this.cards.length ; i++ ) {\n double x = Math.floor(Math.random() * ((double)this.cards.length - (double)0)) + (double)0;\n Card temp = this.cards[i];\n this.cards[i]= this.cards[(int)x];\n this.cards[(int)x]= temp;\n }\n }", "public static int[] selectionShuffle(int[] arr) { \n int temp;\n int idx;\n for(int i = 0; i < arr.length; i ++){\n idx = (int) (Math.random() * arr.length);\n temp = arr[i];\n arr[i] = arr[idx];\n arr[idx] = temp;\n }\n return arr;\n }", "public static void shuffle(Object[] a) {\r\n int N = a.length;\r\n for (int i = 0; i < N; i++) {\r\n int r = i + uniform(N-i); // between i and N-1\r\n Object temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public int[] shuffle() {\n int[] shuffled = Arrays.copyOf(origin, origin.length);\n \n for (int i = shuffled.length - 1; i > 0; i--) {\n int index = random.nextInt(i + 1);\n int temp = shuffled[i];\n shuffled[i] = shuffled[index];\n shuffled[index] = temp;\n }\n return shuffled;\n }", "public static void shuffle(double[] a) {\r\n int N = a.length;\r\n for (int i = 0; i < N; i++) {\r\n int r = i + uniform(N-i); // between i and N-1\r\n double temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public static void shuffle( double[] a ) {\n int N = a.length;\n \n for ( int i = 0; i < N; i++ ) {\n int r = i + uniform( N - i ); // between i and N-1\n double temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public static void shuffle(String[] arrayList){\n int num=arrayList.length; \n for(int j=0;j<60;j++){ // the number of shuffling>50 times, so I choose 60 times\n for(int i=0;i<num;i++){ \n int index=(int)(Math.random()*num);\n //Swap the position of elements in the array at that index with the first element\n String temp=arrayList[i]; \n arrayList[i]=arrayList[index];\n arrayList[index]=temp;\n }}}", "public void shuffle()\r\n\t{\r\n\t\tRandom rand = ThreadLocalRandom.current();\r\n\t\t\r\n\t\tfor (int i = topCard; i > 0; i--)\r\n\t\t{\r\n\t\t\tint index = rand.nextInt(i + 1);\r\n\t\t\tString temp = cards[index];\r\n\t\t\tcards[index] = cards[i];\r\n\t\t\tcards[i] = temp;\r\n\t\t}\r\n\t}", "public int[] shuffle() {\n int[] shuffled = new int[length];\n for (int i = 0; i < length; i++)\n shuffled[i] = nums[i];\n for (int i = 0; i < length; i++) {\n int randomIndex = (int) (Math.random() * length);\n int temp = shuffled[i];\n shuffled[i] = shuffled[randomIndex];\n shuffled[randomIndex] = temp;\n }\n return shuffled;\n }", "static public <T> void shuffle(T[] a, RNG rng) {\r\n\r\n for (int i = a.length - 1; i > 0; i--) {\r\n int j = (int) rng.random((i + 1));\r\n //System.out.println(j);\r\n T x = a[i];\r\n a[i] = a[j];\r\n a[j] = x;\r\n }\r\n \r\n }", "private static void scrambleArray(int[] a, boolean randomize) {\n\t\tfor (int k = 0; k < a.length; k++)\n\t\t\ta[k] = k;\n\t\tif (randomize) // use unpredictable random shuffle\n\t\t{\n\t\t\tRandom gen = new Random();\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, gen.nextInt(a.length));\n\t\t\t}\n\t\t} else // use repeatable math formula for shuffle\n\t\t{\n\t\t\tint cell = (int) (a.length * 3.14159) % a.length;\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, cell);\n\t\t\t\tcell = (int) (cell * 3.14159) % a.length;\n\t\t\t}\n\t\t}\n\n\t}", "public static void shuffle(int data[]) {\n\n }", "public static int[] shuffle(int[] deck){\n\t\tRandom rnd = new Random();\n\t for (int i = deck.length - 1; i > 0; i--)\n\t {\n\t int index = rnd.nextInt(i + 1);\n\t int a = deck[index];\n\t deck[index] = deck[i];\n\t deck[i] = a;\n\t }\n\t return deck;\n\t}", "public int[] shuffle() {\r\n\t\t\tRandom r = new Random();\r\n\t\t\tint[] shuffle = new int[this.nums.length];\r\n\t\t\tint i = 0;\r\n\t\t\tMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();\r\n\t\t\twhile (i < this.nums.length) {\r\n\t\t\t\tint count = r.nextInt(this.nums.length);\r\n\t\t\t\tif (map.get(count) != null && map.get(count)) {\r\n\t\t\t\t} else {\r\n\t\t\t\t\tshuffle[i] = this.nums[count];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tmap.put(count, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn shuffle;\r\n\t\t}", "public void shuffle() {\n\t\tCollections.shuffle(inds);\n\t}", "public void shuffle() {\n\t\tCollections.shuffle(Arrays.asList(reel));\n\t}", "@Override\n public <T> T[] shuffle(T[] elements) {\n return super.shuffle(elements);\n }", "public void shuffle() {\n Collections.shuffle(this);\n }", "public void shuffle() {\r\n for (int i = 0; i < this.numCards; i++) {\r\n int spot = (int) (Math.random() * ((this.numCards - 1) - i + 1) + i);\r\n Card temp = cards[i];\r\n cards[i] = cards[spot];\r\n cards[spot] = temp;\r\n\r\n\r\n }\r\n }", "public paintIntegers[] shuffle(paintIntegers[] arr){\n paintIntegers[] arrayNew = new paintIntegers[arr.length];\n paintIntegers.initPaint(arrayNew);\n //updates n\n n = arr.length;\n for(int i = 0; i < arrayNew.length; i++){\n arrayNew[i].val = i + 1;\n }//init the array with 0 to n;\n for(int i = 0; i < arrayNew.length; i++){ // shuffles the array\n //random index past current -> thats why random\n int ridx = i + rand.nextInt(arrayNew.length - i);\n //swap values\n int temp = arrayNew[ridx].val;\n arrayNew[ridx].val = arrayNew[i].val;\n arrayNew[i].val = temp;\n }\n // new origarray array\n return arrayNew.clone();\n }", "static void shuffleArray(String[] ar) {\n Random rnd = new Random();\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n String a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "public static void scrambledArray(int[] array){\n Random rand=new Random();// use java.util.random method to scramble the index number\n for(int i=0;i<array.length;i++){\n int num=rand.nextInt(15);\n // swap the two different positioned values by swaping their index number \n int temp=array[i];\n array[i]=array[num];\n array[num]=temp; }\n }", "public abstract void shuffled();", "public Deck randomShuffle(){\n\t\tshuffleOnceRandom();\n\t\tshuffleOnceRandom();\n\t\treturn ourDeck;\n\t}", "public static List arrayShuffle(List arrayToShuffle)\n\t{\n\t\tCollections.shuffle(arrayToShuffle);\n\t\treturn arrayToShuffle;\n\t}", "public int[] shuffle() \n {\n List<Integer> al = new ArrayList(reset.length);\n //push all values of the original array onto an arraylist\n for(int i = 0; i < reset.length; i++)\n {\n al.add(reset[i]);\n }\n //shuffles the arraylist\n Collections.shuffle(al);\n return al.stream().mapToInt(Integer::intValue).toArray();\n }", "public void shuffle() {\n\t\tfor (int i = deck.length - 1; i > 0; i--) {\n\t\t\tint rand = (int) (Math.random() * (i + 1));\n\t\t\tCard temp = deck[i];\n\t\t\tdeck[i] = deck[rand];\n\t\t\tdeck[rand] = temp;\n\t\t}\n\t\tcardsUsed = 0;\n\t}", "void myshuffleArray(String[] ar1, String[] ar2) {\n for (int i = ar1.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i+1);\n // Simple swap\n String a1 = ar1[index];\n String a2 = ar2[index];\n ar1[index] = ar1[i];\n ar2[index] = ar2[i];\n ar1[i]=a1;\n ar2[i]=a2;\n }\n }", "public void shuffle() {\n\t\tfor (int i = 51; i > 0; i--) {\n\t\t\tint rand = (int) (Math.random() * (i + 1));\n\t\t\tint temp = deck[i];\n\t\t\tdeck[i] = deck[rand];\n\t\t\tdeck[rand] = temp;\n\t\t}\n\t\tcurrentPosition = 0;\n\t}", "public static void knuthShuffle(Comparable[] a) {\n int r, n = a.length;\n for (int i = 1; i < n; i++) {\n r = randInt(0, i);\n exch(a, i, r);\n }\n }", "public void Shuffle() {\n\t\tCollections.shuffle(cards);\n\t}", "public void shuffle()\n\t{\n\t\tHashSet<Integer> usedRandoms = new HashSet<Integer>();\n\t\tthis.currentCard = 0;\n\t\tint i= 0;\n\t\twhile (i < deck.length)\n\t\t{\n\t\t\tint another = this.rand.nextInt(NUMBER_OF_CARDS);\n\t\t\tif(!usedRandoms.contains(another))\n\t\t\t{\n\t\t\t\tCard temp = this.deck[i];\n\t\t\t\tthis.deck[i] = this.deck[another];\n\t\t\t\tthis.deck[another] = temp;\n\t\t\t\ti++;\n\t\t\t\tusedRandoms.add(another);\n\t\t\t}\n\t\t}\n\t}", "public int[] shuffle() {\n Collections.shuffle(list);\n int[] temp = new int[list.size()];\n for (int i = 0; i < list.size(); i++) {\n temp[i] = list.get(i);\n }\n return temp;\n }", "public void scramble(){\r\n for (int i = 0; i < data.length / 2; i++){\r\n int randomIndex1 = (int)(Math.random()*(data.length - 1));\r\n int randomIndex2 = (int)(Math.random()*(data.length - 1));\r\n swap(randomIndex1, randomIndex2);\r\n }\r\n }", "public void shuffle() {\r\n\t\tCollections.shuffle(cards);\r\n\t\t// : Shuffle with random seed each time, then we can save the seed\r\n\t\t// Collections.shuffle(cards, new Random(10));\r\n\t}", "public void shuffle(){\r\n Collections.shuffle(cards);\r\n }", "public void shuffle() {\r\n\t\tCollections.shuffle(cards);\r\n\t}", "private static void scrambleArray(Integer[] a, boolean randomize) {\n\t\tfor (int k = 0; k < a.length; k++)\n\t\t\ta[k] = k;\n\t\tif (randomize) {\n\t\t\tRandom gen = new Random();\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, gen.nextInt(a.length));\n\t\t\t}\n\t\t} else {\n\t\t\tint cell = (int) (a.length * 3.14159) % a.length;\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, cell);\n\t\t\t\tcell = (int) (cell * 3.14159) % a.length;\n\t\t\t}\n\t\t}\n\n\t}", "public static String [] randomizeArray(String[] array){\n Random rgen = new Random(); // Random number generator\n\n for (int i=0; i<array.length; i++) {\n int randomPosition = rgen.nextInt(array.length);\n String temp = array[i];\n array[i] = array[randomPosition];\n array[randomPosition] = temp;\n }\n\n return array;\n }", "public void shuffle() {\n\t\tCollections.shuffle(Shoe);\n\t}", "public void shuffle() {\n\t\tCollections.shuffle(cards);\n\t}", "public final <T> T random(T[] array) {\n return array[random(0, array.length)];\n }", "public void shuffle()\r\n {\r\n // We will start from the last element and swap the cards one by one. We actually\r\n // don't need to swap the last element.\r\n for (int i = valid - 1; i > 0; i --) { \r\n \r\n // By using Math.random, we will get a random integer from 0 to i\r\n int j = (int) ( (i+1) * Math.random()); \r\n \r\n // Swapping with the help of temp instance of Card Class.\r\n Card temp = cards[i]; \r\n cards[i] = cards[j]; \r\n cards[j] = temp; \r\n } \r\n // Prints the random array \r\n }", "public void shuffle(){\n Collections.shuffle(Arrays.asList(this.deck));\n }", "public void shuffle() {\n\n\tcardsLeft = cards.length;\n\tfor (int i=cards.length-1; i>=0; --i) {\n\n\t int r = (int)(Math.random()*(i+1)); // pick a random pos <= i\n\n\t Card t = cards[i];\n\t cards[i] = cards[r];\n\t cards[r] = t;\n\n\t}\n }", "public void shuffle() {\n\t\t\t/*\n\t\t\t * This is very different from the sort method because:\n\t\t\t * @ we decant the cards into an array list;\n\t\t\t * @ we use a library function to do the work;\n\t\t\t * The implementation you write for the sort method should\n\t\t\t * have *neither* of these characteristics.\n\t\t\t */\n\t\t\tList<Card> cards = new ArrayList<Card>();\n\t\t\twhile (!isEmpty()) {\n\t\t\t\tcards.add(draw());\n\t\t\t}\n\t\t\tCollections.shuffle(cards);\n\t\t\tfor (Card c: cards) {\n\t\t\t\tadd(c);\n\t\t\t}\n\t\t}", "public void shuffle() {\n Collections.shuffle(this.plateau);\n }", "public void shuffle() {\n Random rand = new Random();\n for(int i = 0; i < deck.length; i++) {\n // get random index past current index\n int randomVal = i + rand.nextInt(deck.length - i);\n // swaps randomly selected card with card at index i\n Card swap = deck[randomVal];\n deck[randomVal] = deck[i];\n deck[i] = swap;\n }\n }", "public void shuffle() {\n\t\tRandom randIndex = new Random();\n\t\tint size = cards.size();\n\t\t\n\t\tfor(int shuffles = 1; shuffles <= 20; ++shuffles)\n\t\t\tfor (int i = 0; i < size; i++) \n\t\t\t\tCollections.swap(cards, i, randIndex.nextInt(size));\n\t\t\n\t}", "public static String[] randomizeHand(String[] arrayShuffle){\n String[] combine=new String[5];\n int k=-1;\n for(int i=0;i<5;i++){\n int j=(int)(Math.random()*52);\n if(j==k){continue;} // use if statements to avoid from picking up the same item twice\n else{combine[i]=arrayShuffle[j];k=j;\n }}\n return combine;}", "public void shuffle() {\n\t\tfor (int i = 0; i < cards.size(); i++){\n\t\t\t//exchange card i with the random card from i to cards.size() - 1\n\t\t\tint j = Randoms.randomIntInRange(i, cards.size() - 1);\n\t\t\tT c1 = cards.get(i);\n\t\t\tT c2 = cards.get(j);\n\t\t\tcards.set(i, c2);\n\t\t\tcards.set(j, c1);\n\t\t}\n\t}", "public void shuffle(){\n Collections.shuffle(this.deckOfCards);\n }", "private void shuffle(ArrayList<Product> dataSet) {\n\t\tfor (int i = 0; i < dataSet.size(); i++) {\n\t\t\tint k = rand(0, i);\n\t\t\tProduct temp = dataSet.get(k);\n\t\t\tdataSet.set(k, dataSet.get(i));\n\t\t\tdataSet.set(i, temp);\n\t\t}\t\n\t}", "public static void shuffle(int[] deck){\n //temporary variable for swapping the values\n int storage = 0;\n //random integer\n int randomInt;\n for(int i = 0; i < deck.length; i++){\n //set the variable equal to a random integer every time\n randomInt = (int) (Math.random() * (deck.length));\n //store the original deck[i] in storage\n //swap deck[i] and deck[randomInt]\n storage = deck[i];\n deck[i] = deck[randomInt];\n deck[randomInt] = storage;\n }\n }", "public int[] shuffle() {\n\n Random random = new Random();\n int posizioneRandom;\n int i = 0;\n int[] shuffleArray = new int[soluzione.length];\n\n while(i < soluzione.length){\n\n posizioneRandom = random.nextInt(soluzione.length);\n\n if(shuffleArray[posizioneRandom] == 0){\n\n shuffleArray[posizioneRandom] = soluzione[i];\n i++;\n }\n\n continue;\n\n\n }\n\n soluzione = shuffleArray;\n\n return soluzione;\n\n }", "public void shuffle()\n\t{\n\t\tCollections.shuffle(card);\n\t}", "public static void arraySwaping(int array[]) {\r\n\r\n\t\tint temp, randInt;\r\n\r\n\t\tRandom rand = new Random();\r\n\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\r\n\t\t\trandInt = rand.nextInt(array.length);\r\n\r\n\t\t\ttemp = array[i];\r\n\t\t\tarray[i] = array[randInt];\r\n\t\t\tarray[randInt] = temp;\r\n\r\n\t\t}\r\n\r\n\t}", "public void shuffle() {\n Collections.shuffle((List<Nummer>) this.albumNummers);\n }", "public JumbleBoard shuffle()\n {\n\n for (int i = 0; i < dice.length; i++)\n {\n for (int j = 0; j < dice[i].length; j++)\n {\n int a = random.nextInt(dice.length);\n int b = random.nextInt(dice[i].length);\n\n char c = dice[i][j];\n dice[i][j] = dice[a][b];\n dice[a][b] = c;\n\n }\n }\n\n return this;\n\n }", "public void shuffle() {\n Collections.shuffle(deck);\n }", "public void shuffle() {\n Collections.shuffle(deck);\n }", "public void shuffle(){\n //After shuffling dealing starts at deck[0] again\n currentCard = 0;\n //for each card , pick another random card and swap them\n for(int first = 0; first < deck.length; first++){\n int second = randomNumbers.nextInt(NUMBER_OF_CARDS);\n\n //Swap Method to swap current card with randomly selected card\n Card temp = deck[first];\n deck[first] = deck[second];\n deck[second] = temp;\n }\n }", "public void shuffle() {\n List<Card> shuffledCards = new ArrayList<>(52);\n while (cards.size() > 0) {\n int index = random.nextInt(cards.size());\n shuffledCards.add(cards.remove(index));\n }\n cards = shuffledCards;\n }", "private static void __exercise37(final int[] a) {\n final int N = a.length;\n for (int i = 0; i < N; ++i) {\n final int r = StdRandom.uniform(N);\n final int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "private static void __exercise36(final int[] a) {\n final int N = a.length;\n for (int i = 0; i < N; ++i) {\n final int r = i + StdRandom.uniform(N - i);\n final int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "private void shuffleCards(final ICard[] myCards) {\r\n ICard tmp;\r\n int rand;\r\n for (int i = ZERO; i < myCards.length; i++) {\r\n rand = rmd.nextInt(myCards.length);\r\n tmp = myCards[i];\r\n myCards[i] = myCards[rand];\r\n myCards[rand] = tmp;\r\n }\r\n }", "public static int[] shuffleArray(int[] array) {\n\t\tList<Integer> list = new ArrayList<>();\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tlist.add(array[i]);\n\t\t}\n\t\tCollections.shuffle(list, rand);\n\t\treturn list.stream().mapToInt(i->i).toArray();\n\t}", "void shuffleDeck() {\n\t\tfor(int index = 0; index < this.getNumberOfCards(); index++) {\n\t\t\tint randomNumber = index + (int)(Math.random() * (this.getNumberOfCards() - index));\n\t\t\tCard temp = this.cardsInDeck[randomNumber];\n\t\t\tthis.cardsInDeck[randomNumber] = this.cardsInDeck[index];\n\t\t\tthis.cardsInDeck[index] = temp;\n\t\t}\n\t}", "static void randomize(int arr[], Random r) {\n for (int i = arr.length - 1; i > 0; i--) {\n\n // Pick a random index from 0 to i\n int j = r.nextInt(i);\n\n // Swap arr[i] with the element at random index\n int temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n\n }" ]
[ "0.79378474", "0.778238", "0.77558976", "0.7748851", "0.769553", "0.7656073", "0.7656073", "0.764616", "0.7633283", "0.7544139", "0.74743384", "0.7454164", "0.74540776", "0.74223113", "0.7409494", "0.7409494", "0.73869467", "0.73639935", "0.73605025", "0.7356231", "0.73261786", "0.7321312", "0.7306085", "0.7276382", "0.72729564", "0.72695166", "0.7260634", "0.7243679", "0.7204779", "0.7203283", "0.7188711", "0.7155403", "0.7130805", "0.7122232", "0.7105189", "0.7098895", "0.7080142", "0.7075019", "0.7061934", "0.7054396", "0.7047806", "0.7045515", "0.7018579", "0.7004252", "0.7003321", "0.7000025", "0.6998794", "0.69971424", "0.6967456", "0.6964762", "0.69614476", "0.69488674", "0.69469607", "0.69213086", "0.69037575", "0.6841731", "0.6837485", "0.6814215", "0.6774359", "0.6764662", "0.6762832", "0.67605084", "0.67281485", "0.6720151", "0.6690804", "0.66904813", "0.66734195", "0.66725683", "0.6637918", "0.66316605", "0.6630798", "0.662338", "0.6614134", "0.66097707", "0.659406", "0.6593723", "0.658347", "0.65531224", "0.65498453", "0.654241", "0.6530047", "0.652262", "0.65125597", "0.65095896", "0.6500389", "0.647457", "0.6454686", "0.6451233", "0.64396155", "0.642977", "0.64169085", "0.64169085", "0.64026725", "0.63826126", "0.6369169", "0.6360915", "0.63487357", "0.63424647", "0.6330985", "0.63300604" ]
0.745568
11
Created by mmatosevic on 22.5.2015.
public interface UserRepository extends CrudRepository<User, Long> { Page<User> findAll(Pageable pageable); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public final void mo51373a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "private void init() {\n\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n protected void initialize() {\n\n \n }", "private void m50366E() {\n }", "private void strin() {\n\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "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\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void init() {\n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private Rekenhulp()\n\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 public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n void init() {\n }", "public void mo6081a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@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 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 protected void init() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "protected void mo6255a() {\n }", "@Override\n public void init() {}", "private void init() {\n\n\n\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "static void feladat4() {\n\t}", "void berechneFlaeche() {\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}" ]
[ "0.6013387", "0.5946135", "0.59022874", "0.5842465", "0.58174974", "0.57972765", "0.57972765", "0.57503843", "0.5743629", "0.57356703", "0.5732938", "0.57280856", "0.5726575", "0.57045335", "0.5662636", "0.5646996", "0.5644887", "0.5644692", "0.56250095", "0.5613656", "0.5611353", "0.5581782", "0.55599624", "0.5558548", "0.5545127", "0.5545127", "0.5539513", "0.5524453", "0.5524453", "0.5524453", "0.5524453", "0.5524453", "0.55158085", "0.5514247", "0.551419", "0.55141395", "0.5510933", "0.55000454", "0.54775804", "0.54733485", "0.5472778", "0.5468292", "0.5455661", "0.54485095", "0.54374504", "0.5416324", "0.5416324", "0.54162425", "0.540815", "0.540815", "0.540815", "0.540815", "0.540815", "0.540815", "0.540815", "0.5406035", "0.54049206", "0.5403483", "0.5403483", "0.5403483", "0.5395501", "0.5394905", "0.5394827", "0.5392725", "0.53802997", "0.53802997", "0.53802997", "0.5375564", "0.5375564", "0.53664345", "0.53573096", "0.5352347", "0.5349324", "0.53482836", "0.5347041", "0.5347041", "0.5347041", "0.5347041", "0.5347041", "0.5347041", "0.5345438", "0.5345438", "0.5345438", "0.5339674", "0.5337564", "0.53372604", "0.5334887", "0.53185886", "0.5308662", "0.5305151", "0.53029376", "0.5296857", "0.5292673", "0.52921534", "0.52887416", "0.5286897", "0.5286044", "0.52837014", "0.52776754", "0.52760327", "0.5271135" ]
0.0
-1
System.out.println(starDocument(new StarDocument(new ObjectId("5b506ce6d0485758b8baacf4"), new ObjectId("5b548051f6f11647bccd4fe6"), 3))); deleteStarDocument(new ObjectId("5b506ce6d0485758b8baacf4"), new ObjectId("5b548051f6f11647bccd4fe6")); System.out.println(""+getStarDocument(new ObjectId("5b506ce6d0485758b8baacf4"), new ObjectId("5b548051f6f11647bccd4fe6")));
public void main(String[] args) { System.out.println(starDocument(new StarDocument(new ObjectId("5b506ce6d0485758b8baacf4"), new ObjectId("5b548051f6f11647bccd4fe6"), 2))); System.out.println(getAverageStarDocument(new ObjectId("5b548051f6f11647bccd4fe6"))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n\t\tMongoClient client = new MongoClient();\n\t\tMongoDatabase db = client.getDatabase(\"db\");\n\t\tMongoCollection<Document> collection = db.getCollection(\"deleteTest\");\n\t\t\n\t\tcollection.drop();\n\t\t\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tcollection.insertOne(new Document().append(\"_id\", i));\n\t\t}\n\t\t\n\t\tcollection.deleteMany(Filters.gt(\"_id\", 4));\n\t\t\n\t\tfor (Document cur : collection.find().into(new ArrayList<Document>())) {\n\t\t\t// printJson(cur);\n\t\t}\n\t}", "@Test\n public void deletion() {\n repo.addDocument(\"test1\", \"{\\\"test\\\":1}\", \"arthur\", \"test version 1\", false);\n repo.addDocument(\"test1\", \"{\\\"test\\\":2}\", \"arthur\", \"this is version 2\", false);\n repo.removeDocument(\"test1\", \"arthur\", \"removal\");\n\n String result = repo.getDocument(\"test1\");\n assertTrue(result == null);\n\n }", "public String removeStudent (String id){\n studentSkills.deleteOne(new Document(\"_id\", new ObjectId(id)));\n Security.deleteOne(new Document(\"id\", id));\n return \"{\\\"result\\\":\\\"ok\\\"}\";\n}", "public String getStudent (String id){\n System.out.println(\"gettin student \"+id);\n String tnp = new String(\"\");\n Document query = new Document();\n query.put(\"_id\", new ObjectId(id));\n MongoCursor<Document> cursor = studentSkills.find(query).iterator();\n try {\n while(cursor.hasNext()) {\n Document c = cursor.next();\n System.out.println(c);\n tnp = c.toString();\n\n\n }\n } finally {\n cursor.close();\n }\n return tnp;\n}", "public int deleteItem(int itemId) {\n\t\t\t DB db = mongoClient.getDB(\"solar\");\n\t\t\t\t\t DBCollection dbCollection = db.getCollection(\"item_master\");\n\t\t\t\t\t BasicDBObject searchQuery = new BasicDBObject(\"item_id\",itemId );\n\t\t\t\t\t \n\t\t\t\t\t BasicDBObject newDocument = new BasicDBObject();\n\t\t\t\t\t newDocument.append(\"delete_status\", 1);\n\t\t\t\t\t //System.out.println(\"NEWDOCUMENT====================\"+newDocument);\n\t\t\t\t\t BasicDBObject setQuery = new BasicDBObject();\n\t\t\t\t\t setQuery.append(\"$set\", newDocument);\n\t\t\t\t\t WriteResult result = dbCollection.update(searchQuery, setQuery);\n\t\t\t\t\t //System.out.println(\"Result-----------\"+result.getN());\n\t\t\t\t return result.getN();\n\t\t}", "public double getSkillPknow (String stdId,String skill){\n double pknow = 0.0;\n Iterator<Document> cr;\n Document query = new Document();\n query = new Document(\"_id\", new ObjectId(stdId)).append(\"skills.name\",skill);\n MongoCursor<Document> cursor = studentSkills.find(query).iterator();\n try {\n // SKill already exists\n if (cursor.hasNext()){\n Document c = cursor.next();\n List<Document> skills = (List<Document>)c.get(\"skills\");\n cr = skills.iterator();\n try {\n while (cr.hasNext()){\n Document sk = cr.next();\n String name = (String)sk.get(\"name\");\n System.out.println(name);\n if (name!=null && name.equals(skill)){\n pknow = (double)sk.get(\"pknown\");\n System.out.println(pknow);\n }\n }\n // System.out.println(c.toJson(),skills);\n\n\n }\n finally {\n cursor.close();\n }\n }\n // SKill is new for student\n else{\n System.out.println(\"Adding no existing skill for user, with default values\");\n this.addSkill(stdId,skill,\"none\");\n return 0.3;\n\n }\n } finally {\n cursor.close();\n }\n return pknow;\n}", "DBObject executeSingle();", "public String updateSkill (String studentid,String skill,Double pknow){\n System.out.println(\"updating skill \"+skill+ \" student \"+studentid + \" pknow \"+pknow);\n String tnp = new String(\"\");\n Document query = new Document();\n query = new Document(\"_id\", new ObjectId(\n studentid)).append(\"skills.name\",skill);\n MongoCursor<Document> cursor = studentSkills.find(query).iterator();\n try {\n // SKill already exists\n if (cursor.hasNext()){\n Document c = cursor.next();\n c.put(\"skills.name\",skill);\n studentSkills.updateOne(c,new Document(\"$set\",new Document(\"skills.$.pknown\",pknow)));\n }\n // SKill is new for student\n else{\n System.out.println(\"Warning Skill does not exists, please add before !\");\n }\n } finally {\n cursor.close();\n }\n\n System.out.println(\"updating know of student\");\n return tnp;\n}", "public static void main(String[] args) {\n\t\tString reviewer=\"reviewer_\"; \n\t\tString client=\"client_\"; \n\t\tString review_text=\"review_text\"; \n\t\tString product=\"prod_\";\n\t\tint rating; \n\t\t\n\t\tMongoHelper m = new MongoHelper(); \n\t\tcoll = m.getCollectiono(); \n\t\t\n\t\tRandom rg=new Random(); \n\t\tSystem.out.println( \"reviewer \" + \"client \" +\n\t\t \" review_text \" + \" product \" ); \n\t\t\n\t\t client = \"cust_b\" ; \n\t\t for ( int pr=1; pr<5; pr++ ) {\n\t\t\t product = \"prod_a\" + pr; \n\t\t for ( int i=1 ; i< 5; ++i) {\n\t\t\t int rand=rg.nextInt(30); \n\t\t\t reviewer = \"reviewer_\" + rand; \n\t\t\t rating=rg.nextInt(10)+ 1; \n\t\t\t int d=rg.nextInt(200); \n\t\t\t Calendar cal= Calendar.getInstance();\n\t\t\t cal.add(Calendar.DATE, d*(-1) ); \n\t\t\t cal.add(Calendar.HOUR, d*(-1) );\n\t\t\t\t SimpleDateFormat sdf=new SimpleDateFormat(DATA_FORMAT_NOW); \n\t\t\t\t String review_date= sdf.format(cal.getTime()); \n\t\t\t\t ReviewData rd=new ReviewData(reviewer, client, review_text, product, rating, review_date); \n\t//\t\t System.out.println( reviewer + \" \" + client + \" \"+ \n\t//\t\t review_text + \" \"+ product + \" \" + rating + \" \"+ review_date); \n\t\t\t BasicDBObject doc = rd.getMongoDoc();\n\t\t\t System.out.println (doc); \n\t\t\t coll.insert(doc); \n\t\t }\n\t\t } \n\t\t\n\t\t System.out.println(\" ===============\"); \n\n\t\t DBCursor cursor=coll.find();\n\t\t\ttry {\n\t\t\t\tint i=1; \n\t\t\t\twhile (cursor.hasNext()) {\n\t\t\t\t\tDBObject obj=cursor.next(); \n\t\t\t\t\tSystem.out.println( \" db: \" + i + \"\\n\" + obj ); \n\t\t\t\t\ti++; \n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tcursor.close(); \n\t\t\t}\n\t\t\n\t\t\n\t}", "public String addSkill (String studentid,String skill,String params){\n System.out.println(\"adding skill \"+skill+ \" student \"+studentid);\n String tnp = new String(\"\");\n Document query = new Document();\n query = new Document(\"_id\", new ObjectId(\n studentid)).append(\"skills.name\",skill);\n MongoCursor<Document> cursor = studentSkills.find(query).iterator();\n try {\n // SKill already exists\n if (cursor.hasNext()){\n System.out.println(\"Skill all ready exists !\");\n }\n // SKill is new for student\n else{\n System.out.println(\"query not working \");\n Document _skill = new Document();\n _skill.append(\"name\",skill);\n _skill.append(\"pknown\",0.3);\n _skill.append(\"subject\",\"math\");\n _skill.append(\"answer\",Arrays.asList());\n if (!params.equals(\"none\")){\n _skill.append(\"bktParams\",params);\n }\n // Insert to student skills\n Document std = new Document();\n std.append(\"_id\",new ObjectId(studentid));\n studentSkills.updateOne(std,new Document(\"$push\",new Document(\"skills\",_skill)));\n }\n } finally {\n cursor.close();\n }\n/* try {\n studentSkills.updateOne(query,new Document(\"$set\", new Document(\"pknown\", 0.3)));\n}\ncatch (Exception e){\n System.out.println(e);\n}*/\n System.out.println(\"updating know of student\");\n return tnp;\n}", "stars.StarListDocument.StarList getStarList();", "stars.StarListDocument.StarList addNewStarList();", "public void test1(){\n // 创建客户端\n MongoClient client = new MongoClient(\"localhost\");\n // 获得要查询的数据库\n MongoDatabase userdb = client.getDatabase(\"userdb\");\n // 得到要查询的集合\n MongoCollection<Document> spitcollection = userdb.getCollection(\"spit\");\n // 查询数据\n FindIterable<Document> documents = spitcollection.find();\n\n for (Document document: documents) {\n // 获得该字段的值\n System.out.println(\"id + \" + document.get(\"_id\"));\n // 获得该字段指定数据类型的值\n System.out.println(\"content : \" + document.getString(\"content\"));\n // 获得userid\n System.out.println(\"userid : \" + document.getString(\"userid\"));\n // 获得nickname\n System.out.println(\"nickname : \" + document.get(\"nickname\",String.class));\n // 获得integer id\n System.out.println(\"visits : \" + document.get(\"visits\",Integer.class));\n }\n }", "public int getObjectId()\r\n/* 71: */ {\r\n/* 72:152 */ return this.objectId;\r\n/* 73: */ }", "public String getObjectId();", "public void deleteOne(String id) {\n\t\t mongoTemplate.remove(new Query(Criteria.where(\"id\").is(id)), AsxDataVO.class); \r\n\t}", "public static void main(String args[]) throws IOException {\n\t\tsetUpMyDatabase();\n\t\tSystem.out.println(\"Collection GRADES current size: \" + collection.count());\n\t\t\n\t\t// List<Document> myDocsToBeDelete = new ArrayList<>();\n\n\t\t// https://docs.mongodb.com/manual/reference/operator/aggregation/match/\n\t\t// https://docs.mongodb.com/manual/reference/operator/aggregation/eq/\n\t\t// https://docs.mongodb.com/manual/reference/method/db.collection.group/\n\t\t// https://docs.mongodb.com/manual/reference/operator/aggregation/group/\n\t\t\n\t\t// db.grades.aggregate( { \"$match\" : { \"type\" : \"homework\" } }, { '$group': { '_id' : { student_id : \"$student_id\", type : \"$type\" }, 'min' : { '$min' : '$score' } } }, {'$sort':{'_id':-1}}, {'$limit':1000});\n\t\tList<Document> myDocsToBeDelete = collection.aggregate(Arrays.asList(\n\t\t\t\tnew Document(\"$match\", new Document(\"type\", \"homework\")),\n\t\t\t\tnew Document(\"$group\", \n\t\t\t\t\t\tnew Document(\"_id\", new Document(\"student_id\", \"$student_id\").append(\"type\", \"$type\"))\n\t\t\t\t\t\t.append(\"min\", new Document(\"$min\", \"$score\"))),\n\t\t\t\tnew Document(\"$sort\", new Document(\"_id\", -1)), new Document(\"$limit\", 1000)))\n\t\t\t\t.into(new ArrayList<Document>())\n\t\t\t\t\t.stream().flatMap(d -> Stream.of(new Document(\"student_id\", ((Document)d.get(\"_id\")).get(\"student_id\"))\n\t\t\t\t\t\t\t.append(\"type\", \"homework\")\n\t\t\t\t\t\t\t.append(\"score\", d.get(\"min\"))))\n\t\t\t\t\t.collect(Collectors.toList());\n\n\t\tmyDocsToBeDelete.forEach(d -> collection.deleteOne(Filters.and(\n\t\t\t\tFilters.eq(\"student_id\", d.get(\"student_id\")), Filters.eq(\"type\", \"homework\"),Filters.eq(\"score\", d.get(\"score\")))));\n\t\t\n\t\tSystem.out.println(\"Collection GRADES current size: \" + collection.count());\n\t}", "public static void main(String[] args) {\n\t\tMongoClient client = new MongoClient(new MongoClientURI(\"mongodb://localhost:27017\"));\n\t\tMongoDatabase testDb = client.getDatabase(\"test\");\n\t\tMongoCollection<Document> crudTest = testDb.getCollection(\"crudTest\");\n\t\tcrudTest.drop();\n\t\t\n\t\tDocument smith = new Document().append(\"name\", \"Smith\")\n\t\t\t\t\t\t\t\t\t\t.append(\"age\", 30)\n\t\t\t\t\t\t\t\t\t\t.append(\"profession\", \"programmer\");\n\t\tHelpers.printJson(smith, true);\n\t\t\n\t\tcrudTest.insertOne(smith);\n\t\t\n\t\tsmith.remove(\"_id\");\t//removes the _id attribute from the document map\n\t\t\n\t\tcrudTest.insertOne(smith);\t//insert the documnet again with new id\n\t\t\n\t\tHelpers.printJson(smith, true);\n\t\t\n\t\tDocument jones = new Document().append(\"name\", \"Jones\")\n\t\t\t\t.append(\"age\", 32)\n\t\t\t\t.append(\"profession\", \"hacker\");\n\t\t\n\t\tDocument mike = new Document().append(\"name\", \"Mike\")\n\t\t\t\t.append(\"age\", 34)\n\t\t\t\t.append(\"profession\", \"tester\");\n\n\t\tcrudTest.insertMany(Arrays.asList(jones, mike));\n\t\t\n\t\tclient.close();\n\n\t}", "public IndexableDocument() {\n\t\tthis.id=new ObjectId();\n\t}", "public String getAllStudent (){\n MongoCursor<Document> cursor = studentSkills.find().iterator();\n String json = \"{\\\"result\\\":[\";\n boolean hasOne = false;\n while (cursor.hasNext()){\n Document c = (Document)cursor.next();\n json +=c.toJson()+\",\";\n hasOne = true;\n }\n if (hasOne)json = json.substring(0,json.length()-1);\n json+=\"]}\";\n return json;\n}", "@Override\r\n\tpublic UUID deleteDoc(UUID id) {\n\t\treturn null;\r\n\t}", "public String[] getSkillOfGroup (String exId){\n String[] sks = new String[100];\n Iterator<Document> cr;\n Document query = new Document();\n query = new Document(\"id\", new ObjectId(exId));\n MongoCursor<Document> cursor = exerciseAttr.find(query).iterator();\n try {\n // SKill already exists\n if (cursor.hasNext()){\n Document c = cursor.next();\n String group = (String)c.get(\"group\");\n\n\n\n }\n // SKill is new for student\n else{\n System.out.println(\">>>>> ERROR getting group <<<<<\");\n\n }\n } finally {\n cursor.close();\n }\n return sks;\n}", "public static void main(String[] args) {\n\n MongoClientOptions mongoClientOptions = MongoClientOptions.builder().connectionsPerHost(500).build();\n MongoClient mongoClient = new MongoClient(new ServerAddress(), mongoClientOptions);\n final MongoDatabase db = mongoClient.getDatabase(\"varun_db\");\n final MongoCollection<Document> person = db.getCollection(\"person\");\n for (Document doc : person.find()) {\n printDoc(doc);\n }\n person.drop();\n for(int i=0;i<10;i++) {\n Document smith = new Document(\"name\", \"smith\"+i)\n .append(\"age\", 30)\n .append(\"profession\", \"programmer\"+i);\n person.insertOne(smith);\n }\n final Document document = person.find().first();\n printDoc(document);\n\n final ArrayList<Document> into = person.find().into(new ArrayList<Document>());\n for (Document doc : into)\n printDoc(doc);\n\n final MongoCursor<Document> mongoCursor = person.find().iterator();\n try {\n while (mongoCursor.hasNext())\n printDoc(mongoCursor.next());\n } finally {\n mongoCursor.close();\n }\n\n System.out.println(\"total count is \"+ person.count());\n\n System.out.println(\"filter\");\n Bson filterDoc=new Document(\"name\",\"smith9\");\n final FindIterable<Document> filter = person.find().filter(filterDoc);\n for(Document doc:filter)\n printDoc(doc);\n Bson filterDoc2=eq(\"name\",\"smith8\");\n final FindIterable<Document> filter2 = person.find().filter(filterDoc2);\n for(Document doc:filter2)\n printDoc(doc);\n\n }", "public static String get() {\n\t\treturn new ObjectId()+\"\";\n\t}", "@Override\n public void resetObjectId() {\n }", "@Override\n public void handleDelete(MemoryBatchMessage msg, String dpSchemaName) {\n System.out.println(\"Primary keys of the deletion are \" + msg.getDpSinkRecords().keySet()\n .stream().map(pk -> \"'\" + pk.getCompositeValue() + \"'\").collect(Collectors.joining(\", \")));\n MongoCollection<Document> collection = MongoDBHelper.INSTANCE.getCollection(\"test\", \"c1\");\n }", "public String[] getStudentSkills (String stdId,String exId){\n String[] sks = new String[100];\n Iterator<Document> cr;\n Document query = new Document();\n/* if (!exId.equals('none')){\n dbi.getSkillOfGroup(exId);\n }\n */\n query = new Document(\"_id\", new ObjectId(stdId));\n MongoCursor<Document> cursor = studentSkills.find(query).iterator();\n try {\n // SKill already exists\n if (cursor.hasNext()){\n Document c = cursor.next();\n List<Document> skills = (List<Document>)c.get(\"skills\");\n cr = skills.iterator();\n\n try {\n int i =0 ;\n while (cr.hasNext()){\n Document sk = cr.next();\n String name = (String)sk.get(\"name\");\n sks[i] = name;\n System.out.println(\"getting skill\");\n System.out.println(name);\n i++;\n }\n // System.out.println(c.toJson(),skills);\n\n\n }\n finally {\n cursor.close();\n }\n }\n // SKill is new for student\n else{\n /*System.out.println(\"Adding no existing skill for user, with default values\");\n this.addSkill(stdId,skill);\n return 0.3;*/\n\n }\n } finally {\n cursor.close();\n }\n return sks;\n}", "public ObjectId() {\n\t\tthis(new Date());\n\t}", "public String[] getStudentSkills (String stdId){\n String[] sks = new String[100];\n Iterator<Document> cr;\n Document query = new Document();\n query = new Document(\"_id\", new ObjectId(stdId));\n MongoCursor<Document> cursor = studentSkills.find(query).iterator();\n try {\n // SKill already exists\n if (cursor.hasNext()){\n Document c = cursor.next();\n List<Document> skills = (List<Document>)c.get(\"skills\");\n cr = skills.iterator();\n\n try {\n int i =0 ;\n while (cr.hasNext()){\n Document sk = cr.next();\n String name = (String)sk.get(\"name\");\n sks[i] = name;\n System.out.println(\"getting skill\");\n System.out.println(name);\n i++;\n }\n // System.out.println(c.toJson(),skills);\n\n\n }\n finally {\n cursor.close();\n }\n }\n // SKill is new for student\n else{\n /*System.out.println(\"Adding no existing skill for user, with default values\");\n this.addSkill(stdId,skill);\n return 0.3;*/\n\n }\n } finally {\n cursor.close();\n }\n return sks;\n}", "public String getAnswer (String exId,String ans1){\n String ans =\"\";\n Document query = new Document();\n query.put(\"id\",exId);\n MongoCursor<Document> cursor = exerciseAttr.find(query).iterator();\n try {\n // SKill already exists\n if (cursor.hasNext()){\n Document c = cursor.next();\n ans = (String)c.get(\"response\");\n System.out.println(\"ans \"+ans+\" \"+ans1);\n if (ans.equals(ans1)){\n ans = \"true\";\n }\n else ans =\"false\";\n\n }\n // SKill is new for student\n else{\n System.out.println(\"Warning exerciseAttr does not exists, please add before !\");\n\n }\n } finally {\n cursor.close();\n }\n return ans;\n}", "@Override\n\tpublic Boolean deleteDocument(Document document) {\n\t\treturn null;\n\t}", "public String getExercicesById (String id){\n String json =\"\";\n Document query = new Document();\n query.put(\"id\",id);\n MongoCursor<Document> cursor = exerciseAttr.find(query).iterator();\n try {\n // SKill already exists\n if (cursor.hasNext()){\n Document c = cursor.next();\n List<String> subjects = (List<String>)c.get(\"subjects\");\n String spaceVector = (String)c.get(\"spaceVector\");\n String bktP = (String)c.get(\"bktParameters\");\n json = \"{\\\"skill\\\":\"+\"\\\"\"+subjects.get(0)+\"\\\",\\\"spaceVector\\\":\"+\"\\\"\"+spaceVector+\"\\\",\\\"bktP\\\":\"+\"\\\"\"+bktP+\"\\\"}\";\n\n\n }\n // SKill is new for student\n else{\n System.out.println(\"Warning Ids exerciseAttr does not exists, please add before !\");\n }\n } finally {\n cursor.close();\n }\n return json;\n}", "public static void main(String[] args) {\n\t\tMongoClient client = new MongoClient(\"localhost\", 27017);\n\t\t// getting access to database.. if not available, it will create new one with this name 'test'\n\t\tMongoDatabase database = client.getDatabase(\"test\");\n\t\t// getting Collections from database.if not available, it will create new one with this name 'Employee'\n\t\tMongoCollection<Document> collection = database.getCollection(\"Employee\");\n\t\t//put data in map Collection\n\t\t/*\n\t\t Map<String,Object> m=new HashMap<>();\n\t\t\tm.put(\"id\", \"500\");\n\t\t\tm.put(\"name\", \"krishna\");\n\t\t\tm.put(\"address\", \"mum\");\n\t\t\tm.put(\"phone\", \"546325\");\n\t\t*/\n\t\t/**\n\t\t * Map Collection can not be used to store data. for mongo, we have to use document class of mongo\n\t\t * To store multiple document at a time,add document in list collection and store.\n\t\t * e.g.,\n\t\t * \n\t\t */\n\t\t\n\t\t// Creating single documents to add in mongo collections\n\t\t/*\n\t\tDocument document = new Document();\n\t\tdocument.append(\"id\", \"200\");\n\t\tdocument.append(\"name\", \"radha\");\n\t\tdocument.append(\"address\", \"pune\");\n\t\tdocument.append(\"phone\", \"78564\");\n\t\t*/\n\t\t/*//adding document to collection\n\t\tcollection.insertOne(document);*/\n\t\t\n\t\t// Creating multiple documents to add in mongo collections\n\t\t/**\n\t\t * Creating multiple documents instances\n\t\t */\n\t\tDocument document1 = new Document();\n\t\tdocument1.append(\"id\", \"300\");\n\t\tdocument1.append(\"name\", \"rani\");\n\t\tdocument1.append(\"address\", \"kol\");\n\t\tdocument1.append(\"phone\", \"56975\");\n\t\t\n\t\tDocument document2 = new Document();\n\t\tdocument2.append(\"id\", \"301\");\n\t\tdocument2.append(\"name\", \"sushma\");\n\t\tdocument2.append(\"address\", \"shimla\");\n\t\tdocument2.append(\"phone\", \"65987\");\n\t\t\n\t\tDocument document3 = new Document();\n\t\tdocument3.append(\"id\", \"302\");\n\t\tdocument3.append(\"name\", \"mamta\");\n\t\tdocument3.append(\"address\", \"delhi\");\n\t\tdocument3.append(\"phone\", \"78564\");\n\t\t\n\t\t/**\n\t\t * Adding multiple document instances in list Collection\n\t\t */\n\t\tList<Document> listOfDocuments=new ArrayList<>();\n\t\tlistOfDocuments.add(document1);\n\t\tlistOfDocuments.add(document2);\n\t\tlistOfDocuments.add(document3);\n\t\t\n\t\t//----------Calling insertMany(-) to save multiple document instances placed in list\n\t\n\t\tcollection.insertMany(listOfDocuments);\n\t\t\n\t\tSystem.out.println(\"documents inserted successfully\");\n\t\t// closing connection\n\t\tclient.close();\n\n\t}", "private void deleteHelper() {\n FirebaseFirestore db = FirebaseFirestore.getInstance();\n db.collection(\"posts\")\n .whereEqualTo(\"authorId\", MainActivity.currentUser.getUid())\n .whereEqualTo(\"published\", this.published)\n .get()\n .addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {\n @Override\n public void onSuccess(QuerySnapshot queryDocumentSnapshots) {\n for (QueryDocumentSnapshot q : queryDocumentSnapshots) {\n q.getReference().delete();\n }\n }\n });\n }", "@Override\n\tpublic Document find(int id) {\n\t\treturn null;\n\t}", "public String getUserID (String name){\n Document query = new Document();\n query.put(\"name\", name);\n MongoCursor<Document> cursor = studentSkills.find(query).iterator();\n if (cursor==null || !cursor.hasNext()) {\n System.out.println(\"here fails !\");\n System.out.println(cursor.hasNext());\n return \"none\";\n }\n else {\n Document c = cursor.next();\n return c.get(\"_id\").toString();\n }\n //return \"none\";\n }", "public void updateSingleRecord(){\n MongoCollection<Document> table = db.getCollection(\"user\");\n Document document = new Document();\n document.put(\"userType\", \"Free\");\n\n Document updateDocument=new Document(\"$set\", document);\n\n ObjectId id = null;\n\n try { id = new ObjectId(\"5ea41b16334a2657d0c26717\"); }\n catch (Exception e) { }\n\n\n table.updateOne(eq(\"_id\", id), updateDocument);\n }", "public String delete_mongo(long id, NeUser user) throws Exception {\n\n \t\t log.setLevel(Level.INFO);\n\t log.info(\"delete_mongo service operation started !\");\n\n\t\ttry{\n\t\t\tString method_return_message;\n\n\t\t\tmethod_return_message = mongo_Default_Activity_dao.delete_mongo(id, user);\n\n \t\t\tlog.info(\" Object returned from delete_mongo service method !\");\n\t\t\treturn method_return_message;\n\n\t\t}catch(Exception e){\n\n\t\t\tSystem.out.println(\"ServiceException: \" + e.toString());\n\t\t\tlog.error(\"delete_mongo service throws exception : \"+ e.toString());\n\n\t\t}\n\t\treturn null;\n\n\n\n\t}", "@Test\n public void delete() {\n try{\n repo.save(s);\n repot.save(t);\n repon.save(n);\n Tema t2 = new Tema(2, 0, 6, \"GUI\");\n Student s2 = new Student(2,221, \"Pop Ion\",\"pop.ion@gmail.com\",\"prof\");\n Nota n2 = new Nota(2,2,\"prof\", 3, \"cv\");\n repo.save(s2);\n repot.save(t2);\n repon.save(n2);\n repot.delete(2);\n repo.delete(2);\n repon.delete(\"22\");\n assert repo.size() == 1;\n assert repot.size() == 1;\n assert repon.size() == 1;\n }\n catch (ValidationException e){\n }\n }", "protected Integer deleteDocumentsByPath(String path) {\r\n\r\n\t\tInteger statusReturn = 0;\r\n\r\n\t\tObjectPath docPath = new ObjectPath(path);\r\n\r\n\t\tObjectIdentity<ObjectPath> objIdentity = new ObjectIdentity<ObjectPath>();\r\n\r\n\t\tobjIdentity.setValue(docPath);\r\n\r\n\t\tobjIdentity.setRepositoryName(REPOSITORY_NAME);\r\n\r\n\t\tObjectIdentitySet objectIdSet = new ObjectIdentitySet(objIdentity);\r\n\r\n\t\tDeleteProfile deleteProfile = new DeleteProfile();\r\n\r\n\t\tdeleteProfile.setDeepDeleteFolders(true);\r\n\r\n\t\tdeleteProfile.setDeepDeleteChildrenInFolders(true);\r\n\r\n\t\tOperationOptions operationOptions = new OperationOptions();\r\n\r\n\t\toperationOptions.setDeleteProfile(deleteProfile);\r\n\r\n\t\ttry {\r\n\r\n\t\t\tthis.objectService.delete(objectIdSet, operationOptions);\r\n\r\n\t\t\tstatusReturn = 1;\r\n\r\n\t\t} catch (CoreServiceException e) {\r\n\r\n\t\t\tlogger.error(ERROR_REPOSITORIO_EMC.concat(e.getLocalizedMessage()));\r\n\r\n\t\t} catch (ServiceException e) {\r\n\r\n\t\t\tlogger.error(ERROR_SERVICO_EMC.concat(e.getLocalizedMessage()));\r\n\r\n\t\t}\r\n\r\n\t\treturn statusReturn;\r\n\r\n\t}", "public Long getObjectId() {\n return objectId;\n }", "public static void main(final String[] args) throws Exception {\n MongoClient mongo = new MongoClient(\"localhost\", 27017);\n /**** Get database ****/\n // if database doesn't exists, MongoDB will create it for you\n DB db = mongo.getDB(\"enron\");\n DBCollection table = db.getCollection(\"demo\");\n BasicDBObject searchQuery = new BasicDBObject();\n searchQuery.put(\"_id\", 1);\n DBCursor cursor = table.find(searchQuery).limit(5);\n System.out.println(\"test\");\n System.out.println(JSON.serialize(cursor));\n\n }", "public void deleteAll() {\n\t\t mongoTemplate.remove(new Query(), COLLECTION);\n\t}", "public interface IDocumentDao extends DAO<Document, ObjectId> {\n\n Document findLatestByProductId(int productId);\n\n List<Document> findByProductIdLimit(int productId, long start, long limit);\n\n void update(Document document, float[] arrays);\n\n void add(int pid, float[] arrays);\n}", "@Test\n public void findById_2(){\n String firstName=\"prakash\",lastName=\"s\";\n int age=21;\n String city=\"chennai\", houseNo=\"c-1\";\n Address address1=new Address(city, houseNo);\n Employee employee1=new Employee(firstName,lastName,age,address1);\n employee1=mongo.save(employee1);\n Employee fetched=employeeService.findById(employee1.getId());\n Assertions.assertEquals(firstName, fetched.getFirstName());\n Assertions.assertEquals(lastName,fetched.getLastName());\n Assertions.assertEquals(employee1.getId(),fetched.getId());\n Assertions.assertEquals(age, fetched.getAge());\n\n }", "void insertOne(Document person);", "public K getSavedId() {\n if (dbObjects.length == 0) {\n throw new MongoException(\"No objects to return\");\n }\n if (dbObjects[0] instanceof JacksonDBObject) {\n throw new UnsupportedOperationException(\n \"Generated _id retrieval not supported when using stream serialization\");\n }\n return jacksonDBCollection.convertFromDbId(dbObjects[0].get(\"_id\"));\n }", "public String getSkillBktParams (String stdId, String skill){\n String p = new String(\"\");\n Iterator<Document> cr;\n Document query = new Document();\n query = new Document(\"_id\", new ObjectId(stdId));\n MongoCursor<Document> cursor = studentSkills.find(query).iterator();\n try {\n // SKill already exists\n if (cursor.hasNext()){\n Document c = cursor.next();\n List<Document> skills = (List<Document>)c.get(\"skills\");\n cr = skills.iterator();\n\n try {\n int i =0 ;\n while (cr.hasNext()){\n Document sk = cr.next();\n String name = (String)sk.get(\"name\");\n if (name!=null && name.equals(skill)){\n p = (String)sk.get(\"bktParams\");\n }\n else return \"\";\n\n }\n // System.out.println(c.toJson(),skills);\n\n\n }\n finally {\n cursor.close();\n }\n }\n // SKill is new for student\n else{\n return \"\";\n\n }\n } finally {\n cursor.close();\n }\n if (p==null) return \"\";\n return p;\n}", "public void del(String docId);", "@Test\n public void TestInfo(){\n THelper helper = mongoTemplate.findById(\"Y1nnMgn\",THelper.class);\n System.out.println(JSONObject.fromObject(helper).toString());\n }", "@Override\r\n\tpublic Ngo delete(Ngo obj) {\n\t\treturn null;\r\n\t}", "@org.junit.Test\r\n public void testRemoveReview1() throws Exception {\r\n System.out.println(\"removeReview1\");\r\n Long id = new Long(0);\r\n Review review = new Review(new Long(0), \"Max\", 9, \"It's excellent\");\r\n review = service.insertReview(review);\r\n Review result = service.removeReview(id);\r\n assertEquals(review, result);\r\n }", "int deleteByExample(DisproductExample example);", "public boolean deleteAggregatedObject(String templateName) {\n String queryString = \"{\\\"_id\\\": /.*\" + templateName + \"/}\";\n MongoQuery query = new MongoStringQuery(queryString);\n LOGGER.debug(\"The JSON query for deleting aggregated object is: {}\", query);\n return mongoDBHandler.dropDocument(aggregationDataBaseName, aggregationCollectionName, query);\n }", "public static void main_delete(String args[]){\n\t//public static void main(String args[]){\n\t\tQueryResponse solr_response = null;\n\n\t\tSolrConnection tmp_conn = new SolrConnection();\n\t\ttmp_conn.setSolrURL(\"http://localhost:8983/solr/Test1\");\n\t\t\n\t\tHashMap<String,String> params = new HashMap<String,String>();\n\t\tparams.put(\"rows\", \"16\");\n\t\t//tmp_conn.resetQueryParams();\n\t\ttmp_conn.setQueryParams(params);\n\t\t//tmp_conn.setQueryParams(\"q\",\"id:\"+QueryParser.escape(\"com.xinhuanet.js.www:http/2013-10/14/c_117706867_16.htm\"));\n\t\t\n\t\ttry {\n\t\t\tsolr_response = tmp_conn.getContent();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\tfor (SolrDocument doc:solr_response.getResults()){\n\t\t\t//String id = doc.getFieldValue(\"id\").toString();\n\t\t\n\t\tList<String> ids = new ArrayList<String>();\n\t\t//ids.add(\"3\");\n\t\t//ids.add(\"8\");\n\t\t//ids.add(\"7\");\n\t\tids.add(doc.getFieldValue(\"id\").toString());\n\t\ttmp_conn.deleteContentById(ids);\n\t\t}\n\t}", "public Integer getObjectId() {\n\t\treturn objectId;\n\t}", "public BasicDBObject getDocument () {\n\t\tBasicDBObject myDoc = new BasicDBObject(\"ID\",this.ID);\t\t\n\t\tmyDoc.append(\"CompanyID\", this.CompanyID);\n\t\tmyDoc.append(\"FormType\",this.FormType);\n\t\tmyDoc.append(\"FieldID\",this.FieldID);\n\t\tmyDoc.append(\"Context\", this.Context);\n\t\treturn myDoc;\n\t}", "public Object getObjectId() {\n\t\treturn null;\n\t}", "public interface ZoologieInvertebresMollusquesMapper extends MongoRepository<ZoologieInvertebresMollusques, String > {\n List<ZoologieInvertebresMollusques> findAll();\n ZoologieInvertebresMollusques findOne(String id);\n ZoologieInvertebresMollusques save(ZoologieInvertebresMollusques zoologieInvertebresMollusques);\n void delete(ZoologieInvertebresMollusques ZoologieInvertebresMollusques);\n}", "public BasicDBObject getMyDocument(){\n\n\t\t//create basic transaction attributes\n\t\tBasicDBObject mainDocument = new BasicDBObject();\n\t\tif(mongoId != null )\n\t\t\tmainDocument.put(\"_id\",mongoId);\n\t\tif(counter != null )\n\t\t\tmainDocument.put(\"counter\",counter);\n\t\tif(dateTimeAtStartSession != null )\n\t\t\tmainDocument.put(\"dateTimeAtStartSession\",dateTimeAtStartSession);\n\t\tif(dateTimeAtEndSession != null )\n\t\t\tmainDocument.put(\"dateTimeAtEndSession\",dateTimeAtEndSession);\n\t\tif(sesssionOpenedByUserId != null )\n\t\t\tmainDocument.put(\"sesssionOpenedByUserId\",\"\"+sesssionOpenedByUserId);\n if(sesssionClosedByUserId != null )\n mainDocument.put(\"sesssionClosedByUserId\",\"\"+sesssionClosedByUserId);\n\t\tif(sumOfSessionGross != null )\n\t\t\tmainDocument.put(\"sumOfSessionGross\",sumOfSessionGross);\n\t\tif(sumOfSessionNet != null )\n\t\t\tmainDocument.put(\"sumOfSessionNet\",sumOfSessionNet);\n\t\tif(sumOfSessionTax != null )\n\t\t\tmainDocument.put(\"sumOfSessionTax\",sumOfSessionTax);\n\t\tif(zReportPrint != null )\n\t\t\tmainDocument.put(\"zReportPrint\",zReportPrint);\n\t\tif(countOfReturnedArticles != null )\n\t\t\tmainDocument.put(\"countOfReturnedArticles\",countOfReturnedArticles);\n\t\tif(sumOfReturnedArticlesInclTax != null )\n\t\t\tmainDocument.put(\"sumOfReturnedArticlesInclTax\",sumOfReturnedArticlesInclTax);\n\t\tif(sumOfReturnedArticlesExclTax != null )\n\t\t\tmainDocument.put(\"sumOfReturnedArticlesExclTax\",sumOfReturnedArticlesExclTax);\n\t\tif(countOfDepositArticles != null )\n\t\t\tmainDocument.put(\"countOfDepositArticles\",countOfDepositArticles);\n\t\tif(sumOfDepositArticlesInclTax != null )\n\t\t\tmainDocument.put(\"sumOfDepositArticlesInclTax\",sumOfDepositArticlesInclTax);\n\t\tif(sumOfDepositArticlesExclTax != null )\n\t\t\tmainDocument.put(\"sumOfDepositArticlesExclTax\",sumOfDepositArticlesExclTax);\n\n\t\treturn mainDocument;\n\t}", "public DBDoc getObject(String id) {\n\t\treturn null;\n\t}", "public Boolean deleteData(Document addQuery,String collectionName) {\n\t\ttry {\n\t\t\t\n\t\t\tMongoDatabase database =dbConnection.mongoDBConnection();\n\t\t\tMongoCollection<Document> collection = database.getCollection(collectionName);\n\t\t\tcollection.deleteOne(addQuery);\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\treturn false;\n\t\t}\n\t}", "int deleteByExample(ScoreProductExample example);", "@Override\r\n\t\tpublic Boolean delete(long id) {\n\t\t\treturn documentDAO.delete(id);\r\n\t\t}", "@Test\n public void testSave_1(){\n String firstName=\"prakash\",lastName=\"s\";\n int age=21;\n String city=\"chennai\", houseNo=\"c-1\";\n Address address1=new Address(city, houseNo);\n Employee employee1=new Employee(firstName,lastName,age,address1);\n employee1=employeeService.save(employee1);\n String id=employee1.getId();\n Employee fetched=mongo.findById(id,Employee.class);\n Assertions.assertEquals(employee1.getId(),fetched.getId());\n Assertions.assertEquals(firstName,employee1.getFirstName());\n Assertions.assertEquals(lastName, employee1.getLastName());\n Assertions.assertEquals(age,employee1.getAge());\n }", "@Ignore\n @Test\n public void testGetDocument() throws Exception\n {\n \n int organizationId = 100;\n \n Util.commonServiceIPs=\"127.0.0.1\";\n EntityManager em = Util.getEntityManagerFactory(100).createEntityManager();\n \n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client esClient = ESUtil.getClient(em, platformEm, 1, false);\n \n String dataobjectId = \"081E9AB4157A5F628E93436DB994A1F1EADCF3EA\";\n \n JSONObject obj = ESUtil.getDocument(esClient,organizationId, dataobjectId, null);\n \n int k;\n }", "@Test\n public void testRemobeId(){\n DogHouse testDogHouseRemId = new DogHouse();\n Integer expected = 0;\n\n Dog testDog = new Dog(\"Scully\", new Date(), 56);\n Integer dogId = 56;\n testDogHouseRemId.add(testDog);\n\n testDogHouseRemId.remove(testDog);\n Integer actual = testDogHouseRemId.getNumberOfDogs();\n\n Assert.assertEquals(expected, actual);\n }", "public String getAuthData (String stdId){\n String tnp = new String(\"\");\n String id = new String(\"\");\n Boolean ad = false;\n\n Document query = new Document();\n query.put(\"id\",stdId);\n System.out.println(\"SECURITY GETTIN USER INFO\");\n\n MongoCursor<Document> cursor = Security.find(query).iterator();\n try {\n while(cursor.hasNext()) {\n System.out.println(\"SECURITY GETTIN USER INFO\");\n Document c = cursor.next();\n tnp =(String) c.get(\"token\");\n ad =(Boolean) c.get(\"admin\");\n id =(String) c.get(\"id\");\n }\n } finally {\n cursor.close();\n }\n return \"{\\\"token\\\":\\\"\"+tnp+\"\\\",\\\"admin\\\":\"+ad+\",\\\"id\\\":\\\"\"+id+\"\\\"}\";\n}", "Mono<Long> deleteReactive(String collection);", "public static void main(String[] args) throws UnknownHostException {\n\n BasicDBObject document = new BasicDBObject();\n// document.put(\"id\",1);\n document.put(\"term\",0);\n document.put(\"index\", 0);\n document.put(\"decree\", \"UNKNOWN\");\n table.insert(document);\n\n /**** Find and display ****/\n BasicDBObject searchQuery = new BasicDBObject();\n searchQuery.put(\"term\", \"1\");\n\n // Read db's collection and populate hash\n DBCursor cursor = table.find();\n System.out.println(\"cursor is\"+cursor);\n ArrayList<Integer> indexColl = new ArrayList<>();\n while (cursor.hasNext()) {\n// System.out.println(cursor.next());\n DBObject dbobject = cursor.next();\n System.out.println(dbobject.get(\"term\"));\n System.out.println(dbobject.get(\"index\"));\n System.out.println(dbobject.get(\"decree\"));\n int a = (int)dbobject.get(\"index\");\n System.out.println(a);\n indexColl.add(a);\n\n }\n Collections.sort(indexColl);\n lastLogIndex = indexColl.get(indexColl.size()-1);\n System.out.println(\"LastLogIndex\"+lastLogIndex);\n\n String dec = getDecree(11);\n if (dec == \"\") {\n System.out.println(\"Decree Not Found\");\n }\n System.out.println(\"Decree \" + dec);\n\n /* Read DB and populate logHash*/\n\n }", "public interface DesktopClassDoRepository extends MongoRepository<QuickBooksClass, UUID> {\n\n QuickBooksClass findByQuickBooksId(String quickBooksId);\n}", "public String getObjectId() {\r\n\t\treturn objectId;\r\n\t}", "@Delete\n Single<Integer> delete(Collection<Plant> plant);", "@Override\n public Set<URI> deleteAllWithPrefix(String keywordPrefix) {\n List<Document> searchDocs = searchDocumentsPrefix(keywordPrefix);\n HashSet<URI> uriSet = new HashSet<URI>(); \n CommandSet cSet = new CommandSet<>();\n for (Document d: searchDocs) {\n Function<URI, Boolean> func = docURI -> {\n boolean lambdaReturnValue = true;\n DocumentImpl doc = (DocumentImpl) d;\n if (doc == null) {\n lambdaReturnValue = false;\n }\n hashTable.put(docURI, doc);\n setWordCountOfDoc(doc);\n return lambdaReturnValue;\n };\n uriSet.add(d.getKey());\n GenericCommand cmd = new GenericCommand(d.getKey(), func);\n cSet.addCommand(cmd);\n }\n docTrie.deleteAllWithPrefix(keywordPrefix);\n cmdStack.push(cSet);\n return uriSet;\n\n\n\n // return null;\n }", "private RevObject getRevObject(ObjectId anId)\n{\n RevWalk rwalk = new RevWalk(getRepo());\n try { return rwalk.parseAny(anId); }\n catch(Exception e) { throw new RuntimeException(e); }\n}", "@Override\n\tpublic void delete(NewsCollection findOne) {\n\t\tnewsCollectionMapper.delete(findOne);\n\t\t\n\t}", "void deleteDocument(Long documentID) throws EntityNotFoundException;", "public int delete( Conge conge ) ;", "public static void main(String[] args) {\n\t\tMongoClientURI uri = new MongoClientURI(\n\t\t\t \"mongodb://admin:senha123@ds141208.mlab.com:41208/springclouddb\");\n\n\t\t\tMongoClient mongoClient = new MongoClient(uri);\n\t\t\tMongoDatabase database = mongoClient.getDatabase(\"springclouddb\");\n\t\t\tMongoCollection<Document> collection = database.getCollection(\"vehicle\");\n\t\t\t\n\t\t\tcollection.insertOne(new Document(\"key\", \"value\"));\n\t\t\tSystem.out.println(collection);\n\t\t\t\n\t}", "@Override\n\tpublic int deleteOne(String id) {\n\t\treturn 0;\n\t}", "@Override\n public DocumentSnapshot getSnapshot() {\n return null;\n }", "public String getDocumentNo();", "public String getDocumentNo();", "public String getDocumentNo();", "public interface BaseDAO {\n\n // utility method to remove the custom ID data structure in mongo db record result and restore ID Data structure to match model\n public String reformatDBObject(DBObject record);\n\n}", "public String getObjectId() {\n\t\treturn objectId;\n\t}", "public void remove(ObjectId id) {\n\t_filesCollection.remove(new BasicDBObject(\"_id\", id));\n\t_chunkCollection.remove(new BasicDBObject(\"files_id\", id));\n }", "long delete(String collection, String hkey);", "@Override\r\n public String getDocid() {\r\n return docid;\r\n }", "@Repository\npublic interface PurchaseRepository extends MongoRepository<Purchase, UUID>\n{\n Collection<Purchase> findPurchaceByUserId(Integer userId);\n}", "@DELETE\r\n @Path(\"{id}\")\r\n public void remove(@PathParam(\"id\") Integer id) throws InternalServerErrorException {\r\n LOGGER.info(\"Peticion de borrado de documento\");\r\n Document document = new Document();\r\n document.setId(id);\r\n try {\r\n ejb.deleteDocument(document);\r\n } catch (DeleteException ex) {\r\n LOGGER.warning(\"ERROR a la hora de borrar un documento\");\r\n throw new InternalServerErrorException(\"Erro al borrar el documento\");\r\n }\r\n}", "public Object getObject() {\n return getWildcard();\n }", "public MongoWriter() {\n\t\tmongoClient = new MongoClient(\"localhost\");\n\t\tMongoDatabase database = mongoClient.getDatabase(\"ai\");\n\t\tminPathsCollection = database.getCollection(\"min_paths\");\n\t\tedgesCollection = database.getCollection(\"edges\");\n\t\t// clear before starting\n\t\tminPathsCollection.drop();\n\t\tedgesCollection.drop();\n\t}", "public int delete(o dto);", "int deleteByExample(TbSnapshotExample example);", "public int getObjectId() {\n\t\t\treturn objectId;\n\t\t}", "BsonToken getCurrentToken();", "SingleDocumentModel getCurrentDocument();", "public static void main(String[] args){\n MongoClient mongoClient = new MongoClient(\"localhost\", 27017);\n\n //Creating a Mongo database\n MongoDatabase mongoDatabase = mongoClient.getDatabase(\"test\");\n\n //Creating a collection\n MongoCollection mongoCollection = mongoDatabase.getCollection(\"user\");\n\n //save(mongoCollection);\n //findAll(mongoCollection);\n //findByPosition(mongoCollection);\n //findByPositionAndSalary(mongoCollection);\n //updateOne(mongoCollection);\n //updateMany(mongoCollection);\n //replaceOne(mongoCollection);\n //deleteOne(mongoCollection);\n //deleteMultiple(mongoCollection);\n //sort(mongoCollection);\n //limit(mongoCollection);\n //aggregation(mongoCollection);\n //aggregationWithUsingProject(mongoCollection);\n }", "private void delete() {\n\n\t}" ]
[ "0.61106074", "0.61078274", "0.610587", "0.5973134", "0.57626987", "0.57618445", "0.5702642", "0.56204015", "0.5531279", "0.55125034", "0.5492644", "0.54906857", "0.5469754", "0.5426397", "0.5420924", "0.53933847", "0.5363516", "0.5329165", "0.5274708", "0.5263451", "0.52498776", "0.5247483", "0.5210492", "0.52073586", "0.5201705", "0.5193019", "0.5186347", "0.51751935", "0.5151522", "0.51473194", "0.5126249", "0.51247317", "0.5044974", "0.5039344", "0.5023145", "0.5015266", "0.50084865", "0.5005978", "0.4968858", "0.49653944", "0.49641925", "0.4928182", "0.49203455", "0.49058115", "0.49026924", "0.48978883", "0.48671135", "0.48658627", "0.48647726", "0.4852268", "0.485094", "0.4850688", "0.48500603", "0.48462304", "0.48450646", "0.48363864", "0.4830933", "0.48248914", "0.48228103", "0.48192307", "0.48186836", "0.48110142", "0.4810473", "0.48032245", "0.4791194", "0.47810113", "0.47563654", "0.47552732", "0.47536272", "0.4747044", "0.47466922", "0.47137782", "0.47118005", "0.4711347", "0.47109532", "0.4710903", "0.47096708", "0.47027886", "0.47023368", "0.4690684", "0.46848878", "0.468392", "0.468392", "0.468392", "0.46838635", "0.4680977", "0.46790478", "0.46771032", "0.4674019", "0.46709055", "0.46704143", "0.46696752", "0.46695435", "0.46634042", "0.46585104", "0.46566367", "0.4655255", "0.4644398", "0.46366695", "0.46365866" ]
0.6852054
0
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_person_center, container, false); CircleImageView headerIv = (CircleImageView) view.findViewById(R.id.head_iv); final MaterialTabHost tabHost = (MaterialTabHost) view.findViewById(R.id.content_tbhost); pager = (ViewPager) view.findViewById(R.id.person_viewpager); // init view pager initFraments(); PersonViewPagerAdapter pagerAdapter = new PersonViewPagerAdapter(getChildFragmentManager()); pager.setAdapter(pagerAdapter); res = getResources(); // pager.setFocusableInTouchMode(false); pager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { // when user do a swipe the selected tab change tabHost.setSelectedNavigationItem(position); } }); // insert all tabs from pagerAdapter data for (int i = 0; i < pagerAdapter.getCount(); i++) { tabHost.addTab( tabHost.newTab() .setText(pagerAdapter.getPageTitle(i)) .setTabListener(this) ); } ImageLoader loader = ImageLoader.getInstance(); String url = Global.getmGlobalUser().getHeadIcon(); loader.displayImage(url, headerIv); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
when user do a swipe the selected tab change
@Override public void onPageSelected(int position) { tabHost.setSelectedNavigationItem(position); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onTabReselected(int position);", "public void tabSelected();", "@Override\r\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n viewPager.setCurrentItem(tab.getPosition());\r\n\t\t\r\n\t}", "@Override\n public void onTabSelected(TabLayout.Tab tab) {\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconSelected), PorterDuff.Mode.SRC_IN);\n\n // set the current page position\n current_page = tab.getPosition();\n\n // if the current page is the ListMatesFragment, remove the searchView\n if(mToolbar_navig_utils!=null){\n if(current_page==2)\n mToolbar_navig_utils.getSearchView().setVisibility(View.GONE);\n else\n mToolbar_navig_utils.getSearchView().setVisibility(View.VISIBLE);\n }\n\n // refresh title toolbar (different according to the page selected)\n if(mToolbar_navig_utils !=null)\n mToolbar_navig_utils.refresh_text_toolbar();\n\n // Disable pull to refresh when mapView is displayed\n if(tab.getPosition()==0)\n swipeRefreshLayout.setEnabled(false);\n else\n swipeRefreshLayout.setEnabled(true);\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {\n mTabPager.setCurrentItem(tab.getPosition());\n // jumpFlag = true;\n }", "@Override\n public void onTabReselected(TabLayout.Tab tab) {}", "void onTabSelectionChanged(int tabIndex);", "@Override\r\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n\r\n\t\tviewPager.setCurrentItem(tab.getPosition());\r\n\r\n\t}", "@Override\n \t\t\tpublic void onTabSelected(\n \t\t\t\t\tcom.actionbarsherlock.app.ActionBar.Tab tab,\n \t\t\t\t\tandroid.support.v4.app.FragmentTransaction ft) {\n \t\t\t\tmViewPager.setCurrentItem(tab.getPosition());\n \t\t\t}", "protected abstract void doTabSelectionChanged(int oldIndex, int newIndex);", "@Override\n public void onTabReselected(TabLayout.Tab tab) {\n\n }", "@Override\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n viewPager.setCurrentItem(tab.getPosition());\n\t}", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {\n viewPager.setCurrentItem(tab.getPosition());\n }", "@Override\r\n public void onTabSelected(Tab tab, FragmentTransaction ft) {\n viewPager.setCurrentItem(tab.getPosition());\r\n }", "@Override\n public void onTabSelected(TabLayout.Tab tab) {\n mViewPager.setCurrentItem(tabLayout.getSelectedTabPosition());\n }", "@Override\n public void onTabSelected(TabLayout.Tab tab) {\n viewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n\t\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\t\n\t\t}", "@Override\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n\t\tvp.setCurrentItem(tab.getPosition());\n\t}", "@Override\n public void onTabSelected(Tab tab, FragmentTransaction ft) {\n viewPager.setCurrentItem(tab.getPosition());\n if (tab.getPosition() == 1) {\n HomeFragment homeFragment = (HomeFragment)getSupportFragmentManager()\n .findFragmentByTag(\"android:switcher:\"+viewPager.getId()+\":\"+tab.getPosition());\n homeFragment.init();\n }\n }", "public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {\n }", "@Override\n public void onTabChanged(LinearLayout selectedTab, int selectedIndex, int oldIndex) {\n Toast.makeText(MainActivity.this,\"Tab \"+ selectedIndex+\" Selected.\",Toast.LENGTH_SHORT).show();\n }", "public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {\n }", "@Override\r\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\r\n\t}", "@Override\r\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\r\n\t}", "@Override\n public void onTabSelected(TabLayout.Tab tab) {\n\n viewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\n\t}", "@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\n\t}", "@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\n\t}", "public void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t }", "@Override\n public void onTabSelected(TabLayout.Tab tab) {\n\n this.mPager.setCurrentItem(tab.getPosition());\n }", "@Override\r\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\r\n\t\t// on tab selected\r\n\t\t// showing respected fragment view at view pager\r\n\t\tviewPager.setCurrentItem(tab.getPosition());\r\n\t}", "public void tabChange() {\r\n\t}", "@Override\r\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\r\n\t}", "@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}", "@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}", "@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}", "@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}", "@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}", "@Override\n\tpublic void onTabChange() {\n\t}", "@Override\r\n\t\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t}", "@SuppressLint(\"NewApi\") @Override\n public void onTabReselected(android.app.ActionBar.Tab tab,\n FragmentTransaction ft) {\n }", "@Override\r\n\t\t\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\r\n\t\t\t}", "@Override\n public void onSelected(List<View> tabViews, int position) {\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab,\n FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n\tpublic void onTabSelected(Tab tab, FragmentTransaction arg1) {\n\t\tviewPager.setCurrentItem(tab.getPosition());\n\n\t}", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n viewPager.setCurrentItem(tab.getPosition());\n }", "@Override\n\tpublic void selectTab(Tab tab) {\n\t\t\n\t}", "public void onTabChanged(String tag) {\n\t\tint pos = this.mTabHost.getCurrentTab();\n\t\tthis.mViewPager.setCurrentItem(pos);\n }", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.main_ll_xw:\n setTabSelection(0);\n break;\n case R.id.main_ll_rili:\n setTabSelection(1);\n break;\n case R.id.main_ll_hq:\n setTabSelection(2);\n break;\n case R.id.main_ll_wd:\n setTabSelection(3);\n break;\n\n case R.id.main_ll_self:\n setTabSelection(4);\n break;\n }\n }", "@Override\r\n\t\tpublic void onTabReselected(Tab tab, android.app.FragmentTransaction ft) {\n\t\t}", "public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n }", "public void onTabReselected(Tab tab, android.app.FragmentTransaction ft) {\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n\n if(tab.getPosition() == 2 && !jsonData.equals(\"\") && !integratedUpdated) {\n carCheckIntegratedFragment.letsEnterModifyMode();\n integratedUpdated = true;\n }\n\n if(tab.getPosition() == 1 && !jsonData.equals(\"\") && !frameUpdated) {\n carCheckFrameFragment.letsEnterModifyMode();\n frameUpdated = true;\n }\n }", "@Override\n\tpublic void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n\t\tmViewPager.setCurrentItem(tab.getPosition());\n\t\ttab.setIcon(mAppSectionsPagerAdapter.getPageIconSelected(tab.getPosition()));\n\n\t}", "@Override\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n\t\n\t\tmAdapter.notifyDataSetChanged();\n\t\tviewPager.setCurrentItem(tab.getPosition());\n\t\n\t}", "@Override\n\tpublic void onPageSelected(int position) {\n\t\tselectTab(position);\n\t}", "@Override\n\tpublic void onTabSelected(ActionBar.Tab tab,\n\t\t\tandroid.app.FragmentTransaction fragmentTransaction) {\n\t\tmViewPager.setCurrentItem(tab.getPosition());\n\t}", "@Override\n public void onPageSelected(int position) {\n setPage(tabLayout, position);\n }", "@Override\n\tpublic void onTabSelected(ActionBar.Tab tab,\n\t\t\tFragmentTransaction fragmentTransaction) {\n\t\tmViewPager.setCurrentItem(tab.getPosition());\n\t}", "@Override\n\tpublic void onTabSelected(ActionBar.Tab tab,\n\t\t\tFragmentTransaction fragmentTransaction) {\n\t\tmViewPager.setCurrentItem(tab.getPosition());\n\t}", "@Override\n\tpublic void onTabSelected(ActionBar.Tab tab,\n\t\t\tFragmentTransaction fragmentTransaction) {\n\t\tmViewPager.setCurrentItem(tab.getPosition());\n\t}", "@Override\n\tpublic void onTabSelected(ActionBar.Tab tab,\n\t\t\tFragmentTransaction fragmentTransaction) {\n\t\tmViewPager.setCurrentItem(tab.getPosition());\n\t}", "@Override\n\tpublic void onTabSelected(ActionBar.Tab tab,\n\t\t\tFragmentTransaction fragmentTransaction) {\n\t\tmViewPager.setCurrentItem(tab.getPosition());\n\t}", "@Override\n \tpublic int getSelectedDetailsTab() {\n \t\treturn patientPanel.getSelectedIndex();\n \t\t//ScrolledTab Changes start\n \t}", "public void onTabSelected(Tab tab, FragmentTransaction ft) {\n\t\t\tft.setCustomAnimations(R.animator.fragment_slide_left_enter,\n\t\t\t\t\tR.animator.fragment_slide_right_exit);\n\n\t\t\tif (mFragment == null) {\n\t\t\t\tmFragment = Fragment.instantiate(mActivity, mClass.getName(),\n\t\t\t\t\t\tmArgs);\n\t\t\t\tft.add(android.R.id.content, mFragment, mTag);\n\t\t\t} else {\n\t\t\t\tft.attach(mFragment);\n\t\t\t}\n\t\t\tmCurrentFragment = (FlingFragment) mFragment;\n\t\t}", "@Override\n\tpublic void onTabReselected(ActionBar.Tab tab,\n\t\t\tFragmentTransaction fragmentTransaction) {\n\n\t}", "@Override\n\tpublic void onTabReselected(Tab arg0, FragmentTransaction arg1) {\n\n\t}", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tif(mViewPager.getCurrentItem()==index){\n\t\t\t\t\t\tselectTab(index);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmViewPager.setCurrentItem(index, true);\n\t\t\t\t\t}\n\t\t\t\t}", "public void tabChanged()\n {\n super.tabChanged();\n }", "@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\treturn;\n\t}", "@Override\n public void onPageSelected(int position) {\n mViewPager.setCurrentItem(position);\n selectTab(position);\n }", "@Override\r\n\tpublic void onTabReselected(Tab arg0,\r\n\t\t\tandroid.support.v4.app.FragmentTransaction arg1) {\n\r\n\t}", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tif (hMapTabs.size() > 0) {\n\n\t\t\t\t\t\t\tif (mTabHost.getTabWidget().getChildAt(1)\n\t\t\t\t\t\t\t\t\t.isSelected()) {\n\t\t\t\t\t\t\t\tif (hMapTabs.get(Const.TABS[1]).size() > 1) {\n\t\t\t\t\t\t\t\t\tresetFragment();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmTabHost.getTabWidget().setCurrentTab(1);\n\t\t\t\t\t\t\tmTabHost.setCurrentTab(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n \tint pos = tab.getPosition();\n mViewPager.setCurrentItem(pos);\n String result = null;\n \n Log.i(TAG, \"onTabSelected: \" + pos + \"\\r\\n\");\n\n\t\tString sCmds[] = {\n\t\t \t\"/system/bin/dumpsys media.audio_policy\",\n\t\t\t\"/system/bin/dumpsys media.audio_flinger\",\n\t\t\t\"/system/bin/dumpsys audio\",\n\t\t\t\"/system/bin/cat /proc/asound/cards\",\n\t\t\t\"/system/bin/getevent /dev/input/event10\"};\n\t\n\t\tif(mRunners[pos]!=null && !mRunners[pos].isAlive()){\n\t\t\tmSectionsPagerAdapter.clearText(pos);\n\t\t\tmRunners[pos].exit();\n\t\t\tLog.i(TAG, \"Recreate the worker Thread\");\n\t\t}else\n\t\t\tLog.i(TAG, \"Create the worker Thread\");\n\t\t\n\t\tmRunners[pos] = new CmdRunner(sCmds[pos], pos);\n\t\tmRunners[pos].start();\n }", "public void setSelectedTab(int arg0) {\n\n\t}", "@Override\n public void onPageSelected(int position) {\n getActionBar().setSelectedNavigationItem(position);\n // jumpFlag = true;\n }", "public void onSwipe() {\n\n this.listner.onValueSelected(this, 10.5f);\n }", "@Override\n public void onTabChanged(String tabId) {\n FragmentManager fragmentManager = TabMainActivity.this.getSupportFragmentManager();\n FragmentTransaction transaction = fragmentManager.beginTransaction();\n int position = fragmentTabHost.getCurrentTab();\n for (int i = 0; i < list.size(); i++) {\n if (position == i) {\n transaction.show(list.get(i));\n } else {\n transaction.hide(list.get(i));\n }\n }\n transaction.commit();\n//\t viewPage.setCurrentItem(position);\n }", "@Override\n public void onResume() {\n super.onResume();\n //atualizar Listas\n onTabSelected(getActionBar().getSelectedTab(), null);\n }", "@Override\n\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\tif (hMapTabs.size() > 0) {\n\n\t\t\t\t\t\t\tif (mTabHost.getTabWidget().getChildAt(2)\n\t\t\t\t\t\t\t\t\t.isSelected()) {\n\t\t\t\t\t\t\t\tif (hMapTabs.get(Const.TABS[2]).size() > 1) {\n\t\t\t\t\t\t\t\t\tresetFragment();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmTabHost.getTabWidget().setCurrentTab(2);\n\t\t\t\t\t\t\tmTabHost.setCurrentTab(2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public void tabSelected(TabLayout.Tab tab) {\n clearBackstack();\n FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\n if (tab.getPosition() == 0) {\n transaction.replace(R.id.home_page_frame_layout, HomeFragment.newInstance(user));\n } else if (tab.getPosition() == 1) {\n transaction.replace(R.id.home_page_frame_layout, WallsFragment.newInstance(user));\n } else if (tab.getPosition() == 2) {\n transaction.replace(R.id.home_page_frame_layout, ProjectsFragment.newInstance(user));\n } else if (tab.getPosition() == 3) {\n transaction.replace(R.id.home_page_frame_layout, UserInfoFragment.newInstance(user));\n }\n transaction.addToBackStack(null);\n transaction.commit();\n }", "private void registerTabChange() {\n view\n .getNationsTabPane()\n .getSelectionModel()\n .selectedItemProperty()\n .addListener((v, oldValue, newValue) -> tabChanged(oldValue, newValue));\n }", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\tactionBar.setSelectedNavigationItem(arg0);\n\t\t\t}", "void onSwipeStart(int position);", "protected abstract void updateTabState();", "@Override\r\n\tpublic void onChange(TabInfo mLastTab) {\n\t\t\r\n\t}", "public void onSwipeStarted(View v);", "@Override\n public void onTabChanged(String s) {\n int pos = this.mTabHost.getCurrentTab();\n this.mViewPager.setCurrentItem(pos);\n onSetToolbarTitle(pos);\n }", "@Override\n public void onTabUnselected(TabLayout.Tab tab) {\n\n }", "@Override\n public void onTabSelected(Tab tab, FragmentTransaction fragmentTransaction) {\n viewPager.setCurrentItem(tab.getPosition());\n\n // If the favorites tab is selected, remove any items that have been unfavorited.\n if (tab.getPosition() == TAB_FAVORITES) {\n SectionsPagerAdapter adapter = (SectionsPagerAdapter) viewPager.getAdapter();\n TalkListFragment fragment = (TalkListFragment) adapter.getItem(TAB_FAVORITES);\n fragment.removeUnfavoritedItems();\n }\n }" ]
[ "0.8033243", "0.729645", "0.7134653", "0.71340036", "0.71269745", "0.71058136", "0.7098208", "0.70863897", "0.7055507", "0.70533156", "0.7045984", "0.70320654", "0.7028175", "0.70036817", "0.69955254", "0.69939125", "0.6990418", "0.6977021", "0.69616544", "0.6953891", "0.6897545", "0.68819064", "0.68684196", "0.6866478", "0.6866478", "0.6854758", "0.68501765", "0.68501765", "0.68501765", "0.68501765", "0.68501765", "0.68501765", "0.68501765", "0.68501765", "0.68501765", "0.6848978", "0.6848978", "0.6848978", "0.6838297", "0.68223494", "0.6814998", "0.6810583", "0.68097174", "0.68042463", "0.68042463", "0.68042463", "0.68042463", "0.68042463", "0.679883", "0.67923397", "0.6772675", "0.6768843", "0.6766593", "0.6758714", "0.6750957", "0.6749837", "0.6705959", "0.66880316", "0.6686971", "0.6678627", "0.66769135", "0.6655687", "0.6644109", "0.6642801", "0.6563393", "0.65624726", "0.6558456", "0.65536165", "0.65440506", "0.65440506", "0.65440506", "0.65440506", "0.65440506", "0.65429085", "0.6523174", "0.6510716", "0.6478361", "0.64646405", "0.6439629", "0.64169765", "0.638688", "0.6367757", "0.6352025", "0.6351833", "0.63426447", "0.63338333", "0.63318443", "0.62880737", "0.6287824", "0.628269", "0.623774", "0.6197756", "0.61884385", "0.6178464", "0.6156146", "0.61550623", "0.6152938", "0.6152005", "0.6147219", "0.6138149" ]
0.63051444
87
Method for displaying an exception in a popup window (if enabled).
public static void displayException(java.lang.Exception ex) { if (doDisplayException) { exceptionDisplay.displayException(ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void displayError(Exception e)\n\t{\n\t\tJOptionPane.showMessageDialog(frame,\n\t\t\t\te.toString(),\n\t\t\t\t\"EXCEPTION\",\n\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t}", "private void displayError(Exception ex)\n {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Error dialog\");\n alert.setHeaderText(null);\n alert.setContentText(ex.getMessage());\n\n alert.showAndWait();\n }", "public final void displayExceptionAlert(Exception ex){\r\n \r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(\"Exception Dialog\");\r\n alert.setHeaderText(ex.getClass().getCanonicalName());\r\n alert.setContentText(ex.getMessage());\r\n \r\n StringWriter sw = new StringWriter();\r\n PrintWriter pw = new PrintWriter(sw);\r\n ex.printStackTrace(pw);\r\n String exceptionText = sw.toString();\r\n\r\n Label exceptionLabel = new Label(\"The exception stacktrace was:\");\r\n\r\n TextArea textArea = new TextArea(exceptionText);\r\n textArea.setEditable(false);\r\n textArea.setWrapText(true);\r\n\r\n textArea.setMaxWidth(Double.MAX_VALUE);\r\n textArea.setMaxHeight(Double.MAX_VALUE);\r\n GridPane.setVgrow(textArea, Priority.ALWAYS);\r\n GridPane.setHgrow(textArea, Priority.ALWAYS);\r\n\r\n GridPane expContent = new GridPane();\r\n expContent.setMaxWidth(Double.MAX_VALUE);\r\n expContent.add(exceptionLabel, 0, 0);\r\n expContent.add(textArea, 0, 1);\r\n\r\n alert.getDialogPane().setExpandableContent(expContent);\r\n\r\n alert.showAndWait(); \r\n }", "public void showExceptionDialog(Exception InputException)\r\n {\r\n JOptionPane.showMessageDialog(MainFrame,\r\n InputException.getMessage(),\r\n \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n }", "private void showExceptionDialog(String title, String message, String exceptionMessage) {\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));\n\t\tpanel.add(new JLabel(message));\n\t\tpanel.add(Box.createRigidArea(new Dimension(10, 10)));\n\t\tJScrollPane scroll = new JScrollPane();\n\t\tscroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\t\tscroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n\t\tJTextArea ta = new JTextArea(exceptionMessage);\n\t\tta.setRows(10);\n\t\tta.setColumns(50);\n\t\tta.setFont(new Font(\"Monospaced\", Font.PLAIN, 13));\n\t\tta.setWrapStyleWord(true);\n\t\tta.setLineWrap(true);\n\t\tta.setEditable(false);\n\t\tscroll.setViewportView(ta);\n\t\tpanel.add(scroll);\n\t\tJOptionPane.showMessageDialog(this.mf, panel, title, JOptionPane.ERROR_MESSAGE);\n\t}", "public abstract void showErrorBox(Throwable error);", "private void popupMessage(String message) {\n\t\tJOptionPane.showMessageDialog(this, message, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}", "private void displayPopUpError(View view) {\n LayoutInflater inflater = (LayoutInflater)\n getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n View popupView = inflater.inflate(R.layout.popup_error_creation_service, null);\n\n // create the popup window\n int width = LinearLayout.LayoutParams.WRAP_CONTENT;\n int height = LinearLayout.LayoutParams.WRAP_CONTENT;\n boolean focusable = true; // lets taps outside the popup also dismiss it\n final PopupWindow popupWindow = new PopupWindow(popupView, width, height, focusable);\n\n // show the popup window\n // which view you pass in doesn't matter, it is only used for the window tolken\n popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);\n\n Button btnCancel = popupView.findViewById(R.id.btn_cancel);\n\n btnCancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n popupWindow.dismiss();\n Intent intent = new Intent(view.getContext(), HomeActivity.class);\n intent.putExtra(\"userConnected\", userConnected);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n\n }\n });\n }", "protected void displayErrorMessage(String message, Exception ex) {\n JPanel messagePanel = new JPanel(new BorderLayout()); \n JLabel label = new JLabel(message);\n messagePanel.add(label);\n if (ex != null) {\n JComponent panel = new JXPanel(new BorderLayout());\n panel.setBorder(new RoundedBorder());\n \n // remind(aim): provide way to allow user to see exception only if desired\n StringWriter writer = new StringWriter();\n ex.printStackTrace(new PrintWriter(writer));\n JTextArea exceptionText = new JTextArea();\n exceptionText.setText(\"Cause of error:\\n\" +\n writer.getBuffer().toString());\n exceptionText.setBorder(new RoundedBorder());\n exceptionText.setOpaque(false);\n exceptionText.setBackground(\n Utilities.deriveColorHSB(UIManager.getColor(\"Panel.background\"),\n 0, 0, -.2f));\n JScrollPane scrollpane = new JScrollPane(exceptionText);\n scrollpane.setBorder(EMPTY_BORDER);\n scrollpane.setPreferredSize(new Dimension(600,240));\n panel.add(scrollpane);\n messagePanel.add(panel, BorderLayout.SOUTH); \n }\n JOptionPane.showMessageDialog(getMainFrame(), messagePanel, \n resourceMap.getString(\"error.title\"),\n JOptionPane.ERROR_MESSAGE);\n \n }", "public void exception(String message) {\n JOptionPane.showMessageDialog(frame, message, \"exception\", JOptionPane.ERROR_MESSAGE);\n }", "void showError(Throwable throwable);", "protected void showAlertDialog(Exception e) {\n\t\tshowAlertDialog(\"Error\", e.toString());\n\t}", "protected void errorPopup(String msg, Exception ex) {\n Message.showErrorMessage(getComponent(), ex, msg);\n }", "static void showError(Exception ex, String title, String message)\n {\n try\n {\n if(title == null)\n title = SipActivator.getResources().getI18NString(\n \"impl.protocol.sip.XCAP_ERROR_TITLE\");\n\n if(message == null)\n message = title + \"\\n\" +\n ex.getClass().getName() + \": \" +\n ex.getLocalizedMessage();\n\n\n if(SipActivator.getUIService() != null)\n SipActivator.getUIService().getPopupDialog()\n .showMessagePopupDialog(\n message,\n title,\n PopupDialog.ERROR_MESSAGE);\n }\n catch(Throwable t)\n {\n logger.error(\"Error for error dialog\", t);\n }\n }", "public void displayError(String e){\n\t\tJOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}", "@Override\n public void showError() {\n }", "private void createAndShowDialog(Exception exception, String title) {\n Throwable ex = exception;\n if(exception.getCause() != null){\n ex = exception.getCause();\n }\n createAndShowDialog(ex.getMessage(), title);\n }", "private void createAndShowDialog(Exception exception, String title) {\n Throwable ex = exception;\n if(exception.getCause() != null){\n ex = exception.getCause();\n }\n createAndShowDialog(ex.getMessage(), title);\n }", "public static void showError (Exception e)\n\t{\n\t\tString message = getErrorMessage(e);\n\t\n\t\t// filter out cancelled actions by the user which end up as\n\t\t// ModelExceptions after veto\n\t\tif (message != null)\n\t\t{\n\t\t\tNotifyDescriptor desc = new NotifyDescriptor.Message(\n\t\t\t\tmessage, NotifyDescriptor.ERROR_MESSAGE);\n\n\t\t\tDialogDisplayer.getDefault().notify(desc);\n\t\t}\n\t}", "private void errorPopUp() {\n new AlertDialog.Builder(mActivity)\n .setTitle(\"Oops\")\n .setMessage(\"Please choose an emotional state or enter a date and time\")\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n //Go back without changing anything\n dialogInterface.dismiss();\n }\n })\n .create()\n .show();\n }", "void showError(String message);", "void showError(String message);", "@Override\n\tpublic void showError(String message) {\n\t\t\n\t}", "private void showError(String message){\n\t\tsetupErrorState();\n\t\tsynapseAlert.showError(message);\n\t}", "private JFrame popError() {\n\t\tJFrame f = new JFrame();\n\t\tf.setTitle(\"Error!\");\n\t\tf.setSize(200, 200);\n\t\tf.setLocationRelativeTo(null);\n\t\tJPanel showResult = new JPanel();\n\t\tJTextArea area = new JTextArea(\"No such Record!\");\n\t\tshowResult.add(area);\n\t\tf.add(showResult);\n\t\tf.setVisible(true);\n\t\treturn f;\n\t}", "public ErrorAlert(String message) {\r\n\r\n JOptionPane.showMessageDialog(MainWindow.getInstance(), message);\r\n\r\n }", "public synchronized void showErrorMessage(String message) {\r\n \t\tComponent parent = mainWindow;\r\n \t\tif (resultsWindow != null && resultsWindow.hasFocus()) {\r\n \t\t\tparent = resultsWindow;\r\n \t\t}\r\n \t\tJOptionPane.showMessageDialog(parent, message, \"Error\", JOptionPane.ERROR_MESSAGE);\r\n \t}", "public static void displayLaunchError(Shell shell, ILaunchConfiguration config, Exception e) {\n\t\tString title = \"Problem Occured\"; \n\t\tString message = \"Opening the configuration dialog has encoutered a problem.\\n\\n\" + e.getLocalizedMessage();\n\t\tMessageDialog.openError(shell, title, message);\n\t}", "void Alert(IErrorDisplayer displayer, T ex, String message);", "void displayUserTakenError(){\n error.setVisible(true);\n }", "public void displayError(String message){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(message);\n //alert.initOwner(owner);\n alert.show();\n }", "public errPopUp(String value) {\n initComponents();\n errorMsg.setText(value);\n this.setVisible(false);\n }", "public void showError (String message) {\r\n if(myAnimation != null){\r\n myAnimation.stop();\r\n }\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(ALERT_MESSAGE);\r\n alert.setContentText(message);\r\n alert.show();\r\n }", "private void ImproperFillOutException() {\n JOptionPane.showMessageDialog(null, \"Fill out the form properly\");\n }", "private void showErrorDialog(String msg) {\n\t\tJFXDialogLayout content = new JFXDialogLayout();\n\t\tcontent.setHeading(new Text(\"ERROR\"));\n\t\tcontent.setBody(new Text(msg));\n\t\tJFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.CENTER);\n\t\t;\n\n\t\tJFXButton button = new JFXButton(\"I understand\");\n\t\tbutton.setButtonType(ButtonType.RAISED);\n\t\tbutton.setCursor(Cursor.HAND);\n\t\tbutton.setOnAction(e -> dialog.close());\n\t\tcontent.setActions(button);\n\t\tdialog.show();\n\t}", "public boolean isPopupShowing() {\n/* 476 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private void showError(String text, String title){\n JOptionPane.showMessageDialog(this,\n text, title, JOptionPane.ERROR_MESSAGE);\n }", "private void showErrorAlert()\n {\n \tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n \tbuilder.setMessage(getResources().getString(R.string.app_error_str))\n \t .setCancelable(false)\n \t .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n \t public void onClick(DialogInterface dialog, int id) {\n \t dialog.cancel();\n \t }\n \t });\n \t \n \tAlertDialog alert = builder.create();\n \talert.show();\n }", "private void showError(String msg)\n {\n \tJOptionPane.showMessageDialog(this, msg, \"Error\",\n \t\t\t\t JOptionPane.ERROR_MESSAGE);\n }", "public void messageErreur(Exception ex) throws HeadlessException {\n JOptionPane.showMessageDialog(null, ex.getMessage(), \"ERROR\", JOptionPane.ERROR_MESSAGE);\n }", "public void showError(String message) {\n JOptionPane.showMessageDialog(this, message, \"Error!\", JOptionPane.ERROR_MESSAGE);\n }", "private void displayErrorDialog(String message) {\n AlertDialog.Builder builder;\n\n builder = new AlertDialog.Builder(this);\n builder.setTitle(getString(R.string.er_error))\n .setMessage(message)\n .setNegativeButton(getString(R.string.bt_close), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n }).setIcon(android.R.drawable.stat_notify_error).show();\n }", "private void update () {\n // JST: this can be improved in future...\n String lm = current.getLocalizedMessage ();\n String nm = current.getMessage ();\n boolean isLocalized = lm != null && !lm.equals (nm);\n\n next.setVisible (exceptions.hasMoreElements ());\n details.setText (\n showDetails\n ?\n org.openide.util.NbBundle.getBundle(NotifyException.class).getString(\"CTL_Exception_Hide_Details\")\n :\n org.openide.util.NbBundle.getBundle(NotifyException.class).getString(\"CTL_Exception_Show_Details\")\n );\n\n\n if (current instanceof InvocationTargetException) {\n // go in\n current = ((InvocationTargetException)current).getTargetException ();\n }\n\n // setText (current.getLocalizedMessage ());\n String title = org.openide.util.NbBundle.getBundle(NotifyException.class).getString(\"CTL_Title_Exception\");\n\n if (showDetails) {\n descriptor.setMessage (createDetails ());\n } else {\n if (isLocalized) {\n String msg = current.getLocalizedMessage ();\n if (msg == null || \"\".equals(msg)) { // NOI18N\n msg = org.openide.util.Utilities.wrapString (\n msg, MAXIMUM_TEXT_WIDTH, false, false\n );\n }\n descriptor.setMessage (msg);\n } else {\n // emphasize user-non-friendly exceptions\n // if (this.getMessage() == null || \"\".equals(this.getMessage())) { // NOI18N\n descriptor.setMessage (\n java.text.MessageFormat.format(\n NbBundle.getBundle (NotifyDescriptor.class).getString(\"NTF_ExceptionalException\"),\n new Object[] {\n current.getClass().getName()\n }\n )\n );\n\n title = NbBundle.getBundle (NotifyDescriptor.class).getString(\n \"NTF_ExceptionalExceptionTitle\" // NOI18N\n );\n }\n }\n\n descriptor.setTitle (title);\n }", "public void showError(String errorMessage);", "private void displayError(String errorText) {\n\t\tMessageBox messageBox = new MessageBox(shell, SWT.OK);\n\t\tmessageBox.setMessage(errorText);\n\t\tmessageBox.setText(\"Alert\");\n\t\tmessageBox.open();\n\t}", "public void showError(String error);", "private void showPopup(String title, String message)\n\t{\n\t\tJOptionPane.showMessageDialog(frmMPSWebServices, message, title, JOptionPane.PLAIN_MESSAGE);\n\t}", "public void show(Object errorMessage){\n\t\tSystem.out.println(\"Woops, something bad happened\");\n\t\tSystem.out.println(errorMessage);\n\t}", "private void ShowRetrievedErrorPopupDialog(){\n ShowWhaitSpinner();\n //there is an error, show popup message\n Context context;\n AlertDialog.Builder builder = new AlertDialog.Builder(getContext());\n builder.setMessage(R.string.error_message_download_resources)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n startActivity(new Intent(getContext(), MainActivity.class));\n }\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n\n }", "void showError(String errorMessage);", "private void openSelectedProfileError() {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Error Opening Profile\");\n alert.setHeaderText(null);\n alert.setContentText(\"An error occurred while opening the selected profile.\");\n alert.showAndWait();\n }", "public void displayNoSuchMovieException(NoSuchMediaException ex) {\n JOptionPane.showMessageDialog(frame, ex.getMessage());\n\n }", "private void openExceptions(MethodNode method) {\n\t\ttry {\n\t\t\tdisplay.addWindow(new ExceptionsListBox(method));\n\t\t} catch (Exception e) {\n\t\t\tdisplay.exception(e);\n\t\t}\n\t}", "public TestingFailedAlert() {\n this.setResizable(false);\n this.setVisible(true);\n initComponents();\n }", "private void showErrorDialog(int errorCode) {\n\t\t\n }", "public void showPopup(WMSEvent evt) {\n JPanel target = mainPanel;\n JPanel panel = null;\n try {\n panel = JPanel.class.cast(evt.getSource());\n } catch (ClassCastException e) {\n// log.write(\"Exception: \" + e.getMessage());\n }\n if (panel != null) {\n target = panel;\n }\n if (evt.getMessage() == WMSMessage.POPERR) {\n JOptionPane.showMessageDialog(target, evt.getUserMessage(), afMgr.getProductName() + \" Error\",\n JOptionPane.ERROR_MESSAGE);\n } else if (evt.getMessage() == WMSMessage.POPWARN) {\n JOptionPane.showMessageDialog(target, evt.getUserMessage(), afMgr.getProductName() + \" Warning\",\n JOptionPane.WARNING_MESSAGE);\n } else if (evt.getMessage() == WMSMessage.POPMESS) {\n JOptionPane.showMessageDialog(target, evt.getUserMessage(), afMgr.getProductName() + \" Info\",\n JOptionPane.INFORMATION_MESSAGE);\n } else if (evt.getMessage() == WMSMessage.POPDEBUG) {\n if (getLevel().testMoreVerbose(level)) {\n JOptionPane.showMessageDialog(target, evt.getUserMessage(), afMgr.getProductName() + \" Debug\",\n JOptionPane.PLAIN_MESSAGE);\n }\n }\n }", "Boolean confirmWebWideTrackingException(ExceptionInformation args);", "void showErrorMsg(String string);", "private void showErrorMessage(String title, String body)\r\n {\r\n MyLogger.log(Level.INFO, \"Error message initiated. Error Title: {0}\", title);\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n Stage currentStage = (Stage) viewCoinAnchorPane.getScene().getWindow();\r\n alert.initOwner(currentStage);\r\n alert.setTitle(title);\r\n alert.setHeaderText(null);\r\n alert.setContentText(body);\r\n alert.showAndWait();\r\n }", "public void showErrorMessage(final String message) {\r\n JOptionPane.showMessageDialog(window, message, getTitle(), JOptionPane.ERROR_MESSAGE);\r\n }", "private void showErrorDialogue() {\n\t\ttry {\n\t\t\tnew AlertDialog.Builder(mContext)\n\t\t\t\t\t.setTitle(\"Something unfortunate happened...\")\n\t\t\t\t\t.setMessage(\"Your device was not able to verify activation. Please check your internet connection and ensure you are using the latest version of the application.\")\n\t\t\t\t\t.setNeutralButton(\"Close\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.show();\n\t\t} catch (Exception e) {\n\t\t\t//not in main activity, not a problem\n\t\t\tLog.w(TAG, e.getMessage());\n\t\t}\n\t}", "public static Optional<ButtonType> showConnectFailWindow() {\n String msg = String.format(\"Failed to connect to server, please check your network\");\n\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Network Failure\");\n alert.setHeaderText(msg);\n\n return alert.showAndWait();\n }", "private void showErroAlert(String errorMessage) {\n LOGGER.log(Level.INFO, \"Showing Alert window with error message...\");\n Alert errorAlert = new Alert(Alert.AlertType.ERROR, errorMessage, ButtonType.OK);\n errorAlert.show();\n }", "@Override\r\n\tpublic void showErrReq() {\n\t\tdialog.cancel();\r\n\t\tshowNetView(true);\r\n\t}", "public void showMessage(){\r\n if(message == null) return;\r\n JOptionPane.showMessageDialog(new JFrame(), message);\r\n }", "void showResultMoError(String e);", "public static void displayException(java.lang.Exception ex,\n\t\t\tjava.lang.String msg) {\n\t\tif (doDisplayException) {\n\t\t\texceptionDisplay.displayException(ex, msg);\n\t\t}\n\t}", "private void printErrorAlert(String title, String header, String message) {\r\n\t\tAlert alert = new Alert(Alert.AlertType.ERROR);\r\n\t\tif(title.length()>0)\r\n\t\t\talert.setTitle(title);\r\n\t\tif(header.length()>0)\r\n\t\t\talert.setHeaderText(header);\r\n\t\tif(message.length()>0)\r\n\t\t\talert.setContentText(message);\r\n\t\tStage stage = (Stage) alert.getDialogPane().getScene().getWindow();\r\n\t\tstage.getIcons().add(new Image(this.getClass().getResource(\"x.png\").toString()));\r\n\t\talert.showAndWait();\r\n\t}", "void errorBox(String title, String message);", "public static void showErrorPanel(String title, String msg) {\n final DialogBox dialogBox = new DialogBox();\r\n dialogBox.setText(\"Remote Procedure Call\");\r\n dialogBox.setAnimationEnabled(true);\r\n final Button closeButton = new Button(\"Close\");\r\n // We can set the id of a widget by accessing its Element\r\n closeButton.getElement().setId(\"closeButton\");\r\n final HTML serverResponseLabel = new HTML();\r\n VerticalPanel dialogVPanel = new VerticalPanel();\r\n dialogVPanel.addStyleName(\"dialogVPanel\");\r\n dialogVPanel.add(new HTML(\"<br><b>Server replies:</b>\"));\r\n dialogVPanel.add(serverResponseLabel);\r\n dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);\r\n dialogVPanel.add(closeButton);\r\n dialogBox.setWidget(dialogVPanel);\r\n\r\n // Add a handler to close the DialogBox\r\n closeButton.addClickHandler(new ClickHandler() {\r\n\r\n @Override\r\n public void onClick(ClickEvent event) {\r\n dialogBox.hide();\r\n }\r\n });\r\n\r\n // Show the error message to the user\r\n dialogBox.setText(title);\r\n serverResponseLabel.addStyleName(\"serverResponseLabelError\");\r\n serverResponseLabel.setHTML(msg);\r\n dialogBox.center();\r\n closeButton.setFocus(true);\r\n }", "public void showError(String message) {\n showMessageDialog(null, message, \"Error\", JOptionPane.ERROR_MESSAGE);\n }", "private void displayAlert(String title, String message) {\n\t\tStage window = new Stage();\n\t\twindow.initModality(Modality.APPLICATION_MODAL);\n\t\twindow.setTitle(title);\n\t\twindow.setHeight(100);\n\n\t\tLabel errorMessage = new Label(message);\n\t\terrorMessage.setPrefWidth(150 + message.length() * 5);\n\t\terrorMessage.setAlignment(Pos.CENTER);\n\t\tButton close = new Button(\"Okay\");\n\t\tclose.setOnAction(event -> window.close());\n\n\t\twindow.setWidth(errorMessage.getPrefWidth());\n\n\t\tVBox layout = new VBox();\n\t\tlayout.getChildren().addAll(errorMessage, close);\n\t\tlayout.setAlignment(Pos.CENTER);\n\t\tlayout.setSpacing(15);\n\n\t\tScene scene = new Scene(layout);\n\t\twindow.setScene(scene);\n\t\twindow.showAndWait();\n\t}", "private void showAlertSelectionFail(String title, String msg) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(title);\n\n // Header Text: null\n alert.setHeaderText(null);\n alert.setContentText(msg);\n alert.showAndWait();\n }", "private static void displayError(Shell shell, String msg) {\n MessageBox mbox = new MessageBox(shell, SWT.ICON_ERROR|SWT.OK);\n mbox.setMessage(msg);\n mbox.setText(\"USBDM - Can't create launch configuration\");\n mbox.open();\n }", "public void displayErrorMessage(String errorMess)\n {\n JOptionPane.showMessageDialog(this,errorMess);\n }", "public void createPopupWindow() {\r\n \t//\r\n }", "protected void handleException(java.lang.Throwable exception) {\n ch.softenvironment.view.BaseDialog.showError((java.awt.Component)this, getResourceString(\"CESyntax\"), exception.toString(), exception); //$NON-NLS-1$\n}", "@Override\n public void showError(Throwable throwable) {\n Toasts.show(throwable.getMessage());\n }", "@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Failure : \" + caught.getMessage());\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Failure : \" + caught.getMessage());\n\t\t\t\t\t}", "public static void showErrorDialog(Shell shell, Exception e) {\r\n\t\tString message = \"Oops... an unexpected error occurred\";\r\n\t\tif (e != null) {\r\n\t\t\tif (e instanceof MusicTunesException) {\r\n\t\t\t\tmessage = e.getMessage();\r\n\t\t\t}\r\n\t\t}\r\n\t\tshowErrorDialog(shell, message);\r\n\t}", "private void showAlert() {\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setMessage(\"Error al autenticar usuario\");\n alert.setPositiveButton(\"Aceptar\", null);\n AlertDialog pop = alert.create();\n alert.show();\n }", "private void displayDuplicateInputError(){\n\t\tAlert alert = new Alert(Alert.AlertType.INFORMATION);\n\t\talert.setTitle(\"Duplicate Letter Dialog\");\n\t\talert.setHeaderText(\"Pay Attention!\");\n\t\talert.setContentText(\"You have already tried that letter, please try again\");\n\t\talert.showAndWait();\n\t}", "@Override\r\n\tpublic void displayError(EntityPropertyCode code, String message) {\n\t}", "public static void showDialog(final Window parent, final String title, final String message, final Exception exception) {\n ErrorDialog dialog = new ErrorDialog(parent, title, message, exception);\n dialog.setVisible(true);\n }", "public void showErrorMessage(String msg) {\r\n JOptionPane.showMessageDialog(this,\r\n\t\t\t\t msg, TmplResourceSingleton.getString(\"error.dialog.header\"),\r\n\t\t\t\t JOptionPane.ERROR_MESSAGE);\r\n }", "public void exibeMensagem(String mensagem) {\n JOptionPane.showMessageDialog(null, mensagem);\n }", "@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Fail\");\n\t\t\t\t\t}", "public static void logException(String text, Throwable exc) {\n if (SwingUtilities.isEventDispatchThread()) {\n StringBuilder string = new StringBuilder(512);\n //\n // Display our error message\n //\n string.append(\"<html><b>\");\n string.append(text);\n string.append(\"</b><br><br>\");\n //\n // Display the exception object\n //\n string.append(exc.toString());\n string.append(\"<br>\");\n //\n // Display the stack trace\n //\n StackTraceElement[] trace = exc.getStackTrace();\n int count = 0;\n for (StackTraceElement elem : trace) {\n string.append(elem.toString());\n string.append(\"<br>\");\n if (++count == 25)\n break;\n }\n string.append(\"</html>\");\n JOptionPane.showMessageDialog(Main.mainWindow, string, \"Error\", JOptionPane.ERROR_MESSAGE);\n } else if (deferredException == null) {\n deferredText = text;\n deferredException = exc;\n try {\n javax.swing.SwingUtilities.invokeAndWait(new Runnable() {\n @Override\n public void run() {\n Main.logException(deferredText, deferredException);\n deferredException = null;\n deferredText = null;\n }\n });\n } catch (Exception logexc) {\n log.error(\"Unable to log exception during program initialization\");\n }\n }\n }", "public static void noSupplierSelected(){\r\n\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\talert.setTitle(\"Error!\");\r\n\t\talert.setHeaderText(\"\");\r\n\t\talert.setContentText(\"Bitte wählen Sie einen Lieferanten aus!\");\r\n\t\talert.showAndWait();\r\n\t}", "private void showInvalidFileFormatError()\n {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Image Load Error\");\n alert.setHeaderText(null);\n alert.setContentText(\"The file was not recognized as an image file.\");\n\n alert.showAndWait();\n }", "@Then(\"^User should see a predefined alert box$\")\r\n\tpublic void user_should_see_a_predefined_alert_box() throws Throwable {\n\t\tSystem.out.println(\"Alert message pop-ups on the screen\");\r\n\t}", "@Override\r\n public final void displayError(final String message) {\r\n displayMessage(message, \"Error!\", SWT.ICON_ERROR);\r\n }", "private void displayErrorMessage(String message, String fileName)\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"File error\");\n alert.setHeaderText(null);\n alert.setContentText(\"Error: \" + message + \": \" + fileName);\n\n alert.showAndWait();\n }", "public void showUnsolvableMessage() {\n\t\tJOptionPane.showMessageDialog(frame, \"Det angivna sudokut är olösbart\");\n\t}", "public void showErrorMessage(String title, String Messge) {\n\t\tJOptionPane.showMessageDialog(mdiForm, Messge,\n\t\t\t\ttitle, JOptionPane.ERROR_MESSAGE);\n\t}", "private void showAlertResetFail(String msg) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Database error\");\n\n // Header Text: null\n alert.setHeaderText(\"Could not reset database\");\n alert.setContentText(msg);\n alert.showAndWait();\n }", "public void showWarningPopup() {\n\t\ttv_popupTitle.setText(\"Power Warning\");\n\t\ttv_popupInfo.setText(R.string.warning);\n\t\t\n\t\t// The code below assumes that the root container has an id called 'main'\n\t\t popup.showAtLocation(findViewById(R.id.anchor), Gravity.CENTER, 0, 0);\n\t}", "public void ShowMessageBox(String text)\n {\n ShowMessageBox(getShell(), \"Error\", text, 0);\n }", "void showError (String occurredWhile, String error) {\n\n// creates the VerticalBox for all elements\n VBox pane = new VBox();\n\n// creates all necessary labels, adds them to errPane\n Label genLabel = new Label(\"Error occured while \" + occurredWhile + \":\");\n Label errLabel = new Label(error);\n genLabel.setStyle(\"-fx-padding: 10, 10, 10, 10;\");\n errLabel.setStyle(\"-fx-padding: 10, 10, 10, 10;\");\n pane.getChildren().addAll(genLabel, errLabel);\n\n// creates a Scene, applies stylesheets\n Scene scene = new Scene(pane);\n scene.getStylesheets().add(getClass().getResource(\"stylesheet.css\").toExternalForm());\n scene.getStylesheets().add(stylesheet.toString());\n\n// creates a new errorWindow\n errorWindow = new Stage();\n errorWindow.setTitle(\"Error\");\n errorWindow.setResizable(false);\n errorWindow.setScene(scene);\n errorWindow.show();\n }" ]
[ "0.71580404", "0.6906587", "0.6878444", "0.68502563", "0.6846686", "0.67431116", "0.6732938", "0.6726179", "0.67136675", "0.6684716", "0.6644941", "0.6623529", "0.66197604", "0.6599301", "0.65517926", "0.650056", "0.6493418", "0.6493418", "0.64640814", "0.641443", "0.64021915", "0.64021915", "0.6397092", "0.6386363", "0.6376296", "0.6375296", "0.63239014", "0.63179207", "0.63120633", "0.6279614", "0.62662935", "0.6255645", "0.62133855", "0.6207511", "0.62039745", "0.61990625", "0.61925924", "0.61876535", "0.6162924", "0.6128258", "0.6124859", "0.61246717", "0.60874355", "0.6069321", "0.60669065", "0.60564035", "0.6049919", "0.6028892", "0.60271144", "0.6021986", "0.6019551", "0.6011556", "0.598795", "0.5983584", "0.5974325", "0.5960179", "0.5951555", "0.59335047", "0.59318626", "0.59311974", "0.5927411", "0.58998024", "0.5890276", "0.587325", "0.58721536", "0.58702177", "0.58462584", "0.58456635", "0.58344483", "0.5833265", "0.5831356", "0.5823632", "0.5822675", "0.58219385", "0.5801132", "0.5789763", "0.5784941", "0.57798064", "0.57784414", "0.57784414", "0.5775263", "0.57567", "0.57524306", "0.5744271", "0.57252485", "0.5725015", "0.5724779", "0.57152385", "0.57004094", "0.56997854", "0.56985456", "0.5697634", "0.56940544", "0.5693216", "0.5691054", "0.56900847", "0.56780744", "0.5671736", "0.56570935", "0.56531554" ]
0.5872607
64
Method for displaying an exception in a popup window (if enabled).
public static void displayException(java.lang.Exception ex, java.lang.String msg) { if (doDisplayException) { exceptionDisplay.displayException(ex, msg); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void displayError(Exception e)\n\t{\n\t\tJOptionPane.showMessageDialog(frame,\n\t\t\t\te.toString(),\n\t\t\t\t\"EXCEPTION\",\n\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t}", "private void displayError(Exception ex)\n {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Error dialog\");\n alert.setHeaderText(null);\n alert.setContentText(ex.getMessage());\n\n alert.showAndWait();\n }", "public final void displayExceptionAlert(Exception ex){\r\n \r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(\"Exception Dialog\");\r\n alert.setHeaderText(ex.getClass().getCanonicalName());\r\n alert.setContentText(ex.getMessage());\r\n \r\n StringWriter sw = new StringWriter();\r\n PrintWriter pw = new PrintWriter(sw);\r\n ex.printStackTrace(pw);\r\n String exceptionText = sw.toString();\r\n\r\n Label exceptionLabel = new Label(\"The exception stacktrace was:\");\r\n\r\n TextArea textArea = new TextArea(exceptionText);\r\n textArea.setEditable(false);\r\n textArea.setWrapText(true);\r\n\r\n textArea.setMaxWidth(Double.MAX_VALUE);\r\n textArea.setMaxHeight(Double.MAX_VALUE);\r\n GridPane.setVgrow(textArea, Priority.ALWAYS);\r\n GridPane.setHgrow(textArea, Priority.ALWAYS);\r\n\r\n GridPane expContent = new GridPane();\r\n expContent.setMaxWidth(Double.MAX_VALUE);\r\n expContent.add(exceptionLabel, 0, 0);\r\n expContent.add(textArea, 0, 1);\r\n\r\n alert.getDialogPane().setExpandableContent(expContent);\r\n\r\n alert.showAndWait(); \r\n }", "public void showExceptionDialog(Exception InputException)\r\n {\r\n JOptionPane.showMessageDialog(MainFrame,\r\n InputException.getMessage(),\r\n \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n }", "private void showExceptionDialog(String title, String message, String exceptionMessage) {\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));\n\t\tpanel.add(new JLabel(message));\n\t\tpanel.add(Box.createRigidArea(new Dimension(10, 10)));\n\t\tJScrollPane scroll = new JScrollPane();\n\t\tscroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\t\tscroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n\t\tJTextArea ta = new JTextArea(exceptionMessage);\n\t\tta.setRows(10);\n\t\tta.setColumns(50);\n\t\tta.setFont(new Font(\"Monospaced\", Font.PLAIN, 13));\n\t\tta.setWrapStyleWord(true);\n\t\tta.setLineWrap(true);\n\t\tta.setEditable(false);\n\t\tscroll.setViewportView(ta);\n\t\tpanel.add(scroll);\n\t\tJOptionPane.showMessageDialog(this.mf, panel, title, JOptionPane.ERROR_MESSAGE);\n\t}", "public abstract void showErrorBox(Throwable error);", "private void popupMessage(String message) {\n\t\tJOptionPane.showMessageDialog(this, message, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}", "private void displayPopUpError(View view) {\n LayoutInflater inflater = (LayoutInflater)\n getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n View popupView = inflater.inflate(R.layout.popup_error_creation_service, null);\n\n // create the popup window\n int width = LinearLayout.LayoutParams.WRAP_CONTENT;\n int height = LinearLayout.LayoutParams.WRAP_CONTENT;\n boolean focusable = true; // lets taps outside the popup also dismiss it\n final PopupWindow popupWindow = new PopupWindow(popupView, width, height, focusable);\n\n // show the popup window\n // which view you pass in doesn't matter, it is only used for the window tolken\n popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);\n\n Button btnCancel = popupView.findViewById(R.id.btn_cancel);\n\n btnCancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n popupWindow.dismiss();\n Intent intent = new Intent(view.getContext(), HomeActivity.class);\n intent.putExtra(\"userConnected\", userConnected);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n\n }\n });\n }", "protected void displayErrorMessage(String message, Exception ex) {\n JPanel messagePanel = new JPanel(new BorderLayout()); \n JLabel label = new JLabel(message);\n messagePanel.add(label);\n if (ex != null) {\n JComponent panel = new JXPanel(new BorderLayout());\n panel.setBorder(new RoundedBorder());\n \n // remind(aim): provide way to allow user to see exception only if desired\n StringWriter writer = new StringWriter();\n ex.printStackTrace(new PrintWriter(writer));\n JTextArea exceptionText = new JTextArea();\n exceptionText.setText(\"Cause of error:\\n\" +\n writer.getBuffer().toString());\n exceptionText.setBorder(new RoundedBorder());\n exceptionText.setOpaque(false);\n exceptionText.setBackground(\n Utilities.deriveColorHSB(UIManager.getColor(\"Panel.background\"),\n 0, 0, -.2f));\n JScrollPane scrollpane = new JScrollPane(exceptionText);\n scrollpane.setBorder(EMPTY_BORDER);\n scrollpane.setPreferredSize(new Dimension(600,240));\n panel.add(scrollpane);\n messagePanel.add(panel, BorderLayout.SOUTH); \n }\n JOptionPane.showMessageDialog(getMainFrame(), messagePanel, \n resourceMap.getString(\"error.title\"),\n JOptionPane.ERROR_MESSAGE);\n \n }", "public void exception(String message) {\n JOptionPane.showMessageDialog(frame, message, \"exception\", JOptionPane.ERROR_MESSAGE);\n }", "void showError(Throwable throwable);", "protected void showAlertDialog(Exception e) {\n\t\tshowAlertDialog(\"Error\", e.toString());\n\t}", "protected void errorPopup(String msg, Exception ex) {\n Message.showErrorMessage(getComponent(), ex, msg);\n }", "static void showError(Exception ex, String title, String message)\n {\n try\n {\n if(title == null)\n title = SipActivator.getResources().getI18NString(\n \"impl.protocol.sip.XCAP_ERROR_TITLE\");\n\n if(message == null)\n message = title + \"\\n\" +\n ex.getClass().getName() + \": \" +\n ex.getLocalizedMessage();\n\n\n if(SipActivator.getUIService() != null)\n SipActivator.getUIService().getPopupDialog()\n .showMessagePopupDialog(\n message,\n title,\n PopupDialog.ERROR_MESSAGE);\n }\n catch(Throwable t)\n {\n logger.error(\"Error for error dialog\", t);\n }\n }", "public void displayError(String e){\n\t\tJOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}", "@Override\n public void showError() {\n }", "private void createAndShowDialog(Exception exception, String title) {\n Throwable ex = exception;\n if(exception.getCause() != null){\n ex = exception.getCause();\n }\n createAndShowDialog(ex.getMessage(), title);\n }", "private void createAndShowDialog(Exception exception, String title) {\n Throwable ex = exception;\n if(exception.getCause() != null){\n ex = exception.getCause();\n }\n createAndShowDialog(ex.getMessage(), title);\n }", "public static void showError (Exception e)\n\t{\n\t\tString message = getErrorMessage(e);\n\t\n\t\t// filter out cancelled actions by the user which end up as\n\t\t// ModelExceptions after veto\n\t\tif (message != null)\n\t\t{\n\t\t\tNotifyDescriptor desc = new NotifyDescriptor.Message(\n\t\t\t\tmessage, NotifyDescriptor.ERROR_MESSAGE);\n\n\t\t\tDialogDisplayer.getDefault().notify(desc);\n\t\t}\n\t}", "private void errorPopUp() {\n new AlertDialog.Builder(mActivity)\n .setTitle(\"Oops\")\n .setMessage(\"Please choose an emotional state or enter a date and time\")\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n //Go back without changing anything\n dialogInterface.dismiss();\n }\n })\n .create()\n .show();\n }", "void showError(String message);", "void showError(String message);", "@Override\n\tpublic void showError(String message) {\n\t\t\n\t}", "private void showError(String message){\n\t\tsetupErrorState();\n\t\tsynapseAlert.showError(message);\n\t}", "private JFrame popError() {\n\t\tJFrame f = new JFrame();\n\t\tf.setTitle(\"Error!\");\n\t\tf.setSize(200, 200);\n\t\tf.setLocationRelativeTo(null);\n\t\tJPanel showResult = new JPanel();\n\t\tJTextArea area = new JTextArea(\"No such Record!\");\n\t\tshowResult.add(area);\n\t\tf.add(showResult);\n\t\tf.setVisible(true);\n\t\treturn f;\n\t}", "public ErrorAlert(String message) {\r\n\r\n JOptionPane.showMessageDialog(MainWindow.getInstance(), message);\r\n\r\n }", "public synchronized void showErrorMessage(String message) {\r\n \t\tComponent parent = mainWindow;\r\n \t\tif (resultsWindow != null && resultsWindow.hasFocus()) {\r\n \t\t\tparent = resultsWindow;\r\n \t\t}\r\n \t\tJOptionPane.showMessageDialog(parent, message, \"Error\", JOptionPane.ERROR_MESSAGE);\r\n \t}", "public static void displayLaunchError(Shell shell, ILaunchConfiguration config, Exception e) {\n\t\tString title = \"Problem Occured\"; \n\t\tString message = \"Opening the configuration dialog has encoutered a problem.\\n\\n\" + e.getLocalizedMessage();\n\t\tMessageDialog.openError(shell, title, message);\n\t}", "void Alert(IErrorDisplayer displayer, T ex, String message);", "void displayUserTakenError(){\n error.setVisible(true);\n }", "public void displayError(String message){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(message);\n //alert.initOwner(owner);\n alert.show();\n }", "public errPopUp(String value) {\n initComponents();\n errorMsg.setText(value);\n this.setVisible(false);\n }", "public void showError (String message) {\r\n if(myAnimation != null){\r\n myAnimation.stop();\r\n }\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(ALERT_MESSAGE);\r\n alert.setContentText(message);\r\n alert.show();\r\n }", "private void ImproperFillOutException() {\n JOptionPane.showMessageDialog(null, \"Fill out the form properly\");\n }", "private void showErrorDialog(String msg) {\n\t\tJFXDialogLayout content = new JFXDialogLayout();\n\t\tcontent.setHeading(new Text(\"ERROR\"));\n\t\tcontent.setBody(new Text(msg));\n\t\tJFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.CENTER);\n\t\t;\n\n\t\tJFXButton button = new JFXButton(\"I understand\");\n\t\tbutton.setButtonType(ButtonType.RAISED);\n\t\tbutton.setCursor(Cursor.HAND);\n\t\tbutton.setOnAction(e -> dialog.close());\n\t\tcontent.setActions(button);\n\t\tdialog.show();\n\t}", "public boolean isPopupShowing() {\n/* 476 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private void showError(String text, String title){\n JOptionPane.showMessageDialog(this,\n text, title, JOptionPane.ERROR_MESSAGE);\n }", "private void showErrorAlert()\n {\n \tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n \tbuilder.setMessage(getResources().getString(R.string.app_error_str))\n \t .setCancelable(false)\n \t .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n \t public void onClick(DialogInterface dialog, int id) {\n \t dialog.cancel();\n \t }\n \t });\n \t \n \tAlertDialog alert = builder.create();\n \talert.show();\n }", "private void showError(String msg)\n {\n \tJOptionPane.showMessageDialog(this, msg, \"Error\",\n \t\t\t\t JOptionPane.ERROR_MESSAGE);\n }", "public void messageErreur(Exception ex) throws HeadlessException {\n JOptionPane.showMessageDialog(null, ex.getMessage(), \"ERROR\", JOptionPane.ERROR_MESSAGE);\n }", "public void showError(String message) {\n JOptionPane.showMessageDialog(this, message, \"Error!\", JOptionPane.ERROR_MESSAGE);\n }", "private void displayErrorDialog(String message) {\n AlertDialog.Builder builder;\n\n builder = new AlertDialog.Builder(this);\n builder.setTitle(getString(R.string.er_error))\n .setMessage(message)\n .setNegativeButton(getString(R.string.bt_close), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n }).setIcon(android.R.drawable.stat_notify_error).show();\n }", "private void update () {\n // JST: this can be improved in future...\n String lm = current.getLocalizedMessage ();\n String nm = current.getMessage ();\n boolean isLocalized = lm != null && !lm.equals (nm);\n\n next.setVisible (exceptions.hasMoreElements ());\n details.setText (\n showDetails\n ?\n org.openide.util.NbBundle.getBundle(NotifyException.class).getString(\"CTL_Exception_Hide_Details\")\n :\n org.openide.util.NbBundle.getBundle(NotifyException.class).getString(\"CTL_Exception_Show_Details\")\n );\n\n\n if (current instanceof InvocationTargetException) {\n // go in\n current = ((InvocationTargetException)current).getTargetException ();\n }\n\n // setText (current.getLocalizedMessage ());\n String title = org.openide.util.NbBundle.getBundle(NotifyException.class).getString(\"CTL_Title_Exception\");\n\n if (showDetails) {\n descriptor.setMessage (createDetails ());\n } else {\n if (isLocalized) {\n String msg = current.getLocalizedMessage ();\n if (msg == null || \"\".equals(msg)) { // NOI18N\n msg = org.openide.util.Utilities.wrapString (\n msg, MAXIMUM_TEXT_WIDTH, false, false\n );\n }\n descriptor.setMessage (msg);\n } else {\n // emphasize user-non-friendly exceptions\n // if (this.getMessage() == null || \"\".equals(this.getMessage())) { // NOI18N\n descriptor.setMessage (\n java.text.MessageFormat.format(\n NbBundle.getBundle (NotifyDescriptor.class).getString(\"NTF_ExceptionalException\"),\n new Object[] {\n current.getClass().getName()\n }\n )\n );\n\n title = NbBundle.getBundle (NotifyDescriptor.class).getString(\n \"NTF_ExceptionalExceptionTitle\" // NOI18N\n );\n }\n }\n\n descriptor.setTitle (title);\n }", "public void showError(String errorMessage);", "private void displayError(String errorText) {\n\t\tMessageBox messageBox = new MessageBox(shell, SWT.OK);\n\t\tmessageBox.setMessage(errorText);\n\t\tmessageBox.setText(\"Alert\");\n\t\tmessageBox.open();\n\t}", "public void showError(String error);", "private void showPopup(String title, String message)\n\t{\n\t\tJOptionPane.showMessageDialog(frmMPSWebServices, message, title, JOptionPane.PLAIN_MESSAGE);\n\t}", "public void show(Object errorMessage){\n\t\tSystem.out.println(\"Woops, something bad happened\");\n\t\tSystem.out.println(errorMessage);\n\t}", "private void ShowRetrievedErrorPopupDialog(){\n ShowWhaitSpinner();\n //there is an error, show popup message\n Context context;\n AlertDialog.Builder builder = new AlertDialog.Builder(getContext());\n builder.setMessage(R.string.error_message_download_resources)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n startActivity(new Intent(getContext(), MainActivity.class));\n }\n });\n AlertDialog alertDialog = builder.create();\n alertDialog.show();\n\n }", "void showError(String errorMessage);", "private void openSelectedProfileError() {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Error Opening Profile\");\n alert.setHeaderText(null);\n alert.setContentText(\"An error occurred while opening the selected profile.\");\n alert.showAndWait();\n }", "public void displayNoSuchMovieException(NoSuchMediaException ex) {\n JOptionPane.showMessageDialog(frame, ex.getMessage());\n\n }", "private void openExceptions(MethodNode method) {\n\t\ttry {\n\t\t\tdisplay.addWindow(new ExceptionsListBox(method));\n\t\t} catch (Exception e) {\n\t\t\tdisplay.exception(e);\n\t\t}\n\t}", "public TestingFailedAlert() {\n this.setResizable(false);\n this.setVisible(true);\n initComponents();\n }", "private void showErrorDialog(int errorCode) {\n\t\t\n }", "public void showPopup(WMSEvent evt) {\n JPanel target = mainPanel;\n JPanel panel = null;\n try {\n panel = JPanel.class.cast(evt.getSource());\n } catch (ClassCastException e) {\n// log.write(\"Exception: \" + e.getMessage());\n }\n if (panel != null) {\n target = panel;\n }\n if (evt.getMessage() == WMSMessage.POPERR) {\n JOptionPane.showMessageDialog(target, evt.getUserMessage(), afMgr.getProductName() + \" Error\",\n JOptionPane.ERROR_MESSAGE);\n } else if (evt.getMessage() == WMSMessage.POPWARN) {\n JOptionPane.showMessageDialog(target, evt.getUserMessage(), afMgr.getProductName() + \" Warning\",\n JOptionPane.WARNING_MESSAGE);\n } else if (evt.getMessage() == WMSMessage.POPMESS) {\n JOptionPane.showMessageDialog(target, evt.getUserMessage(), afMgr.getProductName() + \" Info\",\n JOptionPane.INFORMATION_MESSAGE);\n } else if (evt.getMessage() == WMSMessage.POPDEBUG) {\n if (getLevel().testMoreVerbose(level)) {\n JOptionPane.showMessageDialog(target, evt.getUserMessage(), afMgr.getProductName() + \" Debug\",\n JOptionPane.PLAIN_MESSAGE);\n }\n }\n }", "Boolean confirmWebWideTrackingException(ExceptionInformation args);", "void showErrorMsg(String string);", "private void showErrorMessage(String title, String body)\r\n {\r\n MyLogger.log(Level.INFO, \"Error message initiated. Error Title: {0}\", title);\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n Stage currentStage = (Stage) viewCoinAnchorPane.getScene().getWindow();\r\n alert.initOwner(currentStage);\r\n alert.setTitle(title);\r\n alert.setHeaderText(null);\r\n alert.setContentText(body);\r\n alert.showAndWait();\r\n }", "public void showErrorMessage(final String message) {\r\n JOptionPane.showMessageDialog(window, message, getTitle(), JOptionPane.ERROR_MESSAGE);\r\n }", "private void showErrorDialogue() {\n\t\ttry {\n\t\t\tnew AlertDialog.Builder(mContext)\n\t\t\t\t\t.setTitle(\"Something unfortunate happened...\")\n\t\t\t\t\t.setMessage(\"Your device was not able to verify activation. Please check your internet connection and ensure you are using the latest version of the application.\")\n\t\t\t\t\t.setNeutralButton(\"Close\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.show();\n\t\t} catch (Exception e) {\n\t\t\t//not in main activity, not a problem\n\t\t\tLog.w(TAG, e.getMessage());\n\t\t}\n\t}", "public static Optional<ButtonType> showConnectFailWindow() {\n String msg = String.format(\"Failed to connect to server, please check your network\");\n\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Network Failure\");\n alert.setHeaderText(msg);\n\n return alert.showAndWait();\n }", "private void showErroAlert(String errorMessage) {\n LOGGER.log(Level.INFO, \"Showing Alert window with error message...\");\n Alert errorAlert = new Alert(Alert.AlertType.ERROR, errorMessage, ButtonType.OK);\n errorAlert.show();\n }", "public void showMessage(){\r\n if(message == null) return;\r\n JOptionPane.showMessageDialog(new JFrame(), message);\r\n }", "@Override\r\n\tpublic void showErrReq() {\n\t\tdialog.cancel();\r\n\t\tshowNetView(true);\r\n\t}", "public static void displayException(java.lang.Exception ex) {\n\t\tif (doDisplayException) {\n\t\t\texceptionDisplay.displayException(ex);\n\t\t}\n\t}", "void showResultMoError(String e);", "private void printErrorAlert(String title, String header, String message) {\r\n\t\tAlert alert = new Alert(Alert.AlertType.ERROR);\r\n\t\tif(title.length()>0)\r\n\t\t\talert.setTitle(title);\r\n\t\tif(header.length()>0)\r\n\t\t\talert.setHeaderText(header);\r\n\t\tif(message.length()>0)\r\n\t\t\talert.setContentText(message);\r\n\t\tStage stage = (Stage) alert.getDialogPane().getScene().getWindow();\r\n\t\tstage.getIcons().add(new Image(this.getClass().getResource(\"x.png\").toString()));\r\n\t\talert.showAndWait();\r\n\t}", "public static void showErrorPanel(String title, String msg) {\n final DialogBox dialogBox = new DialogBox();\r\n dialogBox.setText(\"Remote Procedure Call\");\r\n dialogBox.setAnimationEnabled(true);\r\n final Button closeButton = new Button(\"Close\");\r\n // We can set the id of a widget by accessing its Element\r\n closeButton.getElement().setId(\"closeButton\");\r\n final HTML serverResponseLabel = new HTML();\r\n VerticalPanel dialogVPanel = new VerticalPanel();\r\n dialogVPanel.addStyleName(\"dialogVPanel\");\r\n dialogVPanel.add(new HTML(\"<br><b>Server replies:</b>\"));\r\n dialogVPanel.add(serverResponseLabel);\r\n dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);\r\n dialogVPanel.add(closeButton);\r\n dialogBox.setWidget(dialogVPanel);\r\n\r\n // Add a handler to close the DialogBox\r\n closeButton.addClickHandler(new ClickHandler() {\r\n\r\n @Override\r\n public void onClick(ClickEvent event) {\r\n dialogBox.hide();\r\n }\r\n });\r\n\r\n // Show the error message to the user\r\n dialogBox.setText(title);\r\n serverResponseLabel.addStyleName(\"serverResponseLabelError\");\r\n serverResponseLabel.setHTML(msg);\r\n dialogBox.center();\r\n closeButton.setFocus(true);\r\n }", "void errorBox(String title, String message);", "public void showError(String message) {\n showMessageDialog(null, message, \"Error\", JOptionPane.ERROR_MESSAGE);\n }", "private void displayAlert(String title, String message) {\n\t\tStage window = new Stage();\n\t\twindow.initModality(Modality.APPLICATION_MODAL);\n\t\twindow.setTitle(title);\n\t\twindow.setHeight(100);\n\n\t\tLabel errorMessage = new Label(message);\n\t\terrorMessage.setPrefWidth(150 + message.length() * 5);\n\t\terrorMessage.setAlignment(Pos.CENTER);\n\t\tButton close = new Button(\"Okay\");\n\t\tclose.setOnAction(event -> window.close());\n\n\t\twindow.setWidth(errorMessage.getPrefWidth());\n\n\t\tVBox layout = new VBox();\n\t\tlayout.getChildren().addAll(errorMessage, close);\n\t\tlayout.setAlignment(Pos.CENTER);\n\t\tlayout.setSpacing(15);\n\n\t\tScene scene = new Scene(layout);\n\t\twindow.setScene(scene);\n\t\twindow.showAndWait();\n\t}", "private static void displayError(Shell shell, String msg) {\n MessageBox mbox = new MessageBox(shell, SWT.ICON_ERROR|SWT.OK);\n mbox.setMessage(msg);\n mbox.setText(\"USBDM - Can't create launch configuration\");\n mbox.open();\n }", "private void showAlertSelectionFail(String title, String msg) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(title);\n\n // Header Text: null\n alert.setHeaderText(null);\n alert.setContentText(msg);\n alert.showAndWait();\n }", "public void displayErrorMessage(String errorMess)\n {\n JOptionPane.showMessageDialog(this,errorMess);\n }", "public void createPopupWindow() {\r\n \t//\r\n }", "protected void handleException(java.lang.Throwable exception) {\n ch.softenvironment.view.BaseDialog.showError((java.awt.Component)this, getResourceString(\"CESyntax\"), exception.toString(), exception); //$NON-NLS-1$\n}", "@Override\n public void showError(Throwable throwable) {\n Toasts.show(throwable.getMessage());\n }", "@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Failure : \" + caught.getMessage());\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Failure : \" + caught.getMessage());\n\t\t\t\t\t}", "public static void showErrorDialog(Shell shell, Exception e) {\r\n\t\tString message = \"Oops... an unexpected error occurred\";\r\n\t\tif (e != null) {\r\n\t\t\tif (e instanceof MusicTunesException) {\r\n\t\t\t\tmessage = e.getMessage();\r\n\t\t\t}\r\n\t\t}\r\n\t\tshowErrorDialog(shell, message);\r\n\t}", "private void showAlert() {\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n alert.setMessage(\"Error al autenticar usuario\");\n alert.setPositiveButton(\"Aceptar\", null);\n AlertDialog pop = alert.create();\n alert.show();\n }", "private void displayDuplicateInputError(){\n\t\tAlert alert = new Alert(Alert.AlertType.INFORMATION);\n\t\talert.setTitle(\"Duplicate Letter Dialog\");\n\t\talert.setHeaderText(\"Pay Attention!\");\n\t\talert.setContentText(\"You have already tried that letter, please try again\");\n\t\talert.showAndWait();\n\t}", "@Override\r\n\tpublic void displayError(EntityPropertyCode code, String message) {\n\t}", "public void exibeMensagem(String mensagem) {\n JOptionPane.showMessageDialog(null, mensagem);\n }", "public void showErrorMessage(String msg) {\r\n JOptionPane.showMessageDialog(this,\r\n\t\t\t\t msg, TmplResourceSingleton.getString(\"error.dialog.header\"),\r\n\t\t\t\t JOptionPane.ERROR_MESSAGE);\r\n }", "public static void showDialog(final Window parent, final String title, final String message, final Exception exception) {\n ErrorDialog dialog = new ErrorDialog(parent, title, message, exception);\n dialog.setVisible(true);\n }", "@Override\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tWindow.alert(\"Fail\");\n\t\t\t\t\t}", "public static void noSupplierSelected(){\r\n\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\talert.setTitle(\"Error!\");\r\n\t\talert.setHeaderText(\"\");\r\n\t\talert.setContentText(\"Bitte wählen Sie einen Lieferanten aus!\");\r\n\t\talert.showAndWait();\r\n\t}", "@Then(\"^User should see a predefined alert box$\")\r\n\tpublic void user_should_see_a_predefined_alert_box() throws Throwable {\n\t\tSystem.out.println(\"Alert message pop-ups on the screen\");\r\n\t}", "public static void logException(String text, Throwable exc) {\n if (SwingUtilities.isEventDispatchThread()) {\n StringBuilder string = new StringBuilder(512);\n //\n // Display our error message\n //\n string.append(\"<html><b>\");\n string.append(text);\n string.append(\"</b><br><br>\");\n //\n // Display the exception object\n //\n string.append(exc.toString());\n string.append(\"<br>\");\n //\n // Display the stack trace\n //\n StackTraceElement[] trace = exc.getStackTrace();\n int count = 0;\n for (StackTraceElement elem : trace) {\n string.append(elem.toString());\n string.append(\"<br>\");\n if (++count == 25)\n break;\n }\n string.append(\"</html>\");\n JOptionPane.showMessageDialog(Main.mainWindow, string, \"Error\", JOptionPane.ERROR_MESSAGE);\n } else if (deferredException == null) {\n deferredText = text;\n deferredException = exc;\n try {\n javax.swing.SwingUtilities.invokeAndWait(new Runnable() {\n @Override\n public void run() {\n Main.logException(deferredText, deferredException);\n deferredException = null;\n deferredText = null;\n }\n });\n } catch (Exception logexc) {\n log.error(\"Unable to log exception during program initialization\");\n }\n }\n }", "private void showInvalidFileFormatError()\n {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Image Load Error\");\n alert.setHeaderText(null);\n alert.setContentText(\"The file was not recognized as an image file.\");\n\n alert.showAndWait();\n }", "@Override\r\n public final void displayError(final String message) {\r\n displayMessage(message, \"Error!\", SWT.ICON_ERROR);\r\n }", "public void showUnsolvableMessage() {\n\t\tJOptionPane.showMessageDialog(frame, \"Det angivna sudokut är olösbart\");\n\t}", "private void displayErrorMessage(String message, String fileName)\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"File error\");\n alert.setHeaderText(null);\n alert.setContentText(\"Error: \" + message + \": \" + fileName);\n\n alert.showAndWait();\n }", "public void showErrorMessage(String title, String Messge) {\n\t\tJOptionPane.showMessageDialog(mdiForm, Messge,\n\t\t\t\ttitle, JOptionPane.ERROR_MESSAGE);\n\t}", "private void showAlertResetFail(String msg) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Database error\");\n\n // Header Text: null\n alert.setHeaderText(\"Could not reset database\");\n alert.setContentText(msg);\n alert.showAndWait();\n }", "public void showWarningPopup() {\n\t\ttv_popupTitle.setText(\"Power Warning\");\n\t\ttv_popupInfo.setText(R.string.warning);\n\t\t\n\t\t// The code below assumes that the root container has an id called 'main'\n\t\t popup.showAtLocation(findViewById(R.id.anchor), Gravity.CENTER, 0, 0);\n\t}", "public void ShowMessageBox(String text)\n {\n ShowMessageBox(getShell(), \"Error\", text, 0);\n }", "@Override\n\tpublic void hidePopup() {\n\t\t// logger.info(\"..errr..I'll hide u\");\n\t}" ]
[ "0.71578956", "0.690647", "0.68775064", "0.68499386", "0.6846869", "0.67429996", "0.67341745", "0.67278945", "0.671364", "0.6683178", "0.6643683", "0.66232735", "0.6619329", "0.6598077", "0.65522283", "0.65011245", "0.6493557", "0.6493557", "0.6462185", "0.64149505", "0.64024115", "0.64024115", "0.63974684", "0.63871366", "0.637852", "0.6375855", "0.6325725", "0.6317318", "0.6311451", "0.6281934", "0.62667286", "0.625627", "0.6213963", "0.6207714", "0.62040395", "0.62010187", "0.61931896", "0.61877215", "0.61643475", "0.61281914", "0.61258143", "0.61252135", "0.608574", "0.60699004", "0.6068103", "0.60568225", "0.60541075", "0.60304326", "0.60278076", "0.6022533", "0.6019843", "0.6011261", "0.59866923", "0.59851307", "0.5975679", "0.5963971", "0.59505045", "0.59334135", "0.5932497", "0.5932301", "0.5928209", "0.590067", "0.58907604", "0.58762604", "0.58750737", "0.5871838", "0.58684886", "0.584461", "0.5835292", "0.5834655", "0.5832014", "0.5825818", "0.58226335", "0.58223873", "0.5803568", "0.5793231", "0.57836276", "0.57793385", "0.5778147", "0.5778147", "0.57749337", "0.5758937", "0.57528925", "0.57441247", "0.5726499", "0.5726362", "0.57254064", "0.57149976", "0.5700412", "0.569924", "0.569794", "0.56977475", "0.56945646", "0.5693712", "0.569251", "0.5691419", "0.5677746", "0.56757396", "0.56582904", "0.5655816" ]
0.584505
67
Sets the tooltip text displayed when outside graph, but inside the display panel.
public static String setToolTipText(String text) { String oldTip = toolTipText; toolTipText = text; return (oldTip); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTooltipDisplay(TooltipDisplay tooltipDisplay);", "public void setTooltipText() { tooltip.setText(name); }", "void showTooltip();", "public void setToolTipText(String text)\n/* */ {\n/* 227 */ putClientProperty(\"ToolTipText\", text);\n/* */ }", "public void setToolTipText (String string) {\r\n\tcheckWidget();\r\n\ttoolTipText = string;\r\n}", "public TooltipDisplay getTooltipDisplay();", "@Override\n public void setTooltip(String arg0)\n {\n \n }", "public String getToolTipText() {\n\t\treturn \"\";\r\n\t}", "@Override\r\n\tpublic String getToolTipText() {\n\t\treturn \"\";\r\n\t}", "protected void setToolTipText(Tile tile) {\n\t\tif(!peek && hidden) { tile.setToolTipText(\"concealed tile\"); }\n\t\telse {\n\t\t\tString addendum = \"\";\n\t\t\tif(playerpanel.getPlayer().getType()==Player.HUMAN) { addendum = \" - click to discard during your turn\"; }\n\t\t\ttile.setToolTipText(tile.getTileName()+ addendum); }}", "@Override\n\tpublic void setToolTip(String tooltip) {\n\t\t\n\t}", "public void setShowToolTip( boolean showToolTip )\n {\n this.showToolTip = showToolTip;\n }", "public void setPositionToolTipEnabled(boolean b) {\n enablePositionTooltip = b;\r\n }", "@Override\n public String getTooltip()\n {\n return null;\n }", "public void setTooltip(IFigure tooltip) {\n hasCustomTooltip = true;\n this.tooltip = tooltip;\n updateFigureForModel(nodeFigure);\n }", "private void setTooltip() {\n\t\tif (buttonAddScannable != null && !buttonAddScannable.isDisposed()) {\n\t\t\tgetParentShell().getDisplay().asyncExec(() -> buttonAddScannable.setToolTipText(\"Select scannable to add to list...\"));\n\t\t}\n\t}", "public void setTooltip(TooltipOptions tooltip) {\n this.tooltip = tooltip;\n }", "private void setHoverDisplay(String text, Vector3 coords) {\n\t\tfloat scaleFactor = 1920 / (Gdx.graphics.getWidth() * 1.0f);\n\t\tfloat x = coords.x * scaleFactor + 50;\n\t\tfloat y = coords.y * scaleFactor - 125;\n\t\tx = Math.min(Math.max(x, 0), 1920 - hoverImage.getWidth());\n\t\ty = Math.min(Math.max(y, 200), 1080 - hoverImage.getHeight());\n\t\thoverLabel.setText(text);\n\t\thoverLabel.setPosition(x + 75, y + 155);\n\t\tif (!text.equals(\"\")) {\n\t\t\thoverImage.setVisible(true);\n\t\t\thoverImage.setPosition(x, y);\n\t\t}\n\t}", "public void displayHover() {\n if (textColour == null) {\r\n displayEmptyHover();\r\n return;\r\n }\r\n stroke(0, 0, 0);\r\n strokeWeight(strokeWeight);\r\n hoverFill(boxColour);\r\n if (strokeWeight != 0 && text != null) {\r\n rect(x, y, w, h, 7);\r\n }\r\n fill(textColour);\r\n textSize(textSize);\r\n text(text, x + xTextOffset, y + yTextOffset);\r\n }", "@Override\n\tpublic String getToolTipText() {\n\t\treturn \"Show the clusters\";\n\t}", "protected void setToolTipErrorMessage() {\n\t\tString toolTipErrorMessage = null;\n\t\tsetToolTipMessage(toolTipErrorMessage);\n\t}", "public void setToolTipProvider(ToolTipProvider provider) {\n mToolTipProvider = provider;\n setToolTipText(mToolTipProvider == null ? null : \"\");\n }", "public String getToolTipText () {\r\n\tcheckWidget();\r\n\treturn toolTipText;\r\n}", "public abstract void setTooltipData(ITooltipData data);", "final public void setTooltipsVisible(boolean tooltipsVisible)\n {\n setProperty(TOOLTIPS_VISIBLE_KEY, tooltipsVisible ? Boolean.TRUE : Boolean.FALSE);\n }", "public static String getToolTipText() {\n\t\treturn (toolTipText);\n\t}", "public String getToolTipText() {\n return this.toString();\n }", "public abstract String getToolTip();", "default void setTooltip(@Nullable String tooltip) {}", "protected void setToolTip(String toolTip) {\n\tthis.toolTip = toolTip;\n }", "protected Boolean hasToolTipText(Object value) {\n\t\treturn false;\n }", "@Override\n protected void processUnhover() {\n \n Dialog.getInstance().hideTooltip();\n }", "@Override\r\n\tpublic String getToolTipText(MouseEvent event) {\r\n return toolTipWriter.write(getToolTipText(), event.getPoint());\r\n }", "public void setLabelToBeShown(String label);", "public SafeHtml getTooltip(C value) {\n return tooltipFallback;\n }", "@Override\r\n public String getTooltip() {\r\n return TOOLTIP;\r\n }", "public Shell showTooltip(Shell parent, int x, int y) {\r\n\t\tShell tooltip = new Shell(parent, SWT.TOOL | SWT.ON_TOP);\r\n\t\ttooltip.setLayout(new GridLayout());\r\n\r\n\t\ttooltip.setBackground(tooltip.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));\r\n\t\ttooltip.setBackgroundMode(SWT.INHERIT_FORCE);\r\n\r\n\t\tLabel lbContent = new Label(tooltip, SWT.NONE);\r\n\t\tlbContent.setText(\"Hello world! I'm a fake tooltip\");\r\n\r\n\t\tPoint lbContentSize = lbContent.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r\n\r\n\t\tint width = lbContentSize.x + 10;\r\n\t\tint height = lbContentSize.y + 10;\r\n\r\n\t\ttooltip.setBounds(x, y, width, height);\r\n\t\ttooltip.setVisible(true);\r\n\t\treturn tooltip;\r\n\t}", "@Override\n public StringTextComponent getTooltip() {\n return this.tooltip;\n }", "@Override\n\tpublic String getToolTipText() {\n\t\treturn \"shopEditorToolTipText\";\n\t}", "public void createToolTip(View view, Tooltip.Gravity gravity, String text){\n Tooltip.make(getContext(),\n new Tooltip.Builder(101)\n .anchor(view, gravity)\n .closePolicy(new Tooltip.ClosePolicy()\n .insidePolicy(true, false)\n .outsidePolicy(true, false), 3000)\n .activateDelay(800)\n .showDelay(300)\n .text(text)\n .maxWidth(700)\n .withArrow(true)\n .withOverlay(true)\n .withStyleId(R.style.ToolTipLayoutCustomStyle)\n .floatingAnimation(Tooltip.AnimationBuilder.DEFAULT)\n .build()\n ).show();\n }", "public void createToolTip(View view, Tooltip.Gravity gravity, String text){\n Tooltip.make(this,\n new Tooltip.Builder(101)\n .anchor(view, gravity)\n .closePolicy(new Tooltip.ClosePolicy()\n .insidePolicy(true, false)\n .outsidePolicy(true, false), 3000)\n .activateDelay(800)\n .showDelay(300)\n .text(text)\n .maxWidth(700)\n .withArrow(true)\n .withOverlay(true)\n .withStyleId(R.style.ToolTipLayoutCustomStyle)\n .floatingAnimation(Tooltip.AnimationBuilder.DEFAULT)\n .build()\n ).show();\n }", "@Override\n public void update() {\n super.update();\n Frame parentFrame = getParentFrame(0);\n setEnabled(parentFrame != null);\n setToolTipText(getToolTipText(parentFrame));\n }", "public void setDisplayTextLabel (boolean value)\r\n {\r\n displayTextLabelInformation_ = value;\r\n }", "void setHoverDetail(String detail);", "private void setToolTip(ARXProcessStatistics stats) {\n\n // Prepare\n double prunedPercentage = new BigDecimal(stats.getTransformationsAvailable())\n .subtract(BigDecimal.valueOf(stats.getTransformationsChecked()))\n .divide(new BigDecimal(stats.getTransformationsAvailable()), 1000, RoundingMode.HALF_UP)\n .multiply(BigDecimal.valueOf(100)).doubleValue();\n \n // Render statistics about the solution space\n StringBuilder sb = new StringBuilder();\n sb.append(Resources.getMessage(\"MainToolBar.1\")); //$NON-NLS-1$\n sb.append(Resources.getMessage(\"MainToolBar.2\")) //$NON-NLS-1$\n .append(stats.getTransformationsAvailable())\n .append(\"\\n\"); //$NON-NLS-1$\n \n sb.append(Resources.getMessage(\"MainToolBar.12\")) //$NON-NLS-1$\n .append(stats.getTransformationsAvailable().subtract(BigInteger.valueOf(stats.getTransformationsChecked())).toString());\n sb.append(\" [\") //$NON-NLS-1$\n .append(SWTUtil.getPrettyString(prunedPercentage))\n .append(\"%]\\n\"); //$NON-NLS-1$\n \n sb.append(Resources.getMessage(\"MainToolBar.18\")) //$NON-NLS-1$\n .append(SWTUtil.getPrettyString((double)stats.getDuration() / 1000d))\n .append(\"s\\n\"); //$NON-NLS-1$\n \n // Render information about the selected transformation\n if (stats.isSolutationAvailable()) {\n \n // Global transformation scheme\n if (!stats.isLocalTransformation()) {\n sb.append(Resources.getMessage(\"MainToolBar.36\")) //$NON-NLS-1$\n .append(Resources.getMessage(\"MainToolBar.39\")) //$NON-NLS-1$\n .append(stats.getStep(0).isOptimal() ? SWTUtil.getPrettyString(true) : Resources.getMessage(\"MainToolBar.72\"))\n .append(Resources.getMessage(\"MainToolBar.37\")) //$NON-NLS-1$\n .append(Arrays.toString(stats.getStep(0).getTransformation()));\n sb.append(Resources.getMessage(\"MainToolBar.38\")) //$NON-NLS-1$\n .append(stats.getStep(0).getScore().toString());\n for (QualityMetadata<?> metadata : stats.getStep(0).getMetadata()) {\n sb.append(\"\\n - \") //$NON-NLS-1$\n .append(metadata.getParameter()).append(\": \") //$NON-NLS-1$\n .append(SWTUtil.getPrettyString(metadata.getValue()));\n }\n \n // Complex transformation\n } else {\n sb.append(Resources.getMessage(\"MainToolBar.36\")) //$NON-NLS-1$\n .append(Resources.getMessage(\"MainToolBar.70\")) //$NON-NLS-1$\n .append(SWTUtil.getPrettyString(stats.getNumberOfSteps()))\n .append(Resources.getMessage(\"MainToolBar.39\")) //$NON-NLS-1$\n .append(SWTUtil.getPrettyString(false));\n }\n \n // No solution found\n } else {\n sb.append(Resources.getMessage(\"MainToolBar.71\")); //$NON-NLS-1$\n }\n \n this.tooltip = sb.toString();\n this.labelSelected.setToolTipText(tooltip);\n this.labelApplied.setToolTipText(tooltip);\n this.labelTransformations.setToolTipText(tooltip);\n }", "public X tooltipText(String text) {\n component.setToolTipText(text);\n return (X) this;\n }", "public JToolTip getCustomToolTip() {\n // to be overwritten by subclasses\n return null;\n }", "public void setToolTip (String imageName)\r\n\t{\r\n\t\tthis.imageName = imageName;\r\n\t}", "public String getToolTip() {\n\treturn this.toolTip;\n }", "public String getTooltip() {\n\t\treturn tooltip;\n\t}", "@Override\r\n\tpublic String getToolTipText(MouseEvent e) {\r\n\t\tMCLParticleSet particles = model.getParticles();\r\n\t\tif (particles == null) return null;\r\n\t\t\r\n\t\t// If the mouse is on a article, show its weight\r\n\t\tfloat x = e.getX()/ parent.pixelsPerUnit + viewStart.x;\r\n\t\tfloat y = (getHeight() - e.getY())/ parent.pixelsPerUnit + viewStart.y;\r\n\t\tint i = particles.findClosest(x,y);\r\n\t\tMCLParticle part = particles.getParticle(i);\r\n\t\tPose p = part.getPose(); \r\n\t\tif (Math.abs(p.getX() - x) <= 2f && Math.abs(p.getY() - y) <= 2f) return \"Weight \" + part.getWeight();\r\n\t\telse return null;\r\n\t}", "@Exported(visibility = 999)\n public String getTooltip() {\n return tooltip;\n }", "void onDeactivate() {\n\t\t/* Hide the FakeToolTip that could be open in this moment */\n\t\tfakeToolTip.hide();\n\t}", "public String lTipText() {\n return \"Whether to scale based on the number of instances.\";\n }", "TooltipTextMap getTooltipText() throws SearchServiceException;", "public boolean isShowToolTip()\n {\n return showToolTip;\n }", "void setTopLabelText(String text) {\n topLabel.setText(text);\n }", "@Override \n\t\t public void handle(MouseEvent event) {\n\t\t \ttooltip.setText(\n\t\t \t\t\tnode instanceof Label ? \n\t\t \t\t\t\t\t((Label)node).getText() :\n\t\t \t\t\t\t\t\t// for VBoxes who manage children\n\t\t \t\t\t\t\t\t(node instanceof VBox || node instanceof HBox) // is VBox or HBox\n\t\t \t\t\t\t\t\t&& (((Pane)node).getParent() != null) // AND has parent\n\t\t \t\t\t\t\t\t&& ((Pane)((Pane)node).getParent()).getChildren().get(0) instanceof Label ? // AND parent has children, the first of which is a Label \n\t\t \t\t\t\t\t\t((Label)((VBox)((Pane)node).getParent()).getChildren().get(0)).getText() :\n\t\t \t\t\t\t\t// for VBoxes who manage a Label and the child VBox\n\t\t \t\t\t\t\tnode instanceof VBox || node instanceof HBox || node instanceof Pane ? ((Label)((Pane)node).getChildren().get(0)).getText() :\t\t \t\t\t\t\t\n\t\t \t\t\t\t\t\t\"\"\t\t \t\t\t\n\t\t \t);\t\t \t\n\t\t tooltip.show(node, event.getScreenX() + 1 , event.getScreenY() - 30);\n//\t\t System.out.println(node.getClass().getName() + \" \" + tooltip.getText() + \" MouseMove\");\n\t\t event.consume();\n\t\t }", "public IFigure getTooltip() {\n return this.tooltip;\n }", "@Override\n\tpublic boolean isCustomTip() {\n\t\treturn false;\n\t}", "public static void setTooltip(final @NonNull Control control, final @NonNull String message) {\n Objects.requireNonNull(control);\n Objects.requireNonNull(message);\n\n if (message.isEmpty()) {\n throw new IllegalArgumentException(\"The message cannot be empty.\");\n }\n\n control.setTooltip(new Tooltip(message));\n }", "public void setShowCellTooltips(boolean visible) {\r\n calendarTable.setShowCellTooltips(visible);\r\n }", "public void updateElementTooltip()\n\t{\n\t\tsetElementTooltip();\n\t\t//update the tooltip of elements\n\t\tfor (ElementPanel tabElemnt : tableElements.values()) {\n\t\t\ttabElemnt.setElementTooltip();\n\t\t}\n\t\tfor (TablePanel subTPanel : SubTablePanels.values()) {\n\t\t\tsubTPanel.updateElementTooltip();\n\t\t}\n\t}", "private void setAllToolTip() {\n\t\tDeviceSettingsController.setAllToolTip(tooltipAndErrorProperties, deviceName.getText(), vendorId, productId,\n\t\t\t\tmanufacture, productString, autoGenerateSerialNumber, serialNumber, serialNumberIncrement,\n\t\t\t\tenableRemoteWakeup, powerConfiguration, Endpoint_1, fifoBusWidth, fifoClockFrequency, enableDebugLevel,\n\t\t\t\tdebugValue, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7, interFaceType, uvcVersion,\n\t\t\t\tuvcHeaderAddition, enableFPGA, fpgaFamily, browseBitFile, i2cSlaveAddress, deviceSttingFirmWare,\n\t\t\t\tdeviceSttingI2CFrequency);\n\t}", "public void setTooltipText(@RecentlyNullable CharSequence tooltipText) {\n/* 1572 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private void updateSystemTrayToolTip()\n {\n if (OSUtil.IS_LINUX)\n this.systemTray.setToolTip(\"SFR WiFi Public : Connecté\");\n else\n this.systemTray.setToolTip(FrmMainController.APP_NAME + \" \" + FrmMainController.APP_VERSION + FrmMainController.LINE_SEPARATOR + \"SFR WiFi Public : Connecté\");\n }", "@Override\n public String getToolTipText (final MouseEvent mEvent) {\n return getText();\n }", "public String getTabToolTipText();", "public void setOnmouseout(String val)\r\n\t{\r\n\t\t_onMouseOut = val;\r\n\t}", "public Optional<String> tooltip(double[] coord) {\n return Optional.empty();\n }", "public void showWarningPopup() {\n\t\ttv_popupTitle.setText(\"Power Warning\");\n\t\ttv_popupInfo.setText(R.string.warning);\n\t\t\n\t\t// The code below assumes that the root container has an id called 'main'\n\t\t popup.showAtLocation(findViewById(R.id.anchor), Gravity.CENTER, 0, 0);\n\t}", "public JToolTip createToolTip(){\n return new CreatureTooltip(this);\n }", "@Nullable\n\tdefault String getTooltip()\n\t{\n\t\treturn null;\n\t}", "public void setShowHover(boolean h)\n {\n showHover = h;\n }", "final public boolean isTooltipsVisible()\n {\n return ComponentUtils.resolveBoolean(getProperty(TOOLTIPS_VISIBLE_KEY), true);\n }", "public void editToolTip() {\r\n\t\tString expectedTooltip = \"Edit\";\r\n\t\tWebElement editTooltip = driver.findElement(By.cssSelector(\".ant-btn.ant-btn-primary.ant-btn-circle\"));\r\n\t\tActions actions = new Actions(driver);\r\n\t\tactions.moveToElement(editTooltip).perform();\r\n\t\tWebElement toolTipElement = driver.findElement(By.cssSelector(\"div[role='tooltip']\"));\r\n\t\tneedToWait(2);\r\n\t\tString actualTooltip = toolTipElement.getText();\r\n\t\tSystem.out.println(\"Actual Title of Tool Tip +++++++++\" + actualTooltip);\r\n\t\tAssert.assertEquals(actualTooltip, expectedTooltip);\r\n\t}", "@Override\n\t\tpublic int getToolTipDisplayDelayTime(Object object) {\n\t\t\treturn 2;\n\t\t}", "@Override\n public void setShowTips(boolean showFlag) {\n mesoCfgXML.setTipsOption(showFlag);\n }", "@Override\n\tpublic void setCustomTip(boolean isCustomTip) {\n\t\t\n\t}", "public String generateToolTipFragment(String toolTipText) {\n/* 88 */ return \" onMouseOver=\\\"return stm(['\" + \n/* 89 */ ImageMapUtilities.javascriptEscape(this.title) + \"','\" + \n/* 90 */ ImageMapUtilities.javascriptEscape(toolTipText) + \"'],Style[\" + this.style + \"]);\\\"\" + \" onMouseOut=\\\"return htm();\\\"\";\n/* */ }", "@Override\n public void onMouseOver(MouseOverEvent event) {\n popup.setPositionAndShow(event);\n }", "protected void reloadText() {\n this.chart.getPlot().setNoDataMessage(translator.translate(\"noDataAvailable\"));\n //this.chart.setTitle(translator.translate(key));\n //TODO extend method for x and y title exchange\n }", "String getTooltip() {\n return mTooltip;\n }", "public void setTooltipHandler(CanvasType.TooltipHandler handler)\r\n\t{\n\t}", "public String getToolTipText() {\n\t\t\treturn fragname.toString();\n\t\t}", "private void displayPopup(NativeEvent event, Element parent) {\n if (displayed) {\n return;\n }\n displayed = true;\n\n HorizontalPanel holder = new HorizontalPanel();\n SimplePanel arrow = new SimplePanel();\n arrow.addStyleName(\"arrow-left\");\n\n HTMLPanel panel = new HTMLPanel(tooltip);\n panel.addStyleName(\"panel\");\n\n holder.add(arrow);\n holder.add(panel);\n\n popup.clear();\n popup.add(holder);\n popup.addStyleName(StyleResource.INSTANCE.modal().tooltip());\n popup.show();\n popup.setPopupPosition(parent.getAbsoluteLeft() + 33, parent.getAbsoluteTop() + 2);\n }", "public void setInfoLabelText(String text) {\n Label infoLabel = s.findNiftyControl(\"infoLabel\", Label.class);\n if (text != null) {\n infoLabel.setText(text);\n infoPanel.setVisible(true);\n } else\n infoPanel.setVisible(false);\n }", "default String getTooltip() {\n throw new UnsupportedOperationException();\n }", "@Override\r\n\tpublic IFigure getTooltip(Object entity) {\n\t\tif (entity instanceof GraphNode) {\r\n\t\t\tGraphNode node = (GraphNode) entity;\r\n\t\t\treturn new Label(node.getName());\r\n\t\t} else if (entity instanceof EntityConnectionData) {\r\n\t\t\tEntityConnectionData conn = (EntityConnectionData) entity;\r\n\t\t\tGraphNode caller = (GraphNode) conn.source;\r\n\t\t\tGraphNode callee = (GraphNode) conn.dest;\r\n\t\t\treturn new Label(caller.getName() + \"-\" + callee.getName());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public FakeToolTip getFakeToolTip() {\n\t\treturn fakeToolTip;\n\t}", "public abstract ITooltipData getTooltipData();", "public String getToolTip ()\r\n\t{\r\n\t\tif (!((imageName.equals(\"GND\")) || (imageName.equals(\"VCC\")) || (imageName.equals(\"BOX\")) || (imageName.equals(\"OUTPUT\"))))\r\n\t\t{\r\n\t\t\tthis.toolTip = \"<html><img src=\"+this.imageName+\"></html>\";\r\n\t\t\treturn this.toolTip;\r\n\t\t}\r\n\t\t\r\n\t\telse if (imageName.equals(\"GND\"))\r\n\t\t\treturn \"GND\";\r\n\t\t\r\n\t\telse if (imageName.equals(\"VCC\"))\r\n\t\t\treturn \"VCC\";\r\n\t\t\r\n\t\telse if (imageName.equals(\"OUTPUT\"))\r\n\t\t\treturn \"Output window\";\r\n\t\t\r\n\t\telse\r\n\t\t\treturn \"TODO\";\r\n\t}", "private static void setValueTips(Series<String, Number> series1) {\n \tfor (Data<String, Number> entry : series1.getData()) { \n Tooltip t = new Tooltip(entry.getYValue().toString());\n Tooltip.install(entry.getNode(), t);\n }\n }", "public String getLocalizedHoverText(ContentEntity entity, boolean expanded);", "public void addConcordionTooltip(final String message) {\n\t\ttooltipLogger.debug(message);\r\n\t}", "private void changeToolTip(SingleDocumentModel model) {\n\t\tsetToolTipTextAt(models.indexOf(model), model.getFilePath().toString());\n\t}", "public void setXLabel(final String str) {\n this.XLabel.setText(str);\n this.XLabel.setToolTipText(this.XLabel.getText());\n }", "private void updateLabel(String text) {\r\n labelT.setText(text);\r\n labelT.setToolTipText(text);\r\n }", "protected void setValue(Object v) {\n super.setValue(v);\n\n setToolTipText(\"Hi There!!!!\");\n\n }", "@Override\n public void onMouseOut(MouseOutEvent event) {\n popup.hide(true);\n }" ]
[ "0.75172824", "0.7241901", "0.6978087", "0.67169535", "0.6588013", "0.6547506", "0.6534462", "0.62411803", "0.6193769", "0.6192304", "0.6091632", "0.6075374", "0.60601455", "0.6016937", "0.60162294", "0.598257", "0.59305596", "0.59269696", "0.59025526", "0.58752894", "0.5857194", "0.5845433", "0.5756443", "0.5724376", "0.5712893", "0.5708066", "0.5702514", "0.5690962", "0.56777614", "0.5661715", "0.5656778", "0.56344676", "0.5581158", "0.5547173", "0.5522606", "0.5517113", "0.55101794", "0.5507247", "0.5480429", "0.5472593", "0.5465561", "0.54536736", "0.54403585", "0.54341584", "0.5430907", "0.54191536", "0.5404715", "0.5389302", "0.5386073", "0.5372137", "0.5367334", "0.5352015", "0.5347221", "0.5332548", "0.53248256", "0.5313899", "0.5309822", "0.53021204", "0.529968", "0.52918", "0.5270782", "0.5251949", "0.5250473", "0.5249584", "0.52269036", "0.5225881", "0.5225043", "0.520046", "0.51928115", "0.51513445", "0.51507336", "0.51489973", "0.51364875", "0.5125093", "0.51136005", "0.511204", "0.5110666", "0.51013994", "0.509768", "0.50901276", "0.5085881", "0.5068885", "0.5065499", "0.50636876", "0.504524", "0.5037965", "0.50368303", "0.50314176", "0.5025754", "0.502347", "0.5019259", "0.50167227", "0.5002843", "0.5000776", "0.49950087", "0.49836114", "0.49812734", "0.49795923", "0.4957115", "0.49473664" ]
0.5564758
33
Gets the current tooltip text displayed when outside graph, but inside the display panel.
public static String getToolTipText() { return (toolTipText); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TooltipDisplay getTooltipDisplay();", "public String getToolTipText() {\n return this.toString();\n }", "public String getToolTipText () {\r\n\tcheckWidget();\r\n\treturn toolTipText;\r\n}", "public String getToolTipText() {\n\t\treturn \"\";\r\n\t}", "public String getTabToolTipText();", "public String getToolTipText() {\n\t\t\treturn fragname.toString();\n\t\t}", "public abstract String getToolTip();", "public String getToolTip() {\n\treturn this.toolTip;\n }", "@Override\r\n\tpublic String getToolTipText() {\n\t\treturn \"\";\r\n\t}", "public IFigure getTooltip() {\n return this.tooltip;\n }", "@Override\r\n\tpublic String getToolTipText(MouseEvent event) {\r\n return toolTipWriter.write(getToolTipText(), event.getPoint());\r\n }", "@Override\n public String getToolTipText (final MouseEvent mEvent) {\n return getText();\n }", "public String getTooltip() {\n\t\treturn tooltip;\n\t}", "@Override\r\n\tpublic String getToolTipText(MouseEvent e) {\r\n\t\tMCLParticleSet particles = model.getParticles();\r\n\t\tif (particles == null) return null;\r\n\t\t\r\n\t\t// If the mouse is on a article, show its weight\r\n\t\tfloat x = e.getX()/ parent.pixelsPerUnit + viewStart.x;\r\n\t\tfloat y = (getHeight() - e.getY())/ parent.pixelsPerUnit + viewStart.y;\r\n\t\tint i = particles.findClosest(x,y);\r\n\t\tMCLParticle part = particles.getParticle(i);\r\n\t\tPose p = part.getPose(); \r\n\t\tif (Math.abs(p.getX() - x) <= 2f && Math.abs(p.getY() - y) <= 2f) return \"Weight \" + part.getWeight();\r\n\t\telse return null;\r\n\t}", "String getHoverDetail();", "@Override\n public StringTextComponent getTooltip() {\n return this.tooltip;\n }", "@Override public String getToolTipText(MouseEvent evt)\n{\n String rslt = null;\n\n int pos = evt.getX();\n int minpos = getX() + 16;\n int maxpos = getX() + getWidth() - 16;\n double relpos = (pos - minpos);\n if (relpos < 0) relpos = 0;\n relpos /= (maxpos - minpos);\n double timer = getMinimum() + relpos * (getMaximum() - getMinimum()) + 0.5;\n long time = (long) timer;\n if (time > getMaximum()) time = getMaximum();\n\n BicexEvaluationContext ctx = for_bubble.getExecution().getCurrentContext();\n if (ctx == null) return null;\n\n BicexValue bv = ctx.getValues().get(\"*LINE*\");\n List<Integer> times = bv.getTimeChanges();\n String line = null;\n for (Integer t : times) {\n if (t <= time) {\n\t line = bv.getStringValue(t+1);\n\t}\n else break;\n }\n if (line != null) rslt = \"Line \" + line;\n\n if (ctx != null) {\n String what = \"In\";\n if (ctx.getInnerContexts() != null) {\n\t for (BicexEvaluationContext sctx : ctx.getInnerContexts()) {\n\t if (sctx.getStartTime() <= time && sctx.getEndTime() >= time) {\n\t ctx = sctx;\n\t what = \"Calling\";\n\t break;\n\t }\n\t }\n }\n if (rslt == null) rslt = what + \" \" + ctx.getMethod();\n else rslt += \" \" + what + \" \" + ctx.getShortName();\n }\n\n return rslt;\n}", "@Exported(visibility = 999)\n public String getTooltip() {\n return tooltip;\n }", "public JToolTip getCustomToolTip() {\n // to be overwritten by subclasses\n return null;\n }", "String getTooltip() {\n return bufTip;\n }", "@Override\n public String getTooltip()\n {\n return null;\n }", "void showTooltip();", "TooltipTextMap getTooltipText() throws SearchServiceException;", "public String getToolTip ()\r\n\t{\r\n\t\tif (!((imageName.equals(\"GND\")) || (imageName.equals(\"VCC\")) || (imageName.equals(\"BOX\")) || (imageName.equals(\"OUTPUT\"))))\r\n\t\t{\r\n\t\t\tthis.toolTip = \"<html><img src=\"+this.imageName+\"></html>\";\r\n\t\t\treturn this.toolTip;\r\n\t\t}\r\n\t\t\r\n\t\telse if (imageName.equals(\"GND\"))\r\n\t\t\treturn \"GND\";\r\n\t\t\r\n\t\telse if (imageName.equals(\"VCC\"))\r\n\t\t\treturn \"VCC\";\r\n\t\t\r\n\t\telse if (imageName.equals(\"OUTPUT\"))\r\n\t\t\treturn \"Output window\";\r\n\t\t\r\n\t\telse\r\n\t\t\treturn \"TODO\";\r\n\t}", "@Override\r\n\tpublic IFigure getTooltip(Object entity) {\n\t\tif (entity instanceof GraphNode) {\r\n\t\t\tGraphNode node = (GraphNode) entity;\r\n\t\t\treturn new Label(node.getName());\r\n\t\t} else if (entity instanceof EntityConnectionData) {\r\n\t\t\tEntityConnectionData conn = (EntityConnectionData) entity;\r\n\t\t\tGraphNode caller = (GraphNode) conn.source;\r\n\t\t\tGraphNode callee = (GraphNode) conn.dest;\r\n\t\t\treturn new Label(caller.getName() + \"-\" + callee.getName());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Nullable\n\tdefault String getTooltip()\n\t{\n\t\treturn null;\n\t}", "protected String getToolTip( MouseEvent event )\n {\n SmartText descr = new SmartText();\n int column = treeTable.columnAtPoint( event.getPoint() );\n if ( column == 0 )\n {\n int row = treeTable.rowAtPoint( event.getPoint() );\n if ( row == 0 )\n {\n descr.setText( componentModel.getTypeDescription() );\n }\n else\n {\n Object value = treeTable.getValueAt( row, 1 );\n if ( value instanceof Property )\n {\n Property p = ( Property )value;\n descr.setText( p.getToolTip() );\n }\n }\n\n // perform line wrapping now\n descr.setText( \"<html>\" + descr.insertBreaks( \"<br>\", toolTipWidth, true ) + \"</html>\" );\n return descr.toString();\n }\n return null;\n }", "String getTooltip() {\n return mTooltip;\n }", "public String getToolTipText(MouseEvent event) {\n\t\tjava.awt.Point loc = event.getPoint();\n\t\tint row = rowAtPoint(loc);\n\t\tFileTableModel model = (FileTableModel) getModel();\n\t\treturn model.getDescriptions()[row];\n\t}", "@Override\r\n public String getTooltip() {\r\n return TOOLTIP;\r\n }", "public void setTooltipText() { tooltip.setText(name); }", "@Override\n\tpublic String getToolTipText() {\n\t\treturn \"shopEditorToolTipText\";\n\t}", "public String getRibbonToolTipText()\n\t{\n\t\treturn ribbonToolTipText;\n\t}", "public String getToolTipText(int series, int item) {\n\n String result = null;\n\n if (series < getListCount()) {\n List tooltips = (List) this.toolTipSeries.get(series);\n if (tooltips != null) {\n if (item < tooltips.size()) {\n result = (String) tooltips.get(item);\n }\n }\n }\n\n return result;\n }", "@Override\n\tpublic String getToolTipText() {\n\t\treturn \"Show the clusters\";\n\t}", "public void setTooltipDisplay(TooltipDisplay tooltipDisplay);", "public SafeHtml getTooltip(C value) {\n return tooltipFallback;\n }", "public String getToolTip(ViewEvent anEvent)\n {\n LineMarker<?>[] markers = getMarkers();\n LineMarker<?> marker = ArrayUtils.findMatch(markers, m -> m.contains(_mx, _my));\n return marker != null ? marker.getToolTip() : null;\n }", "public abstract ITooltipData getTooltipData();", "public String getLocalizedHoverText(ContentEntity entity, boolean expanded);", "public TooltipOptions getTooltip() {\n return this.tooltip;\n }", "@JsOverlay\n\tpublic final String getZoomOutText() {\n\t\treturn this.zoomOutText;\n\t}", "default String getTooltip() {\n throw new UnsupportedOperationException();\n }", "public Optional<String> tooltip(double[] coord) {\n return Optional.empty();\n }", "public FakeToolTip getFakeToolTip() {\n\t\treturn fakeToolTip;\n\t}", "String getDisplayText();", "public String getLabelText(){\n\t\treturn syncExec(new StringResult() {\t\t\n\t\t\t@Override\n\t\t\tpublic String run() {\n\t\t\t\tControl[] aux = widget.getParent().getChildren();\n\t\t\t\tfor (Control control : aux) {\n\t\t\t\t\tif (control instanceof CLabel){\n\t\t\t\t\t\treturn ((CLabel)control).getText();\n\t\t\t\t\t}\n\t\t\t\t\tif (control instanceof Label){\n\t\t\t\t\t\treturn ((Label)control).getText();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t}", "String getTooltipContent(WebElement field){\n String tooltip = null;\n String tooltipId = field.getAttribute(\"aria-describedby\");\n By tooltipLocator = By.id(tooltipId);\n WebElement tooltipField = driver.findElement(tooltipLocator);\n tooltip = tooltipField.getText();\n System.out.println(\"** tooltip value: \" + tooltip);\n return tooltip;\n }", "public String lTipText() {\n return \"Whether to scale based on the number of instances.\";\n }", "public String getLabelText();", "public java.lang.String getTip()\n {\n return this.tip;\n }", "public double getTip() {\r\n return tipCalculator.getCalculatedTip();\r\n }", "public String getToolTip(int columnIndex) {\n\t\t//@formatter:off\n\t\tList<ColumnConstraintSet<R, ?>> filtered =\n\t\t\tconstraintSets.stream()\n\t\t\t\t.filter(cf -> cf.getColumnModelIndex() == columnIndex)\n\t\t\t\t.collect(Collectors.toList());\n\t\t//@formatter:on\n\n\t\tif (filtered.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\treturn getHtmlRepresentation(filtered);\n\t}", "public Object[] getTooltipTokens() {\n return null;\n }", "@Override\n public String getToolTipText(MouseEvent e)\n {\n Point p = e.getPoint();\n int rowIndex = rowAtPoint(p);\n int colIndex = columnAtPoint(p);\n Object cellData = getValueAt(rowIndex, colIndex);\n\n if (cellData instanceof Color)\n {\n Color color = (Color)cellData;\n return \"RGB Color value: \" + color.getRed() + \", \" + color.getGreen() + \", \" + color.getBlue();\n }\n else\n return cellData.toString();\n }", "public String getDisplayText() {\r\n\t\treturn Strings.isNOTNullOrEmpty(this.getText())\r\n\t\t\t\t\t\t? this.getText()\r\n\t\t\t\t\t\t: Strings.isNOTNullOrEmpty(this.getDescription())\r\n\t\t\t\t\t\t\t\t? this.getDescription()\r\n\t\t\t\t\t\t\t\t: this.getUrl() != null\r\n\t\t\t\t\t\t\t\t\t\t? this.getUrl().asString()\r\n\t\t\t\t\t\t\t\t\t\t: \"NO TEXT DEFINED\";\r\n\t}", "public String getENDTooltip(int endCost);", "final public boolean isTooltipsVisible()\n {\n return ComponentUtils.resolveBoolean(getProperty(TOOLTIPS_VISIBLE_KEY), true);\n }", "public String getHover() { return (String)get(\"Hover\"); }", "@SuppressWarnings(\"deprecation\")\n public String getToolTipText(JTextComponent t, Point pt) {\n if (!painted) {\n return null;\n }\n Document doc = editor.getDocument();\n String tt = null;\n Rectangle alloc = getVisibleEditorRect();\n\n if (alloc != null) {\n if (doc instanceof AbstractDocument) {\n ((AbstractDocument)doc).readLock();\n }\n try {\n tt = rootView.getToolTipText(pt.x, pt.y, alloc);\n } finally {\n if (doc instanceof AbstractDocument) {\n ((AbstractDocument)doc).readUnlock();\n }\n }\n }\n return tt;\n }", "public String getText() {\n\t\t\t\t\tint i = customTabbed.tabbedPane.indexOfTabComponent(customJTabbedpane.this);\n\t\t\t\t\tif (i != -1)\n\t\t\t\t\t\treturn customTabbed.tabbedPane.getTitleAt(i);\n\t\t\t\t\treturn null;\n\t\t\t\t}", "public boolean isShowToolTip()\n {\n return showToolTip;\n }", "public String kTipText() {\n return \"The value used in the tozero() method.\";\n }", "public static String getToolTipOfObject(By byObj) throws IllegalArgumentException, IllegalAccessException, InterruptedException, IOException {\n\t\tString tooltip = \"\";\n\t\tString t1 = driver.findElement(byObj).getAttribute(\"tooltip-text\");\n\t\tif(t1!=null) {\n\t\t\ttooltip = t1;\n\t\t}\n\t\telse {\n\t\t\thoverMouseToObject(byObj);\n\t\t\tsnooze(1000);\n\t\t\tif(getExistentStatus(byToolTip_Object)) {\n\t\t\t\tString t2 = driver.findElement(byToolTip_Object).getText();\n\t\t\t\ttooltip = t2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tString objectName = getObjectName(byObj);\n\t\t\t\ttooltip = \"\";\n\t\t\t\tTestNotify.warning(GenLogTC() + \"There is no tooltip for the object [\" + objectName +\"].\");\n\t\t\t}\n\t\t}\t\n\t\treturn tooltip;\n\t}", "@JsOverlay\n\tpublic final String getzoomOutTitle() {\n\t\treturn this.zoomOutTitle;\n\t}", "public ToolTipView getToolTipView() { return _toolTipView; }", "public String getOnmouseout()\r\n\t{\r\n\t\treturn _onMouseOut;\r\n\t}", "public String getStatusInfoDetailsToolTip() {\r\n return statusInfoTooltip;\r\n }", "public String getDisplayText()\n\t\t{\n\t\t\tElement displayText = XMLUtils.findChild(userElement, DISPLAY_TEXT_ELEMENT_NAME);\n\t\t\tif (displayText != null)\n\t\t\t\treturn displayText.getTextContent();\n\n\t\t\treturn null;\n\t\t}", "protected Boolean hasToolTipText(Object value) {\n\t\treturn false;\n }", "@Override\n public String getHoverInfo( final ITextViewer textViewer,\n final IRegion hoverRegion ) {\n \t String hoverInfo = computeProblemInfo( textViewer, hoverRegion );\n \t if (hoverInfo != null) {\n \t return hoverInfo;\n \t }\n \t return computeThingAtPoint( textViewer, hoverRegion );\n }", "public String getTitlePopup() {\n/* 136 */ return getCOSObject().getString(COSName.T);\n/* */ }", "public String generateToolTip(XYDataset data, int series, int item) {\n\n return getToolTipText(series, item);\n\n }", "public String generateToolTipFragment(String toolTipText) {\n/* 88 */ return \" onMouseOver=\\\"return stm(['\" + \n/* 89 */ ImageMapUtilities.javascriptEscape(this.title) + \"','\" + \n/* 90 */ ImageMapUtilities.javascriptEscape(toolTipText) + \"'],Style[\" + this.style + \"]);\\\"\" + \" onMouseOut=\\\"return htm();\\\"\";\n/* */ }", "public String getText() {\n int i = tp.indexOfTabComponent(TabButtonComponent.this);\n if (i != -1) {\n return tp.getTitleAt(i);\n }\n return null;\n }", "public String getToolTip(java.awt.Point position, long millis) {\n return getName() + \"\\n\"\n + getClass().getName() + \"\\n\"\n + \"Start = \" + isStart() + \"\\n\"\n + \"AFU ID = \" + getAfuId() + \"\\n\"\n + \"value<\" + (n_bits - 1) + \":0>= \" + vector.toBinString() + \"\\n\"\n + vector.toHexString() + \" / \" + vector.toDecString();\n }", "public void setToolTipText (String string) {\r\n\tcheckWidget();\r\n\ttoolTipText = string;\r\n}", "protected DecoratorString<ARXNode> getTooltipDecorator() {\n return this.tooltipDecorator;\n }", "public int getWingTip() {\n if (arrowhead != null) {\n return arrowhead.getWingTip();\n }\n return 0;\n }", "public String getOnmouseover()\r\n\t{\r\n\t\treturn _onMouseOver;\r\n\t}", "@Override\n\t\tpublic int getToolTipDisplayDelayTime(Object object) {\n\t\t\treturn 2;\n\t\t}", "public void displayHover() {\n if (textColour == null) {\r\n displayEmptyHover();\r\n return;\r\n }\r\n stroke(0, 0, 0);\r\n strokeWeight(strokeWeight);\r\n hoverFill(boxColour);\r\n if (strokeWeight != 0 && text != null) {\r\n rect(x, y, w, h, 7);\r\n }\r\n fill(textColour);\r\n textSize(textSize);\r\n text(text, x + xTextOffset, y + yTextOffset);\r\n }", "@RecentlyNullable\n/* */ public CharSequence getTooltipText() {\n/* 1556 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public String getFacetLabelHoverStyle() {\r\n return getAttributeAsString(\"facetLabelHoverStyle\");\r\n }", "@Override\n public java.lang.String getLabelToDisplay() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (SystemAttributeSymbols.LABEL_TO_DISPLAY_);\n return (java.lang.String)retnValue;\n }", "public JToolTip createToolTip(){\n return new CreatureTooltip(this);\n }", "@Nullable\n protected String location() {\n String location = null;\n\n if (parent != null) {\n ItemPresentation itemPresentation = parent.getPresentation();\n\n if (itemPresentation instanceof Parent) {\n Parent parentPresentation = (Parent) itemPresentation;\n location = parentPresentation.getLocatedPresentableText();\n }\n }\n\n return location;\n }", "public String getTabTitleToolTip() {\r\n\t return \"Perform SubspaceClusterings\";\r\n\t }", "protected String getToolTipTextForDate(JaretDate date, Range range) {\n String str;\n if (range == Range.HOUR) {\n str = date.toDisplayString();\n } else {\n str = date.toDisplayStringDate();\n }\n return str;\n }", "public Object getOnmouseover() {\r\n\t\treturn getOnMouseOver();\r\n\t}", "public abstract String getLabelText();", "public Position getTextPosition()\n {\n int hpos = getComponent().getHorizontalTextPosition();\n int vpos = getComponent().getVerticalTextPosition();\n return Position.get(hpos, vpos);\n }", "public void setToolTipText(String text)\n/* */ {\n/* 227 */ putClientProperty(\"ToolTipText\", text);\n/* */ }", "public float XOffset() {\n\t\tfloat xoffset = 0;\n\t\tif (MouseX() + 12 + (tipw * 7 + 4) > MainSim.WinX) {\t\t\t \t// If the tooltip will be outside the window (based on mousex):\n\t\t\txoffset = (MouseX() + 12 + (tipw * 7 + 4)) - MainSim.WinX; \t\t// Find how much the tip will be drawn outside\n\t\t} else {\n\t\t\txoffset = 0;\n\t\t}\n\t\treturn xoffset;\n\t}", "public String getTip(int tipNo) {\n\t\treturn tips.get(tipNo);\n\t}", "String getXAxisLabel();", "public String getYaxisTitle() {\r\n if (yaxisTitle != null) {\r\n return yaxisTitle;\r\n }\r\n ValueBinding vb = getValueBinding(\"yaxisTitle\");\r\n return vb != null ? (String) vb.getValue(getFacesContext()) :\r\n DEFAULT_YAXIS_TITLE;\r\n }", "public boolean isShowCellTooltips() {\r\n return calendarTable.isShowCellTooltips();\r\n }", "public String getThePanel() {\r\n\t\treturn secretIt.currentS().puzzle();\r\n\t}", "public String getToolTipText()\n\t{\n\n\t\treturn \"Execute DQL\"; //$NON-NLS-1$\n\t}" ]
[ "0.7504646", "0.71467006", "0.7038985", "0.6977671", "0.67709327", "0.66917753", "0.6613435", "0.6599907", "0.6590268", "0.65480345", "0.6529025", "0.648044", "0.64615595", "0.64553756", "0.64512026", "0.63915354", "0.63914096", "0.63864005", "0.6336692", "0.63243", "0.6296646", "0.6213976", "0.6204273", "0.61908376", "0.6176048", "0.6132738", "0.6131126", "0.61184996", "0.61001396", "0.60462666", "0.6043897", "0.6015502", "0.6003913", "0.600355", "0.59445983", "0.5941536", "0.59329915", "0.590202", "0.58852863", "0.5883265", "0.5862434", "0.58490306", "0.58366793", "0.5836103", "0.576137", "0.57597893", "0.57474756", "0.57466626", "0.5744209", "0.574385", "0.57307106", "0.5718358", "0.5712366", "0.56837213", "0.56789696", "0.56595665", "0.56389564", "0.5632928", "0.562716", "0.56236273", "0.56234634", "0.5611308", "0.560472", "0.5575364", "0.557362", "0.55556065", "0.55488896", "0.5544827", "0.55150414", "0.5497959", "0.5497888", "0.5496674", "0.54867125", "0.54785764", "0.54543966", "0.540734", "0.5402887", "0.5401886", "0.5393466", "0.53855467", "0.538547", "0.5382925", "0.537874", "0.53684616", "0.53658086", "0.53477", "0.53276676", "0.52981436", "0.5278942", "0.5272306", "0.5258864", "0.52587104", "0.52554345", "0.5253552", "0.5247664", "0.52447736", "0.5238464", "0.52319205", "0.523093", "0.5221014" ]
0.72922164
1
sort array linearly check for triangle property
public int solution(int[] A) { Arrays.sort(A); for(int i=0; i<A.length - 2;i++) { if(checkForTriangleProperty(A, i)) { return 1; } } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int triangleNumber_sort(int[] nums) {\n if (nums == null || nums.length <= 2) {\n return 0;\n }\n\n Arrays.sort(nums);\n int ans = 0;\n int len = nums.length;\n for (int i = 0; i < len; i++) {\n if (nums[i] <= 0) {\n continue;\n }\n for (int j = i + 1; j < len; j++) {\n if (nums[j] <= 0) {\n continue;\n }\n for (int k = j + 1; k < len; k++) {\n if (nums[i] + nums[j] > nums[k]) {\n ans++;\n } else {\n break;\n }\n }\n }\n }\n\n return ans;\n }", "public static ArrayList<Integer[]> compactForwardAlgorithmTriangles(ArrayList<Integer>[] graph) {\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // sort adjacency arrays according to eta\n pairs.forEach(p -> p.getSecond().sort(Comparator.comparing(etas::get)));\n\n\n\n int triangleCount = 0;\n ArrayList<Integer[]> triangles = new ArrayList();\n\n\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n Integer v = pair.getFirst();\n ArrayList<Integer> v_neighbors = graph[v];\n\n for (int u : v_neighbors) {\n if (etas.get(u) > etas.get(v)) {\n ArrayList<Integer> u_neighbors = graph[u];\n\n Iterator<Integer> uIterator = u_neighbors.iterator(), vIterator = v_neighbors.iterator();\n\n if (uIterator.hasNext() && vIterator.hasNext()) {\n Integer u_ = uIterator.next(), v_ = vIterator.next();\n while (uIterator.hasNext() && vIterator.hasNext() && etas.get(u_) < etas.get(v)\n && etas.get(v_) < etas.get(v)) {\n if (etas.get(u_) < etas.get(v_))\n u_ = uIterator.next();\n else if (etas.get(u_) > etas.get(v_))\n v_ = vIterator.next();\n else {\n Integer[] triangle = new Integer[3];\n\n triangle[0] = u;\n triangle[1] = v;\n triangle[2] = u_;\n triangles.add(triangle);\n\n\n triangleCount++;\n\n u_ = uIterator.next();\n v_ = vIterator.next();\n\n }\n }\n\n }\n }\n }\n }\n return triangles;\n }", "static public void findPossibleTrianglesCount_V1(int[] arr, int n){\n \r\n int i,j,k; //loop or index variables\r\n int nTriangles = 0;\r\n \r\n for(i=0; i<n-2; i++){\r\n for(j=i+1; j<n-1; j++){\r\n for(k=j+1; k<n; k++){\r\n if(arr[i] != arr[j] && arr[i] != arr[k] && arr[j] != arr[k]){\r\n if(arr[i]+arr[j] > arr[k] && arr[i]+arr[k] > arr[j] && arr[j]+arr[k] > arr[i] ){ //a+b > c \r\n System.out.println(arr[i] + \" , \" + arr[j] + \" , \" + arr[k]);\r\n nTriangles+=1;\r\n }\r\n } //if\r\n } //innermost for k\r\n } //inner for j\r\n } //outer for i\r\n \r\n System.out.println(\"Number of possible triangles: \" + nTriangles);\r\n }", "@Test\n\t\tpublic void orderTest () {\n\t\t\tassertTrue (Demo.isTriangle(2, 1, 4));\t\n\t\t}", "public static int[] sortArray3(int[] array) {\n for(int i=0 ; i<array.length-1 ; i++){\n for(int j=i+1; j<array.length ; j++){\n if(array[i]>array[j] && array[i]%2 == 1 && array[j]%2 == 1){\n int aux=array[i];\n array[i]=array[j];\n array[j]=aux;\n }\n }\n }\n return array;\n }", "void sort() {\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) { // if the first term is larger\n\t\t\t\t\t\t\t\t\t\t\t\t// than the last term, then the\n\t\t\t\t\t\t\t\t\t\t\t\t// temp holds the previous term\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];// swaps places within the array\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public static void shellSort(Comparable[] a) {\n int n = a.length;\n int h = 1;\n // Iteratively increase the stride h until the stride will at most sort 2 elements.\n while (h < n/3) h = 3*h + 1;\n while (h >= 1) {\n for (int i = 1; i < n; i += h) {\n for (int j = i; j > 0; j--) {\n if (less(a[j], a[j-1])) exch(a, j, j-1);\n else break;\n }\n }\n h /= 3;\n }\n\n }", "private static void sort(Object[] a, Object[] tmp,\n int from, int to, Fun isLess) {\n int split = (from + to) / 2;\n if (split - from > 1)\n sort(tmp, a, from, split, isLess);\n if (to - split > 1)\n sort(tmp, a, split, to, isLess);\n int i = from, j = split;\n while (i < split && j < to) {\n if (isLess.apply(tmp[i], tmp[j]) == Boolean.TRUE)\n a[from] = tmp[i++];\n else\n a[from] = tmp[j++];\n ++from;\n }\n if (i < split)\n System.arraycopy(tmp, i, a, from, split - i);\n else if (j < to)\n System.arraycopy(tmp, j, a, from, to - j);\n }", "public boolean canReorderDoubled3(int[] A) {\n SortedMap<Integer, Integer> count = new TreeMap<>();\n for (int a : A) {\n count.put(a, count.getOrDefault(a, 0) + 1);\n }\n for (int num : count.keySet()) {\n int cnt = count.get(num);\n if (cnt == 0) { continue; }\n\n if (num < 0 && num % 2 != 0) { return false; }\n\n int pair = (num < 0) ? num / 2 : num * 2;\n if (cnt > count.getOrDefault(pair, 0)) { return false; }\n\n count.put(pair, count.get(pair) - cnt);\n }\n return true;\n }", "public int triangleNumber(int[] nums) {\n Arrays.sort(nums);\n int count = 0;\n for (int i = 0; i < nums.length - 2; i++) {\n for (int j = i + 1; j < nums.length - 1; j++) {\n int k = j + 1;\n while (k < nums.length && nums[i] + nums[j] > nums[k]) {\n k++;\n }\n count += k - j - 1;\n }\n\n }\n return count;\n }", "static long findNumberOfTriangles(int arr[], int n)\n {\n\n long count=0;\n\n for(int i=0;i<n;i++){\n for(int j=i;j<n;j++){\n if(arr[i]>arr[j]){\n int temp=arr[j];\n arr[j]=arr[i];\n arr[i]=temp;\n }\n }\n }\n\n int k =n-1;\n for(int i=n-2;i>=0;i--){\n for(int j=i-1;j>=0;j--){\n if(arr[k]<arr[j]+arr[i]){\n count++;\n }\n }\n k--;\n }\n\n return count;\n }", "public static void sort(Comparable[] a) {\n for (int i = 0 ; i < a.length ; i++) { // each position scan\n int min = i;\n for (int j = i+1; j < a.length; j++) { // each time we have to scan through remaining entry\n if (HelperFunctions.less(a[j], a[min])) {\n min = j ;\n }\n HelperFunctions.exch(a, i, min);\n }\n }\n }", "@Test\n public void testSort_intArr_half() {\n int[] expResult = ASC_CHECK_HALF_SORT_ARRAY;\n sorter.sort(data, 0, 8);\n assertArrayEquals(\"Error testing class: \" + className, expResult, data);\n }", "public static int triangleNumber_tp(int[] nums) {\n if (nums == null || nums.length <= 2) {\n return 0;\n }\n\n Arrays.sort(nums);\n int ans = 0;\n int len = nums.length;\n for (int i = len - 1; i >= 2; i--) {\n int left = 0;\n int right = i - 1;\n while (left < right) {\n if (nums[left] + nums[right] > nums[i]) {\n ans += right - left;\n right--;\n } else {\n left++;\n }\n }\n }\n\n return ans;\n }", "static public void findPossibleTrianglesCount_V2(int[] arr, int n){\n \r\n int i,j,k; //loop or index variables\r\n int nTriangles = 0;\r\n \r\n Arrays.sort(arr);\r\n \r\n for(i=0; i<n-2; i++){\r\n k = i+2;\r\n for(j=i+1; j<n-1; j++){\r\n while(k<n && arr[i]+arr[j]>arr[k])\r\n k++;\r\n nTriangles+= k-j-1;\r\n }\r\n }\r\n \r\n System.out.println(\"Number of possible triangles \" + nTriangles);\r\n }", "@Test\n public void testSort_intArr_IntComparator_half() {\n IntComparator comparator = IntComparatorAsc.getInstance();\n int[] expResult = ASC_CHECK_HALF_SORT_ARRAY;\n sorter.sort(data, 0, 8, comparator);\n assertArrayEquals(\"Error testing class: \" + className, expResult, data);\n }", "public <T extends Comparable<? super T>> void sort (T[] a) {\n int n = a.length;\n for (int i = 0; i< n - 1; i++) {\n for (int j = 0; j < n -1 - i; j++) {\n if (a[j+1].compareTo(a[j]) < 0) \n {\n T tmp = a[j]; \n a[j] = a[j+1];\n a[j+1] = tmp;\n }\n }\n }\n }", "void findLeadrsInArray1(int[] a){\n\t\tint n = a.length;\n\t\tboolean flag = true;\n\t\tfor(int i =0;i<n;i++){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(a[i] < a[j]){\n\t\t\t\t\tflag = false; \n\t\t\t\t}\n\t\t\t}\n\t\t\tif(flag != false){\n\t\t\t\tSystem.out.println(a[i]);\n\t\t\t}\n\t\t}\n\t}", "public static <T extends Comparable<? super T>> void sortTest(T[] a) {\n int N = a.length;\n int q = 0;\n for (int i = 1; i < N; i++) { \n // Insert a[i] among a[i-1], a[i-2], a[i-3]... ..\n for (int j = i; j > 0 && less(a[j], a[j-1]); j--) {\n exch(a, j, j-1); q = j;\n }\n }\n System.out.println(\"q==j==\"+q);\n }", "@Override\n\tpublic T[] sort(T[] input) {\n\t\tfor(int i = 1; i < input.length; i++){\n\t\t\t//compare with the previous one, if smaller, switch with it.\n\t\t\tfor(int j = i; j > 0 && input[j-1].compareTo( input[j]) > 0; j--){\n\t\t\t\t//add the condition input[j-1] > input[j] in the for loop;\n\t\t\t\t//cause if j-1th < jth, j-2th < jth(left part is ordered)\n\t\t\t\tswap(input, j, j-1);\n\t\t\t}\n\t\t}\n\t\treturn input;\n\t}", "public int solution(int[] A) {\n Arrays.sort(A);\n int hasTriangular = 0;\n // System.out.print(Arrays.toString(A));\n \n if (A.length < 3) {\n hasTriangular = 0;\n }\n else {\n int P = 0;\n int Q = 1;\n int R = 2;\n \n for(int i= 2; i<A.length; i++) {\n if((long) A[P]+ (long) A[Q]> (long)A[R]) {\n hasTriangular = 1;\n break;\n }\n else {\n P++;\n Q++;\n R++;\n } \n }\n }\n \n return hasTriangular;\n }", "static void sort(int[] array) {\n int len = array.length;\n for (int i = 0; i < len; i++) {\n int minIndex = i;\n for (int j = i + 1; j < len; j++) {\n if (array[j] < array[minIndex])\n minIndex = j;\n }\n SortingUtil.swap(array, i, minIndex);\n }\n }", "public static boolean isTri(int [] input) {\n\t\treturn (input[0] < input[1] + input[2]) && (input[1] < input[0] + input[2]) && (input[2] < input[0] + input[1]);\n\t}", "private static void sort(int[] arr) {\n\t\tint lesserIndex=-1;\n\t\tint arrLen = arr.length ; \n\t\tfor(int i=0; i<arrLen; i++){\n\t\t\tif(arr[i]<0){\n\t\t\t\tlesserIndex++; \n\t\t\t\tint tmp = arr[lesserIndex]; \n\t\t\t\tarr[lesserIndex] = arr[i];\n\t\t\t\tarr[i] = tmp; \n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tint negBound = lesserIndex+1;\n\t\tint posIndex = negBound;\n\t\t\n\t\tfor(int negIngex = 0;negIngex<negBound && posIndex<arr.length; negIngex+=2, posIndex+=1){\n\t\t\tint tmp = arr[posIndex]; \n\t\t\tarr[posIndex] = arr[negIngex] ; \n\t\t\tarr[negIngex] = tmp ;\n\t\t\tnegBound++;\n\t\t}\n\t\t\n\t\t\n\t\tfor(int a : arr) {\n\t\t\tSystem.out.print(a);\n\t\t}\n\t\t\n\t}", "public void sort(int[] a) {\n\t\tint n = a.length;\n\t\tint temp;\n\t\tfor (int gap = n / 2; gap > 0; gap /= 2) {\n\t\t\tfor (int i = gap; i < n; i++) {\n\t\t\t\tfor (int j = i - gap; j >= 0; j -= gap) {\n\t\t\t\t ++totalValCmp;\n\t\t\t\t if (a[j] > a[j + gap]) {\n\t\t\t\t\t temp = a[j];\n\t\t\t\t\t a[j] = a[j + gap];\n\t\t\t\t\t a[j + gap] = temp;\n\t\t\t\t\t ++totalswaps;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public int[] sort(int[] a) {\n\t\t// Outer loop that will progress the marker one step ahead\n\t\tfor (int i = 1; i < a.length; i++) {\n\t\t\t// Get the current element which we need to compare with the remaining i-1\n\t\t\t// elements of the array\n\t\t\tint key = a[i];\n\t\t\t// Select the j index which checks the 1-1 elements\n\t\t\tint j = i - 1;\n\t\t\t// Loop for these i-1 elements and compare each element with the key in the\n\t\t\t// reverse order\n\t\t\twhile (j >= 0 && a[j] > key) {\n\t\t\t\t// Move the element to the left\n\t\t\t\ta[j + 1] = a[j];\n\t\t\t\t// Decrement counter by 1\n\t\t\t\tj--;\n\t\t\t}\n\t\t\t// Now put the key in its appropriate position\n\t\t\ta[j + 1] = key;\n\t\t}\n\t\treturn a;\n\t}", "public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}", "private ArrayList<XYValue> sortArray(ArrayList<XYValue> array){\n /*\n //Sorts the xyValues in Ascending order to prepare them for the PointsGraphSeries<DataSet>\n */\n int factor = Integer.parseInt(String.valueOf(Math.round(Math.pow(array.size(),2))));\n int m = array.size()-1;\n int count = 0;\n Log.d(TAG, \"sortArray: Sorting the XYArray.\");\n\n while(true){\n m--;\n if(m <= 0){\n m = array.size() - 1;\n }\n Log.d(TAG, \"sortArray: m = \" + m);\n try{\n //print out the y entrys so we know what the order looks like\n //Log.d(TAG, \"sortArray: Order:\");\n //for(int n = 0;n < array.size();n++){\n //Log.d(TAG, \"sortArray: \" + array.get(n).getY());\n //}\n double tempY = array.get(m-1).getY();\n double tempX = array.get(m-1).getX();\n if(tempX > array.get(m).getX() ){\n array.get(m-1).setY(array.get(m).getY());\n array.get(m).setY(tempY);\n array.get(m-1).setX(array.get(m).getX());\n array.get(m).setX(tempX);\n }\n else if(tempY == array.get(m).getY()){\n count++;\n Log.d(TAG, \"sortArray: count = \" + count);\n }\n\n else if(array.get(m).getX() > array.get(m-1).getX()){\n count++;\n Log.d(TAG, \"sortArray: count = \" + count);\n }\n //break when factorial is done\n if(count == factor ){\n break;\n }\n }catch(ArrayIndexOutOfBoundsException e){\n Log.e(TAG, \"sortArray: ArrayIndexOutOfBoundsException. Need more than 1 data point to create Plot.\" +\n e.getMessage());\n break;\n }\n }\n return array;\n }", "public static <T extends Comparable<? super T>> void sortTest2(T[] a) {\n int N = a.length;\n for (int i = 1; i < N; i++) { \n // Insert a[i] among a[i-1], a[i-2], a[i-3]... ..\n for (int j = i; j > 0 && lessTest(a[j], a[j-1]); j--) {\n exch(a, j, j-1);\n }\n }\n }", "public static void LinearSorting(int[] arr) {\n\t\tfor(int i=0;i<arr.length-1;i++) {\r\n\t\t\tfor(int j=i+1;j<arr.length;j++) {\r\n\t\t\t if(arr[i]>arr[j]) {\r\n\t\t\t\t //Swap elements\r\n\t\t\t\t int temp=arr[i];\r\n\t\t\t\t arr[i]=arr[j];\r\n\t\t\t\t arr[j]=temp;\r\n\t\t\t }\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n public void testSort_intArr_IntegerComparator_half() {\n IntComparator comparator = IntComparatorAsc.getInstance();\n int[] expResult = ASC_CHECK_HALF_SORT_ARRAY;\n sorter.sort(data, 0, 8, (Comparator<Integer>) comparator);\n assertArrayEquals(\"Error testing class: \" + className, expResult, data);\n }", "@Test\n\tpublic void testSortNormalElements() {\n\t\tint[] arrayBeforeSort = { 565, 78, 34, 2, 23, 2222, 34 };\n\t\tint[] arrayAfterSort = { 565, 78, 34, 2, 23, 2222, 34 };\n\t\tArrayQuickSort.sort(arrayAfterSort);\n\t\tif (!isSorted(arrayBeforeSort, arrayAfterSort)) {\n\t\t\tAssert.fail(\"The array is not sorted!\");\n\t\t}\n\t}", "public abstract void sort(int[] array);", "private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }", "public static void sort(Comparable[] a){\n for(int i=1;i<a.length;i++){\n // Insert a[i] among a[i-1],a[i-2],a[i-3]...\n for (int j=i;j>0&&less(a[j],a[j-1]);j--){\n exch(a,j,j-1);\n }\n }\n }", "private void assertSorted(final IntPlus[] testArr,\n Comparator<IntPlus> cmp) {\n for (int i = 0; i < testArr.length - 1; i++) {\n assertTrue(\"Array was not sorted: element \" + i + \" was out \"\n + \"of order: \\n\" + Arrays.deepToString(testArr),\n cmp.compare(testArr[i], testArr[i + 1]) <= 0);\n\n }\n }", "@Test\n public void testSort_intArr_IntComparator_Desc_half() {\n IntComparator comparator = IntComparatorDesc.getInstance();\n int[] expResult = DESC_CHECK_HALF_CHECK_ARRAY;\n sorter.sort(data, 0, 8, comparator);\n assertArrayEquals(\"Error testing class: \" + className, expResult, data);\n }", "static void sort(int[] a)\n {\n for ( int j = 1; j<a.length; j++)\n {\n int i = j - 1;\n while(i>=0 && a[i]>a[i+1])\n {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n i--;\n }\n }\n }", "private static void sort1(int[] x, IntComparator comp, int off, int len) {\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)\n\t\t\t\t\tswap(x, j, j-1);\n\t\t}\n\t\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x,comp, l, l+s, l+2*s);\n\t\t\t\tm = med3(x,comp, m-s, m, m+s);\n\t\t\t\tn = med3(x,comp, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x,comp, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tint v = x[m];\n\t\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && comp.compare(x[b],v)<=0) {\n\t\t\t\tif (x[b] == v)\n\t\t\t\t\tswap(x, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && comp.compare(x[c],v)>=0) {\n\t\t\t\tif (x[c] == v)\n\t\t\t\t\tswap(x, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x, b++, c--);\n\t\t}\n\t\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,b, n-s, s);\n\t\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,comp, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,comp, n-s, s);\n\t}", "public static boolean dIsSorted(double [] a) {\n\n for(int i = 0; i < a.length-1; i ++) { \n if (a[i] >= a[i+1]) {\n return false; \n }\n }\n return true;\n }", "@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }", "private void sorter(int[] array){\r\n\r\n for (int i = 0; i < array.length-1; i++)\r\n for (int j = 0; j < array.length-i-1; j++)\r\n if (array[j] > array[j+1])\r\n {\r\n int temp = array[j];\r\n array[j] = array[j+1];\r\n array[j+1] = temp;\r\n }\r\n }", "public static void sort(int[] array) {\n for (int i = 0; i < array.length - 1; i++) {\n for (int j = i + 1; j < array.length; j++) {\n if (array[j] < array[i]) {\n swap(array, i, j);\n }\n }\n\n }\n\n }", "private void sort(int[] array, int start, int end){\n //base condition\n if(start >= end)\n return;\n int boundary = partition(array, start, end);\n sort(array, start, boundary - 1);\n sort(array, boundary + 1, end);\n }", "public double[] sort(double[] data) {\r\n for (int pass = 1; pass < data.length; pass++) {\r\n for (int element=0;element<data.length-1;element++) {\r\n if (data[element] > data[element + 1]){\r\n double hold = data[element];\r\n this.countOp();\r\n data[element] = data[element + 1];\r\n this.countOp();\r\n data[element + 1] = hold;\r\n this.countOp();\r\n }\r\n }\r\n }\r\n return data;\r\n }", "public static void sortArray(int[] array)\r\n {\r\n //create boolean variable to compare array values\r\n boolean swapped;\r\n //loop through the entire array\r\n for (int n=0; n < array.length; ++n)\r\n {\r\n do\r\n {\r\n //set boolean variable swapped to false\r\n swapped = false;\r\n \r\n //nested loop compares each pair of adjacent elements starting at array[n]\r\n for (int x = n + 1; x < array.length; x++) \r\n {\r\n //if the element in the array is greater than the following element\r\n if (array[n] > array[x]) \r\n {\r\n //initialize a temp variable to hold an array element value\r\n int temp;\r\n \r\n //swap the elements\r\n temp = array[n];\r\n array[n] = array[x];\r\n array[x] = temp;\r\n //set boolean variable swapped to true\r\n swapped = true;\r\n }\r\n }\r\n }while (swapped == true);\r\n }\r\n\r\n \r\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int noOfElements = sc.nextInt();\n int[] arr = new int[noOfElements];\n int[] arr1 = new int[noOfElements];\n int diff = Integer.MAX_VALUE;\n int sIndex = 0;\n int j = 0;\n for (int i = 0; i < noOfElements; i++) {\n arr[i] = sc.nextInt();\n }\n for (int j1 = 1; j1 < noOfElements; j1++) {\n int i = j1 - 1;\n int key = arr[j1];\n while (i >= 0 && key < arr[i]) { // 1 2 3\n arr[i + 1] = arr[i];\n i--;\n }\n arr[i + 1] = key;\n }\n //Arrays.sort(arr);\n for (int i = 0; i < noOfElements - 1; i++) {\n int temp = Math.abs(arr[i] - arr[i + 1]);\n if (temp <= diff) {\n diff=temp;\n }\n\n }\n\n for (int i = 0; i < noOfElements - 1; i++) {\n if (Math.abs(arr[i] - arr[i+1]) == diff) {\n System.out.print(arr[i] + \" \" + arr[i+1] + \" \");\n }\n }\n// for (int a = 0; a < j; a++) {\n//\n// System.out.print(arr[arr1[a]] + \" \" + arr[arr1[a]+1] + \" \");\n// }\n\n }", "public static void shellSort(int[] array){\n //System.out.println(\"Original array is : \" + Arrays.toString(array));\n //find the initial value of h (increment)\n int h = 1;\n while(h*3+1 < array.length){\n h = h*3 + 1;//1,4,13,40......\n }\n //decreasing h, until h = 1\n while(h > 0){\n //h-sort, when h=1, equal to insertion sort\n for(int i = h ; i < array.length ; i++){\n int temp = array[i];\n int j = i - h;\n // array[j] (array[i-h]) means left neighbor of array[i]\n while(j >= 0 && array[j] >= temp){\n array[j + h] = array[j];\n j -= h;\n }\n //\n array[j + h] = temp;\n }//end for\n //System.out.println(\"The result of h=\"+h+\" sort: \"+ Arrays.toString(array));\n //decrease h\n h = h/3;\n }\n //System.out.println(\"Final result:\"+ Arrays.toString(array));\n }", "public static List<List<Integer>> triangleTriplets(List<Integer> data) {\n\t\tList<List<Integer>> output = new ArrayList<>();\n\t\tif (data == null || data.size() < 3) {\n\t\t\treturn output;\n\t\t}\n\t\tdata.sort( (a, b) -> a - b);\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tfor (int j = i + 1; j < data.size(); j++) {\n\t\t\t\tfor (int k = j + 1; k < data.size(); k++) {\n\t\t\t\t\tint a = data.get(i);\n\t\t\t\t\tint b = data.get(j);\n\t\t\t\t\tint c = data.get(k);\n\t\t\t\t\tif (isTriangle(a, b, c)) {\n\t\t\t\t\t\toutput.add(Arrays.asList(a, b, c));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}", "public static Long compactForwardAlgorithm(ArrayList<Integer>[] graph) {\n // define injective function eta - takes O(n log(n)) time\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // sort adjacency arrays according to eta\n pairs.forEach(p -> Collections.sort(p.getSecond(), new Comparator<Integer>() {\n @Override\n public int compare(Integer first, Integer second) {\n if (etas.get(first) > etas.get(second))\n return 1;\n else\n return -1;\n }\n }));\n\n int triangleCount = 0;\n\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n Integer v = pair.getFirst();\n ArrayList<Integer> v_neighbors = graph[v];\n\n for (int u : v_neighbors) {\n if (etas.get(u) > etas.get(v)) {\n ArrayList<Integer> u_neighbors = graph[u];\n\n Iterator<Integer> uIterator = u_neighbors.iterator(), vIterator = v_neighbors.iterator();\n\n if (uIterator.hasNext() && vIterator.hasNext()) {\n Integer u_ = uIterator.next(), v_ = vIterator.next();\n while (uIterator.hasNext() && vIterator.hasNext() && etas.get(u_) < etas.get(v)\n && etas.get(v_) < etas.get(v)) {\n if (etas.get(u_) < etas.get(v_))\n u_ = uIterator.next();\n else if (etas.get(u_) > etas.get(v_))\n v_ = vIterator.next();\n else {\n triangleCount++;\n u_ = uIterator.next();\n v_ = vIterator.next();\n }\n }\n\n }\n }\n }\n }\n return new Long(triangleCount);\n }", "public void sort(int array[]){\n for(int i=1;i < array.length;i++){\n int j=i-1;\n int cur=i;\n while(array[cur] < array[j] && j >=0 ){\n swap(array,cur,j);\n cur--;\n j--;\n }\n\n }\n }", "public long sort(Comparable[] array) throws IllegalArgumentException {\n\t\tif (array == null) {\n\t\t\tthrow new IllegalArgumentException(\"argument 'array' must not be null.\");\n\t\t}\n\t\tAmountOfCompares amount_of_compares = new AmountOfCompares(0);\n\t\tint n = array.length;\n\t\tfor (int i = 1; i < n ; i++){\n\t\t\tfor(int j = i; j > 0 && less(array[j], array[j-1]); j--){\n\t\t\t\tamount_of_compares.add_one();\n\t\t\t\texch(array, j, j-1);\n\t\t\t}\n\t\t}\n\t\treturn amount_of_compares.get();\n\t}", "private static boolean isSorted(Comparable[] a) {\n for (int i = 1; i < a.length; i++)\n if (less(a[i], a[i-1])) return false;\n return true;\n }", "@Override\n public int[] sort(int[] array) {\n\n int n = array.length;\n\n for (int i = 1; i <= n - 1; i++) {\n int j = i - 1;\n\n while (j >= 0 && array[j] > array[j + 1]) {\n swap(array, j, j + 1);\n j--;\n }\n }\n\n return array;\n }", "private static <T extends Comparable<? super T>> void sort(T[] a, int lo, int hi) {\n\t\tif (hi <= lo) {\n\t\t\treturn;\n\t\t}\n\t\tint lt = lo, gt = hi;\n\t\tT v = a[lo];\n\t\tint i = lo + 1;\n\t\twhile (i <= gt) {\n\t\t\tint cmp = a[i].compareTo(v);\n\t\t\tif (cmp < 0) {\n\t\t\t\texch(a, lt++, i++);\n\t\t\t\tshow(a, lt, i, gt);\n\t\t\t} else if (cmp > 0) {\n\t\t\t\texch(a, i, gt--);\n\t\t\t\tshow(a, lt, i, gt);\n\t\t\t} else {\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\t// a[lo..lt-1] < v = a[lt..gt] < a[gt+1..hi].\n//\t\tsort(a, lo, lt - 1);\n//\t\tsort(a, gt + 1, hi);\n\t}", "private void sort(T[] arr, int lo, int hi) {\n if (lo >= hi) return; // we return if the size of the part equals 1\n int pivot = partition(arr, lo, hi); // receiving the index of the pivot element\n sort(arr, lo, pivot - 1); // sorting the left part\n sort(arr, pivot + 1, hi); // sorting the right part\n }", "private static boolean isSorted(Comparable[] a, int lo, int hi) {\n for (int i = lo; i < hi; i++)\n if (less(a[i+1], a[i])) return false;\n return true;\n }", "private static void sort(int[] a) {\n shufle(a);\n // we use quicksort here because there's no need for stability\n sort(a, 0, a.length - 1);\n }", "protected Individual[] sortIndsArr(Individual[] ar)\n\t\t{\tint num_ar = ar.length;\n\t\t\tIndividual temp;\n\t\t\tfor(int j=0;j<num_ar-1;j++)\n\t\t\t\tfor(int i=0;i<num_ar-1-j;i++)\n\t\t\t\t\tif(ar[i].getFitness()<ar[i+1].getFitness()) {\n\t\t\t\t\t\ttemp\t= ar[i+1];\n\t\t\t\t\t\tar[i+1]\t= ar[i];\n\t\t\t\t\t\tar[i]\t= temp;\n\t\t\t\t\t}\n\t\t\treturn ar;\n\t\t}", "private void doSort (Column A, int [] i, int p, int r, int begin) {//double[] A, int p, int r, MutableTable t) {\n\t\tif (p < r) {\n\t\t\tint q = partition(A, i, p, r, begin);\n\t\t\tdoSort(A, i, p, q, begin);\n\t\t\tdoSort(A, i, q + 1, r, begin);\n\t\t}\n\t}", "private static <T> boolean isSorted(Comparable<T>[] a) {\n\t\tfor(int i=1; i<a.length; i++) {\r\n\t\t\tif(less(a[i],a[i-1]))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static void main(String[] args)\n {\n Point p1 = new Point(10, 0);\n Point p2 = new Point(0, 10);\n Point p3 = new Point(3, 7);\n Point p4 = new Point(7, 3);\n Point p5 = new Point(20, 21);\n Point p6 = new Point(3, 4);\n Point p7 = new Point(14, 15);\n Point p8 = new Point(6, 7);\n\n Point[] arr = new Point[8];\n arr[0] = p1;\n arr[1] = p2;\n arr[2] = p3;\n arr[3] = p4;\n arr[4] = p5;\n arr[5] = p6;\n arr[6] = p7;\n arr[7] = p8;\n\n System.out.println(\"Before sorting:\");\n for (Point i : arr)\n {\n System.out.println(i.toString());\n }\n\n Arrays.sort(arr, p1.slopeOrder());\n\n System.out.println(\"After sorting:\");\n for (Point i : arr)\n {\n System.out.println(i.toString());\n }\n\n double[] slopes = new double[8];\n Point pt = p1;\n slopes[0] = pt.slopeTo(p2);\n slopes[1] = pt.slopeTo(p3);\n slopes[2] = pt.slopeTo(p4);\n slopes[3] = pt.slopeTo(p5);\n slopes[4] = pt.slopeTo(p6);\n slopes[5] = pt.slopeTo(p7);\n slopes[6] = pt.slopeTo(p8);\n\n System.out.println(\"Slope values, initial:\");\n for (double d : slopes)\n {\n System.out.println(d);\n }\n\n for (int i = 0; i < 8; ++i)\n {\n slopes[i] = pt.slopeTo(arr[i]);\n }\n\n System.out.println(\"Slope values, final:\");\n for (double d : slopes)\n {\n System.out.println(d);\n }\n }", "public void sort(Contestant[] arr){\n\t\t/* code goes here */\n\t\t\n\t\t//WHAT IS DIFFERENCE BETWEEN THIS AND sortAllRows???\n\t\t\n\t}", "protected boolean checkTriangleArrow() {\n\t\tboolean passed = true;\n\t\tStroke last = m_subStrokes.get(m_subStrokes.size() - 1);\n\t\tStroke secondLast = m_subStrokes.get(m_subStrokes.size() - 2);\n\t\tStroke thirdLast = m_subStrokes.get(m_subStrokes.size() - 3);\n\t\tStroke fourthLast = m_subStrokes.get(m_subStrokes.size() - 4);\n\t\tdouble lastLength = StrokeFeatures.getStrokeLength(last);\n\t\tdouble secondLastLength = StrokeFeatures.getStrokeLength(secondLast);\n\t\tdouble thirdLastLength = StrokeFeatures.getStrokeLength(thirdLast);\n\t\tdouble fourthLastLength = StrokeFeatures.getStrokeLength(fourthLast);\n\n\t\t// test 1: last stroke and third to last stroke should be same size\n\t\tdouble diff = Math.abs(lastLength - thirdLastLength)\n\t\t\t\t/ (lastLength + thirdLastLength);\n\t\tif (diff > 0.5)\n\t\t\tpassed = false;\n\n\t\t// test 2: two points at the \"head\" of the arrow should be close\n\t\tdouble dis = last.getLastPoint().distance(thirdLast.getFirstPoint())\n\t\t\t\t/ m_features.getStrokeLength();\n\t\tif (dis > 0.25)\n\t\t\tpassed = false;\n\n\t\t// test 3: triangle arrow should be better fit than standard arrow\n\t\tif (m_standardPassed && dis > m_standardSum)\n\t\t\tpassed = false;\n\n\t\t// test 4: second to last line of arrow head should intersect shaft of\n\t\t// arrow\n\t\tLine2D.Double line1 = new Line2D.Double(secondLast.getFirstPoint()\n\t\t\t\t.getX(), secondLast.getFirstPoint().getY(), secondLast\n\t\t\t\t.getLastPoint().getX(), secondLast.getLastPoint().getY());\n\t\tArrayList<Point2D> intersect = StrokeFeatures.getIntersection(\n\t\t\t\tm_subStrokes.get(m_subStrokes.size() - 4), line1);\n\t\tif (intersect.size() <= 0)\n\t\t\tpassed = false;\n\t\tLine2D.Double line2 = new Line2D.Double(fourthLast.getPoints()\n\t\t\t\t.get(fourthLast.getNumPoints() / 2).getX(), fourthLast\n\t\t\t\t.getPoints().get(fourthLast.getNumPoints() / 2).getY(),\n\t\t\t\tfourthLast.getLastPoint().getX(), fourthLast.getLastPoint()\n\t\t\t\t\t\t.getY());\n\t\tdouble perpDiff = Math.abs(getSlope(line1) - (1.0 / getSlope(line2)));\n\t\tif (perpDiff > 5)\n\t\t\tpassed = false;\n\n\t\t// sometimes the last line of the arrow is broken incorrectly;\n\t\t// try combining last two strokes and repeat test\n\t\tif (!passed && m_subStrokes.size() >= 5) {\n\t\t\tpassed = true;\n\n\t\t\t// test 1: last stroke and third to last stroke should be same size\n\t\t\tdiff = Math.abs(lastLength + secondLastLength - fourthLastLength)\n\t\t\t\t\t/ (lastLength + secondLastLength + thirdLastLength);\n\t\t\tif (diff > 0.5)\n\t\t\t\tpassed = false;\n\n\t\t\t// test 2: two points at the \"head\" of the arrow should be close\n\t\t\tdis = last.getLastPoint().distance(fourthLast.getFirstPoint())\n\t\t\t\t\t/ m_features.getStrokeLength();\n\t\t\tif (dis > 0.25)\n\t\t\t\tpassed = false;\n\n\t\t\t// test 3: triangle arrow should be better fit than standard arrow\n\t\t\tif (m_standardPassed && dis > m_standardSum)\n\t\t\t\tpassed = false;\n\n\t\t\t// test 4: line connecting tips of arrow head should be close to\n\t\t\t// perpendicular to the line it would intersect\n\t\t\tline1 = new Line2D.Double(thirdLast.getFirstPoint().getX(),\n\t\t\t\t\tthirdLast.getFirstPoint().getY(), thirdLast.getLastPoint()\n\t\t\t\t\t\t\t.getX(), thirdLast.getLastPoint().getY());\n\t\t\tStroke fifthLast = m_subStrokes.get(m_subStrokes.size() - 5);\n\t\t\tintersect = StrokeFeatures.getIntersection(fifthLast, line1);\n\t\t\tif (intersect.size() <= 0)\n\t\t\t\tpassed = false;\n\t\t\tline2 = new Line2D.Double(fifthLast.getPoints()\n\t\t\t\t\t.get(fifthLast.getNumPoints() / 2).getX(), fifthLast\n\t\t\t\t\t.getPoints().get(fifthLast.getNumPoints() / 2).getY(),\n\t\t\t\t\tfifthLast.getLastPoint().getX(), fifthLast.getLastPoint()\n\t\t\t\t\t\t\t.getY());\n\t\t\tperpDiff = Math.abs(getSlope(line1) - (1.0 / getSlope(line2)));\n\t\t\tif (perpDiff > 5)\n\t\t\t\tpassed = false;\n\n\t\t}\n\n\t\t// if passed make a beautified standard arrow\n\t\tif (passed) {\n\n\t\t\tm_arrowType = Type.TRIANGLE;\n\n\t\t\t// TODO\n\t\t\t// create shape/beautified object\n\t\t\t/*\n\t\t\t * m_shape = new GeneralPath(); try { computeBeautified(); } catch\n\t\t\t * (Exception e) { log.error(\"Could not create shape object: \" +\n\t\t\t * e.getMessage()); }\n\t\t\t */\n\t\t}\n\n\t\tSystem.out.println(\"TriangleArrow: passed = \" + passed + \" diff = \"\n\t\t\t\t+ diff + \" dis = \" + dis + \" intersect = \" + intersect.size()\n\t\t\t\t+ \" num substrokes = \" + m_subStrokes.size() + \" perp diff = \"\n\t\t\t\t+ perpDiff);\n\t\tSystem.out.print(\"sizes: \");\n\t\tfor (int i = 0; i < m_subStrokes.size(); i++)\n\t\t\tSystem.out.print(m_subStrokes.get(i).getNumPoints() + \" \");\n\t\tSystem.out.println(\"\");\n\n\t\treturn passed;\n\t}", "@Override\n public void sort(int[] array) {\n for (int i = 0; i < array.length - 1; ++i) {\n for (int j = i + 1; j < array.length; ++j) {\n if (array[i] > array[j]) {\n int tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n }\n }\n }", "int countDistinctTriangles(ArrayList<Sides> arr) {\n // Write your code here\n // Validate input data\n if(arr == null || arr.isEmpty()){\n return 0;\n }\n \n // Find distinct triangles\n Set<Triangle> trs = new HashSet<Triangle>();\n for(Sides s : arr){\n trs.add(new Triangle(s));\n }\n \n return trs.size();\n }", "@Test\n public void testSort_intArr_IntegerComparator_Desc_half() {\n IntComparator comparator = IntComparatorDesc.getInstance();\n int[] expResult = DESC_CHECK_HALF_CHECK_ARRAY;\n sorter.sort(data, 0, 8, (Comparator<Integer>) comparator);\n assertArrayEquals(\"Error testing class: \" + className, expResult, data);\n }", "@Override\n\tpublic int[] sort(int[] arr) {\n\t\tif(arr == null) \n\t\t\tthrow new Error(\"################ Array is null ################\");\n\t\tint left = 0;\n\t\tint right = arr.length-1;\n\t\treturn ( right <= 0)? arr : split(left, right, arr);\n\t}", "static void doubleSelectionSort (int [] array) {\n\t for (int i = 0, j = array.length - 1; (i < array.length && j >= 0); i++, j--)\n {\n int minIndex = i;\n int maxIndex = j;\n\n for (int a = i + 1; a < array.length; a++)\n if (array[a] < array[minIndex])\n minIndex = a;\n\n for (int b = j - 1; b >= 0; b--)\n if (array[b] > array[maxIndex])\n maxIndex = b;\n\n if (isSorted(array)) return;\n\n swap(array, minIndex, i);\n System.out.println(Arrays.toString(array));\n swap(array, maxIndex, j);\n System.out.println(Arrays.toString(array));\n }\n\t}", "private void sort(Comparable[] array) {\n Comparable[] aux = new Comparable[array.length];\n sort(array, aux, 0, array.length - 1);\n }", "static boolean isSorted(int arr[]) {\n\t\tif(arr.length==1) {\n\t\t\treturn true;\n\t\t}\n\t\tif(arr[0]>arr[1]) {\n\t\t\treturn false;\n\t\t}\n\t\tint paritialArray [] = new int[arr.length-1];\n\t\tfor(int i=0; i<paritialArray.length; i++) {\n\t\t\tparitialArray[i] = arr[i+1];\n\t\t}\n\t\tboolean result = isSorted(paritialArray);\n\t\treturn result;\n\t\t\n\t\t\n\t}", "public boolean canReorderDoubled4(int[] A) {\n PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.comparingInt(Math::abs));\n for (int a : A) {\n pq.offer(a);\n }\n while (!pq.isEmpty()) {\n int num = pq.poll();\n if (!pq.remove(num * 2)) { return false; }\n }\n return true;\n }", "public static void testSort() {\n\t\tint[] test = {-1,-2,-3,4,1,3,0,3,-2,1,-2,2,-1,1,-5,4,-3};\n\t\tArrays.sort(test);\n\t\tfor (int e : test) {\n\t\t\tSystem.out.print(e + \", \");\n\t\t}\n\t}", "private static ArrayList<Integer> mergKsort(int[][] arr) {\n\t\tArrayList<Integer> rv = new ArrayList<>();\r\n\t\tPriorityQueue<Pair> pq= new PriorityQueue<>();\r\n\t\t\t\t\r\n\t\tfor (int i=0;i<arr.length;i++) {\r\n\t\tPair p = new Pair(i,0,arr[i][0]);\r\n\t\t\tpq.add(p);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\twhile(pq.size()>0) {\r\n\t\t\tPair p=pq.remove();\r\n\t\t\trv.add(p.val);\r\n\t\t\tp.di++;\r\n\t\t\tif(p.di<arr[p.li].length) {\r\n\t\t\t\tp.val=arr[p.li][p.di];\r\n\t\t\t\tpq.add(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn rv;\r\n\r\n\t}", "public static void sort(int mat3d[][]) {\n \n }", "public static int[] sort( int[] arr )\n {\n int m = arr.length / 2; //find the half way point \n if (arr.length == 1) { //base case: when the array has one number\n\t return arr; }\n else \n\t int[] firstH = new int[m]; //array holding the first half\n\t int[] secondH = new int[m]; //array holding the second half\n\t for (int i = 0; i < firstH.length; i++) { //fills both arrays up with the respective halves\n\t firstH[i] = arr[i];\n\t secondH[i] = arr[arr.length - 1 - i];\n\t }\n\t return merge(sort(firstH),sort(secondH)); //recursive that calls sort again on both halves, halfing them further until they reach the base case and merge will kick in, merging them together until you reach the top again and merge the original 2 halves \n }", "private static void sort(int[] arr) {\n\t\t\n\t\tint i=0;\n\t\tint j=0;\n\t\tint k=arr.length-1;\n\t\tSystem.out.println(\"length \"+arr.length);\n\t\twhile (i<=k)\n\t\t{\n\t\t\tSystem.out.println(\"at start i \"+i+\" j \"+j+\" k \"+k);\n\t\t\tif(arr[i]==0)\n\t\t\t\tswap(j++,i++,arr);\n\t\t\telse if(arr[i]==2)\n\t\t\t\tswap(k--,i,arr);\n\t\t\telse\n\t\t\t\ti++;\n\t\t\t\n\t\t\tprintArray(arr);\n\t\t\tSystem.out.println(\"at end i \"+i+\" j \"+j+\" k \"+k);\n\t\t\t\n\t\t}\n\t}", "@Override\n\tvoid sort(int[] array, SortingVisualizer display) {\n\t\tSystem.out.println(\"a\");\n\t\tboolean sorted = false;\n\t\tboolean h = true;\n\t\twhile (sorted == false) {\nh=true;\n\t\t\t// System.out.println(\"1\");\n\t\t\tRandom x = new Random();\n\t\t\tint y = x.nextInt(array.length);\n\n\t\t\tint el1 = array[y];\n\t\t\tint z = x.nextInt(array.length);\n\t\t\tint el2 = array[z];\n\n\t\t\tarray[y] = el2;\n\t\t\tarray[z] = el1;\n\t\t\tfor (int i = 0; i < array.length - 1; i++) {\n/*\n\t\t\t\tif (array[i] < array[i + 1]) {\n\n\t\t\t\t\th = true;\n\n\t\t\t\t}*/\n\n\t\t\t\tif (array[i] > array[i + 1]) {\n\t\t\t\t\th = false;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (h == true) {\n\n\t\t\t\tsorted = true;\n\t\t\t}\n\n\t\t\tdisplay.updateDisplay();\n\t\t\t\n\t\t}\n\t}", "public static void sort(int [] a) {\n for(int i=0; i<a.length;i++){\n for (int j = i+1; j < a.length; j++) {\n int temp=0;\n if(a[i]>a[j]){\n temp=a[j];\n a[j]=a[i];\n a[i]=temp;\n }\n }\n }\n }", "public static int[] gnomeSort(int[] arr){\n int i = 1, j = 2;\n while (i < arr.length){\n if (arr[i - 1] < arr[i]){\n i = j;\n j++;\n } else {\n int tmp = arr[i - 1];\n arr[i - 1] = arr[i];\n arr[i] = tmp;\n i--;\n if (i == 0){\n i = j;\n j++;\n }\n }\n }\n return arr;\n }", "@Override\n\tpublic void sort(int[] array) {\n\n\t}", "public void sortColors(int[] nums) {\n\n int min = 0;\n int max = nums.length -1;\n\n\n for(int i = 0 ; i <= max ; i++) { // i 是当前待移动下标\n if(nums[i] == 0 && i!=min){\n swap(i, min , nums);\n min++;\n i--;\n }\n if(nums[i] == 2 && i!=max){\n swap(i, max, nums);\n max--;\n i--;\n }\n }\n return;\n }", "private static void sort2(int[] a) {\n for(int i=0; i<a.length; i++){\n //find smallest from i to end \n int minIndex=i;\n for(int j=i ; j<a.length; j++)\n if(a[j]<a[minIndex])\n minIndex=j;\n //swap\n int t = a[i];\n a[i] = a[minIndex];\n a[minIndex] = t;\n }\n }", "@Override\n public int compare(final Triangle t1, final Triangle t2) {\n final Vec4 min1 = t1.getMin();\n final Vec4 min2 = t2.getMin();\n return Double.compare(min1.get(splitType), min2.get(splitType));\n }", "public static void sort01(int[] arr){\n int j = 0 ;\r\n for( int i = 0 ; i < arr.length ; i++){\r\n \r\n if( arr[i] == 1){\r\n continue;\r\n }\r\n \r\n else{\r\n swap( arr , i , j);\r\n j++;\r\n }\r\n }\r\n \r\n }", "public static void insertionSort(int[] array, int lo, int hi){\n for (int i = lo; i <= hi;i++){//loops through the subarray from left to right\n for (int j = i; j > 0;j--){//copy the current array pointer and start to move backwards from there\n if(array[j] < array[j-1]){//check if the current value is misplaced in relation to teh previous one\n int copy = array[j];//the next 3 lines of code are to swap\n array[j] = array[j-1];\n array[j-1] = copy;\n } else{break;}//if the position is correct than we break the loop\n }\n }\n }", "@Test\r\n public void testCompare() {\r\n\r\n double[] r1;\r\n double[] r2;\r\n Comparator<double[]> instance = new DoubleArrayComparator();\r\n \r\n r1 = new double[]{1,2,3};\r\n r2 = new double[]{1,2,3}; \r\n assertEquals(0, instance.compare(r1, r2));\r\n\r\n r1 = new double[]{1,2,3};\r\n r2 = new double[]{1,3,2}; \r\n assertEquals(-1, instance.compare(r1, r2));\r\n \r\n r1 = new double[]{1,3,3};\r\n r2 = new double[]{1,3,2}; \r\n assertEquals(1, instance.compare(r1, r2));\r\n \r\n }", "@Override\n public int[] sort(int[] array) {\n\n if (array.length <= 1) return array;\n\n for (int num_sorted = 1; num_sorted < array.length; num_sorted++) {\n\n int check_idx = num_sorted;\n int temp_val;\n\n while (array[check_idx] < array[check_idx - 1]) {\n\n temp_val = array[check_idx];\n array[check_idx] = array[check_idx - 1];\n array[check_idx - 1] = temp_val;\n check_idx --;\n\n if (check_idx == 0) break;\n\n }\n\n }\n\n return array;\n }", "public static void sort(Comparable[] a) {\n int minPos = 0;\n for (int i = 1; i < a.length; i++) {\n if (less(a[i], a[minPos])) minPos = i;\n }\n if (minPos != 0) exch(a, 0, minPos);\n\n // Modify i from 0 to 1, this can avoid index out of bound error\n for (int i = 1; i < a.length; i++) {\n for (int j = i; less(a[j], a[j - 1]); j--) {\n exch(a, j, j - 1);\n }\n }\n }", "@Override\n\tvoid sort(int[] arr, SortingVisualizer display) {\n\t\tint current = 0;\n\t\tint x;\n\t\tint y;\n\t\tboolean complete = false;\n\t\twhile(complete == false) {\n\t\t\tcurrent = 0;\n\t\t\tcomplete = true;\n\t\t\tfor(int i = 0 ; i < arr.length; i ++) {\n\t\t\t\tdisplay.updateDisplay();\n\t\t\t\tif(arr[current] > arr[i]) {\n\t\t\t\t\tx = arr[i];\n\t\t\t\t\ty = arr[current];\n\t\t\t\t\tarr[i] = y;\n\t\t\t\t\tarr[current] = x;\n\t\t\t\t\tcomplete = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\tcurrent = i;\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void sort(T[] arr, T[] temp, int lo, int hi) {\n if (lo >= hi) return; // we return if the size of the part equals 1\n int mid = lo + (hi - lo) / 2;\n sort(arr, temp, lo, mid); // sorting the left part\n sort(arr, temp, mid + 1, hi); // sorting the right part\n merge(arr, temp, lo, hi, mid); // merging two parts\n }", "public static int[] partialSort(int[] a) {\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < 2 - i; j++) {\n if (a[j] > a[j+1]) {\n int temp = a[j+1];\n a[j+1] = a[j];\n a[j] = temp;\n }\n }\n }\n return a;\n}", "private static void sortPoints(int[][] pointSet, int start, int end)\n {\n if (start < end)\n {\n int mid = (start+end)/2;\n sortPoints(pointSet, start, mid);\n sortPoints(pointSet, mid+1, end);\n crossProductMerge(pointSet, start, mid, end);\n }\n }", "void selectionSort(int[] array) {\r\n\r\n\t\tint size = array.length;\r\n\r\n\t\tfor (int step = 0; step < size; step++) {\r\n\t\t\tint minIndex = step;\r\n\t\t\tfor (int i = step + 1; i < size; i++) {\r\n\r\n\t\t\t\tif (array[i] < array[minIndex]) {\r\n\t\t\t\t\tminIndex = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tint temp = array[step];\r\n\t\t\tarray[step] = array[minIndex];\r\n\t\t\tarray[minIndex] = temp;\r\n\t\t\tSystem.out.println(\"Round - \" + (step + 1) + \" - \" + Arrays.toString(array));\r\n\t\t}\r\n\r\n\t}", "@Override\r\n\tpublic void sort(int[] demo) {\n\t\tint temp;\r\n\t\tfor(int gap = 5;gap > 0;gap /= 2){\r\n\t\t\tfor(int i = gap;i < demo.length;i++){\r\n\t\t\t\tfor(int j = i - gap;j >= 0;j -= gap){\r\n\t\t\t\t\tif (demo[j] > demo[j + gap]) {\r\n\t\t\t\t\t\ttemp =demo[j];\r\n\t\t\t\t\t\tdemo[j] =demo[j + gap];\r\n\t\t\t\t\t\tdemo[j + gap] = temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(Arrays.toString(demo));\r\n\t}", "public void sortArray(){\n\t\tfor (int i=0; i<population.length;i++){\n\n\t\t\tfor (int j=0; j<population.length-i-1;j++){\n\n\t\t\t\tif(population[j].computeFitness()>population[j+1].computeFitness()) {\n\t\t\t\t\t//swap their positions in the array\n\t\t\t\t\tChromosome temp1 = population[j];\n\t\t\t\t\tpopulation[j] = population[j+1];\n\t\t\t\t\tpopulation[j+1] = temp1;\n\t\t\t\t}//end if\n\n\t\t\t}//end j for\n\n\t\t}//end i for\n\t}", "public static void sortColors(int[] A) {\n int start = 0, end = A.length -1;\n while (start < end) {\n \t// System.out.println(\"start: \" + start + \" end: \" + end);\n \t\n while (start < end && A[start] == 0) start++;\n // 1 switch with 0\n if (A[start] == 1) {\n \tint temp_end = end;\n \twhile (start < temp_end && A[temp_end] != 0) temp_end--;\n \tif (start >= temp_end) start++;\n \telse {\n \t\tswap(A, start, temp_end);\n \t\tstart++;\n \t}\n }\n // 2 switch with 0 or 1\n else {\n \tint temp_end = end;\n \twhile (start < temp_end && A[temp_end] == 2) temp_end--;\n \tif (start >= temp_end) break; // This means all the numbers after start are two\n \telse {\n \t\tswap(A, start, temp_end);\n \t\tend--; // Skip the blue color at the end of the array we already knew.\n \t\tif (A[start] == 0) start++; // If 2 switch with 0, then we advance start\n \t\t// If 2 switch with 1, then we do nothing\n \t}\n }\n }\n }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "public boolean canReorderDoubled2(int[] A) {\n Map<Integer, Integer> count = new HashMap<>();\n for (int a : A) {\n count.put(a, count.getOrDefault(a, 0) + 1);\n }\n Integer[] B = new Integer[A.length];\n for (int i = 0; i < A.length; i++) {\n B[i] = A[i];\n }\n Arrays.sort(B, Comparator.comparingInt(Math::abs));\n for (int b : B) {\n if (count.get(b) == 0) { continue; }\n if (count.getOrDefault(2 * b, 0) <= 0) { return false; }\n\n count.put(b, count.get(b) - 1);\n count.put(2 * b, count.get(2 * b) - 1);\n }\n return true;\n }", "public void wiggleSort(int[] nums) {\n\n // At position 0 we need a[0] < a[1] and in position 1 we need a[1] > a[2]\n for(int i=0; i < nums.length-1; i++) {\n boolean isEven = i%2==0;\n if(isEven) {\n if(nums[i] > nums[i+1]) { // a[0] should less than a[1]\n ArrayUtils.swap(nums,i,i+1);\n }\n } else {\n if(nums[i] < nums[i+1]) { // a[1] should greater than a[2]\n ArrayUtils.swap(nums,i,i+1);\n }\n }\n }\n }" ]
[ "0.63955104", "0.62169397", "0.61492705", "0.5980174", "0.59754324", "0.59057486", "0.5902066", "0.5899739", "0.5876057", "0.58648163", "0.583994", "0.58276355", "0.5809299", "0.5795092", "0.5794028", "0.5779413", "0.5760351", "0.57601154", "0.5749084", "0.5732863", "0.5726853", "0.5715614", "0.5707427", "0.569447", "0.5674699", "0.56704503", "0.5638846", "0.56387967", "0.5626836", "0.56232125", "0.56092197", "0.5608238", "0.5607685", "0.56054246", "0.560418", "0.56008315", "0.55959225", "0.55905694", "0.55905515", "0.558461", "0.557997", "0.55727625", "0.5571902", "0.55672795", "0.5563326", "0.55609715", "0.5544342", "0.5539537", "0.55360526", "0.55245703", "0.5522374", "0.5518413", "0.54912865", "0.549026", "0.5483215", "0.54817134", "0.5476144", "0.54705036", "0.54667985", "0.54603034", "0.54589725", "0.5452938", "0.54420316", "0.5432979", "0.54278547", "0.54257524", "0.5422348", "0.541928", "0.54164666", "0.54083204", "0.5406189", "0.540594", "0.5402401", "0.53999406", "0.539042", "0.53863484", "0.53857744", "0.5385467", "0.53839195", "0.5381603", "0.53811884", "0.53775233", "0.53775156", "0.5373757", "0.5371553", "0.5367474", "0.53569484", "0.5354296", "0.5353899", "0.5352901", "0.53497195", "0.53434634", "0.5339952", "0.5338708", "0.53379226", "0.53321975", "0.5329429", "0.53289855", "0.53200877", "0.5319915" ]
0.55600816
46
when max int is possible, ..sum should handle in long since it cannot fit and overflow
private long calcSum(int a, int b) { return (new Long(a) + new Long(b)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n Long sum = 0L;\n for (long i = 0; i < Integer.MAX_VALUE; i++) {\n sum += i;\n }\n System.out.println(sum);\n}", "static long aVeryBigSum(int[] ar,int l) {\n long sum=0;\n for(int i=0;i<l;i++)\n {\n sum+=ar[i];\n }\n System.out.println(\"Sum=\"+sum);\n return sum;\n\n\n }", "private static int maxSubSumN(int[] a) {\n int maxSum = 0;\n int thisSum = 0;\n\n for (int i = 0; i < a.length; i++) {\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n } else if (thisSum < 0) {\n thisSum = 0;\n }\n }\n\n return maxSum;\n }", "private static int MaxSubarraySum(int[] a) {\n\t\t\n\t\tint max_so_for =Integer.MIN_VALUE;\n\t\tint max_ending_here = 0;;\n\t\t\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tmax_ending_here = max_ending_here + a[i];\n\t\t\t\n\t\t\tif(max_so_for < max_ending_here )\n\t\t\t\tmax_so_for = max_ending_here;\n\t\t\tif(max_ending_here < 0)\n\t\t\t\tmax_ending_here = 0;\n\t\t}\n\t\t\n\t\treturn max_so_for;\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 long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}", "static void miniMaxSum(int[] arr) {\n\n\n ArrayList<Long> numbers = new ArrayList<>();\n for (int i : arr\n ) {\n numbers.add(new Long(String.valueOf(i)));\n }\n //max sum\n Long maxSum=numbers.stream().sorted().skip(1).collect(Collectors.summingLong(x->x));\n Long minSum=numbers.stream().sorted(Comparator.reverseOrder()).skip(1).collect(Collectors.summingLong(x->x));\n System.out.println(minSum+\" \"+maxSum);\n }", "public static void main(String[] args) throws IOException {\r\n\t long a = 1182312000;\r\n\t System.out.println((a<<1) + 57596000);\r\n\t System.out.println(Long.MAX_VALUE);\r\n }", "private static int maxSum(int arr[]) {\n int sum = 0;\n Arrays.sort(arr);\n\n // Subtracting a1, a2, a3,....., a(n/2)-1,\n // an/2 twice and adding a(n/2)+1, a(n/2)+2,\n // a(n/2)+3,....., an - 1, an twice.\n for (int i = 0; i < arr.length / 2; i++) {\n sum -= (2 * arr[i]);\n sum += (2 * arr[arr.length - i - 1]);\n }\n\n return sum;\n }", "public static double getSum(long num) {\r\n double total = 0;\r\n for(int i = 0; i < digitBit.length; i ++){\r\n double sum = 0;\r\n Bucket bkt = digitBit[i].bucket;\r\n //find sum of buckets of size (j+1)\r\n while(bkt.endTimestamp >= (currentTimeStamp - num + 1)){\r\n sum += bkt.size;\r\n if(bkt.next != null){\r\n bkt = bkt.next;\r\n }else{\r\n break;\r\n }\r\n }\r\n if(bkt.startTimeStamp >= (currentTimeStamp - num + 1)){\r\n sum += (bkt.size)/2;\r\n }\r\n //add the contribution of ith position bits to the total\r\n total += sum * Math.pow(2, i);\r\n }\r\n return total;\r\n }", "private int FindMaxSum(int[] arr, int length) {\r\n\t\t\r\n\t\tint incl = arr[0];\r\n\t\tint excl = 0;\r\n\t\tint excl_new = 0;\r\n\t\t\r\n\t\tfor(int i = 1;i<arr.length;i++)\r\n\t\t{\r\n\t\t\texcl_new = (incl > excl) ? incl : excl;\r\n\t\t\t \r\n /* current max including i */\r\n incl = excl + arr[i];\r\n excl = excl_new;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn excl>incl?excl:incl;\r\n\t}", "private static int maxSubSumN2(int[] a) {\n int maxSum = 0;\n\n for (int first = 0; first < a.length; first++) {\n int thisSum = 0;\n for (int i = first; i < a.length; i++) {\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n }\n }\n }\n\n return maxSum;\n }", "static int findMaxSum(Node node){\n Res res = new Res();\n res.value = Integer.MIN_VALUE;\n findmaxUtil(node,res);\n return res.value;\n }", "public static long longFastFib(int n) {\n\t\tlong a = 1;\n\t\tlong b = 0;\n\t\t\n\t\tlong temp = 0;\n\t\tfor(int i=0; i<n-1; i++){\n\t\t\ttemp = a;\n\t\t\ta += b;\n\t\t\tb = temp;\n\t\t\tif(a<0){\n\t\t\t\tSystem.out.println(\"Int overflow\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n return a; \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n }", "public static long sum(long[] s)\n {\n long sum = 0;\n for (int i = 0; i < s.length; i++) sum = sum + s[i];\n return sum;\n }", "static int maxSum()\n {\n // Find array sum and i*arr[i] with no rotation\n int arrSum = 0; // Stores sum of arr[i]\n int currVal = 0; // Stores sum of i*arr[i]\n for (int i=0; i<arr.length; i++)\n {\n arrSum = arrSum + arr[i];\n currVal = currVal+(i*arr[i]);\n }\n\n // Initialize result as 0 rotation sum\n int maxVal = currVal;\n\n // Try all rotations one by one and find\n // the maximum rotation sum.\n for (int j=1; j<arr.length; j++)\n {\n currVal = currVal + arrSum-arr.length*arr[arr.length-j];\n if (currVal > maxVal)\n maxVal = currVal;\n }\n\n // Return result\n return maxVal;\n }", "private static int[] add(int[] x, long val) {\n int[] y;\n long sum = 0;\n int xIndex = x.length;\n int[] result;\n int highWord = (int)(val >>> 32);\n if (highWord == 0) {\n result = new int[xIndex];\n sum = (x[--xIndex] & LONG_MASK) + val;\n result[xIndex] = (int)sum;\n } else {\n if (xIndex == 1) {\n result = new int[2];\n sum = val + (x[0] & LONG_MASK);\n result[1] = (int)sum;\n result[0] = (int)(sum >>> 32);\n return result;\n } else {\n result = new int[xIndex];\n sum = (x[--xIndex] & LONG_MASK) + (val & LONG_MASK);\n result[xIndex] = (int)sum;\n sum = (x[--xIndex] & LONG_MASK) + (highWord & LONG_MASK) + (sum >>> 32);\n result[xIndex] = (int)sum;\n }\n }\n // Copy remainder of longer number while carry propagation is required\n boolean carry = (sum >>> 32 != 0);\n while (xIndex > 0 && carry)\n carry = ((result[--xIndex] = x[xIndex] + 1) == 0);\n // Copy remainder of longer number\n while (xIndex > 0)\n result[--xIndex] = x[xIndex];\n // Grow result if necessary\n if (carry) {\n int bigger[] = new int[result.length + 1];\n System.arraycopy(result, 0, bigger, 1, result.length);\n bigger[0] = 0x01;\n return bigger;\n }\n return result;\n }", "public static int maxSubArraySum(int a[]) {\n\t\tint max_so_far = a[0];\n\t\tint curr_max = a[0];\n\n\t\tfor (int i = 1; i < a.length; i++) {\n\t\t\tcurr_max = Math.max(a[i], curr_max + a[i]);\n\t\t\tmax_so_far = Math.max(max_so_far, curr_max);\n\t\t}\n\t\treturn max_so_far;\n\t}", "public static long getMaxLongValueForNumBits(int i) {\n\n if (i >= 64)\n throw new RuntimeException(\"Number of bits exceeds Java long.\");\n else\n return maxValueCache[i];\n\n }", "int maxSubarraySum(int arr[], int n){\n \n // Your code here\n int max = Integer.MIN_VALUE, curr = 0; \n \n for (int i = 0; i < n; i++) { \n curr = curr + arr[i]; \n if (max < curr) \n max = curr; \n if (curr < 0) \n curr = 0; \n } \n return max;\n }", "public static int circularArrayMaxSubarraySum(int[] arr) {\n\t\tint ceNotWrapping = kadane(arr);\n\n\t\t// Case 2 : CE are wrapping\n\t\tint totalSum = 0;\n\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\ttotalSum += arr[i];\n\t\t\tarr[i] = -arr[i];\n\t\t}\n\n\t\tint nonContributingElementSum = kadane(arr);\n\n\t\tint ceWrapping = totalSum + nonContributingElementSum;\n\n\t\treturn Math.max(ceNotWrapping, ceWrapping);\n\n\t}", "public long getMaximumLong() {\n/* 233 */ return this.max;\n/* */ }", "static void miniMaxSum(int[] arr) {\n\t\tlong max = Long.MIN_VALUE;\n\t\tlong min = Long.MAX_VALUE;\n\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tlong compareMax = sum(i, arr);\n\t\t\tlong compareMin = sum(i, arr);\n\n\t\t\tif (max < compareMax)\n\t\t\t\tmax = compareMax;\n\t\t\tif (min > compareMin)\n\t\t\t\tmin = compareMin;\n\n\t\t}\n\t\tSystem.out.print(min);\n\t\tSystem.out.print(\" \");\n\t\tSystem.out.print(max);\n\t}", "private static long sumSquares(long n) {\n\t\tBigInteger nBI = BigInteger.valueOf(n);\n\t\tBigInteger sum = nBI.multiply(nBI.add(BigInteger.ONE));\n\t\tsum = sum.multiply(nBI.shiftLeft(1).add(BigInteger.ONE));\n\t\tsum = sum.divide(BigInteger.valueOf(6)).mod(BigInteger.valueOf(mod));\n\t\treturn sum.longValue();\n\t}", "long getLsum(int n, int i, int k){ \r\n return (i-k+1)>=0 ? (i-k+1) + ssum(k) : ssum(k) - ssum(k-i-1);\r\n }", "static void miniMaxSum(int[] arr) {\n Arrays.sort(arr);\n long sum = 0;\n for (int i : arr) {\n sum += i;\n }\n System.out.println((sum - arr[4]) + \" \" + (sum - arr[0]));\n }", "int maxSubarraySum(int arr[], int n){\n \n // Your code here\n int cursum = arr[0];\n int osum = arr[0];\n \n for(int i=1;i<n;i++){\n if(cursum>=0){\n cursum+=arr[i];\n }else{\n cursum=arr[i];\n }\n if(cursum>osum){\n osum=cursum;\n }\n }\n return osum;\n \n }", "static void miniMaxSum(int[] arr) {\n int min=arr[0];\n int max=0;\n long maxsum=0,minsum=0;\n for(int i:arr)\n {\n if(i<min)\n {\n min=i;\n }\n if(i>max)\n {\n max=i;\n }\n }\n for(int i:arr)\n {\n if(i==max)\n {\n max=0;\n continue;\n }\n else\n {\n minsum+=i;\n }\n }\n for(int i:arr)\n {\n if(i==min)\n {\n min=0;\n continue;\n }\n else\n {\n maxsum+=i;\n }\n }\n System.out.println(minsum+\" \"+maxsum);\n }", "public static int getMaxSum(int[] arr) {\n int maxSum = 0;\n int sum = 0;\n for (int i : arr) {\n sum += i;\n if (maxSum < sum) maxSum = sum;\n else if (sum < 0) sum = 0;\n }\n return maxSum;\n }", "public static long digitSum(long n){\n if (String.valueOf(n).contains(\"-\")) return 0;\n long sum = 0;\n char[] chs = String.valueOf(n).toCharArray();\n for (char ch : chs){\n sum += Long.parseLong(String.valueOf(ch));\n }\n return sum;\n }", "static int maxSubsetSum(int[] arr) {\n int n = arr.length;\n int[] dp = new int[n];\n dp[0] = arr[0];\n dp[1] = Math.max(arr[0], arr[1]);\n\n for (int i = 2; i < n; ++i) {\n dp[i] = Math.max(dp[i - 2], Math.max(dp[i - 2] + arr[i], Math.max(dp[i - 1], arr[i])));\n }\n\n return dp[n - 1];\n }", "public long parallelSum(long n) {\n //better use long int double rangeclosed instead of iterate\n return Stream.iterate(1L, i -> i + 1)\n .limit(n)\n .parallel()\n .reduce(0L, Long::sum);\n }", "int maxSum(int[] arr){\n\t\tint sum=0;\n\t\tint arrayMin = findMin(arr);\n\t\tfor (int i=0; i<arr.length; i++) {\n\t\t\tif (arr[i] != arrayMin) {\n\t\t\t\tsum += arr[i];\n\t\t\t}\n\t\t}\n\t\treturn sum;\n\t}", "public static long sumOfDigits(long n) {\n int sum = 0;\n // Checks the integer and adds up its variables\n while (n > 0) {\n sum += n % 10;\n n /= 10;\n }\n // returns the sum of digits back\n return sum;\n }", "public static int kadaneMaxSum(int[] nums) {\n if(nums == null || nums.length == 0) return -1;\n\n int maxSoFar = 0, maxEndingHere = 0;\n for(int i = 0; i < nums.length; i++) {\n maxEndingHere += nums[i];\n\n if(maxEndingHere < 0) {\n maxEndingHere = 0;\n } else if(maxSoFar < maxEndingHere) {\n maxSoFar = maxEndingHere;\n }\n }\n\n System.out.println(\"kadane the maxsum is \" + maxSoFar);\n return maxSoFar;\n }", "public long sumFromZeroUpToAutoboxed(int upTo) {\n\t\tLong sum = 0L;\n\t\t\n\t\tfor (long i = 0;i < upTo; i++) {\n\t\t\tsum += i;\n\t\t}\n\t\t\n\t\treturn sum;\n\t}", "static void miniMaxSum(int[] arr) {\n long minSum=0,maxSum=0;\n int temp=0;\n for(int k=0; k<arr.length-1; k++) {\n for(int i=0; i <arr.length-k-1;i++) {\n if(arr[i]>arr[i+1] ) {\n temp=arr[i];\n arr[i]=arr[i+1];\n arr[i+1]=temp;\n }\n }\n }\n for(int i=1;i<arr.length;i++){\n minSum+=arr[i-1];\n maxSum+=arr[i];\n }\n System.out.print(minSum+\" \"+maxSum);\n\n }", "private static int calcDigitsSum(long number) {\r\n\t\tint sum = 0;\r\n\t\t\r\n\t\twhile (number != 0) {\r\n\t\t\tint value = (int) (number % 10);\r\n\t\t\tsum += value;\r\n\t\t\tnumber /= 10;\r\n\t\t}\r\n\t\t\r\n\t\treturn sum;\r\n\t}", "public long getSum()\n {\n long sum = 0;\n\n for(int i = 0; i < integerList.length; i++)\n {\n sum = sum + integerList[i];\n }\n\n return sum;\n }", "private static int LargestSubArraySum(int[] array) {\n\t\tint maximumSum=0;\n\t\tfor(int i=0; i< array.length; i++) {\n\t\t\tfor(int j=i; j < array.length; j++) {\n\t\t\t\t\n\t\t\t\tint sum=0;\n\t\t\t\tfor(int k=i; k<= j; k++) \n\t\t\t\t\tsum += array[k];\n\t\t\t\t\n\t\t\t\tmaximumSum=Math.max(maximumSum, sum);\n\t\t\t} \n\t\t}\n\t\treturn maximumSum;\n\t}", "static int findLargestSubtreeSum(Node root) {\n\t\t// If tree does not exist,\n\t\t// then answer is 0.\n\t\tif (root == null)\n\t\t\treturn 0;\n\n\t\t// Variable to store\n\t\t// maximum subtree sum.\n\t\tINT ans = new INT(-9999999, root);\n\n\t\t// Call to recursive function\n\t\t// to find maximum subtree sum.\n\t\tfindLargestSubtreeSumUtil(root, ans);\n\n\t\treturn ans.n.key;\n\t}", "public static int maxCircularSum(int[] arr) {\n\t\tint sumNotWrapping = kadane(arr);\n\n\t\t// case 2 : CE are wrapping : NCE are not wrapping\n\t\tint totalSum = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\ttotalSum += arr[i];\n\t\t\tarr[i] = -arr[i];\n\t\t}\n\n\t\tint sumNCE = kadane(arr);\n\n\t\tint sumWrapping = totalSum + sumNCE;\n\n\t\treturn Math.max(sumNotWrapping, sumWrapping);\n\t}", "public static void main(String[] arrr){\n\t\tlong mod = 10000000011L;\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i]=sc.nextInt();\n\t\t}\n\t\tlong total=0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\ttotal = (total+((long)Math.pow((countBit(arr[i])),(i+1))%mod))%mod;\n\t\t}\n\t\tSystem.out.println(total);\n\t}", "public static long sequentialSum(long n) {\n return Stream.iterate(1L, num -> num + 1)\n .limit(n)\n .reduce(0L, Long::sum);\n }", "static int hash(long sum) {\n return (int) (sum) >>> 7;\n }", "private static int sumDigits(int sum) {\n int result;\n do {\n result = 0;\n while (sum != 0) {\n result += sum % 10;\n sum /= 10;\n }\n sum = result;\n }\n while (result > 9);\n return result;\n }", "public static void main(String[] args) {\r\n\t\t//int val = Integer.MAX_VALUE;\r\n\t\t//long biggerVal = val + 1;\r\n\t\t\r\n\t}", "public long iterativeSum(long n){\n long result = 0;\n for(long i = 1L; i <= n; i++){\n result += i;\n }\n return result;\n }", "static BigInteger findSum(BigInteger n) {\n if (n.equals(BigInteger.ZERO))\n return BigInteger.ZERO;\n BigInteger TWO = BigInteger.valueOf(2);\n\n BigInteger sum = BigInteger.ZERO;\n sum = sum.add(\n n.multiply(n.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n BigInteger flooredN = findFraction(n);\n sum = sum.add(\n n.multiply(flooredN)\n );\n\n sum = sum.subtract(\n flooredN.multiply(flooredN.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n sum = sum.subtract(findSum(flooredN));\n\n return sum;\n }", "private static int calculate(int limit) {\n\t\tPrimeGenerator primeGenerator = new PrimeGenerator((int) Math.floor(Math.sqrt(limit)) + 10);\n\n\t\t// BitSet is used to set a given number/index if it can be produced as p1^2 + p2^3 + p4^4\n\t\t// because there are numbers that can be produced more than once\n\t\tBitSet numbers = new BitSet(limit);\n\t\tnumbers.set(0, limit, false);\n\n\t\tList<Integer> list = primeGenerator.getPrimeList();\n\n\t\tfor (int a : list) {\n\t\t\tint powera = a * a;\n\t\t\tsearchB: for (int b : list) {\n\t\t\t\tint powerb = b * b * b;\n\t\t\t\tif (powera + powerb > limit) {\n\t\t\t\t\tbreak searchB;\n\t\t\t\t}\n\n\t\t\t\tsearchC: for (int c : list) {\n\t\t\t\t\tint powerc = c * c * c * c;\n\t\t\t\t\tint sum = powera + powerb + powerc;\n\t\t\t\t\tif (sum > limit) {\n\t\t\t\t\t\tbreak searchC;\n\t\t\t\t\t}\n\t\t\t\t\t// Set the index - the number is passed\n\t\t\t\t\tnumbers.set(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Set the number of set bit - the solution\n\t\treturn numbers.cardinality();\n\t}", "private static int maxSubSumN3(int[] a) {\n int maxSum = 0;\n\n for (int first = 0; first < a.length; first++) {\n for (int last = first; last < a.length; last++) {\n int thisSum = 0;\n\n for (int i = first; i <= last; i++)\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n }\n }\n }\n\n return maxSum;\n }", "public static void main(String[] args) {\n\n byte byteVal = 5;\n short shortVal = 10;\n int intVal = 100;\n long longVal = 50000L + (byteVal + shortVal + intVal) * 10L;\n\n System.out.println(longVal);\n\n }", "public static long m33345a(long j, long j2) {\n long j3 = j + j2;\n if (j3 < 0) {\n return Long.MAX_VALUE;\n }\n return j3;\n }", "public void setSum(long value) {\n this.bitField0_ |= 4;\n this.sum_ = value;\n }", "int maxSubarraySum(int arr[], int n)\r\n {\r\n int maxSoFar = Integer.MIN_VALUE;\r\n int currMax = 0;\r\n for(int i = 0; i < n; i++) {\r\n currMax = Math.max(arr[i], currMax+arr[i]);\r\n maxSoFar = Math.max(currMax, maxSoFar);\r\n }\r\n return maxSoFar;\r\n }", "public static void main(String[] args) {\n int myValue = 10000;\n int myMinIntValue = Integer.MIN_VALUE;\n int myMaxIntValue = Integer.MAX_VALUE;\n int myMaxIntTest = 2_147_483_647; // use \"_\" for better readability\n System.out.println(\"INT min value = \" + myMinIntValue);\n System.out.println(\"INT max value = \" + myMaxIntValue);\n System.out.println(\"Bad int max value = \" + (myMaxIntValue + 1)); // causes overflow - exceed max data value\n System.out.println(\"Bad int min value = \" + (myMinIntValue - 1)); // causes underflow - exceed min data value\n\n // BYTES - occupies 8 bits\n byte minByteValue = Byte.MIN_VALUE;\n byte maxByteValue = Byte.MAX_VALUE;\n System.out.println(\"BYTE min value = \" + minByteValue);\n System.out.println(\"BYTE max value = \" + maxByteValue);\n\n // SHORT - occupies 16 bits\n short minShortValue = Short.MIN_VALUE;\n short maxShortValue = Short.MAX_VALUE;\n System.out.println(\"SHORT min value = \" + minShortValue);\n System.out.println(\"SHORT max value = \" + maxShortValue);\n\n // LONG\n long longValue = 1000L; // \"L\" indicates that it is a long value\n long minLongValue = Long.MIN_VALUE;\n long maxLongValue = Long.MAX_VALUE;\n System.out.println(\"LONG min value = \" + minLongValue);\n System.out.println(\"LONG max value = \" + maxLongValue);\n\n // Arithmetic - try to always use an integer\n int intDivision = (myMinIntValue / 2); // java treats parens as ints\n byte byteValue = (byte) (myMinIntValue / 2); // casting - tells java to treat the parens as a byte\n short shortValue = (short) (minShortValue / 2);\n\n // Primitive Challenge:\n byte byteChallenge = 100;\n short shortChallenge = 1000;\n int intChallenge = 50;\n\n long challengeTotal = 50_000L + 10L * (byteChallenge + shortChallenge + intChallenge);\n System.out.println(challengeTotal);\n\n short shortTotal = (short) (1000 + 10 * (byteChallenge + shortChallenge + intChallenge));\n }", "public int maxSubarraySumCircular(int[] A) {\n int total = 0, maxSum = -30000, curMax = 0, minSum = 30000, curMin = 0;\n for (int a :\n A) {\n curMax = Math.max(curMax + a, a);\n maxSum = Math.max(maxSum, curMax);\n curMin = Math.min(curMin + a, a);\n minSum = Math.min(minSum, curMin);\n total += a;\n }\n return maxSum > 0 ? Math.max(maxSum, total - minSum) : maxSum;\n }", "public static void main(String[] args) {\n int i = 1;\n int n = 100;\n for(;i<=n;i++){\n System.out.println(\"i:\" + i);\n }\n\n BigInteger bigInteger = BigInteger.valueOf(111L);\n bigInteger.longValue();\n }", "private static double getTimeForMaxSubSumOf(int[] list) {\n long start = System.currentTimeMillis();\n maxSubSumN(list);\n long stop = System.currentTimeMillis();\n return (stop - start) / 1000.0;\n }", "public static void main(String[] args) {\n\n\t\tlong largestSum = 0; \n\t\t\n\t\tfor(int a=1;a<100;a++)\n\t\t{\n\t\t\tfor(int b=1;b<100;b++)\n\t\t\t{\n\t\t\t\tBigInteger A = new BigInteger(a+\"\"),B = new BigInteger(b+\"\");\n\t\t\t\t\n\t\t\t\tBigInteger Result = A.pow(b);\n\t\t\t\tif(largestSum<SumOfDigitsInAString(Result.toString()))\n\t\t\t\t{\n\t\t\t\t\tlargestSum = SumOfDigitsInAString(Result.toString());\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\tSystem.out.println(SumOfDigitsInAString(Result.toString()));\n\t\t\tSystem.out.println(\"a : \" + a + \"b : \" + b);\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(largestSum);\n\t}", "private static Pair<Integer, Integer> getMaxSumHelper(Node root) {\n\t\t\n\t\tif(root.left_ == null && root.right_ == null) {\n\t\t\treturn new Pair<Integer, Integer>(root.data_, 0);\n\t\t}\n\t\t\n\t\tPair<Integer, Integer> lp = null;\n\t\tif(root.left_ != null) {\n\t\t\tlp = getMaxSumHelper(root.left_);\n\t\t}\n\t\t\n\t\tPair<Integer, Integer> rp = null;\n\t\tif(root.right_ != null) {\n\t\t\trp = getMaxSumHelper(root.right_);\n\t\t}\n\t\t\n\t\treturn new Pair<Integer, Integer>(\n\t\t\t\tlp.getValue()+rp.getValue()+root.data_, \t// root inclusiveSum + sum of children exclusiveSum\n\t\t\t\tlp.getKey()+rp.getKey());\t\t\t\t\t// root exclusiveSum -> sum of children inclusiveSum\n\t\t\n\t}", "int maxLen(int arr[], int n) \n {\n \tHashMap< Integer,Integer> map =new HashMap<Integer, Integer>();\n \t\n \t//set zero's as -1\n \tfor(int i= 0; i<n;i++)\n \t{\n \t\tif(arr[i]== 0){arr[i] = -1;}\n \t}\n \t\n \tint sum =0, maxLen =0;\n \t\n \tfor(int i= 0; i<n;i++)\n \t{\n \t\tsum += arr[i];\n \t\tif(sum == 0)\n \t\t{\n \t\t\tmaxLen = i+1;\n \t\t} \n \t\t\n \t\tif(map.containsKey(sum))\n \t\t{ maxLen = Math.max(maxLen, (i -map.get(sum))); \n \t\t}\n \t\telse{ map.put(sum, i);}\n \t}\n \t\n \treturn maxLen;\n }", "long sum(long[] a, int l, int r) {\n return l <= 0 ? a[r] : (a[r] + mod - a[l - 1]) % mod;\n }", "public static long compute(long limit) {\n return Stream.iterate(new long[]{1, 2}, p -> new long[]{p[1], p[0] + p[1]})\n .limit(100)\n .filter(e -> e[0] < limit && e[0] > 0)\n .mapToLong(e -> e[0])\n .filter(e -> e % 2 == 0)\n .sum();\n }", "static int maxSubArraySum(int a[], int size)\n {\n int Cur_Max = a[0];\n int Prev_Max = a[0];\n \n for (int i = 1; i < size; i++)\n {\n //we want to know if the summition is increassing or not\n Prev_Max = Math.max(a[i], Prev_Max+a[i]);\n //Take Decision to change the value of the largest sum or not\n Cur_Max = Math.max(Cur_Max, Prev_Max);\n }\n return Cur_Max;\n }", "public static int maxSumContiniousSubArray(int[] data) {\n\t\tint[] sums = new int[data.length];\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\tsum += data[i];\n\t\t\tsum = Math.max(0, sum);\n\t\t\tsums[i] = sum;\n\t\t}\n\t\treturn Arrays.stream(sums).max().getAsInt();\n\t}", "public int getMaximumInteger() {\n/* 244 */ return (int)this.max;\n/* */ }", "public static void main(String[] args) {\n Long prime = 2L;\n Long sum = 0L;\n \n do {\n sum += prime;\n prime = _7_10001Prime.nextPrime(prime);\n \n \n } while (prime < 2000000);\n \n System.out.println(sum);\n }", "public int maxSubArraySum(int[] nums) {\n int maxSoFar = 0;\n int maxEndingHere = 0;\n\n for (int i = 0; i < nums.length; i++) {\n maxEndingHere = maxEndingHere + nums[i];\n if (maxEndingHere > maxSoFar)\n maxSoFar = maxEndingHere;\n if (maxEndingHere < 0)\n maxEndingHere = 0;\n }\n return maxSoFar;\n }", "public static long sb(long a[], long n, long x) {\n long len = Long.MAX_VALUE;\n int p1 = 0;\n int p2 = 0;\n long sum = 0l;\n while(p1<=p2 && p2<n) {\n sum = sum + a[p2];\n p2++;\n while(sum >= x) {\n len = len > (p2-p1) ? (p2-p1) : len;\n sum = sum - a[p1];\n p1++;\n }\n }\n return len == Long.MAX_VALUE ? -1 : len;\n }", "public static int maxSum(int[] nums) {\n if(nums == null || nums.length == 0) return -1;\n\n int maxEndingHere = nums[0], maxSoFar = nums[0];\n for(int i = 1; i < nums.length; i++) {\n maxEndingHere = Math.max(maxEndingHere + nums[i], nums[i]);\n maxSoFar = Math.max(maxSoFar, maxEndingHere);\n }\n\n return maxSoFar;\n }", "private int go(int a[]) {\n int n = a.length;\n int maxsofar = Integer.MIN_VALUE;\n int minsofar = Integer.MAX_VALUE;\n int curmin = 0, curmax = 0, total = 0;\n int ans = 0;\n\n for (int i = 0; i < n; i++) {\n curmax = Math.max(curmax + a[i], a[i]);\n curmin = Math.min(curmin + a[i], a[i]);\n maxsofar = Math.max(maxsofar, curmax);\n minsofar = Math.min(minsofar, curmin);\n total += a[i];\n }\n\n if (maxsofar > 0) {\n ans = Math.max(maxsofar, total - minsofar);\n } else {\n ans = maxsofar;\n }\n return ans;\n }", "private long function(long a, long b) {\n if (a == UNIQUE) return b;\n else if (b == UNIQUE) return a;\n\n // return a + b; // sum over a range\n // return (a > b) ? a : b; // maximum value over a range\n return (a < b) ? a : b; // minimum value over a range\n // return a * b; // product over a range (watch out for overflow!)\n }", "private static int maxValue(int[] a) {\n\t\tint max_value =0;\r\n\t\tint current_max=0;\r\n\t\t\r\n\t\tfor(int i=0;i<a.length;i++)\r\n\t\t{\r\n\t\t\tcurrent_max += a[i];\r\n\t\t\tmax_value= Math.max(max_value, current_max);\r\n\t\t\tif(a[i]<0)\r\n\t\t\t\tcurrent_max=0;\r\n\t\t}\r\n\t\t\r\n\t\treturn max_value;\r\n\t}", "public static int maxSumSubSequence(int[] d) {\n\t\tint[] sum = new int[d.length];\n\t\tfor (int i = 0; i < d.length; i++) {\n\t\t\tsum[i] = d[i];\n\t\t}\n\t\tfor (int i = 1; i < d.length; i++) {\n\t\t\tfor (int j = 0; j < i; j++) {\n\t\t\t\tif (d[j] < d[i] && sum[i] < sum[j] + d[i]) {\n\t\t\t\t\tsum[i] = sum[j] + d[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tfor (int i = 0; i < sum.length; i++) {\n\t\t\tmax = Math.max(max, sum[i]);\n\t\t}\n\t\treturn max;\n\t}", "static int bitLengthForInt(int n) {\n return 32 - Integer.numberOfLeadingZeros(n);\n }", "public static int size_sum_a() {\n return (32 / 8);\n }", "public static int getMaxIntValueForNumBits(int i) {\n\n if (i >= 32)\n throw new RuntimeException(\"Number of bits exceeds Java int.\");\n else\n return (int) maxValueCache[i];\n\n }", "static INT findLargestSubtreeSumUtil(Node root, INT ans) {\n\t\t// If current node is null then\n\t\t// return 0 to parent node.\n\t\tif (root == null)\n\t\t\treturn new INT(0, null);\n\n\t\t// Subtree sum rooted\n\t\t// at current node.\n\t\tINT tmp = new INT(0, root);\n\t\tINT left = (INT)findLargestSubtreeSumUtil(root.left, ans);\n\t\tINT right = (INT)findLargestSubtreeSumUtil(root.right, ans);\n\t\ttmp.v = (int)(root.key + left.v + right.v) / maxDepth(root);\n\n\t\t// Update answer if current subtree\n\t\t// sum is greater than answer so far.\n\t\t\n\t\tif (tmp.v > ans.v ) {\n\t\t\tans.v = Math.max(ans.v, tmp.v);\n\t\t\tans.n = tmp.n;\n\t\t}\n\n\t\t// Return current subtree\n\t\t// sum to its parent node.\n\t\treturn new INT(root.key, root);\n\t}", "public static long sumOfDigitsByStream(BigInteger integer) {\n return integer.toString().chars()\n .map(x -> x & 0xF)\n .sum();\n }", "public Number getMaximumNumber() {\n/* 221 */ if (this.maxObject == null) {\n/* 222 */ this.maxObject = new Long(this.max);\n/* */ }\n/* 224 */ return this.maxObject;\n/* */ }", "public static int solve() {\n FactorizationSieve sieve = new FactorizationSieve(LIMIT + 1);\n int[] abundants = new int[LIMIT + 1];\n int k = 0;\n\n for (int n = 1; n <= LIMIT; n++)\n if (sieve.sigma(1, n) > n + n)\n abundants[k++] = n;\n\n // Sum pair of abundant numbers\n BitSet absums = new BitSet(LIMIT + 1);\n for (int i = 0; i < k; i++) {\n for (int j = i; j < k; j++) {\n int n = abundants[i] + abundants[j];\n if (n > LIMIT)\n break;\n absums.set(n);\n }\n }\n\n // Find all numbers that cannot be written as the sum of two abundant numbers\n int res = 0;\n for (int n = 1; n <= LIMIT; n++)\n if (!absums.get(n))\n res += n;\n return res;\n }", "static int sum(int... args) {\n\t\tint sum = 0;\n\t\tfor (int arg : args)\n\t\t\tsum += arg;\n\t\treturn sum;\n\t}", "public static final long Integer(final Object o) {\n\t\t\n\t\treturn Convert.Any.toLong(o, 0);\n\t}", "private void calcSum() {\n String numberVal = number.getText().toString();\n if (numberVal.isEmpty()) {\n numberVal = \"0\";\n }\n\n int count = Integer.parseInt(numberVal);\n\n if (count > 1e5) {\n Toast.makeText(\n this,\n \"The given number is too large for product of even items!\",\n Toast.LENGTH_SHORT).show();\n }\n\n\n // array initialization\n int[] arr = new int[count];\n for (int i = 0; i < count; i++) {\n arr[i] = i + 1;\n }\n\n // calculate sum\n long sum = 0;\n for (int i = 0; i < count; i++) {\n sum += arr[i];\n }\n\n result.setText(String.format(\"The sum is %d\", sum)); ;\n }", "public int sumSubarrayMins2(int[] nums) \n {\n if (nums == null || nums.length == 0)\n {\n return 0;\n }\n \n int size = nums.length;\n int result = 0;\n int mod = 1_000_000_000 + 7;\n \n for (int i = 0; i < size; i++)\n {\n int min = Integer.MAX_VALUE;\n \n for (int j = i; j < size; j++)\n {\n min = Math.min(min, nums[j]);\n result = (result + min) % mod;\n result %= mod;\n }\n }\n \n return result;\n }", "public static void main(String arg[]) {\n\t\t\n\t\tlong longNumberWithoutL = 1000*60*60*24*365;\n\t\tlong longNumberWithL = 1000*60*60*24*365L;\n\n\t\tSystem.out.println(longNumberWithoutL);//1471228928\n\t\tSystem.out.println(longNumberWithL);//31536000000\n\n\t\t//31536000000 -- 36 bits\n\t\t// 11101010111101100010010110000000000\n\t\t//max limit of 32 bit int: 2147483647\n\t\t//1010111101100010010110000000000 --> 1471228928\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(judgeSquareSum(1));//10000000001000000001\n\t}", "public int maxPathSum(TreeNode root) {\n helper(root); \n //run the function but don't use the final return value\n //only save the \"result\" when we run the function\n return result;\n }", "public int maxPathSum(TreeNode root) {\n\t\tint[] globalMax = new int[] {Integer.MIN_VALUE};\r\n\t\thelper(root, globalMax);\r\n\t\treturn globalMax[0];\r\n\t}", "public int get_sum_a() {\n return (int)getSIntBEElement(offsetBits_sum_a(), 32);\n }", "public long sum(long maximum, int int1, int int2) throws InterruptedException {\n\t\t// Java doesn't have pass by reference. This one element array keeps\n\t\t// track of our sum\n\t\tlong[] sum = { 0 };\n\n\t\tArrayList<Thread> threads = new ArrayList<Thread>();\n\t\tThread lowestMultipleOfBoth = new MultipleSummer(sum, maximum, int1 * int2, 1, 1);\n\n\t\tthreads.add(lowestMultipleOfBoth);\n\t\tlowestMultipleOfBoth.start();\n\t\tfor (int i = 1; i < int2; i++) {\n\t\t\tMultipleSummer t0 = new MultipleSummer(sum, maximum, int1, int2, i);\n\t\t\tt0.start();\n\t\t\tthreads.add(t0);\n\t\t}\n\t\tfor (int i = 1; i < int1; i++) {\n\t\t\tMultipleSummer t0 = new MultipleSummer(sum, maximum, int2, int1, i);\n\t\t\tt0.start();\n\t\t\tthreads.add(t0);\n\t\t}\n\n\t\tfor (Thread t1 : threads) {\n\n\t\t\tt1.join();\n\n\t\t}\n\n\t\treturn sum[0];\n\t}", "static long sumOfFullyTruncatable(boolean[] composite) {\n int count = 0;\n long sum = 0;\n\n for(int i = 10; i < composite.length; i++) {\n if(fullyTruncatable(i, composite)) {\n count++;\n sum += i;\n }\n }\n\n System.out.println(\"Count of truncatable primes is \" + count);\n return sum;\n }", "private int[] maxMoney(TreeNode root) {\n\t\tif (root == null) return new int[2];\n\t\tint[] ans = new int[2], l = maxMoney(root.left), r = maxMoney(root.right);\n\t\tans[0] = l[1] + r[1];\n\t\tans[1] = Math.max(root.val + l[0] + r[0], ans[0]);\n\t\treturn ans;\n\t}", "public static int sizeBits_sum_e() {\n return 32;\n }", "public static int maxSumOfAdjancentElementsSubArray( int[] array ) {\n\t\tassertThat( array ).isNotNull();\n\n\t\tint arrLength = array.length;\n\n\t\tif( arrLength == 0 )\n\t\t\treturn 0;\n\t\tif( arrLength == 1 )\n\t\t\treturn array[0];\n\n\t\tint maximumSum = array[0];\n\t\tfor( int i = 1; i < arrLength; i++ ) {\n\n\t\t\tarray[i] = Math.max( array[i - 1] + array[i], array[i] );\n\t\t\tmaximumSum = maximumSum > array[i] ? maximumSum : array[i];\n\t\t}\n\n\t\treturn maximumSum;\n\t}", "public static int size_sum_e() {\n return (32 / 8);\n }", "public static void main(String[] args) {\n\tint myValue = 10000;\n// int Mininum and vaximun value\n\tint myMinIntValue = Integer.MIN_VALUE;\n\tint myMaxIntValue = Integer.MAX_VALUE;\n\tSystem.out.println(\"Interger Minimum Value = \" + myMinIntValue);\n\tSystem.out.println(\"Interger Maximum Value = \" + myMaxIntValue);\n\t\tSystem.out.println(\"Busted MAX value = \" + (myMaxIntValue + 1));\n\t\tSystem.out.println(\"Busted Min value \" + (myMinIntValue - 1));\n//max int\n\t\tint myMaxIntTest = 2_147_483_647;\n//max and min byte value\n\t\tbyte myMinByteValue = Byte.MIN_VALUE;\n\t\tbyte myMaxByteValue = Byte.MAX_VALUE;\n\t\tSystem.out.println(\"Byte Minimum value =\" + myMinByteValue);\n\t\tSystem.out.println(\"Byte maximum value =\" + myMaxByteValue);\n\t\t//max and min short value\n\t\tshort myMinShortValue = Short.MIN_VALUE;\n\t\tshort myMaxShortValue = Short.MAX_VALUE;\n\t\tSystem.out.println(\"Short Minimum value =\" + myMinShortValue);\n\t\tSystem.out.println(\"Short maximum value =\" + myMaxShortValue);\n\t\t//max and min long value. long is double of int so while initializing value, put 'L'\n\t\tlong myLongValue = 100L;\n\t\tlong myMinlongValue = Long.MIN_VALUE;\n\t\tlong myMaxlongValue = Long.MAX_VALUE;\n\t\tSystem.out.println(\"long Minimum value =\" + myMinlongValue);\n\t\tSystem.out.println(\"long maximum value =\" + myMaxlongValue);\n\t\t//long literal value--just as we did of int.\n\t\tlong bigLongLiteralValue = 2_147_483_647_234L;\n\t\tSystem.out.println(bigLongLiteralValue);\n\t\t//short literal value\n\t\tshort bigShortLiteralValue = 32767;\n\t\t//total of datatype int\n\t\tint myTotal = (myMinIntValue /2);\n\t\t/* since it is not a literal value, we need to cast it. (byte) is casting, by this java\n\t\tidentifies it */\n\t\tbyte myByte = (byte) (myMinByteValue / 2);\n\n\t\tshort myShort = (short) (myMinShortValue /2);\n\t\t//chalenge\n\t\tbyte MyChallenge = 10;\n\t\tshort MyShort = 20;\n\t\tint MyInte = 50;\n\t\tlong Mylong = 50000L + 10l * (MyChallenge + MyShort + MyInte);\n\t\tSystem.out.println(Mylong);\n\n\n\n\t}", "private static long tenToThePowerOfInt(int number) {\n\n\t\tlong result = 1; // default case (10 power 0)\n\n\t\t// checking for out of long range\n\t\tif (number > 18) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tfor (int i = 0; i < number; i++) {\n\t\t\tresult = result * 10;\n\t\t}\n\n\t\treturn result;\n\n\t}", "public long readBoundedLong(final long max) throws IOException {\n final int bits = 0 >= max ? 0 : (int) (Math.floor(Math.log(max) / Math.log(2)) + 1);\n return 0 < bits ? this.read(bits).toLong() : 0;\n }" ]
[ "0.72864336", "0.7031912", "0.6453677", "0.64464283", "0.6358942", "0.6309442", "0.6289005", "0.62187666", "0.6212826", "0.6205813", "0.61942446", "0.6191051", "0.61692345", "0.6152151", "0.61019516", "0.60956776", "0.6082244", "0.6026866", "0.6018528", "0.60182214", "0.60095006", "0.600449", "0.5993916", "0.59937656", "0.59839326", "0.59604234", "0.5952182", "0.59454006", "0.59314054", "0.59224886", "0.5911575", "0.5892883", "0.5892561", "0.5887849", "0.5887536", "0.58685106", "0.5854415", "0.58534753", "0.5853188", "0.58457875", "0.584431", "0.5832454", "0.5827108", "0.58225286", "0.5817936", "0.5811322", "0.57997775", "0.5794821", "0.57884926", "0.57863444", "0.57837284", "0.5777649", "0.5768257", "0.57681704", "0.576237", "0.5757819", "0.5753539", "0.5745278", "0.57299656", "0.57200897", "0.57153374", "0.5705868", "0.57029706", "0.5695405", "0.5693518", "0.5685458", "0.5683258", "0.5680217", "0.5679706", "0.5666313", "0.56606156", "0.5659618", "0.564964", "0.5643227", "0.5639411", "0.5638438", "0.56081414", "0.5608136", "0.56072605", "0.55971855", "0.55923885", "0.55893636", "0.5585328", "0.557848", "0.5574987", "0.55749464", "0.55744773", "0.5568145", "0.55673283", "0.55595917", "0.5553413", "0.55363065", "0.55326825", "0.55299217", "0.55238515", "0.5521359", "0.5521219", "0.55206066", "0.55204844", "0.55153173" ]
0.6246167
7
TODO Autogenerated method stub
public static void main(String[] args) { try { FileInputStream fis = new FileInputStream("Sundari.txt"); BufferedInputStream bis = new BufferedInputStream(fis); int i; while((i=bis.read())!=-1) { System.out.print((char)i); } bis.close(); } catch(IOException ie) { System.out.println("exception thrown:"+ie); } finally { try { FileOutputStream fos = new FileOutputStream("Sundari.txt"); BufferedOutputStream bos = new BufferedOutputStream(fos); String s = "am an employee of Vaavel"; byte b[] = s.getBytes(); bos.write(b); bos.flush(); bos.close(); } catch(IOException ie) { ie.printStackTrace(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.drawer_bottom, container, false); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
As a user I want to input my first and last name so that I can know how to input my first and last name
@Test (dataProvider = "userData") public void canInputFirstAndLastName(userData John) { boolean expected = true; boolean actual = new AutomationPracticeFormPageObject(driver, baseUrl) .openAutomationWebPage() .inputFirstName(John.getFirstName()) .inputLastName(John.getLastName()) .isFirstNameAndLastNameFilled(); Assert.assertEquals(actual, expected); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void inputFirstLastName(String firstName, String lastName) {\n txbFirstName.type(firstName);\n txbLastName.type(lastName);\n }", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n\n // prepare questions for the user\n String fn_question = \"Enter your first name: \";\n String ln_question = \"Enter your last name: \";\n\n // show the user the questions and retrieve their answers\n // tip: .next() always returns string type\n System.out.print(fn_question);\n String first = input.next();\n\n System.out.print(ln_question);\n String last = input.next();\n\n //produce the output\n System.out.println(\"These usernames are available for use:\");\n System.out.println(first + last);\n System.out.println(last + first);\n System.out.println(first + \" \" + last);\n System.out.println(last + \"-\" + first);\n\n }", "public static void main (String[] args){\n System.out.println(\"What is your name?\");\n Scanner console = new Scanner(System.in);\n String first = console.next();\n String subfirst = first.substring(1);\n String last = console.next();\n String sublast = last.substring(1);\n\n name(first, subfirst);\n name(last, sublast);\n\n\n }", "private String getFirstName() {\n System.out.println(\"Enter Your Last Name Of First Letter In Capital \");\n return sc.next();\n }", "public String setUserFirstName(){\n String firstName = \"\";\n while(firstName.isBlank()) {\n System.out.print(\"Please Enter First Name: \");\n firstName = supplyString.get();\n }\n return firstName.trim();\n }", "public String setUserLastName(){\n String lastName = \"\";\n while(lastName.isBlank()) {\n System.out.print(\"Please Enter Last Name: \");\n lastName = supplyString.get();\n }\n return lastName.trim();\n }", "public void enterPersonalDetails(String firstName,String lastName){\n this.firstName.sendKeys(firstName);\n this.lastName.sendKeys(lastName);\n }", "public void promptFirstName(String firstName)\n {\n this.firstName = firstName;\n }", "static String getFirstName() {\n\t\tScanner s = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter first name: \");\n\t\tString fn = s.nextLine();\n\t\treturn fn;\n\t}", "public void enterlastName(String lastName) {\n Reporter.addStepLog(\"Enter last name \" + lastName + \" to last name field\" + _lastNameField.toString());\n sendTextToElement(_lastNameField, lastName);\n log.info(\"Enter last name \" + lastName + \" to last name field\" + _lastNameField.toString());\n }", "private static String getFirstName() {\n Scanner input = new Scanner(System.in);\n\n System.out.print(\"Enter your first name: \");\n String firstName = \"'\" + input.next() + \"'\";\n return firstName;\n }", "public static void main(String[] args) {\n String forename = Keyboard.getText(\"Please enter your forname\");\n //Step 2: ask user for surname\n String surname = Keyboard.getText(\"Please enter your surname\");\n //Step 3: ask user for mothers maiden name\n String maiden = Keyboard.getText(\"Please enter your mothers maiden name\");\n //Step 4: ask user for city in which they were born\n String town = Keyboard.getText(\"Please enter the town where you were born\");\n //Step 5: starwarsname = first 3 letter of surname + first 2 letters of first name + \" \" + first 3 letters of motehrs maiden name + first 2 letters of town you **were born in\n\nString starwarsname = (surname.substring(0,3)+(forename.substring(0,2)) + \" \"+ (maiden.substring(0,3)+ (town.substring(0,2))));\n\n //Step 6: display \"your star wars name is \" + starwarsname\n System.out.println(\"Your Star Wars name is \" + starwarsname);\n }", "@When(\"^I type in \\\"([^\\\"]*)\\\" in the lastname textbox$\")\n\tpublic void i_type_in_in_the_lastname_textbox(String arg1) throws Throwable {\n\t // Write code here that turns the phrase above into concrete actions\n\t\t driver.findElement(By.name(\"lastname\")).clear();\n\t driver.findElement(By.name(\"lastname\")).sendKeys(arg1);\n\t}", "public void promptLastName(String lastName)\n {\n this.lastName = lastName;\n }", "public void updateFirstNameAndlastName() {\r\n\t\tprint(\"Update First name and last name\");\r\n\t\tDateFormat txt = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n\t\tDate date = new Date();\r\n\t\tString fNamePostFix = \"Vivek\" + txt.format(date);\r\n\t\tString lNamePostFix = \"Sharma\" + txt.format(date);\r\n\t\tsendKeys(Locator.MyTrader.First_Name.value, fNamePostFix);\r\n\t\tsendKeys(Locator.MyTrader.Last_Name.value, lNamePostFix);\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter fullname:\");\n\t\tString name = input.nextLine();\n\t\tinput.close();\n\t\t\n\t\t//find the index of the space between first and last names\n\t\tint spaceIndex = name.indexOf(\" \");\n\t\t//Gives the value from index 0 until spaceIndex \n\t\tString firstName = name.substring(0, spaceIndex);\n\t\t//Gives the value from spaceIndex + 1 until the last index of lastName\n\t\tString lastName = name.substring(spaceIndex + 1);\n\t\t\n\t\t\n\t\ttheNameSong(firstName);\n\t\ttheNameSong(lastName);\n\t}", "private void getTextFromInput() {\n firstName = firstNameField.getText();\n lastName = lastNameField.getText();\n age = ageField.getText();\n email = emailField.getText().toLowerCase();\n }", "private String getLastName() {\n System.out.println(\"Enter Your Last Name Of First Letter In Capital \");\n return sc.next();\n }", "static String getLastName() {\n\t\tScanner s = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter last name: \");\n\t\tString ln = s.nextLine();\n\t\treturn ln;\n\t}", "public String searchLastNameUI() {\n console.promptForPrintPrompt(\" +++++++++++++++++++++++++++++++++++++++\");\n console.promptForPrintPrompt(\" + PLEASE ENTER LAST NAME TO SEARCH BY +\");\n console.promptForPrintPrompt(\" +++++++++++++++++++++++++++++++++++++++\");\n console.promptForString(\"\");\n String lastName = console.promptForString(\" LAST NAME: \");\n return lastName;\n }", "public void typeFirstName(String firstName) {\n firstNameInput.sendKeys(firstName);\n }", "private static String getLastName() {\n Scanner input = new Scanner(System.in);\n\n System.out.print(\"Enter your last name: \");\n String lastName = \"'\" + input.next() + \"'\";\n return lastName;\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"enter your first name, last name, company seperated by space\");\n String firstName, lastName, company, email;\n firstName = scan.next(); //(\"Dilmurod\");\n lastName = scan.next(); //(\"Yakubov\");\n company = scan.next();//(\"Verizon\");\n email = (firstName+\"_\"+lastName+\"@\"+company+\".com\");\n System.out.println(\"My name is \"+lastName+\", \"+firstName+\" and I work for \"+ company+\" and my email is: \"\n + email);\n\n\n\n }", "public void name(String first, String last) {\r\n String display = first + \" \" + last;\r\n textName.setText(display);\r\n }", "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 main(String[] args) {\n\t\tSystem.out.println(\"Enter the first name\");\n\t\tScanner sc=new Scanner(System.in);\n\t\tString first=sc.nextLine();\n\t\tSystem.out.println(\"Enter the second name\");\t\t\n\t\tString middle=sc.nextLine();\n\t\tSystem.out.println(\"Enter the last name\");\n\t\tString last=sc.nextLine();\n\t\tSystem.out.println(\"Enter the age\");\n\t\tint n=sc.nextInt();\n\t\tString f1=\"\";\n\t\t//int x= first.length();\n\t\tf1+=first.charAt(0);\t\n\t\tf1+=middle.charAt(0);\n\t\tf1+=last.charAt(0);\n\t\tf1+=\"\"+n;\n\t\t\n\t\tSystem.out.println(f1);\n\n\n}", "public void inputToFristnameTextbox(String firstName) {\n\t\twaitToElementVisible(driver,RegisterPageUI.FIRSTNAME_TEXTBOX);\n\t\tsendkeyToElement(driver, RegisterPageUI.FIRSTNAME_TEXTBOX, firstName);\n\t\t\n\t}", "static void displaySalutation(String firstName, String lastName) {\n //for capital first character first/last name\n lastName = (lastName.substring(0, 1).toUpperCase()) + lastName.substring(1);\n firstName = (firstName.substring(0, 1).toUpperCase()) + firstName.substring(1);\n //call displaySalutation one parameter\n displaySalutation(lastName);\n System.out.println();\n System.out.printf(\"Greeting Dear %s %s Thank you for \\nproviding with a good suggestion for our problem.\\nSoon, your solution will be reviewed.\", firstName, lastName);\n System.out.println();\n\n }", "private static void promptName() {\n\t\tSystem.out.print(\"Please enter a name: \");\n\t}", "public void enterFirstName(String firstName) {\n waitUntilElementToBeClickable(_firstNameField, 20);\n Reporter.addStepLog(\"Enter first Name: \" + firstName + \" to first name field \" + _firstNameField.toString());\n sendTextToElement(_firstNameField, firstName);\n log.info(\"Enter first Name: \" + firstName + \" to first name field \" + _firstNameField.toString());\n }", "java.lang.String getFirstName();", "java.lang.String getFirstName();", "public static void userName() {\n System.out.println(\"Please enter your name: \");\n String name = sc.nextLine(); \n System.out.println(\"Hello, \" + name);\n }", "public void enterLastName() throws IOException {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tlog.info(\"Verifying the Last Name is available or not\");\n\t\tWaitClass.WaitForElementisDisplay(driver, 5, enterLastName);\n\t\tAssert.assertTrue(enterLastName.isDisplayed());\n\t\tenterLastName.sendKeys(BasePage.getCellData(xlsxName, sheetName, 6, 0));\n\n\t}", "public void getInfo() {\n Scanner scanner = new Scanner(System.in);\n //get values from the user using scanner and sets class variables appropriately\n System.out.print(\"Enter the first name: \");\n setFirstName(scanner.nextLine());\n\n System.out.print(\"Enter the last name: \");\n setLastName(scanner.nextLine());\n\n System.out.print(\"Enter the ZIP code: \");\n setZipcode(scanner.nextLine());\n\n System.out.print(\"Enter the employee ID: \");\n setEmployeeID(scanner.next());\n }", "public void fillName(String firstNameProvided, String middleNameProvided, String lastNameProvided) {\n WebDriverWait waitDialog = getWait(3);\n waitDialog.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(\"//div[@role='dialog']\")));\n name.click();\n waitDialog.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//div[@role='dialog']\")));\n setFieldValue(\"firstName\", firstNameProvided);\n setFieldValue(\"middleName\", middleNameProvided);\n setFieldValue(\"lastName\", lastNameProvided);\n saveButton.click();\n }", "public static void main(String[] args) {\nString name;\nScanner s=new Scanner(System.in);\n\tSystem.out.println(\"Please enter your first name: \");\n\tname=s.next();\n\tSystem.out.println(name+\", Welcome\");}", "public void getNames() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter a name: \");\n\t\twhile (sc.hasNextLine()) {\n\t\t\tString name = sc.nextLine();\n\t\t\tif (name.equals(\"\")) {\n\t\t\t\t//User is finished.\n\t\t\t\tSystem.out.println(\"Exiting the program\");\n\t\t\t\tSystem.exit(1);\n\t\t\t} else {\n\t\t\t\tgetSimilarNames(name);\n\t\t\t\tSystem.out.println(\"Please enter a name: \");\n\t\t\t}\n\t\t}\n\t}", "public void fillName(String firstNameProvided, String lastNameProvided) {\n WebDriverWait waitDialog = getWait(3);\n waitDialog.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(\"//div[@role='dialog']\")));\n name.click();\n waitDialog.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//div[@role='dialog']\")));\n setFieldValue(\"firstName\", firstNameProvided);\n setFieldValue(\"lastName\", lastNameProvided);\n saveButton.click();\n }", "public void setLast_name(String last_name);", "@java.lang.Override\r\n public String askName() {\r\n Hello.display(\"Welcome! What is your name?\");\r\n Scanner in = new Scanner(System.in);\r\n String name = in.next();\r\n return name;\r\n }", "@When(\"^I type in \\\"([^\\\"]*)\\\" in the firstname textbox$\")\n\tpublic void i_type_in_in_the_firstname_textbox(String arg1) throws Throwable {\n\t // Write code here that turns the phrase above into concrete actions\n\t\t driver.findElement(By.name(\"firstname\")).clear();\n\t driver.findElement(By.name(\"firstname\")).sendKeys(arg1);\n\t}", "public static void main(String[] args) {\n Scanner myOdj = new Scanner(System.in );\n System .out.println(\" Enter your name\");\n\n String userName = myOdj.nextLine();\n System.out.println (\" hi \" + userName);\n\n \n }", "static void displaySalutation(String lastName) {\n System.out.println(\"Dear Mr. or Ms. \" + lastName);\n }", "private void readContactInfo() {\n\t\tScanner console = new Scanner(System.in);\n\t\tPerson tempPerson = new Person();\n\t\tString stringInput;\n\t\t\n\t\tSystem.out.println(\"Please press enter after each input, or \"\n\t\t\t\t\t\t\t+ \"input only 'c' to cancel.\");\n\t\tSystem.out.print(\"Last name: \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else if (stringInput.isEmpty()) { //terminates if last name is blank\n\t\t\tSystem.err.println(\"Last name is required. No contact added!\");\n\t\t\treturn;\n\t\t} else {\n\t\t\ttempPerson.setLastName(stringInput);\n\t\t}\n\t\t\n\t\tSystem.out.print(\"First name: \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else if (stringInput.isEmpty()) { //terminates if first name is blank\n\t\t\tSystem.err.println(\"First name is required. No contact added!\");\n\t\t\treturn;\n\t\t} else {\n\t\t\ttempPerson.setFirstName(stringInput);\n\t\t}\n\t\t\n\t\t\n\t\tStreetAddress address = new StreetAddress();\n\t\tSystem.out.println(\"Address: \");\n\t\tSystem.out.print(\"\\tHouse/Apartment: \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\taddress.setHouse(stringInput);\n\t\t}\n\t\t\n\t\tSystem.out.print(\"\\tCity: \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\taddress.setCity(stringInput);\n\t\t}\n\t\t\n\t\tSystem.out.print(\"\\tState: \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\taddress.setState(stringInput);\n\t\t}\n\t\t\n\t\tSystem.out.print(\"\\tZip code: \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\taddress.setZip(stringInput);\n\t\t}\n\t\t\n\t\tSystem.out.print(\"\\tCountry: \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\taddress.setCountry(stringInput);\n\t\t\ttempPerson.setAddress(address);\n\t\t}\n\t\t\t\n\t\tSystem.out.print(\"Email address: \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\ttempPerson.setEmail(stringInput);\n\t\t}\n\t\t\n\t\tSystem.out.print(\"Phone number(XXX XXX XXXX): \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\ttempPerson.setPhone(stringInput);\n\t\t}\n\t\n\t\tSystem.out.print(\"Notes: \");\n\t\tstringInput = console.nextLine().trim();\n\t\tif (isCancelled(stringInput)) { //terminates if user enters \"c\"\n\t\t\tSystem.out.println(\"No contact added.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\ttempPerson.setNotes(stringInput);\n\t\t}\n\t\t\n\t\tcontactList[contactCounter] = tempPerson;\n\t\tSystem.out.println(\"New contact added!\");\n\t\tcontactCounter++;\n\t}", "public static String getName(){\r\n String name = \"\";\r\n do{\r\n System.out.println(\"Please enter your name and press enter\");\r\n name = sc.nextLine();\r\n name = name.trim(); \r\n if(name.equals(\"\")){\r\n System.out.println(\"Error: Please put in name\");\r\n }\r\n }while(name.equals(\"\")); \r\n return name;\r\n }", "public void searchLeadForm(String firstName, String lastName) {\n\t\tactionbot.type(By.id(\"search_name_basic\"), firstName + \" \" + lastName);\n\t\tactionbot.click(By.id(\"search_form_submit\"));\n\t}", "public static String getValidFirstName(String aFirstName) {\n\n while (isValidFirstName(aFirstName) == false) {\n aFirstName = JOptionPane.showInputDialog(\"Please Enter Valid First Name\");\n }\n return aFirstName;\n\n }", "protected void validateFirstName(){\n Boolean firstName = Pattern.matches(\"[A-Z][a-z]{2,}\",getFirstName());\n System.out.println(nameResult(firstName));\n }", "public void processUser(){\n Scanner sc = new Scanner(System.in);\n\n InputNote inputNote = new InputNote(view, sc, note);\n inputNote.inputNote();\n\n notebook.addNote(note);\n note.formLastNameAndFirstLetterOfName();\n System.out.println(note.toString());\n }", "private void validateFirst() {\n mNameValidator.processResult(\n mNameValidator.apply(binding.personFirstName.getText().toString().trim()),\n this::validateLast,\n result -> binding.personFirstName.setError(\"Please enter a first name.\"));\n }", "public void inputToLastnameTextbox(String lastName) {\n\t\twaitToElementVisible(driver,RegisterPageUI.LASTNAME_TEXTBOX);\n\t\tsendkeyToElement(driver, RegisterPageUI.LASTNAME_TEXTBOX, lastName);\n\t}", "public void setLastname(String lastname);", "private void validateFirstNameInput(String firstName) {\n\t\t\n\t\tif(Objects.isNull(firstName) || firstName.length() < 3) {\n\t\t\tthrow new FirstNameIsNotInExpectedFormat(firstName);\n\t\t}\n\t\t\n\t}", "abstract void lastNameValidity();", "String getFirstName();", "String getFirstName();", "String getFirstName();", "public void setName(String firstName, String lastName){\r\n this.firstname = firstName;\r\n this.lastname = lastName;\r\n }", "public First()\r\n{\r\n\tScanner in = new Scanner(System.in);\r\n\tSystem.out.println(\"Enter your First Name: \");\r\n\tthis.fname=in.next();\r\n\tSystem.out.println(\"Enter your Last Name: \" );\r\n\tthis.lname=in.next();\t\r\n\tSystem.out.println(\"Enter Your GradeYear :\\n [1]Freshman \\n[2] Sophomore \\n[3] Junior \\n[4] Senior \\n\");\r\n\tthis.gradeyear=in.nextInt();\t\r\n\tsetStudentId();\r\n\tSystem.out.println(\"Name: \"+fname+\" \"+lname+\"\\nGrade-year: \"+gradeyear+\"\\nStudentID: \"+student_id+\"\");\r\n\tSystem.out.print(\"\\nEnter Your Course Name: \");\r\n}", "public static void main(String[] args) {\n\n System.out.println(\"Vad är ditt namn?\");\n\n\n Scanner namnInput = new Scanner (System.in);\n String namn = namnInput.nextLine();\n\n\n System.out.println(\"Hur gammal är du?\");\n\n Scanner ålderInput = new Scanner (System.in);\n String ålder = namnInput.nextLine();\n\n System.out.println(\"Vilken adress bor du på?\");\n\n\n Scanner adressInput = new Scanner (System.in);\n String adress = adressInput.nextLine();\n\n\n System.out.println(\"Vad är ditt postnummer?\");\n\n Scanner postnummerInput = new Scanner (System.in);\n String postnummer = postnummerInput.nextLine();\n\n\n System.out.println(\"Vad är ditt telefonnummer?\");\n\n\n Scanner telefonnummerInput = new Scanner (System.in);\n String telefonnummer = adressInput.nextLine();\n\n\n System.out.println(\"Information\" + \"\\n\");\n\n System.out.println(\"Namn:Lucas Lindqvist\" + \"\\n\");\n\n System.out.println(\"Ålder:17\" + \"\\n\");\n\n System.out.println(\"Adress:Valebergsvägen 191\" + \"\\n\");\n\n System.out.println(\"Postnummer:42737\" + \"\\n\");\n\n System.out.println(\"Telefonnummer:0723376320\" + \"\\n\");\n\n }", "void validateFullName(String firstName, String lastName, String fullName) throws FirstName, LastName {\n\t\tif (fullName.trim().equalsIgnoreCase(firstName)) {\n\t\t\tthrow new FirstName(\"last name is blank\");\n\t\t} else if (fullName.trim().equalsIgnoreCase(lastName)) {\n\t\t\tthrow new LastName(\"first name is blank\");\n\n\t\t} else {\n\t\t\tSystem.out.println(\" employee fullName: \" + fullName);\n\t\t}\n\t}", "public static String inputName() throws IOException {\n String name; //The name\n \n //Prompt user to enter name\n System.out.println(\"Please enter the employee's name:\");\n \n //Get name\n name = input.readLine();\n System.out.println(\"\");\n \n //Return name\n return name;\n }", "String getSurname();", "public void registration() {\n\t\tSystem.out.print(\"Enter Name : \");\r\n\t\tthis.name=scan.nextLine();\r\n\t\tSystem.out.print(\"Enter Age : \");\r\n\t\tthis.age=scan.nextInt();\r\n\t\tSystem.out.print(\"Enter Gender : \");\r\n\t\tthis.gender=scan.next().charAt(0);\r\n\t\tscan.nextLine();\r\n\t\tSystem.out.print(\"Enter Price : \");\r\n\t\tthis.price=scan.nextDouble();\r\n\t\tSystem.out.print(\"Enter Quantity : \");\r\n\t\tthis.quantity=scan.nextInt();\t\r\n\t\tSystem.out.println(\"Register Successfully\");\r\n\t}", "public NameInfo(String inFirst, String inLast)\n\t{\n\t\t//Set instance data.\n\t\tfirstName = inFirst;\n\t\tlastName = inLast;\n\n\t}", "void setFirstName(String firstName);", "public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter your name\\n\");\r\n\t\tString a=s.nextLine();\r\n\t\tSystem.out.print(\"College\\n\");\r\n\t\tString b=s.nextLine();\r\n\t\tSystem.out.print(\"De\\n\");\r\n\t\tString c=s.nextLine();\r\n\t\tSystem.out.print(\"Department\\n\");\r\n\t\tString d=s.nextLine();\r\n\t\tSystem.out.println(\"Name : \"+a+\"\\n\"+\"College : \"+b+\"\\n\"+\"De :\"+c+\"\\n\"+\"Department : \"+d);\r\n\t\t\r\n\r\n\t}", "public void setFirstName( String first )\r\n {\r\n firstName = first;\r\n }", "public static String Editor(String username){\n\t\tString main = username+\" \";\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter your first and last name(for example: John Lennon):\");\n\t\tmain+=input.nextLine()+\" \";\n\t\tSystem.out.println(\"Enter your date of birth (as MM/DD/YYYY)\");\n\t\tmain+=input.nextLine()+\" \";\n\t\tSystem.out.println(\"Enter your bank name and account number (as BANKOFMARS-10789)\");\n\t\tmain+=input.nextLine()+\" \";\n\t\tSystem.out.println(\"Enter your social security number (as 109382193)\");\n\t\tmain+=input.nextLine();\n\t\tSystem.out.println(\"Your new information has been saved\");\n\t\treturn main;\n\n\t}", "public void input(Scanner in) { \r\n if (in.hasNext()) firstName = in.next();\r\n if (in.hasNext()) lastName = in.next();\r\n\t}", "public static void main(String[] args) {\n System.out.println(\"Hey! Please enter your goodname: \");\n Scanner ip = new Scanner(System.in);\n String name = ip.nextLine();\n System.out.println(\"Happy Birthday \" + name);\n }", "public void printName()\n\t{\t\t\n\t\t//check if we know the name of the professor\n\t\tif(this.firstName == null || this.surname == null ||\n\t\t\tthis.firstName.isEmpty() || this.surname.isEmpty())\n\t\t{\n\t\t\t//We haven't learned exception throwing yet, so let's just output something and return :'(\n\t\t\tSystem.out.println(\"Error: This Professor is nameless, I'm sorry :(\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(String.format(\"\", this.firstName, this.surname));\n\t}", "private static String getUserName(){\r\n Scanner in = new Scanner(System.in);\r\n System.out.print(\"What is your character's name?\");\r\n return in.nextLine();\r\n }", "public void setFirstName(String fName){\n\t\t//If the user hits cancel a null is sent. Error message to let the user know they must enter a first name. \n\t\tif(fName == null){\n\t\t\tthrow new IllegalArgumentException(\"Sorry, but a first name must be entered.\");\n\t\t}\n\t\t\n\t\t//If the name is blank then an exception is thrown to inform the user.\n\t\tif(fName.trim().equals(\"\")){\n\t\t\tthrow new IllegalArgumentException(\"The first name cannot be blank\");\n\t\t}\n\t\t//If the name is not blank then the name is stored and a true is return.\n\t\telse{\n\t\t\t//Loop to check that all characters are letters and there are no digits.\n\t\t\tfor(int x = 0; x < fName.length(); x++){\n\t\t\t\tif(Character.isDigit(fName.charAt(x))){\n\t\t\t\t\tthrow new IllegalArgumentException(\"No digits are allowed in the name.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.firstName = fName;\n\t\t}\n\t}", "public static void main(String[] args) {\n String firstInitial, lastName, streetName, streetType, cityName;\n int houseNumber;\n Scanner keyboard=new Scanner(System.in);\n\n System.out.print(\"Enter your first initial, last name, street name,street type and your house number: \");\n firstInitial=keyboard.next();\n lastName=keyboard.next();\n streetName=keyboard.next();\n streetType=keyboard.next();\n cityName=keyboard.next();\n houseNumber=keyboard.nextInt();\n System.out.print(firstInitial+ \" \" +lastName+ \" \" + houseNumber +\" \");\n System.out.println(streetName + \" \" + streetType + \" \" +cityName);\n\n }", "public void startInfo() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Enter your name:\");\n\t\tString name = this.getInputString();\n\t\tSystem.out.println(\"Enter your mobile number:\");\n\t\tint number = this.getInputInteger();\n\t\tSystem.out.println(\"Enter your email:\");\n\t\tString email = this.getInputString();\n\t}", "public static void main(String[] args) {\r\n //create a scanner to obtain input from the console window\r\n\r\n Scanner input = new Scanner(System.in);\r\n\r\n System.out.print(\"Enter Name \"); //prompt\r\n String name1 = input.nextLine(); //read first number from user \r\n\r\n System.out.print(\"Enter age: \"); //prompt\r\n\r\n int num2 = input.nextInt(); //read second number from user \r\n\r\n input.close();\r\n\r\n\r\n \r\n\r\n System.out.println(\"Your name is \" + name1 + \" You are \"+ num2 + \" years old\");\r\n\r\n }", "java.lang.String getSurname();", "public static void main(String[] args) \n {\n Scanner sc = new Scanner(System.in); \n \n // String input\n System.out.print(\"What's your name? \"); \n String name = sc.nextLine(); \n \n // Print the values to check if input was correctly obtained. \n System.out.println(\"Name: \" + name); \n\n // Close the Scanner\n sc.close();\n }", "abstract void firstNameValidity();", "private void verifyInput(){\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n\n mNameFieldsFilled = !TextUtils.isEmpty(firstName) && !TextUtils.isEmpty(lastName);\n\n }", "public static void main(String[] args) {\n System.out.print(\"Please enter your name: \");\n String name = new Scanner(System.in).nextLine();\n\n //2. Do something with that input\n String greeting = \"Good morning \" + name + \"!\";\n\n //3. Output result to user\n System.out.println(greeting);\n }", "private String getName() {\n System.out.println(\"Enter contact name\");\n return scannerForAddressBook.scannerProvider().nextLine();\n }", "public void setFirstName(String firstName);", "public static void printUsername() {\n\t\tSystem.out.println(\"Enter the username\");\n\t\tString username = Utility.SCANNER.nextLine();\n\t\tint length = username.length();\n\t\tif(length > 3) {\n\t\t\tSystem.out.println(\"Hello \"+username+\", How are you?\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Invalid username\");\n\t\t}\n\t}", "private void requestUserName() {\n // Show an alert to ask for the name\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Enter name:\");\n\n final EditText input_field = new EditText(this);\n\n builder.setView(input_field);\n\n // If a name is provided, let the user pass after pressing Ok\n builder.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n name = input_field.getText().toString();\n }\n });\n // If a no name is provided, prompt again\n builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.cancel();\n requestUserName();\n }\n });\n\n builder.show();\n }", "public static String getValidation(String message) { // Example of using Method Overloading\r\n\r\n Scanner reader = new Scanner(System.in); // Create a Scanner object\r\n String input = null;\r\n int charIsNotSpace = 0;\r\n\r\n do {\r\n System.out.print(message);\r\n\r\n while (!reader.hasNextLine()) { // I think that the program never enters this while because .hasNextLine identifies\r\n System.out.print(\"Please enter a valid name with at least 3 characters\"); // any type of input as a valid\r\n reader.next(); // value, including \"enter\" and space, but it is like this in the \"PPT Input Validation\"\r\n }\r\n\r\n input = reader.nextLine();\r\n\r\n for (int i=0; i < input.length(); i++) { // checks if at least three characters are not space\r\n if (input.charAt(i) != ' ') {\r\n charIsNotSpace ++;\r\n }\r\n }\r\n\r\n } while (input == null || input.equals(\"\") || input.length() < 3 || charIsNotSpace < 3); //While the input value is not a null value or empty string or least 3 characters.\r\n\r\n // Loop used to capitalize the first letter of the name and without using any other auxiliary class, such as the StringBuilder\r\n String letter = \"\";\r\n String capitalizedName = \"\";\r\n boolean isFirstLetter;\r\n for (int i=0; i < input.length(); i++) {\r\n\r\n isFirstLetter = false;\r\n\r\n if (i == 0) {\r\n while (input.charAt(i) == ' ') { // Ignores spaces that the user typed before the first letter of the name\r\n i++;\r\n }\r\n isFirstLetter = true;\r\n }\r\n\r\n if (input.charAt(i) == ' ' && (i+1) < input.length()) {\r\n if (input.charAt(i) == ' ' && input.charAt(i + 1) == ' ') {\r\n letter = \"\";\r\n } else {\r\n letter += \" \" + input.charAt(i + 1);\r\n capitalizedName += letter.toUpperCase();\r\n i++;\r\n letter = \"\";\r\n }\r\n }\r\n else if (isFirstLetter == true) {\r\n letter += input.charAt(i);\r\n capitalizedName += letter.toUpperCase();\r\n letter = \"\";\r\n }\r\n else if (input.charAt(i) != ' ') {\r\n letter += input.charAt(i);\r\n capitalizedName += letter.toLowerCase();\r\n letter = \"\";\r\n }\r\n }\r\n\r\n return capitalizedName;\r\n }", "public java.lang.String getFirstName();", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "String getLastName();", "String getLastName();", "public static String inputName() {\n return GolferScoresTree.inputString(\"Golfer name: \");\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}", "Name(String fName, String lName) {\n if (fName.length() == 0 || lName.length() == 0) {\n throw new IllegalArgumentException(\"first \" +\n \"and/or last name cannot be empty\");\n }\n this.firstName = Utilities.capitalizeString(fName);\n this.lastName = Utilities.capitalizeString(lName);\n this.initials = createInitials(getFirstName(), getLastName());\n }", "public static void processInputNames() {\r\n\t\tif (!IniSetup.enterNames.getText().equals(\"\")) {\r\n\t\t\tnames.add((String) IniSetup.enterNames.getText());\r\n\t\t}\r\n\t}", "public static ArrayList<String> nameInput() {\r\n\t\tString name = \"initialized\";\r\n\t\twhile(name.length() > 0) {\r\n\t\tSystem.out.println(\"Enter name: \");\r\n\t\tname = input.nextLine();\r\n\t\tnames.add(name);\r\n\t\t}\r\n\t\treturn names;\r\n\t}", "public void setFirstName(java.lang.CharSequence value) {\n this.first_name = value;\n }", "public void changeName(String first, String last) {\n this.firstName = first;\n this.lastName = last;\n }", "public void changeName(String first, String last) {\n this.firstName = first;\n this.lastName = last;\n }" ]
[ "0.7559575", "0.7268371", "0.72260255", "0.7173993", "0.71643", "0.7147664", "0.7039711", "0.6952384", "0.69510454", "0.6947968", "0.686395", "0.68549633", "0.68507534", "0.6842945", "0.6842767", "0.67742443", "0.6753776", "0.6744566", "0.67420053", "0.6734066", "0.6695711", "0.66556764", "0.66475797", "0.6608394", "0.65973604", "0.65893847", "0.6515206", "0.65027946", "0.6496399", "0.6447279", "0.6430895", "0.6430895", "0.641624", "0.63552046", "0.63410103", "0.6340334", "0.6314192", "0.6312953", "0.62994295", "0.6232897", "0.6230366", "0.62247926", "0.6214338", "0.62097514", "0.61970323", "0.6182614", "0.61785185", "0.6171866", "0.6164227", "0.61631614", "0.61620873", "0.6161506", "0.6148418", "0.61380935", "0.6131142", "0.6122682", "0.6122682", "0.6122682", "0.6115443", "0.6114756", "0.61110425", "0.61103237", "0.61019284", "0.6095117", "0.60900563", "0.6068438", "0.6042212", "0.60289866", "0.6028343", "0.60279375", "0.60217", "0.6014341", "0.6010233", "0.6004227", "0.5998734", "0.5996409", "0.5994039", "0.59937286", "0.59863836", "0.5985591", "0.5985329", "0.5976477", "0.596216", "0.596064", "0.5957264", "0.59456366", "0.5943355", "0.5938974", "0.5936443", "0.59331393", "0.5929043", "0.5929043", "0.59246725", "0.5922021", "0.59187216", "0.5912641", "0.590983", "0.59083766", "0.5903739", "0.5903739" ]
0.6990661
7
As a user I want to fill all the information so that i can know how to use a data class
@Test public void canFillAllInformation() { userData John = People.getJohnInfo(); boolean expected = true; boolean actual = new AutomationPracticeFormPageObject(driver, baseUrl) .openAutomationWebPage() .inputFirstName(John.getFirstName()) .inputLastName(John.getLastName()) .selectGender(John.getGender()) .selectYearsOfExperience(John.getYearsOfExperience()) .inputDate(John.getDate().toString()) .selectProfession(John.getProfession()) .selectAutomationTool(John.getAutomationTool()) .selectContinent(John.getContinent()) .selectMultipleContinents(John.getContinentList()) .selectSeleniumCommand(John.getSeleniumCommands()) .areFieldsCompleted(); Assert.assertEquals(actual, expected); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void fetchData() {\n mFirstNameLabel = \"First name:\";\n mFirstNameValue = \"Taylor\";\n mSurnameLabel = \"Surname:\";\n mSurnameValue = \"Swift\";\n\n initFields();\n }", "private void fillData() {\n\tparname.setText(UpStudentController.getName());\r\n\tparphone.setText(UpStudentController.getPhone());\r\n\tparmail.setText(UpStudentController.getMail());\r\n\taddres.setText(UpStudentController.getAdr());\r\n\tlocation.setText(UpStudentController.getLoc());\r\n\tkazi.setText(UpStudentController.getOc());\r\n\ttaifa.setText(UpStudentController.getNat());\r\n\t}", "public void populateUserInformation()\n {\n ViewInformationUser viewInformationUser = new ViewFXInformationUser();\n\n viewInformationUser.buildViewProfileInformation(clientToRegisteredClient((Client) user), nameLabel, surnameLabel, phoneLabel, emailLabel, addressVbox);\n }", "public void setStuData() {\n\n System.out.print(\"Enter The Name : \"); \t String Entered_Name = Scan.next();\n\n System.out.print(\"Enter User Name : \");\t String Entered_User = Scan.next();\n\n System.out.print(\"Enter Password : \");\t int Entered_Pass = Scan.nextInt();\n\n System.out.print(\"Enter Feild : \");\t\t String Entered_Feild = Scan.next();\n\n Students_list.add(new Student(Entered_User , Entered_Name , Entered_Pass , Entered_Feild));\n\n System.out.print(\"Data Has been Saved!\");\n\n }", "private static void setData() {\n attributeDisplaySeq = new ArrayList<String>();\n attributeDisplaySeq.add(\"email\");\n\n signUpFieldsC2O = new HashMap<String, String>();\n signUpFieldsC2O.put(\"Email\",\"email\");\n\n\n signUpFieldsO2C = new HashMap<String, String>();\n signUpFieldsO2C.put(\"email\", \"Email\");\n\n\n }", "void populateData();", "public static void populateData() {\n\n }", "private void populateUserInfo() {\n User user = Session.getInstance().getUser();\n labelDisplayFirstname.setText(user.getFirstname());\n labelDisplayLastname.setText(user.getLastname());\n lblEmail.setText(user.getEmail());\n lblUsername.setText(user.getUsername());\n }", "private void initData() {\n ContractList conl = new ContractList();\n String iCard = txtindentify.getText().trim();\n if (conl.getacc(iCard) == 0) {\n txtAcc.setText(\"NEW CUSTOMER\");\n\n } else {\n Customer cus = new Customer();\n CustomerList cl = new CustomerList();\n cus = cl.getcus(iCard);\n txtAcc.setText(Integer.toString(cus.acc));\n\n }\n }", "void initData() {\r\n\t\tthis.daVinci = new Artist(\"da Vinci\");\r\n\t\tthis.mona = new Painting(daVinci, \"Mona Lisa\");\r\n\t\t//this.lastSupper = new Painting(this.daVinci, \"Last Supper\");\r\n\t}", "protected UserWordData() {\n\n\t}", "private static void createDemoData() {\n if (userManager.user_map.isEmpty() || accountManager.account_map.isEmpty() || banknoteManager.banknotes.isEmpty()) {\n if (userManager.user_map.isEmpty()) {\n userManager.createAccount(BankManager.class.getSimpleName(), \"jen\", \"1234\");\n userManager.createAccount(Teller.class.getSimpleName(), \"pete\", \"1234\");\n userManager.createAccount(Customer.class.getSimpleName(), \"steve\", \"1234\");\n }\n\n if (accountManager.account_map.isEmpty()) {\n accountManager.addAccount(CreditCard.class.getSimpleName(), Collections.singletonList(\"steve\"));\n accountManager.addAccount(Youth.class.getSimpleName(), Collections.singletonList(\"steve\"));\n accountManager.addAccount(Saving.class.getSimpleName(), Collections.singletonList(\"steve\"));\n accountManager.addAccount(Chequing.class.getSimpleName(), Collections.singletonList(\"steve\"));\n accountManager.addAccount(CreditLine.class.getSimpleName(), Collections.singletonList(\"steve\"));\n }\n\n if (banknoteManager.banknotes.isEmpty()) {\n banknoteManager.banknotes = new HashMap<>();\n for (int d : banknoteManager.DENOMINATIONS) {\n banknoteManager.banknotes.put(String.valueOf(d), 50);\n }\n }\n }\n }", "private void fillData()\n {\n\n }", "public void getInfo() {\n Scanner scanner = new Scanner(System.in);\n //get values from the user using scanner and sets class variables appropriately\n System.out.print(\"Enter the first name: \");\n setFirstName(scanner.nextLine());\n\n System.out.print(\"Enter the last name: \");\n setLastName(scanner.nextLine());\n\n System.out.print(\"Enter the ZIP code: \");\n setZipcode(scanner.nextLine());\n\n System.out.print(\"Enter the employee ID: \");\n setEmployeeID(scanner.next());\n }", "private void setUserData(){\n }", "private void initData() {\n getCourse();\n// getMessage();\n\n }", "@Override\n\tpublic void input() {\n\t\tUser u =new User();\n\t\tif(list.size() <= MAX_USER) {\n\t\tSystem.out.print(\"이름 입력 : \");\n\t\tu.setName(sc.next());\n\t\tSystem.out.print(\"나이 입력 : \");\n\t\tu.setAge(sc.nextInt());\n\t\tSystem.out.print(\"주소 입력 : \");\n\t\tu.setAddr(sc.next());\n\t\tlist.add(u);\n\t\t\n\t\t}else if(list.size() > MAX_USER) {\n\t\t\tSystem.out.println(\"최대 등록 인원은 10명입니다.\");\n\t\t}\n\t}", "public Data() {\n initComponents();\n koneksi_db();\n tampil_data();\n }", "public void populateFields(String userName){\n this.userNameLabel.setText(userName);\n \n if(this.dbConnection.ConnectDB()){\n //we connected\n String[] temp = this.dbConnection.getUserInformation(userName);\n //take this array and populate the input fields for firstName, lastName,Email,\n this.firstNameInputField.setText(temp[0]);\n this.lastNameInputField.setText(temp[1]);\n this.emailInputField.setText(temp[4]);\n this.roleDropdown.promptTextProperty().set(temp[2]);\n this.departmentDropdown.promptTextProperty().set(temp[3]);\n //add these default values to the map\n this.defaultFirstname = temp[0];\n this.defaultLastname = temp[1];\n this.defaultEmail = temp[4];\n this.defaultRole = temp[2];\n this.defaultDepartment = temp[3];\n \n //repopulate the map\n populateMap();\n //unlock the checkboxes\n this.unlockCheckboxes(this.boxes);\n \n// //print out the mapfor testing purposes\n// for(Map.Entry<String,String> mapObj: this.defaultValuesMap.entrySet()){\n// System.out.println(mapObj.getKey());\n// System.out.println(mapObj.getValue());\n// }\n \n \n }\n }", "@Override\n\tvoid getData() {\n\t\tSystem.out.println(\"Enter Brand\");\n\t\tbrand=a.next();\n\t\tSystem.out.println(\"Enter model\");\n\t\tmodel=a.next();\n\t\tSystem.out.println(\"Enter CC\");\n\t\tcc=a.nextDouble();\n\t}", "public UserData() {\n\t\tvalid = false;\n\t\tcode = \"\";\n\t\t\n\t\tphone = \"\";\n\t\temail = \"\";\n\t\t\n\t\taccounts = new ArrayList<Account>();\n\t\tpayees = new ArrayList<Payee>();\n\t}", "public static void main(String[] args) {\n\n UserInformation userInformation = new UserInformation();\n System.out.println(\"What do you want ?\");\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"1)Sign Up \\n2)Login \");\n int select = scanner.nextInt();\n System.out.println(\"Enter the requested information\");\n\n switch (select){\n case 1:\n System.out.println(\"Enter your name:\");\n userInformation.setName(scanner.next());\n System.out.println(\"Enter your UserName:\");\n userInformation.setUsername(scanner.next());\n System.out.println(\"Enter your PassWord:\");\n userInformation.setPassword(scanner.next());\n System.out.println(\"Enter your Email\");\n userInformation.setEmail(scanner.next());\n System.out.println(\"Welcom :)\");\n userInformation.insert(userInformation.getName(),userInformation.getUsername(),userInformation.getPassword(),userInformation.getEmail());\n break;\n\n case 2:\n System.out.println(\"Enter your UserName\");\n userInformation.setUsername(scanner.next());\n System.out.println(\"Enter your PassWord:\");\n userInformation.setPassword(scanner.next());\n break;\n }\n }", "private void initialData() {\n\n }", "@Override\n\tvoid putData() {\n\t\tSystem.out.println(\"Brand : \"+brand);\n\t\tSystem.out.println(\"Model : \"+model);\n\t\tSystem.out.println(\"Year of manufacture : \"+year_of_manufacture);\n\t\tSystem.out.println(\"CC : \"+cc);\n\t}", "public static void main(String[] args) {\n\n\n Person id = new Person();//shortns the code\n\n Scanner input= new Scanner(System.in);//set scanner\n\n //Ask user to input data\n\n System.out.println(\"Name of a person: \");\n id.setName(input.next());\n\n System.out.println(\"Age: \");\n id.setAge(input.nextInt());\n\n System.out.println(\"Height (m): \");\n id.setHeight(input.nextFloat());\n\n System.out.println(\"Weight: \");\n id.setWeight(input.nextFloat());\n\n System.out.println(\"Gender M/F:\");\n id.setGender(input.next());\n\n System.out.println(\"Does it talk? Y/N: \");\n id.setTalk(input.next());\n\n //After we gathered all the data we need,\n // we can proceed with given that data back\n System.out.println(\"Now lets see what we can tell about \" + id.getName() + \":\");\n\n System.out.println(\"Name \" + id.getName());\n System.out.println(\"Gender \" +id.getGender());\n System.out.println(\"Age \" + id.getAge());\n System.out.println(\"Height\" + id.getHeight());\n System.out.println(\"Weight\" + id.getWeight());\n id.talking();\n id.complexion();\n\n\n\n\n\n\n\n }", "private void initializeData() {\n lblItem.setText(product.getName());\n txtReference.setText(product.getTransaction().getReferenceNumber());\n txtItem.setText(product.getName());\n txtDescription.setText(product.getDescription());\n txtBrand.setText(product.getBrand());\n txtModel.setText(product.getModel());\n txtQuantity.setText(String.valueOf(product.getQuantity()));\n txtUnit.setText(product.getUnit());\n txtProductDate.setDate(product.getProduct_date());\n txtOrigPrice.setText(String.valueOf(product.getOriginalPrice()));\n txtAgent.setText(product.getAgent());\n txtContactPerson.setText(product.getContactPerson());\n try { \n txtSupplier.setText(((Supplier)product.getSuppliers().toArray()[0]).getName());\n } catch(ArrayIndexOutOfBoundsException ex) {\n System.out.println(ex.toString());\n }\n }", "public static void main(String[] args){\n All_in_One<String> nama = new All_in_One<>();\r\n nama.setManusia(\"Wildan\");\r\n System.out.println(\"Nama Saya: \"+nama.getManusia());\r\n \r\n //Membuat Instance dan Mendefinisikan Tipe Data Integer\r\n All_in_One<Integer> umur = new All_in_One<>();\r\n umur.setManusia(19);\r\n System.out.println(\"Usia Saya: \"+umur.getManusia()+\" Tahun\");\r\n \r\n //Membuat Instance dan Mendefinisikan Tipe Data Boolean\r\n All_in_One<Boolean> kondisi = new All_in_One<>();\r\n kondisi.setManusia(true);\r\n System.out.println(\"Saya Sedang Belajar Java: \"+kondisi.getManusia());\r\n \r\n //Membuat Instance dan Mendefinisikan Tipe Data Float\r\n All_in_One<Float> IPK = new All_in_One<>();\r\n IPK.setManusia(3.5f);\r\n System.out.println(\"Nilai IPK Saya: \"+IPK.getManusia());\r\n \r\n //Membuat Instance dan Mendefinisikan Tipe Data Character\r\n All_in_One<Character> Karakter = new All_in_One<>();\r\n Karakter.setManusia('W');\r\n System.out.println(\"Huruf Awalan Nama Saya Adalah: \"+Karakter.getManusia());\r\n }", "public void startInfo() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Enter your name:\");\n\t\tString name = this.getInputString();\n\t\tSystem.out.println(\"Enter your mobile number:\");\n\t\tint number = this.getInputInteger();\n\t\tSystem.out.println(\"Enter your email:\");\n\t\tString email = this.getInputString();\n\t}", "private RandomData() {\n initFields();\n }", "void fillDatabase() {\n Type.type( \"FOOD\" );\n Type.type( \"HOT\" );\n Type.type( \"SNACK\" );\n }", "private void initData() {\n\t\tIntent intent = getIntent();\n\t\tjob = (Job) intent.getSerializableExtra(\"job\");\n\t\tedt_content.setText(job.getJobContent());\n\t\tedt_course.setText(job.getCourseName());\n\t}", "private void userInformation()\n {\n name = eName.getText().toString();\n userName = eUserName.getText().toString();\n email = eEmail.getText().toString();\n password = ePassword.getText().toString();\n password = encryptionAlgo.encryptPass(password);//initialize new encrypt password\n address = eAddress.getText().toString();\n favouriteWord = eFavourite.getText().toString();\n }", "private TigerData() {\n initFields();\n }", "public void dataView(String nom, String apell1, String apell2, String dni,\n String num, String inttype){\n\n System.out.println(\"Datos personales\");\n System.out.println(\"\");\n System.out.println(\"Nombre: \"+nom);\n System.out.println(\"Primer Apellido: \"+apell1);\n System.out.println(\"Segundo Apellido: \"+apell2);\n System.out.println(\"Dni: \"+dni);\n System.out.println(\"Numero de cuenta: \"+num);\n System.out.println(\"Tipo de interes: \"+inttype);\n System.out.println(\"\");\n}", "public void initData(){\r\n \r\n }", "public void setupUserInfo(Bundle upUserInfo) {\n // Getting Info\n String name = upUserInfo.getString(\"userName\");\n String email = upUserInfo.getString(\"userEmail\");\n\n\n // Setting local Variables\n this.tutorName = name;\n this.tutorEmail = email;\n\n TextView nameField = (TextView) findViewById(R.id.UserNameField);\n nameField.setText(name);\n\n\n }", "@Override\n\tprotected void initData() {\n\t\trequestUserInfo();\n\t}", "public void setDefaultData()\n\t\t{\n\t\t\t\n\t\t\t//Creating demo/default ADMIN:\n\t\t\t\n\t\t\tUser testAdmin = new User(\"ADMIN\", \"YAGYESH\", \"123\", 123, Long.parseLong(\"7976648278\"));\n\t\t\tdata.userMap.put(testAdmin.getUserId(), testAdmin);\n\t\t\t\n\t\t\t//Creating demo/default CUSTOMER:\n\t\t\tUser tempCustomer = new User(\"CUSTOMER\", \"JOHN\", \"124\", 124, Long.parseLong(\"9462346459\"));\n\t\t\tdata.userMap.put(tempCustomer.getUserId(), tempCustomer);\n\t\t\t\n\t\t\t//Creating Airports:\n\t\t\tAirport airport1 = new Airport(\"Mumbai Chattrapathi Shivaji International Airport\",\n\t\t\t\t\t\t\t\t\t\t\t\"MUMBAI\", \"BOM\");\n\t\t\t\n\t\t\tAirport airport2 = new Airport(\"Bangalore Bengaluru International Airport \",\n\t\t\t\t\t\t\t\t\t\t\t\"Bangalore\", \"BLR\");\n\t\t\t\n\t\t\tAirport airport3 = new Airport(\"New Delhi Indira Gandhi International Airport\",\n\t\t\t\t\t\t\t\t\t\t\t\"New Delhi \", \"DEL\");\n\n\t\t\tAirport airport4 = new Airport(\"Hyderabad Rajiv Gandhi International Airport\",\n\t\t\t\t\t\t\t\t\t\t\t\"Hyderabad\", \"HYD\");\n\n\t\t\tdata.airportMap.put(airport1.getAirportCode(), airport1);\n\t\t\tdata.airportMap.put(airport2.getAirportCode(), airport2);\n\t\t\tdata.airportMap.put(airport3.getAirportCode(), airport3);\n\t\t\tdata.airportMap.put(airport4.getAirportCode(), airport4);\n\t\t\t\n\t\t\t//Creating DateTime Objects:\n\t\t\t\n\t\t\tDate dateTime1 = null;\n\t\t\tDate dateTime2 = null;\n\t\t\tDate dateTime3 = null;\n\t\t\tDate dateTime4 = null;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tdateTime1 = dateFormat.parse(\"12-01-2020 05:12:00\");\n\t\t\t\tdateTime2 = dateFormat.parse(\"02-02-2020 23:45:00\");\n\t\t\t\tdateTime3 = dateFormat.parse(\"12-01-2020 07:12:00\");\n\t\t\t\tdateTime4 = dateFormat.parse(\"03-02-2020 01:45:00\");\n\t\t\t}\n\t\t\tcatch (ParseException e) \n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Creating Schedules:\n\t\t\tSchedule schedule1 = new Schedule(airport1, airport2, dateTime3, dateTime1, dateFormat);\n\t\t\tSchedule schedule2 = new Schedule(airport2, airport3, dateTime3, dateTime1, dateFormat);\n\t\t\tSchedule schedule3 = new Schedule(airport4, airport1, dateTime4, dateTime2, dateFormat);\n\t\t\tSchedule schedule4 = new Schedule(airport3, airport4, dateTime4, dateTime2, dateFormat);\n\t\t\t\n\t\t\t//Creating Flights:\n\t\t\tFlight flight1 = new Flight(\"AB3456\", \"INDIGO\", \"A330\", 293);\n\t\t\tFlight flight2 = new Flight(\"BO6789\", \"JET AIRWAYS\", \"777\", 440);\n\t\t\tdata.flightMap.put(flight1.getFlightNumber(), flight1);\n\t\t\tdata.flightMap.put(flight2.getFlightNumber(), flight2);\n\t\t\t\n\t\t\t//Creating Scheduled Flights:\n\t\t\tScheduledFlight scheduledFlight1 = new ScheduledFlight(flight1, 293, schedule1);\n\t\t\tScheduledFlight scheduledFlight2 = new ScheduledFlight(flight2, 440, schedule2);\n\t\t\tScheduledFlight scheduledFlight3 = new ScheduledFlight(flight1, 293, schedule3);\n\t\t\tScheduledFlight scheduledFlight4 = new ScheduledFlight(flight2, 440, schedule4);\n\t\t\t\n\t\t\t//Creating List of Scheduled Flights:\n\t\t\tdata.listScheduledFlights.add(scheduledFlight1);\n\t\t\tdata.listScheduledFlights.add(scheduledFlight2);\n\t\t\tdata.listScheduledFlights.add(scheduledFlight3);\n\t\t\tdata.listScheduledFlights.add(scheduledFlight4);\n\n\t\t}", "private void initData(){\n\n }", "private void fillConstructorFields() {\n constructorId.setText(\"\"+ constructorMutator.getConstructor().getConstructorId());\n constructorUrl.setText(\"\"+ constructorMutator.getConstructor().getConstructorUrl());\n constructorName.setText(\"\"+ constructorMutator.getConstructor().getConstructorName());\n constructorNationality.setText(\"\"+ constructorMutator.getConstructor().getNationality());\n teamLogo.setImage(constructorMutator.getConstructor().getTeamLogo().getImage());\n // Display Drivers that were from the JSON File\n constructorMutator.getConstructor().setBuffer(new StringBuffer());\n // Java 8 Streaming\n constructorMutator.getConstructorsList().stream().forEach(constructorList -> constructorMutator.getConstructor().toString(constructorList));\n }", "abstract public Object getUserData();", "private void getUserInput() {\n getUserTextInput();\n getUserPhotoChoice();\n getUserRoomChoice();\n getUserBedroomsChoice();\n getUserBathroomsChoice();\n getUserCoownerChoice();\n getUserIsSoldChoice();\n getUserTypeChoice();\n mAmenitiesInput = Utils.getUserAmenitiesChoice(mBinding.chipGroupAmenities.chipSchool,\n mBinding.chipGroupAmenities.chipShop, mBinding.chipGroupAmenities.chipTransport,\n mBinding.chipGroupAmenities.chipGarden);\n }", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void solicitarDatos() {\r\n System.out.println(\"Dime el nombre del cliente: \");\r\n this.setNombre(lector.nextLine());\r\n System.out.println(\"Dime el primer apellido: \");\r\n this.setPrimerApellido(lector.nextLine());\r\n System.out.println(\"Dime el segundo apellido: \");\r\n this.setSegundoApellido(lector.nextLine());\r\n System.out.println(\"Dime la edad: \");\r\n this.setEdad(lector.nextInt());\r\n }", "public void initData(Users user){\n \n this.selectedUser = user;\n String idValue = String.valueOf(selectedUser.getId());\n String expiresValue = String.valueOf(selectedUser.getExpires_at());\n String enabledValue = String.valueOf(selectedUser.getEnabled());\n String lastLoginValue = String.valueOf(selectedUser.getLast_login());\n email.setText(selectedUser.getEmail());\n password.setText(selectedUser.getPassword());\n role.setText(selectedUser.getRoles());\n idField.setText(idValue);\n expiresField.setText(expiresValue);\n enabledField.setText(enabledValue);\n lockedTextField.setText(lastLoginValue);\n lastLoginTextField.setText(idValue);\n System.out.println(user.toString());\n }", "protected void proccesValues() {\n Users user = new Users();\n user.setName(bean.getName());\n user.setSurname(bean.getSurname());\n user.setUsername(bean.getUsername());\n StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();\n String encryptedPassword = passwordEncryptor.encryptPassword(bean.getPassword());\n user.setPassword(encryptedPassword);\n \n usersService.persist(user);\n Notification.show(msgs.getMessage(INFO_REGISTERED), Notification.Type.ERROR_MESSAGE);\n resetValues();\n UI.getCurrent().getNavigator().navigateTo(ViewLogin.NAME);\n }", "public abstract void userValues();", "private void putDefaultInformation() throws FileNotFoundException, SQLException, IOException {\n staff_name = \"Sin informacion\";\n staff_surname = \"Sin informacion\";\n id_type = \"Sin informacion\";\n id_number = \"Sin informacion\";\n putProfPic(null);\n phone_number = \"Sin informacion\";\n mobile_number = \"Sin informacion\";\n email = \"Sin informacion\";\n birthdate = GBEnvironment.getInstance().serverDate();\n gender = \"Seleccione sexo\";\n }", "public Informations() {\n initComponents();\n \n Affichage();\n }", "public UserImplPart1(int studentId, String yourName, int yourAge,int yourSchoolYear, String yourNationality){\n this.studentId = studentId;\n this.name= yourName;\n this.age = yourAge; \n this.schoolYear= yourSchoolYear;\n this.nationality= yourNationality;\n}", "private void fillFields() {\n\t\tInteger owner = this.contractor.getOwner();\n\n\t\tnameField.setText(getTrimmedValue(this.contractor.getName()));\n\t\tlocationField.setText(getTrimmedValue(this.contractor.getLocation()));\n\t\townerField.setText(owner == null ? \"\" : owner.toString());\n\t\tsizeField.setText(contractor.getSize().toString());\n\t\trateField.setText(Contractor.RATE_FORMAT.format(this.contractor\n\t\t\t\t.getRate()));\n\t\tspecialtiesList.setListData(this.contractor.getSpecialties());\n\t}", "protected Member getMembersData() {\r\n String firstName = txtFieldFirstName.getText();\r\n String lastName = txtFieldLastName.getText();\r\n String dateOfBirth = txtFieldDateOfBirth.getText();\r\n String iban = txtFieldIBAN.getText();\r\n String entranceDate = txtFieldEntranceDate.getText();\r\n String leavingDate = txtFieldLeavingDate.getText();\r\n String disabilities = txtAreaDisabilities.getText();\r\n String notes = txtAreaNotes.getText();\r\n String sex = comBoxSexSelection.getItemAt(comBoxSexSelection.getSelectedIndex());\r\n int boardMember = (comBoxBoardMember.getItemAt(comBoxBoardMember.getSelectedIndex()) == \"Ja\") ? 1 : 0;\r\n\r\n Member member = new Member.Builder()\r\n .firstName(firstName)\r\n .lastName(lastName)\r\n .dateOfBirth(dateOfBirth)\r\n .iban(iban)\r\n .sex(sex)\r\n .disabilities(disabilities)\r\n .boardMember(boardMember)\r\n .entranceDate(entranceDate)\r\n .leavingDate(leavingDate)\r\n .notes(notes)\r\n .build();\r\n\r\n return member;\r\n }", "@Override\r\n\tpublic void setInfo(Object datos) {\n\t\t\r\n\t}", "private void initData() {\n\n }", "abstract void initializeNeededData();", "private void fillInCurrentStudentInfo() {\n // Extract info from Student object\n String name = WordUtils.capitalizeFully(mCurrentStudent.getName());\n int sex = mCurrentStudent.getSex();\n mStudentBirthdate = mCurrentStudent.getBirthdate();\n int grade = mCurrentStudent.getGrade();\n mChosenClassesList = (ArrayList<String>) mCurrentStudent.getClasses();\n String classes = TextUtils.join(\", \", mChosenClassesList);\n String photoUrl = mCurrentStudent.getPhotoUrl();\n\n // Populate views with the current student's information\n mStudentNameEditText.setText(name);\n mStudentBirthdateTextView.setText(DateUtils.convertDateLongToString(mStudentBirthdate));\n mStudentGradeEditText.setText(String.valueOf(grade));\n mStudentClassesTextView.setText(classes);\n mStudentClassesTextView.setVisibility(View.VISIBLE);\n\n // Set student photo (if it exists)\n if (!TextUtils.isEmpty(photoUrl)) {\n Glide.with(mAddPhotoView.getContext())\n .load(photoUrl)\n .into(mAddPhotoView);\n studentHasPhoto = true;\n }\n\n // Set student sex spinner\n switch (sex) {\n case SEX_MALE_INT:\n mStudentSexSpinner.setSelection(SEX_MALE_INT);\n break;\n case SEX_FEMALE_INT:\n mStudentSexSpinner.setSelection(SEX_FEMALE_INT);\n break;\n default:\n throw new IllegalArgumentException(\"Invalid sex\");\n }\n }", "void populateFrom(Person r) {\n // nombre.setText(r.mail1);\n // apellido.setText(r.apellido1);\n usu.setText(r.nom_usuario1);\n // mail.setText(r.mail1);\n }", "public void set_info() {\n System.out.println(\"The name of the donor is \" + donor_name);\n System.out.println(\"The rating of the donor is \" + donor_rating); //display\n }", "private FundInfo() {\n initFields();\n }", "private void Initialized_Data() {\n\t\t\r\n\t}", "private void InitData() {\n\t}", "Object getUserData();", "private void populateForm() {\n Part selectedPart = (Part) PassableData.getPartData();\n partPrice.setText(String.valueOf(selectedPart.getPrice()));\n partName.setText(selectedPart.getName());\n inventoryCount.setText(String.valueOf(selectedPart.getStock()));\n partId.setText(String.valueOf(selectedPart.getId()));\n maximumInventory.setText(String.valueOf(selectedPart.getMax()));\n minimumInventory.setText(String.valueOf(selectedPart.getMin()));\n\n if (PassableData.isOutsourced()) {\n Outsourced part = (Outsourced) selectedPart;\n variableTextField.setText(part.getCompanyName());\n outsourced.setSelected(true);\n\n } else if (!PassableData.isOutsourced()) {\n InHouse part = (InHouse) selectedPart;\n variableTextField.setText(String.valueOf(part.getMachineId()));\n inHouse.setSelected(true);\n }\n\n\n }", "public void setUserData(Object data);", "private void callFormDetailFunctions() {\n ArrayList<Item> items = new ArrayList<>();\n items.addAll(computers);\n items.addAll(printers);\n getBuildingNames(items);\n getBrandNames(items);\n getOSNames(computers);\n setAdapters();\n }", "public void readuserData() {\n\t\t\tSystem.out.println(\"Welcome to the BMI calculator, enter 1 for imperial or 2 for Metric \");\n\t\t\t\n\t\t}", "public Object getUserData();", "public static void main(String[] args) {\n\r\n clsAlumno alumno1 = new clsAlumno();\r\n\r\n alumno1.setNombre(\"Eneko\");\r\n\r\n alumno1.setApellido(\"Galdos\");\r\n\r\n alumno1.setDNI(\"72826873H\");\r\n\r\n alumno1.setCreditos(60);\r\n\r\n alumno1.mostrarPersona();\r\n\r\n alumno1.mostrarCreditos();\r\n\r\n System.out.println();\r\n\r\n clsProfesor profesor1 = new clsProfesor();\r\n\r\n profesor1.setNombre(\"Javier\");\r\n\r\n profesor1.setApellido(\"Cerro\");\r\n\r\n profesor1.setDNI(\"11111111A\");\r\n\r\n profesor1.setDepartamento(\"Informática\");\r\n\r\n profesor1.mostrarPersona();\r\n\r\n profesor1.mostrarDepartamento();\r\n\r\n }", "public Citizen(){\n fullName = \"\";\n email = \"\";\n address = \"\";\n age = 0;\n district = 0;\n resident = false;\n gender = 'M';\n }", "public void read() {\r\n\t\tJTextField txtCustomerNo = new JTextField();\r\n\t\ttxtCustomerNo.setText(\"\" + this.getCustomerNo());\r\n\t\tJTextField txtTitle = new JTextField();\r\n\t\ttxtTitle.requestFocus();\r\n\t\tJTextField txtFirstName = new JTextField();\r\n\t\tJTextField txtSurname = new JTextField();\r\n\t\tJTextField txtAddress = new JTextField();\r\n\t\tJTextField txtPhoneNo = new JTextField();\r\n\t\tJTextField txtEmail = new JTextField();\r\n\r\n\t\t\r\n\t\tObject[] message = { \"Customer Number:\", txtCustomerNo, \"Title:\", txtTitle, \"First Name:\", txtFirstName,\r\n\t\t\t\t\"Surname:\", txtSurname, \"Address:\", txtAddress, \"Phone Number:\", txtPhoneNo, \"Email:\", txtEmail, };\r\n\t\t\r\n\r\n\t\tint option = JOptionPane.showConfirmDialog(null, message, \"Enter customer details\",\r\n\t\t\t\tJOptionPane.OK_CANCEL_OPTION);\r\n\t\t\r\n\t\tName txtName = new Name(txtTitle.getText(), txtFirstName.getText(), txtSurname.getText());\r\n\r\n\t\tif (option == JOptionPane.OK_OPTION) {\r\n\t\t\tthis.name = txtName;\r\n\t\t\tthis.address = txtAddress.getText();\r\n\t\t\tthis.phoneNo = txtPhoneNo.getText();\r\n\t\t\tthis.emailAddress = txtEmail.getText();\r\n\t\t}\r\n\t}", "void printData()\n {\n System.out.println(\"Studentname=\" +name);\n System.out.println(\"Student city =\"+city);\n System.out.println(\"Student age = \"+age);\n }", "private void initData() {\n }", "public void inputItemDetails()\r\n\t{\r\n\t\tserialNum = inputValidSerialNum();\r\n\t\tweight = inputValidWeight();\r\n\t}", "private void initialData() {\n\n// if (MorphiaObject.datastore.createQuery(SecurityRole.class).countAll() == 0) {\n// for (final String roleName : Arrays\n// .asList(controllers.Application.USER_ROLE)) {\n// final SecurityRole role = new SecurityRole();\n// role.roleName = roleName;\n// MorphiaObject.datastore.save(role);\n// }\n// }\n }", "public ingresarDatos() {\n initComponents();\n Validacion();\n \n }", "PassengerPersonalInfo(String First_Name, String Last_Name, int Age, Date dob, \n String Address, String Nationality, long Number, String eID) { \n this.firstName = First_Name;\n this.lastName = Last_Name;\n this.age = Age;\n this.dateOfBirth = dob;\n this.address = Address;\n this.nationality = Nationality;\n this.contact = Number;\n this.email = eID;\n }", "public void populateUserDetails() {\n\n this.enterprise = system.getOpRegionDirectory().getOperationalRegionList()\n .stream().filter(op -> op.getRegionId() == user.getNetworkId())\n .findFirst()\n .get()\n .getBuDir()\n .getBusinessUnitList()\n .stream()\n .filter(bu -> bu.getUnitType() == BusinessUnitType.CHEMICAL)\n .map(unit -> (ChemicalManufacturingBusiness) unit)\n .filter(chemBusiness -> chemBusiness.getEnterpriseId() == user.getEnterpriseId())\n .findFirst()\n .get();\n\n this.organization = (ChemicalManufacturer) enterprise\n .getOrganizationList().stream()\n .filter(o -> o.getOrgId() == user.getOrganizationId())\n .findFirst()\n .get();\n\n }", "String askForData();", "private void setFields() {\n\t\tfirstname.setText(guest.getFirstName());\n\t\tlastname.setText(guest.getLastName());\n\t\tpassport.setText(guest.getPassportNumber());\n\t\ttelephone.setText(guest.getTelephoneNumber());\n\t\tarrival.setText(arrivalDate.toString());\n\t\tdeparture.setText(departureDate.toString());\n\n\t\tif (hotelChoice.getName() != null && hotelChoice.getName() != \"\"\n\t\t\t\t&& !(hotelChoice.getName() == Controller.DEFAULT_HOTEL_CHOICE)) {\n\t\t\thotel.setText(hotelChoice.getName());\n\t\t} else {\n\t\t\thotelChoice = new Hotel();\n\t\t\thotelChoice.setName(\"\");\n\t\t\thotel.clear();\n\t\t}\n\t\tif (roomQualityChoice.getQuality() != null && roomQualityChoice.getQuality() != \"\"\n\t\t\t\t&& !(roomQualityChoice.getQuality() == Controller.DEFAULT_QUALITY_CHOICE)) {\n\t\t\tquality.setText(roomQualityChoice.getQuality());\n\t\t} else {\n\t\t\troomQualityChoice = new RoomQuality();\n\t\t\troomQualityChoice.setQuality(\"\");\n\t\t\tquality.clear();\n\t\t}\n\t\tif (discountChoice > 0) {\n\t\t\tdiscount.setText(\"(-\" + discountChoice + \"%)\");\n\t\t}\n\n\t\tloadAvailableRooms();\n\n\t}", "private void setData() {\n populateInterfaceElements();\n }", "@Override\n protected Object[] getData() {\n return new Object[] { creator };\n }", "public Data() {\n initComponents();\n getData();\n }", "public AdminData() {\n initComponents();\n TampilData();\n }", "private void loadUserData() {\n\t\tuserData = new UserData();\n }", "public static void main(String[] args) {\n Alumnos a = new Alumnos(\"3457794\",\"IDS\",\"A\",3,\"Juan\",\"Masculino\",158);\n //recibe: String folio,String nombre, String sexo, int edad\n Profesores p = new Profesores(\"SDW7984\",\"Dr. Pimentel\",\"Masculino\",25);\n \n //recibe: String puesto,String nombre, String sexo, int edad\n Administrativos ad = new Administrativos(\"Rectoria\",\"Jesica\",\"Femenino\",25);\n \n //datos de alumnos//\n System.out.println(\"\\nEl alumno tiene los siguientes datos:\");\n System.out.println(a.GetName());\n System.out.println(a.GetEdad());\n System.out.println(a.getCarrera());\n \n //datos de maestro//\n System.out.println(\"\\nLos datos de x maestro es:\");\n System.out.println(p.GetName());\n System.out.println(p.getFolio());\n System.out.println(p.GetEdad());\n \n //daros de Administrativo//\n System.out.println(\"\\nLos datos de x Administrativo\");\n System.out.println(ad.GetName());\n System.out.println(ad.getPuesto());\n System.out.println(ad.GetEdad());\n \n \n System.out.println(\"\\n\\nIntegranres de Equipo\");\n System.out.println(\"Kevin Serrano - 133369\");\n System.out.println(\"Luis Angel Farelo Toledo - 143404\");\n System.out.println(\"Ericel Nucamendi Jose - 133407\");\n System.out.println(\"Javier de Jesus Flores Herrera - 143372\");\n System.out.println(\"Carlos Alejandro Zenteno Robles - 143382\");\n }", "public mainData() {\n }", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private void mostrarInformacionP(){\n System.out.println(\"Nombre: \"+this.nombre);\n System.out.println(\"Sexo: \"+ this.sexo);\n System.out.println(\"Edad: \" + edad);\n\n }", "Information createInformation();", "public static void main(String[] args) {\n\t\tAuthor ar = new Author();\r\n\t\tBookdetails bk = new Bookdetails();\r\n\t\tbk.setName(\"Revolution 2020\");\r\n\t\tbk.setPrice(1000);\r\n\t\tbk.setQtyinstack(250);\r\n\t\tar.setName(\"Chetan Bhagat\");\r\n\t\tar.setEmail(\"chetanbhagat77@gmail.com\");\r\n\t\tar.setGender('m');\r\n\t\tSystem.out.println(bk.getName()+\" \"+bk.getPrice()+\" \"+bk.getQtyinstack());\r\n\t\tSystem.out.println(ar.getName()+\" \"+ar.getEmail()+\" \"+ar.getGender()); \r\n}", "CreationData creationData();", "public UserData(String firstName, String lastName, String patronymic, String email, String phone, int userId) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.patronymic = patronymic;\n this.email = email;\n this.phone = phone;\n this.userId = userId;\n }", "public dataPegawai() {\n initComponents();\n koneksiDatabase();\n tampilGolongan();\n tampilDepartemen();\n tampilJabatan();\n Baru();\n }", "public InitialData(){}", "private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }" ]
[ "0.69548887", "0.66997707", "0.6599396", "0.6478917", "0.646835", "0.6458576", "0.6441204", "0.6437024", "0.63850504", "0.63779986", "0.6314687", "0.6313453", "0.62759", "0.626959", "0.6256334", "0.62404823", "0.62312996", "0.6218703", "0.6217265", "0.6208569", "0.61807966", "0.61751425", "0.61524427", "0.61500716", "0.6149854", "0.61405045", "0.6137594", "0.6132746", "0.61211884", "0.6110444", "0.60954756", "0.60914063", "0.6042351", "0.60305697", "0.60019416", "0.59811306", "0.5980578", "0.59749776", "0.5972533", "0.59708947", "0.5964379", "0.5963511", "0.5957918", "0.5957187", "0.59567195", "0.5945225", "0.5939306", "0.5933488", "0.59266335", "0.5926039", "0.5925652", "0.5920186", "0.5909148", "0.59044635", "0.58929586", "0.5883339", "0.58721435", "0.58590883", "0.58516544", "0.5836256", "0.5819518", "0.5814995", "0.5812031", "0.5806379", "0.5805893", "0.5804237", "0.57918", "0.57901573", "0.57880116", "0.57842463", "0.5783789", "0.57801735", "0.5775054", "0.57700837", "0.57696986", "0.5764392", "0.57627445", "0.5759828", "0.5753843", "0.57529527", "0.57482404", "0.57458216", "0.57431746", "0.5742231", "0.57420343", "0.57395786", "0.57377565", "0.57377565", "0.57377565", "0.57377565", "0.57377565", "0.57377565", "0.57371426", "0.5735725", "0.5733186", "0.5729977", "0.57283735", "0.57225084", "0.571437", "0.57133055" ]
0.59820443
35
Constructor for the map
public PlainsArea(MapManager manager) { super(MAPNAME, false); this.manager = manager; // manager for loading maps this.creator = B2WorldCreator.getInstance(); // for creating the game's physics this.setMusic(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map() {\n\n\t\t}", "protected MapImpl() {\n }", "public Map() {\n\t\t//intially empty\n\t}", "public MyHashMap() {\n\n }", "public FMap(String rute) {\n super(rute);\n init(rute);\n }", "public AttributeMap()\r\n\t{\r\n\t\tsuper();\r\n\t}", "public MapBuilder() {\r\n map = new Map();\r\n json = new Gson();\r\n }", "public MapTile() {}", "public OwnMap() {\n super();\n keySet = new OwnSet();\n }", "public IntMap()\r\n {\r\n this(16);\r\n }", "protected WumpusMap() {\n\t\t\n\t}", "public MyHashMap() {\n\n }", "public MyHashMap() {\n map = new HashMap();\n }", "public MapOther() {\n }", "public TimeMap2() {\n map = new HashMap<>();\n }", "public StrStrMap() {\n }", "public ConnectedMap() {\n }", "public ArrayMap() {\n this(DEFAULT_INITIAL_CAPACITY);\n }", "public MapNode(\n\t\tAbstractNode\tparent)\n\t{\n\t\t// Call superclass constructor\n\t\tsuper(parent);\n\n\t\t// Initialise instance variables\n\t\tpairs = new LinkedHashMap<>();\n\t}", "public MapNode()\n\t{\n\t\t// Call alternative constructor\n\t\tthis((AbstractNode)null);\n\t}", "public FactoryMapImpl()\n {\n super();\n }", "public HashEntityMap()\n\t\t{\n\t\t\tmapNameToValue = new HashMap<String, Integer>();\n\t\t}", "public Map(PApplet p, String id) {\n \t\tthis(p, id, 0, 0, p.width, p.height, false, false, null);\n \t}", "public MyHashMap() {\n\t\tthis(INIT_CAPACITY);\n\t}", "public Map(){\n this.matrix = new int[10][10];\n }", "private Map(int id) {\n\t\tthis.id = Integer.valueOf(id);\n\t\tSystem.out.println(\"Initializing map: \" + this.toString() + \" (\" + this.id + \")\");\n\t}", "public ArrayHashMap() {\n super();\n }", "private MapTransformer(Map map) {\n super();\n iMap = map;\n }", "public CountingMap() {\n this( new HashMap<K, Integer>() );\n }", "public CjtMap(){\r\n cjtMap = new TreeMap();\r\n sequence = new Sequence(1, 0, 1, false);\r\n }", "public ObservableHashMap()\n {\n super();\n }", "public Map(){\r\n map = new Square[0][0];\r\n }", "public Model() {\n\t\tthis.map = new Map(37, 23);\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashMap()\r\n\t{\r\n\t\ttable = new MapEntry[7];\r\n\t\tcount = 0;\r\n\t\tmaxCount = table.length - table.length/3;\r\n\t\tDUMMY = new MapEntry<>(null, null);\r\n\t}", "public MapGraphExtra()\n\t{\n\t\t// TODO: Implement in this constructor in WEEK 3\n\t\tmap = new HashMap<GeographicPoint, MapNode> ();\n\t}", "public HashMap(){\n\t\tthis.numOfBins=10;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "public TimeMap() {\n\n }", "public QuadGramMap()\n\t{\n\t\tsuper();\n\t}", "public RadarMap() {\n initComponents();\n }", "public MagicDictionary() {\n this.map = new HashMap<>();\n }", "public MapNatural() {\n }", "public TimeMap() {\n timeMap = new HashMap<>();\n }", "public EncodingMap() {}", "public MyHashMap() {\n keys = new MapNode[n];\n vals = new MapNode[n];\n for (int i=0; i < n ; ++i) {\n keys[i] = new MapNode();\n vals[i] = new MapNode();\n }\n }", "public MKMapView() {}", "public MapEntity() {\n\t}", "public MapContainer() {\n this(new OpenStreetMapProvider());\n }", "public Map(int x, int y) {\n\n height_ = y;\n width_ = x;\n\n map_grid_ = new MapTile[height_][width_];\n for (int i = 0; i < height_; ++i) {\n for (int j = 0; j < width_; ++j) {\n map_grid_[i][j] = new MapTile(j, i); //switch rows and columns\n }\n }\n entity_list_ = new LinkedHashMap<String, Entity>();\n items_list_ = new LinkedList<Item>();\n time_measured_in_turns = 0;\n try {\n my_internet_ = new MapInternet(this);\n } catch (Exception e) {\n // No clue what causes this\n e.printStackTrace();\n System.exit(-6);\n return;\n }\n }", "public MapToken() {\n\t\tmData = new FastMap<String, Object>();\n\t}", "public MyHashMap() {\n map = new ArrayList<>();\n for (int i = 0;i<255;i++)\n map.add(new Entry());\n }", "MAP createMAP();", "public JSONNode() {\n map = new HashMap<>();\n }", "public TimeMap() {\n hashMap = new HashMap<String, List<Data>>();\n }", "public Map initMap(){\n\t\tif (map == null){\n\t\t\tmap = createMap();\n\t\t}\n\t\treturn map;\n\t}", "public Mapping() { this(null); }", "public Q706DesignHashMap() {\n keys = new ArrayList<>();\n values = new ArrayList<>();\n\n }", "protected MapElement(long key) {\r\n super(key);\r\n }", "public OmaHashMap() {\n this.values = new OmaLista[32];\n this.numberOfValues = 0;\n }", "public MyHashMap() {\r\n data = new Node[DEFAULT_CAPACITY];\r\n }", "public MapResult() {\n }", "public OwnMap(int capacity) {\n super(capacity);\n keySet = new OwnSet();\n }", "public mapper3c() { super(); }", "public MapCalculator(ZanMinimap minimap) {\n \t\tmap = minimap.map;\n \t}", "public Map(String level) {\n this.level = level;\n terrains = new String[]{\"r\", \"p\", \"m1\", \"m2\", \"m3\"};\n\n //if default random\n if (level.equals(\"default\")) {\n String[] defaultLevel = {\n \"p\", \"p\", \"m1\", \"p\", \"r\", \"p\", \"m3\", \"p\", \"p\",\n \"p\", \"m1\", \"p\", \"p\", \"r\", \"p\", \"p\", \"p\", \"m3\",\n \"m3\", \"p\", \"p\", \"p\", \"t\", \"p\", \"p\", \"p\", \"m1\",\n \"p\", \"m2\", \"p\", \"p\", \"r\", \"p\", \"m2\", \"p\", \"p\",\n \"p\", \"p\", \"m2\", \"p\", \"r\", \"p\", \"p\", \"p\", \"m2\"};\n int j = 0;\n for (int i = 0; i < tiles.length; i++) {\n for (int k = 0; k < tiles[0].length; k++, j++) {\n tiles[i][k] = new Tile(i, k, defaultLevel[j]);\n }\n }\n }\n\n // if random level\n if (level.equals(\"random\")) {\n for (int i = 0; i < tiles.length; i++) {\n for (int k = 0; k < tiles[0].length; k++) {\n String ter = terrains[(int) (Math.random() * (terrains.length - 1))];\n tiles[i][k] = new Tile(i, k, ter);\n }\n }\n tiles[2][4] = new Tile(2, 4, \"t\");\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashTableMap() {\r\n\t\tK = new LinkedList[10];\r\n\t\tV = new LinkedList[10];\r\n\t}", "public MapSum() {\n\n }", "public CitiesMap(){\r\n\t\tmap=new Graph<City>();\r\n\t}", "public MapElement(int key) {\n this.key = key;\n }", "public CharCharMap() {\n this(DEFAULT_INITIAL_SIZE, DEFAULT_LOAD_FACTOR);\n }", "public RbTreeMap() {\n super();\n }", "public TurtleMapDescriptor() {}", "public CompactHashMap() {\n\t\tthis(INITIAL_SIZE);\n\t}", "private Map(Builder builder) {\n super(builder);\n }", "public MapTest(String name) {\n\t\tsuper(name);\n\t}", "@SuppressWarnings(\"static-access\")\n\tpublic SequenceMap() {\n\t\tthis.seqNumbers = new HashMap<>();\n\t}", "public MyHashMap() {\n hashMap = new ArrayList<>();\n }", "public ScopedMap() {\n\t\tmap = new ArrayList<HashMap<K, V>>();\n\n\t}", "public StandardValues() {\n super(ForwardingMap.this);\n }", "public MapSum() {\n map = new HashMap<>();\n }", "public Map(Tile[][] tiles) {\n terrains = new String[]{\"r\", \"p\", \"m1\", \"m2\", \"m3\"};\n this.tiles = tiles;\n }", "public MagicDictionary() {\n\n }", "public Map(Dimension dim){\r\n\t\tthis.dim = dim;\r\n\t\tinitiateMap();\r\n\t\tcreateWorldMap();\r\n\t}", "public abstract void createMap();", "@SuppressWarnings(\"unused\")\n private MyPropertiesMapEntry() {\n this.key = null;\n this.value = null;\n }", "public MapController() {\r\n\t}", "public Map(Config config) {\n this.mapCells = new Cell[100][100];\n this.cellGrid= new Cell[20][20][20];\n this.config = config;\n this.origin = config.getOrigin();\n generateMap();\n }", "public TreeDictionary() {\n\t\t\n\t}", "public BSTMap() {\n root = null;\n size = 0;\n }", "public AbstractIntHashMap() {\n this(DEFAULT_CAPACITY, DEFAULT_LOADFACTOR);\n }", "public AgentBuilderDictionary(Map m) {\n\t\tsuper(m);\n\t}", "public InstanceLabelMapTable() {\n\t\tthis(\"instance_label_map\", null);\n\t}", "public FractalMapImpl() {\n this.shift = 0;\n }", "public Twitter() {\n map = new HashMap<>();\n }", "public Map(int size_pixels, double size_meters) {\n this.init(size_pixels, size_meters);\n\n // for public accessor\n this.size_meters = size_meters;\n }", "public MagicDictionary() {\n root=new Node();\n }", "public mapper3c(Integer theKey, String theValue) { super(theKey, theValue); }", "private SimpleMap(Builder builder) {\n super(builder);\n }", "public AutoIndexMap()\n\t\t{\n\t\t\t// Initialise instance variables\n\t\t\tindices = new IdentityHashMap<>();\n\t\t}", "public MapGenerator(GameMap map) {\n\n gameMap = map;\n setGuiHashMap();\n firstCountryFlag=true;\n validator = new MapValidator(gameMap);\n }", "public MapNode(\n\t\tMap<String, AbstractNode>\tpairs)\n\t{\n\t\t// Call alternative constructor\n\t\tthis(null, pairs);\n\t}", "@SuppressWarnings(\"unused\")\n private Map() {\n height_ = 0;\n width_ = 0;\n System.exit(-777);\n }" ]
[ "0.8544793", "0.7768412", "0.77071035", "0.76772", "0.7550663", "0.7499375", "0.7468191", "0.7414694", "0.74051243", "0.7374863", "0.7350588", "0.7324474", "0.73076886", "0.72861236", "0.72840947", "0.72782135", "0.7273606", "0.7254819", "0.7238765", "0.72239524", "0.7217734", "0.72113717", "0.72022873", "0.7192294", "0.71647537", "0.71587026", "0.7158475", "0.7156816", "0.71559215", "0.71475136", "0.71313286", "0.71192324", "0.7103268", "0.7098115", "0.7083033", "0.70763636", "0.7066123", "0.70545053", "0.70239204", "0.6975399", "0.6955899", "0.69542956", "0.69422996", "0.6920637", "0.69155794", "0.6904417", "0.6875451", "0.68572086", "0.6849885", "0.6831004", "0.6830919", "0.681555", "0.68133485", "0.68120337", "0.6790547", "0.6786075", "0.6783275", "0.6751504", "0.6740239", "0.67399424", "0.6718342", "0.67169964", "0.6711398", "0.67087215", "0.67048234", "0.66974634", "0.6693157", "0.6689363", "0.66848797", "0.66831326", "0.6683071", "0.6681175", "0.6670524", "0.6652124", "0.6649297", "0.66269636", "0.6616068", "0.6608756", "0.6602656", "0.6598813", "0.6593204", "0.6589819", "0.6584137", "0.6574681", "0.65719974", "0.6559447", "0.6557135", "0.65527534", "0.6551055", "0.65492177", "0.65467006", "0.65440196", "0.6540283", "0.65399903", "0.6523182", "0.6520688", "0.65178484", "0.65131575", "0.65107775", "0.65043414", "0.65006274" ]
0.0
-1
Generate the world for the game's physics.
@Override public void generateWorld(World world) { // create the static non-moving bodies this.creator.createWorld(world, this, COLLISIONLAYERS); // create the transition areas this.creator.createTransition(world, this, NORTHTRANSITION, NORTH); this.creator.createTransition(world, this, SOUTHTRANSITION, SOUTH); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void generateWorld() {\n\t\t// Loop through all block locations where a block needs to be generated\n\t\tfor(int x=0; x<WORLD_SIZE; x++) {\n\t\t\tfor(int z=0; z<WORLD_SIZE; z++) {\n\t\t\t\tfor(int y=0; y<WORLD_HEIGHT/2; y++) {\n\t\t\t\t\tsetBlockAt(x, y, z, BlockType.STONE);\n\t\t\t\t\tif(y > (WORLD_HEIGHT/2) - 5)\n\t\t\t\t\t\tsetBlockAt(x, y, z, BlockType.DIRT);\n\t\t\t\t\tif(y == (WORLD_HEIGHT/2) -1)\n\t\t\t\t\t\tsetBlockAt(x, y, z, BlockType.GRASS);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Generate NUM_DIAMONDS of diamonds in random locations\n\t\tfor(int i=0; i<NUM_DIAMONDS; i++)\n\t\t\tsetBlockAt(getRandomLocation(), BlockType.DIAMOND);\t\n\t}", "public World makeWorld() {\n World world = new World(1000, 1000);\n world.createEntity().addComponent(new CursorComponent());\n \n ProjectileSystem projectileSystem = new ProjectileSystem();\n world.addSystem(projectileSystem, 1);\n \n return world;\n }", "public World() {\n\t\tblockIDArray = new byte[WORLD_SIZE][WORLD_HEIGHT][WORLD_SIZE];\n\t\tentities\t = new ArrayList<Entity>();\n\t\trand\t\t = new Random();\n\t\t\n new GravityThread(this);\n\t\t\t\t\n\t\tgenerateWorld();\n\t}", "protected void setupPhysicsWorld() {\n\t\tfloat mass = 1.0f;\n\t\tfloat up[] = { 0.0f, 1.0f, 0.0f };\n\t\tdouble[] transform;\n\n\t\ttransform = toDoubleArray(dolphinNodeOne.getLocalTransform().toFloatArray());\n\t\tdolphinOnePhysicsObject = physicsEngine.addCapsuleObject(physicsEngine.nextUID(), mass, transform, 0.3f, 1.0f);\n\n\t\tdolphinOnePhysicsObject.setBounciness(0.0f);\n\t\tdolphinOnePhysicsObject.setFriction(0.0f);\n\t\tdolphinOnePhysicsObject.setDamping(0.99f, 0.99f);\n\t\tdolphinOnePhysicsObject.setSleepThresholds(0.0f, 0.0f);\n\t\tdolphinNodeOne.setPhysicsObject(dolphinOnePhysicsObject);\n\n\t\ttransform = toDoubleArray(groundNode.getLocalTransform().toFloatArray());\n\t\tgroundPlane = physicsEngine.addStaticPlaneObject(physicsEngine.nextUID(), transform, up, 0.0f);\n\n\t\tgroundPlane.setBounciness(0.0f);\n\n\t\tdouble[] planeTransform = groundPlane.getTransform();\n\t\tplaneTransform[12] = groundNode.getLocalPosition().x();\n\t\tplaneTransform[13] = groundNode.getLocalPosition().y();\n\t\tplaneTransform[14] = groundNode.getLocalPosition().z();\n\t\tgroundPlane.setTransform(planeTransform);\n\t\tgroundNode.setPhysicsObject(groundPlane);\n\n\t\tfor (int i = 0; i < npcEntity.length; i++) {\n\t\t\tdouble[] transformNPC = toDoubleArray(npcEntity[i].getNode().getLocalTransform().toFloatArray());\n\t\t\tPhysicsObject npcPhysicObject = physicsEngine.addCapsuleObject(physicsEngine.nextUID(), mass, transformNPC,\n\t\t\t\t\t0.3f, 1.0f);\n\t\t\tnpcPhysicObject.setBounciness(0.0f);\n\t\t\tnpcPhysicObject.setFriction(0.0f);\n\t\t\tnpcPhysicObject.setDamping(0.99f, 0.99f);\n\t\t\tnpcPhysicObject.setSleepThresholds(0.0f, 0.0f);\n\t\t\tnpcEntity[i].getNode().setPhysicsObject(npcPhysicObject);\n\t\t\tnpcEntity[i].setPhysicObject(npcPhysicObject);\n\t\t\tnpcPhysicsObjects[i] = npcEntity[i].getPhysicObject();\n\t\t}\n\t}", "public void buildWorld() {\n buildBoundaryWall();\n buildDiscreteWorld();\n removeBoundaryWall();\n reorganizeNote();\n connectWorld();\n buildWall();\n }", "private void createWorld() {\n world = new World();\n world.setEventDeliverySystem(new BasicEventDeliverySystem());\n //world.setSystem(new MovementSystem());\n world.setSystem(new ResetPositionSystem());\n world.setSystem(new RenderingSystem(camera, Color.WHITE));\n\n InputSystem inputSystem = new InputSystem();\n InputMultiplexer inputMultiplexer = new InputMultiplexer();\n inputMultiplexer.addProcessor(inputSystem);\n inputMultiplexer.addProcessor(new GestureDetector(inputSystem));\n Gdx.input.setInputProcessor(inputMultiplexer);\n world.setSystem(inputSystem);\n world.setSystem(new MoveCameraSystem(camera));\n\n world.initialize();\n }", "WorldGenerator getForWorld(World world);", "World getWorld();", "private static WorldDescription createWorld() {\r\n \t\tWorldDescription world = new WorldDescription();\t \r\n \t\tworld.setPlaneSize(100);\t\t\r\n \t \tObstacleGenerator generator = new ObstacleGenerator();\r\n \t generator.obstacalize(obstacleType, world); // activate to add obstacles\r\n \t // world.setPlaneTexture(WorldDescription.WHITE_GRID_TEXTURE);\r\n \t\treturn world;\r\n \t}", "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 SimulationWorld( SimulationEngine engine )\n {\n this.engine = engine;\n this.gravity = new Vector3f( 0f, -9.81f, 0f );\n }", "public World()\n\t{\n\t\tinitWorld();\t\n\t}", "public void createWorld(){\n\n }", "public void generate() {\n currentlyGenerating = true;\n Bukkit.broadcastMessage(ChatColor.GREEN + \"The world generation process has been started!\");\n createUhcWorld();\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 GameData getWorld() {\r\n return world;\r\n }", "public abstract World create(World world);", "public World (){\n\t\tpattern = new ShapePattern (PATTERN_SIZE);\n\t\tscroll = new ShapeScroll (SCROLL_SIZE);\n\t}", "public static World getWorld() {\n\t\treturn world;\n\t}", "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 }", "private static void generateWorld(){\n for(int i = 0; i < SIZE*SIZE; i++){\n new Chunk();\n }\n }", "private void buildWorld() {\r\n\t\tremoveAll();\r\n\t\tintro = null;\r\n\t\tfacingEast = true;\r\n\t\t\r\n\t\taddLevels();\r\n\t\taddCharacters();\r\n\t\taddLifeDisplay();\r\n\t}", "private IWorld worldCreator(){\n if (gameWorld == GameWorld.NORMAL) return\n new Normal();\n else return\n new Nether();\n }", "public World getWorld();", "void postGen(World world, int x, int y, int z);", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1000, 600, 1);\n planets();\n stars();\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 World getWorld() {\n return world;\n }", "public World getWorld() {\n return world;\n }", "public GameWorld(){\r\n\t\t\r\n\t}", "public World getWorld () {\n\t\treturn world;\n\t}", "public WiuWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1xpixels.\n super(WIDTH_WORLD, HEIGHT_WORLD, 1); \n }", "public WaterWorld()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(600, 400, 1); \r\n populateWorld();\r\n }", "@Override\n\tpublic World getWorld() { return world; }", "private GameWorld getGameWorld(){\n\t\tHashMap<String, Location> locations = new HashMap<String, Location>();\n\t\tHashMap<Avatar, Location> avatarLocations = new HashMap<Avatar, Location>();\n\t\tArrayList<Avatar> avatars = new ArrayList<Avatar>();\n\t\t\n\t\tLocation testLocation = new Location(\"Test Location\");\n\t\tAvatar testAvatar = new Avatar(\"Slim\", 1);\n\t\t\n\t\tlocations.put(\"testLocation\", testLocation);\n\t\tavatarLocations.put(testAvatar, testLocation);\n\t\tavatars.add(testAvatar);\n\t\t\n\t\treturn new GameWorld(locations, avatarLocations, avatars);\n\t}", "public OverWorld()\n { \n // Create a new world with 800x600 cells with a cell size of 1x1 pixels.\n super(1024, 600, 1, false);\n Setup();\n }", "public SideScrollingWorld()\n { \n // Create a new world with 640x480 cells with a cell size of 1x1 pixels.\n // Final argument of 'false' means that actors in the world are not restricted to the world boundary.\n // See: https://www.greenfoot.org/files/javadoc/greenfoot/World.html#World-int-int-int-boolean-\n super(VISIBLE_WIDTH, VISIBLE_HEIGHT, 1, false);\n\n // Set up the starting scene\n setup();\n\n // Game on\n isGameOver = false;\n\n }", "protected void mapToSimulationCube() {\n\t\t/* Map the system into the simulation cube, by scaling, translation, and\n\t\t by applying the periodic boundary conditions */\n\t\tdouble xo,yo,zo;\n\t\tVectorD3 mapBox;\n\t\t/* Loop over lattices: */\n\t\tfor ( int ilatt = 0; ilatt < 2; ilatt++ ) {\n\t\t\t/* Loop over spheres: */\n\t\t\tfor ( int in = 0; in < n; in++ ) {\n\t\t\t\tif( ilatt == 0 || (in < phaseIndex())) {\n\t\t\t\t\tmapBox = boxes[ilatt];\n\t\t\t\t} else {\n\t\t\t\t\tmapBox = boxT;\n\t\t\t\t}\n\t\t\t\t/* Copy vector from lattice array */\n\t\t\t\txo = latt[ilatt][in].x;\n\t\t\t\tyo = latt[ilatt][in].y;\n\t\t\t\tzo = latt[ilatt][in].z;\n\t\t\t\t\n\t\t\t\t/*Scale and translate: */\n\t\t\t\txo = ( xo/mapBox.x ) - 0.5;\n\t\t\t\tyo = ( yo/mapBox.y ) - 0.5;\n\t\t\t\tzo = ( zo/mapBox.z ) - 0.5;\n\t\t\t\t\n\t\t\t\t/*Apply periodic boundary conditions: */\n\t\t\t\txo = xo - ( (int) ( xo+xo ) );\n\t\t\t\tyo = yo - ( (int) ( yo+yo ) );\n\t\t\t\tzo = zo - ( (int) ( zo+zo ) );\n\t\t\t\t\n\t\t\t\t/* Copy modified vector back into the lattice array */\n\t\t\t\tlatt[ilatt][in].x = xo;\n\t\t\t\tlatt[ilatt][in].y = yo;\n\t\t\t\tlatt[ilatt][in].z = zo;\n\t\t\t\t\n\t\t\t}\n\t\t}\t\t\n\t}", "@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 Body initPhysicsBody(World world,float x,float y){\r\n BodyDef bodyDef = new BodyDef();\r\n bodyDef.type = BodyType.DYNAMIC;\r\n bodyDef.position = new Vec2(0,0);\r\n Body body = world.createBody(bodyDef);\r\n\r\n ///EdgeShape shape = new EdgeShape();\r\n PolygonShape shape = new PolygonShape();\r\n shape.setAsBox((sprite.layer().width()*GameScreen.M_PER_PIXEL/2)-1.5f,\r\n (sprite.layer().height())*GameScreen.M_PER_PIXEL/2);\r\n FixtureDef fixtureDef = new FixtureDef();\r\n fixtureDef.shape = shape;\r\n fixtureDef.density = 0.4f;\r\n fixtureDef.friction = 0.1f;\r\n fixtureDef.restitution = 0.35f;\r\n body.createFixture(fixtureDef);\r\n\r\n body.setLinearDamping(0.2f);\r\n body.setTransform(new Vec2(x,y),0f);\r\n body.setFixedRotation(true);\r\n\r\n return body;\r\n }", "public void create() {\n\t\trandomUtil = new RandomUtil();\n\t\t// create the camera using the passed in viewport values\n\t\tcamera = new OrthographicCamera(viewPortWidth, viewPortHeight);\n\t\tbatch.setProjectionMatrix(camera.combined);\n\t\tdebugRender = new Box2DDebugRenderer(true, false, false, false, false, true);\n\t\ttestWorld = new TestWorld(assetManager.blockManager(), new Vector2(0, 0f));\n\t\ttestWorld.genWorld(debugUtil);\n\t\ttestWorld.setCamera(getCamera());\n\t\tplayer.createBody(testWorld.getWorld(), BodyType.DynamicBody);\n\t\ttestWorld.getPlayers().add(player);\n\t\tworldParser = new WorldParser(testWorld, \"Test World\");\n\t\tworldParser = new WorldParser(testWorld, \"Test Write\");\n\t\tworldParser.parseWorld();\n\t\twriter = new WorldWriter(\"Test Write\", testWorld);\n\t}", "public World getWorld() {\n\t\treturn world;\n\t}", "public RobotWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(800, 600, 1); \n prepare();\n }", "public void loadWorld() {\n\t\tint[][] tileTypes = new int[100][100];\n\t\tfor (int x = 0; x < 100; x++) {\n\t\t\tfor (int y = 0; y < 100; y++) {\n\t\t\t\ttileTypes[x][y] = 2;\n\t\t\t\tif (x > 40 && x < 60 && y > 40 && y < 60) {\n\t\t\t\t\ttileTypes[x][y] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tEntityList entities = new EntityList(0);\n\t\tPlayer player = new Player(Direction.SOUTH_WEST, 50, 50);\n\t\tentities.addEntity(player);\n\t\tentities.addEntity(new Tree(Direction.SOUTH_WEST,49, 49));\n\t\tworld = new World(new Map(tileTypes), player, entities);\n\t}", "public RandomCoordinateWorldGenerator(int worldWidth, int worldHeight) {\n this.worldWidth = worldWidth;\n this.worldHeight = worldHeight;\n }", "public MyWorld()\n { \n // Create a new world with 600x550 cells with a cell size of 1x1 pixels.\n super(600, 550, 1);\n // Set the order in which Actors are drawn on the screen in this World\n setPaintOrder ( Counter.class, HighScore.class, Fader.class);\n // Counter\n counter = new Counter (\"Score: \");\n addObject (counter, 50, 30);\n // Initialize the player\n player = new Player ();\n addObject (player, 300, 530); \n platforms = new Platform[10]; \n startingPlatform = new Platform();\n addObject (startingPlatform, 300, 550);\n // Loop through as many Meteors as there are on this level\n for (int i = 0; i < platforms.length; i++)\n {\n // Initialize a new Platform object for each spot in the array\n platforms[i] = new Platform ();\n // Add each platform at a random position anywhere on the X axis and at intervals of 15 on the Y axis\n addObject (platforms[i], Greenfoot.getRandomNumber(600), platformCounter);\n platformCounter = platformCounter - 55;\n }\n }", "@Override\n\tpublic void update() {\n\t\tworld.update();\n\t}", "public ThingNode getWorld()\n {\n return world;\n }", "protected abstract void initializeWorld();", "@Override\n\tpublic void init() {\n\t\tworld = new World(gsm);\n\t\tworld.init();\n\t\t\n\t\tif(worldName == null){\n\t\t\tworldName = \"null\";\n\t\t\tmap_name = \"map\";\n\t\t} \n\t\tworld.generate(map_name);\n\t}", "private void configureWorlds(){\n switch (gameWorld){\n case NORMAL:\n world.setPVP(true);\n world.setKeepSpawnInMemory(false);\n world.setAutoSave(false);\n world.setStorm(false);\n world.setThundering(false);\n world.setAnimalSpawnLimit((int) (mobLimit * 0.45));\n world.setMonsterSpawnLimit((int) (mobLimit * 0.45));\n world.setWaterAnimalSpawnLimit((int) (mobLimit * 0.1));\n world.setDifficulty(Difficulty.HARD);\n break;\n case NETHER:\n world.setPVP(true);\n world.setAutoSave(false);\n world.setKeepSpawnInMemory(false);\n world.setStorm(false);\n world.setThundering(false);\n world.setMonsterSpawnLimit((int) (mobLimit * 0.45));\n world.setAnimalSpawnLimit((int) (mobLimit * 0.45));\n world.setWaterAnimalSpawnLimit((int) (mobLimit * 0.1));\n world.setDifficulty(Difficulty.HARD);\n break;\n }\n }", "public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }", "private void createPhysics(final Camera camera, PhysicsWorld physicsWorld){\n\t\t \n\t\t body = PhysicsFactory.createBoxBody(physicsWorld, this, BodyType.DynamicBody, PhysicsFactory.createFixtureDef(0, 0, 0));\n\t\t \n\t\t body.setUserData(\"player\");\n\t\t body.setFixedRotation(true);\n\t\t \n\t\t physicsWorld.registerPhysicsConnector(new PhysicsConnector(this, body, true, false){\n\t\t\t @Override\n\t\t\t public void onUpdate(float pSecondsElapsed){\n\t\t\t\t \n\t\t\t\t super.onUpdate(pSecondsElapsed);\n\t\t\t\t camera.onUpdate(0.1f);\n\t\t\t\t \n\t\t\t\t if (getY()<=0 || getY() >= 800){\n\t\t\t\t\t onDie();\n\t\t\t\t }\n\t\t\t\t if(canRun){\n\t\t\t\t\t body.setLinearVelocity(new Vector2(5,body.getLinearVelocity().y));\n\t\t\t\t }\n\t\t\t }\n\t\t });\n\t }", "public void createBody(){\n this.fuelMass = this.initFuelMass;\n BodyDef def = new BodyDef();\n def.position.set(initPosition);\n def.type = BodyDef.BodyType.DynamicBody;\n body = world.createBody(def);\n\n PolygonShape box = new PolygonShape();\n box.setAsBox(lunarModuleWidth / 2, lunarModuleHeight / 2);\n fixture = body.createFixture(box, (lunarModuleMass + fuelMass) / (lunarModuleHeight * lunarModuleWidth));\n box.dispose();\n\n fixture.setUserData(\"lunar module\");\n fixture.setFriction(0.4f);\n massData = body.getMassData();\n setSize(lunarModuleWidth, lunarModuleHeight);\n\n this.alive = true;\n this.activateEngine = false;\n this.activateAuxiliaryEnginesLeft = false;\n this.activateAuxiliaryEnginesRight = false;\n }", "public MyWorld()\n { \n super(1200, 600, 1); \n prepare();\n bienvenida();\n instrucciones();\n sonido();\n }", "public void makeBody()\n {\n Texture text;\n if(bounds.getHeight()<bounds.getWidth()) {\n text = new Texture(\"img/wall.jpg\");\n }else{\n text = new Texture(\"img/wall2.jpg\");\n }\n\n Sprite wallSprite;\n wallSprite = new Sprite(text);\n wallSprite.setSize(bounds.getWidth(),bounds.getHeight());\n wallSprite.setOrigin(bounds.getWidth()/2, bounds.getHeight()/2);\n\n BodyDef bodydef = new BodyDef();\n bodydef.type = BodyType.StaticBody;\n bodydef.position.set(position.x,position.y);\n\n PolygonShape shape = new PolygonShape();\n shape.setAsBox(bounds.width/2, bounds.height/2);\n\n FixtureDef def = new FixtureDef();\n def.shape = shape;\n def.friction = 0.5f;\n def.restitution = 0;\n wall = world.createBody(bodydef);\n wall.createFixture(def);\n wall.getFixtureList().get(0).setUserData(\"w\");\n wall.setUserData(wallSprite);\n\n shape.dispose();\n }", "public void createWorldMap() {\r\n\t\tdo {\r\n\t\t\t//\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Recursive map generation method over here@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n\t\t\t//Generation loop 1 *ADDS VEIN STARTS AND GRASS*\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif (Math.random()*10000>9999) { //randomly spawn a conore vein start\r\n\t\t\t\t\t\ttileMap[i][j] = new ConoreTile (conore, true);\r\n\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t}else if (Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new KannaiteTile(kanna, true);\r\n\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new FuelTile(fuel, true);\r\n\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999) {\r\n\t\t\t\t\t\ttileMap[i][j] = new ForestTile(forest, true);\r\n\t\t\t\t\t\tforestCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new OilTile(oil,true);\r\n\t\t\t\t\t}else if(Math.random()*10000>9997) {\r\n\t\t\t\t\t\ttileMap[i][j] = new MountainTile(mountain, true);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\ttileMap[i][j] = new GrassTile(dirt);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} // End for loop \r\n\t\t\t} // End for loop\r\n\t\t\t//End generation loop 1\r\n\r\n\t\t\t//Generation loop 2 *EXPANDS ON THE VEINS*\r\n\t\t\tdo {\r\n\t\t\t\tif (conoreCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ConoreTile (conore,true);\r\n\t\t\t\t\tconoreCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tconorePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (kannaiteCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new KannaiteTile (kanna,true);\r\n\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (fuelCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new FuelTile (fuel,true);\r\n\t\t\t\t\tfuelCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (forestCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ForestTile (forest,true);\r\n\t\t\t\t\tforestCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tforestPass = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 2\r\n\r\n\t\t\t//Generation loop 3 *COUNT ORES*\r\n\t\t\tint loop3Count = 0;\r\n\t\t\tconorePass = false;\r\n\t\t\tkannaitePass = false;\r\n\t\t\tfuelPass = false;\r\n\t\t\tforestPass = false;\r\n\t\t\tdo {\r\n\t\t\t\tconoreCount = 0;\r\n\t\t\t\tkannaiteCount = 0;\r\n\t\t\t\tfuelCount = 0;\r\n\t\t\t\tforestCount = 0;\r\n\t\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (tileMap[i][j] instanceof ConoreTile) {\r\n\t\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof KannaiteTile) {\r\n\t\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof FuelTile) {\r\n\t\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof ForestTile) {\r\n\t\t\t\t\t\t\tforestCount++;\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\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (conoreCount < 220) {\r\n\t\t\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tconorePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (kannaiteCount < 220) {\r\n\t\t\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (fuelCount< 220) {\r\n\t\t\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (forestCount < 220) {\r\n\t\t\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tforestPass = 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\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tloop3Count++;\r\n\t\t\t\tif (loop3Count > 100) {\r\n\t\t\t\t\tSystem.out.println(\"map generation failed! restarting\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\t\t\t//END OF LOOP 3\r\n\r\n\t\t\t//LOOP 4: THE MOUNTAIN & OIL LOOP\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildMountain(i,j);\r\n\t\t\t\t\tbuildOil(i,j);\r\n\t\t\t\t}\r\n\t\t\t}//End of THE Mountain & OIL LOOP\r\n\r\n\t\t\t//ADD MINIMUM AMOUNT OF ORES\r\n\r\n\t\t\t//Generation Loop 5 *FINAL SETUP*\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif(i == 1 || j == 1 || i == tileMap.length-2 || j == tileMap[i].length-2) {\r\n\t\t\t\t\t\ttileMap[i][j] = new DesertTile(desert);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (i == 0 || j == 0 || i == tileMap.length-1 || j == tileMap[i].length-1) {\r\n\t\t\t\t\t\ttileMap[i][j] = new WaterTile(water);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 5\r\n\t\t\t//mapToString();//TEST RUN\r\n\t\t} while(!conorePass || !kannaitePass || !fuelPass || !forestPass); // End createWorldMap method\r\n\t}", "private void buildBody() {\n\t\tBodyDef def = new BodyDef();\n\t\tdef.type = BodyType.KinematicBody;\n\t\tdef.position.set(new Vector2(0, 0));\n\t\tmouseBody = GamePlayManager.world.createBody(def);\n\n\t\t//this body is jointed to the above body and is physically pulled towards the mouse\n\t\tBodyDef def2 = new BodyDef();\n\t\tdef2.type = BodyType.DynamicBody;\n\t\tdef2.position.set(new Vector2(0, 0));\n\t\tBody collisionBody = GamePlayManager.world.createBody(def2);\n\t\tCircleShape shape = new CircleShape();\n\t\tshape.setRadius(8 * Util.PIXEL_TO_BOX);\n\t\tFixtureDef fixDef2 = new FixtureDef();\n\t\tfixDef2.shape = shape;\n\t\tfixDef2.isSensor = true;\n\t\tfixDef2.density = 1f;\n\t\tfixDef2.filter.categoryBits = Util.CATEGORY_EVERYTHING;\n\t\tfixDef2.filter.maskBits = Util.CATEGORY_EVERYTHING;\n\t\tcollisionBody.createFixture(fixDef2);\n\t\tcollisionBody.setUserData(this);\n\t\tshape.dispose();\n\t\t\n\t\tWeldJointDef jDef = new WeldJointDef();\n\t\tjDef.bodyA = mouseBody;\n\t\tjDef.bodyB = collisionBody;\n\t\tjDef.collideConnected = false;\n\t\tjDef.type = JointType.WeldJoint;\n\t\tjDef.referenceAngle = 0;\n\t\tjDef.dampingRatio = 0;\n\t\tGamePlayManager.world.createJoint(jDef);\n\t}", "protected WorldController(Rectangle bounds, Vector2 gravity) {\n\t\tassets = new Array<String>();\n\t\tworld = new World(gravity,false);\n\t\tthis.bounds = new Rectangle(bounds);\n\t\tthis.scale = new Vector2(1,1);\n\t\tcomplete = false;\n\t\tfailed = false;\n\t\tdebug = false;\n\t\tactive = false;\n\t\tcountdown = -1;\n\t}", "public Main()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n\n prepare();\n }", "public World() {\n\t\tbackgroundLoader.submit(new Callable<Object>() {\n\t\t\t@Override\n\t\t\tpublic Object call() throws Exception {\n\t\t\t\tItemDefinition.load();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t\tbackgroundLoader.submit(new Callable<Object>() {\n\t\t\t@Override\n\t\t\tpublic Object call() throws Exception {\n\t\t\t\tNPCDefinition.load();\n\t\t\t\tNPCStyle.init();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t\tbackgroundLoader.submit(new Callable<Object>() {\n\t\t\t@Override\n\t\t\tpublic Object call() throws Exception {\n\t\t\t\tDegradeSystem.init();\n\t\t\t\tProjectileManager.init();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t\tbackgroundLoader.submit(new Callable<Object>() {\n\t\t\t@Override\n\t\t\tpublic Object call() throws Exception {\n\t\t\t\tShops.loadShopFile();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t}", "@Override\n public World generateWorld(int numCracks) {\n\n Random rand = new Random();\n Point[] p;\n World world = new World();\n\n for (int i = 0; i<numCracks;i++) {\n p = new Point[2];\n p[0] = new Point(rand.nextInt(worldWidth),rand.nextInt(worldHeight));\n p[1] = new Point(rand.nextInt(worldWidth),rand.nextInt(worldHeight));\n world.addCrack(new Crack(p));\n }\n\n return world;\n }", "public MyWorld()\n {\n super(600, 400, 1);\n }", "public static void initialize() {\n BroadphaseInterface aabbInterface = new DbvtBroadphase(); //Checks if objects could collide\n CollisionConfiguration collisionConfiguration = new DefaultCollisionConfiguration();\n CollisionDispatcher collisionDispatcher = new CollisionDispatcher(collisionConfiguration); //Handles collisions\n ConstraintSolver constraintSolver = new SequentialImpulseConstraintSolver();\n\n world = new DiscreteDynamicsWorld(collisionDispatcher, aabbInterface, constraintSolver, collisionConfiguration);\n world.setGravity(DataTypeHelper.stringToVector3f(PreferenceHelper.getValue(\"gravity\")));\n }", "@Override\n\tpublic void create() {\n\t\tGdx.app.setLogLevel(Application.LOG_DEBUG);\n\t\t\n\t\t//Load assets\n\t\tAssets.instance.init(new AssetManager());\n\t\t\n\t\t//initialize controller and renderer\n\t\tworldController = new WorldController();\n\t\tworldRenderer= new WorldRenderer(worldController);\n\t\t\n\t\t//The world is not paused on start\n\t\tpaused = false;\n\t}", "public void resetWorld(){\r\n\t\tSystem.out.println(\"Resetting world\");\r\n\t\tengine.removeAllEntities();\r\n\t\tlvlFactory.resetWorld();\r\n\t\t\r\n\t\tplayer = lvlFactory.createPlayer(cam);\r\n\t\tlvlFactory.createFloor();\r\n lvlFactory.createWaterFloor();\r\n \r\n int wallWidth = (int) (1*RenderingSystem.PPM);\r\n int wallHeight = (int) (60*RenderingSystem.PPM);\r\n TextureRegion wallRegion = DFUtils.makeTextureRegion(wallWidth, wallHeight, \"222222FF\");\r\n lvlFactory.createWalls(wallRegion); //TODO make some damn images for this stuff \r\n \r\n // reset controller controls (fixes bug where controller stuck on directrion if died in that position)\r\n controller.left = false;\r\n controller.right = false;\r\n controller.up = false;\r\n controller.down = false;\r\n controller.isMouse1Down = false;\r\n controller.isMouse2Down = false;\r\n controller.isMouse3Down = false;\r\n\t\t\r\n\t}", "public GameWorldModel(int width, int height, int particleNo, int movementType) {\n\t\tthis.movementType = movementType;\n\t\tthis.particleCollection = new ArrayList<Particle>(particleNo);\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tthis.particleNo = particleNo;\n\t\tthis.staticParticles = 0;\n\t\t//initialize to 0 all the matrix cells\n\t\tthis.worldMatrix = new int[this.height][this.width];\n\t\tfor(int i=0; i<this.height; i++){\n\t\t\tfor(int j=0; j<this.width; j++){\n\t\t\t\tthis.worldMatrix[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * if the simulation is not of the snowflake type then a seed is positioned in the center\n\t\t * and the max and min value for X and Y are recalculated to surround the seed point\n\t\t */\n\t\tif( movementType == 1 || movementType == 2 || movementType == 3 ){\n\t\t\tworldMatrix[((height/2)-1)][((width/2)-1)] = 1;\n\t\t\telements++;\n\t\t\tstaticParticles++;\n\t\t\txMin = (height/2)-2;\n\t\t\txMax = height/2;\n\t\t\tyMin = (width/2)-2;\n\t\t\tyMax = width/2;\n\t\t}\n\t}", "@NotNull\r\n World getWorld();", "public void buildDiscreteWorld(int numOfRooms, int numOfHallways) {\n for (int i = 0; i < numOfRooms; i += 1) {\n randomBuildRoom();\n note.add(position);\n }\n\n for (int j = 0; j < numOfHallways; j += 1) {\n randomBuildHallway();\n note.add(position);\n }\n }", "public void createBody(World world) {\n\t BodyEditorLoader loader = new BodyEditorLoader((FileHandle)game.getResourceManager().getResource(assetName + \".json\"));\n\t \n\t // 1. Create a BodyDef, as usual.\n\t BodyDef bd = new BodyDef();\n\t bd.type = BodyType.StaticBody;\n\t \n\t // 2. Create a FixtureDef, as usual.\n\t FixtureDef fd = new FixtureDef();\n\t fd.density = 1;\n\t fd.friction = 0.5f;\n\t fd.restitution = 0f;\n\t fd.isSensor = true;\n\t fd.filter.categoryBits = FilterData.ENTITY;\n\t \n\t // 3. Create a Body, as usual.\n\t body = world.createBody(bd);\n\t body.setTransform(GameUtil.ptm(position.x), GameUtil.ptm(position.y), 0);\n\t body.setUserData(this);\n\t \n\t // 4. Create the body fixture automatically by using the loader.\n\t loader.attachFixture(body, assetName, fd, GameUtil.ptm(sprite.getWidth()));\n\t}", "public void newGameWorld()\r\n {\r\n addObject(new Blackout(\"Fade\"), getWidth() / 2, getHeight() / 2);\r\n removeAllObjects();\r\n\r\n GameWorld gameWorld = new GameWorld();\r\n Greenfoot.setWorld(gameWorld);\r\n }", "public String getWorld() {\r\n\t\treturn mainSpawn.getWorld().toString();\r\n\t}", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1078, 672, 1); \n preparePlayer1();\n preparePlayer2();\n prepareTitle();\n //playmusic();\n }", "@Override\n public void world() {\n super.world();\n }", "protected WorldWindow createWorldWindow() {\n\t\treturn new WorldWindowGLJPanel();\r\n\t\t//return new WorldWindow();\r\n\t}", "public static World readWorld() {\n\t\treturn null;\n\t}", "public void initWorld()\n\t{\n\t\tgrid = new Creature[numRows][numColumns];\n\t\t\n\t\t//place a Species1 object in the top half of the grid\n\t\tint topRowInit = (int)(Math.random()*(numRows/2));\n\t\tint topColInit = (int)(Math.random()*(numColumns));\n\t\tgrid[topRowInit][topColInit] = new Species1(this, topRowInit, topColInit);\n\t\tgrid[topRowInit][topColInit].live();\n\t\t\n\t\t//place a Species2 object in the bottom half of the grid\n\t\tint bottomRowInit = (int)(Math.random()*(numRows/2))+(numRows/2);\t\t\n\t\tint bottomColInit = (int)(Math.random()*(numColumns));\t\t\t\t\n\t\tgrid[bottomRowInit][bottomColInit] = new Species2(this, bottomRowInit, bottomColInit);\n\t\tgrid[bottomRowInit][bottomColInit].live();\n\t\t\n\t}", "public void setWorld(GameData world) {\r\n this.world = world;\r\n }", "public void updateGameWorld() {\r\n\t\t//divide the user entered height by the height of the canvas to get a ratio\r\n\t\tfloat canvas_height = Window.getCanvas().getHeight();\r\n\t\tfloat new_height = EnvironmentVariables.getHeight();\r\n\t\tfloat ratio = new_height / canvas_height;\r\n\t\t\r\n\t\t//use this ration th=o set the new meter value\r\n\t\tEnvironmentVariables.setMeter(EnvironmentVariables.getMeter() * ratio);\r\n\t\t\r\n\t\t//use the ratio to set all objects new location\r\n\t\tfor(GameObject obj: EnvironmentVariables.getWorldObjects()) {\r\n\t\t\tobj.setX(obj.getX() * ratio);\r\n\t\t\tobj.setY(obj.getY() * ratio);\r\n\t\t}\r\n\t\t\r\n\t\tfor(GameObject obj: EnvironmentVariables.getTerrain()) {\r\n\t\t\tobj.setX(obj.getX() * ratio);\r\n\t\t\tobj.setY(obj.getY() * ratio);\r\n\t\t}\r\n\t\t\r\n\t\tif(EnvironmentVariables.getMainPlayer() != null) {\r\n\t\t\tEnvironmentVariables.getMainPlayer().setX(EnvironmentVariables.getMainPlayer().getX() * ratio);\r\n\t\t\tEnvironmentVariables.getMainPlayer().setY(EnvironmentVariables.getMainPlayer().getY() * ratio);\r\n\t\t}\r\n\t\t\r\n\t}", "@BeforeClass\n\tpublic static void setup() {\n\t\tbaseWorld = new BaseWorld(1000 ,1500);\n \tGameManager.get().setWorld(new BaseWorld(1000, 1500));\n\t}", "public static void createBodyAndType(World world) {\n\t\t\n\t}", "public static void generateWorld(int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)\n\t{\n\t\tlong worldSeed = world.getSeed();\n\t\tRandom random = new Random(worldSeed);\n\t\tlong xSeed = random.nextLong() >> 2 + 1L;\n\t\tlong zSeed = random.nextLong() >> 2 + 1L;\n\t\trandom.setSeed((xSeed * chunkX + zSeed * chunkZ) ^ worldSeed);\n\n\t\tfor (IWorldGenerator generator : worldGenerators)\n\t\t{\n\t\t\tgenerator.generate(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);\n\t\t}\n\t}", "public World getWorld ( ) {\n\t\treturn invokeSafe ( \"getWorld\" );\n\t}", "public void setWorld(World world) {\n this.world = world;\n }", "public WorldModel(){\t\n\t}", "public static World getWorld(NetworkManager network) {\n\t\treturn getWorld();\n\t}", "public static void main(String [] args)\n\t{\n\t\tWorld newWorld = new World();\n\n\t\t//Adding everything into the world\n\t\tnewWorld.treesShrubsToWorld();\n\t\tnewWorld.grassToWorld();\n\t\tnewWorld.caterpillarToWorld();\n\t\tnewWorld.grasshopperToWorld();\n\t\tnewWorld.deerToWorld();\n\t\tnewWorld.bluejayToWorld();\n\t\tnewWorld.squirrelToWorld();\n\t\tnewWorld.mouseToWorld();\n\t\tnewWorld.rabbitToWorld();\n\t\tnewWorld.hawkToWorld();\n\t\tnewWorld.foxToWorld();\n\t\tnewWorld.wolfToWorld();\n\n\t\t//Printing out the world onto the console\n\t\tnewWorld.printWorld();\n\t\t\n\t}", "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 }", "protected void updateWorld(World world) {\r\n\t\tthis.world = world;\r\n\t\tsetup(); //Call setup again to re assign certain variables that depend\r\n\t\t\t\t // on the world\r\n\t\tbufferWorld(); //Buffer the new world\r\n\t}", "public void addToWorld(World world);", "public WorldGenerator getRandomWorldGenForTrees(Random par1Random)\n {\n return worldGenSwamp;\n }", "public PhysicsSimulator() {\n\t\tshapes = new ArrayList<PhysicsShape>();\n\t\t\n\t\tground = new PhysicsRectangle(400, 800, 1000000, 1000, 200, new Color(200, 200, 200), new Color(0));\n\t\tshapes.add(ground);\n\t\t\n\t}", "public VolcanoWorld() {\n this(DEFAULT_WIDTH, DEFAULT_HEIGHT);\n }", "@Override\n public void create(World world, float x, float y) {\n \n super.create(world, x, y);\n this.body.setGravityScale(0f);\n /* WheelJointDef wjd1 = new WheelJointDef();\n\n this.body.getFixtureList().setDensity(1);\n wjd1.initialize(this.w1.getBody(),this.getBody(), new Vec2(0,1), new Vec2(0, 1f));\n wjd1.enableMotor = true;\n wjd1.frequencyHz =1;\n wjd1.maxMotorTorque = 4;\n wjd1.motorSpeed = -5;\n wjd1.dampingRatio = 0.8f;\n \n this.w1.getBody().getFixtureList().setDensity(0.1f);\n \n WheelJointDef wjd2 = new WheelJointDef();\n wjd2.initialize(this.getBody(),this.w2.getBody(), new Vec2(0, 1), new Vec2(0, 1));\n wjd2.frequencyHz =1;\n wjd2.maxMotorTorque = 4;\n wjd2.motorSpeed = -5;\n wjd2.dampingRatio = 0.8f;\n world.createJoint(wjd1);\n this.w2.getBody().getFixtureList().setDensity(0.1f);\n\n world.createJoint(wjd2);*/\n \n \n }", "public static World getInstance() {\n\t\tif (world == null) {\n\t\t\tworld = new World();\n\t\t}\n\t\treturn world;\n\t}", "public World(final BoundingBox bounds, final Peer peer) {\n \t\tmyVirtualWorldBounds = bounds;\n \t\tmyPeer = peer;\n \t\tmyPeer.addObserver(this);\n \t\t\n \t\tmyForces = new LinkedList<Force>();\n \t\tmyObjects = new LinkedList<PhysicalObject>();\n \t\t\n \t\t// TODO: Should this go here?\n \t\tmyScene = new BranchGroup();\n \t\tmyScene.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);\n \t\tmyScene.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);\n \t\t\n \t\tBoundingLeaf originLeaf = new BoundingLeaf(new BoundingSphere());\n \t\tmyScene.addChild(originLeaf);\n \t\t\n \t\tmyScene.addChild(createVirtualWorldBoundsShape());\n \t\t\n \t\taddLights();\n \t\taddHalfspaces();\n \t\t\n \t\tmyScene.compile();\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 }", "public static List<World> getWorlds() {\n\t\treturn worlds;\n\t}", "@Basic\n\tpublic World getWorld() {\n\t\treturn this.world;\n\t}", "@Basic\n\tpublic World getWorld() {\n\t\treturn this.world;\n\t}" ]
[ "0.7204093", "0.71206605", "0.7094518", "0.6967207", "0.668262", "0.66483444", "0.6627295", "0.6559407", "0.6533536", "0.6504768", "0.64514303", "0.6444279", "0.6377753", "0.63679254", "0.63014615", "0.62978095", "0.625795", "0.6229158", "0.62121975", "0.61944854", "0.619259", "0.61567646", "0.61493504", "0.61458707", "0.6117154", "0.6114107", "0.6095544", "0.60618335", "0.60618335", "0.6039779", "0.60074496", "0.60019726", "0.5979436", "0.59786534", "0.5954211", "0.5948903", "0.5945334", "0.5943121", "0.5929528", "0.5917249", "0.59143037", "0.5913172", "0.5890354", "0.5872128", "0.5865003", "0.5859942", "0.5840788", "0.5823366", "0.5815701", "0.58154505", "0.58063686", "0.57887113", "0.57857066", "0.5742105", "0.57399756", "0.57223153", "0.571863", "0.5717012", "0.5693793", "0.5692627", "0.5691148", "0.56833273", "0.56721634", "0.56598157", "0.5658518", "0.5657546", "0.5656553", "0.5649917", "0.5631606", "0.5618747", "0.5601424", "0.5587421", "0.5586354", "0.55849427", "0.55845815", "0.55816054", "0.55744267", "0.5571817", "0.5570846", "0.55647415", "0.5561601", "0.55595285", "0.555908", "0.55457556", "0.55060035", "0.5504238", "0.5492062", "0.5487021", "0.5485358", "0.5484144", "0.5474616", "0.5467198", "0.5462587", "0.54616934", "0.54603726", "0.5453991", "0.54507864", "0.5448368", "0.54378897", "0.54378897" ]
0.7328743
0
Transition between areas North: PlainsArea South: IntroArea Door: OogLagInterior
@Override public void transitionAreas(short transitionType) { switch (transitionType) { // the transition to the north case NORTH: this.manager.setMap(new MountainLeft(this.manager), 400,30); break; // the transition to the south case SOUTH: this.manager.setMap(new OogLagExterior(this.manager), 350, 1175); break; // no transition default: break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void mapAreaOne()\n\n {\n\n Area area = areaIDMap.get(Constants.FIRST_AREA_ID);\n\n area.areaMap.put(Constants.North, areaIDMap.get(Constants.SECOND_AREA_ID));\n\n area.areaMap.put(Constants.South, areaIDMap.get(Constants.FIFTH_AREA_ID));\n\n area.areaMap.put(Constants.East, areaIDMap.get(Constants.FOURTH_AREA_ID));\n\n area.areaMap.put(Constants.West, areaIDMap.get(Constants.SIXTH_AREA_ID));\n\n area.paths = Constants.NorthSouthEastAndWest;\n\n }", "private void makeEntranceAndExit() {\n int rowView = calcRowViewAndWalk(rowEntry, Direction.up);\r\n int colView = calcColViewAndWalk(colEntry, Direction.up);\r\n setCell(rowView, colView, Cell.corridor);\r\n \r\n rowView = calcRowViewAndWalk(rowExit, Direction.down);\r\n colView = calcColViewAndWalk(colExit, Direction.down);\r\n setCell(rowView, colView, Cell.corridor);\r\n }", "private void createFinalLine() {\n //Up\n if (orOpActive.row > origin.row) {\n for (int i = origin.row + 1; i <= orOpActive.row; i++) {\n game.gridMap.get(i).get(origin.column).setState(game.STATE_FINAL);\n //setState(gridMap.get(i).get(origin.column), STATE_FINAL);\n }\n }\n\n //Down\n if (orOpActive.row < origin.row) {\n for (int i = origin.row - 1; i >= orOpActive.row; i--) {\n game.gridMap.get(i).get(origin.column).setState(game.STATE_FINAL);\n //setState(gridMap.get(i).get(origin.column), STATE_FINAL);\n }\n }\n //Right\n if (orOpActive.column > origin.column) {\n for (int i = origin.column + 1; i <= orOpActive.column; i++) {\n game.gridMap.get(origin.row).get(i).setState(game.STATE_FINAL);\n //setState(gridMap.get(origin.row).get(i), STATE_FINAL);\n }\n }\n //Left\n if (orOpActive.column < origin.column) {\n for (int i = origin.column - 1; i >= orOpActive.column; i--) {\n game.gridMap.get(origin.row).get(i).setState(game.STATE_FINAL);\n //setState(gridMap.get(origin.row).get(i), STATE_FINAL);\n }\n }\n }", "@Override\n\tpublic void area() {\n\t\tSystem.out.println(\"------------------------------\");\n\t\tSystem.out.println(this.name+\"的面积:\"+land1high*land1);\n\t}", "AREA createAREA();", "private void mapContinents() {\n\t\tElevationMap elevs = mRegion.getElevationMap();\r\n\t\tif (elevs.w != w || elevs.h != h)\r\n\t\t\tthrow new RuntimeException(\"Elevation map and continent map are not the same size.\");\r\n\t\t\r\n\t\t// Create continent map\r\n\t\tthis.mContinents = new int[w][h];\r\n\t\t// Set points below sea level to 0, all else to 2\r\n\t\tfor (int x = 0; x < w; ++x) {\r\n\t\t\tfor (int y = 0; y < h; ++y) {\r\n\t\t\t\t// MUST CHANGE THIS; SEA LEVEL HARD CODED TO 5\r\n\t\t\t\tif (elevs.getElev(x, y) < 5) mContinents[x][y] = 0;\r\n\t\t\t\telse mContinents[x][y] = 2;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Previous step separated land and water; now we distinguish unique land masses\r\n\t\tfor (int x = 0; x < w; ++x) {\r\n\t\t\tfor (int y = 0; y < h; ++y) {\r\n\t\t\t\t// \r\n\t\t\t\tif (mContinents[x][y] == 0) continue;\r\n\t\t\t\telse if (mContinents[x][y] == 2) {\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}", "public void enemymoveAri(){\n\t\tint YEari = 0;\n\t\tint XEari = 0;\n\t\tfor(int i = 0 ; i < this.Ari.length;i++){\n\t\t\tfor(int p = 0; p < this.Ari.length;p++){\n\t\t\t\tif(this.Ari[i][p] == 1){\n\t\t\t\t\tYEari = i;\n\t\t\t\t\tXEari = p;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint move = fate.nextInt(4);// 0 is left, 1 is right , 2 is up , 3 is down\n\t\tswitch(move){//first block is up and down second block is left and right\n\t\t\tcase 0:\n\t\t\t\tif(this.area[YEari][XEari-1] != \"[ ]\"){\n\t\t\t\t\tthis.Ari[YEari][XEari-1] = 1;//to turn left\n\t\t\t\t\tthis.Ari[YEari][XEari] = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif(this.area[YEari][XEari+1] != \"[ ]\"){\n\t\t\t\t\tthis.Ari[YEari][XEari+1] = 1;//to turn right\n\t\t\t\t\tthis.Ari[YEari][XEari] = 0;\n\t\t\t\t}\n\t\t\t\tbreak; \n\t\t\tcase 2:\n\t\t\t\tif(this.area[YEari-1][XEari] != \"[ ]\"){\n\t\t\t\t\tthis.Ari[YEari-1][XEari] = 1;//to turn up\n\t\t\t\t\tthis.Ari[YEari][XEari] = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif(this.area[YEari+1][XEari] != \"[ ]\"){\n\t\t\t\t\tthis.Ari[YEari +1][XEari] = 1;//to turn down\n\t\t\t\t\tthis.Ari[YEari][XEari] = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}//end of switch\n\t}", "public void claShapeArea(){\r\n\t\tshape.calArea();\r\n\t}", "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 }", "private void calculateAreas() {\n\n\t\t/*\n\t\t * Each section is a trapezoid, so that the area is given by:\n\t\t * \n\t\t * (thicknessAtMainSpar + thicknessAtSecondarySpar)*distanceBetweenSpars*0.5\n\t\t * \n\t\t */\n\t\tint nSections = this._thicknessAtMainSpar.size();\n\t\tfor(int i=0; i<nSections; i++)\n\t\t\tthis._prismoidsSectionsAreas.add(\n\t\t\t\t\tAmount.valueOf(\n\t\t\t\t\t\t\t(this._thicknessAtMainSpar.get(i).plus(this._thicknessAtSecondarySpar.get(i)))\n\t\t\t\t\t\t\t.times(this._distanceBetweenSpars.get(i)).times(0.5).getEstimatedValue(),\n\t\t\t\t\t\t\tSI.SQUARE_METRE\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t}", "private void decorateMountains(int xStart, int xLength, int floor, ArrayList finalListElements, ArrayList states,boolean enemyAddedBefore)\r\n\t {\n\t if (floor < 1)\r\n\t \treturn;\r\n\r\n\t // boolean coins = random.nextInt(3) == 0;\r\n\t boolean rocks = true;\r\n\r\n\t //add an enemy line above the box\r\n\t Random r = new Random();\r\n\t boolean enemyAdded=addEnemyLine(xStart + 1, xLength - 1, floor - 1);\r\n\r\n\t int s = 1;\r\n\t int e = 1;\r\n\r\n\t if(enemyAdded==false && enemyAddedBefore==false)\r\n\t {\r\n\t if (floor - 2 > 0){\r\n\t if ((xLength - e) - (xStart + s) > 0){\r\n\t for(int x = xStart + s; x < xLength- e; x++){\r\n\t \tboolean flag=true;\r\n\t \tfor(int i=0;i<states.size();i++)\r\n\t \t{\r\n\t \t\tElements element=(Elements)finalListElements.get(i);\r\n\t \t\t\tBlockNode state=(BlockNode)states.get(i);\r\n\t \t\t\t\r\n\t \t\t\tint xElement = (int)(initialStraight+state.getX());\r\n\t \t int floorC= (int)state.getY()+1;\r\n\t \t int widthElement=element.getWidth();\r\n\t \t int heigthElement=element.getHeigth()+2;\r\n\t \t \r\n\t \t int widthElementNext=1;\r\n\t \t int heigthElementNext=0;\r\n\t \t \r\n\t \t if(x+(widthElementNext-1)>=xElement && x<xElement+widthElement && (floor-1)-heigthElementNext<=floorC && (floor-1)>= floorC-heigthElement )\r\n\t \t {\r\n\t \t \tflag=false;\r\n\t \t \tbreak;\r\n\t \t }\r\n\t \t \t \t \t\t \t \r\n\t \t } \r\n\t \tif(flag==true)\r\n\t \t{\r\n\t \t\tsetBlock(x, floor - 1, COIN);\r\n\t \t}\r\n\t \r\n\t //COINS++;\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t s = random.nextInt(4);\r\n\t e = random.nextInt(4);\r\n\t \r\n\t //this fills the set of blocks and the hidden objects inside them\r\n\t /*\r\n\t if (floor - 4 > 0)\r\n\t {\r\n\t if ((xLength - 1 - e) - (xStart + 1 + s) > 2)\r\n\t {\r\n\t for (int x = xStart + 1 + s; x < xLength - 1 - e; x++)\r\n\t {\r\n\t if (rocks)\r\n\t {\r\n\t if (x != xStart + 1 && x != xLength - 2 && random.nextInt(3) == 0)\r\n\t {\r\n\t if (random.nextInt(4) == 0)\r\n\t {\r\n\t setBlock(x, floor - 4, BLOCK_POWERUP);\r\n\t //BLOCKS_POWER++;\r\n\t }\r\n\t else\r\n\t {\t//the fills a block with a hidden coin\r\n\t setBlock(x, floor - 4, BLOCK_COIN);\r\n\t //BLOCKS_COINS++;\r\n\t }\r\n\t }\r\n\t else if (random.nextInt(4) == 0)\r\n\t {\r\n\t if (random.nextInt(4) == 0)\r\n\t {\r\n\t setBlock(x, floor - 4, (byte) (2 + 1 * 16));\r\n\t }\r\n\t else\r\n\t {\r\n\t setBlock(x, floor - 4, (byte) (1 + 1 * 16));\r\n\t }\r\n\t }\r\n\t else\r\n\t {\r\n\t setBlock(x, floor - 4, BLOCK_EMPTY);\r\n\t //BLOCKS_EMPTY++;\r\n\t }\r\n\t }\r\n\t }\r\n\t //additionElementToList(\"Block\", 1,(xLength - 1 - e)-(xStart + 1 + s));\r\n\t }\r\n\t \r\n\t }*/\r\n\t }", "@Override\r\n\tprotected void generateAreas() {\n\t\tPerlinNoise noise = new PerlinNoise(new Random().nextInt(), xmasTemplate.getScale(), xmasTemplate.getOctaves(), xmasTemplate.getPersistence());\r\n\t\tfor (int y = 0; y < getHeight(); y ++) {\r\n\t\t\tfor (int x = 0; x < getWidth(); x ++) {\r\n\t\t\t\tif (getValue(x, y) != BASE) {\r\n\t\t\t\t\tif (noise.perlinNoise(x, y) > xmasTemplate.getThreshold()) {\r\n\t\t\t\t\t\tsetValue(x, y, WALL);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsetValue(x, y, FLOOR);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Fill east, west and south\r\n\t\tfor (int x = 0; x < getWidth(); x ++) {\r\n\t\t\tdrawArea(x, 0, CosineInterpolator.instance.interpolate(2.0f, 6.0f, (float) Math.random()), WALL);\r\n\t\t}\r\n\t\tfor (int y = 0; y < getHeight(); y ++) {\r\n\t\t\tdrawArea(0, y, CosineInterpolator.instance.interpolate(2.0f, 6.0f, (float) Math.random()), WALL);\r\n\t\t\tdrawArea(getWidth() - 1, y, CosineInterpolator.instance.interpolate(2.0f, 6.0f, (float) Math.random()), WALL);\r\n\t\t}\r\n\r\n\t\t// Draw random blotch lines between each base first\r\n\t\tArrayList<Point> basesCopy = new ArrayList<Point>(getBases());\r\n\t\tfor (int i = 0; i < basesCopy.size(); i ++) {\r\n\t\t\tPoint p1 = basesCopy.get(i);\r\n\t\t\tint j = Util.random(0, basesCopy.size() - 1);\r\n\t\t\tPoint p2 = basesCopy.get(j);\r\n\t\t\tbasesCopy.set(i, p2);\r\n\t\t\tbasesCopy.set(j, p1);\r\n\t\t}\r\n\r\n\t\tPoint s = basesCopy.get(0), t;\r\n\t\tdrawArea(s.getX(), s.getY(), (xmasTemplate.getMinMainTunnelWidth() + xmasTemplate.getMaxMainTunnelWidth()) / 2.0f, FLOOR);\r\n\t\tfor (int i = 0; i < basesCopy.size() - 1; i ++) {\r\n\t\t\ts = basesCopy.get(i);\r\n\t\t\tt = basesCopy.get(i + 1);\r\n\t\t\tdrawLine(s.getX(), s.getY(), t.getX(), t.getY(), xmasTemplate.getMinMainTunnelWidth(), xmasTemplate.getMaxMainTunnelWidth(), FLOOR);\r\n\t\t}\r\n\r\n\t}", "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 go()\r\n\t{\r\n\t\tthis.prePopulate();\r\n\t\twhile (!bothFull)\r\n\t\t{\r\n\t\t\tthis.NorthSouth();\r\n\t\t\tthis.populate1();\r\n\t\t\tthis.EastWest();\r\n\t\t\tthis.populate2();\r\n\t\t\tif (EWFull&&NSFull)\r\n\t\t\t\tbothFull=true;\r\n\t\t}\r\n\t}", "public abstract Area newArea();", "private void revealAround() {\n if (xTile - 1 >= 0 && !References.GetMainTileActorMap()[xTile - 1][yTile].isRevealed()) {\n References.GetMainTileActorMap()[xTile - 1][yTile].setRevealed(true);\n\n if (References.GetMainTileActorMap()[xTile - 1][yTile].itContainsMonster()) {\n References.GetMonsterActorMap()[xTile - 1][yTile].setRevealed(true);\n }\n }\n if (yTile - 1 >= 0 && !References.GetMainTileActorMap()[xTile][yTile - 1].isRevealed()) {\n References.GetMainTileActorMap()[xTile][yTile - 1].setRevealed(true);\n\n if (References.GetMainTileActorMap()[xTile][yTile - 1].itContainsMonster()) {\n References.GetMonsterActorMap()[xTile][yTile - 1].setRevealed(true);\n }\n }\n if (xTile + 1 < Parameters.NUM_X_TILES && !References.GetMainTileActorMap()[xTile + 1][yTile].isRevealed()) {\n References.GetMainTileActorMap()[xTile + 1][yTile].setRevealed(true);\n\n if (References.GetMainTileActorMap()[xTile + 1][yTile].itContainsMonster()) {\n References.GetMonsterActorMap()[xTile + 1][yTile].setRevealed(true);\n }\n }\n if (yTile + 1 < Parameters.NUM_Y_TILES && !References.GetMainTileActorMap()[xTile][yTile + 1].isRevealed()) {\n References.GetMainTileActorMap()[xTile][yTile + 1].setRevealed(true);\n\n if (References.GetMainTileActorMap()[xTile][yTile + 1].itContainsMonster()) {\n References.GetMonsterActorMap()[xTile][yTile + 1].setRevealed(true);\n }\n }\n }", "public void moverJugador(char letra) {\n switch (letra) {\n case 'w':\n for(int b=0;b<rectangles.length;b++){\n if(rectangles[b].overlaps(rectangle.set(x,y+3,AnchoJugador,largoJugador))){//Comprobamos si en el array de rectangles hacer overlaps con nuestro jugador\n olision=true;//Si lo hace olision se vuelve true y no se movera\n break;\n }else{\n olision=false;//Si no lo hace olision de volvera false y se movera\n }\n }\n if(olision==false){\n for(int b=0;b<colisiones.getSalida().length;b++){\n if(colisiones.getSalida()[b].overlaps(rectangle.set(x,y,AnchoJugador,largoJugador))){//Comprobamos si nuestro personaje hace overlaps con alguna salida\n switch (colisiones.getObj2()[b].getName()){//Si colisiona este switch se encargara de ver con que salida estamos chocando mediante el nombre de los rectangulos(Esto se pone en el tiled)\n case \"salidaBajo\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,358,10));\n break;\n case \"salida1\":\n main.dispose();\n main.setPantallaActual(new MapaInicial(main,347,298,main.getScreen().getBd()));\n break;\n case \"salida2\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,80,140));\n break;\n case \"miCasa\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,194,10));\n break;\n case \"bichos\":\n main.dispose();\n main.setPantallaActual(new MapaBichos(main,100,100));\n break;\n case \"salidaPuebloBichos\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,196,22));\n break;\n }\n }\n }\n y=y+3;\n }else{\n\n }\n\n break;\n case 's':\n for(int b=0;b<rectangles.length;b++){\n if(rectangles[b].overlaps(rectangle.set(x,y-3,AnchoJugador,largoJugador))){\n olision=true;\n break;\n }else{\n olision=false;\n }\n }\n if(olision==false){\n for(int b=0;b<colisiones.getSalida().length;b++){\n if(colisiones.getSalida()[b].overlaps(rectangle.set(x,y,AnchoJugador,largoJugador))){\n System.out.println(\"colisionando\");\n switch (colisiones.getObj2()[b].getName()){\n case \"salidaBajo\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,358,140));\n break;\n case \"salida1\":\n main.dispose();\n main.setPantallaActual(new MapaInicial(main,347,298,main.getScreen().getBd()));\n break;\n case \"salida2\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,80,140));\n break;\n case \"miCasa\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,194,10));\n break;\n case \"bichos\":\n main.dispose();\n main.setPantallaActual(new MapaBichos(main,100,100));\n break;\n case \"salidaPuebloBichos\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,196,22));\n break;\n }\n }\n }\n\n y=y-3;\n }\n break;\n case 'd':\n for(int b=0;b<rectangles.length;b++){\n if(rectangles[b].overlaps(rectangle.set(x+3,y,AnchoJugador,largoJugador))){\n olision=true;\n break;\n }else{\n olision=false;\n }\n }\n if(olision==false){\n for(int b=0;b<colisiones.getSalida().length;b++){\n if(colisiones.getSalida()[b].overlaps(rectangle.set(x,y,AnchoJugador,largoJugador))){\n System.out.println(\"colisionando\");\n switch (colisiones.getObj2()[b].getName()){\n case \"salidaBajo\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,358,140));\n break;\n case \"salida1\":\n main.dispose();\n main.setPantallaActual(new MapaInicial(main,347,298,main.getScreen().getBd()));\n break;\n case \"salida2\":\n main.dispose();\n main.getScreen().dispose();\n main.setPantallaActual(new MapaPueblo(main,80,140));\n break;\n case \"miCasa\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,194,10));\n break;\n case \"bichos\":\n main.dispose();\n main.setPantallaActual(new MapaBichos(main,100,100));\n case \"salidaPuebloBichos\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,196,22));\n break;\n }\n }\n }\n x=x+3;\n }\n break;\n case 'a':\n for(int b=0;b<rectangles.length;b++){\n if(rectangles[b].overlaps(rectangle.set(x-3,y,AnchoJugador,largoJugador))){\n olision=true;\n break;\n }else{\n olision=false;\n }\n }\n if(olision==false){\n for(int b=0;b<colisiones.getSalida().length;b++){\n if(colisiones.getSalida()[b].overlaps(rectangle.set(x,y,AnchoJugador,largoJugador))){\n System.out.println(\"colisionando\"+colisiones.getObj2()[b].getName());\n switch (colisiones.getObj2()[b].getName()){\n case \"salidaBajo\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,358,140));\n break;\n case \"salida1\":\n main.dispose();\n main.setPantallaActual(new MapaInicial(main,347,298,main.getScreen().getBd()));\n break;\n case \"salida2\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,80,140));\n break;\n case \"miCasa\":\n main.dispose();\n main.setPantallaActual(new MapaPlantaBaja(main,194,10));\n break;\n case \"bichos\":\n main.dispose();\n main.setPantallaActual(new MapaBichos(main,100,100));\n case \"salidaPuebloBichos\":\n main.dispose();\n main.setPantallaActual(new MapaPueblo(main,196,22));\n break;\n }\n }\n }\n x=x-3;\n }\n break;\n }\n }", "public Place goNorth();", "@Override\r\n\tprotected void generateAreas() {\n\t\tPerlinNoise noise = new PerlinNoise((int) getSeed(), perlinTemplate.getScale(), perlinTemplate.getOctaves(), perlinTemplate.getPersistence());\r\n\t\tfor (int y = 0; y < getHeight(); y ++) {\r\n\t\t\tfor (int x = 0; x < getWidth(); x ++) {\r\n\t\t\t\tif (getValue(x, y) != BASE) {\r\n\t\t\t\t\tif (noise.perlinNoise(x, y) > perlinTemplate.getThreshold()) {\r\n\t\t\t\t\t\tsetValue(x, y, WALL);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsetValue(x, y, FLOOR);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private ResizeContext getHoverArea(Point p) {\n ResizeContext toRet = null;\n ResizeType resizeType = null;\n Point resizePoint = null;\n for (Rectangle rectangle : originalAreas) {\n if (isMatch(new Point(rectangle.x, rectangle.y), p)) {\n resizeType = ResizeType.CORNER;\n resizePoint = new Point(rectangle.x, rectangle.y); \n } else if (isMatch(new Point(rectangle.x + rectangle.width, rectangle.y), p)) {\n resizeType = ResizeType.CORNER;\n resizePoint = new Point(rectangle.x + rectangle.width, rectangle.y); \n } else if (isMatch(new Point(rectangle.x, rectangle.y + rectangle.height), p)) {\n resizeType = ResizeType.CORNER;\n resizePoint = new Point(rectangle.x, rectangle.y + rectangle.height); \n } else if (isMatch(new Point(rectangle.x + rectangle.width, rectangle.y + rectangle.height), p)) {\n resizeType = ResizeType.CORNER;\n resizePoint = new Point(rectangle.x + rectangle.width, rectangle.y + rectangle.height);\n } \n // TODO The side resizing is not yet supported.\n// else if (isMatch(new Point(rectangle.x + rectangle.width / 2, rectangle.y), p)) {\n// resizeType = ResizeType.SIDE;\n// resizePoint = new Point(rectangle.x + rectangle.width / 2, rectangle.y); \n// } else if (isMatch(new Point(rectangle.x + rectangle.width, rectangle.y + rectangle.height / 2), p)) {\n// resizeType = ResizeType.SIDE;\n// resizePoint = new Point(rectangle.x + rectangle.width, rectangle.y + rectangle.height / 2); \n// } else if (isMatch(new Point(rectangle.x, rectangle.y + rectangle.height / 2), p)) {\n// resizeType = ResizeType.SIDE;\n// resizePoint = new Point(rectangle.x, rectangle.y + rectangle.height / 2); \n// } else if (isMatch(new Point(rectangle.x + rectangle.width / 2, rectangle.y + rectangle.height), p)) {\n// resizeType = ResizeType.SIDE;\n// resizePoint = new Point(rectangle.x + rectangle.width / 2, rectangle.y + rectangle.height); \n// }\n\n if (resizeType != null) {\n toRet = new ResizeContext(resizeType, resizePoint, rectangle);\n break;\n }\n }\n\n return toRet;\n }", "private void moveMonsters() {\r\n\t\tfor (AreaOrMonster obj : areas) {\r\n\t\t\tif(obj.getLeftRight()) {\r\n\t\t\t\tif(!pirate1.currentLocation.equals(new Point(obj.getX()+1, obj.getY())) && !pirate2.currentLocation.equals(new Point(obj.getX()+1, obj.getY()))) {\r\n\t\t\t\t\tobj.move();\r\n\t\t\t\t\tobj.getImageView().setX(obj.getX() * scalingFactor);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(!pirate1.currentLocation.equals(new Point(obj.getX()-1, obj.getY())) && !pirate2.currentLocation.equals(new Point(obj.getX()-1, obj.getY()))) {\r\n\t\t\t\t\tobj.move();\r\n\t\t\t\t\tobj.getImageView().setX(obj.getX() * scalingFactor);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void initializeLandmarks()\n\t{\n\t\t// Do nothing if not set\n\t\tif (startingMinionPerArea == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Check starting landmark for each area\n\t\tfor(Area area : board.getAreaList())\n\t\t{\n\t\t\tint number = area.getNumber();\n\t\t\tInteger minionCount = startingMinionPerArea.get(number);\n\t\t\tif (minionCount != null)\n\t\t\t{\n\t\t\t\tfor(int i = 0; i < minionCount; i++)\n\t\t\t\t{\n\t\t\t\t\tfor(Player player : playerList)\n\t\t\t\t\t{\n\t\t\t\t\t\tarea.addMinion(player.removeMinion());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract void findArea();", "abstract void findArea();", "private void cs8() {\n\t\t\t\n\t\n\t\t\tif(new Tile(3088,3092,0).matrix(ctx).reachable()){\n\t\t\t\t\n\t\t\t\tif(new Tile(3079,3084,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\t\tMethod.interactO(9709, \"Open\", \"Door\");\n\t\t\t\t}else ctx.movement.step(new Tile(3079,3084,0));\n\t\t\t\t\n\t\t\t}else if(new Tile(3090,3092,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\tfinal int[] bounds = {140, 108, -84, 144, -64, 136};\n\t\t\t\tGameObject gate = ctx.objects.select().id(GATEBYFISH).each(Interactive.doSetBounds(bounds)).select(Interactive.areInViewport()).nearest().poll();\n\t\t\t\tgate.interact(\"Open\",\"\");\n\t\t\t}else ctx.movement.step(new Tile(3090,3092,0));\n\t\t\t\n\t\t\t\n\t\t}", "private void createSwitches() {\n \t\tswitches = new Point[4];\n \t\tswitches[0] = new Point(centreMin, centreMin);\n \t\tswitches[1] = new Point(centreMin, centreMax-1);\n \t\tswitches[2] = new Point(centreMax-1, centreMin);\n \t\tswitches[3] = new Point(centreMax-1, centreMax-1);\n \t}", "public void localize() {\n //Turn robot to 45 degrees\n leftMotor.setSpeed(ROTATE_SPEED);\n rightMotor.setSpeed(ROTATE_SPEED);\n initialRedValue = leftRedVal;\n Navigation.turnTo(45);\n \n //Proceed forward until the color sensors detect lines\n while(Math.abs(leftRedVal - initialRedValue) < rgbThres || Math.abs(rightRedVal - initialRedValue) < rgbThres) {\n leftMotor.forward();\n rightMotor.forward();\n }\n leftMotor.stop(true);\n rightMotor.stop(false);\n \n //Make the robot turn left until the left sensor finds it\n \n //make the robot turn right until the right sensor finds it\n \n //do calculations\n \n //turn robot back to facing north\n }", "private void createFloor2Connections(IndoorVertex stairs, IndoorVertex elevator)\n {\n armesConnectionNorth = new IndoorVertex(building, new XYPos(1000, 151.19), 2);\n armesConnectionSouth = new IndoorVertex(building, new XYPos(1000, 158.75), 2);\n IndoorVertex rm239_fac_science = new IndoorVertex(building, new XYPos(1030.24, 97.11), 2);\n IndoorVertex _30_151 = new IndoorVertex(building, new XYPos(1030.24, 151.19), 2);\n IndoorVertex _30_179 = new IndoorVertex(building, new XYPos(1030.24, 179.65), 2);\n exit = new IndoorVertex(building, new XYPos(1030.24, 188.41), 2);\n IndoorVertex rm211_library = new IndoorVertex(building, new XYPos(1080.25, 173.29), 2);\n IndoorVertex _44_160 = new IndoorVertex(building, new XYPos(1044.19, 160.49), 2);\n IndoorVertex _44_173 = new IndoorVertex(building, new XYPos(1044.19, 173.29), 2);\n IndoorVertex _30_173 = new IndoorVertex(building, new XYPos(1030.24, 173.29), 2);\n IndoorVertex _30_158 = new IndoorVertex(building, new XYPos(1030.24, 158.75), 2);\n IndoorVertex _44_154 = new IndoorVertex(building, new XYPos(1044.19, 154.1), 2);\n IndoorVertex _30_154 = new IndoorVertex(building, new XYPos(1030.24, 154.1), 2);\n\n //Rooms\n ArrayList<IndoorVertex> rm211 = new ArrayList<>();\n rm211.add(rm211_library);\n\n rooms.put(\"211\", rm211);\n\n ArrayList<IndoorVertex> rm239 = new ArrayList<>();\n rm239.add(rm239_fac_science);\n\n rooms.put(\"239\", rm239);\n\n //Connections to other points\n connectVertex(armesConnectionSouth, _30_158);\n connectVertex(armesConnectionNorth, _30_151);\n connectVertex(_30_151, rm239_fac_science);\n connectVertex(_30_151, _30_154);\n connectVertex(_30_154, _44_154);\n connectVertex(_30_154, _30_158);\n connectVertex(_30_158, _44_154);\n connectVertex(_30_158, _44_160);\n connectVertex(_30_158, _30_173);\n connectVertex(_30_173, _44_173);\n connectVertex(_30_173, _30_179);\n connectVertex(_30_179, exit);\n connectVertex(_44_154, elevator);\n connectVertex(_44_154, _44_160);\n connectVertex(_44_160, stairs);\n connectVertex(_44_160, _44_173);\n connectVertex(_44_173, rm211_library);\n\n }", "public Shape getAreaColision();", "public void setAreaOfInterest(ReferencedEnvelope aoe) {\n PBounds cRect = getCamera().getViewBounds();\n ReferencedEnvelope envelope = new ReferencedEnvelope(getCRS());\n\n double dx = aoe.getWidth() / cRect.getWidth();\n double dy = aoe.getHeight() / cRect.getHeight();\n\n double scale;\n double wid, hi;\n if (dx > dy) {\n scale = dx;\n } else { //dy > dx\n scale = dy;\n }\n wid = scale * cRect.getWidth();\n hi = scale * cRect.getHeight();\n\n double w2 = wid / 2.0;\n double h2 = hi / 2.0;\n\n envelope.init(aoe.getMedian(0) - w2, aoe.getMedian(0) + w2, aoe.getMedian(1) - h2, aoe.getMedian(1) + h2);\n setAreaOfInterest_preScaled(envelope);\n }", "public abstract boolean isInterior();", "public void returnDefualt() {\r\n this.x = (float)getWidth()/2;\r\n this.y = (float)getHeight()/2;\r\n notifyObservers(normelizeAilron(this.x), normelizeElevator(this.y));\r\n }", "public interface ConflictRegionStrategy extends AlgStrategy {}", "public static int area_intersection(int blx1, int bly1, int trx1,int try1, int blx2, int bly2,int trx2,int try2){\r\n\t\tint base = 0, height = 0, area = 0;\r\n\t\r\n\t\tif (blx2>=blx1 && blx2<=trx1){\r\n\t\t\tif (bly2>=bly1 && bly2<=try1){\r\n\tif (trx2<=trx1 && trx2>=blx1){\r\n\tbase = trx2 - blx2;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\telse{\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tif( blx1>=blx2 && blx1<=trx2){\r\n\tbase = trx1 - blx1;\r\n\theight = try2 - bly2;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (blx1>=blx2 && blx1<=trx2){\r\n\t if( bly1>=bly2 && bly1<=try2){\r\n\tbase = trx1 - blx1;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t }\r\n\tif( trx2>=blx1 && trx2<=trx1){\r\n\tbase = trx2 - blx1;\r\n\theight = try2 - bly1;\r\n\tarea = base * height;\r\n\t}\r\n\t\t}\r\n\t//end\r\n\r\n\t\telse if (bly2>=bly1 && bly2<=try1){\r\n\tbase = trx1 - blx2;\r\n\theight = try1 - bly1;\r\n\tarea = base * height;\r\n\t\t}\r\n\t//end\r\n\r\n\t\t//else if(trx1 - blx2)==0 || (try1 - bly1)==0 || !(trx1>blx2 and trx2>trx1 && bly2<=bly1){\r\n\t//area = 0\r\n\t\t//}\r\n\t//end\r\n\t \r\n\t//if( area && area<=2147483647 )\r\n\t//area\r\n\t//else\r\n\t//-1\r\n\t//end\r\n\r\n\t\treturn area;\r\n\t}", "@Override\n\tpublic void roadChanged() {\n\t\tthis.from_x=this.from.getX();\n\t\tthis.from_y=this.from.getY();\n\t\tthis.to_x=this.to.getX();\n\t\tthis.to_y=this.to.getY();\n\t\tthis.getTopLevelAncestor().repaint();\n\t\tthis.repaint();\n//\t\tthis.getParent().repaint();\n\t}", "private void buildPanelEast() {\n\r\n }", "public void reinitiallizeDistanceFunctionInside() {\n\t\tint i, j;\r\n\t\tfor (i = 0; i < _levelSet.length; i++) {\r\n\t\t\tfor (j = 0; j < _levelSet[i].length; j++) {\r\n\t\t\t\tint iPlus = imposeBorder(i + 1, _iSize);\r\n\t\t\t\tint iMinus = imposeBorder(i - 1, _iSize);\r\n\t\t\t\tint jPlus = imposeBorder(j + 1, _iSize);\r\n\t\t\t\tint jMinus = imposeBorder(j - 1, _iSize);\r\n\t\t\t\tif (_levelSet[i][j] <= 0) // // the check for points in region\r\n\t\t\t\t\t// // the check for points in border\r\n\t\t\t\t\tif (MatrixMath.anyNeighborIsOutside(_levelSet, i, j, iPlus,\r\n\t\t\t\t\t\t\tiMinus, jPlus, jMinus)) {\r\n\t\t\t\t\t\t// points in border are placed in narrowband\r\n\t\t\t\t\t\t// _narrowBandInside.add(new Location(i, j));\r\n\t\t\t\t\t\t_narrowBandInside.add(new Location(i, j));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// and location in distance matrix is set to infinite\r\n\t\t\t\t\t\t_levelSet[i][j] = Double.NEGATIVE_INFINITY;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// iterate until narrow band is empty\r\n\t\t// OrderByLevelSetValue comparator = new OrderByLevelSetValue();\r\n\t\t// while (_narrowBandInside.size() > 0) {\r\n\t\twhile (_narrowBandInside.size() > 0) {\r\n\t\t\t// get the maximum value\r\n\t\t\t// Location maxVal = _narrowBandInside.last();\r\n\t\t\tLocation maxVal = _narrowBandInside.last();\r\n\t\t\t// System.out.println(\"maxVal \" + maxVal);\r\n\t\t\t// System.out.println(\"_narrowBandInside.contains(maxVal) \"\r\n\t\t\t// + _narrowBandInside.contains(maxVal));\r\n\t\t\t// System.out.println(\"maxVal.compareTo(maxVal) \"\r\n\t\t\t// + maxVal.compareTo(maxVal));\r\n\r\n\t\t\t// get the neighbors that are still in _faraway\r\n\t\t\tint iPlus = imposeBorder(maxVal.i + 1, _iSize);\r\n\t\t\tint iMinus = imposeBorder(maxVal.i - 1, _iSize);\r\n\t\t\tint jPlus = imposeBorder(maxVal.j + 1, _iSize);\r\n\t\t\tint jMinus = imposeBorder(maxVal.j - 1, _iSize);\r\n\t\t\ttransferNeighborInside(iPlus, maxVal.j);\r\n\t\t\ttransferNeighborInside(iMinus, maxVal.j);\r\n\t\t\ttransferNeighborInside(maxVal.i, jPlus);\r\n\t\t\ttransferNeighborInside(maxVal.i, jMinus);\r\n\t\t\t// remove the value from the narrowband\r\n\t\t\t// _narrowBandInside.remove(maxVal);\r\n\t\t\t_narrowBandInside.remove(maxVal);\r\n\t\t}\r\n\t\t// done\r\n\t}", "public Area GetNextAreaRandom(Area area)\n\n {\n\n Random rand = new Random();\n\n int i = 0;\n\n switch(area.paths)\n\n {\n\n case Constants.North:\n\n i = rand.nextInt(2);\n\n if(i==0)\n\n return area.areaMap.get(Constants.North);\n\n if(i==1)\n\n return area;\n\n case Constants.South:\n\n if(i==0)\n\n return area.areaMap.get(Constants.South);\n\n if(i==1)\n\n return area;\n\n \n\n case Constants.East:\n\n if(i==0)\n\n return area.areaMap.get(Constants.East);\n\n if(i==1)\n\n return area;\n\n \n\n case Constants.West:\n\n if(i==0)\n\n return area.areaMap.get(Constants.West);\n\n if(i==1)\n\n return area;\n\n \n\n \n\n case Constants.NorthAndSouth:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthAndEast:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 2)\n\n return area;\n\n case Constants.SouthAndEast:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.SouthAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.EastAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthSouthAndEast:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 3)\n\n return area;\n\n case Constants.NorthSouthAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 3)\n\n return area;\n\n case Constants.NorthEastAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 3)\n\n return area;\n\n case Constants.SouthEastAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 3)\n\n return area;\n\n \n\n case Constants.NorthSouthEastAndWest:\n\n i = rand.nextInt(5);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 3)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 4)\n\n return area;\n\n }\n\n \n\n return area;\n\n \n\n \n\n }", "public void checkwarp(){\n\t\tif(pacman.ypos > (colours[0].length*interval)-2){\r\n\t\t\tpacman.ypos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.xpos > (colours.length*interval)-2){\r\n\t\t\tpacman.xpos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.ypos < interval+2){\r\n\t\t\tpacman.ypos = (colours[0].length*interval)-2;\r\n\t\t}\r\n\t\telse if(pacman.xpos < interval+2){\r\n\t\t\tpacman.xpos = (colours.length*interval)-2;\r\n\t\t}\r\n\t\t\r\n\t}", "public void testAreaInfo()\n\t{\n\t\tGameArea ga = new GameArea();\n\t\tga.areaInfo();\n\t\tga.setConditionsMet(true);\n\t\tga.setAreaProgress(1);\n\t\tga.areaInfo();\n\t\tga.areaInfo();\n\t\tga.setLoot(null);\n\t\tga.areaInfo();\n\t}", "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}", "static void adjustOrientation(Triangulator triRef, int i1, int i2) {\n\n\tdouble area;\n\tint i, outer;\n\tint ind;\n\n\tif(i1 >= i2)\n\t System.out.println(\"Orientation:adjustOrientation Problem i1>=i2 !!!\");\n\n\tif (triRef.numLoops >= triRef.maxNumPolyArea) {\n\t // System.out.println(\"Orientation:adjustOrientation Expanding polyArea array .\");\n\t triRef.maxNumPolyArea = triRef.numLoops;\n\t double old[] = triRef.polyArea;\n\t triRef.polyArea = new double[triRef.maxNumPolyArea];\n\t if(old != null)\n\t\tSystem.arraycopy(old, 0, triRef.polyArea, 0, old.length);\n\t}\n\n\t// for each contour, compute its signed area, i.e., its orientation. the\n\t// contour with largest area is assumed to be the outer-most contour.\n\tfor (i = i1; i < i2; ++i) {\n\t ind = triRef.loops[i];\n\t triRef.polyArea[i] = polygonArea(triRef, ind);\n\t}\n\n\t// determine the outer-most contour\n\tarea = Math.abs(triRef.polyArea[i1]);\n\touter = i1;\n\tfor (i = i1 + 1; i < i2; ++i) {\n\t if (area < Math.abs(triRef.polyArea[i])) {\n\t\tarea = Math.abs(triRef.polyArea[i]);\n\t\touter = i;\n\t }\n\t}\n\n\t// default: the outer contour is referenced by loops[i1]\n\tif (outer != i1) {\n\t ind = triRef.loops[i1];\n\t triRef.loops[i1] = triRef.loops[outer];\n\t triRef.loops[outer] = ind;\n\n\t area = triRef.polyArea[i1];\n\t triRef.polyArea[i1] = triRef.polyArea[outer];\n\t triRef.polyArea[outer] = area;\n\t}\n\n\t// adjust the orientation\n\tif (triRef.polyArea[i1] < 0.0) triRef.swapLinks(triRef.loops[i1]);\n\tfor (i = i1 + 1; i < i2; ++i) {\n\t if (triRef.polyArea[i] > 0.0) triRef.swapLinks(triRef.loops[i]);\n\t}\n }", "public void decision(Entity[][] map, int y, int x){ \r\n if (!getTired()){\r\n // check if surrounding area is another animal\r\n if ((x > 0) && (y > 0) && (map[y-1][x-1] instanceof Animal )){\r\n destroyArea(map, x, y);\r\n }else if ((x < map.length-1) && (y < map.length -1) && (map[y+1][x+1] instanceof Animal)){\r\n destroyArea(map, x, y);\r\n }else if ((y > 0) && map[y-1][x] instanceof Animal){\r\n destroyArea(map, x, y);\r\n }else if ((x < map.length -1) && (y > 0) && (map[y-1][x+1] instanceof Animal)){\r\n destroyArea(map, x, y);\r\n }else if(( x < map.length -1) && (map[y][x+1] instanceof Animal)){\r\n destroyArea(map, x, y);\r\n }else if(( x > 0) && (map[y][x-1] instanceof Animal)){\r\n destroyArea(map, x, y);\r\n }else if( (y < map.length-1) && (map[y+1][x] instanceof Animal)){\r\n destroyArea(map, x, y);\r\n }else if((x > 0) && (y < map.length -1) && (map[y+1][x-1] instanceof Animal)){\r\n destroyArea(map, x, y);\r\n }else if (numOfTurns == 3){\r\n numOfTurns = 0;\r\n moveRandom(map, y, x);\r\n }\r\n }\r\n numOfTurns ++;\r\n }", "public void areaEffect(Player player){\n if(object.getProperties().containsKey(\"endLevel\")) {\n System.out.println(\"Fin du level\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n PlayScreen.setEndLevel();\n }\n\n if(object.getProperties().containsKey(\"startBossFight\")) {\n\n System.out.println(\"Start Boss Fight\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n\n TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 6, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 7, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 8, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 9, cell);\n\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 6, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 7, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 8, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 9, cell);\n\n PlayScreen.cameraChangeBoss(true);\n setCategoryFilterFixture(GameTest.GROUND_BIT, PlayScreen.getFixtureStartBoss());\n\n }\n\n if(object.getProperties().containsKey(\"blueKnight\")) {\n System.out.println(\"Changement en bleu\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n getCell().setTile(null);\n PlayScreen.setColorKnight(\"blue\");\n }\n\n if(object.getProperties().containsKey(\"greyKnight\")) {\n System.out.println(\"Changement en gris\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n getCell().setTile(null);\n PlayScreen.setColorKnight(\"grey\");\n }\n\n if(object.getProperties().containsKey(\"redKnight\")) {\n System.out.println(\"Changement en rouge\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n getCell().setTile(null);\n PlayScreen.setColorKnight(\"red\");\n }\n\n }", "public void enemymoveGarret(){\n\t\tint YEG = 0;\n\t\tint XEG = 0;\n\t\tint[] turns = new int[]{0,0,0,0,0,2,1,1,1,1,1,3};//dependign on the placement garret will move a certain way\n\t\tfor(int i = 0 ; i < this.Garret.length;i++){//this grabs garrets current locations\n\t\t\tfor(int p = 0; p < this.Garret.length;p++){\n\t\t\t\tif(this.Garret[i][p] == 1){\n\t\t\t\t\tYEG = i;\n\t\t\t\t\tXEG = p;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint move = turns[count];\n\t\tswitch(move){//first block is up and down second block is left and right\n\t\t\tcase 0:\n\t\t\t\tif(this.area[YEG][XEG-1] != \"[ ]\"){\n\t\t\t\t\tthis.Garret[YEG][XEG-1] = 1;//to turn left\n\t\t\t\t\tthis.Garret[YEG][XEG] = 0;\n\t\t\t\t\tcount++;\n\t\t\t\t\tif(count == 12){\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif(this.area[YEG][XEG+1] != \"[ ]\"){\n\t\t\t\t\tthis.Garret[YEG][XEG+1] = 1;//to turn right\n\t\t\t\t\tthis.Garret[YEG][XEG] = 0;\n\t\t\t\t\tcount++;\n\t\t\t\t\tif(count == 12){\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(this.area[YEG-1][XEG] != \"[ ]\"){\n\t\t\t\t\tthis.Garret[YEG-1][XEG] = 1;//to turn up\n\t\t\t\t\tthis.Garret[YEG][XEG] = 0;\n\t\t\t\t\tcount++;\n\t\t\t\t\tif(count == 12){\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif(this.area[YEG+1][XEG] != \"[ ]\"){\n\t\t\t\t\tthis.Garret[YEG+1][XEG] = 1;//to turn down\n\t\t\t\t\tthis.Garret[YEG][XEG] = 0;\n\t\t\t\t\tcount++;\n\t\t\t\t\tif(count == 12){\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}//end of switch\t\n\t}", "@Override\n\n\t//Method\n\tpublic void start (Stage primaryStage) {\n\t\tPane pane = new Pane();\n\n\t\t//Make the machine\n\t\tLine L1=new Line();\n\t\tL1.setStartX(180);\n\t\tL1.setStartY(39);\n\t\tL1.setEndX(285);\n\t\tL1.setEndY(168);\n\n\t\tLine L2=new Line();\n\t\tL2.setStartX(285);\n\t\tL2.setStartY(210);\n\t\tL2.setEndX(45);\n\t\tL2.setEndY(210);\n\n\t\tLine L3=new Line();\n\t\tL3.setStartX(150);\n\t\tL3.setStartY(39);\n\t\tL3.setEndX(45);\n\t\tL3.setEndY(168);\n\n\t\tLine L4=new Line();\n\t\tL4.setStartX(285);\n\t\tL4.setStartY(168);\n\t\tL4.setEndX(285);\n\t\tL4.setEndY(210);\n\n\t\tLine L5=new Line();\n\t\tL5.setStartX(45);\n\t\tL5.setStartY(210);\n\t\tL5.setEndX(45);\n\t\tL5.setEndY(168);\n\n\t\tLine L6=new Line();\n\t\tL6.setStartX(180);\n\t\tL6.setStartY(39);\n\t\tL6.setEndX(180);\n\t\tL6.setEndY(24);\n\n\t\tLine L7=new Line();\n\t\tL7.setStartX(150);\n\t\tL7.setStartY(39);\n\t\tL7.setEndX(150);\n\t\tL7.setEndY(24);\n\n\t\tLine L8=new Line();\n\t\tL8.setStartX(75);\n\t\tL8.setStartY(168);\n\t\tL8.setEndX(75);\n\t\tL8.setEndY(210);\n\n\t\tLine L9=new Line();\n\t\tL9.setStartX(105);\n\t\tL9.setStartY(168);\n\t\tL9.setEndX(105);\n\t\tL9.setEndY(210);\n\n\t\tLine L10=new Line();\n\t\tL10.setStartX(135);\n\t\tL10.setStartY(168);\n\t\tL10.setEndX(135);\n\t\tL10.setEndY(210);\n\n\t\tLine L11=new Line();\n\t\tL11.setStartX(165);\n\t\tL11.setStartY(168);\n\t\tL11.setEndX(165);\n\t\tL11.setEndY(210);\n\n\t\tLine L12=new Line();\n\t\tL12.setStartX(195);\n\t\tL12.setStartY(168);\n\t\tL12.setEndX(195);\n\t\tL12.setEndY(210);\n\n\t\tLine L13=new Line();\n\t\tL13.setStartX(255);\n\t\tL13.setStartY(168);\n\t\tL13.setEndX(255);\n\t\tL13.setEndY(210);\n\n\t\tLine L14=new Line();\n\t\tL14.setStartX(225);\n\t\tL14.setStartY(168);\n\t\tL14.setEndX(225);\n\t\tL14.setEndY(210);\n\n\t\tEllipse D1 = new Ellipse(165,60,5,5);\n\t\tEllipse D2 = new Ellipse(150,78,5,5);\n\t\tEllipse D3 = new Ellipse(180,78,5,5);\n\t\tEllipse D4 = new Ellipse(165,96,5,5);\n\t\tEllipse D5 = new Ellipse(195,96,5,5);\n\t\tEllipse D6 = new Ellipse(135,96,5,5);\n\t\tEllipse D7 = new Ellipse(120,114,5,5);\n\t\tEllipse D8 = new Ellipse(210,114,5,5);\n\t\tEllipse D9 = new Ellipse(150,114,5,5);\n\t\tEllipse D10 = new Ellipse(180,114,5,5);\n\t\tEllipse D11 = new Ellipse(225,132,5,5);\n\t\tEllipse D12 = new Ellipse(105,132,5,5);\n\t\tEllipse D13 = new Ellipse(135,132,5,5);\n\t\tEllipse D14 = new Ellipse(165,132,5,5);\n\t\tEllipse D15 = new Ellipse(195,132,5,5);\n\t\tEllipse D16 = new Ellipse(240,150,5,5);\n\t\tEllipse D17 = new Ellipse(90,150,5,5);\n\t\tEllipse D18 = new Ellipse(120,150,5,5);\n\t\tEllipse D19 = new Ellipse(150,150,5,5);\n\t\tEllipse D20 = new Ellipse(180,150,5,5);\n\t\tEllipse D21 = new Ellipse(210,150,5,5);\n\t\tEllipse D22 = new Ellipse(255,168,5,5);\n\t\tEllipse D23 = new Ellipse(75,168,5,5);\n\t\tEllipse D24 = new Ellipse(105,168,5,5);\n\t\tEllipse D25 = new Ellipse(135,168,5,5);\n\t\tEllipse D26 = new Ellipse(165,168,5,5);\n\t\tEllipse D27 = new Ellipse(195,168,5,5);\n\t\tEllipse D28 = new Ellipse(225,168,5,5);\n\n\t\t//Add all things in pane\n\t\tpane.getChildren().addAll(L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11,L12,L13,L14,D1,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12,D13,D14,D15,D16,D17,D18,D19,D20,D21,D22,D23,D24,D25,D26,D27,D28);\n\t\t//Add the pane in the scene\n\t\tScene scene = new Scene(pane, 480, 240);\n\t\t//Add scene in the stage\n\t\tprimaryStage.setScene(scene);\n\t\t//Show the stage\n\t\tprimaryStage.show();\n\t}", "public void interface1(){\n noStroke();\n fill(10,100);//light gray\n rect(0,60,600,590);\n fill(220);//gray\n noStroke();\n beginShape();\n vertex(365,40);\n vertex(600,40);\n vertex(600,80);\n vertex(365,80);\n vertex(345,60);\n endShape(CLOSE);\n fill(19,70,100,100);//dark blue\n rect(0,110,600,215);\n rect(0,380,600,215);\n}", "@Override\n\tpublic void motionScheme(int a){\n\t\tint i;\n\t\tArrayList<Dimension> list = new ArrayList<Dimension>();\n\t\tCase t;\n\t\tboolean ok=true;\n\t\t\n\t\ti = this.x-1;\n\t\twhile((i>-1)&&ok){\n\t\t\tt = Window.getTabCase(i,y);\n\t\t\t\n\t\t\tif((t.getOccupant()==null)){\n\t\t\t\tlist.add(new Dimension(y,i));\n\t\t\t}else if(((t.getOccupant().getColor()!=this.col))){//Si la case est occupee par une piece de couleur differente\n\t\t\t\tif(a!=1){\n\t\t\t\t\tif(t.getOccupant().getRep().substring(0,3).equals(\"Roi\")){\n\t\t\t\t\t\tt.getOccupant().inChess(this);\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlist.add(new Dimension(y,i));\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlist.add(new Dimension(y,i));\n\t\t\t\t\tok=false;\n\t\t\t\t}\n\t\t\t}else if(((t.getOccupant().getColor()==this.col))){\n\t\t\t\tok=false;\n\t\t\t}\n\t\t\t--i;\n\t\t}\n\t\t\n\t\tok=true;\n\t\ti = this.x+1;\n\t\twhile((i<8)&&ok){\n\t\t\tt = Window.getTabCase(i,y);\n\t\t\t\n\t\t\tif((t.getOccupant()==null)){\n\t\t\t\tlist.add(new Dimension(y,i));\n\t\t\t}else if(((t.getOccupant().getColor()!=this.col))){//Si la case est occupee par une piece de couleur differente\n\t\t\t\tif(a!=1){\n\t\t\t\t\tif(t.getOccupant().getRep().substring(0,3).equals(\"Roi\")){\n\t\t\t\t\t\tt.getOccupant().inChess(this);\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlist.add(new Dimension(y,i));\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlist.add(new Dimension(y,i));\n\t\t\t\t\tok=false;\n\t\t\t\t}\n\t\t\t}else if(((t.getOccupant().getColor()==this.col))){\n\t\t\t\tok=false;\n\t\t\t}\n\t\t\t++i;\n\t\t}\n\t\t\n\t\tok=true;\n\t\ti = this.y-1;\n\t\twhile((i>-1)&&ok){\n\t\t\tt = Window.getTabCase(x,i);\n\t\t\t\n\t\t\tif((t.getOccupant()==null)){\n\t\t\t\tlist.add(new Dimension(i,x));\n\t\t\t}else if(((t.getOccupant().getColor()!=this.col))){//Si la case est occupee par une piece de couleur differente\n\t\t\t\tif(a!=1){\n\t\t\t\t\tif(t.getOccupant().getRep().substring(0,3).equals(\"Roi\")){\n\t\t\t\t\t\tt.getOccupant().inChess(this);\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlist.add(new Dimension(i,x));\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlist.add(new Dimension(i,x));\n\t\t\t\t\tok=false;\n\t\t\t\t}\n\t\t\t}else if(((t.getOccupant().getColor()==this.col))){\n\t\t\t\tok=false;\n\t\t\t}\n\t\t\t--i;\n\t\t}\n\t\t\n\t\t\n\t\tok=true;\n\t\ti = this.y+1;\n\t\twhile((i<8)&&ok){\n\t\t\tt = Window.getTabCase(x,i);\n\t\t\t\n\t\t\tif((t.getOccupant()==null)){\n\t\t\t\tlist.add(new Dimension(i,x));\n\t\t\t}else if(((t.getOccupant().getColor()!=this.col))){//Si la case est occupee par une piece de couleur differente\n\t\t\t\tif(a!=1){\t\n\t\t\t\t\tif(t.getOccupant().getRep().substring(0,3).equals(\"Roi\")){//piece dans la case == Roi\n\t\t\t\t\t\tt.getOccupant().inChess(this);\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}else{//occupant de la case different d'un Roi\n\t\t\t\t\t\tlist.add(new Dimension(i,x));\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlist.add(new Dimension(i,x));\n\t\t\t\t\tok=false;\n\t\t\t\t}\n\t\t\t}else if(((t.getOccupant().getColor()==this.col))){//case occupee par une piece de meme couleur\n\t\t\t\tok=false;\n\t\t\t}\n\t\t\t++i;\n\t\t}\n\t\t\n\t\tthis.dep = list;\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 createAreas(ElectionEvent electionEvent, Locale locale) {\n\n\t\tCountry norge = new Country(\"47\", \"Norge\", electionEvent);\n\t\tentityManager.persist(norge);\n\n\t\tCountyStatus countyStatusApproved = (CountyStatus) entityManager.createQuery(\"select cs from CountyStatus cs where cs.id = \"\n\t\t\t\t+ (Integer) CountyStatusEnum.APPROVED_CONFIGURATION.id()).getSingleResult();\n\t\tCounty osloFylke = new County(\"03\", \"Oslo\", norge);\n\t\tosloFylke.setLocale(locale);\n\t\tosloFylke.setCountyStatus(countyStatusApproved);\n\t\tentityManager.persist(osloFylke);\n\n\t\tMunicipalityStatus statusApproved = (MunicipalityStatus) entityManager.createQuery(\"select ms from MunicipalityStatus ms where ms.id = \"\n\t\t\t\t+ (Integer) MunicipalityStatusEnum.APPROVED_CONFIGURATION.id()).getSingleResult();\n\n\t\tMunicipality osloKommune = new Municipality(AreaPath.OSLO_MUNICIPALITY_ID, \"Oslo\", osloFylke);\n\t\tosloKommune.setLocale(locale);\n\t\tosloKommune.setMunicipalityStatus(statusApproved);\n\t\tosloKommune.setElectronicMarkoffs(true);\n\t\tosloKommune.setRequiredProtocolCount(true);\n\t\tosloKommune.setTechnicalPollingDistrictsAllowed(true);\n\t\tentityManager.persist(osloKommune);\n\n\t\tBorough bydelGamleOslo = new Borough(\"030101\", \"Gamle Oslo\", osloKommune);\n\t\tbydelGamleOslo.setMunicipality1(false);\n\t\tentityManager.persist(bydelGamleOslo);\n\n\t\tPollingDistrict kampenSkole = new PollingDistrict(\"0103\", \"Kampen skole\", bydelGamleOslo);\n\t\tkampenSkole.setMunicipality(false);\n\t\tkampenSkole.setParentPollingDistrict(false);\n\t\tkampenSkole.setTechnicalPollingDistrict(false);\n\t\tentityManager.persist(kampenSkole);\n\t}", "private void pickLayoutForSequenceFlow() {\n if (sourceAbsoluteCenterX == targetAbsoluteCenterX) {\n setEdgeDirectCenter();\n return;\n } else if (sourceAbsoluteCenterY == targetAbsoluteCenterY) {\n if (areCellsHorizontalFree()) {\n setEdgeDirectCenter();\n } else {\n setEdgeAroundTheCorner(true);\n }\n return;\n }\n\n if (sourceAbsoluteCenterX <= targetAbsoluteCenterX && sourceAbsoluteCenterY <= targetAbsoluteCenterY) {\n if (sourceJoin && sourceSplit) {\n setEdgeStepRight();\n return;\n } else if (sourceSplit) {\n setEdge90DegreeRightUnderClockwise();\n return;\n } else if (targetJoin) {\n setEdge90DegreeRightUnderAntiClockwise();\n return;\n }\n } else if (sourceAbsoluteCenterX > targetAbsoluteCenterX && sourceAbsoluteCenterY <= targetAbsoluteCenterY) {\n // target is left under\n if (sourceJoin && sourceSplit) {\n setEdgeStepRight();\n return;\n } else if (sourceSplit) {\n setEdge90DegreeRightAboveAntiClockwise();\n return;\n } else if (targetJoin) {\n setEdge90DegreeRightAboveClockwise();\n return;\n }\n }\n\n if (sourceJoin && sourceSplit && (!backwards)) {\n setEdgeStepRight();\n return;\n }\n\n if (sourceSplit && targetJoin) {\n setEdgeAroundTheCorner(true);\n return;\n }\n\n setEdgeDirectCenter();\n }", "public void fill(ELandscapeType type, IMapArea area) {\n\t\tList<ShortPoint2D> points = area.stream().filterBounds(width, height).toList();\n\t\tlandscapeEditor.fill(type, points);\n\n\t\tif(backgroundListener != null) {\n\t\t\tint size = points.size();\n\t\t\tfor(int i = 0; i != size; i++) {\n\t\t\t\tShortPoint2D pt = points.get(i);\n\t\t\t\tbackgroundListener.backgroundLineChangedAt(pt.x, pt.y, 1);\n\t\t\t}\n\t\t}\n\t}", "public void swim() {\r\n\t\tif(super.getPosition()[0] == Ocean.getInstance().getWidth()-71){\r\n\t\t\tinvX = true;\r\n\t\t} else if(super.getPosition()[0] == 0){\r\n\t\t\tinvX = false;\r\n\t\t}\r\n\t\tif(super.getPosition()[1] == Ocean.getInstance().getDepth()-71){\r\n\t\t\tinvY = true;\r\n\t\t} else if(super.getPosition()[1] == 0){\r\n\t\t\tinvY = false;\r\n\t\t}\r\n\t\tif(invX){\r\n\t\t\tsuper.getPosition()[0]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[0]+=1;\r\n\t\t}\r\n\t\tif(invY){\r\n\t\t\tsuper.getPosition()[1]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[1]+=1;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void motionScheme(int a){\n\t\tint i,j;\n\t\tCase t;\n\t\tboolean ok=true;\n\t\tArrayList<Dimension> list = new ArrayList<Dimension>();\n\t\t\n\t\t\n\t\t/*en bas a droite*/\n\t\ti = this.x+1;\n\t\tj = this.y+1;\n\t\twhile((i<8)&&(j<8)&&ok){\n\t\t\tt = Window.getTabCase(i,j);\n\t\t\t\n\t\t\tif((t.getOccupant()==null)){\n\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t}else if(((t.getOccupant().getColor()!=this.col))){//Si la case est occupee par une piece de couleur differente\n\t\t\t\tif(a!=1){\t\n\t\t\t\t\tif(t.getOccupant().getRep().substring(0,3).equals(\"Roi\")){\n\t\t\t\t\t\tt.getOccupant().inChess(this);\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t\t\tok=false;\n\t\t\t\t}\n\t\t\t}else if(((t.getOccupant().getColor()==this.col))){\n\t\t\t\tok=false;\n\t\t\t}\n\t\t\t++i;\n\t\t\t++j;\n\t\t}\n\t\t\n\t\t/*en haut a droite*/\n\t\tok=true;\n\t\ti = this.x-1;\n\t\tj = this.y+1;\n\t\twhile((i>-1)&&(j<8)&&ok){\n\t\t\tt = Window.getTabCase(i,j);\n\t\t\t\n\t\t\tif((t.getOccupant()==null)){\n\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t}else if(((t.getOccupant().getColor()!=this.col))){//Si la case est occupee par une piece de couleur differente\n\t\t\t\tif(a!=1){\t\n\t\t\t\t\tif(t.getOccupant().getRep().substring(0,3).equals(\"Roi\")){\n\t\t\t\t\t\tt.getOccupant().inChess(this);\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t\t\tok=false;\n\t\t\t\t}\n\t\t\t}else if(((t.getOccupant().getColor()==this.col))){\n\t\t\t\tok=false;\n\t\t\t}\n\t\t\t--i;\n\t\t\t++j;\n\t\t}\n\t\t\n\t\t/*en bas a gauche*/\n\t\tok=true;\n\t\ti = this.x+1;\n\t\tj = this.y-1;\n\t\twhile((i<8)&&(j>-1)&&ok){\n\t\t\tt = Window.getTabCase(i,j);\n\t\t\t\n\t\t\tif((t.getOccupant()==null)){\n\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t}else if(((t.getOccupant().getColor()!=this.col))){//Si la case est occupee par une piece de couleur differente\n\t\t\t\tif(a!=1){\n\t\t\t\t\tif(t.getOccupant().getRep().substring(0,3).equals(\"Roi\")){\n\t\t\t\t\t\tt.getOccupant().inChess(this);\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t\t\tok=false;\n\t\t\t\t}\n\t\t\t}else if(((t.getOccupant().getColor()==this.col))){\n\t\t\t\tok=false;\n\t\t\t}\n\t\t\t++i;\n\t\t\t--j;\n\t\t}\n\t\t\n\t\t/*en haut a gauche*/ \n\t\tok=true;\n\t\ti = this.x-1;\n\t\tj = this.y-1;\n\t\twhile((i>-1)&&(j>-1)&&ok){\n\t\t\tt = Window.getTabCase(i,j);\n\t\t\t\n\t\t\tif((t.getOccupant()==null)){\n\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t}else if(((t.getOccupant().getColor()!=this.col))){//Si la case est occupee par une piece de couleur differente\n\t\t\t\tif(a!=1){\n\t\t\t\t\tif(t.getOccupant().getRep().substring(0,3).equals(\"Roi\")){//piece dans la case == Roi\n\t\t\t\t\t\tt.getOccupant().inChess(this);\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}else{//occupant de la case different d'un Roi\n\t\t\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t\t\t\tok=false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlist.add(new Dimension(j,i));\n\t\t\t\t\tok=false;\n\t\t\t\t}\n\t\t\t}else if(((t.getOccupant().getColor()==this.col))){//case occupee par une piece de meme couleur\n\t\t\t\tok=false;\n\t\t\t}\n\t\t\t--i;\n\t\t\t--j;\n\t\t}\n\t\t\n\t\tthis.dep = list;\t\t\n\t}", "public void lungs(Graphics bbg, int n, int length, int x, int y, double angle){\n double r1 = angle + Math.toRadians(-45);\n double r2 = angle + Math.toRadians(45);\n double r3 = angle + Math.toRadians(135);\n double r4 = angle + Math.toRadians(-135);\n\n //length modifications of the different branches\n double l1 = length/1.3 + (l1I*5);\n double l2 = length/1.3 + (l2I*5);\n double l3 = length/1.3 + (l3I*5);\n double l4 = length/1.3 + (l4I*5);\n\n //x and y points of the end of the different branches\n int ax = (int)(x - Math.sin(r1)*l1)+(int)(l1I);\n int ay = (int)(y - Math.cos(r1)*l1)+(int)(l1I);\n int bx = (int)(x - Math.sin(r2)*l2)+(int)(l2I);\n int by = (int)(y - Math.cos(r2)*l2)+(int)(l2I);\n int cx = (int)(x - Math.sin(r3)*l3)+(int)(l3I);\n int cy = (int)(y - Math.cos(r3)*l3)+(int)(l3I);\n int dx = (int)(x - Math.sin(r4)*l4)+(int)(l4I);\n int dy = (int)(y - Math.cos(r4)*l4)+(int)(l4I);\n\n if(n == 0){\n return;\n }\n\n\n increment();\n Color fluidC = new Color(colorR,colorG,colorB);\n //bbg.setColor(new Color((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random()*255)));\n bbg.setColor(fluidC);\n\n\n //draw different branches\n bbg.drawLine(x,y,ax,ay);\n bbg.drawLine(x,y,bx,by);\n bbg.drawLine(x,y,cx,cy);\n bbg.drawLine(x,y,dx,dy);\n\n\n\n //call recursively to draw fractal\n lungs(bbg, n - 1, (int)l1, ax,ay,r1);\n lungs(bbg, n - 1, (int)l2, bx,by,r2);\n lungs(bbg, n - 1, (int)l3, cx,cy,r3);\n lungs(bbg, n - 1, (int)l4, dx,dy,r4);\n\n\n }", "void object_calculations_touch_ground(){\n\n if (down_angle < 0 && up_angle > 0)//base case\n {\n double temp = up_angle;\n up_angle = down_angle;\n down_angle = temp;\n base_case();\n } else if ((down_angle > 0 && up_angle > 0) && (down_angle < up_angle))//smaller object\n {\n double temp = up_angle;\n up_angle = down_angle;\n down_angle = temp;\n measure_small_object();\n } else if (up_angle < 0 && down_angle > 0)//base case\n base_case();\n else //smaller object\n measure_small_object();\n }", "AngleResource inclination();", "public void toggleRegion(){\n\t\tif(getRegion() == regionNormal)\n\t\t\tsetRegion(regionDown);\n\t\t\n\t\telse if(getRegion() == regionDown)\n\t\t\tsetRegion(regionNormal);\t\t\n\t}", "private void loadAreas() {\r\n\t\tareas = map.getAreas();\r\n\t\tfor (Area area : areas) {\r\n\t\t\tfor (AreaOrMonster monster : area.getChildren()) {\r\n\t\t\t\tmonster.getImageView().setX(monster.getX() * scalingFactor);\r\n\t\t\t\tmonster.getImageView().setY(monster.getY() * scalingFactor);\r\n\t\t\t\troot.getChildren().add(monster.getImageView());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void loopy() {\n if (position.y < -50) {\n position.y = Constants.height + 50;\n } else\n if (position.y > Constants.height + 50) {\n position.y = -50;\n }\n if (position.x< -50) {\n position.x = Constants.width +50;\n } else if (position.x > Constants.width + 50) {\n position.x = -50;\n }\n }", "public void reinitiallizeDistanceFunctionOutside() {\n\t\tint i, j;\r\n\t\tfor (i = 0; i < _levelSet.length; i++) {\r\n\t\t\tfor (j = 0; j < _levelSet[i].length; j++) {\r\n\t\t\t\tint iPlus = imposeBorder(i + 1, _iSize);\r\n\t\t\t\tint iMinus = imposeBorder(i - 1, _iSize);\r\n\t\t\t\tint jPlus = imposeBorder(j + 1, _iSize);\r\n\t\t\t\tint jMinus = imposeBorder(j - 1, _iSize);\r\n\t\t\t\tif (_levelSet[i][j] > 0) // // the check for points in region\r\n\t\t\t\t\t// // the check for points in border\r\n\t\t\t\t\tif (MatrixMath.anyNeighborIsInside(_levelSet, i, j, iPlus,\r\n\t\t\t\t\t\t\tiMinus, jPlus, jMinus)) {\r\n\t\t\t\t\t\t// points in border are placed in narrowband\r\n\t\t\t\t\t\t_narrowBandOutside.add(new Location(i, j,\r\n\t\t\t\t\t\t\t\t_levelSet[i][j]));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// and location in distance matrix is set to infinite\r\n\t\t\t\t\t\t_levelSet[i][j] = Double.POSITIVE_INFINITY;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// iterate until narrow band is empty\r\n\t\t// OrderByLevelSetValue comparator = new OrderByLevelSetValue();\r\n\t\t// int lixo = 0;\r\n\t\twhile (_narrowBandOutside.size() > 0) {\r\n\t\t\t// if (lixo++ > 5000) {\r\n\t\t\t// System.out.println(\"done \" + lixo);\r\n\t\t\t// break;\r\n\t\t\t// }\r\n\t\t\t// get the minimum value\r\n\t\t\tLocation minVal = _narrowBandOutside.first();\r\n\t\t\t// get the neighbors that are still in _faraway\r\n\t\t\tint iPlus = imposeBorder(minVal.i + 1, _iSize);\r\n\t\t\tint iMinus = imposeBorder(minVal.i - 1, _iSize);\r\n\t\t\tint jPlus = imposeBorder(minVal.j + 1, _iSize);\r\n\t\t\tint jMinus = imposeBorder(minVal.j - 1, _iSize);\r\n\t\t\ttransferNeighborOutside(iPlus, minVal.j);\r\n\t\t\ttransferNeighborOutside(iMinus, minVal.j);\r\n\t\t\ttransferNeighborOutside(minVal.i, jPlus);\r\n\t\t\ttransferNeighborOutside(minVal.i, jMinus);\r\n\t\t\t// remove the value from the narrowband\r\n\t\t\t_narrowBandOutside.remove(minVal);\r\n\t\t}\r\n\t\t// done\r\n\t}", "public void moverArriba() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, 1));\n }", "abstract double area();", "abstract double area();", "abstract double area();", "abstract double area();", "private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }", "public abstract int getArea();", "public void mouseClicked(MouseEvent e) {\n\t\t\tint x = e.getX();\n\t\t\tint y = e.getY();\n\n\t\t\t// selected area is highlighted by drawing a rectangle around it\n\t\t\t// areaLabel flashes the name of the area selected\n\t\t\tif ((x >= 230 && x <= 329) && (y >= 155 && y <= 295)) {\n\n\t\t\t\tsection = new Rectangle(230, 155, 99, 140);\n\t\t\t\trepaint();\n\t\t\t\tsectionLabel.setText(\"TOILET 1\");\n\n\t\t\t\tid = 1;\n\n\t\t\t} else if ((x >= 319 && x <= 480) && (y >= 225 && y <= 507)) {\n\t\t\t\tsection = new Rectangle(319, 225, 161, 282);\n\t\t\t\trepaint();\n\n\t\t\t\tsectionLabel.setText(\"BEDROOM 1\");\n\t\t\t\tsectionLabel.revalidate();\n\n\t\t\t\tid = 2;\n\n\t\t\t} else if ((x >= 478 && x <= 651) && (y >= 226 && y <= 437)) {\n\t\t\t\tsection = new Rectangle(478, 226, 173, 211);\n\t\t\t\trepaint();\n\n\t\t\t\tsectionLabel.setText(\"LIVING ROOM\");\n\t\t\t\tsectionLabel.revalidate();\n\n\t\t\t\tid = 3;\n\n\t\t\t} else if ((x >= 478 && x <= 686) && (y >= 450 && y <= 581)) {\n\t\t\t\tsection = new Rectangle(478, 450, 208, 131);\n\t\t\t\trepaint();\n\n\t\t\t\tsectionLabel.setText(\"DINING ROOM\");\n\t\t\t\tsectionLabel.revalidate();\n\n\t\t\t\tid = 4;\n\n\t\t\t} else if ((x >= 654 && x <= 779) && (y >= 227 && y <= 405)) {\n\t\t\t\tsection = new Rectangle(654, 227, 125, 178);\n\t\t\t\trepaint();\n\n\t\t\t\tsectionLabel.setText(\"KITCHEN\");\n\t\t\t\tsectionLabel.revalidate();\n\n\t\t\t\tid = 5;\n\n\t\t\t} else if ((x >= 776 && x <= 929) && (y >= 225 && y <= 404)) {\n\t\t\t\tsection = new Rectangle(776, 225, 153, 179);\n\t\t\t\trepaint();\n\n\t\t\t\tsectionLabel.setText(\"BEDROOM 2\");\n\t\t\t\tsectionLabel.revalidate();\n\n\t\t\t\tid = 6;\n\n\t\t\t} else if ((x >= 688 && x <= 782) && (y >= 460 && y <= 589)) {\n\t\t\t\tsection = new Rectangle(688, 460, 94, 129);\n\t\t\t\trepaint();\n\n\t\t\t\tsectionLabel.setText(\"TOILET 2\");\n\t\t\t\tsectionLabel.revalidate();\n\n\t\t\t\tid = 7;\n\t\t\t} else if ((x >= 929 && x <= 1094) && (y >= 226 && y <= 486)) {\n\t\t\t\tsection = new Rectangle(929, 224, 165, 262);\n\t\t\t\trepaint();\n\n\t\t\t\tsectionLabel.setText(\"MASTER BEDROOM\");\n\n\t\t\t\tsectionLabel.revalidate();\n\n\t\t\t\tid = 8;\n\n\t\t\t} else if ((x >= 958 && x <= 1095) && (y >= 489 && y <= 590)) {\n\t\t\t\tsection = new Rectangle(958, 489, 137, 101);\n\t\t\t\trepaint();\n\n\t\t\t\tsectionLabel.setText(\"TOILET 3\");\n\t\t\t\tsectionLabel.revalidate();\n\n\t\t\t\tid = 9;\n\n\t\t\t} else if ((x >= 346 && x <= 1095) && (y >= 138 && y <= 223)) {\n\t\t\t\tsection = new Rectangle(346, 138, 748, 85);\n\t\t\t\trepaint();\n\n\t\t\t\tsectionLabel.setText(\"BALCONY\");\n\t\t\t\tsectionLabel.revalidate();\n\n\t\t\t\tid = 10;\n\t\t\t} else {\n\t\t\t\tsection = null;\n\t\t\t\tsectionLabel.setText(\"\");\n\n\t\t\t\tid = 0;\n\t\t\t}\n\n\t\t}", "private void createAccess(ArrayList<Room> rooms) {\n\n rooms.get(0).setNorth(rooms.get(1));\n\n rooms.get(1).setEast(rooms.get(2));\n rooms.get(1).setWest(rooms.get(4));\n rooms.get(1).setSouth(rooms.get(0));\n\n rooms.get(2).setWest(rooms.get(1));\n rooms.get(2).setNorth(rooms.get(10));\n rooms.get(2).setEast(rooms.get(3));\n\n rooms.get(3).setWest(rooms.get(2));\n\n rooms.get(4).setWest(rooms.get(5));\n rooms.get(4).setNorth(rooms.get(8));\n rooms.get(4).setEast(rooms.get(1));\n\n rooms.get(5).setNorth(rooms.get(7));\n rooms.get(5).setSouth(rooms.get(6));\n rooms.get(5).setEast(rooms.get(4));\n\n rooms.get(6).setNorth(rooms.get(5));\n\n rooms.get(7).setNorth(rooms.get(13));\n rooms.get(7).setSouth(rooms.get(5));\n\n rooms.get(8).setEast(rooms.get(9));\n rooms.get(8).setSouth(rooms.get(4));\n\n rooms.get(9).setWest(rooms.get(8));\n rooms.get(9).setNorth(rooms.get(15));\n rooms.get(9).setEast(rooms.get(10));\n\n rooms.get(10).setWest(rooms.get(9));\n rooms.get(10).setEast(rooms.get(11));\n rooms.get(10).setSouth(rooms.get(2));\n\n rooms.get(11).setWest(rooms.get(10));\n\n rooms.get(12).setEast(rooms.get(13));\n\n rooms.get(13).setWest(rooms.get(12));\n rooms.get(13).setEast(rooms.get(14));\n rooms.get(13).setSouth(rooms.get(7));\n\n rooms.get(14).setWest(rooms.get(13));\n rooms.get(14).setNorth(rooms.get(18));\n rooms.get(14).setEast(rooms.get(15));\n\n rooms.get(15).setWest(rooms.get(14));\n rooms.get(15).setNorth(rooms.get(19));\n rooms.get(15).setEast(rooms.get(16));\n rooms.get(15).setSouth(rooms.get(9));\n\n rooms.get(16).setWest(rooms.get(15));\n rooms.get(16).setEast(rooms.get(17));\n\n rooms.get(17).setWest(rooms.get(16));\n\n rooms.get(18).setSouth(rooms.get(14));\n\n rooms.get(19).setSouth(rooms.get(13));\n\n }", "protected void groupBoardArea(){\n for (int i = 0; i < norseCityArea.getComponents().length; i++){\n if (norseCityArea.getComponent(i) instanceof JLabel){\n norseCity.add((JLabel)norseCityArea.getComponent(i));\n }\n }\n for (int i = 0; i < greekCityArea.getComponents().length; i++){\n if (greekCityArea.getComponent(i) instanceof JLabel){\n greekCity.add((JLabel)greekCityArea.getComponent(i));\n }\n }\n for (int i = 0; i < egyptCityArea.getComponents().length; i++){\n if (egyptCityArea.getComponent(i) instanceof JLabel){\n egyptCity.add((JLabel)egyptCityArea.getComponent(i));\n }\n }\n for (int i = 0; i < norseProductArea.getComponents().length; i++){\n if (norseProductArea.getComponent(i) instanceof JLabel){\n norseProduction.add((JLabel)norseProductArea.getComponent(i));\n }\n }\n for (int i = 0; i < greekProductArea.getComponents().length; i++){\n if (greekProductArea.getComponent(i) instanceof JLabel){\n greekProduction.add((JLabel)greekProductArea.getComponent(i));\n }\n }\n for (int i = 0; i < egyptProductArea.getComponents().length; i++){\n if (egyptProductArea.getComponent(i) instanceof JLabel){\n egyptProduction.add((JLabel)egyptProductArea.getComponent(i));\n }\n }\n }", "public void specialMove() {\n\t\tChessSquare initial = getSquare();\n\t\tChessSquare next;\n\t\t\n\t\tif(initial.getNorth() != null){\n\t\t\tnext = initial.getNorth();\n\t\t\t\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getEast() != null)\n\t\t\t\tif((next.getEast().getOccupant() == null) || (!next.getEast().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getWest() != null && next.getWest().getOccupant() == null)\n\t\t\t\tif((next.getWest().getOccupant() == null) || (!next.getWest().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t}\n\t\t\n\t\tif(initial.getSouth() != null){\n\t\t\tnext = initial.getSouth();\n\t\t\t\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getEast() != null)\n\t\t\t\tif((next.getEast().getOccupant() == null) || (!next.getEast().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getWest() != null)\n\t\t\t\tif((next.getWest().getOccupant() == null) || (!next.getWest().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t\t\n\t\t}\n\t\t\n\t\tnext = initial.getEast();\n\t\tif(next != null)\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\tnext = initial.getWest();\n\t\tif(next != null)\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\tsetCountdown(9);\n\t}", "public void updateOptimalCollisionArea();", "double area() {\nSystem.out.println(\"Inside Area for Rectangle.\");\nreturn dim1 * dim2;\n }", "public void setIns() {\n\t\tImage p1= null, f1 = null;\n\t\ttry {\n\t\t\tp1 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P1.png\"));\n\t\t\tf1 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P1 = new ImageView(p1);\n\t\tP1.setFitHeight(360); \n\t\tP1.setFitWidth(600);\n\t\tImageView F1 = new ImageView(f1);\n\t\tF1.setX(545); \n\t\tF1.setY(305);\n\t\tF1.setFitHeight(50); \n\t\tF1.setFitWidth(50);\n\n\t\tGroup insP1 = new Group(P1, F1);\n\t\tScene scene1 = new Scene(insP1, 600, 360);\n\n\t\tImage p2= null, b2 = null, f2 = null;\n\t\ttry {\n\t\t\tp2 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P2.png\"));\n\t\t\tb2 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t\tf2 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P2 = new ImageView(p2);\n\t\tP2.setFitHeight(360); \n\t\tP2.setFitWidth(600);\n\t\tImageView B2 = new ImageView(b2);\n\t\tB2.setX(5); \n\t\tB2.setY(305);\n\t\tB2.setFitHeight(50); \n\t\tB2.setFitWidth(50);\n\t\tImageView F2 = new ImageView(f2);\n\t\tF2.setX(545); \n\t\tF2.setY(305);\n\t\tF2.setFitHeight(50); \n\t\tF2.setFitWidth(50);\n\n\t\tGroup insP2 = new Group(P2, F2, B2);\n\t\tScene scene2 = new Scene(insP2, 600, 360);\n\n\t\tImage p3= null, b3 = null, f3 = null;\n\t\ttry {\n\t\t\tp3 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P3.png\"));\n\t\t\tb3 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t\tf3 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P3 = new ImageView(p3);\n\t\tP3.setFitHeight(360); \n\t\tP3.setFitWidth(600);\n\t\tImageView B3 = new ImageView(b3);\n\t\tB3.setX(5); \n\t\tB3.setY(305);\n\t\tB3.setFitHeight(50); \n\t\tB3.setFitWidth(50);\n\t\tImageView F3 = new ImageView(f3);\n\t\tF3.setX(545); \n\t\tF3.setY(305);\n\t\tF3.setFitHeight(50); \n\t\tF3.setFitWidth(50);\n\n\t\tGroup insP3 = new Group(P3, F3, B3);\n\t\tScene scene3 = new Scene(insP3, 600, 360);\n\n\t\tImage p4= null, b4 = null, f4 = null;\n\t\ttry {\n\t\t\tp4 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P4.png\"));\n\t\t\tb4 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t\tf4 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P4 = new ImageView(p4);\n\t\tP4.setFitHeight(360); \n\t\tP4.setFitWidth(600);\n\t\tImageView B4 = new ImageView(b4);\n\t\tB4.setX(5); \n\t\tB4.setY(305);\n\t\tB4.setFitHeight(50); \n\t\tB4.setFitWidth(50);\n\t\tImageView F4 = new ImageView(f4);\n\t\tF4.setX(545); \n\t\tF4.setY(305);\n\t\tF4.setFitHeight(50); \n\t\tF4.setFitWidth(50);\n\n\t\tGroup insP4 = new Group(P4, B4, F4);\n\t\tScene scene4 = new Scene(insP4, 600, 360);\n\n\t\tImage p5= null, b5 = null;\n\t\ttry {\n\t\t\tp5 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P5.png\"));\n\t\t\tb5 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P5 = new ImageView(p5);\n\t\tP5.setFitHeight(360); \n\t\tP5.setFitWidth(600);\n\t\tImageView B5 = new ImageView(b5);\n\t\tB5.setX(5); \n\t\tB5.setY(305);\n\t\tB5.setFitHeight(50); \n\t\tB5.setFitWidth(50);\n\n\t\tGroup insP5 = new Group(P5, B5);\n\t\tScene scene5 = new Scene(insP5, 600, 360);\n\n\t\tStage newWindow = new Stage();\n\t\tnewWindow.setTitle(\"Instructions\");\n\t\tnewWindow.setScene(scene1);\n\t\tnewWindow.initModality(Modality.WINDOW_MODAL);\n\t\tnewWindow.initOwner(primaryStage);\n\n\t\tnewWindow.show();\n\n\t\tF1.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene2);\n\t\t\t}\n\t\t});\n\t\tB2.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene1);\n\t\t\t}\n\t\t});\n\t\tF2.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene3);\n\t\t\t}\n\t\t});\n\t\tB3.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene2);\n\t\t\t}\n\t\t});\n\t\tF3.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene4);\n\t\t\t}\n\t\t});\n\t\tB4.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene3);\n\t\t\t}\n\t\t});\n\t\tF4.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene5);\n\t\t\t}\n\t\t});\n\t\tB5.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene4);\n\t\t\t}\n\t\t});\n\t}", "public static Point2D[] CompressionRegion(Point2D[] vertices, double angle) {\r\n Point2D[] finalVertices = null;\r\n double NA = (NAdepth - minY) * 0.8;\r\n// System.out.println(\"NA: \" + NA);\r\n double newNA = minY + NA;\r\n double angleA;\r\n if (angle > 0.5) {\r\n angleA = angle;\r\n } else {\r\n angleA = 0.0;\r\n }\r\n\r\n //triangle: if both leftmost and rightmost corners are above the NADepth line\r\n if (leftmost.y > newNA && rightmost.y > newNA) {\r\n// System.out.println(\"case 1\");\r\n double x1 = NA / Math.tan(angleA * Math.PI / 180);\r\n double x2 = NA / Math.tan((90 - angleA) * Math.PI / 180);\r\n int[] xcoord = new int[3];\r\n int[] ycoord = new int[3];\r\n xcoord[0] = (int) topmost.x;\r\n xcoord[1] = (int) (topmost.x - x1);\r\n xcoord[2] = (int) (topmost.x + x2);\r\n ycoord[0] = (int) topmost.y;\r\n ycoord[1] = (int) newNA;\r\n ycoord[2] = (int) newNA;\r\n Point2D[] polyVertices = {new Point2D(xcoord[0], ycoord[0]), new Point2D(xcoord[1], ycoord[1]), new Point2D(xcoord[2], ycoord[2])};\r\n finalVertices = polyVertices;\r\n } //quadrilateral: if either point is below NADepth line(@ CASES FOR LEFT AND RIGHT MOST POINTS)\r\n else if (leftmost.y <= newNA && rightmost.y >= newNA) {\r\n double x2 = NA / Math.tan((90 - angleA) * Math.PI / 180);\r\n double x3 = (newNA - leftmost.y) / Math.tan((90 - angleA) * Math.PI / 180);\r\n// System.out.println(\" lx: \" + leftmost.x + \" ly: \" + leftmost.y + \"na\" + newNA);\r\n// System.out.println(\"x3: \" + x3);\r\n int[] xcoord = new int[4];\r\n int[] ycoord = new int[4];\r\n xcoord[0] = (int) topmost.x;\r\n xcoord[1] = (int) leftmost.x;\r\n xcoord[2] = (int) (leftmost.x + x3);\r\n xcoord[3] = (int) (topmost.x + x2);\r\n\r\n ycoord[0] = (int) topmost.y;\r\n ycoord[1] = (int) leftmost.y;\r\n ycoord[2] = (int) newNA;\r\n ycoord[3] = (int) newNA;\r\n Point2D[] polyVertices = {new Point2D(xcoord[0], ycoord[0]), new Point2D(xcoord[1], ycoord[1]), new Point2D(xcoord[2], ycoord[2]), new Point2D(xcoord[3], ycoord[3])};\r\n finalVertices = polyVertices;\r\n\r\n } else if (leftmost.y >= newNA && rightmost.y <= newNA) {\r\n double x1 = NA / Math.tan(angleA * Math.PI / 180);\r\n double x3 = (newNA - rightmost.y) / Math.tan(angleA * Math.PI / 180);\r\n// System.out.println(\" lx: \" + leftmost.x + \" ly: \" + leftmost.y + \"na\" + newNA);\r\n// System.out.println(\"x3: \" + x3);\r\n int[] xcoord = new int[4];\r\n int[] ycoord = new int[4];\r\n xcoord[0] = (int) topmost.x;\r\n xcoord[1] = (int) (topmost.x - x1);\r\n xcoord[2] = (int) (rightmost.x - x3);\r\n xcoord[3] = (int) rightmost.x;\r\n\r\n ycoord[0] = (int) topmost.y;\r\n ycoord[1] = (int) newNA;\r\n ycoord[2] = (int) newNA;\r\n ycoord[3] = (int) rightmost.y;\r\n Point2D[] polyVertices = {new Point2D(xcoord[0], ycoord[0]), new Point2D(xcoord[1], ycoord[1]), new Point2D(xcoord[2], ycoord[2]), new Point2D(xcoord[3], ycoord[3])};\r\n finalVertices = polyVertices;\r\n\r\n } //pentagon: if both points are below NADepth line\r\n else if (leftmost.y < newNA && rightmost.y < newNA) {\r\n double x3 = (newNA - leftmost.y) / Math.tan((90 - angleA) * Math.PI / 180);\r\n double x4 = (newNA - rightmost.y) / Math.tan(angleA * Math.PI / 180);\r\n// System.out.println(\" lx: \" + leftmost.x + \" ly: \" + leftmost.y + \"na\" + newNA);\r\n// System.out.println(\"x3: \" + x3);\r\n\r\n if (angle < 0.5) {\r\n int[] xcoord = new int[4];\r\n int[] ycoord = new int[4];\r\n xcoord[0] = (int) rightmost.x;\r\n xcoord[1] = (int) leftmost.x;\r\n xcoord[2] = (int) leftmost.x;\r\n xcoord[3] = (int) rightmost.x;\r\n\r\n ycoord[0] = (int) topmost.y;\r\n ycoord[1] = (int) topmost.y;\r\n ycoord[2] = (int) newNA;\r\n ycoord[3] = (int) newNA;\r\n Point2D[] polyVertices = {new Point2D(xcoord[0], ycoord[0]), new Point2D(xcoord[1], ycoord[1]), new Point2D(xcoord[2], ycoord[2]), new Point2D(xcoord[3], ycoord[3])};\r\n finalVertices = polyVertices;\r\n\r\n } else {\r\n int[] xcoord = new int[5];\r\n int[] ycoord = new int[5];\r\n xcoord[0] = (int) topmost.x;\r\n xcoord[1] = (int) leftmost.x;\r\n xcoord[2] = (int) (leftmost.x + x3);\r\n xcoord[3] = (int) (rightmost.x - x4);\r\n xcoord[4] = (int) rightmost.x;\r\n\r\n ycoord[0] = (int) topmost.y;\r\n ycoord[1] = (int) leftmost.y;\r\n ycoord[2] = (int) newNA;\r\n ycoord[3] = (int) newNA;\r\n ycoord[4] = (int) rightmost.y;\r\n Point2D[] polyVertices = {new Point2D(xcoord[0], ycoord[0]), new Point2D(xcoord[1], ycoord[1]), new Point2D(xcoord[2], ycoord[2]), new Point2D(xcoord[3], ycoord[3]), new Point2D(xcoord[4], ycoord[4])};\r\n finalVertices = polyVertices;\r\n\r\n }\r\n }\r\n return finalVertices;\r\n }", "@Override\n protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n super.onLayout(changed, left, top, right, bottom);\n\n horizon = (getHeight() - 100) / density;\n\n // set city coordinates\n float loc[] = new float[3];\n loc[0] = getWidth() / (density * 4);\n loc[1] = getWidth() / (density * 2);\n loc[2] = (getWidth() * 3) / (density * 4);\n\n for (int i = 0; i < cityCount; ++i) {\n cityLocations[i] = new PointF(loc[i], horizon);\n }\n }", "public void testArea() {\n\t CircleArc2D whole = new CircleArc2D(-10, -10, 5, 0, 4*PI);\r\n\t double expectedAreaWhile = PI*25; // \\pi * 5^2\r\n\r\n\t assertEquals(expectedAreaWhile, whole.getArea());\r\n\r\n\t // TODO: Pull in JCheck to supercharge this.\r\n\t Random r = new Random();\r\n\t double sweepExtent = r.nextDouble();\r\n\t CircleArc2D partial = new CircleArc2D(-10, -10, 5, 45, (4*PI)/sweepExtent);\r\n\t double expectedAreaParial = expectedAreaWhile / sweepExtent;\r\n\r\n\t assertEquals(expectedAreaParial, partial.getArea(), 0.0001);\r\n\t }", "private void collapseIgloo() {\n blocks.sort(Comparator.comparing(a -> a.center.getY()));\n\n double minDistance, distance;\n Point3D R = new Point3D(0, -1, 0);\n for (int i = 0; i < blocks.size(); i++) {\n minDistance = Double.MAX_VALUE;\n for (int j = i - 1; j >= 0; j--) {\n if (boundingSpheresIntersect(blocks.get(i), blocks.get(j))) {\n distance = minDistance(blocks.get(i), blocks.get(j), R);\n if (distance < minDistance) {\n minDistance = distance;\n }\n }\n }\n if (minDistance != Double.MAX_VALUE) {\n blocks.get(i).move(R.multiply(minDistance));\n }\n }\n }", "private void react_mainRegion_State2__region0_a() {\n\t\tif (check_mainRegion_State2_tr0_tr0()) {\n\t\t\teffect_mainRegion_State2_tr0();\n\t\t} else {\n\t\t\tif (check_mainRegion_State2__region0_a_tr0_tr0()) {\n\t\t\t\teffect_mainRegion_State2__region0_a_tr0();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void getarea(int a) {\n\t\t\r\n\t}", "private static boolean makeHallway(int[][] board, int[] from, int[] to, float[] filled, Random random) {\n // ignore out of bounds attempts\n if (!(from[X] >= 0 && from[X] < board.length && from[Y] >= 0 && from[Y] < board[0].length)\n || !(to[X] >= 0 && to[X] < board.length && to[Y] >= 0 && to[Y] < board[0].length)) {\n return false;\n }\n\n int x1 = from[X];\n int x2 = to[X];\n int y1 = from[Y];\n int y2 = to[Y];\n\n board[x1][y1] = ROOM;\n board[x2][y2] = ROOM;\n\n filled[0] += 2;\n\n // keep track of directional motion\n int dirX, dirY;\n\n // find initial direction\n if (x2 > x1)\n dirX = 1; // east\n else\n dirX = -1; // west\n if (y2 > y1)\n dirY = 1; // north\n else\n dirY = -1; // south\n\n // move into random direction\n boolean firstHorizontal = random.nextBoolean();\n boolean secondHorizontal = random.nextBoolean();\n\n // making a corridor might take awhile, just continue this iterative\n // process\n while (true) {\n\n if (x1 != x2 && y1 != y2) {\n // adjust the first tile iterator\n if (firstHorizontal)\n x1 += dirX;\n else\n y1 += dirY;\n }\n\n if (x1 != x2 && y1 != y2)\n // still not equal\n {\n // adjust the second tile iterator\n if (secondHorizontal)\n x2 -= dirX;\n else\n y2 -= dirY;\n }\n\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n if (board[x2][y2] == NULL) {\n board[x2][y2] = HALL;\n filled[0]++;\n }\n // check once more if the iterators match after moving\n // if the iterators are on the same level, try connecting them\n if (x1 == x2) {\n while (y1 != y2) {\n // adjust y until we reach destination\n y1 += dirY;\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n }\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n // return that we've connected the hallway successfully\n return true;\n }\n // iterators are on the same level horizontally, so we must now\n // connect across\n if (y1 == y2) {\n while (x1 != x2) {\n // adjust y until we reach destination\n x1 += dirX;\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n }\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n return true;\n }\n }\n }", "Rover(){\n\t\tthis.id = 0;\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.orientation = Directions.NORTH;\n\t\tthis.mapW=this.defaultMapW;\n\t\tthis.mapH=this.defaultMapH;\n\t}", "@Override\r\n\tpublic void calcArea() {\n\t\t\r\n\t}", "boolean land();", "@Override\r\n public void moverAyuda() {\n System.out.println(\"La reina puede mover hacia cualquier dirección en linea recta / diagonal\");\r\n }", "private void decorate(int xStart, int xLength, int floor, ArrayList finalListElements, ArrayList states)\r\n\t {\n\t if (floor < 1)\r\n\t \treturn;\r\n\r\n\t // boolean coins = random.nextInt(3) == 0;\r\n\t boolean rocks = true;\r\n\r\n\t //add an enemy line above the box\r\n\t Random r = new Random();\r\n\t boolean enemyAdded=addEnemyLine(xStart + 1, xLength - 1, floor - 1);\r\n\r\n\t int s = 1;\r\n\t int e = 1;\r\n\r\n\t if(enemyAdded==false)\r\n\t {\r\n\t if (floor - 2 > 0){\r\n\t \tif ((xLength - e) - (xStart + s) > 0){\r\n\t \t\tfor(int x = xStart + s; x < xLength- e; x++){\r\n\t \tboolean flag=true;\r\n\t \tfor(int i=0;i<states.size();i++)\r\n\t \t{\r\n\t \t\tElements element=(Elements)finalListElements.get(i);\r\n\t \t\t\tBlockNode state=(BlockNode)states.get(i);\r\n\t \t\t\t\r\n\t \t\t\tint xElement = (int)(initialStraight+state.getX());\r\n\t \t int floorC= (int)state.getY()+1;\r\n\t \t int widthElement=element.getWidth();\r\n\t \t int heigthElement=element.getHeigth()+2;\r\n\t \t \r\n\t \t int widthElementNext=1;\r\n\t \t int heigthElementNext=0;\r\n\t \t \r\n\t \t if(x+(widthElementNext-1)>=xElement && x<xElement+widthElement && (floor-1)-heigthElementNext<=floorC && (floor-1)>= floorC-heigthElement )\r\n\t \t {\r\n\t \t \tflag=false;\r\n\t \t \tbreak;\r\n\t \t }\r\n\t \t \t \t \t\t \t \r\n\t \t } \r\n\t \tif(flag==true)\r\n\t \t{\r\n\t \t\tsetBlock(x, floor - 1, COIN);\r\n\t \t}\r\n\t \r\n\t //COINS++;\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t s = random.nextInt(4);\r\n\t e = random.nextInt(4);\r\n\t \r\n\t //this fills the set of blocks and the hidden objects inside them\r\n\t /*\r\n\t if (floor - 4 > 0)\r\n\t {\r\n\t if ((xLength - 1 - e) - (xStart + 1 + s) > 2)\r\n\t {\r\n\t for (int x = xStart + 1 + s; x < xLength - 1 - e; x++)\r\n\t {\r\n\t if (rocks)\r\n\t {\r\n\t if (x != xStart + 1 && x != xLength - 2 && random.nextInt(3) == 0)\r\n\t {\r\n\t if (random.nextInt(4) == 0)\r\n\t {\r\n\t setBlock(x, floor - 4, BLOCK_POWERUP);\r\n\t //BLOCKS_POWER++;\r\n\t }\r\n\t else\r\n\t {\t//the fills a block with a hidden coin\r\n\t setBlock(x, floor - 4, BLOCK_COIN);\r\n\t //BLOCKS_COINS++;\r\n\t }\r\n\t }\r\n\t else if (random.nextInt(4) == 0)\r\n\t {\r\n\t if (random.nextInt(4) == 0)\r\n\t {\r\n\t setBlock(x, floor - 4, (byte) (2 + 1 * 16));\r\n\t }\r\n\t else\r\n\t {\r\n\t setBlock(x, floor - 4, (byte) (1 + 1 * 16));\r\n\t }\r\n\t }\r\n\t else\r\n\t {\r\n\t setBlock(x, floor - 4, BLOCK_EMPTY);\r\n\t //BLOCKS_EMPTY++;\r\n\t }\r\n\t }\r\n\t }\r\n\t //additionElementToList(\"Block\", 1,(xLength - 1 - e)-(xStart + 1 + s));\r\n\t }\r\n\t \r\n\t }*/\r\n\t }", "public abstract void isgameover(AnchorPane paneArena);", "public void drawArea(Graphics2D g, int width, int height, double minX,\n double minY, double maxX, double maxY) {\n upperX = maxX;\n lowerX = minX;\n\n upperY = maxY;\n lowerY = minY;\n //debug, drawLine bounds\n// g.drawLine(XOffSet, YOffSet, width, YOffSet);\n// g.drawLine(XOffSet, height, width, height); //X\n//\n// g.drawLine(XOffSet, YOffSet, XOffSet, height);\n// g.drawLine(width, YOffSet, width, height); //Y\n\n double Xscale = GetXScale(width);\n double Yscale = GetYScale(height);\n int centerX = getCenterX(width);\n int centerY = getCenterY(height);\n\n //drawGrid(g, width, height, minX, minY, maxX, maxY);\n\n //create a polygon for every area between two zeros\n g.setColor(LineColor);\n //ArrayList<Polygon> p = new ArrayList<>();\n Polygon p = new Polygon();\n //p.add(new Polygon());\n g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,\n Opacity));\n //p.get(0).addPoint(XOffSet, getCenterY(height));\n p.addPoint(XOffSet, getCenterY(height));\n for (int i = 0; i <= PointArray.length - 2; i += 2) {\n double x = ((PointArray[i] * Xscale) + centerX);\n double y = ((centerY) - (PointArray[i + 1]) * Yscale);\n if (x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {\n continue;\n }\n if (y == Double.POSITIVE_INFINITY || y == Double.NEGATIVE_INFINITY) {\n y = height - YOffSet;\n }\n //p.get(p.size() - 1).addPoint((int) x, (int) y);\n p.addPoint((int) x, (int) y);\n }\n //p.get(p.size() - 1).addPoint(width, getCenterY(height));\n p.addPoint(width, getCenterY(height));\n //for (int i = 0; i <= p.size() - 1; i++) {\n g.fill(p);//.get(i));\n //}\n g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1));\n drawLine(g, width, height, minX, minY, maxX, maxY);\n }", "public void generateAntHill(int x, int y, String colour) {\n for (int i = 0; i < 11; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[x*130+y+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[x*130+y+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next change the two rows above and below the centre\n for (int i = 0; i < 10; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+1)*130+y+1+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-1)*130+y+1+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+1)*130+y+1+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-1)*130+y+1+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next rows inset by one on the right\n for (int i = 0; i < 9; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+2)*130+y+1+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-2)*130+y+1+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+2)*130+y+1+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-2)*130+y+1+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next Row inset by one more on the left none on the right\n for (int i = 0; i < 8; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+3)*130+y+2+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-3)*130+y+2+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+3)*130+y+2+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-3)*130+y+2+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next Row inset by one more on the right and none on the left\n for (int i = 0; i < 7; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+4)*130+y+2+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-4)*130+y+2+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+4)*130+y+2+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-4)*130+y+2+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n \n // Next Row inset by one more on the left and none on the right\n for (int i = 0; i < 6; i++) {\n if (colour.equals(\"red\")) {\n worldGrid[(x+5)*130+y+3+i].setType(Cell.Type.REDANTHILL);\n worldGrid[(x-5)*130+y+3+i].setType(Cell.Type.REDANTHILL);\n } else {\n worldGrid[(x+5)*130+y+3+i].setType(Cell.Type.BLACKANTHILL);\n worldGrid[(x-5)*130+y+3+i].setType(Cell.Type.BLACKANTHILL);\n }\n }\n }", "public void terrainStates(){\n \tif(statesPad.getRawButton(portButton)){terrainStates = portState;}\n \telse if(statesPad.getRawButton(chevellButton)){terrainStates = chevellState;}\n \telse if(statesPad.getRawButton(ballGrabButton)){terrainStates = ballGrabState;}\n \telse if(statesPad.getRawButton(driveStateButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(lowBarButton)){terrainStates = lowBarState;}\n \telse if(statesPad.getRawButton(roughButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(rockButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(moatButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(rampartButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(drawButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(sallyButton)){terrainStates = driveState;}\n \telse if(statesPad.getRawButton(statesPadDefault) || drivePad.getRawButton(defaultButton)){terrainStates = driveState;}\n \t\n \tswitch (terrainStates) {\n\t \tcase 1: \n\t \t\tport();\n\t \t\tSystem.out.println(\"HERE IN ONE\");\n\t break;\n\t \tcase 2:\t\n\t \t\tchevell();\n\t \t\tSystem.out.println(\"HERE IN TWO\");\n\t \tbreak;\n\t case 3:\n\t \troughT();\n\t \tSystem.out.println(\"HERE IN THREE\");\n\t \tbreak;\n\t case 4: \n\t \tmoat();\n\t \tSystem.out.println(\"HERE IN FOUR\");\n\t \tbreak;\n\t case 5:\n\t \trampart();\n \t\t\tSystem.out.println(\"HERE IN FIVE\");\n \t\t\tbreak;\n\t case 6: \n\t \tdrawBridge();\n \t\t\tSystem.out.println(\"HERE IN SIX\");\n \t\t\tbreak;\n\t case 7: \n\t \tsallyPort();\n \t\t\tSystem.out.println(\"HERE IN SEVEN\");\n \t\t\tbreak;\n\t case 8: \n\t \tlowBar();\n\t \tSystem.out.println(\"HERE IN EIGHT\");\n\t \tbreak;\n\t case 9: \n\t \trockWall();\n \t\t\tSystem.out.println(\"HERE IN NINE\");\n \t\t\tbreak;\n\t case 10: \n\t \tballGrab();\n\t\t\t\tSystem.out.println(\"HERE IN TEN\");\n\t\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\t\tdrivingState();\n\t\t\t\tSystem.out.println(\"HERE IN TWELVE\");\n\t\t\t\tbreak;\n\t default: \n\t \t//reset all of the states\n\t \tportSwitch \t\t= 0;\n\t \tchevellSwitch\t= 0;\n\t \tballGrabSwitch\t= 0;\n\t \tdriveSwitch\t\t= 0;\n\t \tliftArm();\n\t \twheelArms();\n\t \tSystem.out.println(\"HERE IN DEFAULT\");\n \t}\n \tSystem.out.println(\"OUTSIDE THE SWITCH\");\n }", "public void calArea()\n {\n //Start of the formula\n for(int i = 0; i < sides-1; i++)\n {\n area += (poly[i].getX()*poly[i+1].getY())-(poly[i].getY()*poly[i+1].getX());\n }\n\n //half the total calculation\n area = area/2;\n\n //if area is negative times by -1\n if(area <= 0)\n {\n area = area*-1;\n }\n }", "private final void segmentsFrameEffects() {\n\t\tif (alive) {\n\t\t\tint i;\n\t\t\t// Energy obtained through photosynthesis\n\t\t\tdouble photosynthesis = 0;\n\t\t\t_nChildren = 1;\n\t\t\t_indigo =0;\n\t\t\t_lowmaintenance =0;\n\t\t\tint fertility =0;\n\t\t\tint yellowCounter =0;\n\t\t\tint reproduceearly =0;\n\t\t\tdouble goldenage =0;\n\t\t\t_isfrozen =false;\n\t\t\tboolean trigger =false;\n\t\t\tfor (i=_segments-1; i>=0; i--) {\n\t\t\t\t// Manteniment\n\t\t\t\tswitch (getTypeColor(_segColor[i])) {\n\t\t\t\t// \tMovement\n\t\t\t\tcase CYAN:\n\t\t\t\t\tif (Utils.random.nextInt(100)<8 && useEnergy(Utils.CYAN_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\tdx=Utils.between(dx+12d*(x2[i]-x1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\tdy=Utils.between(dy+12d*(y2[i]-y1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\tdtheta=Utils.between(dtheta+Utils.randomSign()*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEAL:\n\t\t\t\t\tif (_geneticCode.getPassive()) {\n\t\t\t\t\t\tif (_hasdodged == false) {\n\t\t\t\t\t\t\t_dodge =true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_lowmaintenance += 0.9 * _m[i];\n\t\t\t\t\t} else \n\t\t\t\t\t if (Utils.random.nextInt(100)<8 && useEnergy(Utils.CYAN_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t dx=Utils.between(dx+12d*(x2[i]-x1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\t dy=Utils.between(dy+12d*(y2[i]-y1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\t dtheta=Utils.between(dtheta+Utils.randomSign()*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Photosynthesis\n\t\t\t\tcase SPRING:\n\t\t\t\t\t if (_geneticCode.getClockwise()) {\n\t\t\t\t\t\t dtheta=Utils.between(dtheta+0.1*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t\t photosynthesis += Utils.SPRING_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t dtheta=Utils.between(dtheta-0.1*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t photosynthesis += Utils.SPRING_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIME:\n\t\t\t\t\tif (trigger == false) {\n\t\t\t\t\t\ttrigger =true;\n\t\t\t\t\t if (_world.fastCheckHit(this) != null) {\n\t\t\t\t\t \t_crowded =true;\n\t\t\t\t\t } else {\n\t\t\t\t\t \t_crowded =false;\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\tif (_crowded == true) {\n\t\t\t\t\t photosynthesis += Utils.CROWDEDLIME_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tphotosynthesis += Utils.LIME_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase JADE:\n\t\t\t\t\t_isjade =true;\n\t\t\t\t\tphotosynthesis += Utils.JADE_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase GREEN:\n\t\t\t\t\tphotosynthesis += Utils.GREEN_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase FOREST:\n\t\t\t\t\tphotosynthesis += Utils.FOREST_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase BARK:\n\t\t\t\t\tphotosynthesis += Utils.BARK_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase GRASS:\n\t\t\t\t\tphotosynthesis += Utils.GRASS_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase C4:\n\t\t\t\t\t_lowmaintenance += _m[i];\n\t\t\t\t\tphotosynthesis += Utils.C4_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// is a consumer\n\t\t\t\tcase RED:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase FIRE:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ORANGE:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase MAROON:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\t_lowmaintenance += 0.9 * _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase PINK:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tif (_isakiller < 2) {\n\t\t\t\t\t\t_lowmaintenance += 0.8 * _m[i];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase CREAM:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with yellow segments have more children\n\t\t\t\tcase YELLOW:\n\t\t\t\t\tyellowCounter++;\n\t\t\t\t\tfertility += _m[i];\n\t\t\t\t break;\n\t\t\t\t// Experienced parents have more children\n\t\t\t\tcase SILVER:\n\t\t\t\t\tif (_isaconsumer == false) {\n\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\tcase DARKGRAY:\n\t\t\t\t\t\tcase GRAY:\n\t\t\t\t\t\tcase LILAC:\n\t\t\t\t\t\tcase SPIKE:\n\t\t\t\t\t\tcase PLAGUE:\n\t\t\t\t\t\tcase CORAL:\n\t\t\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\t}}}\n\t\t\t\t\t if (_nTotalChildren >= 1 && _nTotalChildren < 5) {\n\t\t\t\t\t\t_nChildren = 2; \n\t\t\t\t\t} else if (_nTotalChildren >= 5 && _nTotalChildren < 14) {\n\t\t\t\t\t\t_nChildren = 3; \n\t\t\t\t\t} else if (_nTotalChildren >= 14 && _nTotalChildren < 30) {\n\t\t\t\t\t\t_nChildren = 4; \n\t\t\t\t\t} else if (_nTotalChildren >= 30 && _nTotalChildren < 55) {\n\t\t\t\t\t\t_nChildren = 5;\n\t\t\t\t\t} else if (_nTotalChildren >= 55 && _nTotalChildren < 91) {\n\t\t\t\t\t _nChildren = 6;\n\t\t\t\t\t} else if (_nTotalChildren >= 91 && _nTotalChildren < 140) {\n\t\t\t\t\t\t_nChildren = 7; \n\t\t\t\t\t} else if (_nTotalChildren >= 140) {\n\t\t\t\t\t\t_nChildren = 8;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Auburn always has one real child if infected\n\t\t\t\tcase AUBURN:\n\t\t\t\t\t_isauburn =true;\n\t\t\t\t\t_lowmaintenance += _m[i] - (Utils.AUBURN_ENERGY_CONSUMPTION * _m[i]);\n\t\t\t\t\tif (_infectedGeneticCode != null && _nChildren == 1) {\n\t\t\t\t\t\t_nChildren = 2;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with blond segments reproduce earlier\n\t\t\t\tcase BLOND:\n\t\t\t\t\treproduceearly += 3 + _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with indigo segments reduce the energy the new born virus receives\n\t\t\t\tcase INDIGO:\n\t\t\t\t\t_indigo += _m[i];\n\t\t\t\t\t_lowmaintenance += 0.8 * _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// Plague forces an organism to reproduce the virus\n\t\t\t\tcase PLAGUE:\n\t\t\t\t\t_isplague =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Coral transforms particles and viruses\n\t\t\t\tcase CORAL:\n\t\t\t\t\t_iscoral =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Mint immunity against infections\t\n\t\t\t\tcase MINT:\n\t\t\t\t\t_isantiviral =true;\n\t\t\t\t\tif (_infectedGeneticCode != null && Utils.random.nextInt(Utils.IMMUNE_SYSTEM)<=_m[i] && useEnergy(Utils.MINT_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t_infectedGeneticCode = null;\n\t\t\t\t\t\tsetColor(Utils.ColorMINT);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Healing\n\t\t\t\tcase MAGENTA:\n\t\t\t\t _isregenerative =true;\n\t\t\t\t for (int j = 0; j < _segments; j++) {\n\t\t\t\t if ((_segColor[j] == Utils.ColorLIGHTBROWN) || (_segColor[j] == Utils.ColorGREENBROWN) || (_segColor[j] == Utils.ColorPOISONEDJADE)\n\t\t\t\t\t\t|| (_segColor[j] == Utils.ColorBROKEN) || (_segColor[j] == Utils.ColorLIGHT_BLUE) || (_segColor[j] == Utils.ColorICE)\n\t\t\t\t\t\t|| (_segColor[j] == Utils.ColorDARKJADE) || (_segColor[j] == Utils.ColorDARKFIRE)) {\n\t\t\t\t\tif (Utils.random.nextInt(Utils.HEALING)<=_m[i] && useEnergy(Utils.MAGENTA_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t _segColor[j] = _geneticCode.getGene(j%_geneticCode.getNGenes()).getColor(); \n\t\t\t\t\t}}}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DARKFIRE:\n\t\t\t\t\tif (Utils.random.nextInt(100)<_geneticCode.getSymmetry() && useEnergy(Utils.MAGENTA_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t_segColor[i] = _geneticCode.getGene(i%_geneticCode.getNGenes()).getColor(); \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DARKJADE:\n\t\t\t\t\t_isjade =true;\n\t\t\t\t\tif (Utils.random.nextInt(Utils.DARKJADE_DELAY * _geneticCode.getSymmetry() * _geneticCode.getSymmetry())<8) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorJADE; \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Normalize spike\n\t\t\t\tcase SPIKEPOINT:\n\t\t\t\t\t_segColor[i] = Utils.ColorSPIKE;\n\t\t\t\t\tbreak;\n\t\t\t\t// is a killer\n\t\t\t\tcase SPIKE:\n\t\t\t\t\tif (_isenhanced) {\n\t\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\t}\n\t\t\t\t\tif (_isakiller == 0) {\n\t\t\t\t\t\t_isakiller = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LILAC:\n\t\t\t\t\tif (_isakiller == 0) {\n\t\t\t\t\t\t_isakiller = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase GRAY:\n\t\t\t\t\tif (_isakiller < 2) {\n\t\t\t\t\t _isakiller = 2;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// is poisonous\n\t\t\t\tcase VIOLET:\n\t\t\t\t\t_ispoisonous =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// is a freezer\n\t\t\t\tcase SKY:\n\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// is enhanced\n\t\t\t\tcase DARKGRAY:\n\t\t\t\t\t_isenhanced =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Energy transfer\n\t\t\t\tcase ROSE:\n\t\t\t\t\t_lowmaintenance += 0.99 * _m[i];\n\t\t\t\t\tif (_transfersenergy == false) {\n\t\t\t\t\t\t_transfersenergy =true;\n\t\t\t\t\t _lengthfriend = _geneticCode.getGene(i%_geneticCode.getNGenes()).getLength();\n\t\t\t\t\t _thetafriend = _geneticCode.getGene(i%_geneticCode.getNGenes()).getTheta();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Low maintenance\n\t\t\t\tcase DARK:\n\t\t\t\t\t_lowmaintenance += 0.99 * _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with gold segments live longer\n\t\t\t\tcase GOLD:\n\t\t\t\t\t_lowmaintenance += 0.9 * _m[i];\n\t\t\t\t\tgoldenage += (_m[i]/Utils.GOLD_DIVISOR);\n\t\t\t\t\t_geneticCode._max_age = Utils.MAX_AGE + ((_geneticCode.getNGenes() * _geneticCode.getSymmetry())/Utils.AGE_DIVISOR) + (int)goldenage;\n\t\t\t\t\tbreak;\n\t\t\t\t// is weakened\n\t\t\t\tcase LIGHTBROWN:\n\t\t\t\tcase GREENBROWN:\n\t\t\t\tcase POISONEDJADE:\n\t\t\t\t\tif (_remember) {\n\t\t\t\t\t\t_isjade =false;\n\t\t\t\t\t\t_isenhanced =false;\n\t\t\t\t\t\t_isantiviral =false;\n\t\t\t\t\t\t_isregenerative =false;\n\t\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\t\tcase JADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DARKJADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DARKGRAY:\n\t\t\t\t\t\t\t\t_isenhanced =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase MINT:\n\t\t\t\t\t\t\t\t_isantiviral =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase MAGENTA:\n\t\t\t\t\t\t\t\t_isregenerative =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t _geneticCode._max_age = Utils.MAX_AGE + ((_geneticCode.getNGenes() * _geneticCode.getSymmetry())/Utils.AGE_DIVISOR) + (int)goldenage;\n\t\t\t\t\t _remember =false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIGHT_BLUE:\n\t\t\t\t\tif (_isafreezer) {\n\t\t\t\t\t\t_isafreezer =false;\n\t\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\t\tcase SKY:\n\t\t\t\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DEEPSKY:\n\t\t\t\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// is frozen\n\t\t\t\tcase ICE:\n\t\t\t\t\t_isfrozen =true;\n\t\t\t\t\tif (_isjade) {\n\t\t\t\t\t\t_isjade =false;\n\t\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\t\tcase JADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DARKJADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DEADBARK:\n\t\t\t\t\t_isfrozen =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Restore abilities\n\t\t\t\tcase DARKLILAC:\n\t\t\t\t\tif (_isakiller == 0) {\n\t\t\t\t\t\t_isakiller = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (Utils.random.nextInt(100)<8) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorLILAC;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DEEPSKY:\n\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\tif (Utils.random.nextInt(100)<8) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorSKY;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DARKOLIVE:\n\t\t\t\t\tif (Utils.random.nextInt(100)<8 && useEnergy(Utils.OLIVE_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorOLIVE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Reset dodging\n\t\t\tif (_hasdodged == true) {\n\t\t\t\t_dodge =false;\n\t\t\t\t_hasdodged =false;\n\t\t\t}\n\t\t\t//Get sun's energy\n\t\t\tif (photosynthesis > 0) {\n\t\t\t\t_isaplant =true;\n\t\t\t _energy += _world.photosynthesis(photosynthesis);\t\t\t\n\t\t\t}\n\t\t\t// Calculate number of children\n\t\t\tif (fertility > 0) {\n\t\t\t\tif (_geneticCode.getSymmetry() != 3) {\n\t\t\t\t _nChildren += (yellowCounter / _geneticCode.getSymmetry()) + (fertility / 23);\n\t\t\t } else {\n\t\t\t \t_nChildren += (yellowCounter / _geneticCode.getSymmetry()) + (fertility / 34);\n\t\t\t }\n\t\t\t}\n\t\t\t// Calculate reproduction energy for blond segments\n\t\t\tif ((reproduceearly > 0) && (_infectedGeneticCode == null)) {\n\t\t\t\tif (_energy > _geneticCode.getReproduceEnergy() - reproduceearly + Utils.YELLOW_ENERGY_CONSUMPTION*(_nChildren-1)) {\n\t\t\t\t\tif ((!_isaplant) && (!_isaconsumer)) {\n\t\t\t\t\t\tif ((_energy >= 10) && (_growthRatio<16) && (useEnergy(Utils.BLOND_ENERGY_CONSUMPTION))) {\n\t\t\t\t\t\t\t_nChildren = 1;\n\t\t\t\t\t _geneticCode._reproduceEnergy = Math.max((40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry()) - reproduceearly, 10);\n\t\t\t\t\t reproduce();\n\t\t\t\t\t _geneticCode._reproduceEnergy = 40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry();\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ((_energy >= 30) && (_growthRatio==1) && (_timeToReproduce==0) && (useEnergy(Utils.BLOND_ENERGY_CONSUMPTION))) {\n\t\t\t\t\t\t _geneticCode._reproduceEnergy = Math.max((40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry()) - reproduceearly, 30);\n\t\t\t\t\t\t reproduce();\n\t\t\t\t\t\t _geneticCode._reproduceEnergy = 40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry();\t\t\t\t\t\t\t\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t}\n\t}", "double area() {\nSystem.out.println(\"Inside Area for Rectangle.\");\nreturn dim1 * dim2;\n}", "public void loopThroughEdge()\n {\n int margin = 2;\n\n if (getX() < margin) //left side\n { \n setLocation(getWorld().getWidth()+ margin, getY());\n }\n else if (getX() > getWorld().getWidth() - margin) //right side\n {\n setLocation(margin, getY());\n }\n\n if (getY() < margin) //top side\n { \n setLocation(getX(), getWorld().getHeight() - margin);\n }\n else if(getY() > getWorld().getHeight() - margin) //bottom side\n { \n setLocation(getX(), margin);\n }\n }", "public void run(){\n \n while (true){\n double p1Xnext =l1.getStart().getX()+v1p1;\n double p2Xnext =l2.getStart().getX()+v1p2;\n double p3Xnext =l3.getStart().getX()+v1p3;\n double p1Ynext =l1.getStart().getY()+v2p1;\n double p2Ynext =l2.getStart().getY()+v2p2;\n double p3Ynext =l3.getStart().getY()+v2p3;\n double p4Xnext =l1.getEnd().getX()+v1p1;\n double p5Xnext =l2.getEnd().getX()+v1p2;\n double p6Xnext =l3.getEnd().getX()+v1p3;\n double p4Ynext =l1.getEnd().getY()+v2p1;\n double p5Ynext =l2.getEnd().getY()+v2p2;\n double p6Ynext =l3.getEnd().getY()+v2p3;\n\n if (p1Xnext > l1.getCanvas().getWidth()){\n v1p1=-v1p1; \n }\n if (p1Xnext< 0){\n v1p1=-v1p1;\n \n }\n if (p1Ynext > l1.getCanvas().getHeight()){\n v2p1=-v2p1;\n \n }\n if (p1Ynext< 0){\n v2p1=-v2p1;\n }\n if (p2Xnext > l1.getCanvas().getWidth()){\n v1p2=-v1p2; \n }\n if (p2Xnext< 0){\n v1p2=-v1p2;\n \n }\n if (p2Ynext > l1.getCanvas().getHeight()){\n v2p2=-v2p2;\n \n }\n if (p2Ynext< 0){\n v2p2=-v2p2;\n \n }\n if (p3Xnext > l1.getCanvas().getWidth()){\n v1p3=-v1p3; \n }\n if (p3Xnext< 0){\n v1p3=-v1p3;\n \n }\n if (p3Ynext > l1.getCanvas().getHeight()){\n v2p3=-v2p3;\n \n }\n if (p3Ynext< 0){\n v2p3=-v2p3;\n }\n l1.setStart(l1.getStart().getX()+v1p1, l1.getStart().getY()+v2p1);\n l2.setStart(l2.getStart().getX()+v1p2, l2.getStart().getY()+v2p2);\n l3.setStart(l3.getStart().getX()+v1p3, l3.getStart().getY()+v2p3);\n l1.setEnd(l3.getStart());\n l2.setEnd(l1.getStart());\n l3.setEnd(l2.getStart());\n pause(10);\n \n \n \n }\n}", "public int area(String[] rectangles){\n TreeMap<Integer, Events> events = new TreeMap<>();\n\n int tag = 0;\n for(String r : rectangles){\n tag++;\n Scanner sc = new Scanner(r);\n int x1 = sc.nextInt();\n int y1 = sc.nextInt();\n int x2 = sc.nextInt();\n int y2 = sc.nextInt();\n if(!events.containsKey(x1))\n events.put(x1, new Events());\n if(!events.containsKey(x2))\n events.put(x1, new Events());\n\n events.get(x1).in.add(new YRange(y1, y2, tag));\n events.get(x2).out.add(new YRange(y1, y2, tag));\n }\n\n // Active set of tags for each unique y\n // we need to identify where each each rectangle starts & end\n // positve tag - start \n // negative tag - end\n // We need all of them sorted\n TreeSet<Pair> active = new TreeSet<Pair>(new Comparator<Pair>(){\n @Override\n public int compare(Pair a, Pair b){\n if(a.y == b.y)\n return Integer.compare(a.tag, b.tag);\n return Integer.compare(a.y, b.y);\n }\n });\n\n int area = 0;\n for(Map.Entry<Integer, Events> entry : events.entrySet()){\n int x = entry.getKey();\n Integer next_x = events.higherKey(x);\n // processed last unique x\n if(next_x == null) break;\n Events e = entry.getValue();\n\n // Construct the current active set\n for(YRange y : e.in){\n active.add(new Pair(y.y1, y.tag));\n active.add(new Pair(y.y2, -y.tag));\n }\n\n for(YRange y : e.out){\n active.remove(new Pair(y.y1, y.tag));\n active.remove(new Pair(y.y2, -y.tag));\n }\n // Compute union of y segments\n Integer lasty = null;\n int ySum = 0;\n int cnt = 0;\n for(Pair p : active){\n int y = p.y;\n if(cnt == 0){\n lasty = y;\n }\n // closing\n if(p.tag < 0) cnt--;\n else cnt++;\n\n if(cnt == 0){\n ySum += y - lasty;\n // reset lasty\n lasty = null;\n }\n }\n area += (next_x - x)*ySum;\n }\n return area;\n }", "private void switches() {\n finland.setChecked(true);\n chosenArea = \"Finland\";\n wholeWorld.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n europe.setChecked(false);\n nordic.setChecked(false);\n finland.setChecked(false);\n chosenArea = \"Whole world\";\n }\n }\n });\n europe.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n wholeWorld.setChecked(false);\n nordic.setChecked(false);\n finland.setChecked(false);\n chosenArea = \"Europe\";\n\n }\n }\n });\n nordic.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n wholeWorld.setChecked(false);\n europe.setChecked(false);\n finland.setChecked(false);\n chosenArea = \"Nordic countries and Estonia\";\n }\n }\n });\n finland.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n wholeWorld.setChecked(false);\n europe.setChecked(false);\n nordic.setChecked(false);\n chosenArea = \"Finland\";\n }\n }\n });\n }", "private void react_mainRegion_State1() {\n\t\tif (check_mainRegion_State1_tr0_tr0()) {\n\t\t\teffect_mainRegion_State1_tr0();\n\t\t}\n\t}", "public AABB a(World paramaqu, BlockPosition paramdt, Block parambec, float paramFloat, EnumDirection paramej)\r\n/* 147: */ {\r\n/* 148:175 */ if ((parambec.getType() == this) || (parambec.getType().getMaterial() == Material.air)) {\r\n/* 149:176 */ return null;\r\n/* 150: */ }\r\n/* 151:178 */ AABB localbrt = parambec.getType().a(paramaqu, paramdt, parambec);\r\n/* 152:180 */ if (localbrt == null) {\r\n/* 153:181 */ return null;\r\n/* 154: */ }\r\n/* 155:184 */ double d1 = localbrt.minX;\r\n/* 156:185 */ double d2 = localbrt.minY;\r\n/* 157:186 */ double d3 = localbrt.minZ;\r\n/* 158:187 */ double d4 = localbrt.maxX;\r\n/* 159:188 */ double d5 = localbrt.maxY;\r\n/* 160:189 */ double d6 = localbrt.maxZ;\r\n/* 161:192 */ if (paramej.g() < 0) {\r\n/* 162:193 */ d1 -= paramej.g() * paramFloat;\r\n/* 163: */ } else {\r\n/* 164:195 */ d4 -= paramej.g() * paramFloat;\r\n/* 165: */ }\r\n/* 166:197 */ if (paramej.h() < 0) {\r\n/* 167:198 */ d2 -= paramej.h() * paramFloat;\r\n/* 168: */ } else {\r\n/* 169:200 */ d5 -= paramej.h() * paramFloat;\r\n/* 170: */ }\r\n/* 171:202 */ if (paramej.i() < 0) {\r\n/* 172:203 */ d3 -= paramej.i() * paramFloat;\r\n/* 173: */ } else {\r\n/* 174:205 */ d6 -= paramej.i() * paramFloat;\r\n/* 175: */ }\r\n/* 176:207 */ return new AABB(d1, d2, d3, d4, d5, d6);\r\n/* 177: */ }" ]
[ "0.6241424", "0.5931451", "0.5776103", "0.5654852", "0.5609633", "0.55240285", "0.55033416", "0.53730065", "0.5362981", "0.5346694", "0.5346067", "0.5344232", "0.53110796", "0.53051895", "0.5300319", "0.5282189", "0.52801", "0.51883817", "0.51438046", "0.51304245", "0.51010525", "0.50950724", "0.5091967", "0.5091967", "0.5090824", "0.50796133", "0.50764346", "0.5068737", "0.50656915", "0.5064297", "0.505124", "0.5027736", "0.50244653", "0.5005961", "0.49935034", "0.49857932", "0.49820846", "0.4977677", "0.49765447", "0.49727702", "0.49641863", "0.49634802", "0.49484727", "0.49404106", "0.49384648", "0.4937491", "0.49274397", "0.49268165", "0.49252835", "0.49241892", "0.4919892", "0.4918627", "0.49163353", "0.49154338", "0.49086186", "0.49083441", "0.49060956", "0.490501", "0.4901656", "0.49009374", "0.48989764", "0.4896631", "0.48945418", "0.48945418", "0.48945418", "0.48945418", "0.48900753", "0.48866504", "0.48839402", "0.4881823", "0.48736438", "0.48727167", "0.48709908", "0.48645997", "0.48624307", "0.48516318", "0.48482624", "0.48468712", "0.48442742", "0.48422056", "0.48396656", "0.4834697", "0.48298892", "0.4817924", "0.48169762", "0.48139933", "0.48007393", "0.47943324", "0.47926855", "0.479259", "0.47925", "0.47905347", "0.47903076", "0.47888348", "0.47871563", "0.4785395", "0.47852057", "0.47838306", "0.4782844", "0.47791755" ]
0.6181075
1
Return an enemy from the specific gameMap
@Override public EnemySprites getEnemy(int level) { int enemyCount = 3; Random rand = new Random(); int enemyNum = rand.nextInt(enemyCount); switch(enemyNum){ case 0: //return new goblin(level); break; case 1: //return new kobold(level); break; case 2: //return new Bandit(level); break; default: return null; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Enemy getEnemy(int whichEnemy);", "public Enemy getEnemy(String name) {\n\n // For all enemies\n for (Entity curEnt : getEntityList()) {\n\n // If current enemy name matches given name\n if (curEnt.getName().equalsIgnoreCase(name)) {\n\n // Return enemy\n return (Enemy) curEnt;\n }\n }\n\n // If no enemy was found, return null\n return null;\n }", "public Enemy getEnemy(){\n return enemy;\n }", "public MapLocation getEnemySwarmTarget() {\n\t\tdouble a = Math.sqrt(vecEnemyX * vecEnemyX + vecEnemyY * vecEnemyY) + .001;\n\n\t\treturn new MapLocation((int) (vecEnemyX * 7 / a) + br.curLoc.x,\n\t\t\t\t(int) (vecEnemyY * 7 / a) + br.curLoc.y);\n\n\t}", "public EnemyManager getEnemyManager() {\n return map.getEnemyManager();\n }", "public Element getOneEnemy(String name){\r\n\t\t//follow the commentarys of the player group, getOneCharacter, just doesn´t have its own where\r\n\t\treturn loadFile(getFile(getWanted(getFile(getWanted(RPGSystem.getRPGSystem().getWhere(), \"Enemys\")), name)));\r\n\t}", "@Override\n public Enemy getEnemyPlayer() {\n return batMan.getEnemyPlayer();\n }", "public void spawnEnemy(){\n\t\tint initTile = 0;\n\t\n\t\tfor(int i=0; i<screen.maps[screen.currentMap].path.getHeight(); i++){\n\t\t\tif(screen.maps[screen.currentMap].path.getCell(0, i).getTile().getProperties().containsKey(\"ground\") == true){\n\t\t\t\tinitTile = i;\n\t\t\t}\n\t\t}\n\t\t\n\t\txCoor = 2;\n\t\tyCoor = (initTile)*64 + 2;\n\t\tbound = new Circle(xCoor+30, yCoor+30, 30);\n\t\tinGame = true;\n\t}", "public Enemy getEnemy(String enemyType)\n {\n if(enemyType == null)\n {\n return null;\n }\n if(enemyType.equalsIgnoreCase(\"SquareEnemy\"))\n {\n return new SquareEnemy();\n }\n else if(enemyType.equalsIgnoreCase(\"CircleEnemy\"))\n {\n return new CircleEnemy();\n }\n else if(enemyType.equalsIgnoreCase(\"TriangleEnemy\"))\n {\n return new TriangleEnemy();\n }\n return null;\n }", "void useInBattle(PlayerCharacter player, Opponent enemy) {\n\t}", "public static void enemy(){\n\t\tenemy = null;\n\t\twhile(enemy == null){\n\t\t spawnEnemy();\n\t\t}\n\t}", "public EnemyRoom getEnemyRoom(){\n return (EnemyRoom) room;\n }", "private void enemy_choose_player(){\n\t\tint i;\n\t\tRandom r_gen = new Random();\n\t\tfor(i=0;i<enemy_num;i++){\n\t\t\tenemy[i][2] = r_gen.nextInt(player_num);\n\t\t}\n\t}", "private static Unit getUnitOn(Coordinate coordinate){\n\t\tfor (int i = 0; i < enemyList.length; i++){\n\t\t\tif (enemyList[i].isAlive()){\n\t\t\t\tif (coordinate.compareToCoordinates(enemyList[i].getCoordinate())){\n\t\t\t\t\treturn enemyList[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public List<Enemy> getEnemies();", "private void enemyEncounter()\n {\n currentEnemies = currentRoom.getEnemies();\n \n if(currentEnemies.size() > 0)\n {\n for(Enemy e : currentEnemies)\n {\n System.out.println(\"\\n\" + \"A \" + e.getName() + \" stares menacingly!\" + \"\\n\");\n enemyName = e.getName();\n \n }\n enemyPresent = true;\n clearExits();\n }\n else{\n setExits(); \n }\n }", "public void enemySpawner(){\n\t\tif (spawnFrame >= spawnTime){\n\t\t\tfor(int i =0;i<enemies.size();i++){\n\t\t\t\tif (!enemies.get(i).getInGame()){\n\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy);\n\t\t\t\t\tbreak;\n\t\t\t\t\t/*if (enemies.get(i).getNum()==1){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==2){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy2);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==3){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}*/\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tspawnFrame=0;\n\t\t} else{\n\t\t\tspawnFrame+=1;\n\t\t}\n\t}", "public Enemy summon() {\n\t\treturn null;\n\t}", "public ArrayList<Enemy> getEnemies()\r\n\t{\r\n\t\treturn enemy;\r\n\t}", "protected abstract void defineEnemy();", "public PlayerState getEnemy()\n {\n if(this.turnOfPlayer == playerBlack)\n {\n return playerWhite;\n }\n return playerBlack;\n }", "public Enemy getNextEnemy() {\n return findNextEnemy(0);\n }", "private static void addEnemy( int team_a, int team_b )\r\n\t{\n\t\tENEMY_MAP[team_a-1][team_b-1] = true;\r\n\t\tENEMY_MAP[team_b-1][team_a-1] = true;\r\n\t}", "public Pokemon getEnemyPokemon()\r\n {\r\n return enemyPokemon;\r\n }", "public HashMap<Integer, Element> getEnemies() {\n\t\treturn enemies;\n\t}", "public boolean getAttack(IEntity enemyUnit){\n return tempUnit.getAttack(enemyUnit);\n }", "public static Enemy read(InputStream is) throws IOException, GameException {\r\n\t\tbyte id = NetIO.readByte(is);\r\n\t\tEnemy enemy = null;\r\n\r\n\t\t/*\r\n\t\t * iterates over all the areas and returns the enemy with the given id\r\n\t\t */\r\n\t\tfor (Entry<Integer,Area> entry : Main.getGameWorld().getAreas().entrySet()){\r\n\t\t\tif (enemy != null){\r\n\t\t\t\treturn enemy;\r\n\t\t\t}\r\n\t\t\tenemy = entry.getValue().getEnemy(id);\r\n\t\t}\r\n\r\n\t\tif (enemy == null)\r\n\t\t\tthrow new EnemyIDNotFoundException(id);\r\n\r\n\t\treturn enemy;\r\n\t}", "public void basicEnemyAI(){\n if(enemyMana == enemyManaMax){\n applyCard(enemyPlayCard(), \"enemy\");\n }\n }", "private void loadEnemies(BasicEnemy enemy) {\n String enemyName = enemy.getType().get();\n switch (enemyName) {\n case \"Slug\":\n onLoad((Slug) enemy);\n break;\n case \"Zombie\":\n onLoad((Zombie) enemy);\n break;\n case \"Vampire\":\n onLoad((Vampire) enemy);\n break;\n default:\n System.out.println(\"Should not see this LMWC: {\" + enemyName + \"}\");\n break;\n }\n }", "int attack(Unit unit, Unit enemy);", "public DungeonObject getDungeonTile(int x, int y) {\n\t\treturn dungeonRoom[x][y];\r\n\t}", "public void drawEnemies(){\n for (Object e : world.getEnemies()) {\n Enemy enemy = (Enemy) e;\n if (enemy instanceof EnemyPistol) {\n spriteBatch.draw(enemyPistolTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyAwp){\n spriteBatch.draw(enemyAWPTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyStalker){\n spriteBatch.draw(enemyStalkerTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }else if (enemy instanceof EnemyBoss){\n spriteBatch.draw(enemyBossTexture, enemy.getPosition().x * ppuX, enemy.getPosition().y * ppuY,\n enemy.WIDTH * ppuX, enemy.HEIGHT * ppuY);\n }\n }\n }", "private static void checkForEnemies() throws GameActionException {\n //No need to hijack code for structure\n if (rc.isWeaponReady()) {\n // basicAttack(enemies);\n HQPriorityAttack(enemies, attackPriorities);\n }\n \n //Old splash damage code\n //Preserve because can use to improve current splash damage code\n //But not so simple like just checking directions, since there are many more \n //locations to consider hitting.\n /*if (numberOfTowers > 4) {\n //can do splash damage\n RobotInfo[] enemiesInSplashRange = rc.senseNearbyRobots(37, enemyTeam);\n if (enemiesInSplashRange.length > 0) {\n int[] enemiesInDir = new int[8];\n for (RobotInfo info: enemiesInSplashRange) {\n enemiesInDir[myLocation.directionTo(info.location).ordinal()]++;\n }\n int maxDirScore = 0;\n int maxIndex = 0;\n for (int i = 0; i < 8; i++) {\n if (enemiesInDir[i] >= maxDirScore) {\n maxDirScore = enemiesInDir[i];\n maxIndex = i;\n }\n }\n MapLocation attackLoc = myLocation.add(directions[maxIndex],5);\n if (rc.isWeaponReady() && rc.canAttackLocation(attackLoc)) {\n rc.attackLocation(attackLoc);\n }\n }\n }//*/\n \n }", "private void generateEnemies(){\n\t\tint coordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tint coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tEnemy enemy = new Enemy(coordX,coordY);\n\t\tenemies.put(0, enemy);\n\t\tcoordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tcoordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tenemy = new Enemy(coordX,coordY);\n\t\tenemies.put(1, enemy);\n\t}", "public Team getTeam(Team enemyTeam) {\n\t\tArrayList<Character>battleArray = new ArrayList<Character>();\r\n\t\tboolean complete = false;\r\n\t\t\r\n\t\tfor(Character c : guildArray) {\r\n\t\t\tStudent s = (Student) c;\r\n\t\t\t//Choosing alive students whose KP is max thus they can perform stronger attacks\r\n\t\t\tif(s.MaxKPReached() && s.getHP() > 0){\r\n\t\t\t\tbattleArray.add(s);\r\n\t\t\t}\r\n\t\t\t//if the size of the team is 5, then the team is completed\r\n\t\t\tif(battleArray.size() == 5){\r\n\t\t\t\tcomplete = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//If the team still needs members search for members\r\n\t\tfor(int i = 0; i < guildArray.size() && complete == false; i++) {\r\n\t\t\t//Check if the student is not already in the battle team and alive\r\n\t\t\tStudent student = (Student)guildArray.get(i);\r\n\t\t\tif(!battleArray.contains(student) && student.getHP() > 0){ \r\n\t\t\t\tbattleArray.add(student);\r\n\t\t\t}\r\n\t\t\tif(battleArray.size() == 5) {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tTeam battleTeam = new StudentTeam(\"BattleTeam\");\r\n\t\tfor(Character c : battleArray) {\r\n\t\t\tbattleTeam.addMember(c);\r\n\t\t}\r\n\r\n\t\treturn battleTeam;\r\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 }", "public void attack(int idx)\n {\n CreatureWorld playerWorld = ;\n \n }", "public static void spawnEnemy(){\n RNG.D100();\n if(PlayerStats.LVL <= 2){\n if(RNG.num <= 90){\n enemy = \"imp\";\n }else{\n enemy = \"IMP LORD\";\n }\n }else if(PlayerStats.LVL > 2 && PlayerStats.LVL <= 3){\n if(RNG.num <= 20){\n enemy = \"imp\";\n }else if(RNG.num > 20 && RNG.num <= 90){\n enemy = \"toadman\";\n }else{\n enemy = \"IMP LORD\";\n }\n }else if(PlayerStats.LVL > 3 && PlayerStats.LVL <= 5){\n if(RNG.num <= 10){\n enemy = \"toadman\";\n }else if(RNG.num > 10 && RNG.num <= 90){\n enemy = \"giant spider\";\n }else{\n enemy = \"BROODMOTHER\";\n }\n }else if (PlayerStats.LVL > 5 && PlayerStats.LVL <= 8){\n if(RNG.num <= 30){\n enemy = \"goblin sorceror\";\n }else if(RNG.num > 30 && RNG.num <= 60){\n enemy = \"goblin warrior\";\n }else if(RNG.num >60 && RNG.num <= 90){\n enemy = \"goblin archer\";\n }else if(RNG.num > 90 && RNG.num <= 100){\n enemy = \"GOBLIN CHIEFTAN\"; \n }\n } \n }", "public interface IMap \n{ \n String GetMaps(boolean showEnemyShips);\n String GetSpecifiedMap(MapSettings ms);\n \n MapSettings GetUserMap();\n\n boolean HitEnemyCell(int x, int y);\n boolean CheckVictory(boolean checkPlayerMap);\n boolean SetUserMap(MapSettings userMap);\n boolean SetEnemyMap(MapSettings enemyMap);\n}", "public MapLocation senseLocationOf(GameObject o) throws GameActionException;", "protected Movable findFarthestEnemy(ArrayList<Movable> moving){\n\t\tdouble farthest = Integer.MIN_VALUE;\n\t\tint idxOfMob = -1;\n\t\t// Search for the farthest enemy within the range\n\t\tfor(int i = 0; i < moving.size(); i++){\n\t\t\tif(moving.get(i) instanceof Mob){\n\t\t\t\tMob mob = (Mob)moving.get(i);\n\t\t\t\tdouble tempEnemyPosX = mob.getX();\n\t\t\t\tdouble tempEnemyPosY = mob.getY();\n\t\t\t\tdouble tempFarthest = MainMethods.distance(x\n\t\t\t\t\t\t+ img.getWidth(null) / 2, y + img.getHeight(null) / 2,\n\t\t\t\t\t\ttempEnemyPosX, tempEnemyPosY);\n\t\t\t\tif(tempFarthest <= range && tempFarthest >= farthest){\n\t\t\t\t\tfarthest = tempFarthest;\n\t\t\t\t\tidxOfMob = i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(idxOfMob == -1){\n\t\t\treturn null;\n\t\t}\n\t\treturn moving.get(idxOfMob);\n\t}", "public static AbstractEnemy produceEnemy(GameModelInterface game, Vector2 position, AbstractEnemy.entity_type enemyType) {\n\t\tif (enemyType == AbstractEnemy.entity_type.archer) {\n return new ShootingEnemy(game.getWorld(),game.getPlayer(),position);\n\t\t} else if (enemyType == AbstractEnemy.entity_type.slime) {\n\t\t\tSlime2 slime = new Slime2(game.getWorld(),game.getPlayer(),position);\n\t\t\t//to allow the slime to dynamically add itself at runtime\n\t\t\tslime.provideGameModel(game);\n\t\t\treturn slime;\n\t\t}\n\t\telse if (enemyType == AbstractEnemy.entity_type.spikeblock) {\n return new SpikeBlock(game.getWorld(),game.getPlayer(),position);\n\t\t}\n\t\telse if (enemyType == AbstractEnemy.entity_type.rogue) {\n return new Rogue(game.getWorld(),game.getPlayer(),position);\n\t\t}\n\t\telse if (enemyType == AbstractEnemy.entity_type.boss1) {\n\t\t\tBoss1V2 b = new Boss1V2(game.getWorld(),game.getPlayer(),position);\n\t\t\tb.provideGameModel(game);\n\t\t\treturn b ;\n\t\t}\n\t\treturn null;\n\t}", "public Character getOpponent() {\n Character result = null;\n if (this.enemies.getAdversaries().size() > 0) {\n Collections.shuffle(this.enemies.getAdversaries());\n result = this.enemies.getAdversaries().get(0);\n this.enemies.getAdversaries().remove(result);\n }\n return result;\n }", "private int getIndexForEnemy(String enemyName) {\r\n\r\n\t\tfor (int i = 0; i < enemyTracker.getEnemyList().size(); i++) {\r\n\t\t\tif (enemyTracker.getEnemyList().get(i).getName().equals(enemyName)) {\r\n\t\t\t\treturn i;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\r\n\t}", "@Override\n\t\t\tpublic void attack(Base enemy) {\n\t\t\t}", "@Override\n\tpublic void loadEnemies() {\n\t\t\n\t}", "public Enemy deathSummon() {\n\t\treturn null;\n\t}", "private void spawnEnemy() {\n float randomEnemy = (float) Math.random();\n\n if (round == 1) {\n addActorFunction.accept(new SimpleEnemy(tileSet));\n } else {\n float speedMultiplier = 1 + (0.08f * round);\n float healthMultiplier = 1 + (0.01f * round * round);\n\n if (randomEnemy < (round - 1) * 0.1) {\n addActorFunction.accept(new HeavyEnemy(tileSet, speedMultiplier, healthMultiplier));\n } else {\n addActorFunction.accept(new SimpleEnemy(tileSet, speedMultiplier, healthMultiplier));\n }\n }\n }", "void updateEnemies() {\n getEnemies().forEach(e -> {\n if (!e.isAlive()) {\n e.die();\n SoundPlayer.play(SoundPlayer.enemyDestroyed);\n }\n });\n objectsInMap.removeIf(o -> o instanceof Enemy && !(((Enemy) o).isAlive()));//Removing Dead Enemies\n getEnemies().forEach(e -> e.setTarget(objectsInMap.stream().filter(p -> p.identifier.contains(\"PlayerTank0.\") &&\n p.isBlocking && ((Tank) p).isVisible()).collect(Collectors.toList())));//Giving Possible target to enemies to decide\n }", "public void setEnemy(Enemy enemy){\n this.enemy = enemy;\n enemy.setXGrid(getXGrid());\n enemy.setYGrid(getYGrid());\n setEntity(enemy);\n }", "protected Entity findPlayerToAttack() {\n/* 339 */ double var1 = 8.0D;\n/* 340 */ return getIsSummoned() ? null : this.field_70170_p.func_72890_a(this, var1);\n/* */ }", "@Override\n public Answer getAnswer(Guess guess) {\n\n \tint row = guess.row;\n \tint col = guess.column;\n \tCoordinate enemyShot = world.new Coordinate();\n \tenemyShot.column = col;\n \tenemyShot.row = row;\n \t\n \t//store enemy's shot\n \tenemyShots.add(enemyShot);\n \tAnswer a = new Answer();\n\n \t//loop all ship locations and its coordinate, if enemy shot same as ship coordinate there is a hit \n \tfor (ShipLocation shipLocation: shipLocations) {\n \t\tfor (Coordinate coordinate: shipLocation.coordinates) {\n \t\t\tif (coordinate.row == row && coordinate.column == col) {\n \t\t\t\ta.isHit = true;\n \t\t\n \t\t\t\t//if enemy shots contain a whole ship coordinates, there is a ship sunk\n \t \t\tif (enemyShots.containsAll(shipLocation.coordinates)) {\n \t \t\t\ta.shipSunk = shipLocation.ship;\n \t \t\t}\n \t\t\t\t\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \t\n\n // dummy return\n return a;\n }", "public Player enemyHasAContinent() {\r\n\t\tfor (int i = 0; i < Board.getBoard().getPlayers().size(); i++) {\r\n\t\t\tif (Board.getBoard().getPlayers().get(i).fullContinent() == 0) {\r\n\t\t\t\treturn Board.getBoard().getPlayers().get(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public ArrayList<Actor> getEnemies() {\n return getGrid().getNeighbors(getLocation());\n }", "abstract public Unit getDefendingUnit(Unit attacker);", "private Enemy findNextEnemy(int currentIndex) {\n if(enemiesLeft[currentIndex] > 0) {\n enemiesLeft[currentIndex] -=1;\n Enemy next = currentEnemies[currentIndex].clone();\n next.setCoords(map.getStart()[0],map.getStart()[1]);\n return next;\n } else if(currentIndex < enemiesLeft.length){\n return findNextEnemy(currentIndex+1); //recursively traverses the array till all enemies are spawned i guess\n } else {\n return null;\n }\n }", "@Override\n public String getEntLS() {\n return \"Enemies\";\n }", "public void checkEnemy() {\n\t\tif (enemy != null)\n\t\tif (Integer.parseInt(getCurrentPositionX()) == enemy.getCurrentPositionX() && Integer.parseInt(getCurrentPositionY()) == enemy.getCurrentPositionY()) {\n\t\t\tx = spawnX;\n\t\t\ty = spawnY;\n\t\t}\n\t}", "public void enemyoff(){\n getWorld().removeObject(this);\n }", "public void enemyShoot()\r\n\t{\r\n\t\tfor (Enemy enemies : enemy)\r\n\t\t{\r\n\t\t\tif (enemies.getHasFired())\r\n\t\t\t{\r\n\t\t\t\tBullet enemyPew = enemies.shoot();\r\n\t\t\t\tif (enemyPew != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.add(enemyPew);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }", "private boolean checkSeesPlayer(int x, int y) {\r\n\t\tint enemy;\r\n\t\tif (creature.getCreature().team == 1) {\r\n\t\t\tenemy = 2;\r\n\t\t} else if (creature.getCreature().team == 2) {\r\n\t\t\tenemy = 1;\r\n\t\t} else {\r\n\t\t\tenemy = 0; //No enemy\r\n\t\t}\r\n\t\tRectangle r = new Rectangle(); // Location Rectangle\r\n\t\tr.width = Tile.TILEWIDTH;\r\n\t\tr.height = Tile.TILEHEIGHT;\r\n\t\tr.x = x * Tile.TILEWIDTH;\r\n\t\tr.y = y * Tile.TILEHEIGHT;\r\n\t\tfor(Creature c : handler.getWorld().getEntityManager().getCreatures()) {\r\n\t\t\tif (c.getCreature().team == enemy) {\r\n\t\t\t\tif(c.getCollisionBounds(0, 0).intersects(r)) {\r\n\t\t\t\t\tseenEnemy = c;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "void generateEnemy(){\n\t\tEnemy e = new Enemy((int)(Math.random()*\n\t\t\t(cp.getWidthScreen() - (ss.getWidth()/2)))\n\t\t\t,ss.getHeight(), cp.getHieghtScreen());\t\t\t\t//Enemy (int x, int y, int heightScreen)\n\t\tcp.shapes.add(e);\n\t\tenemies.add(e);\n\t}", "@Override\n public boolean attack(final Player enemy, Location loc) {\n final Ship ship = enemy.getShip(loc = board.attack());\n\n// System.out.println(loc);\n\n if (ship != null) {\n getGuessBoard()[loc.getRow()][loc.getCol()] = 1;\n ship.takeHit(loc);\n\n board.getHits().add(loc);\n\n if (ship.isSunk()) {\n\n board.getIntegers().remove(Integer.valueOf(ship.getLocations().size()));\n board.getMisses().addAll(board.getHits());\n board.getHits().clear();\n\n return true;\n }\n\n } else {\n getGuessBoard()[loc.getRow()][loc.getCol()] = -1;\n board.getMisses().add(loc);\n }\n\n return false;\n }", "@Override\n public ArrayList<Entity> getEntities() {\n ArrayList<Entity> enemies = new ArrayList<>();\n\n // Fire Dragon (Near Starting Area)\n enemies.add(new Enemy(\"Dracoflame\", 31, 32) {\n @Override\n public void doAction() {\n //Globals.SBG.enterState(Globals.STATES.get(\"CHALLENGE\"));\n }\n });\n\n // Evil Tree (Far Right)\n enemies.add(new Enemy(\"Trevil\", 90, 40) {\n @Override\n public void doAction() {\n //Globals.SBG.enterState(Globals.STATES.get(\"CHALLENGE\"));\n }\n });\n\n // Evil Mushroom (Bottom Left)\n enemies.add(new Enemy(\"Mycovolence\", 72, 80) {\n @Override\n public void doAction() {\n //Globals.SBG.enterState(Globals.STATES.get(\"CHALLENGE\"));\n }\n });\n\n // Ship\n enemies.add(new Enemy(\"SailingShip\", 11, 76) {\n @Override\n public void doAction() {\n //Globals.SBG.enterState(Globals.STATES.get(\"CHALLENGE\"));\n }\n });\n\n return enemies;\n }", "protected Entity findPlayerToAttack()\n {\n EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);\n return var1 != null && this.canEntityBeSeen(var1) ? var1 : null;\n }", "int defend(Unit unit, Unit enemy);", "Entity getShooter();", "private void enemyMove() {\n\n\t\tboolean goAgain = false;\n\n\t\tint x = (int) (Math.random() * 10);\n\t\tint y = (int) (Math.random() * 10);\n\n\t\t// Make sure the enemy hits in a checkerboard pattern.\n\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\tif (y % 2 == 0) {\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t\t}\n\t\t} else { // if x is odd, y should be even\n\t\t\tif (y % 2 == 1)\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t}\n\n\t\tif (enemyLastShotHit && getDifficulty() > 0) { // /if last shot was a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// hit, enemy\n\t\t\t// will try to\n\t\t\t// check around it only run if difficulty is\n\t\t\t// normal or above\n\t\t\tx = enemyLastHitX;\n\t\t\ty = enemyLastHitY;\n\n\t\t\tif (getDifficulty() != 2) {\n\n\t\t\t\tif (conflictX == 4) {\n\t\t\t\t\tconflictX = 0;\n\t\t\t\t} else if (conflictY == 4) {\n\t\t\t\t\tconflictY = 0;\n\t\t\t\t\t// System.out.println(\"conflict has been reset \");\n\t\t\t\t}\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\t// System.out.println(\"checking down\");\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\n\t\t\t\t\tif (checkDirection == 0) // checks in each direction\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse if (checkDirection == 1)\n\t\t\t\t\t\tx--;\n\t\t\t\t\telse if (checkDirection == 2)\n\t\t\t\t\t\ty++;\n\t\t\t\t\telse if (checkDirection == 3) {\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (x < 0) // making sure coordinates stay within bounds\n\t\t\t\t\t\tx = 0;\n\t\t\t\t\telse if (x > 9)\n\t\t\t\t\t\tx = 9;\n\t\t\t\t\tif (y < 0)\n\t\t\t\t\t\ty = 0;\n\t\t\t\t\telse if (y > 9)\n\t\t\t\t\t\ty = 9;\n\t\t\t\t}\n\t\t\t} // medium diff\n\n\t\t\telse if (getDifficulty() == 2) {// hard difficulty\n\t\t\t\t// gives enemy unfair advantage\n\n\t\t\t\tif (conflictX == 4)\n\t\t\t\t\tconflictX = 0;\n\t\t\t\tif (conflictY == 4)\n\t\t\t\t\tconflictY = 0;\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\t\tif (y + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x][y + 1] == 1)// if y+1 is a hit and it is\n\t\t\t\t\t\t\t\t\t\t\t\t\t// within bounds, it will go\n\t\t\t\t\t\t\t\t\t\t\t\t\t// there\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (y - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x][y - 1] == 1)\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t\tif (x + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x + 1][y] == 1)\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t}\n\t\t\t\t\tif (x - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} // hard diff\n\t\t\tcheckDirection++;\n\t\t} // lasthit\n\n\t\tint tryCount = 0;\n\t\twhile (egrid[x][y] == 3) { // makes sure enemy doesn't hit same spot\n\t\t\t\t\t\t\t\t\t// twice\n\t\t\tx = (int) (Math.random() * 10);\n\t\t\ty = (int) (Math.random() * 10);\n\t\t\tif (tryCount < 20 && getDifficulty() > 0) {\n\t\t\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\t\t\tif (y % 2 == 0) { // for checkerboard pattern\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t} else { // if x is odd, y should be even\n\t\t\t\t\tif (y % 2 == 1)\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttryCount++;\n\t\t}\n\n\t\tif (egrid[x][y] == 1) { // hit branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilehit.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a hit\");\n\t\t\tenemyLastShotHit = true; // starts ai\n\t\t\tcheckDirection = 0;\n\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\tenemyLastHitX = x; // stores x and y values\n\t\t\t\tenemyLastHitY = y;\n\t\t\t}\n\t\t\tehits--; // keeps score\n\t\t}\n\n\t\telse if (egrid[x][y] == 2) { // poweup branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilepower.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a PowerUp\");\n\t\t\tgoAgain = true;\n\t\t}\n\n\t\telse\n\t\t\t// miss branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilemiss.jpg\"));\n\n\t\tegrid[x][y] = 3;\n\n\t\tcheckEnemyWin();\n\n\t\tif (goAgain)\n\t\t\tenemyMove();\n\n\t}", "private void spawnMediumEnemy(IEnemyService spawner, World world, GameData gameData) {\r\n if (spawner != null) {\r\n spawner.createMediumEnemy(world, gameData, new Position(randomIntRange(1600, 3200), gameData.getGroundHeight()));\r\n spawner.createMediumEnemy(world, gameData, new Position(randomIntRange(-600, -2000), gameData.getGroundHeight()));\r\n }\r\n }", "Entity getClosestEnemy(Collection<Entity> attackable, Entity entity, ServerGameModel model) {\n return attackable.stream().min((e1, e2) ->\n Double.compare(util.Util.dist(e1.getX(), e1.getY(), entity.getX(), entity.getY()),\n util.Util.dist(e2.getX(), e2.getY(), entity.getX(), entity.getY()))).get();\n }", "public IEntity getOnTheMapXY(int x, int y) {\r\n\t\t// we check if we are not at the edge of the map\r\n\t\t if(x >= 0 && x < Map.getWidth() && y >= 0 && y < Map.getHeight())\r\n\t\t \treturn this.map[x][y];\r\n\t\t else\r\n\t\t \treturn this.map[0][0];\r\n\t\t \r\n\t}", "public Tile getTileAt(Position p);", "public EnemySpawner(String mapName) {\n\n map = new Map(mapName);\n enemiesLeft = new int[]{0};\n }", "public abstract IAttackable getEnemyInSearchArea(ShortPoint2D centerPos, IAttackable movable, short minSearchRadius, short maxSearchRadius,\n\t\t\t\t\t\t\t\t\t\t\t\t\t boolean includeTowers);", "Collection<Entity> attackableEnemies(Entity entity, ServerGameModel model) {\n // Minions shouldn't count enemies around a wall as attackable.\n\n Collection<Entity> enemies = new HashSet<>();\n double x = entity.getX();\n double y = entity.getY();\n double range = ((TowerBuildingSpawnerStrat) entity.get(AI_STRAT)).attackRange(entity);\n\n // Add enemies within the range of this entity and in the line of sight of this enemy.\n for (int i = (int) (x - range); i <= (int) (x + range); i++) {\n for (int j = (int) (y - range); j <= (int) (y + range); j++) {\n if (util.Util.checkBounds(i, j))\n enemies.addAll(model.getCell(i, j).getContents().stream().filter(e ->\n util.Util.dist(x, y, e.getX(), e.getY()) <= range\n && e.has(Entity.EntityProperty.TEAM)\n && e.getTeam() != entity.getTeam()\n && !e.has(PROJECTILE)\n && checkLineOfSight(entity, e, model)).collect(Collectors.toSet()));\n }\n }\n\n return enemies;\n }", "@Override\n public Action getAction(Actor actor, GameMap map) {\n Dinosaur dino = (Dinosaur) actor;\n dinoClass = dino.getClass();\n here = map.locationOf(dino);\n\n Action ret = null;\n for(Exit exit: here.getExits()){\n if (map.isAnActorAt(exit.getDestination())) {\n //make sure they're not trying to mate with Player\n if(map.getActorAt(exit.getDestination()).getDisplayChar() != '@'){\n Dinosaur target = (Dinosaur) map.getActorAt(exit.getDestination());\n //if they are the same species\n if (!target.isPregnant() && target.getDisplayChar() == dino.getDisplayChar()\n && target.getGender() != dino.getGender() && !(target instanceof BabyDinosaur)){\n //if Pterodactyls are trying to mate, make sure their on a tree\n if(target instanceof Pterodactyl){\n Pterodactyl pteroOne = (Pterodactyl) target;\n Pterodactyl pteroTwo = (Pterodactyl) dino;\n if(pteroOne.getOnTree() && pteroTwo.getOnTree()){\n ret= new MateAction(target);\n }\n }\n else{\n ret= new MateAction(target);\n }\n }\n }\n }\n }\n //if no breeding they'll just move closer to a target OR return null if no target\n if(ret == null){\n ret = moveCloser(dino, map);\n }\n return ret;\n }", "public void killedByPlayer() {\r\n\t\tscreen.enemiesKilled++;\r\n\t\tMazeCrawler mc = screen.mazeHandler.mazeCrawler;\r\n\t\tint n = 2; //if enemy is large do movement n+1 times\r\n\t\tswitch (enemyType) {\r\n\t\tcase DOWN:\r\n\t\t\tmc.moveDown();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveDown();}\r\n\t\t\tbreak;\r\n\t\tcase LEFT:\r\n\t\t\tmc.moveLeft();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveLeft();}\r\n\t\t\tbreak;\r\n\t\tcase RIGHT:\r\n\t\t\tmc.moveRight();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveRight();}\r\n\t\t\tbreak;\r\n\t\tcase UP:\r\n\t\t\tmc.moveUp();\r\n\t\t\tif(large) {for(int i = 0; i < n; i++) mc.moveUp();}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tscreen.enemyDeath.play(.5f);\r\n\t\tdestroy();\r\n\t}", "@Override\n public int getType() {\n return Enemy.TYPEA;\n }", "protected void attackEnemy(Path toOp) {\n int opX = toOp.getStep(toOp.getLength() - 1).getX();\n int opY = toOp.getStep(toOp.getLength() - 1).getY();\n if (this.player.getX() == opX || this.player.getY() == opY) {\n // in the same row or column\n if (toOp.getLength() <= this.player.getFirePower() + 1) {\n // and is reachable\n this.player.placeBomb(map);\n// System.out.println(\"Player #\"+player.getPID()+\" will attack block [\"+opX+\", \"+opY+\"]\");\n }\n }\n }", "public PkmnInfoBox getEnemyInfoBox()\r\n {\r\n return enemyPkmnInfoBox;\r\n }", "public boolean enemyOutOfBounds() {\n return (position.x < 0\n || position.x + TYPE_A_WIDTH > World.WORLD_WIDTH\n || position.y < 0\n || position.y + TYPE_A_HEIGHT > World.WORLD_HEIGHT);\n }", "public void playEnemy(){\n // System.out.println(\"staaaaaaaaaaaaaaaaaaaaar\"+character.getBlock());\n for(int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.playEnemy( i );\n }\n for( int i = 0 ; i < enemyController.getSize() ; i++){\n if (! enemies.get(i).isDead())\n effectHandler.endEnemyTurn(i);\n }\n\n }", "private boolean isEnemyOccupied(int x, int y) {\n for (int i = 0; i < player.own.length; i++) {\n if (player.enemy[i].x == x && player.enemy[i].y == y) {\n System.out.println(\"enemy occupied:\" + i);\n return true;\n }\n }\n return false;\n }", "public Card enemyPlayCard(){ //Is it really worth the effort to give the enemy a full deck/temp hand? Having 2-4 basic abilities that vary should be enough.\n if(!(enemyHand.isEmpty())){\n return enemyHand.get(0);\n } else {\n return null;\n }\n }", "public int getTile(int x, int y)\n {\n return tilemap[x][y];\n }", "public ArrayList<Enemy> getEnemies(int levelNum) {\n\n\t\tArrayList<Enemy> enemies = new ArrayList<Enemy>();\n\n\t\tScanner scnr = TextFileReader.getScannedFile(\"LH_Level\" + levelNum, directory);\n\n\t\tif (scnr == null) {\n\t\t\tSystem.out.println(\"Failed to find level\" + levelNum);\n\t\t\treturn null;\n\t\t}\n\n\t\twhile (scnr.hasNextLine()) {\n\n\t\t\tString line = scnr.nextLine();\n\t\t\tString[] details = line.split(\",\");\n\n\t\t\tString type = details[0];\n\t\t\tString detail1 = details[1];\n\n\t\t\tif (type.equals(\"enemy\")) {\n\t\t\t\tif (detail1.equals(\"grunt\")) {\n\t\t\t\t\tenemies.add(addGrunt(details, 2));\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn enemies;\n\n\t}", "public MapEntity getTileAt(int x, int y) {\n\t\ttry {\n\t\t\treturn tiles.get(y)[x];\n\t\t}\n\t\tcatch(IndexOutOfBoundsException | NullPointerException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "private EntityLivingBase findPlayerToAttack() {\n EntityPlayer player = entity.worldObj.getClosestVulnerablePlayerToEntity(entity, aggroRange);\n if ( player != null && !player.capabilities.isCreativeMode && entity.canEntityBeSeen(player) )\n \treturn player;\n\n EntityLivingBase target = entity.getLastAttacker();\n if ( isTargetValid(target) && entity.canEntityBeSeen(target) )\n \treturn target;\n\n \treturn null;\n }", "public void getEnemyBattleEffects(Enemy enemy) {\n try {\n Ability chosenAbility = enemy.getLastUsableAbility().clone();\n ArrayList<Entity> players = new ArrayList<>();\n players.add(playerInCombat);\n addEffect(enemy.parse(chosenAbility,players,true));\n } catch (InsufficientResourceException ignored) {\n ;\n }\n }", "private void createEnemyHelicopter()\n\t {\n\t \t\tRandNum = 0 + (int)(Math.random()*700);\n\t\t \t\tint xCoordinate = 1400;\n\t int yCoordinate = RandNum; \n\t eh = new Enemy(xCoordinate,yCoordinate);\n\t \n\t // Add created enemy to the list of enemies.\n\t EnemyList.add(eh);\n\t \n\t }", "public Battleable getOpponent()\n\t{\n\t\t/* TODO: Inherited function from Character Interface, requires implementation! */\n\t\treturn null;\n\t}", "private void setEnemy(){\n depths.setEnemy(scorpion);\n throne.setEnemy(rusch);\n ossuary.setEnemy(skeleton);\n graveyard.setEnemy(zombie);\n ramparts.setEnemy(ghoul);\n bridge.setEnemy(concierge);\n deathRoom1.setEnemy(ghost);\n deathRoom2.setEnemy(cthulu);\n deathRoom3.setEnemy(wookie); \n }", "public interface AI {\n\n /**\n * Sets the new enemy position.\n * @param pos the new enemy position\n */\n void setEnemyPos(Point2D pos);\n\n /**\n * Returns the new position for the enemy to\n * move to.\n * @param target the position that wants to be tracked\n * @param pursuit the state in which the enemy is in\n * @param map\n * @return the position to move to\n */\n Point2D getNextMove(Point2D target, boolean pursuit, Set<Point2D> map);\n\n /**\n * Returns the new enemy rotation based on the\n * state in which the enemy is in.\n * @param target the position that wants to be tracked\n * @param pursuit the state in which the enemy is in\n * @return the angle that the enemy should face\n */\n double getRotation(Point2D target, boolean pursuit);\n\n /**\n * Returns if the enemy is in pursuit of the target\n * by calculating if the noise radius overlap with the\n * two.\n * @param target the position that wants to be tracked\n * @param noise the radius of the noise made by a player action\n * @return the state in which the enemy will be in\n * @see Player\n */\n boolean isInPursuit(Point2D target, double noise);\n\n /**\n * Returns if the enemy has the {@code target} in line of\n * sight and is close enough to get the enemy attention\n * to shoot.\n * @param target the position that wants to be tracked\n * @return the action that should be performed by the enemy\n */\n boolean isShooting(Point2D target);\n\n /**\n * Returns the collection of all position to check\n * if target is obscured by a wall used to JUnit\n * tests purpose.\n * @return the collections of all wall objects position\n */\n Set<Point2D> getWallSet();\n\n}", "@Override\r\n\t/**\r\n\t * Each enemy has a unique health and scales as the game goes along\r\n\t */\r\n\tpublic int enemyHealth() {\n\t\treturn enemyHealth;\r\n\t}", "public abstract Player getOpponent();", "@Override\n public Action getAction(Actor actor, GameMap map) {\n Location currentLocation = map.locationOf(actor);\n target = getLocation(currentLocation, map);\n\n if (actor.getDisplayChar() == 'P' || actor.getDisplayChar() == 'p') {\n\n }\n\n if (target != null && adjacent(actor, target, map)) {\n return new AttackAction(target);\n }\n\n return super.getAction(actor, map);\n }", "private void generateEnemies() {\n for(int i =0; i < currentEnemies.length; i++) {\n Attributes a = genAttributes();\n double[] healthSpeed = genHealthAndSpeed();\n LinkedList<Pathing> paths = map.getPathings();\n this.currentEnemies[i] = new Enemy(determineImage(a, healthSpeed[0]), healthSpeed[0], healthSpeed[1], 10+currentDifficulty/20, a, paths);\n }\n\n }", "public void generateEnemy() {\n int rowsPlace = randomGenerator(0, rows-1);\n int collsPlace = randomGenerator(0, colls-1);\n\n if(board[rowsPlace][collsPlace] == ' '){\n snakeEnemyPartList.add(new SnakeEnemyPart(rowsPlace, collsPlace, enemyId));\n board[rowsPlace][collsPlace] = 'E';\n setSnakeHeadColls(collsPlace);\n setSnakeHeadRows(rowsPlace);\n } else {\n generateEnemy();\n }\n }", "public static Monster getNearbyMonster() {\n String monsterId = checkMonster(currentBoard, hero); //Obtain id of monster\n if (monsterId != null) { //If monster exists in front of the player\n int length = currentLevelScreen.getMonstersList().size();\n for (int i = 0; i < length; i++) { //Look for monster object using id in ArrayList\n Monster monster = currentLevelScreen.getMonstersList().get(i);\n if (monsterId.equals(monster.getId())) { //If found\n return monster;\n }\n }\n }\n return null;\n }" ]
[ "0.76167434", "0.6771753", "0.6524716", "0.6469577", "0.64381367", "0.62707883", "0.62694865", "0.6238708", "0.6205812", "0.61838007", "0.61380005", "0.61015975", "0.60795444", "0.6013557", "0.59622985", "0.5959713", "0.5912044", "0.59028924", "0.5876899", "0.5856397", "0.5856187", "0.5850152", "0.58011883", "0.5784562", "0.57487726", "0.5742268", "0.5711681", "0.570708", "0.56924313", "0.56896234", "0.56829685", "0.56653553", "0.56575453", "0.5622025", "0.5616074", "0.55951136", "0.5594372", "0.55885214", "0.5575992", "0.5557796", "0.5531236", "0.55191255", "0.5490967", "0.5486776", "0.54855734", "0.5481036", "0.54727113", "0.5458931", "0.5453743", "0.5427227", "0.5424588", "0.5423104", "0.5418413", "0.5414986", "0.54071397", "0.54053533", "0.5404254", "0.54040617", "0.54038954", "0.53816086", "0.5380968", "0.53783965", "0.53694856", "0.53688604", "0.536849", "0.53578407", "0.53545463", "0.5353985", "0.5343939", "0.532652", "0.53209764", "0.5315759", "0.5313671", "0.53126985", "0.5307517", "0.53069586", "0.52996135", "0.5285319", "0.5283856", "0.528221", "0.5279364", "0.527897", "0.52715206", "0.5266069", "0.52654564", "0.5260947", "0.525647", "0.52534616", "0.52516615", "0.52462053", "0.5241948", "0.5241022", "0.52380896", "0.52339894", "0.52255607", "0.5220464", "0.52121204", "0.5205297", "0.5187902", "0.518744" ]
0.652946
2
Create all of the sprites for the map.
@Override public void createSprites(World world) { // the height of the map since 0,0 in Tiled is in the top left // compared to the TiledMap's 0,0 in the bottom left int height = 2400; // file locations of different trees TextureAtlas atlas = new TextureAtlas("Game Tilesets/Trees/Trees.pack"); Skin skin = new Skin(); skin.addRegions(atlas); TextureRegion T2 = skin.getRegion("T2"); TextureRegion T3 = skin.getRegion("T3"); TextureRegion T7 = skin.getRegion("T7"); TextureRegion T9 = skin.getRegion("T9"); TextureRegion T10 = skin.getRegion("T10"); // add all of the trees this.addSprite(new ObjectSprites(T2, 236, height - 1490)); this.addSprite(new ObjectSprites(T9, 622, height - 1907)); this.addSprite(new ObjectSprites(T9, 683, height - 1687)); this.addSprite(new ObjectSprites(T9, 174, height - 1851)); this.addSprite(new ObjectSprites(T9, 361, height - 1643)); this.addSprite(new ObjectSprites(T10, 572, height - 1354)); this.addSprite(new ObjectSprites(T10, 0, height - 1475)); this.addSprite(new ObjectSprites(T10, -9, height - 1707)); this.addSprite(new ObjectSprites(T10, 675, height - 1479)); this.addSprite(new ObjectSprites(T10, 416, height - 1903)); this.addSprite(new ObjectSprites(T3, 428, height - 1453)); this.addSprite(new ObjectSprites(T3, 596, height - 1122)); this.addSprite(new ObjectSprites(T3, -32, height - 988)); this.addSprite(new ObjectSprites(T3, 476, height - 864)); this.addSprite(new ObjectSprites(T3, 640, height - 725)); this.addSprite(new ObjectSprites(T3, 424, height - 2123)); this.addSprite(new ObjectSprites(T7, 145, height - 1347)); this.addSprite(new ObjectSprites(T7, 83, height - 1935)); this.addSprite(new ObjectSprites(T7, 585, height - 2031)); this.addSprite(new ObjectSprites(T7, 290, height - 2304)); Bandit b1 = new Bandit(); b1.defineBody(world, 215, 1305); super.addSprite(b1); Bandit b2 = new Bandit(); b2.defineBody(world, 60, 1445); super.addSprite(b2); Bandit b3 = new Bandit(); b3.defineBody(world, 90, 1640); super.addSprite(b3); Bandit b4 = new Bandit(); b4.defineBody(world, 530, 1740); super.addSprite(b4); Bandit b5 = new Bandit(); b5.defineBody(world, 730, 1655); super.addSprite(b5); Bandit b6 = new Bandit(); b6.defineBody(world, 90, 2235); super.addSprite(b6); Bandit b7 = new Bandit(); b7.defineBody(world, 715, 1490); super.addSprite(b7); Bandit b8 = new Bandit(); b8.defineBody(world, 318, 1605); super.addSprite(b8); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "private void initSprites(){\r\n try\r\n {\r\n spriteSheet = ImageIO.read (spriteSheetFile);\r\n }\r\n catch (IOException e)\r\n {\r\n System.out.println(\"SPRITE spritesheet not found\");\r\n } \r\n try\r\n {\r\n iconSheet=ImageIO.read(playerIconFile);\r\n }\r\n catch (IOException e)\r\n {\r\n System.out.println(\"PLAYERICON spritesheet not found\");\r\n } \r\n\r\n // saves images to array\r\n for(int i=0;i<3;i++){\r\n bomb[i]=new BufferedImage(32,32,BufferedImage.TYPE_INT_ARGB); \r\n bomb[i]=spriteSheet.getSubimage(i*32,6,32,32);\r\n }\r\n for(int i=0;i<4;i++){\r\n icons[i] = new BufferedImage(30,30,BufferedImage.TYPE_INT_ARGB);\r\n icons[i] = iconSheet.getSubimage(0, 31*i, 30, 30);\r\n }\r\n }", "private void initialiseMap(ArrayList<Sprite> allSprites){\n\t\tint x = (allSprites.get(0).getXOffset()*-2) + App.COLUMNS;\n\t\tint y = (allSprites.get(0).getYOffset()*-2) + App.ROWS;\n\t\t\n\t\tgameMap = new MapCell[x][y];\n\t\t\n\t\t//initialise the gameMap\n\t\tfor (int i = 0; i < x; i++) {\n\t\t\tfor( int j = 0; j < y; j++) {\n\t\t\t\tthis.gameMap[i][j] = new MapCell();\n\t\t\t}\n\t\t}\n\t}", "private void generate() {\n preGenerate();\n\n SpriteGrid grid = new SpriteGrid(specState);\n IOHelper.pixelsToBitmap(grid.draw(), sprite);\n\n }", "private void loadSprites() throws IOException {\n \t\tsprites.put(\"fullBin\", ImageIO.read(new File(\"user-trash-full64.png\")));\n \t\tsprites.put(\"emptyBin\", ImageIO.read(new File(\"user-trash64.png\")));\n \t\tsprites.put(\"sysfileLarge\", ImageIO.read(new File(\"sysfile1-48.png\")));\n \t\tsprites.put(\"sysfileMedium\", ImageIO.read(new File(\"sysfile2-32.png\")));\n \t\tsprites.put(\"sysfileSmall\", ImageIO.read(new File(\"sysfile3-16.png\")));\n \t\tsprites.put(\"junk\", ImageIO.read(new File(\"junk.png\")));\n \t\tsprites.put(\"grass\", ImageIO.read(new File(\"grass.jpg\")));\n \t}", "public Map(SpriteLoader sprites) {\n\n this.sprites = sprites;\n\n }", "private void generateSprites() {\n final int PIXEL_ZOMBIE_SKIN = 0xa0ff90;\n final int PIXEL_SKIN = 0xFF9993;\n\n int pix = 0;\n for (int i = 0; i < 18; i++) {\n int skin = PIXEL_SKIN;\n int clothes = 0xFFffff;\n\n if (i > 0) {\n skin = PIXEL_ZOMBIE_SKIN;\n clothes = (random.nextInt(0x1000000) & 0x7f7f7f);\n }\n for (int t = 0; t < 4; t++) {\n for (int d = 0; d < 16; d++) {\n double dir = d * Math.PI * 2 / 16.0;\n\n if (t == 1)\n dir += 0.5 * Math.PI * 2 / 16.0;\n if (t == 3)\n dir -= 0.5 * Math.PI * 2 / 16.0;\n\n // if (i == 17)\n // {\n // dir = d * Math.PI * 2 / 64;\n // }\n\n double cos = Math.cos(dir);\n double sin = Math.sin(dir);\n\n for (int y = 0; y < 12; y++) {\n int col = 0x000000;\n for (int x = 0; x < 12; x++) {\n int xPix = (int) (cos * (x - 6) + sin * (y - 6) + 6.5);\n int yPix = (int) (cos * (y - 6) - sin * (x - 6) + 6.5);\n\n if (i == 17) {\n if (xPix > 3 && xPix < 9 && yPix > 3 && yPix < 9) {\n col = 0xff0000 + (t & 1) * 0xff00;\n }\n } else {\n if (t == 1 && xPix > 1 && xPix < 4 && yPix > 3 && yPix < 8)\n col = skin;\n if (t == 3 && xPix > 8 && xPix < 11 && yPix > 3 && yPix < 8)\n col = skin;\n\n if (xPix > 1 && xPix < 11 && yPix > 5 && yPix < 8) {\n col = clothes;\n }\n if (xPix > 4 && xPix < 8 && yPix > 4 && yPix < 8) {\n col = skin;\n }\n }\n sprites[pix++] = col;\n\n // If we just drew a pixel, make the next one an almost-black\n // pixel, and if it's already an almost-black one, make it\n // transparent (full black). (This is all honored only if the\n // next pixel isn't actually set to something else.) This takes\n // advantage of the left-to-right scanning of the sprite\n // generation to create a slight shadow effect on each sprite.\n if (col > 1) {\n col = 1;\n } else {\n col = 0;\n }\n }\n }\n }\n }\n }\n }", "private void initSubSprites() {\n\n subSprites = new Hashtable<>();\n\n for (BrushType cT : BrushType.values()) {\n\n int x = cT.subSpr.x;\n int y = cT.subSpr.y;\n\n BufferedImage sprite = spriteSheet.getSubimage(x, y, 8, 8);\n\n subSprites.put(cT, sprite);\n }\n }", "@Override\n public void onAdd() {\n onRemove();\n \n // Generate a list of renderable images\n MapChunk[] chunks = generateChunks(generate());\n \n // Ensure the list is valid\n if(chunks == null) {\n return;\n }\n \n // Move the textures onto Rectangle shapes\n int chunkWidth = getChunkWidth();\n int chunkHeight = getChunkHeight();\n \n int rows = getHeightInChunks();\n int cols = getWidthInChunks();\n \n // Init our storage\n mTextures = new Texture[ rows * cols ];\n mShapes = new RectangleShape[ rows * cols ];\n \n // Iterate the whole map in chunks\n for(int x = 0; x < cols; x++) {\n for(int y = 0; y < rows; y++) {\n \n // Get the chunk for this position\n MapChunk thisChunk = chunks[ (y * cols) + x ];\n \n if(thisChunk == null) {\n // Something went wrong. Undo.\n onRemove();\n return;\n }\n \n // Convert our image into a texture\n Texture t = new Texture();\n if(t == null || !t.loadFromImage(thisChunk.image)) {\n onRemove();\n return;\n }\n \n // Store the texture for removal later on\n mTextures[ (y * cols) + x ] = t;\n \n // Create a rectangle shape\n RectangleShape r = new RectangleShape( chunkWidth, chunkHeight );\n \n // Apply some settings\n r.setTexture(t);\n r.setPosition( x * chunkWidth, y * chunkHeight );\n \n // Add this shape to the renderer\n if(mRenderer.add(r) < 0) {\n onRemove();\n return;\n }\n \n // Store the shape\n mShapes[ (y * cols) + x ] = r;\n \n }\n }\n \n }", "@Override\n\tpublic void create() {\n\t\tthis.batch = new SpriteBatch();\n\t\t\n//\t\tgame.batch.begin();\n// player.draw(game.batch);\n// \n// game.batch.end();\n\t\t\n\t\tmanager = new AssetManager();\n\t\tmanager.setLoader(TiledMap.class, new TmxMapLoader(new InternalFileHandleResolver()));\n\t\tmanager.load(\"data/level1.tmx\", TiledMap.class);\n\t\tmanager.load(\"data/background.png\", Texture.class);\n//\t\tmanager.load(\"level1.tsx\", TiledMapTileSet.class);\n\t\tmanager.finishLoading();\n\t\tscreen = new GameScreen(this);\n\t\tsetScreen(screen);\n\t\t\n\t}", "public void initTiles()\n {\n PropertiesManager props = PropertiesManager.getPropertiesManager(); \n String imgPath = props.getProperty(MahjongSolitairePropertyType.IMG_PATH);\n int spriteTypeID = 0;\n SpriteType sT;\n \n // WE'LL RENDER ALL THE TILES ON TOP OF THE BLANK TILE\n String blankTileFileName = props.getProperty(MahjongSolitairePropertyType.BLANK_TILE_IMAGE_NAME);\n BufferedImage blankTileImage = miniGame.loadImageWithColorKey(imgPath + blankTileFileName, COLOR_KEY);\n ((MahjongSolitairePanel)(miniGame.getCanvas())).setBlankTileImage(blankTileImage);\n \n // THIS IS A HIGHLIGHTED BLANK TILE FOR WHEN THE PLAYER SELECTS ONE\n String blankTileSelectedFileName = props.getProperty(MahjongSolitairePropertyType.BLANK_TILE_SELECTED_IMAGE_NAME);\n BufferedImage blankTileSelectedImage = miniGame.loadImageWithColorKey(imgPath + blankTileSelectedFileName, COLOR_KEY);\n ((MahjongSolitairePanel)(miniGame.getCanvas())).setBlankTileSelectedImage(blankTileSelectedImage);\n \n // FIRST THE TYPE A TILES, OF WHICH THERE IS ONLY ONE OF EACH\n // THIS IS ANALOGOUS TO THE SEASON TILES IN FLAVORLESS MAHJONG\n ArrayList<String> typeATiles = props.getPropertyOptionsList(MahjongSolitairePropertyType.TYPE_A_TILES);\n for (int i = 0; i < typeATiles.size(); i++)\n {\n String imgFile = imgPath + typeATiles.get(i); \n sT = initTileSpriteType(imgFile, TILE_SPRITE_TYPE_PREFIX + spriteTypeID);\n initTile(sT, TILE_A_TYPE);\n spriteTypeID++;\n }\n \n // THEN THE TYPE B TILES, WHICH ALSO ONLY HAVE ONE OF EACH\n // THIS IS ANALOGOUS TO THE FLOWER TILES IN FLAVORLESS MAHJONG\n ArrayList<String> typeBTiles = props.getPropertyOptionsList(MahjongSolitairePropertyType.TYPE_B_TILES);\n for (int i = 0; i < typeBTiles.size(); i++)\n {\n String imgFile = imgPath + typeBTiles.get(i); \n sT = initTileSpriteType(imgFile, TILE_SPRITE_TYPE_PREFIX + spriteTypeID);\n initTile(sT, TILE_B_TYPE);\n spriteTypeID++;\n }\n \n // AND THEN TYPE C, FOR WHICH THERE ARE 4 OF EACH \n // THIS IS ANALOGOUS TO THE CHARACTER AND NUMBER TILES IN FLAVORLESS MAHJONG\n ArrayList<String> typeCTiles = props.getPropertyOptionsList(MahjongSolitairePropertyType.TYPE_C_TILES);\n for (int i = 0; i < typeCTiles.size(); i++)\n {\n String imgFile = imgPath + typeCTiles.get(i);\n sT = initTileSpriteType(imgFile, TILE_SPRITE_TYPE_PREFIX + spriteTypeID); \n for (int j = 0; j < 4; j++)\n {\n initTile(sT, TILE_C_TYPE);\n }\n spriteTypeID++;\n }\n }", "private void createMaps() {\r\n\t\tint SIZE = 100;\r\n\t\tint x = 0, y = -1;\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tif (i % 10 == 0) {\r\n\t\t\t\tx = 0;\r\n\t\t\t\ty = y + 1;\r\n\t\t\t}\r\n\t\t\tshipStateMap.put(new Point(x, y), 0);\r\n\t\t\tshipTypeMap.put(new Point(x, y), 0);\r\n\t\t\tx++;\r\n\t\t}\r\n\t}", "public TiledMap createMap() {\n map_inter = new MapTile[g_logic.MAP_WIDTH][g_logic.MAP_HEIGHT];\n \n //drawing stuff\n tiles = new Texture(Gdx.files.internal(\"packed/terrain.png\"));\n TextureRegion[][] splitTiles = TextureRegion.split(tiles, 54, 54);\n map = new TiledMap();\n MapLayers layers = map.getLayers();\n TiledMapTileLayer new_layer = new TiledMapTileLayer(g_logic.MAP_WIDTH, g_logic.MAP_HEIGHT, g_logic.ISO_WIDTH, g_logic.ISO_HEIGHT);\n \n //actual generation\n for (int x = 0; x < g_logic.MAP_WIDTH; x++) \n {\n for (int y = 0; y < g_logic.MAP_HEIGHT; y++) \n {\n char chara = '.';\n int ty = 0;\n int tx;\n if (x == 0 || x == g_logic.MAP_WIDTH-1)\n {\n tx = 1;\n chara = '#';\n }\n else\n {\n tx = 0; \n chara = '.';\n }\n \n //set up map tiles\n MapTile tile = new MapTile(x, y, tx, ty, chara);\n Gdx.app.log(\"Map gen\", \"Created a map tile @\" + x + \",\" + y + \" \" + tx + \" \" + ty + \" \" + chara);\n \n //put them in the internal map\n putInterMap(tile, x, y);\n \n //set up renderer cells\n TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();\n //y,x\n cell.setTile(new StaticTiledMapTile(splitTiles[tile.getTextureY()][tile.getTextureX()]));\n new_layer.setCell(x, y, cell);\n }\n }\n \n \n float y_off = g_logic.getYOffset();\n new_layer.setOffsetY(y_off);\n layers.add(new_layer);\n \n g_logic.setInterMap(map_inter);\n\n return map;\n }", "private static void loadSprites(){\n \t\tshipSprites.put(\"SCOUT_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/scout.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"HUNTER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/hunter.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"DESTROYER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/destroyer.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"COLONIZER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/colonizer.png\"), 0.5f, 0.5f));\n \t\t\n \t\t/*\n \t\t * Ships Red Player\n \t\t */\n \t\tshipSprites.put(\"SCOUT_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/scout.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"HUNTER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/hunter.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"DESTROYER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/destroyer.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"COLONIZER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/colonizer.png\"), 0.5f, 0.5f));\n \n \t\t/*\n \t\t * Path Arrows\n \t\t */\n\t\tpathTextures.put(\"HEAD\", Toolkit.getDefaultToolkit().getImage(\"res/path/head.png\"));\n\t\tpathTextures.put(\"START\", Toolkit.getDefaultToolkit().getImage(\"res/path/start.png\"));\n\t\tpathTextures.put(\"STRAIGHT\", Toolkit.getDefaultToolkit().getImage(\"res/path/straight.png\"));\n\t\tpathTextures.put(\"TURN\", Toolkit.getDefaultToolkit().getImage(\"res/path/turn.png\"));\n \t\t\n \t\t/*\n \t\t * Planets\n \t\t */\n \t\tmetalplanets.put(0, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_0.png\"), 0.5f, 0));\n \t\tmetalplanets.put(1, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_1.png\"), 0.5f, 0));\n \t\tmetalplanets.put(2, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_2.png\"), 0.5f, 0));\n \t\tmetalplanets.put(3, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_3.png\"), 0.5f, 0));\n \t\tgasplanets.put(0, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_0.png\"), 0.5f, 0));\n \t\tgasplanets.put(1, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_1.png\"), 0.5f, 0));\n \t\tgasplanets.put(2, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_2.png\"), 0.5f, 0));\n \t\t\n \t\t/*\n \t\t * Colony Sprite\n \t\t */\n \t\tloadColonySprites(Color.RED, \"RED\");\n \t\tloadColonySprites(Color.BLUE, \"BLUE\");\n \t}", "private void generate()\r\n {\r\n mapPieces = myMap.Generate3();\r\n mapWidth = myMap.getMapWidth();\r\n mapHeight = myMap.getMapHeight();\r\n }", "private void ini_Sprites()\r\n\t{\r\n\t\tLogger.DEBUG(\"ini_Sprites\");\r\n\t\tResourceCache.LoadSprites(false);\r\n\t}", "public abstract void createSprites() throws FileNotFoundException;", "private void createSpritesList() {\n\t\tArrayList<PartyMember> pmList = player.getPartyMembers();\n\t\tfor (int i = 0; i < pmList.size(); i++) {\n\t\t\tSprite as = pmList.get(i);\n\t\t\tsprites.put(as.hashCode(), as);\n\t\t}\n\t\telements = new SortingElement[sprites.size()];\n\t\tIterator<Integer> it = sprites.keySet().iterator();\n\t\tint i = 0;\n\t\twhile (it.hasNext()) {\n\t\t\tint index = it.next();\n\t\t\tSprite as = sprites.get(index);\n\t\t\telements[i++] = new SortingElement(as.pos[Values.Y], index);\n\t\t}\n\t}", "public MapGen()//Collect images, create Platform list, create grassy array and generate a random integer as the map wideness\n\t{\n\t\tblocksWide= ThreadLocalRandom.current().nextInt(32, 64 + 1);\n\t\tclouds=kit.getImage(\"Resources/SkyBackground.jpg\");\n\t\tdirt=kit.getImage(\"Resources/Dirt.png\");\n\t\tgrass[0]=kit.getImage(\"Resources/Grass.png\");\n\t\tgrass[1]=kit.getImage(\"Resources/Grass1.png\");\n\t\tgrass[2]=kit.getImage(\"Resources/Grass2.png\");\n\t\tplatforms=new ArrayList<Platform>();\n\t\tgrassy=new int[blocksWide];\n\t\tgrassT=new int[blocksWide];\n\t\tgenerateTerrain();\n\t\t\n\t\t\n\t\t\n\t}", "private void loadSpritesheet() {\n\t\tobjects = new SpriteSheet(\"res\\\\pong.png\");\n\t\tobjects_hires = new SpriteSheet(\"res\\\\ponghires.png\",\n\t\t\t\tSpriteSheet.LINEAR);\n\t}", "public static void LoadSpritesIntoArray() {\r\n\t\t// Get all nodes for the settings\r\n\t\t// Node main = document.getElementById(\"main\");\r\n\t\t// Node textures = document.getElementById(\"textures\");\r\n\t\t// NodeList nList = document.getElementsByTagName(\"TexturePath\");\r\n\r\n\t\t// for (Element texPath : texturePathElements) {\r\n\t\t// System.out.println(texPath.getAttribute(\"name\") + \" \" +\r\n\t\t// texPath.getAttribute(\"name\"));\r\n\t\t// sprites.add(new Sprite(texPath.getAttribute(\"name\"),\r\n\t\t// texPath.getAttribute(\"path\")));\r\n\t\t// }\r\n\r\n\t\tsprites = ImageTools.LoadAllSpriteTexturesFromSpriteSheet(\"In_Game\");\r\n\r\n\t\t/*\r\n\t\t * This method i got from a stack overflow question\r\n\t\t * https://stackoverflow.com/questions/22610526/how-to-append-elements-\r\n\t\t * at-the-end-of-arraylist-in-java\r\n\t\t */\r\n\t\tint endOfList = sprites.size();\r\n\t\tsprites.addAll(endOfList, ImageTools.LoadAllSpriteTexturesFromSpriteSheet(\"In_Game_HUD\"));\r\n\t\tendOfList = sprites.size();\r\n\t\tsprites.addAll(endOfList, ImageTools.LoadAllSpriteTexturesFromSpriteSheet(\"In_Game_Custom\"));\r\n\t\tSystem.out.println(endOfList);\r\n\r\n\t\tfor (Element el : texturePathElements) {\r\n\r\n\t\t\ttry {\r\n\t\t\t\tsprites.add(new Sprite(el.getAttribute(\"name\"), el.getAttribute(\"path\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tisTexturesDone = true;\r\n\t}", "public static void init()\n {\n \tSpriteSheet sheet = new SpriteSheet(ImageLoader.loadImage(\"/sprites/spritesheet.png\"));\n BufferedImage img;\n /*for(int y = 0;y<4;y++)\n \t{\n \t\t\n \timg = sheet.crop(width*y,0,width,height);\n \t\t\n \t\tplayer.add(img);\n \t}*/\n hero = sheet.crop(0,0,width,height);\n heroUp = sheet.crop(width,0,width,height);\n heroLeft = sheet.crop(width*2,0,width,height);\n heroRight = sheet.crop(width*3,0,width,height);\n \n heroDown1 = sheet.crop(0,height+32,width+1,height);\n heroDown2 = sheet.crop(width+1,height+32,width+1,height);\n heroUp1 = sheet.crop(width*2+2,height+32,width,height);\n heroUp2 = sheet.crop(width*3+2,height+32,width,height);\n heroLeft1 = sheet.crop(width*4+2,height+32,width,height);\n heroLeft2 = sheet.crop(width*5+2,height+32,width,height);\n heroRight1 = sheet.crop(width*6+2,height+32,width,height);\n heroRight2 = sheet.crop(width*7+2,height+32,width,height);\n \n /*for(int i = 0;i<4;i++)\n {\n \tfor(int y = 0;y<4;y++)\n \t{\n \t\tif(y==1)\n \t\t{\n \t\t\timg = sheet.crop(width*y,height*i,width,height);\n \t\t}\n \t\telse\n \t\t{\n \t\t\timg = sheet.crop(width*y+1,height*i+1,width,height);\n \t\t}\n \t\tplayer.add(img);\n \t}\n }*/\n sheet = new SpriteSheet(ImageLoader.loadImage(\"/sprites/PokemonTileSet.png\"));\n for(int i = 0;i<50;i++)\n {\n \tfor(int y = 0;y<8;y++)\n \t{\n \t\timg = sheet.crop(tileW*y,tileH*i,tileW,tileH);\n \t\tassets.add(img);\n \t}\n }\n \n /*\n hero = sheet.crop(0,0,width,height);\n heroUp = sheet.crop(width,0,width,height);\n heroLeft = sheet.crop(width*2,0,width,height);\n heroRight = sheet.crop(width*3,0,width,height);\n \n treeTopLeft = sheet.crop(0,firstRow,tWidth,tHeight);\n treeTopRight = sheet.crop(tWidth,firstRow,tWidth,tHeight);\n treeMidLeft = sheet.crop(tWidth*2,firstRow,tWidth,tHeight);\n treeMidRight = sheet.crop(tWidth*3,firstRow,tWidth,tHeight);\n treeBotLeft = sheet.crop(tWidth*4,firstRow,tWidth,tHeight);\n treeBotRight = sheet.crop(tWidth*5,firstRow,tWidth,tHeight);\n treeTopLeftGrass = sheet.crop(tWidth*6,firstRow,tWidth,tHeight);\n treeTopRightGrass = sheet.crop(tWidth*7,firstRow,tWidth,tHeight);\n treeTopLeftMushroom = sheet.crop(tWidth*8,firstRow,tWidth,tHeight);\n grass = sheet.crop(tWidth*9,firstRow,tWidth,tHeight);\n \n wildGrass = sheet.crop(0,secondRow,tWidth,tHeight);\n mushroom = sheet.crop(tWidth,secondRow,tWidth,tHeight);\n logLeft = sheet.crop(tWidth*2,secondRow,tWidth,tHeight);\n logRight = sheet.crop(tWidth*3,secondRow,tWidth,tHeight);\n ledgeLeft = sheet.crop(tWidth*4,secondRow,tWidth,tHeight);\n ledgeMid = sheet.crop(tWidth*5,secondRow,tWidth,tHeight);\n ledgeRight = sheet.crop(tWidth*6,secondRow,tWidth,tHeight);\n treeLeftOverlap = sheet.crop(tWidth*7,secondRow,tWidth,tHeight);\n treeRightOverlap = sheet.crop(tWidth*8,secondRow,tWidth,tHeight);\n \n heroWalkingDown1 = sheet.crop(0,thirdRow,width+1,height);\n heroWalkingDown2 = sheet.crop(width+1,thirdRow,width+1,height);\n heroWalkingUp1 = sheet.crop(width*2+1,thirdRow,width,height);\n heroWalkingUp2 = sheet.crop(width*3+1,thirdRow,width,height);\n heroWalkingLeft1 = sheet.crop(width*4+1,thirdRow,width,height);\n heroWalkingLeft2 = sheet.crop(width*5+1,thirdRow,width,height);\n heroWalkingRight1 = sheet.crop(width*6+1,thirdRow,width,height);\n heroWalkingRight2 = sheet.crop(width*7+1,thirdRow,width,height);\n */\n }", "private void addAllSprites(String heroName) throws IOException {\n BufferedReader reader = new BufferedReader(\n new FileReader(\"assets/config/characters/\"+heroName+\"Sprites.txt\")\n );\n String line = reader.readLine();\n String[] data;\n BufferedImage[] sprites;\n while (line != null) {\n data = line.split(\"\\\\s+\"); //regex for spliting all spaces\n sprites = new BufferedImage[data.length-1];\n for (int i = 1; i < data.length; i++) {\n sprites[i-1] = Util.urlToImage(\"characters/\"+heroName+\"/\"+data[i]);\n \n }\n this.sprites.put(data[0], sprites);\n line = reader.readLine();\n }\n reader.close();\n }", "private void loadMap(ArrayList<Sprite> allSprites) {\n\t\tint numTargets = 0;\n\t\t\n\t\tfor (Sprite thisSprite : allSprites) {\n\t\t\tif(!(thisSprite instanceof Explosion)) {\n\t\t\t\tputInCell(thisSprite.getX(), thisSprite.getY(), thisSprite);\n\t\t\t}\n\t\t\tif (thisSprite instanceof Target) {\n\t\t\t\tnumTargets++;\n\t\t\t}\n\t\t\tif(thisSprite instanceof Door) {\n\t\t\t\tthis.theDoor = (Door)thisSprite;\n\t\t\t}\n\t\t\tif(thisSprite instanceof Player) {\n\t\t\t\tthis.thePlayer = (Player)thisSprite;\n\t\t\t}\n\t\t}\n\t\tthis.numTargets = numTargets;\n\t}", "public void createWorldMap() {\r\n\t\tdo {\r\n\t\t\t//\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Recursive map generation method over here@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n\t\t\t//Generation loop 1 *ADDS VEIN STARTS AND GRASS*\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif (Math.random()*10000>9999) { //randomly spawn a conore vein start\r\n\t\t\t\t\t\ttileMap[i][j] = new ConoreTile (conore, true);\r\n\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t}else if (Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new KannaiteTile(kanna, true);\r\n\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new FuelTile(fuel, true);\r\n\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999) {\r\n\t\t\t\t\t\ttileMap[i][j] = new ForestTile(forest, true);\r\n\t\t\t\t\t\tforestCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new OilTile(oil,true);\r\n\t\t\t\t\t}else if(Math.random()*10000>9997) {\r\n\t\t\t\t\t\ttileMap[i][j] = new MountainTile(mountain, true);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\ttileMap[i][j] = new GrassTile(dirt);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} // End for loop \r\n\t\t\t} // End for loop\r\n\t\t\t//End generation loop 1\r\n\r\n\t\t\t//Generation loop 2 *EXPANDS ON THE VEINS*\r\n\t\t\tdo {\r\n\t\t\t\tif (conoreCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ConoreTile (conore,true);\r\n\t\t\t\t\tconoreCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tconorePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (kannaiteCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new KannaiteTile (kanna,true);\r\n\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (fuelCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new FuelTile (fuel,true);\r\n\t\t\t\t\tfuelCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (forestCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ForestTile (forest,true);\r\n\t\t\t\t\tforestCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tforestPass = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 2\r\n\r\n\t\t\t//Generation loop 3 *COUNT ORES*\r\n\t\t\tint loop3Count = 0;\r\n\t\t\tconorePass = false;\r\n\t\t\tkannaitePass = false;\r\n\t\t\tfuelPass = false;\r\n\t\t\tforestPass = false;\r\n\t\t\tdo {\r\n\t\t\t\tconoreCount = 0;\r\n\t\t\t\tkannaiteCount = 0;\r\n\t\t\t\tfuelCount = 0;\r\n\t\t\t\tforestCount = 0;\r\n\t\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (tileMap[i][j] instanceof ConoreTile) {\r\n\t\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof KannaiteTile) {\r\n\t\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof FuelTile) {\r\n\t\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof ForestTile) {\r\n\t\t\t\t\t\t\tforestCount++;\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\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (conoreCount < 220) {\r\n\t\t\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tconorePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (kannaiteCount < 220) {\r\n\t\t\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (fuelCount< 220) {\r\n\t\t\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (forestCount < 220) {\r\n\t\t\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tforestPass = 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\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tloop3Count++;\r\n\t\t\t\tif (loop3Count > 100) {\r\n\t\t\t\t\tSystem.out.println(\"map generation failed! restarting\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\t\t\t//END OF LOOP 3\r\n\r\n\t\t\t//LOOP 4: THE MOUNTAIN & OIL LOOP\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildMountain(i,j);\r\n\t\t\t\t\tbuildOil(i,j);\r\n\t\t\t\t}\r\n\t\t\t}//End of THE Mountain & OIL LOOP\r\n\r\n\t\t\t//ADD MINIMUM AMOUNT OF ORES\r\n\r\n\t\t\t//Generation Loop 5 *FINAL SETUP*\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif(i == 1 || j == 1 || i == tileMap.length-2 || j == tileMap[i].length-2) {\r\n\t\t\t\t\t\ttileMap[i][j] = new DesertTile(desert);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (i == 0 || j == 0 || i == tileMap.length-1 || j == tileMap[i].length-1) {\r\n\t\t\t\t\t\ttileMap[i][j] = new WaterTile(water);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 5\r\n\t\t\t//mapToString();//TEST RUN\r\n\t\t} while(!conorePass || !kannaitePass || !fuelPass || !forestPass); // End createWorldMap method\r\n\t}", "protected void createMaps() {\n\t\tBlueSchellingCell bCell = new BlueSchellingCell();\n\t\tOrangeSchellingCell oCell = new OrangeSchellingCell();\n\t\tEmptyCell eCell = new EmptyCell();\n\t\tTreeCell tCell = new TreeCell();\n\t\tBurningTreeCell bTCell = new BurningTreeCell();\n\t\tEmptyLandCell eLCell = new EmptyLandCell();\n\n\t\tLiveCell lCell = new LiveCell();\n\t\tDeadCell dCell = new DeadCell();\n\t\tGreenRPSCell gcell = new GreenRPSCell();\n\t\tRedRPSCell rcell = new RedRPSCell();\n\t\tBlueRPSCell blcell = new BlueRPSCell();\n\t\tWhiteRPSCell wcell = new WhiteRPSCell();\n\n\t\tFishCell fCell = new FishCell();\n\t\tSharkCell sCell = new SharkCell();\n\n\t\tAntGroupCell aCell = new AntGroupCell();\n\n\t\tsegregation.put('b', bCell);\n\t\tsegregation.put('o', oCell);\n\t\tsegregation.put('e', eCell);\n\n\t\tgameOfLife.put('l', lCell);\n\t\tgameOfLife.put('d', dCell);\n\n\t\trps.put('g', gcell);\n\t\trps.put('r', rcell);\n\t\trps.put('b', blcell);\n\t\trps.put('w', wcell);\n\n\t\tspreadingWildfire.put('t', tCell);\n\t\tspreadingWildfire.put('b', bTCell);\n\t\tspreadingWildfire.put('e', eLCell);\n\n\t\twaTor.put('f', fCell);\n\t\twaTor.put('s', sCell);\n\t\twaTor.put('e', eCell);\n\n\t\tforagingAnts.put('a', aCell);\n\t\tforagingAnts.put('e', eCell);\n\t\tinitExportMap();\n\n\t\tinitCountMap();\n\t}", "private void createTiles() {\n\t\tint tile_width = bitmap.getWidth() / gridSize;\n\t\tint tile_height = bitmap.getHeight() / gridSize;\n\n\t\tfor (short row = 0; row < gridSize; row++) {\n\t\t\tfor (short column = 0; column < gridSize; column++) {\n\t\t\t\tBitmap bm = Bitmap.createBitmap(bitmap, column * tile_width,\n\t\t\t\t\t\trow * tile_height, tile_width, tile_height);\n\n\t\t\t\t// if final, Tile -> blank\n\t\t\t\tif ((row == gridSize - 1) && (column == gridSize - 1)) {\n\t\t\t\t\tbm = Bitmap.createBitmap(tile_width, tile_height,\n\t\t\t\t\t\t\tbm.getConfig());\n\t\t\t\t\tbm.eraseColor(Color.WHITE);\n\t\t\t\t\ttheBlankTile = new Tile(bm, row, column);\n\t\t\t\t\ttiles.add(theBlankTile);\n\t\t\t\t} else {\n\t\t\t\t\ttiles.add(new Tile(bm, row, column));\n\t\t\t\t}\n\t\t\t} // end column\n\t\t} // end row\n\t\tbitmap.recycle();\n\n\t}", "@Override\n\tprotected void generateMap() {\n\t\t//read map from tmx\n\t\tmap = null;\n\t\tfinal String tmx = \"res/tiles/map.tmx\";\n\t\ttry {\n\t\t\tTMXMapReader mapReader = new TMXMapReader();\n\t\t\tmap = mapReader.readMap(tmx);\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tTileLayer layer = (TileLayer)map.getLayer(0);\n\n\t\ttiles = new PropertyTile[layer.getWidth()][layer.getHeight()];\n\t\tfor(int x=0; x<layer.getWidth(); x++) {\n\t\t\tfor(int y=0; y<layer.getHeight(); y++) {\n\t\t\t\tTile tile = layer.getTileAt(x, y);\n\t\t\t\tString type = (String)tile.getProperties().get(\"type\");\n\t\t\t\ttiles[x][y] = new PropertyTile(tile, TileType.valueOf(type.toUpperCase()));\n\t\t\t\ttiles[x][y].setImage(tile.getImage());\n\t\t\t}\n\t\t}\n\t\t\n\t\t//generate animated tiles from river tileset\n\t\tTileSet riverset = map.getTileSets().get(1);\n\t\tList<AnimatedTile> animatedTiles = new ArrayList<>();\n\t\tfor(int i=0; i<5; i++) {\n\t\t\tTile[] frames = new Tile[3];\n\t\t\tIterator<Tile> iterator = riverset.iterator();\n\t\t\twhile(iterator.hasNext()) {\n\t\t\t\tTile tile = iterator.next();\n\t\t\t\tint rtile = Integer.parseInt(tile.getProperties().getProperty(\"tile\"));\n\t\t\t\tint frame = Integer.parseInt(tile.getProperties().getProperty(\"frame\"));\n\t\t\t\tif(rtile == i+1) {\n\t\t\t\t\tframes[frame-1] = tile;\n\t\t\t\t}\n\t\t\t}\n\t\t\tAnimatedTile aTile = new AnimatedTile(frames);\n\t\t\tanimatedTiles.add(aTile);\n\t\t}\n\n\t\t//replace tiles in map with animated tiles\n//\t\tfor(int x=0; x<layer.getWidth(); x++) {\n//\t\t\tfor(int y=0; y<layer.getHeight(); y++) {\n//\t\t\t\tTile tile = layer.getTileAt(x, y);\n//\t\t\t\tif(tile.getProperties().containsKey(\"animated\")) {\n//\t\t\t\t\tint rtile = Integer.parseInt(tile.getProperties().getProperty(\"tile\"));\n//\t\t\t\t\tlayer.setTileAt(x, y, animatedTiles.get(rtile-1));\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}", "public void create(int [][] arr) {\n //default background image\n gc.drawImage(bg0, 0, 0);\n gc.drawImage(bg0, 1024,0);\n\n // traverses 2D array to creat map\n for(int i = 0; i < arr.length; i++) {\n for(int j = 0; j < arr[0].length; j++) {\n if(arr[i][j] == 0) {\n //blank space, for reference\n } else if(arr[i][j] == 1) { // make IndestructibleObject\n IndestructibleObject object = new IndestructibleObject(img0, j*64, i*64);\n mapList.add(object);\n } else if(arr[i][j] == 2) { // make DestructibleObject\n DestructibleObject object = new DestructibleObject(img1, j*64, i*64);\n mapList.add(object);\n } else if(arr[i][j] == 3) { // make power up\n PowerUpObject object = new PowerUpObject(img2, j*64+1, i*64, 1);\n powerList.add(object);\n } else if(arr[i][j] == 4) { // make power up\n PowerUpObject object = new PowerUpObject(img3, j*64+1, i*64, 2);\n powerList.add(object);\n } else if(arr[i][j] == 5) { // make power up\n PowerUpObject object = new PowerUpObject(img4, j*64+1, i*64, 3);\n powerList.add(object);\n } else if(arr[i][j] == 6) { // make power up\n PowerUpObject object = new PowerUpObject(img5, j*64+1, i*64, 4);\n powerList.add(object);\n }\n }\n }\n }", "@Override\r\n public void init() {\n Image bgImage = assets().getImage(\"images/bg.png\");\r\n ImageLayer bgLayer = graphics().createImageLayer(bgImage);\r\n graphics().rootLayer().add(bgLayer);\r\n\r\n // Create tiles\r\n tiles = new int[BOARD_MAX_WIDTH][BOARD_MAX_HEIGHT];\r\n printTiles();\r\n\r\n // Place mines at random positions\r\n int placedMines = 0;\r\n Random r = new Random();\r\n while (placedMines < MINES) {\r\n int row = r.nextInt(BOARD_MAX_WIDTH);\r\n int col = r.nextInt(BOARD_MAX_HEIGHT);\r\n if (tiles[row][col] == TILE_EMPTY) {\r\n tiles[row][col] = TILE_MINE;\r\n placedMines++;\r\n }\r\n }\r\n printTiles();\r\n\r\n // Count number of mines around blank tiles\r\n for (int row = 0; row < BOARD_MAX_WIDTH; row++) {\r\n for (int col = 0; col < BOARD_MAX_WIDTH; col++) {\r\n // Check surrounding tiles if mine\r\n if (tiles[row][col] == TILE_MINE) {\r\n for (int rowCheck = -1; rowCheck <= 1; rowCheck++) {\r\n for (int colCheck = -1; colCheck <= 1; colCheck++) {\r\n if (tileExistAndNotMine(row+rowCheck, col+colCheck)) {\r\n tiles[row+rowCheck][col+colCheck]++;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n printTiles();\r\n\r\n // Create tile map\r\n Map<Integer, TileType> tileMap = new HashMap<Integer, TileType>();\r\n tileMap.put(0, TileType.EMPTY);\r\n tileMap.put(1, TileType.ONE);\r\n tileMap.put(2, TileType.TWO);\r\n tileMap.put(3, TileType.THREE);\r\n tileMap.put(4, TileType.FOUR);\r\n tileMap.put(5, TileType.FIVE);\r\n tileMap.put(6, TileType.SIX);\r\n tileMap.put(7, TileType.SEVEN);\r\n tileMap.put(8, TileType.EIGHT);\r\n tileMap.put(9, TileType.MINE);\r\n\r\n // Create a GroupLayer to hold the sprites\r\n GroupLayer groupLayer = graphics().createGroupLayer();\r\n graphics().rootLayer().add(groupLayer);\r\n\r\n // Create graphic tiles\r\n tileList = new ArrayList<Tile>();\r\n for (int row = 0; row < BOARD_MAX_WIDTH; row++) {\r\n for (int col = 0; col < BOARD_MAX_WIDTH; col++) {\r\n Tile tile = new Tile(groupLayer, col*Tile.SIZE, row*Tile.SIZE, tileMap.get(tiles[row][col]), row, col);\r\n tileList.add(tile);\r\n }\r\n }\r\n\r\n // Timer text\r\n CanvasImage canvasImage = graphics().createImage(160, 70);\r\n timerLabel = canvasImage.canvas();\r\n ImageLayer countDownLayer = graphics().createImageLayer(canvasImage);\r\n countDownLayer.setTranslation(180, 10);\r\n graphics().rootLayer().add(countDownLayer);\r\n\r\n // Cleared tiles text\r\n CanvasImage clearedTilesImage = graphics().createImage(160, 70);\r\n clearedTilesLabel = clearedTilesImage.canvas();\r\n ImageLayer clearedTilesLayer = graphics().createImageLayer(clearedTilesImage);\r\n clearedTilesLayer.setTranslation(180, 30);\r\n graphics().rootLayer().add(clearedTilesLayer);\r\n updateClearedTiles();\r\n }", "public void drawMap() {\r\n\t\tfor (int x = 0; x < map.dimensionsx; x++) {\r\n\t\t\tfor (int y = 0; y < map.dimensionsy; y++) {\r\n\t\t\t\tRectangle rect = new Rectangle(x * scalingFactor, y * scalingFactor, scalingFactor, scalingFactor);\r\n\t\t\t\trect.setStroke(Color.BLACK);\r\n\t\t\t\tif (islandMap[x][y]) {\r\n\t\t\t\t\tImage isl = new Image(\"island.jpg\", 50, 50, true, true);\r\n\t\t\t\t\tislandIV = new ImageView(isl);\r\n\t\t\t\t\tislandIV.setX(x * scalingFactor);\r\n\t\t\t\t\tislandIV.setY(y * scalingFactor);\r\n\t\t\t\t\troot.getChildren().add(islandIV);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trect.setFill(Color.PALETURQUOISE);\r\n\t\t\t\t\troot.getChildren().add(rect);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void render() {\n\t\tupdate();\n\n\t\tGdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); // clear the screen\n\t\tbatch.begin();\n\n\t\tTextureRegion tmpRegion = null;\n\t\t\n\t\t// Draw the terrain!\n\t\tfor (int x = 0; x < 30; ++x) {\n\t\t\tfor (int y = 0; y < 20; ++y) {\n\t\t\t\ttmpRegion = new TextureRegion( tileset32Texture, (tiles[x][y] - 4) * 32, 0, 32, 32);\n\t\t\t\t//pause_button_region = new TextureRegion( spriteSheet, tiles[x][y] - 4, 0, 32, 32);\n\t\t\t\t// switch to 32x32 sprite\n\t\t\t\t//batch.draw(spriteSheet, x * 16, y * 16, tiles[x][y] * 16, 0, 16, 16);\n\t\t\t\tbatch.draw(tmpRegion, x * SQUARE_WIDTH, y * SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH);\n\n\t\t\t\t// Temporary, copy pasta\n\t\t\t\t/*\n\t\t\t\t * switch( movementDirs[x][y] ) { case 'N': batch.draw(\n\t\t\t\t * spriteSheet, x*16, y*16, 11*16, 0, 16, 16 ); break; case 'E':\n\t\t\t\t * batch.draw( spriteSheet, x*16, y*16, 12*16, 0, 16, 16 );\n\t\t\t\t * break; case 'W': batch.draw( spriteSheet, x*16, y*16, 13*16,\n\t\t\t\t * 0, 16, 16 ); break; case 'S': batch.draw( spriteSheet, x*16,\n\t\t\t\t * y*16, 14*16, 0, 16, 16 ); break; }\n\t\t\t\t */\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// Draw the towers\n\t\tfor( int i = 0; i < towers.size(); ++i )\n\t\t{\n\t\t\tbatch.draw(towers.get(i).m_type.getTextureRegion(), towers.get(i).m_x * SQUARE_WIDTH, (towers.get(i).m_y) * SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH);\n\t\t\t//drawSprite(towers.get( i ).getIconNum(), towers.get(i).m_x, towers.get(i).m_y);\n\t\t\tif (towers.get(i).selected) {\n\t\t\t\t//batch.draw(spriteSheet, towers.get(i).m_x * SQUARE_WIDTH, towers.get(i).m_y * SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, towers.get(i).m_type.getSpriteLocX(), towers.get(i).m_type.getSpriteLocY(), 16, 16, false, true);\n\t\t\t\t//drawSprite(towers.get( i ).getIconNum(), towers.get(i).m_x, towers.get(i).m_y);\n\t\t\t\tbatch.draw(selectionImg, towers.get(i).m_x * SQUARE_WIDTH, towers.get(i).m_y * SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 0, 0, 32, 32, false, true);\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\t// Draw the creeps!\n\t\tfor( int i = 0; i < creeps.size(); ++i)\n\t\t{\n\n\t\t\tif( creeps.get(i).active ) {\n\t\t\t\tTextureRegion toUse = null;\n\t\t\t\t//TextureRegion toUse = new TextureRegion(corporateCreepTexture);\n\t\t\t\tif (creeps.get(i).m_type == CreepType.GLOBAL_CORP) {\n\t\t\t\t\ttoUse = new TextureRegion(corporateCreepTexture);\n\t\t\t\t} else if (creeps.get(i).m_type == CreepType.SEARCHER) {\n\t\t\t\t\ttoUse = new TextureRegion(defconZeplinTexture);\n\t\t\t\t} else if (creeps.get(i).m_type == CreepType.GOVERNMENT) {\n\t\t\t\t\ttoUse = new TextureRegion(govHeliTexture);\n\t\t\t\t} else {\n\t\t\t\t\t// TODO: Change this to difference art.\n\t\t\t\t\ttoUse = new TextureRegion(corporateCreepTexture);\n\t\t\t\t}\n\t\t\t\tbatch.draw(toUse, creeps.get(i).x * SQUARE_WIDTH + creeps.get(i).xOffset, creeps.get(i).y * SQUARE_WIDTH + creeps.get(i).yOffset, SQUARE_WIDTH, SQUARE_WIDTH);\n\t\t\t\t//batch.draw(toUse, creeps.get(i).x * SQUARE_WIDTH + creeps.get(i).xOffset, creeps.get(i).y * SQUARE_WIDTH + creeps.get(i).yOffset, SQUARE_WIDTH, SQUARE_WIDTH, 0, 32, 32, 32, false, false);\n\t\t\t}\n\t\t}\n\n\t\t// Draw the projectiles!\n\t\tfor( int i = 0; i < maxProjectiles; ++i )\n\t\t{\n\t\t\tif( projectiles[i].active )\n\t\t\t{\n//\t\t\t\tbatch.draw( spriteSheet, projectiles[i].my_coords.x*SQUARE_WIDTH, projectiles[i].my_coords.y*SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 0, 16*3, 16, 16, false, false);\n\t\t\t\tif (projectiles[i].towertype == \"judge\"){\n\t\t\t\t\tbatch.draw( spriteSheet, projectiles[i].my_coords.x*SQUARE_WIDTH, projectiles[i].my_coords.y*SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 0, 16*3, 16, 16, false, false);\n\t\t\t\t} else if (projectiles[i].towertype == \"teacher\"){\n\t\t\t\t\tbatch.draw( spriteSheet, projectiles[i].my_coords.x*SQUARE_WIDTH, projectiles[i].my_coords.y*SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 16, 16*3, 16, 16, false, false);\n\t\t\t\t} else if (projectiles[i].towertype == \"lawyer\"){\n\t\t\t\t\tbatch.draw( spriteSheet, projectiles[i].my_coords.x*SQUARE_WIDTH, projectiles[i].my_coords.y*SQUARE_WIDTH, SQUARE_WIDTH, SQUARE_WIDTH, 32, 16*3, 16, 16, false, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw the UI!\n\n\t\t// Background\n\n\t\tbatch.draw(blackBox, 0, 0, uiPanelWidth , screenHeight);\n\n\t\t// Draw the menu bar\n\t\tbatch.draw(menuTexture,-4,-190);\n\t\t//batch.draw(menu_region, 0, -100);\n\t\t\n\t\t// Draw the free towers.\n\t\t\n\t\tfor (int i = 1; i <= 3; i++) \n\t\t{\n\t\t\tif (free_towers.get(i-1) != null) \n\t\t\t{\n\t\t\t\t//tower_region.setRegion( free_towers.get(i-1).getSpriteLocX(), free_towers.get(i-1).getSpriteLocY(), 16, 16 );\n\t\t\t\tbatch.draw(free_towers.get(i-1).getTextureRegion(), 29, (screenHeight - 60 * i) + 5, SQUARE_WIDTH, SQUARE_WIDTH);\n\t\t\t\t//batch.draw(tower_region, 33, screenHeight - 57 * i, 16, 16);\n\t\t\t\t\n\t\t\t\tString towerPrice = \"$\" + free_towers.get(i-1).getPrice();\n\t\t\t\tTextBounds priceBounds = mFont.getBounds(towerPrice);\n\t\t\t\tColor oldColor = mFont.getColor();\n\t\t\t\tmFont.setColor(Color.GREEN);\n\t\t\t\tmFont.drawWrapped(batch, towerPrice, 10, 33 + screenHeight - 58*i + priceBounds.height, priceBounds.width);\n\t\t\t\tmFont.setColor(oldColor);\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t// Keep the GC in its cage as long as possible. \n\t\tif( oldMoney != money || oldLife != life )\n\t\t{\n\t\t\tuiString = \"+: \" + life + '\\n' + \"$: \" + money;\n\t\t\tuiBounds = mFont.getMultiLineBounds(uiString);\n\t\t}\n\t\toldMoney = money;\n\t\toldLife = life;\n\t\t\t\t\n\t\t// Draw droid pause button if on an android device.\n\t\tif (runningDrd) {\n\t\t\t\n\t\t\tpause_button_region.setRegion(7*17, 23, 2, 2);\n\t\t\tbatch.draw(pause_button_region, DRD_PAUSE_RECT.x, DRD_PAUSE_RECT.y, DRD_PAUSE_RECT.width, DRD_PAUSE_RECT.height);\n\t\t\t\n\t\t\tString pause_button_string = \"Pause\";\n\t\t\tTextBounds pauseButtonBounds = mFont.getBounds(pause_button_string);\n\t\t\tmFont.drawWrapped(batch, pause_button_string,\n\t\t\t\t\t\t\t(32 - (pauseButtonBounds.width / 2)),\n\t\t\t\t\t\t\tDRD_PAUSE_RECT.y + pauseButtonBounds.height + 4, pauseButtonBounds.width);\n\t\t}\n\t\t\n\t\t// Draw the restart button if paused or game over.\n\t\tif (life <= 0 || isPaused) {\n\t\t\t\n\t\t\trestart_button_region.setRegion(7*17, 23, 2, 2);\n\t\t\tbatch.draw(restart_button_region, RESTART_RECT.x, RESTART_RECT.y, RESTART_RECT.width, RESTART_RECT.height);\n\t\t\t\n\t\t\tString restart_button_string = \"Restart\";\n\t\t\tTextBounds restartButtonBounds = mFont.getBounds(restart_button_string);\n\t\t\tmFont.drawWrapped(batch, restart_button_string,\n\t\t\t\t\t\t\t(32 - (restartButtonBounds.width / 2)),\n\t\t\t\t\t\t\tRESTART_RECT.y + restartButtonBounds.height + 4, restartButtonBounds.width);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t// Draw the start button if we are in build mode.\n\t\tif (buildMode) {\n\t\t\t\n\t\t\tstart_button_region.setRegion(7*17, 23, 2, 2);\n\t\t\tbatch.draw(start_button_region, START_RECT.x, START_RECT.y, START_RECT.width, START_RECT.height);\n\t\t\t\n\t\t\tString start_button_string = \"Start\";\n\t\t\tTextBounds startButtonBounds = mFont.getBounds(start_button_string);\n\t\t\tmFont.drawWrapped(batch, start_button_string,\n\t\t\t\t\t\t\t(32 - (startButtonBounds.width / 2)),\n\t\t\t\t\t\t\tSTART_RECT.y + startButtonBounds.height + 4, startButtonBounds.width);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t// Draw the sell button if we are not paused or in build mode and a tower is selected.\n\t\tif (!isPaused && !buildMode && selected != null) {\n\t\t\t\n\t\t\tsell_button_region.setRegion(7*17, 23, 2, 2);\n\t\t\tbatch.draw(sell_button_region, SELL_RECT.x, SELL_RECT.y, SELL_RECT.width, SELL_RECT.height);\n\t\t\t\n\t\t\tString sell_button_string = \"Sell\";\n\t\t\tTextBounds sellButtonBounds = mFont.getBounds(sell_button_string);\n\t\t\tmFont.drawWrapped(batch, sell_button_string,\n\t\t\t\t\t\t\t(32 - (sellButtonBounds.width / 2)),\n\t\t\t\t\t\t\tSTART_RECT.y + sellButtonBounds.height + 4, sellButtonBounds.width);\n\t\t}\n\t\t\n\t\t// Text\n\t\tString uiString = \"+ \" + life + '\\n' + \"$ \" + money;\n\t\tTextBounds uiBounds = mFont.getMultiLineBounds(uiString);\n\t\tColor oldColor = mFont.getColor();\n\t\tmFont.setColor(Color.RED);\n\t\tmFont.drawWrapped(batch, uiString, 3, uiBounds.height + 3, uiBounds.width);\n\t\tmFont.setColor(oldColor);\n\n\t\t// DEBUG TEXT\n\t\t//mFont.drawWrapped(batch, debugtext, 60, uiBounds.height + 3, 1000);\t\t\n\n\t\t// Draw the cursorTexture\n\t\tif (cursorState != null && cursorTexture != null) {\n\t\t\tbatch.draw(cursorTexture, cursorLocX - 8, screenHeight - cursorLocY - 8);\n\t\t}\n\t\t\n\t\t// Render Paused String if needed in bottom right corner.\n\t\tString center_string = null;\n\t\tif (isPaused) {\n\t\t\tcenter_string = \"PAUSED\";\n\t\t} else if (life <= 0) {\n\t\t\tcenter_string = \"GAME OVER\";\n\t\t}\n\t\t\n\t\tif (center_string != null) {\n\t\t\tTextBounds pausedBounds = mFont.getMultiLineBounds(center_string);\n\t\t\tColor oldColor2 = mFont.getColor();\n\t\t\tmFont.setColor(Color.RED);\n\t\t\tmFont.drawWrapped(batch, center_string,\n\t\t\t\t\t(screenWidth / 2) - (pausedBounds.width / 2),\n\t\t\t\t\t(screenHeight / 2) - (pausedBounds.height / 2), pausedBounds.width );\n\t\t\tmFont.setColor(oldColor2);\n\t\t}\n\t\t\n\t\tbatch.end();\n\t}", "private void fillImageMap() {\n Image shipImage;\n try {\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat.png\"));\n imageMap.put(ShipType.PATROL_BOAT, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat_sunken.png\"));\n imageMap.put(ShipType.PATROL_BOAT_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL_SUNKEN, shipImage);\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "private void createIdleRegions(Texture spriteSheet) {\n\n TextureRegion downRegion = new TextureRegion(spriteSheet, 0, 0, TILESIZE, TILESIZE);\n\n idleSprites.add(new TextureRegion(spriteSheet, 0, TILESIZE * 3, TILESIZE, TILESIZE));\n idleSprites.add(new TextureRegion(spriteSheet, 0, TILESIZE, TILESIZE, TILESIZE));\n idleSprites.add(downRegion);\n idleSprites.add(new TextureRegion(spriteSheet, 0, TILESIZE * 2, TILESIZE, TILESIZE));\n idleSprites.add(downRegion);\n }", "public void Define() {\n manager = new Manager(); // Initialize other classes\n save = new Save();\n store = new Store();\n menu = new Menu();\n postgame = new PostGame();\n\n map = new ImageIcon(\"res/map.png\").getImage(); // Load background image\n \t\n \n // Load the track image\n track = new ImageIcon(\"res/TrackCorner.png\").getImage(); // Initialize the track image file\n \n // Load images for the towers\n tileset_towers[0] = new ImageIcon(\"res/redlasertower.png\").getImage();\n tileset_towers[1] = new ImageIcon(\"res/blueLaserTower.png\").getImage();\n tileset_towers[2] = new ImageIcon(\"res/goldLaserTower.png\").getImage();\n \n // Load images for the indicators\n tileset_indicators[0] = new ImageIcon(\"res/button.png\").getImage();\n tileset_indicators[1] = new ImageIcon(\"res/money.png\").getImage();\n tileset_indicators[2] = new ImageIcon(\"res/heart.png\").getImage();\n \n // Load images for the buttons\n tileset_buttons[0] = new ImageIcon(\"res/redLaserTower.png\").getImage();\n tileset_buttons[1] = new ImageIcon(\"res/blueLaserTower.png\").getImage();\n tileset_buttons[2] = new ImageIcon(\"res/goldLaserTower.png\").getImage();\n tileset_buttons[3] = new ImageIcon(\"res/trash.png\").getImage();\n \n // Load images for the solider\n tileset_soldier[0] = new ImageIcon(\"res/enemyD1.png\").getImage();\n tileset_soldier[1] = new ImageIcon(\"res/enemyD2.png\").getImage();\n \n tileset_soldier[2] = new ImageIcon(\"res/enemyR1.png\").getImage();\n tileset_soldier[3] = new ImageIcon(\"res/enemyR2.png\").getImage();\n \n tileset_soldier[4] = new ImageIcon(\"res/enemyL1.png\").getImage();\n tileset_soldier[5] = new ImageIcon(\"res/enemyL2.png\").getImage();\n \n tileset_soldier[6] = new ImageIcon(\"res/enemyU1.png\").getImage();\n tileset_soldier[7] = new ImageIcon(\"res/enemyU2.png\").getImage();\n \n // Save the configuration of the track\n save.loadSave(new File(\"save/mission.txt\"));\n save.loadHighScore();\n \n // Initialize enemy objects\n for(int i = 0; i < enemies.length; i++) {\n \tenemies[i] = new Enemy();\n }\n \n }", "private void createTile(){\n for(int i = 0; i < COPY_TILE; i++){\n for(int k = 0; k < DIFF_TILES -2; k++){\n allTiles.add(new Tile(k));\n }\n }\n }", "public static Tile[][] setUpMap() {\n\n Tile[][] tiles = new Tile[5][9];\n String[][] defaultMapLayout = GameMap.getMapLayout();\n\n for (int i = 0; i < 5; i++) {\n\n for (int j = 0; j < 9; j++) {\n\n String tileType = defaultMapLayout[i][j];\n\n if (tileType.equals(\"P\")) {\n Tile newTileName = new Plain();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"R\")) {\n Tile newTileName = new River();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"M1\")) {\n Tile newTileName = new Mountain1();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"M2\")) {\n Tile newTileName = new Mountain2();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"M3\")) {\n Tile newTileName = new Mountain3();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"SM\")) {\n Tile newTileName = new SwampMonster();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"O\")) {\n Tile newTileName = new Ocean();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"G\")) {\n Tile newTileName = new Grass();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"V\")) {\n Tile newTileName = new Volcano();\n tiles[i][j] = newTileName;\n\n }else {\n Tile newTileName = new Plain();\n tiles[i][j] = newTileName;\n newTileName.setOwner(null);\n }\n\n }\n }\n return tiles;\n }", "private void fillMap() {\n\t\tObject tile = new Object();\n\t\tfor(int x = 0; x < map.length; x++) {\n\t\t\tfor(int y = 0; y < map.length; y++) {\n\t\t\t\tmap[x][y] = tile;\n\t\t\t}\n\t\t}\n\t}", "public static void load(){\r\n\t \ttry {\r\n\t \t\t// load and set all sprites\r\n\t\t\t\tsetBlueGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/blueGarbage.png\")));\r\n\t\t\t\tsetRank(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/rank.png\")));\r\n\t\t\t\tsetRedGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/redGarbage.png\")));\r\n\t\t\t\tsetYellowGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/yellowGarbage.png\")));\r\n\t\t\t\tsetGreenGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/greenGarbage.png\")));\r\n\t\t\t\tsetBlueSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/blueSnakeBodyPart.png\")));\r\n\t\t\t\tsetRedSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/redSnakeBodyPart.png\")));\r\n\t\t\t\tsetYellowSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/yellowSnakeBodyPart.png\")));\r\n\t\t\t\tsetGreenSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/greenSnakeBodyPart.png\")));\r\n\t\t\t\tsetHeart(ImageIO.read(classPath.getResourceAsStream(\"/images/heart.png\")));\r\n\t\t\t\tsetGameScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameScreenBackground.png\")));\r\n\t\t\t\tsetGameScreenHeader(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameScreenHeader.png\")));\r\n\t\t\t\tsetGameOver(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameOver.png\")));\r\n\t\t\t\tsetHitsOwnBody(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/hitsOwnBody.png\")));\r\n\t\t\t\tsetHitsWall(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/hitsWall.png\")));\r\n\t\t\t\tsetWrongColor(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/wrongColor.png\")));\r\n\t\t\t\tsetHelpScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/helpScreenBackground.png\")));\r\n\t\t\t \tsetWarningScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/warningScreenBackground.png\")));\r\n\t\t\t \tsetOkButton(ImageIO.read(classPath.getClass().getResource(\"/images/okButton.png\")));\r\n\t\t\t \tsetMenuScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/menuScreenBackground.png\")));\r\n\t\t\t\tsetStartButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/startButton.png\")));\r\n\t\t\t\tsetExitButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/exitButton.png\")));\r\n\t\t\t\tsetHelpButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/helpButton.png\")));\r\n\t\t\t\t\r\n\t \t} \r\n\t \tcatch (Exception e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getStackTrace(), \"Erro ao carregar imagens\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\r\n\t\t\t}\t\r\n \t\r\n \t}", "public void resetSprites() {\n\t\tSPRITE_LIST.clear();\n\t}", "private void initTextures() {\n\n\t\ttextureManager.loadTexture(\"PNG\", \"menu_bg\", \"res/menu_bg.png\");\n\t\ttextureManager.loadTexture(\"PNG\", \"mountain_bg\", \"res/mountain_bg.png\");\n\t\ttextureManager.loadTexture(\"PNG\", \"ball\", \"res/ball_sm.png\");\n\t\ttextureManager.loadTexture(\"PNG\", \"inner_bg1\", \"res/inner_bg1.png\");\r\n\t\ttextureManager.loadSheet(\"stand_still\", \"res/stand_still.png\", 32, 64);\n\t\ttextureManager.loadSheet(\"testAnim\", \"res/testAnim.png\", 32, 64);\n\t\ttextureManager.loadSheet(\"tileSet\", \"res/tileset_small.png\", 32, 32);\n\t\ttextureManager.loadSheet(\"walking\", \"res/walking.png\", 32, 64);\r\n\t\ttextureManager.loadSheet(\"jumping\", \"res/jumping.png\", 32, 64);\n\t\ttextureManager.loadSheet(\"slime_still\", \"res/slime_still_small.png\", 32, 32);\n\t}", "public void createMap() {\n\t\tArrayList<String>boardMap = new ArrayList<String>(); //boardmap on tiedostosta ladattu maailman malli\n\t\t\n\t\t//2. try catch blocki, ei jaksa laittaa metodeja heittämään poikkeuksia\n\t\ttry {\n\t\t\tboardMap = loadMap(); //ladataan data boardMap muuttujaan tiedostosta\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\t\n\t\t// 3. j=rivit, i=merkit yksittäisellä rivillä\n\t\tfor(int j=0; j<boardMap.size();j++){ \t\t//..rivien lkm (boardMap.size) = alkioiden lkm. \n\t\t\tfor(int i=0; i<boardMap.get(j).length(); i++){\t\t//..merkkien lkm rivillä (alkion Stringin pituus .length)\n\t\t\t\tCharacter hexType = boardMap.get(j).charAt(i);\t//tuodaan tietyltä riviltä, yksittäinen MERKKI hexType -muuttujaan\n\t\t\t\tworld.add(new Hex(i, j, hexType.toString()));\t//Luodaan uusi HEXa maailmaan, Character -merkki muutetaan Stringiksi että Hex konstructori hyväksyy sen.\n\t\t\t}\n\t\t}\n\t\tconvertEmptyHex();\n\t}", "private void initTiles(){\n\t\ttiles = new Tile[size * size];\n\t\tfor(int i = 0; i < tiles.length; i++){\n\t\t\ttiles[i] = new Tile(KEYS[i]);\n\t\t}\n\t}", "public static void createImages()\n {\n //Do if not done before\n if(!createdImages)\n {\n createdImages = true;\n for(int i=0; i<rightMvt.length; i++)\n {\n rightMvt[i] = new GreenfootImage(\"sniperEnemyRight\"+i+\".png\");\n leftMvt[i] = new GreenfootImage(\"sniperEnemyRight\"+i+\".png\");\n rightMvt[i].scale(rightMvt[i].getWidth()*170/100, rightMvt[i].getHeight()*170/100);\n leftMvt[i].scale(leftMvt[i].getWidth()*170/100, leftMvt[i].getHeight()*170/100);\n }\n for(int i=0; i<leftMvt.length; i++)\n {\n leftMvt[i].mirrorHorizontally();\n }\n for(int i=0; i<upMvt.length; i++)\n {\n upMvt[i] = new GreenfootImage(\"sniperEnemyUp\"+i+\".png\");\n downMvt[i] = new GreenfootImage(\"sniperEnemyDown\"+i+\".png\");\n upMvt[i].scale(upMvt[i].getWidth()*170/100, upMvt[i].getHeight()*170/100);\n downMvt[i].scale(downMvt[i].getWidth()*170/100, downMvt[i].getHeight()*170/100);\n }\n }\n }", "public void createTiles() {\r\n Session session = sessionService.getCurrentSession();\r\n Campaign campaign = session.getCampaign();\r\n\r\n tilePane.getChildren().clear();\r\n List<Pc> pcs = null;\r\n try {\r\n pcs = characterService.getPlayerCharacters();\r\n } catch (MultiplePlayersException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n if (pcs != null) {\r\n pcs = pcs.stream().filter(pc -> campaign.getPcs().stream().anyMatch(\r\n campaignPc -> campaignPc.getId().equalsIgnoreCase(pc.getId())\r\n )).collect(Collectors.toList());\r\n\r\n for (Pc pc : pcs) {\r\n SortedMap<String, String> items = getTileItems(pc);\r\n Tile tile = new Tile(pc.getId(), pc.getName(), items);\r\n tile.setOnMouseClicked(mouseEvent -> {\r\n try {\r\n sessionService.updateParticipant(playerManagementService.getRegisteredPlayer().getId(), tile.getObjectId());\r\n } catch (EntityNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n parentController.updateSession(sessionService.getCurrentSession());\r\n parentController.switchView();\r\n });\r\n tilePane.getChildren().add(tile);\r\n }\r\n }\r\n }", "private void generateEnemies() {\n for(int i =0; i < currentEnemies.length; i++) {\n Attributes a = genAttributes();\n double[] healthSpeed = genHealthAndSpeed();\n LinkedList<Pathing> paths = map.getPathings();\n this.currentEnemies[i] = new Enemy(determineImage(a, healthSpeed[0]), healthSpeed[0], healthSpeed[1], 10+currentDifficulty/20, a, paths);\n }\n\n }", "private void createMonsters() {\n monsters = new ArrayList<Monster>();\n\n Integer value;\n Integer key;\n for(Map.Entry<Integer, Integer> entry : characterLoader.getMonsters().entrySet()){\n\n key = entry.getKey();\n value = entry.getValue();\n\n for(int i=0;i<value;i++) {\n\n Point newPoint = findEmptyCell();\n\n switch (key) {\n\n // Case Ghost\n case LabyrinthFactory.GHOST:\n monsters.add(new Ghost(newPoint.x, newPoint.y));\n break;\n\n // Case Troll\n case LabyrinthFactory.TROLL:\n monsters.add(new Troll(newPoint.x, newPoint.y));\n break;\n }\n }\n }\n\n playThread();\n }", "public void InitMap() {\n for (int i=0; i<m_mapSize; i++) {\n SetColour(i, null);\n }\n }", "private static void initResources() {\n\t\tString[] res = new String[4];\r\n\t\tres[0] = \"res/entity/spaceshipv1.png\";\r\n\t\tres[1] = \"res/entity/prob.png\";\r\n\t\tres[2] = \"res/dot.png\";\r\n\t\tres[3] = \"res/entity/spaceshipv2.png\";\r\n\t\tSResLoader.addSpriteArray(res);\r\n\t}", "public Level()\n {\n //Initialise Tile Types\n try \n {\n //Dynamically assign texture paints\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/surface.jpg\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/rover.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/rock.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/mineral.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/target.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/warning.png\")), tile));\n } catch(FileNotFoundException fnfe) {\n System.out.println(\"ERROR: Invalid texture paint, file not found\" + fnfe);\n }\n catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "private void loadTextures() {\n\t\tspriteSheet01 = new Texture(\"data/buttonsspritesheet02.png\");\n\n\t\tnew TextureRegion(spriteSheet01, BROKEN_COLUMN * SQUARE_SIZE,\n\t\t\t\tBROKEN_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, EMPTY_BUTTON_COLUMN * SQUARE_SIZE,\n\t\t\t\tEMPTY_BUTTON_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, ACTIVATED_COLUMN * SQUARE_SIZE,\n\t\t\t\tSPECIALS_ROW_TWO * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, DEPRESSED_BUTTON * SQUARE_SIZE,\n\t\t\t\tSPECIALS_ROW_TWO * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, HIGHLIGHTED_COLUMN * SQUARE_SIZE,\n\t\t\t\tSPECIALS_ROW_TWO * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, CAROUSEL_COLUMN * SQUARE_SIZE,\n\t\t\t\t(CAROUSEL_ROW * SQUARE_SIZE) + CAROUSEL_PIXELS, SQUARE_SIZE,\n\t\t\t\tCAROUSEL_PIXELS);\n\n\t\tnew TextureRegion(spriteSheet01, FIX_BUTTON_COLUMN * SQUARE_SIZE,\n\t\t\t\tFIX_BUTTON_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tnew TextureRegion(spriteSheet01, WILD_BUTTON_COLUMN * SQUARE_SIZE,\n\t\t\t\tWILD_BUTTON_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\n\t\tcarousel = new TextureRegion[MAIN_COLOUR_AMOUNT];\n\t\tfor (int i = 0; i < MAIN_COLOUR_AMOUNT; i++) {\n\t\t\tcarousel[i] = new TextureRegion(spriteSheet01,\n\t\t\t\t\t(CAROUSEL_COLUMN * SQUARE_SIZE) + (i * CAROUSEL_PIXELS),\n\t\t\t\t\tCAROUSEL_ROW * SQUARE_SIZE, CAROUSEL_PIXELS,\n\t\t\t\t\tCAROUSEL_PIXELS);\n\t\t}\n\n\t\trings = new TextureRegion[RING_AMOUNT];\n\t\tfor (int i = 0; i < RING_AMOUNT; i++) {\n\t\t\trings[i] = new TextureRegion(spriteSheet01, i * SQUARE_SIZE,\n\t\t\t\t\tRING_ROW * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\t\t}\n\n\t\tmainColour = new TextureRegion[MAIN_COLOUR_AMOUNT];\n\t\tfor (int i = 0; i < MAIN_COLOUR_AMOUNT; i++) {\n\t\t\tmainColour[i] = new TextureRegion(spriteSheet01,\n\t\t\t\t\t(i + MAIN_COLOUR_COLUMN) * SQUARE_SIZE, MAIN_COLOUR_ROW,\n\t\t\t\t\tSQUARE_SIZE, SQUARE_SIZE);\n\t\t}\n\n\t\tspecials = new TextureRegion[SPECIALS_AMOUNT];\n\t\tfor (int i = 0; i < SPECIALS_ROW_ONE_AMOUNT; i++) {\n\t\t\tspecials[i] = new TextureRegion(spriteSheet01, i * SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\t\t}\n\t\tfor (int i = SPECIALS_ROW_ONE_AMOUNT; i < SPECIALS_AMOUNT; i++) {\n\t\t\tspecials[i] = new TextureRegion(spriteSheet01,\n\t\t\t\t\t(i - SPECIALS_ROW_ONE_AMOUNT) * SQUARE_SIZE,\n\t\t\t\t\tSPECIALS_ROW_TWO * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n\t\t}\n\n\t\tenemyBaseColours = new TextureRegion[ENEMY_COLOURS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_COLOURS_AMOUNT; i++) {\n\t\t\tenemyBaseColours[i] = new TextureRegion(spriteSheet01, i\n\t\t\t\t\t* SQUARE_SIZE, ENEMY_BASE_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\n\t\tenemyHalfColours = new TextureRegion[ENEMY_COLOURS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_COLOURS_AMOUNT; i++) {\n\t\t\tenemyHalfColours[i] = new TextureRegion(spriteSheet01, i\n\t\t\t\t\t* SQUARE_SIZE, ENEMY_HALF_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\n\t\tenemyThirdColours = new TextureRegion[ENEMY_COLOURS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_COLOURS_AMOUNT; i++) {\n\t\t\tenemyThirdColours[i] = new TextureRegion(spriteSheet01, i\n\t\t\t\t\t* SQUARE_SIZE, ENEMY_THIRD_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\n\t\tenemyRimColours = new TextureRegion[ENEMY_COLOURS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_COLOURS_AMOUNT; i++) {\n\t\t\tenemyRimColours[i] = new TextureRegion(spriteSheet01, i\n\t\t\t\t\t* SQUARE_SIZE, ENEMY_RIM_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\n\t\tenemyConnectors = new TextureRegion[ENEMY_CONNECTORS_AMOUNT];\n\t\tfor (int i = 0; i < ENEMY_CONNECTORS_AMOUNT; i++) {\n\t\t\tenemyConnectors[i] = new TextureRegion(spriteSheet01,\n\t\t\t\t\t(i + ENEMY_CONNECTORS_COLUMN) * SQUARE_SIZE,\n\t\t\t\t\tENEMY_CONNECTORS_ROW * SQUARE_SIZE, SQUARE_SIZE,\n\t\t\t\t\tSQUARE_SIZE);\n\t\t}\n\t}", "public void init() {\r\n int width = img.getWidth();\r\n int height = img.getHeight();\r\n floor = new Floor(game, width, height);\r\n units = new ArrayList<Unit>();\r\n objects = new ArrayList<GameObject>();\r\n for (int y=0; y<height; y++) {\r\n for (int x=0; x<width; x++) {\r\n int rgb = img.getRGB(x,y);\r\n Color c = new Color(rgb);\r\n Tile t;\r\n if (c.equals(GRASS_COLOR)) {\r\n t = new Tile(game, new Posn(x,y), \"tile_48x24_grass.png\");\r\n } else if (c.equals(STONE_COLOR)) {\r\n t = new Tile(game, new Posn(x,y), \"tile_48x24_stone.png\");\r\n } else {\r\n /* Check all the surrounding tiles. Take a consensus for the underlying tile color. */\r\n int numGrass=0, numStone=0;\r\n for (int j=y-1; j<=y+1; j++) {\r\n for (int i=x-1; i<=x+1; i++) {\r\n if (i>=0 && i<img.getWidth() && j>=0 && j<img.getHeight() && !(i==x && j==y)) {\r\n int rgb2 = img.getRGB(i,j);\r\n Color c2 = new Color(rgb2);\r\n if (c2.equals(GRASS_COLOR)) numGrass++;\r\n else if (c2.equals(STONE_COLOR)) numStone++;\r\n }\r\n }\r\n }\r\n if (numGrass >= numStone) {\r\n t = new Tile(game, new Posn(x,y), \"tile_48x24_grass.png\");\r\n } else {\r\n t = new Tile(game, new Posn(x,y), \"tile_48x24_stone.png\");\r\n }\r\n }\r\n floor.setTile(x, y, t);\r\n \r\n if (c.equals(TREE_COLOR)) {\r\n //objects.add(new GameObject(x,y))\r\n } else if (c.equals(WALL_COLOR)) {\r\n objects.add(new Wall(game, new Posn(x,y), \"wall_48x78_1.png\"));\r\n } else if (c.equals(WIZARD_COLOR)) {\r\n addWizard(x,y);\r\n } else if (c.equals(ZOMBIE_COLOR)) {\r\n addZombie(x,y);\r\n } else if (c.equals(BANDIT_COLOR)) {\r\n addBandit(x,y);\r\n } else if (c.equals(PLAYER_COLOR)) {\r\n game.getPlayerUnit().setPosn(new Posn(x,y));\r\n units.add(game.getPlayerUnit());\r\n }\r\n }\r\n }\r\n }", "private void render() {\n\n // Clear the whole screen\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the background image\n gc.drawImage(curMap.getMap(), 0,0, canvas.getWidth(), canvas.getHeight());\n\n // Draw Paths\n for(DrawPath p : pathMap.values()) {\n p.draw(gc);\n }\n\n // Draw all of the lines and edges\n\n // Lines\n for(Line l : lineMap.values()) {\n l.draw(gc);\n }\n\n // Points\n for(Point p : pointMap.values()) {\n p.draw(gc);\n }\n\n // Images\n for(Img i : imgMap.values()) {\n i.draw(gc);\n }\n\n // Text\n for(Text t : textMap.values()) {\n t.draw(gc);\n }\n }", "private void addCharacters() {\r\n\t\tplayer = new GImage(\"PlayerEast.png\");\r\n\t\tplayer.scale(.75);\r\n\t\tadd(player, player.getWidth() / 2.0, level1.getY() - player.getHeight());\r\n\t\t\r\n\t\tdragon1 = new GImage(\"Dragon1.png\");\r\n\t\tadd(dragon1, getWidth() - dragon1.getWidth() * 1.5, level1.getY() - dragon1.getHeight());\r\n\t\t\r\n\t\tdragon2 = new GImage(\"Dragon2.png\");\r\n\t\tadd(dragon2, dragon2.getWidth() / 2.0, level2.getY() - dragon2.getHeight());\r\n\t\t\r\n\t\tGObject karel = new GImage(\"karel.png\");\r\n\t\tadd(karel, getWidth() - karel.getWidth(), level3.getY() - karel.getHeight());\r\n\t\t\r\n\t\tmehran = new GImage(\"EvilMehran1.png\");\r\n\t\tadd(mehran, getWidth() - mehran.getWidth() - karel.getWidth(), level3.getY() - mehran.getHeight());\r\n\t}", "public void initTiles() {\n\t\ttileList.add(new Go());\n\n\t\t// Brown properties\n\t\tProperty mediterranean = new Property(\"Mediterranean\");\n\t\tProperty balticAve = new Property(\"Baltic Avenue\");\n\n\t\t// Light blue properties\n\t\tProperty orientalAve = new Property(\"Oriental Avenue\");\n\t\tProperty vermontAve = new Property(\"Vermont Avenue\");\n\t\tProperty connecticutAve = new Property(\"Connecticut Avenue\");\n\n\t\t// Magenta properties\n\t\tProperty stCharles = new Property(\"St. Charles Place\");\n\t\tProperty statesAve = new Property(\"States Avenue\");\n\t\tProperty virginiaAve = new Property(\"Virginia Avenue\");\n\n\t\t// Orange properties\n\t\tProperty stJames = new Property(\"St. James Place\");\n\t\tProperty tennesseeAve = new Property(\"Tennessee Avenue\");\n\t\tProperty newYorkAve = new Property(\"New York Avenue\");\n\n\t\t// Red properties\n\t\tProperty kentuckyAve = new Property(\"Kentucky Avenue\");\n\t\tProperty indianaAve = new Property(\"Indiana Avenue\");\n\t\tProperty illinoisAve = new Property(\"Illinois Avenue\");\n\n\t\t// Yellow Properties\n\t\tProperty atlanticAve = new Property(\"Atlantic Avenue\");\n\t\tProperty ventnorAve = new Property(\"Ventnor Avenue\");\n\t\tProperty marvinGard = new Property(\"Marvin Gardins\");\n\n\t\t// Green Properties\n\t\tProperty pacificAve = new Property(\"Pacific Avenue\");\n\t\tProperty northCar = new Property(\"North Carolina Avenue\");\n\t\tProperty pennsylvannia = new Property(\"Pennsylvania Avenue\");\n\n\t\t// Dark blue properties\n\t\tProperty parkPlace = new Property(\"Park Place\");\n\t\tProperty boardWalk = new Property(\"Boardwalk\");\n\n\t\t// Tax tiles\n\t\tTaxTile incomeTax = new TaxTile(\"Income Tax\", 200);\n\t\tTaxTile luxuryTax = new TaxTile(\"Luxury Tax\", 100);\n\n\t\t// Utilities\n\t\tUtility electric = new Utility(\"Electric Company\");\n\t\tUtility water = new Utility(\"Water Works\");\n\n\t\t// Railroads\n\t\tRailroad reading = new Railroad(\"Reading\");\n\t\tRailroad pennRail = new Railroad(\"Pennsylvania\");\n\t\tRailroad bno = new Railroad(\"B & O\");\n\t\tRailroad shortLine = new Railroad(\"Short Line\");\n\n\t\t// Chance and community chest\n\t\tChance chance = new Chance();\n\t\tCommunity chest = new Community();\n\n\t\t// Adds the properties by color in accordance with their position on the board\n\t\t// adds color + placement of piece to a list of their respective colors\n\t\tbrown.add(1);\n\t\tbrown.add(3);\n\t\trailroads.add(5);\n\t\tlightBlue.add(6);\n\t\tlightBlue.add(8);\n\t\tlightBlue.add(9);\n\t\tmagenta.add(11);\n\t\tutilities.add(12);\n\t\tmagenta.add(13);\n\t\tmagenta.add(14);\n\t\trailroads.add(15);\n\t\torange.add(16);\n\t\torange.add(18);\n\t\torange.add(19);\n\t\tred.add(21);\n\t\tred.add(23);\n\t\tred.add(24);\n\t\trailroads.add(25);\n\t\tyellow.add(26);\n\t\tyellow.add(27);\n\t\tutilities.add(28);\n\t\tyellow.add(29);\n\t\tgreen.add(31);\n\t\tgreen.add(32);\n\t\tgreen.add(34);\n\t\trailroads.add(35);\n\t\tdarkBlue.add(37);\n\t\tdarkBlue.add(39);\n\n\t\t// tileList is the list of tiles of the board where each tile is representative of a place on the board\n\t\t// adds each tile is chronological order beginning of the board \"go\"\n\t\t//this list includes: properties, taxes, railroads, chance, community chest\n\t\t\n\t\ttileList.add(new Go());\n\n\t\ttileList.add(mediterranean);\n\t\ttileList.add(chest);\n\t\ttileList.add(balticAve);\n\t\ttileList.add(incomeTax);\n\t\ttileList.add(reading);\n\t\ttileList.add(orientalAve);\n\t\ttileList.add(chance);\t\n\t\ttileList.add(vermontAve);\n\t\ttileList.add(connecticutAve);\n\n\t\ttileList.add(new Jail());\n\t\t\t\n\t\ttileList.add(stCharles);\n\t\ttileList.add(electric);\t\t\t\n\t\ttileList.add(statesAve);\t\t\t\n\t\ttileList.add(virginiaAve);\n\t\ttileList.add(pennRail);\n\t\ttileList.add(stJames);\t\n\t\ttileList.add(chest);\n\t\ttileList.add(tennesseeAve);\t\t\t\n\t\ttileList.add(newYorkAve);\n\n\t\ttileList.add(new FreeParking());\n\t\t\t\n\t\ttileList.add(kentuckyAve);\t\t\n\t\ttileList.add(chance);\t\n\t\ttileList.add(indianaAve);\t\t\t\n\t\ttileList.add(illinoisAve);\n\t\ttileList.add(bno);\n\t\ttileList.add(atlanticAve);\t\t\t\n\t\ttileList.add(ventnorAve);\n\t\ttileList.add(water);\n\t\ttileList.add(marvinGard);\n\n\t\ttileList.add(new GoToJail());\n\t\t\t\t\t\n\t\ttileList.add(pacificAve);\t\t\t\n\t\ttileList.add(northCar);\n\t\ttileList.add(chest);\t\t\t\n\t\ttileList.add(pennsylvannia);\n\t\ttileList.add(shortLine);\n\t\ttileList.add(chance);\n\t\ttileList.add(parkPlace);\n\t\ttileList.add(luxuryTax);\n\t\ttileList.add(boardWalk);\n\t}", "private void drawTiles(Graphics g)\n {\n for (int x = 0; x < 19; x++)\n {\n for (int y = 0; y < 15; y++)\n {\n tileset.getSprite(5, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n switch(board[x][y])\n {\n case 1:\n {\n tileset.getSprite(4, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 2:\n {\n tileset.getSprite(3, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 3:\n {\n if (bombs[x][y].getTimeLeft() > 80)\n {\n bombImage.getSprite(0, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n if (bombs[x][y].getTimeLeft() <= 80 && bombs[x][y].getTimeLeft() > 50)\n {\n bombImage.getSprite(1, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n if (bombs[x][y].getTimeLeft() <= 50 && bombs[x][y].getTimeLeft() > 20)\n {\n bombImage.getSprite(2, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n if (bombs[x][y].getTimeLeft() <= 20)\n {\n bombImage.getSprite(3, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n break;\n }\n //4 is player\n case 5:\n {\n if (fire[x][y] == null)\n {\n tileset.getSprite(2, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n break;\n }\n case 6:\n {\n if (fire[x][y] == null)\n {\n tileset.getSprite(15, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n break;\n }\n }\n }\n }\n }", "private void init() {\n\t\trunning = true;\n\t\timage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);\n\t\tg = (Graphics2D) image.getGraphics();\n\t\ttheMap.loadTiles(\"resizedTiles2.png\");\n\t}", "private BufferedImage[] drawSprite(int width, int height) {\r\n // Initialize each image in the array to be drawn to\r\n BufferedImage[] spriteAnimation = new BufferedImage[ResourceCollection.SpriteMaps.EXPLOSION_SPRITEMAP.getImage().getWidth() / 32];\r\n for (int i = 0; i < spriteAnimation.length; i++) {\r\n spriteAnimation[i] = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\r\n }\r\n\r\n // Draw to each image in the array\r\n for (int i = 0; i < spriteAnimation.length; i++) {\r\n Graphics2D g2 = spriteAnimation[i].createGraphics();\r\n g2.setColor(new Color(0, 0, 0, 0));\r\n g2.fillRect(0, 0, spriteAnimation[i].getWidth(), spriteAnimation[i].getHeight());\r\n\r\n for (int j = 0; j < spriteAnimation[i].getHeight() / 32; j++) {\r\n if (spriteAnimation[i].getHeight() / 32 == 1 || this.centerOffset == j * 32) {\r\n // Center sprite\r\n g2.drawImage(this.sprites[0][i], 0, j * 32, null);\r\n } else if (j == 0) {\r\n // Topmost sprite\r\n g2.drawImage(this.sprites[5][i], 0, j * 32, null);\r\n } else if (j == (spriteAnimation[i].getHeight() / 32) - 1) {\r\n // Bottommost sprite\r\n g2.drawImage(this.sprites[6][i], 0, j * 32, null);\r\n } else {\r\n // Vertical between sprite\r\n g2.drawImage(this.sprites[2][i], 0, j * 32, null);\r\n }\r\n }\r\n\r\n g2.dispose();\r\n }\r\n\r\n return spriteAnimation;\r\n }", "public static void load() {\n\t\tspritesheet = new Spritesheet(\"src/de/kaffeeliebhaber/assets/pyxel/voland_spritesheet_new.png\", 32, 32);\n\t\tspritesheet.load();\n\t\t\n\t\t// load player\n\t\tAssetsLoader.loadPlayerAssets();\n\t\t\n\t\t// load crate\n\t\tAssetsLoader.loadCrates();\n\t\t\n\t\t// load item spritesheet \n\t\tspritesheetInventory = new Spritesheet(Config.ITEM_SPRITESHEET, Config.ITEM_SIZE, Config.ITEM_SIZE);\n\t\tspritesheetInventory.load();\n\t\t\n\t\t// load font \n\t\tloadFonts();\n\t\t\n\t\t// ui\n\t\timageUI = ImageLoader.loadImage(\"src/de/kaffeeliebhaber/assets/ui/ui.png\");\n\t\t\n\t\tAssetsLoader.loadInfoPaneAssets();\n\t\t\n\t\t// npc\n\t\tspritesheetNPC = new Spritesheet(\"src/de/kaffeeliebhaber/assets/AH_SpriteSheet_People1.png\", 16, 16);\n\t\tspritesheetNPC.load();\n\t\t\n\t\t// fox\n\t\tspritesheetNPCFox = new Spritesheet(\"src/de/kaffeeliebhaber/assets/imgs/72c68863962b7a6b5a9f5f5bcc5afb16.png\", 32, 32);\n\t\tspritesheetNPCFox.load();\n\n\t\t// *** LOAD NPCs\n\t\tAssetsLoader.loadFoxAssets();\n\t\t\n\t\tAssetsLoader.loadNPCs();\n\t\t\n\t\tspritesheetFemale = new Spritesheet(\"src/de/kaffeeliebhaber/assets/imgs/Female 01-1.png\", 32, 32);\n\t\tspritesheetFemale.load();\n\t}", "public Map(int r, int c){\r\n try {\r\n bomb = new Image(new FileInputStream(\"Minesweeper_Images/bomb.png\"));\r\n zero = new Image(new FileInputStream(\"Minesweeper_Images/zero.png\"));\r\n one = new Image(new FileInputStream(\"Minesweeper_Images/one.png\"));\r\n two = new Image(new FileInputStream(\"Minesweeper_Images/two.png\"));\r\n three = new Image(new FileInputStream(\"Minesweeper_Images/three.png\"));\r\n four = new Image(new FileInputStream(\"Minesweeper_Images/four.png\"));\r\n five = new Image(new FileInputStream(\"Minesweeper_Images/five.png\"));\r\n six = new Image(new FileInputStream(\"Minesweeper_Images/six.png\"));\r\n seven = new Image(new FileInputStream(\"Minesweeper_Images/seven.png\"));\r\n eight = new Image(new FileInputStream(\"Minesweeper_Images/eight.png\"));\r\n flag = new Image(new FileInputStream(\"Minesweeper_Images/flag.png\"));\r\n square = new Image(new FileInputStream(\"Minesweeper_Images/square.png\"));\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n map = new Square[r][c];\r\n for(int row = 0; row<map.length; row++){\r\n for(int col = 0; col<map[0].length; col++){\r\n map[row][col] = new Square();\r\n //map[row][col].setVisual(\" \");\r\n int x = row;\r\n int y = col;\r\n map[row][col].setVisual(square);\r\n map[row][col].getSquareButton().setOnMouseClicked(e->{\r\n if(e.getButton() == MouseButton.PRIMARY){\r\n revealArea(x, y);\r\n }\r\n if(e.getButton() == MouseButton.SECONDARY){\r\n flag(x, y);\r\n if(win() == true){\r\n System.out.println(\"WIN\");\r\n EndBox.end(\"Win\", \"YOU WIN!!!\");\r\n System.exit(0);\r\n }\r\n }\r\n });\r\n\r\n\r\n }\r\n\r\n }\r\n }", "private BufferedImage[] drawSprite(int width, int height) {\r\n // Initialize each image in the array to be drawn to\r\n BufferedImage[] spriteAnimation = new BufferedImage[ResourceCollection.SpriteMaps.EXPLOSION_SPRITEMAP.getImage().getWidth() / 32];\r\n for (int i = 0; i < spriteAnimation.length; i++) {\r\n spriteAnimation[i] = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\r\n }\r\n\r\n // Draw to each image in the array\r\n for (int i = 0; i < spriteAnimation.length; i++) {\r\n Graphics2D g2 = spriteAnimation[i].createGraphics();\r\n g2.setColor(new Color(0, 0, 0, 0));\r\n g2.fillRect(0, 0, spriteAnimation[i].getWidth(), spriteAnimation[i].getHeight());\r\n\r\n for (int j = 0; j < spriteAnimation[i].getWidth() / 32; j++) {\r\n if (spriteAnimation[i].getWidth() / 32 == 1 || this.centerOffset == j * 32) {\r\n // Center sprite\r\n g2.drawImage(this.sprites[0][i], j * 32, 0, null);\r\n } else if (j == 0) {\r\n // Leftmost sprite\r\n g2.drawImage(this.sprites[3][i], j * 32, 0, null);\r\n } else if (j == (spriteAnimation[i].getWidth() / 32) - 1) {\r\n // Rightmost sprite\r\n g2.drawImage(this.sprites[4][i], j * 32, 0, null);\r\n } else {\r\n // Horizontal between sprite\r\n g2.drawImage(this.sprites[1][i], j * 32, 0, null);\r\n }\r\n }\r\n\r\n g2.dispose();\r\n }\r\n\r\n return spriteAnimation;\r\n }", "@Override\n protected void generateTiles() {\n }", "@Override\n public void create() {\n theMap = new ObjectSet<>(2048, 0.5f);\n generate();\n }", "private void initEntities() {\n\t\tship = new ShipEntity(this,\"ship.gif\",370,550);\n\t\tentities.add(ship);\n\t\tscore = 0;\n\t\t// create a block of aliens (5 rows, by 12 aliens, spaced evenly)\n\t\talienCount = 0;\n\t\tfor (int row=0;row<5;row++) {\n\t\t\tfor (int x=0;x<12;x++) {\n\t\t\t\tEntity alien = new AlienEntity(this,\"alien.gif\",100+(x*50),(50)+row*30);\n\t\t\t\tentities.add(alien);\n\t\t\t\talienCount++;\n\t\t\t}\n\t\t}\n\t}", "private void createGraphics(Texture spriteSheet, float frameTime) {\n createAnimations(spriteSheet, frameTime);\n createIdleRegions(spriteSheet);\n }", "public static void loadTiles() {\n\t\tTILE_SETS.put(\"grass\", TileSet.loadTileSet(\"plains\"));\n\t}", "public void initSpriteSheet() {\n\t\tString url = \"https://amiealbrecht.files.wordpress.com/2016/08/set-cards.jpg?w=1250\";\n\n\t\tcimg = loadImage(url, \"png\");\n\t}", "public HashMap<String, BufferedImage> getSprites() {\n \t\treturn sprites;\n \t}", "public static BufferedImage[] cutMapaImage(String name, int X, int Y) {\n BufferedImage[] sprites = null;\n try {\n BufferedImage imagen = ImageIO.read(new File(CanvasMap.class.getClassLoader().getResource(name).getFile()));\n final int filas = imagen.getHeight() / X;\n final int columnas = imagen.getWidth() / Y;\n sprites = new BufferedImage[filas * columnas];\n\n for (int i = 0; i < filas; i++) {\n for (int j = 0; j < columnas; j++) {\n sprites[(i * columnas) + j] = imagen.getSubimage(j * X, i * Y, X, Y);\n Image img = sprites[(i * columnas) + j].getScaledInstance(tamX, tamY, BufferedImage.SCALE_DEFAULT);\n sprites[(i * columnas) + j] = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n Graphics2D g = (Graphics2D) sprites[(i * columnas) + j].getGraphics();\n g.drawImage(img, 0, 0, null);\n }\n }\n } catch (IOException ex) {\n Logger.getLogger(CanvasMap.class.getName()).log(Level.SEVERE, null, ex);\n }\n return sprites;\n }", "private void loadMapData(Context context, int pixelsPerMeter,int px,int py){\n\n char c;\n\n //keep track of where we load our game objects\n int currentIndex = -1;\n\n //calculate the map's dimensions\n mapHeight = levelData.tiles.size();\n mapWidth = levelData.tiles.get(0).length();\n\n //iterate over the map to see if the object is empty space or a grass\n //if it's other than '.' - a switch is used to create the object at this location\n //if it's '1'- a new Grass object it's added to the arraylist\n //if it's 'p' the player it's initialized at the location\n\n for (int i = 0; i < levelData.tiles.size(); i++) {\n for (int j = 0; j < levelData.tiles.get(i).length(); j++) {\n\n c = levelData.tiles.get(i).charAt(j);\n //for empty spaces nothing to load\n if(c != '.'){\n currentIndex ++;\n switch (c){\n case '1' :\n //add grass object\n gameObjects.add(new Grass(j,i,c));\n break;\n\n case 'p':\n //add the player object\n gameObjects.add(new Player(context,px,py,pixelsPerMeter));\n playerIndex = currentIndex;\n //create a reference to the player\n player = (Player)gameObjects.get(playerIndex);\n break;\n }\n\n //check if a bitmap is prepared for the object that we just added in the gameobjects list\n //if not (the bitmap is still null) - it's have to be prepared\n if(bitmapsArray[getBitmapIndex(c)] == null){\n //prepare it and put in the bitmap array\n bitmapsArray[getBitmapIndex(c)] =\n gameObjects.get(currentIndex).prepareBitmap(context,\n gameObjects.get(currentIndex).getBitmapName(),\n pixelsPerMeter);\n }\n\n }\n\n }\n\n }\n }", "public void updateSprites() {\n this.model.getSprites().values().forEach(x -> x.setPosition(this.x, this.y));\n }", "@Override\r\n\tpublic void gameInit() \r\n\t{\r\n\t\tfont = new Font(\"Courier\", Font.BOLD, 14);\r\n\t\tfontInfo = this.getFontMetrics(font);\r\n\t\tkeys = new KeyValues();\r\n\t\t\r\n\t\tbackground.loadImage(\"/images/sky.png\");\r\n\t\ttileset = new TileSet(10,10,32,32);\r\n\t\ttileset.loadTiles(\"/images/test_tiles.png\");\r\n\t\tmap = new Map(tileset, 20, 50);\r\n\t\tmap.readMap(\"res/maps/testmap2.txt\");\r\n\t\t\r\n\t\tcamera.setDimensions(getScreenWidth(), getScreenHeight());\r\n\t\tcamera.setXRange(0, map.getWidth() - getScreenWidth());\r\n\t\tcamera.setYRange(0, map.getHeight() - getScreenHeight());\r\n\t}", "public void makeMap(){\r\n\t\tint m =1;\r\n\t\t//EnvironObj temp = new EnvironObj(null, 0, 0);\r\n\t\tfor(int i=0; i<map.size(); i++){\r\n\t\t\tfor(int j =0; j<map.get(i).size(); j++){\r\n\t\t\t\tString o = map.get(i).get(j);\r\n\t\t\t\t//System.out.println(\"grabbing o from map, o = \" + o);\r\n\t\t\t\tif(o.equals(\"t\")){\r\n\t\t\t\t\ttemp = new EnvironObj(\"treee.png\", j+m, i*20);\r\n\t\t\t\t\tobjectList.add(temp);\r\n\t\t\t\t\tm+=10;\r\n\t\t\t\t\t//System.out.println(\"objectList: \" + objectList);\r\n\t\t\t\t}else if(o.equals(\"p\")){\r\n\t\t\t\t\ttemp = new EnvironObj(\"path.png\", j+m, i*20, true);\r\n\t\t\t\t\t//dont need to add to obj list bc its always in back\r\n\t\t\t\t\twalkables.add(temp);\r\n\r\n\t\t\t\t}else if(o.equals(\"h\")){\r\n\t\t\t\t\ttemp = new EnvironObj(\"house.png\", j+m, i*20);\r\n\t\t\t\t\tobjectList.add(temp);\r\n\t\t\t\t}else if(o.equals(\"g\")){\r\n\t\t\t\t\tm+=10;\r\n\t\t\t\t}\r\n\t\t\t\telse if(!o.equals(\"g\")){\r\n\t\t\t\t\tString fn = o +\".txt\";\r\n\t\t\t\t\tSystem.out.println(\"filename for NPC: \" + fn);\r\n\t\t\t\t\tnp = new NPC(o, fn, j+m, i*20);\r\n\t\t\t\t\tm+=10;\r\n\t\t\t\t\tcharacters.add(np);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tm=0;\r\n\t\t}\r\n\t}", "public void createImageSet() {\n\t\t\n\t\t\n\t\tString image_folder = getLevelImagePatternFolder();\n \n String resource = \"0.png\";\n ImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(\"navigable\", ii.getImage());\n\n\t}", "@Override\n\tpublic void create () {\n\t\tmBatch = new SpriteBatch();\n mFont = new BitmapFont();\n\t\tmCamera = new OrthographicCamera();\n\t\tmCamera.setToOrtho(false, 800, 480); // Regardless of resolution, project screen onto 800 x 480 orthographic matrix\n\n\t\tmGameBackgrounds = new Texture[6]; // Six frames describing six states of damage to the castle, from pristine to broken\n\t\tmGameBackgrounds[0] = new Texture(\"castle_v1.png\");\n\t\tmGameBackgrounds[1] = new Texture(\"castle_v1_dam1.png\");\n\t\tmGameBackgrounds[2] = new Texture(\"castle_v1_dam2.png\");\n\t\tmGameBackgrounds[3] = new Texture(\"castle_v1_dam3.png\");\n\t\tmGameBackgrounds[4] = new Texture(\"castle_v1_dam4.png\");\n\t\tmGameBackgrounds[5] = new Texture(\"castle_v1_dam5.png\");\n\n\t\t// Assign value to list so it may be given objects to store\n\t\tmAttackers = new Attacker[ATTACKER_ARRAY_SIZE];\n\t\tmButtons = new DefenderButtons[7];\n\t\tmButtons[0] = new DefenderButtons(DefenderButtons.TYPE_NEW_GAME);\n\t\tmButtons[1] = new DefenderButtons(DefenderButtons.TYPE_RESUME_SAVED_GAME);\n\t\tmButtons[2] = new DefenderButtons(DefenderButtons.TYPE_PAUSE_GAME);\n\t\tmButtons[3] = new DefenderButtons(DefenderButtons.TYPE_RESUME_PAUSED_GAME);\n\t\tmButtons[4] = new DefenderButtons(DefenderButtons.TYPE_REPAIR_CASTLE);\n\t\tmButtons[5] = new DefenderButtons(DefenderButtons.TYPE_CONTINUE_NEXT_ROUND);\n\t\tmButtons[6] = new DefenderButtons(DefenderButtons.TYPE_SAVE_GAME);\n\n\t\tmButtons[0].setTexture(new Texture(\"button1.png\"));\n\t\tmButtons[1].setTexture(new Texture(\"button1.png\"));\n\t\tmButtons[2].setTexture(new Texture(\"button2.png\"));\n\t\tmButtons[3].setTexture(new Texture(\"button2.png\"));\n\t\tmButtons[4].setTexture(new Texture(\"button3.png\"));\n\t\tmButtons[5].setTexture(new Texture(\"button3.png\"));\n\t\tmButtons[6].setTexture(new Texture(\"button3.png\"));\n\n\t\t// Create the object that tracks the touch coordinates\n\t\tmLastTouch = new Vector3();\n\n // Assign value to miscellaneous game variables\n mRoundTimeElapsed = 0;\n mRoundMaxTime = 25f; // Counted in SECONDS\n\t\tmCastleMaxHealth = 1000f;\n mCastleHealth = mCastleMaxHealth; // Will last 1,000 frames if attacked by one single standard attacker constantly\n\t\tmCastleDamageStage = 0;\n mRoundScore = 0f;\n mTotalScore = 0f;\n mRoundNumber = 1;\n\t\tmGameState = STATE_PRE_GAME;\n\t\tmAttackerDelay = 0;\n mRoundMaxAttackers = 5;\n\t\tmRepairCost = 1000f;\n\t\tmLivingAttackerCount = 0;\n\t\tmKnightSpawnChance = 0.35f; // 35% chance to spawn a knight instead of normal under regular circumstances\n mPaused = false;\n\t\tmRoundSaved = false;\n mHealthText = \"Castle Strength: \" + mCastleHealth;\n mRoundScoreText = \"This Round Score: \" + mRoundScore;\n\t\tmTotalScoreText = \"Total Game Score: \" + mTotalScore;\n\t\tmGameTitle = \"Castle Defender\";\n\t\tmGameSavedText = \"Game Saved!\";\n\t\tmRoundText = \"Round :\" + mRoundNumber;\n\t\tmRandom = new Random();\n\t\t//TEMPORARY! Will change the logic later\n mSpawnTime = 100;\n\t\tmMonsterHouseSpawn = 10;\n\n\t\t// Pull out the normal attacker's frames through temporary objects\n\t\tTexture walkTexture = new Texture(\"attackerSheet.png\");\n\t\tTextureRegion[][] walkTempArray = TextureRegion.split(walkTexture, 64, 64);\n\t\tTextureRegion[] walkFrames = new TextureRegion[16];\n\n\t\tint index = 0; // Cut the animation's frames up using this temporary jagged array (8 by 2 matches the image file rows / cols)\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tfor (int j = 0; j < 8; j++) {\n\t\t\t\twalkFrames[index++] = walkTempArray[i][j];\n\t\t\t}\n\t\t}\n\n\t\tmStandardAttackerWalk = new Animation(0.055f, walkFrames);\n\n\t\t// Do the same process for the knight animations\n\t\tTexture knightWalk = new Texture(\"knight_sheet_walk.png\");\n\t\tTexture knightAttack = new Texture(\"knight_sheet_attack.png\");\n\n\t\tTextureRegion[][] knightWalkTemp = TextureRegion.split(knightWalk, 64, 128);\n\t\tTextureRegion[][] knightAtkTemp = TextureRegion.split(knightAttack, 64, 128);\n\n\t\tTextureRegion[] knightWalkFrames = new TextureRegion[8];\n\t\tTextureRegion[] knightAtkFrames = new TextureRegion[4];\n\n\t\tindex = 0;\n\t\tfor(int i = 0; i < 2; i++) {\n\t\t\tfor(int j = 0; j < 4; j++) {\n\t\t\t\tknightWalkFrames[index++] = knightWalkTemp[i][j];\n\t\t\t}\n\t\t}\n\n\t\tindex = 0;\n\t\tfor(int i = 0; i < 4; i++) {\n\t\t\tknightAtkFrames[index++] = knightAtkTemp[0][i];\n\t\t}\n\n\t\tmKnightAttackerAttack = new Animation(0.25f, knightAtkFrames);\n\t\tmKnightAttackerWalk = new Animation(0.125f, knightWalkFrames);\n\n\t\t// Populate the mAttackers array with 50 total attackers, 25 of each\n\t\tfor(int i = 0; i < ATTACKER_ARRAY_SIZE; i++){\n\t\t\t// Grab a walk speed between constant minimum and maximum\n\t\t\tfloat walkSpeed = mRandom.nextFloat() * MAX_SPEED_VARIANCE;\n\t\t\twalkSpeed += MIN_SPEED; // Ensures the speed is AT LEAST 60 \"units\"\n\t\t\t// Spawn at a random y coordinate starting at MIN_SPAWN_Y, varying by MAX_SPAWN_Y_VARIANCE\n\t\t\tfloat spawnY = mRandom.nextFloat() * MAX_SPAWN_Y_VARIANCE;\n\t\t\tspawnY += MIN_SPAWN_Y;\n\n\t\t\tif(i < ATTACKER_HALF_SIZE) {\n\t\t\t\t// The first half of the array are normal attackers\n\t\t\t\tmAttackers[i] = new Attacker(1f, walkSpeed, -100f, spawnY, 64f, 64f, \"normal\");\n\t\t\t\tmAttackers[i].addAnimation(mStandardAttackerWalk, \"walk\");\n\t\t\t} else {\n\t\t\t\t// The second half of the array are \"knight\" attackers\n\t\t\t\tmAttackers[i] = new Attacker(2f, walkSpeed * 0.75f, -100f, spawnY, 64f, 128f, \"knight\");\n\t\t\t\tmAttackers[i].addAnimation(mKnightAttackerWalk, \"walk\");\n\t\t\t\tmAttackers[i].addAnimation(mKnightAttackerAttack, \"attack\");\n\t\t\t}\n\t\t}\n\t}", "public void createImages(){\r\n\t\ttry {\r\n\t\t\timg_bg = Image.createImage(GAME_BG);\r\n\t\t\timg_backBtn = Image.createImage(BACK_BTN);\r\n\t\t\timg_muteBtn = Image.createImage(MUTE_BTN);\r\n\t\t\timg_resetBtn = Image.createImage(RESET_BTN);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void gameInitialize() {\n this.world = new BufferedImage(GameConstants.GAME_SCREEN_WIDTH,\n GameConstants.GAME_SCREEN_HEIGHT,\n BufferedImage.TYPE_3BYTE_BGR);\n\n gameObjs = new ArrayList<>();\n try {\n background = (BufferedImage)Resource.getHashMap().get(\"wallpaper\");\n /*\n * note class loaders read files from the out folder (build folder in Netbeans) and not the\n * current working directory.\n */\n InputStreamReader isr = new InputStreamReader(Objects.requireNonNull(RainbowReef.class.getClassLoader().getResourceAsStream(\"map/map1\")));\n BufferedReader mapReader = new BufferedReader(isr);\n\n String row = mapReader.readLine();\n if (row == null) {\n throw new IOException(\"nothing here\");\n }\n String[] mapInfo = row.split(\"\\t\");\n int numCols = Integer.parseInt(mapInfo[0]);\n int numRows = Integer.parseInt(mapInfo[1]);\n for (int curRow = 0; curRow < numRows; curRow++){\n row = mapReader.readLine();\n mapInfo = row.split(\"\\t\");\n for(int curCol = 0; curCol< numCols; curCol++){\n switch (mapInfo[curCol]) {\n case \"2\" -> {\n UnbreakableWall sowall = new UnbreakableWall(curCol * 20, curRow * 20, (BufferedImage) Resource.getHashMap().get(\"SolidBlock\"));\n gameObjs.add(sowall);\n }\n case \"3\" -> {\n BreakableWall pwall = new BreakableWall(curCol * 20, curRow * 20, (BufferedImage) Resource.getHashMap().get(\"PinkBlock\"));\n gameObjs.add(pwall);\n }\n case \"4\" -> {\n BreakableWall ywall = new BreakableWall(curCol * 20, curRow * 20, (BufferedImage) Resource.getHashMap().get(\"YellowBlock\"));\n gameObjs.add(ywall);\n }\n case \"5\" -> {\n BreakableWall rwall = new BreakableWall(curCol * 20, curRow * 20, (BufferedImage) Resource.getHashMap().get(\"RedBlock\"));\n gameObjs.add(rwall);\n }\n case \"6\" -> {\n BreakableWall gwall = new BreakableWall(curCol * 20, curRow * 20, (BufferedImage) Resource.getHashMap().get(\"GreenBlock\"));\n gameObjs.add(gwall);\n }\n case \"7\" -> {\n Health health = new Health(curCol * 20, curRow * 20, (BufferedImage) Resource.getHashMap().get(\"HealthBlock\"));\n gameObjs.add(health);\n }\n case \"8\" -> {\n BulletBlock bigbullet = new BulletBlock(curCol * 20, curRow * 20, (BufferedImage) Resource.getHashMap().get(\"BulletBlock\"));\n gameObjs.add(bigbullet);\n }\n case \"9\" -> {\n Goblin bl = new Goblin(curCol * 20, curRow * 20, (BufferedImage) Resource.getHashMap().get(\"Goblin\"));\n gameObjs.add(bl);\n }\n }\n }\n }\n } catch (IOException ex) {\n System.out.println(ex.getMessage());\n ex.printStackTrace();\n }\n\n Katch t1 = new Katch(290, 440, 0, 0, 0, (BufferedImage) Resource.getHashMap().get(\"Katch\"));\n KatchControl tc1 = new KatchControl(t1, KeyEvent.VK_D, KeyEvent.VK_A, KeyEvent.VK_SPACE);\n this.setBackground(Color.BLACK);\n this.lf.getJf().addKeyListener(tc1);\n this.gameObjs.add(t1);\n\n }", "public static void loadImages(){\n\t\tsetPath(main.getShop().inventory.getEquipID());\n\t\ttry {\n\t\t\tbackground = ImageIO.read(new File(\"res/world/bg.png\"));\n\t\t\tterrain = ImageIO.read(new File(\"res/world/solids.png\"));\n\t\t\t// Character and Armour\n\t\t\tcharacters = ImageIO.read(new File(\"res/world/char3.png\"));\n\t\t\tcharactersHead =ImageIO.read(new File(\"res/world/charhead\"+path[0]+\".png\"));\n\t\t\tcharactersTop = ImageIO.read(new File(\"res/world/chartop\"+path[2]+\".png\"));\n\t\t\tcharactersShoulder = ImageIO.read(new File(\"res/world/charshoulders\"+path[3]+\".png\"));\n\t\t\tcharactersHand = ImageIO.read(new File(\"res/world/charhands\"+path[5]+\".png\"));\n\t\t\tcharactersBottom = ImageIO.read(new File(\"res/world/charbottom\"+path[8]+\".png\"));\n\t\t\tcharactersShoes = ImageIO.read(new File(\"res/world/charshoes\"+path[9]+\".png\"));\n\t\t\tcharactersBelt = ImageIO.read(new File(\"res/world/charBelt\"+path[4]+\".png\"));\n\n\t\t\tweaponBow = ImageIO.read(new File(\"res/world/bow.png\"));\n\t\t\tweaponArrow = ImageIO.read(new File(\"res/world/arrow.png\"));\n\t\t\tweaponSword = ImageIO.read(new File(\"res/world/sword.png\"));\n\t\t\titems = ImageIO.read(new File(\"res/world/items.png\"));\n\t\t\tnpc = ImageIO.read(new File(\"res/world/npc.png\"));\n\t\t\thealth = ImageIO.read(new File(\"res/world/health.png\"));\n\t\t\tenemies = ImageIO.read(new File(\"res/world/enemies.png\"));\n\t\t\tcoin = ImageIO.read(new File(\"res/world/coin.png\"));\n\t\t\tmana = ImageIO.read(new File(\"res/world/mana.gif\"));\n\t\t\tarrowP = ImageIO.read(new File(\"res/world/arrowP.png\"));\n\t\t\tbutton = ImageIO.read(new File(\"res/world/button.png\"));\n\t\t\tblood = ImageIO.read(new File(\"res/world/blood.png\"));\n\t\t\tarrowDisp = ImageIO.read(new File(\"res/world/arrowDisp.png\"));\n\t\t\tboss1 = ImageIO.read(new File(\"res/world/boss1.png\"));\n\t\t\tmagic = ImageIO.read(new File(\"res/world/magic.png\"));\n\t\t\tmainMenu = ImageIO.read(new File(\"res/world/MainMenu.png\"));\n\t\t\tinstructions = ImageIO.read(new File(\"res/world/instructions.png\"));\n\t\t\trespawn = ImageIO.read(new File(\"res/world/respawn.png\"));\n\t\t\tinventory = ImageIO.read(new File(\"res/world/inventory.png\"));\n shop = ImageIO.read(new File(\"res/world/shop.png\"));\n dizzy = ImageIO.read(new File(\"res/world/dizzy.png\"));\n pet = ImageIO.read(new File(\"res/world/pet.png\"));\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error Loading Images\");\n\t\t}\n\t}", "@Override\n\tprotected void generateTiles() {\n\t}", "public void draw(Graphics2D graphics) {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n Tile temp = tiles[x][y];\n Tile bgtemp = backGroundTiles[x][y];\n Tile grasstemp = grassTiles[x][y];\n if ((temp.x >= -TILE_SIZE && temp.x <= Constants.FRAME_WIDTH\n + TILE_SIZE)\n && (temp.y >= -TILE_SIZE && temp.y <= Constants.FRAME_HEIGHT\n + TILE_SIZE)) {\n\n if (bgtemp.texture != 0) {\n graphics.drawImage(sprites.getTile(bgtemp.texture), bgtemp.x,\n bgtemp.y, null);\n }\n if (temp.texture != 0) {\n graphics.drawImage(sprites.getTile(temp.texture), temp.x, temp.y,\n null);\n }\n if (grasstemp.texture != 0) {\n graphics.drawImage(sprites.getTile(grasstemp.texture), grasstemp.x,\n grasstemp.y, null);\n }\n }\n }\n }", "public void createList () {\n imageLocs = new ArrayList <Location> ();\n for (int i = xC; i < xLength * getPixelSize() + xC; i+=getPixelSize()) {\n for (int j = yC; j < yLength * getPixelSize() + yC; j+=getPixelSize()) {\n Location loc = new Location (i, j, LocationType.POWERUP, true);\n\n imageLocs.add (loc);\n getGridCache().add(loc);\n \n }\n }\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 void createImage() {\n\t\tBufferedImage crab1ststep = null;\n\t\tBufferedImage crab2ndstep = null;\n\t\tBufferedImage crabhalf = null;\n\t\tBufferedImage crabfull = null;\n\t\tBufferedImage eye6 = null;\n\t\tBufferedImage eye5 = null;\n\t\tBufferedImage eye4 = null;\n\t\tBufferedImage eye3 = null;\n\t\tBufferedImage eye2 = null;\n\t\tBufferedImage eye1 = null;\n\t\tBufferedImage eyeClosed = null;\n\t\ttry {\n\t\t crabImage = ImageIO.read(new File(\"src/images/crab.png\"));\n\t\t crab1ststep = ImageIO.read(new File(\"src/images/crab1ststep.png\"));\n\t\t crab2ndstep = ImageIO.read(new File(\"src/images/crab2ndstep.png\"));\n\t\t crabhalf = ImageIO.read(new File(\"src/images/crabhalf.png\"));\n\t\t crabfull = ImageIO.read(new File(\"src/images/crabfull.png\"));\n\t\t crabWin = ImageIO.read(new File(\"src/images/crabwin.png\"));\n\t\t crabLose = ImageIO.read(new File(\"src/images/crablose.png\"));\n\t\t eye6 = ImageIO.read(new File(\"src/images/crab_eye6.png\"));\n\t\t eye5 = ImageIO.read(new File(\"src/images/crab_eye5.png\"));\n\t\t eye4 = ImageIO.read(new File(\"src/images/crab_eye4.png\"));\n\t\t eye3 = ImageIO.read(new File(\"src/images/crab_eye3.png\"));\n\t\t eye2 = ImageIO.read(new File(\"src/images/crab_eye2.png\"));\n\t\t eye1 = ImageIO.read(new File(\"src/images/crab_eye1.png\"));\n\t\t eyeClosed = ImageIO.read(new File(\"src/images/eyes_closed.png\"));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"bad\");\n\t\t}\n//\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n//\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n//\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n//\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\t\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\t\n\t\tblink.add(eye6);\n\t\tblink.add(eye6);\n//\t\tblink.add(eye5);\n//\t\tblink.add(eye5);\n\t\tblink.add(eye4);\n\t\tblink.add(eye4);\n//\t\tblink.add(eye3);\n//\t\tblink.add(eye3);\n\t\tblink.add(eye2);\n\t\tblink.add(eye2);\n//\t\tblink.add(eye1);\n//\t\tblink.add(eye1);\n\t\tblink.add(eyeClosed);\n\t\tblink.add(eyeClosed);\n\t\tblink.add(eyeClosed);\n\t\tblink.add(eyeClosed);\n//\t\tblink.add(eye1);\n//\t\tblink.add(eye1);\n\t\tblink.add(eye2);\n\t\tblink.add(eye2);\n//\t\tblink.add(eye3);\n//\t\tblink.add(eye3);\n\t\tblink.add(eye4);\n\t\tblink.add(eye4);\n//\t\tblink.add(eye5);\n//\t\tblink.add(eye5);\n\t\tblink.add(eye6);\n\t\tblink.add(eye6);\n\t}", "public static void loadSprites(MediaTracker m)\r\n\t{\r\n\t\tsprites = new ArrayList<String>();\r\n\t\t\r\n\t\t//Get list of files in pedestrian sprite directory\r\n\t\tFile folder = new File(\"res/pedestrians\");\r\n\t\tString[] files = folder.list();\r\n\t\t\r\n\t\t//Load all .gif files from the directory\r\n\t\tfor(String fileName : files){\r\n\t\t\tif (fileName.endsWith(\".gif\")) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (fileName.endsWith(\"Walk1.gif\")) {\r\n\t\t\t\t\t\tsprites.add(fileName);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tnew Sprite(\"pedestrians/\"+fileName, m);\r\n\t\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t\tSystem.err.println(\"ERROR: Unable to load pedestrian sprite \"+fileName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Ensure at least one sprite was loaded\r\n\t\tif (sprites.isEmpty()) {\r\n\t\t\tSystem.err.println(\"ERROR: Unable to load any pedestrian sprites\");\r\n\t\t}\r\n\t}", "public static void load(){\n for(TextureHandler t : textures){\n if(t.texture!=null)t.texture.dispose();\n }\n textures.clear();\n \n //if the textures are corrupt or just arent there then the error TextureHandler will\n //be a placeholder which is generated programatically so it is always there\n int size = 64;\n Pixmap pixmap = new Pixmap(size,size, Format.RGBA8888 );\n pixmap.setColor(1f,0f,0f,1f);\n pixmap.fillCircle(size/2,size/2,size/2);\n pixmap.setColor(0f,0f,0f,1f);\n pixmap.fillCircle(size/2,size/2,(size/2)-2);\n pixmap.setColor(1f,0f,0f,1f);\n int offset = size/6;\n int length = (size+size)/3;\n pixmap.drawLine(offset,offset,offset+length,offset+length);\n pixmap.drawLine(offset+length,offset,offset,offset+length);\n error = new Texture(pixmap);\n pixmap.dispose();\n //things that get rendered the most get put at the top so theyre the first in the list\n textures.add(new TextureHandler(\"Block\" ,\"Block.png\",true));\n textures.add(new TextureHandler(\"Block1\",\"Block1.png\",true));\n textures.add(new TextureHandler(\"Block2\",\"Block2.png\",true));\n textures.add(new TextureHandler(\"Block3\",\"Block3.png\",true));\n textures.add(new TextureHandler(\"Block4\",\"Block4.png\",true));\n textures.add(new TextureHandler(\"GameBackground\",\"GameBackground.png\",true));\n \n textures.add(new TextureHandler(\"Hints\",\"Hints.png\",false));\n textures.add(new TextureHandler(\"Left\" ,\"ButtonLeft.png\",true));\n textures.add(new TextureHandler(\"Right\" ,\"ButtonRight.png\",true));\n textures.add(new TextureHandler(\"Rotate\",\"ButtonRotate.png\",true));\n textures.add(new TextureHandler(\"Pause\" ,\"ButtonPause.png\",true));\n textures.add(new TextureHandler(\"Label\" ,\"TextBox.png\",true));\n \n textures.add(new TextureHandler(\"Locked\",\"levels/Locked.png\",false));\n textures.add(new TextureHandler(\"Timer\",\"levels/Clock.png\",false));\n \n textures.add(new TextureHandler(\"PauseSelected\",\"SelectedPause.png\",true));\n textures.add(new TextureHandler(\"LeftSelected\",\"SelectedLeft.png\",true));\n textures.add(new TextureHandler(\"RightSelected\",\"SelectedRight.png\",true));\n textures.add(new TextureHandler(\"RotateSelected\",\"SelectedRotate.png\",true));\n \n textures.add(new TextureHandler(\"Background\",\"Background.png\",false));\n textures.add(new TextureHandler(\"Title\",\"MainMenuTitle.png\",false));\n\n }", "public void generateShape() {\n\n //TODO for tetris game - copy added to Tetris\n Shape newShape = null;\n //if(GAME_TO_TEST==GameEnum.TETRIS){\n //newShape = TetrisShapeFactory.getRandomShape(this.board);\n //} else if (GAME_TO_TEST== GameEnum.DRMARIO){\n //newShape = DrMarioShapeFactory.getRandomShape(this.board);\n //}\n\n //Temporary\n //-------------------------------------//\n Image image = null;\n try {\n image = new Image(new FileInputStream(\"resources/BlockPurple.png\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n int spawnColIndex = 0;\n int spawnRowIndex = 0;\n int tileSize = 0;\n boolean setColor = false;\n boolean setTileBorder = false; //toggle to add boarder to tile\n boolean setImage = true;\n spawnColIndex = (board.gridWidth-1)/2; //half of board width\n spawnRowIndex = 0;\n tileSize = board.tileSize;\n\n Tile tile1 = new Tile(tileSize, setColor, Color.VIOLET, setTileBorder, setImage, image, spawnColIndex,spawnRowIndex, 0 , Direction.DOWN); //Center Tile\n Tile tile2 = new Tile(tileSize, setColor, Color.VIOLET, setTileBorder, setImage, image, spawnColIndex,spawnRowIndex,1 , Direction.RIGHT);\n Tile tile3 = new Tile(tileSize, setColor, Color.VIOLET, setTileBorder, setImage, image, spawnColIndex,spawnRowIndex, 1 , Direction.LEFT);\n Tile tile4 = new Tile(tileSize, setColor, Color.VIOLET, setTileBorder, setImage, image, spawnColIndex,spawnRowIndex, 1 , Direction.DOWN);\n\n List<Tile> tiles = new ArrayList<Tile>();\n tiles.add(tile1);\n tiles.add(tile2);\n tiles.add(tile3);\n tiles.add(tile4);\n newShape = new Shape(tiles);\n\n //set newly created shape as the currently active shape\n this.currentActiveShape = newShape;\n\n //check if spawn area is occupied\n boolean isOccupied =false;\n for (Tile newTile : this.currentActiveShape.tiles) {\n if(this.board.getTile(newTile.columnIndex,newTile.rowIndex)!=null){\n isOccupied = true;\n }\n }\n\n //TODO\n //check if shape reaches top\n if(!isOccupied){\n //add tiles to board\n for (Tile newTile : this.currentActiveShape.tiles) {\n this.board.placeTile(newTile);\n }\n } else {\n //TODO later add Game Over JavaFx message\n System.out.println(\"GAME OVER\");\n\n //TODO Finishlater\n //Text gameoverText = new Text(10,20,\"GAME OVER\");\n //gameoverText.setFill(Color.RED);\n //gameoverText.setX( 100/*( ((board.gridWidth-1)*tileSize)/2)*/ );\n //gameoverText.setY( 100/*( ((board.gridHeight-1)*tileSize)/2)*/ );\n //gameoverText.setStyle(\"-fx-font: 70 arial;\");\n //this.group.getChildren().add(gameoverText);\n\n //Text t = new Text();\n //t.setX(20.0f);\n //t.setY(65.0f);\n //t.setX(100);\n //t.setY(200);\n //t.setText(\"Perspective\");\n //t.setFill(Color.YELLOW);\n //t.setFont(Font.font(null, FontWeight.BOLD, 36));\n //this.group.getChildren().add(t);\n //this.pane.getChildren().add(t);\n\n //System.exit(0);\n }\n\n }", "private void generateEnemies(int count) {\n generateEnemiesOnLayer(map.getHell(), count);\n generateEnemiesOnLayer(map.getEarth(), count);\n generateEnemiesOnLayer(map.getHeaven(), count);\n }", "public void removeSprites(){\r\n\r\n\t}", "private void addAllDrawables() {\n \t\n \tfor (int i = 0; i < 10; i++) {\n \t\tint res_id = c.getResources().getIdentifier(\"puzzle_\"+i, \"drawable\", c.getPackageName());\n \t\t\n \t\tif (res_id != 0) {\n \t\t\timage_id_array.add(res_id);\n \t\t}\n \t}\n }", "public void loadTileImages() {\n // keep looking for tile A,B,C, etc. this makes it\n // easy to drop new tiles in the images/ directory\n tiles = new ArrayList();\n char ch = 'A';\n while (true) {\n String name = \"tile_\" + ch + \".png\";\n File file = new File(\"images/\" + name);\n if (!file.exists()) {\n break;\n }\n tiles.add(loadImage(name));\n ch++;\n }\n }", "public void constructArray(){\n\t\tfor (int col = 0; col < cols; col++){\n\t\t\tfor (int row = 0; row < rows; row++){\n\t\t\t\tmap[col][row] = new Pixel();\n\t\t\t}\n\t\t}\n\t}", "private void updateMap() {\n\t\tfor (int i = 0; i < 12; i++) {\n\t\t\tfor (int j = 0; j < 12; j++) {\n\t\t\t\tif (newMap[i][j] instanceof Player) {\n\t\t\t\t\tmap[i][j] = new Player(i, j, board);\n\t\t\t\t} else if (newMap[i][j] instanceof BlankSpace) {\n\t\t\t\t\tmap[i][j] = new BlankSpace(i, j, board);\n\t\t\t\t} else if (newMap[i][j] instanceof Mho) {\n\t\t\t\t\tmap[i][j] = new Mho(i, j, board);\n\t\t\t\t} else if (newMap[i][j] instanceof Fence) {\n\t\t\t\t\tmap[i][j] = new Fence(i, j, board);\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}", "private void populateFromSprite() {\n long start = System.currentTimeMillis();\n int bitSetIndex = 0;\n BufferedImage bImage = (BufferedImage) sprite.m_image;\n //BufferedImage img = ImageIO.read(new File(\"assets/LoopBitmap.bmp\"));\n int color;\n // Loop through image according to scale\n for(int i = 0; i < sprite.getWidth(); i+=scale) {\n for(int j = 0; j < sprite.getHeight(); j+= scale) {\n // Get color at pixel i, j, if black set Bitmap index to true.\n color = bImage.getRGB(i, j);\n if(color == Color.BLACK.getRGB()) { //tempColor.equals(Color.black)) {\n this.set(bitSetIndex, true);\n //System.out.println(\"'BLACK' Color = \"+color + \" i=\"+ i + \", j=\"+j);\n }\n bitSetIndex++;\n }\n }\n long end = System.currentTimeMillis();\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n// System.out.println(\"BITMAP DONE :)\");\n// System.out.println(\"Time to build = \"+(end-start)+\"ms\");\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\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 for( int i = 0; i < IMAGE_COUNT; i++)\n {\n images[i] = new GreenfootImage(\"frame_\" + i + \"_delay-0.06s.gif\");\n }\n \n setBackground(images [0]); \n \n }", "protected void setSprite(Image i){\n sprites = new HashMap<Facing,Image>();\n sprites.put(Facing.RIGHT, i);\n sprites.put(Facing.LEFT , i.getFlippedCopy(true, false));\n }", "public void mostrarSprites() throws MalformedURLException, IOException, InterruptedException{\n URL url = new URL(miPokemon.getSprites().get(\"front_default\").toString());\n Image img = ImageIO.read(url);\n lblSprites.setIcon(new ImageIcon(img));\n // 1 segundo para cada cambio de sprite\n Thread.sleep(1000);\n \n url = new URL(miPokemon.getSprites().get(\"back_default\").toString());\n img = ImageIO.read(url);\n lblSprites.setIcon(new ImageIcon(img));\n Thread.sleep(1000);\n \n url = new URL(miPokemon.getSprites().get(\"front_shiny\").toString());\n img = ImageIO.read(url);\n lblSprites.setIcon(new ImageIcon(img));\n Thread.sleep(1000);\n \n url = new URL(miPokemon.getSprites().get(\"back_shiny\").toString());\n img = ImageIO.read(url);\n lblSprites.setIcon(new ImageIcon(img));\n Thread.sleep(1000);\n }", "private void createTurtleMap () {\n turtleInstructions.put(\"Forward\", new TurtleForward());\n turtleInstructions.put(\"Backward\", new TurtleBackward());\n turtleInstructions.put(\"Right\", new TurtleRight());\n turtleInstructions.put(\"Left\", new TurtleLeft());\n turtleInstructions.put(\"SetHeading\", new TurtleSetHeading());\n turtleInstructions.put(\"SetTowards\", new TurtleSetTowards());\n turtleInstructions.put(\"SetPosition\", new TurtleSetPosition());\n turtleInstructions.put(\"PenUp\", new TurtlePenUp());\n turtleInstructions.put(\"PenDown\", new TurtlePenDown());\n turtleInstructions.put(\"ShowTurtle\", new TurtleShowTurtle());\n turtleInstructions.put(\"HideTurtle\", new TurtleHideTurtle());\n turtleInstructions.put(\"Home\", new TurtleHome());\n turtleInstructions.put(\"ClearScreen\", new TurtleClearScreen());\n turtleInstructions.put(\"XCoordinate\", new TurtleXCor());\n turtleInstructions.put(\"YCoordinate\", new TurtleYCor());\n turtleInstructions.put(\"Heading\", new TurtleHeading());\n turtleInstructions.put(\"IsPenDown\", new TurtleIsPenDown());\n turtleInstructions.put(\"IsShowing\", new TurtleIsShowing()); \n displayInstructions.put(\"SetBackground\", new DisplaySetBackground());\n displayInstructions.put(\"SetPenColor\", new DisplaySetPenColor());\n displayInstructions.put(\"SetPenSize\", new DisplaySetPenSize());\n displayInstructions.put(\"SetShape\", new DisplaySetShape());\n displayInstructions.put(\"SetPalette\", new DisplaySetPalette());\n displayInstructions.put(\"GetPenColor\", new DisplayPenColor());\n displayInstructions.put(\"GetShape\", new DisplayShape());\n displayInstructions.put(\"Stamp\", new DisplayStamp());\n displayInstructions.put(\"ClearStamps\", new DisplayClearStamps());\n multiTurtleInstructions.put(\"ID\", new TurtleID());\n multiTurtleInstructions.put(\"Turtles\", new TurtleTurtles());\n multiTurtleInstructions.put(\"Tell\", new TurtleTellMulti());\n // multiTurtleInstructions.put(\"Ask\", new TurtleAsk());\n //multiTurtleInstructions.put(\"AskWith\", new TurtleAskWith());\n }", "public Sprite(String pathname) throws IOException {\n\t\tBufferedImage img = ImageIO.read(new File(pathname));\n\t\tint nbcol = img.getWidth() / SPRITE_WIDTH;\n\t\tint nblig = img.getHeight() / SPRITE_HEIGHT;\n\t\tm_length = nblig * nbcol;\n\t\tm_sprites = new BufferedImage[m_length];\n\t\tfor (int i = 0; i < m_length; i++) {\n\t\t\tint x = i % nbcol;\n\t\t\tint y = i / nbcol;\n\t\t\tm_sprites[i] = img.getSubimage(x * SPRITE_WIDTH, y * SPRITE_HEIGHT, SPRITE_WIDTH, SPRITE_HEIGHT);\n\t\t}\n\t}", "public void createImages(){\n for(String s : allPlayerMoves){\n String a = \"Left\";\n for(int i = 0; i < 2; i++) {\n ArrayList<Image> tempImg = new ArrayList();\n boolean done = false;\n int j = 1;\n while(!done){\n try{\n tempImg.add(ImageIO.read(new File(pathToImageFolder+s+a+j+\".png\")));\n j++;\n } catch (IOException ex) {\n done = true;\n }\n }\n String temp = s.replace(\"/\",\"\") + a;\n playerImages.put(temp, tempImg);\n a = \"Right\";\n }\n }\n imagesCreated = true;\n }", "private void importImages() {\n\n\t\t// Create array of the images. Each image pixel map contains\n\t\t// multiple images of the animate at different time steps\n\n\t\t// Eclipse will look for <path/to/project>/bin/<relative path specified>\n\t\tString img_file_base = \"Game_Sprites/\";\n\t\tString ext = \".png\";\n\n\t\t// Load background\n\t\tbackground = createImage(img_file_base + \"Underwater\" + ext);\n\t}" ]
[ "0.72086614", "0.70928276", "0.703618", "0.6853489", "0.6799377", "0.6797439", "0.67749214", "0.67073846", "0.6668626", "0.6653737", "0.661423", "0.65897036", "0.6582134", "0.6571706", "0.6569907", "0.6565833", "0.6541011", "0.65388787", "0.65090525", "0.6500951", "0.6497324", "0.64415836", "0.642696", "0.6423406", "0.6396717", "0.6367098", "0.6350977", "0.634818", "0.6345669", "0.63447076", "0.6302196", "0.6298639", "0.62608755", "0.62487715", "0.62072957", "0.6191795", "0.61445606", "0.6123817", "0.61163074", "0.61157614", "0.60930943", "0.60816354", "0.6079969", "0.60742277", "0.60641253", "0.6061884", "0.60504836", "0.6015938", "0.600274", "0.6002182", "0.59726554", "0.59724164", "0.59703636", "0.59650123", "0.5955546", "0.5949684", "0.59428406", "0.59412664", "0.593408", "0.59190965", "0.59099144", "0.5905362", "0.58981586", "0.58865845", "0.5878581", "0.5875668", "0.58667046", "0.58657765", "0.58389103", "0.583745", "0.58367455", "0.5831683", "0.58206964", "0.5814373", "0.58050513", "0.5799652", "0.5796888", "0.57958347", "0.57885426", "0.57847726", "0.57791543", "0.57757586", "0.57755077", "0.5774251", "0.57729703", "0.5771794", "0.5760036", "0.57593906", "0.5757173", "0.57447994", "0.57284194", "0.5723687", "0.57216907", "0.57216674", "0.5721152", "0.57114404", "0.5708965", "0.5706364", "0.5701291", "0.5699484" ]
0.720201
1
Set the music for the map
@Override public void setMusic() { manager.getMusicManager().setMusic((Music) Gdx.audio.newMusic(Gdx.files.internal("Music/Bandit Camp.mp3"))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setMusic(Music music);", "public void setMusicOn(boolean on){\r\n\t\tmusicOn = on;\r\n\t}", "public void setMap()\n {\n gameManager.setMap( savedFilesFrame.getCurrent_index() );\n }", "void changeMusic(AudioTrack newSong);", "public void setMap(String mn){\r\n mapName = mn;\r\n currentMap = new ImageIcon(mapName);\r\n }", "public void setMap01(){\n\t\tmapSelect = \"map01.txt\";\n\t\treloadMap(mapSelect);\n\t\tsetImg(mapSelect);\n\t}", "private void initialMusic(){\n\n }", "public void playMusic() {\n\t\tthis.music.start();\n\t}", "public void StartMusic(int music_id);", "public void playMusic() {\n\t\ttry {\n\t\t\tsoundManager.playMusic(\"bgroundmusic\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static void updateMusic()\r\n\t{\r\n\t\tif ( Settings.isMusicOn() && !musicPlaying() )\r\n\t\t\tstartMusic();\r\n\t\telse if ( !Settings.isMusicOn() && musicPlaying() )\r\n\t\t\tstopMusic();\r\n\t}", "public void ChangeMusic(int musicnum, boolean looping);", "public void play(boolean music) {\n\t\tplay(1.0f, 1.0f, music);\n\t}", "void startMusic(AudioTrack newSong);", "@Override\n public void initialize() {\n //talonOrchestra.playMusic();\n }", "public static void startMusic()\r\n\t{\r\n\t\tif ( musicPlayer == null )\r\n\t\t\tmusicPlayer = new MusicPlayer( \"Music2.mid\" );\r\n\t\telse\r\n\t\t\tmusicPlayer.play();\r\n\t}", "public void setMusic(boolean checked) {\n\n SharedPreferences.Editor editor = mSharedPreferences.edit();\n editor.putBoolean(mContext.getString(R.string.music_checked), checked);\n editor.commit();\n }", "public void setMusicFile(MusicFile musicFile) {\n this.musicFile = musicFile;\n }", "public static void startMusic()\n\t{\n\t\tmusic.loop();\n\t}", "public void StartMusic(musicenum_t music_id);", "public void toggleMusic() {\n this.musicEnabled = !this.musicEnabled;\n }", "private void musicClicked() {\n MatchScreen.setMusicVolume(MatchScreen.getMusicVolume() == 0 ? 0.5f : 0);\n setSoundButtonColor(MatchScreen.getMusicVolume() == 0, music);\n }", "public void play() {\n\t\tmusic.play();\n\t\tsyncPosition();\n\t}", "private static void loadMusic()\n\t{\n\t\t// TODO: update this with the correct file names.\n\t\tmusic = new ArrayList<Music>();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tmusic.add(Gdx.audio.newMusic(new FileHandle(new File(MUSIC_PATH + \"Lessons-8bit.mp3\"))));\n\t\t\tmusic.add(Gdx.audio.newMusic(new FileHandle(new File(MUSIC_PATH + \"bolo_menu.mp3\"))));\n\t\t\t//music.add(Gdx.audio.newMusic(new FileHandle(new File(MUSIC_PATH + \"song2.ogg\"))));\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t\n\t\t\tSystem.out.println(e);\n\t\t\te.printStackTrace();\n\t\t\tthrow e;\n\t\t}\n\t}", "@Override\n\tpublic void musicSwapped(Music arg0, Music arg1) {\n\t\t\n\t}", "private void setItem(String material, String nameKey, Sound music, int x, int y) {\r\n\t\tMaterial loadedMaterial = Material.valueOf(plugin.getSettings().getString(material));\r\n\t\tthis.setAction(new VanillaMusicItem(\r\n\t\t\t\trenameItem(new ItemStack(loadedMaterial, 1), nameKey), \r\n\t\t\t\tmusic), x, y);\r\n\t}", "public void setMap(Map map) {\r\n\t\tthis.map = map;\r\n\t\tsmap.setMap(map);\r\n\t}", "protected abstract void setMarkers();", "private void setPlayList() {\n int[] rawValues = {\n R.raw.bensoundbrazilsamba,\n R.raw.bensoundcountryboy,\n R.raw.bensoundindia,\n R.raw.bensoundlittleplanet,\n R.raw.bensoundpsychedelic,\n R.raw.bensoundrelaxing,\n R.raw.bensoundtheelevatorbossanova\n };\n String[] countryList = {\n \"Brazil\",\n \"USA\",\n \"India\",\n \"Iceland\",\n \"South Korea\",\n \"Indonesia\",\n \"Brazil\"\n };\n String [] descriptions = {\n \"Samba is a Brazilian musical genre and dance style, with its roots in Africa via the West African slave trade religious particularly of Angola and African traditions.\",\n \"Country music is a genre of American popular originated Southern States in the 1920s music that in the United\",\n \"The music of India includes multiple varieties of folk music, pop, and Indian classical music. India's classical music tradition, including Hindustani music and Carnatic, has a history spanning millennia and developed over several eras\",\n \"The music of Iceland includes vibrant folk and pop traditions. Well-known artists from Iceland include medieval music group Voces Thules, alternative rock band The Sugarcubes, singers Björk and Emiliana Torrini, post- rock band Sigur Rós and indie folk/indie pop band Of Monsters and Men\",\n \"The Music of South Korea has evolved over the course of the decades since the end of the Korean War, and has its roots in the music of the Korean people, who have inhabited the Korean peninsula for over a millennium. Contemporary South Korean music can be divided into three different categories: Traditional Korean folk music, popular music, or K- pop, and Western- influenced non-popular music\",\n \"The music of Indonesia demonstrates its cultural diversity, the local musical creativity, as well as subsequent foreign musical influences that shaped contemporary music scenes of Indonesia. Nearly thousands Indonesian having its own cultural and artistic history and character Nearly of islands\",\n \"Samba is a Brazilian musical genre and dance style, with its roots in Africa via the West African slave trade religious particularly of Angola\"\n };\n\n for (int i = 0; i < rawValues.length; i++) {\n this.mPlayList.add(rawValues[i]);\n this.mTrackList.add(new Track(this.getResources().getResourceEntryName(rawValues[i]),\n countryList[i],descriptions[i],rawValues[i]));\n }\n }", "@Override\n\tpublic void OnGameStart() {\n\t\tsuper.OnGameStart();\n\t\tMusicManage.setLoopingMusic(tumMusic, true);\n\t\tMusicManage.playMusic(tumMusic);\n\t}", "public void loadMusic(File f) {\n music = new MP3(f);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(this.getApplicationContext(), R.raw.maps_night);\n mMap.setMapStyle(style);\n\n /*cmall=mMap.addMarker(new MarkerOptions()\n .position(CMALL)\n .title(\"CMALL\")\n .snippet(\"Population: 4,627,300\"));\n //.icon(BitmapDescriptorFactory.fromResource(R.drawable.lexicon)));\n cmall.setTag(0);*/\n\n\n /*//add a marker in Sydney and move the camera\n LatLng myfav = new LatLng(10.3395125, 123.9110532);//(-34, 151);\n mMap.addMarker(new MarkerOptions().position(myfav).title(\"My Favorite Mall\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(myfav));\n //Zooming mode\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n CameraUpdate update=CameraUpdateFactory.newLatLngZoom(myfav, 18);\n mMap.animateCamera(update);*/\n\n }", "private void fillMusicList()\n\t{\n\t\tmusicList.add(\"violin\");\n\t\tmusicList.add(\"viola\");\n\t\tmusicList.add(\"cello\");\n\t\tmusicList.add(\"bass\");\n\t\tmusicList.add(\"guitar\");\n\t\tmusicList.add(\"drums\");\n\t\tmusicList.add(\"tuba\");\n\t\tmusicList.add(\"flute\");\n\t\tmusicList.add(\"harp\");\n\t}", "private void startMusic() {\r\n final Format input1 = new AudioFormat(AudioFormat.MPEGLAYER3);\r\n final Format input2 = new AudioFormat(AudioFormat.MPEG);\r\n final Format output = new AudioFormat(AudioFormat.LINEAR);\r\n PlugInManager.addPlugIn(\r\n \"com.sun.media.codec.audio.mp3.JavaDecoder\",\r\n new Format[]{input1, input2},\r\n new Format[]{output},\r\n PlugInManager.CODEC\r\n );\r\n try {\r\n final File f = new File(\"support_files//tetris.mp3\");\r\n myPlayer = Manager.createPlayer(new MediaLocator(f.toURI().toURL()));\r\n } catch (final NoPlayerException | IOException e) {\r\n e.printStackTrace();\r\n }\r\n if (myPlayer != null) {\r\n myPlayer.start();\r\n }\r\n }", "public void addMusic(String musicname)\r\n\t{\r\n\t\tmyMusics.add(musicname);\r\n\t}", "public static void load() {\n\n\t\ttry {\n\t\t\t// Insert audio load ex:\n\t\t\tmusicMap.put(\"music\", new Music(\"res/menuMusic.wav\"));\n\t\t} catch (SlickException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static void playMapSelectSound() {\n int roll = MathUtils.random(3);\n switch (roll) {\n case 0: {\n CardCrawlGame.sound.play(\"MAP_SELECT_1\");\n break;\n }\n case 1: {\n CardCrawlGame.sound.play(\"MAP_SELECT_2\");\n break;\n }\n case 2: {\n CardCrawlGame.sound.play(\"MAP_SELECT_3\");\n break;\n }\n default: {\n CardCrawlGame.sound.play(\"MAP_SELECT_4\");\n }\n }\n }", "public void pauseMusic() {\n\t\talSourcePause(musicSourceIndex);\n\t\talSourcePause(reverseSourceIndex);\n\t\talSourcePause(flangeSourceIndex);\n\t\talSourcePause(revFlangeSourceIndex);\n\t\talSourcePause(wahSourceIndex);\n\t\talSourcePause(revWahSourceIndex);\n\t\talSourcePause(wahFlangeSourceIndex);\n\t\talSourcePause(revWahFlangeSourceIndex);\n\t\talSourcePause(distortSourceIndex);\n\t\talSourcePause(revDistortSourceIndex);\n\t\talSourcePause(distortFlangeSourceIndex);\n\t\talSourcePause(revDistortFlangeSourceIndex);\n\t\talSourcePause(wahDistortSourceIndex);\n\t\talSourcePause(revWahDistortSourceIndex);\n\t\talSourcePause(wahDistortFlangeSourceIndex);\n\t\talSourcePause(revWahDistortFlangeSourceIndex);\n\t}", "public static void music (String fileName)\r\n {\r\n\tAudioPlayer MGP = AudioPlayer.player;\r\n\tAudioStream BGM;\r\n\tAudioData MD;\r\n\r\n\tContinuousAudioDataStream loop = null;\r\n\r\n\ttry\r\n\t{\r\n\t InputStream test = new FileInputStream (\"lamarBackgroundMusic.wav\");\r\n\t BGM = new AudioStream (test);\r\n\t AudioPlayer.player.start (BGM);\r\n\r\n\t}\r\n\tcatch (FileNotFoundException e)\r\n\t{\r\n\t System.out.print (e.toString ());\r\n\t}\r\n\tcatch (IOException error)\r\n\t{\r\n\t System.out.print (error.toString ());\r\n\t}\r\n\tMGP.start (loop);\r\n }", "@Override\r\n \tpublic void setMap(Map m) {\n \t\t\r\n \t}", "public static void startMusic()\n\t{\n\t\tif (music == null)\n\t\t{\n\t\t\tloadMusic();\n\t\t\tif (music.size() < 2)\n\t\t\t{\n\t\t\t\tthrow new GameLogicException(\"At least two songs must be specified.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrentMusicFile = 0;\n\t\tmusic.get(currentMusicFile).setVolume(musicVolume / 100.f);\n\t\tmusic.get(currentMusicFile).play();\n\t\tmusic.get(currentMusicFile).setOnCompletionListener(musicOnCompletionListener);\n\t}", "@Override\n protected void onPause()\n {\n super.onPause();\n setSound.pauseMusic();\n }", "@Override\n\tpublic void pause() {\n\t PhoneDevice.Settings.stopMusic();\n\t}", "private String addMusic() {\n\t\t// One Parameter: MusicName\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|music:\" + parameters[0]);\n\t\treturn tag.toString();\n\n\t}", "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 }", "private void startPlay() {\n isPlaying = true;\n isPaused = false;\n playMusic();\n }", "public void playMedia() {\n\t\tif (MainActivity.mPlayer == null) {\n\t\t\tMainActivity.mPlayer = new MediaPlayer();\n\t\t\tMainActivity.mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n\t\t\tMainActivity.currentSong = song;\n\t\t\tMainActivity.currentAlbum = album;\n\t\t}\n\t\tif (!MainActivity.currentSong.getTitleKey().equals(song.getTitleKey())) {\n\t\t\tMainActivity.currentSong = song;\n\t\t\tMainActivity.currentAlbum = album;\n\t\t\tMainActivity.mPlayer.reset();\n\t\t}\n\n\t\ttitle = song.getTitle();\n\t\talbumTitle = album.getAlbum();\n\t\talbumArt = album.getAlbumArt();\n\n\t\ttry {\n\t\t\tMainActivity.mPlayer.setDataSource(this, song.getUri());\n\t\t\tMainActivity.mPlayer.prepare();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t} catch (SecurityException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalStateException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t}\n\t\tMainActivity.mPlayer.setOnPreparedListener(new OnPreparedListener() {\n\t\t\t@Override\n\t\t\tpublic void onPrepared(MediaPlayer mp) {\n\t\t\t\tmp.start();\n\t\t\t}\n\t\t});\n\t\tMainActivity.mPlayer.setOnCompletionListener(new OnCompletionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onCompletion(MediaPlayer mp) {\n\t\t\t\tnext();\n\t\t\t}\n\n\t\t});\n\n\t\tnew Handler(getMainLooper()).post(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tupdateMainActivity();\n\t\t\t\tupdateNowPlaying();\n\t\t\t}\n\t\t});\n\t}", "@Override\n public SoundClip getGameMusic(){\n return gameMusic;\n }", "public final native void setMap(MapJSO map) /*-{\n\t\tthis.setMap(map);\n\t}-*/;", "public void setCurrentSong(int position) {\n serviceBound = false;\n currentSong = position;\n }", "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 void playAudio() {\n\t\tmusic[currentSong].stop();\n\t\tcurrentSong++;\n\t\tcurrentSong %= music.length;\n\t\tmusic[currentSong].play();\n\t}", "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 }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng current = new LatLng(10.762887, 106.681835);\n mMap.addMarker(new MarkerOptions().position(current).title(\"Current Location\").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(current));\n text5 = \"Current Location\";\n toSpeech.speak(text5, TextToSpeech.QUEUE_FLUSH, null);\n }", "public static void resumeMusic() {\n\t\t\n\t\tif (currentMusic == null) {\n\t\t\tplayMusic(\"mainMenuMusic\", 0.1f);\n\t\t} else {\n\t\t\tcurrentMusic.start();\n\t\t}\n\t}", "void setMap(Map aMap);", "private void makeNewMusic() {\n File f = music.getFile();\n boolean playing = music.isPlaying();\n music.stop();\n music = new MP3(f);\n if (playing) {\n music.play(nextStartTime);\n }\n }", "private void setupPlayer() {\n player = MediaPlayer.create(MediaPlayerActivity.this, R.raw.byte_music);\n updateState(MediaPlayerState.STATE_PREPARED);\n }", "public static void setSounds() {\r\n\t\tString temp = \"\";\r\n\t\tString[] sa;\r\n\t\tString prefix = \"\";\r\n\t\tString suffix = \"\";\r\n\t\t\r\n\t\tclearSounds();\r\n\t\t\t\t\r\n\t\t//Loop through the entire sounds array list to find all the settings.\r\n\t\tfor (int i = 0; i < sounds.size(); i++) {\r\n\t\t\t//When found, set the variable in main to that string..\r\n\t\t\ttemp = (String) sounds.get(i);\r\n\t\t\tsa = splitString('=', temp);\r\n\r\n\t\t\t//Set the variables to empty if the setting is empty.\r\n\t\t\tif (temp.endsWith(\"=\")) {\r\n\t\t\t\tprefix = sa[0];\r\n\r\n\t\t\t\tif (prefix.equalsIgnoreCase(\"start\")) {\r\n\t\t\t\t\tMain.soundGameStart = \"\";\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"bags\")){\r\n\t\t\t\t\tMain.soundBags = \"\";\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"set\")){\r\n\t\t\t\t\tMain.soundSet = \"\";\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"win\")){\r\n\t\t\t\t\tMain.soundWin = \"\";\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"lose\")){\r\n\t\t\t\t\tMain.soundLose = \"\";\r\n\t\t\t\t}\r\n\t\t\t//Find the properties and set them to the desired values.\r\n\t\t\t} else {\r\n\t\t\t\tprefix = sa[0];\r\n\t\t\t\tsuffix = sa[1];\r\n\t\t\t\r\n\t\t\t\tif (prefix.equalsIgnoreCase(\"start\")) {\r\n\t\t\t\t\tMain.soundGameStart = suffix;\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"bags\")){\r\n\t\t\t\t\tMain.soundBags = suffix;\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"set\")){\r\n\t\t\t\t\tMain.soundSet = suffix;\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"win\")){\r\n\t\t\t\t\tMain.soundWin = suffix;\r\n\t\t\t\t} else if (prefix.equalsIgnoreCase(\"lose\")){\r\n\t\t\t\t\tMain.soundLose = suffix;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public MediaView loadMusic(StackPane p)\n {\n String musicLoc = \"PTtheme.mp3\";\n \n Media mjuzik = new Media(new File(musicLoc).toURI().toString());\n MediaPlayer mediaPlayer = new MediaPlayer(mjuzik);\n mediaPlayer.setAutoPlay(true);\n \n playMusic = new Button(\"Music On/Off\");\n \n MediaView mjuzikView = new MediaView(mediaPlayer); \n \n //on click\n playMusic.setOnAction(new EventHandler<ActionEvent>() \n {\n @Override\n public void handle(ActionEvent e) \n {\n Status status = mediaPlayer.getStatus();\n\n if (status == Status.PAUSED || status == Status.READY || status == Status.STALLED || status == Status.STOPPED) \n {\n mediaPlayer.play();\n } \n else \n {\n mediaPlayer.pause();\n }\n }\n });\n \n playMusic.setTranslateX(0);\n playMusic.setTranslateY(-425);\n playMusic.setScaleX(1);\n playMusic.setScaleY(1); \n \n p.getChildren().add(playMusic);\n \n return mjuzikView;\n }", "public void mo1675a(C2523a song, int pos) {\n C2606l.m9828a().m9829a(C2606l.f8615a, \"play.music\", new Gson().toJson(song));\n }", "private static void playAudio(String musicFile) {\n }", "public MP3 getMusic() {\n return music;\n }", "private void setDefaultSongNameAndArtist(){\r\n\t\tString[] songLocation = getLocation().split(\"/\");\r\n\t\tString[] songFragment = songLocation[songLocation.length - 1].split(\"[.]\");\r\n\t\tsetSongName(songFragment[0]);\r\n\t\t\r\n\t\tsetAlbum(songLocation[songLocation.length - 2] + \"?\");\r\n\t\tsetArtist(songLocation[songLocation.length - 3] + \"?\");\r\n\t\t\r\n\t}", "private void play() {\n /** Memanggil File MP3 \"indonesiaraya.mp3\" */\n try {\n mp.prepare();\n } catch (IllegalStateException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n /** Menjalankan Audio */\n mp.start();\n\n /** Penanganan Ketika Suara Berakhir */\n mp.setOnCompletionListener(new OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n stateAwal();\n }\n });\n }", "public static void setMarker() {\n\t\tfor (Picture p : pictures) {\n\t\t\tif (p.getLon() < 200 && p.getLat() < 200) {\n\t\t\t\tMarker myMarker = mMap.addMarker(\n\t\t\t\t\t\tnew MarkerOptions()\n\t\t\t\t\t\t\t\t.position(new LatLng(p.getLat(), p.getLon()))\n\t\t\t\t\t\t\t\t.visible(true)\n\t\t\t\t\t\t//.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_brightness_1_black_24dp))\n\t\t\t\t);\n\t\t\t\tmarkers.put(myMarker, p);\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public void show()\r\n {\r\n // De inmediato, ponemos en marcha una melodia\r\n if (!juego.getAdminComponentes().get(\"Audios/bgmusic06.ogg\", Music.class).isPlaying())\r\n {\r\n juego.getAdminComponentes().get(\"Audios/bgmusic06.ogg\", Music.class).play();\r\n juego.getAdminComponentes().get(\"Audios/bgmusic06.ogg\", Music.class).setLooping(true);\r\n }\r\n }", "public void setPlayAll() {\n shuffle = false;\n // set AUTO so when the song ends - it will start the next song automatically\n action = PLAY_TRACK;\n if (shuffleIndexes != null) shuffleIndexes.clear();\n songPosn = 0;\n playSong();\n }", "public void setActiveMap(IMap map) {\n\t\tm_activeMap = map;\n\t\t\n\t\tFile imageLocation = map.getImage();\n\t\tif (! imageLocation.exists()) {\n\t\t\tFile altImage = map.getAltImage();\n\t\t\tif ( altImage != null && altImage.exists()) {\n\t\t\t\timageLocation = altImage;\n\t\t\t}\n\t\t}\n\t\t\n\t\tloadImage(imageLocation);\n\t\tupdateZoomCanvas();\n\t}", "public MusicLibrary() {\n\t\tthis.idMap = new HashMap<String, Song>();\n\t\tthis.titleMap = new TreeMap<String, TreeSet<Song>>(new StringComparator());\n\t\tthis.artistMap = new TreeMap<String, TreeSet<Song>>(new StringComparator());\n\t\tthis.tagMap = new TreeMap<String, TreeSet<String>>(new StringComparator());\n\t\t//this.artistList = new ArrayList<>();\n\t}", "public boolean musicOn ()\n\t{\n\t\tif (musicInt == 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public void SetupMap()\n {\n mMap.setMyLocationEnabled(true);\n\n // GAME LatLng\n LatLng latLng = new LatLng(53.227668, -0.540038);\n\n // Create instantiate Marker\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.draggable(false);\n markerOptions.title(\"GAME\");\n\n MapsInitializer.initialize(getActivity());\n // Create Marker at pos\n mMap.addMarker(markerOptions);\n // Position Map Camera to pos\n mMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(latLng, 100, 0, 0)));\n }", "@Override\n\tpublic void show() {\n\t\tmusic.play();\n\t}", "@Override\n public void setPosition(int position) {\n\n // If the service has disconnected, the SSMusicService is restarted.\n if (!serviceBound) {\n setUpAudioService(); // Sets up the SSMusicService.\n }\n\n // Signals the SSMusicService to set the song position.\n else {\n musicService.setPosition(position);\n }\n }", "public void setPlayer(Player _player) { // beallit egy ezredest az adott mapElementre, ha az rajta van\n player = _player;\n }", "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 Music loadMusic(String fileName);", "void setPosition(Unit unit, MapLocation position);", "void setSound(boolean b){\r\n\t\tgc.setSound(b);\r\n\t}", "@Override\n public void onMapReady(GoogleMap googleMap) {\n\n mMap = googleMap;\n // Add a marker in Sydney and move the camera\n\n MarkerOptions markerOptions =new MarkerOptions().position(x).title(\"abane ramdane\");\n CircleOptions circleOptions = new CircleOptions().center(x).radius(1000).fillColor(0xffffff0).strokeColor(0xffff0000).strokeWidth(2);\n markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.house));\n mMap.addMarker(markerOptions);\n mMap.addCircle(circleOptions);\n\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(x, 13));\n }", "public void setMusicOnHold() throws FrameException {\n infoElements.put(new Integer(InfoElement.MUSICONHOLD), new byte[0]);\n }", "abstract public void setSoundResourcesDir(String path);", "private void setUpMap() {\n // Crear all map elements\n mGoogleMap.clear();\n // Set map type\n mGoogleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n // If we cant find the location now, we call a Network Provider location\n if (mLocation != null) {\n // Create a LatLng object for the current location\n LatLng latLng = new LatLng(mLocation.getLatitude(), mLocation.getLongitude());\n // Show the current location in Google Map\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n // Draw the first circle in the map\n mCircleOptions = new CircleOptions().fillColor(0x5500ff00).strokeWidth(0l);\n // Zoom in the Google Map\n mGoogleMap.animateCamera(CameraUpdateFactory.zoomTo(15));\n\n // Zoom in the Google Map\n //icon = BitmapDescriptorFactory.fromResource(R.drawable.logo2);\n\n // Creation and settings of Marker Options\n mMarkerOptions = new MarkerOptions().position(latLng).title(\"You are here!\");//.icon(icon);\n // Creation and addition to the map of the Marker\n mMarker = mGoogleMap.addMarker(mMarkerOptions);\n // set the initial map radius and draw the circle\n drawCircle(RADIUS);\n }\n }", "public WavPlayer(String track) {\n\t\tthis.wavMusicFile = track;\n\t\t//startSound();\n\n\t}", "public void Play() {\n superPlaneGodMode = false;\r\n if (!musicPlaying)\r\n backgroundMusic.pause();\r\n if (musicPlaying)\r\n backgroundMusic.start();\r\n paused = false;\r\n }", "private void setUpMap() {\n\t\t \n\t\tmMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n\t\t//mMap.setMyLocationEnabled(true);\n\t\t\t \n\t\tmMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(\n\t\t\t\tlatitude, longitude), 12.0f));\n\n\t}", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n String info = sTitle;\n // Add a marker in Sydney and move the camera\n LatLng pos = new LatLng(latitude, longitude);\n mMap.addMarker(new MarkerOptions().position(pos).title(info));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(pos));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(pos, 8));\n\n }", "public static void playBackGroundMusic(String path) {\n if (musicPlayer != null && musicPlayer.getSourceLocation() != null) {\n if (musicPlayer.getSourceLocation().equals(path)) {\n if (musicPlayer.isEndOfMediaReached()) {\n musicPlayer.seek(0);\n musicPlayer.play();\n }\n return;\n }\n musicPlayer.stop();\n }\n musicPlayer = new Player();\n musicPlayer.setSourceLocation(path);\n musicPlayer.play();\n }", "public static void init() {\n\t\tmusicManager = new MusicManager();\n\t}", "public void setSongInfoList(ArrayList<SongInfo> list)\n {\n songInfos = list;\n }", "public void setAudioPlayer(AudioPlayer player) {\n\taudioPlayer = player;\n externalAudioPlayer = true;\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng parque = new LatLng(latitud, longitud);\n mMap.addMarker(new MarkerOptions().position(parque).title(lugar).icon(BitmapDescriptorFactory.fromResource(R.drawable.icons8_terraria_48)));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(parque));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitud, longitud),16.0f));\n }", "public Music getMusic() {\n return music;\n }", "private void play()\n {\n if(AudioDetector.getInstance().isNoAudio())\n {\n return;\n }\n\n stop();\n musicPlayer.play();\n }", "public void setSound(String filename) {\n\t\ts = new Sound(filename);\n\t}", "public void setPlayTrack(int position) {\n shuffle = false;\n action = PLAY_TRACK;\n if (shuffleIndexes != null) shuffleIndexes.clear();\n songPosn = position;\n playSong();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n\n\n }", "private void setup() {\n\t\t map.setMyLocationEnabled(true);\n\t \n\t CameraPosition cameraPosition = new CameraPosition.Builder()\n\t .target(USMP_LOCATION) // Sets the center of the map to\n\t // Golden Gate Bridge\n\t .zoom(16) // Sets the zoom\n\t .bearing(90) // Sets the orientation of the camera to east\n\t .tilt(60) // Sets the tilt of the camera to 30 degrees\n\t .build(); // Creates a CameraPosition from the builder\n\t \n\t CameraUpdate cameraUpdate=CameraUpdateFactory.newCameraPosition(\n\t \t cameraPosition);\n\t\t map.animateCamera(cameraUpdate);\n\t\t \n\t map.addMarker(new MarkerOptions()\n\t .position(USMP_LOCATION)\n\t .title(\"DevFest 2013 Season 2\"));\n\t}", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n LatLng livraria = new LatLng(maps.getLatitude(), maps.getLongitude());\n if(this.maps.getId() == 1){\n mMap.addMarker(new MarkerOptions().position(livraria).title(\"Livraria Saraiva - Praia de Belas\"));\n } else if(this.maps.getId() == 2){\n mMap.addMarker(new MarkerOptions().position(livraria).title(\"Livraria Cultura - Bourbon Country\"));\n } else if(this.maps.getId() == 3){\n mMap.addMarker(new MarkerOptions().position(livraria).title(\"Livraria Cameron\"));\n } else if(this.maps.getId() == 4){\n mMap.addMarker(new MarkerOptions().position(livraria).title(\"Livraria Siciliano\"));\n }\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(livraria, 15f));\n mMap.getUiSettings().setZoomControlsEnabled(true);\n\n }", "public void setMap(MapAssembly demoMap) {\n this.map = demoMap;\n }" ]
[ "0.68852025", "0.6523692", "0.6268633", "0.6230707", "0.6180291", "0.61049664", "0.6082474", "0.6079415", "0.6025493", "0.59976524", "0.59761506", "0.59415907", "0.5904077", "0.5880784", "0.5868563", "0.5866186", "0.58318835", "0.5830527", "0.5788271", "0.57878006", "0.5741946", "0.5737467", "0.56774724", "0.56717986", "0.56704515", "0.56619865", "0.5609456", "0.5581424", "0.5564903", "0.5543705", "0.5527357", "0.5521136", "0.55138", "0.55019677", "0.55013585", "0.54734457", "0.546568", "0.54655266", "0.5454662", "0.54537785", "0.54486287", "0.54177827", "0.5416753", "0.5415159", "0.5412626", "0.53880256", "0.5377471", "0.5376599", "0.536369", "0.53588426", "0.53439206", "0.53435916", "0.5342385", "0.5333024", "0.532284", "0.5320018", "0.5318818", "0.53028524", "0.5300897", "0.5299887", "0.5297855", "0.5291553", "0.5278699", "0.5276766", "0.5276556", "0.527598", "0.5275474", "0.5273629", "0.52714694", "0.5268401", "0.5264557", "0.5261713", "0.5261691", "0.52590746", "0.5255657", "0.5250494", "0.5238911", "0.52355325", "0.5234378", "0.52186936", "0.5216441", "0.5216099", "0.518304", "0.51826984", "0.51823753", "0.5180348", "0.5179793", "0.51733625", "0.5171609", "0.5157553", "0.5149251", "0.51440114", "0.5142068", "0.51351047", "0.5133572", "0.5119311", "0.5116587", "0.511134", "0.5111187", "0.5108579" ]
0.7308506
0
TODO Autogenerated method stub
@Override public void print() { System.out.println("Avaliable Media items are"); System.out.println("Identification Number number of copies title of item"); for(int i =0; i<getTitle().length; i++) { System.out.println(getIdentificatioNumber()[i]+" " +getNumberOfCopies()[i]+" "+getTitle()[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public boolean equal() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void checkIn(String title) { super.checkIn(title); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void checkOut(String title) { super.checkOut(title); }
{ "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
/ O(N) Precondition: Path is a file Postcondition: String with the contents of the file
public static String readFile(String path) { String contents = ""; try { BufferedReader br = new BufferedReader(new FileReader(path)); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while (line != null) { sb.append(line); sb.append(System.lineSeparator()); line = br.readLine(); } contents = sb.toString(); br.close(); } catch (Exception e) { System.out.println(e.toString()); System.exit(1); } return contents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String readFileIntoString(String filepath) throws IOException;", "private static String readFile(String path) throws IOException {\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(path)))) {\n\t\t\tStringBuilder input = new StringBuilder();\n\t\t\tString tmp; while ((tmp = br.readLine()) != null) input.append(tmp+\"\\n\");\n\t\t\treturn input.toString();\n\t\t}\n\t}", "private static String loadFile(String path){\n try {\n\n BufferedReader reader = new BufferedReader(new FileReader(path));\n StringBuilder sb = new StringBuilder();\n\n String line;\n while((line = reader.readLine()) != null){\n sb.append(line);\n sb.append('\\n');\n }\n\n reader.close();\n return sb.toString();\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n return null;\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "public String readFromFile(String path) {\n BufferedReader br = null;\n String returnString =\"\";\n try {\n String sCurrentLine;\n br = new BufferedReader(new FileReader(path));\n while ((sCurrentLine = br.readLine()) != null) {\n returnString+=sCurrentLine;\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (br != null)br.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n return returnString;\n }", "public String readFileIntoString(String sourceFilepath) throws IOException {\n StringBuilder sb = new StringBuilder();\n URL url = new URL(sourceFilepath);\n BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));\n String line = null;\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n reader.close();\n return sb.toString();\n }", "String readText(FsPath path);", "public static String getContent(String path){\t\n\t\t\n\t\tStringBuilder content = new StringBuilder();\n\t\tFile file = new File(path);\n\t\t\n\t\ttry{\n\t\t\tScanner fileReader = new Scanner(file);\n\t\t\twhile (fileReader.hasNextLine()) \n\t\t\t\tcontent.append(fileReader.nextLine() + \"\\n\");\t\n\t\t\tfileReader.close();\n\t\t}\n\t\tcatch(FileNotFoundException f){\n\t\t\tf.printStackTrace();\n }\n \n return content.toString();\n\t}", "public static String read(String path) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile file = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// if the file does not exist return null\r\n\t\tif (!file.exists())\r\n\t\t\treturn null;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString content = \"\";\r\n\t\t\r\n\t\t// write to the file\r\n\t\ttry {\r\n\t\t\t// open stream\r\n\t\t\tFileReader fReader = new FileReader(file);\r\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fReader);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// read all the content of the file\r\n\t\t\tString current = bufferedReader.readLine();\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tcontent = content.concat(current + \"\\n\");\r\n\t\t\t\tcurrent = bufferedReader.readLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// close anything was opened\r\n\t\t\tbufferedReader.close();\r\n\t\t\tfReader.close();\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t\t\r\n\t\treturn content;\r\n\t}", "private String getFileContent(String filePath) {\r\n\r\n\t\ttry {\r\n\t\t\tString text = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);\r\n\t\t\treturn text;\r\n\t\t} catch (Exception ex) {\r\n\t\t\treturn \"-1\";\r\n\t\t}\r\n\t}", "public static String readFile(Path path) {\n\t\tif (path != null) {\n\t\t\tbyte[] bytes = toByteArray(path);\n\t\t\tif (bytes != null) {\n\t\t\t\treturn new String(bytes, StandardCharsets.UTF_8);\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "private static String fileToString(String path) throws IOException {\n\n\t\tbyte[] encoded = Files.readAllBytes(Paths.get(path));\n\t\treturn new String(encoded, StandardCharsets.UTF_8);\n\t}", "Path getContent(String filename);", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n return contentBuilder.toString();\n }", "public static String readFile(String path) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(path));\n\n String line;\n StringBuilder builder = new StringBuilder();\n\n while ((line = reader.readLine()) != null) {\n builder.append(line);\n }\n\n return builder.toString();\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n }", "public String readFile(){\r\n StringBuffer str = new StringBuffer(); //StringBuffer is a mutable string\r\n Charset charset = Charset.forName(\"UTF-8\"); //UTF-8 character encoding\r\n Path file = Paths.get(filename + \".txt\");\r\n try (BufferedReader reader = Files.newBufferedReader(file, charset)) { // Buffer: a memory area that buffered streams read\r\n String line = null;\r\n while ((line = reader.readLine()) != null) { //Readers and writers are on top of streams and converts bytes to characters and back, using a character encoding\r\n str.append(line + \"\\n\");\r\n }\r\n }\r\n catch (IOException x) {\r\n System.err.format(\"IOException: %s%n\", x);\r\n }\r\n return str.toString();\r\n }", "public String loadTextFile(String path) throws IOException {\n File file = new File(path);\n\n // Convert the file to a string.\n String output;\n try {\n output = Files.toString(file, Charsets.UTF_8);\n } catch (IOException ex) {\n LoggerFactory.getLogger(Resources.class).error(\"Unable to locate the resource at \" + path + \".\", ex);\n throw ex;\n }\n\n return output;\n }", "public static String readFile() {\n\t\tFileReader file;\n\t\tString textFile = \"\";\n\n\t\ttry {\n\t\t\tfile = new FileReader(path);\n\n\t\t\t// Output string.\n\t\t\ttextFile = new String();\n\n\t\t\tBufferedReader bfr = new BufferedReader(file);\n\n\t\t\ttextFile= bfr.readLine();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error reading the file\");\n\t\t}\n\t\treturn textFile;\n\n\t}", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(contentBuilder::append);\n }\n return contentBuilder.toString();\n }", "java.lang.String getFilePath();", "static String readFile(String path) throws IOException{\n\t\tFileInputStream fs = new FileInputStream(path);\n\t\tStringBuffer sb = new StringBuffer();\n\t\t// read a file\n\t\tint singleByte = fs.read(); // read singleByte\n\t\twhile(singleByte!=-1){\n\t\t\tsb.append((char)singleByte);\n\t\t\t///System.out.print((char)singleByte);\n\t\t\tsingleByte = fs.read();\n\t\t}\n\t\tfs.close(); // close the file\n\t\treturn sb.toString();\n\t}", "private String getStringFromFile() throws FileNotFoundException {\n String contents;\n FileInputStream fis = new FileInputStream(f);\n StringBuilder stringBuilder = new StringBuilder();\n try {\n InputStreamReader inputStreamReader = new InputStreamReader(fis, \"UTF-8\");\n BufferedReader reader = new BufferedReader(inputStreamReader);\n String line = reader.readLine();\n while (line != null) {\n stringBuilder.append(line).append('\\n');\n line = reader.readLine();\n }\n } catch (IOException e) {\n // Error occurred when opening raw file for reading.\n } finally {\n contents = stringBuilder.toString();\n }\n return contents;\n }", "String getFile();", "String getFile();", "String getFile();", "private String readFile(String path, Charset encoding) throws IOException \r\n\t{\r\n\t\tbyte[] encoded = Files.readAllBytes(Paths.get(path));\r\n\t\treturn new String(encoded, encoding);\r\n\t}", "public String readFile(){\n\t\tString res = \"\";\n\t\t\n\t\tFile log = new File(filePath);\n\t\tBufferedReader bf = null;\n\t\t\n\t\ttry{\n\t\t\tbf = new BufferedReader(new FileReader(log));\n\t\t\tString line = bf.readLine();\n\t\t\n\t\t\n\t\t\twhile (line != null){\n\t\t\t\tres += line+\"\\n\";\n\t\t\t\tline = bf.readLine();\n\t\t\t}\n\t\t\n\t\t\treturn res;\n\t\t}\n\t\tcatch(Exception oops){\n\t\t\tSystem.err.println(\"There was an error reading the file \"+oops.getStackTrace());\n\t\t\treturn \"\";\n\t\t}\n\t\tfinally{\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"There was an error closing the read Buffer \"+e.getStackTrace());\n\t\t\t}\n\t\t}\n\t}", "public String getFormattedFileContents ();", "public static String loadFileAsString(String filePath) throws java.io.IOException{\n\t StringBuffer fileData = new StringBuffer(1000);\n\t BufferedReader reader = new BufferedReader(new FileReader(filePath));\n\t char[] buf = new char[1024];\n\t int numRead=0;\n\t while((numRead=reader.read(buf)) != -1){\n\t String readData = String.valueOf(buf, 0, numRead);\n\t fileData.append(readData);\n\t }\n\t reader.close();\n\t return fileData.toString();\n\t}", "private static BufferedReader getFileContents(String path) throws FileNotFoundException{\n\t\tFile file = new File(path);\n\t\treturn new BufferedReader(new FileReader(file));\t\n\t}", "private static String ReadFile(String filePath) {\n StringBuilder sb = new StringBuilder();\n try {\n BufferedReader r = new BufferedReader(new FileReader(filePath));\n String line;\n while ((line = r.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n System.out.println(e.getStackTrace());\n }\n return sb.toString();\n\n }", "private static String readFile(String filePath) {\n\t\tFile file = new File(filePath);\n\t\tString fileElements;\n\t\tFileInputStream in = null;\n\t\t\n\t\tif(file.exists()){\n\t\t\ttry {\n\t\t\t\tin = new FileInputStream(file);\n\t\t\t\tbyte[] fileBytes = new byte[(int)file.length()];\n\t\t\t\tin.read(fileBytes);\n\t\t\t\tfileElements = new String(fileBytes);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tfileElements = \"\";\n\t\t\t} catch(IOException io){\n\t\t\t\tio.printStackTrace();\n\t\t\t\tfileElements = \"\";\n\t\t\t}\n\t\t}else{\n\t\t\tfileElements=\"\";\n\t\t}\n\t\treturn fileElements;\n\t}", "private String getFileContents ()\n {\n final String s = m_buffers.values ()//\n .stream ()//\n .flatMap (List::stream)//\n .collect (Collectors.joining ());\n\n return s;\n }", "public String getFileContent(String filePath) {\n\t\tString content = \"\";\n\t\t// get the path\n\t\tString path = filePath.substring(0, filePath.lastIndexOf(\"/\"));\n\t\t// get the file's name\n\t\tString name = filePath.substring(filePath.lastIndexOf(\"/\") + 1);\n\t\t// iterate through all the files to see if we can find it...\n\t\tfor (FileObjects t : getDirectory(path, directory).getFiles()) {\n\t\t\tif (name.equals(t.getName())) {\n\t\t\t\tcontent = t.getContent();\n\t\t\t}\n\t\t}\n\t\t// return the content of the file, or just an empty string if it's\n\t\t// empty.\n\t\treturn content;\n\n\t}", "List readFile(String pathToFile);", "private static String readFileToString(String filePath) throws IOException {\n\t\tStringBuilder fileData = new StringBuilder(1000);\n\t\tBufferedReader reader = new BufferedReader(new FileReader(filePath));\n\t\tchar[] buf = new char[10];\n\t\tint numRead = 0;\n\t\twhile ((numRead = reader.read(buf)) != -1) {\n\t\t\tString readData = String.valueOf(buf, 0, numRead);\n\t\t\tfileData.append(readData);\n\t\t\tbuf = new char[1024];\n\t\t}\n\t\treader.close();\n\t\treturn fileData.toString();\t\n\t}", "private String readFile(String file) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(file), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n\n }", "public String readFile (String pathOfFileSelected) {\n\n File file = new File(pathOfFileSelected);\n\n StringBuilder text = new StringBuilder();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(file));\n String line;\n\n while ((line = br.readLine()) != null) {\n text.append(line);\n text.append('\\n');\n }\n br.close();\n Log.d(TAG, \"readFile: text: \" +text.toString());\n return text.toString().trim();\n }\n catch (IOException e) {\n Log.e(TAG, \"readFile: \",e );\n return null;\n }\n }", "protected String openReadFile(Path filePath) throws IOException{\n\t\tString line;\n\t\tStringBuilder sb = new StringBuilder();\n\t\t// Read the document\n\t\tBufferedReader reader = Files.newBufferedReader(filePath, ENCODING);\n\t\t// Append each line in the document to our string\n\t\twhile ((line = reader.readLine()) != null) {\n\t\t\tsb.append(line);\n\t\t\tsb.append(\"\\n\"); // readLine discards new-row characters, re-append them.\n\t\t}\n\t\tif(sb.length() != 0){\n\t\t\tsb.deleteCharAt(sb.length()-1); // However last line doesn't contain one, remove it.\n\t\t}\n\t\treader.close();\n\t\treturn new String(sb.toString());\n\t}", "public String getContent() {\n String s = null;\n try {\n s = new String(Files.readAllBytes(Paths.get(filename)), StandardCharsets.UTF_8);\n }\n catch (IOException e) {\n message = \"Problem reading a file: \" + filename;\n }\n return s;\n }", "public String readFileContents(String filename) {\n return null;\n\n }", "public static String readFileAsString(String filePath) {\n\t\tbyte[] buffer = new byte[(int) new File(filePath).length()];\n\t\tBufferedInputStream f = null;\n\t\ttry {\n\t\t\tFile file = new File(filePath);\n\t\t\tfor (int attempt = 0; attempt < 3; attempt++) {\n\t\t\t\tif (file.exists()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tThread.sleep(2);\n\t\t\t}\n\n\t\t\tif (!file.exists()) {\n\t\t\t\tSystem.err.println(\"\\nfile not found: \" + filePath);\n\t\t\t\tthrow new FileNotFoundException(\"Could not find file: \" + filePath);\n\t\t\t}\n\n\t\t\tf = new BufferedInputStream(new FileInputStream(filePath));\n\t\t\tf.read(buffer);\n\t\t} catch (IOException e) {\n\t\t\tthrow new UncheckedExecutionException(e);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (f != null)\n\t\t\t\ttry {\n\t\t\t\t\tf.close();\n\t\t\t\t} catch (IOException ignored) {\n\t\t\t\t}\n\t\t}\n\t\treturn new String(buffer);\n\t}", "public String readFromFile(String filePath){\n String fileData = \"\";\n try{\n File myFile = new File(filePath);\n Scanner myReader = new Scanner(myFile);\n while (myReader.hasNextLine()){\n String data = myReader.nextLine();\n fileData += data+\"\\n\";\n }\n myReader.close();\n } catch(FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n return fileData;\n }", "private void ReadTextFile(String FilePath) {\n\t\t\n\t\t\n\t}", "public String read(String filePath) throws IOException {\r\n\t\t//read file into stream\r\n\t\t\treturn new String(Files.readAllBytes(Paths.get(filePath)));\r\n\t}", "private static String p_readFromResource(String path) {\n StringBuffer content = new StringBuffer();\n\n InputStream istream = NamedTemplate.class.getResourceAsStream(path);\n\n if (istream != null) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(istream));\n\n try {\n String line = reader.readLine();\n while (line != null) {\n content.append(line).append(\"\\n\");\n\n line = reader.readLine();\n }\n } catch (IOException e) {\n logger.error(\"NamedTemplate: unable to read template from \" + path, e);\n }\n } else {\n return null;\n }\n\n return content.toString();\n }", "static String readFile(String path, Charset encoding)\n throws IOException\n {\n byte[] encoded = Files.readAllBytes(Paths.get(path));\n return new String(encoded, encoding);\n }", "@SuppressWarnings(\"unused\")\n private String readFile(File f) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n StringBuilder builder = new StringBuilder();\n while (line != null) {\n builder.append(line).append('\\n');\n line = reader.readLine();\n }\n reader.close();\n return builder.toString();\n }", "public String readFile(String Path, String File_name) {\n\t\tFile f1 = new File( Path + \"/\" + File_name);\n\t\t String str = \"\";\n\t\t String res = \"\";\n\t try {\n\t // открываем поток для чтения\n\t BufferedReader br = new BufferedReader(new FileReader(f1));\n\t \n\t // читаем содержимое\n\t while ((str = br.readLine()) != null) {\n\t Log.d(LOG_TAG, str);\n\t res+=str;\n\t }\n\t //res=str;\n\t \n\t } catch (FileNotFoundException e) {\n\t e.printStackTrace();\n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t }\n\t return res;\n\t }", "public void readFile();", "public String textExtractor(String filePath) {\n\n StringBuilder textBuilder = new StringBuilder();\n try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/\" + filePath), \"UTF-8\"))) {\n while (bufferedReader.ready()) {\n textBuilder.append(bufferedReader.readLine()).append(\"/n\");\n }\n\n } catch (IOException exc) {\n exc.printStackTrace();\n }\n return textBuilder.toString();\n }", "String getFilePath();", "public static String getFileContentsAsString(String filename) {\n\n // Java uses Paths as an operating system-independent specification of the location of files.\n // In this case, we're looking for files that are in a directory called 'data' located in the\n // root directory of the project, which is the 'current working directory'.\n final Path path = FileSystems.getDefault().getPath(\"Resources\", filename);\n\n try {\n // Read all of the bytes out of the file specified by 'path' and then convert those bytes\n // into a Java String. Because this operation can fail if the file doesn't exist, we\n // include this in a try/catch block\n return new String(Files.readAllBytes(path));\n } catch (IOException e) {\n // Since we couldn't find the file, there is no point in trying to continue. Let the\n // user know what happened and exit the run of the program. Note: we're only exiting\n // in this way because we haven't talked about exceptions and throwing them in CS 126 yet.\n System.out.println(\"Couldn't find file: \" + filename);\n System.exit(-1);\n return null; // note that this return will never execute, but Java wants it there.\n }\n }", "public String loadFromFile() {\n StringBuilder sb = new StringBuilder();\n try {\n Log.d(\"DEBUG\", this.context.getPackageName());\n Log.d(\"DEBUG\", this.file);\n FileInputStream fis = context.openFileInput(file);\n BufferedReader br = new BufferedReader(new InputStreamReader(fis, this.encoding));\n String line;\n while(( line = br.readLine()) != null ) {\n sb.append( line );\n sb.append( '\\n' );\n }\n } catch (IOException e) {\n e.printStackTrace();\n return \"\";\n }\n return sb.toString();\n }", "public static String readFileAsString(String filePath, String encoding) {\n\t\tbyte[] buffer = new byte[(int) new File(filePath).length()];\n\t\tBufferedInputStream f = null;\n\t\ttry {\n\t\t\tFile file = new File(filePath);\n\t\t\tfor (int attempt = 0; attempt < 3; attempt++) {\n\t\t\t\tif (file.exists()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tThread.sleep(2);\n\t\t\t}\n\n\t\t\tif (!file.exists()) {\n\t\t\t\tSystem.err.println(\"\\nfile not found: \" + filePath);\n\t\t\t\tthrow new FileNotFoundException(\"Could not find file: \" + filePath);\n\t\t\t}\n\n\t\t\tf = new BufferedInputStream(new FileInputStream(filePath));\n\t\t\tf.read(buffer);\n\t\t} catch (IOException e) {\n\t\t\tthrow new UncheckedExecutionException(e);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (f != null)\n\t\t\t\ttry {\n\t\t\t\t\tf.close();\n\t\t\t\t} catch (IOException ignored) {\n\t\t\t\t}\n\t\t}\n\t\tString contents = null;\n\t\ttry {\n\t\t\tcontents = new String(buffer, encoding);\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn contents;\n\t}", "String[] readFile(String path) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader;\n File file;\n\n try {\n file = new File(path);\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n return output;\n }", "protected abstract InputStream getFile(final String path);", "public String readFile(String filePath)\n {\n String result = \"\";\n try {\n\n FileReader reader = new FileReader(filePath);\n Scanner scanner = new Scanner(reader);\n\n while(scanner.hasNextLine())\n {\n result += scanner.nextLine();\n }\n reader.close();\n }\n catch(FileNotFoundException ex)\n {\n System.out.println(\"File not found. Please contact the administrator.\");\n }\n catch (Exception ex)\n {\n System.out.println(\"Some error occurred. Please contact the administrator.\");\n }\n return result;\n }", "public static String readFileAsString(String path) throws IOException {\n return readFileAsString(path, Charset.defaultCharset().name());\n }", "public String getFileText(String filePath) {\n String fileText = \"\"; \n \n File myFile = new File(filePath);\n Scanner myReader; \n \n try {\n myReader = new Scanner(myFile);\n \n while(myReader.hasNext()) {\n fileText+= myReader.nextLine() + \"\\n\"; \n }\n \n } catch (FileNotFoundException ex) {\n logger.log(Level.SEVERE, \"Error getting text from text file\", ex.getMessage()); \n }\n \n return fileText; \n }", "public List<String> readFileContents(String filePath) throws APIException;", "private static String[] readFile(String path) throws FileNotFoundException{\n\t\tjava.io.File file = new java.io.File(path);\n\t\tjava.util.Scanner sc = new java.util.Scanner(file); \n\t\tStringBuilder content = new StringBuilder();\n\t\twhile (sc.hasNextLine()) {\n\t\t String line = sc.nextLine();\n\t\t if (!line.startsWith(\"!--\")){\n\t\t \tline = line.trim();\n\t\t \tString[] lineContent = line.split(\"/\");\n\t\t \tfor (String entry : lineContent){\n\t\t \t\tcontent.append(entry);\n\t\t \t\tcontent.append(\"/\");\n\t\t \t}\n\t\t \tcontent.append(\"!\");\n\t\t }\n\t\t}\n\t\tsc.close();\n\t\treturn content.toString().split(\"!\");\n\t}", "private static String readFileContents(File file) throws FileNotFoundException {\n StringBuilder fileContents = new StringBuilder((int) file.length());\n\n try (Scanner scanner = new Scanner(file)) {\n while (scanner.hasNext()) {\n fileContents.append(scanner.next());\n }\n return fileContents.toString();\n }\n }", "static String readFile(String path, Charset encoding) throws IOException {\n\t\tbyte[] encoded = Files.readAllBytes(Paths.get(path));\n\t\treturn encoding.decode(ByteBuffer.wrap(encoded)).toString();\n\t}", "public static String readFile(String pFilePath) {\n\t\tBufferedReader bufferedReader = null;\n\t StringBuilder stringBuilder = new StringBuilder();\n\t\ttry {\n\t\t\tbufferedReader = new BufferedReader(new FileReader(pFilePath));\n\t\t\tbufferedReader.lines().forEach((s) -> { stringBuilder.append(s + \"\\n\"); });\t\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t} finally {\n\t\t\tif (bufferedReader != null) {\n\t\t\t\ttry {\n\t\t\t\t\tbufferedReader.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (stringBuilder != null && stringBuilder.toString().equals(\"\")) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\treturn stringBuilder.toString();\n\t\t}\n\t}", "public String getFileContents(String myFile) {\n\n\t\t// Creates a new StringBuilder object.\n\t\tthis.fileContents = new StringBuilder();\n\n\t\t// Creates a new File object.\n\t\tthis.file = new File(myFile);\n\n\t\ttry {\n\t\t\t// Creates a FileReader object.\n\t\t\tthis.fileReader = new FileReader(file);\n\n\t\t\t// Wraps the FileReader in a BufferedReader.\n\t\t\tthis.bufferedReader = new BufferedReader(fileReader);\n\n\t\t\t// Reads from the FileReader via the BufferedReader and appends to the String.\n\t\t\twhile ((this.line = bufferedReader.readLine()) != null) {\n\t\t\t\tfileContents.append(line + \"\\n\");\n\t\t\t}\n\t\t\t// If file cannot be located.\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"[ERROR] File not found: \" + file.toString());\n\t\t\t// If file cannot be read.\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"[ERROR] Unable to read file: \" + file.toString());\n\t\t}\n\n\t\ttry {\n\t\t\tbufferedReader.close();\n\t\t\t// If file cannot be closed.\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"[ERROR] Unable to close file: \" + file.toString());\n\t\t\t// If file contains a null value.\n\t\t} catch (NullPointerException ex) {\n\t\t\tSystem.out.println(\"[ERROR] \" + file.toString() + \"contains no information.\");\n\t\t}\n\t\treturn fileContents.toString();\n\t}", "public String ReadFile() throws IOException {\n File file = context.getFilesDir();\n File textfile = new File(file + \"/\" + this.fileName);\n\n FileInputStream input = context.openFileInput(this.fileName);\n byte[] buffer = new byte[(int)textfile.length()];\n\n input.read(buffer);\n\n return new String(buffer);\n }", "private void fileRead(String path)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// create file\n\t\t\tFile file = new File(path);\n\t\t\tFileInputStream fileStream = new FileInputStream(file);\n\t\t\t\n\t\t\t// data read\n\t\t\tthis.dataContent = new byte[(int)file.length()];\n\t\t\tint ret = fileStream.read(this.dataContent, 0, (int)file.length());\n\t\t}\n\t\tcatch(FileNotFoundException e)\n\t\t{\n\t\t\tSystem.out.println(\"File Not Found : \" + e.getMessage());\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(\"Failed File Read : \" + e.getMessage());\n\t\t}\n\t\t\n\t}", "public static String readFileAsString(String fileName) {\n String text = \"\";\n\n try {\n text = new String(Files.readAllBytes(Paths.get(fileName)));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return text;\n }", "public static ArrayList<String> textToStr(String path) throws IOException {\n ArrayList<String> lines = new ArrayList<>();\n try{\n File file = new File(path);\n FileReader fr = new FileReader(file);\n BufferedReader bufr = new BufferedReader(fr);\n String line = \"\";\n while((line = bufr.readLine()) != null){\n if(line.trim() != null && line.trim().length() > 0){\n lines.add(line.trim());\n }\n }\n return lines;\n }\n catch (Exception e){\n System.out.println(\"The path is wrong or the input file does not exist. Try again.\\n\");\n return null;\n }\n }", "public void readTextFile(String path) throws IOException {\n FileReader fileReader=new FileReader(path);\n BufferedReader bufferedReader=new BufferedReader(fileReader);\n String value=null;\n while((value=bufferedReader.readLine())!=null){\n System.out.println(value);\n }\n }", "public static String getAsString(String filePath) {\n\t\tInputStream is = FileUtil.class.getResourceAsStream(filePath);\n\t\treturn getAsString(is);\n\t}", "public String ReadFile(String sFilePath) throws Exception {\n File f = null;\n FileInputStream fstream = null;\n String stemp = \"\";\n try {\n //getting file oject\n f = new File(sFilePath);\n //get object for fileinputstream\n fstream = new FileInputStream(f);\n //getting byte array length\n byte data[] = new byte[fstream.available()];\n //getting file stream data into byte array\n fstream.read(data);\n //storing byte array data into String\n stemp = new String(data);\n return stemp;\n } catch (Exception e) {\n throw new Exception(\"ReadFile : \" + e.toString());\n } finally {\n try {\n fstream.close();\n } catch (Exception e) {\n }\n }\n }", "public String readFileContent(File file) {\n StringBuilder fileContentBuilder = new StringBuilder();\n if (file.exists()) {\n String stringLine;\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n while ((stringLine = bufferedReader.readLine()) != null) {\n fileContentBuilder.append(stringLine + \"\\n\");\n }\n bufferedReader.close();\n fileReader.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return fileContentBuilder.toString();\n }", "FileObject getFile();", "FileObject getFile();", "private static String getText(IFile file) throws CoreException, IOException {\n\t\tInputStream in = file.getContents();\n\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\tbyte[] buf = new byte[1024];\n\t\tint read = in.read(buf);\n\t\twhile (read > 0) {\n\t\t\tout.write(buf, 0, read);\n\t\t\tread = in.read(buf);\n\t\t}\n\t\treturn out.toString();\n\t}", "private static String file2string(String file) {\n StringBuilder sb = new StringBuilder();\n try {\n BufferedReader br = new BufferedReader(new FileReader(new File(file)));\n String line;\n\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return (sb != null) ? sb.toString() : \"\";\n }", "String getFilepath();", "Path getFilePath();", "public static String readFileAsString(Context context, String fileName) {\n\t\tInputStream in;\n\t\tStringBuilder sb = new StringBuilder();\n \t\tboolean result = false;\n\t\t// wykonaj jako jeden nieprzerwany blok czynnosci na plikach - zaloz blokade na statyczny obiekt DATA_LOCK\n \t\tsynchronized (FileUtil.DATA_LOCK) {\n \t\t\ttry{\n\t\t\t\tin = context.getAssets().open(fileName);\n\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in), 8*1024);\n\t\t\t String line = null;\n\t\t\t while ((line = reader.readLine()) != null) {\n\t\t\t sb.append(line).append(FileUtil.LINE_SEP);\n\t\t\t }\n\t\t\t in.close();\n\t\t\t result = true;\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tLog.e(LOG_TAG, \"Nie odnaleziono pliku: '\"+fileName+\"'\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tLog.e(LOG_TAG, \"Blad odczytu pliku: '\"+fileName+\"'\");\n\t\t\t}\n \t\t}\n \t\tif(result) return sb.toString();\n \t\treturn null;\n\t}", "private StringBuffer readFromFile(String src) {\n \t\tif (src == null)\n \t\t\treturn null;\n \t\tInputStream stream = null;\n \t\tStringBuffer content = new StringBuffer();\n \t\tBufferedReader reader = null;\n \t\ttry {\n \t\t\tURL url = new URL(src);\n \t\t\tstream = url.openStream();\n \t\t\t//TODO: Do we need to worry about the encoding here? e.g.:\n \t\t\t//reader = new BufferedReader(new InputStreamReader(stream,\n \t\t\t// ResourcesPlugin.getEncoding()));\n \t\t\treader = new BufferedReader(new InputStreamReader(stream));\n \t\t\twhile (true) {\n \t\t\t\tString line = reader.readLine();\n \t\t\t\tif (line == null) // EOF\n \t\t\t\t\tbreak; // done reading file\n \t\t\t\tcontent.append(line);\n \t\t\t\tcontent.append(IIntroHTMLConstants.NEW_LINE);\n \t\t\t}\n \t\t} catch (Exception exception) {\n \t\t\tLogger.logError(\"Error reading from file\", exception); //$NON-NLS-1$\n \t\t} finally {\n \t\t\ttry {\n \t\t\t\tif (reader != null)\n \t\t\t\t\treader.close();\n \t\t\t\tif (stream != null)\n \t\t\t\t\tstream.close();\n \t\t\t} catch (IOException e) {\n \t\t\t\tLogger.logError(\"Error closing input stream\", e); //$NON-NLS-1$\n \t\t\t\treturn null;\n \t\t\t}\n \t\t}\n \t\treturn content;\n \t}", "@Override\n public String getContent() throws FileNotFound, CannotReadFile\n {\n Reader input = null;\n try\n {\n input = new InputStreamReader(resource.openStream());\n String content = IOUtils.toString(input).replace(\"\\r\\n\", \"\\n\");\n\n return content;\n } catch (FileNotFoundException ex)\n {\n throw new FileNotFound();\n } catch (IOException ex)\n {\n throw new CannotReadFile();\n } finally\n {\n InternalUtils.close(input);\n }\n }", "public static String getStringFromFile(Context context, String filePath) throws IOException {\n final InputStream stream = context.getResources().getAssets().open(filePath);\n String ret = convertStreamToString(stream);\n stream.close();\n return ret;\n }", "private String getTextStructure (String path, String separator) {\r\n\t\tFile file = new File (path);\r\n\t\tBufferedReader input;\r\n\t\tString data = \"\", temp; \r\n\r\n\t\ttry {\r\n\t\t\tinput = new BufferedReader(new FileReader(file));\r\n\t\t\twhile ((temp = input.readLine())!= null) {\r\n\t\t\t\tdata += temp + separator;\r\n\t\t\t}\r\n\t\t\tinput.close();\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t\tcatch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "private String loadAsString(final String path) {\n try (InputStream inputStream = Thread.currentThread()\n .getContextClassLoader().getResourceAsStream(path)) {\n return new Scanner(inputStream).useDelimiter(\"\\\\A\").next();\n } catch (IOException e) {\n throw new RuntimeException(\"Unable to close input stream.\", e);\n }\n }", "public static String readFile(String filePath) throws java.io.IOException {\r\n\t\tStringBuffer fileData = new StringBuffer(1000);\r\n\t\tBufferedReader reader = new BufferedReader(new FileReader(filePath));\r\n\t\tchar[] buf = new char[1024];\r\n\t\tint numRead = 0;\r\n\t\twhile ((numRead = reader.read(buf)) != -1) {\r\n\t\t\tString readData = String.valueOf(buf, 0, numRead);\r\n\t\t\tfileData.append(readData);\r\n\t\t\tbuf = new char[1024];\r\n\t\t}\r\n\t\treader.close();\r\n\t\treturn fileData.toString();\r\n\t}", "private List<String> readFile(String path) throws IOException {\n return Files.readAllLines (Paths.get (path), StandardCharsets.UTF_8);\n }", "public String read(String path) throws IOException {\n Path destionationPath = new Path(path);\n\n FSDataInputStream inputStream = hdfs.open(destionationPath);\n String content = IOUtils.toString(inputStream);\n inputStream.close();\n return content;\n }", "public String getStringFile(){\n return fileView(file);\n }", "public String read() {\n\t\tStringBuffer text = new StringBuffer((int)file.length());\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader b = new BufferedReader(fr);\n\t\t\tboolean eof = false;\n\t\t\tString line;\n\t\t\tString ret = \"\\n\";\n\t\t\twhile (!eof) {\n\t\t\t\tline = b.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\teof = true;\n\t\t\t\t} else {\n\t\t\t\t\ttext.append(line);\n\t\t\t\t\ttext.append(ret);\n\t\t\t\t}\n\t\t\t}\n\t\t\tb.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"File \" + file.getName() +\n\t\t\t\t\" is unreadable : \" + e.toString());\n\t\t}\n\t\treturn text.toString();\n\t}", "public String readFile(String str) {\n\t\t FileReader fileReader;\n\t BufferedReader bufferedReader;\n\t StringBuilder text=new StringBuilder();\n\t \n\t try {\n\t fileReader = new FileReader(str);\n \t bufferedReader = new BufferedReader(fileReader);\n \t String line = null;\n\n \t while((line = bufferedReader.readLine()) != null) \n \t {\n text.append(line+\"\\n\");\n } \n \tbufferedReader.close();\n\t }\n\t \tcatch(FileNotFoundException ex) {\n\t System.out.println(\"Unable to open file '\" + str + \"'\"); \n\t \t}\n\t catch(IOException ex) {\n\t System.out.println(\"Error reading file '\"+ str + \"'\"); \n\t }\n\t catch(Exception ex) {\n\t System.out.println(\"Error \" + ex.getMessage() + \"'\");\n\t ex.printStackTrace();\n\t \n\t }\n\t \n\t\treturn text.toString();\n\t}", "SourceFilePath getFilePath();", "public static String readFileContent(String fileName){\r\n String str=null;\r\n BufferedReader reader=null;\r\n try {\r\n reader=new BufferedReader(new FileReader(fileName));\r\n str=reader.readLine();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }finally{\r\n if(reader!=null){\r\n try {\r\n reader.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n return str;\r\n }", "private String getFileContent(java.io.File fileObj) {\n String returned = \"\";\n try {\n java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader(fileObj));\n while (reader.ready()) {\n returned = returned + reader.readLine() + lineSeparator;\n }\n } catch (FileNotFoundException ex) {\n JTVProg.logPrint(this, 0, \"файл [\" + fileObj.getName() + \"] не найден\");\n } catch (IOException ex) {\n JTVProg.logPrint(this, 0, \"[\" + fileObj.getName() + \"]: ошибка ввода/вывода\");\n }\n return returned;\n }", "public String getString (String path) {\r\n\t\treturn getTextStructure(path, \"\");\r\n\t}", "private String getFileContent(){\n\t\tString employeesJsonString=\"\";\n\t\ttry {\n\t\t\tScanner sc = new Scanner(file);\n\t\t\twhile(sc.hasNextLine()){\n\t\t\t\temployeesJsonString += sc.nextLine();\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tSystem.out.println(\"file error\");\n\t\t}\n\t\treturn employeesJsonString;\n\t}", "private static String readFile(String file) throws IOException { //Doesn't work - possible error with FileReader\n //BufferedReader reader = new BufferedReader(new FileReader(file));\n //FileReader reader=new FileReader(file);\n\n\n FileReader file2 = new FileReader(file);\n System.out.println(\"Inside readFile\");\n BufferedReader buffer = new BufferedReader(file2);\n\n\n\n //String line = null;\n String line=\"\";\n\n StringBuilder stringBuilder = new StringBuilder();\n String ls = System.getProperty(\"line.separator\");\n try {\n while ((line = buffer.readLine()) != null) {\n System.out.println(line);\n stringBuilder.append(line);\n stringBuilder.append(ls);\n }\n return stringBuilder.toString();\n\n }finally{\n buffer.close();//https://stackoverflow.com/questions/326390/how-do-i-create-a-java-string-from-the-contents-of-a-file\n }\n /*Scanner scanner = null;\n scanner = new Scanner(file);\n StringBuilder stringBuilder = new StringBuilder();\n while (scanner.hasNextLine()) {\n String line = scanner.nextLine();\n stringBuilder.append(line);\n\n System.out.println(\"line: \"+line);\n }\n return stringBuilder.toString();*/\n\n }", "private static String readFile(File file) {\n String result = \"\";\n\n try (BufferedReader bufferedReader = new BufferedReader(\n new FileReader(file))) {\n result = bufferedReader.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return result;\n }" ]
[ "0.7473312", "0.7373801", "0.7329231", "0.7289841", "0.7270983", "0.72084075", "0.71340466", "0.7122798", "0.71216804", "0.70630324", "0.70300645", "0.7029518", "0.69593054", "0.69591975", "0.69394296", "0.6935471", "0.6922223", "0.6911777", "0.69116604", "0.6908381", "0.6897394", "0.68883556", "0.68596125", "0.6850537", "0.6850537", "0.6850537", "0.6823977", "0.67935926", "0.67862666", "0.67194307", "0.66944134", "0.6679634", "0.66637534", "0.6644731", "0.6641867", "0.662548", "0.6618253", "0.6586754", "0.6579635", "0.65573007", "0.65405905", "0.6523978", "0.65239537", "0.6511766", "0.6505885", "0.6497385", "0.64838696", "0.64765984", "0.64754695", "0.64650416", "0.64563304", "0.645456", "0.6435137", "0.6433786", "0.64303195", "0.6424865", "0.6423693", "0.6420565", "0.6419945", "0.64170545", "0.641534", "0.640591", "0.63976973", "0.6391108", "0.63894916", "0.63861805", "0.6358924", "0.63479114", "0.6324112", "0.6308598", "0.63024944", "0.6301639", "0.6276121", "0.62587726", "0.6255612", "0.6255522", "0.6255522", "0.62546396", "0.6253851", "0.62464374", "0.6243852", "0.62334466", "0.6231576", "0.62105703", "0.6194745", "0.6192379", "0.6188044", "0.6168538", "0.6161691", "0.6161434", "0.6157474", "0.6142722", "0.61258876", "0.6119177", "0.610567", "0.61021245", "0.60967726", "0.6088834", "0.60885054", "0.6068108" ]
0.7219636
5
/ O(N^2) Precondition: Path exists Postcondition: An ArrayList of Strings that includes the files with the inputted ending
public static void findFiles(String path, ArrayList<String> fileNames, String ending) { File directory = new File(path); File[] files = directory.listFiles(); for (File file : files) { if (file.isDirectory()) { findFiles(file.getAbsolutePath(), fileNames, ending); } else { String fileName = file.getPath(); if (fileName.endsWith(ending)) { fileNames.add(fileName); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void get_file_List() {\n\tString file_name=null;\r\n\tfor (int i = 0; i < listOfFiles.length; i++) \r\n\t {\r\n\t \r\n\t if (listOfFiles[i].isFile()) \r\n\t {\r\n\t\t file_name = listOfFiles[i].getName();\r\n\t if (file_name.endsWith(\".xml\") || file_name.endsWith(\".XML\"))\r\n\t {\r\n\t file_list.add(file_name) ;\r\n\t }\r\n\t }\r\n\t }\r\n\t\r\n}", "private List<String> scoutForFiles(FileType fileType, Path path) {\n\t\tfinal List<String> filesFound = new ArrayList<>();\n\n\t\t// Create a stream of Paths for the contents of the directory\n\t\ttry (Stream<Path> walk = Files.walk(path)) {\n\n\t\t\t// Filter the stream to find only Paths that match the filetype we are looking\n\t\t\tfilesFound.addAll(walk.map(x -> x.toString())\n\t\t\t\t.filter(f -> f.endsWith(fileType.suffix)).collect(Collectors.toList()));\n\t\t} catch (IOException e) {\n\t\t\tthrow new MessagePassableException(EventKey.ERROR_EXTERNAL_DIR_NOT_READABLE, e, path.toString());\n\t\t}\n\n\t\treturn filesFound;\n\t}", "private List<String> getNotComputedFilesPath(String absolutePath) {\r\n\t\tList<String> res = new ArrayList<String>();\r\n\t\tFile f = new File(absolutePath);\r\n\t\tString[] list = f.list();\r\n\t\t\r\n\t\tfor(String s : list) {\r\n\t\t\tString elemPath = AppUtil.createFilePath(new String[]{absolutePath, s});\r\n\t\t\tif(!s.contains(COMPUTED_FILES_FOLDER_NM)) {\r\n\t\t\t\tFile f2 = new File(elemPath);\r\n\t\t\t\tif(f2.isDirectory()) {\r\n\t\t\t\t\tres.addAll(getNotComputedFilesPath(elemPath));\r\n\t\t\t\t} else if(f2.isFile()) {\r\n\t\t\t\t\tres.add(elemPath);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn res;\r\n\t}", "private static String[] findFiles(String dirpath) {\n\t\tString fileSeparator = System.getProperty(\"file.separator\");\n\t\tVector<String> fileListVector = new Vector<String>();\n\t\tFile targetDir = null;\n\t\ttry {\n\t\t\ttargetDir = new File(dirpath);\n\t\t\tif (targetDir.isDirectory())\n\t\t\t\tfor (String val : targetDir.list(new JavaFilter()))\n\t\t\t\t\tfileListVector.add(dirpath + fileSeparator + val);\n\t\t} catch(Exception e) {\n\t\t\tlogger.error(e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\tString fileList = \"\";\n\t\tfor (String filename : fileListVector) {\n\t\t\tString basename = filename.substring(filename.lastIndexOf(fileSeparator) + 1);\n\t\t\tfileList += \"\\t\" + basename;\n\t\t}\n\t\tif (fileList.equals(\"\")) \n\t\t\tfileList += \"none.\";\n\t\tlogger.trace(\"Unpackaged source files found in dir \" + dirpath + fileSeparator + \": \" + fileList);\n\t\t\n\t\treturn (String[]) fileListVector.toArray(new String[fileListVector.size()]);\n\t}", "List<String> getFiles(String path) throws IOException;", "private static void getFiles(String root, Vector files) {\n Location f = new Location(root);\n String[] subs = f.list();\n if (subs == null) subs = new String[0];\n Arrays.sort(subs);\n \n // make sure that if a config file exists, it is first on the list\n for (int i=0; i<subs.length; i++) {\n if (subs[i].endsWith(\".bioformats\") && i != 0) {\n String tmp = subs[0];\n subs[0] = subs[i];\n subs[i] = tmp;\n break;\n }\n }\n \n if (subs == null) {\n LogTools.println(\"Invalid directory: \" + root);\n return;\n }\n \n ImageReader ir = new ImageReader();\n Vector similarFiles = new Vector();\n \n for (int i=0; i<subs.length; i++) {\n LogTools.println(\"Checking file \" + subs[i]);\n subs[i] = new Location(root, subs[i]).getAbsolutePath();\n if (isBadFile(subs[i]) || similarFiles.contains(subs[i])) {\n LogTools.println(subs[i] + \" is a bad file\");\n String[] matching = new FilePattern(subs[i]).getFiles();\n for (int j=0; j<matching.length; j++) {\n similarFiles.add(new Location(root, matching[j]).getAbsolutePath());\n }\n continue;\n }\n Location file = new Location(subs[i]);\n \n if (file.isDirectory()) getFiles(subs[i], files);\n else if (file.getName().equals(\".bioformats\")) {\n // special config file for the test suite\n configFiles.add(file.getAbsolutePath());\n }\n else {\n if (ir.isThisType(subs[i])) {\n LogTools.println(\"Adding \" + subs[i]);\n files.add(file.getAbsolutePath());\n }\n else LogTools.println(subs[i] + \" has invalid type\");\n }\n file = null;\n }\n }", "List<Path> getFiles();", "protected abstract ArrayList<String> getFileNamesByPath(\n\t\t\tfinal String path);", "public List<String> paths(String path) throws SystemException;", "List<String> getFiles(String path, String searchPattern) throws IOException;", "public abstract List<String> getFiles( );", "List<String> getFiles(String path, String searchPattern, String searchOption) throws IOException;", "public void listFiles(String path) {\r\n String files;\r\n File folder = new File(path);\r\n File[] listOfFiles = folder.listFiles();\r\n\r\n for (int i = 0; i < listOfFiles.length; i++) {\r\n\r\n if (listOfFiles[i].isFile()) {\r\n files = listOfFiles[i].getName();\r\n if (files.endsWith(\".png\") || files.endsWith(\".PNG\")\r\n || files.endsWith(\".gif\") || files.endsWith(\".GIF\")) {\r\n //System.out.println(files);\r\n pathList.add(path+\"\\\\\");\r\n fileList.add(files);\r\n }\r\n }\r\n \r\n else {\r\n listFiles(path+\"\\\\\"+listOfFiles[i].getName());\r\n }\r\n }\r\n }", "public static List<String> getFiles(String path) {\n\t try {\n\t\t\tURI uri = getResource(path).toURI();\n\t\t String absPath = getResource(\"..\").getPath();\n\t\t\tPath myPath;\n\t\t\tif (uri.getScheme().equals(\"jar\")) {\n\t\t\t FileSystem fileSystem = FileSystems.newFileSystem(uri, Collections.<String, Object>emptyMap());\n\t\t\t myPath = fileSystem.getPath(path);\n\t\t\t \n\t\t\t} else {\n\t\t\t myPath = Paths.get(uri);\n\t\t\t}\n\t\t\t\n\t\t\t List<String> l = Files.walk(myPath)\t\n\t\t\t \t\t\t\t\t .map(filePath -> pathAbs2Rel(absPath, filePath))\n\t\t\t \t .collect(Collectors.toList());\n\t\t\t return l;\n\t\t} catch (URISyntaxException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t return null;\n\t \n\t}", "private List<String> addPath(List<String> filenames, String additionalPath) {\n ArrayList<String> newFilenames = new ArrayList<String>(filenames.size());\n for (String filename : filenames) {\n newFilenames.add(additionalPath + '/' + filename);\n }\n\n return newFilenames;\n }", "boolean hasFilePath();", "private String checkFilename(String str){\n\n final ArrayList<String> values = new ArrayList<String>();\n File dir = new File(path);\n String[] list = dir.list();\n int num = 1;\n String origin = str;\n if (list != null) {\n while(Arrays.asList(list).contains(str+\".m4a\")){\n str = origin + String.format(\" %03d\", num);\n num+=1;\n }\n }\n return str;\n }", "static void searchFile( ) \r\n\t {\n\t\t\r\n\t\t File directoryPath = new File(\"D:\\\\java_project\");\r\n\t File filesList[] = directoryPath.listFiles();\r\n\t\t Scanner file = new Scanner(System.in);\r\n System.out.println(\"Enter a file name\");\r\n String newfilename = file.next();\r\n\t\t File f = new File( \"D:\\\\java_project\\\\\"+file+\".txt\");\r\n\t boolean fileound=false;\r\n\t\t for(File file1:filesList)\r\n\t\t {\r\n\t\t \t File tempFile = new File(\"D:\\\\java_project\\\\\"+newfilename+\".txt\");\r\n\t\t\t boolean exists = tempFile.exists();\r\n\t\t\t\r\n\t\t \t if(exists)\r\n\t\t \t{\r\n\t\t\t\t fileound = true;\r\n\t\t\t\t\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t }\r\n\t\t }\r\n\t\t if(fileound)\r\n\t\t {\r\n\t\t\t System.out.println(\"File found\");\t\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t System.out.println(\"File not found\");\r\n\t\t }\r\n\t\t\r\n\t }", "protected ArrayList<Path> find(Path file) {\n\t\tPath name = file.getFileName();\n\t\tif (name != null && matcher.matches(name)) {\n\t\t\tresults.add(file);\n\t\t}\n\t\treturn null;\n\t}", "public List<File> getFiles(List<String> stringlist);", "private File getMatchingFile(String fileName){\n debug(\"matching file: \"+fileName);\n StringBuffer filePath = new StringBuffer();\n filePath.append(rootDir.getAbsolutePath());\n filePath.append(File.separator);\n String compPath = fileName.replace('\\\\', '/'); \n Iterator it = files.iterator(); \n while(it.hasNext()){\n String rawPath = (String)it.next();\n String path = rawPath.replace('\\\\', '/');\n debug(\"path:\"+path); \n if(getFile(rawPath).isDirectory()){\n //check if path ends with the same name as fileName starts\n int rawIndex = path.lastIndexOf('/');\n String rawEnd = path.substring(rawIndex+1);\n debug(\"rawend:\"+rawEnd);\n int compIndex = compPath.indexOf('/');\n String compStart;\n if (compIndex < 0) {\n compStart = \".\";\n } else {\n compStart = compPath.substring(0,compIndex);\n }\n if(rawEnd.equals(compStart)){\n debug(\"equals\");\n filePath.append(path);\n if (compIndex >= 0) filePath.append(compPath.substring(compIndex));\n break;\n }\n }else{\n if(path.endsWith(compPath)){\n filePath.append(path);\n break;\n }\n }\n }\n debug(\"matching file result:\"+filePath.toString());\n return new File(filePath.toString());\n }", "private String[] findFiles(String dirName, String suffix)\r\n {\r\n File dir = new File(dirName);\r\n if(dir.isDirectory()) {\r\n String[] allFiles = dir.list();\r\n if(suffix == null) {\r\n return allFiles;\r\n }\r\n else {\r\n List<String> selected = new ArrayList<String>();\r\n for(String filename : allFiles) {\r\n if(filename.endsWith(suffix)) {\r\n selected.add(filename);\r\n }\r\n }\r\n return selected.toArray(new String[selected.size()]);\r\n }\r\n }\r\n else {\r\n System.out.println(\"Error: \" + dirName + \" must be a directory\");\r\n return null;\r\n }\r\n }", "public List listFiles(String path);", "private boolean allSourcePathsExist(List<String> sourcePath) {\n\t\tfor (Iterator<String> ii = sourcePath.iterator(); ii.hasNext();) {\n\t\t\tString dirName = ii.next();\n\t\t\tFile dir = new File(getDirectory().getAbsolutePath() + \"/\"\n\t\t\t\t\t+ dirName);\n\t\t\tif (!dir.exists())\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private List<String> processDirectory(Path path) {\n\t\treturn null;\r\n\t}", "private static File[] filesMiner(String path) {\n try {\n File directoryPath = new File(path);\n FileFilter onlyFile = new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n return pathname.isFile();\n }\n }; // filter directories\n return directoryPath.listFiles(onlyFile);\n } catch (Exception e) {\n System.err.println(UNKNOWN_ERROR_WHILE_ACCESSING_FILES);\n return null;\n }\n\n }", "private static void joinFiles(String mainPath, ArrayList<File> oldFiles){\n FileFilter jsonFilter = new FileFilter() {\r\n public boolean accept(File path) {\r\n return path.getName().endsWith(\".json\");\r\n }\r\n };\r\n\r\n //contains all files in path\r\n File fileMain = new File(mainPath);\r\n File[] fileList = fileMain.listFiles();\r\n boolean checkedPath = false;\r\n\r\n if(fileList!=null){\r\n for(File fileTemp: fileList){\r\n //checkedPath makes sure JSON files are not cloned\r\n if(fileTemp.isFile() && checkedPath == false){\r\n //adds the JSON files found to arraylist\r\n File file = new File(mainPath);\r\n File[] jsonList = file.listFiles(jsonFilter);\r\n for(File temp: jsonList){\r\n oldFiles.add(temp);\r\n }\r\n checkedPath = true;\r\n }\r\n //if file found is a folder, recursively searches until JSON file is found\r\n else if(fileTemp.isDirectory()){\r\n joinFiles(fileTemp.getAbsolutePath(), oldFiles);\r\n }\r\n }\r\n }\r\n }", "private void producePaths(ArrayList<String> produced){\n for(int i = 0; i < paths.size(); i++){\n for(String k : produced){\n if(paths.get(i)[0].equals(k) && currentLocation.getLocationName().equals(paths.get(i)[1])){\n String[] newPath = {currentLocation.getLocationName(), k};\n if(checkPathDosentAlraedyExist(newPath)) {\n paths.add(newPath);\n }\n }\n }\n }\n }", "protected List<String> getFileNames(@NonNull ConfigQuery query, @NonNull T context) {\n val paths = interpolateVarStrings(getPaths(), query);\n log.trace(\"{} retrieving filenames for paths: {}\", this, paths);\n return paths.stream()\n .flatMap(name -> maybeListDirectory(name, context))\n .distinct()\n .collect(Collectors.toList());\n }", "@Test\n public void testGetFilesList() {\n System.out.println(\"getFilesList from existing folder with existing subfiles\");\n String entryPath = folder.toString()+fSeparator+\"Images\";\n FilesDao instance = new FilesDao();\n String[] expResult = new String[2];\n expResult[0] = \"testImg.jpg\";\n expResult[1] = \"testImg2.jpg\";\n String[] result;\n try{\n result = instance.getFilesList(entryPath);\n }catch(EntryException ex){\n result = null;\n }\n assertArrayEquals(expResult, result);\n }", "public String listPath(List<String> arg) {\n String output = \"\";\n for (int path = 0; path < arg.size(); path++) {\n Directory tDir = Directory.getDir(arg.get(path));\n if (tDir == null) {\n output +=\n \"Error: The input path \" + arg.get(path) + \" doesn't exist!\\n\\n\";\n } else if (tDir.isFile) {\n output += tDir.getName();\n } else {\n for (int j = 0; j < tDir.getSubContent().size(); j++) {\n if (!tDir.getSubContent().get(j).isFile) {\n output += tDir.getSubContent().get(j).getName();\n Directory dir = tDir.getSubContent().get(j);\n if (!dir.getSubContent().isEmpty()) {\n output += \" : \";\n for (int k = 0; k < tDir.getSubContent().get(j).getSubContent()\n .size(); k++) {\n if (k != tDir.getSubContent().get(j).getSubContent().size()\n - 1) {\n output += tDir.getSubContent().get(j).getSubContent().get(k)\n .getName() + \", \";\n } else {\n output += tDir.getSubContent().get(j).getSubContent().get(k)\n .getName() + \"\\n\";\n }\n }\n } else {\n output += \"\\n\";\n }\n } else {\n output += tDir.getSubContent().get(j).getName() + \"\\n\";\n }\n }\n }\n }\n return output;\n }", "public ArrayList<File> getFileList(File file){\r\n\t\tFile dir = new File(file.getParent());\r\n\t\r\n\t\tString filename = file.getName();\r\n\t\t//get all files with the same beginning and end\r\n\t\tint index = filename.indexOf(\"Version\");\r\n\t\tString stringStart = filename.substring(0, index-1);\r\n\t\t\r\n\t\tArrayList<File> files = new ArrayList<File>();\r\n\t\t\r\n\t\tfor(File f:dir.listFiles()){\r\n\t\t\tif(f.getName().contains(stringStart))files.add(f);\r\n\t\t}\r\n\t\t\r\n\t\treturn files;\t\r\n\t}", "public List<List<String>> findDuplicate(String[] paths) {\n final Map<String, List<File>> map = new HashMap<>();\n\n for (String path : paths) {\n final List<File> fileList = parse(path);\n for (File file : fileList) {\n if (!map.containsKey(file.content)) map.put(file.content, new LinkedList<>());\n map.get(file.content).add(file); \n }\n }\n\n final List<List<String>> result = new LinkedList<>();\n for (String content : map.keySet()) {\n final List<File> files = map.get(content);\n if (files.size() == 1) continue;\n\n final List<String> fileList = files.stream().map(File::fullPath).collect(Collectors.toList());\n result.add(fileList);\n }\n return result;\n }", "private String[] nlstHelper(String args) {\n // Construct the name of the directory to list.\n String filename = currDirectory;\n if (args != null) {\n filename = filename + fileSeparator + args;\n }\n\n // Now get a File object, and see if the name we got exists and is a\n // directory.\n File f = new File(filename);\n\n if (f.exists() && f.isDirectory()) {\n return f.list();\n } else if (f.exists() && f.isFile()) {\n String[] allFiles = new String[1];\n allFiles[0] = f.getName();\n return allFiles;\n } else {\n return null;\n }\n }", "public List<String> getFiles();", "public void testFindFilesForLocation() {\n \t\t//should not find the workspace root\n \t\tIWorkspaceRoot root = getWorkspace().getRoot();\n \t\tIFile[] result = root.findFilesForLocation(root.getLocation());\n \t\tassertEquals(\"1.0\", 0, result.length);\n\t\t\n\t\tIProject project = root.getProject(\"p1\");\n\t\tIFile existing = project.getFile(\"file1\");\n\t\tensureExistsInWorkspace(existing, true);\n\t\t\n\t\t//existing file\n\t\tresult = root.findFilesForLocation(existing.getLocation());\n\t\tassertResources(\"2.0\", existing, result);\n\t\t\n\t\t//non-existing file\n\t\tIFile nonExisting = project.getFile(\"nonExisting\");\n\t\tresult = root.findFilesForLocation(nonExisting.getLocation());\n\t\tassertResources(\"2.1\", nonExisting, result);\n \n \t\t// TODO add more tests\n \t}", "private ArrayList<String> checkSubDir(ArrayList<String> paths) {\n ArrayList<String> finalPaths;\n finalPaths = (ArrayList<String>) paths.clone();\n for (int i = 0; i < paths.size(); i++) {\n if (!checkValidity(paths.get(i))) {\n finalPaths.remove(paths.get(i));\n continue;\n }\n for (int j = i + 1; j < paths.size(); j++)\n if (paths.get(j).contains(paths.get(i))) {\n finalPaths.remove(paths.get(j));\n }\n }\n return finalPaths;\n }", "public String addDataDir(String path) {\n ArrayList<File> dataDir = getDataDirectories();\n\n String tmp = \"These are paths to be indexed.\\n\";\n\n //Check input(s).\n if (path.isEmpty() || path.length() == 0) return \"Input error.\";\n\n //Split a string into many paths with ';'\n String[] paths = path.split(\";\");\n\n for (String dir : paths) {\n Path dir_path = Paths.get(dir);\n if (Files.exists(dir_path)) {\n if (!contains(dataDir, dir_path)) { //If path hasn't been added.\n dataDir.add(dir_path.toFile()); //Add a path into a list of directory to be indexed.\n watchDir(dir_path);\n tmp += dir_path.toString() + \"\\n\";\n } else {\n tmp += dir + \" is already added.\\n\";\n logger.info(dir + \" is a duplicated path.\");\n }\n } else {\n tmp += dir + \" is an incorrect path, Please enter an exist path.\\n\";\n logger.warning(dir + \" is an incorrect path, Please enter an exist path.\");\n }\n }\n return tmp; //Report back what path had been added.\n }", "public boolean isContainFile(String input){\n\t\tfor(int i = 0;i<filenames.size();i++){\n\t\t\tif(filenames.get(i).equals(input)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean isExistingFile(String filename, String[] array)\n\t{\n\t\tfor (String temp : array)\n\t\t{\n\t\t\tif (temp.equals(filename) == true)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "List<File> list(String directory) throws FindException;", "public String[] GetAllFileNames() {\n \tFile dir = new File(fileStorageLocation.toString());\n \tString[] matchingFiles = dir.list(new FilenameFilter() {\n \t public boolean accept(File dir, String name) {\n \t return name.startsWith(\"1_\");\n \t }\n \t});\n \t\n \tfor (int i=0; i < matchingFiles.length; i++)\n \t{\n \t\tmatchingFiles[i] = matchingFiles[i].replaceFirst(\"1_\", \"\");\n \t}\n \t\n return matchingFiles;\n }", "public abstract List<String> path();", "public static File searchPaths(Iterable<? extends File> paths, String relFile) {\n for (File path : paths) {\n File f = new File(path, relFile);\n if (f.exists()) {\n return path;\n }\n }\n return null;\n }", "public static List<String> getFile(String path){\n File file = new File(path);\n // get the folder list\n File[] array = file.listFiles();\n\n List<String> fileName = new ArrayList<>();\n\n for(int i=0;i<array.length;i++){\n if(array[i].isFile()){\n // only take file name\n fileName.add(array[i].getName());\n }else if(array[i].isDirectory()){\n getFile(array[i].getPath());\n }\n }\n return fileName;\n }", "private static String files()\n\t{\n\t\tString path = dirpath + \"\\\\Server\\\\\";\n\t\tFile folder = new File(path);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tString msg1 = \"\";\n\n\t\tfor (int i = 0; i < listOfFiles.length; i++)\n\t\t{\n\t\t\tif (listOfFiles[i].isFile())\n\t\t\t{\n\t\t\t\tmsg1 = msg1 + \"&\" + listOfFiles[i].getName();\n\t\t\t}\n\t\t}\n\t\tmsg1 = msg1 + \"#\" + path + \"\\\\\";\n\t\treturn msg1;\n\t}", "private List<String> getFiles(String path){\n workDir = Environment.getExternalStorageDirectory().getAbsolutePath() + path;\n List<String> files = new ArrayList<String>();\n File file = new File(workDir);\n File[] fs = file.listFiles();\n for(File f:fs)\n if (f.isFile())\n files.add(String.valueOf(f).substring(workDir.length()));\n return files;\n }", "@Test\n public void testGetSubFiles() {\n System.out.println(\"getSubFiles from Existing path with 2 images\");\n String path = folder.toString()+fSeparator+\"Images\";\n FilesDao instance = new FilesDao();\n \n File firstImageFile = new File(path+fSeparator+\"testImg.jpg\");\n File secondImageFile = new File(path+fSeparator+\"testImg2.jpg\");\n List<URI> expResult = new ArrayList<URI>();\n expResult.add(firstImageFile.toURI());\n expResult.add(secondImageFile.toURI());\n List<URI> result;\n try{\n result = instance.getSubFiles(path);\n }catch(EntryException ex){\n result = null;\n }\n assertEquals(\"Some message\",expResult, result);\n }", "private File[] listFiles(File dir, final String name2) {\n File[] files = dir.listFiles(new FilenameFilter() {\n @Override\n public boolean accept(File dir, String name) {\n return name.startsWith(name2);\n }\n });\n return files != null ? files : new File[0];\n }", "private static void getAllFilesFromGivenPath(String path, List<String> fileNames) {\n try {\n DirectoryStream<Path> directoryStream = Files.newDirectoryStream(Paths.get(path));\n for (Path paths : directoryStream) {\n fileNames.add(paths.toString());\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "private void addPackageDirFiles(WebFile aDir, List aList)\n{\n boolean hasNonPkgFile = false;\n for(WebFile child : aDir.getFiles())\n if(child.isDir() && child.getType().length()==0)\n addPackageDirFiles(child, aList);\n else hasNonPkgFile = true;\n if(hasNonPkgFile || aDir.getFileCount()==0) aList.add(aDir);\n}", "private void seekBy() {\n Queue<File> queue = new LinkedList<>();\n queue.offer(new File(root));\n while (!queue.isEmpty()) {\n File file = queue.poll();\n File[] list = file.listFiles();\n if (file.isDirectory() && list != null) {\n for (File tempFile : list) {\n queue.offer(tempFile);\n }\n } else {\n if (args.isFullMatch() && searchingFile.equalsIgnoreCase(file.getName())) {\n result.add(file);\n }\n if (args.isMask() && searchingFile.replaceAll(\"\\\\*\", \".*\").equalsIgnoreCase(file.getName())) {\n result.add(file);\n }\n if (args.isRegex() && file.getName().matches(args.getName())) {\n result.add(file);\n }\n }\n }\n this.writeLog(output, result);\n }", "public static File[] findFiles(String fileName) {\n List<File> fileList_ = new ArrayList<File>();\n if(fileRepoPath_ != null)\n listFiles(new File(fileRepoPath_),fileName, fileList_);\n if(fileList_.size()==0) {\n try {\n \t Enumeration<URL> en_ = FileFinder.class.getClassLoader().getResources(fileName);\n \t while(en_.hasMoreElements()) {\n \t fileList_.add(new File(en_.nextElement().getFile().replaceAll(\"%20\",\" \")));\n \t }\n \t } \n \t catch(IOException e) { }\n }\n \treturn (File[])fileList_.toArray(new File[fileList_.size()]);\n }", "@Override\n public String getFileList() {\n StringBuilder string = null;\n //if (parentFile.isDirectory()) {\n File parentFile = currentDir;\n string = new StringBuilder();\n for (File childFile : parentFile.listFiles()) {\n try {\n //TODO: Verify that Paths.get() is retrieving a valid path relative to the project's location.\n Path file = Paths.get(childFile.getPath());\n\n BasicFileAttributes attr = Files.readAttributes(file, BasicFileAttributes.class);\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"M\");\n String month = dateFormat.format(attr.creationTime().toMillis());\n dateFormat.applyPattern(\"d\");\n String dayOfMonth = dateFormat.format(attr.creationTime().toMillis());\n dateFormat.applyPattern(\"y\");\n String year = dateFormat.format(attr.creationTime().toMillis());\n\n char fileType = childFile.isDirectory() ? 'd' : '-'; //'-' represents a file.\n string.append(String.format(\"%srw-r--r--\", fileType)); //Linux style permissions\n string.append(\"\\t\");\n string.append(\"1\"); //?\n string.append(\" \");\n string.append(\"0\"); //?\n string.append(\"\\t\");\n string.append(\"0\"); //?\n string.append(\"\\t\");\n string.append(childFile.length()); //Length\n string.append(\" \");\n string.append(month); //Month\n string.append(\" \");\n string.append(dayOfMonth); //Day\n string.append(\" \");\n string.append(\" \");\n string.append(year); //Year\n string.append(\" \");\n string.append(childFile.getName());\n string.append(System.getProperty(\"line.separator\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n //}\n\n String format = \"%S\\t%d %d\\t%d\\t%d %S %d %d %S\";\n //return \"-rw-r--r-- 1 0 0 1073741824000 Feb 19 2016 1000GB.zip\";\n if (!string.equals(null)) {\n return string.toString();\n } else {\n return \"Error when creating file list.\";\n }\n }", "public String[] listFiles() throws FileSystemUtilException \r\n\t{\r\n\t\tString remoteDir = null;\r\n\t\tString remoteFileName = null;\r\n\t\tString command = null;\r\n\t\tint signal = -1;\r\n\t\tlogger.debug(\"Begin: \"+getClass().getName()+\":listFiles()\");\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tconnect(); \r\n\t\t\t\r\n\t\t\tint lastSeperatorIndex = -1;\r\n\t\r\n\t\t\tif(remoteFilePath.lastIndexOf(\"/\") != -1){\r\n\t\t\t\tlastSeperatorIndex = remoteFilePath.lastIndexOf(\"/\");\r\n\t\t\t}else if(remoteFilePath.lastIndexOf(\"\\\\\") != -1){\r\n\t\t\t\tlastSeperatorIndex = remoteFilePath.lastIndexOf(\"\\\\\");\r\n\t\t\t}\r\n\t\t\tif(lastSeperatorIndex == remoteFilePath.length()-1)\r\n\t\t\t{\r\n\t\t\t\tremoteDir = remoteFilePath;\r\n\t\t\t\tremoteFileName = \"\";\r\n\t\t\t\tlogger.debug(\"file path ends with / - directory is \"+remoteDir+\" , filename is \"+remoteFileName);\r\n\t\t\t\tcommand = \"cd \"+remoteDir;\t\t\t\r\n\t\t\t\tsignal = executeSimpleCommand(command);\r\n\t\r\n\t\t\t\tif(signal != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t//invlid directory/file\r\n\t\t\t\t\tthrow new FileSystemUtilException(\"ET0017\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tremoteDir = remoteFilePath.substring(0,lastSeperatorIndex+1);\r\n\t\t\t\tremoteFileName = remoteFilePath.substring(lastSeperatorIndex+1,remoteFilePath.length());\r\n\t\t\t\tlogger.debug(\"file path not ends with / - directory is \"+remoteDir+\" , filename is \"+remoteFileName);\r\n\t\t\t\tcommand = \"cd \"+remoteDir;\r\n\t\t\t\tsignal = executeSimpleCommand(command);\r\n\t\t\t\tif(signal != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t//invlid directory/file\r\n\t\t\t\t\tthrow new FileSystemUtilException(\"ET0017\");\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tif(!remoteFileName.startsWith(\"*.\") && !remoteFileName.endsWith(\".*\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tlogger.debug(\"file/directory name \"+remoteFileName+\" not started with *. or ends wirh .*\");\r\n\t\t\t\t\tcommand = \"cd \"+remoteDir+remoteFileName;\r\n\t\t\t\t\tsignal = executeSimpleCommand(command);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\tif(signal != 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tboolean isFile = false;\r\n\t\t\t\t\t\tcommand = \"ls \"+remoteDir;\r\n\t\t\t\t\t\texecuteSimpleCommand(command);\r\n\t\t\t\t\t\tString[] tempFileNames = getFileNamesArray(output);\r\n\t\t\t\t\t\tfor(int j = 0; j < tempFileNames.length; j++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(remoteFileName.equals(tempFileNames[j]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tisFile = true;\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(!isFile)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//invlid directory/file\r\n\t\t\t\t\t\t\tthrow new FileSystemUtilException(\"ET0017\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlogger.debug(remoteFileName+\" is a file\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlogger.debug(remoteFileName+\" is a directory\");\r\n\t\t\t\t\t\tremoteDir = remoteDir+remoteFileName;\r\n\t\t\t\t\t\tremoteFileName = \"\";\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlogger.debug(\"Before getting list of files : current dir \"+remoteDir+\" getting files list for \"+remoteFileName);\r\n\t\t\tcommand = \"cd \"+remoteDir+\";ls -F \"+remoteFileName;\r\n\t\t\tsignal = executeSimpleCommand(command);\r\n\t\t\tdisconnect();\r\n\t\t\tif(signal != 0)\r\n\t\t\t{\t\t\t \r\n\t\t\t\tthrow new FileSystemUtilException(\"ET0017\");\r\n\t\t\t}\r\n\t\t\tString[] filesList = getFileNamesArray(output);\t\t\r\n\t\t\tlogger.debug(\"End: \"+getClass().getName()+\":listFiles()\");\r\n\t\t\treturn filesList;\r\n\t\t}\r\n\t\t\r\n\t\tcatch(FileSystemUtilException e)\r\n\t\t{\r\n\t\t disconnect();\r\n\t\t if(e.getMessage() != null && e.getMessage().equals(\"FL0071\")){\r\n\t\t \tthrow new FileSystemUtilException(\"FL0071\");\r\n\t\t }\r\n\t\t\tthrow new FileSystemUtilException(e.getErrorCode(),e.getException());\r\n\t\t}\r\n\t\t\r\n\t}", "private void searchDFS(File[] files, ArrayList<String> list) {\n\n\t\tfor (File file : files) {\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tif (file.getAbsolutePath().endsWith(GIT)) {\n\t\t\t\t\tgitDir = file.getAbsolutePath();\n\t\t\t\t}\n\t\t\t\tsearchDFS(file.listFiles(), list);\n\t\t\t} else {\n\t\t\t\tif (file.getName().endsWith(EXTENSION)) {\n\t\t\t\t\tlist.add(file.getAbsolutePath());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static List<String> scanFileNamesInArchive(InputStream in)\r\n\t\t\tthrows IOException {\r\n\r\n\t\tfinal List<String> back = new ArrayList<String>();\r\n\r\n\t\tJarInputStream jin = new JarInputStream(in);\r\n\t\tZipEntry entry = jin.getNextEntry();\r\n\t\twhile (entry != null) {\r\n\r\n\t\t\tString fileName = entry.getName();\r\n\t\t\tif (fileName.charAt(fileName.length() - 1) == '/') {\r\n\t\t\t\tfileName = fileName.substring(0, fileName.length() - 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (fileName.charAt(0) == '/') {\r\n\t\t\t\tfileName = fileName.substring(1);\r\n\t\t\t}\r\n\r\n\t\t\tif (File.separatorChar != '/') {\r\n\t\t\t\tfileName = fileName.replace('/', File.separatorChar);\r\n\t\t\t}\r\n\r\n\t\t\tif (!entry.isDirectory()) {\r\n\t\t\t\tback.add(fileName);\r\n\t\t\t}\r\n\r\n\t\t\tentry = jin.getNextEntry();\r\n\t\t}\r\n\t\tjin.close();\r\n\t\treturn back;\r\n\t}", "public void addPath(File path) throws IllegalArgumentException {\r\n File[] PathFiles;\r\n if (path.isDirectory() == true) {\r\n \tPathFiles = path.listFiles();\r\n for (int i=0; i<PathFiles.length; i++) {\r\n \tFile currentfile = PathFiles[i];\r\n if (currentfile.isDirectory()) {\r\n \tdirectory_queue.enqueue(currentfile);\r\n \taddPath(currentfile);\r\n }\r\n }\r\n } else {\r\n throw new IllegalArgumentException(\"Can't resolve the directory path \" + path);\r\n }\r\n }", "public static boolean file_list_exists(String filename) {\n boolean exists = true;\n\n try {\n\n FileInputStream fstream = new FileInputStream(\"textfile.txt\");\n DataInputStream in = new DataInputStream(fstream);\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String strLine;\n while ((strLine = br.readLine()) != null) {\n File f = new File(strLine);\n if (f.exists() == false) {\n exists = false;\n }\n }\n in.close();\n } catch (Exception e) {//Catch exception if any\n e.printStackTrace();\n }\n return exists;\n }", "private boolean contains(ArrayList<File> dataDir, Path path) {\n //File path_dir = new File(path.toString());\n File path_dir = path.toFile();\n for (File dir : dataDir) {\n try {\n if (Files.isSameFile(path_dir.toPath(), dir.toPath())) return true;\n } catch (IOException e) {\n logger.warning(\"Cannot check isSameFile with \" + path_dir.toPath() + \", \" +\n dir.toPath());\n }\n }\n return false;\n }", "@Test\n public void testMatchesAny() {\n\n Set<PathMatcher> patterns = new HashSet<PathMatcher>() {\n {\n add(FileUtil.matcherForGlobExpression(\"/notADir1\"));\n add(FileUtil.matcherForGlobExpression(\"/notADir2\"));\n }\n };\n\n Assertions.assertThat(FileUtil.matchesAny(FOLDER, patterns)).isFalse();\n\n patterns.add(FileUtil.matcherForGlobExpression(FOLDER.toString()));\n\n Assertions.assertThat(FileUtil.matchesAny(FOLDER, patterns)).isTrue();\n }", "public void filesNotFound(File... f) { }", "public void filesNotFound(File... f) { }", "public static List<String> getFilesFromDirectory(){\n File wordTextFolder = new File(FOLDER_OF_TEXT_FILES.toString());\n File[] filesInsideFolder = wordTextFolder.listFiles();\n List<String> paths = new ArrayList<>();\n String name;\n\n for (File txtFile : filesInsideFolder){\n paths.add( txtFile.getPath() );\n name = txtFile.getName();\n name = name.substring(0, name.lastIndexOf('.'));\n\n if(name.length() > Table.maxFileNameLength){\n Table.setMaxFileNameLength(name.length());\n }\n }\n return paths;\n }", "public ArrayList<ArrayList<String>> readthePathOfMusicFiles()\n {\n File file = new File(path);\n String[] names = file.list();// all directories inside dataset1 direcory\n ArrayList<ArrayList<String>> pathOfMusicFiles = new ArrayList<>();\n String artistName = \"\";\n String trackName = \"\";\n Mp3File song = null;\n for (int i = 0; i < names.length; i++) \n {\n File file1 = new File(path + '/' + names[i]);\n if (file1.isDirectory())\n {\n String[] fileNames = file1.list();\n for (String fileName : fileNames)// all files in directory\n {\n if (fileName.contains(\".mp3\") && !(fileName.charAt(0) == '.'))\n {\n try\n {\n song = new Mp3File(path + '/' + names[i] + '/' + fileName);\n }\n catch (UnsupportedTagException | InvalidDataException | IOException e)\n {\n e.printStackTrace();\n }\n if(song!=null && song.hasId3v1Tag())\n {\n ID3v1 id3v1Tag = song.getId3v1Tag();\n artistName = id3v1Tag.getArtist();\n trackName = id3v1Tag.getTitle();\n }\n if(song!=null && song.hasId3v2Tag())\n {\n ID3v2 id3v2tag = song.getId3v2Tag();\n artistName = id3v2tag.getArtist();\n trackName = id3v2tag.getTitle();\n }\n if(artistName != null && artistName.length() >= 1 && trackName != null && artistName.length() >= 1)\n {\n if(artistName.charAt(0) >= startChar && artistName.charAt(0) <= endChar)\n {\n ArrayList<String> songAttributes = new ArrayList<>();\n songAttributes.add(path + '/' + names[i] + '/' + fileName);\n songAttributes.add(artistName);\n songAttributes.add(trackName);\n pathOfMusicFiles.add(songAttributes);\n }\n }\n }\n }\n }\n }\n return pathOfMusicFiles;\n }", "private static ArrayList<String> getImagesInFileSystem() {\n\t\t// get file list in database\n\t\tArrayList<String> fileNameList = new ArrayList<String>();\n\t\t\n\t\tFile folder = new File(IMAGE_DIRECTORY);\n\t File[] listOfFiles = folder.listFiles();\n\t \n\t for (File currFile : listOfFiles) {\n\t if (currFile.isFile() && !currFile.getName().startsWith(\".\")) {\n\t \t fileNameList.add(currFile.getName());\n\t }\n\t }\n\t \n\t return fileNameList;\n\t}", "public static String[] getFilePaths(String path, String parameter){\n\t\tString[] filePaths=null;\n\t\tif(parameter.trim().equals(\"-f\")){\n\t\t\tfilePaths=new String[1];\n\t\t\tfilePaths[0]=path;\n\t\t}\n\t\telse if(parameter.trim().equals(\"-d\")){\n\t\t\tfilePaths=new File(path).list();\n\t\t\tif(filePaths==null){\n\t\t\t\tfilePaths=new String[0];\n\t\t\t}\n\t\t\tString[] tmp=new String[filePaths.length];\n\t\t\tfor(int i=0;i<tmp.length;i++){\n\t\t\t\ttmp[i]=path+'/'+filePaths[i];\n\t\t\t}\n\t\t\tfilePaths=tmp;\n\t\t}\n\t\treturn filePaths;\n\t}", "private static List<String[]> process(String[] files) {\n String path = files[0];\n List<String[]> list = new ArrayList<String[]>();\n for (int i = 1, j = 0; i < files.length; i++) {\n String name = files[i];\n for (j = 0; j < name.length(); j++) {\n if (name.charAt(j) == '('){\n break;\n }\n }\n list.add(new String[]{path+\"/\"+name.substring(0, j), name.substring(j+1, name.length() - 1)});\n }\n \n return list;\n }", "protected static Path[] globInternal(Path folderOrFile, FileSystem fs) throws IOException {\n\t\tPath input = folderOrFile;\n\t\tPath[] files;\n\t\t\n\t\tif (fs != null && fs.exists(input)) {\n\t\t\tif (fs.isDirectory(input)) {\n\t\t\t\tinput = new Path(input.toUri().toString() + \"/part-*\");\n\t\t\t\tFileStatus[] fStatus= fs.globStatus(input);\n\t\t\t\tfiles = FileUtil.stat2Paths(fStatus);\n\t\t\t} else {\n\t\t\t\tPath[] temp = {input};\n\t\t\t\tfiles = temp;\n\t\t\t}\n\t\t\treturn files;\n\t\t} else\n\t\t\treturn null;\n\t}", "private static String combine(final String... path) {\n File file = new File(path[0]);\n for (int i = 1; i < path.length; i++) {\n file = new File(file, path[i]);\n }\n return file.getPath();\n }", "ArrayList<File> findSong(File file) {\n ArrayList<File> arrayList = new ArrayList<>();\n\n File[] files = file.listFiles();\n for (File singleFile : files) {\n if (singleFile.isDirectory() && !singleFile.isHidden()) {\n arrayList.addAll(findSong(singleFile));\n } else {\n if (singleFile.getName().endsWith(\".mp3\") || singleFile.getName().endsWith(\".wva\")) {\n arrayList.add(singleFile);\n }\n }\n }\n return arrayList;\n }", "private static void getFile(String path){\n File file = new File(path); \r\n // get the folder list \r\n File[] array = file.listFiles();\r\n // flag = array.length;\r\n \r\n for(int i=0;i<array.length;i++){ \r\n if(array[i].isFile()){ \r\n // only take file name \r\n //System.out.println(\"^^^^^\" + array[i].getName()); \r\n // take file path and name \r\n //System.out.println(\"#####\" + array[i]); \r\n // take file path and name \r\n System.out.println(\"*****\" + array[i].getPath()); \r\n\t\t\tcalculate_Ave(array[i].getPath());\r\n } \r\n }\r\n}", "static public Vector<File> searchDateFiles(File dir, Date beginDate, Date endDate, String prefix) {\n\n\t\tVector<File> toReturn=new Vector<File>();\n\n\t\t// if directory ha files \n\t\tif(dir.isDirectory() && dir.list()!=null && dir.list().length!=0){\n\n//\t\t\tserach only files starting with prefix\n\n\t\t\t// get sorted array\n\t\t\tFile[] files=getSortedArray(dir, prefix);\n\n\t\t\tif (files == null){\n\t\t\t\tthrow new SpagoBIServiceException(SERVICE_NAME, \"Missing files in specified interval\");\n\t\t\t}\n\n\t\t\t// cycle on all files\n\t\t\tboolean exceeded = false;\n\t\t\tfor (int i = 0; i < files.length && !exceeded; i++) {\n\t\t\t\tFile childFile = files[i];\n\n\t\t\t\t// extract date from file Name\n\t\t\t\tDate fileDate=null;\n\t\t\t\ttry {\n\t\t\t\t\tfileDate = extractDate(childFile.getName(), prefix);\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\tlogger.error(\"error in parsing log file date, file will be ignored!\",e);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// compare beginDate and timeDate, if previous switch file, if later see end date\n\t\t\t\t// compare then end date, if previous then endDate add file, else exit\n\n\t\t\t\t// if fileDate later than begin Date\n\t\t\t\tif(fileDate !=null && fileDate.after(beginDate)){\n\t\t\t\t\t// if end date later than file date\n\t\t\t\t\tif(endDate.after(fileDate)){\n\t\t\t\t\t\t// it is in the interval, add to list!\n\t\t\t\t\t\ttoReturn.add(childFile);\n\t\t\t\t\t}\n\t\t\t\t\telse { // if file date is later then end date, we are exceeding interval\n\t\t\t\t\t\texceeded = true;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn toReturn;\n\t}", "@Override\r\n\tpublic String globFilesDirectories(String[] args) {\r\n\t\treturn globHelper(args);\r\n\t}", "private String[] addJarsInPath(List<String> paths) {\r\n\t\tSet fullList = new HashSet();\r\n\t\tfor (String path : paths) {\r\n\t\t\tfullList.add(path);\r\n\t\t\tif (!path.endsWith(\".jar\")) {\r\n\t\t\t\tFile dir = new File(path);\r\n\t\t\t\tif (dir.exists() && dir.isDirectory()) {\r\n\t\t\t\t\tString[] jars = dir.list(new FilenameFilter() {\r\n\t\t\t\t\t\tpublic boolean accept(File f, String name) {\r\n\t\t\t\t\t\t\tif (name.endsWith(\".jar\")) {\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tfor (int x = 0; x < jars.length; x++) {\r\n\t\t\t\t\t\tfullList.add(jars[x]);\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 (String[]) fullList.toArray(new String[0]);\r\n\t}", "public static void searchFile(String path){\n try {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter the File Name You need to Find:\");\n String name = scanner.next();\n File file = new File(path + \"/\" + name);\n if (file.isFile()) {\n file.getName();\n System.out.println(\"File Exists\");\n }\n else{\n System.out.println(\"File Not Found\");\n\n }\n\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "AntiIterator<FsPath> listFilesAndDirectories(FsPath dir);", "private static void validPaths(String args[]){\n if(args.length!=2){\r\n System.out.println(\"First argument required is path, Second argument required is output directory\");\r\n System.exit(-1);\r\n }\r\n File json = new File(args[0]);\r\n File csv = new File (args[1]);\r\n if(json.exists() == false || csv.exists() == false){\r\n if(json.exists()==false){\r\n System.out.println(\"Path: \" + args[0] + \" does not exist\");\r\n }\r\n if(csv.exists()==false){\r\n System.out.println(\"Path: \" + args[1] + \" does not exist\");\r\n }\r\n System.exit(-1);\r\n }\r\n }", "private static void rAddFilesToArray(File workingDirectory, ArrayList<File> result) {\n File[] fileList = workingDirectory.listFiles();\n if (fileList == null) return;\n for (File file : fileList) {\n String name = file.getName();\n int lastDotIndex = name.lastIndexOf('.');\n String ext = (lastDotIndex == -1) ? \"\" : name.substring(lastDotIndex + 1);\n if (file.isDirectory())\n rAddFilesToArray(file, result);\n if (!file.equals(remainderFile) && ext.equals(\"xml\")) {\n result.add(file);\n }\n }\n }", "public static List<Path> glob(String filePath, Path location) {\r\n List<Path> matched = new ArrayList<>();\r\n if (filePath != null && location != null) {\r\n Path globFilePath = Paths.get(location.toString(), filePath);\r\n if (!globFilePath.toFile().exists()) {\r\n String globPattern = String.format(\"glob:**%s\", filePath);\r\n walkFies(filePath, globPattern, location, matched);\r\n } else {\r\n matched.add(globFilePath);\r\n }\r\n }\r\n return matched;\r\n }", "private void FindFiles(Path findPath)\n {\n\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(findPath))\n {\n\n for (Path thisPath : stream)\n {\n File file = new File(thisPath.toString());\n\n if (file.isDirectory())\n {\n dirCount++;\n\n if (HasMatch(thisPath.toString(), lineIncludePattern, lineExcludePattern))\n {\n dirLineMatchCount++;\n\n System.out.println(thisPath.toAbsolutePath().toString() + \",directory,none\");\n }\n\n if (HasMatch(thisPath.toString(), dirIncludePattern, dirExcludePattern))\n {\n dirMatchCount++;\n folderLevel++;\n //indentBuffer = String.join(\"\", Collections.nCopies(folderLevel * 3, \" \"));\n indentBuffer = \"\";\n\n //System.out.println(indentBuffer + thisPath.toString() + \" ...\");\n FindFiles(thisPath.toAbsolutePath());\n\n folderLevel--;\n //indentBuffer = String.join(\"\", Collections.nCopies(folderLevel * 3, \" \"));\n }\n }\n else\n {\n fileCount++;\n\n if (HasMatch(thisPath.getParent().toString(), lineIncludePattern, lineExcludePattern))\n {\n fileLineMatchCount++;\n\n System.out.println(thisPath.getParent().toString() + \",\" + thisPath.getFileName() + \",none\");\n }\n\n if (HasMatch(thisPath.toString(), fileIncludePattern, fileExcludePattern))\n {\n fileMatchCount++;\n\n File refFile;\n if (doReplace)\n {\n refFile = new File(thisPath.toString() + \"_bak\");\n file.renameTo(refFile);\n\n //System.out.println(indentBuffer + thisPath.toString());\n Scan(refFile.toPath().toAbsolutePath().toString(),thisPath.toAbsolutePath().toString());\n }\n else\n {\n //System.out.println(indentBuffer + thisPath.toString());\n Scan(file.toPath().toAbsolutePath().toString(),thisPath.toAbsolutePath().toString());\n }\n\n }\n }\n }\n }\n catch (Exception e)\n {\n System.err.format(\"Exception occurred trying to read '%s'.\", findPath);\n e.printStackTrace();\n }\n\n }", "private File[] filter(File[] inputList, String beginning, String ending) {\n\t\t// in case no filtering is neccessary\n\t\tif ((beginning == null) && (ending == null))\n\t\t\treturn inputList;\n\t\tjava.util.List<File> result = new ArrayList<File>();\n\t\tfor (int i = 0; i < inputList.length; i++) {\n\t\t\tif (beginning == null) {\n\t\t\t\tif (inputList[i].getName().endsWith(ending))\n\t\t\t\t\tresult.add(inputList[i]);\n\t\t\t} else if (ending == null) {\n\t\t\t\tif (inputList[i].getName().startsWith(beginning))\n\t\t\t\t\tresult.add(inputList[i]);\n\t\t\t} else if ((inputList[i].getName().startsWith(beginning))\n\t\t\t\t\t&& (inputList[i].getName().endsWith(ending))) {\n\t\t\t\tresult.add(inputList[i]);\n\t\t\t}\n\t\t}\n\t\tFile[] retval = result.toArray(new File[result.size()]);\n\t\tjava.util.Arrays.sort(retval);\n\t\treturn retval;\n\t}", "public List<Resource> getFileLocations() throws IOException;", "public List<String> checkFiles() {\n List<String> instances = new ArrayList<String>();\n if (StringUtils.isBlank(getPathOffset())) return instances;\n File[] directories = listFiles(new File(getPathOffset()), \"gcm_\");\n for (File dir : directories) {\n File[] files = listFiles(new File(dir.toString() + \"\\\\logs\"), \"GcmWebServices\");\n for (File file : files)\n instances.add(file.toString());\n }\n return instances;\n }", "public void should_read_files_in_directory() throws IOException {\n File tempDir = Files.createTempDir();\n tempDir.deleteOnExit();\n // json file\n File file1 = File.createTempFile(\"file1\", \".json\", tempDir);\n String content1 = \"content1\";\n Files.write(content1.getBytes(), file1);\n // n1ql file\n File file2 = File.createTempFile(\"file2\", \".N1QL\", tempDir);\n String content2 = \"content2\";\n Files.write(content2.getBytes(), file2);\n // txt file\n Files.write(getRandomString().getBytes(), File.createTempFile(getRandomString(), \".txt\", tempDir));\n\n // When we read files in this directory with extension filter\n Map<String, String> result = FileUtils.readFilesInDirectory(tempDir.toPath(), \"json\", \"n1ql\");\n\n // Then we should have file content matching this extension\n Assert.assertEquals(2, result.size());\n Assert.assertEquals(content1, result.get(file1.getName()));\n Assert.assertEquals(content2, result.get(file2.getName()));\n}", "private List<DMTFile> listFilesRecursive(String path) {\n\t\tList<DMTFile> list = new ArrayList<DMTFile>();\n\t\tDMTFile file = getFile(path); //Get the real file\n\t\t\n\t\tif (null != file ){ //It checks if the file exists\n\t\t\tif (! file.isDirectory()){\n\t\t\t\tlist.add(file);\n\t\t\t} else {\n\t\t\t\tDMTFile[] files = listFilesWithoutConsoleMessage(file.getPath());\n\t\t\t\tfor (int x = 0; x < files.length; x++) {\n\t\t\t\t\tDMTFile childFile = files[x];\t\t \n\t\t\t\t\tif (childFile.isDirectory()){\n\t\t\t\t\t\tlist.addAll(listFilesRecursive(childFile.getPath()));\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlist.add(childFile);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "private void popFiles(String path) {\n\t\tFile dir = new File(path);\n\t\tFile[] list = dir.listFiles();\n\n\t\tfor (File file : list) {\n\t\t if (file.isFile()) {\n\t\t this.files.add(file.getName());\n\t\t }\n\t\t}\n\t}", "Path getHasPath();", "private String get_FilePath(String put, int ind) {\n\n File file = new File(put);\n File[] files = file.listFiles();\n\n try {\n if (files[ind].isFile()) {\n return files[ind].getAbsolutePath();\n }\n } catch (Exception e) {\n Log.d(TAG, \"Exception error : \" + e.getMessage());\n }\n return null;\n }", "static Predicate<File> endsWith(String suffix) \r\n\t{\r\n\t\treturn f -> f.getPath().endsWith(suffix);\r\n\t}", "public static ArrayList<String> filesByExtension(String path, ArrayList<String> extList) {\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (String ext: extList) {\n\t\t\tresult.addAll(IO.filesByExtension(path, ext, true));\n\t\t}\n\t\treturn result;\n\t}", "private List<String> getValidFiles(File currentFolder) {\n File[] subFiles = currentFolder.listFiles();\n List<String> sValidFiles = new ArrayList<>();\n\n // recurse through root directory, http://stackoverflow.com/questions/1844688/read-all-files-in-a-folder\n // valid file must not be a directory, not be the redirect file, and be a supported content type\n if (subFiles != null) {\n for (File fileEntry : subFiles) {\n String sFileName = fileEntry.getPath();\n if (fileEntry.isDirectory()) {\n sValidFiles.addAll(getValidFiles(fileEntry));\n } else if (isValidContentType(sFileName) && !sFileName.equals(REDIRECT_FILE_NAME)) {\n sValidFiles.add(sFileName.replaceFirst(\".\",\"\").toLowerCase());\n }\n }\n }\n return sValidFiles;\n }", "public void addFailedFilePath(String path){failedFilepaths.add(path);}", "public static String[] findFiles(String dirName, String suffix)\n\n {\n File dir = new File(dirName);\n if(dir.isDirectory()) {\n String[] allFiles = dir.list();\n if(suffix == null)\n return allFiles;\n else {\n List<String> selected = new ArrayList<String>();\n for(String filename : allFiles) {\n if(filename.endsWith(suffix))\n selected.add(filename);\n }\n return selected.toArray(new String[selected.size()]);\n }\n }\n else {\n JOptionPane.showMessageDialog(null, \"Error: \" + dirName + \" must be a directory\");\n return null;\n }\n }", "public static void main(String[] args) {\n File directoryPath = new File(\"C:\\\\Users\\\\jarek\\\\Downloads\");\n //List of all files and directories\n String[] contents = directoryPath.list();\n\n Pattern p= Pattern.compile(\"zip$\");\n Matcher m;\n Vector<String> lis = new Vector<>();\n for(int i = 0; i< Objects.requireNonNull(contents).length; i++){\n m=p.matcher(contents[i]);\n if(m.find()) lis.addElement(contents[i]);\n }\n System.out.println(\"List of files and directories in the specified directory:\");\n for (String content : contents) {\n System.out.println(content);\n }\n }", "boolean hasFileInfo();", "boolean hasFileInfo();", "public abstract List<LocalFile> getAllFiles();", "public boolean exists(String path);", "private DMTFile[] listFilesWithoutConsoleMessage(String path) {\t\n\t\tDMTFile[] fileList = listFiles(path, true);\n\t\treturn fileList;\n\t}" ]
[ "0.6488945", "0.64407027", "0.64179885", "0.6396463", "0.6379966", "0.6350109", "0.6138829", "0.6077166", "0.604497", "0.60406137", "0.6026886", "0.6020403", "0.6011003", "0.5984065", "0.595798", "0.5948863", "0.5931533", "0.5905609", "0.59013546", "0.5888402", "0.5870747", "0.58620715", "0.5843991", "0.58080447", "0.58026314", "0.5767275", "0.575255", "0.57339716", "0.57199097", "0.5719468", "0.571849", "0.5712753", "0.56986064", "0.5698267", "0.5697319", "0.5695618", "0.5667574", "0.56547475", "0.5647573", "0.5640089", "0.56305814", "0.5629894", "0.5621553", "0.56183785", "0.5605759", "0.5604099", "0.56012106", "0.5597227", "0.5589468", "0.55684006", "0.5557133", "0.55556494", "0.55512106", "0.55495757", "0.5544577", "0.55352116", "0.5534068", "0.5515506", "0.55084795", "0.55029815", "0.54948264", "0.5487505", "0.5487505", "0.54811686", "0.5480785", "0.54802704", "0.5473947", "0.54634327", "0.5459499", "0.54562914", "0.54491925", "0.5448047", "0.5447053", "0.5440517", "0.5432789", "0.5430105", "0.5430095", "0.5415947", "0.54154164", "0.541497", "0.53987324", "0.5394205", "0.5392798", "0.538621", "0.5384612", "0.5383164", "0.5381299", "0.53803146", "0.5379744", "0.5376289", "0.5373551", "0.53700805", "0.53616863", "0.5360123", "0.5354743", "0.5344748", "0.5344748", "0.53443885", "0.53407866", "0.5323649" ]
0.6272868
6
input row and cols are zero indexed
private int manhattanMoves(int val,int curr_row,int curr_col) { int correct_row = (int)Math.ceil((double) val/(double)this.dimension)-1; int mod_val = val%this.dimension; int correct_col = 0; // make corrections if (mod_val == 0) correct_col = this.dimension -1; else correct_col = mod_val -1; int vertical_moves = Math.abs(correct_row - curr_row); int horizontal_moves = Math.abs(correct_col - curr_col); return vertical_moves+horizontal_moves; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void makeRowsCols0(int [][]input) {\n\t\tint previ=-1,prevj=-1;\n\t\tfor(int i=0;i<input.length;i++)\n\t\t{\n\t\t\tfor(int j=0;j<input[0].length;j++)\n\t\t\t{\n\t\t\t\tif(input[i][j]==0)\n\t\t\t\t{\t\n\t\t\t\t\tif(i!=previ&&j!=prevj)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int k=0;k<input.length;k++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinput[k][j]=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(int k=0;k<input[0].length;k++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinput[i][k]=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprevi=i;\n\t\t\t\t\t\tprevj=j;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public Coordinate() { row = col = -1; }", "private void markRowsAndCols(int row){\n if(row < 0)\n return;\n\n markedRows[row] = true;\n for (int j = 0; j < cols; j++)\n if(j != chosenInRow[row] && source[row][j] == 0) {\n markedCols[j] = true;\n markRowsAndCols(chosenInCol[j]);\n }\n }", "public int[] getRowAndCol() {\n return new int[]{myRow, myCol};\n }", "private void resetPosition() {\n for (int i = 0; i < board.length; i++) {\n for (int j = 0; j < board[0].length; j++) {\n if (!board[i][j]) {\n rowPos = i;\n columnPos = j;\n return;\n }\n }\n }\n }", "private int xyTo1D(int row, int col)\n {\n validate(row, col);\n return (row-1) * gridSize + col-1;\n }", "void markRowAndColumnZero(int[][] matrix) {\n HashSet<Integer> rows = new HashSet<Integer>();\n HashSet<Integer> columns = new HashSet<Integer>();\n for(int i=0; i< matrix.length;i++) {\n for(int j =0; j < matrix[0].length; j++) {\n if(matrix[i][j] == 0) {\n rows.add(i);\n columns.add(j);\n }\n }\n }\n Iterator<Integer> rowsIterator = rows.iterator();\n while(rowsIterator.hasNext()) {\n int rowToBeSetToZero = rowsIterator.next();\n for(int i=0;i< matrix[0].length;i++) {\n matrix[rowToBeSetToZero][0] = 0;\n }\n }\n\n Iterator<Integer> columnsIterator = columns.iterator();\n while(columnsIterator.hasNext()) {\n int columnToBeSetToZero = columnsIterator.next();\n for(int i=0;i< matrix[0].length;i++) {\n matrix[i][columnToBeSetToZero] = 0;\n }\n }\n\n return;\n\n\n }", "private int transformInput(int row, int col){\n\t\tif( row <= 0 || row > n\n\t\t\t\t|| col <=0 || col > n){\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\t\n\t\treturn (row-1)*n + col;\n\t}", "public int getX() {\r\n return ix % numCols;\r\n }", "private void valid_rc(int row, int col) {\n\t\tif (row < 1 || row > n || col < 1 || col > n) \r\n\t\t\tthrow new IllegalArgumentException(\"Index is outside its prescribed range\");\r\n\t}", "private int[] blankFinder(){\n for(int x = 0; x < n; x++){\n for(int y = 0; y < n; y++){\n if(tiles[x][y] == 0){\n return new int[]{x, y};\n }\n }\n }\n return null;\n }", "@Test\r\n public void Test007TakeUserInputInValidRowColumn()\r\n {\r\n gol.input = new Scanner(new ByteArrayInputStream(\"2 1 20 20 2 3 2 4 -1\".getBytes()));\r\n gol.takeUserInput();\r\n assertTrue(gol.grid[2][1] == 1 && gol.grid[2][3] == 1 && gol.grid[2][4] == 1);\r\n }", "static void update(int[][] matrix){\n\t\tboolean rowFlag = false;\n\t\tboolean colFlag = false;\n\t\tint n = matrix.length;\n int m = matrix[0].length;\n for(int i=0;i<n;i++){\n for(int j=0;j<m;j++){\n if(i==0 && matrix[i][j]==0){\n rowFlag =true;\n }\n if(j==0 && matrix[i][j]==0){\n colFlag = true;\n }\n if(matrix[i][j]==0){\n matrix[0][j] = 0;\n matrix[i][0] = 0;\n }\n }\n }\n for(int i=1;i<n;i++){\n for(int j=1;j<m;j++){\n if(matrix[i][0]==0||matrix[0][j]==0){\n matrix[i][j]=0;\n }\n }\n }\n if(rowFlag){\n for(int i=0;i<m;i++){\n matrix[0][i] =0 ;\n }\n }\n if(colFlag){\n for(int j=0;j<n;j++){\n matrix[j][0] = 0;\n }\n }\n\n\t}", "private void inputData(int[][] board) {\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tfor(int j=0;j<N;j++) {\n\t\t\t\tboard[i][j]=0;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "int getRow();", "private void validate(int row, int col)\n {\n if (row <= 0 || row > gridSize) throw new IllegalArgumentException(\"row index out of bounds\");\n if (col <= 0 || col > gridSize) throw new IllegalArgumentException(\"col index out of bounds\");\n }", "private int ufindex(int row, int col) {\n return grid.length * (row - 1) + col - 1;\n }", "void colFull(int col);", "private boolean isValid( int r, int c )\n {\n return r >= 0 && r < rows && c >= 0 && c < cols ; \n }", "@Test\n public void testCreateRowIndices1(){\n\n double[][] input = new double[4][3];\n int[][] myIndices = HarderArrayProblems.createRowIndices(input);\n assertEquals(0, myIndices.length);\n assertEquals(0, myIndices[0].length);\n }", "int atRow();", "RowCoordinates getRowCoordinates();", "public void reset() {\n for (int i = 0; i < this.numRows; i++) {\n this.rows[i] = new int[0];\n }\n for (int k = 0; k < this.numCols; k++) {\n this.cols[k] = new IntOpenHashSet();\n }\n }", "public int getCols();", "@Test\r\n public void Test006TakeUserInputInValidColumn()\r\n {\r\n gol.input = new Scanner(new ByteArrayInputStream(\"2 1 2 20 2 3 2 4 -1\".getBytes()));\r\n gol.takeUserInput();\r\n assertTrue(gol.grid[2][1] == 1 && gol.grid[2][3] == 1 && gol.grid[2][4] == 1);\r\n }", "public void setToZero() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n data[i][j] = 0;\n }\n }\n }", "@Override\n public int getNumCols(){ return WIDTH; }", "private void validateRowAndColumn(int row, int col) {\n // row or column must be in range [1, N]\n if ((row < 1 || row > size) || (col < 1 || col > size)) {\n throw new IllegalArgumentException(\"wrong row or column\");\n }\n }", "public int row();", "public Cell(int col, int row){ // constructor\n this.col = col;\n this.row = row;\n }", "public ChessLocation(int inputRow, int inputColumn)\r\n {\r\n row = inputRow;\r\n col = inputColumn;\r\n }", "public static void main(String[] args) throws Exception {\n\n Scanner scn = new Scanner(System.in);\n System.out.println(\"row?\");\n int r = scn.nextInt();\n System.out.println(\"colmn?\");\n int c = scn.nextInt();\n\n int[][] a = new int[r][c];\n\n for (int i = 0; i < r; i++) {\n for (int j = 0; j < c; j++) {\n System.out.println(\"Elements?\");\n a[i][j] = scn.nextInt();\n // System.out.print(a[i][j] + \" \");\n }\n // System.out.println();\n }\n\n // System.out.println(\"\");\n\n for (int j = 0; j < c; j++) {\n\n if (j % 2 == 0) {\n for (int i = 0; i < r; i++) {\n System.out.println(a[i][j]);\n }\n }\n\n else {\n for (int i = r - 1; i >= 0; i--) {\n System.out.println(a[i][j]);\n }\n }\n\n }\n scn.close();\n\n }", "protected abstract void position(int[][] gameboard, int col, int row);", "private int getIndex(int row, int col) {\n return (row - 1) * getSize() + col;\n }", "void makeZero(){\n nnz = 0;\n for(int i=0; i<this.matrixSize; i++){\n this.rows[i] = new List();\n }\n }", "private boolean isLegalPos(int row, int col){\r\n return !(row < 0 || row > 7 || col < 0 || col > 7);\r\n }", "public int getRowNumber() {\n return cols;\n }", "private boolean isEmpty( int r, int c ) {\n\treturn matrix[r][c] == null;\n }", "private int colPos(int pos) {\r\n return pos % squareDimension;\r\n }", "public int method2(int row, int col) {\n return 0;\n }", "private int xyTo1D(final int row, final int col) {\n return (row - 1) * size + (col - 1);\n }", "private int xyToOneD(int row, int col) {\n return ((row - 1) * grid.length) + (col - 1);\n }", "public int[] takeShots(){\n ui.printToUser(\"Please enter the row value\");\n int row = Integer.parseInt(String.valueOf(ui.readFromUser().charAt(0)));\n ui.printToUser(\"Please enter the column value\");\n int column = Integer.parseInt(String.valueOf(ui.readFromUser().charAt(0)));\n return new int[]{row, column};\n }", "public abstract void processCell(int rowIndex, int colIndex);", "protected void checkRow(int row) {\n\tif (row < 0 || row >= rows) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at row=\"+row);\n}", "private static void cleanArray() {\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tcolTemp[i] = 0;\r\n\t\t\trowTemp[i] = 0;\r\n\t\t}\r\n\t}", "private static void changeFirstRowAndColumn(int[][] matrix,MatrixSize matrixSize){\n for(int i=1;i<matrixSize.numberOfRows;i++){\n for(int j=1;j<matrixSize.numberOfColumns;j++) {\n if(matrix[i][j]==0){\n matrix[i][0]=0;\n matrix[0][j]=0;\n }\n }\n }\n }", "void clearCell(int x, int y);", "public Matriz( int lin, int col )\n {\n if(lin <= 0 || col <= 0 )\n {\n IO.println(\"ERRO: Quantidade invalida. \" );\n } //end\n else\n {\n table = new Object[lin][col];\n } //end se\n }", "int getCol();", "private static int[][] identifyMatrixWithZeros(int[][] matrix){\n\t\tboolean[] rowCheck = new boolean[matrix.length];\n\t\tboolean[] colCheck = new boolean[matrix[0].length];\n\n\t\tfor(int i=0;i<matrix.length ;i++) {\n\t\t\tfor(int j=0;j<matrix[0].length;j++) {\n\t\t\t\tif(matrix[i][j] == 0) {\n\t\t\t\t\trowCheck[i] = true;\n\t\t\t\t\tcolCheck[j] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int row=0;row<rowCheck.length;row++) {\n\t\t\tif(rowCheck[row])\n\t\t\t\tnullifyRows(matrix, row);\n\t\t}\n\t\t\n\t\tfor(int col=0;col<colCheck.length;col++) {\n\t\t\tif(colCheck[col])\n\t\t\t\tnullifyColumns(matrix, col);\n\t\t}\n\t\treturn matrix;\n\t}", "public void nullifyMatrix(int[][] mat) {\r\n //extra space\r\n boolean rows[] = new boolean[mat[0].length];\r\n boolean columns[] = new boolean[mat.length];\r\n \r\n for (int i=0;i<mat.length ;i++ ) {\r\n for (int j=0; j<mat[0].length;j++ ) {\r\n if(mat[i][j] == 0) {\r\n rows[i] = true;\r\n columns[j] = true;\r\n }\r\n } \r\n }\r\n \r\n //Nullify rows\r\n for(int i=0; i<rows.length; i++) {\r\n if(rows[i])\r\n helperNullifyRow(mat, i);\r\n }\r\n //Nullify columns\r\n for(int i=0; i<columns.length; i++) {\r\n if(columns[i])\r\n helperNullifyColumn(mat,i);\r\n }\r\n printMat(mat);\r\n }", "public void setZeroes2(int[][] matrix) {\n boolean row00 = false;\n boolean col00 = false;\n\n int row = 0, col = 0;\n int rows = matrix.length;\n int cols = matrix[0].length;\n while (col < cols && !row00) {\n row00 = matrix[0][col++] == 0;\n }\n while (row < rows && !col00) {\n col00 = matrix[row++][0] == 0;\n }\n\n for (row = 1; row < rows; ++row) {\n for (col = 1; col < cols; ++col) {\n if (matrix[row][col] == 0) {\n matrix[row][0] = 0;\n matrix[0][col] = 0;\n }\n }\n }\n for (row = 1; row < rows; ++row) {\n for (col = 1; col < cols; ++col) {\n if (matrix[0][col] == 0 || matrix[row][0] == 0) {\n matrix[row][col] = 0;\n }\n }\n }\n if (row00) {\n for (col = 0; col < cols; ++col) {\n matrix[0][col] = 0;\n }\n }\n if (col00) {\n for (row = 0; row < rows; ++row) {\n matrix[row][0] = 0;\n }\n }\n }", "public int getNumCols() { return numCols; }", "private static void setFirstRowToZero(int[][] matrix,int numberOfColumns){\n for(int i=0;i<numberOfColumns;i++){\n matrix[0][i]=0;\n }\n }", "public static void solution2(int[][] grid) {\n int rows = grid.length;\n int cols = grid[0].length;\n \n // Check if row 0 has a 0. Save this info for later.\n boolean row0Has0 = false;\n for (int col = 0; col < cols; col++) {\n if (grid[0][col] == 0) {\n row0Has0 = true;\n }\n }\n\n // Check if col 0 has a 0. Save this info for later.\n boolean col0Has0 = false;\n for (int row = 0; row < rows; row++) {\n if (grid[row][0] == 0) {\n col0Has0 = true;\n }\n }\n \n // Use row 0 and col 0 as storage.\n // Loop through grid and save which rows and columns have 0s. \n for (int row = 0; row < rows; row++) {\n for (int col = 0; col < cols; col++) {\n if (grid[row][col] == 0) {\n grid[row][0] = 0;\n grid[0][col] = 0;\n }\n }\n }\n \n // Zero out the necessary cells in grid (except for 0th row and 0th col).\n for (int row = 1; row < rows; row++) {\n for (int col = 1; col < cols; col++) {\n if (grid[row][0] == 0 || grid[0][col] == 0) {\n grid[row][col] = 0;\n }\n }\n }\n \n // Zero out the necessary cells in row 0.\n if (row0Has0) {\n for (int col = 0; col < cols; col++) {\n grid[0][col] = 0;\n }\n }\n \n // Zero out the necessary cells in col 0.\n if (col0Has0) {\n for (int row = 0; row < rows; row++) {\n grid[row][0] = 0;\n }\n }\n }", "protected boolean validCoord(int row, int col) {\n\t\treturn (row >= 0 && row < b.size() && col >= 0 && col < b.size());\n\t}", "public void setPos(int r, int c) { _row = r; _col = c; }", "static void setFirstColumnToZero(int[][] matrix,int numberOfRows){\n for(int i=0;i<numberOfRows;i++){\n matrix[i][0]=0;\n }\n }", "public void setRowCol(int row1, int col1){\n row = row1;\n col = col1;\n }", "Cell(int[][] board, int zeroRow, int zeroCol) {\n\t\t\tthis.board = board;\n\t\t\tthis.zeroRow = zeroRow;\n\t\t\tthis.zeroCol = zeroCol;\n\t\t\tthis.representation = Arrays.deepToString(board);\n\t\t}", "@Test\r\n public void Test005TakeUserInputInValidRow()\r\n {\r\n gol.input = new Scanner(new ByteArrayInputStream(\"20 1 2 2 2 3 2 4 -1\".getBytes()));\r\n gol.takeUserInput();\r\n assertTrue(gol.grid[2][3] == 1 && gol.grid[2][2] == 1 && gol.grid[2][3] == 1 && gol.grid[2][4] == 1);\r\n }", "private boolean isOutOfBounds(int row, int col) {\n if (row < 0 || row >= this.getRows()) {\n return true;\n }\n else if (col < 0 || col >= this.getColumns()) {\n return true;\n }\n else {\n return false; // the placement is valid\n }\n }", "private int getNIdx() {\n return this.colStartOffset + 7;\n }", "public static void main(String[] args) {\n int[][] inp = new int[][] {\n {1,2,3},\n {5,6,7},\n {9,10,11}};\n \n int temp;\n \n\t for(int i = inp.length-1,j=0; i>=0 ; i--,j=0)\n {\n System.out.print(inp[i][j] + \" \");\n\t\t \n temp = i; // store old row where we started \n \n\t\t while(i+1 < inp.length && j+1 < inp[0].length)\n {\n System.out.print(inp[i+1][j+1] + \" \"); // keep print right diagonal\n i++;j++;\n }\n \n\t\t i = temp; // restore old row\n \n\t\t System.out.println();\n\t\t \n\t\t // special case - when we switch from processing row to processing column\n if(i == 0)\n {\n\t\t\t // now, column will go from 1 to inp[0].length-1\n\t\t\t \n for (int k = 1; k < inp[0].length; k++) {\n\n\t\t\t\t temp = k; // save old column\n \n\t\t\t\t System.out.print(inp[i][k] + \" \");\n\t\t\t\t \n\t\t\t\t // keep getting right diagonal\n while (i + 1 < inp.length && k + 1 < inp[0].length) {\n System.out.print(inp[i + 1][k + 1] + \" \");\n i++;\n k++;\n }\n \n\t\t\t\t k = temp;\n \n\t\t\t\t i = 0;\n \n\t\t\t\t System.out.println();\n\n }\n }\n }\n \n }", "private boolean isLegalCoordinate(int row, int col) {\n return row > 0 && row <= getSize() && col > 0 && col <= getSize();\n }", "private int rowPos(int pos) {\r\n return pos / squareDimension;\r\n }", "public boolean isEmpty(int row, int column);", "protected void validateCell( int row, int column )\n {\n }", "public abstract boolean checkIfCellHasValue(int row, int col);", "public int getRow()\n {\n return row;\n }", "@Override\n\tpublic void reset() {\n\t\tfor (int i = 0; i < _board.length; i++)\n for (int j = 0; j < _board[i].length; j++)\n \t_board[i][j] = null;\n\n\t\t_columnFull = new HashSet<Integer>();\n\t\t_lastPosition = new HashMap<Integer,Integer>();\n\t}", "public int[] getRow() { return _row; }", "public int getCol() { return _col; }", "private boolean checkRange(int rowIndex, int columnIndex) {\n return rowIndex >= 0 && rowIndex < matrix.length\n && columnIndex >= 0 && columnIndex < matrix[rowIndex].length;\n\n }", "private void genInitialMatch(){\n for (int i = 0; i < rows; i++)\n for (int j = 0; j < cols; j++)\n if(source[i][j] == 0 && chosenInRow[i] == -1 && chosenInCol[j] == -1) {\n chosenInRow[i] = j;\n chosenInCol[j] = i;\n break;\n }\n }", "public void punishment(){\n\t\tthis.cell = 0;\n\t}", "public boolean isFull(int row, int col) {\n return false;\n }", "private boolean isValid(int row, int col) {\n if (row < 1 || row > this.side || col < 1 || col > this.side)\n return false;\n return true;\n }", "private int size() {\n\treturn matrix.length; //# of rows\n }", "public int getRow() { return _row; }", "private boolean validate(int row, int col) {\n if (row < 1 || row > this.n || col < 1 || col > this.n) {\n throw new IllegalArgumentException(\"row \" + row + \" col \" + col + \" is out of the grid.\");\n }\n else return true;\n }", "private int rowColToIndex(int row, int col) {\n row = row - 1;\n col = col - 1;\n int index = row * side + col;\n if (index >= side*side || index < 0 || row < 0 || row >= side || col < 0 || col >= side)\n throw new IndexOutOfBoundsException();\n return index;\n }", "private int convertMatrixToVectorIndex(int row, int col){\n return ((row)*this.col)+col;\n }", "public Cell(int row, int column){\r\n this.row = row;\r\n this.column = column;\r\n }", "private boolean isSafe(int[][] input, char[][] path, int row, int col, int n) {\n if (row >= 0 && row < n && col >= 0 && col < n && input[row][col] == 0 && path[row][col] == 'N')\n return true;\n return false;\n }", "@Override\n public boolean isInBounds(int row, int col) {\n return row >= 0 && row < grid.length && col >= 0 && col < grid[0].length;\n }", "public void clear() {\n rows = cols = 0;\n matrix.clear();\n }", "public void makeIdentity() {\n if (rows == cols) {\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n if (i == j) {\n matrix.get(i)[j] = 1;\n }\n else {\n matrix.get(i)[j] = 0;\n }\n }\n }\n }\n else {\n throw new NonSquareMatrixException();\n }\n }", "public int[] getCol() { return _col; }", "public void setGridNull(int row, int col)\n\t{\n\t\tgrid[row][col] = null;\n\t}", "boolean isSafe(int row, int col,boolean mat[][]) {\n\t\treturn (row >= 0) && (row < mat.length) && (col >= 0) && (col < mat.length) && (mat[row][col]);\r\n\t}", "public static ArrayList<int[]> getEmptyCellCoords(int[][] grid) {\n\n ArrayList<int[]> emptyCells = new ArrayList<int[]>();\n for (int i = 0; i < grid.length; i++) {\n for (int j = 0; j < grid[0].length; j++) {\n if (grid[i][j] == 0) {\n int[] arr = {i, j};\n emptyCells.add(0, arr);\n }\n }\n }\n\n return emptyCells;\n }", "public void setZeroes1(int[][] matrix) {\n boolean col00 = false;\n\n int row, col;\n int rows = matrix.length;\n int cols = matrix[0].length;\n for (row = 0; row < rows; ++row) {\n for (col = 0; col < cols; ++col) {\n if (matrix[row][col] == 0) {\n if (col != 0) {\n matrix[0][col] = 0;\n matrix[row][0] = 0;\n } else {\n col00 = true;\n }\n }\n }\n }\n for (row = rows - 1; row >= 0; --row) {\n for (col = 1; col < cols; ++col) {\n if (matrix[row][0] == 0 || matrix[0][col] == 0) {\n matrix[row][col] = 0;\n }\n }\n }\n if (col00) {\n for (row = rows - 1; row >= 0; --row) {\n matrix[row][0] = 0;\n }\n }\n }", "public int col() {\r\n return col;\r\n }", "public CellCoord(int column, int row) {\n if (row <= 0 || column <= 0 || row > SpreadSheet.MAX_ROWS || column > SpreadSheet.MAX_COLUMNS) {\n valid = false;\n } else {\n this.column = column;\n this.row = row;\n }\n\n }", "public int getRow(){ return (Integer)args[0]; }", "private void overwritePositionWithEmpty(int row, int col){\n gameBoard[row][col] = new EmptyPiece();\n }", "public static void getUserMove(char[][] a){\r\n //first check if valid\r\n int rowNumber = a.length;\r\n int colNumber = a[0].length;\r\n Scanner in = new Scanner(System.in);\r\n int row = in.nextInt();\r\n int col = in.nextInt();\r\n \r\n while (!(colNumber>=row && rowNumber>=row && spotIsEmpty(a[row][col]))){\r\n in.nextLine();//to clean buffer\r\n System.out.println(\"Please re-enter a new point.\");\r\n in = new Scanner (System.in);\r\n row = in.nextInt();\r\n col = in.nextInt();\r\n }\r\n writeOnBoard(a,'x',row,col);\r\n \r\n }", "private int getIndex(int row,int column,int maxColumn)\n {\n \tint rownumber = row*maxColumn+column;\n \treturn rownumber;\n }", "public int getPositionRow(){return this.positionRow;}" ]
[ "0.65335345", "0.6250576", "0.6238086", "0.6236564", "0.6152922", "0.61211306", "0.61169446", "0.6115387", "0.60813653", "0.6057212", "0.6052844", "0.6026604", "0.6023025", "0.60203516", "0.6014142", "0.59781706", "0.5977137", "0.5954558", "0.5954263", "0.5946978", "0.5915021", "0.5910788", "0.5908041", "0.5904136", "0.5878586", "0.5877706", "0.58645374", "0.5858712", "0.5843439", "0.5835603", "0.58215034", "0.5821317", "0.5811268", "0.5807947", "0.5797008", "0.57894903", "0.5787912", "0.57808757", "0.57661307", "0.575849", "0.5757328", "0.57548285", "0.57516456", "0.5721793", "0.5713447", "0.57064533", "0.5705092", "0.5702041", "0.5700332", "0.569169", "0.56900865", "0.56826484", "0.5675194", "0.5673199", "0.56630045", "0.5661906", "0.56599516", "0.5657182", "0.565705", "0.56499773", "0.564795", "0.56477857", "0.5634694", "0.5633897", "0.5625871", "0.56211114", "0.5619009", "0.56182617", "0.5615008", "0.56034434", "0.5589903", "0.5587167", "0.55838484", "0.5583847", "0.5581625", "0.5579344", "0.55761427", "0.55754036", "0.5570646", "0.5570465", "0.55702525", "0.5557711", "0.55574334", "0.55535585", "0.5552499", "0.5547966", "0.5543078", "0.55426264", "0.55356574", "0.5527649", "0.55263686", "0.5523814", "0.5522848", "0.55228215", "0.55216205", "0.55065733", "0.5505448", "0.5504744", "0.5503997", "0.55037385", "0.5499381" ]
0.0
-1
create initial board from file
public static void main(String[] args) { In in = new In(args[0]); int N = in.readInt(); int[][] blocks = new int[N][N]; for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) blocks[i][j] = in.readInt(); Board initial = new Board(blocks); System.out.println(initial); System.out.println(initial.hamming()); System.out.println(initial.manhattan()); System.out.println(initial.isGoal()); for (Board b:initial.neighbors()) { System.out.println(b); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Board initBoard() throws IOException {\n // Scanner in = new Scanner(System.in);\n Scanner in = new Scanner(new File(\"src/rocketfuel/input005.txt\"));\n int colNum = 0;\n int rowNum = 0;\n StringBuilder sb = new StringBuilder();\n while (in.hasNextLine()) {\n String line = in.nextLine();\n if (rowNum == 0)\n colNum = line.length();\n sb.append(line);\n sb.append(\"\\n\");\n rowNum++;\n }\n Board board = new Board(rowNum, colNum);\n in = new Scanner(sb.toString());\n int row = 0;\n while (in.hasNextLine()) {\n String line = in.nextLine();\n for (int col = 0; col < line.length(); col++) {\n char curr = line.charAt(col);\n if (curr != NONE)\n board.setCellValue(row, col, curr);\n if (curr == START) // mark the starting point of the laser\n board.setStart(row, col);\n }\n row++;\n }\n return board;\n }", "@Override\r\n\tpublic void createBoardWithFile(Board board) {\n\t\t\r\n\t}", "@Override\r\n\tvoid initialize(boolean fromFile) {\n\t\tfor (int i = 0; i < board.length; i++) {\r\n\t\t\tfor (int j = 0; j < board[i].length; j++) {\r\n\t\t\t\tboard[i][j] = -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tboard[boardsize/2][boardsize/2] = 0;\r\n\t\tboard[boardsize/2-1][boardsize/2] = 1;\r\n\t\tboard[boardsize/2][boardsize/2-1] = 1;\r\n\t\tboard[boardsize/2-1][boardsize/2-1] = 0;\r\n\t}", "static int[][] fileToBoard(String fileName) {\n\t\ttry {\n\t\t\t// open up file\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(fileName));\n\t\t\ttry {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tString line = br.readLine();\n\t\t\t\t\n\t\t\t\t// used to record the length and \n\t\t\t\t// height of the board for the 2d int array\n\t\t\t\tint x = 0;\n\t\t\t\tint y = 0;\n\t\t\t\t\n\t\t\t\tx = line.replaceAll(\"\\t\", \"\").length();\n\t\t\t\t// build up string line by line\n\t\t\t\twhile (line != null) {\n\t\t\t\t\ty++;\n\t\t\t\t\tsb.append(line);\n\t\t\t\t\tline = br.readLine();\n\t\t\t\t}\n\n\t\t\t\t// change from string builder to string and take out tabs\n\t\t\t\tString everything = sb.toString();\n\t\t\t\tString noTabs = everything.replaceAll(\"\\t\", \"\");\n\n\t\t\t\t// close file\n\t\t\t\tbr.close();\n\t\t\t\t\n\t\t\t\t// convert string to 2d int array\n\t\t\t\tint [][] board = new int[x][y];\n\t\t\t\tfor(int i = 0; i < x; i++){\n\t\t\t\t\tfor(int j = 0; j < y; j++){\n\t\t\t\t\t\tchar character = noTabs.charAt(i+j*x);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check to see if the character is a special state (Start and Goal)\n\t\t\t\t\t\tif(character == 'G')\n\t\t\t\t\t\t\tboard[i][j] = State.GOAL;\n\t\t\t\t\t\telse if(character == 'S')\n\t\t\t\t\t\t\tboard[i][j] = State.START;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tboard[i][j] = character - '0';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn board;\n\t\t\t} finally {\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\n\t\t}\n\t\treturn new int[0][0];\n\t}", "Board(String filename, SudokuContainer s) {\n\t\treadFromFile(filename);\n\t\trows = new Row[size];\n\t\tcolumns = new Column[size];\n\t\tboxes = new Box[height][length];\n\t\tcontainer = s;\n\t\tcreateBoard();\n }", "public Grid decode (File file) throws IOException\n {\n String currentLine;\n int width = 0, height = 0;\n Grid _grid = null;\n\n try (BufferedReader br = new BufferedReader(new FileReader(file)))\n {\n // skip all the lines that we are not using\n while ((currentLine = br.readLine()) != null) {\n if (currentLine.startsWith(\"#\")) { continue; }\n if (currentLine.startsWith(\"x = \"))\n {\n for (String s : currentLine.split(\",\"))\n {\n if (s.contains(\"x = \"))\n {\n width = Integer.valueOf(s.replaceAll(\"\\\\D+\", \"\"));\n }\n else if (s.contains(\"y = \"))\n {\n height = Integer.valueOf(s.replaceAll(\"\\\\D+\", \"\"));\n }\n else\n {\n break;\n }\n }\n break;\n }\n }\n _grid = new Grid(height, width, false);\n\n int currentY = 0;\n int currentX = 0;\n int startX = 0;\n int i = 0;\n\n String kNumber = \"\"; // The number of times block should be repeated.\n String board = \"\";\n\n // convert the board to a long string\n while ((currentLine = br.readLine()) != null)\n {\n board += currentLine;\n }\n\n for (char c : board.toCharArray())\n {\n if (c == DEAD)\n {\n currentX += (kNumber.equals(\"\") ? 1 : Integer.parseInt(kNumber));\n kNumber = \"\";\n }\n else if (c == LIVE)\n {\n int count = (kNumber.equals(\"\") ? 1 : Integer.parseInt(kNumber));\n for (int j = 0; j < count; j++)\n {\n if (currentY < height && currentX < width)\n {\n _grid.setCell(true, currentX, currentY);\n }\n currentX++;\n }\n kNumber = \"\";\n }\n else if (c == EOL)\n {\n currentX = startX;\n currentY += (kNumber.equals(\"\") ? 1 : Integer.parseInt(kNumber));\n kNumber = \"\";\n }\n else if (c == EOF)\n {\n break;\n }\n else\n {\n kNumber += Integer.parseInt(board.substring(i, i + 1));\n }\n i++;\n }\n\n }\n return _grid;\n }", "public BoardBuilder(File fileName) throws Exception {\n\t\tJAXBContext contextObj = JAXBContext.newInstance(BoardInitializer.class);\n\t\tUnmarshaller mub = contextObj.createUnmarshaller();\n\t\tbi = (BoardInitializer) mub.unmarshal(new FileReader(fileName));\n\t}", "@Override\r\n \r\n public void initGrid(String filename)\r\n throws FileNotFoundException, IOException\r\n {\r\n \tFile fileToParse = new File(filename);\r\n \tScanner scanner = new Scanner(fileToParse);\r\n \tint linePositionInFile = 0;\r\n \tfinal int MAZE_SIZE_LINE_POSITION = 0;\r\n \tfinal int VALID_SYMBOLS_LINE_POSITION = 1;\r\n \tfinal int PRESET_VALUE_LINE_POSITION = 2;\r\n\t\tfinal String SYMBOL_DELIMITER = \" \";\r\n\r\n \tString[] splitString = null;\r\n \twhile(scanner.hasNextLine()){\r\n \t\t//current line to be parsed\r\n\t\t\tString parseLine = scanner.nextLine();\r\n \t\tif(linePositionInFile == MAZE_SIZE_LINE_POSITION) {\r\n \t\t\t//construct the game sizes.\r\n \t\t\t\r\n \t\t\t//System.out.println(\"DEBUG: size\" + parseLine);\r\n \t\t\tint parsedMazeSize = Integer.parseInt(parseLine);\r\n \t\t\t//set the gridSize variable\r\n \t\t\tgridSize = parsedMazeSize;\r\n \t\t\t\r\n \t\t\t//construct the game with the proper sizes.\r\n \t\t\tsymbols = new Integer[parsedMazeSize];\r\n \t\t\tgame = new Integer[parsedMazeSize][parsedMazeSize];\r\n\r\n \t\t}else if(linePositionInFile == VALID_SYMBOLS_LINE_POSITION) {\r\n \t\t\t//set valid symbols\r\n \t\t\t//System.out.println(\"DEBUG: symbols\" + parseLine);\r\n \t\t\tsplitString = parseLine.split(SYMBOL_DELIMITER);\r\n \t\t\tfor(int i = 0; i < symbols.length && i < splitString.length; ++i) {\r\n \t\t\t\tsymbols[i] = Integer.parseInt(splitString[i]);\r\n \t\t\t}\r\n \t\t}else if(linePositionInFile >= PRESET_VALUE_LINE_POSITION) {\r\n \t\t\t//System.out.println(\"DEBUG: inserting preset\" + parseLine);\r\n \t\t\t/*\r\n \t\t\t * example = 8,8 7\r\n \t\t\t * below parses and splits the string up to usable values to \r\n \t\t\t * then insert into the game, as preset value constraints.\r\n \t\t\t * \r\n \t\t\t */\r\n \t\t\t\r\n \t\t\tsplitString = parseLine.split(SYMBOL_DELIMITER);\r\n \t\t\tString[] coordinates = splitString[0].split(\",\");\r\n \t\t\tint xCoordinate = Integer.parseInt(coordinates[0]);\r\n \t\t\tint yCoordinate = Integer.parseInt(coordinates[1]);\r\n \t\t\tint presetValueToInsert = Integer.parseInt(splitString[1]);\r\n \t\t\tgame[xCoordinate][yCoordinate] = presetValueToInsert;\r\n\r\n \t\t}\r\n \t\t++linePositionInFile;\r\n \t}\r\n \tscanner.close();\r\n }", "public void loadStateFromFile(String fileName)\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile f = new File(fileName);\n\t\t\tScanner input = new Scanner(f);\n\t\t\t_rows = input.nextInt();\n\t\t\t_cols = input.nextInt();\n\t\t\t_puzzle = new int[_rows][_cols];\n\t\t\tfor (int r_idx = 0; r_idx < _rows; r_idx++)\n\t\t\t\tfor (int c_idx = 0; c_idx<_cols; c_idx++)\n\t\t\t\t{\n\t\t\t\t\t_puzzle[r_idx][c_idx] = input.nextInt();\n\t\t\t\t\tif (_puzzle[r_idx][c_idx] == 0){\n\t\t\t\t\t\t_holes.add(new Coordinate(r_idx,c_idx));\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "public void load(File file) throws IOException {\n FileReader reader = new FileReader(file); //new File Reader\r\n char str[] = new char[10000]; //create a character string array of 10000 values\r\n reader.read(str);//read the file\r\n boolean temp[][] = new boolean[100][100]; //create a temporary new colony\r\n for (int r = 0; r < 100; r++) { //iterate through to fill with values\r\n for (int c = 0; c < 100; c++) {\r\n if (str[r*100 + c] == '1') { //if the char is equal to one, cell is alive\r\n temp[r][c] = true;\r\n } else {\r\n temp[r][c] = false; //else, the cell is dead\r\n }\r\n }\r\n }\r\n grid = temp;\r\n }", "public static void main(String[] args) {\n\t\t// create initial board from file\n\t\tIn in = new In(args[0]);\n\t\tint n = in.readInt();\n\t\tint[][] blocks = new int[n][n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tfor (int j = 0; j < n; j++)\n\t\t\t\tblocks[i][j] = in.readInt();\n\t\t// int blocks[][] = {{0,1,3},{4,2,5},{7,8,6}};\n\t\tBoard initial = new Board(blocks);\n\n\t\t// solve the puzzle\n\t\tSolver solver = new Solver(initial);\n\n\t\t// print solution to standard output\n\t\tif (!solver.isSolvable())\n\t\t\tStdOut.println(\"No solution possible\");\n\t\telse {\n\t\t\tStdOut.println(\"Minimum number of moves = \" + solver.moves());\n\t\t\tfor (Board board : solver.solution())\n\t\t\t\tStdOut.println(board);\n\t\t}\n\t}", "private void loadGame() {\r\n\t\tJFileChooser fileChooser = new JFileChooser();\r\n\t\tArrayList<String> data = new ArrayList<String>();\r\n\t\tFile file = null;\r\n\t\tif (fileChooser.showOpenDialog(gameView) == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tfile = fileChooser.getSelectedFile();\r\n\t\t}\r\n\r\n\t\tif (file != null) {\r\n\t\t\tmyFileReader fileReader = new myFileReader(file);\r\n\t\t\ttry {\r\n\t\t\t\tdata = fileReader.getFileContents();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\t// TODO: allow writing of whose turn it is!\r\n\t\t\tParser parse = new Parser();\r\n\t\t\tint tempBoard[][] = parse.parseGameBoard(data);\r\n\t\t\tgameBoard = new GameBoardModel(tempBoard, parse.isBlackTurn(), parse.getBlackScore(), parse.getRedScore());\r\n\t\t}\r\n\t}", "public Board(String inputBoard, Random random) throws IOException\n {\n File file = new File( inputBoard );\n Scanner scanner = new Scanner( file );\n this.random = random;\n GRID_SIZE = scanner.nextInt();\n score = scanner.nextInt();\n this.grid = new int[GRID_SIZE][GRID_SIZE];\n // runs through rows first, columns second\n for ( int i=0; i< GRID_SIZE; i++) {\n for( int j=0; j< GRID_SIZE; j++) {\n grid[i][j] = scanner.nextInt();\n }\n }\n scanner.close();\n }", "private List<String> generateSquareStructureFromFile(String path) {\n Scanner scanner;\n List<String> readInput;\n InputStream inputStream = getClass().getResourceAsStream(path);\n scanner = new Scanner(inputStream);\n readInput = new ArrayList<>();\n\n while (scanner.hasNextLine()) {\n readInput.add(scanner.nextLine());\n }\n scanner.close();\n\n roomsToBuild = new ArrayList<>();\n squares = new ArrayList<>();\n spawnPoints = new ArrayList<>();\n for(int i = 0; i<readInput.size(); i++){\n if(i%2 == 0)\n squares.add(new ArrayList<>());\n }\n\n int row = 0;\n int col;\n char c;\n String s;\n while(row < readInput.size()){\n col = 0;\n while(col < readInput.get(row).length()){\n c = readInput.get(row).charAt(col);\n s = String.valueOf(c).toLowerCase();\n\n if(c=='R'||c=='B'||c=='Y'||c=='G'||c=='W'||c=='P') {\n SpawnPoint tempSquare = new SpawnPoint(row/2, col/2, Color.fromString(s));\n squares.get(row/2).add(tempSquare);\n spawnPoints.add(tempSquare);\n if(!roomsToBuild.contains(Color.fromString(s)))\n roomsToBuild.add(Color.fromString(s));\n }\n else if(c=='r'||c=='b'||c=='y'||c=='g'||c=='w'||c=='p'){\n squares.get(row/2).add(new Square(row/2, col/2, Color.fromString(s)));\n if(!roomsToBuild.contains(Color.fromString(s)))\n roomsToBuild.add(Color.fromString(s));\n }\n else if(c==' ' && row%2==0 && col%2==0){\n squares.get(row/2).add(null);\n }\n //update max\n if(row/2 + 1> numRow)\n numRow = row/2 + 1;\n if(col/2 + 1> numCol)\n numCol = col/2 + 1;\n col++;\n }\n row++;\n }\n\n return readInput;\n\n }", "public DistrictBoard(String filename) {\r\n Path file = FileSystems.getDefault().getPath(\"../Gerrymander/data/\", filename);\r\n try (BufferedReader reader = Files.newBufferedReader(file)) {\r\n // get the dimensions from the first line (M N)\r\n String line = reader.readLine();\r\n int[] dim = Arrays.stream(line.split(\" \")).mapToInt(s -> Integer.parseInt(s)).toArray();\r\n boardRows = dim[0];\r\n boardCols = dim[1];\r\n board = new int[boardRows][boardCols];\r\n \r\n // read the remaining lines into the board array\r\n for (int i = 0; i < boardRows; i++) {\r\n line = reader.readLine();\r\n board[i] = Arrays.stream(line.split(\" \")).mapToInt(s -> Integer.parseInt(s)).toArray();\r\n }\r\n } catch (IOException e) {\r\n System.err.format(\"IOException: %s%n\", e);\r\n }\r\n }", "public Board createBoard(String inputFileName) {\nList<String> ants = new ArrayList<>();\n\nint rows = 0;\nrows = getMatrixSize(inputFileName);\n\nBoard b = new Board(rows, rows);\n\nants = findAnts(inputFileName);\nfor (int k = 0; k < ants.size(); k++) {\nString firstAnt = ants.get(k);\nString[] firstAntSplitted = firstAnt.split(\" \");\nString name = \"\";\nint posX = 0;\nint posY = 0;\n\nname = firstAntSplitted[2];\nposX = Integer.parseInt(firstAntSplitted[0]);\nposY = Integer.parseInt(firstAntSplitted[1]);\n\nAnt a = new Ant(name);\n\n\nb.placeAnt(posX, posY, a);\n}\nreturn b;\n}", "@SuppressWarnings(\"resource\")\n\tpublic void setPieces(String filename) throws IOException\n {\n\tString[] colors = new String[11]; //array containing the colors of the pieces\n\tcolors[0] = \"Red\";\n\tcolors[1] = \"Orange\";\n\tcolors[2] = \"Yellow\";\n\tcolors[3] = \"Green\";\n\tcolors[4] = \"Teal\";\n\tcolors[5] = \"Sky\";\n\tcolors[6] = \"Azure\";\n\tcolors[7] = \"Blue\";\n\tcolors[8] = \"Pink1\";\n\tcolors[9] = \"Pink2\";\n\tcolors[10] = \"Violet\";\n\n\tFileReader file = new FileReader(filename);\n\tScanner stringIn = new Scanner(file);\n\tString[] temp_pieces = new String[11]; \n\tint index = 0;\n\twhile(stringIn.hasNext())\n\t {\n\t\ttemp_pieces[index] = stringIn.nextLine(); \n\t\tindex++;\n\t }\n\n\tpieces = new Piece[11];\n\tunused = new Piece[11];\n\tfor(int i=0;i<temp_pieces.length;i++)\n\t {\n\t\tPiece temp = new Piece(temp_pieces[i],colors[i]); //creates new pieces from the temp array\n\t\tpieces[i] = temp;\n\t\tunused[i] = temp;\n\t\t}\n }", "public void setGameFromState(String filePath, int boardSize) {\n File readFile = new File(filePath);\n\n int whiteScore = 0;\n int blackScore = 0;\n String turn = \"black\";\n int endBoardLine;\n String human = \"black\";\n\n if (boardSize == 6) {\n endBoardLine = 8;\n } else if (boardSize == 8) {\n endBoardLine = 10;\n } else {\n endBoardLine = 12;\n }\n\n try (BufferedReader bufferedReader = new BufferedReader(new FileReader(readFile))) {\n String line;\n int lineCounter = 0;\n\n while ((line = bufferedReader.readLine()) != null) {\n if (lineCounter == 0) {\n blackScore = Integer.parseInt(line.substring(7));\n } else if (lineCounter == 1) {\n whiteScore = Integer.parseInt(line.substring(7));\n } else if (lineCounter >= 3 && lineCounter <= endBoardLine) {\n for (int c = 0; c < line.length(); c += 2) {\n if (line.charAt(c) == 'B') {\n boardObject.setSlotColor(boardObject.getSlot(lineCounter - 3, c / 2), Slot.BLACK);\n } else if (line.charAt(c) == 'W') {\n boardObject.setSlotColor(boardObject.getSlot(lineCounter - 3, c / 2), Slot.WHITE);\n } else if (line.charAt(c) == 'O') {\n boardObject.setSlotColor(boardObject.getSlot(lineCounter - 3, c / 2), Slot.EMPTY);\n }\n }\n } else if (lineCounter == endBoardLine + 1) {\n turn = line.substring(13);\n } else if (lineCounter == endBoardLine + 2) {\n human = line.substring(7);\n }\n\n lineCounter++;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n playerWhite.setScore(whiteScore);\n playerBlack.setScore(blackScore);\n\n if (turn.equals(\"White\")) {\n playerWhite.setIsTurn(true);\n playerBlack.setIsTurn(false);\n } else {\n playerBlack.setIsTurn(true);\n playerWhite.setIsTurn(false);\n }\n\n if (human.equals(\"White\")) {\n playerWhite.setComputer(false);\n playerBlack.setComputer(true);\n } else {\n playerWhite.setComputer(true);\n playerBlack.setComputer(false);\n }\n }", "private void generateBoard(){\n\t}", "private void loadTiles(String filename) {\n\t\ttry {\n\t\t\tScanner s;\n\n\t\t\tif (StealthGame.EXPORT)\n\t\t\t\ts = new Scanner(ResourceLoader.load(filename));\n\t\t\telse\n\t\t\t\ts = new Scanner(new File(filename));\n\n\t\t\tif (s.hasNextLine()) {\n\t\t\t\tname = s.nextLine();\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Room has no name\");\n\t\t\t}\n\t\t\txSize = s.nextInt();\n\t\t\tySize = s.nextInt();\n\t\t\ttiles = new Tile[xSize][ySize];\n\t\t\tint xPos = 0;\n\t\t\tint yPos = 0;\n\t\t\tint tileNum = 0;\n\n\t\t\t// List of doors to be given destinations\n\n\t\t\twhile (s.hasNext()) {\n\n\t\t\t\tif (s.hasNextInt()) {\n\t\t\t\t\tparseInt(s, xPos, yPos, tileNum);\n\n\t\t\t\t\txPos++;\n\t\t\t\t\ttileNum++;\n\n\t\t\t\t\tif (xPos >= xSize) {\n\t\t\t\t\t\txPos = 0;\n\t\t\t\t\t\tyPos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Not a basic floor, door or wall\n\t\t\t\telse {\n\t\t\t\t\tString str = s.next();\n\t\t\t\t\tif (str.length() == 1) {\n\t\t\t\t\t\tparseChar(xPos, yPos, tileNum, str);\n\n\t\t\t\t\t\txPos++;\n\t\t\t\t\t\ttileNum++;\n\n\t\t\t\t\t\tif (xPos >= xSize) {\n\t\t\t\t\t\t\txPos = 0;\n\t\t\t\t\t\t\tyPos++;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (str.equals(\"door\")) {\n\t\t\t\t\t\t\tparseDoorDestination(s);\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\ts.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Room - Error loading file - IOException : \"\n\t\t\t\t\t+ e.getMessage());\n\t\t}\n\t}", "public static void readFileBronze(String filename) throws FileNotFoundException{\n try {\n //Scanners and readers and everything??\n File text = new File(filename);\n Scanner inf = new Scanner(text);\n BufferedReader brTest = new BufferedReader(new FileReader(filename));\n String firstLine = brTest.readLine();\n String[] firstLineArray = new String[4];\n firstLineArray = firstLine.split(\" \");\n\n //Determines rows, cols, elevation, number of instructions.\n r = Integer.parseInt(firstLineArray[0]);\n c = Integer.parseInt(firstLineArray[1]);\n e = Integer.parseInt(firstLineArray[2]);\n n = Integer.parseInt(firstLineArray[3]);\n\n //Initializes map.\n map = new int[r][c];\n inf.nextLine();\n for (int i = 0; i < r; i++){\n for (int j = 0; j < c; j++) {\n map[i][j] = inf.nextInt();\n }\n }\n //System.out.println(inf.nextLine());\n //System.out.println(inf.nextLine());\n\n //Instructions.\n\n instructions = new int[n][3];\n for (int i = 0; i < n; i++){\n inf.nextLine();\n for (int j = 0; j < 3; j++){\n instructions[i][j] = inf.nextInt();\n }\n }\n //Exceptions.\n } catch (FileNotFoundException ex){\n System.out.println(\"Yikes\");\n } catch (IOException ex){\n System.out.println(\"Yikes\");\n }\n }", "public void LoadBoard(String strFilePath){\n\t\t_TEST stack = new _TEST();\t\t\t\t\t\t/* TEST */\n\t\tstack.PrintHeader(ID,\"strFilePath:String\", \"\");\t/* TEST */\n\t\tParseFile(strFilePath);\n\t\tstack.PrintTail(ID,\"strFilePath:String\", \"\"); \t\t/* TEST */\n\n\t}", "public static ArrayList<BoardPair> readFile(String inFileName, String format) {\n ArrayList<BoardPair> boardPairs = new ArrayList<BoardPair>();\n try { \n File inFile = new File(inFileName); \n BufferedReader reader = new BufferedReader(new FileReader(inFile));\n String line = null;\n while ((line=reader.readLine()) != null) { // loop as long as there are input lines \n if(line.contains(\"id,delta\")) \n continue; // skip header\n String str = line.trim(); \n // line fields are: id, delta, start1..400, stop1..400\n String[] tokens = str.split(\",\"); \n int row_id = Integer.parseInt( tokens[0] );\n int delta = Integer.parseInt( tokens[1] );\n int[][] startBoard = new int[Consts.BOARD_SIDE][Consts.BOARD_SIDE]; \n int[][] stopBoard = new int[Consts.BOARD_SIDE][Consts.BOARD_SIDE]; \n for(int col=0; col<Consts.BOARD_SIDE; col++) { \n for(int row=0; row<Consts.BOARD_SIDE; row++) {\n if(format==\"train\") { \n // train format: id, delta, start.1-start.400, stop.1-stop.400\n // note column major order!\n int startIndex = col*Consts.BOARD_SIDE + row + 2; \n int stopIndex = startIndex + Consts.BOARD_SIDE*Consts.BOARD_SIDE;\n startBoard[row][col]= Integer.parseInt( tokens[startIndex] );\n stopBoard[ row][col]= Integer.parseInt( tokens[stopIndex ] );\n } \n if(format==\"test\") {\n // test format is: id, delta, stop.1-stop.400\n // note column major order!\n int stopIndex = col*Consts.BOARD_SIDE + row + 2; \n startBoard = null; \n stopBoard[ row][col]= Integer.parseInt( tokens[stopIndex ] );\n }\n }\n }\n boardPairs.add( new BoardPair(row_id, delta, startBoard, stopBoard) );\n } \n reader.close(); \n } catch (IOException e) {\n System.out.println(\"ERROR reading: \" + inFileName);\n }\n return boardPairs;\n }", "public Board(int size, String path) {\n\t\tfilePath = path;\n\t\tdict = new Dictionary(filePath + \"words_scrabble.txt\");\n\t\tlen = size;\n\n\t\t// initialize 2d array of Squares\n\t\tboard = new Square[len][len];\n\t\tfor (int r = 0; r < len; r++)\n\t\t\tfor (int c = 0; c < len; c++)\n\t\t\t\tboard[r][c] = new Square();\n\n\t\t// create a list that contains any letters on the board\n\t\tlettersInPlay = new ArrayList<LetterTile>();\n\n\t\ttry {\n\t\t\tinitScoreModifiers();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File not found: \" + filePath\n\t\t\t\t\t+ \"scoremodifiers.txt\");\n\t\t}\n\t}", "private void loadBoardFromXML(){\n int x = 0;\n int y = 0;\n int width = 0;\n try {\n File inputFile = new File(\"Config\\\\level1.xml\");\n DocumentBuilderFactory dbFactory\n = DocumentBuilderFactory.newInstance();\n DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n Document doc = dBuilder.parse(inputFile);\n doc.getDocumentElement().normalize();\n\n NodeList nList = doc.getElementsByTagName(\"line\");\n for(int n = 0; n < nList.getLength(); ++ n){\n Node nNode = nList.item(n);\n NodeList innerList = nNode.getChildNodes();\n for(int j = 0; j < innerList.getLength(); ++j){\n Node innerNode = innerList.item(j);\n if(innerNode.getTextContent().equals(\"wall\")){\n Wall wall = new Wall(x,y);\n walls.add(wall);\n } else if(innerNode.getTextContent().equals(\"empty_field\")){\n } else if(innerNode.getTextContent().equals(\"player\")){\n player = new Player(x,y);\n } else if(innerNode.getTextContent().equals(\"box\")){\n Box box = new Box(x,y);\n boxes.add(box);\n } else if(innerNode.getTextContent().equals(\"end_position\")){\n End_position end_position = new End_position(x,y);\n end_positions.add(end_position);\n }\n x+= DISTANCE;\n }\n //next row\n y += DISTANCE;\n if(width < x){\n width = x;\n }\n if(LEVEL_WIDTH < x) LEVEL_WIDTH = x;\n x = 0;\n }\n LEVEL_HEIGHT = y;\n }catch(Exception ex){\n ex.printStackTrace();\n }\n }", "public void createBoard() {\n\t\tboard = new Piece[8][8];\n\t\t\n\t\tfor(int i=0; i<8; i++) {\n\t\t\tfor(int j=0; j<8; j++) {\n\t\t\t\tboard[i][j] = null;\n\t\t\t}\n\t\t}\n\t}", "public PuzzleGrid( String filename)\n\t{\n\t loadGridFromFile( filename );\n\t}", "public static Grid buildGrid(String inputFile) throws IOException{\r\n\r\n\t\ttry (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(inputFile), \"utf-8\"))) {\r\n\t\t\t\r\n\t\t\t int width = Integer.parseInt(reader.readLine());//read the grid width\r\n\t\t\t int height = Integer.parseInt(reader.readLine());//read the grid height\r\n\t\t\t \r\n\t\t\t Grid grid = new Grid(width, height);\r\n\t\t\t int typePiece;\r\n\t\t\t int orientation;\r\n\t\t\t \r\n\t\t\t for(int i =0; i < height; i++){//populate the grid\r\n\t\t\t\t for(int j = 0; j< width; j++){\r\n\t\t\t\t\t try{\r\n\t\t\t\t\t\t String[] tab = reader.readLine().trim().split(\"\\\\s+\"); // findbugs warning => null pointer exception is handled 5 lines below\r\n\t\t\t\t\t\t typePiece = Integer.valueOf(tab[0]);\r\n\t\t\t\t\t\t orientation = Integer.valueOf(tab[1]);\r\n\t\t\t\t\t\t grid.setPiece(i, j, new Piece(i,j,typePiece, orientation));\r\n\t\t\t\t\t }catch(NullPointerException e){\r\n\t\t\t\t\t\t throw new IOException(\"File is not in the correct format\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t }\r\n\r\n\t\t\t return grid;\r\n\t\t\t\r\n\t\t}catch(NumberFormatException e){\r\n\t\t\tthrow new IOException(\"File is not in the correct format\");\r\n\t\t}\r\n\t}", "private static Node[][] parseFile(File sudFile) {\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(sudFile))) {\r\n\r\n\t\t\tString currentLine;\r\n\t\t\tString firstLine;\r\n\r\n\t\t\t// Grab the dimensions of the maze and create the array.\r\n\t\t\tfirstLine = br.readLine();\r\n\t\t\tdimensions = Integer.parseInt(firstLine.substring(0, 1));\r\n\t\t\tsubGrids = Integer.parseInt(firstLine.substring(2, 3));\r\n\t\t\tpuzzle = new Node[dimensions][dimensions];\r\n\r\n\t\t\t// Note: Removed domain set present in the N-Queens problem\r\n\t\t\t// Because of how basic the domain of a sudoku problem is\r\n\t\t\t// (1-dimensions) and because checking such values fits so perfectly\r\n\t\t\t// in a for loop.\r\n\t\t\t// for (int i = 1; i <= dimensions; i++) {\r\n\t\t\t// domain.add(i);\r\n\t\t\t// }\r\n\r\n\t\t\tint r = 0;\r\n\t\t\tNode temp;\r\n\t\t\twhile ((currentLine = br.readLine()) != null) {\r\n\t\t\t\tfor (int c = 0; c < dimensions; c++) {\r\n\t\t\t\t\tif (currentLine.charAt(c) == '-') {\r\n\t\t\t\t\t\t// let's replace the dashes with zeroes for comparison's\r\n\t\t\t\t\t\t// sake, and for variable typing's sake\r\n\t\t\t\t\t\ttemp = new Node(0, new HashSet<Integer>(), r, c);\r\n\t\t\t\t\t\tpuzzle[r][c] = temp;\r\n\t\t\t\t\t\t// Keep track of these \"unsolved\" nodes\r\n\t\t\t\t\t\tconstrainedNodes.add(temp);\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttemp = new Node(Character.getNumericValue(currentLine.charAt(c)), new HashSet<Integer>(), r, c);\r\n\t\t\t\t\t\tpuzzle[r][c] = temp;\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tr++; // next row for next pass through loop\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tprintArray(puzzle);\r\n\r\n\t\treturn puzzle;\r\n\r\n\t}", "private void readFromFile(String filename) {\n\t\ttry {\n\t\t Scanner read = new Scanner(new File(filename));\n\t\t String line;\n\t\t int counter = 0;\n\t\t String temp;\n\t\t line = read.nextLine();\n\t\t temp = line.substring(0);\n\t\t height = convertToInt(temp);\n\n\t\t line = read.nextLine();\n\t\t temp = line.substring(0);\n\n\t\t length = convertToInt(temp);\n\t\t size = height*length;\n\t\t \n\t\t squares = new Square[size][size];\n\n\t\t while(read.hasNextLine()) {\n\t\t\t\tline = read.nextLine();\n\t\t \tfor (int i = 0; i < line.length(); i++) {\n\t\t \t temp = line.substring(i, i+1);\n\n\t\t \t if (temp.equals(\".\")) {\n\t\t \t\t\tsquares[counter][i] = new FindValue(0);\n\t\t \t } \n\t\t \t else {\n\t\t\t\t\t\tsquares[counter][i] = new PreFilled(convertToInt(temp));\n\t\t\t \t\t}\n\t\t \t}\n\t\t \tcounter++;\n\t\t }\n\t\t} catch(IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n }", "public static void main(String[] args) {\n\n // create initial board from file\n In in = new In(args[0]);\n int N = in.readInt();\n int[][] tiles = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n tiles[i][j] = in.readInt();\n Board initial = new Board(tiles);\n\n // check if puzzle is solvable; if so, solve it and output solution\n if (initial.isSolvable()) {\n Solver solver = new Solver(initial);\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n\n // if not, report unsolvable\n else {\n StdOut.println(\"Unsolvable puzzle\");\n }\n}", "private void createDeck() {\n FileReader reader = null;\n try {\n try {\n reader = new FileReader(deckInputFile);\n Scanner in = new Scanner(reader);\n \n // read the top line column names of the file\n // e.g. description, size, speed etc.\n String categories = in.nextLine();\n\n // loop through the file line by line, creating a card and adding to the deck\n while (in.hasNextLine()) {\n String values = in.nextLine();\n Card newCard = new Card(categories, values);\n deck.add(newCard);\n }\n } finally {\n if (reader != null) {\n reader.close();\n }\n }\n } catch (IOException e) {\n System.out.print(\"error\");\n }\n }", "@Test(expected = Exception.class)\r\n public void testBadBoard2() throws Exception {\n new Board(\"src/minesweeper/server/badBoard2.txt\");\r\n }", "public void fillBoardFromCSV(String pathToCSV){\r\n \r\n BufferedReader br = null;\r\n String line = \" \";\r\n int index = 0;\r\n \r\n \r\n try{\r\n br = new BufferedReader(new FileReader(pathToCSV));\r\n while ((line = br.readLine()) != null) {\r\n String[] lines = line.split(\",\");\r\n System.out.println(lines.length);\r\n for(int i = 0; i < 11; i++){\r\n if(lines[i].equals(\"f\")){\r\n board[index][i] = new Flat(index,i);\r\n }\r\n if(lines[i].equals(\"s\")){\r\n board[index][i] = new Slot(index,i);\r\n }\r\n }\r\n index++; \r\n }\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } finally {\r\n if (br != null) {\r\n try {\r\n br.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n \r\n \r\n }", "public static Board createBoard(String boardConfigFile) throws IOException {\n BufferedReader br = null;\n\n // 101 squares, start at 1 index to make it more similar to a game board\n Square[] squares = new Square[101];\n for(int i=0; i<squares.length; i++) {\n // Fill all squares with default value\n squares[i] = new Square(i, 'N', 0);\n }\n\n // Start reading in the board config for chutes/ladders event squares\n try {\n br = new BufferedReader(new FileReader(boardConfigFile));\n String line = \"\";\n int lineCount = 0;\n while((line = br.readLine()) != null) {\n if (lineCount > 0) {\n String[] data = line.split(\",\");\n // data[0] = square # (String) * Convert to int\n // data[1] = eventType char (String) * Convert to char\n // data[2] = offset # (String) * Convert to int\n // data[3] = endSquare # (String) * Not needed.\n\n int eventSquare = Integer.parseInt(data[0]);\n char eventType = data[1].toUpperCase().charAt(0);\n int eventOffset = Integer.parseInt(data[2]);\n Square curr = new Square(eventSquare, eventType, eventOffset);\n\n squares[eventSquare] = curr;\n }\n\n lineCount++;\n }\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n return new Board(squares);\n }", "public SudokuSolver(String filename) {\n this.board = new SudokuBoard(filename);\n }", "public void newDeck()\r\n\t{\r\n\t\t// attempts to read the file\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// sets up file input\r\n\t\t\tFile file = new File(FILE_NAME);\r\n\t\t\tScanner inputFile = new Scanner(file);\r\n\t\t\t\r\n\t\t\t// creates counter for array input\r\n\t\t\tint i = 0;\r\n\t\t\t\r\n\t\t\t// reads card notations from file\r\n\t\t\twhile (inputFile.hasNext() && i < DECK_SIZE)\r\n\t\t\t{\r\n\t\t\t\tcards[i] = inputFile.nextLine();\r\n\t\t\t\t\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\r\n\t\t\t// Closes the file.\r\n\t\t\tinputFile.close();\r\n\t\t\t\r\n\t\t\t// Sets topCard\r\n\t\t\ttopCard = 51;\r\n\t\t\t\r\n\t\t\t// shuffles deck\r\n\t\t\tshuffle();\r\n\t\t}\r\n\t\tcatch (FileNotFoundException e)\r\n\t\t{\r\n\t\t\t// prints error if file not found\r\n\t\t\tSystem.out.println(\"The file \" + FILE_NAME + \" does not exist.\");\r\n\t\t}\r\n\t}", "public void fromFile(String fileName)\n {\n //definir dados\n int i;\n int j;\n int lin;\n int col;\n String linha;\n FILE arquivo;\n\n arquivo = new FILE(FILE.INPUT, fileName);\n\n //obter dimensoes\n lin = lines();\n col = columns();\n\n //verificar se dimensoes validas\n if( lin <= 0 || col <= 0 )\n {\n IO.println(\"ERRO: Tamanho invalido. \");\n } //end\n else\n {\n //verificar se arquivo e' valido\n if( arquivo == null )\n {\n IO.println(\"ERRO: Arquivo invalido. \");\n } //end\n else\n {\n //ler a primeira linha do arquivo\n linha = arquivo.readln();\n\n //verificar se ha' dados\n if( linha == null )\n {\n IO.println(\"ERRO: Arquivo vazio. \");\n } //end\n else\n {\n linha = arquivo.readln();\n for( i = 0; i < lin; i++)\n {\n for( j = 0; j < col; j++)\n {\n //ler linha do arquivo\n linha = arquivo.readln();\n table[ i ][ j ] = linha;\n } //end repetir\n } //end repetir\n //fechar arquivo (indispensavel)\n arquivo.close();\n } //end se\n } //end se\n } //end se\n }", "public abstract void initGrid(String filename)\r\n throws NumberFormatException, FileNotFoundException, IOException;", "MainBoard createMainBoard();", "final public void fieldFromSrc(){\n List<String> lines = readSrc();\n size = Integer.parseInt(lines.get(0));\n Tile[] tiles = new Tile[size*size];\n int count = 0;\n Tile t;\n \n char[][] fieldChars = new char[size][size];\n \n for(int Y=0; Y<size; Y++){\n for(int X=0; X<size; X++){\n try{\n fieldChars[X][Y] = lines.get(Y+1).charAt(X);\n }catch(StringIndexOutOfBoundsException e){\n System.out.println(e);\n }\n }\n }\n \n for(int Y=0; Y<size; Y++){\n for(int X=0; X<size; X++){\n Coordinaat C = new Coordinaat(X,Y); \n switch(fieldChars[X][Y]){\n case 'M' : \n t = new Muur(C); \n break;\n case 'V' :\n t = new Veld(C);\n break;\n case 'E' :\n t = new EindVeld(C);\n break;\n default :\n t = new Tile(C);\n break;\n }\n tiles[count] = t;\n count++;\n }\n }\n \n fillField(tiles,size);\n createMoveAbles(lines.subList(size+2, lines.size()));\n }", "public void load (){\n try{\n FileInputStream fis = new FileInputStream(\"game.data\");\n ObjectInputStream o = new ObjectInputStream(fis);\n for (int i = 0; i < 8; i++){\n for (int j = 0; j < 8; j++){\n String loaded = o.readUTF();\n if (loaded.equals(\"null\")){\n Tiles[i][j].removePiece();\n }else if (loaded.equals(\"WhiteLeftKnight\")){\n Tiles[i][j].setPiece(WhiteLeftKnight);\n }else if (loaded.equals(\"WhiteRightKnight\")){\n Tiles[i][j].setPiece(WhiteRightKnight);\n }else if (loaded.equals(\"WhiteLeftBishop\")){\n Tiles[i][j].setPiece(WhiteLeftBishop);\n }else if (loaded.equals(\"WhiteRightBishop\")){\n Tiles[i][j].setPiece(WhiteRightBishop);\n }else if (loaded.equals(\"WhiteLeftRook\")){\n Tiles[i][j].setPiece(WhiteLeftRook);\n }else if (loaded.equals(\"WhiteRightRook\")){\n Tiles[i][j].setPiece(WhiteRightRook);\n }else if (loaded.equals(\"WhiteQueen\")){\n Tiles[i][j].setPiece(WhiteQueen);\n }else if (loaded.equals(\"WhiteKing\")){\n Tiles[i][j].setPiece(WhiteKing);\n }else if (loaded.equals(\"WhitePromotedRookPawn\")){\n Rook WhitePromotedRookPawn = new Rook(\"WhitePromotedRookPawn\");\n WhitePromotedRookPawn.setIcon(WhiteRookImg);\n Tiles[i][j].setPiece(WhitePromotedRookPawn);\n }else if (loaded.equals(\"WhitePromotedBishopPawn\")){\n Bishop WhitePromotedBishopPawn = new Bishop(\"WhitePromotedBishopPawn\");\n WhitePromotedBishopPawn.setIcon(WhiteBishopImg);\n Tiles[i][j].setPiece(WhitePromotedBishopPawn);\n }else if (loaded.equals(\"WhitePromotedKnightPawn\")){\n Knight WhitePromotedKnightPawn = new Knight(\"WhitePromotedKnightPawn\");\n WhitePromotedKnightPawn.setIcon(WhiteKnightImg);\n Tiles[i][j].setPiece(WhitePromotedKnightPawn);\n }else if (loaded.equals(\"WhitePromotedQueenPawn\")){\n Queen WhitePromotedQueenPawn = new Queen(\"WhitePromotedQueenPawn\");\n WhitePromotedQueenPawn.setIcon(WhiteQueenImg);\n Tiles[i][j].setPiece(WhitePromotedQueenPawn);\n }else if (loaded.equals(\"BlackLeftKnight\")){\n Tiles[i][j].setPiece(BlackLeftKnight);\n }else if (loaded.equals(\"BlackRightKnight\")){\n Tiles[i][j].setPiece(BlackRightKnight);\n }else if (loaded.equals(\"BlackLeftBishop\")){\n Tiles[i][j].setPiece(BlackLeftBishop);\n }else if (loaded.equals(\"BlackRightBishop\")){\n Tiles[i][j].setPiece(BlackRightBishop);\n }else if (loaded.equals(\"BlackLeftRook\")){\n Tiles[i][j].setPiece(BlackLeftRook);\n }else if (loaded.equals(\"BlackRightRook\")){\n Tiles[i][j].setPiece(BlackRightRook);\n }else if (loaded.equals(\"BlackQueen\")){\n Tiles[i][j].setPiece(BlackQueen);\n }else if (loaded.equals(\"BlackKing\")){\n Tiles[i][j].setPiece(BlackKing);\n }else if (loaded.equals(\"BlackPromotedQueenPawn\")){\n Queen BlackPromotedQueenPawn = new Queen(\"BlackPromotedQueenPawn\");\n BlackPromotedQueenPawn.setIcon(BlackQueenImg);\n Tiles[i][j].setPiece(BlackPromotedQueenPawn);\n }else if (loaded.equals(\"BlackPromotedRookPawn\")){\n Rook BlackPromotedRookPawn = new Rook(\"BlackPromotedRookPawn\");\n BlackPromotedRookPawn.setIcon(BlackRookImg);\n Tiles[i][j].setPiece(BlackPromotedRookPawn);\n }else if (loaded.equals(\"BlackPromotedBishopPawn\")){\n Bishop BlackPromotedBishopPawn = new Bishop(\"BlackPromotedBishopPawn\");\n BlackPromotedBishopPawn.setIcon(BlackBishopImg);\n Tiles[i][j].setPiece(BlackPromotedBishopPawn);\n }else if (loaded.equals(\"BlackPromotedKnightPawn\")){\n Knight BlackPromotedKnightPawn = new Knight(\"BlackPromotedKnightPawn\");\n BlackPromotedKnightPawn.setIcon(BlackKnightImg);\n Tiles[i][j].setPiece(BlackPromotedKnightPawn);\n }else if (loaded.equals(\"WhitePawn0\")){\n Tiles[i][j].setPiece(WhitePawns[0]);\n }else if (loaded.equals(\"WhitePawn1\")){\n Tiles[i][j].setPiece(WhitePawns[1]);\n }else if (loaded.equals(\"WhitePawn2\")){\n Tiles[i][j].setPiece(WhitePawns[2]);\n }else if (loaded.equals(\"WhitePawn3\")){\n Tiles[i][j].setPiece(WhitePawns[3]);\n }else if (loaded.equals(\"WhitePawn4\")){\n Tiles[i][j].setPiece(WhitePawns[4]);\n }else if (loaded.equals(\"WhitePawn5\")){\n Tiles[i][j].setPiece(WhitePawns[5]);\n }else if (loaded.equals(\"WhitePawn6\")){\n Tiles[i][j].setPiece(WhitePawns[6]);\n }else if (loaded.equals(\"WhitePawn7\")){\n Tiles[i][j].setPiece(WhitePawns[7]);\n }else if (loaded.equals(\"BlackPawn0\")){\n Tiles[i][j].setPiece(BlackPawns[0]);\n }else if (loaded.equals(\"BlackPawn1\")){\n Tiles[i][j].setPiece(BlackPawns[1]);\n }else if (loaded.equals(\"BlackPawn2\")){\n Tiles[i][j].setPiece(BlackPawns[2]);\n }else if (loaded.equals(\"BlackPawn3\")){\n Tiles[i][j].setPiece(BlackPawns[3]);\n }else if (loaded.equals(\"BlackPawn4\")){\n Tiles[i][j].setPiece(BlackPawns[4]);\n }else if (loaded.equals(\"BlackPawn5\")){\n Tiles[i][j].setPiece(BlackPawns[5]);\n }else if (loaded.equals(\"BlackPawn6\")){\n Tiles[i][j].setPiece(BlackPawns[6]);\n }else if (loaded.equals(\"BlackPawn7\")){\n Tiles[i][j].setPiece(BlackPawns[7]);\n }\n }\n }\n player = o.readInt();\n if (player == 1){\n area.setText(\"\\t\\t\\tPlayer \"+player+\" (White)\");\n }else{\n area.setText(\"\\t\\t\\tPlayer \"+player+\" (Black)\");\n }\n o.close();\n OriginalColor();\n }catch (Exception ex){\n\n }\n }", "@Override\n public void createShoeFromFile(String fileName) {\n\n File file = new File(fileName);\n Scanner myReader = null;\n try {\n myReader = new Scanner(file);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n while (myReader.hasNextLine()) {\n String rankStr = \"\";\n Rank rank;\n rank = Rank.ACE;\n String suit = \"\";\n\n // The cards are separated by spaces in the file\n // Splits next line of the file into chunks containing each Card of the Shoe\n // Iterates over each card\n for (String data : myReader.nextLine().split(\" \"))\n {\n int len = data.length();\n if(data.length() == 3){\n rankStr = \"\";\n suit = \"\";\n rankStr += String.valueOf(data.charAt(0));\n rankStr += String.valueOf(data.charAt(1));\n //1 char suit\n suit = String.valueOf(data.charAt(2));\n this.cards.add(new Card( Suit.valueOf(suit), rank.getRank(rankStr), true));\n }else if(data.length() == 2){\n rankStr = \"\";\n suit = \"\";\n rankStr = String.valueOf(data.charAt(0));\n suit = String.valueOf(data.charAt(1));\n this.cards.add(new Card(Suit.valueOf(suit), rank.getRank(rankStr), true));\n }else if(data.length() == 0){\n return;\n }else{\n System.out.println(\"Error reading card.\");\n System.exit(0);\n }\n }\n }\n myReader.close();\n }", "private void updateBoard() throws FileNotFoundException {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Creating board image\");\r\n\t\tBufferedImage combined = new BufferedImage(GlobalVars.images.get(\"Board1\").getWidth(), GlobalVars.images.get(\"Board1\").getHeight(), BufferedImage.TYPE_INT_ARGB);\r\n\t\t\r\n\t\tGraphics g = combined.getGraphics();\r\n\t\t// Draws board template first\r\n\t\tg.drawImage(GlobalVars.images.get(\"Board1\"), 0, 0, null);\r\n\t\t\r\n\t\t// Loops through contents and adds secrets, artifacts, idols\r\n\t\tfor (int i = 0; i < mapContents.length; i++) {\r\n\t\t\tif (mapContents[i] != null && mapContents[i] != \"heart\") {\r\n\t\t\t\tint offsetX = 4;\r\n\t\t\t\tint offsetY = -1;\r\n\t\t\t\tif (mapContents[i].startsWith(\"Minor\")) {\r\n\t\t\t\t\toffsetX = 7;\r\n\t\t\t\t\toffsetY = 3;\r\n\t\t\t\t}\r\n\t\t\t\t// Specific spots to this map\r\n\t\t\t\tif (i == 18) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), 206, 286, null);\r\n\t\t\t\t} else if (i == 19) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), 299, 287, null);\r\n\t\t\t\t} else if (i == 25) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), 297, 352, null);\r\n\t\t\t\t} else if (i == 28) {\r\n\t\t\t\t\tint num = Integer.parseInt(mapContents[i].substring(10));\r\n\t\t\t\t\tif (num > 0) {\r\n\t\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"MonkeyIdol\"), 28, 369, null);\r\n\t\t\t\t\t\tif (num > 1) {\r\n\t\t\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"MonkeyIdol\"), 28, 395, null);\r\n\t\t\t\t\t\t\tif (num > 2) {\r\n\t\t\t\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"MonkeyIdol\"), 28, 422, null);\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} else {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), GlobalVars.playerCoordsPerRoom[i][0]+offsetX, GlobalVars.playerCoordsPerRoom[i][1]+offsetY, null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Draws dragons\r\n\t\tif (attackLevel == 0) g.drawImage(GlobalVars.images.get(\"Dragon\"), 395, 548, null);\r\n\t\telse if (attackLevel == 1) g.drawImage(GlobalVars.images.get(\"Dragon\"), 456, 542, null);\r\n\t\telse if (attackLevel == 2) g.drawImage(GlobalVars.images.get(\"Dragon\"), 513, 510, null);\r\n\t\telse if (attackLevel == 3) g.drawImage(GlobalVars.images.get(\"Dragon\"), 549, 462, null);\r\n\t\telse if (attackLevel == 4) g.drawImage(GlobalVars.images.get(\"Dragon\"), 561, 412, null);\r\n\t\telse if (attackLevel == 5) g.drawImage(GlobalVars.images.get(\"Dragon\"), 551, 349, null);\r\n\t\telse {\r\n\t\t\tg.drawImage(GlobalVars.images.get(\"Dragon\"), 552, 287, null);\r\n\t\t}\r\n\t\t\r\n\t\t// Draws characters\r\n\t\tg.drawImage(GlobalVars.images.get(\"RedChar\"), p1.getPiece().getX(), p1.getPiece().getY(), null);\r\n\t\tif (playerCount >= 2) {\r\n\t\t\tg.drawImage(GlobalVars.images.get(\"BlueChar\"), p2.getPiece().getX(), p2.getPiece().getY(), null);\r\n\t\t\tif (playerCount >= 3) {\r\n\t\t\t\tg.drawImage(GlobalVars.images.get(\"YellowChar\"), p3.getPiece().getX(), p3.getPiece().getY(), null);\r\n\t\t\t\tif (playerCount >= 4) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"GreenChar\"), p4.getPiece().getX(), p4.getPiece().getY(), null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Writes the combined image into a file\r\n\t\ttry {\r\n\t\t\tImageIO.write(combined, \"PNG\", new File(\"newboard.png\"));\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t// Builds an embed and sends it to the filesChannel\r\n\t\tEmbedBuilder embed = new EmbedBuilder();\r\n\t\tembed.setTitle(gameChannel.getName());\r\n\t\tembed.setColor(Color.GRAY);\r\n\t\tInputStream test = new FileInputStream(\"newboard.png\");\r\n\t\tembed.setImage(\"attachment://newboard.png\");\r\n\t\tMessageBuilder m = new MessageBuilder();\r\n\t\tm.setEmbed(embed.build());\r\n\t\tGlobalVars.filesChannel.sendFile(test, \"newboard.png\", m.build()).queue();\r\n\t}", "public void initializeBoard() {\r\n int x;\r\n int y;\r\n\r\n this.loc = this.userColors();\r\n\r\n this.board = new ArrayList<ACell>();\r\n\r\n for (y = -1; y < this.blocks + 1; y += 1) {\r\n for (x = -1; x < this.blocks + 1; x += 1) {\r\n ACell nextCell;\r\n\r\n if (x == -1 || x == this.blocks || y == -1 || y == this.blocks) {\r\n nextCell = new EndCell(x, y);\r\n } else {\r\n nextCell = new Cell(x, y, this.randColor(), false);\r\n }\r\n if (x == 0 && y == 0) {\r\n nextCell.flood();\r\n }\r\n this.board.add(nextCell);\r\n }\r\n }\r\n this.stitchCells();\r\n this.indexHelp(0, 0).floodInitStarter();\r\n }", "public void start() {\n clear();\n // Assigning chess pieces to players.\n whitePieces.add(new Piece(Owner.WHITE, Who.KING, Rank.R1, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.QUEEN, Rank.R1, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.H));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.H));\n\n for (Piece p : whitePieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n blackPieces.add(new Piece(Owner.BLACK, Who.KING, Rank.R8, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.QUEEN, Rank.R8, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.H));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.H));\n\n for (Piece p : blackPieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n whoseTurn = Owner.WHITE;\n canCastle = 15;\n passer = null;\n movesDone = lastEatMove = 0;\n }", "public Plain(String inputFileName) throws FileNotFoundException {\n File fileReader = new File(inputFileName);\n Scanner fileScanner = new Scanner(fileReader);\n while (fileScanner.hasNextLine()) {\n width++;\n fileScanner.nextLine();\n }\n fileScanner.close();\n Scanner scanner = new Scanner(fileReader);\n Plain plain = new Plain(width + 2);\n grid = new Living[width + 2][width + 2];\n System.out.println(\"... reading ...\");\n while (scanner.hasNext()) {\n for (int j = 1; j < grid.length - 1; j++) {\n for (int k = 1; k < grid[j].length - 1; k++) {\n String nextFileObj = scanner.next();\n char firstLetter = nextFileObj.charAt(0);\n int animalAge = 0;\n if (nextFileObj.length() == 2) {\n animalAge = Character.getNumericValue(nextFileObj.charAt(1));\n }\n switch (firstLetter) {\n case 'B':\n grid[j][k] = new Badger(plain, j, k, animalAge);\n break;\n case 'E':\n grid[j][k] = new Empty(plain, j, k);\n break;\n case 'F':\n grid[j][k] = new Fox(plain, j, k, animalAge);\n break;\n case 'G':\n grid[j][k] = new Grass(plain, j, k);\n break;\n case 'R':\n grid[j][k] = new Rabbit(plain, j, k, animalAge);\n break;\n default:\n grid[j][k] = null;\n break;\n }\n }\n }\n }\n scanner.close();\n System.out.println(\" reading complete \");\n }", "public Solver(String inputFile){\r\n\tthis();\r\n\tString[][] puzzle = readPuzzle(inputFile);\r\n\t\r\n\tfor (int r = 0; r < puzzle.length; r++){\r\n\t for (int c = 0; c < puzzle[0].length; c++){\r\n\t\tboard[r][c] = new Box();\r\n\t }\r\n\t}\r\n\r\n\tfor (int r = 0; r < puzzle.length; r++){\r\n\t for (int c = 0; c < puzzle[0].length; c++){\r\n\t if (!(puzzle[c][r].equals(\"_\"))){\r\n\t\t int given = Integer.parseInt(puzzle[c][r]);\r\n\t\t assign(given, r, c);\r\n\t\t}\r\n\t }\r\n\t}\r\n }", "public void importFileClick() {\n\n //Lets the user choose a file location\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Open Resource File\");\n fileChooser.setInitialDirectory(new File(System.getProperty(\"user.dir\")));\n fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Run-length encoding\",\n \"*.rle\"));\n File file = fileChooser.showOpenDialog(new Stage());\n\n //If a file was chosen, will stop the game and set the generation to 0 and try to load the file.\n if (file != null) {\n timeline.stop();\n gOL.resetGenCounter();\n generationLabel.setText(Integer.toString(gOL.getGenCounter()));\n try {\n fileHandler.readGameBoardFromDisk(file);\n } catch (IOException ie) {\n //Produces a warning if unsuccessful\n PopUpAlerts.ioAlertFromDisk();\n }\n }\n\n aliveLabel.setText(Integer.toString(board.getCellsAlive()));\n ruleLabel.setText(gOL.getRuleString().toUpperCase());\n isMovable = true;\n canvasArea.requestFocus();\n setFocusTraversable(false);\n\n //Resets offset to accommodate for the new pattern and calls draw().\n canvasDrawer.resetOffset(board, canvasArea);\n draw();\n }", "@SuppressWarnings(\"resource\")\n\tpublic void loadLayoutConfig() throws IOException, BadConfigFormatException {\n\t\tFileReader layoutInput = new FileReader(layoutConfigFile);\t\t\t\t\t\t\t// File reader to parse the layout file\n\t\tScanner input = new Scanner(layoutInput);\t\t\t\t\t\t\t\t\t\t\t// Scanner to use the data from the File Reader\n\n\t\tArrayList<String[]> inputGrid = new ArrayList<String[]>();\t\t\t\t\t\t\t// Arraylist of an Array of Strings This is necessary because we want a dynamic size\n\t\twhile(input.hasNextLine()) {\n\t\t\tString thisLine = input.nextLine();\t\t\t\t\t\t\t\t\t\t\t\t// Gather the next line from the layout file\n\t\t\tString grid[] = thisLine.split(\",\"); \t\t\t\t\t\t\t\t\t\t\t// Separating the items separated by commas and turning them into an array of strings\n\t\t\tinputGrid.add(grid); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ads csv input to the grid\n\t\t}\n\t\tsetNumColumns(inputGrid.get(0).length);\t\t\t\t\t\t\t\t\t\t\t\t// Setting the number of columns to be the length of the first row\n\t\tsetNumRows(inputGrid.size());\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Setting the number of rows to the number of elements in the input grid\n\n\t\tthis.grid = new BoardCell[numRows][numColumns];\t\t\t\t\t\t\t\t\t\t// Declaring the unpopulated grid and it's size\n\n\t\tfor(int r = 0; r < numRows; r++) { \t\t\t\t\t\t\t\t\t\t\t\t\t// iterating through each row\n\t\t\tString temp[] = inputGrid.get(r);\t\t\t\t\t\t\t\t\t\t\t\t// grabbing a row from the input grid\n\t\t\tif(temp.length != numColumns) {\t\t\t\t\t\t\t\t\t\t\t\t\t// test to see if any of the rows are of incorrect length\n\t\t\t\tthrow new BadConfigFormatException(\"uneven rows.\"); \t\t\t\t\t\t// Custom exception for BadConfigFormatException\n\t\t\t} else {\n\t\t\t\tif(temp[0].contains(\"\")) {\t// get rid of\t\t\t\t\t\t\t\t// test to see if the file conversion from CSV standard to UTF-8 has added artifacts\n\t\t\t\t\tString replace = temp[0].replace(\"\",\"\");\t\t\t\t\t\t\t\t// creates a temporary string that does not contain the artifact\n\t\t\t\t\ttemp[0] = replace;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// sets the original string to be the temporary string, removing the artifact from the array\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int c = 0; c < numColumns; c++) {\t\t\t\t\t\t\t\t\t\t\t// iterating through each element in the particular row\n\t\t\t\tthis.grid[r][c] = new BoardCell(r,c);\t\t\t\t\t\t\t\t\t\t// creates a BoardCell for each location on the board\n\t\t\t\tString auto = temp[c];\t\t\t\t\t\t\t\t\t\t\t\t\t\t// creates a temporary string for each location on the board\n\t\t\t\tif(!(roomMap.containsKey(auto.charAt(0)))) {\t\t\t\t\t\t\t\t// Checks and makes sure each cell is a cell type identified in the setup document\n\t\t\t\t\tthrow new BadConfigFormatException(\"unspecified room detected.\"); \t\t// Custom exception for BadConfigFormatException\n\t\t\t\t} else {\n\t\t\t\t\tif(auto.length() > 1) { \t\t\t\t\t\t\t\t\t\t\t\t// Identifying Special cell (more than one initial per cell)\n\t\t\t\t\t\tString directions = \"^><v\";\n\t\t\t\t\t\tif(directions.indexOf(auto.charAt(1)) != -1) { \t\t\t\t\t\t// Handling doorways\n\t\t\t\t\t\t\tthis.grid[r][c].setDoorDirection(auto.charAt(1));\t\t\t\t// Setting the door direction of the cell to be wherever the arrow points\n\t\t\t\t\t\t\tthis.grid[r][c].isDoorway();\t\t\t\t\t\t\t\t\t// Setting the cell to identify as a door\n\t\t\t\t\t\t\tthis.grid[r][c].setInitial(auto.charAt(0));\t\t\t\t\t\t// Setting the initial of the cell \n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(auto.charAt(1) == '#') { \t\t\t\t\t\t\t\t\t// Handling a room label\n\t\t\t\t\t\t\tthis.grid[r][c].setLabel(true);\t\t\t\t\t\t\t\t\t// Setting the cell to identify as a room label\n\t\t\t\t\t\t\tthis.grid[r][c].setInitial(auto.charAt(0));\t\t\t\t\t\t// Setting the initial of the cell \n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(auto.charAt(1) == '*') { \t\t\t\t\t\t\t\t\t// Handling a room center\n\t\t\t\t\t\t\tthis.grid[r][c].setCenter(true);\t\t\t\t\t\t\t\t// Setting the cell to identify as a room center\n\t\t\t\t\t\t\tthis.grid[r][c].setInitial(auto.charAt(0));\t\t\t\t\t\t// Setting the initial of the cell \n\t\t\t\t\t\t}\n\t\t\t\t\t\telse { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Handling a secret passageway\n\t\t\t\t\t\t\tthis.grid[r][c].setSecretPassage(auto.charAt(1));\t\t\t\t// Setting the cell to identify as a secret passage\n\t\t\t\t\t\t\tthis.grid[r][c].setInitial(auto.charAt(0));\t\t\t\t\t\t// Setting the initial of the cell \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Handling normal cells (only one initial per cell)\n\t\t\t\t\t\tthis.grid[r][c].setInitial(auto.charAt(0));\t\t\t\t\t\t\t// Setting the initial of the cell \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Iterating back through each cell after they have all been assigned\n\t\t// This is done so that when making the door map there are no cells that are still null\n\t\tfor(int i = 0; i < this.numRows ; i++){\t\t\t\t\t\t\t\t\t\t\t\t// Iterating through the rows\n\t\t\tfor(int j = 0; j < this.numColumns ; j++){\t\t\t\t\t\t\t\t\t\t// Iterating through each cell per row\n\t\t\t\tif(this.getCell(i,j).isDoorway()) {\t\t\t\t\t\t\t\t\t\t\t// Getting each of the doorways\n\t\t\t\t\tswitch (this.getCell(i,j).getDoorDirection()) {\n\t\t\t\t\tcase UP:\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Getting the doors that point up\n\t\t\t\t\t\troomMap.get(this.getCell(i-1,j).getInitial()).addDoor(this.getCell(i,j)); // Assigning each door to the room it points to\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase LEFT:\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Getting the doors that point left\n\t\t\t\t\t\troomMap.get(this.getCell(i,j-1).getInitial()).addDoor(this.getCell(i,j)); // Assigning each door to the room it points to\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DOWN:\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Getting the doors that point down\n\t\t\t\t\t\troomMap.get(this.getCell(i+1,j).getInitial()).addDoor(this.getCell(i,j)); // Assigning each door to the room it points to\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RIGHT:\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Getting the doors that point right\n\t\t\t\t\t\troomMap.get(this.getCell(i,j+1).getInitial()).addDoor(this.getCell(i,j)); // Assigning each door to the room it points to\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\telse if(this.getCell(i,j).isLabel()) {\t\t\t\t\t\t\t\t\t\t// getting the label cells\n\t\t\t\t\troomMap.get(this.getCell(i,j).getInitial()).setLabelCell(this.getCell(i,j)); // adding the label cells to each room\n\t\t\t\t}\n\t\t\t\telse if(this.getCell(i,j).isRoomCenter()) {\t\t\t\t\t\t\t\t\t// getting the center cells\n\t\t\t\t\troomMap.get(this.getCell(i,j).getInitial()).setCenterCell(this.getCell(i,j)); // adding the center cells to each room\n\t\t\t\t}\n\t\t\t\telse if(this.getCell(i,j).getSecretPassage() != 0) {\t\t\t\t\t\t// getting the secret passage cells\n\t\t\t\t\troomMap.get(this.getCell(i,j).getInitial()).setSecretPassage(this.getCell(i,j).getSecretPassage()); // adding the secret passage char to each room\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < this.numRows ; i++){\t\t\t\t\t\t\t\t\t\t\t\t// Iterating through the rows\n\t\t\tfor(int j = 0; j < this.numColumns ; j++){\t\t\t\t\t\t\t\t\t\t// Iterating through each cell per row\n\t\t\t\tgenerateAdjList(i, j);\n\t\t\t}\n\t\t}\n\t\tlayoutInput.close();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Closing the layout document\n\t}", "public Game(InputStream in) throws Exception\n\t{\n\t\tif(in == null)\n\t\t\tthrow new Exception(\"Input cannot be null\");\n\n\t\t//initialize variables\n\t\toriginalPuzzle = new ArrayList<>();\n\t\tonePossibility = 0;\n\n\t\t//read in the game\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\t\tString str;\n\t\twhile((str = reader.readLine()) != null){\n\t\t\toriginalPuzzle.add(str);\n\t\t}\n\t\tin.close();\n\t\treader.close();\n\n\t\t//set the size and blocksize variables\n\t\tsize = Integer.parseInt(originalPuzzle.get(0));\n\n\t\tHashSet<String> characters = new HashSet<>(size * 2);\n\n\t\t//get the characters\n\t\tString[] stringCharacters = originalPuzzle.get(1).split(\"\\\\s\");\n\t\tfor(String character : stringCharacters){\n\t\t\tcharacters.add(character);\n\t\t}\n\n\t\t//validate the puzzle\n\t\tvalidatePuzzle(characters);\n\n\t\t//start creating the different houses\n\t\trows = new Row[size];\n\t\tcolumns = new Column[size];\n\t\tblocks = new Block[size/getBlockSize()][size/getBlockSize()];\n\n\t\t//construct a two dimensional cell array first\n\t\tCell[][] board = new Cell[size][size];\n\n\t\t// read all cells into the board array\n\t\tfor(int j = 0; j < size; j++){\n\t\t\tString[] boardLine = originalPuzzle.get(j+2).split(\"\\\\s\");\n\t\t\tfor(int i = 0; i < size; i++){\n\t\t\t\tboard[i][j] = new Cell(boardLine[i], stringCharacters, i, j);\n\t\t\t\tboard[i][j].Attach(this);\n\t\t\t}\n\t\t}\n\n\t\t//create the individual rows and columns\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tCell[] row = new Cell[size];\n\t\t\tCell[] column = new Cell[size];\n\t\t\tfor(int j = 0; j < size; j++){\n\t\t\t\trow[j] = board[j][i];\n\t\t\t\tcolumn[j] = board[i][j];\n\t\t\t}\n\t\t\tRow r = new Row(row);\n\t\t\tColumn c = new Column(column);\n\n\t\t\trows[i] = r;\n\t\t\tcolumns[i] = c;\n\t\t}\n\n\t\t//create the blocks\n\t\tfor(int blockX = 0; blockX < size/getBlockSize(); blockX++){\n\t\t\tfor(int blockY = 0; blockY < size/getBlockSize(); blockY++){\n\t\t\t\tCell[][] block = new Cell[getBlockSize()][getBlockSize()];\n\t\t\t\tfor(int i = 0; i < getBlockSize(); i++){\n\t\t\t\t\tfor(int j = 0; j < getBlockSize(); j++){\n\t\t\t\t\t\tblock[i][j] = board[(blockX * getBlockSize()) + i][(blockY * getBlockSize()) + j];\n\t\t\t\t\t\tblock[i][j].Attach(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tblocks[blockX][blockY] = new Block(block);\n\t\t\t}\n\t\t}\n\t}", "public static Cell[][] readSavedGrid() throws IOException {\n String savedGameFile = \"Grid.txt\";\n Cell[][] grid = new Cell[4][4];\n BufferedReader reader = new BufferedReader(new FileReader(savedGameFile));\n String line = \"\";\n int row = 0;\n while((line = reader.readLine()) != null) {\n String[] cols = line.split(\",\");\n int col = 0;\n for(String c : cols) {\n if (Integer.parseInt(c) == 0) {\n targetCellX = row;\n targetCellY = col;\n }\n\n grid[row][col] = new Cell(Integer.parseInt(c));\n col++;\n }\n row++;\n }\n reader.close();\n\n return grid;\n }", "public static void main(String[] args) {\n // create initial board from file\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] tiles = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n tiles[i][j] = in.readInt();\n Board initial = new Board(tiles);\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n }", "private void initializeBoard() {\n\t\t\n\t}", "private static void checkAndPlay(File file) throws FileNotFoundException {\n\n\t\tfinal JFrame popupNotEnoughPieces = new PopupFrame(\"Not Enough Pieces!\", \"<html><center>\"\n\t\t\t\t+ \"There are not enough pieces on the board! <br><br>\"\n\t\t\t\t+ \"Please make sure that there is at least one piece of each team on the board before starting.\"\n\t\t\t\t+ \"</center></html>\");\n\n\t\tfinal JFrame popupTooManyPieces = new PopupFrame(\"Too Many Pieces!\", \"<html><center>\"\n\t\t\t\t+ \"There are too many pieces on the board! <br><br>\"\n\t\t\t\t+ \"Please make sure that there is a maximum of 12 pieces on each team.\" + \"</center></html>\");\n\n\t\t// Convert file to 2D array\n\t\tString[][] fileBoard = new String[8][8];\n\t\tString delimiter = \",\";\n\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner sc = new Scanner(file);\n\n\t\tString line;\n\t\tString pastMoveList = \"\";\n\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tline = sc.nextLine();\n\t\t\tfileBoard[i] = line.split(delimiter);\n\t\t}\n\t\t\n\t\t// Convert string lines to enumerated types\n\t\tString turn = sc.nextLine();\n\t\tTurn toPlay = Turn.valueOf(turn);\n\t\t\n\t\tString white = sc.nextLine();\n Player whitePlayer = Player.valueOf(white);\n \n String black = sc.nextLine();\n Player blackPlayer = Player.valueOf(black);\n \n // Read the past move list into a string\n\t\twhile (sc.hasNextLine()) {\n\t\t\tpastMoveList += sc.nextLine() + '\\n';\n\t\t}\n\n\t\t// Create blank game board\n\t\tfinal GameBoard board = new GameBoard(false, toPlay, blackPlayer, whitePlayer);\n\n\t\tPiece newPiece;\n\n\t\tboolean success;\n\n\t\tfor (int y = 0; y < 8; y++) {\n\t\t\t// Check the board setup row by row starting at the bottom row\n\t\t\tfor (int x = 0; x < 8; x++) {\n\t\t\t\t// Check the value of the ComboBox if the square is not\n\t\t\t\t// forbidden\n\t\t\t\tif (((x + y) % 2) != 1) {\n\n\t\t\t\t\tnewPiece = Piece.valueOf(fileBoard[7 - y][x]);\n\n\t\t\t\t\t// Try to add the selected piece to the board\n\t\t\t\t\tsuccess = board.model.setPiece(x, y, newPiece);\n\n\t\t\t\t\t// If we were unable to add the piece to the board\n\t\t\t\t\t// it must have 12 pieces on that team already\n\t\t\t\t\tif (!success) {\n\n\t\t\t\t\t\tpopupTooManyPieces.setVisible(true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// If setup is valid, game is started\n\t\tif (board.model.validStartSetup()) {\n\n\t\t\t// Load the past move list into the board\n\t\t\tboard.model.setPastMoveListString(pastMoveList);\n\n\t\t\t// The custom setup is complete\n\t\t\tboard.model.setupComplete();\n\n\t\t\t// Start the game\n\t\t\tjavax.swing.SwingUtilities.invokeLater(new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tNewGameWindow.createAndShowNewGame(board);\n\t\t\t\t\tstartMenu.dispose();\n\t\t\t\t}\n\t\t\t});\n\n\t\t} else {\n\t\t\t// Cannot start a game without any pieces\n\t\t\tpopupNotEnoughPieces.setVisible(true);\n\t\t\t// Return without closing the window\n\t\t\treturn;\n\t\t}\n\n\t}", "void loadCheckerBoard(int tileSize);", "public void loadGridFromFile( String filename )\n\t{\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader( new FileReader( filename ));\n\t\t\tString[] data = new String[width];\n\t\t\tString delimiter = \",\", line = null;\n\t\t\tint i = 0, j = 0;\n\t\t\t\n\t\t\ttry \n\t\t\t{ \n\t\t\t\tline = br.readLine(); \n\t\t\t\t\n\t\t\t\t// Based on file format, determine grid width / height\n\t\t\t\twidth = line.length() / 2 + 1;\n\t\t\t\theight = line.length() / 2 + 1;\n\t\t\t\tgrid = new int[width][height];\n\t\t\t\t\n\t\t\t\t// While file isn't empty\n\t\t\t\twhile ( line != null )\n\t\t\t\t{\n\t\t\t\t\t// Split lines using delimiter of ','\n\t\t\t\t\tdata = line.split( delimiter );\n\t\t\t\t\t\n\t\t\t\t\t// Put contents of each formatted line into grid array\n\t\t\t\t\tfor (i = 0; i < width; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tgrid[i][j] = Integer.parseInt( data[i] );\n\t\t\t\t\t\tif ( grid[i][j] == 0 ) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tx0 = i;\n\t\t\t\t\t\t\ty0 = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tj++;\n\t\t\t\t\tline = br.readLine();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e) \n\t\t\t{ \n\t\t\t\tSystem.out.println( \"Unable to read from file \" + filename + \". Closing...\" ); \n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\tcatch ( FileNotFoundException e)\n\t\t{\n\t\t\tSystem.out.println( \"File with name \" + filename + \" not found. Closing...\" );\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public static void main(String[] args) {\n // create initial board from file\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] tiles = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n tiles[i][j] = in.readInt();\n Board initial = new Board(tiles);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n }", "public static void main(String[] args) {\n // create initial board from file\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] tiles = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n tiles[i][j] = in.readInt();\n Board initial = new Board(tiles);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n }", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "public Safe(File file) throws FileNotFoundException {\n Scanner in = new Scanner(file);\n lastVerifiedRow = null;\n lastVerifiedColumn = null;\n RowOfLastPlacedLaser = null;\n ColumnOfLastPlacedLaser = null;\n this.numberOfRows = in.nextInt();\n this.numberOfColumns = in.nextInt();\n this.grid = new char[numberOfRows][numberOfColumns];\n for (int i = 0; i < numberOfRows; i++) {\n for (int j = 0; j < numberOfColumns; j++) {\n grid[i][j] = in.next().charAt(0);\n }\n }\n in.close();\n }", "public Safe(String filename) throws FileNotFoundException {\n Scanner in = new Scanner(new File(filename));\n lastVerifiedRow = null;\n lastVerifiedColumn = null;\n RowOfLastPlacedLaser = null;\n ColumnOfLastPlacedLaser = null;\n this.numberOfRows = in.nextInt();\n this.numberOfColumns = in.nextInt();\n this.grid = new char[numberOfRows][numberOfColumns];\n for (int i = 0; i < numberOfRows; i++) {\n for (int j = 0; j < numberOfColumns; j++) {\n grid[i][j] = in.next().charAt(0);\n }\n }\n in.close();\n }", "public static boolean loadMap(String path) throws FileNotFoundException {\n\n// System.out.println(\" Enter map file address\");\n// String path = sc.next();\n\n // ---------------- Reading file-------------------------------\n File file_map = new File(path.trim());\n HashMap<String, List<String>> neighborsList = new HashMap<>();\n\n if (file_map.exists()) {\n Scanner myReader = new Scanner(file_map);\n\n while (myReader.hasNextLine()) {\n\n String data = myReader.nextLine();\n\n if (\"[Continents]\".equals(data.trim())) {\n System.out.println(\"==>\" + data.trim());\n data = myReader.nextLine();\n\n while (!data.equals(\"[Territories]\")) {\n System.out.println(data);\n String split[] = data.split(\"=\");\n String continent_name = split[0];\n String no_of_countries = split[1];\n continents.put(continent_name, Integer.parseInt(no_of_countries));\n data = myReader.nextLine();\n }\n }\n\n System.out.println(\"continents: \" + continents.toString());\n board.setContinents(continents);\n\n if (\"[Territories]\".equals(data)) {\n\n while (myReader.hasNextLine()) {\n String country_input = myReader.nextLine();\n\n String split[] = country_input.split(\",\");\n String country = split[0];\n int x = Integer.parseInt(split[1]);\n int y = Integer.parseInt(split[2]);\n String continent = split[3];\n List<String> neighbours = new ArrayList<>();\n\n for (int i = 4; i < split.length; i++) {\n neighbours.add(split[i]);\n }\n\n board.createTile(country, x, y, continent);\n neighborsList.put(country, neighbours);\n\n }\n }\n\n for (Map.Entry entry : neighborsList.entrySet()) {\n board.setNeighbourTile((List<String>) entry.getValue(), (String) entry.getKey());\n }\n\n\n }\n System.out.println(\"Risk Map Loaded!\");\n HashMap<String, Tile> map = board.getTiles();\n\n System.out.println(\"Map\" + map.keySet().toString());\n\n if (board.getContinents().size() == 0 || board.getTiles().size() == 0)\n return false;\n return true;\n\n } else {\n System.out.println(\"File does not exist! \");\n return false;\n }\n\n }", "public static void readFileSilver(String filename) throws FileNotFoundException{\n try {\n //Scanners and readers and everything??\n File text = new File(filename);\n Scanner inf = new Scanner(text);\n BufferedReader brTest = new BufferedReader(new FileReader(filename));\n String firstLine = brTest.readLine();\n String[] firstLineArray = new String[3];\n firstLineArray = firstLine.split(\" \");\n\n //Determines number of rows, cows, and time.\n N = Integer.parseInt(firstLineArray[0]);\n M = Integer.parseInt(firstLineArray[1]);\n T = Integer.parseInt(firstLineArray[2]);\n\n //Initializes pasture. Assume 0 for empty space, -1 for a tree.\n String temp = \"\";\n pasture = new int[N][M];\n inf.nextLine();\n\n for (int i = 0; i < N; i++){\n temp = inf.next();\n\n for (int j = 0; j < M; j++){\n if (temp.charAt(j) == '.'){\n pasture[i][j] = 0;\n }\n if (temp.charAt(j) == '*'){\n pasture[i][j] = -1;\n }\n }\n }\n\n //Determines (R1, C1) and (R2, C2).\n inf.nextLine();\n R1 = inf.nextInt(); C1 = inf.nextInt();\n R2 = inf.nextInt(); C2 = inf.nextInt();\n\n //Exceptions.\n } catch (FileNotFoundException ex){\n System.out.println(\"Yikes\");\n } catch (IOException ex){\n System.out.println(\"Yikes\");\n }\n }", "private void fillBoard() {\n\n boardMapper.put(1, new int[]{0, 0});\n boardMapper.put(2, new int[]{0, 1});\n boardMapper.put(3, new int[]{0, 2});\n boardMapper.put(4, new int[]{1, 0});\n boardMapper.put(5, new int[]{1, 1});\n boardMapper.put(6, new int[]{1, 2});\n boardMapper.put(7, new int[]{2, 0});\n boardMapper.put(8, new int[]{2, 1});\n boardMapper.put(9, new int[]{2, 2});\n\n }", "public static void createTopology()\r\n\t{\r\n\t\tSystem.out.println(\"==============STARTING TO CREATE TOPOLOGY=================\");\r\n\t\tint row = 0, col = 0;\r\n\t\ttry {\r\n\t\t\tscan = new Scanner(System.in);\r\n\t\t\tSystem.out.println(\"\\nPlease enter the file name <name.txt>\");\r\n\t\t\tString s_t_r = scan.nextLine();\r\n\t\t\tFile inFile = new File(s_t_r); // Connecting to the input file\r\n\t\t\t\r\n\t\t\tScanner in = new Scanner(inFile);\r\n\t\t\tString lines[] = in.nextLine().trim().split(\"\\\\s+\"); // line count estimation\r\n\t\t\tin.close(); // Closing the input file\r\n\t\t\t\r\n\t\t\trouters = lines.length;\r\n\t\t\tgraph = new int[routers][routers]; // declaring the adjacency matrix\r\n\t\t\t\r\n\t\t\tin = new Scanner(inFile); // scanner for each line in the input file\r\n\t\t\tint lineCount = 0;\r\n\t\t\twhile (in.hasNextLine()) // Checking the size of the matrix input\r\n\t\t\t{\r\n\t\t\t\tString currentLine[] = in.nextLine().trim().split(\"\\\\s+\"); // read each line\r\n\t\t\t\tfor (int i = 0; i < currentLine.length; i++) {\r\n\t\t\t\t\tgraph[lineCount][i] = Integer.parseInt(currentLine[i]);\r\n\t\t\t\t}\r\n\t\t\t\tlineCount++;\r\n\t\t\t}\r\n\t\t} catch (Exception e) { // Catching exception for error in reading the file\r\n\t\t\tSystem.out.println(\"Error in reading the file\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"\\nReview the original topology \");\r\n\t\tfor (row = 0; row < routers; row++) {\r\n\t\t\tfor (col = 0; col < routers; col++)\r\n\t\t\t\tSystem.out.print(graph[row][col] + \"\\t\"); // Printing the topology that is created\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public abstract void createBoard();", "public GameInput load() {\n int rows = 0;\n int columns = 0;\n char[][] arena = new char[rows][columns];\n int noPlayers = 0;\n LinkedList<Hero> heroList = new LinkedList<Hero>();\n LinkedList<String> moves = new LinkedList<String>();\n int noRounds = 0;\n try {\n FileSystem fs = new FileSystem(inputPath, outputPath);\n rows = fs.nextInt();\n columns = fs.nextInt();\n arena = new char[rows][columns];\n for (int i = 0; i < rows; i++) {\n String rowLandTypes = fs.nextWord();\n char[] landType = rowLandTypes.toCharArray();\n for (int j = 0; j < columns; j++) {\n arena[i][j] = landType[j];\n }\n }\n noPlayers = fs.nextInt();\n for (int i = 0; i < noPlayers; i++) {\n\n char playerType = fs.nextWord().charAt(0);\n int positionX = fs.nextInt();\n int positionY = fs.nextInt();\n\n Hero myHero = new Hero();\n\n if (playerType == 'W') {\n myHero = new Wizard(positionX, positionY, arena[positionX][positionY]);\n } else if (playerType == 'P') {\n myHero = new Pyromancer(positionX, positionY, arena[positionX][positionY]);\n } else if (playerType == 'R') {\n myHero = new Rogue(positionX, positionY, arena[positionX][positionY]);\n } else if (playerType == 'K') {\n myHero = new Knight(positionX, positionY, arena[positionX][positionY]);\n }\n\n heroList.add(myHero);\n }\n\n noRounds = fs.nextInt();\n\n for (int i = 0; i < noRounds; i++) {\n String listOfMoves = fs.nextWord();\n moves.add(listOfMoves);\n }\n\n fs.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return new GameInput(rows, columns, arena, noPlayers, heroList, noRounds, moves);\n }", "private void loadWorld(String path) {\r\n StringBuilder builder = new StringBuilder();\r\n \r\n try {\r\n BufferedReader br = new BufferedReader(new FileReader(path));\r\n String line;\r\n while ((line = br.readLine()) != null) {\r\n builder.append(line + \"\\n\");\r\n }\r\n br.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n \r\n String file = builder.toString();\r\n String[] tokens = file.split(\"\\\\s+\");\r\n width = Integer.parseInt(tokens[0]);\r\n height = Integer.parseInt(tokens[1]);\r\n spawnX = Integer.parseInt(tokens[2]);\r\n spawnY = Integer.parseInt(tokens[3]);\r\n winX = Integer.parseInt(tokens[4]);\r\n winY = Integer.parseInt(tokens[5]);\r\n \r\n tiles = new int[width][height];\r\n for (int y = 0;y < height;y++) {\r\n for (int x = 0;x < width;x++) {\r\n tiles[x][y] = Integer.parseInt(tokens[(x + y * width) + 6]);\r\n }\r\n }\r\n \r\n assert (tiles != null);\r\n }", "public Tile[][] updateBoard(int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t/*String[] fileRanks = input.split(\" \");\n\t\tint startRow= 8 -Integer.parseInt(fileRanks[0].substring(1));\n\t\tint startColumn = (fileRanks[0].charAt(0)) -'a';\n\t\tint endRow = 8-Integer.parseInt(fileRanks[1].substring(1));\n\t\tint endColumn = (fileRanks[1].charAt(0))-'a'; */\n\n\t\tboard[endRow][endColumn].setOccupyingPiece(null);\n\t\tboard[endRow][endColumn].setOccupyingPiece(board[startRow][startColumn].getOccupyingPiece());\n\t\tboard[startRow][startColumn].setOccupyingPiece(null);\n\n\t\treturn board;\n\t}", "public static SnakeProblem buildProblemFromFile(File file) throws IOException {\n int NUM_ONE_AI_OBLIGATORY_PARAMS = 4;\n int NUM_TWO_AI_OBLIGATORY_PARAMS = 7;\n\n java.util.Scanner f;\n try {\n f = new java.util.Scanner(file);\n } catch (FileNotFoundException e) {\n return null;\n }\n\n List<String> lines = new LinkedList<>();\n\n while (f.hasNextLine()) {\n String s = f.nextLine();\n if (!s.equals(\"\") && !s.startsWith(\"//\")) {\n lines.add(s);\n }\n }\n\n List<String> parametersValues = new LinkedList<>();\n for (String line : lines) {\n String[] tokens = line.split(\":|,\");\n for (int i = 1; i < tokens.length; i++) {\n parametersValues.add(tokens[i].trim());\n }\n }\n\n int environmentSize, maxIterations, numEnvironmentRuns;\n\n\n try {\n environmentSize = Integer.parseInt(parametersValues.get(0));\n maxIterations = Integer.parseInt(parametersValues.get(1));\n numEnvironmentRuns = Integer.parseInt(parametersValues.get(2));\n } catch (NumberFormatException e) {\n return null;\n }\n\n if (parametersValues.size() > NUM_ONE_AI_OBLIGATORY_PARAMS) {\n List<Integer> numInputs = new ArrayList<>();\n List<Integer> numHiddenUnits = new ArrayList<>();\n List<Integer> numOutputs = new ArrayList<>();\n List<ActivationFunction> activationFunctions = new ArrayList<>();\n\n try {\n numInputs.add(Integer.parseInt(parametersValues.get(3)));\n\n if (parametersValues.size() > NUM_TWO_AI_OBLIGATORY_PARAMS) {\n numInputs.add(Integer.parseInt(parametersValues.get(4)));\n numHiddenUnits.add(Integer.parseInt(parametersValues.get(5)));\n numHiddenUnits.add(Integer.parseInt(parametersValues.get(6)));\n numOutputs.add(Integer.parseInt(parametersValues.get(7)));\n numOutputs.add(Integer.parseInt(parametersValues.get(8)));\n activationFunctions.add(ActivationFunction.valueOf(parametersValues.get(9).toUpperCase()));\n activationFunctions.add(ActivationFunction.valueOf(parametersValues.get(10).toUpperCase()));\n } else {\n numHiddenUnits.add(Integer.parseInt(parametersValues.get(4)));\n numOutputs.add(Integer.parseInt(parametersValues.get(5)));\n activationFunctions.add(ActivationFunction.valueOf(parametersValues.get(6).toUpperCase()));\n }\n } catch (IllegalArgumentException e) {\n return null;\n }\n\n return new SnakeProblem(\n environmentSize,\n maxIterations,\n numEnvironmentRuns,\n numInputs,\n numHiddenUnits,\n numOutputs,\n activationFunctions);\n }\n\n return new SnakeProblem(\n environmentSize,\n maxIterations,\n numEnvironmentRuns);\n }", "@Override\n public void load() {\n File file = new File(path + \"/\" + \"rooms.txt\"); //Hold file of the riddles. riddles.txt should be placed in the root folder.\n Scanner scanner = null; //if the scanner can't load the file.\n\n try {\n scanner = new Scanner(file); // scanner for the file\n } catch (FileNotFoundException ex) {\n try {\n //if not such file exists create it.\n file.createNewFile();\n } catch (IOException ex1) {\n Logger.getLogger(LoadRooms.class.getName()).log(Level.SEVERE, null, ex1);\n return;\n }\n }\n while (scanner.hasNextLine()) { //if scanner har fundt next line of text in the file\n switch (scanner.nextLine()) {\n case \"[Room]:\": //if scanner fundt \"[Room]:\" case, get rooms attributes\n state = LOAD_ATTRIBUTES;\n break;\n case \"[Connections]:\"://if scanner fundt \"[Connections]:\" case, get connections from file\n state = LOAD_CONNECTIONS;\n break;\n\n default:\n break;\n }\n switch (state) {\n case LOAD_ATTRIBUTES: //case, that get rooms attributes and add them to room_list\n String name = scanner.nextLine();\n int timeToTravel = Integer.parseInt(scanner.nextLine());\n boolean isLocked = Boolean.parseBoolean(scanner.nextLine());\n boolean isTransportRoom = Boolean.parseBoolean(scanner.nextLine());\n Room newRoom = new Room(name, timeToTravel, isLocked, isTransportRoom);\n if (newRoom.isTransportRoom()) {\n newRoom.setExit(\"exit\", newRoom);\n newRoom.setExitDir(\"west\", newRoom);\n }\n rooms_list.add(newRoom);\n break;\n case LOAD_CONNECTIONS: //case that get connections betweem rooms in game\n while (scanner.hasNextLine()) {\n String[] string = scanner.nextLine().split(\",\");\n Room room = this.getRoomByName(string[0]);\n room.setExit(string[1], this.getRoomByName(string[1]));\n if (!this.getRoomByName(string[1]).isTransportRoom() && !room.isTransportRoom()) {\n room.setExitDir(string[2], getRoomByName(string[1]));\n }\n }\n break;\n default:\n break;\n }\n }\n }", "void readFiles(Boolean smart) \n\t//throws IOException// more here for safety\n\t{\n\t\tint i;\n\t\tfor (i = 0; i<165; ++i)\n\t\tfor (int j = 0; j<11; ++j)\n\t\t{\t//if(smart)memoryFile.readInt(board(i,j));\n\t\t\t//else \n\t\t\t\tboard[i][j] = 0;\n\t\t}\n\t\t//try memoryFileStream.close(); catch (IOException e);\n\t}", "public Board(int rows, int cols) {\n\t\t_board = new ArrayList<ArrayList<String>>();\n\t\t_rand = new Random();\n\t\t_colorFileNames = new ArrayList<String>();\n\t\tfor (int i=0; i<MAX_COLORS; i=i+1) {\n\t\t\t_colorFileNames.add(\"Images/Tile-\"+i+\".png\");\n\t\t}\n\t\tfor (int r=0; r<rows; r=r+1) {\n\t\t\tArrayList<String> row = new ArrayList<String>();\n\t\t\tfor (int c=0; c<cols; c=c+1) {\n\t\t\t\trow.add(_colorFileNames.get(_rand.nextInt(_colorFileNames.size())));\n\t\t\t}\n\t\t\t_board.add(row);\n\t\t\t\n\t\t\tif(_board.size()==rows) { //board is complete\n\t\t\t\tboolean istrue = false;\n\t\t\t\tif(match(3).size()>0 || end()){ //(1)there are match //(2)there is no valid move\n\t\t\t\t\tistrue = true;\n\t\t\t\t}\n\t\t\t\tif (istrue) {\n\t\t\t\t\t_board.clear();\t\t// if istrue clear the board\n\t\t\t\t\tr=-1;\t\t\t\t// restart; r=-1, at the end of loop will add 1\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\t\t\n\t}", "public static void Load(String filename) throws IOException {\n\t\tLineNumberReader lnr = new LineNumberReader(new FileReader(filename));\r\n\t\t linenumber = 0;\r\n\t\t while (lnr.readLine() != null){\r\n\t\t\t linenumber++;\r\n\t\t }\r\n lnr.close();\r\n \tarrr=new String[linenumber][5];\r\n\t\tarr=arrr;\r\n\t\tBufferedReader br=new BufferedReader(new FileReader(filename));\r\n\t\t Scanner sc1=new Scanner(br);\r\n\t\t String ss=sc1.nextLine();\r\n\t\t String[] str1 = ss.split(\",\") ;\r\n\t\t String r=str1[0];\r\n\t\t String t=str1[1];\r\n\t\t String[] str2 = r.split(\":\") ;\r\n\t\t round= Integer.parseInt(str2[1]);\r\n\t\t String[] str3 = t.split(\":\") ;\r\n\t\t who=Integer.parseInt(str3[1]);\r\n\t\t arr=new String[linenumber][5];\r\n\t\t int num=0;\r\n\t\t while(sc1.hasNextLine()) {\t\r\n\t\t\t int i=0;\r\n\t\t\t num++;\r\n\t\t\t String x=sc1.nextLine();\r\n\t\t\tString[] str = x.split(\",\") ;\r\n\t\t\twhile(i<5) {\r\n\t\t\t\tarr[num][i]=str[i];\r\n\t\t\t\ti++;\r\n\t\t\t }\r\n\t\t }\r\n\t\t int c=1;\r\n\t ch=new Character[linenumber];\r\n\r\n\t\t\twhile(c<(linenumber)) {\r\n\t\t\t\t\r\n\t\t\t\tch[c]=new Character(Integer.parseInt(arr[c][0]),Integer.parseInt(arr[c][1]),Integer.parseInt(arr[c][2]),Integer.parseInt(arr[c][3]),arr[c][4]);\t\t\t\t\t\t\t\r\n\t\t\t\tc++;\r\n\t\t\t}\t\r\n\t\t\r\n\t\t sc1.close();\r\n\t\t String file=\"Land.txt\";\r\n\t\t\tBufferedReader br2=new BufferedReader(new FileReader(file));\r\n\t\t\tland=new String[20][2];\r\n\t\t\tland2=new String[20][2];\r\n\t\t\tland=land2;\r\n\t\t\tScanner sc2=new Scanner(br2);\r\n\t\t\tString strr=sc2.nextLine();\r\n\t\t\tnum=0;\r\n\t\t\t while(sc2.hasNextLine()) {\t\r\n\t\t\t\t int i=0;\r\n\t\t\t\t num++;\r\n\t\t\t\t String x=sc2.nextLine();\t\t\t\r\n\t\t\t\tString[] str = x.split(\",\") ;\r\n\t\t\t\twhile(i<2) {\r\n\t\t\t\t\tland[num][i]=str[i];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t }\t\t\t\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\t String url = \"//localhost:3306/checkpoint?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT\";\r\n\t\t // String url=\"//140.127.220.220/\";\r\n\t\t // String dbname=\"CHECKPOINT\";\r\n\t\t\t Connection conn = null;\r\n\t\t try{\r\n\t\t conn = DriverManager.getConnection(protocol + url,username,passwd);\r\n\t\t Statement s = conn.createStatement();\r\n\t\t String sql = \"SELECT PLACE_NUMBER,LAND_PRICE,TOLLS FROM LAND\";\r\n\t\t rs=s.executeQuery(sql);\r\n\t\t p_number=new int[20];\r\n\t\t l_price=new int[20];\r\n\t\t tolls=new int[20];\r\n\t\t grid=0;\r\n\t\t while(rs.next()){\r\n\t\t \tgrid++;\r\n\t\t \tp_number[grid]=rs.getInt(\"PLACE_NUMBER\");\r\n\t\t \tl_price[grid]=rs.getInt(\"LAND_PRICE\");\r\n\t\t \ttolls[grid]=rs.getInt(\"TOLLS\");\t \t\t \t\r\n\t\t }\t\t \t\t \r\n\t\t rs.close();\r\n\t\t conn.close();\r\n\t\t } catch(SQLException err){\r\n\t\t System.err.println(\"SQL error.\");\r\n\t\t err.printStackTrace(System.err);\r\n\t\t System.exit(0);\r\n\t\t }\r\n\t\t\t Land=new Land[20];\r\n\t\t\t Land2=new Land[20];\r\n\t\t\t Land=Land2;\t\t\t \r\n\t\t \tfor(int i=1;i<=grid;i++) {\r\n\t\t \t\tLand[i]=new Land(p_number[i],Integer.parseInt(land[i][1]),l_price[i],tolls[i]);\t \t\t\r\n\t\t \t}\r\n\t\t\t sc2.close();\r\n\t}", "public static void initBoard()\r\n\t{\n\t\tfor ( int r=0; r<3; r++ )\r\n\t\t\tfor ( int c=0; c<3; c++ )\r\n\t\t\t\tboard[r][c] = ' ';\r\n\t}", "private Board create5by5Board() {\n Tile[][] tiles;\n Tile t1 = new Tile(0, 5);\n Tile t2 = new Tile(1, 5);\n Tile t3 = new Tile(2, 5);\n Tile t4 = new Tile(3, 5);\n Tile t5 = new Tile(4, 5);\n Tile t6 = new Tile(5, 5);\n Tile t7 = new Tile(6, 5);\n Tile t8 = new Tile(7, 5);\n Tile t9 = new Tile(8, 5);\n Tile t10 = new Tile(9, 5);\n Tile t11 = new Tile(10, 5);\n Tile t12 = new Tile(11, 5);\n Tile t13 = new Tile(12, 5);\n Tile t14 = new Tile(13, 5);\n Tile t15 = new Tile(14, 5);\n Tile t16 = new Tile(15, 5);\n Tile t17 = new Tile(16, 5);\n Tile t18 = new Tile(17, 5);\n Tile t19 = new Tile(18, 5);\n Tile t20 = new Tile(19, 5);\n Tile t21 = new Tile(20, 5);\n Tile t22 = new Tile(21, 5);\n Tile t23 = new Tile(22, 5);\n Tile t24 = new Tile(23, 5);\n Tile t25 = new Tile(24, 5);\n tiles = new Tile[5][5];\n tiles[0][0] = t7;\n tiles[0][1] = t6;\n tiles[0][2] = t2;\n tiles[0][3] = t5;\n tiles[0][4] = t9;\n tiles[1][0] = t3;\n tiles[1][1] = t1;\n tiles[1][2] = t8;\n tiles[1][3] = t4;\n tiles[1][4] = t11;\n tiles[2][0] = t17;\n tiles[2][1] = t18;\n tiles[2][2] = t10;\n tiles[2][3] = t25;\n tiles[2][4] = t20;\n tiles[3][0] = t23;\n tiles[3][1] = t21;\n tiles[3][2] = t12;\n tiles[3][3] = t15;\n tiles[3][4] = t13;\n tiles[4][0] = t22;\n tiles[4][1] = t24;\n tiles[4][2] = t14;\n tiles[4][3] = t16;\n tiles[4][4] = t19;\n return new Board(tiles);\n }", "void generateNewBoard() {\n createAvailableDice();\n\n // Add them to board\n generateBoardLayout();\n }", "void generateBoard(){\r\n rearrangeSolution();\r\n makeInitial();\r\n }", "public Board(int lines, int columns, List<String> board) {\r\n\t\tif (lines == 0 || lines % 2 != 0 || lines < 2 || lines > 98) {\r\n\t\t\tthrow new IllegalArgumentException(\"Error! Line length is invalid.\");\r\n\t\t} else if (columns == 0 || columns % 2 != 0 || columns < 2 || columns > 26) {\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Error! Column length is invalid.\");\r\n\t\t} else if (board != null) {\r\n\r\n\t\t\tfor (String s : board) {\r\n\t\t\t\tif (!s.matches(\"[W,B,#,,-]+\")) {\r\n\t\t\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\t\t\"Error! Invalid board parameters.\");\r\n\t\t\t\t} else if (s.length() != columns) {\r\n\t\t\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\t\t\"Error! Board columns not equal to columns.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (board.size() != lines) {\r\n\t\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\t\"Error! Board lines not equal to lines.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.playBoard = new char[lines][columns];\r\n\t\tthis.possibleMoves = new ArrayList<PossibleMove>();\r\n\r\n\t\tif (board == null) {\r\n\t\t\tthis.init();\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < playBoard.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < playBoard[0].length; j++) {\r\n\t\t\t\t\tplayBoard[i][j] = board.get(i).charAt(j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static String[][][] schematic(File file) {\n try {\n blocks = new String[8][11][11];\n \n BufferedReader bufRdr = new BufferedReader(new FileReader(file));\n String line;\n //read each line of text file\n for (int level = 0; level < 8; level++) {\n for (int row = 0; row < 11; row++) {\n line = bufRdr.readLine();\n String[] strArr = line.split(\",\");\n System.arraycopy(strArr, 0, blocks[level][row], 0, 11);\n }\n }\n } catch (IOException io) {\n System.err.println(Constants.MY_PLUGIN_NAME + \" Could not read csv file\");\n }\n return blocks;\n }", "public static void createBoard() \n\t{\n\t\tfor (int i = 0; i < tictactoeBoard.length; i++) \n\t\t{\n\t\t\ttictactoeBoard[i] = '-';\n\t\t}\n\t}", "public static void main(String[] args) {\n\n // create initial board from file\n In in = new In(args[0]);\n int N = in.readInt();\n int[][] blocks = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n blocks[i][j] = in.readInt();\n Board initial = new Board(blocks);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n }", "public static void main(String[] args) {\n\n // create initial board from file\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] tiles = new int[n][n];\n for (int i = 0; i < n; i++)\n for (int j = 0; j < n; j++)\n tiles[i][j] = in.readInt();\n Board initial = new Board(tiles);\n // solve the puzzle\n\n Solver solver = new Solver(initial);\n\n\n // print solution to standard output\n\n if (!solver.isSolvable())\n StdOut.println(\"No solution possible\");\n else {\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n for (Board board : solver.solution())\n StdOut.println(board);\n }\n }", "private void init()\r\n\t{\r\n\t\ttry {\r\n\t\t\tThread.currentThread().getContextClassLoader().getResourceAsStream(\"d\").read(board);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tzp = 0;\r\n\t\txp = 0.5f;\r\n\t\typ = 0.5f;\r\n\t\tvx = 0;\r\n\t\tvy = 0;\r\n\t\tstarted = false;\r\n\t\tmsg = \"PRESS ENTER\";\r\n\t\tint[] levelTimes = {80,80,99,99,99};\r\n\t\ttimers[0] = levelTimes[l]*1000;\r\n\t\ttoggles = 0;\r\n\t\t\r\n\t\tif (complete) {\r\n\t\t\tl++;\r\n\t\t\t// LEVELS\r\n\t\t\tif (l >= 5) {\r\n\t\t\t\tl = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//ports.clear();\r\n\t\tports[99][0] = 0;\r\n\t\tfor (int x=0;x<30;x++) {\r\n\t\t\tfor (int y=0;y<30;y++) {\r\n\t\t\t\tint tile = getTile(x,y);\r\n\t\t\t\t\r\n\t\t\t\tif (tile == 3) {\r\n\t\t\t\t\txp = x+0.5;\r\n\t\t\t\t\typ = y+0.5;\r\n\t\t\t\t}\r\n\t\t\t\tif (tile == 14) {\r\n\t\t\t\t\ttoggles++;\r\n\t\t\t\t}\r\n\t\t\t\tif (tile == 12) {\r\n\t\t\t\t\tports[ports[99][0]][0] = x;\r\n\t\t\t\t\tports[ports[99][0]][1] = y;\r\n\t\t\t\t\tports[99][0]++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomplete = false;\r\n\t}", "public Auditorium(String filename) throws FileNotFoundException {\r\n\t\t//node variables\r\n\t\tint row;\r\n\t\tchar seat; \r\n\t\tboolean reserved; \r\n\t\tchar ticketType;\r\n\t\tTheaterSeat up = null;\r\n\t\tTheaterSeat down = null;\r\n\t\tTheaterSeat left = null;\r\n\t\tTheaterSeat right = null;\r\n\t\t\r\n\t\t//read from the file passed to the constructor\r\n\t\t//and fill the grid with that data\r\n\t\tFile seatingFile = new File(filename);\r\n\t\tScanner seatScanner = new Scanner(new FileInputStream(seatingFile));\r\n\t\tString firstLine = seatScanner.nextLine();\r\n\t\tnumRows = 1;\r\n\t\tnumCols = firstLine.length();\r\n\t\tString fullInput = firstLine;\r\n\t\t\r\n\t\twhile (seatScanner.hasNext()) {\r\n\t\t\tfullInput += seatScanner.nextLine();\r\n\t\t\tnumRows++;\r\n\t\t}\r\n\t\tseatScanner.close();\r\n\t\t\r\n\t\tTheaterSeat previous = null;\r\n\t\trow = 0;\r\n\t\tseat = 'A';\r\n\t\tticketType = fullInput.charAt(0);\r\n\t\tif (ticketType == '.') {\r\n\t\t\treserved = false;\r\n\t\t} else {\r\n\t\t\treserved = true;\r\n\t\t}\r\n\t\tfirst = new TheaterSeat(row, seat, reserved, ticketType, up, down, left, right);\r\n\t\tTheaterSeat current = getFirst();\r\n\t\tint sIndex = 0;\r\n\t\tint rIndex = 0;\r\n\t\tint location = 0;\r\n\t\tfor (rIndex = 0; rIndex < numRows - 1; rIndex++) { //iterate through grid\r\n\t\t\trow = rIndex;\r\n\t\t\tfor (sIndex = 0; sIndex < numCols - 1; sIndex++) {\r\n\t\t\t\t\r\n\t\t\t\t//preserve previous node\r\n\t\t\t\tprevious = current;\r\n\t\t\t\t\r\n\t\t\t\tseat = (char) (sIndex + 65);\r\n\t\t\t\tlocation = (1+rIndex)*(numCols) + sIndex;\r\n\t\t\t\tticketType = fullInput.charAt(location);\r\n\t\t\t\tif (ticketType == '.') {\r\n\t\t\t\t\treserved = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treserved = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcurrent = new TheaterSeat(row + 1, seat, reserved, ticketType, up, down, left, right);\r\n\t\t\t\t//create up-down link\r\n\t\t\t\tprevious.setDown(current);\r\n\t\t\t\tcurrent.setUp(previous);\r\n\t\t\t\t\r\n\t\t\t\tseat = (char) (sIndex + 66);\r\n\t\t\t\tlocation = rIndex*numCols + sIndex + 1;\r\n\t\t\t\tticketType = fullInput.charAt(location);\r\n\t\t\t\tif (ticketType == '.') {\r\n\t\t\t\t\treserved = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treserved = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcurrent = new TheaterSeat(row, seat, reserved, ticketType, up, down, left, right);\r\n\t\t\t\t//create right-left link\r\n\t\t\t\tcurrent.setLeft(previous);\r\n\t\t\t\tprevious.setRight(current);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tprevious = current;\r\n\t\t\t\r\n\t\t\tseat = (char) (sIndex + 66);\r\n\t\t\tlocation = (1 + rIndex)*numCols + sIndex;\r\n\t\t\tif (ticketType == '.') {\r\n\t\t\t\treserved = false;\r\n\t\t\t} else {\r\n\t\t\t\treserved = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurrent = new TheaterSeat(row, seat, reserved, ticketType, up, down, left, right);\r\n\t\t\t//create up-down link\r\n\t\t\tprevious.setDown(current);\r\n\t\t\tcurrent.setUp(previous);\r\n\t\t\t\r\n\t\t\tcurrent = previous;\r\n\t\t\tfor (int index = 0; index < numCols - 1; index++) {\r\n\t\t\t\tcurrent = current.getLeft();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcurrent = current.getDown();\r\n\t\t} //end of for loop\r\n\t\t\r\n\t\tfor (sIndex = 0; sIndex < numCols - 1; sIndex++) {\r\n\t\tprevious = current;\r\n\t\tseat = (char) (sIndex + 66);\r\n\t\tlocation = (numRows - 1)*numCols + sIndex + 1;\r\n\t\tticketType = fullInput.charAt(location);\r\n\t\tif (ticketType == '.') {\r\n\t\t\treserved = false;\r\n\t\t} else {\r\n\t\t\treserved = true;\r\n\t\t}\r\n\t\t\r\n\t\tcurrent = new TheaterSeat(numRows - 1, seat, reserved, ticketType, up, down, left, right);\r\n\t\t//create right-left link\r\n\t\tcurrent.setLeft(previous);\r\n\t\tprevious.setRight(current);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\r\n // create initial board from file\r\n In in = new In(args[0]);\r\n int N = in.readInt();\r\n int[][] blocks = new int[N][N];\r\n for (int i = 0; i < N; i++)\r\n for (int j = 0; j < N; j++)\r\n blocks[i][j] = in.readInt();\r\n Board initial = new Board(blocks);\r\n\r\n // solve the puzzle\r\n Solver solver = new Solver(initial);\r\n\r\n // print solution to standard output\r\n if (!solver.isSolvable())\r\n StdOut.println(\"No solution possible\");\r\n else {\r\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\r\n for (Board board : solver.solution())\r\n StdOut.println(board);\r\n }\r\n }", "public void newGame(){\n if (won) {\n idx = 0;\n won = false; \n List<String> rows = new ArrayList<String>();\n\n try{\n // loads one random image from list\n Random rand = new Random(); \n col = 0;\n int randInt = rand.nextInt(files.size());\n File file = new File(\n Game.class.getResource(\"/\"+files.get(randInt)).getFile()\n );\n BufferedReader br = new BufferedReader(new FileReader(file));\n String line;\n while ((line = br.readLine()) != null) {\n if (col < line.length()) {\n col = line.length();\n }\n rows.add(line);\n }\n }\n catch (Exception e){\n System.out.println(\"File load error\"); // extremely simple error handling, you can do better if you like. \n }\n\n // this handles creating the orinal array and the hidden array in the correct size\n String[] rowsASCII = rows.toArray(new String[0]);\n\n row = rowsASCII.length;\n\n // Generate original array by splitting each row in the original array.\n original = new char[row][col];\n for(int i = 0; i < row; i++) {\n char[] splitRow = rowsASCII[i].toCharArray();\n for (int j = 0; j < splitRow.length; j++) {\n original[i][j] = splitRow[j];\n }\n }\n\n // Generate Hidden array with X's (this is the minimal size for columns)\n hidden = new char[row][col];\n for(int i = 0; i < row; i++){\n for(int j = 0; j < col; j++){\n hidden[i][j] = 'X';\n }\n }\n setIdxMax(col * row);\n }\n else {\n }\n }", "public static void main(String[] args) {\n\n String dict = \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/dictionary-yawl.txt\";\n String[] boardPaths = new String[]{\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points0.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points100.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1000.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1111.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1250.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points13464.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1500.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points2.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points200.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points2000.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points26539.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points3.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points300.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points400.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4410.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4527.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4540.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points5.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points500.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points750.txt\",\n \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points777.txt\",\n };\n // String dict = \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/dictionary-common.txt\";\n // String[] boardPaths = new String[]{\n // \"/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-random1.txt\",\n // };\n In in = new In(dict);\n String[] dictionary = in.readAllStrings();\n BoggleSolver solver = new BoggleSolver(dictionary);\n\n int[] scores = new int[boardPaths.length];\n int[] counts = new int[boardPaths.length];\n for (int i = 0; i < boardPaths.length; i++) {\n BoggleBoard board = new BoggleBoard(boardPaths[i]);\n for (String word : solver.getAllValidWords(board)) {\n counts[i]++;\n StdOut.print(word + \", \");\n scores[i] += solver.scoreOf(word);\n }\n StdOut.println(\"\\n************************\\n\");\n }\n\n for (int i = 0; i < boardPaths.length; i++) {\n StdOut.println(boardPaths[i]);\n StdOut.println(\"Count: \" + counts[i]);\n StdOut.println(\"Score = \" + scores[i]);\n }\n }", "public Board() {\n this.board = new byte[][] { new byte[3], new byte[3], new byte[3] };\n }", "public Board(int boardSize) {\n\n sounds = new GameSounds();\n gridSize = boardSize;\n newGame = 0;\n titleScreen = true;\n traversedTiles = new boolean[gridSize][gridSize];\n pellets = new boolean[gridSize][gridSize];\n ghosts.add(new Ghost(180, 180, ghostImage1));\n ghosts.add(new Ghost(200, 180, ghostImage2));\n ghosts.add(new Ghost(220, 180, ghostImage3));\n map = getMapFromFile(\"first.txt\");\n// ghosts.add(new Ghost(220,180,ghostImage4));\n reset();\n }", "public Puzzle loadPuzzle () {\n Puzzle puzzle = null;\n File file;\n if (chooser.showOpenDialog (null) == JFileChooser.APPROVE_OPTION) {\n file = chooser.getSelectedFile ();\n if (file != null) {\n try {\n Scanner scan = new Scanner (file);\n String type = scan.nextLine ();\n puzzle = Puzzle.getConstructor (type);\n puzzle.load (scan);\n } catch (FileNotFoundException e) {\n JOptionPane.showMessageDialog (null, \"File IO Exception\\n\" + e.getLocalizedMessage (), \"Error!\", JOptionPane.ERROR_MESSAGE);\n } catch (IllegalArgumentException e) {\n JOptionPane.showMessageDialog (null, \"A Critical Error Has Occurred\", \"Error!\", JOptionPane.ERROR_MESSAGE);\n }\n }\n }\n return puzzle;\n }", "public Board(String blocks) { this(blocks, Heuristic.INT, null); }", "private Board create4by4Board() {\n Tile[][] tiles;\n Tile t1 = new Tile(0, 4);\n Tile t2 = new Tile(1, 4);\n Tile t3 = new Tile(2, 4);\n Tile t4 = new Tile(3, 4);\n Tile t5 = new Tile(4, 4);\n Tile t6 = new Tile(5, 4);\n Tile t7 = new Tile(6, 4);\n Tile t8 = new Tile(7, 4);\n Tile t9 = new Tile(8, 4);\n Tile t10 = new Tile(9, 4);\n Tile t11 = new Tile(10, 4);\n Tile t12 = new Tile(11, 4);\n Tile t13 = new Tile(12, 4);\n Tile t14 = new Tile(13, 4);\n Tile t15 = new Tile(14, 4);\n Tile t16 = new Tile(15, 4);\n tiles = new Tile[4][4];\n tiles[0][0] = t5;\n tiles[0][1] = t16;\n tiles[0][2] = t1;\n tiles[0][3] = t3;\n tiles[1][0] = t13;\n tiles[1][1] = t15;\n tiles[1][2] = t9;\n tiles[1][3] = t12;\n tiles[2][0] = t2;\n tiles[2][1] = t6;\n tiles[2][2] = t7;\n tiles[2][3] = t14;\n tiles[3][0] = t10;\n tiles[3][1] = t4;\n tiles[3][2] = t8;\n tiles[3][3] = t11;\n return new Board(tiles);\n }", "public void createMap() {\n\t\tArrayList<String>boardMap = new ArrayList<String>(); //boardmap on tiedostosta ladattu maailman malli\n\t\t\n\t\t//2. try catch blocki, ei jaksa laittaa metodeja heittämään poikkeuksia\n\t\ttry {\n\t\t\tboardMap = loadMap(); //ladataan data boardMap muuttujaan tiedostosta\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\t\n\t\t// 3. j=rivit, i=merkit yksittäisellä rivillä\n\t\tfor(int j=0; j<boardMap.size();j++){ \t\t//..rivien lkm (boardMap.size) = alkioiden lkm. \n\t\t\tfor(int i=0; i<boardMap.get(j).length(); i++){\t\t//..merkkien lkm rivillä (alkion Stringin pituus .length)\n\t\t\t\tCharacter hexType = boardMap.get(j).charAt(i);\t//tuodaan tietyltä riviltä, yksittäinen MERKKI hexType -muuttujaan\n\t\t\t\tworld.add(new Hex(i, j, hexType.toString()));\t//Luodaan uusi HEXa maailmaan, Character -merkki muutetaan Stringiksi että Hex konstructori hyväksyy sen.\n\t\t\t}\n\t\t}\n\t\tconvertEmptyHex();\n\t}", "public MapArchitect(String a_fileName, int rows, int cols)\n {\n m_fileName=a_fileName;\n m_waypoints = new LinkedList<Vector2d>();\n m_maxNumWaypoints = 10;\n m_brush = 4;\n m_startPoint = null;\n m_mousePosition = new Vector2d();\n\n this.m_grid =new char[rows][cols];\n\n for(int i=0;i< m_grid.length;i++)\n for(int j=0;j< m_grid[i].length;j++)\n m_grid[i][j]=EMPTY;\n\n this.addMouseListener(this);\n this.addMouseMotionListener(this);\n }", "public Board() {\n\t\tboard = new char[9][9];\n\t}", "void loadFromFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile source = new File(directory, FILE_NAME);\n\t\t\tMap<String, Scoreboard> scoreboards = new HashMap<String, Scoreboard>();\n\t\t\tif (source.exists()) {\n\t\t\t\tJsonReader reader = new JsonReader(new FileReader(source));\n\t\t\t\treader.beginArray();\n\t\t\t\twhile (reader.hasNext()) {\n\t\t\t\t\tScoreboard scoreboard = readScoreboard(reader);\n\t\t\t\t\tscoreboards.put(scoreboard.getName(), scoreboard);\n\t\t\t\t}\n\t\t\t\treader.endArray();\n\t\t\t\treader.close();\n\t\t\t} else {\n\t\t\t\tsource.createNewFile();\n\t\t\t}\n\t\t\tthis.scoreboards = scoreboards;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public GameBoard()\n\t{\n\t\tint i = 0;\n\t\tboard = new int[9][9];\n\t\tString s = ReadCSV.readCSV(); //data in CSV file is turned into a string\n\t\tfor(int r = 0; r < board.length; r++)\n\t\t{\n\t\t\tfor(int c = 0; c < board.length; c++)\n\t\t\t{\n\t\t\t\twhile((s.charAt(i) == ',') || (s.charAt(i) == '\\n')) //passes over enters and commas\n\t\t\t\t{\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(s.charAt(i) == '-') //dashes represent 0\n\t\t\t\t\tboard[r][c] = 0;\n\t\t\t\telse\n\t\t\t\t\tboard[r][c] = (int)s.charAt(i) - 48; //int value of the character which is a number \n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t}", "public static void main(final String[] args) {\n\n // create initial board from file\n In in = new In(args[0]);\n int n = in.readInt();\n int[][] blocks = new int[n][n];\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n blocks[i][j] = in.readInt();\n }\n }\n Board initial = new Board(blocks);\n\n // solve the puzzle\n Solver solver = new Solver(initial);\n\n // print solution to standard output\n if (!solver.isSolvable()) {\n StdOut.println(\"No solution possible\");\n } else {\n for (Board board : solver.solution()) {\n StdOut.println(board);\n }\n StdOut.println(\"Minimum number of moves = \" + solver.moves());\n }\n }", "private String rooverSetUp() throws IOException\n {\n if (fileName == null)\n {\n System.err.println(\"Please set fileName before calling runRoover\");\n return null;\n }\n \n BufferedReader r = new BufferedReader(new FileReader(fileName));\n String[] dims = r.readLine().split(\" \"); //reads the first line, which is the dimensions of our grid\n numCols = Integer.parseInt(dims[0]);\n numRows = Integer.parseInt(dims[1]);\n String[] dirtPosArr;\n String currDirtPos;\n \n //read in rooverPos\n String[] rooverPosStr = r.readLine().split(\" \");\n currXPos = Integer.parseInt(rooverPosStr[0]);\n currYPos = Integer.parseInt(rooverPosStr[1]);\n \n //validate inputs\n if (numCols <= 0 || numRows <= 0 || currXPos < 0 || currXPos > numCols - 1 \n || currYPos < 0 || currYPos > numRows - 1)\n {\n System.err.println(\"Invalid inputs for board size or starting roover position.\");\n r.close();\n return null;\n }\n \n String currLine = r.readLine();\n String nextLine = r.readLine();\n //set up the roover and dirt patches\n while (nextLine != null)\n {\n dirtPosArr = currLine.split(\" \");\n \n //validate dirt pos\n if (Integer.parseInt(dirtPosArr[0]) < 0 || Integer.parseInt(dirtPosArr[0]) > numCols - 1\n || Integer.parseInt(dirtPosArr[1]) < 0 || Integer.parseInt(dirtPosArr[1]) > numRows - 1)\n {\n System.err.println(\"Invalid dirt position.\");\n r.close();\n return null;\n }\n \n currDirtPos = dirtPosArr[0] + dirtPosArr[1];\n dirtSet.add(currDirtPos);\n currLine = nextLine;\n nextLine = r.readLine();\n }\n \n r.close();\n \n //at this point, currLine is the driving instructions\n return currLine;\n }" ]
[ "0.7299582", "0.6986188", "0.68108344", "0.6509917", "0.64929163", "0.6462288", "0.6418608", "0.6384506", "0.63529676", "0.6222289", "0.6218587", "0.6166824", "0.61437666", "0.6142588", "0.6100265", "0.6088518", "0.6041594", "0.5987475", "0.59696186", "0.5967449", "0.59666556", "0.5951254", "0.5948851", "0.59240246", "0.58915466", "0.5866894", "0.5862903", "0.5856685", "0.58432335", "0.58314884", "0.5830031", "0.581945", "0.5808567", "0.5792116", "0.577947", "0.5764246", "0.5754971", "0.57524145", "0.574464", "0.57432777", "0.57327944", "0.5731364", "0.5718921", "0.5707741", "0.57067746", "0.5700034", "0.56962436", "0.5696118", "0.56941724", "0.5684844", "0.5679575", "0.56748694", "0.5673526", "0.5649624", "0.563455", "0.5634339", "0.5630895", "0.56269467", "0.56269467", "0.56236416", "0.5619247", "0.5609682", "0.56087834", "0.5598461", "0.55860424", "0.5578506", "0.55763376", "0.5574885", "0.5573541", "0.557126", "0.55704033", "0.55659455", "0.55614084", "0.5555542", "0.5553008", "0.55487615", "0.55479294", "0.55360407", "0.55338013", "0.55294496", "0.551888", "0.5508691", "0.5508122", "0.5504299", "0.5502589", "0.5501272", "0.54973555", "0.54878217", "0.5486747", "0.5485656", "0.5482509", "0.54804665", "0.5469649", "0.5460807", "0.5456695", "0.5456011", "0.54515624", "0.54479975", "0.5440055", "0.5439394", "0.54382193" ]
0.0
-1
The entry point of application.
public static void main(String[] args) { new AnaTestClient().invoke(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\t\trunApplication();\n\t}", "public static void main(String[] args) {\n startApplication();\n }", "public static void main(String arg[]) {\n\n\t\tUtility.runApplication();\n\t}", "public static void main(String[] args) {\r\n \t\r\n // Creates new controller named the main controller\r\n GlobalResources.MainControl = new Control();\r\n // Starts main application\r\n GlobalResources.MainControl.StartApplication();\r\n }", "public static void main( String[] args )\n\t{\n\t\trunApp();\n\t}", "public static void main(String[] args){\n // app.run(args);\r\n new SpringApplicationBuilder(MainApplication.class).web(true).run(args);\r\n }", "public static void main(String[] args){\n\n MyApp myApp = new MyApp(); //1\n myApp.runMyApp(); //2\n System.out.println(\"End of Program\"); //3\n }", "public MainEntryPoint() {\r\n\r\n }", "public static void main(String[] args)\n { \n // Create a new instance of the application and make the currently\n \tEntryPoint theApp = new EntryPoint(); \n \t// running thread the application's event dispatch thread.\n theApp.enterEventDispatcher();\n }", "@Override\n public void run(ApplicationArguments args) {\n }", "public static void main() {\n \n }", "@Override public void run(ApplicationArguments args) {\n }", "public static void main(String[] args) {\n new MyApp();\n }", "public static void main(String[] args) {\n\t\tnew App();\r\n\t}", "public static void main(String[] args) {\r\n\t\t/* application object */\r\n\t\tCustomersApp myAp = new CustomersApp();\r\n\t\t/* run the application */\r\n\t\tmyAp.run();\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n // Start App\n EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() { new App(); }\n });\n }", "public AuctionApp() {\r\n runAuctionApp();\r\n }", "public static void main(String args[]){\n\n createConnection();\n\n if (conn == null) {\n System.err.println(\"Failed to establish connection!\");\n }\n\n new App();\n\n }", "public static void main(String[] args) {\n App.main(args);\n }", "public static void main(final String... args) {\n\n Application.launch();\n }", "public static void main(String[] args) {\r\n SunSpotHostApplication app = new SunSpotHostApplication();\r\n app.run();\r\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"*** START MAIN() ***\");\n\t\tSpringApplication.run(BeshstoreApplication.class, args);\n\t\tSystem.out.println(\"*** END MAIN() ***\");\n\t}", "public void startApp()\r\n\t{\n\t}", "public ParkingApp() {\n runApp();\n }", "public static void main(String[] args)\n {\n Injector guice = Guice.createInjector(new DiscountGuiceModule());\n\n // Inject the application which contains a separate object graph which contains all the business logic\n // When we call the top level class, BasicApplication, guice will inject every static dependency that we request\n // via @Inject\n BasicApplication basicApplication = guice.getInstance(BasicApplication.class);\n\n // now start the application\n basicApplication.start();\n }", "public static void main(String[] args) {\n Startup.main(args);\n }", "public static void main(String[] args) throws Exception {\n URL webRootLocation = MainView.class.getResource(\"/webapp/\"); //src/masin\n URI webRootUri = webRootLocation.toURI();\n\n WebAppContext context = new WebAppContext();\n context.setBaseResource(Resource.newResource(webRootUri));\n context.setContextPath(\"/\");\n context.setAttribute(\"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern\", \".*\");\n context.setConfigurationDiscovered(true);\n context.setConfigurations(new Configuration[]{\n new AnnotationConfiguration(),\n new WebInfConfiguration(),\n new WebXmlConfiguration(),\n new MetaInfConfiguration()\n });\n context.getServletContext().setExtendedListenerTypes(true);\n context.addEventListener(new ServletContextListeners());\n\n Server server = new Server(8080);\n server.setHandler(context);\n server.start();\n server.join();\n }", "public void run() {\n\t\tport(8080);\n\n\t\t// Main Page, welcome\n\t\tget(\"/\", (request, response) -> \"Welcome!\");\n\n\t\t// Date\n\t\tget(\"/date\", (request, response) -> {\n\t\t\tDate d = new Date(\"frida.org\", Calendar.getInstance().get(Calendar.YEAR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH));\n\t\t\treturn om.writeValueAsString(d);\n\t\t});\n\n\t\t// Time\n\t\tget(\"/time\", (request, response) -> {\n\t\t\tTime t = new Time(\"frida.org\", Calendar.getInstance().get(Calendar.HOUR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MINUTE), Calendar.getInstance().get(Calendar.SECOND));\n\t\t\treturn om.writeValueAsString(t);\n\t\t});\n\t}", "public static void main(String[] args) {\n // Configure MongoDB and Morphia\n \n \n // Define route handlers\n get(\"/\", PersonController.sayHello);\n }", "public static void main(String[] args) {\n WeatherApplication gui = new WeatherApplication( );\n \n // make window visible\n gui.setVisible( true );\n \n }", "public static void main(String[] args) {\n Application.launch(App.class, args);\n }", "public static void main(String[] args) {\n\t\tnew LoipeApp();\n\t}", "public static void main(String[] args) {\n\n Application.launch(args);\n }", "public static void main(String[] args) {\n \n SpringApplication.run(App.class, args);\n }", "public static void main(String[] args) {\n Application.launch(args);\n }", "@Override\n\t public void run(ApplicationArguments args) throws Exception {\n\n\t }", "public static void main(String args[]){\r\n Application theApp = new Application();\r\n theApp.createAccounts();\r\n theApp.processAccounts();\r\n theApp.outputAccounts();\r\n\r\n }", "public static void main(String[] args) {\n\t\tSpringApplication.run(HimalayanKitchenBackendStarter.class, args);\t\t\n\t}", "public static void main(String[] args) { \n\t\t//we are calling a static method and passing it the name of the class where we have our Main method.\t\t\n\t\tSpringApplication.run(CourseApiApp.class, args);\n\t}", "public static void main(String[] args) {\n staticFiles.location(\"/public\");\n\n //This will listen to GET requests to /model and return a clean new model\n get(\"/model/:Version\", (req, res) -> newModel( req ));\n\n //This will listen to POST requests and expects to receive a game model, as well as location to fire to\n post(\"/fire/:Version/:row/:col/:hard\", (req, res) -> fireAt( req ));\n //This will handle the scan feature\n post(\"/scan/:Version/:row/:col/:hard\", (req, res) -> scan( req ));\n\n //This will listen to POST requests and expects to receive a game model, as well as location to place the ship\n post(\"/placeShip/:Version/:id/:row/:col/:orientation/:hard\", (req, res) -> placeShip( req ));\n }", "public static void main ( String[] args ) {\n PhoneBook myApp = new PhoneBook(); \r\n }", "public static void main(String[] args) {\n\t\tAbstractDataHandlerFactory dataHandlerFactory = DataHandler.getDataHandlerInstance(); \n\t\t\n\t\t// Create a Controller object to begin the application and control code flow \n\t\tController control = new Controller(dataHandlerFactory);\t\n\t}", "public static void main(String[] args){\n\t\tView view = new View();\r\n\t\tDatabaseInteraction model = new DatabaseInteraction();\r\n\r\n\t\t//Initialize controller. \r\n\t\tController controller = new Controller(view,model);\r\n\r\n\t\t//Connect database, start user interaction, and let the controller respond to user options. \r\n\t\tmodel.connectDatabase();\r\n\t\tcontroller.userInteracion();\r\n\t\tcontroller.respondToUserOption();\r\n\r\n\t}", "public static void main(String[] args) {\n staticFiles.location(\"/public\");\n //This will listen to GET requests to /model and return a clean new model\n get(\"/model\", (req, res) -> newModel());\n //This will listen to POST requests and expects to receive a game model, as well as location to fire to\n post(\"/fire/:row/:col\", (req, res) -> fireAt(req));\n //This will listen to POST requests and expects to receive a game model, as well as location to place the ship\n post(\"/placeShip/:id/:row/:col/:orientation\", (req, res) -> placeShip(req));\n }", "public static void main(String[] args) {\n\r\n Starter starter = new Starter();\r\n starter.start();\r\n\r\n\r\n }", "public static void main(String[] args) {\n MainController mainController = new MainController();\n mainController.showView();\n SessionManager.getSessionManager().getSession();\n }", "public static void main(String[] args) {\n // TODO code application logic here\n // some testing? or actually we can't run it standalone??\n }", "public static void main(String[] args) {\n\t\tSpringApplication.run(StwwmakerApplication.class, args);\n\t}", "public static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\n\t\t\n\t}", "public static void main(String[] args) {\n Injector guice = Guice.createInjector(new DiscountGuiceModule());\n\n // Creates separate object graph with business logic, etc. Instantiate the main object on that\n MainAppWithCustomFactory application = guice.getInstance(MainAppWithCustomFactory.class);\n\n // Start your app\n application.start();\n }", "public static void main(String[] args) {\n InitStart.Init();\r\n new MainMenuView().displayMenu();\r\n\r\n }", "public static void main(String[] args) {\n new GraphicStudyApp();\n }", "public Main() {\n \n \n }", "public static void main(String[] args) {\n\t\tSpringApplication.run(PatyalApplication.class, args);\n\t}", "public static void main(String[] args)\n {\n MyApp theApp = new MyApp(); \n theApp.enterEventDispatcher();\n }", "public static void main(String[] args) {\n\t\tSpringApplication.run(ResturantAppApplication.class, args);\n\t}", "public static void main(String[] args) {\n if (Config.Api.URL.contains(\"localhost\")) {\n Server.main(new String[0]);\n }\n Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();\n config.setTitle(Config.Game.TITLE);\n config.setWindowedMode(Config.Game.WIDTH, Config.Game.HEIGHT);\n config.setWindowIcon(Config.Game.ICON);\n config.setResizable(false);\n new Lwjgl3Application(new BubbleSpinner(), config);\n }", "public static void main(String[] args) {\r\n // TODO code application logic here\r\n ObjectFactory.getUIinstance().getHomeInstance().setVisible(true);\r\n }", "public MainEntry() {\n\t\tthis.taskController = new Controller();\n\t}", "public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }", "public static void main(String[] args) {\n\t\tSpringApplication.run(AnzEngineeringApplication.class, args);\n\t}", "public static void main(String args[]) {\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tnew AppStarter();\n\t\t\t}\n\t\t});\t\n\t}", "public static void main(String[] args){\n FinagoController finagoController = new FinagoController();\n finagoController.run();\n }", "private Main() {\n\n super();\n }", "public static void main(String... args) {\n\t\tApplication.launch(View.class, args);\n\t}", "public static void main(String[] args) {\n\t\tHelloAiming app = new HelloAiming();\n app.setConfigShowMode(ConfigShowMode.AlwaysShow);\n\t\tapp.start();\n\n\t}", "public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }", "public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }", "public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }", "public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }", "public static void main(final String[] args) {\n\n System.setProperty(\"org.restlet.engine.loggerFacadeClass\", \"org.restlet.ext.slf4j.Slf4jLoggerFacade\");\n\n // Start application with the command line arguments\n Bootstrapper.launchApp(new OImaging(args));\n }", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tApplication.launch(args);\r\n\t}", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public static void main(String []args){\n\n }", "public DefaultApplication() {\n\t}", "public static void main(String[] args) {\n\t\tApplication.launch(args); // Not needed for running from the command line\n\t}", "public static void main(String[] args) {\n SpringApplication.run(ArtworkApplication.class, args);\n }", "public static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\t}", "public static void main(String[] args) {\n\t\tSpringApplication.run(Application.class, args);\n\t}", "public static void main(String[] args) {\n\n SpringApplication.run(Application.class, args);\n // AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n }", "public static void main(String[] args){\n System.setProperty(\"spring.jackson.serialization.INDENT_OUTPUT\", \"true\");\n\n SpringApplication application = new SpringApplication(Application.class);\n application.addListeners(new ApplicationPidFileWriter(\"ms-recommendation.pid\"));\n application.run(args);\n }", "public static void main(final String[] args) throws Exception {\n new ApiApplication().run(args);\n }", "public static void main(String[] args) {\n launch(RestaurantManagementApp.class, args);\n }", "public static void main(String[] args) {\n\t\tnew SpringApplicationBuilder(Application.class).web(true).run(args);\n\t}", "public static void main(String[] args)\r\n {\r\n Ipoki app = new Ipoki();\r\n app.enterEventDispatcher();\r\n }", "@Override\n protected void appStart() {\n }", "public static void main(String args[]) {\n Greeting.ToyApp toyApp = DaggerGreeting_ToyComponent.builder().build().toyApp();\n toyApp.greeting.sayHello();\n }", "public static void main(String[] args) {\n \n \n \n \n }", "public static void main(String[] args) {\n\t\t\n\t\tApplication.launch(args);\n\t\t\n\t\t\n\t\t\n\n\t}", "public MainApp() {\n initComponents();\n }", "public static void main(String[] args) {\n AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();\n ctx.register(ApplicationConfig.class);\n ctx.register(ApplicationContext.class);\n ctx.register(PersistenceContext.class);\n ctx.register(ProductionContext.class);\n ctx.register(SwaggerConfig.class);\n\n SpringApplication.run(Application.class);\n }", "public static void main(String[] args) {\n SpringApplication.run(MyLotoApplication.class, args);\n }", "public static void main(String[] args) {\n\t\tSpringApplication.run(ApiApplication.class, args);\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 static void main(String[] args) {\n\t\tSpringApplication.run(ManolitoBackApplication.class, args);\n\t\t//SpringApplication.run(ManolitoBackApplication.class, \"--debug\");\n\t\n\t}", "public static void main(String[] args) {\n\t\tApplication.launch(Main.class, args);\n\t}", "public static void main(String[] args) {\n LogInController logInController = new LogInController();\n logInController.initController();\n \n }", "public static void main(String[] args) {\n // Create the system.\n Application.launch( args );\n }", "public static void main (String []args){\n }", "public static void main(String[] args) {\n\t\tApplication.launch(args);\n\n\t}", "public static void main(String[] args)\r\n {\n\t\t System.out.println(\"************* Welocome To My Application ************* \");\r\n\t\t MainMenu();\r\n }" ]
[ "0.73630613", "0.7347031", "0.7215883", "0.71634805", "0.71544456", "0.71317524", "0.7123426", "0.7119055", "0.70908254", "0.7038634", "0.7020937", "0.7018889", "0.70058846", "0.7001001", "0.69867754", "0.6964717", "0.6941777", "0.693072", "0.69003654", "0.6891231", "0.68892854", "0.68789196", "0.6877498", "0.6848687", "0.684384", "0.6834209", "0.680974", "0.6806298", "0.6799862", "0.6798445", "0.67952025", "0.6758019", "0.6750142", "0.67395455", "0.6735814", "0.6730339", "0.67196625", "0.67109424", "0.6710178", "0.670756", "0.66934216", "0.66886985", "0.6685946", "0.6664809", "0.6657899", "0.66574305", "0.66540635", "0.6649639", "0.66483486", "0.66476285", "0.6647542", "0.66465086", "0.6635075", "0.6633407", "0.6631268", "0.66275764", "0.6617482", "0.6614574", "0.6607494", "0.659264", "0.6589237", "0.6585533", "0.6582555", "0.65814507", "0.6580764", "0.65743166", "0.65720123", "0.65720123", "0.65720123", "0.65720123", "0.6567401", "0.655267", "0.6550088", "0.65488786", "0.6548491", "0.65484685", "0.6543597", "0.653707", "0.653707", "0.6532345", "0.6531918", "0.6531708", "0.6531565", "0.65314555", "0.65293294", "0.65292287", "0.6526775", "0.65242136", "0.6516836", "0.6515459", "0.65075153", "0.6506322", "0.6505312", "0.65042216", "0.65009314", "0.6498618", "0.6498417", "0.64978623", "0.6493323", "0.6490639", "0.64902043" ]
0.0
-1
Data model used for the computer product
public ComputerDataModel() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Product {\n\n //Define Variables data Type\n\n\n\n //methods Get and set information\n\n //item number, the name of the product, the number of units in stock, and the price of each unit.\n\n void SetItemNumber(int ItemNumber);\n int getItemNumber();\n\n void SetPrice(Double Price);\n Double getPrice();\n\n void SetName(String ProductName);\n String getName();\n\n double GetUnitsInStock();\n\n}", "public ModelInfo generateInfo() { \n ModelInfo info = new ModelInfo();\n \n // Store basic info\n info.author = Author;\n info.citation = Citation;\n info.description = Description;\n info.property = Property;\n info.training = Model.TrainingStats.NumberTested + \" entries: \" + TrainingSet;\n info.notes = Notes;\n info.trainTime = new SimpleDateFormat(\"dMMMyy HH:mm z\").format(Model.getTrainTime());\n \n // Store units or class names\n if (Model instanceof AbstractClassifier) {\n info.classifier = true;\n info.units = \"\";\n AbstractClassifier clfr = (AbstractClassifier) Model;\n boolean started = false;\n for (String name : clfr.getClassNames()) {\n if (started) {\n info.units += \";\";\n }\n info.units += name;\n started = true;\n }\n } else {\n info.classifier = false;\n info.units = Units;\n }\n \n // Store names of models\n info.dataType = Dataset.printDescription(true);\n info.modelType = Model.printDescription(true);\n \n // Store validation performance data\n info.valMethod = Model.getValidationMethod();\n if (Model.isValidated()) {\n info.valScore = Model.ValidationStats.getStatistics();\n }\n \n return info;\n }", "DataModel getDataModel ();", "protected List<DataModel> generateModel(){\n\t\tList<DataModel> list = new ArrayList<DataModel>();\n\t\t\n\t\tDataModel outTemperature = new DataModelTemperature(\"Outer Temperature\", this);\n\t\toutTemperature.setShouldAlarm(false);\n\t\toutTemperature.setMaxSafeValue(200);\n\t\toutTemperature.setHowManyPercentageToAdd(0.5);\n\t\toutTemperature.setVibeRate(2.42);\n\t\tlist.add(outTemperature);\n\t\t\n\t\tlist.add(new DataModelTemperature(\"Inner Temperature\", this));\n\t\tlist.add(new DataModelHumidity(\"Humidity\", this));\n\t\tlist.add(new DataModelOxygen(\"Oxygen\", this));\n\t\t\n\t\treturn list;\n\t}", "ModelData getModel();", "protected DirectProductNodeModel() {\n\t\tsuper(2, 1);\n\t}", "protected abstract String getPreprocessingModel(PipelineData data);", "@Override\n\tvoid putData() {\n\t\tSystem.out.println(\"Brand : \"+brand);\n\t\tSystem.out.println(\"Model : \"+model);\n\t\tSystem.out.println(\"Year of manufacture : \"+year_of_manufacture);\n\t\tSystem.out.println(\"CC : \"+cc);\n\t}", "public Map buildDataModel() {\r\n\t\tMap<String, Object> root = new HashMap<String, Object>();\r\n\t\t\t\t\r\n\t\t// Create the \"latestProduct\" hash. We use a JavaBean here, but it could be a Map too.\r\n\t\t\t\t\t\t\r\n\t\tProduct latestProduct = new Product();\r\n\t\tlatestProduct.setUrl(\"products/greenmouse.html\");\r\n\t\tlatestProduct.setName(\"green mouse\");\r\n\t\t\r\n\t\t// and all animals\r\n\t\tAnimal mouse = new Animal();\r\n\t\tmouse.setSize(\"small\");\r\n\t\tmouse.setPrice(50);\r\n\t\t\r\n\t\tAnimal elephant = new Animal();\r\n\t\telephant.setSize(\"large\");\r\n\t\telephant.setPrice(5000);\r\n\t\t\r\n\t\tAnimal python = new Animal();\r\n\t\tpython.setSize(\"medium\");\r\n\t\tpython.setPrice(4999);\r\n\t\tList<Animal> animals = new ArrayList<Animal>();\r\n\t\t\r\n\t\tanimals.add(mouse);\r\n\t\tanimals.add(elephant);\r\n\t\tanimals.add(python);\r\n\t\tMisc foo = new Misc();\r\n\t\tfoo.setFoo(\"Something\");\r\n\t\t\r\n\t\t// and put it into the root\r\n\t\troot.put(\"user\", \"Big Joe\");\r\n\t\troot.put(\"latestProduct\", latestProduct);\r\n\t\troot.put(\"message\",\"It is a test\");\r\n\t\troot.put(\"foo\",foo);\r\n\t\troot.put(\"animals\", animals);\r\n\t\treturn root;\r\n\t}", "public VendingMachine(){\n this.customerMoney = new ArrayList<>();\n this.bank = new ArrayList<>();\n this.stock = new ArrayList<>();\n stock.add(new Product(\"Cookie\", .50, 10));\n stock.add(new Product(\"Crackers\", .25, 10));\n stock.add(new Product(\"Candy\", .45, 10));\n stock.add(new Product(\"Water\", 1.0, 10));\n stock.add(new Product(\"Juice\", 1.5, 10));\n }", "public interface ProcessModel {\n\t\n\t\n\t\n\t/** \n\t * Returns the initial covariance matrix.\n\t * @return the initial covariance matrix.\n\t */\n\tpublic Matrix P0 ();\n\n\t/**\n\t * Returns the process noise matrix.\n\t * @param t time\n\t * @param dt dt = current time - previous time.\n\t * @param x current state vector\n\t * @return the process noise matrix.\n\t */\n\tpublic Matrix Q (double t, double dt, EstSTM x);\n\n\n\t/** \n\t * Returns the initial reference state.\n\t * @return the initial reference state.\n\t */\n\tpublic VectorN xref0 ();\n\t\n\t/**\n\t * Returns the number of states.\n\t * @return the number of states.\n\t */\t\n\tpublic int numberOfStates();\n\t\n\t/** \n\t * Propagate the state and state transition matrix to the next measurement time.\n\t * @param t0 previous time\n\t * @param xin array containing state and state transition matrix at previous time.\n\t * @param tf next time\n\t */\t\n\tpublic double[] propagate( double t0, double[] xin, double tf);\n\t\n\t/**\n\t * Print out the state and covariance data\n\t * @param t time\n\t * @param state state vector\n\t * @param covariance covariance matrix\n\t */\n\tpublic void print(double t, VectorN state, Matrix covariance);\n\t\n\t/**\n\t * Print out the residuals\n\t * @param t time\n\t * @param resid1 residual before the measurement update\n\t * @param resid2 residual after the measurement update\n\t */\n\tpublic void printResiduals(double t, double resid1, double resid2);\n\t\n\t/**\n\t * Close all open LinePrinters\n\t */\n\tpublic void closeLinePrinter();\n\n}", "public Model() {\n operation = new DecimalOperation();\n base = 10;\n newnum = true;\n memory = new Stack<>();\n }", "public interface Model {\n void addBasket(String name, int date);\n\n void updateBasket(String name, String ticker, int shares) throws Exception;\n\n String printBasket(String name) throws NullPointerException;\n\n String getTrend(String name, int start, int end) throws IllegalArgumentException;\n\n void addPlot(String name);\n\n void removePlot(String name);\n\n List<List<Integer>> plots(int startingDate, int endingDate);\n}", "@Override\n\tpublic Data getDataModelVariables() {\n\t\treturn new Data();\n\t}", "public ProductImp() {\n insert(new Product(\"hammer\", 9.99));\n insert(new Product(\"screwdriver\", 9.99));\n insert(new Product(\"drill\", 19.99));\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 }", "public ModelStructure(){\n dcModelPurposeIndexMap = new HashMap<String,Integer>();\n dcModelIndexPurposeMap = new HashMap<Integer,String>();\n dcSoaUecIndexMap = new HashMap<String,Integer>();\n dcUecIndexMap = new HashMap<String,Integer>();\n tourModeChoiceUecIndexMap = new HashMap<String,Integer>();\n stopFreqUecIndexMap = new HashMap<String,Integer>();\n stopLocUecIndexMap = new HashMap<String,Integer>();\n tripModeChoiceUecIndexMap = new HashMap<String,Integer>();\n \n segmentedPurposeIndexMap = new HashMap<String,Integer>();\n segmentedIndexPurposeMap = new HashMap<Integer,String>();\n\n primaryPurposeIndexMap = new HashMap<String,Integer>();\n primaryIndexPurposeMap = new HashMap<Integer,String>();\n primaryPurposeIndexMap.put( \"Home\", -1 );\n primaryPurposeIndexMap.put( \"Work\", -2 );\n primaryPurposeIndexMap.put( WORK_PURPOSE_NAME, WORK_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( UNIVERSITY_PURPOSE_NAME, UNIVERSITY_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( SCHOOL_PURPOSE_NAME, SCHOOL_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( ESCORT_PURPOSE_NAME, ESCORT_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( SHOPPING_PURPOSE_NAME, SHOPPING_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( OTH_MAINT_PURPOSE_NAME, OTH_MAINT_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( EAT_OUT_PURPOSE_NAME, EAT_OUT_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( SOCIAL_PURPOSE_NAME, SOCIAL_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( OTH_DISCR_PURPOSE_NAME, OTH_DISCR_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( AT_WORK_PURPOSE_NAME, AT_WORK_PURPOSE_INDEX );\n primaryIndexPurposeMap.put( -1, \"Home\" );\n primaryIndexPurposeMap.put( -2, \"Work\" );\n primaryIndexPurposeMap.put( WORK_PURPOSE_INDEX, WORK_PURPOSE_NAME );\n primaryIndexPurposeMap.put( UNIVERSITY_PURPOSE_INDEX, UNIVERSITY_PURPOSE_NAME );\n primaryIndexPurposeMap.put( SCHOOL_PURPOSE_INDEX, SCHOOL_PURPOSE_NAME );\n primaryIndexPurposeMap.put( ESCORT_PURPOSE_INDEX, ESCORT_PURPOSE_NAME );\n primaryIndexPurposeMap.put( SHOPPING_PURPOSE_INDEX, SHOPPING_PURPOSE_NAME );\n primaryIndexPurposeMap.put( OTH_MAINT_PURPOSE_INDEX, OTH_MAINT_PURPOSE_NAME );\n primaryIndexPurposeMap.put( EAT_OUT_PURPOSE_INDEX, EAT_OUT_PURPOSE_NAME );\n primaryIndexPurposeMap.put( SOCIAL_PURPOSE_INDEX, SOCIAL_PURPOSE_NAME );\n primaryIndexPurposeMap.put( OTH_DISCR_PURPOSE_INDEX, OTH_DISCR_PURPOSE_NAME );\n primaryIndexPurposeMap.put( AT_WORK_PURPOSE_INDEX, AT_WORK_PURPOSE_NAME );\n }", "private void setupModel() {\n\n //Chooses which model gets prepared\n switch (id) {\n case 2:\n singlePackage = new Node();\n activeNode = singlePackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_solo)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 3:\n multiPackage = new Node();\n activeNode = multiPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_multi_new)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 4:\n wagonPackage = new Node();\n activeNode = wagonPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_car_new)\n .build().thenAccept(a -> activeRenderable = a)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n default:\n mailbox = new Node();\n activeNode = mailbox;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.mailbox)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n }\n }", "M getModel();", "NCModel getModel();", "@Override\n\tpublic DataType dataType() {\n\n\t\treturn new StructType().\n\t\t\t\t// add(\"device_distr\",\n\t\t\t\t// DataTypes.createArrayType(DataTypes.createMapType(DataTypes.StringType,\n\t\t\t\t// DataTypes.FloatType, true)))\n\t\tadd(\"device_distribution\", DataTypes.StringType).add(\"time_spent\", DataTypes.LongType).add(\"video_start\",\n\t\t\t\tDataTypes.LongType);\n\n\t}", "public WeightingModel(){}", "ArtefactModel getArtefactModel();", "private void loadData()\r\n\t{\r\n\t\taddProduct(\"Area\", \"Education\");\r\n\t\taddProduct(\"Area\", \"Environment\");\r\n\t\taddProduct(\"Area\", \"Health\");\r\n\r\n\t\taddProduct(\"Domain\", \"Documentation\");\r\n\t\taddProduct(\"Domain\", \"Project Activity\");\r\n\t\taddProduct(\"Domain\", \"Technology\");\r\n\r\n\t\taddProduct(\"City\", \"Bangalore\");\r\n\t\taddProduct(\"City\", \"Hyderabad\");\r\n\t\taddProduct(\"City\", \"Lucknow\");\r\n\r\n\t\taddProduct(\"Activity_Type\", \"Onsite\");\r\n\t\taddProduct(\"Activity_Type\", \"Offsite\");\r\n\r\n\t}", "DataModel createDataModel();", "private void generateModel() {\n // Initialize a new model object\n mCm = new CategoryModel[nodes.length];\n\n for (int i = 0; i < nodes.length; i++) {\n mCm[i] = new CategoryModel(nodes[i].id, nodes[i].title);\n }\n }", "public ModelData modelData()\n\t{\n\t\treturn new PriceChangeEditModelData(this);\n\t}", "public Driver(){\n\t\tthis.D = Parameters.numberOfDocuments;\n\t\tthis.K = Parameters.numberOfTopics;\n\t\tthis.V = Parameters.sizeOfVocabulary;\n\n\t\tthis.oldAlpha = new double[this.K];\n\t\tthis.newAlpha = new double[this.K];\n\t\tthis.hessian = new double[this.K][this.K];\n\t\tthis.gradient = new double[this.K];\n\t}", "Product getPProducts();", "Object getProduct();", "public static void main(String[] args) {\n\t Product a = new Product(123, \"Shiseido Face Cream\", 85.00 , 2);\r\n\t Product b = new Product(111, \"Chanel Perfume\", 65.00, 5);\r\n\t \r\n\t System.out.println(a.toString());\r\n\t System.out.println(b.toString());\r\n\t \r\n}", "@Override\n\tpublic Product getModel() {\n\t\treturn product;\n\t}", "ProductInner innerModel();", "IDataModel getIDataModel();", "public String product() {\n return this.product;\n }", "public interface Equipment {\n String manufacturer = \"\";\n Float msrp = 0f;\n Boolean genuine = true;\n}", "public void modelShow() {\n\t\tSystem.out.println(\"秀衣服\");\n\t}", "public Tuple getModel();", "public Data() {\n initComponents();\n koneksi_db();\n tampil_data();\n }", "public byte getIProduct() {\r\n\t\treturn iProduct;\r\n\t}", "public static String getDeviceModel() {\n String deviceName = SystemProperties.get(\"prize.system.boot.rsc\");\n // prize modify for bug66476 by houjian end\n deviceName = !TextUtils.isEmpty(deviceName) ? deviceName : Build.MODEL + DeviceInfoUtils.getMsvSuffix();\n //prize modified by xiekui, fix bug 74122, 20190408-start\n return UtilsExt.useDeviceInfoSettingsExt() == null ? deviceName : UtilsExt.useDeviceInfoSettingsExt().customeModelInfo(deviceName);\n //prize modified by xiekui, fix bug 74122, 20190408-end\n }", "public ME_Model() {\n _nheldout = 0;\n _early_stopping_n = 0;\n _ref_modelp = null;\n }", "@Override\n public Productor getProductor() {\n return new ProductorImp1();\n }", "DataModelOracle getDataModelOracle( Path project );", "public Product inputProduct() {\n Scanner in = new Scanner(System.in);\n System.out.println(\"Description:\");\n String dscrp = in.next();\n p.setName(dscrp);\n System.out.println(\"Price:\");\n double Price = in.nextDouble();\n p.setPrice(Price);\n System.out.println(\"Quantity:\");\n int Quantity = in.nextInt();\n p.setQuantity(Quantity);\n\n return new Product(p.getName(), p.getPrice(), p.getQuantity());\n }", "EisModel createEisModel();", "com.google.ortools.linearsolver.MPModelProto getModel();", "public void initializeStructure(){\n\t\tif ( !this.isRegistered()){\n\t\t\tthrow new Error(\"Can't initialize structure for unregistered SOS2Primitive\");\n\t\t}\n\t\tMatrix matrix=parentComponent.matrix;\n\t\tint col=0;\n\t\t// First create a variable for the x value itself but have it contribute nothing to the objective \n\t\tMatrixVariable newVariable=new MatrixVariable(0,0,1.0,LPX.LPX_FR,LPX.LPX_CV,matrix.numCols(),ObjectiveType.SOS2DUMMY);\n\t\tnewVariable.setTag(objType+label+\"_x\");\n\t\tmatrix.addVariable(newVariable);\n\t\tregisterVariable(newVariable,col);\n\t\tcol++;\n\t\t// Now create the weighting variables \n\t\tfor(int i=0;i<xVals.length;i++){\n\t\t\tnewVariable=new MatrixVariable(yVals[i],\n\t\t\t\t\t0.0,1.0,\n\t\t\t\t\tLPX.LPX_DB,LPX.LPX_CV,matrix.numCols(),objType);\n\t\t\tnewVariable.setTag(objType+label+\"y\"+i);\n\t\t\tmatrix.addVariable(newVariable);\n\t\t\tregisterVariable(newVariable,col);\n\t\t\tcol++;\n\t\t}\n\t\t// Now the binary variables\n\t\tfor(int i=0;i<(xVals.length-1);i++){\n\t\t\tnewVariable=new MatrixVariable(0,\n\t\t\t\t\t0.0,1.0,\n\t\t\t\t\tLPX.LPX_DB,LPX.LPX_IV,matrix.numCols(),ObjectiveType.SOS2DUMMY);\n\t\t\tnewVariable.setTag(label+\"b\"+i);\n\t\t\tmatrix.addVariable(newVariable);\n\t\t\tregisterVariable(newVariable,col);\n\t\t\tcol++;\n\t\t}\t\t\n\t}", "public void induceModel(Graph graph, DataSplit split) {\r\n super.induceModel(graph, split);\r\n Node[] trainingSet = split.getTrainSet();\r\n if(trainingSet == null || trainingSet.length == 0)\r\n return;\r\n\r\n Attributes attribs = trainingSet[0].getAttributes();\r\n FastVector attInfo = new FastVector(tmpVector.length);\r\n logger.finer(\"Setting up WEKA attributes\");\r\n if(useIntrinsic)\r\n {\r\n for(Attribute attrib : attribs)\r\n {\r\n // do not include the KEY attribute\r\n if(attrib == attribs.getKey())\r\n continue;\r\n\r\n switch(attrib.getType())\r\n {\r\n case CATEGORICAL:\r\n String[] tokens = ((AttributeCategorical)attrib).getTokens();\r\n FastVector values = new FastVector(tokens.length);\r\n for(String token : tokens)\r\n values.addElement(token);\r\n attInfo.addElement(new weka.core.Attribute(attrib.getName(),values));\r\n logger.finer(\"Adding WEKA attribute \"+attrib.getName()+\":Categorical\");\r\n break;\r\n\r\n default:\r\n attInfo.addElement(new weka.core.Attribute(attrib.getName()));\r\n logger.finer(\"Adding WEKA attribute \"+attrib.getName()+\":Numerical\");\r\n break;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n String[] tokens = attribute.getTokens();\r\n FastVector values = new FastVector(tokens.length);\r\n for(String token : tokens)\r\n values.addElement(token);\r\n attInfo.addElement(new weka.core.Attribute(attribute.getName(),values));\r\n logger.finer(\"Adding WEKA attribute \"+attribute.getName()+\":Categorical\");\r\n }\r\n\r\n for(Aggregator agg : aggregators)\r\n {\r\n Attribute attrib = agg.getAttribute();\r\n switch(agg.getType())\r\n {\r\n case CATEGORICAL:\r\n String[] tokens = ((AttributeCategorical)attrib).getTokens();\r\n FastVector values = new FastVector(tokens.length);\r\n for(String token : tokens)\r\n values.addElement(token);\r\n attInfo.addElement(new weka.core.Attribute(agg.getName(),values));\r\n logger.finer(\"Adding WEKA attribute \"+agg.getName()+\":Categorical\");\r\n break;\r\n\r\n default:\r\n attInfo.addElement(new weka.core.Attribute(agg.getName()));\r\n logger.finer(\"Adding WEKA attribute \"+agg.getName()+\":Numerical\");\r\n break;\r\n }\r\n }\r\n\r\n Instances train = new Instances(\"train\",attInfo,split.getTrainSetSize());\r\n train.setClassIndex(vectorClsIdx);\r\n\r\n for(Node node : split.getTrainSet())\r\n {\r\n double[] v = new double[attInfo.size()];\r\n makeVector(node,v);\r\n train.add(new Instance(1,v));\r\n }\r\n try\r\n {\r\n classifier.buildClassifier(train);\r\n }\r\n catch(Exception e)\r\n {\r\n throw new RuntimeException(\"Failed to build classifier \"+classifier.getClass().getName(),e);\r\n }\r\n testInstance = new Instance(1,tmpVector);\r\n testInstances = new Instances(\"test\",attInfo,1);\r\n testInstances.setClassIndex(vectorClsIdx);\r\n testInstances.add(testInstance);\r\n testInstance = testInstances.firstInstance();\r\n }", "private DiscretePotentialOperations() {\r\n\t}", "SModel getOutputModel();", "public interface EngineNeuralNetwork extends EngineMachineLearning {\r\n\t\r\n\t/**\r\n\t * Decode an array to the neural network weights.\r\n\t * @param data The data to decode.\r\n\t */\r\n\tvoid decodeNetwork(double[] data);\r\n\r\n\t/**\r\n\t * Encode the neural network weights to an array.\r\n\t * @return The encoded neural network.\r\n\t */\r\n\tdouble[] encodeNetwork();\r\n\r\n\t/**\r\n\t * @return The length of the encoded array.\r\n\t */\r\n\tint getEncodeLength();\r\n}", "PriceModel createInstanceOfPriceModel();", "MetricModel createMetricModel();", "public HDPModel getModel() {\n HDPModelBuilder builder = new HDPModelBuilder(numberOfTopics, totalNumberOfWords);\n for (int k = 0; k < numberOfTopics; k++) {\n for (int w = 0; w < sizeOfVocabulary; w++) {\n builder.addTopicWordCount(k, w, wordCountByTopicAndTerm[k][w]);\n }\n }\n return builder.build();\n }", "PriceSummaryModel createInstanceOfPriceSummaryModel();", "private static String newModel() {\n\n End end = new End(0,0);\n Start start = new Start(0,0);\n End end1 = new End(0,0);\n Start start1 = new Start(0,0);\n End end2 = new End(0,0);\n Start start2 = new Start(0,0);\n Start start3 = new Start(0,0);\n End end3 = new End(0,0);\n Start start4 = new Start(0,0);\n End end4 = new End(0,0);\n\n Start start5 = new Start(2,2);\n End end5 = new End(2,7);\n Start start6 = new Start(2,8);\n End end6 = new End(6,8);\n Start start7 = new Start(4,1);\n End end7 = new End(4,4);\n Start start8 = new Start(7,3);\n End end8 = new End(7,5);\n Start start9 = new Start(9,6);\n End end9 = new End(9,8);\n\n\n\n AircraftCarrier aircraftCarrier = new AircraftCarrier(\"AircraftCarrier\",5,start,end);\n Battleship battleship = new Battleship(\"Battleship\",4,start1,end1);\n Cruiser cruiser = new Cruiser(\"Cruiser\",3,start2,end2);\n Destroyer destroyer = new Destroyer(\"Destroyer\",2,start3,end3);\n Submarine submarine = new Submarine(\"Submarine\",2,start4,end4);\n\n ComputerAircraftCarrier computer_aircraftCarrier = new ComputerAircraftCarrier(\"Computer_AircraftCarrier\",5,start5,end5);\n ComputerBattleship computer_battleship = new ComputerBattleship(\"Computer_Battleship\",4,start6,end6);\n ComputerCruiser computer_cruiser = new ComputerCruiser(\"Computer_Cruiser\",3,start7,end7);\n ComputerDestroyer computer_destroyer = new ComputerDestroyer(\"Computer_Destroyer\",2,start8,end8);\n ComputerSubmarine computer_submarine = new ComputerSubmarine(\"Computer_Submarine\",2,start9,end9);\n ArrayList<Hits>playerHits = new ArrayList<Hits>();\n ArrayList<Misses>playerMisses = new ArrayList<Misses>();\n ArrayList<Misses>computerMisses = new ArrayList<Misses>();\n ArrayList<Hits>computerHits = new ArrayList<Hits>();\n\n BattleshipModel battleshipModel = new BattleshipModel(aircraftCarrier,battleship,cruiser,destroyer,submarine,\n computer_aircraftCarrier,computer_battleship,computer_cruiser,computer_destroyer,computer_submarine,\n playerHits,playerMisses,computerHits,computerMisses);\n\n Gson gson = new Gson();\n String battleshipModelWithJson = gson.toJson(battleshipModel);\n return battleshipModelWithJson;\n }", "public static void main(String [] args)\n\t{\n\t\tProduct p = new Product(\"P10\", \"Table\", 10.00, true);\n\t\tSystem.out.println(p);\n\t}", "public ProductModel getProduct()\n\t{\n\t\treturn product;\n\t}", "public String getDatabaseProduct();", "public interface Model {\n /**\n * Generate a image of checker board pattern (8 X 8) of the given size.\n *\n * @param size the size of the image\n * @return the 3D array of the generated checkerboard.\n */\n int[][][] generateChecker(int size);\n\n /**\n * Generate a image if rainbow stripes (7 colors) with the given size.\n *\n * @param height the height of the image\n * @param width the width of the image\n * @param vOrH the stripes should be vertical of horizontal.\n * @return the 3D array of the generated rainbow stripes.\n */\n int[][][] generateRainbow(int height, int width, VOrH vOrH);\n\n /**\n * Generate the appropriate-sized flags of a country with the given ratio.\n *\n * @param ratio the given ratio of the flag.\n * @param country the country whose flag will be generated.\n * @return the 3D array of the generated flag.\n */\n int[][][] generateFlags(int ratio, String country);\n\n /**\n * Blur the image using the image processor.\n *\n * @param imageArray the 3D array of the image\n * @param height the height of the image\n * @param width the width of the image\n * @return the 3D array of the blurred image\n */\n int[][][] blurImage(int[][][] imageArray, int height, int width);\n\n /**\n * Sharpen the image using the image processor.\n *\n * @param imageArray the 3D array of the image\n * @param height the height of the image\n * @param width the width of the image\n * @return the 3D array the sharpened image\n */\n int[][][] sharpenImage(int[][][] imageArray, int height, int width);\n\n /**\n * Grey scale the image using the image processor.\n *\n * @param imageArray the 3D array of the image\n * @param height the height of the image\n * @param width the width of the image\n * @return 3D array of the greyscale image\n */\n int[][][] greyscaleImage(int[][][] imageArray, int height, int width);\n\n /**\n * Sepia- tone the image using the image processor.\n *\n * @param imageArray the 3D array of the image\n * @param height the height of the image\n * @param width the width of the image\n * @return the 3D array of the sepia-tone image\n */\n int[][][] sepiaToneImage(int[][][] imageArray, int height, int width);\n\n /**\n * Dither the image using the image processor.\n *\n * @param imageArray the 3D array of the image\n * @param height the height of the image\n * @param width the width of the image\n * @return 3D array of the dithered image\n */\n int[][][] ditheringImage(int[][][] imageArray, int height, int width);\n\n /**\n * Mosaic the image using the image processor.\n *\n * @param imageArray the 3D array of the image\n * @param height the height of the image.\n * @param width the width of the image.\n * @param seedNum the number of seeds.\n * @return the 3D array of mosaic image.\n */\n int[][][] mosaicingImage(int[][][] imageArray, int height, int width, int seedNum);\n\n /**\n * Undo. Return a previous result before the operation.\n *\n * @return a previous result.\n * @throws EmptyStackException when there is no previous one.\n */\n int[][][] undo() throws EmptyStackException;\n\n /**\n * Redo. Return a previous result before an undo.\n *\n * @return a previous result before an undo.\n * @throws EmptyStackException when there is no previous one.\n */\n int[][][] redo() throws EmptyStackException;\n\n /**\n * Set the stacks for undo and redo. Add a new element to the undo stack, and clear the redo\n * stack.\n * @param add the image in 3D array to be added to the stack.\n */\n void setStack(int[][][] add);\n}", "public interface ModeloProdutoProduto extends DCIObjetoDominio , ModeloProdutoProdutoAgregadoI , ModeloProdutoProdutoDerivadaI\n{\n\n\t\n\tpublic long getIdModeloProdutoProduto();\n\tpublic void setIdModeloProdutoProduto(long valor);\n\t\n\t\n\tpublic long getIdModeloProdutoRa();\n\tpublic void setIdModeloProdutoRa(long valor);\n\t\n\t\n\tpublic long getIdProdutoRa();\n\tpublic void setIdProdutoRa(long valor);\n\t\n\t\n}", "public Product()\n\t{\n\t\tthis.name = \"\";\n\t\tthis.price = 0.0;\n\t\tthis.imported = false;\n\t\tthis.quantity = 0;\n\t\tthis.taxedCost = 0.0;\n\t}", "interface IModel {\n\n /**\n * Get settings of this model.\n * @return the settings\n */\n Settings getSettings();\n\n /**\n * Set the settings of this mobile.\n * @param sm the settings\n * @return Returns if the Settings could be set successfuly\n */\n boolean setSettings(Settings sm);\n\n /**\n * Add a device to the list containing the devices.\n * @param pc the pc to add\n */\n void addPC(PCDevice pc);\n\n /**\n * Get a PCDevice by unique ID.\n * @param uID unique ID\n * @return the PCDevice\n */\n PCDevice getPC(UUID uID);\n\n /**\n * Remove a device from list by unique ID.\n * @param uID the unique ID.\n */\n void removePC(UUID uID);\n\n /**\n * Add all devices from collection to the device list.\n * @param pcs the devices to add.\n * @return <tt>true</tt>\n */\n boolean addAllPCs(List<PCDevice> pcs);\n\n /**\n * Get all devices currently in device list.\n * @return the PCs\n */\n List<PCDevice> getAllPC();\n}", "@Override\n\tvoid getData() {\n\t\tSystem.out.println(\"Enter Brand\");\n\t\tbrand=a.next();\n\t\tSystem.out.println(\"Enter model\");\n\t\tmodel=a.next();\n\t\tSystem.out.println(\"Enter CC\");\n\t\tcc=a.nextDouble();\n\t}", "public String getKind_of_product() {\r\n return kind_of_product;\r\n }", "public InterpolationModel() {\n\tUnigram = new UnigramModel();\n\tBigram = new BigramModel();\n\tTrigram = new TrigramModel();\n }", "private BasePackage getPackageModel()\r\n {\r\n return packageCartService.getBasePackage();\r\n }", "protected Product() {\n\t\t\n\t}", "private void loadProducts() {\n\t\tproduct1 = new Product();\n\t\tproduct1.setId(1L);\n\t\tproduct1.setName(HP);\n\t\tproduct1.setDescription(HP);\n\t\tproduct1.setPrice(BigDecimal.TEN);\n\n\t\tproduct2 = new Product();\n\t\tproduct2.setId(2L);\n\t\tproduct2.setName(LENOVO);\n\t\tproduct2.setDescription(LENOVO);\n\t\tproduct2.setPrice(new BigDecimal(20));\n\n\t}", "public Product() {}", "protected EObject createInitialModel() {\r\n \t\tReqIF root = reqif10Factory.createReqIF();\r\n \r\n \t\tReqIFHeader header = reqif10Factory.createReqIFHeader();\r\n \t\troot.setTheHeader(header);\r\n \r\n \t\t// Setting the time gets more and more complicated...\r\n \t\ttry {\r\n \t\t\tGregorianCalendar cal = new GregorianCalendar();\r\n \t\t\tcal.setTime(new Date());\r\n \t\t\theader.setCreationTime(DatatypeFactory.newInstance()\r\n \t\t\t\t\t.newXMLGregorianCalendar(cal));\r\n \t\t} catch (DatatypeConfigurationException e) {\r\n \t\t\tthrow new RuntimeException(e);\r\n \t\t}\r\n \r\n \t\theader.setSourceToolId(\"ProR (http://pror.org)\");\r\n //\t\theader.setAuthor(System.getProperty(\"user.name\"));\r\n \r\n \t\tReqIFContent content = reqif10Factory.createReqIFContent();\r\n \t\troot.setCoreContent(content);\r\n \r\n \t\t// Add a DatatypeDefinition\r\n \t\tDatatypeDefinitionString ddString = reqif10Factory\r\n \t\t\t\t.createDatatypeDefinitionString();\r\n \t\tddString.setLongName(\"T_String32k\");\r\n \t\tddString.setMaxLength(new BigInteger(\"32000\"));\r\n \t\tcontent.getDatatypes().add(ddString);\r\n \r\n \t\t// Add a Specification\r\n \t\tSpecification spec = reqif10Factory.createSpecification();\r\n \t\tspec.setLongName(\"Specification Document\");\r\n \t\tcontent.getSpecifications().add(spec);\r\n \r\n \t\t// Add a SpecType\r\n \t\tSpecObjectType specType = reqif10Factory.createSpecObjectType();\r\n \t\tspecType.setLongName(\"Requirement Type\");\r\n \t\tcontent.getSpecTypes().add(specType);\r\n \r\n \t\t// Add an AttributeDefinition\r\n \t\tAttributeDefinitionString ad = reqif10Factory\r\n \t\t\t\t.createAttributeDefinitionString();\r\n \t\tad.setType(ddString);\r\n \t\tad.setLongName(\"Description\");\r\n \t\tspecType.getSpecAttributes().add(ad);\r\n \r\n \t\t// Configure the Specification View\r\n \t\tProrToolExtension extension = ConfigurationFactory.eINSTANCE\r\n \t\t\t\t.createProrToolExtension();\r\n \t\troot.getToolExtensions().add(extension);\r\n \t\tProrSpecViewConfiguration prorSpecViewConfiguration = ConfigurationFactory.eINSTANCE\r\n \t\t\t\t.createProrSpecViewConfiguration();\r\n \t\textension.getSpecViewConfigurations().add(prorSpecViewConfiguration);\r\n \t\tprorSpecViewConfiguration.setSpecification(spec);\r\n \t\tColumn col = ConfigurationFactory.eINSTANCE.createColumn();\r\n \t\tcol.setLabel(\"Description\");\r\n \t\tcol.setWidth(400);\r\n \t\tprorSpecViewConfiguration.getColumns().add(col);\r\n \r\n \t\tColumn leftHeaderColumn = ConfigFactory.eINSTANCE.createColumn();\r\n \t\tleftHeaderColumn\r\n \t\t\t\t.setWidth(ConfigurationUtil.DEFAULT_LEFT_HEADER_COLUMN_WIDTH);\r\n \t\tleftHeaderColumn\r\n \t\t\t\t.setLabel(ConfigurationUtil.DEFAULT_LEFT_HEADER_COLUMN_NAME);\r\n \t\tprorSpecViewConfiguration.setLeftHeaderColumn(leftHeaderColumn);\r\n \r\n \t\t// Configure the Label configuration\r\n \t\tProrGeneralConfiguration generalConfig = ConfigurationFactory.eINSTANCE\r\n \t\t\t\t.createProrGeneralConfiguration();\r\n \t\tLabelConfiguration labelConfig = ConfigurationFactory.eINSTANCE\r\n \t\t\t\t.createLabelConfiguration();\r\n \t\tlabelConfig.getDefaultLabel().add(\"Description\");\r\n \t\tgeneralConfig.setLabelConfiguration(labelConfig);\r\n \t\textension.setGeneralConfiguration(generalConfig);\r\n \r\n \t\t// Create one Requirement\r\n \t\tSpecObject specObject = reqif10Factory.createSpecObject();\r\n \t\tspecObject.setType(specType);\r\n \t\tcontent.getSpecObjects().add(specObject);\r\n \t\tAttributeValueString value = reqif10Factory.createAttributeValueString();\r\n \t\tvalue.setTheValue(\"Start editing here.\");\r\n \t\tvalue.setDefinition(ad);\r\n \t\tspecObject.getValues().add(value);\r\n \r\n \t\t// Add the requirement to the Specification\r\n \t\tSpecHierarchy specHierarchy = reqif10Factory.createSpecHierarchy();\r\n \t\tspec.getChildren().add(specHierarchy);\r\n \t\tspecHierarchy.setObject(specObject);\t\r\n \t\treturn root;\r\n \t}", "public BoxModel getEnergyModel()\r\n/* 111: */ {\r\n/* 112:118 */ BoxModel boxes = new BoxModel();\r\n/* 113:119 */ boxes.add(new Box(0.1875F, 0.3125F, 0.3125F, 0.8125F, 0.6875F, 0.6875F));\r\n/* 114:120 */ boxes.add(new Box(0.3125F, 0.1875F, 0.3125F, 0.6875F, 0.8125F, 0.6875F));\r\n/* 115:121 */ boxes.add(new Box(0.3125F, 0.3125F, 0.1875F, 0.6875F, 0.6875F, 0.8125F));\r\n/* 116:122 */ boxes.add(new Box(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F));\r\n/* 117:123 */ return boxes;\r\n/* 118: */ }", "List<PriceInformation> getPriceForProduct(ProductModel product);", "public Products(){\n services = new LinkedHashMap<>();\n\n //Setting up products\n services.put(\"Consultation\", 30.0);\n services.put(\"Special Acupuncture Treatment\", 80.0);\n services.put(\"Medical Machine Therapy\", 30.0);\n services.put(\"Tapping Treatment\", 25.0);\n\n //Initializing the counter\n numCounter = services.size()+1;\n }", "public Product build() {\n Product product = new Product();\n product.product_id = this.product_id;\n product.product_name = this.product_name;\n product.price = this.price;\n product.in_stock = this.in_stock;\n product.amount = this.amount;\n product.ordered_amount = this.ordered_amount;\n product.order_price = this.order_price;\n\n return product;\n }", "public abstract M getModel();", "protected void establishTransformationModel() {\r\n\t \r\n\t\tTransformationModel transformModel ;\r\n\t\tArrayList<TransformationStack> modelTransformStacks ;\r\n\t\t\r\n\t\t\r\n\t\t// the variables needed for the profile\r\n\t\t// targetStruc = getTargetVector();\r\n\t\tsomData = soappTransformer.getSomData() ; \r\n\t\t// soappTransformer.setSomData( somApplication.getSomData() );\r\n\t\tsomApplication.setSomData(somData) ;\r\n\t\t\r\n\t\tsomData.getVariablesLabels() ;\r\n\t\t \r\n\t\t\r\n\t\t// from here we transfer...\r\n\t\tmodelTransformStacks = soappTransformer.getTransformationModel().getVariableTransformations();\r\n\t\ttransformModel = soappTransformer.getTransformationModel() ;\r\n\t\t \r\n\t\t\r\n\t\ttransformationModelImported = true;\r\n\t}", "public interface ManualQuote extends MutableBusinessModel\n{\n public static final String PROPERTY_PRODUCT_KEYS = \"PROPERTY_PRODUCT_KEYS\";\n public static final String PROPERTY_SIDE = \"PROPERTY_SIDE\";\n public static final String PROPERTY_PRICE = \"PROPERTY_PRICE\";\n public static final String PROPERTY_SIZE = \"PROPERTY_SIZE\";\n public static final String PROPERTY_OVERRIDE = \"PROPERTY_OVERRIDE\";\n\n // helper methods to struct attributes\n public String getSessionName();\n public ProductKeys getProductKeys();\n public char getSide();\n public Price getPrice();\n public int getSize();\n public boolean isOverrideIndicator();\n public ManualQuoteDetail getManualQuoteDetail();\n public KeyValueStruct[] getExtensions();\n public SessionProduct getSessionProduct();\n public SessionReportingClass getSessionReportingClass();\n public SessionProductClass getSessionProductClass();\n\n public void setSessionProduct(SessionProduct sessionProduct);\n public void setSessionReportingClass(SessionReportingClass sessionReportingClass);\n public void setSessionProductClass(SessionProductClass sessionProductClass);\n public void setSide(char side);\n public void setPrice(Price price);\n public void setSize(int size);\n public void setOverrideIndicator(boolean override);\n public void setManualQuoteDetail(ManualQuoteDetail manualQuoteDetail);\n public void setExtensions(KeyValueStruct[] keyValues);\n\n public ManualQuoteStruct getStruct();\n}", "String getProduct();", "private static void createProducts() {\n productRepository.addProduct(Product.builder()\n .name(\"Milk\")\n .barcode(new Barcode(\"5900017304007\"))\n .price(new BigDecimal(2.90))\n .build()\n );\n productRepository.addProduct(Product.builder()\n .name(\"Butter\")\n .barcode(new Barcode(\"5906217041483\"))\n .price(new BigDecimal(4.29))\n .build()\n );\n productRepository.addProduct(Product.builder()\n .name(\"Beer\")\n .barcode(new Barcode(\"5905927001114\"))\n .price(new BigDecimal(2.99))\n .build()\n );\n }", "public T getProduct() {\n return this.product;\n }", "public DataModel()\r\n {\r\n System.out.println(\"New DataModel created\");\r\n \r\n languageList = new LanguageList();\r\n }", "public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}", "opmodelFactory getopmodelFactory();", "@Override\n\t\tpublic int getModel() {\n\t\t\treturn 0;\n\t\t}", "public static void main(String args[]) {\nProducto p = new Producto(\"123456\", 1987.29f, 2123.10f);\r\nObservadorCodigoBarras ObsCodigo = new ObservadorCodigoBarras();\r\nObservadorCosto ObsCosto = new ObservadorCosto();\r\n// Agregando los Observadores para Producto!\r\np.addObserver(ObsCodigo);\r\np.addObserver(ObsCosto);\r\n// Crear y Manipular Cambios en el Producto.\r\nSystem.out.println(\"----Cambio de Codigo Barras---\");\r\np.setCodigoBarra(\"654321\");\r\nSystem.out.println(\"----Cambio de Costo---\");\r\np.setCosto(18879.6f);\r\n\r\n}", "public String getProduct() {\r\n return this.product;\r\n }", "public CommodityImg getModel() {\n\t\treturn commodityImg;\n\t}", "public interface PVPlant extends ElectricityGenerator {\n\n\t/**\n\t * Total area of the panels.\n\t */\n\tAreaResource panelArea();\n\n\t/**\n\t * Inclination of the modules in degrees. <br>\n\t * 0 : horizontal <br>\n\t * 90 : vertical.\n\t */\n\tAngleResource inclination();\n\n\t/**\n\t * Azimuthal orientation of the modules, from 0° to 360°. <br>\n\t */\n\tGeographicDirectionSensor azimuth();\n\n\t/**\n\t * Change in panel output power per temperature unit. Unit = 1/K. <br>\n\t * Note that this quantity is normally given in %/K instead of 1/K (factor 100 difference!). <br>\n\t * In practice, this value is temperature dependent. TODO\n\t * */\n\tFloatResource temperatureCoefficient();\n\n\t/**\n\t * Nominal Operating Cell Temperature (TNOCT), <br>\n\t * defined as the mean panel cell temperature for an open-rack mounted module in idle operation @ solar irradiance\n\t * of 800 W/m2 on the panel surface, ambient temperature of 20°C, wind speed of 1 m/s.\n\t */\n\tTemperatureResource nominalOperatingCellTemperature();\n\n\t/**\n\t * Solar panel installation type <br>\n\t * 1: roof mount <br>\n\t * 2: free standing <br>\n\t * 3: building integrated PV <br>\n\t * 10: flush mount roof installation (panels have the same orientation as the roof, panels close to roof) <br>\n\t * 11: open-rack roof installation <br>\n\t * 20: open-rack free standing <br>\n\t * 21: pole-mounted free standing\n\t */\n\tIntegerResource installationType();\n\n\t/**\n\t * 1: fixed installation, no tracking <br>\n\t * 2: single-axis tracking: horizontal <br>\n\t * 2: single-axis tracking: vertical <br>\n\t * 3: dual-axis tracking\n\t * */\n\tIntegerResource tracking();\n}", "public Product() { }", "public Product() { }", "protected abstract D createData();", "private String generateModel() {\n\t\tString model = \"\";\n\t\tint caseNumber = randomGenerator.nextInt(6) + 1;\n\t\t\n\t\tswitch (caseNumber) {\n\t\tcase 1: \n\t\t\tmodel = \"compact\";\n\t\t\tbreak;\n\t\tcase 2: \n\t\t\tmodel = \"intermediate\";\n\t\t\tbreak;\n\t\tcase 3: \n\t\t\tmodel = \"fullSized\";\n\t\t\tbreak;\n\t\tcase 4: \n\t\t\tmodel = \"van\";\n\t\t\tbreak;\n\t\tcase 5: \n\t\t\tmodel = \"suv\";\n\t\t\tbreak;\n\t\tcase 6: \n\t\t\tmodel = \"pickup\";\n\t\t\tbreak;\n\t\tdefault: \n\t\t\tmodel = \"\";\n\t\t\tbreak;\n\t\t}\n\t\treturn model;\n\t}", "public interface Product {\n String getName();\n void produce();\n}", "List<PriceRow> getPriceInformationsForProduct(ProductModel model);", "public QuinzicalModel() throws Exception {\n\t\tinitialiseCategories();\n\t\treadCategories();\n\t\tsetFiveRandomCategories();\n\t\tloadCurrentPlayer();\n\t\tsetAnsweredQuestions();\n\t\tFile winnings = new File(\"data/winnings\");\n\t\tif (!winnings.exists()) {\n\t\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/winnings\");\n\t\t\tBashCmdUtil.bashCmdNoOutput(\"echo 0 >> data/winnings\");\n\t\t}\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/tts_speed\");\n\t\tloadInternationalUnlocked();\n\t}", "private ProcessedDynamicData( ) {\r\n super();\r\n }", "public Object getModel();", "A getModel();" ]
[ "0.5952914", "0.59447426", "0.58885604", "0.58765733", "0.5860213", "0.57962734", "0.57385635", "0.5731524", "0.5728721", "0.5721892", "0.57165396", "0.5705831", "0.56600696", "0.5648542", "0.56454575", "0.5626632", "0.5620609", "0.5592561", "0.55780613", "0.5567918", "0.5517293", "0.55146855", "0.5498707", "0.54904324", "0.5440407", "0.54347646", "0.54316455", "0.54227674", "0.5408698", "0.5406558", "0.5405494", "0.54045075", "0.5401615", "0.5376906", "0.5371717", "0.5365731", "0.53557116", "0.5349551", "0.53461605", "0.53447", "0.5336901", "0.5336567", "0.5333838", "0.5327737", "0.5319385", "0.5312142", "0.53117406", "0.53065485", "0.5302633", "0.5300562", "0.529948", "0.52916026", "0.5286529", "0.52847075", "0.52780575", "0.5263248", "0.5252643", "0.52501667", "0.52499944", "0.524795", "0.5245178", "0.524405", "0.52326846", "0.5231916", "0.5222589", "0.5214282", "0.5213612", "0.5211138", "0.5210546", "0.52034146", "0.51926404", "0.5190124", "0.51868516", "0.5186228", "0.5182579", "0.5182343", "0.518022", "0.5178187", "0.5176919", "0.5173303", "0.5166965", "0.51655364", "0.51643413", "0.5164322", "0.51544213", "0.51541114", "0.5151842", "0.51494294", "0.51487345", "0.51462567", "0.5143651", "0.5143651", "0.51393807", "0.5138265", "0.51336545", "0.51290774", "0.5125403", "0.512493", "0.5124728", "0.5123763" ]
0.56252927
16
Sets the mock service to return for the given serviceName.
public static void setMockSystemService(String serviceName, Object service) { if (service != null) { sMockServiceMap.put(serviceName, service); } else { sMockServiceMap.remove(serviceName); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void setServiceName(String serviceName);", "public void setServiceName(String serviceName)\n {\n this.serviceName = serviceName;\n }", "public void setServiceName(String serviceName)\r\n {\r\n this.serviceName = serviceName;\r\n }", "public void setServiceName(String serviceName) {\n this.serviceName = serviceName;\n }", "public void setServiceName(String serviceName) {\n this.serviceName = serviceName;\n }", "public void setServiceName(String serviceName){\n this.serviceName = serviceName;\n }", "public static void setServiceName(String serviceName) {\n\t\tMDC.put(ApplicationConstants.SERVICE_NAME, serviceName);\n\t}", "public Builder withServiceName(String serviceName) {\n\t\t\tthis.serviceName = serviceName; \n\t\t\treturn this;\n\t\t}", "public Builder setServiceName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n serviceName_ = value;\n onChanged();\n return this;\n }", "public Builder setServiceName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n serviceName_ = value;\n onChanged();\n return this;\n }", "public Builder setServiceName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n serviceName_ = value;\n onChanged();\n return this;\n }", "public Builder serviceName(String serviceName) {\n commonAttributesBuilder.serviceName(serviceName);\n return this;\n }", "public void setService(String service) {\n this.service = service;\n }", "private void setService(Service service) {\n this.service = service;\n }", "public OracleConnectOptions setServiceName(String serviceName) {\n this.serviceName = serviceName;\n return this;\n }", "public void setService(String service) {\n this.service = service;\n }", "public void setService(String service) {\n this.service = service;\n }", "public void setService(String service) {\n this.service = service;\n }", "public Object getService(String serviceName);", "public void setServiceName(java.lang.String param){\n localServiceNameTracker = true;\n \n this.localServiceName=param;\n \n\n }", "public void setServiceName(final String serviceNameValue) {\n this.serviceName = serviceNameValue;\n }", "public void registerService(String serviceName){\n jmc.registerService(serviceName);\n }", "public Builder setService(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n service_ = value;\n onChanged();\n return this;\n }", "public Builder setService(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n service_ = value;\n onChanged();\n return this;\n }", "public Builder setService(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n service_ = value;\n onChanged();\n return this;\n }", "void setServiceId(java.lang.String serviceId);", "Object getService(String serviceName);", "public void setService (String service) {\n\t this.service = service;\n\t}", "public void registerService(String serviceName, Object service);", "public Event setService(String service) {\n this.service = service;\n return this;\n }", "public final void setService(java.lang.String service)\r\n\t{\r\n\t\tsetService(getContext(), service);\r\n\t}", "void putServiceNameServiceInfos(net.zyuiop.ovhapi.api.objects.services.Service param0, java.lang.String serviceName) throws java.io.IOException;", "public void assignService(String serviceName, Map attributes)\n throws SMSException {\n addServiceConfig(serviceName, attributes);\n }", "public void setService(Text newService) {\n service = newService;\n }", "public void setServiceRef(IntegrationAppmasterService<?> serviceRef) {\n\t\tthis.serviceRef = serviceRef;\n\t}", "public final void setService(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String service)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.Service.toString(), service);\r\n\t}", "public Builder withService(final String service) {\n this.service = service;\n return this;\n }", "public String getServiceName() {\n return serviceName;\n }", "public ServiceInstance lookupInstance(String serviceName);", "public Builder setServiceNameBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n serviceName_ = value;\n onChanged();\n return this;\n }", "public Builder setServiceNameBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n serviceName_ = value;\n onChanged();\n return this;\n }", "public void setService(Service value) {\n\t\tthis._service = value;\n\t}", "public String getServiceName()\r\n {\r\n return serviceName;\r\n }", "@JsonProperty(\"service\")\n public void setService(String service) {\n this.service = service;\n }", "@Transactional\n public abstract OnmsServiceType createServiceTypeIfNecessary(String serviceName);", "public NcrackClient onTargetService(TargetService targetService) {\n this.targetService = targetService;\n return this;\n }", "public String getServiceName()\n {\n return serviceName;\n }", "public String getServiceName() {\n return serviceName;\n }", "public Builder setService(\n go.micro.runtime.RuntimeOuterClass.Service.Builder builderForValue) {\n if (serviceBuilder_ == null) {\n service_ = builderForValue.build();\n onChanged();\n } else {\n serviceBuilder_.setMessage(builderForValue.build());\n }\n\n return this;\n }", "public Builder setService(\n go.micro.runtime.RuntimeOuterClass.Service.Builder builderForValue) {\n if (serviceBuilder_ == null) {\n service_ = builderForValue.build();\n onChanged();\n } else {\n serviceBuilder_.setMessage(builderForValue.build());\n }\n\n return this;\n }", "public Builder setService(\n go.micro.runtime.RuntimeOuterClass.Service.Builder builderForValue) {\n if (serviceBuilder_ == null) {\n service_ = builderForValue.build();\n onChanged();\n } else {\n serviceBuilder_.setMessage(builderForValue.build());\n }\n\n return this;\n }", "public void setServicename(java.lang.String newServicename) {\n\tservicename = newServicename;\n}", "public Service getService(final String serviceName) {\n final String[] arr = serviceName.split(\"::\");\n if (arr.length != 2) {\n logger.error(\n \"Servicename didnt match pattern 'archive::service': {}\",\n serviceName);\n return null;\n }\n final Archive archive = getArchive(arr[0]);\n if (archive != null) {\n return archive.getService(arr[1]);\n }\n logger.error(\"Could not find archive '{}'\", arr[0]);\n return null;\n }", "public abstract void setServiceType(String serviceType);", "public String getServiceName(){\n return serviceName;\n }", "void setCurrent(String serviceName, String currentAddress)\n\t{\n\t\tthis.currentAddress = currentAddress;\n\t\tthis.serviceName = serviceName;\n\t}", "public void testSetService() throws Exception {\n }", "public export.serializers.avro.DeviceInfo.Builder setService(java.lang.CharSequence value) {\n validate(fields()[1], value);\n this.service = value;\n fieldSetFlags()[1] = true;\n return this;\n }", "void setClassOfService(ClassOfService serviceClass);", "@Override\n\t\tpublic void setService(String system_id) throws RemoteException {\n\t\t\tSystem.out.println(\"set service invoke on \" + system_id);\n\t\t}", "public ServiceName getServiceName() {\n return serviceName;\n }", "public void setViewServiceName(String viewServiceName)\n {\n this.viewServiceName = viewServiceName;\n }", "@Required\n\tpublic void setTargetService(TargetService service) {\n\t\tthis.targetService = service;\n\t}", "public final void setFoundService(java.lang.Boolean foundservice)\r\n\t{\r\n\t\tsetFoundService(getContext(), foundservice);\r\n\t}", "@Override\n public String getServiceEndpoint(String serviceName) {\n return serviceEndpoints.get(serviceName);\n }", "private RegionServerServices getRegionServer(ServerName name) {\n\n RegionServerServices mockedServer = mock(RegionServerServices.class);\n when(mockedServer.getConfiguration()).thenReturn(TEST_UTIL.getConfiguration());\n when(mockedServer.getServerName()).thenReturn(name);\n when(mockedServer.getZooKeeper()).thenReturn(zkw);\n when(mockedServer.isStopped()).thenReturn(false);\n when(mockedServer.getExecutorService()).thenReturn(executorService);\n\n return mockedServer;\n }", "default void setEventService(EventService service) {\n bind(service);\n }", "public void setServicePath(String servicePath) {\n this.servicePath = servicePath;\n }", "net.zyuiop.ovhapi.api.objects.services.Service getServiceNameServiceInfos(java.lang.String serviceName) throws java.io.IOException;", "public String getServiceName() {\r\n return this.serviceName;\r\n }", "public ServerServices searchServerService(String serviceName, int servId);", "public String getServiceName() {\n return this.serviceName;\n }", "@Autowired\n\tpublic void setConfigService(ConfigService configService) {\n\t\tthis.configService = configService;\n\t}", "public Builder setServiceNameBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n serviceName_ = value;\n onChanged();\n return this;\n }", "public void setBankService(BankService bankService) {\r\n this.bankService = bankService;\r\n }", "void setTimerServiceResource(TimerService timerService);", "public String getServiceName() {\n return this.serviceName;\n }", "void putServiceName(net.zyuiop.ovhapi.api.objects.license.windows.Windows param0, java.lang.String serviceName) throws java.io.IOException;", "Object getService(String serviceName, boolean checkExistence);", "public abstract void setService(OntologyGenerationComponentServiceInterface<T,R> service);", "public Builder setService(go.micro.runtime.RuntimeOuterClass.Service value) {\n if (serviceBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n service_ = value;\n onChanged();\n } else {\n serviceBuilder_.setMessage(value);\n }\n\n return this;\n }", "public Builder setService(go.micro.runtime.RuntimeOuterClass.Service value) {\n if (serviceBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n service_ = value;\n onChanged();\n } else {\n serviceBuilder_.setMessage(value);\n }\n\n return this;\n }", "public Builder setService(go.micro.runtime.RuntimeOuterClass.Service value) {\n if (serviceBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n service_ = value;\n onChanged();\n } else {\n serviceBuilder_.setMessage(value);\n }\n\n return this;\n }", "public void setGameService(GameService gameService) {\n this.gameService = gameService;\n }", "public void setGameService(GameService gameService) {\n this.gameService = gameService;\n }", "protected void setServiceRegistry(ServiceRegistry serviceRegistry) {\n this.serviceRegistry = serviceRegistry;\n }", "protected void setServiceRegistry(ServiceRegistry serviceRegistry) {\n this.serviceRegistry = serviceRegistry;\n }", "public void setServiceID(java.lang.String serviceID)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SERVICEID$6, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SERVICEID$6);\n }\n target.setStringValue(serviceID);\n }\n }", "public void cloneService(final String serviceName, final String newServiceName) {\n selectOptionByValue(Page.SELECT_SERVICES_LIST, serviceName);\r\n fillInput(Page.INPUT_NAME, newServiceName);\r\n clickLink(Page.BUTTON_CLONE);\r\n }", "@Autowired\n\tpublic void setRegistratorService (RegistratorService registratorService) {\n\t\tthis.registratorService = registratorService;\n\t}", "public CreateServiceRequest withServiceName(String serviceName) {\n setServiceName(serviceName);\n return this;\n }", "public ServiceHandler createServiceHandler(\n Reactor reactor,\n SelectableChannel handle) {\n try {\n return new TestAcceptHandler(reactor, handle, this._pool);\n } catch (IOException ex) {\n MDMS.ERROR(ex.getMessage());\n return null;\n }\n }", "public void addServiceName(String name) {\n if (name != null) {\n this.serviceNameSet.add(name);\n }\n }", "public final void setServiceProcess(java.lang.String serviceprocess)\r\n\t{\r\n\t\tsetServiceProcess(getContext(), serviceprocess);\r\n\t}", "public void xsetServiceID(org.apache.xmlbeans.XmlString serviceID)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(SERVICEID$6, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(SERVICEID$6);\n }\n target.set(serviceID);\n }\n }", "public final void setFoundService(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean foundservice)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.FoundService.toString(), foundservice);\r\n\t}", "public void setService(CentralSystemServiceFactory service) {\n\t\tthis.service = service;\n\t}", "static void initServiceName(Persister persister, String serviceName) {\n try {\n byte[] bytes = persister.get(SERVICE_NAME_NODE);\n if (bytes.length == 0) {\n throw new IllegalArgumentException(String.format(\n \"Invalid data when fetching service name in '%s'\", SERVICE_NAME_NODE));\n }\n String currentServiceName = new String(bytes, SERVICE_NAME_CHARSET);\n if (!currentServiceName.equals(serviceName)) {\n throw new IllegalArgumentException(String.format(\n \"Collision between similar service names: Expected name '%s', but stored name is '%s'.\",\n serviceName, currentServiceName));\n }\n } catch (PersisterException e) {\n if (e.getReason() == Reason.NOT_FOUND) {\n // The service name doesn't exist yet, either due to a new install or an upgrade from a prior version\n // that doesn't store this information. Initialize.\n try {\n persister.set(SERVICE_NAME_NODE, serviceName.getBytes(SERVICE_NAME_CHARSET));\n } catch (PersisterException e2) {\n throw new IllegalStateException(\"Failed to store service name\", e2);\n }\n } else {\n throw new IllegalStateException(\"Failed to fetch prior service name for validation\", e);\n }\n }\n }", "public void setTypeOfService(String typeOfService){\n\tthis.typeOfService=typeOfService;\n}", "public void setWebServiceDriver(Supplier<CloseableHttpClient> webServiceSupplier) {\n this.getManagerStore().put(WebServiceDriverManager.class.getCanonicalName(),\n new WebServiceDriverManager(webServiceSupplier, this));\n }" ]
[ "0.7154513", "0.70427233", "0.7037412", "0.70206875", "0.70206875", "0.6804343", "0.6611334", "0.6264567", "0.6074601", "0.606046", "0.606046", "0.6041631", "0.6038704", "0.6038114", "0.60295093", "0.5971197", "0.5971197", "0.5971197", "0.59179217", "0.5915531", "0.5815747", "0.5802357", "0.57311773", "0.57311773", "0.57311773", "0.5721764", "0.56944174", "0.5687915", "0.5651883", "0.5611419", "0.5584243", "0.5531085", "0.5506419", "0.54691696", "0.5442459", "0.5437582", "0.54291797", "0.54105157", "0.54067326", "0.5398525", "0.5398525", "0.5376248", "0.5353345", "0.5352528", "0.5336785", "0.5328436", "0.5325716", "0.532402", "0.53164595", "0.53164595", "0.53164595", "0.5291378", "0.5287763", "0.5272023", "0.5264722", "0.52204293", "0.5219865", "0.5219298", "0.52089655", "0.5197835", "0.51786", "0.5169816", "0.51637435", "0.51529706", "0.51304275", "0.5107662", "0.5106938", "0.51062137", "0.5098355", "0.5070715", "0.5067965", "0.50509393", "0.503399", "0.5025985", "0.5005456", "0.5003017", "0.4996845", "0.49912035", "0.49859115", "0.49829367", "0.4982016", "0.4982016", "0.4982016", "0.49738714", "0.49738714", "0.49714565", "0.49714565", "0.4962138", "0.4954124", "0.49509364", "0.4947234", "0.49367592", "0.49339956", "0.4925636", "0.49228463", "0.4919725", "0.48936722", "0.4892169", "0.4878235", "0.4865952" ]
0.7600653
0
Create a group of buttons. Must have at least 2 buttons.
public JoystickButtonGroup(Button... buttons) { if (buttons.length < 2) { this.close(); } else { this.buttons = (Button[]) buttons; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createButtonsPanel() {\r\n Composite buttonsPanel = new Composite(this, SWT.NONE);\r\n buttonsPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));\r\n buttonsPanel.setLayout(new GridLayout(4, true));\r\n\r\n getButtonFromAction(buttonsPanel, \"New\", new NewAction(_window));\r\n getButtonFromAction(buttonsPanel, \"Save\", new SaveAction());\r\n getButtonFromAction(buttonsPanel, \"Delete\", new DeleteAction(_window));\r\n getButtonFromAction(buttonsPanel, \"Cancel\", new CancelAction());\r\n }", "private void groupButton() {\n ButtonGroup bg1 = new ButtonGroup();\n \n bg1.add(excellentbtn);\n bg1.add(goodbtn);\n bg1.add(normalbtn);\n bg1.add(badbtn);\n bg1.add(worstbtn);\n }", "public void createButtons() {\n\t\tbutton1 = new JButton(\"Button1\");\n\t\tbutton2 = new JButton(\"Button2\");\n\t\tbutton3 = new JButton(\"Button3\");\n\t\tbutton4 = new JButton(\"Button4\");\n\t\tbutton5 = new JButton(\"Button5\");\n\t}", "private JComponent buildButtons() {\n Panel panel = new Panel();\n panel.setLayout(new FlowLayout(FlowLayout.RIGHT));\n JButton button = Buttons.create(\"Create\").onClick((ev) -> {\n try {\n group.setName(name.getText());\n group.clearUsers();\n list.getSelectedValuesList().forEach((item) -> {\n group.addUser(item);\n });\n if (group.getName().isEmpty()) {\n JOptionPane.showMessageDialog(null, \"Name is required\");\n return;\n }\n if (!group.hasUsers()) {\n JOptionPane.showMessageDialog(null, \"Users are required\");\n return;\n }\n if (group.getId() == 0) {\n GroupRepository.get().save(group);\n } else {\n GroupRepository.get().update(group);\n }\n SwingUtilities.getWindowAncestor(this).dispose();\n } catch (RepositoryException ex) {\n JOptionPane.showMessageDialog(null, ex.getMessage());\n }\n });\n button.setIcon(IconFactory.get().create(\"fa:check\"));\n panel.add(button);\n return panel;\n }", "private JPanel createButtons()\r\n\t{\r\n\t\tJPanel buttons = new JPanel();\r\n\t\tbuttons.setLayout(new FlowLayout(FlowLayout.TRAILING));\r\n\r\n\r\n\t\tButton save = new Button(PrimeMain1.texts.getString(\"save\"));\r\n\t\tsave.addActionListener(this);\r\n\t\tsave.setActionCommand(\"save\");\r\n\r\n\t\tButton cancel = new Button(PrimeMain1.texts.getString(\"cancel\"));\r\n\t\tcancel.addActionListener(this);\r\n\t\tcancel.setActionCommand(\"cancel\");\r\n\r\n\r\n\t\tbuttons.add(save);\r\n\t\tbuttons.add(cancel);\r\n\r\n\t\treturn buttons;\r\n\t}", "private void createBottomActionButtons() {\n Composite actionControlComp = new Composite(shell, SWT.NONE);\n GridLayout gl = new GridLayout(2, false);\n GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);\n actionControlComp.setLayout(gl);\n actionControlComp.setLayoutData(gd);\n\n Button okBtn = new Button(actionControlComp, SWT.PUSH);\n okBtn.setText(\" OK \");\n okBtn.addSelectionListener(new SelectionAdapter() {\n\n @Override\n public void widgetSelected(SelectionEvent e) {\n if (verifySelection()) {\n close();\n }\n }\n });\n\n Button cancelBtn = new Button(actionControlComp, SWT.PUSH);\n cancelBtn.setText(\" Cancel \");\n cancelBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent e) {\n close();\n }\n });\n }", "public void createButtons() {\n\t\tescapeBackground = new GRect(200, 150, 300, 400);\n\t\tescapeBackground.setFilled(true);\n\t\tescapeBackground.setColor(Color.gray);\n\n\t\tbutton1 = new GButton(\"Return to Game\", 250, 175, 200, 50, Color.cyan);\n\t\tbutton3 = new GButton(\"Exit Level\", 250, 330, 200, 50, Color.cyan);\n\t\tbutton4 = new GButton(\"Return to Menu\", 250, 475, 200, 50, Color.cyan);\n\n\t\tescapeButtons.add(button1);\n\t\tescapeButtons.add(button3);\n\t\tescapeButtons.add(button4);\n\n\t}", "private void iterateOverButtons(){\n int columnRows = 4;\n integerButtons = new Button[MAX_BUTTONS];\n for (int i = 0; i < integerButtons.length; ++i) {\n integerButtons[i] = new Button(buttonText[i]);\n integerButtons[i].setId(\"buttons\");\n integerButtons[i].setPrefSize(60, 80);\n gridPane.add(integerButtons[i], i % columnRows , i / columnRows);\n }\n }", "public void createButtonGrid() {\n\t\tbuttonPanel.setOpaque(false);\n\t\t\n\t\t// designs array of buttons\n\t\tfor (int counter = 1; counter <= 20; counter++) {\n\t\t\tbuttonArray[counter] = new JButton();\n\t\t\tbuttonArray[counter].setOpaque(false);\n\t\t\tbuttonArray[counter].setVisible(true);\n\t\t\tbuttonArray[counter].setBorderPainted(false);\n\t\t\tbuttonArray[counter].setHorizontalTextPosition(JButton.CENTER);\n\t\t\tbuttonArray[counter].setVerticalTextPosition(SwingConstants.CENTER);\n\t\t\tbuttonArray[counter].setFont(new Font(\"Courier\", Font.PLAIN, 15));\n\t\t\tbuttonArray[counter].setText(\"<html><font color = white>\" + Integer.toString(counter) + \"</font></html>\");\n\t\t\t// add action listener to each button\n\t\t\tbuttonArray[counter].addActionListener(eventsMain);\n\t\t\t// add each button to the container\n\t\t\tbuttonPanel.add(buttonArray[counter]);\n\t\t}\n\t\t\n\t\t// set colour for ach row of buttons\n\t\tfor (int counter = 1; counter <= 20; counter++) {\n\t\t\tif (counter >= 1 && counter < 6) {\n\t\t\t\tbuttonArray[counter].setIcon(btnBlue);\n\t\t\t} else if (counter > 5 && counter < 11) {\n\t\t\t\tbuttonArray[counter].setIcon(btnGreen);\n\t\t\t} else if (counter > 10 && counter < 16) {\n\t\t\t\tbuttonArray[counter].setIcon(btnRed);\n\t\t\t} else if (counter > 15 && counter < 21) {\n\t\t\t\tbuttonArray[counter].setIcon(btnGray);\n\t\t\t}\n\t\t}\n\t}", "public void createButtons() {\n\n addRow = new JButton(\"Add row\");\n add(addRow);\n\n deleteRow = new JButton(\"Delete row\");\n add(deleteRow);\n }", "private void createComponentForButtons(Composite section)\n {\n createRowForNewStyleButton(section);\n createRowForNewRegexButton(section);\n createRowForNewColumnButton(section);\n createRowForDeleteButton(section);\n createRowForDeleteAllButton(section);\n }", "void createButtons(Container cp) {\r\n JPanel pn4 = new JPanel(); // create a panel\r\n pn4.setLayout(new FlowLayout(FlowLayout.LEFT)); // set the layout\r\n for (int i=0; i<strClEx.length; i++) {\r\n // repeat for the number of the buttons\r\n bt[i] = new JButton(strClEx[i]); // create a button\r\n bt[i].addActionListener(this); // add the action listener to the button\r\n pn4.add(bt[i]); // add the button to the panel\r\n }\r\n cp.add(pn4); // add the panel to the container\r\n }", "private JPanel createAddAndRemoveButtons() {\n JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEADING));\n panel.add(createAddResourceButton());\n panel.add(createRemoveResourceButton());\n\n return panel;\n }", "private void createButton(){\n addButton();\n addStartButton();\n }", "private void generateButtons(){\n\t\tint coordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tint coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\t//Button button = new Button(coordX, coordY);\n\t\t//buttons.put(0, button);\n\t}", "private void setupButtons() {\n final ButtonGroup btngrp = new ButtonGroup();\n\n for (final AbstractAction actn : myToolActions) {\n final JToggleButton btn = new JToggleButton(actn);\n btn.addActionListener(actn);\n btngrp.add(btn);\n add(btn);\n }\n\n btngrp.clearSelection();\n btngrp.getElements().nextElement().setSelected(true);\n\n }", "private HBox createButtons() {\n\t\tButton solve = new Button(\"Solve\");\n\t\tButton clear = new Button(\"Clear\");\n\t\tButton quit = new Button(\"Quit\");\n\t\t\n\t\tsolve.setStyle(\"-fx-font: 12 arial; -fx-base: #336699;\");\n\t\tclear.setStyle(\"-fx-font: 12 arial; -fx-base: #336699;\");\n\t\tquit.setStyle(\"-fx-font: 12 arial; -fx-base: #336699;\");\n\t\t\n\t\tsolve.setOnAction(e -> solve());\n\t\tclear.setOnAction(e -> clear());\n\t\tquit.setOnAction(e -> quit());\n\t\t\n\t\tHBox buttons = new HBox();\n\t\tbuttons.setSpacing(20);\n\t\tbuttons.setPadding(new Insets(20,20,20,20));\n\t\tbuttons.setAlignment(Pos.CENTER);\n\t\tbuttons.getChildren().addAll(solve, clear, quit);\n\t\tbuttons.setStyle(\"-fx-background-color: #DCDCDC;\");\n\t\t\n\t\treturn buttons;\n\t}", "private void createButtons() {\n\t\tfor (int x = 0; x < buttons.length; x++)\n\t\t\tfor (int y = 0; y < buttons[x].length; y++) {\n\t\t\t\tif ((x % 2 == 0 && y % 2 == 0) || (x % 2 == 1 && y % 2 == 1))\n\t\t\t\t\tbuttons[x][y] = new DarkButton();\n\t\t\t\telse\n\t\t\t\t\tbuttons[x][y] = new LightButton();\n\n\t\t\t\tbuttonListener(x, y);\n\t\t\t}\n\t\t\t\n\t\t\tinitButtonIcons();\n\t}", "public void createGameButtons() {\n \tcreateGameButton(myResources.getString(\"startcommand\"), 1, GAME_BUTTON_XLOCATION, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"stopcommand\"), 0, GAME_BUTTON_XLOCATION * 3, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"speedup\"), SPEED_INCREASE, GAME_BUTTON_XLOCATION*5, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"slowdown\"), 1/SPEED_INCREASE, GAME_BUTTON_XLOCATION*7, GAME_BUTTON_YLOCATION);\n }", "private List<Button> createButtons(final JSONObject jsonMessageSet) {\n final List<Button> buttons = new ArrayList<Button>();\n\n final JSONArray jsonButtons = (JSONArray) jsonMessageSet.get(\"button\");\n for (Object buttonObject : jsonButtons) {\n final JSONObject jsonButton = (JSONObject) buttonObject;\n final Button button = new Button();\n button.setButtonId((Integer) jsonButton.get(\"buttonId\"));\n button.setText((String) jsonButton.get(\"text\"));\n buttons.add(button);\n }\n\n return buttons;\n }", "private void initializeButtonPanel() {\n buttonPanel = new ButtonPanel();\n radioPanel = new JPanel(new GridLayout(0, 1));\n ButtonGroup buttonGroup = new ButtonGroup();\n Collections.addAll(toDoButtonList,task1,task2,task3,task4,task5,task6);\n for (int i=0;i<toDoButtonList.size();i++){\n JRadioButton task = toDoButtonList.get(i);\n buttonGroup.add(task);\n radioPanel.add(task);\n }\n\n refresh();\n\n }", "protected void createSaveButtons() {\n Composite buttonComp = new Composite(shell, SWT.NONE);\n buttonComp.setLayout(new GridLayout(2, true));\n buttonComp.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true,\n false));\n\n int buttonWidth = 80;\n GridData gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);\n gd.widthHint = buttonWidth;\n Button saveBtn = new Button(buttonComp, SWT.PUSH);\n saveBtn.setText(\"Save\");\n saveBtn.setLayoutData(gd);\n saveBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent e) {\n handleSaveAction();\n }\n });\n\n gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);\n gd.widthHint = buttonWidth;\n Button cancelBtn = new Button(buttonComp, SWT.PUSH);\n cancelBtn.setText(\"Cancel\");\n cancelBtn.setLayoutData(gd);\n cancelBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent e) {\n setReturnValue(null);\n close();\n }\n });\n }", "private void createButton(int i){\n\t\tint x = 10, y = 120, width = 100, height = 20;\n\t\tint temp = 0;\n\t\t\n\t\tbuttons.add(new JButton(\"New Student\"));\n\t\tbuttons.get(i).addActionListener(this);\n\t\t\n\t\tfor (int a = 0; a<i; a++){\n\t\t\tx += 110;\n\t\t\ttemp++;\n\t\t\tif(temp >= Integer.parseInt(askColumns.getText())){\n\t\t\t\ty += 140;\n\t\t\t\tx = 10;\n\t\t\t\ttemp = 0;\n\t\t\t}\n\t\t\t\n\n\t\t}\n\t\t\n\t\t\n\t\tbuttons.get(i).setBounds(x, y, width, height);\n\t\tthis.add(buttons.get(i));\t\n\t\tbuttons.get(i).revalidate();\n\t\tbuttons.get(i).repaint();\n\t\t\n\t}", "private void createAdditionalButtonControls(Composite parent) {\r\n\t\tComposite btnComposite = new Composite(parent, SWT.NONE);\r\n\t\tbtnComposite.setLayout(new GridLayout(2, false));\r\n\r\n\t\tButton selAllBtn = new Button(btnComposite, SWT.PUSH);\r\n\t\tselAllBtn.setText(Messages.TOPOLOGY_BTN_SELECT_ALL_TXT);\r\n\t\tselAllBtn.addSelectionListener(new SelectionListener() {\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n\t\t\t}\r\n\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tselectedUnitsList.setAllChecked(true);\r\n\t\t\t\tupdateSelectedItemsProperty();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tButton deselAllBtn = new Button(btnComposite, SWT.PUSH);\r\n\t\tdeselAllBtn.setText(Messages.TOPOLOGY_BTN_DESELECT_ALL_TXT);\r\n\t\tdeselAllBtn.addSelectionListener(new SelectionListener() {\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n\t\t\t}\r\n\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tselectedUnitsList.setAllChecked(false);\r\n\t\t\t\tupdateSelectedItemsProperty();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void createButtonsPane(VBox labelsPane){\n\t\tHBox buttonsPane = new HBox();\n\t\tButton easy = new Button(\"EASY\");\n\t\teasy.setFont(new Font(\"Arial Black\", 12));\n\t\teasy.setTextFill(Color.BLUE);\n\t\teasy.setFocusTraversable(false);\n\t\tButton medium = new Button(\"MEDIUM\");\n\t\tmedium.setFont(new Font(\"Arial Black\", 12));\n\t\tmedium.setTextFill(Color.BLUE);\n\t\tmedium.setFocusTraversable(false);\n\t\tButton hard = new Button(\"HARD\");\n\t\thard.setFont(new Font(\"Arial Black\", 12));\n\t\thard.setTextFill(Color.BLUE);\n\t\thard.setFocusTraversable(false);\n\t\tbuttonsPane.getChildren().addAll(easy, medium, hard);\n\t\tbuttonsPane.setMargin(easy, new Insets(10,5,5,5));\n\t\tbuttonsPane.setMargin(medium, new Insets(10,5,5,5));\n\t\tbuttonsPane.setMargin(hard, new Insets(10,5,5,5));\n\t\tbuttonsPane.setSpacing(20);\n\t\tbuttonsPane.setAlignment(Pos.CENTER);\n\t\tbuttonsPane.setStyle(\"-fx-background-color: gray;\");\n\t\teasy.setOnAction(new EasyHandler());\n\t\tmedium.setOnAction(new MediumHandler());\n\t\thard.setOnAction(new HardHandler());\n\t\tlabelsPane.getChildren().add(buttonsPane);\n\t}", "private JPanel createConfirmationButtons() {\r\n JPanel buttonPanel = new JPanel();\r\n buttonPanel.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n buttonPanel.setBorder(new EmptyBorder(5, 5, 5, 5));\r\n buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));\r\n JButton confirmButton = new JButton(\"Confirm\");\r\n confirmButton.addActionListener(event -> onConfirmButtonPressed());\r\n JButton cancelButton = new JButton(\"Cancel\");\r\n cancelButton.addActionListener(event -> onCancelButtonPressed());\r\n buttonPanel.add(confirmButton);\r\n buttonPanel.add(cancelButton);\r\n return buttonPanel;\r\n }", "@AutoGenerated\n\tprivate HorizontalLayout buildLayoutButtons() {\n\t\tlayoutButtons = new HorizontalLayout();\n\t\tlayoutButtons.setImmediate(false);\n\t\tlayoutButtons.setWidth(\"-1px\");\n\t\tlayoutButtons.setHeight(\"-1px\");\n\t\tlayoutButtons.setMargin(false);\n\t\t\n\t\t// btnSave\n\t\tbtnSave = new Button();\n\t\tbtnSave.setCaption(\"Salvar\");\n\t\tbtnSave.setImmediate(true);\n\t\tbtnSave.setWidth(\"-1px\");\n\t\tbtnSave.setHeight(\"-1px\");\n\t\tlayoutButtons.addComponent(btnSave);\n\t\t\n\t\t// btnCancel\n\t\tbtnCancel = new Button();\n\t\tbtnCancel.setCaption(\"Cancelar\");\n\t\tbtnCancel.setImmediate(true);\n\t\tbtnCancel.setWidth(\"-1px\");\n\t\tbtnCancel.setHeight(\"-1px\");\n\t\tlayoutButtons.addComponent(btnCancel);\n\t\t\n\t\treturn layoutButtons;\n\t}", "private void addButtons() {\r\n\t\troot.getChildren().add(button); // creating the Easy button \r\n\t\tb1 = new Button(\"Easy\");\r\n\t\tb1.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent ke) {\r\n\t\t\t\tdiff = \"Easy\";\r\n\t\t\t}\r\n\t\t});\r\n\t\troot.getChildren().add(b1); // creating the Normal button\r\n\t\tb2 = new Button(\"Normal\");\r\n\t\tb2.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent ke) {\r\n\t\t\t\tdiff = \"Normal\";\r\n\t\t\t}\r\n\t\t});\r\n\t\tb2.setLayoutX(50);\r\n\t\troot.getChildren().add(b2); // creating the Hard button\r\n\t\tb3 = new Button(\"Hard\");\r\n\t\tb3.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent ke) {\r\n\t\t\t\tdiff = \"Hard\";\r\n\t\t\t}\r\n\t\t});\r\n\t\tb3.setLayoutX(115);\r\n\t\troot.getChildren().add(b3);\r\n\t}", "private JPanel createConfirmButtons() {\n JPanel panel = new JPanel(new FlowLayout(FlowLayout.TRAILING));\n panel.add(createConfirmButton());\n panel.add(createCancelButton());\n\n return panel;\n }", "private void createButtons() {\n\tTexture startGameTex = new Texture(\n\t\tGdx.files.internal(\"assets/data/menu/menu_start.png\"));\n\tTexture plane_p1_tex = new Texture(\n\t\tGdx.files.internal(\"assets/data/menu/menu_player1.png\"));\n\tTexture plane_p2_tex = new Texture(\n\t\tGdx.files.internal(\"assets/data/menu/menu_player2.png\"));\n\n\tplayButton = new Button(\"\", font, 0, 0, new TextureRegion(startGameTex,\n\t\t0, 0, 161, 20), new TextureRegion(startGameTex, 0, 0, 161, 20),\n\t\tnew ScreenSwitchHandler(Screen.GAME));\n\tplaneButton_p1 = new Button(\"\", font, 0, 0, new TextureRegion(\n\t\tplane_p1_tex, 0, 0, 161, 20), new TextureRegion(plane_p1_tex,\n\t\t0, 0, 161, 20), new ScreenSwitchHandler(Screen.PLANE_P1));\n\tplaneButton_p2 = new Button(\"\", font, 0, 0, new TextureRegion(\n\t\tplane_p2_tex, 0, 0, 161, 20), new TextureRegion(plane_p2_tex,\n\t\t0, 0, 161, 20), new ScreenSwitchHandler(Screen.PLANE_P2));\n\toptionsButton = new Button(\"Options\", font, new ScreenSwitchHandler(\n\t\tScreen.OPTIONS));\n\texitButton = new Button(\"Exit\", font, new ButtonHandler() {\n\t @Override\n\t public void onClick() {\n\t\tGdx.app.exit();\n\t }\n\n\t @Override\n\t public void onRelease() {\n\t\t// TODO Auto-generated method stub\n\n\t }\n\t});\n }", "private void createBeginningButtons() {\n\t createStartButtons(myResources.getString(\"game1\"), 0, 0);\n\t\tcreateStartButtons(myResources.getString(\"game2\"), 0, 1);\n\t\tcreateStartButtons(myResources.getString(\"game3\"), 0, 2);\n\t\tcreateStartButtons(myResources.getString(\"game4\"), 0, 3);\n\t\tcreateStartButtons(myResources.getString(\"game5\"), 0, 4);\n\t\tcreateInstructionButton();\n\t\tcreateStartingLabel();\n\t\tcreateGridSizeButton();\n }", "@Override\n\tprotected void createCompButtons() {\n\t\tbuildCompButtons();\n\t}", "private void addButtons(JPanel contentPanel, GridBagConstraints c) {\n JPanel buttonPanel = new JPanel();\n buttonPanel.setLayout(new GridBagLayout());\n GridBagConstraints gbc = new GridBagConstraints();\n\n JButton addButton = new JButton(buttonText);\n addButton.setFont(new Font(QuizAppUtilities.UI_FONT, Font.PLAIN, 16));\n addButton.addActionListener(new AddListener());\n buttonPanel.add(addButton, gbc);\n\n gbc.gridx = 1;\n gbc.insets = new Insets(0, 20, 0, 0);\n JButton cancelButton = new JButton(\"Cancel\");\n cancelButton.addActionListener(new CancelListener());\n cancelButton.setFont(new Font(QuizAppUtilities.UI_FONT, Font.PLAIN, 16));\n buttonPanel.add(cancelButton, gbc);\n\n c.gridy = 6;\n contentPanel.add(buttonPanel, c);\n }", "private Button createNewArrayButton(BorderPane root) {\n Button newArr = new Button(\"Generate New Array\");\n\n newArr.setOnMouseClicked(event -> {\n ((HBox) root.getTop()).getChildren().get(2).setDisable(false);\n ((HBox) root.getTop()).getChildren().get(3).setDisable(false);\n\n generateRandomHeights();\n root.setBottom(createSortingDisplay());\n });\n\n return newArr;\n }", "private void initButtons() {\n HBox buttons = new HBox(50);\n yes = new Button(\"Yes!\");\n no = new Button(\"No!\");\n buttons.getChildren().addAll(yes,no);\n buttons.setAlignment(Pos.CENTER);\n root.getChildren().addAll(buttons);\n }", "private void makeDayButtons() \n\t{\n\t\t\n\t\tSystem.out.println(monthMaxDays);\n\t\tfor (int i = 1; i <= monthMaxDays; i++) \n\t\t{\n\t\t\t//the first day starts from 1\n\t\t\tfinal int dayNumber = i;\n\t\t\t\n\t\t\t//create new button\n\t\t\tJButton day = new JButton(Integer.toString(dayNumber));\n\t\t\tday.setBackground(Color.WHITE);\n\t\n\t\t\t//attach a listener\n\t\t\tday.addActionListener(new \n\t\t\t\t\tActionListener() \n\t\t\t\t\t{\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent arg0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if button is pressed, highlight it \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}\n\t\t\t\t\t});\n\t\t\t\n\t\t\t//add this button to the day button ArrayList\n\t\t\tbuttonArray.add(day);\n\t\t}\n\t}", "private void crearBotones() {\n\t\tJButton botonTropa;\n\t\tArrayList<Tropa> tropasJugador = getJuego().getTurnoActual().getJugador().getTropas();\n\t\tint posicion = 0;\n\t\tfor (int i = 0; i < CANTIDADBOTONES; ++i) {\n\t\t\tif (tropasJugador.size() > i && !tropasJugador.get(i).isEnJuego()) {\n\t\t\t\tbotonTropa = new JButton(\" \" + tropasJugador.get(i).getNombre());\n\t\t\t\tponerIconosBotones(botonTropa, tropasJugador.get(i).getNombre());\n\n\t\t\t} else if (tropasJugador.size() > i && tropasJugador.get(i).isEnJuego()) {\n\t\t\t\tbotonTropa = new JButton(\" \" + tropasJugador.get(i).getNombre() + \" (En juego)\");\n\t\t\t\tponerIconosBotones(botonTropa, tropasJugador.get(i).getNombre());\n\t\t\t\tbotonTropa.setEnabled(false);\n\t\t\t} else {\n\t\t\t\tposicion = i + 1;\n\t\t\t\tbotonTropa = new JButton(\"Tropa \" + posicion);\n\t\t\t\tbotonTropa.setEnabled(false);\n\t\t\t}\n\n\t\t\tbotones.add(botonTropa);\n\t\t\tpanelBotones.add(botonTropa);\n\t\t}\n\t}", "public void buildButtons() {\r\n\t\tImage temp1= display_img.getImage();\r\n\t\tImageIcon img=new ImageIcon(temp1.getScaledInstance(800, 800, Image.SCALE_SMOOTH));\r\n\t\timg1 = img.getImage();\r\n\t\tfor(int y=0;y<10;y++) {\r\n\t\t\tfor(int x=0; x<10; x++) {\r\n\t\t\t\tImage image = Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(img1.getSource(), new CropImageFilter(x * 800 / 10, y * 800 / 10, 100, 100)));\r\n\t\t\t\tImageIcon icon = new ImageIcon(image);\r\n\t\t\t\tJButton temp = new JButton(icon);\r\n\t\t\t\ttemp.putClientProperty(\"position\", new Point(y,x));\r\n\t\t\t\tsolutions.add(new Point(y,x));\r\n\t\t\t\ttemp.putClientProperty(\"isLocked\", false);\r\n\t\t\t\ttemp.addMouseListener(new DragMouseAdapter());\r\n\t\t\t\tgrid[x][y]=temp;\r\n\r\n\t\t\t\tbuttons.add(temp);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void createButton() throws SlickException {\n int width = 25*getGameContainer().getWidth()/100;\n int height = 10*getGameContainer().getHeight()/100;\n\n Image login = new Image(getReaderXmlFile().read(\"buttonLogin\")).getScaledCopy(width, height);\n Coordinate posLogin = new Coordinate((getGameContainer().getWidth() - login.getWidth())/2,55*getGameContainer().getHeight()/100);\n loginButton = new Button(getGameContainer(), login, posLogin, IDStates.MENU_STATE, this);\n\n Image account = new Image(getReaderXmlFile().read(\"buttonAccount\")).getScaledCopy(width, height);\n Coordinate posAccount = new Coordinate((getGameContainer().getWidth() - account.getWidth())/2,70*getGameContainer().getHeight()/100);\n accountButton = new Button(getGameContainer(), account, posAccount, IDStates.MENU_STATE, this);\n }", "private void createButton() {\n\t\tbtnAddTask = new JButton(\"Add Task\");\n\t\tbtnSave = new JButton(\"Save\");\n\t\tbtnCancel = new JButton(\"Cancel\");\n\n\t\tbtnAddTask.addActionListener(new ToDoAction());\n\t\tbtnSave.addActionListener(new ToDoAction());\n\t\tbtnCancel.addActionListener(new ToDoAction());\n\t}", "private Button[] createButtonsAndLMessage() {\n\t\t\n\t\t// local buttom\n\t\tButton launchLocal = new Button(\"Launch Local Game\");\n\t\tlaunchLocal.setMaxWidth(Double.MAX_VALUE);\n\t\tlaunchLocal.setAlignment(Pos.CENTER);\n\t\tlaunchLocal.autosize();\n\t\tlaunchLocal.setOnAction(e -> {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(checkingAllArguments()) {\n\t\t\t\t\tmenuMessage.setText(\"Game will start soon...\");\n\t\t\t\t\tlaunchLocal(new Stage());\n\t\t\t\t}\n\t\t\t } catch (Exception exception) { \n\t\t\t\t menuMessage.setText(\"Can't launch a local game : either a IP Address of a remote player is wrong or you didn't select 4 players\");\n\t\t\t } \n\t\t \n\t\t});\n\t\t\n\t\t// remote button\n\t\tButton launchRemote = new Button(\"Launch Remote Game\");\n\t\tlaunchRemote.setMaxWidth(Double.MAX_VALUE);\n\t\tlaunchRemote.setAlignment(Pos.CENTER);\n\t\tlaunchRemote.autosize();\n\t\tlaunchRemote.setOnAction(e -> { \n\t\t\t\n\t\t\ttry {\n\t\t\t\tmenuMessage.setText(\"Game will start as soon as the client is connected...\");\n\t\t\t\tlaunchRemote(new Stage());\n\t\t\t } catch (Exception exception) { \n\t\t\t\tmenuMessage.setText(\"Can't launch a remote game : Check your internet connection\");\n\t\t\t } \n\t\t}); \n\t\t\n\t\tButton[] toReturn = {launchLocal, launchRemote};\n\t\treturn toReturn;\n\t}", "private JPanel createConfirmButtonsPanel() {\n JPanel p = new JPanel(new FlowLayout());\n p.add(createConfirmButton());\n p.add(createCancelButton());\n \n return p;\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void addSingleplayerMultiplayerButtons() {\n\t\tthis.buttonList.add(new GuiButton(1, 4, 3, 60, 20, I18n.format(\"menu.singleplayer\", new Object[0])));\n\t\tthis.buttonList.add(new GuiButton(2, 70, 3, 50, 20, I18n.format(\"menu.multiplayer\", new Object[0])));\n\t\tthis.buttonList.add(new GuiButton(14, 126, 3, 60, 20, \"§bResilient§r\"));\n\n\t}", "@AutoGenerated\r\n\tprivate HorizontalLayout buildButtonsLayout()\r\n\t{\n\t\tbuttonsLayout = new HorizontalLayout();\r\n\t\tbuttonsLayout.setImmediate(false);\r\n\t\tbuttonsLayout.setWidth(\"-1px\");\r\n\t\tbuttonsLayout.setHeight(\"-1px\");\r\n\t\tbuttonsLayout.setMargin(false);\r\n\t\tbuttonsLayout.setSpacing(true);\r\n\t\t\r\n\t\t// addButton\r\n\t\taddButton = new Button();\r\n\t\taddButton.setCaption(\"Add...\");\r\n\t\taddButton.setImmediate(true);\r\n\t\taddButton.setWidth(\"100px\");\r\n\t\taddButton.setHeight(\"-1px\");\r\n\t\tbuttonsLayout.addComponent(addButton);\r\n\t\t\r\n\t\t// editButton\r\n\t\teditButton = new Button();\r\n\t\teditButton.setCaption(\"Edit...\");\r\n\t\teditButton.setImmediate(true);\r\n\t\teditButton.setWidth(\"100px\");\r\n\t\teditButton.setHeight(\"-1px\");\r\n\t\tbuttonsLayout.addComponent(editButton);\r\n\t\t\r\n\t\t// deleteButton\r\n\t\tdeleteButton = new Button();\r\n\t\tdeleteButton.setCaption(\"Delete...\");\r\n\t\tdeleteButton.setImmediate(true);\r\n\t\tdeleteButton.setWidth(\"100px\");\r\n\t\tdeleteButton.setHeight(\"-1px\");\r\n\t\tbuttonsLayout.addComponent(deleteButton);\r\n\t\t\r\n\t\treturn buttonsLayout;\r\n\t}", "private void createbuttons(){\n newPatient = (Button) findViewById(R.id.newButton);\n newPatient.setOnClickListener(buttonClick);\n\n registeredPatient = (Button) findViewById(R.id.registeredButton);\n registeredPatient.setOnClickListener(buttonClick);\n\n viewManagement = (Button) findViewById(R.id.viewStaffActivitiesButton);\n viewManagement.setOnClickListener(buttonClick);\n }", "private void createButtons(GridBagConstraints gridBagConstraints) {\n\t\tgridBagConstraints.gridx = 0;\n\t\tgridBagConstraints.gridy = 3;\n\t\tfileInputPanel.add(evolveButton, gridBagConstraints);\n\n\t\tgridBagConstraints.gridx = 1;\n\t\tgridBagConstraints.gridy = 3;\n\t\tfileInputPanel.add(simulateButton, gridBagConstraints);\n\t}", "private void setupButtons() {\n for (int i = 0; i < players.size(); i++) {\n final int j = i + 1;\n players.get(i).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n buttonPushed(j);\n }\n });\n }\n }", "@Test\n\tpublic void addButtons_2Test() throws Exception {\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.skins &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showcover &&\n\t\t\t\t!Configuration.reorderplaylist && \n\t\t\t\t!Configuration.queuetrack &&\n\t\t\t\tConfiguration.clearplaylist ) {\n\t\t\tstart();\n\t\t\t\n\t\t\tgui.addButtons();\n\t\t\tJFrame g = (JFrame) MemberModifier.field(Application.class, \"frmAsd\").get(gui);\n\t\t\tJButton button =null;\n\t\t\t\n\t\t\tfor (int i = 0; i < g.getContentPane().getComponentCount(); i++) {\n\t\t\t\tif(g.getContentPane().getComponent(i).getName()!= null && g.getContentPane().getComponent(i).getName().equals(\"clearList\")) {\n\t\t\t\t\tbutton = (JButton) g.getContentPane().getComponent(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tassertTrue(button.getBounds().getX() == 361);\n\t\t\tassertTrue(button.getBounds().getY() == 324);\n\t\t\tassertTrue(button.getBounds().getWidth() == 111);\n\t\t\tassertTrue(button.getBounds().getHeight() == 23);\n\t\t\tassertTrue(button.getActionListeners()!= null);\n\t\t\t\n\t\t\t}\n\t}", "@Override\n\tprotected void createButtonsForButtonBar(Composite parent)\n\t{\n\t\tButton button_1 = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,\n\t\t\t\ttrue);\n\t\tbutton_1.setText(\"Ja\");\n\t\tButton button = createButton(parent, IDialogConstants.CANCEL_ID,\n\t\t\t\tIDialogConstants.CANCEL_LABEL, false);\n\t\tbutton.setText(\"Nein\");\n\t}", "public HBox hbButtons() {\r\n\r\n HBox hbBottom = new HBox(10); //HBox for buttons at the bottom\r\n\r\n hbBottom.setAlignment(Pos.CENTER); //Set Buttoms to center\r\n hbBottom.setPadding(new Insets(10, 1, 1, 1)); //Padd it\r\n\r\n //SetId\r\n btnConfirm.setId(\"btn\");\r\n btnEdit.setId(\"btn\");\r\n\r\n //Add buttons to the bottom HBox\r\n hbBottom.getChildren().addAll(btnConfirm, btnEdit);\r\n\r\n //Handlers\r\n btnConfirm.setOnAction(new ConfirmHandler()); //Handler for confirm\r\n btnEdit.setOnAction(new EditHandler()); //Handler for edit\r\n\r\n return hbBottom;\r\n\r\n }", "Button createButton();", "private void addSingleplayerMultiplayerButtons(int p_73969_1_, int p_73969_2_)\r\n\t{\r\n\t\tthis.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_, I18n.format(\"menu.singleplayer\")));\r\n\t\tthis.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.format(\"menu.multiplayer\")));\r\n\t\tthis.buttonList.add(modButton = new GuiButton(6, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.format(\"fml.menu.mods\")));\r\n\t\tRandomTexture = (int) (Math.random() * 3 + 1);\r\n\r\n\t}", "protected void drawButtons() {\n\t\tint spaceX = 50;\n\t\tint spaceY = 500;\t\n\t\t\n\t\tint aux = 1;\n\t\tfor(int i = 65; i < 91; i++) {\n\n\t\t\tLetterButton button = new LetterButton((char) i, (25 + spaceX ) * aux, spaceY);\n\t\t\taux++;\n\t\t\tif(aux == 14) {\n\t\t\t\tspaceY += 25 + 50;\n\t\t\t\taux = 1;\n\t\t\t}\n\t\t\tthis.add(button);\n\t\t}\n\t\t\n\t}", "public GridPane lobbyButtons() {\n GridPane gridPane = new GridPane();\n Button createButton;\n Button joinButton;\n Button chatButton;\n Button leaderboardButton;\n\n gridPane.setAlignment(Pos.CENTER);\n gridPane.setVgap(10);\n gridPane.setHgap(10);\n gridPane.setPadding(new Insets(10));\n\n createButton = new Button(\"Create game\");\n createButton.setAlignment(Pos.CENTER);\n int buttonWIDTH = 150;\n int buttonHEIGHT = 100;\n createButton.setPrefSize(buttonWIDTH, buttonHEIGHT);\n createButton.setOnAction(event -> new CreateGameGUI().start(stage, this, socket));\n\n joinButton = new Button(\"Join game\");\n joinButton.setAlignment(Pos.CENTER);\n joinButton.setPrefSize(buttonWIDTH, buttonHEIGHT);\n joinButton.setOnAction(event -> new JoinGameGUI().start(stage, this, socket));\n\n chatButton = new Button(\"Chat\");\n chatButton.setAlignment(Pos.CENTER);\n chatButton.setPrefSize(buttonWIDTH, buttonHEIGHT);\n chatButton.setOnAction(event -> ChatGUI());\n\n leaderboardButton = new Button(\"Leaderboard\");\n leaderboardButton.setAlignment(Pos.CENTER);\n leaderboardButton.setPrefSize(buttonWIDTH, buttonHEIGHT);\n leaderboardButton.setOnAction(event -> new LeaderboardGUI().start(stage, this, socket));\n\n gridPane.add(createButton, 0, 0);\n gridPane.add(joinButton, 1, 0);\n gridPane.add(chatButton, 2, 0);\n gridPane.add(leaderboardButton, 1, 1);\n\n return gridPane;\n }", "private void initPanelButtons() {\r\n\t\tthis.panelButtons = new JPanel(new GridBagLayout());\r\n\t\tthis.panelButtons.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 5));\r\n\t\tthis.panelButtons.setOpaque(false);\r\n\t\tGridBagConstraints gbc = new GridBagConstraints();\r\n\r\n\t\tgbc.gridx = 0;\r\n\t\tgbc.gridy = 0;\r\n\t\tgbc.gridwidth = 1;\r\n\t\tgbc.gridheight = 1;\r\n\t\tgbc.weightx = 1;\r\n\t\tgbc.weighty = 1;\r\n\t\tthis.returnButton.setBackground(ConstantView.COLOR_BUTTON_LOGIN);\r\n\t\tthis.returnButton.setForeground(Color.WHITE);\r\n\t\tthis.returnButton.setFocusable(false);\r\n\t\tthis.returnButton.setCursor(new Cursor(Cursor.HAND_CURSOR));\r\n\t\tthis.returnButton.setFont(ConstantView.FONT_PRINCIPAL_LABELS);\r\n\t\tthis.panelButtons.add(returnButton, gbc);\r\n\r\n\t\tgbc.gridx = 7;\r\n\t\tthis.okButton.setBackground(ConstantView.COLOR_BUTTON_LOGIN);\r\n\t\tthis.okButton.setForeground(Color.WHITE);\r\n\t\tthis.okButton.setFocusable(false);\r\n\t\tthis.okButton.setCursor(new Cursor(Cursor.HAND_CURSOR));\r\n\t\tthis.okButton.setFont(ConstantView.FONT_PRINCIPAL_LABELS);\r\n\t\tthis.okButton.addActionListener(ControlClient.getInstance());\r\n\t\tthis.okButton.setActionCommand(ClientCommands.OK_SIGN_IN.toString());\r\n\t\tthis.panelButtons.add(okButton, gbc);\r\n\t}", "private void createButtons() {\n Button helpSettingsButton = new Button(\"\",\n new Button.ClickListener() {\n private static final long serialVersionUID = -5797923866320649518L;\n\n @Override\n public void buttonClick(ClickEvent event) {\n settingsPresenter.navigateToHelp();\n }\n });\n\n// Button skillSettingsButton = new Button(\"\",\n// new Button.ClickListener() {\n// private static final long serialVersionUID = 7147554466396214893L;\n//\n// @Override\n// public void buttonClick(ClickEvent event) {\n// settingsPresenter.navigateToSkills();\n// }\n// });\n// skillSettingsButton.addStyleName(\"icon-cog\");\n\n Button medicSettingsButton = new Button(\"\",\n new Button.ClickListener() {\n private static final long serialVersionUID = 7147554466396214893L;\n\n @Override\n public void buttonClick(ClickEvent event) {\n settingsPresenter.navigateToMedic();\n }\n });\n\n\n Button logoutButton = new Button(\"\",\n new Button.ClickListener() {\n private static final long serialVersionUID = -1096188732209266611L;\n\n @Override\n public void buttonClick(ClickEvent event) {\n settingsPresenter.navigateBack();\n }\n });\n logoutButton.addStyleName(\"default\");\n\n // Adding and aligning the 3 Buttons.\n //Setting a Description for the buttons which is displayed when flying over the button\n super.verticalNavigation.addComponent(helpSettingsButton);\n super.verticalNavigation.setComponentAlignment(helpSettingsButton, Alignment.MIDDLE_CENTER);\n helpSettingsButton.setDescription(\"Set the Help options for the Patient\");\n helpSettingsButton.setIcon(new ThemeResource(\"img/contacgg.png\"), BUTTON_HELP_SETTINGS);\n helpSettingsButton.setWidth(BUTTON_WIDTH);\n helpSettingsButton.setHeight(BUTTON_HEIGHT);\n\n super.verticalNavigation.addComponent(medicSettingsButton);\n super.verticalNavigation.setComponentAlignment(medicSettingsButton, Alignment.MIDDLE_CENTER);\n medicSettingsButton.setDescription(\"Set the Medication options for the Patient\");\n medicSettingsButton.setIcon(new ThemeResource(\"img/medicine-icon-cog.png\"),BUTTON_MEDIC_SETTINGS);\n medicSettingsButton.setWidth(BUTTON_WIDTH);\n medicSettingsButton.setHeight(BUTTON_HEIGHT);\n\n// addComponent(skillSettingsButton);\n// setComponentAlignment(skillSettingsButton, Alignment.MIDDLE_CENTER);\n// skillSettingsButton.setDescription(\"Set the Skill options for the Patient\");\n// skillSettingsButton.setIcon(new ThemeResource(\"img/skill2-icon-cog.png\"), BUTTON_SKILL_SETTINGS);\n// skillSettingsButton.setWidth(BUTTON_WIDTH);\n// skillSettingsButton.setHeight(BUTTON_HEIGHT);\n\n logoutButton.setWidth(BUTTON_WIDTH);\n super.verticalNavigation.addComponent(logoutButton);\n super.verticalNavigation.setComponentAlignment(logoutButton, Alignment.MIDDLE_CENTER);\n logoutButton.setDescription(\"You will be logged out\");\n logoutButton.setIcon(new ThemeResource(\"img/logout.png\"), BUTTON_LOGOUT);\n logoutButton.setWidth(BUTTON_WIDTH);\n logoutButton.setHeight(BUTTON_HEIGHT);\n\n }", "private void createButtonPanel()\r\n { \r\n JPanel buttonPanel = new JPanel();\r\n buttonPanel.setLayout(new GridLayout(4, 4));\r\n\r\n buttonPanel.add(makeDigitButton(\"7\"));\r\n buttonPanel.add(makeDigitButton(\"8\"));\r\n buttonPanel.add(makeDigitButton(\"9\"));\r\n buttonPanel.add(makeOperatorButton(\"/\"));\r\n buttonPanel.add(makeDigitButton(\"4\"));\r\n buttonPanel.add(makeDigitButton(\"5\"));\r\n buttonPanel.add(makeDigitButton(\"6\"));\r\n buttonPanel.add(makeOperatorButton(\"*\"));\r\n buttonPanel.add(makeDigitButton(\"1\"));\r\n buttonPanel.add(makeDigitButton(\"2\"));\r\n buttonPanel.add(makeDigitButton(\"3\"));\r\n buttonPanel.add(makeOperatorButton(\"-\"));\r\n buttonPanel.add(makeDigitButton(\"0\"));\r\n buttonPanel.add(makeDigitButton(\".\"));\r\n buttonPanel.add(makeOperatorButton(\"=\"));\r\n buttonPanel.add(makeOperatorButton(\"+\"));\r\n\r\n add(buttonPanel, BorderLayout.CENTER);\r\n }", "private void refreshButtons() {\n flowPane.getChildren().clear();\n\n for(String testName : Files.listTests()) {\n TestJson info;\n try {\n info = TestParser.read(testName);\n } catch(FileNotFoundException e) {\n continue; /* Skip */\n }\n\n JFXButton button = new JFXButton(testName);\n button.pseudoClassStateChanged(PseudoClass.getPseudoClass(\"select-button\"), true);\n\n button.setOnAction(e -> buttonPressed(info));\n\n if(!filter(info, button))\n continue;\n\n // If this model asked to be put in a specific place, put it there\n if(!info.custom && info.order >= 0)\n flowPane.getChildren().add(Math.min(info.order, flowPane.getChildren().size()), button);\n else\n flowPane.getChildren().add(button);\n }\n }", "private void createBottomButtons() {\n // Create a composite that will contain the control buttons.\n Composite bottonBtnComposite = new Composite(shell, SWT.NONE);\n GridLayout gl = new GridLayout(3, true);\n gl.horizontalSpacing = 10;\n bottonBtnComposite.setLayout(gl);\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n bottonBtnComposite.setLayoutData(gd);\n\n // Create the Interpolate button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n interpolateBtn = new Button(bottonBtnComposite, SWT.PUSH);\n interpolateBtn.setText(\"Interpolate\");\n interpolateBtn.setLayoutData(gd);\n interpolateBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n ColorData upperColorData = upperColorWheel.getColorData();\n ColorData lowerColorData = lowerColorWheel.getColorData();\n\n colorBar.interpolate(upperColorData, lowerColorData, rgbRdo\n .getSelection());\n undoBtn.setEnabled(true);\n updateColorMap();\n }\n });\n\n // Create the Undo button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n undoBtn = new Button(bottonBtnComposite, SWT.PUSH);\n undoBtn.setText(\"Undo\");\n undoBtn.setEnabled(false);\n undoBtn.setLayoutData(gd);\n undoBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n undoBtn.setEnabled(colorBar.undoColorBar());\n updateColorMap();\n redoBtn.setEnabled(true);\n }\n });\n\n // Create the Redo button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n redoBtn = new Button(bottonBtnComposite, SWT.PUSH);\n redoBtn.setText(\"Redo\");\n redoBtn.setEnabled(false);\n redoBtn.setLayoutData(gd);\n redoBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n redoBtn.setEnabled(colorBar.redoColorBar());\n updateColorMap();\n undoBtn.setEnabled(true);\n }\n });\n\n // Create the Revert button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n revertBtn = new Button(bottonBtnComposite, SWT.PUSH);\n revertBtn.setText(\"Revert\");\n revertBtn.setLayoutData(gd);\n revertBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n colorBar.revertColorBar();\n updateColorMap();\n undoBtn.setEnabled(false);\n redoBtn.setEnabled(false);\n }\n });\n\n // Create the Save button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n saveBtn = new Button(bottonBtnComposite, SWT.PUSH);\n saveBtn.setText(\"Save\");\n saveBtn.setLayoutData(gd);\n if( seldCmapName == null ) {\n saveBtn.setEnabled(false);\n }\n \n saveBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n ColorMap cm = (ColorMap) cmapParams.getColorMap();\n seldCmapName = selCmapCombo.getText();\n \n// int sepIndx = seldCmapName.indexOf(File.separator);\n// String cmapCat = seldCmapName.substring(0,seldCmapName.indexOf(File.separator));\n// String cmapName = seldCmapName.substring( seldCmapName.indexOf(File.separator));\n if (lockedCmaps != null && lockedCmaps.isLocked(seldCmapName)) {\n \tMessageDialog confirmDlg = new MessageDialog( \n \t\t\tNcDisplayMngr.getCaveShell(), \n \t\t\t\"Save Colormap\", null, \n \t\t\t\"Colormap \" +seldCmapCat+File.separator +seldCmapName + \n \t\t\t\" already exists and is locked.\\n\\n\" +\n \t\t\t\"You cannot overwrite it.\",\n \t\t\tMessageDialog.INFORMATION, new String[]{\"OK\"}, 0);\n \tconfirmDlg.open();\n \tcolorBar.undoColorBar();\n updateColorMap();\n \treturn;\n } \n else if( ColorMapUtil.colorMapExists( seldCmapCat, seldCmapName ) ) {\n \tMessageDialog confirmDlg = new MessageDialog( \n \t\t\tNcDisplayMngr.getCaveShell(), \n \t\t\t\"Save Colormap\", null, \n \t\t\t\"Colormap \" +seldCmapCat+File.separator +seldCmapName + \n \t\t\t\" already exists.\\n\\n\" +\n \t\t\t\"Do you want to overwrite it?\",\n \t\t\tMessageDialog.QUESTION, new String[]{\"Yes\", \"No\"}, 0);\n \tconfirmDlg.open();\n\n \tif( confirmDlg.getReturnCode() == MessageDialog.CANCEL ) {\n \t\treturn;\n \t}\n }\n\n try {\n ColorMapUtil.saveColorMap( cm, seldCmapCat, seldCmapName );\n \n MessageDialog msgDlg = new MessageDialog( \n \t\t\tNcDisplayMngr.getCaveShell(), \n \t\t\t\"Colormap Saved\", null, \n \t\t\t\"Colormap \" +seldCmapCat+File.separator +seldCmapName + \n \t\t\t\" Saved.\",\n \t\t\tMessageDialog.INFORMATION, new String[]{\"OK\"}, 0);\n \tmsgDlg.open();\n } catch (VizException e) {\n MessageDialog msgDlg = new MessageDialog( \n \t\t\tNcDisplayMngr.getCaveShell(), \n \t\t\t\"Error\", null, \n \t\t\t\"Error Saving Colormap \" +seldCmapCat+File.separator +seldCmapName + \n \t\t\t\"\\n\"+e.getMessage(),\n \t\t\tMessageDialog.ERROR, new String[]{\"OK\"}, 0);\n \tmsgDlg.open();\n }\n\n completeSave();\n }\n });\n\n\n // \n // Create the Delete button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.grabExcessHorizontalSpace = false;\n deleteBtn = new Button(bottonBtnComposite, SWT.PUSH);\n deleteBtn.setText(\"Delete\");\n deleteBtn.setLayoutData(gd);\n deleteBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n \tdeleteColormap();\n }\n });\n Label sep = new Label(shell, SWT.SEPARATOR|SWT.HORIZONTAL);\n gd = new GridData(GridData.FILL_HORIZONTAL);\n sep.setLayoutData(gd);\n\n // \n // Create the Delete button.\n gd = new GridData(GridData.HORIZONTAL_ALIGN_END);\n Button closeBtn = new Button(shell, SWT.PUSH);\n closeBtn.setText(\" Close \");\n closeBtn.setLayoutData(gd);\n closeBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n \tshell.dispose();\n }\n });\n }", "@Override\n protected void createButtonsForButtonBar(final Composite parent) {\n\n GridLayout layout = (GridLayout) parent.getLayout();\n layout.marginHeight = 0;\n }", "@Override\n protected void addButtons()\n {\n JLabel agentOptions = new JLabel(\"Client Options \", SwingConstants.CENTER);\n addComponentToGridBag(this, agentOptions, 0, 0, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH);\n\n JButton agentSendMessage = new JButton(\"Send Message\");\n addComponentToGridBag(this, agentSendMessage, 0, 2, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH);\n agentSendMessage.addActionListener((ActionEvent e) ->\n {\n String to = getTo();\n String content = getContent(to);\n sendMessage(to, content);\n });\n\n JButton agentShowPortal = new JButton(\"Show Portal\");\n addComponentToGridBag(this, agentShowPortal, 0, 3, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH);\n agentShowPortal.addActionListener((ActionEvent e) ->\n {\n displayConnections();\n });\n\n JButton agentexit = new JButton(\"Exit\");\n addComponentToGridBag(this, agentexit, 0, 5, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH);\n agentexit.addActionListener((ActionEvent e) ->\n {\n System.exit(0);\n });\n }", "private void createOKButtons() {\n okAddButton = addOKButton(\"Add Shape\");\n okRemoveButton = addOKButton(\"Remove Shape\");\n okAddKeyframeButton = addOKButton(\"Add Keyframe\");\n okAddKeyframeTimeButton = addOKButton(\"Add Keyframe Time\");\n okRemoveKeyframeButton = addOKButton(\"Remove Keyframe\");\n okRemoveKeyframeTimeButton = addOKButton(\"Remove Keyframe Time\");\n okEditKeyframeButton = addOKButton(\"Edit Keyframe\");\n okEditKeyframeTimeButton = addOKButton(\"Edit Keyframe Time\");\n okEditKeyframeFinalButton = addOKButton(\"Edit Keyframe Final\");\n okClearShapeButton = addOKButton(\"Clear Shape\");\n }", "public void addKeys() {\n\t\tbtnDot = new JButton(\".\");\n\t\tbtnDot.setBounds(42, 120, 40, 40);\n\t\tthis.add(btnDot); //Handle case\n\t\t\n\t\tbtn0 = new JButton(\"0\");\n\t\tbtn0.setBounds(81, 120, 40, 40);\n\t\tthis.add(btn0);\n\t\tnumberButtonList = new ArrayList<JButton>(10);\n\t\tnumberButtonList.add(btn0);\n\t\t\n\t\tbtnC = new JButton(\"C\");\n\t\tbtnC.setBounds(120, 120, 40, 40);\n\t\tthis.add(btnC);\n\t\t\n\t\tbtnStar = new JButton(\"*\");\n\t\tbtnStar.setBounds(159, 120, 40, 40);\n\t\tthis.add(btnStar);\n\t\toperationButtonList = new ArrayList<JButton>(10);\n\t\toperationButtonList.add(btnStar);\n\t\t\n\t\tbtnPi = new JButton(\"π\");\n\t\tbtnPi.setBounds(198, 120, 40, 40);\n\t\tthis.add(btnPi);\n\t\t//numberButtonList.add(btnPi); //Special case\n\t\tvalueButtons.add(btnPi);\n\t\t\n\t\tbtnLn = new JButton(\"ln\");\n\t\tbtnLn.setBounds(237, 120, 40, 40);\n\t\tthis.add(btnLn);\n\t\tresultOperations.add(btnLn);\n\t\t\n\t\t//Row 2\n\t\t\n\t\tbtn3 = new JButton(\"3\");\n\t\tbtn3.setBounds(42, 80, 40, 40);\n\t\tthis.add(btn3);\n\t\tnumberButtonList.add(btn3);\n\t\t\n\t\tbtn2 = new JButton(\"2\");\n\t\tbtn2.setBounds(81, 80, 40, 40);\n\t\tthis.add(btn2);\n\t\tnumberButtonList.add(btn2);\n\t\t\n\t\tbtn1 = new JButton(\"1\");\n\t\tbtn1.setBounds(120, 80, 40, 40);\n\t\tthis.add(btn1);\n\t\tnumberButtonList.add(btn1);\n\t\t\n\t\tbtnDivide = new JButton(\"/\");\n\t\tbtnDivide.setBounds(159, 80, 40, 40);\n\t\tthis.add(btnDivide);\n\t\toperationButtonList.add(btnDivide);\n\t\t\n\t\tbtnE = new JButton(\"e\");\n\t\tbtnE.setBounds(198, 80, 40, 40);\n\t\tthis.add(btnE);\n\t\tvalueButtons.add(btnE);\n\t\t//numberButtonList.add(btnE); //Special case\n\t\t\n\t\tbtnTan = new JButton(\"tan\");\n\t\tbtnTan.setBounds(237, 80, 40, 40);\n\t\tthis.add(btnTan);\n\t\tresultOperations.add(btnTan);\n\t\t\n\t\t//Row 3\n\t\t\n\t\tbtn6 = new JButton(\"6\");\n\t\tbtn6.setBounds(42, 40, 40, 40);\n\t\tthis.add(btn6);\n\t\tnumberButtonList.add(btn6);\n\t\t\n\t\tbtn5 = new JButton(\"5\");\n\t\tbtn5.setBounds(81, 40, 40, 40);\n\t\tthis.add(btn5);\n\t\tnumberButtonList.add(btn5);\n\t\t\n\t\tbtn4 = new JButton(\"4\");\n\t\tbtn4.setBounds(120, 40, 40, 40);\n\t\tthis.add(btn4);\n\t\tnumberButtonList.add(btn4);\n\t\t\n\t\tbtnMinus = new JButton(\"-\");\n\t\tbtnMinus.setBounds(159, 40, 40, 40);\n\t\tthis.add(btnMinus);\n\t\toperationButtonList.add(btnMinus);\n\t\t\n\t\tbtnSqRt = new JButton(\"√\");\n\t\tbtnSqRt.setBounds(198, 40, 40, 40);\n\t\tthis.add(btnSqRt);\n\t\tresultOperations.add(btnSqRt);\n\t\t\n\t\tbtnCos = new JButton(\"cos\");\n\t\tbtnCos.setBounds(237, 40, 40, 40);\n\t\tthis.add(btnCos);\n\t\tresultOperations.add(btnCos);\n\t\t\n\t\t//Row 4\n\t\t\n\t\tbtn9 = new JButton(\"9\");\n\t\tbtn9.setBounds(42, 0, 40, 40);\n\t\tthis.add(btn9);\n\t\tnumberButtonList.add(btn9);\n\t\t\n\t\tbtn8 = new JButton(\"8\");\n\t\tbtn8.setBounds(81, 0, 40, 40);\n\t\tthis.add(btn8);\n\t\tnumberButtonList.add(btn8);\n\t\t\n\t\tbtn7 = new JButton(\"7\");\n\t\tbtn7.setBounds(120, 0, 40, 40);\n\t\tthis.add(btn7);\n\t\tnumberButtonList.add(btn7);\n\t\t\n\t\tbtnPlus = new JButton(\"+\");\n\t\tbtnPlus.setBounds(159, 0, 40, 40);\n\t\tthis.add(btnPlus);\n\t\toperationButtonList.add(btnPlus);\n\t\t\n\t\tbtnPower = new JButton(\"^\");\n\t\tbtnPower.setBounds(198, 0, 40, 40);\n\t\tthis.add(btnPower);\n\t\toperationButtonList.add(btnPower);\n\t\t\n\t\tbtnSin = new JButton(\"sin\");\n\t\tbtnSin.setBounds(237, 0, 40, 40);\n\t\tthis.add(btnSin);\n\t\tresultOperations.add(btnSin);\n\t}", "protected void createButtons(Composite parent) {\n\t\tcomRoot = new Composite(parent, SWT.BORDER);\n\t\tcomRoot.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));\n\t\tcomRoot.setLayout(new GridLayout(2, false));\n\n\t\ttbTools = new ToolBar(comRoot, SWT.WRAP | SWT.RIGHT | SWT.FLAT);\n\t\ttbTools.setLayout(new GridLayout());\n\t\ttbTools.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, true, false));\n\n\t\tfinal ToolItem btnSettings = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnSettings.setText(Messages.btnAdvancedSettings);\n\t\tbtnSettings.setToolTipText(Messages.tipAdvancedSettings);\n\t\tbtnSettings.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tPerformanceSettingsDialog dialog = new PerformanceSettingsDialog(\n\t\t\t\t\t\tgetShell(), getMigrationWizard().getMigrationConfig());\n\t\t\t\tdialog.open();\n\t\t\t}\n\t\t});\n\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\t\tbtnPreviewDDL = new ToolItem(tbTools, SWT.CHECK);\n\t\tbtnPreviewDDL.setSelection(false);\n\t\tbtnPreviewDDL.setText(Messages.btnPreviewDDL);\n\t\tbtnPreviewDDL.setToolTipText(Messages.tipPreviewDDL);\n\t\tbtnPreviewDDL.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tboolean flag = btnPreviewDDL.getSelection();\n\t\t\t\tswitchText(flag);\n\t\t\t}\n\t\t});\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\n\t\tfinal ToolItem btnExportScript = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnExportScript.setText(Messages.btnExportScript);\n\t\tbtnExportScript.setToolTipText(Messages.tipSaveScript);\n\t\tbtnExportScript.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\texportScriptToFile();\n\t\t\t}\n\t\t});\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\t\tfinal ToolItem btnUpdateScript = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnUpdateScript.setText(Messages.btnUpdateScript);\n\t\tbtnUpdateScript.setToolTipText(Messages.tipUpdateScript);\n\t\tbtnUpdateScript.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tprepare4SaveScript();\n\t\t\t\tgetMigrationWizard().saveMigrationScript(false, isSaveSchema());\n\t\t\t\tMessageDialog.openInformation(PlatformUI.getWorkbench()\n\t\t\t\t\t\t.getDisplay().getActiveShell(),\n\t\t\t\t\t\tMessages.msgInformation, Messages.setOptionPageOKMsg);\n\t\t\t}\n\t\t});\n\t\tbtnUpdateScript\n\t\t\t\t.setEnabled(getMigrationWizard().getMigrationScript() != null);\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\t\tfinal ToolItem btnNewScript = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnNewScript.setText(Messages.btnCreateNewScript);\n\t\tbtnNewScript.setToolTipText(Messages.tipCreateNewScript);\n\t\tbtnNewScript.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tprepare4SaveScript();\n\t\t\t\tString name = EditScriptDialog.getMigrationScriptName(\n\t\t\t\t\t\tgetShell(), getMigrationWizard().getMigrationConfig()\n\t\t\t\t\t\t\t\t.getName());\n\t\t\t\tif (StringUtils.isBlank(name)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgetMigrationWizard().getMigrationConfig().setName(name);\n\t\t\t\tgetMigrationWizard().saveMigrationScript(true, isSaveSchema());\n\t\t\t\tbtnUpdateScript.setEnabled(getMigrationWizard()\n\t\t\t\t\t\t.getMigrationScript() != null);\n\t\t\t\tMessageDialog.openInformation(PlatformUI.getWorkbench()\n\t\t\t\t\t\t.getDisplay().getActiveShell(),\n\t\t\t\t\t\tMessages.msgInformation, Messages.setOptionPageOKMsg);\n\t\t\t}\n\t\t});\n\t}", "protected void createButtons(Panel panel) {\n panel.add(new Filler(24,20));\n\n Choice drawingChoice = new Choice();\n drawingChoice.addItem(fgUntitled);\n\n\t String param = getParameter(\"DRAWINGS\");\n\t if (param == null)\n\t param = \"\";\n \tStringTokenizer st = new StringTokenizer(param);\n while (st.hasMoreTokens())\n drawingChoice.addItem(st.nextToken());\n // offer choice only if more than one\n if (drawingChoice.getItemCount() > 1)\n panel.add(drawingChoice);\n else\n panel.add(new Label(fgUntitled));\n\n\t\tdrawingChoice.addItemListener(\n\t\t new ItemListener() {\n\t\t public void itemStateChanged(ItemEvent e) {\n\t\t if (e.getStateChange() == ItemEvent.SELECTED) {\n\t\t loadDrawing((String)e.getItem());\n\t\t }\n\t\t }\n\t\t }\n\t\t);\n\n panel.add(new Filler(6,20));\n\n Button button;\n button = new CommandButton(new DeleteCommand(\"Delete\", fView));\n panel.add(button);\n\n button = new CommandButton(new DuplicateCommand(\"Duplicate\", fView));\n panel.add(button);\n\n button = new CommandButton(new GroupCommand(\"Group\", fView));\n panel.add(button);\n\n button = new CommandButton(new UngroupCommand(\"Ungroup\", fView));\n panel.add(button);\n\n button = new Button(\"Help\");\n\t\tbutton.addActionListener(\n\t\t new ActionListener() {\n\t\t public void actionPerformed(ActionEvent event) {\n\t\t showHelp();\n\t\t }\n\t\t }\n\t\t);\n panel.add(button);\n\n fUpdateButton = new Button(\"Simple Update\");\n\t\tfUpdateButton.addActionListener(\n\t\t new ActionListener() {\n\t\t public void actionPerformed(ActionEvent event) {\n if (fSimpleUpdate)\n setBufferedDisplayUpdate();\n else\n setSimpleDisplayUpdate();\n\t\t }\n\t\t }\n\t\t);\n\n // panel.add(fUpdateButton); // not shown currently\n }", "private void createPanel() {\n JPanel panel = new JPanel();\n \n for(int i = 0; i < button.size(); i++){\n panel.add(button.get(i));\n }\n panel.add(label);\n \n add(panel);\n }", "@Override\r\n\tprotected void createButtonsForButtonBar(Composite parent) {\r\n\t\tcreateButton(parent, IDialogConstants.OK_ID, Messages.BTN_ADD,\r\n\t\t\t\ttrue);\r\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID,\r\n\t\t\t\tMessages.BTN_FINISH, false);\r\n\t\tinitDataBindings();\r\n\t}", "@Override\r\n\tprotected void createButtonsForButtonBar(Composite parent) {\n\t\tcreateButton(parent, IDialogConstants.OK_ID, \"Add\",\r\n\t\t\t\ttrue);\r\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID,\r\n\t\t\t\tIDialogConstants.CANCEL_LABEL, false);\r\n\t}", "private void initBtnsArray()\r\n {\r\n for (int i = 0; i < this.buttons.length; i++)\r\n this.buttons[i] = new Button(\"Button #\" + i);\r\n }", "private void createButtonComp() {\n GridData gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);\n Composite okBtnComp = new Composite(shell, SWT.NONE);\n GridLayout okBtnCompLayout = new GridLayout(2, true);\n okBtnComp.setLayout(okBtnCompLayout);\n okBtnComp.setLayoutData(gd);\n\n GridData bd = new GridData(110, 30);\n okBtn = new Button(okBtnComp, SWT.PUSH);\n okBtn.setText(\"OK\");\n okBtn.setLayoutData(bd);\n okBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent e) {\n calculateDuration();\n shell.dispose();\n }\n });\n\n bd = new GridData(110, 30);\n cancelBtn = new Button(okBtnComp, SWT.PUSH);\n cancelBtn.setText(\"Close\");\n cancelBtn.setLayoutData(bd);\n cancelBtn.addSelectionListener(new SelectionAdapter() {\n\n /*\n * (non-Javadoc)\n * \n * @see\n * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse\n * .swt.events.SelectionEvent)\n */\n @Override\n public void widgetSelected(SelectionEvent e) {\n setReturnValue(-1);\n close();\n }\n });\n }", "private HorizontalPanel createCommands() {\n\t\tfinal HorizontalPanel bar = new HorizontalPanel();\n\t\tbar.addStyleName(AbstractField.CSS.cbtAbstractCommand());\n\t\t\n\t\t//-----------------------------------------------\n\t\t// Save button\n\t\t//-----------------------------------------------\n\t\tfinal CommandButton saveButton = new CommandButton(this, AbstractField.CONSTANTS.allSave(), actorUpdate, tab++);\n\t\tsaveButton.addStyleName(AbstractField.CSS.cbtCommandButtonTwo());\n\t\tsaveButton.addStyleName(AbstractField.CSS.cbtGradientBlue());\n\t\tsaveButton.setTitle(AbstractField.CONSTANTS.helpSave());\n\t\tbar.add(saveButton);\n\n\t\t//-----------------------------------------------\n\t\t// Delete button\n\t\t//-----------------------------------------------\n\t\tfinal CommandButton deleteButton = new CommandButton(this, AccessControl.DELETE_PERMISSION, AbstractField.CONSTANTS.allDelete(), actorDelete, tab++);\n\t\tdeleteButton.addStyleName(AbstractField.CSS.cbtCommandButtonTwo());\n\t\tdeleteButton.addStyleName(AbstractField.CSS.cbtGradientRed());\n\t\tdeleteButton.setTitle(AbstractField.CONSTANTS.helpDelete());\n\t\tbar.add(deleteButton);\n\n\t\t//-----------------------------------------------\n\t\t// Transition array that defines the finite state machine\n\t\t//-----------------------------------------------\n\t\tfsm = new ArrayList<Transition>();\n\t\tfsm.add(new Transition(Party.CREATED, saveButton, Party.CREATED));\n\t\tfsm.add(new Transition(Party.CREATED, deleteButton, Party.FINAL));\n\n\t\treturn bar;\n\t}", "private void createTileButtons(Context context) {\n Board board = boardManager.getBoard();\n tileButtons = new ArrayList<>();\n for (int row = 0; row != Board.NUM_ROWS; row++) {\n for (int col = 0; col != Board.NUM_COLS; col++) {\n Button tmp = new Button(context);\n if (bitmapList == null) {\n tmp.setBackgroundResource(board.getTile(row, col).getBackground());\n } else if (board.getTile(row, col).getId() != Board.NUM_COLS * Board.NUM_ROWS) {\n BitmapDrawable d = new BitmapDrawable(getResources(), bitmapList.get(board.getTile(row, col).getId()));\n tmp.setBackground(d);\n } else {\n tmp.setBackgroundResource(R.drawable.tile_grey);\n }\n this.tileButtons.add(tmp);\n }\n }\n }", "private void buttonInit(){\n for(int i=0; i < 3; i++){\n choice[i] = new JButton();\n\n }\n choice[0].setText(\"10x10 / 8 bombs\");\n choice[0].setBackground(new Color(86, 160, 189));\n\n\n choice[0].addActionListener(l-> makeGamePanel(10, 8));\n\n choice[1].setText(\"15x15 / 30 bombs\");\n choice[1].setBackground(new Color(238, 160, 160));\n\n\n choice[1].addActionListener(l-> makeGamePanel(15,30));\n\n choice[2].setText(\"24x24 / 70 bombs\");\n choice[2].setBackground(new Color(253, 230, 122));\n choice[2].setFont(new Font(Font.MONOSPACED, Font.BOLD, 30));\n choice[2].setForeground(new Color(45, 68, 73));\n\n choice[2].addActionListener(l-> makeGamePanel(24,70));\n\n this.add(choice[0], BorderLayout.LINE_START); this.add(choice[1], BorderLayout.LINE_END); this.add(choice[2], BorderLayout.CENTER);\n }", "private JButton[][] createBoard(int size){\n int count = 1;\n this.setLayout( new GridLayout(dimensions, dimensions));\n for (int o = 0; o < size; o++) {\n for (int i = 0; i < size; i++) {\n jbtnBoard[o][i] = new JButton(Integer.toString(i) + \",\" + Integer.toString(o));\n String name = Integer.toString(i) + \",\" + Integer.toString(o);\n jbtnBoard[o][i].setName(name);\n jbtnBoard[o][i].setForeground(Color.GREEN);\n this.add(jbtnBoard[o][i]);\n count++;\n }\n }\n return jbtnBoard;\n }", "private void makeButtonPanel()\n {\n \n this.buttonPanel.setLayout(new GridLayout(10, 2, 30, 10));\n \n \n this.buttonPanel.add(this.fLabel);\n this.fName.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.fName);\n\n this.buttonPanel.add(this.lLabel);\n this.lName.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.lName);\n\n this.buttonPanel.add(this.idLabel);\n this.iD.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.iD);\n\n this.buttonPanel.add(this.courseLabel);\n this.course.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.course);\n\n this.buttonPanel.add(this.instructorLabel);\n this.instructor.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.instructor);\n\n this.buttonPanel.add(this.tutorLabel);\n this.tutor.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.tutor);\n \n this.buttonPanel.add(this.commentsLable);\n this.comments.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.comments);\n //Removed for appointment tabel\n //this.buttonPanel.add(this.appointmentLable);\n //this.buttonPanel.add(this.appointment);\n this.buttonPanel.add(this.sessionLenLabel);\n this.sessionLength.setColumns(COL_WIDTH);\n this.sessionLength.setText(\"30\");\n this.buttonPanel.add(this.sessionLength);\n\n this.ADD_BUTTON.addActionListener(new AddButtonListener());\n //buttonPanel.add(ADD_BUTTON);\n \n \n this.addSessionPlaceHolder.add(this.buttonPanel);\n }", "private void addComponents(Container pane) {\n // Reset pane\n pane.removeAll();\n\n GridLayout mainLayout = new GridLayout(4,3);\n JPanel mainPanel = new JPanel();\n mainPanel.setLayout(mainLayout);\n\n // Setting up button sizes\n JButton b = new JButton(\"Filler button\");\n Dimension buttonSize = b.getPreferredSize();\n Dimension preferredSize = new Dimension(\n (int)(buttonSize.getWidth() * 7.5) + newGUI.maxGap,\n (int)(buttonSize.getHeight() * 3.5) + newGUI.maxGap * 2);\n mainPanel.setPreferredSize(preferredSize);\n\n // Add the main panel buttons\n mainPanel.add(commands);\n mainPanel.add(availableCommands);\n mainPanel.add(new JLabel());\n mainPanel.add(enterButton);\n\n pane.add(mainPanel, BorderLayout.NORTH);\n pane.add(new JSeparator(), BorderLayout.CENTER);\n }", "private void addViewBody() {\n\t\tJButton medicosButton = new JButton(\"Médicos\");\n\t\tmedicosButton.addActionListener((ActionEvent e) -> {\n\t\t\tRouter.getInstance().goToView(new MedicosView());\n\t\t});\n\t\tthis.add(medicosButton);\n\n\t\tJButton clientesButton = new JButton(\"Clientes\");\n\t\tclientesButton.addActionListener((ActionEvent e) -> {\n\t\t\tRouter.getInstance().goToView(new ClientesView());\n\t\t});\n\t\tthis.add(clientesButton);\n\n\t\tJButton novaConsultaButton = new JButton(\"Nova Consulta\");\n\t\tnovaConsultaButton.addActionListener((ActionEvent e) -> {\n\t\t\tRouter.getInstance().goToView(new CadastroConsultaView());\n\t\t});\n\t\tthis.add(novaConsultaButton);\n\n\t\tJButton novoTesteButton = new JButton(\"Novo Teste [EM BREVE]\");\n\t\tnovoTesteButton.setEnabled(false);\n\t\tthis.add(novoTesteButton);\n\t}", "protected Panel createButtonPanel() {\n Panel panel = new Panel();\n panel.setLayout(new PaletteLayout(2, new Point(2,2), false));\n return panel;\n }", "private List<JRadioButton> setupCharacterButtons() {\n\t\tList<JRadioButton> btns = new ArrayList<JRadioButton>();\n\t\t// select the first button\n\t\tJRadioButton greenBtn = new JRadioButton(frame.makeDave(GameOfCluedo.GREEN));\n\t\tgreenBtn.setSelected(true);\n\t\t// add buttons to list\n\t\tbtns.add(greenBtn);\n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.MUSTARD)));\n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.PEACOCK))); \n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.PLUM))); \n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.SCARLETT))); \n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.WHITE))); \n\t\treturn btns;\n\t}", "@FXML\n public void createRecentsButtons(ActionEvent ae) throws Exception {\n\n // do your job of creating Buttons and pass the arraylist as function parameters\n for(int k=0; k<11; k++)\n myArray.add(k);\n this.getNumberOfRecentGroups(myArray);\n System.out.println(\"I was clicked\");\n }", "@Override\n\tprotected void createButtonsForButtonBar(Composite parent) {\n\t\tButton button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);\n\t\tbutton.setText(DialogStrings.RemoveUserDialog_RemoveButton);\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);\n\t}", "ButtonPanel() {\n setLayout(new GridLayout(0,3));\n setPreferredSize(new Dimension(1000,100));\n setVisible(true);\n setMaximumSize(new Dimension(1000,250));\n reservationButton = new JButton(\"Reservation View\");\n bookingButton = new JButton(\"Booking View\");\n searchButton = new JButton(\"Search View\");\n add(reservationButton);\n add(bookingButton);\n add(searchButton);\n \n }", "private void generateButtonPanel() {\n buttonsPanel = new JPanel();\n playPauseButton = addButton(\"Play/Pause\");\n restartButton = addButton(\"Restart\");\n speedUpButton = addButton(\"Speed Up\");\n slowDownButton = addButton(\"Slow Down\");\n loopbackButton = addButton(\"Loopback\");\n keyCommandsButton = addButton(\"Key Commands\");\n textViewButton = addButton(\"Animation Text\");\n\n addShapeButton = addButton(\"Add Shape\");\n removeShapeButton = addButton(\"Remove Shape\");\n addKeyframeButton = addButton(\"Add Keyframe\");\n removeKeyframeButton = addButton(\"Remove Keyframe\");\n editKeyframeButton = addButton(\"Edit Keyframe\");\n clearAnimationButton = addButton(\"Clear Animation\");\n clearShapeButton = addButton(\"Clear Shape\");\n buttonsPanel.setLayout(new FlowLayout());\n\n mainPanel.add(buttonsPanel);\n }", "private void doButtons()\n {\n if (scopes.size()>1) addButtons();\n else hideButtons();\n }", "private void init_buttons(){\r\n /**\r\n * BOTON NUEVO\r\n */\r\n im_tool1.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonInicio();\r\n botonNuevo();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON EDITAR\r\n */\r\n im_tool2.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonEditar();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON GUARDAR\r\n */\r\n im_tool3.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonGuardar();\r\n }\r\n }\r\n }); \r\n /**\r\n * BOTON ELIMINAR\r\n */\r\n im_tool4.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonEliminar();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON IMPRIMIR\r\n */\r\n im_tool5.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){ \r\n botonImprimir();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON REGRESAR\r\n */\r\n im_tool6.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonInicio();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON POR ASIGNAR\r\n */\r\n im_tool7.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n //\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON NOTAS DE CREDITO\r\n */\r\n im_tool8.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n //\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON DEVOLUCION\r\n */\r\n im_tool9.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n //\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON BUSCAR\r\n */\r\n im_tool12.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n switch (mouseEvent.getClickCount()){\r\n case 1:\r\n botonInicio();\r\n botonBuscar();\r\n break;\r\n case 2:\r\n Datos.setIdButton(2003041);\r\n Gui.getInstance().showBusqueda(\"Busqueda\"); \r\n break;\r\n }\r\n }\r\n });\r\n /**\r\n * SELECCION EN LA TABLA\r\n */\r\n tb_guias.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n if ((tb_guias.getItems() != null) && (!tb_guias.getItems().isEmpty()))\r\n selectedRowGuide();\r\n }\r\n }\r\n }); \r\n /**\r\n * metodo para mostrar buscar el nro de guia\r\n * param: ENTER O TAB\r\n */\r\n tf_nroguia.setOnKeyReleased((KeyEvent ke) -> {\r\n if (ke.getCode().equals(KeyCode.ENTER)){\r\n //Valida que el evento se haya generado en el campo de busqueda\r\n if(((Node)ke.getSource()).getId().equals(\"tf_nroguia\")){\r\n //Solicita los datos y envia la Respuesta a imprimirse en la Pantalla\r\n Datos.setLog_cguias(new log_CGuias()); \r\n boolean boo = Ln.getInstance().check_log_CGuias_rela_caja(tf_nroguia.getText()); \r\n numGuias = 0;\r\n if(boo){\r\n Datos.setRep_log_cguias(Ln.getInstance().find_log_CGuias(tf_nroguia.getText(), \"\", \"ncaja\", Integer.parseInt(rows)));\r\n loadTable(Datos.getRep_log_cguias()); \r\n }\r\n else{\r\n change_im_val(0, im_checkg); \r\n Gui.getInstance().showMessage(\"El Nro. de \" + ScreenName + \" NO existe!\", \"A\");\r\n tf_nroguia.requestFocus();\r\n }\r\n }\r\n }\r\n });\r\n /**\r\n * metodo para mostrar buscar el nro de guia\r\n * param: ENTER O TAB\r\n */\r\n tf_nrorguia.setOnKeyReleased((KeyEvent ke) -> {\r\n if (ke.getCode().equals(KeyCode.ENTER)){\r\n //Valida que el evento se haya generado en el campo de busqueda\r\n if(((Node)ke.getSource()).getId().equals(\"tf_nrorguia\")){\r\n //Solicita los datos y envia la Respuesta a imprimirse en la Pantalla\r\n boolean booa = true; \r\n if(booa){\r\n boolean booc = Ln.getInstance().check_log_CGuias_caja(tf_nrorguia.getText()); \r\n if(booc){\r\n change_im_val(0, im_checkg); \r\n Gui.getInstance().showMessage(\"El Nro. de Guia ya esta relacionado!\", \"A\");\r\n tf_nrorguia.requestFocus();\r\n }\r\n else{\r\n for (int i = 0; i < log_guide_guia.size(); i++) {\r\n if(tf_nrorguia.getText().equals(tb_guias.getItems().get(i).getGuias())){\r\n booa = false;\r\n Gui.getInstance().showMessage(\"El Nro. de Guia ya esta relacionado!\", \"A\");\r\n tf_nrorguia.requestFocus();\r\n break;\r\n }\r\n } \r\n if(booa){\r\n log_Guide_rel_inv guide_carga = new log_Guide_rel_inv();\r\n\r\n List<Fxp_Archguid_gfc> data = \r\n Ln.getList_log_Archguid_gfc(Ln.getInstance().find_Archguid_gfc(tf_nrorguia.getText()));\r\n\r\n if (data.get(0).getStat_guia().equals(\"X\")\r\n || data.get(0).getStat_guia().equals(\"C\")){\r\n guide_carga.setNumorden(String.valueOf((log_guide_guia.size() + 1)));\r\n guide_carga.setGuias(tf_nrorguia.getText());\r\n guide_carga.setNumfact(data.get(0).getNumfact());\r\n guide_carga.setNumclie(data.get(0).getNumclie());\r\n\r\n if (data.get(0).getStat_guia().equals(\"A\")){\r\n if (tipoOperacion == 1)\r\n guide_carga.setStat_guia(null);\r\n else\r\n guide_carga.setStat_guia(data.get(0).getStat_guia());\r\n }\r\n else{\r\n guide_carga.setStat_guia(null);\r\n }\r\n \r\n \r\n log_guide_guia.add(guide_carga);\r\n\r\n loadTableGuide_guias();\r\n change_im_val(200, im_checkg); \r\n\r\n numFactCarga = numFactCarga + data.get(0).getNumfact();\r\n numClieCarga = numClieCarga + data.get(0).getNumclie();\r\n\r\n tf_nrorguia.setText(\"\");\r\n }else{\r\n if (data.get(0).getStat_guia().equals(\"\")){\r\n Gui.getInstance().showMessage(\"El Nro. de Guia NO tiene relación de Guia de Carga!\", \"A\");\r\n }\r\n else{\r\n Gui.getInstance().showMessage(\"El Nro. de Guia ya esta relacionado!\", \"A\");\r\n }\r\n tf_nrorguia.requestFocus();\r\n }\r\n \r\n }\r\n }\r\n }\r\n else{\r\n change_im_val(0, im_checkg); \r\n Gui.getInstance().showMessage(\"El Nro. de Guia NO existe!\", \"A\");\r\n tf_nrorguia.requestFocus();\r\n }\r\n }\r\n }\r\n });\r\n }", "public JoystickButtonGroup(JoystickAnalogButton... buttons) {\n\t\t\tif (buttons.length < 2) {\n\t\t\t\tthis.close();\n\t\t\t} else {\n\t\t\t\tthis.buttons = buttons;\n\t\t\t}\n\t\t}", "private void createRedButtons() {\r\n\t\tint y = 40;\r\n\t\tfor (int i = 60; i < 65; i++) {\r\n\t\t\tarray[i] = createRedButton(y);\r\n\t\t\ty += 40;\r\n\t\t}\r\n\t}", "protected void createButtonsForButtonBar(Composite parent) {\n\t\tcreateButton(barComp, BUTTON_ADD_ID, Messages.btnAddParameter, true);\n\t\tcreateButton(barComp, BUTTON_EDIT_ID, Messages.btnEditParameter, true);\n\t\tcreateButton(barComp, BUTTON_DROP_ID, Messages.btnDropParameter, true);\n\t\tcreateButton(barComp, BUTTON_UP_ID, Messages.btnUpParameter, true);\n\t\tcreateButton(barComp, BUTTON_DOWN_ID, Messages.btnDownParameter, true);\n\t\tcreateButton(parent, IDialogConstants.OK_ID, com.cubrid.common.ui.common.Messages.btnOK, true);\n\n\t\tgetButton(BUTTON_EDIT_ID).setEnabled(false);\n\t\tgetButton(BUTTON_UP_ID).setEnabled(false);\n\t\tgetButton(BUTTON_DOWN_ID).setEnabled(false);\n\t\tgetButton(BUTTON_DROP_ID).setEnabled(false);\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID, com.cubrid.common.ui.common.Messages.btnCancel, false);\n\t}", "private void createUIComponents() {\n bt1 = new JButton(\"Hola\");\n }", "void set_buttons(){\n\n int button_count = 5;\n\n button_data_set = new ArrayList(button_count);\n\n try {\n\n JSONObject btn1 = new JSONObject();\n btn1.put(\"title\", \"Button1\");\n button_data_set.add(btn1);\n\n JSONObject btn2 = new JSONObject();\n btn1.put(\"title\", \"Button2\");\n button_data_set.add(btn2);\n\n JSONObject btn3 = new JSONObject();\n btn1.put(\"title\", \"Button3\");\n button_data_set.add(btn3);\n\n JSONObject btn4 = new JSONObject();\n btn1.put(\"title\", \"Button4\");\n button_data_set.add(btn4);\n\n JSONObject btn5 = new JSONObject();\n btn1.put(\"title\", \"Button5\");\n button_data_set.add(btn5);\n\n }catch(Exception e){\n e.printStackTrace();\n }\n\n Common.ButtonsCount = button_count;\n }", "public void createButtonUI(final LinearLayout linearLayout){\n btnAddSet =new Button(this);\n btnDeleteLift=new Button(this);\n btnAddSet.setText(\"Add\");\n btnDeleteLift.setText(\"Delete\");\n btnAddSet.setId(View.generateViewId());\n btnDeleteLift.setId(View.generateViewId());\n btnLayout=new RelativeLayout(this);\n final RelativeLayout.LayoutParams btnRelLayoutparams=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n btnRelLayoutparams.setMargins(0,5,0,20);\n btnLayout.setLayoutParams(btnRelLayoutparams);\n RelativeLayout.LayoutParams btnAddSetParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n RelativeLayout.LayoutParams btnDeleteLiftParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n\n btnAddSetParams.setMargins(75, 0, 10, 0);\n btnDeleteLiftParams.setMargins(10, 0, 75, 0);\n btnAddSetParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);\n btnDeleteLiftParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);\n btnAddSet.setLayoutParams(btnAddSetParams);\n btnDeleteLift.setLayoutParams(btnDeleteLiftParams);\n\n btnLayout.addView(btnAddSet, btnAddSetParams);\n btnLayout.addView(btnDeleteLift, btnDeleteLiftParams);\n\n linearLayout.addView(btnLayout, btnRelLayoutparams);\n btnAddSet.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n linearLayout.removeView(btnLayout);\n createSetUI(linearLayout,setNum , null);\n setNum++;\n linearLayout.addView(btnLayout, btnRelLayoutparams);\n }\n });\n//Listener for delete lift button\n btnDeleteLift.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n delLift();\n }\n });\n\n }", "private void addShapeNameButtons() {\n popupPanel.add(SHAPE_NAME_LABEL);\n ButtonGroup bg = new ButtonGroup();\n for (String name : model.getIds()) {\n JRadioButton jb = new JRadioButton(name);\n bg.add(jb);\n shapeNames.add(jb);\n popupPanel.add(jb);\n }\n\n }", "public void getNumberOfRecentGroups(ArrayList arr) throws Exception {\n int arraySize = arr.size();\n int z = 0;\n\n Button[] btn = new Button[arraySize];\n while (z < arraySize) {\n btn[z] = new Button();\n\n //Anonymous method\n btn[z].setOnAction(new EventHandler<ActionEvent>() {\n public void handle(ActionEvent event) {\n System.out.println(\"hey i was clicked\");\n }\n });\n btn[z].setId(\"btnRecent\");\n btn[z].setPrefHeight(118);\n btn[z].setPrefWidth(118);\n btn[z].setText(arr.get(z) + \"\");\n fp.getChildren().add(btn[z]);\n z++;\n }\n fp.setHgap(10);\n }", "private void createComponents() {\n\t\tbuttons = new Button[9];\r\n\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\tbuttons[i] = new Button();\r\n\t\t}\r\n\r\n\t\t// Initialize components\r\n\t\tplayAgainButton = new Button(\"Play Again\");\r\n\t\tquitButton = new Button(\"Quit\");\r\n\r\n\t\t// Initialize layouts\r\n\t\tgameButtonGrid = new GridPane();\r\n\t\tgameButtonGrid.setStyle(\"-fx-background-color:Aquamarine;\");\r\n\t\tbottomButtonsHBox = new HBox();\r\n\t\tbottomButtonsHBox.setStyle(\"-fx-background-color:LightSlateGray;\");\r\n\t\tsceneVBox = new VBox();\r\n\t\t\r\n\t\t//Game components\r\n\t\tgameInfo = new GameInfo();\r\n\t}", "private Classes.Button principalButtonsMenu(TextView buttonTitle, ImageView buttonImage){\n Classes.Button button;\n if(buttonIndex < (rows*(columns-1))) {\n button = buttons.get(buttonIndex);\n createPrincipalButtons(buttonTitle, button, buttonImage);\n }else if(buttonFunctionIndex < functionButtons.size()) {\n button = functionButtons.get(buttonFunctionIndex);\n createFuncionesButtons(buttonTitle, button, buttonImage);\n }else{\n button = new Classes.Button(0, \"\", \"\", \"\",\"\", \"\",\"\", \"\");\n }\n return button;\n }", "private void createRgbHsbButtons() {\n \t\n Composite comp1 = new Composite(shell, SWT.NONE);\n GridLayout gl = new GridLayout(3, false);\n gl.horizontalSpacing = 10;\n comp1.setLayout(gl);\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n comp1.setLayoutData(gd);\n\n // Create a group to contain the RGB and HSB radio buttons.\n Group colorGroup = new Group(comp1, SWT.NONE);\n colorGroup.setText(\" Use color model: \");\n\n RowLayout groupRowLayout = new RowLayout();\n groupRowLayout.marginLeft = 10;\n groupRowLayout.marginRight = 10;\n groupRowLayout.spacing = 10;\n colorGroup.setLayout(groupRowLayout);\n\n // Create the RGB radio button. When the radio button is selected\n // update the upper and lower color wheel objects to display the RGB\n // sliders.\n rgbRdo = new Button(colorGroup, SWT.RADIO);\n rgbRdo.setText(\"RGB\");\n rgbRdo.setSelection(true);\n rgbRdo.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n changeColorWheels();\n }\n });\n\n // Create the HSB radio button. When the radio button is selected\n // update the upper and lower color wheel objects to display the HSB\n // sliders.\n hsbRdo = new Button(colorGroup, SWT.RADIO);\n hsbRdo.setText(\"HSB\");\n hsbRdo.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n changeColorWheels();\n }\n });\n \n Composite catComp = new Composite(comp1, SWT.NONE);\n gl = new GridLayout(1, false);\n gl.horizontalSpacing = 20;\n catComp.setLayout(gl);\n gd = new GridData(GridData.CENTER);\n gd.horizontalAlignment = SWT.CENTER;\n \n catComp.setLayoutData(gd);\n\n Label selCatLbl = new Label( catComp, SWT.None );\n selCatLbl.setText(\"Category\");\n \n final Combo selCmapCatCombo = new Combo( catComp, SWT.DROP_DOWN | SWT.READ_ONLY );\n selCmapCatCombo.setItems( availColorMapCats );\n selCmapCatCombo.select(0);\n \n selCmapCatCombo.addSelectionListener( new SelectionAdapter() {\n \tpublic void widgetSelected(SelectionEvent event) {\n \t\tString seldCat = selCmapCatCombo.getText();\n \t\tif( seldCat.equals( seldCmapCat ) ) {\n \t\t\treturn;\n \t\t}\n \t\t\n \t\tseldCmapCat = seldCat;\n \t\tseldCmapName = null;\n \t\tavailColorMaps.clear();\n \t\t\n for( String cmap : ColorMapUtil.listColorMaps(seldCmapCat) ) {\n \tif( seldCmapName == null ) {\n \t\tseldCmapName = cmap;\n \t\tif( !initColorMap() ) {\n \t\tseldCmapName = null;\n \t\t\tcontinue; // don't add to the list\n \t\t}\n \t}\n \tavailColorMaps.add(cmap);\n }\n \t\n createSliderData();\n selCmapCombo.setItems( availColorMaps.toArray(new String[0] ) );\n selCmapCombo.select(0);\n colorBar.setNewColorMap(sliderText, colorArray);\n \t}\n });\n \n Composite cmapComp = new Composite(comp1, SWT.NONE);\n gl = new GridLayout(1, false);\n gl.horizontalSpacing = 10;\n cmapComp.setLayout(gl);\n gd = new GridData(GridData.FILL_HORIZONTAL);\n cmapComp.setLayoutData(gd);\n\n Label selCmapLbl = new Label( cmapComp, SWT.None );\n selCmapLbl.setText(\"Colormap\");\n \n selCmapCombo = new Combo( cmapComp, SWT.DROP_DOWN );\n selCmapCombo.setItems( availColorMaps.toArray(new String[0] ) );\n selCmapCombo.select(0);\n \n selCmapCombo.addSelectionListener( new SelectionAdapter() {\n \tpublic void widgetSelected(SelectionEvent event) {\n \t\tString seldCmap = selCmapCombo.getText();\n \t\tif( seldCmap.equals( seldCmapName ) ) {\n \t\t\treturn;\n \t\t}\n \t\t\n \t\tseldCmapName = seldCmap;\n\n \t\tif( initColorMap() ) {\n createSliderData();\n \t\t}\n colorBar.setNewColorMap(sliderText, colorArray);\n \t}\n });\n \n// selCmapCombo.addModifyListener( new ModifyListener() {\n//\t\t\t@Override\n//\t\t\tpublic void modifyText(ModifyEvent e) { \n//\t\t\t\tseldCmapName = selCmapCombo.getText();\n//\t\t\t}\n// });\n }", "public void groupFunction ()\n { \n // Set layouts.\n g = new GroupLayout (this);\n setLayout (g);\n \n // Button initialization.\n getInfoButton = new JButton (\"getMethods()\");\n stringButton = new JButton (\"String\");\n setContainGapsButton = new JButton (\"setAutoCreateContainerGaps()\");\n setAutoGapsButton = new JButton (\"setAutoCreateGaps()\");\n setHonorsVisButton = new JButton (\"setHonorsVisibility()\");\n diagonalButton = new JButton (\"Diagonal\");\n verticalButton = new JButton (\"Vertical\");\n horizontalButton = new JButton (\"Horizontal\");\n linkSizeButton = new JButton (\"linkSize()\");\n replaceButton = new JButton (\"replace()\");\n returnButton = new JButton (\"Return\");\n \n // Default Layout\n g.setVerticalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n g.setHorizontalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n \n // Horizontal Layout\n horizontalButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n remove (returnButton);\n g.setVerticalGroup(\n g.createParallelGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n g.setHorizontalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n \n }\n }); \n \n // Diagonal Layout\n diagonalButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n remove (returnButton);\n g.setVerticalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n g.setHorizontalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n \n }\n }); \n \n // Vertical Layout\n verticalButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n remove (returnButton);\n g.setVerticalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n g.setHorizontalGroup(\n g.createParallelGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n \n }\n }); \n \n // get() Methods\n getInfoButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n new JOptionPane().showMessageDialog (GroupLayoutRonald.this, \"Auto Create Container Gaps Enabled: \" + g.getAutoCreateContainerGaps () + \"\\n\"\n + \"Auto Create Component Gaps Enabled: \" + g.getAutoCreateGaps () + \"\\n\"\n + \"Honors Component Visibility: \" + g.getHonorsVisibility () + \"\\n\"\n + \"Horizontal Alignment: \" + g.getLayoutAlignmentX(GroupLayoutRonald.this) + \"\\n\"\n + \"Vertical Alignment: \" + g.getLayoutAlignmentY (GroupLayoutRonald.this) + \"\\n\"\n + \"Layout Style: \" + g.getLayoutStyle () + \"\\n\"\n + \"Minimum Layout Size: \" + g.minimumLayoutSize(GroupLayoutRonald.this).getWidth() + \" by \" + g.minimumLayoutSize(GroupLayoutRonald.this).getHeight() + \"\\n\"\n + \"Maximum Layout Size: \" + g.maximumLayoutSize(GroupLayoutRonald.this).getWidth() + \" by \" + g.maximumLayoutSize(GroupLayoutRonald.this).getHeight() + \"\\n\"\n + \"Preferred Layout Size: \" + g.preferredLayoutSize(GroupLayoutRonald.this).getWidth() + \" by \" + g.preferredLayoutSize(GroupLayoutRonald.this).getHeight() + \"\\n\"\n , \"About: Layout Data\", JOptionPane.PLAIN_MESSAGE);\n }\n });\n \n // toString() Method\n stringButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n new JOptionPane().showMessageDialog (GroupLayoutRonald.this, g.toString(), \"String Representation of Layout\", JOptionPane.PLAIN_MESSAGE);\n }\n });\n \n \n // setAutoCreateContainerGaps() Method\n setContainGapsButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n if (g.getAutoCreateContainerGaps() == true)\n g.setAutoCreateContainerGaps (false);\n else\n g.setAutoCreateContainerGaps (true);\n }\n });\n \n // setAutoCreateGaps() Method\n setAutoGapsButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n if (g.getAutoCreateGaps() == true)\n g.setAutoCreateGaps(false);\n else\n g.setAutoCreateGaps(true);\n }\n });\n \n // setHonorsVisibility() Method\n setHonorsVisButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n if (g.getHonorsVisibility() == true)\n g.setHonorsVisibility (false);\n else\n g.setHonorsVisibility (true);\n }\n });\n \n // linkSize() Method\n linkSizeButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n g.linkSize(SwingConstants.HORIZONTAL, linkSizeButton, setHonorsVisButton, setAutoGapsButton);\n }\n });\n \n // replace() Method\n replaceButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n g.replace (replaceButton, returnButton);\n }\n });\n \n // replace() Method\n returnButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n g.replace (returnButton, replaceButton);\n }\n });\n }", "public static HBox createWinBtnBox() {\n int numWinBtns = 3;\n ToggleButton winBtn1 = createRoundWinBtn(5);\n ToggleButton winBtn2 = createRoundWinBtn(10);\n ToggleButton winBtn3 = createRoundWinBtn(20);\n\n //Only one map can be selected, hence the use of a toggling system\n final ToggleGroup group = new ToggleGroup();\n winBtn1.setToggleGroup(group);\n winBtn2.setToggleGroup(group);\n winBtn3.setToggleGroup(group);\n winBtn1.setSelected(true);\n endScore = 5; // default\n\n HBox hbox = new HBox(winBtn1, winBtn2, winBtn3);\n hbox.setLayoutX(MainGUI.WIDTH / 2.0 - winBtn1.getPrefWidth() * numWinBtns / 2.0);\n hbox.setLayoutY(MainGUI.HEIGHT / 2.0 + 40);\n return hbox;\n }", "private JPanel createResourcesListAndButtonsPanel() {\n\n JPanel panel = new JPanel(new BorderLayout());\n panel.setBorder(PADDING_BORDER);\n\n panel.add(createResourcesPanel(), BorderLayout.NORTH);\n panel.add(createConfirmButtons(), BorderLayout.SOUTH);\n\n return panel;\n }", "public void generateElevatorButtons() {\n\t\tfor (int i = 1; i <= Settings.NUMBER_OF_FLOORS; i++) {\n\t\t\televatorButtons.put(i, new ElevatorButton(false, i));\n\t\t}\n\t}" ]
[ "0.7705233", "0.76489395", "0.7441956", "0.74234563", "0.7369384", "0.72707677", "0.71578646", "0.69689435", "0.6961077", "0.6943231", "0.6893604", "0.6886755", "0.68422824", "0.6840741", "0.6793571", "0.67551726", "0.67201364", "0.6696621", "0.6695865", "0.6690504", "0.66840625", "0.6622794", "0.65955156", "0.6558677", "0.6548885", "0.65372944", "0.6534896", "0.6526962", "0.6523411", "0.6497655", "0.6485232", "0.64807904", "0.64731324", "0.6470418", "0.64608777", "0.64591205", "0.6431243", "0.6391238", "0.6374049", "0.63740075", "0.63660353", "0.634849", "0.63465935", "0.63312244", "0.631042", "0.6295161", "0.62845665", "0.62763226", "0.62626183", "0.6236526", "0.62284595", "0.6222365", "0.6216594", "0.6208402", "0.61901397", "0.6184375", "0.61825955", "0.6180217", "0.61800945", "0.61799884", "0.61788005", "0.61777097", "0.61738193", "0.6172368", "0.61701566", "0.616425", "0.61514366", "0.61511713", "0.6138659", "0.61364967", "0.6134927", "0.61139536", "0.61124665", "0.61122215", "0.6112218", "0.61030585", "0.6089623", "0.6082362", "0.60822606", "0.6079521", "0.6078914", "0.60753924", "0.60749817", "0.60539246", "0.6047765", "0.6045167", "0.604471", "0.6043399", "0.60405254", "0.6034422", "0.6026556", "0.6023298", "0.60228187", "0.6002203", "0.6001803", "0.5997127", "0.5996676", "0.599528", "0.59931374", "0.5988645" ]
0.65224606
29
Create a group of buttons. Must have at least 2 buttons.
public JoystickButtonGroup(JoystickAnalogButton... buttons) { if (buttons.length < 2) { this.close(); } else { this.buttons = buttons; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createButtonsPanel() {\r\n Composite buttonsPanel = new Composite(this, SWT.NONE);\r\n buttonsPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));\r\n buttonsPanel.setLayout(new GridLayout(4, true));\r\n\r\n getButtonFromAction(buttonsPanel, \"New\", new NewAction(_window));\r\n getButtonFromAction(buttonsPanel, \"Save\", new SaveAction());\r\n getButtonFromAction(buttonsPanel, \"Delete\", new DeleteAction(_window));\r\n getButtonFromAction(buttonsPanel, \"Cancel\", new CancelAction());\r\n }", "private void groupButton() {\n ButtonGroup bg1 = new ButtonGroup();\n \n bg1.add(excellentbtn);\n bg1.add(goodbtn);\n bg1.add(normalbtn);\n bg1.add(badbtn);\n bg1.add(worstbtn);\n }", "public void createButtons() {\n\t\tbutton1 = new JButton(\"Button1\");\n\t\tbutton2 = new JButton(\"Button2\");\n\t\tbutton3 = new JButton(\"Button3\");\n\t\tbutton4 = new JButton(\"Button4\");\n\t\tbutton5 = new JButton(\"Button5\");\n\t}", "private JComponent buildButtons() {\n Panel panel = new Panel();\n panel.setLayout(new FlowLayout(FlowLayout.RIGHT));\n JButton button = Buttons.create(\"Create\").onClick((ev) -> {\n try {\n group.setName(name.getText());\n group.clearUsers();\n list.getSelectedValuesList().forEach((item) -> {\n group.addUser(item);\n });\n if (group.getName().isEmpty()) {\n JOptionPane.showMessageDialog(null, \"Name is required\");\n return;\n }\n if (!group.hasUsers()) {\n JOptionPane.showMessageDialog(null, \"Users are required\");\n return;\n }\n if (group.getId() == 0) {\n GroupRepository.get().save(group);\n } else {\n GroupRepository.get().update(group);\n }\n SwingUtilities.getWindowAncestor(this).dispose();\n } catch (RepositoryException ex) {\n JOptionPane.showMessageDialog(null, ex.getMessage());\n }\n });\n button.setIcon(IconFactory.get().create(\"fa:check\"));\n panel.add(button);\n return panel;\n }", "private JPanel createButtons()\r\n\t{\r\n\t\tJPanel buttons = new JPanel();\r\n\t\tbuttons.setLayout(new FlowLayout(FlowLayout.TRAILING));\r\n\r\n\r\n\t\tButton save = new Button(PrimeMain1.texts.getString(\"save\"));\r\n\t\tsave.addActionListener(this);\r\n\t\tsave.setActionCommand(\"save\");\r\n\r\n\t\tButton cancel = new Button(PrimeMain1.texts.getString(\"cancel\"));\r\n\t\tcancel.addActionListener(this);\r\n\t\tcancel.setActionCommand(\"cancel\");\r\n\r\n\r\n\t\tbuttons.add(save);\r\n\t\tbuttons.add(cancel);\r\n\r\n\t\treturn buttons;\r\n\t}", "private void createBottomActionButtons() {\n Composite actionControlComp = new Composite(shell, SWT.NONE);\n GridLayout gl = new GridLayout(2, false);\n GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);\n actionControlComp.setLayout(gl);\n actionControlComp.setLayoutData(gd);\n\n Button okBtn = new Button(actionControlComp, SWT.PUSH);\n okBtn.setText(\" OK \");\n okBtn.addSelectionListener(new SelectionAdapter() {\n\n @Override\n public void widgetSelected(SelectionEvent e) {\n if (verifySelection()) {\n close();\n }\n }\n });\n\n Button cancelBtn = new Button(actionControlComp, SWT.PUSH);\n cancelBtn.setText(\" Cancel \");\n cancelBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent e) {\n close();\n }\n });\n }", "public void createButtons() {\n\t\tescapeBackground = new GRect(200, 150, 300, 400);\n\t\tescapeBackground.setFilled(true);\n\t\tescapeBackground.setColor(Color.gray);\n\n\t\tbutton1 = new GButton(\"Return to Game\", 250, 175, 200, 50, Color.cyan);\n\t\tbutton3 = new GButton(\"Exit Level\", 250, 330, 200, 50, Color.cyan);\n\t\tbutton4 = new GButton(\"Return to Menu\", 250, 475, 200, 50, Color.cyan);\n\n\t\tescapeButtons.add(button1);\n\t\tescapeButtons.add(button3);\n\t\tescapeButtons.add(button4);\n\n\t}", "private void iterateOverButtons(){\n int columnRows = 4;\n integerButtons = new Button[MAX_BUTTONS];\n for (int i = 0; i < integerButtons.length; ++i) {\n integerButtons[i] = new Button(buttonText[i]);\n integerButtons[i].setId(\"buttons\");\n integerButtons[i].setPrefSize(60, 80);\n gridPane.add(integerButtons[i], i % columnRows , i / columnRows);\n }\n }", "public void createButtonGrid() {\n\t\tbuttonPanel.setOpaque(false);\n\t\t\n\t\t// designs array of buttons\n\t\tfor (int counter = 1; counter <= 20; counter++) {\n\t\t\tbuttonArray[counter] = new JButton();\n\t\t\tbuttonArray[counter].setOpaque(false);\n\t\t\tbuttonArray[counter].setVisible(true);\n\t\t\tbuttonArray[counter].setBorderPainted(false);\n\t\t\tbuttonArray[counter].setHorizontalTextPosition(JButton.CENTER);\n\t\t\tbuttonArray[counter].setVerticalTextPosition(SwingConstants.CENTER);\n\t\t\tbuttonArray[counter].setFont(new Font(\"Courier\", Font.PLAIN, 15));\n\t\t\tbuttonArray[counter].setText(\"<html><font color = white>\" + Integer.toString(counter) + \"</font></html>\");\n\t\t\t// add action listener to each button\n\t\t\tbuttonArray[counter].addActionListener(eventsMain);\n\t\t\t// add each button to the container\n\t\t\tbuttonPanel.add(buttonArray[counter]);\n\t\t}\n\t\t\n\t\t// set colour for ach row of buttons\n\t\tfor (int counter = 1; counter <= 20; counter++) {\n\t\t\tif (counter >= 1 && counter < 6) {\n\t\t\t\tbuttonArray[counter].setIcon(btnBlue);\n\t\t\t} else if (counter > 5 && counter < 11) {\n\t\t\t\tbuttonArray[counter].setIcon(btnGreen);\n\t\t\t} else if (counter > 10 && counter < 16) {\n\t\t\t\tbuttonArray[counter].setIcon(btnRed);\n\t\t\t} else if (counter > 15 && counter < 21) {\n\t\t\t\tbuttonArray[counter].setIcon(btnGray);\n\t\t\t}\n\t\t}\n\t}", "public void createButtons() {\n\n addRow = new JButton(\"Add row\");\n add(addRow);\n\n deleteRow = new JButton(\"Delete row\");\n add(deleteRow);\n }", "private void createComponentForButtons(Composite section)\n {\n createRowForNewStyleButton(section);\n createRowForNewRegexButton(section);\n createRowForNewColumnButton(section);\n createRowForDeleteButton(section);\n createRowForDeleteAllButton(section);\n }", "void createButtons(Container cp) {\r\n JPanel pn4 = new JPanel(); // create a panel\r\n pn4.setLayout(new FlowLayout(FlowLayout.LEFT)); // set the layout\r\n for (int i=0; i<strClEx.length; i++) {\r\n // repeat for the number of the buttons\r\n bt[i] = new JButton(strClEx[i]); // create a button\r\n bt[i].addActionListener(this); // add the action listener to the button\r\n pn4.add(bt[i]); // add the button to the panel\r\n }\r\n cp.add(pn4); // add the panel to the container\r\n }", "private JPanel createAddAndRemoveButtons() {\n JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEADING));\n panel.add(createAddResourceButton());\n panel.add(createRemoveResourceButton());\n\n return panel;\n }", "private void createButton(){\n addButton();\n addStartButton();\n }", "private void generateButtons(){\n\t\tint coordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tint coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\t//Button button = new Button(coordX, coordY);\n\t\t//buttons.put(0, button);\n\t}", "private void setupButtons() {\n final ButtonGroup btngrp = new ButtonGroup();\n\n for (final AbstractAction actn : myToolActions) {\n final JToggleButton btn = new JToggleButton(actn);\n btn.addActionListener(actn);\n btngrp.add(btn);\n add(btn);\n }\n\n btngrp.clearSelection();\n btngrp.getElements().nextElement().setSelected(true);\n\n }", "private HBox createButtons() {\n\t\tButton solve = new Button(\"Solve\");\n\t\tButton clear = new Button(\"Clear\");\n\t\tButton quit = new Button(\"Quit\");\n\t\t\n\t\tsolve.setStyle(\"-fx-font: 12 arial; -fx-base: #336699;\");\n\t\tclear.setStyle(\"-fx-font: 12 arial; -fx-base: #336699;\");\n\t\tquit.setStyle(\"-fx-font: 12 arial; -fx-base: #336699;\");\n\t\t\n\t\tsolve.setOnAction(e -> solve());\n\t\tclear.setOnAction(e -> clear());\n\t\tquit.setOnAction(e -> quit());\n\t\t\n\t\tHBox buttons = new HBox();\n\t\tbuttons.setSpacing(20);\n\t\tbuttons.setPadding(new Insets(20,20,20,20));\n\t\tbuttons.setAlignment(Pos.CENTER);\n\t\tbuttons.getChildren().addAll(solve, clear, quit);\n\t\tbuttons.setStyle(\"-fx-background-color: #DCDCDC;\");\n\t\t\n\t\treturn buttons;\n\t}", "private void createButtons() {\n\t\tfor (int x = 0; x < buttons.length; x++)\n\t\t\tfor (int y = 0; y < buttons[x].length; y++) {\n\t\t\t\tif ((x % 2 == 0 && y % 2 == 0) || (x % 2 == 1 && y % 2 == 1))\n\t\t\t\t\tbuttons[x][y] = new DarkButton();\n\t\t\t\telse\n\t\t\t\t\tbuttons[x][y] = new LightButton();\n\n\t\t\t\tbuttonListener(x, y);\n\t\t\t}\n\t\t\t\n\t\t\tinitButtonIcons();\n\t}", "public void createGameButtons() {\n \tcreateGameButton(myResources.getString(\"startcommand\"), 1, GAME_BUTTON_XLOCATION, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"stopcommand\"), 0, GAME_BUTTON_XLOCATION * 3, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"speedup\"), SPEED_INCREASE, GAME_BUTTON_XLOCATION*5, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"slowdown\"), 1/SPEED_INCREASE, GAME_BUTTON_XLOCATION*7, GAME_BUTTON_YLOCATION);\n }", "private List<Button> createButtons(final JSONObject jsonMessageSet) {\n final List<Button> buttons = new ArrayList<Button>();\n\n final JSONArray jsonButtons = (JSONArray) jsonMessageSet.get(\"button\");\n for (Object buttonObject : jsonButtons) {\n final JSONObject jsonButton = (JSONObject) buttonObject;\n final Button button = new Button();\n button.setButtonId((Integer) jsonButton.get(\"buttonId\"));\n button.setText((String) jsonButton.get(\"text\"));\n buttons.add(button);\n }\n\n return buttons;\n }", "private void initializeButtonPanel() {\n buttonPanel = new ButtonPanel();\n radioPanel = new JPanel(new GridLayout(0, 1));\n ButtonGroup buttonGroup = new ButtonGroup();\n Collections.addAll(toDoButtonList,task1,task2,task3,task4,task5,task6);\n for (int i=0;i<toDoButtonList.size();i++){\n JRadioButton task = toDoButtonList.get(i);\n buttonGroup.add(task);\n radioPanel.add(task);\n }\n\n refresh();\n\n }", "protected void createSaveButtons() {\n Composite buttonComp = new Composite(shell, SWT.NONE);\n buttonComp.setLayout(new GridLayout(2, true));\n buttonComp.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true,\n false));\n\n int buttonWidth = 80;\n GridData gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);\n gd.widthHint = buttonWidth;\n Button saveBtn = new Button(buttonComp, SWT.PUSH);\n saveBtn.setText(\"Save\");\n saveBtn.setLayoutData(gd);\n saveBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent e) {\n handleSaveAction();\n }\n });\n\n gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);\n gd.widthHint = buttonWidth;\n Button cancelBtn = new Button(buttonComp, SWT.PUSH);\n cancelBtn.setText(\"Cancel\");\n cancelBtn.setLayoutData(gd);\n cancelBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent e) {\n setReturnValue(null);\n close();\n }\n });\n }", "private void createButton(int i){\n\t\tint x = 10, y = 120, width = 100, height = 20;\n\t\tint temp = 0;\n\t\t\n\t\tbuttons.add(new JButton(\"New Student\"));\n\t\tbuttons.get(i).addActionListener(this);\n\t\t\n\t\tfor (int a = 0; a<i; a++){\n\t\t\tx += 110;\n\t\t\ttemp++;\n\t\t\tif(temp >= Integer.parseInt(askColumns.getText())){\n\t\t\t\ty += 140;\n\t\t\t\tx = 10;\n\t\t\t\ttemp = 0;\n\t\t\t}\n\t\t\t\n\n\t\t}\n\t\t\n\t\t\n\t\tbuttons.get(i).setBounds(x, y, width, height);\n\t\tthis.add(buttons.get(i));\t\n\t\tbuttons.get(i).revalidate();\n\t\tbuttons.get(i).repaint();\n\t\t\n\t}", "private void createAdditionalButtonControls(Composite parent) {\r\n\t\tComposite btnComposite = new Composite(parent, SWT.NONE);\r\n\t\tbtnComposite.setLayout(new GridLayout(2, false));\r\n\r\n\t\tButton selAllBtn = new Button(btnComposite, SWT.PUSH);\r\n\t\tselAllBtn.setText(Messages.TOPOLOGY_BTN_SELECT_ALL_TXT);\r\n\t\tselAllBtn.addSelectionListener(new SelectionListener() {\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n\t\t\t}\r\n\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tselectedUnitsList.setAllChecked(true);\r\n\t\t\t\tupdateSelectedItemsProperty();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tButton deselAllBtn = new Button(btnComposite, SWT.PUSH);\r\n\t\tdeselAllBtn.setText(Messages.TOPOLOGY_BTN_DESELECT_ALL_TXT);\r\n\t\tdeselAllBtn.addSelectionListener(new SelectionListener() {\r\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\r\n\t\t\t}\r\n\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tselectedUnitsList.setAllChecked(false);\r\n\t\t\t\tupdateSelectedItemsProperty();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void createButtonsPane(VBox labelsPane){\n\t\tHBox buttonsPane = new HBox();\n\t\tButton easy = new Button(\"EASY\");\n\t\teasy.setFont(new Font(\"Arial Black\", 12));\n\t\teasy.setTextFill(Color.BLUE);\n\t\teasy.setFocusTraversable(false);\n\t\tButton medium = new Button(\"MEDIUM\");\n\t\tmedium.setFont(new Font(\"Arial Black\", 12));\n\t\tmedium.setTextFill(Color.BLUE);\n\t\tmedium.setFocusTraversable(false);\n\t\tButton hard = new Button(\"HARD\");\n\t\thard.setFont(new Font(\"Arial Black\", 12));\n\t\thard.setTextFill(Color.BLUE);\n\t\thard.setFocusTraversable(false);\n\t\tbuttonsPane.getChildren().addAll(easy, medium, hard);\n\t\tbuttonsPane.setMargin(easy, new Insets(10,5,5,5));\n\t\tbuttonsPane.setMargin(medium, new Insets(10,5,5,5));\n\t\tbuttonsPane.setMargin(hard, new Insets(10,5,5,5));\n\t\tbuttonsPane.setSpacing(20);\n\t\tbuttonsPane.setAlignment(Pos.CENTER);\n\t\tbuttonsPane.setStyle(\"-fx-background-color: gray;\");\n\t\teasy.setOnAction(new EasyHandler());\n\t\tmedium.setOnAction(new MediumHandler());\n\t\thard.setOnAction(new HardHandler());\n\t\tlabelsPane.getChildren().add(buttonsPane);\n\t}", "private JPanel createConfirmationButtons() {\r\n JPanel buttonPanel = new JPanel();\r\n buttonPanel.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n buttonPanel.setBorder(new EmptyBorder(5, 5, 5, 5));\r\n buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));\r\n JButton confirmButton = new JButton(\"Confirm\");\r\n confirmButton.addActionListener(event -> onConfirmButtonPressed());\r\n JButton cancelButton = new JButton(\"Cancel\");\r\n cancelButton.addActionListener(event -> onCancelButtonPressed());\r\n buttonPanel.add(confirmButton);\r\n buttonPanel.add(cancelButton);\r\n return buttonPanel;\r\n }", "@AutoGenerated\n\tprivate HorizontalLayout buildLayoutButtons() {\n\t\tlayoutButtons = new HorizontalLayout();\n\t\tlayoutButtons.setImmediate(false);\n\t\tlayoutButtons.setWidth(\"-1px\");\n\t\tlayoutButtons.setHeight(\"-1px\");\n\t\tlayoutButtons.setMargin(false);\n\t\t\n\t\t// btnSave\n\t\tbtnSave = new Button();\n\t\tbtnSave.setCaption(\"Salvar\");\n\t\tbtnSave.setImmediate(true);\n\t\tbtnSave.setWidth(\"-1px\");\n\t\tbtnSave.setHeight(\"-1px\");\n\t\tlayoutButtons.addComponent(btnSave);\n\t\t\n\t\t// btnCancel\n\t\tbtnCancel = new Button();\n\t\tbtnCancel.setCaption(\"Cancelar\");\n\t\tbtnCancel.setImmediate(true);\n\t\tbtnCancel.setWidth(\"-1px\");\n\t\tbtnCancel.setHeight(\"-1px\");\n\t\tlayoutButtons.addComponent(btnCancel);\n\t\t\n\t\treturn layoutButtons;\n\t}", "private void addButtons() {\r\n\t\troot.getChildren().add(button); // creating the Easy button \r\n\t\tb1 = new Button(\"Easy\");\r\n\t\tb1.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent ke) {\r\n\t\t\t\tdiff = \"Easy\";\r\n\t\t\t}\r\n\t\t});\r\n\t\troot.getChildren().add(b1); // creating the Normal button\r\n\t\tb2 = new Button(\"Normal\");\r\n\t\tb2.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent ke) {\r\n\t\t\t\tdiff = \"Normal\";\r\n\t\t\t}\r\n\t\t});\r\n\t\tb2.setLayoutX(50);\r\n\t\troot.getChildren().add(b2); // creating the Hard button\r\n\t\tb3 = new Button(\"Hard\");\r\n\t\tb3.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent ke) {\r\n\t\t\t\tdiff = \"Hard\";\r\n\t\t\t}\r\n\t\t});\r\n\t\tb3.setLayoutX(115);\r\n\t\troot.getChildren().add(b3);\r\n\t}", "private JPanel createConfirmButtons() {\n JPanel panel = new JPanel(new FlowLayout(FlowLayout.TRAILING));\n panel.add(createConfirmButton());\n panel.add(createCancelButton());\n\n return panel;\n }", "public JoystickButtonGroup(Button... buttons) {\n\t\t\tif (buttons.length < 2) {\n\t\t\t\tthis.close();\n\t\t\t} else {\n\t\t\t\tthis.buttons = (Button[]) buttons;\n\t\t\t}\n\t\t}", "private void createButtons() {\n\tTexture startGameTex = new Texture(\n\t\tGdx.files.internal(\"assets/data/menu/menu_start.png\"));\n\tTexture plane_p1_tex = new Texture(\n\t\tGdx.files.internal(\"assets/data/menu/menu_player1.png\"));\n\tTexture plane_p2_tex = new Texture(\n\t\tGdx.files.internal(\"assets/data/menu/menu_player2.png\"));\n\n\tplayButton = new Button(\"\", font, 0, 0, new TextureRegion(startGameTex,\n\t\t0, 0, 161, 20), new TextureRegion(startGameTex, 0, 0, 161, 20),\n\t\tnew ScreenSwitchHandler(Screen.GAME));\n\tplaneButton_p1 = new Button(\"\", font, 0, 0, new TextureRegion(\n\t\tplane_p1_tex, 0, 0, 161, 20), new TextureRegion(plane_p1_tex,\n\t\t0, 0, 161, 20), new ScreenSwitchHandler(Screen.PLANE_P1));\n\tplaneButton_p2 = new Button(\"\", font, 0, 0, new TextureRegion(\n\t\tplane_p2_tex, 0, 0, 161, 20), new TextureRegion(plane_p2_tex,\n\t\t0, 0, 161, 20), new ScreenSwitchHandler(Screen.PLANE_P2));\n\toptionsButton = new Button(\"Options\", font, new ScreenSwitchHandler(\n\t\tScreen.OPTIONS));\n\texitButton = new Button(\"Exit\", font, new ButtonHandler() {\n\t @Override\n\t public void onClick() {\n\t\tGdx.app.exit();\n\t }\n\n\t @Override\n\t public void onRelease() {\n\t\t// TODO Auto-generated method stub\n\n\t }\n\t});\n }", "private void createBeginningButtons() {\n\t createStartButtons(myResources.getString(\"game1\"), 0, 0);\n\t\tcreateStartButtons(myResources.getString(\"game2\"), 0, 1);\n\t\tcreateStartButtons(myResources.getString(\"game3\"), 0, 2);\n\t\tcreateStartButtons(myResources.getString(\"game4\"), 0, 3);\n\t\tcreateStartButtons(myResources.getString(\"game5\"), 0, 4);\n\t\tcreateInstructionButton();\n\t\tcreateStartingLabel();\n\t\tcreateGridSizeButton();\n }", "@Override\n\tprotected void createCompButtons() {\n\t\tbuildCompButtons();\n\t}", "private void addButtons(JPanel contentPanel, GridBagConstraints c) {\n JPanel buttonPanel = new JPanel();\n buttonPanel.setLayout(new GridBagLayout());\n GridBagConstraints gbc = new GridBagConstraints();\n\n JButton addButton = new JButton(buttonText);\n addButton.setFont(new Font(QuizAppUtilities.UI_FONT, Font.PLAIN, 16));\n addButton.addActionListener(new AddListener());\n buttonPanel.add(addButton, gbc);\n\n gbc.gridx = 1;\n gbc.insets = new Insets(0, 20, 0, 0);\n JButton cancelButton = new JButton(\"Cancel\");\n cancelButton.addActionListener(new CancelListener());\n cancelButton.setFont(new Font(QuizAppUtilities.UI_FONT, Font.PLAIN, 16));\n buttonPanel.add(cancelButton, gbc);\n\n c.gridy = 6;\n contentPanel.add(buttonPanel, c);\n }", "private Button createNewArrayButton(BorderPane root) {\n Button newArr = new Button(\"Generate New Array\");\n\n newArr.setOnMouseClicked(event -> {\n ((HBox) root.getTop()).getChildren().get(2).setDisable(false);\n ((HBox) root.getTop()).getChildren().get(3).setDisable(false);\n\n generateRandomHeights();\n root.setBottom(createSortingDisplay());\n });\n\n return newArr;\n }", "private void initButtons() {\n HBox buttons = new HBox(50);\n yes = new Button(\"Yes!\");\n no = new Button(\"No!\");\n buttons.getChildren().addAll(yes,no);\n buttons.setAlignment(Pos.CENTER);\n root.getChildren().addAll(buttons);\n }", "private void makeDayButtons() \n\t{\n\t\t\n\t\tSystem.out.println(monthMaxDays);\n\t\tfor (int i = 1; i <= monthMaxDays; i++) \n\t\t{\n\t\t\t//the first day starts from 1\n\t\t\tfinal int dayNumber = i;\n\t\t\t\n\t\t\t//create new button\n\t\t\tJButton day = new JButton(Integer.toString(dayNumber));\n\t\t\tday.setBackground(Color.WHITE);\n\t\n\t\t\t//attach a listener\n\t\t\tday.addActionListener(new \n\t\t\t\t\tActionListener() \n\t\t\t\t\t{\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent arg0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if button is pressed, highlight it \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}\n\t\t\t\t\t});\n\t\t\t\n\t\t\t//add this button to the day button ArrayList\n\t\t\tbuttonArray.add(day);\n\t\t}\n\t}", "private void crearBotones() {\n\t\tJButton botonTropa;\n\t\tArrayList<Tropa> tropasJugador = getJuego().getTurnoActual().getJugador().getTropas();\n\t\tint posicion = 0;\n\t\tfor (int i = 0; i < CANTIDADBOTONES; ++i) {\n\t\t\tif (tropasJugador.size() > i && !tropasJugador.get(i).isEnJuego()) {\n\t\t\t\tbotonTropa = new JButton(\" \" + tropasJugador.get(i).getNombre());\n\t\t\t\tponerIconosBotones(botonTropa, tropasJugador.get(i).getNombre());\n\n\t\t\t} else if (tropasJugador.size() > i && tropasJugador.get(i).isEnJuego()) {\n\t\t\t\tbotonTropa = new JButton(\" \" + tropasJugador.get(i).getNombre() + \" (En juego)\");\n\t\t\t\tponerIconosBotones(botonTropa, tropasJugador.get(i).getNombre());\n\t\t\t\tbotonTropa.setEnabled(false);\n\t\t\t} else {\n\t\t\t\tposicion = i + 1;\n\t\t\t\tbotonTropa = new JButton(\"Tropa \" + posicion);\n\t\t\t\tbotonTropa.setEnabled(false);\n\t\t\t}\n\n\t\t\tbotones.add(botonTropa);\n\t\t\tpanelBotones.add(botonTropa);\n\t\t}\n\t}", "public void buildButtons() {\r\n\t\tImage temp1= display_img.getImage();\r\n\t\tImageIcon img=new ImageIcon(temp1.getScaledInstance(800, 800, Image.SCALE_SMOOTH));\r\n\t\timg1 = img.getImage();\r\n\t\tfor(int y=0;y<10;y++) {\r\n\t\t\tfor(int x=0; x<10; x++) {\r\n\t\t\t\tImage image = Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(img1.getSource(), new CropImageFilter(x * 800 / 10, y * 800 / 10, 100, 100)));\r\n\t\t\t\tImageIcon icon = new ImageIcon(image);\r\n\t\t\t\tJButton temp = new JButton(icon);\r\n\t\t\t\ttemp.putClientProperty(\"position\", new Point(y,x));\r\n\t\t\t\tsolutions.add(new Point(y,x));\r\n\t\t\t\ttemp.putClientProperty(\"isLocked\", false);\r\n\t\t\t\ttemp.addMouseListener(new DragMouseAdapter());\r\n\t\t\t\tgrid[x][y]=temp;\r\n\r\n\t\t\t\tbuttons.add(temp);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void createButton() throws SlickException {\n int width = 25*getGameContainer().getWidth()/100;\n int height = 10*getGameContainer().getHeight()/100;\n\n Image login = new Image(getReaderXmlFile().read(\"buttonLogin\")).getScaledCopy(width, height);\n Coordinate posLogin = new Coordinate((getGameContainer().getWidth() - login.getWidth())/2,55*getGameContainer().getHeight()/100);\n loginButton = new Button(getGameContainer(), login, posLogin, IDStates.MENU_STATE, this);\n\n Image account = new Image(getReaderXmlFile().read(\"buttonAccount\")).getScaledCopy(width, height);\n Coordinate posAccount = new Coordinate((getGameContainer().getWidth() - account.getWidth())/2,70*getGameContainer().getHeight()/100);\n accountButton = new Button(getGameContainer(), account, posAccount, IDStates.MENU_STATE, this);\n }", "private void createButton() {\n\t\tbtnAddTask = new JButton(\"Add Task\");\n\t\tbtnSave = new JButton(\"Save\");\n\t\tbtnCancel = new JButton(\"Cancel\");\n\n\t\tbtnAddTask.addActionListener(new ToDoAction());\n\t\tbtnSave.addActionListener(new ToDoAction());\n\t\tbtnCancel.addActionListener(new ToDoAction());\n\t}", "private Button[] createButtonsAndLMessage() {\n\t\t\n\t\t// local buttom\n\t\tButton launchLocal = new Button(\"Launch Local Game\");\n\t\tlaunchLocal.setMaxWidth(Double.MAX_VALUE);\n\t\tlaunchLocal.setAlignment(Pos.CENTER);\n\t\tlaunchLocal.autosize();\n\t\tlaunchLocal.setOnAction(e -> {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(checkingAllArguments()) {\n\t\t\t\t\tmenuMessage.setText(\"Game will start soon...\");\n\t\t\t\t\tlaunchLocal(new Stage());\n\t\t\t\t}\n\t\t\t } catch (Exception exception) { \n\t\t\t\t menuMessage.setText(\"Can't launch a local game : either a IP Address of a remote player is wrong or you didn't select 4 players\");\n\t\t\t } \n\t\t \n\t\t});\n\t\t\n\t\t// remote button\n\t\tButton launchRemote = new Button(\"Launch Remote Game\");\n\t\tlaunchRemote.setMaxWidth(Double.MAX_VALUE);\n\t\tlaunchRemote.setAlignment(Pos.CENTER);\n\t\tlaunchRemote.autosize();\n\t\tlaunchRemote.setOnAction(e -> { \n\t\t\t\n\t\t\ttry {\n\t\t\t\tmenuMessage.setText(\"Game will start as soon as the client is connected...\");\n\t\t\t\tlaunchRemote(new Stage());\n\t\t\t } catch (Exception exception) { \n\t\t\t\tmenuMessage.setText(\"Can't launch a remote game : Check your internet connection\");\n\t\t\t } \n\t\t}); \n\t\t\n\t\tButton[] toReturn = {launchLocal, launchRemote};\n\t\treturn toReturn;\n\t}", "private JPanel createConfirmButtonsPanel() {\n JPanel p = new JPanel(new FlowLayout());\n p.add(createConfirmButton());\n p.add(createCancelButton());\n \n return p;\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void addSingleplayerMultiplayerButtons() {\n\t\tthis.buttonList.add(new GuiButton(1, 4, 3, 60, 20, I18n.format(\"menu.singleplayer\", new Object[0])));\n\t\tthis.buttonList.add(new GuiButton(2, 70, 3, 50, 20, I18n.format(\"menu.multiplayer\", new Object[0])));\n\t\tthis.buttonList.add(new GuiButton(14, 126, 3, 60, 20, \"§bResilient§r\"));\n\n\t}", "@AutoGenerated\r\n\tprivate HorizontalLayout buildButtonsLayout()\r\n\t{\n\t\tbuttonsLayout = new HorizontalLayout();\r\n\t\tbuttonsLayout.setImmediate(false);\r\n\t\tbuttonsLayout.setWidth(\"-1px\");\r\n\t\tbuttonsLayout.setHeight(\"-1px\");\r\n\t\tbuttonsLayout.setMargin(false);\r\n\t\tbuttonsLayout.setSpacing(true);\r\n\t\t\r\n\t\t// addButton\r\n\t\taddButton = new Button();\r\n\t\taddButton.setCaption(\"Add...\");\r\n\t\taddButton.setImmediate(true);\r\n\t\taddButton.setWidth(\"100px\");\r\n\t\taddButton.setHeight(\"-1px\");\r\n\t\tbuttonsLayout.addComponent(addButton);\r\n\t\t\r\n\t\t// editButton\r\n\t\teditButton = new Button();\r\n\t\teditButton.setCaption(\"Edit...\");\r\n\t\teditButton.setImmediate(true);\r\n\t\teditButton.setWidth(\"100px\");\r\n\t\teditButton.setHeight(\"-1px\");\r\n\t\tbuttonsLayout.addComponent(editButton);\r\n\t\t\r\n\t\t// deleteButton\r\n\t\tdeleteButton = new Button();\r\n\t\tdeleteButton.setCaption(\"Delete...\");\r\n\t\tdeleteButton.setImmediate(true);\r\n\t\tdeleteButton.setWidth(\"100px\");\r\n\t\tdeleteButton.setHeight(\"-1px\");\r\n\t\tbuttonsLayout.addComponent(deleteButton);\r\n\t\t\r\n\t\treturn buttonsLayout;\r\n\t}", "private void createbuttons(){\n newPatient = (Button) findViewById(R.id.newButton);\n newPatient.setOnClickListener(buttonClick);\n\n registeredPatient = (Button) findViewById(R.id.registeredButton);\n registeredPatient.setOnClickListener(buttonClick);\n\n viewManagement = (Button) findViewById(R.id.viewStaffActivitiesButton);\n viewManagement.setOnClickListener(buttonClick);\n }", "private void createButtons(GridBagConstraints gridBagConstraints) {\n\t\tgridBagConstraints.gridx = 0;\n\t\tgridBagConstraints.gridy = 3;\n\t\tfileInputPanel.add(evolveButton, gridBagConstraints);\n\n\t\tgridBagConstraints.gridx = 1;\n\t\tgridBagConstraints.gridy = 3;\n\t\tfileInputPanel.add(simulateButton, gridBagConstraints);\n\t}", "private void setupButtons() {\n for (int i = 0; i < players.size(); i++) {\n final int j = i + 1;\n players.get(i).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n buttonPushed(j);\n }\n });\n }\n }", "@Test\n\tpublic void addButtons_2Test() throws Exception {\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.skins &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showcover &&\n\t\t\t\t!Configuration.reorderplaylist && \n\t\t\t\t!Configuration.queuetrack &&\n\t\t\t\tConfiguration.clearplaylist ) {\n\t\t\tstart();\n\t\t\t\n\t\t\tgui.addButtons();\n\t\t\tJFrame g = (JFrame) MemberModifier.field(Application.class, \"frmAsd\").get(gui);\n\t\t\tJButton button =null;\n\t\t\t\n\t\t\tfor (int i = 0; i < g.getContentPane().getComponentCount(); i++) {\n\t\t\t\tif(g.getContentPane().getComponent(i).getName()!= null && g.getContentPane().getComponent(i).getName().equals(\"clearList\")) {\n\t\t\t\t\tbutton = (JButton) g.getContentPane().getComponent(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tassertTrue(button.getBounds().getX() == 361);\n\t\t\tassertTrue(button.getBounds().getY() == 324);\n\t\t\tassertTrue(button.getBounds().getWidth() == 111);\n\t\t\tassertTrue(button.getBounds().getHeight() == 23);\n\t\t\tassertTrue(button.getActionListeners()!= null);\n\t\t\t\n\t\t\t}\n\t}", "@Override\n\tprotected void createButtonsForButtonBar(Composite parent)\n\t{\n\t\tButton button_1 = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,\n\t\t\t\ttrue);\n\t\tbutton_1.setText(\"Ja\");\n\t\tButton button = createButton(parent, IDialogConstants.CANCEL_ID,\n\t\t\t\tIDialogConstants.CANCEL_LABEL, false);\n\t\tbutton.setText(\"Nein\");\n\t}", "public HBox hbButtons() {\r\n\r\n HBox hbBottom = new HBox(10); //HBox for buttons at the bottom\r\n\r\n hbBottom.setAlignment(Pos.CENTER); //Set Buttoms to center\r\n hbBottom.setPadding(new Insets(10, 1, 1, 1)); //Padd it\r\n\r\n //SetId\r\n btnConfirm.setId(\"btn\");\r\n btnEdit.setId(\"btn\");\r\n\r\n //Add buttons to the bottom HBox\r\n hbBottom.getChildren().addAll(btnConfirm, btnEdit);\r\n\r\n //Handlers\r\n btnConfirm.setOnAction(new ConfirmHandler()); //Handler for confirm\r\n btnEdit.setOnAction(new EditHandler()); //Handler for edit\r\n\r\n return hbBottom;\r\n\r\n }", "Button createButton();", "private void addSingleplayerMultiplayerButtons(int p_73969_1_, int p_73969_2_)\r\n\t{\r\n\t\tthis.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_, I18n.format(\"menu.singleplayer\")));\r\n\t\tthis.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.format(\"menu.multiplayer\")));\r\n\t\tthis.buttonList.add(modButton = new GuiButton(6, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.format(\"fml.menu.mods\")));\r\n\t\tRandomTexture = (int) (Math.random() * 3 + 1);\r\n\r\n\t}", "protected void drawButtons() {\n\t\tint spaceX = 50;\n\t\tint spaceY = 500;\t\n\t\t\n\t\tint aux = 1;\n\t\tfor(int i = 65; i < 91; i++) {\n\n\t\t\tLetterButton button = new LetterButton((char) i, (25 + spaceX ) * aux, spaceY);\n\t\t\taux++;\n\t\t\tif(aux == 14) {\n\t\t\t\tspaceY += 25 + 50;\n\t\t\t\taux = 1;\n\t\t\t}\n\t\t\tthis.add(button);\n\t\t}\n\t\t\n\t}", "public GridPane lobbyButtons() {\n GridPane gridPane = new GridPane();\n Button createButton;\n Button joinButton;\n Button chatButton;\n Button leaderboardButton;\n\n gridPane.setAlignment(Pos.CENTER);\n gridPane.setVgap(10);\n gridPane.setHgap(10);\n gridPane.setPadding(new Insets(10));\n\n createButton = new Button(\"Create game\");\n createButton.setAlignment(Pos.CENTER);\n int buttonWIDTH = 150;\n int buttonHEIGHT = 100;\n createButton.setPrefSize(buttonWIDTH, buttonHEIGHT);\n createButton.setOnAction(event -> new CreateGameGUI().start(stage, this, socket));\n\n joinButton = new Button(\"Join game\");\n joinButton.setAlignment(Pos.CENTER);\n joinButton.setPrefSize(buttonWIDTH, buttonHEIGHT);\n joinButton.setOnAction(event -> new JoinGameGUI().start(stage, this, socket));\n\n chatButton = new Button(\"Chat\");\n chatButton.setAlignment(Pos.CENTER);\n chatButton.setPrefSize(buttonWIDTH, buttonHEIGHT);\n chatButton.setOnAction(event -> ChatGUI());\n\n leaderboardButton = new Button(\"Leaderboard\");\n leaderboardButton.setAlignment(Pos.CENTER);\n leaderboardButton.setPrefSize(buttonWIDTH, buttonHEIGHT);\n leaderboardButton.setOnAction(event -> new LeaderboardGUI().start(stage, this, socket));\n\n gridPane.add(createButton, 0, 0);\n gridPane.add(joinButton, 1, 0);\n gridPane.add(chatButton, 2, 0);\n gridPane.add(leaderboardButton, 1, 1);\n\n return gridPane;\n }", "private void initPanelButtons() {\r\n\t\tthis.panelButtons = new JPanel(new GridBagLayout());\r\n\t\tthis.panelButtons.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 5));\r\n\t\tthis.panelButtons.setOpaque(false);\r\n\t\tGridBagConstraints gbc = new GridBagConstraints();\r\n\r\n\t\tgbc.gridx = 0;\r\n\t\tgbc.gridy = 0;\r\n\t\tgbc.gridwidth = 1;\r\n\t\tgbc.gridheight = 1;\r\n\t\tgbc.weightx = 1;\r\n\t\tgbc.weighty = 1;\r\n\t\tthis.returnButton.setBackground(ConstantView.COLOR_BUTTON_LOGIN);\r\n\t\tthis.returnButton.setForeground(Color.WHITE);\r\n\t\tthis.returnButton.setFocusable(false);\r\n\t\tthis.returnButton.setCursor(new Cursor(Cursor.HAND_CURSOR));\r\n\t\tthis.returnButton.setFont(ConstantView.FONT_PRINCIPAL_LABELS);\r\n\t\tthis.panelButtons.add(returnButton, gbc);\r\n\r\n\t\tgbc.gridx = 7;\r\n\t\tthis.okButton.setBackground(ConstantView.COLOR_BUTTON_LOGIN);\r\n\t\tthis.okButton.setForeground(Color.WHITE);\r\n\t\tthis.okButton.setFocusable(false);\r\n\t\tthis.okButton.setCursor(new Cursor(Cursor.HAND_CURSOR));\r\n\t\tthis.okButton.setFont(ConstantView.FONT_PRINCIPAL_LABELS);\r\n\t\tthis.okButton.addActionListener(ControlClient.getInstance());\r\n\t\tthis.okButton.setActionCommand(ClientCommands.OK_SIGN_IN.toString());\r\n\t\tthis.panelButtons.add(okButton, gbc);\r\n\t}", "private void createButtons() {\n Button helpSettingsButton = new Button(\"\",\n new Button.ClickListener() {\n private static final long serialVersionUID = -5797923866320649518L;\n\n @Override\n public void buttonClick(ClickEvent event) {\n settingsPresenter.navigateToHelp();\n }\n });\n\n// Button skillSettingsButton = new Button(\"\",\n// new Button.ClickListener() {\n// private static final long serialVersionUID = 7147554466396214893L;\n//\n// @Override\n// public void buttonClick(ClickEvent event) {\n// settingsPresenter.navigateToSkills();\n// }\n// });\n// skillSettingsButton.addStyleName(\"icon-cog\");\n\n Button medicSettingsButton = new Button(\"\",\n new Button.ClickListener() {\n private static final long serialVersionUID = 7147554466396214893L;\n\n @Override\n public void buttonClick(ClickEvent event) {\n settingsPresenter.navigateToMedic();\n }\n });\n\n\n Button logoutButton = new Button(\"\",\n new Button.ClickListener() {\n private static final long serialVersionUID = -1096188732209266611L;\n\n @Override\n public void buttonClick(ClickEvent event) {\n settingsPresenter.navigateBack();\n }\n });\n logoutButton.addStyleName(\"default\");\n\n // Adding and aligning the 3 Buttons.\n //Setting a Description for the buttons which is displayed when flying over the button\n super.verticalNavigation.addComponent(helpSettingsButton);\n super.verticalNavigation.setComponentAlignment(helpSettingsButton, Alignment.MIDDLE_CENTER);\n helpSettingsButton.setDescription(\"Set the Help options for the Patient\");\n helpSettingsButton.setIcon(new ThemeResource(\"img/contacgg.png\"), BUTTON_HELP_SETTINGS);\n helpSettingsButton.setWidth(BUTTON_WIDTH);\n helpSettingsButton.setHeight(BUTTON_HEIGHT);\n\n super.verticalNavigation.addComponent(medicSettingsButton);\n super.verticalNavigation.setComponentAlignment(medicSettingsButton, Alignment.MIDDLE_CENTER);\n medicSettingsButton.setDescription(\"Set the Medication options for the Patient\");\n medicSettingsButton.setIcon(new ThemeResource(\"img/medicine-icon-cog.png\"),BUTTON_MEDIC_SETTINGS);\n medicSettingsButton.setWidth(BUTTON_WIDTH);\n medicSettingsButton.setHeight(BUTTON_HEIGHT);\n\n// addComponent(skillSettingsButton);\n// setComponentAlignment(skillSettingsButton, Alignment.MIDDLE_CENTER);\n// skillSettingsButton.setDescription(\"Set the Skill options for the Patient\");\n// skillSettingsButton.setIcon(new ThemeResource(\"img/skill2-icon-cog.png\"), BUTTON_SKILL_SETTINGS);\n// skillSettingsButton.setWidth(BUTTON_WIDTH);\n// skillSettingsButton.setHeight(BUTTON_HEIGHT);\n\n logoutButton.setWidth(BUTTON_WIDTH);\n super.verticalNavigation.addComponent(logoutButton);\n super.verticalNavigation.setComponentAlignment(logoutButton, Alignment.MIDDLE_CENTER);\n logoutButton.setDescription(\"You will be logged out\");\n logoutButton.setIcon(new ThemeResource(\"img/logout.png\"), BUTTON_LOGOUT);\n logoutButton.setWidth(BUTTON_WIDTH);\n logoutButton.setHeight(BUTTON_HEIGHT);\n\n }", "private void createButtonPanel()\r\n { \r\n JPanel buttonPanel = new JPanel();\r\n buttonPanel.setLayout(new GridLayout(4, 4));\r\n\r\n buttonPanel.add(makeDigitButton(\"7\"));\r\n buttonPanel.add(makeDigitButton(\"8\"));\r\n buttonPanel.add(makeDigitButton(\"9\"));\r\n buttonPanel.add(makeOperatorButton(\"/\"));\r\n buttonPanel.add(makeDigitButton(\"4\"));\r\n buttonPanel.add(makeDigitButton(\"5\"));\r\n buttonPanel.add(makeDigitButton(\"6\"));\r\n buttonPanel.add(makeOperatorButton(\"*\"));\r\n buttonPanel.add(makeDigitButton(\"1\"));\r\n buttonPanel.add(makeDigitButton(\"2\"));\r\n buttonPanel.add(makeDigitButton(\"3\"));\r\n buttonPanel.add(makeOperatorButton(\"-\"));\r\n buttonPanel.add(makeDigitButton(\"0\"));\r\n buttonPanel.add(makeDigitButton(\".\"));\r\n buttonPanel.add(makeOperatorButton(\"=\"));\r\n buttonPanel.add(makeOperatorButton(\"+\"));\r\n\r\n add(buttonPanel, BorderLayout.CENTER);\r\n }", "private void refreshButtons() {\n flowPane.getChildren().clear();\n\n for(String testName : Files.listTests()) {\n TestJson info;\n try {\n info = TestParser.read(testName);\n } catch(FileNotFoundException e) {\n continue; /* Skip */\n }\n\n JFXButton button = new JFXButton(testName);\n button.pseudoClassStateChanged(PseudoClass.getPseudoClass(\"select-button\"), true);\n\n button.setOnAction(e -> buttonPressed(info));\n\n if(!filter(info, button))\n continue;\n\n // If this model asked to be put in a specific place, put it there\n if(!info.custom && info.order >= 0)\n flowPane.getChildren().add(Math.min(info.order, flowPane.getChildren().size()), button);\n else\n flowPane.getChildren().add(button);\n }\n }", "private void createBottomButtons() {\n // Create a composite that will contain the control buttons.\n Composite bottonBtnComposite = new Composite(shell, SWT.NONE);\n GridLayout gl = new GridLayout(3, true);\n gl.horizontalSpacing = 10;\n bottonBtnComposite.setLayout(gl);\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n bottonBtnComposite.setLayoutData(gd);\n\n // Create the Interpolate button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n interpolateBtn = new Button(bottonBtnComposite, SWT.PUSH);\n interpolateBtn.setText(\"Interpolate\");\n interpolateBtn.setLayoutData(gd);\n interpolateBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n ColorData upperColorData = upperColorWheel.getColorData();\n ColorData lowerColorData = lowerColorWheel.getColorData();\n\n colorBar.interpolate(upperColorData, lowerColorData, rgbRdo\n .getSelection());\n undoBtn.setEnabled(true);\n updateColorMap();\n }\n });\n\n // Create the Undo button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n undoBtn = new Button(bottonBtnComposite, SWT.PUSH);\n undoBtn.setText(\"Undo\");\n undoBtn.setEnabled(false);\n undoBtn.setLayoutData(gd);\n undoBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n undoBtn.setEnabled(colorBar.undoColorBar());\n updateColorMap();\n redoBtn.setEnabled(true);\n }\n });\n\n // Create the Redo button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n redoBtn = new Button(bottonBtnComposite, SWT.PUSH);\n redoBtn.setText(\"Redo\");\n redoBtn.setEnabled(false);\n redoBtn.setLayoutData(gd);\n redoBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n redoBtn.setEnabled(colorBar.redoColorBar());\n updateColorMap();\n undoBtn.setEnabled(true);\n }\n });\n\n // Create the Revert button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n revertBtn = new Button(bottonBtnComposite, SWT.PUSH);\n revertBtn.setText(\"Revert\");\n revertBtn.setLayoutData(gd);\n revertBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n colorBar.revertColorBar();\n updateColorMap();\n undoBtn.setEnabled(false);\n redoBtn.setEnabled(false);\n }\n });\n\n // Create the Save button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n saveBtn = new Button(bottonBtnComposite, SWT.PUSH);\n saveBtn.setText(\"Save\");\n saveBtn.setLayoutData(gd);\n if( seldCmapName == null ) {\n saveBtn.setEnabled(false);\n }\n \n saveBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n ColorMap cm = (ColorMap) cmapParams.getColorMap();\n seldCmapName = selCmapCombo.getText();\n \n// int sepIndx = seldCmapName.indexOf(File.separator);\n// String cmapCat = seldCmapName.substring(0,seldCmapName.indexOf(File.separator));\n// String cmapName = seldCmapName.substring( seldCmapName.indexOf(File.separator));\n if (lockedCmaps != null && lockedCmaps.isLocked(seldCmapName)) {\n \tMessageDialog confirmDlg = new MessageDialog( \n \t\t\tNcDisplayMngr.getCaveShell(), \n \t\t\t\"Save Colormap\", null, \n \t\t\t\"Colormap \" +seldCmapCat+File.separator +seldCmapName + \n \t\t\t\" already exists and is locked.\\n\\n\" +\n \t\t\t\"You cannot overwrite it.\",\n \t\t\tMessageDialog.INFORMATION, new String[]{\"OK\"}, 0);\n \tconfirmDlg.open();\n \tcolorBar.undoColorBar();\n updateColorMap();\n \treturn;\n } \n else if( ColorMapUtil.colorMapExists( seldCmapCat, seldCmapName ) ) {\n \tMessageDialog confirmDlg = new MessageDialog( \n \t\t\tNcDisplayMngr.getCaveShell(), \n \t\t\t\"Save Colormap\", null, \n \t\t\t\"Colormap \" +seldCmapCat+File.separator +seldCmapName + \n \t\t\t\" already exists.\\n\\n\" +\n \t\t\t\"Do you want to overwrite it?\",\n \t\t\tMessageDialog.QUESTION, new String[]{\"Yes\", \"No\"}, 0);\n \tconfirmDlg.open();\n\n \tif( confirmDlg.getReturnCode() == MessageDialog.CANCEL ) {\n \t\treturn;\n \t}\n }\n\n try {\n ColorMapUtil.saveColorMap( cm, seldCmapCat, seldCmapName );\n \n MessageDialog msgDlg = new MessageDialog( \n \t\t\tNcDisplayMngr.getCaveShell(), \n \t\t\t\"Colormap Saved\", null, \n \t\t\t\"Colormap \" +seldCmapCat+File.separator +seldCmapName + \n \t\t\t\" Saved.\",\n \t\t\tMessageDialog.INFORMATION, new String[]{\"OK\"}, 0);\n \tmsgDlg.open();\n } catch (VizException e) {\n MessageDialog msgDlg = new MessageDialog( \n \t\t\tNcDisplayMngr.getCaveShell(), \n \t\t\t\"Error\", null, \n \t\t\t\"Error Saving Colormap \" +seldCmapCat+File.separator +seldCmapName + \n \t\t\t\"\\n\"+e.getMessage(),\n \t\t\tMessageDialog.ERROR, new String[]{\"OK\"}, 0);\n \tmsgDlg.open();\n }\n\n completeSave();\n }\n });\n\n\n // \n // Create the Delete button.\n gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.grabExcessHorizontalSpace = false;\n deleteBtn = new Button(bottonBtnComposite, SWT.PUSH);\n deleteBtn.setText(\"Delete\");\n deleteBtn.setLayoutData(gd);\n deleteBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n \tdeleteColormap();\n }\n });\n Label sep = new Label(shell, SWT.SEPARATOR|SWT.HORIZONTAL);\n gd = new GridData(GridData.FILL_HORIZONTAL);\n sep.setLayoutData(gd);\n\n // \n // Create the Delete button.\n gd = new GridData(GridData.HORIZONTAL_ALIGN_END);\n Button closeBtn = new Button(shell, SWT.PUSH);\n closeBtn.setText(\" Close \");\n closeBtn.setLayoutData(gd);\n closeBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n \tshell.dispose();\n }\n });\n }", "@Override\n protected void createButtonsForButtonBar(final Composite parent) {\n\n GridLayout layout = (GridLayout) parent.getLayout();\n layout.marginHeight = 0;\n }", "@Override\n protected void addButtons()\n {\n JLabel agentOptions = new JLabel(\"Client Options \", SwingConstants.CENTER);\n addComponentToGridBag(this, agentOptions, 0, 0, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH);\n\n JButton agentSendMessage = new JButton(\"Send Message\");\n addComponentToGridBag(this, agentSendMessage, 0, 2, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH);\n agentSendMessage.addActionListener((ActionEvent e) ->\n {\n String to = getTo();\n String content = getContent(to);\n sendMessage(to, content);\n });\n\n JButton agentShowPortal = new JButton(\"Show Portal\");\n addComponentToGridBag(this, agentShowPortal, 0, 3, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH);\n agentShowPortal.addActionListener((ActionEvent e) ->\n {\n displayConnections();\n });\n\n JButton agentexit = new JButton(\"Exit\");\n addComponentToGridBag(this, agentexit, 0, 5, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH);\n agentexit.addActionListener((ActionEvent e) ->\n {\n System.exit(0);\n });\n }", "private void createOKButtons() {\n okAddButton = addOKButton(\"Add Shape\");\n okRemoveButton = addOKButton(\"Remove Shape\");\n okAddKeyframeButton = addOKButton(\"Add Keyframe\");\n okAddKeyframeTimeButton = addOKButton(\"Add Keyframe Time\");\n okRemoveKeyframeButton = addOKButton(\"Remove Keyframe\");\n okRemoveKeyframeTimeButton = addOKButton(\"Remove Keyframe Time\");\n okEditKeyframeButton = addOKButton(\"Edit Keyframe\");\n okEditKeyframeTimeButton = addOKButton(\"Edit Keyframe Time\");\n okEditKeyframeFinalButton = addOKButton(\"Edit Keyframe Final\");\n okClearShapeButton = addOKButton(\"Clear Shape\");\n }", "public void addKeys() {\n\t\tbtnDot = new JButton(\".\");\n\t\tbtnDot.setBounds(42, 120, 40, 40);\n\t\tthis.add(btnDot); //Handle case\n\t\t\n\t\tbtn0 = new JButton(\"0\");\n\t\tbtn0.setBounds(81, 120, 40, 40);\n\t\tthis.add(btn0);\n\t\tnumberButtonList = new ArrayList<JButton>(10);\n\t\tnumberButtonList.add(btn0);\n\t\t\n\t\tbtnC = new JButton(\"C\");\n\t\tbtnC.setBounds(120, 120, 40, 40);\n\t\tthis.add(btnC);\n\t\t\n\t\tbtnStar = new JButton(\"*\");\n\t\tbtnStar.setBounds(159, 120, 40, 40);\n\t\tthis.add(btnStar);\n\t\toperationButtonList = new ArrayList<JButton>(10);\n\t\toperationButtonList.add(btnStar);\n\t\t\n\t\tbtnPi = new JButton(\"π\");\n\t\tbtnPi.setBounds(198, 120, 40, 40);\n\t\tthis.add(btnPi);\n\t\t//numberButtonList.add(btnPi); //Special case\n\t\tvalueButtons.add(btnPi);\n\t\t\n\t\tbtnLn = new JButton(\"ln\");\n\t\tbtnLn.setBounds(237, 120, 40, 40);\n\t\tthis.add(btnLn);\n\t\tresultOperations.add(btnLn);\n\t\t\n\t\t//Row 2\n\t\t\n\t\tbtn3 = new JButton(\"3\");\n\t\tbtn3.setBounds(42, 80, 40, 40);\n\t\tthis.add(btn3);\n\t\tnumberButtonList.add(btn3);\n\t\t\n\t\tbtn2 = new JButton(\"2\");\n\t\tbtn2.setBounds(81, 80, 40, 40);\n\t\tthis.add(btn2);\n\t\tnumberButtonList.add(btn2);\n\t\t\n\t\tbtn1 = new JButton(\"1\");\n\t\tbtn1.setBounds(120, 80, 40, 40);\n\t\tthis.add(btn1);\n\t\tnumberButtonList.add(btn1);\n\t\t\n\t\tbtnDivide = new JButton(\"/\");\n\t\tbtnDivide.setBounds(159, 80, 40, 40);\n\t\tthis.add(btnDivide);\n\t\toperationButtonList.add(btnDivide);\n\t\t\n\t\tbtnE = new JButton(\"e\");\n\t\tbtnE.setBounds(198, 80, 40, 40);\n\t\tthis.add(btnE);\n\t\tvalueButtons.add(btnE);\n\t\t//numberButtonList.add(btnE); //Special case\n\t\t\n\t\tbtnTan = new JButton(\"tan\");\n\t\tbtnTan.setBounds(237, 80, 40, 40);\n\t\tthis.add(btnTan);\n\t\tresultOperations.add(btnTan);\n\t\t\n\t\t//Row 3\n\t\t\n\t\tbtn6 = new JButton(\"6\");\n\t\tbtn6.setBounds(42, 40, 40, 40);\n\t\tthis.add(btn6);\n\t\tnumberButtonList.add(btn6);\n\t\t\n\t\tbtn5 = new JButton(\"5\");\n\t\tbtn5.setBounds(81, 40, 40, 40);\n\t\tthis.add(btn5);\n\t\tnumberButtonList.add(btn5);\n\t\t\n\t\tbtn4 = new JButton(\"4\");\n\t\tbtn4.setBounds(120, 40, 40, 40);\n\t\tthis.add(btn4);\n\t\tnumberButtonList.add(btn4);\n\t\t\n\t\tbtnMinus = new JButton(\"-\");\n\t\tbtnMinus.setBounds(159, 40, 40, 40);\n\t\tthis.add(btnMinus);\n\t\toperationButtonList.add(btnMinus);\n\t\t\n\t\tbtnSqRt = new JButton(\"√\");\n\t\tbtnSqRt.setBounds(198, 40, 40, 40);\n\t\tthis.add(btnSqRt);\n\t\tresultOperations.add(btnSqRt);\n\t\t\n\t\tbtnCos = new JButton(\"cos\");\n\t\tbtnCos.setBounds(237, 40, 40, 40);\n\t\tthis.add(btnCos);\n\t\tresultOperations.add(btnCos);\n\t\t\n\t\t//Row 4\n\t\t\n\t\tbtn9 = new JButton(\"9\");\n\t\tbtn9.setBounds(42, 0, 40, 40);\n\t\tthis.add(btn9);\n\t\tnumberButtonList.add(btn9);\n\t\t\n\t\tbtn8 = new JButton(\"8\");\n\t\tbtn8.setBounds(81, 0, 40, 40);\n\t\tthis.add(btn8);\n\t\tnumberButtonList.add(btn8);\n\t\t\n\t\tbtn7 = new JButton(\"7\");\n\t\tbtn7.setBounds(120, 0, 40, 40);\n\t\tthis.add(btn7);\n\t\tnumberButtonList.add(btn7);\n\t\t\n\t\tbtnPlus = new JButton(\"+\");\n\t\tbtnPlus.setBounds(159, 0, 40, 40);\n\t\tthis.add(btnPlus);\n\t\toperationButtonList.add(btnPlus);\n\t\t\n\t\tbtnPower = new JButton(\"^\");\n\t\tbtnPower.setBounds(198, 0, 40, 40);\n\t\tthis.add(btnPower);\n\t\toperationButtonList.add(btnPower);\n\t\t\n\t\tbtnSin = new JButton(\"sin\");\n\t\tbtnSin.setBounds(237, 0, 40, 40);\n\t\tthis.add(btnSin);\n\t\tresultOperations.add(btnSin);\n\t}", "protected void createButtons(Composite parent) {\n\t\tcomRoot = new Composite(parent, SWT.BORDER);\n\t\tcomRoot.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));\n\t\tcomRoot.setLayout(new GridLayout(2, false));\n\n\t\ttbTools = new ToolBar(comRoot, SWT.WRAP | SWT.RIGHT | SWT.FLAT);\n\t\ttbTools.setLayout(new GridLayout());\n\t\ttbTools.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, true, false));\n\n\t\tfinal ToolItem btnSettings = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnSettings.setText(Messages.btnAdvancedSettings);\n\t\tbtnSettings.setToolTipText(Messages.tipAdvancedSettings);\n\t\tbtnSettings.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tPerformanceSettingsDialog dialog = new PerformanceSettingsDialog(\n\t\t\t\t\t\tgetShell(), getMigrationWizard().getMigrationConfig());\n\t\t\t\tdialog.open();\n\t\t\t}\n\t\t});\n\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\t\tbtnPreviewDDL = new ToolItem(tbTools, SWT.CHECK);\n\t\tbtnPreviewDDL.setSelection(false);\n\t\tbtnPreviewDDL.setText(Messages.btnPreviewDDL);\n\t\tbtnPreviewDDL.setToolTipText(Messages.tipPreviewDDL);\n\t\tbtnPreviewDDL.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tboolean flag = btnPreviewDDL.getSelection();\n\t\t\t\tswitchText(flag);\n\t\t\t}\n\t\t});\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\n\t\tfinal ToolItem btnExportScript = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnExportScript.setText(Messages.btnExportScript);\n\t\tbtnExportScript.setToolTipText(Messages.tipSaveScript);\n\t\tbtnExportScript.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\texportScriptToFile();\n\t\t\t}\n\t\t});\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\t\tfinal ToolItem btnUpdateScript = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnUpdateScript.setText(Messages.btnUpdateScript);\n\t\tbtnUpdateScript.setToolTipText(Messages.tipUpdateScript);\n\t\tbtnUpdateScript.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tprepare4SaveScript();\n\t\t\t\tgetMigrationWizard().saveMigrationScript(false, isSaveSchema());\n\t\t\t\tMessageDialog.openInformation(PlatformUI.getWorkbench()\n\t\t\t\t\t\t.getDisplay().getActiveShell(),\n\t\t\t\t\t\tMessages.msgInformation, Messages.setOptionPageOKMsg);\n\t\t\t}\n\t\t});\n\t\tbtnUpdateScript\n\t\t\t\t.setEnabled(getMigrationWizard().getMigrationScript() != null);\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\t\tfinal ToolItem btnNewScript = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnNewScript.setText(Messages.btnCreateNewScript);\n\t\tbtnNewScript.setToolTipText(Messages.tipCreateNewScript);\n\t\tbtnNewScript.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tprepare4SaveScript();\n\t\t\t\tString name = EditScriptDialog.getMigrationScriptName(\n\t\t\t\t\t\tgetShell(), getMigrationWizard().getMigrationConfig()\n\t\t\t\t\t\t\t\t.getName());\n\t\t\t\tif (StringUtils.isBlank(name)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgetMigrationWizard().getMigrationConfig().setName(name);\n\t\t\t\tgetMigrationWizard().saveMigrationScript(true, isSaveSchema());\n\t\t\t\tbtnUpdateScript.setEnabled(getMigrationWizard()\n\t\t\t\t\t\t.getMigrationScript() != null);\n\t\t\t\tMessageDialog.openInformation(PlatformUI.getWorkbench()\n\t\t\t\t\t\t.getDisplay().getActiveShell(),\n\t\t\t\t\t\tMessages.msgInformation, Messages.setOptionPageOKMsg);\n\t\t\t}\n\t\t});\n\t}", "protected void createButtons(Panel panel) {\n panel.add(new Filler(24,20));\n\n Choice drawingChoice = new Choice();\n drawingChoice.addItem(fgUntitled);\n\n\t String param = getParameter(\"DRAWINGS\");\n\t if (param == null)\n\t param = \"\";\n \tStringTokenizer st = new StringTokenizer(param);\n while (st.hasMoreTokens())\n drawingChoice.addItem(st.nextToken());\n // offer choice only if more than one\n if (drawingChoice.getItemCount() > 1)\n panel.add(drawingChoice);\n else\n panel.add(new Label(fgUntitled));\n\n\t\tdrawingChoice.addItemListener(\n\t\t new ItemListener() {\n\t\t public void itemStateChanged(ItemEvent e) {\n\t\t if (e.getStateChange() == ItemEvent.SELECTED) {\n\t\t loadDrawing((String)e.getItem());\n\t\t }\n\t\t }\n\t\t }\n\t\t);\n\n panel.add(new Filler(6,20));\n\n Button button;\n button = new CommandButton(new DeleteCommand(\"Delete\", fView));\n panel.add(button);\n\n button = new CommandButton(new DuplicateCommand(\"Duplicate\", fView));\n panel.add(button);\n\n button = new CommandButton(new GroupCommand(\"Group\", fView));\n panel.add(button);\n\n button = new CommandButton(new UngroupCommand(\"Ungroup\", fView));\n panel.add(button);\n\n button = new Button(\"Help\");\n\t\tbutton.addActionListener(\n\t\t new ActionListener() {\n\t\t public void actionPerformed(ActionEvent event) {\n\t\t showHelp();\n\t\t }\n\t\t }\n\t\t);\n panel.add(button);\n\n fUpdateButton = new Button(\"Simple Update\");\n\t\tfUpdateButton.addActionListener(\n\t\t new ActionListener() {\n\t\t public void actionPerformed(ActionEvent event) {\n if (fSimpleUpdate)\n setBufferedDisplayUpdate();\n else\n setSimpleDisplayUpdate();\n\t\t }\n\t\t }\n\t\t);\n\n // panel.add(fUpdateButton); // not shown currently\n }", "private void createPanel() {\n JPanel panel = new JPanel();\n \n for(int i = 0; i < button.size(); i++){\n panel.add(button.get(i));\n }\n panel.add(label);\n \n add(panel);\n }", "@Override\r\n\tprotected void createButtonsForButtonBar(Composite parent) {\r\n\t\tcreateButton(parent, IDialogConstants.OK_ID, Messages.BTN_ADD,\r\n\t\t\t\ttrue);\r\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID,\r\n\t\t\t\tMessages.BTN_FINISH, false);\r\n\t\tinitDataBindings();\r\n\t}", "@Override\r\n\tprotected void createButtonsForButtonBar(Composite parent) {\n\t\tcreateButton(parent, IDialogConstants.OK_ID, \"Add\",\r\n\t\t\t\ttrue);\r\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID,\r\n\t\t\t\tIDialogConstants.CANCEL_LABEL, false);\r\n\t}", "private void initBtnsArray()\r\n {\r\n for (int i = 0; i < this.buttons.length; i++)\r\n this.buttons[i] = new Button(\"Button #\" + i);\r\n }", "private void createButtonComp() {\n GridData gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);\n Composite okBtnComp = new Composite(shell, SWT.NONE);\n GridLayout okBtnCompLayout = new GridLayout(2, true);\n okBtnComp.setLayout(okBtnCompLayout);\n okBtnComp.setLayoutData(gd);\n\n GridData bd = new GridData(110, 30);\n okBtn = new Button(okBtnComp, SWT.PUSH);\n okBtn.setText(\"OK\");\n okBtn.setLayoutData(bd);\n okBtn.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent e) {\n calculateDuration();\n shell.dispose();\n }\n });\n\n bd = new GridData(110, 30);\n cancelBtn = new Button(okBtnComp, SWT.PUSH);\n cancelBtn.setText(\"Close\");\n cancelBtn.setLayoutData(bd);\n cancelBtn.addSelectionListener(new SelectionAdapter() {\n\n /*\n * (non-Javadoc)\n * \n * @see\n * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse\n * .swt.events.SelectionEvent)\n */\n @Override\n public void widgetSelected(SelectionEvent e) {\n setReturnValue(-1);\n close();\n }\n });\n }", "private HorizontalPanel createCommands() {\n\t\tfinal HorizontalPanel bar = new HorizontalPanel();\n\t\tbar.addStyleName(AbstractField.CSS.cbtAbstractCommand());\n\t\t\n\t\t//-----------------------------------------------\n\t\t// Save button\n\t\t//-----------------------------------------------\n\t\tfinal CommandButton saveButton = new CommandButton(this, AbstractField.CONSTANTS.allSave(), actorUpdate, tab++);\n\t\tsaveButton.addStyleName(AbstractField.CSS.cbtCommandButtonTwo());\n\t\tsaveButton.addStyleName(AbstractField.CSS.cbtGradientBlue());\n\t\tsaveButton.setTitle(AbstractField.CONSTANTS.helpSave());\n\t\tbar.add(saveButton);\n\n\t\t//-----------------------------------------------\n\t\t// Delete button\n\t\t//-----------------------------------------------\n\t\tfinal CommandButton deleteButton = new CommandButton(this, AccessControl.DELETE_PERMISSION, AbstractField.CONSTANTS.allDelete(), actorDelete, tab++);\n\t\tdeleteButton.addStyleName(AbstractField.CSS.cbtCommandButtonTwo());\n\t\tdeleteButton.addStyleName(AbstractField.CSS.cbtGradientRed());\n\t\tdeleteButton.setTitle(AbstractField.CONSTANTS.helpDelete());\n\t\tbar.add(deleteButton);\n\n\t\t//-----------------------------------------------\n\t\t// Transition array that defines the finite state machine\n\t\t//-----------------------------------------------\n\t\tfsm = new ArrayList<Transition>();\n\t\tfsm.add(new Transition(Party.CREATED, saveButton, Party.CREATED));\n\t\tfsm.add(new Transition(Party.CREATED, deleteButton, Party.FINAL));\n\n\t\treturn bar;\n\t}", "private void createTileButtons(Context context) {\n Board board = boardManager.getBoard();\n tileButtons = new ArrayList<>();\n for (int row = 0; row != Board.NUM_ROWS; row++) {\n for (int col = 0; col != Board.NUM_COLS; col++) {\n Button tmp = new Button(context);\n if (bitmapList == null) {\n tmp.setBackgroundResource(board.getTile(row, col).getBackground());\n } else if (board.getTile(row, col).getId() != Board.NUM_COLS * Board.NUM_ROWS) {\n BitmapDrawable d = new BitmapDrawable(getResources(), bitmapList.get(board.getTile(row, col).getId()));\n tmp.setBackground(d);\n } else {\n tmp.setBackgroundResource(R.drawable.tile_grey);\n }\n this.tileButtons.add(tmp);\n }\n }\n }", "private void buttonInit(){\n for(int i=0; i < 3; i++){\n choice[i] = new JButton();\n\n }\n choice[0].setText(\"10x10 / 8 bombs\");\n choice[0].setBackground(new Color(86, 160, 189));\n\n\n choice[0].addActionListener(l-> makeGamePanel(10, 8));\n\n choice[1].setText(\"15x15 / 30 bombs\");\n choice[1].setBackground(new Color(238, 160, 160));\n\n\n choice[1].addActionListener(l-> makeGamePanel(15,30));\n\n choice[2].setText(\"24x24 / 70 bombs\");\n choice[2].setBackground(new Color(253, 230, 122));\n choice[2].setFont(new Font(Font.MONOSPACED, Font.BOLD, 30));\n choice[2].setForeground(new Color(45, 68, 73));\n\n choice[2].addActionListener(l-> makeGamePanel(24,70));\n\n this.add(choice[0], BorderLayout.LINE_START); this.add(choice[1], BorderLayout.LINE_END); this.add(choice[2], BorderLayout.CENTER);\n }", "private JButton[][] createBoard(int size){\n int count = 1;\n this.setLayout( new GridLayout(dimensions, dimensions));\n for (int o = 0; o < size; o++) {\n for (int i = 0; i < size; i++) {\n jbtnBoard[o][i] = new JButton(Integer.toString(i) + \",\" + Integer.toString(o));\n String name = Integer.toString(i) + \",\" + Integer.toString(o);\n jbtnBoard[o][i].setName(name);\n jbtnBoard[o][i].setForeground(Color.GREEN);\n this.add(jbtnBoard[o][i]);\n count++;\n }\n }\n return jbtnBoard;\n }", "private void makeButtonPanel()\n {\n \n this.buttonPanel.setLayout(new GridLayout(10, 2, 30, 10));\n \n \n this.buttonPanel.add(this.fLabel);\n this.fName.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.fName);\n\n this.buttonPanel.add(this.lLabel);\n this.lName.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.lName);\n\n this.buttonPanel.add(this.idLabel);\n this.iD.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.iD);\n\n this.buttonPanel.add(this.courseLabel);\n this.course.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.course);\n\n this.buttonPanel.add(this.instructorLabel);\n this.instructor.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.instructor);\n\n this.buttonPanel.add(this.tutorLabel);\n this.tutor.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.tutor);\n \n this.buttonPanel.add(this.commentsLable);\n this.comments.setColumns(COL_WIDTH);\n this.buttonPanel.add(this.comments);\n //Removed for appointment tabel\n //this.buttonPanel.add(this.appointmentLable);\n //this.buttonPanel.add(this.appointment);\n this.buttonPanel.add(this.sessionLenLabel);\n this.sessionLength.setColumns(COL_WIDTH);\n this.sessionLength.setText(\"30\");\n this.buttonPanel.add(this.sessionLength);\n\n this.ADD_BUTTON.addActionListener(new AddButtonListener());\n //buttonPanel.add(ADD_BUTTON);\n \n \n this.addSessionPlaceHolder.add(this.buttonPanel);\n }", "private void addComponents(Container pane) {\n // Reset pane\n pane.removeAll();\n\n GridLayout mainLayout = new GridLayout(4,3);\n JPanel mainPanel = new JPanel();\n mainPanel.setLayout(mainLayout);\n\n // Setting up button sizes\n JButton b = new JButton(\"Filler button\");\n Dimension buttonSize = b.getPreferredSize();\n Dimension preferredSize = new Dimension(\n (int)(buttonSize.getWidth() * 7.5) + newGUI.maxGap,\n (int)(buttonSize.getHeight() * 3.5) + newGUI.maxGap * 2);\n mainPanel.setPreferredSize(preferredSize);\n\n // Add the main panel buttons\n mainPanel.add(commands);\n mainPanel.add(availableCommands);\n mainPanel.add(new JLabel());\n mainPanel.add(enterButton);\n\n pane.add(mainPanel, BorderLayout.NORTH);\n pane.add(new JSeparator(), BorderLayout.CENTER);\n }", "private void addViewBody() {\n\t\tJButton medicosButton = new JButton(\"Médicos\");\n\t\tmedicosButton.addActionListener((ActionEvent e) -> {\n\t\t\tRouter.getInstance().goToView(new MedicosView());\n\t\t});\n\t\tthis.add(medicosButton);\n\n\t\tJButton clientesButton = new JButton(\"Clientes\");\n\t\tclientesButton.addActionListener((ActionEvent e) -> {\n\t\t\tRouter.getInstance().goToView(new ClientesView());\n\t\t});\n\t\tthis.add(clientesButton);\n\n\t\tJButton novaConsultaButton = new JButton(\"Nova Consulta\");\n\t\tnovaConsultaButton.addActionListener((ActionEvent e) -> {\n\t\t\tRouter.getInstance().goToView(new CadastroConsultaView());\n\t\t});\n\t\tthis.add(novaConsultaButton);\n\n\t\tJButton novoTesteButton = new JButton(\"Novo Teste [EM BREVE]\");\n\t\tnovoTesteButton.setEnabled(false);\n\t\tthis.add(novoTesteButton);\n\t}", "protected Panel createButtonPanel() {\n Panel panel = new Panel();\n panel.setLayout(new PaletteLayout(2, new Point(2,2), false));\n return panel;\n }", "private List<JRadioButton> setupCharacterButtons() {\n\t\tList<JRadioButton> btns = new ArrayList<JRadioButton>();\n\t\t// select the first button\n\t\tJRadioButton greenBtn = new JRadioButton(frame.makeDave(GameOfCluedo.GREEN));\n\t\tgreenBtn.setSelected(true);\n\t\t// add buttons to list\n\t\tbtns.add(greenBtn);\n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.MUSTARD)));\n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.PEACOCK))); \n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.PLUM))); \n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.SCARLETT))); \n\t\tbtns.add(new JRadioButton(frame.makeDave(GameOfCluedo.WHITE))); \n\t\treturn btns;\n\t}", "@FXML\n public void createRecentsButtons(ActionEvent ae) throws Exception {\n\n // do your job of creating Buttons and pass the arraylist as function parameters\n for(int k=0; k<11; k++)\n myArray.add(k);\n this.getNumberOfRecentGroups(myArray);\n System.out.println(\"I was clicked\");\n }", "@Override\n\tprotected void createButtonsForButtonBar(Composite parent) {\n\t\tButton button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);\n\t\tbutton.setText(DialogStrings.RemoveUserDialog_RemoveButton);\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);\n\t}", "ButtonPanel() {\n setLayout(new GridLayout(0,3));\n setPreferredSize(new Dimension(1000,100));\n setVisible(true);\n setMaximumSize(new Dimension(1000,250));\n reservationButton = new JButton(\"Reservation View\");\n bookingButton = new JButton(\"Booking View\");\n searchButton = new JButton(\"Search View\");\n add(reservationButton);\n add(bookingButton);\n add(searchButton);\n \n }", "private void generateButtonPanel() {\n buttonsPanel = new JPanel();\n playPauseButton = addButton(\"Play/Pause\");\n restartButton = addButton(\"Restart\");\n speedUpButton = addButton(\"Speed Up\");\n slowDownButton = addButton(\"Slow Down\");\n loopbackButton = addButton(\"Loopback\");\n keyCommandsButton = addButton(\"Key Commands\");\n textViewButton = addButton(\"Animation Text\");\n\n addShapeButton = addButton(\"Add Shape\");\n removeShapeButton = addButton(\"Remove Shape\");\n addKeyframeButton = addButton(\"Add Keyframe\");\n removeKeyframeButton = addButton(\"Remove Keyframe\");\n editKeyframeButton = addButton(\"Edit Keyframe\");\n clearAnimationButton = addButton(\"Clear Animation\");\n clearShapeButton = addButton(\"Clear Shape\");\n buttonsPanel.setLayout(new FlowLayout());\n\n mainPanel.add(buttonsPanel);\n }", "private void doButtons()\n {\n if (scopes.size()>1) addButtons();\n else hideButtons();\n }", "private void init_buttons(){\r\n /**\r\n * BOTON NUEVO\r\n */\r\n im_tool1.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonInicio();\r\n botonNuevo();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON EDITAR\r\n */\r\n im_tool2.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonEditar();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON GUARDAR\r\n */\r\n im_tool3.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonGuardar();\r\n }\r\n }\r\n }); \r\n /**\r\n * BOTON ELIMINAR\r\n */\r\n im_tool4.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonEliminar();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON IMPRIMIR\r\n */\r\n im_tool5.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){ \r\n botonImprimir();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON REGRESAR\r\n */\r\n im_tool6.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n botonInicio();\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON POR ASIGNAR\r\n */\r\n im_tool7.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n //\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON NOTAS DE CREDITO\r\n */\r\n im_tool8.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n //\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON DEVOLUCION\r\n */\r\n im_tool9.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n //\r\n }\r\n }\r\n });\r\n /**\r\n * BOTON BUSCAR\r\n */\r\n im_tool12.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n switch (mouseEvent.getClickCount()){\r\n case 1:\r\n botonInicio();\r\n botonBuscar();\r\n break;\r\n case 2:\r\n Datos.setIdButton(2003041);\r\n Gui.getInstance().showBusqueda(\"Busqueda\"); \r\n break;\r\n }\r\n }\r\n });\r\n /**\r\n * SELECCION EN LA TABLA\r\n */\r\n tb_guias.setOnMouseClicked((MouseEvent mouseEvent) -> {\r\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\r\n if(mouseEvent.getClickCount() > 0){\r\n if ((tb_guias.getItems() != null) && (!tb_guias.getItems().isEmpty()))\r\n selectedRowGuide();\r\n }\r\n }\r\n }); \r\n /**\r\n * metodo para mostrar buscar el nro de guia\r\n * param: ENTER O TAB\r\n */\r\n tf_nroguia.setOnKeyReleased((KeyEvent ke) -> {\r\n if (ke.getCode().equals(KeyCode.ENTER)){\r\n //Valida que el evento se haya generado en el campo de busqueda\r\n if(((Node)ke.getSource()).getId().equals(\"tf_nroguia\")){\r\n //Solicita los datos y envia la Respuesta a imprimirse en la Pantalla\r\n Datos.setLog_cguias(new log_CGuias()); \r\n boolean boo = Ln.getInstance().check_log_CGuias_rela_caja(tf_nroguia.getText()); \r\n numGuias = 0;\r\n if(boo){\r\n Datos.setRep_log_cguias(Ln.getInstance().find_log_CGuias(tf_nroguia.getText(), \"\", \"ncaja\", Integer.parseInt(rows)));\r\n loadTable(Datos.getRep_log_cguias()); \r\n }\r\n else{\r\n change_im_val(0, im_checkg); \r\n Gui.getInstance().showMessage(\"El Nro. de \" + ScreenName + \" NO existe!\", \"A\");\r\n tf_nroguia.requestFocus();\r\n }\r\n }\r\n }\r\n });\r\n /**\r\n * metodo para mostrar buscar el nro de guia\r\n * param: ENTER O TAB\r\n */\r\n tf_nrorguia.setOnKeyReleased((KeyEvent ke) -> {\r\n if (ke.getCode().equals(KeyCode.ENTER)){\r\n //Valida que el evento se haya generado en el campo de busqueda\r\n if(((Node)ke.getSource()).getId().equals(\"tf_nrorguia\")){\r\n //Solicita los datos y envia la Respuesta a imprimirse en la Pantalla\r\n boolean booa = true; \r\n if(booa){\r\n boolean booc = Ln.getInstance().check_log_CGuias_caja(tf_nrorguia.getText()); \r\n if(booc){\r\n change_im_val(0, im_checkg); \r\n Gui.getInstance().showMessage(\"El Nro. de Guia ya esta relacionado!\", \"A\");\r\n tf_nrorguia.requestFocus();\r\n }\r\n else{\r\n for (int i = 0; i < log_guide_guia.size(); i++) {\r\n if(tf_nrorguia.getText().equals(tb_guias.getItems().get(i).getGuias())){\r\n booa = false;\r\n Gui.getInstance().showMessage(\"El Nro. de Guia ya esta relacionado!\", \"A\");\r\n tf_nrorguia.requestFocus();\r\n break;\r\n }\r\n } \r\n if(booa){\r\n log_Guide_rel_inv guide_carga = new log_Guide_rel_inv();\r\n\r\n List<Fxp_Archguid_gfc> data = \r\n Ln.getList_log_Archguid_gfc(Ln.getInstance().find_Archguid_gfc(tf_nrorguia.getText()));\r\n\r\n if (data.get(0).getStat_guia().equals(\"X\")\r\n || data.get(0).getStat_guia().equals(\"C\")){\r\n guide_carga.setNumorden(String.valueOf((log_guide_guia.size() + 1)));\r\n guide_carga.setGuias(tf_nrorguia.getText());\r\n guide_carga.setNumfact(data.get(0).getNumfact());\r\n guide_carga.setNumclie(data.get(0).getNumclie());\r\n\r\n if (data.get(0).getStat_guia().equals(\"A\")){\r\n if (tipoOperacion == 1)\r\n guide_carga.setStat_guia(null);\r\n else\r\n guide_carga.setStat_guia(data.get(0).getStat_guia());\r\n }\r\n else{\r\n guide_carga.setStat_guia(null);\r\n }\r\n \r\n \r\n log_guide_guia.add(guide_carga);\r\n\r\n loadTableGuide_guias();\r\n change_im_val(200, im_checkg); \r\n\r\n numFactCarga = numFactCarga + data.get(0).getNumfact();\r\n numClieCarga = numClieCarga + data.get(0).getNumclie();\r\n\r\n tf_nrorguia.setText(\"\");\r\n }else{\r\n if (data.get(0).getStat_guia().equals(\"\")){\r\n Gui.getInstance().showMessage(\"El Nro. de Guia NO tiene relación de Guia de Carga!\", \"A\");\r\n }\r\n else{\r\n Gui.getInstance().showMessage(\"El Nro. de Guia ya esta relacionado!\", \"A\");\r\n }\r\n tf_nrorguia.requestFocus();\r\n }\r\n \r\n }\r\n }\r\n }\r\n else{\r\n change_im_val(0, im_checkg); \r\n Gui.getInstance().showMessage(\"El Nro. de Guia NO existe!\", \"A\");\r\n tf_nrorguia.requestFocus();\r\n }\r\n }\r\n }\r\n });\r\n }", "private void createRedButtons() {\r\n\t\tint y = 40;\r\n\t\tfor (int i = 60; i < 65; i++) {\r\n\t\t\tarray[i] = createRedButton(y);\r\n\t\t\ty += 40;\r\n\t\t}\r\n\t}", "protected void createButtonsForButtonBar(Composite parent) {\n\t\tcreateButton(barComp, BUTTON_ADD_ID, Messages.btnAddParameter, true);\n\t\tcreateButton(barComp, BUTTON_EDIT_ID, Messages.btnEditParameter, true);\n\t\tcreateButton(barComp, BUTTON_DROP_ID, Messages.btnDropParameter, true);\n\t\tcreateButton(barComp, BUTTON_UP_ID, Messages.btnUpParameter, true);\n\t\tcreateButton(barComp, BUTTON_DOWN_ID, Messages.btnDownParameter, true);\n\t\tcreateButton(parent, IDialogConstants.OK_ID, com.cubrid.common.ui.common.Messages.btnOK, true);\n\n\t\tgetButton(BUTTON_EDIT_ID).setEnabled(false);\n\t\tgetButton(BUTTON_UP_ID).setEnabled(false);\n\t\tgetButton(BUTTON_DOWN_ID).setEnabled(false);\n\t\tgetButton(BUTTON_DROP_ID).setEnabled(false);\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID, com.cubrid.common.ui.common.Messages.btnCancel, false);\n\t}", "private void createUIComponents() {\n bt1 = new JButton(\"Hola\");\n }", "void set_buttons(){\n\n int button_count = 5;\n\n button_data_set = new ArrayList(button_count);\n\n try {\n\n JSONObject btn1 = new JSONObject();\n btn1.put(\"title\", \"Button1\");\n button_data_set.add(btn1);\n\n JSONObject btn2 = new JSONObject();\n btn1.put(\"title\", \"Button2\");\n button_data_set.add(btn2);\n\n JSONObject btn3 = new JSONObject();\n btn1.put(\"title\", \"Button3\");\n button_data_set.add(btn3);\n\n JSONObject btn4 = new JSONObject();\n btn1.put(\"title\", \"Button4\");\n button_data_set.add(btn4);\n\n JSONObject btn5 = new JSONObject();\n btn1.put(\"title\", \"Button5\");\n button_data_set.add(btn5);\n\n }catch(Exception e){\n e.printStackTrace();\n }\n\n Common.ButtonsCount = button_count;\n }", "public void createButtonUI(final LinearLayout linearLayout){\n btnAddSet =new Button(this);\n btnDeleteLift=new Button(this);\n btnAddSet.setText(\"Add\");\n btnDeleteLift.setText(\"Delete\");\n btnAddSet.setId(View.generateViewId());\n btnDeleteLift.setId(View.generateViewId());\n btnLayout=new RelativeLayout(this);\n final RelativeLayout.LayoutParams btnRelLayoutparams=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n btnRelLayoutparams.setMargins(0,5,0,20);\n btnLayout.setLayoutParams(btnRelLayoutparams);\n RelativeLayout.LayoutParams btnAddSetParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n RelativeLayout.LayoutParams btnDeleteLiftParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n\n btnAddSetParams.setMargins(75, 0, 10, 0);\n btnDeleteLiftParams.setMargins(10, 0, 75, 0);\n btnAddSetParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);\n btnDeleteLiftParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);\n btnAddSet.setLayoutParams(btnAddSetParams);\n btnDeleteLift.setLayoutParams(btnDeleteLiftParams);\n\n btnLayout.addView(btnAddSet, btnAddSetParams);\n btnLayout.addView(btnDeleteLift, btnDeleteLiftParams);\n\n linearLayout.addView(btnLayout, btnRelLayoutparams);\n btnAddSet.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n linearLayout.removeView(btnLayout);\n createSetUI(linearLayout,setNum , null);\n setNum++;\n linearLayout.addView(btnLayout, btnRelLayoutparams);\n }\n });\n//Listener for delete lift button\n btnDeleteLift.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n delLift();\n }\n });\n\n }", "private void addShapeNameButtons() {\n popupPanel.add(SHAPE_NAME_LABEL);\n ButtonGroup bg = new ButtonGroup();\n for (String name : model.getIds()) {\n JRadioButton jb = new JRadioButton(name);\n bg.add(jb);\n shapeNames.add(jb);\n popupPanel.add(jb);\n }\n\n }", "public void getNumberOfRecentGroups(ArrayList arr) throws Exception {\n int arraySize = arr.size();\n int z = 0;\n\n Button[] btn = new Button[arraySize];\n while (z < arraySize) {\n btn[z] = new Button();\n\n //Anonymous method\n btn[z].setOnAction(new EventHandler<ActionEvent>() {\n public void handle(ActionEvent event) {\n System.out.println(\"hey i was clicked\");\n }\n });\n btn[z].setId(\"btnRecent\");\n btn[z].setPrefHeight(118);\n btn[z].setPrefWidth(118);\n btn[z].setText(arr.get(z) + \"\");\n fp.getChildren().add(btn[z]);\n z++;\n }\n fp.setHgap(10);\n }", "private void createComponents() {\n\t\tbuttons = new Button[9];\r\n\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\tbuttons[i] = new Button();\r\n\t\t}\r\n\r\n\t\t// Initialize components\r\n\t\tplayAgainButton = new Button(\"Play Again\");\r\n\t\tquitButton = new Button(\"Quit\");\r\n\r\n\t\t// Initialize layouts\r\n\t\tgameButtonGrid = new GridPane();\r\n\t\tgameButtonGrid.setStyle(\"-fx-background-color:Aquamarine;\");\r\n\t\tbottomButtonsHBox = new HBox();\r\n\t\tbottomButtonsHBox.setStyle(\"-fx-background-color:LightSlateGray;\");\r\n\t\tsceneVBox = new VBox();\r\n\t\t\r\n\t\t//Game components\r\n\t\tgameInfo = new GameInfo();\r\n\t}", "private Classes.Button principalButtonsMenu(TextView buttonTitle, ImageView buttonImage){\n Classes.Button button;\n if(buttonIndex < (rows*(columns-1))) {\n button = buttons.get(buttonIndex);\n createPrincipalButtons(buttonTitle, button, buttonImage);\n }else if(buttonFunctionIndex < functionButtons.size()) {\n button = functionButtons.get(buttonFunctionIndex);\n createFuncionesButtons(buttonTitle, button, buttonImage);\n }else{\n button = new Classes.Button(0, \"\", \"\", \"\",\"\", \"\",\"\", \"\");\n }\n return button;\n }", "private void createRgbHsbButtons() {\n \t\n Composite comp1 = new Composite(shell, SWT.NONE);\n GridLayout gl = new GridLayout(3, false);\n gl.horizontalSpacing = 10;\n comp1.setLayout(gl);\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n comp1.setLayoutData(gd);\n\n // Create a group to contain the RGB and HSB radio buttons.\n Group colorGroup = new Group(comp1, SWT.NONE);\n colorGroup.setText(\" Use color model: \");\n\n RowLayout groupRowLayout = new RowLayout();\n groupRowLayout.marginLeft = 10;\n groupRowLayout.marginRight = 10;\n groupRowLayout.spacing = 10;\n colorGroup.setLayout(groupRowLayout);\n\n // Create the RGB radio button. When the radio button is selected\n // update the upper and lower color wheel objects to display the RGB\n // sliders.\n rgbRdo = new Button(colorGroup, SWT.RADIO);\n rgbRdo.setText(\"RGB\");\n rgbRdo.setSelection(true);\n rgbRdo.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n changeColorWheels();\n }\n });\n\n // Create the HSB radio button. When the radio button is selected\n // update the upper and lower color wheel objects to display the HSB\n // sliders.\n hsbRdo = new Button(colorGroup, SWT.RADIO);\n hsbRdo.setText(\"HSB\");\n hsbRdo.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent event) {\n changeColorWheels();\n }\n });\n \n Composite catComp = new Composite(comp1, SWT.NONE);\n gl = new GridLayout(1, false);\n gl.horizontalSpacing = 20;\n catComp.setLayout(gl);\n gd = new GridData(GridData.CENTER);\n gd.horizontalAlignment = SWT.CENTER;\n \n catComp.setLayoutData(gd);\n\n Label selCatLbl = new Label( catComp, SWT.None );\n selCatLbl.setText(\"Category\");\n \n final Combo selCmapCatCombo = new Combo( catComp, SWT.DROP_DOWN | SWT.READ_ONLY );\n selCmapCatCombo.setItems( availColorMapCats );\n selCmapCatCombo.select(0);\n \n selCmapCatCombo.addSelectionListener( new SelectionAdapter() {\n \tpublic void widgetSelected(SelectionEvent event) {\n \t\tString seldCat = selCmapCatCombo.getText();\n \t\tif( seldCat.equals( seldCmapCat ) ) {\n \t\t\treturn;\n \t\t}\n \t\t\n \t\tseldCmapCat = seldCat;\n \t\tseldCmapName = null;\n \t\tavailColorMaps.clear();\n \t\t\n for( String cmap : ColorMapUtil.listColorMaps(seldCmapCat) ) {\n \tif( seldCmapName == null ) {\n \t\tseldCmapName = cmap;\n \t\tif( !initColorMap() ) {\n \t\tseldCmapName = null;\n \t\t\tcontinue; // don't add to the list\n \t\t}\n \t}\n \tavailColorMaps.add(cmap);\n }\n \t\n createSliderData();\n selCmapCombo.setItems( availColorMaps.toArray(new String[0] ) );\n selCmapCombo.select(0);\n colorBar.setNewColorMap(sliderText, colorArray);\n \t}\n });\n \n Composite cmapComp = new Composite(comp1, SWT.NONE);\n gl = new GridLayout(1, false);\n gl.horizontalSpacing = 10;\n cmapComp.setLayout(gl);\n gd = new GridData(GridData.FILL_HORIZONTAL);\n cmapComp.setLayoutData(gd);\n\n Label selCmapLbl = new Label( cmapComp, SWT.None );\n selCmapLbl.setText(\"Colormap\");\n \n selCmapCombo = new Combo( cmapComp, SWT.DROP_DOWN );\n selCmapCombo.setItems( availColorMaps.toArray(new String[0] ) );\n selCmapCombo.select(0);\n \n selCmapCombo.addSelectionListener( new SelectionAdapter() {\n \tpublic void widgetSelected(SelectionEvent event) {\n \t\tString seldCmap = selCmapCombo.getText();\n \t\tif( seldCmap.equals( seldCmapName ) ) {\n \t\t\treturn;\n \t\t}\n \t\t\n \t\tseldCmapName = seldCmap;\n\n \t\tif( initColorMap() ) {\n createSliderData();\n \t\t}\n colorBar.setNewColorMap(sliderText, colorArray);\n \t}\n });\n \n// selCmapCombo.addModifyListener( new ModifyListener() {\n//\t\t\t@Override\n//\t\t\tpublic void modifyText(ModifyEvent e) { \n//\t\t\t\tseldCmapName = selCmapCombo.getText();\n//\t\t\t}\n// });\n }", "public void groupFunction ()\n { \n // Set layouts.\n g = new GroupLayout (this);\n setLayout (g);\n \n // Button initialization.\n getInfoButton = new JButton (\"getMethods()\");\n stringButton = new JButton (\"String\");\n setContainGapsButton = new JButton (\"setAutoCreateContainerGaps()\");\n setAutoGapsButton = new JButton (\"setAutoCreateGaps()\");\n setHonorsVisButton = new JButton (\"setHonorsVisibility()\");\n diagonalButton = new JButton (\"Diagonal\");\n verticalButton = new JButton (\"Vertical\");\n horizontalButton = new JButton (\"Horizontal\");\n linkSizeButton = new JButton (\"linkSize()\");\n replaceButton = new JButton (\"replace()\");\n returnButton = new JButton (\"Return\");\n \n // Default Layout\n g.setVerticalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n g.setHorizontalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n \n // Horizontal Layout\n horizontalButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n remove (returnButton);\n g.setVerticalGroup(\n g.createParallelGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n g.setHorizontalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n \n }\n }); \n \n // Diagonal Layout\n diagonalButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n remove (returnButton);\n g.setVerticalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n g.setHorizontalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n \n }\n }); \n \n // Vertical Layout\n verticalButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n remove (returnButton);\n g.setVerticalGroup(\n g.createSequentialGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n g.setHorizontalGroup(\n g.createParallelGroup()\n .addComponent(getInfoButton)\n .addComponent(diagonalButton)\n .addComponent(verticalButton)\n .addComponent(horizontalButton)\n .addComponent(replaceButton)\n .addComponent(stringButton)\n .addComponent(setContainGapsButton)\n .addComponent(setAutoGapsButton)\n .addComponent(linkSizeButton)\n .addComponent(setHonorsVisButton));\n \n }\n }); \n \n // get() Methods\n getInfoButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n new JOptionPane().showMessageDialog (GroupLayoutRonald.this, \"Auto Create Container Gaps Enabled: \" + g.getAutoCreateContainerGaps () + \"\\n\"\n + \"Auto Create Component Gaps Enabled: \" + g.getAutoCreateGaps () + \"\\n\"\n + \"Honors Component Visibility: \" + g.getHonorsVisibility () + \"\\n\"\n + \"Horizontal Alignment: \" + g.getLayoutAlignmentX(GroupLayoutRonald.this) + \"\\n\"\n + \"Vertical Alignment: \" + g.getLayoutAlignmentY (GroupLayoutRonald.this) + \"\\n\"\n + \"Layout Style: \" + g.getLayoutStyle () + \"\\n\"\n + \"Minimum Layout Size: \" + g.minimumLayoutSize(GroupLayoutRonald.this).getWidth() + \" by \" + g.minimumLayoutSize(GroupLayoutRonald.this).getHeight() + \"\\n\"\n + \"Maximum Layout Size: \" + g.maximumLayoutSize(GroupLayoutRonald.this).getWidth() + \" by \" + g.maximumLayoutSize(GroupLayoutRonald.this).getHeight() + \"\\n\"\n + \"Preferred Layout Size: \" + g.preferredLayoutSize(GroupLayoutRonald.this).getWidth() + \" by \" + g.preferredLayoutSize(GroupLayoutRonald.this).getHeight() + \"\\n\"\n , \"About: Layout Data\", JOptionPane.PLAIN_MESSAGE);\n }\n });\n \n // toString() Method\n stringButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n new JOptionPane().showMessageDialog (GroupLayoutRonald.this, g.toString(), \"String Representation of Layout\", JOptionPane.PLAIN_MESSAGE);\n }\n });\n \n \n // setAutoCreateContainerGaps() Method\n setContainGapsButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n if (g.getAutoCreateContainerGaps() == true)\n g.setAutoCreateContainerGaps (false);\n else\n g.setAutoCreateContainerGaps (true);\n }\n });\n \n // setAutoCreateGaps() Method\n setAutoGapsButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n if (g.getAutoCreateGaps() == true)\n g.setAutoCreateGaps(false);\n else\n g.setAutoCreateGaps(true);\n }\n });\n \n // setHonorsVisibility() Method\n setHonorsVisButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n if (g.getHonorsVisibility() == true)\n g.setHonorsVisibility (false);\n else\n g.setHonorsVisibility (true);\n }\n });\n \n // linkSize() Method\n linkSizeButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n g.linkSize(SwingConstants.HORIZONTAL, linkSizeButton, setHonorsVisButton, setAutoGapsButton);\n }\n });\n \n // replace() Method\n replaceButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n g.replace (replaceButton, returnButton);\n }\n });\n \n // replace() Method\n returnButton.addActionListener (new ActionListener ()\n {\n public void actionPerformed (ActionEvent ae)\n {\n g.replace (returnButton, replaceButton);\n }\n });\n }", "public static HBox createWinBtnBox() {\n int numWinBtns = 3;\n ToggleButton winBtn1 = createRoundWinBtn(5);\n ToggleButton winBtn2 = createRoundWinBtn(10);\n ToggleButton winBtn3 = createRoundWinBtn(20);\n\n //Only one map can be selected, hence the use of a toggling system\n final ToggleGroup group = new ToggleGroup();\n winBtn1.setToggleGroup(group);\n winBtn2.setToggleGroup(group);\n winBtn3.setToggleGroup(group);\n winBtn1.setSelected(true);\n endScore = 5; // default\n\n HBox hbox = new HBox(winBtn1, winBtn2, winBtn3);\n hbox.setLayoutX(MainGUI.WIDTH / 2.0 - winBtn1.getPrefWidth() * numWinBtns / 2.0);\n hbox.setLayoutY(MainGUI.HEIGHT / 2.0 + 40);\n return hbox;\n }", "private JPanel createResourcesListAndButtonsPanel() {\n\n JPanel panel = new JPanel(new BorderLayout());\n panel.setBorder(PADDING_BORDER);\n\n panel.add(createResourcesPanel(), BorderLayout.NORTH);\n panel.add(createConfirmButtons(), BorderLayout.SOUTH);\n\n return panel;\n }", "public void generateElevatorButtons() {\n\t\tfor (int i = 1; i <= Settings.NUMBER_OF_FLOORS; i++) {\n\t\t\televatorButtons.put(i, new ElevatorButton(false, i));\n\t\t}\n\t}" ]
[ "0.7705233", "0.76489395", "0.7441956", "0.74234563", "0.7369384", "0.72707677", "0.71578646", "0.69689435", "0.6961077", "0.6943231", "0.6893604", "0.6886755", "0.68422824", "0.6840741", "0.6793571", "0.67551726", "0.67201364", "0.6696621", "0.6695865", "0.6690504", "0.66840625", "0.6622794", "0.65955156", "0.6558677", "0.6548885", "0.65372944", "0.6534896", "0.6526962", "0.6523411", "0.65224606", "0.6497655", "0.6485232", "0.64807904", "0.64731324", "0.6470418", "0.64608777", "0.64591205", "0.6431243", "0.6391238", "0.6374049", "0.63740075", "0.63660353", "0.634849", "0.63465935", "0.63312244", "0.631042", "0.6295161", "0.62845665", "0.62763226", "0.62626183", "0.6236526", "0.62284595", "0.6222365", "0.6216594", "0.6208402", "0.61901397", "0.6184375", "0.61825955", "0.6180217", "0.61800945", "0.61799884", "0.61788005", "0.61777097", "0.61738193", "0.6172368", "0.61701566", "0.616425", "0.61514366", "0.61511713", "0.6138659", "0.61364967", "0.6134927", "0.61139536", "0.61124665", "0.61122215", "0.6112218", "0.61030585", "0.6089623", "0.6082362", "0.60822606", "0.6079521", "0.6078914", "0.60753924", "0.60749817", "0.60539246", "0.6047765", "0.604471", "0.6043399", "0.60405254", "0.6034422", "0.6026556", "0.6023298", "0.60228187", "0.6002203", "0.6001803", "0.5997127", "0.5996676", "0.599528", "0.59931374", "0.5988645" ]
0.6045167
86
Returns boolean value of analog button.
public boolean get() { int i = 0; while(i < buttons.length) { if (!buttons[i].get()) { return false; } i++; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean getAButton() {\n\t\treturn getRawButton(A_Button);\n\t}", "boolean getBoolValue();", "boolean getBoolValue();", "public boolean getAButton() {\n\t\treturn getRawButton(A_BUTTON);\n\t}", "public boolean getRawButton(int i) throws Exception{\n \ti-=1;\n \tif (i >= 0 && i < buttonCount)return (buttonState & (1 << i))!=0;\n \tthrow new Exception(String.format(\"Button %d does not exist\", i));\n }", "public boolean getValue();", "boolean getValue();", "public boolean getButton(XboxController.Button inputButton) {\n\t\treturn this.getRawButton(inputButton.value);\n\t}", "public boolean getBButton() {\n\t\treturn getRawButton(B_Button);\n\t}", "boolean getBoolean();", "boolean getBoolean();", "public boolean getPressureSwitchValue() {\n return CompressorJNI.getPressureSwitch(m_pcm);\n }", "public Byte getAnalogValueByte() {\n return analogValueByte;\n }", "@Override\n public boolean get() {\n return this.joystick.getPOV() == this.angle;\n }", "public boolean isEnabled_click_Digital_coupons_button(){\r\n\t\tif(click_Digital_coupons_button.isEnabled()) { return true; } else { return false;} \r\n\t}", "public Integer getAnalogValue() {\n return analogValueByte & 0xff;\n }", "boolean getIsChecked();", "public boolean getBButton() {\n\t\treturn getRawButton(B_BUTTON);\n\t}", "public static boolean getButton(int index) {\n\t\treturn SmartDashboard.getBoolean(\"DB/Button \" + index, false);\n\t}", "public boolean isEnabled() {\r\n\t\treturn sensor.isEnabled();\r\n\t}", "abstract public boolean getAsBoolean();", "boolean readBoolean();", "public boolean isOn()\n {\n // Check the pin state\n return ledPin.isHigh();\n }", "public boolean isPressed() {\n\t\treturn get();\n\t}", "public boolean getBoolean();", "public boolean visible_SensConfig_NxtBtn() {\r\n\t\treturn IsElementVisibleStatus(SensorConfiguration_Btn);\r\n\t}", "public boolean getPilotButton(int button) {\n return pilot.getRawButton(button);\n }", "public Boolean getValue() {\n\t\treturn b;\n\t}", "BooleanProperty getOn();", "public java.lang.Boolean value() {\n return value;\n }", "public Boolean isChecked(){\n return aSwitch.isChecked();\n }", "public boolean getRocketBoxButton(int button) {\n return rocketBox.getRawButton(button);\n }", "public boolean isPowered(){\n\t\tint value = sensor.readRawValue();\n\t\tDiscoveryVehicle.getMonitor().log(\"raw: \"+value);\n//\t\treturn Button.ENTER.isDown();\n\t\treturn (value < Configuration.HYDROGEN_MEASURE_TRIGGER_PRECISION);\n\t}", "boolean isSignal();", "public boolean micEnabled();", "public boolean getCopilotButton(int button) {\n return copilot.getRawButton(button);\n }", "public boolean getBoolValue() {\n return boolValue_;\n }", "public boolean getLeftJoystickClick() {\n\t\treturn getRawButton(LEFT_JOYSTICK_CLICK);\n\t}", "public boolean getBoolValue() {\n return boolValue_;\n }", "public abstract boolean read_boolean();", "public boolean getSquareButton() {\n\t\treturn getRawButton(SQUARE_BUTTON);\n\t}", "boolean getKeyWheel();", "public Boolean value() {\n return this.value;\n }", "public Boolean value() {\n return this.value;\n }", "public Boolean value() {\n return this.value;\n }", "public boolean getClicked(){\n return this.isPressed;\n }", "public boolean isOn(){\n return state;\n }", "public int getTrueValue()\n {\n\t// Local constants\n\n\t// Local variables\n\n\t/************ Start getTrueValue Method ***************/\n\n // Return true value\n return trueValue;\n\n }", "public Boolean getValue() {\n return value;\n }", "public boolean readBoolean() {\n\t\tif(!isInit) return false;\n\t\tboolean result = false;\n\t\tisListening = true;\n\t\twriteLine(\"Waiting for Boolean input...\");\n\t\twhile(isListening) {\n\t\t\ttry {\n\t\t\t\tresult = Boolean.parseBoolean(inputArea.getText());\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\tresult= false;\n\t\t\t}\n\t\t}\n\t\tinputArea.setText(\"\");\n\t\twriteLine(\"Input: \" + result);\n\t\treturn result;\n\t}", "public boolean getPinValue() {\n boolean ret = false;\n for (Boolean val : sourceBlocks.values())\n ret = ret | val;\n \n return ret;\n }", "public boolean getValue() {\n\t\treturn _checked;\n\t}", "public Boolean getbEnable() {\n return bEnable;\n }", "boolean hasSignal();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "public boolean getButton(Button button) {\n return getButton(button.getNumber());\n }", "public boolean readBoolean() {\n return (((readLong() & 1) == 1) ? true : false);\n }", "public final boolean mo2786a() {\r\n return this.f4242S.isChecked();\r\n }", "public Boolean getValue() {\n/* 60 */ return Boolean.valueOf(this.val);\n/* */ }", "public boolean getRightJoystickClick() {\n\t\treturn getRawButton(RIGHT_JOYSTICK_CLICK);\n\t}", "boolean getEnabled();", "boolean getEnabled();", "boolean getEnabled();", "public Boolean asBoolean();", "public boolean getValue() {\r\n\t\treturn this.value;\r\n\t}", "public boolean pressed() {\n return pressed;\n }", "public boolean isSwitchPressed() {\n\t\treturn !lightSwitch.get();\n\t}", "@Override\n\tpublic boolean speedBtn()\n\t{\n\t\treturn this.speed;\n\t}", "boolean getWheel();", "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 }", "int getMqttEnabledStateValue();", "boolean getPowerBox();", "public int cameraOn() {\r\n System.out.println(\"hw- ligarCamera\");\r\n return serialPort.enviaDados(\"!111O*\");//camera ON \r\n }", "boolean isChecked();", "boolean isChecked();", "boolean getCheckState();", "org.apache.xmlbeans.XmlBoolean xgetWheel();", "public Boolean getValue() {\n return this.value;\n }", "public Boolean getValue() {\n return this.value;\n }", "public Boolean getValue() {\n return this.value;\n }", "public boolean getAlarmSensorCurrentState() {\n return alarmSensorCurrentState;\n }", "boolean isShutterPressed();", "public boolean getXButton() {\n\t\treturn getRawButton(X_Button);\n\t}", "public boolean getSign() {\n Native.IntPtr res = new Native.IntPtr();\n if (!Native.fpaGetNumeralSign(getContext().nCtx(), getNativeObject(), res))\n throw new Z3Exception(\"Sign is not a Boolean value\");\n return res.value != 0;\n }", "public byte[] readRawBool() throws IOException {\n byte[] bytes = new byte[2];\n bytes[0] = (byte) Type.BOOL.code;\n in.readFully(bytes, 1, 1);\n return bytes;\n }", "boolean getButtonRelease(Buttons but);", "public Boolean getABoolean()\n {\n return aBoolean;\n }", "public Boolean isEnable() {\n return this.enable;\n }", "public static boolean isButtonPressed() {\n return button.isPressed();\n }", "public boolean isGettersOfBoolean() {\n final boolean result = cbBoolean.getModel().isSelected();\n paramBoolean = result;\n return result;\n }", "private boolean isBtConnected(){\n \treturn false;\n }", "public boolean getIsOperator_FuelInfeed_BtnPressed()\n\t{\n\t\treturn super.getIsOperatorLeftBumperBtnPressed();\n\t}", "boolean isSetWheel();" ]
[ "0.67735493", "0.67003644", "0.67003644", "0.66837394", "0.66178304", "0.6435991", "0.641849", "0.6383416", "0.6370091", "0.62826455", "0.62826455", "0.62614346", "0.6247717", "0.624527", "0.6232725", "0.6231831", "0.62189436", "0.61975986", "0.61953413", "0.61829615", "0.61700654", "0.6167113", "0.6166448", "0.6164979", "0.6121836", "0.6121356", "0.6094036", "0.6093032", "0.6088966", "0.60647035", "0.60604304", "0.6052305", "0.60471267", "0.6017128", "0.60153514", "0.6015231", "0.6011587", "0.60107476", "0.60034025", "0.599836", "0.5991591", "0.59906894", "0.5975284", "0.5975284", "0.5975284", "0.5974909", "0.5966867", "0.59648985", "0.59550273", "0.59508735", "0.5950576", "0.5940905", "0.59291977", "0.59285945", "0.5926582", "0.5926582", "0.5926582", "0.5926582", "0.5926582", "0.5926582", "0.5926582", "0.5926582", "0.591861", "0.5915393", "0.5913416", "0.590183", "0.5896575", "0.58908623", "0.58908623", "0.58908623", "0.5875609", "0.58653915", "0.5862322", "0.58621854", "0.5860541", "0.58548373", "0.5843568", "0.5838511", "0.58304995", "0.58267784", "0.5818932", "0.5818932", "0.58129275", "0.5805834", "0.5801759", "0.5801759", "0.5801759", "0.5799958", "0.5793515", "0.5769001", "0.5763356", "0.57610816", "0.57595634", "0.57530504", "0.5751489", "0.574905", "0.5746974", "0.5744123", "0.57379913", "0.5733446" ]
0.64144343
7
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { dtepFixedTime = new ngat.beans.guibeans.DateTimeEditorPanel(); msepSlack = new ngat.beans.guibeans.MillisecondEditorPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jtpHelpPane = new javax.swing.JTextPane(); jLabel1 = new javax.swing.JLabel(); setBackground(new java.awt.Color(255, 255, 255)); dtepFixedTime.setTitle("Fixed Time"); msepSlack.setTitle("Slack"); jtpHelpPane.setBorder(null); jtpHelpPane.setEditable(false); jtpHelpPane.setText("The Slack defines the total time interval (split half before and half after the Fixed Time) that the group may start in.\n\nFor example, a Fixed Time of 22:00 with a Slack of 10 minutes would start somewhere between 21:55 and 22:05.\n\nBeware of setting too small a value for Slack (< 10 minutes) as misestimation of the execution time of a preceeding observation may cause the fixed observation to be missed.\n"); jScrollPane1.setViewportView(jtpHelpPane); jLabel1.setFont(new java.awt.Font("Lucida Grande", 1, 12)); jLabel1.setText("Fixed Timing Constraint"); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel1) .add(dtepFixedTime, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, msepSlack, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE) .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(jLabel1) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(dtepFixedTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 57, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(msepSlack, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 69, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(63, Short.MAX_VALUE)) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public kunde() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public frmVenda() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.73191476", "0.72906625", "0.72906625", "0.72906625", "0.72860986", "0.7248112", "0.7213479", "0.72078276", "0.7195841", "0.71899796", "0.71840525", "0.7158498", "0.71477973", "0.7092748", "0.70800966", "0.70558053", "0.69871384", "0.69773406", "0.69548076", "0.69533914", "0.6944929", "0.6942576", "0.69355655", "0.6931378", "0.6927896", "0.69248974", "0.6924723", "0.69116884", "0.6910487", "0.6892381", "0.68921053", "0.6890637", "0.68896896", "0.68881863", "0.68826133", "0.68815064", "0.6881078", "0.68771756", "0.6875212", "0.68744373", "0.68711984", "0.6858978", "0.68558776", "0.6855172", "0.6854685", "0.685434", "0.68525875", "0.6851834", "0.6851834", "0.684266", "0.6836586", "0.6836431", "0.6828333", "0.68276715", "0.68262815", "0.6823921", "0.682295", "0.68167603", "0.68164384", "0.6809564", "0.68086857", "0.6807804", "0.6807734", "0.68067646", "0.6802192", "0.67943805", "0.67934304", "0.6791657", "0.6789546", "0.6789006", "0.67878324", "0.67877173", "0.6781847", "0.6765398", "0.6765197", "0.6764246", "0.6756036", "0.6755023", "0.6751404", "0.67508715", "0.6743043", "0.67387456", "0.6736752", "0.67356426", "0.6732893", "0.6726715", "0.6726464", "0.67196447", "0.67157453", "0.6714399", "0.67140275", "0.6708251", "0.6707117", "0.670393", "0.6700697", "0.66995865", "0.66989213", "0.6697588", "0.66939527", "0.66908985", "0.668935" ]
0.0
-1
Returns a copy of the self
public MutableString copy() { return new MutableString(this.value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object clone(){\n \t\n \treturn this;\n \t\n }", "public Object clone() {\n return this.copy();\n }", "public CopyBuilder copy() {\n return new CopyBuilder(this);\n }", "protected Shingle copy() {\n return new Shingle(this);\n }", "public Coordinates copy() {\n\t\treturn new Coordinates(this);\n\t}", "public Dispatchable copy() {\n return this;\n }", "@Override\n public TopicObject copy() {\n return new TopicObject(this);\n }", "public T copy() {\n T ret = createLike();\n ret.getMatrix().setTo(this.getMatrix());\n return ret;\n }", "@Override\n public Object clone() {\n return super.clone();\n }", "public Record copy() {\n\t\treturn new Record(video, numOwned, numOut, numRentals);\n\t}", "public Tree<K, V> copy() {\n\t\tTree<K, V> copy = EmptyTree.getInstance(), t = this;\n\t\treturn copy(t, copy);\n\t}", "public /*@ non_null @*/ Object clone() {\n return this;\n }", "public ConfabulatorObject getCopy() {\n\t\tConfabulatorObject copy = new ConfabulatorObject(getMessenger());\n\t\tlockMe(this);\n\t\tint maxD = maxLinkDistance;\n\t\tint maxC = maxLinkCount;\n\t\tList<Link> linksCopy = new ArrayList<Link>();\n\t\tfor (Link lnk: links) {\n\t\t\tlinksCopy.add(lnk.getCopy());\n\t\t}\n\t\tunlockMe(this);\n\t\tcopy.initialize(maxD,maxC,linksCopy);\n\t\treturn copy;\n\t}", "public Record copy() {\n return new Record(\n this.id,\n this.location.copy(),\n this.score\n );\n }", "public StateInfo copy() {\n return new StateInfo(this);\n }", "public Object clone() {\n // No problems cloning here since private variables are immutable\n return super.clone();\n }", "public O copy() {\n return value();\n }", "@Override\n\tpublic Expression copy() {\n\t\treturn null;\n\t}", "public QueueEntry copy() {\n return new QueueEntry(playerName, string, loc, type);\n }", "@Override\n public LocalStore<V> copy() {\n return this;\n }", "public Line copy() {\n return new Line(getWords());\n }", "private Shop deepCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n List<Book> books = new ArrayList<>();\n Iterator<Book> iterator = this.getBooks().iterator();\n while(iterator.hasNext()){\n\n books.add((Book) iterator.next().clone());\n }\n obj.setBooks(books);\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "public BufferTWeak cloneMe() {\r\n BufferTWeak ib = new BufferTWeak(uc);\r\n ib.increment = increment;\r\n ib.set(new Object[objects.length]);\r\n for (int i = 0; i < objects.length; i++) {\r\n ib.objects[i] = this.objects[i];\r\n }\r\n ib.offset = this.offset;\r\n ib.count = this.count;\r\n return ib;\r\n }", "public Position copy() {\n return new Position(values.clone());\n }", "@Override\n\tpublic CanvasItem copy() {\n\t\treturn null;\n\t}", "public Encoding copy() {\n\t\treturn new Encoding(this);\n\t}", "private LinkgrabberFilterRule getCurrentCopy() {\r\n LinkgrabberFilterRule ret = this.rule.duplicate();\r\n save(ret);\r\n return ret;\r\n }", "private Shop shallowCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "private void selfClone() {\n stroke = stroke.clone();\n }", "@Override\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS(this.ga);//create the copy graph via copy constructor\n return copy;\n }", "@Override\n public Piece copy() {\n return new Knight(this.getSide(), this.getCoordinate());\n }", "public Object clone() {\r\n try {\r\n return super.clone();\r\n } catch (CloneNotSupportedException e) {\r\n return null;\r\n }\r\n }", "@Override\n public RawStore copy() {\n return new RawStore(this.toRawCopy2D(), myNumberOfColumns);\n }", "@Override\n public Board clone() {\n return new Board(copyOf(this.board));\n }", "public Ping dup (Ping self)\n {\n if (self == null)\n return null;\n\n Ping copy = new Ping ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.digest = new ArrayList <State> (self.digest);\n return copy;\n }", "@Override\n public ChatReceivePacket copy() {\n return new ChatReceivePacket(this);\n }", "public Object clone()\n {\n PSRelation copy = new PSRelation(new PSCollection(m_keyNames.iterator()),\n new PSCollection(m_keyValues.iterator()));\n \n copy.m_componentState = m_componentState;\n copy.m_databaseComponentId = m_databaseComponentId;\n copy.m_id = m_id;\n\n return copy;\n }", "public JsonMember copy() {\n return new JsonMember(name, value.copy());\n }", "public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }", "public Results copy()\n {\n Results copy = new Results();\n for(Object object : results) {\n copy.add( object );\n }\n return copy;\n }", "@Override\n public Interval clone() {\n return this;\n }", "public MapVS<K, T, V> getCopy() {\n return new MapVS(this);\n }", "Prototype makeCopy();", "public void copy() {\n\n\t}", "public DessertVO clone() {\r\n return (DessertVO) super.clone();\r\n }", "public Object clone() {\n try {\n // clones itself\n return super.clone();\n } catch (Exception exception) {\n ;\n }\n return null;\n }", "public Sudoku copy(){\n\t\treturn (Sudoku) this.clone();\n\t}", "public Object clone() {\n return new PointImpl( this );\n }", "public Card copy(){\n return new Card(Suits, Value);\n }", "public Client copy() {\n\t\tClient clone = new Client(ID, Email, PostalAddress);\n\t\treturn(clone);\n\t}", "public Object clone() {\n\t\ttry {\n\t\t\treturn super.clone();\n\t\t}\n\t\tcatch(CloneNotSupportedException exc) {\n\t\t\treturn null;\n\t\t}\n\t}", "public Line copy() {\r\n Line l = new Line();\r\n l.line = new ArrayList < Point > (this.line);\r\n l.direction = this.direction;\r\n l.clickedPoint = this.clickedPoint;\r\n return l;\r\n }", "public Matrix copy() {\n Matrix m = new Matrix(rows, cols);\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n m.getMatrix().get(i)[j] = this.get(i, j);\n }\n }\n return m;\n }", "public FunctionLibrary copy() {\n return this;\n }", "public AxisAlignedBB copy() {\n\t\treturn getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);\n\t}", "@Override \n public Object clone() {\n try {\n Resource2Builder result = (Resource2Builder)super.clone();\n result.self = result;\n return result;\n } catch (CloneNotSupportedException e) {\n throw new InternalError(e.getMessage());\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n public Object clone() {\r\n try {\r\n OCRSet<E> newSet = (OCRSet<E>) super.clone();\r\n newSet.map = (HashMap<Integer, E>) map.clone();\r\n return newSet;\r\n } catch (CloneNotSupportedException e) {\r\n throw new InternalError();\r\n }\r\n }", "@Override\n public AbstractRelic makeCopy() {\n return new Compendium();\n }", "public Object clone()\n {\n return new ReportConstraints(this);\n }", "@Override\n\tpublic function copy() {\n\t\tMonom M=new Monom(this.get_coefficient(),this.get_power());\n\t\t\n\t\treturn M;\n\t}", "public SoPickedPoint \ncopy() \n//\n////////////////////////////////////////////////////////////////////////\n{\n SoPickedPoint newCopy = new SoPickedPoint(this);\n return newCopy;\n}", "@Override\n public FieldEntity copy()\n {\n return state.copy();\n }", "public Query copy() {\r\n\tQuery queryCopy = new Query();\r\n\tqueryCopy.terms = (LinkedList<String>) terms.clone();\r\n\tqueryCopy.weights = (LinkedList<Double>) weights.clone();\r\n\treturn queryCopy;\r\n }", "public ShortNBT copy() {\n return this;\n }", "@Override\n public UserProfile copy() {\n UserProfile userProfile = new UserProfile();\n copyTo(userProfile);\n return userProfile;\n }", "public Update clone() {\n return (Update)cloneContent(new Update());\n }", "@Override\r\n\tpublic Buffer copy() {\n\t\t\r\n\t\treturn null;\r\n\t}", "public Object clone () {\n\t\t\ttry {\n\t\t\t\treturn super.clone();\n\t\t\t} catch (CloneNotSupportedException e) {\n\t\t\t\tthrow new InternalError(e.toString());\n\t\t\t}\n\t\t}", "public Object clone() {\n try {\n return super.clone();\n } catch (Exception exception) {\n throw new InternalError(\"Clone failed\");\n }\n }", "public Object clone() {\n View v2;\n try {\n v2 = (View) super.clone();\n } catch (CloneNotSupportedException cnse) {\n v2 = new View();\n }\n v2.center = (Location) center.clone();\n v2.zoom = zoom;\n v2.size = (Dimension) size.clone();\n return v2;\n }", "public CellIdentityWcdma copy() {\n return new CellIdentityWcdma(this);\n }", "@Override\r\n public NumericObjectArrayList makeDeepCopy() {\r\n NumericObjectArrayList list = new NumericObjectArrayList();\r\n for (int i = 0; i < this.getCount(); i++) {\r\n try {\r\n list.insert(i, this.getValueAt(i));\r\n } catch (IndexRangeException ex) {\r\n //Shouldn't happen\r\n }\r\n }\r\n return list;\r\n }", "public AST copy()\n {\n return new Implicate(left, right);\n }", "public Feature copy() {\n\t\tFeature ret = new AbbeelFeature();\n\t\treturn ret;\n\t}", "public Square copy() {\n\t\tSquare s = new Square(x,y);\n\t\ts.z = z;\n\t\ts.c = new Color(c.getRGB());\n\t\treturn s;\n\t}", "public Gateway copyChanges() {\n Gateway copy = new Gateway();\n copy.mergeChanges(this);\n copy.resetChangeLog();\n return copy;\n }", "@Override\n public MultiCache clone () {\n return new MultiCache(this);\n }", "public Table shallowCopy() {\n\t\tSubsetTableImpl vt =\n\t\t\tnew SubsetTableImpl(this.getColumns(), this.subset);\n\t\tvt.setLabel(getLabel());\n\t\tvt.setComment(getComment());\n\t\treturn vt;\n\t}", "public PingEnd dup (PingEnd self)\n {\n if (self == null)\n return null;\n\n PingEnd copy = new PingEnd ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.digest = new ArrayList <State> (self.digest);\n return copy;\n }", "public MappingInfo copy()\r\n\t{\r\n\t\tArrayList<MappingCell> mappingCells = new ArrayList<MappingCell>();\r\n\t\tfor(MappingCell mappingCell : mappingCellHash.get())\r\n\t\t\tmappingCells.add(mappingCell);\r\n\t\treturn new MappingInfo(mapping.copy(),mappingCells);\r\n\t}", "public Restaurant clone() {\r\n return new Restaurant(this);\r\n }", "@Override\n\tpublic Message clone() {\n\t\treturn this;\n\t}", "@Override\n\tpublic Message clone() {\n\t\treturn this;\n\t}", "@Override\n\tpublic Message clone() {\n\t\treturn this;\n\t}", "public Object clone() throws CloneNotSupportedException { return super.clone(); }", "public SimpleStyle copy() {\n\t\tSimpleStyle simpleStyle = new SimpleStyle();\n\t\tcopyIn(simpleStyle);\n\t\treturn simpleStyle;\n\t}", "public User copy() {\r\n try {\r\n return (User) BeanUtils.cloneBean(this);\r\n } catch (Exception e) {\r\n throw new IllegalStateException(\"Error while copying \" + this, e);\r\n }\r\n }", "public PingOk dup (PingOk self)\n {\n if (self == null)\n return null;\n\n PingOk copy = new PingOk ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.request = new ArrayList <State> (self.request);\n copy.response = new ArrayList <State> (self.response);\n return copy;\n }", "Model copy();", "@Override\n protected Object clone() throws CloneNotSupportedException {\n\n return super.clone();\n }", "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\t\r\n\t\treturn super.clone();\r\n\t}", "public Address copy() {\n\t\tAddress copy = new Address(this.street, this.city, this.state, this.zipCode);\n\t\treturn copy;\n\t}", "public Object clone() {\n\t\ttry {\n\t\t\tAbstractHashSet newSet = (AbstractHashSet) super.clone();\n\t\t\tnewSet.map = (DelegateAbstractHashMap) map.clone();\n\t\t\treturn newSet;\n\t\t} catch (CloneNotSupportedException e) {\n\t\t\tthrow new InternalError();\n\t\t}\n\t}", "@Override\n\tpublic Object clone() {\n\t\treturn null;\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "private QARange cloneThis(){\n QARange retval = new QARange();\n retval.setName(this.getName());\n retval.setCardTypes(this.getCardTypes());\n retval.setCustom(this.getCustom());\n if (retval.getRangeValues()==null){\n retval.setRangeValues(new RealmList<QARangeValue>());\n }\n\n for (QARangeValue val: getRangeValues()) {\n retval.getRangeValues().add(val);\n }\n for (String cardType : getSupportedCardList()){\n retval.getSupportedCardList().add(cardType);\n }\n return retval;\n }", "public Object clone() {\n // No problems cloning here since private variables are immutable\n return (InstTexes) super.clone();\n }", "@Override\r\n public Object clone() {\r\n\r\n Coordinate c = new Coordinate( this );\r\n return c;\r\n }", "public Whisper dup (Whisper self)\n {\n if (self == null)\n return null;\n\n Whisper copy = new Whisper ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.content = self.content.duplicate ();\n return copy;\n }" ]
[ "0.77465636", "0.7622744", "0.7448444", "0.7384332", "0.7344574", "0.7227278", "0.71933854", "0.7170524", "0.70672196", "0.7029233", "0.70001626", "0.6981551", "0.6966796", "0.69644207", "0.6958846", "0.6898016", "0.68888855", "0.6872299", "0.686177", "0.68497926", "0.6847799", "0.6809043", "0.6781959", "0.6768045", "0.67548317", "0.6750158", "0.6747807", "0.67309165", "0.6722362", "0.6721375", "0.67036724", "0.6699606", "0.66971445", "0.6689477", "0.6685659", "0.66852134", "0.66835654", "0.6667704", "0.6664634", "0.6655266", "0.6636525", "0.66274637", "0.6626011", "0.6622236", "0.66138655", "0.661103", "0.6610419", "0.6604496", "0.65928864", "0.6592242", "0.65882826", "0.65843534", "0.6582732", "0.6567966", "0.6559346", "0.65549433", "0.65469354", "0.6544978", "0.6534537", "0.65327615", "0.6530063", "0.6528981", "0.6527257", "0.6525439", "0.6509385", "0.6509347", "0.6506566", "0.65065646", "0.64985603", "0.64942896", "0.64924455", "0.6478788", "0.64697385", "0.64673734", "0.6466446", "0.64637184", "0.6463717", "0.6458301", "0.6457211", "0.6453695", "0.6451612", "0.645094", "0.645094", "0.645094", "0.6445716", "0.64399636", "0.64385843", "0.6438192", "0.6434046", "0.6430776", "0.6430767", "0.6426091", "0.64230627", "0.6421583", "0.64193", "0.64193", "0.64193", "0.6417", "0.6415244", "0.6414044", "0.64135045" ]
0.0
-1
Finds the next matched element from the string and updates the string snipping that portion.
public String findAndSnip(final Pattern pattern, final boolean trim, final boolean start) { Argument.notNull(pattern, "pattern"); String finalValue = trim ? this.value.trim() : this.value; final Matcher matcher = pattern.matcher(finalValue); String foundString = null; if(matcher.find() && (!start || matcher.start() == 0)) { foundString = finalValue.substring(matcher.start(), matcher.end()); this.value = matcher.replaceFirst(""); } return foundString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String nextString() {\n last = (last + 1) % str.length;\n return str[last];\n }", "public String getNextMatchFromHTML(String strValue) {\n\t\treturn null;\n\t}", "void updateNextMove(String str) {\n _nextMove = getMove(str);\n _ready = true;\n }", "public void advance() {\n if( mMatches.hasNext() ) {\n setCurrent( mMatches.next() );\n }\n }", "public void incrParser(String str){\r\n\r\n String[] words = str.split(\" \");\r\n String word = words[words.length - 1];\r\n word = word.substring(0,word.length() - 1);\r\n this.values.replace(word,values.get(word) + 1);\r\n\r\n }", "public void setNextPieceString(final String theString) {\n this.myNextPiece.setNextPieceString(theString);\n }", "void replaceNext() {\n if (mte.getJtext().getSelectionStart() == mte.getJtext().getSelectionEnd()) {\n findNextWithSelection();\n return;\n }\n String searchText = findWhat.getText();\n String temp = mte.getJtext().getSelectedText(); //get selected text\n\n//check if the selected text matches the search text then do replacement\n if ((matchCase.isSelected() && temp.equals(searchText))\n || (!matchCase.isSelected() && temp.equalsIgnoreCase(searchText))) {\n mte.getJtext().replaceSelection(replaceWith.getText());\n }\n\n findNextWithSelection();\n }", "private int getNextMatch(String searchText) {\n \tint startPosition = textArea.getCaretPosition()+1;\n \treturn document.getContent().indexOf(searchText, startPosition);\n }", "public String atFirst(String str) {\r\n return str.length() > 1 ? str.substring(0, 2) : (str + \"@@\").substring(0, 2);\r\n }", "private void adjustHits(Node winner, String string) {\n\t\tIterator<HitHolder> ite = winner.hitList.iterator();\n\t\tHitHolder temp = null;\n\t\tboolean exists = false;\n\t\t\n\t\t\n\t\twhile(ite.hasNext())\n\t\t{\n\t\t\ttemp = ite.next();\n\t\t\t\n\t\t\tif(temp.element.equalsIgnoreCase(string))\n\t\t\t{\n\t\t\t\tif(temp.getFirstIteration() == -1)\n\t\t\t\t{\n\t\t\t\t\ttemp.firstIteration = CURRENT_ITERATION;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttemp.lastIteration = CURRENT_ITERATION;\n\t\t\t\ttemp.numberOfHits++;\n\t\t\t\texists = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!exists)\n\t\t{\n\t\t\twinner.hitList.add(new HitHolder(string, CURRENT_ITERATION));\n\t\t}\n\t}", "private String getTextInNextElement(String text, String tag, int pos) throws ParseException {\n Pair<Integer, String> result = htmlInTag(text, tag, pos);\n if (result == null) {\n throw new ParseException(\"Cannot find \" + tag + \" in html.\", pos);\n }\n int holdPosition = result.first;\n text = result.second;\n\n if (!text.isEmpty() && text.charAt(0) == '<') {\n tag = findCurrentTag(text, 0);\n text = getTextInNextElement(text, tag, 0);\n position = holdPosition;\n return text;\n }\n\n text = text.replaceAll(\"&nbsp;\", \" \").trim();\n position = holdPosition;\n return text;\n }", "@Override\n public IABTNode updateNode(String substring, String word, int index) {\n int descendNode = this.descend(substring.charAt(index));\n IABTNode newNode;\n if(descendNode == 1){\n newNode = new ABTNode(substring.charAt(index+1));\n } else {\n newNode = new ABTNode(substring.charAt(index));\n }\n newNode.setKey(word, -1);\n this.sons.set(descendNode, newNode);\n return this.sons.get(descendNode);\n }", "void highlightNextWord() {\n\t\tif(findIndex < finder.size()) {\n\t\t\ttextEditor.getHighlighter().removeAllHighlights();\n\t\t\ttry {\n\t\t\t\thighlighter.addHighlight(finder.get(findIndex).p1, \n\t\t\t\t\t\tfinder.get(findIndex).p2-1, painter);\n\t\t\t} catch (BadLocationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfindIndex++;\n\t\t}\n\t\telse {\n\t\t\tfindIndex = 0;\n\t\t}\n\t}", "public void updateMatchFromString(String resultString){\r\n String team1;\r\n String team2;\r\n int score1;\r\n int score2;\r\n \r\n //Separate the string data \r\n //Split the space\r\n String[] splitString = resultString.split(\"\\\\s+\", 5);\r\n \r\n //Store it sorted into the variables\r\n if (splitString[0].compareTo(splitString[2]) < 0){\r\n team1 = splitString[0];\r\n score1 = Integer.parseInt(splitString[1]);\r\n team2 = splitString[2];\r\n score2 = Integer.parseInt(splitString[3]);\r\n }\r\n else {\r\n team1 = splitString[2];\r\n score1 = Integer.parseInt(splitString[3]);\r\n team2 = splitString[0];\r\n score2 = Integer.parseInt(splitString[1]);\r\n }\r\n \r\n //Find the corresponding match in the tree\r\n Match m;\r\n if ((m = this.findMatchFromTeamName(team1, team2)) == null){\r\n return;\r\n }\r\n \r\n //Update the match\r\n m.setScore1(score1);\r\n m.setScore2(score2);\r\n \r\n //Update the teams\r\n this.updateTeamFromResults(m);\r\n }", "public String next()\r\n/* 35: */ {\r\n/* 36:42 */ String thisResult = this.nextResult;\r\n/* 37: */ \r\n/* 38:44 */ this.nextResult = Tags.untagTopLevelString(this.start, this.input);\r\n/* 39:49 */ if (this.nextResult == null) {\r\n/* 40:49 */ return thisResult;\r\n/* 41: */ }\r\n/* 42:51 */ int index = this.input.indexOf(this.nextResult) + this.nextResult.length();\r\n/* 43: */ \r\n/* 44:53 */ index = this.input.indexOf(\"</\" + this.start + \">\", index) + 3 + this.start.length();\r\n/* 45: */ \r\n/* 46:55 */ this.input = this.input.substring(index);\r\n/* 47: */ \r\n/* 48:57 */ this.nextResult = Tags.tag(this.start, this.nextResult);\r\n/* 49: */ \r\n/* 50: */ \r\n/* 51: */ \r\n/* 52: */ \r\n/* 53:62 */ return thisResult;\r\n/* 54: */ }", "public void update() {\r\n if (parseStyle == ParseStyle.CHARACTER) {\r\n wrapText();\r\n int begin = getPosition();\r\n int end = getPosition() + 1;\r\n setCurrentItem(new TextItem(begin, end, getText().substring(begin,\r\n end)));\r\n setPosition(end);\r\n } else if (parseStyle == ParseStyle.WORD) {\r\n if (matcher == null) {\r\n return;\r\n }\r\n wrapText();\r\n boolean matchFound = findNextToken();\r\n if (matchFound) {\r\n selectCurrentToken();\r\n } else {\r\n // No match found. Go back to the beginning of the text area\r\n // and select the first token found\r\n setPosition(0);\r\n updateMatcher();\r\n // Having wrapped to the beginning select the next token, if\r\n // there is one.\r\n if (findNextToken()) {\r\n selectCurrentToken();\r\n }\r\n }\r\n }\r\n\r\n }", "public void next() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getNextMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getNextModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }", "private String findReplace(String str, String find, String replace)\n/* */ {\n/* 944 */ String des = new String();\n/* 945 */ while (str.indexOf(find) != -1) {\n/* 946 */ des = des + str.substring(0, str.indexOf(find));\n/* 947 */ des = des + replace;\n/* 948 */ str = str.substring(str.indexOf(find) + find.length());\n/* */ }\n/* 950 */ des = des + str;\n/* 951 */ return des;\n/* */ }", "public String nextTo(String str) {\n char next;\n AppMethodBeat.m2504i(50194);\n StringBuffer stringBuffer = new StringBuffer();\n while (true) {\n next = next();\n if (str.indexOf(next) < 0 && next != 0 && next != 10 && next != 13) {\n stringBuffer.append(next);\n } else if (next != 0) {\n back();\n }\n }\n if (next != 0) {\n }\n String trim = stringBuffer.toString().trim();\n AppMethodBeat.m2505o(50194);\n return trim;\n }", "private String findReplace(String str, String find, String replace)\n/* */ {\n/* 938 */ String des = new String();\n/* 939 */ while (str.indexOf(find) != -1) {\n/* 940 */ des = des + str.substring(0, str.indexOf(find));\n/* 941 */ des = des + replace;\n/* 942 */ str = str.substring(str.indexOf(find) + find.length());\n/* */ }\n/* 944 */ des = des + str;\n/* 945 */ return des;\n/* */ }", "private void findNext() {\n \tthis.find(true);\n }", "static void getNext(String T, int[] next) {\n\t\tint i = 0, j = -1;\n\t\tnext[0] = -1;\n\t\tint n = next.length;\n\t\twhile (i < n - 1) {\n\t\t\twhile (j > -1 && T.charAt(j) != T.charAt(i)) j = next[j];\n\t\t\t++i; ++j;\n\t\t\tif (i < n - 1 && T.charAt(j) == T.charAt(i)) next[i] = next[j];\n\t\t\telse next[i] = j;\n\t\t\t/*\n\t\t\tif (j == -1 || T.charAt(i) == T.charAt(j))\n\t\t\t\tnext[++i] = ++j;\n\t\t\telse\n\t\t\t\tj = next[j];\n\t\t\t\t*/\n\t\t}\n\t}", "private static String findSubString2(int index, int len, String s2) {\n\t\tint wLen = len - 1;\n\t\tint remLen = s2.length() - index;\n\t\tif (remLen <= wLen) {\n\t\t\treturn s2.substring(0, index) + s2.substring(index, index+remLen);\n\t\t} else {\n\t\t\tif (index == 0) {\n\t\t\t\treturn s2.substring(0, index) + s2.substring(index, len);\n\t\t\t}\n\t\t\treturn s2.substring(0, index) + s2.substring(index, len+1);\n\t\t}\n\t}", "private char advance() {\n current++;\n return source.charAt(current - 1);\n }", "@Override\n public String next() {\n assert(this.hasNext());\n Element currParagraphElement = this.paragraphs.get(this.paragraphIndex);\n String currParagraph = currParagraphElement.wholeText();\n\n ++this.paragraphIndex;\n\n return currParagraph;\n }", "private static String incrementStringByOne(String prefix) {\n StringBuilder end = new StringBuilder(prefix);\n\n int lastPos = end.length() - 1;\n // This is basically end[lastPos] += 1\n end.setCharAt(lastPos, Chars.checkedCast(end.charAt(lastPos) + 1));\n\n return end.toString();\n }", "private static String removeHelper(String s, int index) {\r\n \tif (index == 0) {\r\n \t\treturn s;\r\n \t}\r\n \telse {\r\n \t\tchar cur = s.charAt(index);\r\n \t\tchar prev = s.charAt(index - 1);\r\n \t\tString result = s.substring(0, index);\r\n \t\tif (cur == prev) {\r\n \t\t\treturn removeHelper(result, index - 1);\r\n \t\t}\r\n \t\telse {\r\n \t\t\treturn removeHelper(result, index - 1) + cur;\r\n \t\t}\r\n \t}\r\n }", "private String findReplace(String str, String find, String replace)\n/* */ {\n/* 935 */ String des = new String();\n/* 936 */ while (str.indexOf(find) != -1) {\n/* 937 */ des = des + str.substring(0, str.indexOf(find));\n/* 938 */ des = des + replace;\n/* 939 */ str = str.substring(str.indexOf(find) + find.length());\n/* */ }\n/* 941 */ des = des + str;\n/* 942 */ return des;\n/* */ }", "public void insertAfterCursor(String s) {\n if(this.isEmpty())\n {\n lines.addFirst(s);\n }\n else\n lines.addAfter(new PositionObject<>(lines.get(cursor)), s);\n cursor++;\n }", "public static String getNext(String s1,String s2){\n\t\tint x = s1.indexOf(s2) + s2.length();\n\t\tif(x==s2.length()-1)\n\t\t\treturn null;\n\t\tString[] arr = s1.substring(x).split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\", -1)[1].split(\"\\n\");\n\t\treturn arr[0];\n\t}", "public void setNextLocation(String s) {\n if (s == null) nextLocation = \"\";\n else nextLocation = s;\n }", "public void moveNext() {\n\t\tcurrentElement++;\n\t}", "private void updateGuessedWord(String guessedLetter) {\n\t\tint guessIndex = 0;\n\t\tint indexOffset = 0;\n\t\t//we loop here because there can potentially be multiple instances of guessedLetter in actualWord\n\t\twhile (indexOffset < actualWord.length()) { //could be while true, but this protects against double letters at end of word\n\t\t\tguessIndex = actualWord.indexOf(guessedLetter, indexOffset);\n\t\t\tif (guessIndex < 0) return; //exits loop if no further instances of guessed letter are in actual word\n\t\t\telse {\n\t\t\t\tguessedWord = guessedWord.substring(0, guessIndex) + guessedLetter + guessedWord.substring(guessIndex + 1);\n\t\t\t\tindexOffset = guessIndex + 1;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public String next() {\n if(current<m_list.size())\r\n {\r\n String str = m_list.get(current);\r\n current++;\r\n return str;\r\n }\r\n m_list = getNextLevel(m_list, m_chars);\r\n current = 1;\r\n return m_list.get(0);\r\n \r\n }", "String getNext();", "String getNext();", "private void changeCurrentValue()\n {\n String theText = textBox.toString();\n\n // find the first newline\n int index = theText.indexOf(\"\\n\");\n assert index != -1;\n\n // insert new stuff\n StringBuilder newText = new StringBuilder();\n newText.append(currentTag);\n newText.append(\": \");\n newText.append(currentValue);\n newText.append(\"\\n\");\n\n textBox.replaceTextRange(0, index, newText.toString());\n }", "private static String insert(String input, int index, String toInsert) {\n return input.substring(0, index) + toInsert + input.substring(index);\n }", "private static String findSubString(int index, int len, String s2) {\n\t\tif ((s2.length() - index) >= len) {\n\t\t\treturn s2.substring(index - len + 1, index) + s2.substring(index, index+len);\n\t\t} else {\n\t\t\treturn s2.substring(index - len + 1, index) + s2.substring(index);\n\t\t}\n\t}", "public void updateNextPlayer(String nextPlayer) {\n\t\titem.setText(7, nextPlayer);\n\t}", "private Object getNext(String txt, String originalText) {\n return getNext(txt, originalText, null);\n }", "public String tweakFront(String str) {\n\n if(str.substring(0, 1).equalsIgnoreCase(\"a\")){\n\n if(!str.substring(1, 2).equalsIgnoreCase(\"b\")){\n str = str.substring(0, 1) + str.substring(2,str.length());\n }\n \n }else{\n str = str.substring(1);\n \n if(str.substring(0, 1).equalsIgnoreCase(\"b\")){\n \n }else{\n str = str.substring(1);\n }\n }\n \n \n \n return str;\n \n}", "public static int nextIndexOf(String string, String characters, int index) {\n int retInd = string.length();\n int auxIndex = -1;\n \n for (int i = 0; i < characters.length(); i++) {\n auxIndex = string.substring(index + 1).indexOf(characters.charAt(i));\n if ((auxIndex > -1) && (auxIndex + index + 1 < retInd)) {\n retInd = auxIndex + index + 1;\n }\n }\n return retInd;\n }", "private void setCurrentMatch(SingleMatch newMatch) {\n\t\tcurrentMatch = newMatch;\n\t}", "@Override\r\n\tpublic String nextElement() {\n\t\treturn it.next();\r\n\t}", "public String replaceString(String s, String one, String another) {\n if (s.equals(\"\")) return \"\";\n String res = \"\";\n int i = s.indexOf(one,0);\n int lastpos = 0;\n while (i != -1) {\n res += s.substring(lastpos,i) + another;\n lastpos = i + one.length();\n i = s.indexOf(one,lastpos);\n }\n res += s.substring(lastpos); // the rest\n return res;\n }", "public byte[] after(final byte[] string, final byte[] sub, final InputInfo info)\n throws QueryException {\n\n final String st = string(string);\n final int i = indexOf(st, string(sub), false, false, info);\n return i == -1 ? EMPTY : token(st.substring(i));\n }", "private String replaceStr(String src, String oldPattern, \n String newPattern) {\n\n String dst = \"\"; // the new bult up string based on src\n int i; // index of found token\n int last = 0; // last valid non token string data for concat \n boolean done = false; // determines if we're done.\n\n if (src != null) {\n // while we'er not done, try finding and replacing\n while (!done) {\n // search for the pattern...\n i = src.indexOf(oldPattern, last);\n // if it's not found from our last point in the src string....\n if (i == -1) {\n // we're done.\n done = true;\n // if our last point, happens to be before the end of the string\n if (last < src.length()) {\n // concat the rest of the string to our dst string\n dst = dst.concat(src.substring(last, (src.length())));\n }\n } else {\n // we found the pattern\n if (i != last) {\n // if the pattern's not at the very first char of our searching point....\n // we need to concat the text up to that point..\n dst = dst.concat(src.substring(last, i));\n }\n // update our last var to our current found pattern, plus the lenght of the pattern\n last = i + oldPattern.length();\n // concat the new pattern to the dst string\n dst = dst.concat(newPattern);\n }\n }\n } else {\n dst = src;\n }\n // finally, return the new string\n return dst;\n }", "private String getItemAt(String s, int index) {\n\t\tString temp = new String();\n\t\tStringTokenizer st = new StringTokenizer(s);\n\t\t\n\t\tif(index > st.countTokens()) {\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\t\n\t\tfor(int j = 1; j<=index; j++) {\n\t\t\ttemp = st.nextToken();\n\t\t}\n\t\t\n\t\treturn temp;\n\t}", "private final void r(String s) { if (m() > 0) setto(s); }", "private Token advance() {\n if(!isAtEnd()) current++;\n return previous();\n }", "@Override\n public String next() {\n return bikes[currentIndex++];\n }", "public String substituteSrc(String workString, String oldStr, String newStr) {\n int oldStrLen = oldStr.length();\n int newStrLen = newStr.length();\n String tempString = \"\";\n \n int i = 0, j = 0;\n while (j > -1) {\n j = workString.indexOf(oldStr, i);\n if (j > -1) {\n tempString = workString.substring(0, j) + newStr + workString.substring(j+oldStrLen);\n workString = tempString;\n i = j + newStrLen;\n }\n }\n \n return workString;\n }", "public Point next(Point point)\n {\n assert(_index >= 0);\n assert(_index < _pattern.length);\n\n apply(point);\n\n // Don't need to code defensively. Long live assertions.\n if (++_index == _pattern.length) _index = 0;\n\n return point;\n }", "protected int replace_s(int c_bra, int c_ket, String s)\n {\n\tint adjustment = s.length() - (c_ket - c_bra);\n\tcurrent.replace(c_bra, c_ket, s);\n\tlimit += adjustment;\n\tif (cursor >= c_ket) cursor += adjustment;\n\telse if (cursor > c_bra) cursor = c_bra;\n\treturn adjustment;\n }", "public String previewNextToken() {\r\n matcher.find();\r\n String nextOne = matcher.group();\r\n updateMatcher(); // Return matcher to its previous state\r\n return nextOne;\r\n }", "public void goToNextTag(String tag) throws ParseException {\n // Get the text inside the column\n String open = \"<\" + tag;\n int pos = html.indexOf(open, position + 1);\n if (pos == -1) {\n throw new ParseException(\"Cannot skip tag because open \" + tag + \" doesnt exist.\", position);\n }\n position = pos;\n }", "private static void extractAlpha(List<String> result, StringBuilder chunk, String string, int index) {\n if (index == string.length()) {\n result.add(chunk.toString());\n return;\n }\n\n char literal = string.charAt(index);\n if (Character.isDigit(literal)) {\n if (chunk.length() > 0) {\n result.add(chunk.toString());\n }\n\n extractNumeric(result, new StringBuilder(), string, index);\n } else {\n chunk.append(literal);\n extractAlpha(result, chunk, string, index + 1);\n }\n }", "protected String replaceIthB(String s, int i) {\n\t\tint cur_b_count = -1;\n\t\tchar[] s_array = s.toCharArray();\n\t\t\n\t\tfor (int pos = 0;pos < s.length();pos++) {\n\t\t\tif (s.charAt(pos) == 'B') {\n\t\t\t\tcur_b_count++;\n\t\t\t\t\n\t\t\t\tif (cur_b_count == i-1) {\n\t\t\t\t\ts_array[pos] = 'A';\n\t\t\t\t\treturn new String(s_array);\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\treturn s;\n\t}", "private void moveMatchingNodeToNextElement(Node tmp) {\n for (int i = 0; i < ALL_LINKED_LISTS.size();i++) {\n Node next = ALL_LINKED_LISTS.get(i);\n if (tmp.equals(next)) {\n next = next.next;\n ALL_LINKED_LISTS.put(i, next);\n break;\n }\n }\n }", "@Override\n\tpublic String strreplace(String str, int start, int end, String with) {\n\t\treturn null;\n\t}", "void updateMatcher() {\r\n int begin = getPosition();\r\n int end = getText().length();\r\n // System.out.println(begin + \",\" + end);\r\n matcher.reset(getText());\r\n matcher.region(begin, end);\r\n }", "public static String updateByIndex(String str, int index, int value) {\r\n\t\tStringBuilder result = new StringBuilder();\r\n\t\tString[] list = str.split(\"-\");\r\n\t\tfor (int i = 0; i < list.length; i++) {\r\n\t\t\tif (index == i)\r\n\t\t\t\tresult.append(value + \"-\");\r\n\t\t\telse\r\n\t\t\t\tresult.append(list[i] + \"-\");\r\n\t\t}\r\n\t\tresult.deleteCharAt(result.length() - 1);\r\n\t\treturn result.toString();\r\n\t}", "public static void main(String[] args) {\n\t\tString str = \"They is students.\";\n\t\tint i=0;\n\t\tfor(;i<str.length();i++){\n\t\t\tif(str.charAt(i)=='i')\n\t\t\t\tif(str.charAt(i+1)=='s'){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t\tStringBuffer sb = new StringBuffer(str);\n\t\tsb.replace(i, i+2, \"are\");\n\t\tSystem.out.println(sb);\n\t}", "public void setNextValue(final String nextValue);", "@Override\n public void update(String string) {\n }", "public String replaceIdentifiers(String str) {\n\t\t\n\t\t//If input is null, return null\n\t\tif(str == null) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//Map to store the identifiers and their first occurrence index\n\t\tMap<String, Integer> identifierMap = new HashMap<String, Integer>();\n\t\t\n\t\t//Other temporary variables\n\t\tStringBuilder finalOutput = new StringBuilder();\n\t\tStringBuilder currIdentifier = new StringBuilder();\t \n\t\tint identifierIndex = 0; \t\t\t//keeps a count of identifier index\n\t\tboolean isIdentifier = false;\t\t//a flag to track if current char is part of an identifier\n\t\t\n\t\t//Loop on input string\n\t\tfor(Character ch : str.toCharArray()) {\n\t\t\t\n\t\t\t//If current char is a letter, append char to currIdentifier, else process currIdentifier \n\t\t\tif(Character.isUpperCase(ch) || Character.isLowerCase(ch)) {\n\t\t\t\tcurrIdentifier.append(ch);\n\t\t\t\tisIdentifier = true;\n\t\t\t} else {\t\t\t\t\n\t\t\t\tif(isIdentifier) {\n\t\t\t\t\t//If new identifier, add to map; else get index\n\t\t\t\t\tif(!identifierMap.containsKey(currIdentifier.toString())) {\t\t\t\t\t\t\n\t\t\t\t\t\tidentifierMap.put(currIdentifier.toString(), identifierIndex);\n\t\t\t\t\t\tfinalOutput.append(currIdentifier);\t//first occurrence, so no $ sign\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tInteger existingIdentifierId = identifierMap.get(currIdentifier.toString());\n\t\t\t\t\t\tfinalOutput.append(\"$\" + existingIdentifierId); //$ sign for subsequent occurrences\n\t\t\t\t\t}\n\t\t\t\t\tidentifierIndex++;\n\t\t\t\t\tcurrIdentifier = new StringBuilder(); //start fresh for next identifier\n\t\t\t\t} \n\t\t\t\t//Append the current char, and set isIdentifier to false\n\t\t\t\tfinalOutput.append(ch);\n\t\t\t\tisIdentifier = false;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t/* This block of code handles the case, when the input string ends in a character. Alternatively, \n\t\t * we can add a unique non-alphabetic character at the end of the input string (just before \n\t\t * the for loop), and remove that char from the finalOutput, just before returning it to \n\t\t * the calling method. \n\t\t */\n\t\tif(isIdentifier) {\n\t\t\tif(!identifierMap.containsKey(currIdentifier.toString())) {\t\t\t\t\t\t\n\t\t\t\t//Adding this last identifier to the map, is not needed as we have already reached the end. \n\t\t\t\t//But in case, we want to use this map for future processing, it is needed.\n\t\t\t\tidentifierMap.put(currIdentifier.toString(), identifierIndex);\n\t\t\t\tfinalOutput.append(currIdentifier);\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\tInteger existingWordId = identifierMap.get(currIdentifier.toString());\n\t\t\t\tfinalOutput.append(\"$\" + existingWordId);\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn finalOutput.toString();\n\t}", "public static int indexOfNextWordStart (\n StringBuilder str, \n int fromIndex, \n boolean slashToSeparate) {\n int i = fromIndex;\n if (i < str.length() && \n (isLevelSeparator (str.charAt(i), slashToSeparate) \n || isTagSeparator (str.charAt(i)))) {\n i++;\n }\n while (i < str.length() && Character.isWhitespace (str.charAt(i))) {\n i++;\n }\n return i;\n }", "public void insertAtCurrentPos(String part)\n {\n StringBuffer newLine = new StringBuffer( this.getLine() );\n\n newLine.insert( this.getPos(), part + ' ' );\n this.line = newLine.toString();\n }", "public void replaceAtCursor(String s) {\n lines.set(cursor, s);\n }", "private boolean SET(String s) {\r\n if (in >= input.length()) return false;\r\n int ch = input.charAt(in);\r\n boolean found = false;\r\n for (int i = 0; i < s.length() && ! found; i++) {\r\n if (ch == s.charAt(i)) found = true;\r\n }\r\n if (found) in++;\r\n return found;\r\n }", "private static int findPreviousStarter(char[] paramArrayOfChar, int paramInt1, int paramInt2, int paramInt3, int paramInt4, char paramChar)\n/* */ {\n/* 1550 */ PrevArgs localPrevArgs = new PrevArgs(null);\n/* 1551 */ localPrevArgs.src = paramArrayOfChar;\n/* 1552 */ localPrevArgs.start = paramInt1;\n/* 1553 */ localPrevArgs.current = paramInt2;\n/* */ \n/* 1555 */ while (localPrevArgs.start < localPrevArgs.current) {\n/* 1556 */ long l = getPrevNorm32(localPrevArgs, paramChar, paramInt3 | paramInt4);\n/* 1557 */ if (isTrueStarter(l, paramInt3, paramInt4)) {\n/* */ break;\n/* */ }\n/* */ }\n/* 1561 */ return localPrevArgs.current;\n/* */ }", "private int findCharacter(char ch, String inputString, int currentIdx) {\n if (inputString.isEmpty()) {\n return -1;\n }\n return inputString.charAt(0) == ch ? currentIdx : findCharacter(ch, inputString.substring(1), ++currentIdx);\n }", "public static List<String> partitionFurther(List<String> inputStrings)\n\t{\n\t\tString lastString = inputStrings.remove(inputStrings.size() - 1);\n\t\tString replacementStringA = \"\";\n\t\tString replacementStringB = \"\";\n\t\tSystem.out.println(\"current last string, \" + lastString);\n\t\tCharacter leadingChar = lastString.charAt(0);\n\t\t//Find out where its last repetition is\n\t\tInteger repeatingIndex = findLastOccurrenceOfCharacterInString(leadingChar, lastString);\n\t\tif(repeatingIndex.equals(0))\n\t\t{\n\t\t\t//If no character repetition exists,\n\t\t\t//just substring that 1 char split up into itself\n\t\t\treplacementStringA = String.valueOf(leadingChar);\n\t\t\treplacementStringB = lastString.substring(1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//We have to do MORE work here.\n\t\t\t//Find where the LAST place every character in replacementStringA exists.\n\t\t\t//The last one\n\t\t\tint tempStore = repeatingIndex;\n\t\t\treplacementStringA = lastString.substring(0,repeatingIndex+1);\n\t\t\treplacementStringB = lastString.substring(repeatingIndex+1);\n\t\t\tInteger lastPlaceOfReplacement = 0;\n\t\t\tfor(int i = 0; i < replacementStringA.length(); i++)\n\t\t\t{\n\t\t\t\tCharacter c = replacementStringA.charAt(i);\n\t\t\t\trepeatingIndex = findLastOccurrenceOfCharacterInString(c, replacementStringB);\n\n\t\t\t\tif(repeatingIndex > lastPlaceOfReplacement)\n\t\t\t\t{\n\t\t\t\t\tlastPlaceOfReplacement = repeatingIndex;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(lastPlaceOfReplacement > 0)\n\t\t\t{\n\t\t\t\treplacementStringA = lastString.substring(0,tempStore+lastPlaceOfReplacement+1);\n\t\t\t\treplacementStringB = lastString.substring(tempStore+lastPlaceOfReplacement+1);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"replacement string A, \" + replacementStringA);\n\t\tSystem.out.println(\"replacement string A, \" + replacementStringB);\n\n\t\t//repeat till the last String is not modified.\n\t\tif(replacementStringB.equals(\"\"))\n\t\t{\n\t\t\treturn inputStrings;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tinputStrings.add(replacementStringA);\n\t\t\tinputStrings.add(replacementStringB);\n\t\t\treturn partitionFurther(inputStrings);\n\t\t}\n\t}", "boolean add(String s, int depth) {\n\n\t\t\t// First case: we are at the end of the string and this is the correct node\n\t\t\tif(depth >= s.length() || (s.charAt(depth) == character.get()) && depth == s.length() - 1) {\n\t\t\t\tAtomicBoolean result = absent;\n\t\t\t\tabsent.set(false);\n\t\t\t\treturn result.get();\n\t\t\t}\n\n\t\t\t// Second case: the next character in the string was found, but this is not the end of the string\n\t\t\t// We continue in member \"suffix\"\n\t\t\tif(s.charAt(depth) == character.get()) {\n\t\t\t\tif (suffix == null || suffix.get().character.get() > s.charAt(depth+1)) \n\t\t\t\t\tsuffix = new AtomicReference<Node>(new Node(s.charAt(depth+1), suffix.get()));\n\t\t\t\treturn suffix.get().add(s, depth+1);\n\t\t\t}\n\n\t\t\t// Third case: the next character in the string was not found\n\t\t\t// We continue in member \"next\"\n\t\t\t// To maintain the order, we may have to add a new node before \"next\" first\n\t\t\tif (next == null || next.get().character.get() > s.charAt(depth))\n\t\t\t\tnext.set(new Node(s.charAt(depth), next.get()));\n\t\n\t\t\treturn next.get().add(s, depth);\n\t\t}", "public int nextIndex(String input, String find, int start, boolean caseSensitive) {\n int textPosn = -1;\n if (input != null && find != null && start < input.length()) {\n if (caseSensitive) { // indexOf() returns -1 if not found\n textPosn = input.indexOf(find, start);\n // If not found from non-starting cursor position, wrap around\n if (start > 0 && textPosn < 0) {\n textPosn = input.indexOf(find);\n }\n } else {\n String lowerCaseText = input.toLowerCase();\n textPosn = lowerCaseText.indexOf(find.toLowerCase(), start);\n // If not found from non-starting cursor position, wrap around\n if (start > 0 && textPosn < 0) {\n textPosn = lowerCaseText.indexOf(find.toLowerCase());\n }\n }\n }\n return textPosn;\n }", "public static VersionNumber suggestNextReleaseVersion(\n VersionSegment versionSegmentToIncrement,\n String versionHintAsString,\n List<String> existingVersions) {\n\n VersionNumber versionHint = VersionNumber.parseVersionHint(versionHintAsString);\n\n Optional<VersionNumber> latestTagInCurrentReleaseTrack = existingVersions.stream()\n .map(ReleaseVersionIncrementer::getVersionNumberOrNull)\n .filter(Objects::nonNull)\n .sorted()\n .filter(\n versionNumber -> isVersionTagPartOfReleaseTrack(versionSegmentToIncrement, versionHint, versionNumber))\n .reduce((first, second) -> second);\n\n // To handle first version tag in a new release track\n if (!latestTagInCurrentReleaseTrack.isPresent()) {\n return versionHint.unlockVersion();\n }\n\n // To handle version bumping within the same release track\n if (isVersionHintGreaterThanVersionTag(versionHint, latestTagInCurrentReleaseTrack.get())) {\n return versionHint.unlockVersion();\n }\n\n if (VersionSegment.MINOR.equals(versionSegmentToIncrement)) {\n return latestTagInCurrentReleaseTrack.get().incrementMinorSegment();\n } else {\n return latestTagInCurrentReleaseTrack.get().incrementPatchSegment();\n }\n }", "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}", "private static String replaceAll(Matcher matcher, String rep) {\n try {\n StringBuffer sb = null ; // Delay until needed\n while(matcher.find()) {\n if ( sb == null )\n sb = new StringBuffer() ;\n else {\n // Do one match of zerolength string otherwise filter out.\n if (matcher.start() == matcher.end() )\n continue ;\n }\n matcher.appendReplacement(sb, rep);\n }\n if ( sb == null )\n return null ;\n matcher.appendTail(sb);\n return sb.toString();\n } catch (IndexOutOfBoundsException ex) {\n throw new ExprEvalException(\"IndexOutOfBounds\", ex) ;\n }\n }", "private String replace(String s) {\n return s.replaceAll(\"C#\", \"1\")\n .replace(\"D#\", \"2\")\n .replace(\"F#\", \"3\")\n .replace(\"G#\", \"4\")\n .replace(\"A#\", \"5\");\n }", "private void replaceAll(char[] string, int length, String target, String newString) {\n int idx = length - 1;\n int newIdx = string.length - 1;\n while (idx >= 0) {\n string[newIdx] = string[idx];\n newIdx--;\n idx--;\n }\n\n int slow = 0; // [0, slow)\n int fast = newIdx + 1; // the index of character being processed [0, fast) processed\n\n // student\n // stxxxnt\n while (fast < string.length) { // must process until reaching end! CAN'T use fast < string.length - target.length() because some characters won't be copied!!\n if (isStartOfTargetString(string, fast, target)) {\n // [fast, end);\n for (int i = 0; i < newString.length(); i++) {\n string[slow] = newString.charAt(i);\n slow++;\n }\n fast += target.length();\n } else {\n string[slow] = string[fast];\n slow++;\n fast++;\n }\n }\n\n // set the end of the string\n if (slow < string.length) {\n string[slow] = '\\0';\n }\n }", "public static String substituteOne(String s, String o, String n) {\n\t\tif (s == null)\n\t\t\treturn null;\n\t\tint begin = s.indexOf(o);\n\t\tif (begin == -1)\n\t\t\treturn s;\n\t\tint end = begin + o.length();\n\t\treturn (new StringBuffer(s)).replace(begin, end, n).toString();\n\t}", "public static void markString(String customAbbreviation) {\n\t\tint selectedIndex = allStringsList.getSelectedIndex();\n\t\tString selectedString = allStringsList.getSelectedValue();\n\t\tString newString = null;\n\t\tif (selectedString.startsWith(\"#\")) {\n\t\t\t//update the string\n\t\t\tnewString = \" \" + foundStringsIndexList.size() + \" \" + currentSaveAbbreviation() + \" \" + selectedString;\n\t\t\tfoundStringsIndexList.add(selectedIndex);\n\t\t} else {\n\t\t\tsaveAndTextTextField.setText(\"\");\n\t\t\tif (produceSaveAndText(\"Select a new index\", true, true)) {\n\t\t\t\tint oldIndex = Integer.parseInt(selectedString.substring(4, selectedString.indexOf(' ', 4)));\n\t\t\t\t//if we didn't input an index, just use the old index\n\t\t\t\tint newIndex = saveAndTextText.length() == 0 ? oldIndex : Integer.parseInt(saveAndTextText);\n\t\t\t\tint cappedIndex;\n\t\t\t\tint diff;\n\t\t\t\t//if we're removing it, put it past the end instead\n\t\t\t\t//this way, everything gets shifted backwards properly\n\t\t\t\tif (newIndex < 0)\n\t\t\t\t\tnewIndex = foundStringsIndexList.size();\n\t\t\t\tif (newIndex > oldIndex) {\n\t\t\t\t\tcappedIndex = Math.min(foundStringsIndexList.size() - 1, newIndex);\n\t\t\t\t\tdiff = 1;\n\t\t\t\t} else {\n\t\t\t\t\tcappedIndex = Math.max(0, newIndex);\n\t\t\t\t\tdiff = -1;\n\t\t\t\t}\n\t\t\t\t//reorder and edit the other strings\n\t\t\t\tfor (int toIndex = oldIndex; toIndex != cappedIndex;) {\n\t\t\t\t\t//this is where we will be getting the string+index from\n\t\t\t\t\t//we will then move it to oldIndex\n\t\t\t\t\tint fromIndex = toIndex + diff;\n\t\t\t\t\t//move the index\n\t\t\t\t\tint stringIndex = foundStringsIndexList.get(fromIndex);\n\t\t\t\t\tfoundStringsIndexList.set(toIndex, stringIndex);\n\t\t\t\t\t//update the string\n\t\t\t\t\tString movedString = allStringsListModel.get(stringIndex)\n\t\t\t\t\t\t.replace(String.valueOf(fromIndex), String.valueOf(toIndex));\n\t\t\t\t\tallStringsListModel.set(stringIndex, movedString);\n\t\t\t\t\tsearchableStrings[stringIndex] = movedString.toLowerCase().toCharArray();\n\t\t\t\t\t//and finally, update the index\n\t\t\t\t\ttoIndex = fromIndex;\n\t\t\t\t}\n\t\t\t\t//if our index was in the bounds, insert it\n\t\t\t\tif (newIndex == cappedIndex) {\n\t\t\t\t\tfoundStringsIndexList.set(newIndex, selectedIndex);\n\t\t\t\t\t//replace the index of the string\n\t\t\t\t\tnewString = selectedString.replace(String.valueOf(oldIndex), String.valueOf(newIndex));\n\t\t\t\t\t//always replace the abbreviation in the string with the one in the save\n\t\t\t\t\tint abbreviationIndex = newString.indexOf(' ', 5) + 4;\n\t\t\t\t\tnewString = newString.replace(\n\t\t\t\t\t\tnewString.substring(abbreviationIndex, newString.indexOf(' ', abbreviationIndex)),\n\t\t\t\t\t\tcurrentSaveAbbreviation());\n\t\t\t\t//otherwise, strip it of its index\n\t\t\t\t//we made sure to shift everything backwards, so the last element is dead\n\t\t\t\t} else {\n\t\t\t\t\tfoundStringsIndexList.remove(foundStringsIndexList.size() - 1);\n\t\t\t\t\tnewString = selectedString.substring(selectedString.indexOf('#'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//if we want to replace our string, replace it in the display list and the search list\n\t\tif (newString != null) {\n\t\t\tallStringsListModel.set(selectedIndex, newString);\n\t\t\tsearchableStrings[selectedIndex] = newString.toLowerCase().toCharArray();\n\t\t\tneedsSaving = true;\n\t\t}\n\t}", "public void findNext() {\n\t if (value != null) {\n\t findValue();\n\t } else {\n\t find();\n\t }\n\t}", "private int locate(String str, String substr, int pos) {\n if (substr.length() == 0) {\n if (pos <= (str.length() + 1)) {\n return pos;\n }\n else {\n return 0;\n }\n }\n int idx = StringUtils.indexOf(str, substr, pos - 1);\n if (idx == -1) {\n return 0;\n }\n return idx + 1;\n }", "private void getNextChar() throws ParsingException {\n if (++pos < expression.length()) {\n ch = expression.charAt(pos);\n } else {\n // Just to stop execution\n ch = '&';\n }\n }", "@Override\n public void updateToNextDoc() {\n if(idx < postingList.size())\n idx += postingList.get(idx+1)+2;\n }", "private void wordBreakRecur(String word, String result) {\n\t\tint size = word.length();\n\n\t\tfor (int i = 1; i <= size; i++) {\n\t\t\tString prefix = word.substring(0, i);\n\n\t\t\tif (dictionaryContains(prefix)) {\n\t\t\t\tif (i == size) {\n\t\t\t\t\tresult += prefix;\n\t\t\t\t\tSystem.out.println(result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twordBreakRecur(word.substring(i), result + prefix + \" \");\n\t\t\t}\n\t\t}\n\t}", "public String next() {\r\n\t\tif(firstVal) {\r\n\t\t\tfirstVal = true;\r\n\t\t\treturn getOutput();\r\n\t\t}\r\n\r\n\t\t// Build next lexicographic string and we use the getters to return, we use a finder method to accomplish this task.\r\n\t\tStringBuilder build = new StringBuilder(output);\r\n\t\tsetOutput((outputter(build, build.length()-1)).toString());\r\n\t\treturn getOutput();\r\n\t}", "@Override\r\n\tpublic String next() {\n\t\tString nx;\r\n\r\n\t\tnx = p.getNext();\r\n\r\n\t\tif (nx != null) {\r\n\t\t\tthisNext = true;\r\n\t\t\tinput(nx);\r\n\t\t}\r\n\t\treturn nx;\r\n\t}", "public void insertBeforeCursor(String s) {\n if(this.isEmpty() || cursor==-1)\n {\n lines.addFirst(s);\n }\n else\n lines.addBefore(new PositionObject<>(lines.get(cursor)), s);\n //cursor--;\n }", "private Token scanString(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tappendSubsequentString(buffer);\n\t\tLocatedChar ch = input.peek();\n\t\tif(ch.matchChar('\"')) {\n\t\t\tinput.next();\n\t\t\treturn StringToken.make(firstChar, buffer.toString());\n\t\t} else {\n\t\t\tlexicalError(ch, \"malformed string\");\n\t\t\treturn findNextToken();\n\t\t}\n\t}", "private String DoFindReplace(String line)\n {\n String newLine = line;\n\n for (String findKey : lineFindReplace.keySet())\n {\n String repValue = lineFindReplace.get(findKey).toString();\n\n Pattern findPattern = Pattern.compile(findKey);\n Matcher repMatcher = findPattern.matcher(newLine);\n\n newLine = repMatcher.replaceAll(repValue);\n }\n return(newLine);\n }", "void insert(int pos, String s);", "private static String fixSorts(String strIn){\r\n\t // get a matcher object\r\n\t matches = ptrnNumbers.matcher(strIn);\r\n\t while (matches.find()){\r\n\t \tstrIn = strIn.substring(0,matches.start())+\" \"+strPrepend+strIn.substring(matches.start()+1);\r\n\t }\r\n\t //System.out.println(\">>>\"+strIn);\r\n\t\treturn strIn;\r\n\t}", "public native String replaceItem(String newItem, Number index);", "void mo9058ad(String str, int i);", "public static void backtrack(String str,List<Integer> currentList,List<List<Integer>> result){\n\t\tif(str.length()==0){\n\t\t\tresult.add(new ArrayList<>(currentList));\n\t\t\tSystem.out.println(currentList);\n\t\t\treturn;\n\t\t}\n\t\t// Iterate from 1 as we take current from 0 inside loop\n\t\t// i <= str.length() and not < as we are taking substring at every step,str.length decreases\n\t\t// At one point it becomes 1(for the last character of string), we must include that as well\n\t\tfor(int i=1;i<=str.length();i++){\n\t\t\tString curr = str.substring(0,i);\n\t\t\tint num = Integer.parseInt(curr);\n\t\t\tif(isPrime(num)){\n\t\t\t\tcurrentList.add(num);\n\t\t\t\tString s = str.substring(i);\n\t\t\t\tbacktrack(s,currentList,result);\n\t\t\t\tcurrentList.remove(currentList.size()-1);\n\t\t\t}\n\t\t}\n\t}", "public static int indexOfNextWordStart (\n String str, \n int fromIndex, \n boolean slashToSeparate) {\n int i = fromIndex;\n if (i < str.length() &&\n (isLevelSeparator (str.charAt(i), slashToSeparate) || isTagSeparator (str.charAt(i)))) {\n i++;\n }\n while (i < str.length() && Character.isWhitespace (str.charAt(i))) {\n i++;\n }\n return i;\n }", "public static String replaceFirst(String newValue, String oldValue, String s) {\n\t\t\n\t\tif (s == null || newValue ==null || oldValue == null || oldValue.equals(\"\")) {\n\t\t\treturn s;\n\t\t}\n\t\tString t = s;\n\t\tif (t.indexOf(oldValue) == -1) {\n\t\t\treturn t;\n\t\t}\n\t\tint startIndex = t.indexOf(oldValue);\n\t\tint nextIndex = startIndex + oldValue.length();\n\t\tString firstPart = t.substring(0, startIndex);\n\t\tString middlePart = newValue;\n\t\tString lastPart = t.substring(nextIndex);\n\t\tt = firstPart + middlePart + lastPart;\n\t\t\n\t\treturn t;\t\t\n\t}", "private void updateToken() throws IOException\n\t{\n\t\ttheCurrentToken = theNextToken;\n\t\ttheNextToken = theScanner.GetToken();\n\t}" ]
[ "0.54085135", "0.5342904", "0.5331062", "0.5319046", "0.52971435", "0.52648234", "0.52629066", "0.5232517", "0.5170322", "0.51089615", "0.50776064", "0.5070677", "0.50547427", "0.50534314", "0.5028613", "0.5020352", "0.5010968", "0.50069845", "0.5001978", "0.49950403", "0.49564883", "0.49430564", "0.49282593", "0.49137324", "0.49015614", "0.48902935", "0.48885882", "0.48868376", "0.4855823", "0.48445636", "0.48276246", "0.482483", "0.48221034", "0.4799839", "0.47898698", "0.47898698", "0.4776652", "0.47630203", "0.47588482", "0.4758216", "0.47533298", "0.47313806", "0.47313452", "0.47267178", "0.47236583", "0.47216836", "0.47063923", "0.47058293", "0.4696678", "0.46932682", "0.46834537", "0.46831992", "0.46791983", "0.46780837", "0.46756327", "0.46694472", "0.4653408", "0.4644052", "0.46402323", "0.46208066", "0.46127915", "0.46041006", "0.4603644", "0.4602423", "0.4600561", "0.4599974", "0.4578084", "0.4572608", "0.45611352", "0.45444703", "0.45431778", "0.4539438", "0.452248", "0.45188844", "0.45113972", "0.45110214", "0.45075527", "0.45065266", "0.45060086", "0.4503594", "0.45016158", "0.44985223", "0.44985127", "0.44918662", "0.44904956", "0.44844338", "0.4474216", "0.44656217", "0.44621086", "0.44610274", "0.44515997", "0.44449872", "0.44423604", "0.4438798", "0.44371653", "0.44314206", "0.44215724", "0.44169453", "0.44150206", "0.44142926", "0.44130155" ]
0.0
-1
Finds the next matched element from the string and updates the string snipping that portion.
public String findAndSnip(final String pattern, final boolean trim, final boolean start) { return findAndSnip(Pattern.compile(Argument.notNull(pattern, "pattern")), trim, start); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String nextString() {\n last = (last + 1) % str.length;\n return str[last];\n }", "public String getNextMatchFromHTML(String strValue) {\n\t\treturn null;\n\t}", "void updateNextMove(String str) {\n _nextMove = getMove(str);\n _ready = true;\n }", "public void advance() {\n if( mMatches.hasNext() ) {\n setCurrent( mMatches.next() );\n }\n }", "public void incrParser(String str){\r\n\r\n String[] words = str.split(\" \");\r\n String word = words[words.length - 1];\r\n word = word.substring(0,word.length() - 1);\r\n this.values.replace(word,values.get(word) + 1);\r\n\r\n }", "public void setNextPieceString(final String theString) {\n this.myNextPiece.setNextPieceString(theString);\n }", "void replaceNext() {\n if (mte.getJtext().getSelectionStart() == mte.getJtext().getSelectionEnd()) {\n findNextWithSelection();\n return;\n }\n String searchText = findWhat.getText();\n String temp = mte.getJtext().getSelectedText(); //get selected text\n\n//check if the selected text matches the search text then do replacement\n if ((matchCase.isSelected() && temp.equals(searchText))\n || (!matchCase.isSelected() && temp.equalsIgnoreCase(searchText))) {\n mte.getJtext().replaceSelection(replaceWith.getText());\n }\n\n findNextWithSelection();\n }", "private int getNextMatch(String searchText) {\n \tint startPosition = textArea.getCaretPosition()+1;\n \treturn document.getContent().indexOf(searchText, startPosition);\n }", "public String atFirst(String str) {\r\n return str.length() > 1 ? str.substring(0, 2) : (str + \"@@\").substring(0, 2);\r\n }", "private void adjustHits(Node winner, String string) {\n\t\tIterator<HitHolder> ite = winner.hitList.iterator();\n\t\tHitHolder temp = null;\n\t\tboolean exists = false;\n\t\t\n\t\t\n\t\twhile(ite.hasNext())\n\t\t{\n\t\t\ttemp = ite.next();\n\t\t\t\n\t\t\tif(temp.element.equalsIgnoreCase(string))\n\t\t\t{\n\t\t\t\tif(temp.getFirstIteration() == -1)\n\t\t\t\t{\n\t\t\t\t\ttemp.firstIteration = CURRENT_ITERATION;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttemp.lastIteration = CURRENT_ITERATION;\n\t\t\t\ttemp.numberOfHits++;\n\t\t\t\texists = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!exists)\n\t\t{\n\t\t\twinner.hitList.add(new HitHolder(string, CURRENT_ITERATION));\n\t\t}\n\t}", "private String getTextInNextElement(String text, String tag, int pos) throws ParseException {\n Pair<Integer, String> result = htmlInTag(text, tag, pos);\n if (result == null) {\n throw new ParseException(\"Cannot find \" + tag + \" in html.\", pos);\n }\n int holdPosition = result.first;\n text = result.second;\n\n if (!text.isEmpty() && text.charAt(0) == '<') {\n tag = findCurrentTag(text, 0);\n text = getTextInNextElement(text, tag, 0);\n position = holdPosition;\n return text;\n }\n\n text = text.replaceAll(\"&nbsp;\", \" \").trim();\n position = holdPosition;\n return text;\n }", "@Override\n public IABTNode updateNode(String substring, String word, int index) {\n int descendNode = this.descend(substring.charAt(index));\n IABTNode newNode;\n if(descendNode == 1){\n newNode = new ABTNode(substring.charAt(index+1));\n } else {\n newNode = new ABTNode(substring.charAt(index));\n }\n newNode.setKey(word, -1);\n this.sons.set(descendNode, newNode);\n return this.sons.get(descendNode);\n }", "void highlightNextWord() {\n\t\tif(findIndex < finder.size()) {\n\t\t\ttextEditor.getHighlighter().removeAllHighlights();\n\t\t\ttry {\n\t\t\t\thighlighter.addHighlight(finder.get(findIndex).p1, \n\t\t\t\t\t\tfinder.get(findIndex).p2-1, painter);\n\t\t\t} catch (BadLocationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfindIndex++;\n\t\t}\n\t\telse {\n\t\t\tfindIndex = 0;\n\t\t}\n\t}", "public void updateMatchFromString(String resultString){\r\n String team1;\r\n String team2;\r\n int score1;\r\n int score2;\r\n \r\n //Separate the string data \r\n //Split the space\r\n String[] splitString = resultString.split(\"\\\\s+\", 5);\r\n \r\n //Store it sorted into the variables\r\n if (splitString[0].compareTo(splitString[2]) < 0){\r\n team1 = splitString[0];\r\n score1 = Integer.parseInt(splitString[1]);\r\n team2 = splitString[2];\r\n score2 = Integer.parseInt(splitString[3]);\r\n }\r\n else {\r\n team1 = splitString[2];\r\n score1 = Integer.parseInt(splitString[3]);\r\n team2 = splitString[0];\r\n score2 = Integer.parseInt(splitString[1]);\r\n }\r\n \r\n //Find the corresponding match in the tree\r\n Match m;\r\n if ((m = this.findMatchFromTeamName(team1, team2)) == null){\r\n return;\r\n }\r\n \r\n //Update the match\r\n m.setScore1(score1);\r\n m.setScore2(score2);\r\n \r\n //Update the teams\r\n this.updateTeamFromResults(m);\r\n }", "public String next()\r\n/* 35: */ {\r\n/* 36:42 */ String thisResult = this.nextResult;\r\n/* 37: */ \r\n/* 38:44 */ this.nextResult = Tags.untagTopLevelString(this.start, this.input);\r\n/* 39:49 */ if (this.nextResult == null) {\r\n/* 40:49 */ return thisResult;\r\n/* 41: */ }\r\n/* 42:51 */ int index = this.input.indexOf(this.nextResult) + this.nextResult.length();\r\n/* 43: */ \r\n/* 44:53 */ index = this.input.indexOf(\"</\" + this.start + \">\", index) + 3 + this.start.length();\r\n/* 45: */ \r\n/* 46:55 */ this.input = this.input.substring(index);\r\n/* 47: */ \r\n/* 48:57 */ this.nextResult = Tags.tag(this.start, this.nextResult);\r\n/* 49: */ \r\n/* 50: */ \r\n/* 51: */ \r\n/* 52: */ \r\n/* 53:62 */ return thisResult;\r\n/* 54: */ }", "public void update() {\r\n if (parseStyle == ParseStyle.CHARACTER) {\r\n wrapText();\r\n int begin = getPosition();\r\n int end = getPosition() + 1;\r\n setCurrentItem(new TextItem(begin, end, getText().substring(begin,\r\n end)));\r\n setPosition(end);\r\n } else if (parseStyle == ParseStyle.WORD) {\r\n if (matcher == null) {\r\n return;\r\n }\r\n wrapText();\r\n boolean matchFound = findNextToken();\r\n if (matchFound) {\r\n selectCurrentToken();\r\n } else {\r\n // No match found. Go back to the beginning of the text area\r\n // and select the first token found\r\n setPosition(0);\r\n updateMatcher();\r\n // Having wrapped to the beginning select the next token, if\r\n // there is one.\r\n if (findNextToken()) {\r\n selectCurrentToken();\r\n }\r\n }\r\n }\r\n\r\n }", "public void next() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getNextMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getNextModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }", "private String findReplace(String str, String find, String replace)\n/* */ {\n/* 944 */ String des = new String();\n/* 945 */ while (str.indexOf(find) != -1) {\n/* 946 */ des = des + str.substring(0, str.indexOf(find));\n/* 947 */ des = des + replace;\n/* 948 */ str = str.substring(str.indexOf(find) + find.length());\n/* */ }\n/* 950 */ des = des + str;\n/* 951 */ return des;\n/* */ }", "public String nextTo(String str) {\n char next;\n AppMethodBeat.m2504i(50194);\n StringBuffer stringBuffer = new StringBuffer();\n while (true) {\n next = next();\n if (str.indexOf(next) < 0 && next != 0 && next != 10 && next != 13) {\n stringBuffer.append(next);\n } else if (next != 0) {\n back();\n }\n }\n if (next != 0) {\n }\n String trim = stringBuffer.toString().trim();\n AppMethodBeat.m2505o(50194);\n return trim;\n }", "private String findReplace(String str, String find, String replace)\n/* */ {\n/* 938 */ String des = new String();\n/* 939 */ while (str.indexOf(find) != -1) {\n/* 940 */ des = des + str.substring(0, str.indexOf(find));\n/* 941 */ des = des + replace;\n/* 942 */ str = str.substring(str.indexOf(find) + find.length());\n/* */ }\n/* 944 */ des = des + str;\n/* 945 */ return des;\n/* */ }", "private void findNext() {\n \tthis.find(true);\n }", "static void getNext(String T, int[] next) {\n\t\tint i = 0, j = -1;\n\t\tnext[0] = -1;\n\t\tint n = next.length;\n\t\twhile (i < n - 1) {\n\t\t\twhile (j > -1 && T.charAt(j) != T.charAt(i)) j = next[j];\n\t\t\t++i; ++j;\n\t\t\tif (i < n - 1 && T.charAt(j) == T.charAt(i)) next[i] = next[j];\n\t\t\telse next[i] = j;\n\t\t\t/*\n\t\t\tif (j == -1 || T.charAt(i) == T.charAt(j))\n\t\t\t\tnext[++i] = ++j;\n\t\t\telse\n\t\t\t\tj = next[j];\n\t\t\t\t*/\n\t\t}\n\t}", "private static String findSubString2(int index, int len, String s2) {\n\t\tint wLen = len - 1;\n\t\tint remLen = s2.length() - index;\n\t\tif (remLen <= wLen) {\n\t\t\treturn s2.substring(0, index) + s2.substring(index, index+remLen);\n\t\t} else {\n\t\t\tif (index == 0) {\n\t\t\t\treturn s2.substring(0, index) + s2.substring(index, len);\n\t\t\t}\n\t\t\treturn s2.substring(0, index) + s2.substring(index, len+1);\n\t\t}\n\t}", "private char advance() {\n current++;\n return source.charAt(current - 1);\n }", "@Override\n public String next() {\n assert(this.hasNext());\n Element currParagraphElement = this.paragraphs.get(this.paragraphIndex);\n String currParagraph = currParagraphElement.wholeText();\n\n ++this.paragraphIndex;\n\n return currParagraph;\n }", "private static String incrementStringByOne(String prefix) {\n StringBuilder end = new StringBuilder(prefix);\n\n int lastPos = end.length() - 1;\n // This is basically end[lastPos] += 1\n end.setCharAt(lastPos, Chars.checkedCast(end.charAt(lastPos) + 1));\n\n return end.toString();\n }", "private static String removeHelper(String s, int index) {\r\n \tif (index == 0) {\r\n \t\treturn s;\r\n \t}\r\n \telse {\r\n \t\tchar cur = s.charAt(index);\r\n \t\tchar prev = s.charAt(index - 1);\r\n \t\tString result = s.substring(0, index);\r\n \t\tif (cur == prev) {\r\n \t\t\treturn removeHelper(result, index - 1);\r\n \t\t}\r\n \t\telse {\r\n \t\t\treturn removeHelper(result, index - 1) + cur;\r\n \t\t}\r\n \t}\r\n }", "private String findReplace(String str, String find, String replace)\n/* */ {\n/* 935 */ String des = new String();\n/* 936 */ while (str.indexOf(find) != -1) {\n/* 937 */ des = des + str.substring(0, str.indexOf(find));\n/* 938 */ des = des + replace;\n/* 939 */ str = str.substring(str.indexOf(find) + find.length());\n/* */ }\n/* 941 */ des = des + str;\n/* 942 */ return des;\n/* */ }", "public void insertAfterCursor(String s) {\n if(this.isEmpty())\n {\n lines.addFirst(s);\n }\n else\n lines.addAfter(new PositionObject<>(lines.get(cursor)), s);\n cursor++;\n }", "public static String getNext(String s1,String s2){\n\t\tint x = s1.indexOf(s2) + s2.length();\n\t\tif(x==s2.length()-1)\n\t\t\treturn null;\n\t\tString[] arr = s1.substring(x).split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\", -1)[1].split(\"\\n\");\n\t\treturn arr[0];\n\t}", "public void setNextLocation(String s) {\n if (s == null) nextLocation = \"\";\n else nextLocation = s;\n }", "public void moveNext() {\n\t\tcurrentElement++;\n\t}", "private void updateGuessedWord(String guessedLetter) {\n\t\tint guessIndex = 0;\n\t\tint indexOffset = 0;\n\t\t//we loop here because there can potentially be multiple instances of guessedLetter in actualWord\n\t\twhile (indexOffset < actualWord.length()) { //could be while true, but this protects against double letters at end of word\n\t\t\tguessIndex = actualWord.indexOf(guessedLetter, indexOffset);\n\t\t\tif (guessIndex < 0) return; //exits loop if no further instances of guessed letter are in actual word\n\t\t\telse {\n\t\t\t\tguessedWord = guessedWord.substring(0, guessIndex) + guessedLetter + guessedWord.substring(guessIndex + 1);\n\t\t\t\tindexOffset = guessIndex + 1;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public String next() {\n if(current<m_list.size())\r\n {\r\n String str = m_list.get(current);\r\n current++;\r\n return str;\r\n }\r\n m_list = getNextLevel(m_list, m_chars);\r\n current = 1;\r\n return m_list.get(0);\r\n \r\n }", "String getNext();", "String getNext();", "private void changeCurrentValue()\n {\n String theText = textBox.toString();\n\n // find the first newline\n int index = theText.indexOf(\"\\n\");\n assert index != -1;\n\n // insert new stuff\n StringBuilder newText = new StringBuilder();\n newText.append(currentTag);\n newText.append(\": \");\n newText.append(currentValue);\n newText.append(\"\\n\");\n\n textBox.replaceTextRange(0, index, newText.toString());\n }", "private static String insert(String input, int index, String toInsert) {\n return input.substring(0, index) + toInsert + input.substring(index);\n }", "private static String findSubString(int index, int len, String s2) {\n\t\tif ((s2.length() - index) >= len) {\n\t\t\treturn s2.substring(index - len + 1, index) + s2.substring(index, index+len);\n\t\t} else {\n\t\t\treturn s2.substring(index - len + 1, index) + s2.substring(index);\n\t\t}\n\t}", "public void updateNextPlayer(String nextPlayer) {\n\t\titem.setText(7, nextPlayer);\n\t}", "private Object getNext(String txt, String originalText) {\n return getNext(txt, originalText, null);\n }", "public String tweakFront(String str) {\n\n if(str.substring(0, 1).equalsIgnoreCase(\"a\")){\n\n if(!str.substring(1, 2).equalsIgnoreCase(\"b\")){\n str = str.substring(0, 1) + str.substring(2,str.length());\n }\n \n }else{\n str = str.substring(1);\n \n if(str.substring(0, 1).equalsIgnoreCase(\"b\")){\n \n }else{\n str = str.substring(1);\n }\n }\n \n \n \n return str;\n \n}", "public static int nextIndexOf(String string, String characters, int index) {\n int retInd = string.length();\n int auxIndex = -1;\n \n for (int i = 0; i < characters.length(); i++) {\n auxIndex = string.substring(index + 1).indexOf(characters.charAt(i));\n if ((auxIndex > -1) && (auxIndex + index + 1 < retInd)) {\n retInd = auxIndex + index + 1;\n }\n }\n return retInd;\n }", "private void setCurrentMatch(SingleMatch newMatch) {\n\t\tcurrentMatch = newMatch;\n\t}", "@Override\r\n\tpublic String nextElement() {\n\t\treturn it.next();\r\n\t}", "public String replaceString(String s, String one, String another) {\n if (s.equals(\"\")) return \"\";\n String res = \"\";\n int i = s.indexOf(one,0);\n int lastpos = 0;\n while (i != -1) {\n res += s.substring(lastpos,i) + another;\n lastpos = i + one.length();\n i = s.indexOf(one,lastpos);\n }\n res += s.substring(lastpos); // the rest\n return res;\n }", "public byte[] after(final byte[] string, final byte[] sub, final InputInfo info)\n throws QueryException {\n\n final String st = string(string);\n final int i = indexOf(st, string(sub), false, false, info);\n return i == -1 ? EMPTY : token(st.substring(i));\n }", "private String replaceStr(String src, String oldPattern, \n String newPattern) {\n\n String dst = \"\"; // the new bult up string based on src\n int i; // index of found token\n int last = 0; // last valid non token string data for concat \n boolean done = false; // determines if we're done.\n\n if (src != null) {\n // while we'er not done, try finding and replacing\n while (!done) {\n // search for the pattern...\n i = src.indexOf(oldPattern, last);\n // if it's not found from our last point in the src string....\n if (i == -1) {\n // we're done.\n done = true;\n // if our last point, happens to be before the end of the string\n if (last < src.length()) {\n // concat the rest of the string to our dst string\n dst = dst.concat(src.substring(last, (src.length())));\n }\n } else {\n // we found the pattern\n if (i != last) {\n // if the pattern's not at the very first char of our searching point....\n // we need to concat the text up to that point..\n dst = dst.concat(src.substring(last, i));\n }\n // update our last var to our current found pattern, plus the lenght of the pattern\n last = i + oldPattern.length();\n // concat the new pattern to the dst string\n dst = dst.concat(newPattern);\n }\n }\n } else {\n dst = src;\n }\n // finally, return the new string\n return dst;\n }", "private String getItemAt(String s, int index) {\n\t\tString temp = new String();\n\t\tStringTokenizer st = new StringTokenizer(s);\n\t\t\n\t\tif(index > st.countTokens()) {\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\t\n\t\tfor(int j = 1; j<=index; j++) {\n\t\t\ttemp = st.nextToken();\n\t\t}\n\t\t\n\t\treturn temp;\n\t}", "private final void r(String s) { if (m() > 0) setto(s); }", "private Token advance() {\n if(!isAtEnd()) current++;\n return previous();\n }", "@Override\n public String next() {\n return bikes[currentIndex++];\n }", "public String substituteSrc(String workString, String oldStr, String newStr) {\n int oldStrLen = oldStr.length();\n int newStrLen = newStr.length();\n String tempString = \"\";\n \n int i = 0, j = 0;\n while (j > -1) {\n j = workString.indexOf(oldStr, i);\n if (j > -1) {\n tempString = workString.substring(0, j) + newStr + workString.substring(j+oldStrLen);\n workString = tempString;\n i = j + newStrLen;\n }\n }\n \n return workString;\n }", "public Point next(Point point)\n {\n assert(_index >= 0);\n assert(_index < _pattern.length);\n\n apply(point);\n\n // Don't need to code defensively. Long live assertions.\n if (++_index == _pattern.length) _index = 0;\n\n return point;\n }", "protected int replace_s(int c_bra, int c_ket, String s)\n {\n\tint adjustment = s.length() - (c_ket - c_bra);\n\tcurrent.replace(c_bra, c_ket, s);\n\tlimit += adjustment;\n\tif (cursor >= c_ket) cursor += adjustment;\n\telse if (cursor > c_bra) cursor = c_bra;\n\treturn adjustment;\n }", "public String previewNextToken() {\r\n matcher.find();\r\n String nextOne = matcher.group();\r\n updateMatcher(); // Return matcher to its previous state\r\n return nextOne;\r\n }", "public void goToNextTag(String tag) throws ParseException {\n // Get the text inside the column\n String open = \"<\" + tag;\n int pos = html.indexOf(open, position + 1);\n if (pos == -1) {\n throw new ParseException(\"Cannot skip tag because open \" + tag + \" doesnt exist.\", position);\n }\n position = pos;\n }", "private static void extractAlpha(List<String> result, StringBuilder chunk, String string, int index) {\n if (index == string.length()) {\n result.add(chunk.toString());\n return;\n }\n\n char literal = string.charAt(index);\n if (Character.isDigit(literal)) {\n if (chunk.length() > 0) {\n result.add(chunk.toString());\n }\n\n extractNumeric(result, new StringBuilder(), string, index);\n } else {\n chunk.append(literal);\n extractAlpha(result, chunk, string, index + 1);\n }\n }", "protected String replaceIthB(String s, int i) {\n\t\tint cur_b_count = -1;\n\t\tchar[] s_array = s.toCharArray();\n\t\t\n\t\tfor (int pos = 0;pos < s.length();pos++) {\n\t\t\tif (s.charAt(pos) == 'B') {\n\t\t\t\tcur_b_count++;\n\t\t\t\t\n\t\t\t\tif (cur_b_count == i-1) {\n\t\t\t\t\ts_array[pos] = 'A';\n\t\t\t\t\treturn new String(s_array);\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\treturn s;\n\t}", "private void moveMatchingNodeToNextElement(Node tmp) {\n for (int i = 0; i < ALL_LINKED_LISTS.size();i++) {\n Node next = ALL_LINKED_LISTS.get(i);\n if (tmp.equals(next)) {\n next = next.next;\n ALL_LINKED_LISTS.put(i, next);\n break;\n }\n }\n }", "@Override\n\tpublic String strreplace(String str, int start, int end, String with) {\n\t\treturn null;\n\t}", "void updateMatcher() {\r\n int begin = getPosition();\r\n int end = getText().length();\r\n // System.out.println(begin + \",\" + end);\r\n matcher.reset(getText());\r\n matcher.region(begin, end);\r\n }", "public static String updateByIndex(String str, int index, int value) {\r\n\t\tStringBuilder result = new StringBuilder();\r\n\t\tString[] list = str.split(\"-\");\r\n\t\tfor (int i = 0; i < list.length; i++) {\r\n\t\t\tif (index == i)\r\n\t\t\t\tresult.append(value + \"-\");\r\n\t\t\telse\r\n\t\t\t\tresult.append(list[i] + \"-\");\r\n\t\t}\r\n\t\tresult.deleteCharAt(result.length() - 1);\r\n\t\treturn result.toString();\r\n\t}", "public static void main(String[] args) {\n\t\tString str = \"They is students.\";\n\t\tint i=0;\n\t\tfor(;i<str.length();i++){\n\t\t\tif(str.charAt(i)=='i')\n\t\t\t\tif(str.charAt(i+1)=='s'){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t\tStringBuffer sb = new StringBuffer(str);\n\t\tsb.replace(i, i+2, \"are\");\n\t\tSystem.out.println(sb);\n\t}", "public void setNextValue(final String nextValue);", "@Override\n public void update(String string) {\n }", "public String replaceIdentifiers(String str) {\n\t\t\n\t\t//If input is null, return null\n\t\tif(str == null) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//Map to store the identifiers and their first occurrence index\n\t\tMap<String, Integer> identifierMap = new HashMap<String, Integer>();\n\t\t\n\t\t//Other temporary variables\n\t\tStringBuilder finalOutput = new StringBuilder();\n\t\tStringBuilder currIdentifier = new StringBuilder();\t \n\t\tint identifierIndex = 0; \t\t\t//keeps a count of identifier index\n\t\tboolean isIdentifier = false;\t\t//a flag to track if current char is part of an identifier\n\t\t\n\t\t//Loop on input string\n\t\tfor(Character ch : str.toCharArray()) {\n\t\t\t\n\t\t\t//If current char is a letter, append char to currIdentifier, else process currIdentifier \n\t\t\tif(Character.isUpperCase(ch) || Character.isLowerCase(ch)) {\n\t\t\t\tcurrIdentifier.append(ch);\n\t\t\t\tisIdentifier = true;\n\t\t\t} else {\t\t\t\t\n\t\t\t\tif(isIdentifier) {\n\t\t\t\t\t//If new identifier, add to map; else get index\n\t\t\t\t\tif(!identifierMap.containsKey(currIdentifier.toString())) {\t\t\t\t\t\t\n\t\t\t\t\t\tidentifierMap.put(currIdentifier.toString(), identifierIndex);\n\t\t\t\t\t\tfinalOutput.append(currIdentifier);\t//first occurrence, so no $ sign\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tInteger existingIdentifierId = identifierMap.get(currIdentifier.toString());\n\t\t\t\t\t\tfinalOutput.append(\"$\" + existingIdentifierId); //$ sign for subsequent occurrences\n\t\t\t\t\t}\n\t\t\t\t\tidentifierIndex++;\n\t\t\t\t\tcurrIdentifier = new StringBuilder(); //start fresh for next identifier\n\t\t\t\t} \n\t\t\t\t//Append the current char, and set isIdentifier to false\n\t\t\t\tfinalOutput.append(ch);\n\t\t\t\tisIdentifier = false;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t/* This block of code handles the case, when the input string ends in a character. Alternatively, \n\t\t * we can add a unique non-alphabetic character at the end of the input string (just before \n\t\t * the for loop), and remove that char from the finalOutput, just before returning it to \n\t\t * the calling method. \n\t\t */\n\t\tif(isIdentifier) {\n\t\t\tif(!identifierMap.containsKey(currIdentifier.toString())) {\t\t\t\t\t\t\n\t\t\t\t//Adding this last identifier to the map, is not needed as we have already reached the end. \n\t\t\t\t//But in case, we want to use this map for future processing, it is needed.\n\t\t\t\tidentifierMap.put(currIdentifier.toString(), identifierIndex);\n\t\t\t\tfinalOutput.append(currIdentifier);\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\tInteger existingWordId = identifierMap.get(currIdentifier.toString());\n\t\t\t\tfinalOutput.append(\"$\" + existingWordId);\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn finalOutput.toString();\n\t}", "public static int indexOfNextWordStart (\n StringBuilder str, \n int fromIndex, \n boolean slashToSeparate) {\n int i = fromIndex;\n if (i < str.length() && \n (isLevelSeparator (str.charAt(i), slashToSeparate) \n || isTagSeparator (str.charAt(i)))) {\n i++;\n }\n while (i < str.length() && Character.isWhitespace (str.charAt(i))) {\n i++;\n }\n return i;\n }", "public void insertAtCurrentPos(String part)\n {\n StringBuffer newLine = new StringBuffer( this.getLine() );\n\n newLine.insert( this.getPos(), part + ' ' );\n this.line = newLine.toString();\n }", "public void replaceAtCursor(String s) {\n lines.set(cursor, s);\n }", "private boolean SET(String s) {\r\n if (in >= input.length()) return false;\r\n int ch = input.charAt(in);\r\n boolean found = false;\r\n for (int i = 0; i < s.length() && ! found; i++) {\r\n if (ch == s.charAt(i)) found = true;\r\n }\r\n if (found) in++;\r\n return found;\r\n }", "private static int findPreviousStarter(char[] paramArrayOfChar, int paramInt1, int paramInt2, int paramInt3, int paramInt4, char paramChar)\n/* */ {\n/* 1550 */ PrevArgs localPrevArgs = new PrevArgs(null);\n/* 1551 */ localPrevArgs.src = paramArrayOfChar;\n/* 1552 */ localPrevArgs.start = paramInt1;\n/* 1553 */ localPrevArgs.current = paramInt2;\n/* */ \n/* 1555 */ while (localPrevArgs.start < localPrevArgs.current) {\n/* 1556 */ long l = getPrevNorm32(localPrevArgs, paramChar, paramInt3 | paramInt4);\n/* 1557 */ if (isTrueStarter(l, paramInt3, paramInt4)) {\n/* */ break;\n/* */ }\n/* */ }\n/* 1561 */ return localPrevArgs.current;\n/* */ }", "private int findCharacter(char ch, String inputString, int currentIdx) {\n if (inputString.isEmpty()) {\n return -1;\n }\n return inputString.charAt(0) == ch ? currentIdx : findCharacter(ch, inputString.substring(1), ++currentIdx);\n }", "public static List<String> partitionFurther(List<String> inputStrings)\n\t{\n\t\tString lastString = inputStrings.remove(inputStrings.size() - 1);\n\t\tString replacementStringA = \"\";\n\t\tString replacementStringB = \"\";\n\t\tSystem.out.println(\"current last string, \" + lastString);\n\t\tCharacter leadingChar = lastString.charAt(0);\n\t\t//Find out where its last repetition is\n\t\tInteger repeatingIndex = findLastOccurrenceOfCharacterInString(leadingChar, lastString);\n\t\tif(repeatingIndex.equals(0))\n\t\t{\n\t\t\t//If no character repetition exists,\n\t\t\t//just substring that 1 char split up into itself\n\t\t\treplacementStringA = String.valueOf(leadingChar);\n\t\t\treplacementStringB = lastString.substring(1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//We have to do MORE work here.\n\t\t\t//Find where the LAST place every character in replacementStringA exists.\n\t\t\t//The last one\n\t\t\tint tempStore = repeatingIndex;\n\t\t\treplacementStringA = lastString.substring(0,repeatingIndex+1);\n\t\t\treplacementStringB = lastString.substring(repeatingIndex+1);\n\t\t\tInteger lastPlaceOfReplacement = 0;\n\t\t\tfor(int i = 0; i < replacementStringA.length(); i++)\n\t\t\t{\n\t\t\t\tCharacter c = replacementStringA.charAt(i);\n\t\t\t\trepeatingIndex = findLastOccurrenceOfCharacterInString(c, replacementStringB);\n\n\t\t\t\tif(repeatingIndex > lastPlaceOfReplacement)\n\t\t\t\t{\n\t\t\t\t\tlastPlaceOfReplacement = repeatingIndex;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(lastPlaceOfReplacement > 0)\n\t\t\t{\n\t\t\t\treplacementStringA = lastString.substring(0,tempStore+lastPlaceOfReplacement+1);\n\t\t\t\treplacementStringB = lastString.substring(tempStore+lastPlaceOfReplacement+1);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"replacement string A, \" + replacementStringA);\n\t\tSystem.out.println(\"replacement string A, \" + replacementStringB);\n\n\t\t//repeat till the last String is not modified.\n\t\tif(replacementStringB.equals(\"\"))\n\t\t{\n\t\t\treturn inputStrings;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tinputStrings.add(replacementStringA);\n\t\t\tinputStrings.add(replacementStringB);\n\t\t\treturn partitionFurther(inputStrings);\n\t\t}\n\t}", "boolean add(String s, int depth) {\n\n\t\t\t// First case: we are at the end of the string and this is the correct node\n\t\t\tif(depth >= s.length() || (s.charAt(depth) == character.get()) && depth == s.length() - 1) {\n\t\t\t\tAtomicBoolean result = absent;\n\t\t\t\tabsent.set(false);\n\t\t\t\treturn result.get();\n\t\t\t}\n\n\t\t\t// Second case: the next character in the string was found, but this is not the end of the string\n\t\t\t// We continue in member \"suffix\"\n\t\t\tif(s.charAt(depth) == character.get()) {\n\t\t\t\tif (suffix == null || suffix.get().character.get() > s.charAt(depth+1)) \n\t\t\t\t\tsuffix = new AtomicReference<Node>(new Node(s.charAt(depth+1), suffix.get()));\n\t\t\t\treturn suffix.get().add(s, depth+1);\n\t\t\t}\n\n\t\t\t// Third case: the next character in the string was not found\n\t\t\t// We continue in member \"next\"\n\t\t\t// To maintain the order, we may have to add a new node before \"next\" first\n\t\t\tif (next == null || next.get().character.get() > s.charAt(depth))\n\t\t\t\tnext.set(new Node(s.charAt(depth), next.get()));\n\t\n\t\t\treturn next.get().add(s, depth);\n\t\t}", "public int nextIndex(String input, String find, int start, boolean caseSensitive) {\n int textPosn = -1;\n if (input != null && find != null && start < input.length()) {\n if (caseSensitive) { // indexOf() returns -1 if not found\n textPosn = input.indexOf(find, start);\n // If not found from non-starting cursor position, wrap around\n if (start > 0 && textPosn < 0) {\n textPosn = input.indexOf(find);\n }\n } else {\n String lowerCaseText = input.toLowerCase();\n textPosn = lowerCaseText.indexOf(find.toLowerCase(), start);\n // If not found from non-starting cursor position, wrap around\n if (start > 0 && textPosn < 0) {\n textPosn = lowerCaseText.indexOf(find.toLowerCase());\n }\n }\n }\n return textPosn;\n }", "public static VersionNumber suggestNextReleaseVersion(\n VersionSegment versionSegmentToIncrement,\n String versionHintAsString,\n List<String> existingVersions) {\n\n VersionNumber versionHint = VersionNumber.parseVersionHint(versionHintAsString);\n\n Optional<VersionNumber> latestTagInCurrentReleaseTrack = existingVersions.stream()\n .map(ReleaseVersionIncrementer::getVersionNumberOrNull)\n .filter(Objects::nonNull)\n .sorted()\n .filter(\n versionNumber -> isVersionTagPartOfReleaseTrack(versionSegmentToIncrement, versionHint, versionNumber))\n .reduce((first, second) -> second);\n\n // To handle first version tag in a new release track\n if (!latestTagInCurrentReleaseTrack.isPresent()) {\n return versionHint.unlockVersion();\n }\n\n // To handle version bumping within the same release track\n if (isVersionHintGreaterThanVersionTag(versionHint, latestTagInCurrentReleaseTrack.get())) {\n return versionHint.unlockVersion();\n }\n\n if (VersionSegment.MINOR.equals(versionSegmentToIncrement)) {\n return latestTagInCurrentReleaseTrack.get().incrementMinorSegment();\n } else {\n return latestTagInCurrentReleaseTrack.get().incrementPatchSegment();\n }\n }", "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}", "private static String replaceAll(Matcher matcher, String rep) {\n try {\n StringBuffer sb = null ; // Delay until needed\n while(matcher.find()) {\n if ( sb == null )\n sb = new StringBuffer() ;\n else {\n // Do one match of zerolength string otherwise filter out.\n if (matcher.start() == matcher.end() )\n continue ;\n }\n matcher.appendReplacement(sb, rep);\n }\n if ( sb == null )\n return null ;\n matcher.appendTail(sb);\n return sb.toString();\n } catch (IndexOutOfBoundsException ex) {\n throw new ExprEvalException(\"IndexOutOfBounds\", ex) ;\n }\n }", "private String replace(String s) {\n return s.replaceAll(\"C#\", \"1\")\n .replace(\"D#\", \"2\")\n .replace(\"F#\", \"3\")\n .replace(\"G#\", \"4\")\n .replace(\"A#\", \"5\");\n }", "private void replaceAll(char[] string, int length, String target, String newString) {\n int idx = length - 1;\n int newIdx = string.length - 1;\n while (idx >= 0) {\n string[newIdx] = string[idx];\n newIdx--;\n idx--;\n }\n\n int slow = 0; // [0, slow)\n int fast = newIdx + 1; // the index of character being processed [0, fast) processed\n\n // student\n // stxxxnt\n while (fast < string.length) { // must process until reaching end! CAN'T use fast < string.length - target.length() because some characters won't be copied!!\n if (isStartOfTargetString(string, fast, target)) {\n // [fast, end);\n for (int i = 0; i < newString.length(); i++) {\n string[slow] = newString.charAt(i);\n slow++;\n }\n fast += target.length();\n } else {\n string[slow] = string[fast];\n slow++;\n fast++;\n }\n }\n\n // set the end of the string\n if (slow < string.length) {\n string[slow] = '\\0';\n }\n }", "public static String substituteOne(String s, String o, String n) {\n\t\tif (s == null)\n\t\t\treturn null;\n\t\tint begin = s.indexOf(o);\n\t\tif (begin == -1)\n\t\t\treturn s;\n\t\tint end = begin + o.length();\n\t\treturn (new StringBuffer(s)).replace(begin, end, n).toString();\n\t}", "public static void markString(String customAbbreviation) {\n\t\tint selectedIndex = allStringsList.getSelectedIndex();\n\t\tString selectedString = allStringsList.getSelectedValue();\n\t\tString newString = null;\n\t\tif (selectedString.startsWith(\"#\")) {\n\t\t\t//update the string\n\t\t\tnewString = \" \" + foundStringsIndexList.size() + \" \" + currentSaveAbbreviation() + \" \" + selectedString;\n\t\t\tfoundStringsIndexList.add(selectedIndex);\n\t\t} else {\n\t\t\tsaveAndTextTextField.setText(\"\");\n\t\t\tif (produceSaveAndText(\"Select a new index\", true, true)) {\n\t\t\t\tint oldIndex = Integer.parseInt(selectedString.substring(4, selectedString.indexOf(' ', 4)));\n\t\t\t\t//if we didn't input an index, just use the old index\n\t\t\t\tint newIndex = saveAndTextText.length() == 0 ? oldIndex : Integer.parseInt(saveAndTextText);\n\t\t\t\tint cappedIndex;\n\t\t\t\tint diff;\n\t\t\t\t//if we're removing it, put it past the end instead\n\t\t\t\t//this way, everything gets shifted backwards properly\n\t\t\t\tif (newIndex < 0)\n\t\t\t\t\tnewIndex = foundStringsIndexList.size();\n\t\t\t\tif (newIndex > oldIndex) {\n\t\t\t\t\tcappedIndex = Math.min(foundStringsIndexList.size() - 1, newIndex);\n\t\t\t\t\tdiff = 1;\n\t\t\t\t} else {\n\t\t\t\t\tcappedIndex = Math.max(0, newIndex);\n\t\t\t\t\tdiff = -1;\n\t\t\t\t}\n\t\t\t\t//reorder and edit the other strings\n\t\t\t\tfor (int toIndex = oldIndex; toIndex != cappedIndex;) {\n\t\t\t\t\t//this is where we will be getting the string+index from\n\t\t\t\t\t//we will then move it to oldIndex\n\t\t\t\t\tint fromIndex = toIndex + diff;\n\t\t\t\t\t//move the index\n\t\t\t\t\tint stringIndex = foundStringsIndexList.get(fromIndex);\n\t\t\t\t\tfoundStringsIndexList.set(toIndex, stringIndex);\n\t\t\t\t\t//update the string\n\t\t\t\t\tString movedString = allStringsListModel.get(stringIndex)\n\t\t\t\t\t\t.replace(String.valueOf(fromIndex), String.valueOf(toIndex));\n\t\t\t\t\tallStringsListModel.set(stringIndex, movedString);\n\t\t\t\t\tsearchableStrings[stringIndex] = movedString.toLowerCase().toCharArray();\n\t\t\t\t\t//and finally, update the index\n\t\t\t\t\ttoIndex = fromIndex;\n\t\t\t\t}\n\t\t\t\t//if our index was in the bounds, insert it\n\t\t\t\tif (newIndex == cappedIndex) {\n\t\t\t\t\tfoundStringsIndexList.set(newIndex, selectedIndex);\n\t\t\t\t\t//replace the index of the string\n\t\t\t\t\tnewString = selectedString.replace(String.valueOf(oldIndex), String.valueOf(newIndex));\n\t\t\t\t\t//always replace the abbreviation in the string with the one in the save\n\t\t\t\t\tint abbreviationIndex = newString.indexOf(' ', 5) + 4;\n\t\t\t\t\tnewString = newString.replace(\n\t\t\t\t\t\tnewString.substring(abbreviationIndex, newString.indexOf(' ', abbreviationIndex)),\n\t\t\t\t\t\tcurrentSaveAbbreviation());\n\t\t\t\t//otherwise, strip it of its index\n\t\t\t\t//we made sure to shift everything backwards, so the last element is dead\n\t\t\t\t} else {\n\t\t\t\t\tfoundStringsIndexList.remove(foundStringsIndexList.size() - 1);\n\t\t\t\t\tnewString = selectedString.substring(selectedString.indexOf('#'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//if we want to replace our string, replace it in the display list and the search list\n\t\tif (newString != null) {\n\t\t\tallStringsListModel.set(selectedIndex, newString);\n\t\t\tsearchableStrings[selectedIndex] = newString.toLowerCase().toCharArray();\n\t\t\tneedsSaving = true;\n\t\t}\n\t}", "public void findNext() {\n\t if (value != null) {\n\t findValue();\n\t } else {\n\t find();\n\t }\n\t}", "private int locate(String str, String substr, int pos) {\n if (substr.length() == 0) {\n if (pos <= (str.length() + 1)) {\n return pos;\n }\n else {\n return 0;\n }\n }\n int idx = StringUtils.indexOf(str, substr, pos - 1);\n if (idx == -1) {\n return 0;\n }\n return idx + 1;\n }", "private void getNextChar() throws ParsingException {\n if (++pos < expression.length()) {\n ch = expression.charAt(pos);\n } else {\n // Just to stop execution\n ch = '&';\n }\n }", "@Override\n public void updateToNextDoc() {\n if(idx < postingList.size())\n idx += postingList.get(idx+1)+2;\n }", "private void wordBreakRecur(String word, String result) {\n\t\tint size = word.length();\n\n\t\tfor (int i = 1; i <= size; i++) {\n\t\t\tString prefix = word.substring(0, i);\n\n\t\t\tif (dictionaryContains(prefix)) {\n\t\t\t\tif (i == size) {\n\t\t\t\t\tresult += prefix;\n\t\t\t\t\tSystem.out.println(result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twordBreakRecur(word.substring(i), result + prefix + \" \");\n\t\t\t}\n\t\t}\n\t}", "public String next() {\r\n\t\tif(firstVal) {\r\n\t\t\tfirstVal = true;\r\n\t\t\treturn getOutput();\r\n\t\t}\r\n\r\n\t\t// Build next lexicographic string and we use the getters to return, we use a finder method to accomplish this task.\r\n\t\tStringBuilder build = new StringBuilder(output);\r\n\t\tsetOutput((outputter(build, build.length()-1)).toString());\r\n\t\treturn getOutput();\r\n\t}", "@Override\r\n\tpublic String next() {\n\t\tString nx;\r\n\r\n\t\tnx = p.getNext();\r\n\r\n\t\tif (nx != null) {\r\n\t\t\tthisNext = true;\r\n\t\t\tinput(nx);\r\n\t\t}\r\n\t\treturn nx;\r\n\t}", "public void insertBeforeCursor(String s) {\n if(this.isEmpty() || cursor==-1)\n {\n lines.addFirst(s);\n }\n else\n lines.addBefore(new PositionObject<>(lines.get(cursor)), s);\n //cursor--;\n }", "private Token scanString(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tappendSubsequentString(buffer);\n\t\tLocatedChar ch = input.peek();\n\t\tif(ch.matchChar('\"')) {\n\t\t\tinput.next();\n\t\t\treturn StringToken.make(firstChar, buffer.toString());\n\t\t} else {\n\t\t\tlexicalError(ch, \"malformed string\");\n\t\t\treturn findNextToken();\n\t\t}\n\t}", "private String DoFindReplace(String line)\n {\n String newLine = line;\n\n for (String findKey : lineFindReplace.keySet())\n {\n String repValue = lineFindReplace.get(findKey).toString();\n\n Pattern findPattern = Pattern.compile(findKey);\n Matcher repMatcher = findPattern.matcher(newLine);\n\n newLine = repMatcher.replaceAll(repValue);\n }\n return(newLine);\n }", "void insert(int pos, String s);", "private static String fixSorts(String strIn){\r\n\t // get a matcher object\r\n\t matches = ptrnNumbers.matcher(strIn);\r\n\t while (matches.find()){\r\n\t \tstrIn = strIn.substring(0,matches.start())+\" \"+strPrepend+strIn.substring(matches.start()+1);\r\n\t }\r\n\t //System.out.println(\">>>\"+strIn);\r\n\t\treturn strIn;\r\n\t}", "public native String replaceItem(String newItem, Number index);", "void mo9058ad(String str, int i);", "public static void backtrack(String str,List<Integer> currentList,List<List<Integer>> result){\n\t\tif(str.length()==0){\n\t\t\tresult.add(new ArrayList<>(currentList));\n\t\t\tSystem.out.println(currentList);\n\t\t\treturn;\n\t\t}\n\t\t// Iterate from 1 as we take current from 0 inside loop\n\t\t// i <= str.length() and not < as we are taking substring at every step,str.length decreases\n\t\t// At one point it becomes 1(for the last character of string), we must include that as well\n\t\tfor(int i=1;i<=str.length();i++){\n\t\t\tString curr = str.substring(0,i);\n\t\t\tint num = Integer.parseInt(curr);\n\t\t\tif(isPrime(num)){\n\t\t\t\tcurrentList.add(num);\n\t\t\t\tString s = str.substring(i);\n\t\t\t\tbacktrack(s,currentList,result);\n\t\t\t\tcurrentList.remove(currentList.size()-1);\n\t\t\t}\n\t\t}\n\t}", "public static int indexOfNextWordStart (\n String str, \n int fromIndex, \n boolean slashToSeparate) {\n int i = fromIndex;\n if (i < str.length() &&\n (isLevelSeparator (str.charAt(i), slashToSeparate) || isTagSeparator (str.charAt(i)))) {\n i++;\n }\n while (i < str.length() && Character.isWhitespace (str.charAt(i))) {\n i++;\n }\n return i;\n }", "public static String replaceFirst(String newValue, String oldValue, String s) {\n\t\t\n\t\tif (s == null || newValue ==null || oldValue == null || oldValue.equals(\"\")) {\n\t\t\treturn s;\n\t\t}\n\t\tString t = s;\n\t\tif (t.indexOf(oldValue) == -1) {\n\t\t\treturn t;\n\t\t}\n\t\tint startIndex = t.indexOf(oldValue);\n\t\tint nextIndex = startIndex + oldValue.length();\n\t\tString firstPart = t.substring(0, startIndex);\n\t\tString middlePart = newValue;\n\t\tString lastPart = t.substring(nextIndex);\n\t\tt = firstPart + middlePart + lastPart;\n\t\t\n\t\treturn t;\t\t\n\t}", "private void updateToken() throws IOException\n\t{\n\t\ttheCurrentToken = theNextToken;\n\t\ttheNextToken = theScanner.GetToken();\n\t}" ]
[ "0.54085135", "0.5342904", "0.5331062", "0.5319046", "0.52971435", "0.52648234", "0.52629066", "0.5232517", "0.5170322", "0.51089615", "0.50776064", "0.5070677", "0.50547427", "0.50534314", "0.5028613", "0.5020352", "0.5010968", "0.50069845", "0.5001978", "0.49950403", "0.49564883", "0.49430564", "0.49282593", "0.49137324", "0.49015614", "0.48902935", "0.48885882", "0.48868376", "0.4855823", "0.48445636", "0.48276246", "0.482483", "0.48221034", "0.4799839", "0.47898698", "0.47898698", "0.4776652", "0.47630203", "0.47588482", "0.4758216", "0.47533298", "0.47313806", "0.47313452", "0.47267178", "0.47236583", "0.47216836", "0.47063923", "0.47058293", "0.4696678", "0.46932682", "0.46834537", "0.46831992", "0.46791983", "0.46780837", "0.46756327", "0.46694472", "0.4653408", "0.4644052", "0.46402323", "0.46208066", "0.46127915", "0.46041006", "0.4603644", "0.4602423", "0.4600561", "0.4599974", "0.4578084", "0.4572608", "0.45611352", "0.45444703", "0.45431778", "0.4539438", "0.452248", "0.45188844", "0.45113972", "0.45110214", "0.45075527", "0.45065266", "0.45060086", "0.4503594", "0.45016158", "0.44985223", "0.44985127", "0.44918662", "0.44904956", "0.44844338", "0.4474216", "0.44656217", "0.44621086", "0.44610274", "0.44515997", "0.44449872", "0.44423604", "0.4438798", "0.44371653", "0.44314206", "0.44215724", "0.44169453", "0.44150206", "0.44142926", "0.44130155" ]
0.0
-1
Saves the state of the entity by marking it.
public void mark() { this.markedStack.addLast(this.value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void saveState() \n\t{\n\t\tsuper.saveState();\n\t}", "public void saveState() {\n\t\tsuper.saveState();\n\t}", "public void saveState() { }", "public void saveState() {\n table.saveState(store);\n }", "public void save(){\r\n\t\tmanager.save(this);\r\n\t}", "void save(E entity);", "void save(Object entity);", "public void saveState(IMemento memento) {\n\t\t\r\n\t}", "@Override\n\tpublic void save(Field entity) {\n\t\t\n\t}", "public void save() {\n if(persistenceType == PropertyPersistenceType.Persistent) {\n if (!isSetToDefault()) {\n permanentStore.setBoolean(key, get());\n } else {\n permanentStore.remove(key);\n }\n }\n }", "public void save() throws EntityPersistenceException {\n\n }", "@Override\r\n\tpublic void persist(Seat seatHoldState, SeatState value) {\n\t\t\r\n\t}", "@Override\n\tpublic void persist(Object entity) {\n\t\t\n\t}", "void save() {\r\n if (actionCompleted) {\r\n forget();\r\n } else {\r\n AccountSettings.stateStored = new Bundle();\r\n save(AccountSettings.stateStored);\r\n }\r\n }", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "Entity save(Entity entity);", "public void save() {\n\t\tthis.setState(Constants.CWorld.STATE_SAVING);\n\t\tthis.getWorld().saveAll();\n\t\tthis.setState(Constants.CWorld.STATE_ONLINE);\n\t}", "public void save() {\t\n\t\n\t\n\t}", "void save() {\n File file = new File(main.myPath + \"state.xml\");\n Framework.backup(main.myPath + \"state.xml\");\n Framework.transform(stateDoc, new StreamResult(file), null);\n setDirty(false);\n }", "@Override\n public Building save(Building entity) {\n return dao.save(entity);\n }", "@Override\n public SideDishEntity save(SideDishEntity entity) {\n return null;\n }", "E save(E entity);", "public void save() {\r\n try {\r\n FileOutputStream fos = new FileOutputStream(REPO_STATE_FILE_NAME);\r\n fos.write(CodecUtils.toJson(this).getBytes());\r\n fos.close();\r\n } catch (Exception e) {\r\n Logging.logError(e);\r\n }\r\n }", "public void save(E entity){\n transaction.begin();\n entityManager.persist(entity);\n transaction.commit();\n }", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save(EmpType entity) {\n\t\t\n\t}", "public void save() throws DfException {\n\t\tobject.save();\n\t}", "@Override\r\n\tpublic void save() throws SaveException {\n\t\t\r\n\t}", "public Saver save() {\n return new AugmentedSaver() {\n @Override\n protected void handleSave(Iterable<?> entities) {\n assertInTransaction();\n checkState(\n Streams.stream(entities).allMatch(Objects::nonNull), \"Can't save a null entity.\");\n checkProhibitedAnnotations(entities, NotBackedUp.class, VirtualEntity.class);\n ImmutableMap<Key<?>, ?> keysToEntities = uniqueIndex(entities, Key::create);\n TRANSACTION_INFO.get().putSaves(keysToEntities);\n }\n };\n }", "public void save() {\n }", "@Override\n\tpublic void saveEntity(T t) {\n\t\tgetSession().save(t);\n\t}", "void save(T entity);", "@Override\n\tpublic int saveObject(Evaluate entity) {\n\t\treturn evaluateMapper.saveObject(entity)\n\t\t\t\t;\n\t}", "void save(T entity, boolean editMode) throws PersistenceException;", "public void commitEntity();", "@Override\r\n\tpublic void save() {\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "public boolean save();", "public void save() {\n RegionOwn.saveRegionOwner(this);\n }", "public final Long save() {\n\t\tid = Ollie.save(this);\n\t\tOllie.putEntity(this);\n\t\tnotifyChange();\n\t\treturn id;\n\t}", "public boolean save() {\n\t\tboolean isCreate = false;\n\t\tif(!validate() || !beforeSave(isCreate)){\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\tupdate();\n\t\t} catch (SQLException e) {\n\t\t\tnew Event(Event.getLeafLevelClassName(this), \"save\",\n\t\t\t\t\t\"SQL error while saving: \" + e.toString(), Event.ERROR);\n\t\t\treturn false;\n\t\t}\n\t\tthis.setPersisted(true);\n\t\tafterSave(isCreate);\n\t\treturn true;\n\t}", "@Override\n public void Save() {\n\t \n }", "public void save(final T entity)\n\t{\n\t\tem.persist(entity);\n\t}", "@Override\n public void save() {\n\n }", "@Override\n public void save()\n {\n \n }", "@Override\n public void save() {\n \n }", "public void save();", "public void save();", "public void save();", "public void save();", "@Override\r\n\tpublic void save(PartyType entity) {\n\t\t\r\n\t}", "private void saveState(final Bundle state)\n {\n logEnter(LOG_TAG, \"saveState\", state);\n\n state.putSerializable(BUNDLE_FIELD_INSTANCE, instance);\n state.putSerializable(BUNDLE_FIELD_ENTRIES, entries);\n }", "public void save()\n\t{\n\t\tif(entity != null)\n\t\t\t((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).writePlayerData(entity);\n\t}", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "@Override\n public void persist() {\n }", "public void saveState() {\n mementos = new ArrayList<>(mementos.subList(0, statePointer + 1));\n Notebook notebookToAdd = new Notebook(this.notebook);\n notebookToAdd.setCurrentClassroom(this.notebook.getCurrentClassroom());\n Memento mementoToAdd = new Memento(notebookToAdd);\n mementos.add(mementoToAdd);\n statePointer++;\n }", "@Override\r\n\tpublic void persist() {\n\t}", "void save(Cartera entity);", "public void save(HrCStatitem entity);", "@Override\n\tpublic void persist(Recipe entity) {\n\t\t\n\t}", "Boolean save(T entity);", "void commit( boolean onSave );", "private void save() {\n Saver.saveTeam(team);\n }", "private void saveState() throws IOException {\n speakerManager.saveState();\n roomManager.saveState();\n organizerManager.saveState();\n eventManager.saveState();\n chatManager.saveState();\n attendeeManager.saveState();\n\n }", "@Override\n public int save(T entity) {\n return mapper.insert(entity);\n }", "protected void save() {\n close();\n if(saveAction != null) {\n saveAction.accept(getObject());\n }\n }", "public void attributSave() {\n\r\n\t\tstatusFeldSave();\r\n\t}", "@Override\n public int save( Mention obj ) {\n return 0;\n }", "public void save(Address entity);", "void saveStorage(StorageEntity storage);", "public boolean save() {\n executeCallbacks(CallbackType.BEFORE_SAVE);\n if (readOnly) throw new ReadOnlyException(getClass().getName() + \" is read only\");\n createOrUpdate();\n executeCallbacks(CallbackType.AFTER_SAVE);\n return true;\n }", "void save();", "void save();", "void save();", "public void onSaveInstanceState(Bundle bundle) {\n bundle.putSerializable(\"MARKLIST\", this.f5382B);\n bundle.putInt(\"save_state\", this.f5435p);\n }", "private void save() {\n var boolGrid = editor.getBoolGrid();\n //Generate a track grid from the bool frid\n var grid = Track.createFromBoolGrid(boolGrid);\n var valid = Track.isValidTrack(grid);\n if (!valid) {\n //fire an error event\n MessageBus.fire(new ErrorEvent(\"Invalid track\", \"\", 2));\n } else {\n //Save the track and pop back\n var generator = new TrackFromGridGenerator(grid);\n var track = generator.generateTrack();\n (new TrackStorageManager()).saveTrack(track);\n menu.navigationPop();\n menu.showError(new ErrorEvent(\"Saved track!\", \"\", 2, Colour.GREEN));\n }\n }", "private void save() {\r\n\t\tif (Store.save()) {\r\n\t\t\tSystem.out.println(\" > The store has been successfully saved in the file StoreData.\\n\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\" > An error occurred during saving.\\n\");\r\n\t\t}\r\n\t}", "public void operationSave() {\n\r\n\t\tstatusFeldSave();\r\n\t}", "public void save(PtJJdwcy entity);", "protected abstract void doSave();", "public void save() {\r\n\t\tGame.getInstance().getInventory().add(id);\r\n\t}", "@Override\n\tItem save(Item item);", "public void markDirty() {\n dirty = true;\n }", "@Override\r\n\tpublic void save() throws AccessDeniedException, ItemExistsException,\r\n\t\t\tReferentialIntegrityException, ConstraintViolationException,\r\n\t\t\tInvalidItemStateException, VersionException, LockException,\r\n\t\t\tNoSuchNodeTypeException, RepositoryException {\n\t\t\r\n\t}", "public boolean save() {\n return save(Datastore.fetchDefaultService(), false);\n }", "@Override\n public void saveState(Bundle outBundle) {\n }", "T save(T entity);", "T save(T entity);", "T save(T entity);", "public void save(CbmCItemFininceItem entity);", "public void save() {\n\t\tpreferences().flush();\n\t}", "public void save() {\n\t\tList<EmbeddedEntity> embeddedEntities = new ArrayList<>();\n\t\tfor (FeedItem item : items)\n\t\t\tembeddedEntities.add(item.getEntity());\n\t\tEntity feed = new Entity(getKey());\n\t\tfeed.setUnindexedProperty(\"items\", embeddedEntities); //NOI18N\n\t\tdatastore.put(feed);\n\t}", "@Override\n\tpublic void saveself(DataTaxTask entity) {\n\t\tcommonDao.saveOrUpdate(entity);\n\t\t\n\t}", "@Override\r\n\tpublic GameState save() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void writeEntityToNBT(NBTTagCompound nbt) {\n\t\tsuper.writeEntityToNBT(nbt);\n\t\tnbt.setBoolean(NBT_SADDLED, isSaddled());\n\n\t\thelpers.values().forEach(helper -> helper.writeToNBT(nbt));\n\t}", "public void markDirty()\n {\n }", "public void save(HrJBorrowcontract entity);", "public boolean save() {\n return false;\n }", "public void mark()\n {\n mark = true;\n }", "public boolean doSave() {\n return true;\n }" ]
[ "0.6830183", "0.67902356", "0.66519386", "0.6646682", "0.6604071", "0.64981276", "0.64832926", "0.6427704", "0.64179826", "0.638269", "0.63436556", "0.6324852", "0.6302104", "0.6301996", "0.6279917", "0.62699425", "0.6199356", "0.6198357", "0.6167608", "0.6144932", "0.61430955", "0.61420137", "0.61359465", "0.6121829", "0.61049825", "0.61049825", "0.6092581", "0.60906374", "0.60667664", "0.6052141", "0.6051141", "0.6029599", "0.60187656", "0.6010023", "0.5990297", "0.5986782", "0.59793913", "0.59793913", "0.5976312", "0.5974229", "0.5961631", "0.5955587", "0.5954168", "0.59380984", "0.5930249", "0.5929611", "0.59291697", "0.59165055", "0.59165055", "0.59165055", "0.59165055", "0.5912671", "0.59054387", "0.5894399", "0.5890849", "0.58880365", "0.5886483", "0.5875567", "0.5862255", "0.5842185", "0.5827705", "0.5820363", "0.5817977", "0.58149415", "0.5812679", "0.5812105", "0.5803365", "0.5802614", "0.5799611", "0.57993066", "0.5795633", "0.57954186", "0.5770738", "0.5770738", "0.5770738", "0.5762313", "0.57587427", "0.57494015", "0.57470953", "0.57431746", "0.5734087", "0.5729519", "0.5712428", "0.57014406", "0.5700412", "0.5700321", "0.56952155", "0.56924564", "0.56924564", "0.56924564", "0.5688714", "0.5688258", "0.56686634", "0.56672114", "0.5653321", "0.56485254", "0.5646047", "0.56449044", "0.5641949", "0.56410736", "0.5626578" ]
0.0
-1
Sets the value to a previously marked state. It has no effect if no marked state is present.
public void reset() { if(this.markedStack.isEmpty()) { return; } this.value = this.markedStack.pollLast(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void changeMark() {\n marked = !marked;\n }", "public synchronized void set() {\n this.currentState = EventState.UP;\n notify();\n }", "protected void changeValue() {\n \tif(value == null)\n \t\tvalue = true;\n \telse if(!value) { \n \t\tif (mode == Mode.THREE_STATE)\n \t\t\tvalue = null;\n \t\telse\n \t\t\tvalue = true;\n \t}else\n \t\tvalue = false;\n \t\n \tsetStyle();\n \t\n \tValueChangeEvent.fire(this, value);\n }", "@Override\n public void set(boolean state) {\n if (isInverted) {\n super.set(!state);\n } else {\n super.set(state);\n }\n }", "protected void setState(int value) {\r\n\t\tdState = value;\r\n\t\tstateChanged();\r\n\t\t\r\n\t\t// System debug\r\n\t\tSystem.out.println(\"State changed: \" + STATUS[dState]);\r\n\t}", "public void setState(StateEnum val) {\n state = val;\n }", "public void mark() {\r\n\t\tthis.markedStack.addLast(this.value);\r\n\t}", "public void setState(java.lang.CharSequence value) {\n this.state = value;\n }", "public void setState(State state) { model.setState(state); }", "public void setValue(boolean value) {\n this.value = value;\n }", "public void setMark() {\n\t_source.setMark();\n\t_markedNode = _current;\n }", "@objid (\"dec04375-0805-4a30-ba61-5edb1bdcf44a\")\n void setDataState(BpmnDataState value);", "public void setState(com.trg.fms.api.TripState value) {\n this.state = value;\n }", "@Override\n\tpublic void adjust() {\n\t\tstate = !state;\n\t}", "void setState(int state);", "public void setValue(boolean value) {\n this.value = value;\n }", "public void setState( boolean bool ) { state = bool; }", "public void setValue(Object value) { this.value = value; }", "public void set(GameState state){\n states.pop();\n states.push(state);\n }", "public static void setState(States state) {\r\n\t\tcurrentState = state;\r\n\t}", "public void setValue(Value value) {\n this.value = value;\n }", "public void setState(int state);", "public void setState(int state);", "void setState(boolean state);", "public void setValue(final Object value) { _value = value; }", "public void setCellState(int i, int j, CellState value) {\n switch (value) {\n case ZERO_CELL: {\n int ZERO_MARK = -1;\n field[i][j] = ZERO_MARK;\n break;\n }\n case CROSS_CELL: {\n int CROSS_MARK = 1;\n field[i][j] = CROSS_MARK;\n break;\n }\n case EMPTY_CELL: {\n field[i][j] = EMPTY_MARK;\n break;\n }\n }\n }", "@Override\n\tpublic void setLastState(STATE state) {\n\n\t}", "synchronized void reset() {\n\n // no change if called before getValue() or called twice\n lastValue = currValue = startValue;\n }", "void setValue(byte value) {\n this.value = value;\n blockDrawables.get(selected).setValue(value);\n }", "public void setValue(boolean value)\n {\n if(this.valueBoolean == value)\n {\n return;\n }\n this.valueBoolean = value;\n treeModel.nodeChanged(this.treeNode);\n }", "@Override\n public void setValue(Object val)\n {\n value = val;\n }", "public void set()\n\t{\n\t\tbitHolder.setValue(1);\n\t}", "void setState(Object state);", "public void setValue(boolean value) throws ImmutableSymbolException {\n\t\t\n\t\t// If current symbol is not mutable, then thrown the exception\n\t\tif(!isMutable())\n\t\t\tthrow new ImmutableSymbolException(name);\n\t\t\n\n\t\tthis.value = value;\n\t}", "protected final void setState(State s) {\n state = s;\n }", "public void setState(Integer state) {\r\n this.state = state;\r\n }", "public void setState(Integer state) {\r\n this.state = state;\r\n }", "public void setState(State newState) {this.state = newState;}", "void setState(State state);", "void unsetValue();", "void unsetValue();", "private void setValue(int value) {\n final boolean changed = mValue != value;\n if (changed || !mValueSet) {\n mValue = value;\n mValueSet = true;\n persistInt(value);\n if (changed) {\n notifyChanged();\n }\n }\n }", "public void setValue(Object value) {\n\t\tthis.value = value;\n\t\tsetValueAction(value);\n\t}", "void setValueLocked(boolean valueLocked);", "public void setState(@NotNull State state) {\n this.state = state;\n }", "void setValue(T value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}", "public void setState(State state) {\n\t\tthis.state = state;\n\t}", "public Builder setStateValue(int value) {\n state_ = value;\n bitField0_ |= 0x00000800;\n onChanged();\n return this;\n }", "public BooleanStateValue( boolean value, boolean isImmortal) {\n\t\tsuper( isImmortal);\n\t\t_storage = value;\n\t}", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setValue(Instruction val) {\n this.val = checkNotNull(val, \"val\");\n }", "public void mark()\n {\n mark = true;\n }", "public void setState(State state) {\n this.state = state;\n }", "public void setState(State state) {\n this.state = state;\n }", "public void setState(final StateReference state);", "public void setState(final State state);", "public void setState(Integer state) {\n\t\tthis.state = state;\n\t}", "public void setModified(boolean state) {\n //System.out.println(\"setting modified to \" + state);\n //new Exception().printStackTrace();\n current.setModified(state);\n calcModified();\n }", "public abstract void setState(String sValue);", "public void setState(org.landxml.schema.landXML11.StateType.Enum state)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STATE$14);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STATE$14);\r\n }\r\n target.setEnumValue(state);\r\n }\r\n }", "public void setCameFrom(State n)\r\n\t{\r\n\t\tthis.previousState = new State(n);\r\n\t}", "public Builder setState(int value) {\n bitField0_ |= 0x00000008;\n state_ = value;\n onChanged();\n return this;\n }", "public Builder setState(int value) {\n bitField0_ |= 0x00000008;\n state_ = value;\n onChanged();\n return this;\n }", "public Builder setState(int value) {\n bitField0_ |= 0x00000008;\n state_ = value;\n onChanged();\n return this;\n }", "public void setState(State state) {\n synchronized (stateLock){\n this.state = state;\n }\n }", "protected void setPreviousValue(UIComponent component, Object value) {\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 void setValue(A value) {this.value = value; }", "public void mark() {\r\n\t\tmark = cursor;\r\n\t}", "public void setValue(T value) {\n\t\tthis.value = value;\n\t}", "public void setValue(T value) {\n\t\tthis.value = value;\n\t}", "protected void setValue(T value) {\r\n this.value = value;\r\n }", "@Override\n\tpublic void undoAction() {\n\t\tfield.setValue(oldValue);\n\n\t\tif (checkBox != null)\n\t\t\tcheckBox.setSelected(oldValue);\n\t}", "public void setState(Boolean state) {\n this.state = state;\n }", "public Builder setStateValue(int value) {\n state_ = value;\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "public void setValue(Object value) {\n this.value = value;\n }", "public void setValue(Object value)\r\n\t{\r\n\t\tm_value = value;\r\n\t}", "public void changeState() {\n if (!isDead) {\n Bitmap temp = getBitmap();\n setBitmap(stateBitmap);\n stateBitmap = temp;\n }\n }", "@Override\n public void setChanged() {\n set(getItem());\n }", "public void setState(String s) {\r\n\t\tstate = s;\t\t\r\n\t}", "public void setState(boolean state) {\n\t\tthis.state = state;\n\t}", "public void set(V value) {\n Rules.checkAttributeValue(value);\n checkType(value);\n this.value = value;\n isSleeping = false;\n notifyObservers();\n }", "public void setValue(T value) \n\t{\n\t\tthis.value = value;\n\t}", "public void setState (State state) {\n synchronized (this) {\n this.state = state;\n }\n }", "public void set(int value)\n {\n set(value, true);\n }", "public void resetState() {\n \ts = State.STRAIGHT;\n }", "public void setValue(AXValue value) {\n this.value = value;\n }", "public void setValue(int val)\r\n {\r\n value = val;\r\n }", "public void setValue(T value) {\n this.value = value;\n }", "public void setValue(S s) { value = s; }", "public void setCurrentState(State state) {\n currentState = state;\n }", "public void setValue(Object value)\r\n {\r\n m_value = value;\r\n }", "public void setStateToActive() {\n state = VALID_STATES[0];\n }", "public void setOff(){\n state = false;\n //System.out.println(\"El requerimiento esta siendo atendido!\");\n }", "public Mark(Integer markToSet, int nextState) {\r\n assert markToSet >= 0 && markToSet < 6;\r\n assert nextState >= 0 && nextState < 10000;\r\n this.nextState = nextState;\r\n this.markToSet = markToSet;\r\n }" ]
[ "0.67339635", "0.65756696", "0.6537658", "0.6196202", "0.61619323", "0.612242", "0.6106279", "0.60980445", "0.6021262", "0.60020983", "0.597924", "0.5970021", "0.5953469", "0.5953238", "0.59531933", "0.59486026", "0.592417", "0.59072596", "0.59054434", "0.5895355", "0.5860397", "0.58575666", "0.58575666", "0.584397", "0.5837585", "0.5830105", "0.5804097", "0.5797078", "0.5784754", "0.5772868", "0.57676196", "0.5767336", "0.5766933", "0.5759767", "0.57508886", "0.5743368", "0.5743368", "0.57425994", "0.57338655", "0.5730266", "0.5730266", "0.57232606", "0.5721704", "0.5685402", "0.5673958", "0.56703216", "0.5667746", "0.56456554", "0.5642667", "0.5641221", "0.5641221", "0.5641221", "0.5641221", "0.5641221", "0.5641221", "0.56404626", "0.56386846", "0.5637772", "0.5637772", "0.5633778", "0.5626878", "0.5619534", "0.5618413", "0.5615926", "0.56132287", "0.56064576", "0.55981445", "0.55981445", "0.5598086", "0.55887073", "0.5588631", "0.55882627", "0.55844164", "0.5582555", "0.5574896", "0.5574896", "0.55744654", "0.5565943", "0.5563882", "0.55632704", "0.55627066", "0.5558552", "0.5554246", "0.55528647", "0.5531016", "0.5527418", "0.5522564", "0.5521853", "0.55215555", "0.55186754", "0.5517301", "0.5514831", "0.5514599", "0.5512957", "0.5508844", "0.5508526", "0.55029863", "0.55004936", "0.54979587", "0.54876554" ]
0.62694454
3
Clears the last marked states.
public void discard() { if(this.markedStack.isEmpty()) { return; } this.markedStack.removeLast(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clear() {\n\t\tstate = null;\n\t}", "public void clearState() {\r\n int size = states.size();\r\n states.clear();\r\n states.add(inception);\r\n for (int i = states.size(); i < size; i++) {\r\n nextState();\r\n }\r\n alteredStates.clear();\r\n }", "protected void clear() {\n \twhile (!stack.empty()) {\n \t\tstack.pop();\n \t}\n \tcurrent = 0;\n \tshow(current);\n }", "protected void clear() {\n\n\t\tfinal HashSet<Transition> t = new HashSet<>(transitions);\n\t\tfor (final Transition o : t) {\n\t\t\tremoveTransition(o);\n\t\t}\n\t\ttransitions = new HashSet<>();\n\n\t\tfinal HashSet<State> s = new HashSet<>(states);\n\t\tfor (final State o : s) {\n\t\t\tremoveState(o);\n\t\t}\n\t\tstates = new HashSet<>();\n\n\t\tfinalStates = new HashSet<>();\n\n\t\tinitialState = null;\n\n\t\tcachedStates = null;\n\n\t\tcachedTransitions = null;\n\n\t\tcachedFinalStates = null;\n\n\t\ttransitionFromStateMap = new HashMap<>();\n\t\ttransitionToStateMap = new HashMap<>();\n\n\t\ttransitionArrayFromStateMap = new HashMap<>();\n\n\t\ttransitionArrayToStateMap = new HashMap<>();\n\n\t\twhile (myNotes.size() != 0) {\n\t\t\tfinal AutomatonPane ap = myNotes.get(0).getView();\n\t\t\tap.remove(myNotes.get(0));\n\t\t\tap.repaint();\n\t\t\tdeleteNote(myNotes.get(0));\n\t\t}\n\t}", "private void clear() {\n for (int i = 0; i < NUMCELLS; i++)\n currentState[i] = 0;\n\n generations = 0;\n }", "public void clearState() {\n // if the user press the wrong cells, aka path, etc.\n // set state back to grass\n for (int i = 0; i < cells.size(); i++) {\n if (cells.get(i) == CellState.Chosen) {\n cells.set(i, CellState.Tower);\n } else if (cells.get(i) == CellState.ToPlaceTower) {\n cells.set(i, CellState.Grass);\n }\n\n }\n }", "public void reset() {\r\n\t\tif(this.markedStack.isEmpty()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.value = this.markedStack.pollLast();\r\n\t}", "private void clearAllState() {\n // Clear all layout records and views\n mLayoutRecords.clear();\n removeAllViews();\n\n // Reset to the top of the grid\n resetStateForGridTop();\n\n // Clear recycler because there could be different view types now\n mRecycler.clear();\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}", "void clear() {\n _whoseMove = WHITE;\n _gameOver = false;\n\n for (int i = 0; i <= MAX_INDEX; i += 1) {\n set(i, BLACK);\n }\n for (int i : _initWhite) {\n set(i, WHITE);\n }\n set(12, EMPTY);\n _history.clear();\n\n setInitialDirection(MAX_INDEX);\n\n setChanged();\n notifyObservers();\n }", "public void clear() {\n\t\tthis.set.clear();\n\t\tthis.size = 0;\n\t}", "public void clear() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tclearEntries();\r\n\t\t\r\n\t}", "private void resetMarked() {\n if(!data.isEmpty()) {\n data.getFirst().reset();\n }\n for(IoBuffer buf : resetCache) {\n buf.reset();\n data.addFirst(buf);\n }\n resetCache.clear();\n }", "public void reset() {\n bb.clear();\n cb.clear();\n found = false;\n }", "void clearObjectFlowStates();", "public void reset() {\n this.state = null;\n }", "private void clearStateInfo(){\r\n cmbState.removeAllItems();\r\n }", "public void clearStateSpecificEntries(Entry.State state);", "public void clearState(){\r\n\t\tinsideSemiringWeightsTable.clear();\r\n\t}", "public void clear() {\r\n\tcount = 0;\r\n isDrawn = false;\r\n repaint();\r\n }", "public void clearmarks ()\n\t// clear all marks in the current node\n\t{\n\t\tgetinformation();\n\t\tundonode();\n\t\tListElement la = Pos.node().actions(), lan;\n\t\tAction a;\n\t\twhile (la != null)\n\t\t{\n\t\t\ta = (Action)la.content();\n\t\t\tlan = la.next();\n\t\t\tif (a.type().equals(\"M\") || a.type().equals(\"L\")\n\t\t\t\t|| a.type().equals(\"MA\") || a.type().equals(\"SQ\")\n\t\t\t\t|| a.type().equals(\"SL\") || a.type().equals(\"CR\")\n\t\t\t\t|| a.type().equals(\"TR\") || a.type().equals(\"LB\"))\n\t\t\t{\n\t\t\t\tPos.node().removeaction(la);\n\t\t\t}\n\t\t\tla = lan;\n\t\t}\n\t\tsetnode();\n\t\tshowinformation();\n\t\tcopy();\n\t}", "public void clearMark()\n {\n mark = false;\n }", "public void clear() {\n\t\thighlightsByToken.clear();\n\t}", "public void clear () {\n\t\treset();\n\t}", "private void clearHighlightAfterMove() {\n //clear start\n getTileAt(start).clear();\n for (Move m : possibleMoves) {\n getTileAt(m.getDestination()).clear();\n }\n }", "protected void clearAnswered() {\n answerMarks_.clear();\n LOG.debug(\"Flushed marked answers\");\n }", "public void clearState() {\n synchronized (mutex) {\n statisticsAccumulator.clearState();\n }\n }", "void clear() {\n stacks.clear();\n }", "public void clear()\r\n {\r\n first = null;\r\n last = null;\r\n count = 0;\r\n }", "public void clear(){\n\t\tfor (int i=1; i<linesAndStores.length; i++){\n\t\t\tfor(int j = 0; j<32; j++){\n\t\t\t\tsetWord(i, new Word(0));\n\t\t\t\tincrement();\n\t\t\t}\n\t\t}\n\t}", "public void clearLastMarker(){\n lastMarker.remove();\n }", "void clearCurrent();", "public void clearNodeVisitedMarking() {\n\tfor (Node n : nodes)\n\t n.clearVisitedMark();\n }", "public void clear(){\r\n\t\tbeginMarker.next = endMarker;\r\n\t\tendMarker.prev = beginMarker;\r\n\t\tnumAdded=0;\r\n\t\tsize=0;\r\n \tmodCount++;\r\n\t}", "public void resetAll()\n {\n _markers = null;\n setPrefSizeForText();\n repaint();\n }", "public void reset(){\n active = false;\n done = false;\n state = State.invisible;\n curX = 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}", "public void clear() {\n\t\tdoily.lines.clear();\n\t\tclearRedoStack();\n\t\tredraw();\n\t}", "@Override\r\n\tpublic void clear() {\n\t\tset.clear();\r\n\t}", "public void clear() {\n\t\tconfigurationToButtonMap.clear();\n\t\tselected.clear();\n\t\tsuper.removeAll();\n\t}", "@Override\n public void endState() {\n spells.clear();\n spellButtons.clear();\n }", "public void clear() {\n history.clear();\n position = -1;\n }", "public void clearCollections() {\n sevenStates = new int[7][16];\n moveGeneratedFrom.clear();\n movesWithFreeTurn.clear();\n movesWhichPreventSteals.clear();\n opponentChoicesToSteal.clear();\n opponentBoardsBeforeSteal.clear();\n }", "public void reset() {\n next = 0;\n renderList.clear();\n viewList.clear();\n }", "public void clear() {\n\t\tfor (int i = 0; i < 3; i++)\n\t\t\tfor (int j = 0; j < 3; j++)\n\t\t\t\ttheBoard[i][j] = SPACE_CHAR;\n\t\tmarkCount = 0;\n\t}", "public void unReset () {\n count = lastSave;\n }", "public void clear() {\r\n\t\tbitset.clear();\r\n\t\tnumberOfAddedElements = 0;\r\n\t}", "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}", "protected void clearAll() {\n for (int i=0; i <= (Numbers.INTEGER_WIDTH*8-2); i++) {\n \tthis.clearBitAt(i);\n } \t\n }", "public void clear() {\n\t\tshapes.clear();\n\t\tgroupedShapes.clear();\n\t\tthis.repaint();\n\t\tcounter = 0;\n\t\tnotifyObservers();\n\t}", "public void clear() {\n lists = new TernarySearchTree<>();\n }", "public static void reset() {\n\t\tselectedAtts.clear();\n\t}", "public void clear() {\n\t\tleftIndex = 0;\n\t\trightIndex = 0;\n\t}", "public void clear() {\n up = false;\n down = false;\n left = false;\n right = false;\n }", "void clear() {\n\t\t\tfor (int i = 0 ; i < nodes.length; i++) {\n\t\t\t\tnodes[i].clear((byte) 1);\n\t\t\t}\n\t\t\tsize = 0;\n\t\t}", "public void clear() \r\n\t{\r\n\t\ttotal = 0;\r\n\t\thistory = \"\";\r\n\t}", "public void clear(){\n firstNode = null;\n lastNode = null;\n }", "public void ClearAll()\r\n {\r\n balls.clear();\r\n board.SetMissedBall(0);\r\n }", "void clearUndo() {\r\n while (!listOfBoards.isEmpty()) {\r\n listOfMoves.pop();\r\n listOfBoards.pop();\r\n }\r\n }", "public void clear() {\n first = null;\n n = 0;\n }", "public void clear()\n\t{\n\t\tbitHolder.setValue(0);\n\t}", "public final void clear() {\n clear(true);\n }", "private void clear() {\r\n\t\tpstate.clear();\r\n\t\tdisplay.setLegend(\"\");\r\n\t\tship = null;\r\n\t}", "public synchronized void clear()\n {\n clear(false);\n }", "public void reset()\n {\n mine = false;\n revealed = false;\n flagged = false;\n repaint();\n }", "public void clear() {\n count = 0;\n }", "public void clear(){\n\t\tclear(0);\n\t}", "public void clear() {\n items.clear();\n update();\n }", "public void clear(){\n this.clearing = true;\n }", "public void resetState();", "public void clear() {\n doClear( false );\n }", "@Override\n public void clear() {\n size = 0;\n first = null;\n last = null;\n }", "public void clear() {\n\t\tfor (int x = 0; x < counters.length; x++) {\n\t\t\tcounters[x] = 0;\n\t\t\tArrays.fill(counters, (byte)0);\n\t\t}\n\t}", "public void clear()\n {\n current = null;\n size = 0;\n }", "public void clear() {\n counters.clear();\n }", "private void reset() {\n\t\tlevel.getLogic().resetBoard();\n\t\tlevelView.refresh();\n\t\tlevelView.clearSelectedWords();\n\t}", "public void deselectAll() {\n\t\tselected.clear();\n\t}", "void clear()\n\t{\n\t\tfront = null;\n\t\tback = null;\n\t\tcursor = null;\n\t\tlength = 0;\n\t\tindex = -1;\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 clear() {\r\n if (ObjectiveFunctionWrapper.this.m_use)\r\n this.m_state.clear();\r\n }", "public synchronized void reset()\n\t{\n\t\tthis.snapshots.clear();\n\t\tthis.selfPositions.clear();\n\t}", "void reset() {\n blocks.clear();\n }", "public void clear() {\n for(;topIndex > -1;topIndex--)\n stack[topIndex] = null;\n }", "public void clearStateToPureMapState() {\n for (int i = 0; i < cells.size(); i++) {\n if (cells.get(i) == CellState.Chosen || cells.get(i) == CellState.ToPlaceTower || cells.get(i) == CellState.Tower) {\n cells.set(i, CellState.Grass);\n }\n }\n }", "public void reset()\n {\n setLastItem(NOTHING_HANDLED);\n for (int i = 0; i < counters.length; i++)\n {\n counters[i] = 0;\n }\n for (int j = 0; j < expected.length; j++)\n {\n expected[j] = ITEM_DONT_CARE;\n }\n }", "public void clearHistory() {\n historyStack.clear();\n lastTransition = null;\n }", "public void clearVisited()\n {\n visited = false;\n }", "public void clear() {\r\n\t\tdisplayEntries.clear();\r\n\t\tupdate();\r\n\t}", "public void reset() {\n while (getNumTotal() > 0) {\n this.removeNuclei();\n }\n lastModified = Calendar.getInstance().getTimeInMillis(); // record time\n }", "public void clear() {\n\t\tallItems.clear();\n\t\tminimums.clear();\n\t}", "public void clear() {\n\t\tvisited = false;\n\t}", "public void removeAll() {\n start = null;\n _size = 0;\n }", "public void clear() {\n this.atoms.clear();\n this.bonds.clear();\n this.finished = false;\n }", "private void unsetLast() { this._last = false; }", "private void clearRedoStack() {\n\t\tredoStack.clear();\n\t}", "public void clear() {\r\n\t\tentryGraph.clear();\r\n\t\tupdate();\r\n\t}", "public void reset() {\n \titems.clear();\n \tsetProcessCount(0);\n }", "void reset() {\n colorSelectedList = new HashSet<>();\n }", "public void reset () {\n lastSave = count;\n count = 0;\n }", "public void clear() {\n doClear();\n }", "public void trim() {\n boolean[] visited = new boolean[states.length];\r\n Queue<Integer> visitQueue = new LinkedList<Integer>();\r\n\r\n // init with q0\r\n visitQueue.add(0);\r\n visited[0] = true;\r\n while (!visitQueue.isEmpty()) {\r\n int toVisit = visitQueue.remove();\r\n DFAState visitingState = states[toVisit];\r\n for (int otherState : visitingState.transitions) {\r\n if (!visited[otherState]) {\r\n visitQueue.add(otherState);\r\n }\r\n }\r\n visited[toVisit] = true;\r\n }\r\n\r\n // null out unreachable states\r\n for (int i = 0; i < visited.length; i++) {\r\n if (!visited[i]) {\r\n states[i] = null;\r\n }\r\n }\r\n }" ]
[ "0.72523254", "0.71190375", "0.7117805", "0.71024877", "0.70018554", "0.69175404", "0.6873975", "0.6872229", "0.68154556", "0.67796516", "0.67334723", "0.6726083", "0.67228216", "0.67118114", "0.6677266", "0.6662844", "0.6653187", "0.66307545", "0.6628794", "0.6628395", "0.66156155", "0.6599667", "0.6599002", "0.6598448", "0.6586528", "0.65678316", "0.6563143", "0.65538603", "0.65383554", "0.653771", "0.6523785", "0.65229714", "0.65102965", "0.6508268", "0.64890087", "0.6473278", "0.6471748", "0.6469645", "0.6468277", "0.6453752", "0.64533544", "0.6441644", "0.6441163", "0.64325625", "0.6430006", "0.6429561", "0.64254224", "0.6420361", "0.64130723", "0.6409043", "0.64007735", "0.63876915", "0.63847905", "0.63775295", "0.6370557", "0.63538134", "0.63478184", "0.6346914", "0.6337196", "0.6333694", "0.63313574", "0.63243115", "0.6323651", "0.6323227", "0.6319502", "0.631871", "0.6311161", "0.63083816", "0.6301139", "0.62985474", "0.6297384", "0.6293842", "0.62885785", "0.628651", "0.628602", "0.62846386", "0.6277411", "0.62719464", "0.62707484", "0.6270356", "0.6266691", "0.626629", "0.6263147", "0.6259843", "0.6239132", "0.62325406", "0.6225462", "0.6219237", "0.6214499", "0.6214424", "0.62102896", "0.62085336", "0.6208465", "0.6195333", "0.61914533", "0.61846536", "0.61843526", "0.6180862", "0.6167978", "0.61600995", "0.61568284" ]
0.0
-1
Figure out if we're executing a toplevel expression. If so, we can't be inside of a predicate.
public void postCompileStep(Compiler compiler) { m_isTopLevel = compiler.getLocationPathDepth() == -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isTopLevel();", "private boolean isPreEvalSymobl()\r\n\t{\r\n\t\t//if the expression is empty return false\r\n\t\tif(expression.length() == 0)\r\n\t\t\treturn false;\r\n\t\tString lastChar = expression.substring(expression.length() - 1, expression.length());\r\n\t\tfor(String str : evalSymbol)\r\n\t\t\tif(str.equals(lastChar))\r\n\t\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "public boolean isChildOf(Xcode opcode) {\n Xnode crt = this;\n while(crt != null) {\n if(crt.ancestor().opcode() == opcode) {\n return true;\n }\n // Stop searching when FfunctionDefinition is reached\n if(crt.ancestor().opcode() == Xcode.F_FUNCTION_DEFINITION) {\n return false;\n }\n crt = crt.ancestor();\n }\n return false;\n }", "static boolean isOuterMethodCall(AST node)\n {\n JavaNode call = getLastMethodCall((JavaNode) node);\n\n if (call.getPreviousSibling().getType() == JavaTokenTypes.LPAREN)\n {\n return false;\n }\n\n JavaNode expr = call.getParent();\n\n // if the topmost parent is no ELIST we know we can savely wrap and\n // align\n return getChainParent(expr).getType() != JavaTokenTypes.ELIST;\n }", "protected boolean inSomeBlock() {\n return !enclosingBlocks.isEmpty();\n }", "public boolean isTopLevel() {\n return this.topLevel;\n }", "public boolean isTopLevel() {\n return this.topLevel;\n }", "boolean isInner();", "private boolean inAnonymusFunc(Node node, Node upper_bound) {\n Optional<Node> parentNode = node.getParentNode();\n if(!parentNode.isPresent()){\n return false;\n }\n Node parent = parentNode.get();\n //If upper bound reached\n if(parent.equals(upper_bound)){\n return false;\n }\n\n Class parentClazz = parent.getClass();\n if(parentClazz != ObjectCreationExpr.class){\n //Maybe the grandparent is an anonymous class expression\n return inAnonymusFunc(parent, upper_bound);\n }\n\n ObjectCreationExpr anonymousClassExpr = (ObjectCreationExpr) parent;\n if(anonymousClassExpr.getAnonymousClassBody().isPresent()){\n return true;\n }else{\n return inAnonymusFunc(parent,upper_bound);\n }\n }", "static boolean expressionInParentheses(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"expressionInParentheses\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_);\n r = expression(b, l + 1);\n if (!r) r = statement(b, l + 1);\n exit_section_(b, l, m, r, false, DartParser::parenthesesRecovery);\n return r;\n }", "public boolean evaluate(P object)\n\t{\n\t\treturn !m_predicate.evaluate(object);\n\t}", "protected boolean isInScope() {\n if (_testValue == null) {\n return false;\n }\n return _testValue.startsWith(\"(\") && _testValue.endsWith(\")\");\n }", "private boolean isOutsideOfBracket(String expr, int pos) {\r\n int level = 0;\r\n \r\n for (int i = 0; i < expr.length(); i++) {\r\n char c = expr.charAt(i);\r\n \r\n if (c == BRACKET_OPEN) {\r\n level++;\r\n } else if (c == BRACKET_CLOSE) {\r\n level--;\r\n }\r\n \r\n if (i == pos) {\r\n return level == 0;\r\n }\r\n }\r\n \r\n return true;\r\n }", "static boolean expression(PsiBuilder builder_, int level_) {\n if (!recursion_guard_(builder_, level_, \"expression\")) return false;\n boolean result_ = false;\n Marker marker_ = enter_section_(builder_, level_, _NONE_, null);\n result_ = condition_element(builder_, level_ + 1);\n if (!result_) result_ = include_statement_element(builder_, level_ + 1);\n if (!result_) result_ = value_modification(builder_, level_ + 1);\n if (!result_) result_ = multiline_value_assignment(builder_, level_ + 1);\n if (!result_) result_ = copying(builder_, level_ + 1);\n if (!result_) result_ = unsetting(builder_, level_ + 1);\n if (!result_) result_ = code_block(builder_, level_ + 1);\n if (!result_) result_ = assignment(builder_, level_ + 1);\n exit_section_(builder_, level_, marker_, null, result_, false, top_expression_recover_parser_);\n return result_;\n }", "public void expression(Node n_parent) {\r\n if(token.get(lookAheadPossition).contains(\"ident(\")||token.get(lookAheadPossition).contains(\"num(\")||token.get(lookAheadPossition).contains(\"boollit(\")||token.get(lookAheadPossition).equals(\"LP\")){\r\n System.out.println(\":: expression::if- \"+n_parent.getData());\r\n\r\n Node makeown = new Node (\"makeown\");\r\n Node n_factor = this.simpleExpression(makeown);\r\n\r\n //compNode = expressionNode.addChild(\"Compare\");\r\n //Node n_connect =\r\n this.restExpression(n_parent,n_factor);\r\n //n_parent.setNodeChild(n_connect);\r\n }\r\n }", "protected boolean lookaheadIsFirstOfExpression() {\n if (!lookaheadIn(NonT.firstOf(NonT.EXPRESSION)))\n return false;\n if (lookaheadIs(TokenCode.ADDOP) && lookahead().getOpType() != OpType.PLUS && lookahead().getOpType() != OpType.MINUS)\n return false;\n else\n return true;\n }", "protected boolean atGlobalScope() {\n return !currentScope.hasParent();\n }", "@Override\n\tpublic boolean isInside() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isExpression() {\n\t\treturn heldObj.isExpression();\n\t}", "public boolean shouldContinueExecuting() {\n return (this.shouldExecute() || !this.entity.getNavigator().noPath()) && this.isBowInMainhand();\n }", "public static UnaryExpression isFalse(Expression expression) { throw Extensions.todo(); }", "@Test\r\n public void autoPrintingFun2() {\n eval( \"f <- function( a = if(FALSE) {1 } ) { a; a}\" );\r\n\r\n eval( \"f()\");\r\n assertThat(topLevelContext.getGlobals().isInvisible(), equalTo(false));\r\n }", "public static UnaryExpression isTrue(Expression expression) { throw Extensions.todo(); }", "private boolean isExpression() throws IOException\n\t{\n\t\tboolean isValid = false;\n\t\t\n\t\tif(isArithOp())\n\t\t{\n\t\t\tif(theNextToken.TokenType == TokenType.AND)\n\t\t\t{\n\t\t\t\tupdateToken();\n\t\t\t\tupdateToken();\n\t\t\t\t\n\t\t\t\tif(isExpression())\n\t\t\t\t{\n\t\t\t\t\tisValid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(theNextToken.TokenType == TokenType.OR)\n\t\t\t{\n\t\t\t\tupdateToken();\n\t\t\t\tupdateToken();\n\t\t\t\t\n\t\t\t\tif(isExpression())\n\t\t\t\t{\n\t\t\t\t\tisValid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisValid = true;\n\t\t\t}\n\t\t}\n\t\telse if(theCurrentToken.TokenType == TokenType.NOT)\n\t\t{\n\t\t\tupdateToken();\n\t\t\tif(isArithOp())\n\t\t\t{\n\t\t\t\tisValid = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public boolean isEmptyNestedClauses ();", "public boolean startsInnerScope() {\n return false;\n }", "private boolean isSymbolOperatorAhead() {\r\n\t\treturn expression[currentIndex] == '*' || expression[currentIndex] == '+' || expression[currentIndex] == '!'\r\n\t\t\t\t|| (currentIndex + 2 < expression.length && expression[currentIndex] == ':'\r\n\t\t\t\t\t\t&& expression[currentIndex + 1] == '+' && expression[currentIndex + 2] == ':');\r\n\t}", "public static boolean expression(PsiBuilder builder_, int level_) {\n if (!recursion_guard_(builder_, level_, \"expression\")) return false;\n if (!nextTokenIs(builder_, ID)) return false;\n boolean result_ = false;\n Marker marker_ = builder_.mark();\n result_ = value(builder_, level_ + 1);\n result_ = result_ && consumeToken(builder_, \"*\");\n result_ = result_ && value(builder_, level_ + 1);\n if (result_) {\n marker_.done(EXPRESSION);\n }\n else {\n marker_.rollbackTo();\n }\n return result_;\n }", "protected boolean rightChildUnderLeftImbalancedOps(Expression root, Fragment op,\n Function<Expression, Boolean> matcher) {\n return root.getOp().equals(op) && (matcher.apply(root) || rightChildUnderLeftImbalancedOps(\n getChild(root, 0), op, matcher));\n }", "boolean supportsInnerFunctions();", "public abstract boolean isInCallingProcedure(SDGNode n);", "public Boolean isThisParent(Flow f){\n\t\treturn false;\n\t}", "static boolean topLevelDefinition(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"topLevelDefinition\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_);\n r = libraryStatement(b, l + 1);\n if (!r) r = partOfStatement(b, l + 1);\n if (!r) r = importStatement(b, l + 1);\n if (!r) r = exportStatement(b, l + 1);\n if (!r) r = partStatement(b, l + 1);\n if (!r) r = classDefinition(b, l + 1);\n if (!r) r = mixinDeclaration(b, l + 1);\n if (!r) r = enumDefinition(b, l + 1);\n if (!r) r = extensionDeclaration(b, l + 1);\n if (!r) r = functionTypeAlias(b, l + 1);\n if (!r) r = getterOrSetterDeclaration(b, l + 1);\n if (!r) r = functionDeclarationWithBodyOrNative(b, l + 1);\n if (!r) r = varDeclarationListWithSemicolon(b, l + 1);\n if (!r) r = incompleteDeclaration(b, l + 1);\n exit_section_(b, l, m, r, false, DartParser::top_level_recover);\n return r;\n }", "@Override\n public boolean visit(SQLInSubQueryExpr subQuery) {\n subQuery.getExpr().setParent(subQuery);\n return true;\n }", "public boolean isRootContextNode();", "public boolean check_condition(User u) {\n\tboolean result = false;\n\t// if the recursion has not reached to the leaf level, then continue to\n\t// check the condition\n\tif (operatr_int < 10) // not a leaf node\n\t{\n\t boolean apply_result = cond.check_condition(u);\n\t boolean apply2_result = cond2.check_condition(u);\n\t switch (operatr_int) {\n\t case 1:\n\t\tresult = (apply_result && apply2_result);\n\t\tbreak;\n\t case 2:\n\t\tresult = (apply_result || apply2_result);\n\t\tbreak;\n\t }\n\t}\n\t// recursion has reached a leaf node -\n\telse {\n\t // attempt lookup of value for field name(s) from user\n\t Integer fieldVal1 = u.get_field_value(pre_field);\n\t // check whether a 2-field compare vs. field-constant compare\n\t // uses pre_field_second to signal since pre_cn can't hold null as\n\t // an int\n\t if (pre_field_second.equals(\"\"))\n\t\tresult = compare(fieldVal1, operatr_int, int_constant);\n\t else\n\t\tresult = compare(fieldVal1, operatr_int,\n\t\t\tu.get_field_value(pre_field_second));\n\t}\n\treturn result;\n }", "public boolean isMainline();", "public boolean isExpression (Object value);", "boolean hasParent();", "boolean hasParent();", "private Object eval(OrExpr expr) {\n if (expr.getExpr().size() == 1) {\n return eval(expr.getExpr().get(0));\n }\n\n boolean result = false;\n for (AndExpr e : expr.getExpr()) {\n Object res = eval(e);\n if (res instanceof Boolean) {\n result = result || (Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: Part expression result is not a boolean. Type: '\" + res.getClass() + \"'\");\n }\n\n if (result) {\n return true;\n }\n }\n return false;\n }", "@Override \n public boolean shouldTraverse(Traversal traversal, Exp e, Exp parent) {\n return true; \n }", "final public IASTPKGStatement TopLevelStatementOrProblem() throws ParseException {\r\n IASTPKGStatement stmt;\r\n Token start = token;\r\n try {\r\n stmt = TopLevelStatement();\r\n {if (true) return stmt;}\r\n } catch (ParseException e) {\r\n {if (true) return createProblemStatement(start, null, e);}\r\n }\r\n throw new Error(\"Missing return statement in function\");\r\n }", "public static String evaluate( String expr ) \n {\n\tString[] arr = expr.split(\"\\\\s+\");\n\tLLStack<String> nums = new LLStack<String>();\n\tLLStack<String> noClose = new LLStack<String>();\n\tint op = 0;\n\n\tfor(String i : arr){ \n\t if(i.equals(\")\")){ //when you reach the closing parenthesis\n\t\tString top = noClose.pop(); //start going through this part of the expression\n\t\tnums.push(i); //add ( to stack for unload\n\t\t\n\t\twhile(!top.equals(\"(\")){ //until you reach the (, where the expression ends\n\t\t\t \n\t\t if(top.equals(\"+\")) op = 1;\n\t\t else if(top.equals(\"-\")) op = 2;\n\t\t else if(top.equals(\"*\")) op = 3;\n\n\t\t else nums.push(top); //if it's not an operand\n\n\t\t top = noClose.pop();\n\t\t}\n\n\t\tnoClose.push(unload(op, nums));\n\t }\n\t \n\t else noClose.push(i); //pushed into a stack of what's in this ()\n \n\t}//end of for loop \n \n\treturn noClose.peek();\n }", "public static boolean isCallable(Player player, String rootCMD,\n\t\t\tString subCmd) {\n\t\ttry{\n\t\t\t// alias\n\t\t\treturn iBank.hasPermission(player, getPermission(rootCMD, subCmd));\n\t\t}catch(Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "void mustbe(TK tk) throws ParsingExpressionException {\n if( !is(tk) ) {\n System.err.println( \"mustbe: want \" + tk + \", got \" + tok );\n parse_error( \"missing token (mustbe)\" );\n }\n // read ahead to next token only if not at top level.\n // this enables returning to main loop after parse entire expression;\n // otherwise would need to wait for user to type first\n // part of next expression before evaluating current expression,\n // which wouldn't be so good in interactive environment.\n // (so main loop always calls scan before calling expr)\n if (level > 0) scan();\n }", "private boolean for_cond(){\n int save = position;\r\n boolean for_cond = false;\r\n\r\n if (getNextLexeme() == Lexeme.LP) {\r\n if(init()){\r\n if(log_exp() && getNextLexeme() == Lexeme.END){\r\n if(getNextLexeme() == Lexeme.VAR && assign_op()) {\r\n if (getNextLexeme() == Lexeme.RP) {\r\n for_cond = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n position = for_cond ? position : save;\r\n return for_cond;\r\n }", "boolean hasAstRoot();", "static boolean primary(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"primary\")) return false;\n boolean r;\n r = functionExpression(b, l + 1);\n if (!r) r = literalExpression(b, l + 1);\n if (!r) r = newExpression(b, l + 1);\n if (!r) r = refOrThisOrSuperOrParenExpression(b, l + 1);\n if (!r) r = throwExpression(b, l + 1);\n if (!r) r = switchExpressionWrapper(b, l + 1);\n return r;\n }", "public final boolean synpred1_InternalStl() {\n state.backtracking++;\n int start = input.mark();\n try {\n synpred1_InternalStl_fragment(); // can never throw exception\n } catch (RecognitionException re) {\n System.err.println(\"impossible: \"+re);\n }\n boolean success = !state.failed;\n input.rewind(start);\n state.backtracking--;\n state.failed=false;\n return success;\n }", "public static boolean isExpression(String expr) {\r\n return expr != null && expr.startsWith(\"%{\") && expr.endsWith(\"}\");\r\n }", "private boolean doLeftPop(final S nonTerminal, final Predicate<S> letterPredicate) {\n if(!slp.containsProduction(nonTerminal) || slp.getAxioms().contains(nonTerminal)) {\n return false;\n }\n P production = getProduction(nonTerminal);\n S head = production.getRight().findFirst(s -> !s.isEmpty()).get();\n return letterPredicate.test(head) && !production.getRight().isEmpty();\n }", "public boolean isParent();", "private boolean peekStatement() {\n return peekSourceElement();\n }", "protected boolean consecutiveNodesUnderOps(Expression root, Fragment op,\n BiFunction<Expression, Expression, Boolean> matcher) {\n Wrapper wrapper = new Wrapper();\n return consecutiveNodesUnderOps(root, op, matcher, wrapper);\n }", "@Test\n\tpublic void parenthesses_should_notbalanced_expr()\n\t{\n\t\tString result=\"\";String expr=\"\";\n\t\t\n\t\texpr=\"(a+b(a+c)\";\n\t\t result=com.bridgelabz.util.DataStructure.BalanaceParenthes(expr);\n\t\tassertTrue(\"not balanced\", result!=\"balaced\");\n\t}", "public static Predicate<INode> isValidTarget(INode x) {\n return p-> x != p && x.getTransactionState() == ETransactionState.IDLE && p.wants(x.getHead());\n }", "private static boolean wrongClosingScope(char top, char val) {\n return (top == '{' || top == '[' || top == '(') &&\n (val == '}' || val == ']' || val == ')');\n }", "public boolean ifPeekIsStmt() {\n\t\tif (ifPeek(\"IF_\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (ifPeek(\"WHILE_\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (ifPeek(\"FOR_\")) {\n\t\t\treturn true;\n\t\t}\n\t\t// **************\n\t\t// TODO\n\t\tif (ifPeek(\"ID_\")) {\n\t\t\treturn true;\n\t\t}\n\t\t// ***************\n\t\tif (ifPeek(\"RETURN_\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (ifPeek(\"BREAK_\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (ifPeek(\"CONT_\")) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static UnaryExpression isFalse(Expression expression, Method method) { throw Extensions.todo(); }", "public boolean hasSubQuery() {\r\n\t\tList list = allElements();\r\n\t\tint len = list.size();\r\n\t\tfor (int n = 0; n < len; ++n) {\r\n\t\t\tObject ob = list.get(n);\r\n\t\t\tif (ob instanceof TObject) {\r\n\t\t\t\tTObject tob = (TObject) ob;\r\n\t\t\t\tif (tob.getTType() instanceof TQueryPlanType) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "EntryPointResult evaluateSubtree(Object data, Object node, String entryPointName);", "public static UnaryExpression isTrue(Expression expression, Method method) { throw Extensions.todo(); }", "public abstract boolean isRoot(Position<E> p);", "@Override\n public boolean shouldTraverse(Traversal t, Exp e, Exp parent) {\n return true;\n }", "boolean coreHasParent();", "@Override\n public boolean continueExecuting()\n {\n return !this.entity.getNavigator().noPath();\n }", "private Operation conditionalExpr(Scope scope, Vector queue)\r\n {\r\n Operation root = new Operation();\r\n\r\n matchKeyword(Keyword.QUESTIONMARKSY);\r\n follower.add(Keyword.COLONSY);\r\n root.left = expression(scope, queue);\r\n follower.remove(follower.size() - 1);\r\n matchKeyword(Keyword.COLONSY);\r\n root.right = expression1(scope, queue);\r\n\r\n return root;\r\n }", "private boolean isInnerNode(WAVLNode x) {\n \t\tif(x.left!=EXT_NODE&&x.right!=EXT_NODE) {\r\n \t\t\treturn true;\r\n \t\t}\r\n \t\treturn false;\r\n \t}", "Expression expression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = orExpression();\r\n\t\tif (isKind(OP_QUESTION)) {\r\n\t\t\tconsume();\r\n\t\t\tExpression e1 = expression();\r\n\t\t\tmatch(OP_COLON);\r\n\t\t\tExpression e2 = expression();\r\n\t\t\te0 = new ExpressionConditional(first, e0, e1, e2);\r\n\t\t}\r\n\t\treturn e0;\r\n\t}", "public boolean isOprUner() /*const*/{\n\t\treturn Tkn==TipeToken.Not;\n\t}", "boolean ignoreInner();", "public boolean isHierarchical() {\n/* 2889 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public boolean isEmptyNestedClauses () {\r\n\t\t\t// clauses are asserted not to be null (because we do not have a setter for clauses)\r\n\t\t\treturn (this.clauses.size() == 0);\r\n\t\t}", "public static boolean UnaryExpr(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"UnaryExpr\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _COLLAPSE_, UNARY_EXPR, \"<unary expr>\");\n r = UnaryExpr_0(b, l + 1);\n r = r && ValueExpr(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "private final boolean IsBinaryOp(String expression, String symbol, String leftExpression, String rightExpression) {\r\n boolean isBinaryOp = false;\r\n if (expression.contains(symbol)) {\r\n int openParanthesisCount = 0;\r\n int closeParanthesisCount = 0;\r\n for (int i = 0; (i < expression.length()); i++) {\r\n String currentChar = expression.substring(i, 1);\r\n if ((currentChar.equals(symbol) \r\n && (openParanthesisCount == closeParanthesisCount))) {\r\n leftExpression = expression.substring(0, i);\r\n rightExpression = expression.substring((i + 1), (expression.length() - (i - 1)));\r\n isBinaryOp = true;\r\n break;\r\n }\r\n else if (currentChar.equals(\"(\")) {\r\n openParanthesisCount++;\r\n }\r\n else if (currentChar.equals(\")\")) {\r\n closeParanthesisCount++;\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n return isBinaryOp;\r\n }", "public boolean hasTopLevelNode(IAstTopLevelNode node);", "public boolean postfix_expr(PostfixExpr pe) {\n \n if (lexer.token == Symbol.IDENT) {\n Symbol temp = lexer.checkNextToken();\n if (temp == Symbol.LPAR) {\n return call_expr(pe);\n } else {\n return primary(pe);\n }\n } else {\n return primary(pe);\n }\n }", "private boolean isProcedureCall() throws IOException\n\t{\n\t\tboolean isValid = false;\n\t\t\n\t\tif(theCurrentToken.TokenType == TokenType.RIGHT_PARENTHESIS)\n\t\t{\n\t\t\tisValid = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(isArgumentList(0, theCurrentSymbol.getParameterTypes(), theCurrentSymbol.getParameterReturnTypes()))\n\t\t\t{\n\t\t\t\tif(theCurrentToken.TokenType != TokenType.RIGHT_PARENTHESIS)\n\t\t\t\t\tupdateToken();\n\t\t\t\tif(theCurrentToken.TokenType == TokenType.RIGHT_PARENTHESIS)\n\t\t\t\t{\n\t\t\t\t\tisValid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "boolean hasStatement();", "public static boolean ParenthesizedExpr(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ParenthesizedExpr\")) return false;\n if (!nextTokenIs(b, L_PAR)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, PARENTHESIZED_EXPR, null);\n r = consumeToken(b, L_PAR);\n p = r; // pin = 1\n r = r && report_error_(b, ParenthesizedExpr_1(b, l + 1));\n r = p && consumeToken(b, R_PAR) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "public final void standaloneExpression() {\n ManchesterOWLSyntaxTree STANDALONE_EXPRESSION2 = null;\n ManchesterOWLSyntaxAutoComplete.expression_return e = null;\n try {\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:88:3:\n // ( ^( STANDALONE_EXPRESSION ^( EXPRESSION e= expression ) ) )\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:88:5:\n // ^( STANDALONE_EXPRESSION ^( EXPRESSION e= expression ) )\n {\n STANDALONE_EXPRESSION2 = (ManchesterOWLSyntaxTree) match(input,\n STANDALONE_EXPRESSION,\n FOLLOW_STANDALONE_EXPRESSION_in_standaloneExpression183);\n if (state.failed) {\n return;\n }\n match(input, Token.DOWN, null);\n if (state.failed) {\n return;\n }\n match(input, EXPRESSION, FOLLOW_EXPRESSION_in_standaloneExpression186);\n if (state.failed) {\n return;\n }\n match(input, Token.DOWN, null);\n if (state.failed) {\n return;\n }\n pushFollow(FOLLOW_expression_in_standaloneExpression191);\n e = expression();\n state._fsp--;\n if (state.failed) {\n return;\n }\n match(input, Token.UP, null);\n if (state.failed) {\n return;\n }\n match(input, Token.UP, null);\n if (state.failed) {\n return;\n }\n if (state.backtracking == 1) {\n List<String> completions = new ArrayList<>();\n if (!isNewWord()) {\n completions.addAll(e.node.getCompletions());\n } else {\n if (e.node.getEvalType() != null) {\n completions.addAll(AutoCompleteStrings\n .getStandaloneExpressionCompletions(e.node\n .getEvalType()));\n }\n }\n STANDALONE_EXPRESSION2.setCompletions(completions);\n }\n }\n } catch (@SuppressWarnings(\"unused\") RecognitionException | RewriteEmptyStreamException exception) {}\n return;\n }", "private boolean peekStatementStandard() {\n switch (peekType()) {\n case OPEN_CURLY:\n case VAR:\n case CONST:\n case SEMI_COLON:\n case IF:\n case DO:\n case WHILE:\n case FOR:\n case CONTINUE:\n case BREAK:\n case RETURN:\n case WITH:\n case SWITCH:\n case THROW:\n case TRY:\n case DEBUGGER:\n case YIELD:\n case IDENTIFIER:\n case TYPE:\n case DECLARE:\n case MODULE:\n case NAMESPACE:\n case THIS:\n case CLASS:\n case SUPER:\n case NUMBER:\n case BIGINT:\n case STRING:\n case NO_SUBSTITUTION_TEMPLATE:\n case TEMPLATE_HEAD:\n case NULL:\n case TRUE:\n case SLASH: // regular expression literal\n case SLASH_EQUAL: // regular expression literal\n case FALSE:\n case OPEN_SQUARE:\n case OPEN_PAREN:\n case NEW:\n case DELETE:\n case VOID:\n case TYPEOF:\n case PLUS_PLUS:\n case MINUS_MINUS:\n case PLUS:\n case MINUS:\n case TILDE:\n case BANG:\n case IMPORT:\n return true;\n default:\n return false;\n }\n }", "public abstract boolean isInWidgetTree();", "boolean hasRootFrame();", "public boolean isRoot() { return getAncestorCount()<2; }", "public boolean isLeafContextNode();", "public static boolean isExpression(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"isExpression\")) return false;\n if (!nextTokenIs(b, IS)) return false;\n boolean r;\n Marker m = enter_section_(b, l, _LEFT_, IS_EXPRESSION, null);\n r = consumeToken(b, IS);\n r = r && isExpression_1(b, l + 1);\n r = r && type(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "private SyntaxTreeNode parseTopLevel(SyntaxTreeNode parent, String text,\n String expression) {\n int line = getLineNumber();\n\n try {\n _xpathParser.setScanner(new XPathLexer(new StringReader(text)));\n Symbol result = _xpathParser.parse(expression, line);\n if (result != null) {\n final SyntaxTreeNode node = (SyntaxTreeNode)result.value;\n if (node != null) {\n node.setParser(this);\n node.setParent(parent);\n node.setLineNumber(line);\n return node;\n }\n }\n reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR,\n expression, parent));\n }\n catch (Exception e) {\n if (ErrorMsg.XPATH_LIMIT.equals(e.getMessage())) {\n throw new RuntimeException(ErrorMsg.XPATH_LIMIT);\n }\n if (_xsltc.debug()) e.printStackTrace();\n reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR,\n expression, parent));\n }\n\n // Return a dummy pattern (which is an expression)\n SyntaxTreeNode.Dummy.setParser(this);\n return SyntaxTreeNode.Dummy;\n }", "EntryPointResult evaluateSubtree(Object data, Object node, String entryPointName, EvaluationConfig evaluationConfig);", "public final AstValidator.in_eval_return in_eval() throws RecognitionException {\n AstValidator.in_eval_return retval = new AstValidator.in_eval_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree IN198=null;\n CommonTree IN_LHS199=null;\n CommonTree IN_RHS201=null;\n AstValidator.expr_return expr200 =null;\n\n AstValidator.expr_return expr202 =null;\n\n\n CommonTree IN198_tree=null;\n CommonTree IN_LHS199_tree=null;\n CommonTree IN_RHS201_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:402:8: ( ^( IN ( ^( IN_LHS expr ) ^( IN_RHS expr ) )+ ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:402:10: ^( IN ( ^( IN_LHS expr ) ^( IN_RHS expr ) )+ )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n IN198=(CommonTree)match(input,IN,FOLLOW_IN_in_in_eval1849); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n IN198_tree = (CommonTree)adaptor.dupNode(IN198);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(IN198_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:402:16: ( ^( IN_LHS expr ) ^( IN_RHS expr ) )+\n int cnt53=0;\n loop53:\n do {\n int alt53=2;\n int LA53_0 = input.LA(1);\n\n if ( (LA53_0==IN_LHS) ) {\n alt53=1;\n }\n\n\n switch (alt53) {\n \tcase 1 :\n \t // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:402:18: ^( IN_LHS expr ) ^( IN_RHS expr )\n \t {\n \t _last = (CommonTree)input.LT(1);\n \t {\n \t CommonTree _save_last_2 = _last;\n \t CommonTree _first_2 = null;\n \t CommonTree root_2 = (CommonTree)adaptor.nil();\n \t _last = (CommonTree)input.LT(1);\n \t IN_LHS199=(CommonTree)match(input,IN_LHS,FOLLOW_IN_LHS_in_in_eval1855); if (state.failed) return retval;\n \t if ( state.backtracking==0 ) {\n \t IN_LHS199_tree = (CommonTree)adaptor.dupNode(IN_LHS199);\n\n\n \t root_2 = (CommonTree)adaptor.becomeRoot(IN_LHS199_tree, root_2);\n \t }\n\n\n \t match(input, Token.DOWN, null); if (state.failed) return retval;\n \t _last = (CommonTree)input.LT(1);\n \t pushFollow(FOLLOW_expr_in_in_eval1857);\n \t expr200=expr();\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) \n \t adaptor.addChild(root_2, expr200.getTree());\n\n\n \t match(input, Token.UP, null); if (state.failed) return retval;\n \t adaptor.addChild(root_1, root_2);\n \t _last = _save_last_2;\n \t }\n\n\n \t _last = (CommonTree)input.LT(1);\n \t {\n \t CommonTree _save_last_2 = _last;\n \t CommonTree _first_2 = null;\n \t CommonTree root_2 = (CommonTree)adaptor.nil();\n \t _last = (CommonTree)input.LT(1);\n \t IN_RHS201=(CommonTree)match(input,IN_RHS,FOLLOW_IN_RHS_in_in_eval1863); if (state.failed) return retval;\n \t if ( state.backtracking==0 ) {\n \t IN_RHS201_tree = (CommonTree)adaptor.dupNode(IN_RHS201);\n\n\n \t root_2 = (CommonTree)adaptor.becomeRoot(IN_RHS201_tree, root_2);\n \t }\n\n\n \t match(input, Token.DOWN, null); if (state.failed) return retval;\n \t _last = (CommonTree)input.LT(1);\n \t pushFollow(FOLLOW_expr_in_in_eval1865);\n \t expr202=expr();\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) \n \t adaptor.addChild(root_2, expr202.getTree());\n\n\n \t match(input, Token.UP, null); if (state.failed) return retval;\n \t adaptor.addChild(root_1, root_2);\n \t _last = _save_last_2;\n \t }\n\n\n \t if ( state.backtracking==0 ) {\n \t }\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt53 >= 1 ) break loop53;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(53, input);\n throw eee;\n }\n cnt53++;\n } while (true);\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "private Object eval(NotFact expr) {\n if (expr.getOpt() != null) {\n Object res = eval(expr.getExpr());\n if (res instanceof Boolean) {\n return !(Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: NotFact result is no boolean\");\n }\n } else {\n return eval(expr.getExpr());\n }\n }", "public boolean ifPeekIsBlockStmt() {\n\t\tif (ifPeek(\"IF_\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (ifPeek(\"WHILE_\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (ifPeek(\"FOR_\")) {\n\t\t\treturn true;\n\t\t}\n\t\t// **************\n\t\t// TODO\n\t\tif (ifPeekIsType()) {\n\t\t\treturn true;\n\t\t}\n\t\t// ***************\n\t\tif (ifPeek(\"RETURN_\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (ifPeek(\"BREAK_\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (ifPeek(\"CONT_\")) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean\n dereferenced(HIR pHir)\n {\n HIR lHir = pHir;\n while ((lHir != null) && (lHir != pHir)) {\n if (lHir.getOperator() == HIR.OP_CONTENTS) {\n return true;\n }\n lHir = (HIR)lHir.getParent();\n }\n return false;\n }", "@Override\n\tpublic boolean test(TreeNode node) {\n\t\tif (includedInResultByNode.containsKey(node)) {\n\t\t\treturn includedInResultByNode.get(node);\n\t\t} else if (node.getParent() == null || node.getParent() == evaluationRootNode) { // this is a root node, so it is considered eager\n\t\t\tincludedInResultByNode.put(node, true);\n\t\t\treturn true;\n\t\t} else if (node.getParent().isLazyChildren() && !node.getParent().isExpanded()) { // parent has lazy children\n\t\t\tincludedInResultByNode.put(node, false);\n\t\t\treturn false;\n\t\t} else { // whatever holds for the parent, also holds for this node\n\t\t\tboolean parentIncluded = test(node.getParent());\n\t\t\tincludedInResultByNode.put(node, parentIncluded);\n\t\t\treturn parentIncluded;\n\t\t}\n\t}", "boolean getDoCommonSubexpressionElimination();", "abstract boolean hasFunctionSelfArgument(Object definedOn);", "private boolean keepEvaluating(Stack<Operator> pOperatorStack, Operator pOperator) {\n if (pOperatorStack.isEmpty()) {\n return false;\n } else {\n return pOperatorStack.peek().stackPrecedence() >= pOperator.precedence();\n }\n }", "@Override\n\tpublic boolean hasSubquery() {\n\t\treturn false;\n\t}", "@Override\n public Object evaluateNode(Interpretation interpretation) {\n InternalBoolean internalBoolean = term.verifyAndReturnBoolean(interpretation);\n return internalBoolean;\n }", "public boolean getBoolean(String subExpression) {\n boolean result = false;\n String expression = contextNode + \"/\" + subExpression;\n try {\n result = (Boolean) xp.evaluate(expression, source, XPathConstants.BOOLEAN);\n Util.log(\"BOOLEAN = \"+result+ \" / source = \"+expression);\n } catch(Exception e) {\n Util.log(\"XML error: can't read node \" + expression + \".\");\n Util.logException(e);\n }\n return result;\n }" ]
[ "0.61099064", "0.5607075", "0.5437537", "0.54297775", "0.5340523", "0.5306701", "0.5306701", "0.5197611", "0.5196877", "0.51678944", "0.5154425", "0.5126033", "0.50961596", "0.509248", "0.5082923", "0.50816417", "0.5059565", "0.5042057", "0.5022918", "0.49928817", "0.49729568", "0.4971967", "0.49262428", "0.49233055", "0.490746", "0.48841947", "0.48740396", "0.48179832", "0.48148745", "0.48115864", "0.4789392", "0.47853053", "0.4779767", "0.47779062", "0.47774726", "0.4774808", "0.47571027", "0.47537774", "0.4734941", "0.4734941", "0.4730162", "0.4721204", "0.4718066", "0.46980363", "0.46881643", "0.46881142", "0.46851346", "0.46777216", "0.46728826", "0.46725515", "0.4671236", "0.466535", "0.46630892", "0.46527407", "0.46501774", "0.46441412", "0.46431354", "0.46407905", "0.4633666", "0.46262315", "0.46228895", "0.46117437", "0.4611628", "0.4607595", "0.4604361", "0.46000734", "0.45998076", "0.4592813", "0.4587358", "0.45810524", "0.45789465", "0.45783344", "0.4576681", "0.45742896", "0.45674846", "0.45659345", "0.45619804", "0.45616165", "0.4556446", "0.45532453", "0.45500553", "0.45477536", "0.45466718", "0.45442894", "0.4539818", "0.45351914", "0.45310763", "0.452791", "0.45195827", "0.45180386", "0.45159826", "0.4508471", "0.45077628", "0.45021233", "0.4500656", "0.45004514", "0.44993475", "0.4497782", "0.4497546", "0.44958326", "0.44943562" ]
0.0
-1
Get the position in the current context node list.
public int getCountOfContextNodeList(XPathContext xctxt) throws javax.xml.transform.TransformerException { // assert(null != m_contextNodeList, "m_contextNodeList must be non-null"); // If we're in a predicate, then this will return non-null. SubContextList iter = m_isTopLevel ? null : xctxt.getSubContextList(); // System.out.println("iter: "+iter); if (null != iter) return iter.getLastPos(xctxt); DTMIterator cnl = xctxt.getContextNodeList(); int count; if(null != cnl) { count = cnl.getLength(); // System.out.println("count: "+count); } else count = 0; return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getPosition() {\n\treturn (_current);\n }", "public java.lang.Integer getPosition() {\n return position;\n }", "public java.lang.Integer getPosition() {\n return position;\n }", "public int getPosition()\n\t{\n\t\treturn position;\n\t}", "public Integer getPosition() {\n return position;\n }", "public int position() {\n return pos;\n }", "public Integer getPosition()\n {\n return position;\n }", "public int getPosition() {\r\n\t\treturn position;\r\n\t}", "public int getPosition()\r\n {\r\n return position;\r\n }", "public int getCurrentPosition() {\n\t\treturn mCurrentViewIndex - getChildCount();\n\t}", "public int getPosition() {\r\n return position;\r\n }", "public final int getPosition() {\n return position;\n }", "public int getPos()\n {\n return pos;\n }", "public int getPosition() {\n return position;\n }", "public Integer getPosition() {\n return this.position;\n }", "public int getPosition() {\n return position;\n }", "public int getPosition() {\n return position;\n }", "public int getPosition() {\n return position;\n }", "public int getCurrentPosition() {\n\t\treturn currentPosition;\n\t}", "public long position() {\n return _pos;\n }", "public int getCurrentPos() {\n return currentPos;\n }", "public IntegerTulep getPosition() {\n return position;\n }", "public Integer getPosition();", "public int getPos()\n {\n return pos;\n }", "public final int getContextNode(){\n return this.getCurrentNode();\n }", "public Integer getPositionnum() {\n\t\treturn positionnum;\n\t}", "public long getPos()\n\t{\n\t\treturn -1;\n\t}", "public int getCurrentPosition() {\n return currentPosition;\n }", "public java.util.List getPosition()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(POSITION$0, 0);\n if (target == null)\n {\n return null;\n }\n return target.getListValue();\n }\n }", "public int getPosition() {\n return preferences.getInt(\"position\",0);\n }", "public int getPositionIndex()\n {\n return positionIndex;\n }", "public String getPosition(){\r\n\t\treturn position;\r\n\t}", "public String getPosition() {\n return position;\n }", "public String getPosition() {\n return position;\n }", "public String getPosition() {\n return position;\n }", "public String getPosition() {\n return position;\n }", "public String getPosition() {\n return position;\n }", "public int getPos();", "public int getPos();", "public int getPosition()\n {\n return getInt(\"Position\");\n }", "public int getPosition(){\n return -1;\n }", "@Override\n\tpublic Position getPosition() {\n\t\treturn this.posn;\n\t}", "public int getCurrentPosition(){\n return Integer.parseInt(currentPosition);\n }", "public int getPosition();", "public int getBlockIndex() {\n return mCursorPosition;\n }", "public final native CoOrdinates getPosition() /*-{\r\n\t\treturn this.position;\r\n\t}-*/;", "public int getCurrentNode() {\n\t\treturn currentNode;\n\t}", "public int getPosition() {\n return models.indexOf(activeModel);\n }", "public int getPosition() {\n log.log(Level.FINE, \"position: \" + position + \"ms\");\n return position;\n }", "@Override\n\tpublic Position getPosition() \n\t{\n\t\treturn currentPosition;\n\t}", "public final int getPos() { return i; }", "private int currentPosition() {\n return robot.leftBack.getCurrentPosition();\n }", "public int[] get_position()\r\n\t{\r\n\t\treturn this.position;\r\n\t}", "public int getTagPosition() {\n\t\treturn (position);\n\t}", "public Position getPosition() {\n\t\treturn position;\n\t}", "private static Position position(ParserRuleContext ctx) {\n return new Position(ctx.start.getLine(),\n ctx.start.getCharPositionInLine());\n }", "public Position getPosition()\n\t{\n\t\treturn position;\n\t}", "public long getPosition();", "public Vector2 getPosition() {\n\t\treturn pos;\n\t}", "public Pos getPos()\r\n\t{\r\n\t\treturn position;\r\n\t}", "@Override\n public int getPosition() {\n return position;\n }", "private int getPositionInList(Node n) \n\t//PRE: Node n is initialized\n\t//POST: FCTVAL == the position of the Node n in the list\n\t{\n\t\tNode<T> tmp = start;\n\t\tint count = 0;\t//set counter variable to keep track of position\n\t\twhile(tmp != n) //while current node != to node being searched for\n\t\t{\n\t\t\tif(count > length) //make sure position is not greater than max size of list\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tcount++;\t//increment position\n\t\t\ttmp = tmp.next;\t//move to next element\n\t\t}\n\t\treturn count;\t//return count which is the position of the node n in the list\n\t}", "public int getPositionl() {\n return preferences.getInt(\"positionl\",0);\n }", "public int getCurrentIdx() {\n\t\treturn this.currentIdx;\n\t}", "public long getNodeIndex();", "public int getCurrentIdx() {\n\t\treturn currentIdx;\n\t}", "public int currentindex() {\n\t\treturn currentElement;\n\t}", "public int getCurrentPosition() {\n\t\tif(currentPlayingItem==null) return 0;\n\t\treturn mediaPlayer.getCurrentPosition();\n\t}", "public Point getPosition()\n\t{\n\t\treturn pos;\n\t}", "default String getPos() {\n return meta(\"nlpcraft:nlp:pos\");\n }", "@Override\n\tpublic int getPos() {\n\t\treturn 0;\n\t}", "public int getXPointerPosition() {\n\t\treturn getXPosition() + getXOffset();\n\t}", "public Integer getCaretPosX() {\n\t\tint[] caretPos = getCaretPos();\n\t\treturn (caretPos == null) ? null : caretPos[0];\n\t}", "public int getPosition(E item) {\n\t\treturn data.indexOf(item);\n\t}", "public Position getPosition() {\n return position;\n }", "public Position getPosition() {\n return position;\n }", "public Position getPosition() {\n return position;\n }", "public Position getPosition() {\n return position;\n }", "public Position getPosition() {\n return position;\n }", "public Position getPosition() {\n return position;\n }", "@Override\n\t/**\n\t * returns the position of the class\n\t * \n\t * @return position\n\t */\n\tpublic int getPosition() {\n\t\treturn position;\n\t}", "public PVector getPosition(){\n\t\treturn position;\n\t}", "public int getActualCurrentPosition() {\r\n int position = getCurrentPosition();\r\n return transformToActualPosition(position);\r\n }", "public static Dimension getPos()\n {\n Dimension pos = new Dimension( cX, cY );\n next();\n return pos;\n }", "public Position getCurrentPosition() {\n return this.currentPosition;\n }", "public Point getPosition(){\n\t\treturn position;\n\t}", "public PVector getPos() {\n\t\treturn pos;\n\t}", "public Vector2 getPosition() {\n\t\treturn position;\n\t}", "public final Point getPosition()\n\t{\n\t\treturn pos;\n\t}", "@JsOverlay\n\tpublic final String getPosition() {\n\t\treturn this.position;\n\t}", "public Optional<Integer> getPosition() {\n return this.placement.getAlleles().stream()\n .map(p -> p.getAllele().getSpdi().getPosition())\n .findFirst();\n }", "public int getPosition()\n {\n return m_sequence;\n }", "int getCurrentIdx() {\n return currentIdx;\n }", "public String getPositionList() {\r\n return PositionList;\r\n }", "public int getCurrentLine() {\n return buffer.lineNumber();\n }", "public int getIndexPos() {\n\t\treturn indexPos;\n\t}", "public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}", "public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}", "public Position getPosition() {\n return this.position;\n }", "public int getPosition(){\n\t\treturn this.cell;\n\t}", "public String getPos() {\n return this.pos;\n }" ]
[ "0.7274364", "0.7163107", "0.7138715", "0.7101147", "0.7091924", "0.70862234", "0.7074034", "0.7067818", "0.69850504", "0.6972168", "0.695139", "0.6945814", "0.694438", "0.6941836", "0.69319075", "0.69297653", "0.69297653", "0.69297653", "0.69129694", "0.68908465", "0.68902874", "0.6857329", "0.6841522", "0.67950636", "0.67909884", "0.6779201", "0.6754237", "0.6737192", "0.6684512", "0.66839516", "0.6628389", "0.66120225", "0.6601736", "0.6601736", "0.6601736", "0.6601736", "0.6601736", "0.6593476", "0.6593476", "0.6573195", "0.6566146", "0.6561237", "0.65447235", "0.6536688", "0.65145487", "0.6498029", "0.6461934", "0.64219904", "0.6404401", "0.6401314", "0.63977426", "0.63975793", "0.6396099", "0.63868475", "0.6384819", "0.63793993", "0.6375707", "0.6370705", "0.63608456", "0.63557005", "0.6352691", "0.63447446", "0.6342482", "0.6329062", "0.6322171", "0.629956", "0.6298217", "0.6290062", "0.62856835", "0.6257741", "0.62418795", "0.6222621", "0.62157017", "0.6202768", "0.61994165", "0.61994165", "0.61994165", "0.61994165", "0.61994165", "0.61994165", "0.6193934", "0.6188983", "0.61852527", "0.6181693", "0.6180531", "0.6180513", "0.61795974", "0.6176928", "0.61698353", "0.6157978", "0.6148049", "0.6142258", "0.6140774", "0.6137157", "0.6136144", "0.6134011", "0.6117645", "0.6117645", "0.6111788", "0.610324", "0.6091977" ]
0.0
-1
Execute the function. The function must return a valid object.
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNumber xnum = new XNumber((double) getCountOfContextNodeList(xctxt)); // System.out.println("last: "+xnum.num()); return xnum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unchecked\")\n public <T> T execute() {\n return (T) fetchResponse(getCallToExecute());\n }", "public void execute();", "public void execute();", "public void execute();", "public void execute();", "protected final Object execute(String procedure) throws ExecutionException {\n if (parser == null) throw new ExecutionException(\"Parser not found!\");\n parser.parseExpression(procedure);\n return parser.getValueAsObject();\n }", "@Override\n public void execute() {\n this.setMyReturnValue(myHandler.getXcor());\n }", "@Override\n\tpublic Object execute() {\n\n\t\treturn null;\n\t}", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void ComputeResult(Object result);", "public void Execute() {\n\n }", "@SuppressWarnings(\"unchecked\")\n public void execute() {\n execute(null, null);\n }", "ExecutionResult<Void> execute();", "V result() throws Exception;", "abstract public void execute(FunctionContext context) throws Exception;", "public int execute();", "public boolean execute();", "public void execute() {\n }", "public abstract int execute();", "Result evaluate();", "public abstract T execute() throws Exception;", "public void execute() {\n\t\t\n\t}", "public void execute(){\n\n }", "public abstract void execute();", "public abstract void execute();", "public abstract void execute();", "@Override\n public void execute() throws EngineException {\n Object target = JavaReflectionUtil.getObject(this.target, \n callStatement.getEntries().subList(1,\n callStatement.getEntries().size() - 1));\n this.getParent().setResult(executeMethod(target, callStatement));\n pop();\n }", "@Override\r\n\tpublic String execute() throws Exception {\n\t\treturn null;\r\n\t}", "public void execute() {\n\n\t}", "public Object call() throws Exception {\n return this.call();\n }", "public void execute(){\n\t\t\n\t}", "public void execute() {\r\n\t\r\n\t}", "T execute() throws MageException;", "public abstract void execute(Serializable obj);", "<T> T callMethod(Object obj, String name, Class<T> resultType, Object... args)\n throws ScriptRunnerException;", "public abstract void execute(SimInfo object);", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "public abstract Object eval();", "public abstract Value<T> run() throws Exception;", "T execute() throws Exception;", "protected void execute()\n {\n }", "@Override\n public double execute(Object o) throws InvalidSyntaxException,\n InstantiationException, IllegalAccessException,\n ClassNotFoundException, SlogoException, EndOfStackException {\n return 0;\n }", "public T getResult();", "protected abstract void execute();", "protected void execute() {\r\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "boolean execute();", "public T execute() {\n return GraalCompiler.compile(this);\n }", "protected abstract O getResult();", "Object executeMethod(Object pObject, Method pMethod,Object[] pArgs) {\r\n\t\tObject result = null ;\r\n\t\ttry {\r\n\t\t\tresult = pMethod.invoke(pObject,pArgs) ;\r\n\t\t} catch (Exception e) {\r\n\t\t\tString message ;\r\n\t\t\tmessage = \"Error Capturing \" + getCallingClassSignature() ;\r\n\t\t\t_supervisor.echo(message) ;\r\n\t\t\tthrow new ExecutionException(message) ;\r\n\t\t}\r\n\t\treturn result ;\r\n\t}", "protected void execute() {}", "public Value execute() {\n return execute(Collections.<String, Value>emptyMap(), Collections.<String, Value>emptyMap());\n }", "public T returnValue();", "@Override\n public void Execute() {\n\n }", "protected void execute() {\n \t\n }", "protected void execute() {\n \t\n }", "public static Object invoke(CompileResult compileResult, String functionName) {\n Object[] args = {};\n return invoke(compileResult, functionName, args);\n }", "protected final boolean exec() {\n/* 94 */ this.result = compute();\n/* 95 */ return true;\n/* */ }", "@Override\n\tpublic String execute() throws Exception {\n\t\t\n\t\treturn super.execute();\n\t}", "protected void execute() {\n\t\t\n\t}", "@Override\n public Object getReturnValue(){\n return object;\n }", "protected void execute()\n\t{\n\t}", "@Override\n\tpublic void execute() {\n\t\t\n\t}", "protected void execute() {\n\n\t}", "public Void getObject() throws NotImplementedException, TimeoutException,\n NoSuccessException {\n throw new NoSuccessException(\"getObject() called on Job\");\n }", "ResponseEntity execute();", "@Override\n\tpublic String execute() throws Exception {\n\t\treturn super.execute();\n\t}", "@Override\n\tpublic String execute() throws Exception {\n\t\treturn super.execute();\n\t}", "@Override\n\tpublic String execute() throws Exception {\n\t\treturn super.execute();\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "@Override\n\tpublic int FunctionCall() {\n\t\tint s=success;\n\t\t\n\t\treturn s;\n\n\t}", "@Override\n\tpublic String execute() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String execute() {\n\t\treturn null;\n\t}", "T call() throws EvalException, InterruptedException;", "protected void execute() {\n\t}", "@Override\n\tpublic Object getValue() {\n\t\tObject[] args = new Object[function.getArity()];\n\t\tfor (int i = 0; i < function.getArity(); i++) {\n\t\t\targs[i] = connections[i].getValue();\n\t\t}\n\t\t// return function result\n\t\treturn function.run(args);\n\t}", "@Override\n public double execute() throws IllegalStateException {\n checkError();\n return getValue(X);\n }", "public void execute() {\n // empty\n }", "private JValue invoke(\n\t\tIFuncValue func,\r\n\t\tJFunctionType funcType, \r\n\t\tExecutable exec, \r\n\t\tString funcName, \r\n\t\tArgument[] args, \r\n\t\tJParameter[] params){\t\t\r\n\t\t// 1) (For typed function) Check arguments' type\r\n\t\tboolean isTyped = funcType.isTyped();\r\n\t\tif(isTyped){\r\n\t\t\tcheckArgTypes(funcName, args, params);\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// 2) Execute\r\n\t\t\tResult result = exec.execute(rt, func, args);\r\n\t\t\t\r\n\t\t\t// 3) Get the returned value\r\n\t\t\tJValue val = result.getReturnedValue(false);\r\n\t\t\tJType typ = val.getType();\r\n\t\t\tif(typ == null){\r\n\t\t\t\t// We allow typ to be null only if it is a generic null value.\r\n\t\t\t\tif(val != RefValue.NULL && !RefValue.isGenericNull(val)){\r\n\t\t\t\t\tthrow new JSEError(\"A returned value has no type.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// 4) (For typed function) Check the type of returned value\r\n\t\t\tJType retTyp = null;\r\n\t\t\t// (Optional behavior: if we are using loose typing, and function returns \r\n\t\t\t// void, coerce the value to the default of declared type. For example, \r\n\t\t\t// return 0 if the declared return type is int; null if Object or untyped)\r\n\t\t\tboolean looseReturn = this.looseTyping && typ == VoidType.getInstance();\r\n\t\r\n\t\t\tif (isTyped && !funcType.getReturn().isUntyped() && typ != null){\r\n\t\t\t\tretTyp = funcType.getReturnType();\r\n\t\t\t\tif(typ == AnyType.getInstance()){\r\n\t\t\t\t\ttyp = UntypedValue.unwrap(val).getType();\r\n\t\t\t\t}\r\n\t\t\t\tConvertibility conv = typ.getConvertibilityTo(retTyp);\r\n\t\t\t\tswitch(conv){\r\n\t\t\t\tcase DEMOTED:\r\n\t\t\t\tcase PROMOTED:\r\n\t\t\t\t\t// If we return a value with different but somewhat compatible basic type, \r\n\t\t\t\t\t// we must replicate it in the original frame using the declared type. \r\n\t\t\t\t\tbreak;\n\t\t\t\tcase ORTHOGONAL:\n\t\t\t\t\tif (JArrayType.isArrayType(retTyp) && val.deref() instanceof HostedArrayValue) {\n\t\t\t\t\t\tJValue arrVal = HostedArrayValue.toBasicArrayValue(\n\t\t\t\t\t\t\trt.getHeap(), rt.getTypeTable(), (HostedArrayValue)val.deref(), (JArrayType)retTyp);\n\t\t\t\t\t\tif (arrVal != null) {\n\t\t\t\t\t\t\tval = arrVal;\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// Fall through\n\t\t\t\tcase CASTABLE:\n\t\t\t\t\tif (!looseReturn){\r\n\t\t\t\t\t\tthrow new TypeIncompatibleException(typ, retTyp, true);\r\n\t\t\t\t\t}\n\t\t\t\t\t// Fall through\r\n\t\t\t\tcase UNCONVERTIBLE:\r\n\t\t\t\tcase UNSAFE:\r\n\t\t\t\t\tif (!looseReturn){\r\n\t\t\t\t\t\tthrow new TypeIncompatibleException(typ, retTyp);\r\n\t\t\t\t\t}\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t// Reset this to null so that replicateValue() can derive its type from the actual value.\r\n\t\t\t\t\tretTyp = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// 5) Replicate the returned value in current frame\r\n\t\t\tif (typ != null && typ.getKind() != JTypeKind.VOID){\r\n\t\t\t\t// At this moment, if retTyp == null, the new value will use the type of the one passed in (val)\r\n\t\t\t\tval = ValueUtilities.replicateValue(val, retTyp, rt.getStackMemory().currentFrame());\r\n\t\t\t} else if (looseReturn){\r\n\t\t\t\t// If the declared function returns void, coerce it to a null of type Object\r\n\t\t\t\tretTyp = funcType.getReturnType();\r\n\t\t\t\tif (retTyp == VoidType.getInstance()){\r\n\t\t\t\t\tretTyp = JObjectType.getInstance();\r\n\t\t\t\t}\r\n\t\t\t\tval = ValueUtilities.makeDefaultValue(rt.getStackMemory().currentFrame(), retTyp, false);\r\n\t\t\t}\r\n\t\t\treturn val;\r\n\t\t} catch (JulianScriptException jse){\r\n\t\t\t// Capture JSE (step 2/2):\r\n\t\t\t// At this point we have method's name and parameter information, so we can add a stack trace into the exception.\r\n\t\t\tString fn = jse.getFileName();\r\n\t\t\tint lineNo = jse.getLineNumber();\n\t\t\tString name;\n\t\t\tString[] pnames;\n\t\t\tStackTraceKind stk = jse.resetTraceKind();\n\t\t\tif (stk == null || stk == StackTraceKind.CALL) {\n\t\t\t\t// Regular trace - a function call\n\t\t\t\tname = funcType.getFullFunctionName(false);\n\t\t\t\tpnames = JParameter.getParamNames(params);\n\t\t\t} else {\n\t\t\t\t// Special trace - usually related to incorporating another file\n\t\t\t\tname = stk.getTraceName();\n\t\t\t\tpnames = null;\n\t\t\t}\r\n\t\t\tjse.addStackTrace(rt.getTypeTable(), name, pnames, fn, lineNo);\r\n\t\t\tthrow jse;\r\n\t\t} catch (EngineInvocationError e) {\r\n\t\t\tthrow new JSEError(\"An error occurs while invoking \" + funcType.getName());\r\n\t\t}\r\n\t}", "@Override\n\tpublic void execute() {\n\t}", "public void execute (T target);" ]
[ "0.6705506", "0.63403624", "0.63403624", "0.63403624", "0.63403624", "0.62579453", "0.6249405", "0.61719704", "0.61667866", "0.61667866", "0.61667866", "0.61667866", "0.61667866", "0.61667866", "0.61667866", "0.61562425", "0.614248", "0.6128119", "0.6121949", "0.60973495", "0.60852844", "0.6067252", "0.60474163", "0.60097736", "0.5983465", "0.59694344", "0.59407055", "0.5922221", "0.5903921", "0.5903307", "0.5903307", "0.5903307", "0.58828497", "0.58797663", "0.58772737", "0.5874324", "0.58739537", "0.5865238", "0.58600354", "0.5856217", "0.58381087", "0.58376104", "0.58365804", "0.58365804", "0.58365804", "0.5822899", "0.5806998", "0.57892466", "0.57870394", "0.5778383", "0.5766282", "0.57590705", "0.5754222", "0.574872", "0.574872", "0.574872", "0.574872", "0.574872", "0.574872", "0.574872", "0.574872", "0.574872", "0.574872", "0.574872", "0.574872", "0.57356536", "0.5725288", "0.5714533", "0.5710135", "0.5674168", "0.56706446", "0.56706023", "0.56694776", "0.5667834", "0.5667834", "0.5666982", "0.5660467", "0.56590784", "0.56582063", "0.5657317", "0.56508535", "0.5647372", "0.5643815", "0.5628712", "0.56256914", "0.5619794", "0.5619794", "0.5619794", "0.56178427", "0.56178427", "0.5596455", "0.5593437", "0.5593437", "0.5590276", "0.5590006", "0.55891573", "0.55742013", "0.5573889", "0.5571241", "0.5566504", "0.55657935" ]
0.0
-1
No arguments to process, so this does nothing.
public void fixupVariables(List<QName> vars, int globalsSize) { // no-op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic String process() {\n\t\treturn null;\n\t}", "public void process() {\n\t}", "public void process();", "void process();", "void process();", "public void process() {\n\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void process(TemplatingContext templatingContext)\n throws ProcessingException\n {\n // do nothing in base implementation\n }", "public abstract void onProcess();", "public static void main(String[] args) {\n process();\n }", "public void processing();", "public abstract void runProcess();", "public abstract void runProcess(String[] args) throws Exception;", "public abstract boolean process();", "public abstract void process() throws IOException;", "public static void main(String[] args) {\n\t\tprocess();\r\n\r\n\t}", "public Process() {\n\t\tthis(null);\n\t}", "public void intermediateProcessing() {\n //empty\n }", "default void process(Input input, Output response) { }", "public void start() {\n process(0);\n }", "@Override\n protected void processRun() {\n try {\n if (helpOnly) helpOnly();\n else {\n if (hasPipedInput()) pipeVersion();\n else stdinVersion();\n }\n } catch (IOException e) {\n return; // Killed process\n }\n }", "public void postProcessing() {\n //empty\n }", "@Override\n\t\t\tpublic void onProcess(int process) {\n\t\t\t}", "public void process() throws Exception {\n\n }", "@Override\n\tpublic void processing() {\n\n\t}", "public void process(Object value) {\n\t\t//empty\n\t}", "@Override\n public void run() {\n\tprocess();\n }", "@Override\n\tpublic void process() throws Exception {\n\n\t}", "@Override\n protected String process() {\n process.print();\n return \"hello world!!\";\n }", "@Override\r\n\tprotected void processExecute() {\n\r\n\t}", "@Override\n\tpublic Result doProcessing() {\n\t\treturn doProcessing1();\n\t}", "protected void doExecute(String[] arguments, ContextStatus contextStatus) {\n // no action to do\n }", "protected void execute() {\n \t// literally still do nothing\n }", "protected void additionalProcessing() {\n\t}", "@Override\n public Object preProcess() {\n return null;\n }", "public void processOutput() {\n\n\t}", "public static void doNothing(){\n\t}", "@Override\r\n\t\t\tpublic void autStartProcess() {\n\t\t\t}", "public void doNothing(){\n\t}", "@Override\n\tpublic void startProcessing() {\n\n\t}", "public static void main(String... args) {\n int status;\n try {\n process(args);\n status = 0;\n } catch (IllegalArgumentException | NoSuchElementException ex) {\n printUsage(ex);\n status = 1;\n } catch (NoSuchMethodException ex) {\n log.error(\"Method not found \", ex);\n status = 2;\n } catch (Throwable ex) {\n ex.printStackTrace();\n status = 3;\n }\n System.exit(status);\n }", "@Override\r\n\tprotected void processTarget() {\n\r\n\t}", "@Override\r\n\tprotected void processTarget() {\n\r\n\t}", "public static void main( String[] args )\n {\n \tString filePath = null;\n\t\tif (args.length != 0)\n\t\t\tfilePath = args[0];\n\t\ttry{\n\t\t\tProcessor processor = new Processor();\n\t\t\tIProcessOutput output = new ProcessOutputImpl();\n\t\t\tprocessor.ProcessFile(filePath);\n\t\t\toutput.processOutput();\n\t\t\t\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Oops !! File Not Found \");\n\t\t}\n }", "void preProcess();", "public Process() {\t// constructor with empty parameter\r\n\t\tthis.priority = -1;\t// int value will be -1\r\n \tthis.type = null;\t// String object initialized to null\r\n\t}", "public void process(Object value) {}", "public void processInput() {\n\n\t}", "@Override\n\tpublic void process(Exchange arg0) throws Exception {\n\t\t\n\t}", "void postProcess();", "void postProcess();", "@Override\r\n\tprotected void processTarget() throws SGSException {\n\r\n\t}", "@Override\n\tpublic void process() {\n\t\tInterface2.super.process();\n\t}", "@Override\n\tprotected void processInput() {\n\t}", "public abstract void process(int input);", "@Override\n\tpublic void process(Page page) {\n\t\t\n\t}", "@Override\n\tpublic void process() {\n\t\tport = Integer.parseInt(args);\n\t\tsuper.process();\n\t}", "public void run() {\n // no-op.\n }", "public abstract int process(Buffer input, Buffer output);", "private void executeSimpleProcess(T input) {\n\t\ttry {\n\t\t\tprocess.accept(input, 0);\n\t\t\tdone(false);\n\t\t} catch (RuntimeException ex) {\n\t\t\tlog.error(ex.getMessage(), ex);\n\t\t\t// exception during size estimation\n\t\t\tshowNotification(ex.getMessage());\n\t\t\tsignalDone(true);\n\t\t}\n\t}", "@Override\n public void process(Object[] args) throws HiveException {\n \n }", "@Override\r\n\tpublic void process(ResultItems arg0, Task arg1) {\n\t\t\r\n\t}", "@Override\n\tpublic Map<String, Object> preProccess() {\n\t\treturn null;\n\t}", "@Test\n public void AppNoParams() {\n try{\n App.main(new String[]{});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Insufficient arguments given. Needs [input file] [# processors]\");\n }\n }", "public boolean process() /// Returns true if it has finished processing\r\n {\r\n return true;\r\n }", "@Override\n\tpublic void stopProcessing() {\n\n\t}", "public abstract void initializeProcess();", "@Override\n public DataAttributes process(String fileName) throws Ex {\n return null;\n }", "void processMessage(VoidMessage message);", "public void startProcessingRequest(MailboxSession session) {\n // Do nothing \n }", "protected void execute() {\n\t\t//execution handled by pid thread\n\t}", "@Override\n\tpublic String OpenProcessPost() {\n\t\treturn null;\n\t}", "private static void process(String... args) throws Exception {\n Deque<String> params = new LinkedList<>(Arrays.asList(args));\n String command = params.pop().toUpperCase(Locale.ROOT);\n valueOf(command).run(params);\n }", "public final void process(Void input)\n/* */ {\n/* 53 */ if (!this.processingThread.compareAndSet(null, Thread.currentThread())) {\n/* 54 */ String msg = \"Pipeline stage is already being processed by another thread\";\n/* 55 */ Thread otherThread = (Thread)this.processingThread.get();\n/* 56 */ if (otherThread != null) {\n/* 57 */ msg = msg + \" [\" + otherThread.getName() + \"]\";\n/* */ }\n/* 59 */ throw new ConcurrentModificationException(msg);\n/* */ }\n/* */ try\n/* */ {\n/* 63 */ while (!this.stop) {\n/* 64 */ I i = this.queue.take();\n/* */ try {\n/* 66 */ invokeNext(i);\n/* */ } catch (Exception e) {\n/* 68 */ onError(i, e);\n/* */ } catch (Throwable t) {\n/* 70 */ onUnrecoverableError(i, t);\n/* 71 */ throw t;\n/* */ }\n/* */ }\n/* */ } catch (InterruptedException e) {\n/* 75 */ Exceptions.rethrowAsRuntimeException(e);\n/* */ } catch (Exception e) {\n/* 77 */ Throwables.propagate(e);\n/* */ } finally {\n/* */ try {\n/* 80 */ this.stopWaitLatch.countDown();\n/* */ } finally {\n/* 82 */ this.processingThread.set(null);\n/* */ }\n/* */ }\n/* */ }", "@Override\n\tpublic void process(Task task, Page page) {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\texecutable.feedbackExecutionProcessRunning();\r\n\t\t\t}", "private void processUnprocessed()\n {\n List<Geometry> unprocAdds;\n myUnprocessedGeometryLock.lock();\n try\n {\n // Processing the unprocessed geometries may result in them being\n // added back to one of the unprocessed maps, so create a clean set\n // of maps for them to be added to.\n if (myUnprocessedAdds.isEmpty())\n {\n unprocAdds = null;\n }\n else\n {\n unprocAdds = myUnprocessedAdds;\n myUnprocessedAdds = New.list();\n }\n }\n finally\n {\n myUnprocessedGeometryLock.unlock();\n }\n\n if (unprocAdds != null)\n {\n distributeGeometries(unprocAdds, Collections.<Geometry>emptyList());\n }\n }", "public void process() {\n\t\tSystem.out.println(\"snapdragonm 888\");\n\n\t}", "static public void main(String[] passedArgs) {\n String[] appletArgs = new String[] { \"Processing_Interface\" };\n if (passedArgs != null) {\n PApplet.main(concat(appletArgs, passedArgs));\n } else {\n PApplet.main(appletArgs);\n }\n }", "public Object caseProcess(org.topcased.ispem.Process object) {\n\t\treturn null;\n\t}", "public void processUtterance(Utterance utterance) throws ProcessException {\n\t\tif (LOGGER.isLoggable(Level.FINE)) {\n\t\t\tLOGGER.fine(\"PartOfSpeechTagger does nothing!\");\n\t\t}\n\t}", "private void processQuit() {\n System.exit(0);\n }", "void processFile(File file);", "public void processEnd();", "public void processTask(final EngineTask task) {\n processTask(task, null);\n }", "public DicomProcess() {\n\t\tsuper();\n\t}", "public abstract void processJob() throws Exception;", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tno();\n\t\t\t\t}", "public void process(WatchedEvent event) {\n\t\t\n\t}", "public static void main(String[] args) {\n processData();\r\n }", "@Override\n\tpublic boolean onProcessFaild(WorkItem wi) {\n\t\treturn false;\n\t}", "public abstract Process getProcess();", "@Override\n\t\t\tpublic String run() {\n\t\t\t\treturn null;\n\t\t\t}", "@Override\n\tprotected Object run() {\n\t\treturn null;\n\t}", "protected void doManaged() {\n // default is no-op\n }", "public void run() {\n try {\n System.out.println(\"Calling Process\");\n processRequest();\n\n } catch (Exception e) {\n System.out.println(\"Run Exception\" + e);\n }\n\n }", "@Test\r\n public void testExecute_inputNull() {\r\n \r\n assertThat((Object)processor.execute(null, ANONYMOUS_CSVCONTEXT)).isNull();\r\n \r\n }", "public void doit() {\n // Do nothing\n }", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autStartParallelProcess() {\n\t\t\t\t\r\n\t\t\t}" ]
[ "0.710592", "0.7002373", "0.6950766", "0.6838618", "0.6838618", "0.666847", "0.6641549", "0.64097273", "0.6408239", "0.6361215", "0.62609607", "0.62441224", "0.6226213", "0.61822444", "0.61803156", "0.6146798", "0.61445343", "0.61362535", "0.61052614", "0.6088474", "0.6043399", "0.6029085", "0.6021317", "0.60014534", "0.5983263", "0.5953114", "0.59312516", "0.5929385", "0.59040064", "0.5903783", "0.58942306", "0.58938926", "0.57767445", "0.57162446", "0.5689186", "0.56707776", "0.56689334", "0.5640802", "0.5636217", "0.56279767", "0.56271654", "0.5616099", "0.5616099", "0.5591906", "0.5552996", "0.5539429", "0.54903364", "0.548989", "0.54747564", "0.5467696", "0.5467696", "0.5463081", "0.54616", "0.54379493", "0.5424947", "0.540687", "0.5393536", "0.5388583", "0.53555894", "0.5350184", "0.53433895", "0.5339314", "0.5322672", "0.5309283", "0.530058", "0.5279382", "0.52657974", "0.5246761", "0.5230256", "0.52202034", "0.52053696", "0.51961154", "0.51948345", "0.51824135", "0.5182396", "0.517768", "0.51710075", "0.51604325", "0.51548237", "0.5152415", "0.5149945", "0.51456386", "0.51425403", "0.5121296", "0.5113182", "0.5109785", "0.5108769", "0.51030946", "0.50988966", "0.5074991", "0.50698626", "0.5059857", "0.50555694", "0.5054828", "0.5048841", "0.50456023", "0.5044133", "0.5041823", "0.50333434", "0.50333434", "0.50333434" ]
0.0
-1
Loads all registered PlugIns based on the configuration.
private void loadPlugins(){ KomorebiCoreConfig config = new KomorebiCoreConfig(); if(config.getRootNode().getChildrenCount("plugins") < 1){ return; } List<ConfigurationNode> pluginNodes = config.getRootNode().getChildren("plugins").get(0).getChildren("plugin"); for(int pos=0; pos<pluginNodes.size(); ++pos){ String name = config.getString("plugins.plugin("+pos+")[@name]"); String version = config.getString("plugins.plugin("+pos+")[@version]"); if(version == null || name == null){ continue; } loadPluginsJar(name+"-"+version); // check all classes in jar } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadPlugins() {\n\n ServiceLoader<Pump> serviceLoader = ServiceLoader.load(Pump.class);\n for (Pump pump : serviceLoader) {\n availablePumps.put(pump.getPumpName(), pump);\n }\n\n Pump dummy = new DummyControl();\n availablePumps.put(dummy.getName(), dummy);\n\n Pump lego = new LegoControl();\n availablePumps.put(lego.getName(), lego);\n }", "void bootPlugins() {\n\t\tList<List<String>>vals = (List<List<String>>)properties.get(\"PlugInConnectors\");\n\t\tif (vals != null && vals.size() > 0) {\n\t\t\tString name, path;\n\t\t\tIPluginConnector pc;\n\t\t\tList<String>cntr;\n\t\t\tIterator<List<String>>itr = vals.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tcntr = itr.next();\n\t\t\t\tname = cntr.get(0);\n\t\t\t\tpath = cntr.get(1);\n\t\t\t\ttry {\n\t\t\t\t\tpc = (IPluginConnector)Class.forName(path).newInstance();\n\t\t\t\t\tpc.init(this, name);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogError(e.getMessage(), e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void loadAllPlugins(final String extPointId);", "public void loadPluginsStartup();", "public void loadPlugins()\n throws Exception\n {\n SecurityClassLoader securityClassLoader = new SecurityClassLoader(Plugin.class.getClassLoader(),\n ImmutableList.of(\"ideal.sylph.\", \"com.github.harbby.gadtry.\")); //raed only sylph-api deps\n this.loader = ModuleLoader.<Plugin>newScanner()\n .setPlugin(Plugin.class)\n .setScanDir(pluginDir)\n .setLoader(OperatorManager::serviceLoad)\n .setClassLoaderFactory(urls -> new VolatileClassLoader(urls, securityClassLoader)\n {\n @Override\n protected void finalize()\n throws Throwable\n {\n super.finalize();\n logger.warn(\"Jvm gc free ClassLoader: {}\", Arrays.toString(urls));\n }\n })\n .setLoadHandler(module -> {\n logger.info(\"loading module {} find {} Operator\", module.getName(), module.getPlugins().size());\n ModuleInfo moduleInfo = new ModuleInfo(module, new ArrayList<>());\n analyzeModulePlugins(moduleInfo);\n ModuleInfo old = userExtPlugins.put(module.getName(), moduleInfo);\n if (old != null) {\n Try.of(old::close).onFailure(e -> logger.warn(\"free old module failed\", e)).doTry();\n }\n }).load();\n }", "protected void registerPreLoad(ConfigurationSection configuration) {\n PreLoadEvent loadEvent = new PreLoadEvent(this);\n Bukkit.getPluginManager().callEvent(loadEvent);\n\n blockBreakManagers.addAll(loadEvent.getBlockBreakManagers());\n blockBuildManagers.addAll(loadEvent.getBlockBuildManagers());\n pvpManagers.addAll(loadEvent.getPVPManagers());\n teamProviders.addAll(loadEvent.getTeamProviders());\n castManagers.addAll(loadEvent.getCastManagers());\n targetingProviders.addAll(loadEvent.getTargetingManagers());\n teamProviders.addAll(loadEvent.getTeamProviders());\n playerWarpManagers.putAll(loadEvent.getWarpManagers());\n\n // Vault currency must be registered after VaultController initialization\n ConfigurationSection currencyConfiguration = configuration.getConfigurationSection(\"builtin_currency\");\n addCurrency(new VaultCurrency(this, currencyConfiguration.getConfigurationSection(\"currency\")));\n\n // Custom currencies can override the defaults\n for (Currency currency : loadEvent.getCurrencies()) {\n addCurrency(currency);\n }\n\n if (aureliumSkillsManager != null) {\n aureliumSkillsManager.register(currencyConfiguration);\n }\n if (tokenManager != null) {\n tokenManager.register(currencyConfiguration);\n }\n\n // Configured currencies override everything else\n currencyConfiguration = configuration.getConfigurationSection(\"custom_currency\");\n Set<String> keys = currencyConfiguration.getKeys(false);\n for (String key : keys) {\n addCurrency(new CustomCurrency(this, key, currencyConfiguration.getConfigurationSection(key)));\n }\n\n log(\"Registered currencies: \" + StringUtils.join(currencies.keySet(), \",\"));\n\n // Register any attribute providers that were in the PreLoadEvent.\n for (AttributeProvider provider : loadEvent.getAttributeProviders()) {\n externalProviders.add(provider);\n }\n\n // Re-register any providers previously registered by external plugins via register()\n for (MagicProvider provider : externalProviders) {\n registerAndUpdate(provider);\n }\n\n // Don't allow overriding Magic requirements\n checkMagicRequirements();\n }", "public static void loadAnalyzerContributions() {\n\t\tIExtensionRegistry registry = Platform.getExtensionRegistry();\n\t\tIConfigurationElement[] config = registry.getConfigurationElementsFor(Activator.PLUGIN_ANALYZER_EXTENSION_ID);\n\t\ttry {\n\t\t\tfor (IConfigurationElement element : config) {\n\t\t\t\tfinal Object o = element.createExecutableExtension(\"class\");\n\t\t\t\tif (o instanceof Analyzer) {\n\t\t\t\t\tAnalyzer analyzer = (Analyzer) o;\n\t\t\t\t\tregisterAnalyzer(analyzer);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (CoreException e) {\n\t\t\tLog.error(\"Error loading analyzers.\", e);\n\t\t}\n\t}", "@SuppressWarnings({\"UnstableApiUsage\", \"unchecked\"})\n\tpublic void loadAllHacks() {\n\t\tfinal ConfigurationSection hackConfigs = plugin.getConfig().getConfigurationSection(\"hacks\");\n\t\tif (hackConfigs == null) {\n\t\t\tthis.plugin.warning(\"There are no hacks defined under 'hacks' the config. Is this right?\");\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tfinal ClassPath getSamplersPath = ClassPath.from(plugin.exposeClassLoader());\n\t\t\tfor (final var classInfo : getSamplersPath.getTopLevelClassesRecursive(HACKS_PATH)) {\n\t\t\t\ttry {\n\t\t\t\t\tfinal Class<?> clazz = classInfo.load();\n\t\t\t\t\tif (clazz == null || !SimpleHack.class.isAssignableFrom(clazz)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tthis.plugin.info(\"Found hack class [\" + clazz.getName() + \"]\");\n\t\t\t\t\tloadHack((Class<SimpleHack<?>>) clazz, hackConfigs.getConfigurationSection(clazz.getSimpleName()));\n\t\t\t\t}\n\t\t\t\tcatch (final NoClassDefFoundError exception) {\n\t\t\t\t\tthis.plugin.warning(\"Unable to load hack \\\"\" + classInfo.getSimpleName() + \"\\\" probably due to a \" +\n\t\t\t\t\t\t\t\"dependency / import error.\", exception);\n\t\t\t\t\t//continue;\n\t\t\t\t}\n\t\t\t\tcatch (final Exception exception) {\n\t\t\t\t\tthis.plugin.warning(\"Failed to complete hack discovery of: \" + classInfo.getName(), exception);\n\t\t\t\t\t//continue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (final Exception exception) {\n\t\t\tthis.plugin.warning(\"Failed to complete hack registration\");\n\t\t\texception.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t\tif (this.hacks.isEmpty()) {\n\t\t\tthis.plugin.warning(\"No hacks have been loaded.\");\n\t\t\t//return;\n\t\t}\n\t}", "public static void load() {\n for (DataSourceSwapper each : ServiceLoader.load(DataSourceSwapper.class)) {\n loadOneSwapper(each);\n }\n }", "@Override\n public void initialize() {\n for (final PluginInfo<AbstractVolumeManagerPlugin> info : getPlugins()) {\n String name = info.getName();\n if (name == null || name.isEmpty()) {\n name = info.getClassName();\n }\n // Add the plugin to the list of known animals.\n plugins.put(name, info);\n }\n }", "public void loadConfig() {\n\t}", "@PostConstruct\n public void init() {\n String[] commandPathPatterns = new String[]{\"classpath*:/commands/**\",\n \"classpath*:/crash/commands/**\"};\n\n // Patterns to use to look for configurations.\n String[] configPathPatterns = new String[]{\"classpath*:/crash/*\"};\n\n // Comma-separated list of commands to disable.\n String[] disabledCommands = new String[]{\"jpa*\", \"jdbc*\", \"jndi*\"};\n\n // Comma-separated list of plugins to disable. Certain plugins are disabled by default\n // based on the environment.\n String[] disabledPlugins = new String[0];\n\n FS commandFileSystem = createFileSystem(\n commandPathPatterns,\n disabledCommands);\n FS configurationFileSystem = createFileSystem(\n configPathPatterns, new String[0]);\n\n PluginDiscovery discovery = new BeanFactoryFilteringPluginDiscovery(\n this.resourceLoader.getClassLoader(), this.beanFactory,\n disabledPlugins);\n\n PluginContext context = new PluginContext(discovery,\n createPluginContextAttributes(), commandFileSystem,\n configurationFileSystem, this.resourceLoader.getClassLoader());\n\n context.refresh();\n start(context);\n }", "public static void setup()\n\t{\n\t\tregisterEvent(calico.plugins.events.clients.ClientConnect.class);\n\t\tregisterEvent(calico.plugins.events.clients.ClientDisconnect.class);\n\n\t\tregisterEvent(calico.plugins.events.scraps.ScrapCreate.class);\n\t\tregisterEvent(calico.plugins.events.scraps.ScrapDelete.class);\n\t\tregisterEvent(calico.plugins.events.scraps.ScrapReload.class);\n\t\t\n\t\t\n\t\t//System.out.println(\"LOAD PLUGINS: \"+COptions.server.plugins);\n\t\t\n\t\tlogger.debug(\"Loading plugins\");\n\t\t\n\t\ttry\n\t\t{\n\t\t\tPluginFinder pluginFinder = new PluginFinder();\n\t\t\tpluginFinder.search(\"plugins/\");\n\t\t\tList<Class<?>> pluginCollection = pluginFinder.getPluginCollection();\n\t\t\tfor (Class<?> plugin: pluginCollection)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Loading \" + plugin.getName());\n\t\t\t\tregisterPlugin(plugin);\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tString[] pluginsToLoad = COptions.server.plugins.split(\",\");\n\t\t\n//\t\tif(pluginsToLoad.length>0)\n//\t\t{\n//\t\t\tfor(int i=0;i<pluginsToLoad.length;i++)\n//\t\t\t{\n//\t\t\t\ttry\n//\t\t\t\t{\n//\t\t\t\t\tClass<?> pluginClass = Class.forName(pluginsToLoad[i].trim());\n//\t\t\t\t\tregisterPlugin(pluginClass);\n//\t\t\t\t}\n//\t\t\t\tcatch(Exception e)\n//\t\t\t\t{\n//\t\t\t\t\tlogger.error(\"Could not load plugin \"+pluginsToLoad[i].trim());\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t\t\n\t\n\t}", "@Nonnull\n public List<Class<? extends PluginInterface>> loadPlugins(@Nonnull String pluginDirName) {\n\n List<Class<? extends PluginInterface>> plugins=new ArrayList<>();\n\n //Директория для просмотра файлов\n File pluginDirectory=new File(pluginDirName);\n File[] files=pluginDirectory.listFiles((dir, name) -> name.endsWith(PLUGIN_EXT));\n\n //Загрузка плагинов\n if(files!=null && files.length>0) {\n getPluginsClasses(files).forEach(className->{\n try {\n //Получим свой загрузчик файлов и загрузим с помощью него плагины\n Class cls=getClassLoaderByFilesURL(files)\n .loadClass(className\n .replaceAll(\"/\",\".\")\n .replace(\".class\",\"\"));\n\n //Если класс расширяет PluginInterface, то добавим этот класс в массив\n Class[] interfaces=cls.getInterfaces();\n for(Class intface:interfaces) {\n if(intface.equals(PluginInterface.class)) {\n plugins.add(cls);\n }\n }\n }\n catch (Exception e){\n e.printStackTrace();\n }\n });\n }\n\n return plugins;\n }", "public void loadAndWait()\n {\n injector.addConfigurationInstances(this.configClassInstances);\n\n // load all @Services from @Configuration classes\n injector.activateFailOnNullInstance();\n injector.load();\n\n // detect duplicates and crash on matches\n injector.crashOnDuplicates();\n\n // branch out the dependencies, such that Service A, with dependency B, is\n // aware of all dependencies of B.\n injector.branchOutDependencyTree();\n\n // sort the services, based on dependency requirements\n injector.sortByDependencies();\n\n // instantiate services/clients and crash if any nil instances are detected\n injector.instantiateComponents();\n injector.crashOnNullInstances();\n\n // add the component instances to the ServiceContext\n injector.installServices(ctx);\n\n // instantiate clients\n //injector.instantiateClients();\n\n // invoke DepWire methods with required services & clients\n injector.findDepWireMethodsAndPopulate();\n }", "private void loadRegistratedResources() {\n \t\tFile kbPluginLocation = KbPlugin.getDefault().getLocation();\r\n \t\tif(kbPluginLocation!=null) {\r\n \t IExtensionRegistry registry = Platform.getExtensionRegistry();\r\n \t\t\tIExtensionPoint extensionPoint = registry.getExtensionPoint(\"org.jboss.tools.common.kb.tldResource\");\r\n \t\t\tIExtension[] extensions = extensionPoint.getExtensions();\r\n \t\t\tfor (int i=0; i<extensions.length; i++) {\r\n \t\t\t\tIExtension extension = extensions[i];\r\n \t\t\t\tIConfigurationElement[] elements = extension.getConfigurationElements();\r\n \t\t\t\tfor(int j=0; j<elements.length; j++) {\r\n \t\t\t\t\tString uri = elements[j].getAttribute(\"uri\");\r\n \t\t\t\t\tString location = elements[j].getAttribute(\"schema-location\");\r\n \t\t\t\t\tString version = elements[j].getAttribute(\"version\");\r\n \t\t\t\t\tString jsf = elements[j].getAttribute(\"jsf\");\r\n \t\t\t\t\tif(uri==null || uri.length()==0 || location==null || location.length()==0) {\r\n \t\t\t\t\t\tcontinue;\r\n \t\t\t\t\t}\r\n \t\t\t\t\tFile shemaLocation = new File(kbPluginLocation, location);\r\n \t\t\t\t\tif(shemaLocation.isFile()) {\r\n \t\t\t\t\t\tKbTldResource resource = new KbTldResource(uri, null, null, null);\r\n \t\t\t\t\t\tresource.setSchemaLocation(shemaLocation);\r\n \t\t\t\t\t\tif(version!=null && version.length()>0) {\r\n \t\t\t\t\t\t\tresource.setVersion(version);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tresource.setCustomTld(false);\r\n \t\t\t\t\t\tresource.setJsfResource(\"true\".equals(jsf));\r\n \t\t\t\t\t\tregistratedResources.put(resource, resource);\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tString message = \"Can't load KB schema: \" + shemaLocation;\r\n \t\t\t\t\t\tKbPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, KbPlugin.PLUGIN_ID, IStatus.WARNING, message, null));\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// Get custom schemas.\r\n \t\tFile schemaFolder = new File(schemaLocation); \r\n \t\tif(!schemaFolder.exists()) {\r\n \t\t\treturn;\r\n \t\t}\r\n \t\tFile[] schemas = schemaFolder.listFiles(new FileFilter(){\r\n \t\t\tpublic boolean accept(File file) {\r\n \t\t\t\tif(file.isFile()) {\r\n \t\t\t\t\treturn true;\r\n \t\t\t\t}\r\n \t\t\t\treturn false;\r\n \t\t\t}\r\n \t\t});\r\n \r\n \t\tfor(int i=0; i<schemas.length; i++) {\r\n \t\t\tDocument document = null;\r\n \t\t\ttry {\r\n \t\t\t\tdocument = KbDocumentBuilderFactory.createDocumentBuilder(false).parse(schemas[i]);\r\n \t\t\t} catch (Exception e) {\r\n \t\t\t\tKbPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, KbPlugin.PLUGIN_ID, IStatus.OK, \"Can't parse Schema (location: \" + schemas[i] + \")\", e));\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n //\t\t\tString tldLocation = schemas[i].getAbsolutePath();\r\n \t\t\tString tldLocation = document.getDocumentElement().getAttribute(SchemaNodeFactory.LOCATION_ATTRIBUTE);\r\n \t\t\tString tldUri = document.getDocumentElement().getAttribute(SchemaNodeFactory.URI_ATTRIBUTE);\r\n \t\t\tString tldVersion = document.getDocumentElement().getAttribute(SchemaNodeFactory.VERSION_ATTRIBUTE);\r\n \t\t\tString jsf = document.getDocumentElement().getAttribute(SchemaNodeFactory.JSF_ATTRIBUTE);\r\n \t\t\tString tldContent = null; \r\n \t\t\tNodeList children = document.getDocumentElement().getChildNodes();\r\n \t\t\tfor(int j=0; j<children.getLength(); j++) {\r\n \t\t\t\tNode node = children.item(j);\r\n \t\t\t\tif(node.getNodeName().equals(SchemaNodeFactory.TLD_CONTENT_NODE)) {\r\n \t\t\t\t\tNode child = node.getFirstChild();\r\n \t\t\t\t\tif(child instanceof CDATASection) {\r\n \t\t\t\t\t\ttldContent = ((CDATASection)child).getData();\r\n \t\t\t\t\t}\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tKbTldResource resource = new KbTldResource(tldUri, tldLocation, null, tldVersion);\r\n \t\t\tresource.setTldContent(tldContent);\r\n \t\t\tresource.setSchemaLocation(schemas[i]);\r\n \t\t\tresource.setCustomTld(true);\r\n \t\t\tresource.setJsfResource(\"true\".equals(jsf));\r\n \t\t\tregistratedResources.put(resource, resource);\r\n \t\t}\r\n \t}", "private void loadRegistredCommands() {\n ServiceLoader<Command> loader = ServiceLoader.load(Command.class);\n for (Command command : loader) {\n addCommand(command);\n }\n }", "private synchronized void loadProcessors() {\n if (loaded)\n return;\n\n // Get the processor service declarations\n Set<ServiceDeclaration> processorDeclarations; \n try {\n processorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(URLArtifactProcessor.class);\n } catch (IOException e) {\n \tIllegalStateException ie = new IllegalStateException(e);\n \terror(\"IllegalStateException\", staxProcessor, ie);\n throw ie;\n }\n \n for (ServiceDeclaration processorDeclaration: processorDeclarations) {\n Map<String, String> attributes = processorDeclaration.getAttributes();\n // Load a URL artifact processor\n String artifactType = attributes.get(\"type\");\n String modelTypeName = attributes.get(\"model\");\n \n // Create a processor wrapper and register it\n URLArtifactProcessor processor = new LazyURLArtifactProcessor(artifactType, modelTypeName, \n \t\tprocessorDeclaration, extensionPoints, staxProcessor, monitor);\n addArtifactProcessor(processor);\n }\n \n loaded = true;\n }", "private static void initPlugins() {\n \tJSPFProperties props = new JSPFProperties();\n PluginManager pm = PluginManagerFactory.createPluginManager(props);\n pm.addPluginsFrom(new File(\"plugins/\").toURI());\n JavaBot.plugins = new PluginManagerUtil(pm).getPlugins(javaBotPlugin.class);\n }", "public void loadConfigurations(Dictionary configurations) {\n\t}", "public void startPlugin() {\n classesDisponibles = new HashMap[types.length];\n try { // enregistrer le service d'acces aux depot de jars\n ServicesRegisterManager.registerService(Parameters.JAR_REPOSITORY_MANAGER, this);\n rescanRepository(); // creer les listes de classes disponibles a partir du depot\n }\n catch (ServiceInUseException mbiue) {\n System.err.println(\"Jar Repository Manager service created twice\");\n }\n }", "private void locateDefaultPlugins() {\n \t\tHashMap runtimeImport = getRuntimeImport();\n \n \t\t// locate runtime plugin matching the import from boot\n \t\tURL runtimePluginPath = getPluginPath(runtimeImport);\n \t\tif (runtimePluginPath == null)\n \t\t\tthrow new RuntimeException(Policy.bind(\"error.runtime\")); //$NON-NLS-1$\n \n \t\t// get boot descriptor for runtime plugin\n \t\truntimeDescriptor = createPluginBootDescriptor(runtimePluginPath);\n \n \t\t// determine the xml plugin for the selected runtime\n \t\tHashMap xmlImport = getImport(runtimePluginPath, XML_PLUGIN_ID);\n \n \t\t// locate xml plugin matching the import from runtime plugin\n \t\tURL xmlPluginPath = getPluginPath(xmlImport);\n \t\tif (xmlPluginPath == null)\n \t\t\tthrow new RuntimeException(Policy.bind(\"error.xerces\")); //$NON-NLS-1$\n \n \t\t// get boot descriptor for xml plugin\n \t\txmlDescriptor = createPluginBootDescriptor(xmlPluginPath);\n \t}", "private List<ExtensionClassLoader> getClassLoaders() {\n final List<ExtensionClassLoader> classLoaders = new ArrayList<>();\n\n // start with the class loader that loaded ExtensionManager, should be WebAppClassLoader for API WAR\n final ExtensionClassLoader frameworkClassLoader = new ExtensionClassLoader(\"web-api\", new URL[0], this.getClass().getClassLoader());\n classLoaders.add(frameworkClassLoader);\n\n // we want to use the system class loader as the parent of the extension class loaders\n ClassLoader systemClassLoader = FlowPersistenceProvider.class.getClassLoader();\n\n // add a class loader for each extension dir\n final Set<String> extensionDirs = properties.getExtensionsDirs();\n for (final String dir : extensionDirs) {\n if (!StringUtils.isBlank(dir)) {\n final ExtensionClassLoader classLoader = createClassLoader(dir, systemClassLoader);\n if (classLoader != null) {\n classLoaders.add(classLoader);\n }\n }\n }\n\n return classLoaders;\n }", "public void loadConfigs() {\n\t configYML = new ConfigYML();\n\t configYML.setup();\n }", "public static void init() {\n\t\ttry {\n\t\t\tvariables = new Variables(SaveDataUtilities.JSONIn(\"tmp/variables.json\"));\n\t\t} catch (JSONReloadException e) {\n\t\t\te.printStackTrace();\n\t\t\tvariables = new Variables();\n\t\t}\n\t\t\n\t\tLogger.print(\"Initializing.\");\n\t\t\n\t\t// Load modules\n\t\tLogger.print(\"Loading Handlers...\", 1);\n\t\t// Load default handlers\n\t\tReflections reflect = new Reflections(\"caris.framework.handlers\");\n\t\tfor( Class<?> c : reflect.getSubTypesOf( caris.framework.basehandlers.Handler.class ) ) {\n\t\t\tHandler h = null;\n\t\t\ttry {\n\t\t\t\th = (Handler) c.newInstance();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tif( h != null ) {\n\t\t\t\tLogger.print(\"Adding \" + h.name + \" to the Handler Map\", 2);\n\t\t\t\thandlers.put( h.name.toLowerCase(), h );\n\t\t\t}\n\t\t}\n\t\t// Load modular handlers\n\t\treflect = new Reflections(\"caris.modular.handlers\");\n\t\tfor( Class<?> c : reflect.getSubTypesOf( caris.framework.basehandlers.Handler.class ) ) {\n\t\t\tHandler h = null;\n\t\t\ttry {\n\t\t\t\th = (Handler) c.newInstance();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tif( h != null ) {\n\t\t\t\tLogger.print(\"Adding \" + h.name + \" to the Handler Map\", 2);\n\t\t\t\thandlers.put( h.name.toLowerCase(), h );\n\t\t\t}\n\t\t}\n\t\t\n\t\tLogger.print(\"Loaded Handlers:\", 1);\n\t\tfor( String s : handlers.keySet() ) {\n\t\t\tLogger.print(s, 2);\n\t\t}\n\t\t\t\t\n\t\tLogger.print(\"Initialization complete.\");\n\t}", "private List<IUserLoginPlugin> getLoginPlugins()\n/* */ {\n/* 341 */ if (this.plugins == null)\n/* 342 */ this.plugins = PluginManager.newIns().getExtInstances(\"loginplugin\", IUserLoginPlugin.class);\n/* 343 */ return this.plugins;\n/* */ }", "@Override\n public synchronized void load(Map<String, Object> parameters) {\n // fill properly the \"forGroups\" and \"forProjects\" fields\n processTargetGroupsAndProjects();\n\n if (!hasPlugin()) {\n LOGGER.log(Level.SEVERE, \"Configured plugin \\\"{0}\\\" has not been loaded into JVM (missing file?). \"\n + \"This can cause the authorization to fail always.\",\n getName());\n setFailed();\n LOGGER.log(Level.INFO, \"[{0}] Plugin \\\"{1}\\\" {2} and is {3}.\",\n new Object[]{\n getFlag().toString().toUpperCase(),\n getName(),\n hasPlugin() ? \"found\" : \"not found\",\n isWorking() ? \"working\" : \"failed\"});\n return;\n }\n\n setCurrentSetup(new TreeMap<>());\n getCurrentSetup().putAll(parameters);\n getCurrentSetup().putAll(getSetup());\n\n try {\n plugin.load(getCurrentSetup());\n setWorking();\n } catch (Throwable ex) {\n LOGGER.log(Level.SEVERE, \"Plugin \\\"\" + getName() + \"\\\" has failed while loading with exception:\", ex);\n setFailed();\n }\n\n LOGGER.log(Level.INFO, \"[{0}] Plugin \\\"{1}\\\" {2} and is {3}.\",\n new Object[]{\n getFlag().toString().toUpperCase(),\n getName(),\n hasPlugin() ? \"found\" : \"not found\",\n isWorking() ? \"working\" : \"failed\"});\n }", "public Collection<Plugin> getPlugins()\n {\n final List<Plugin> plugins;\n synchronized ( this )\n {\n plugins = Arrays.asList(pluginsLoaded.values().toArray(new Plugin[0]));\n }\n return Collections.unmodifiableCollection( plugins );\n }", "private void loadManager() {\n LOGGER.info(\"Load metricManager, type: {}\", METRIC_CONFIG.getMetricFrameType());\n ServiceLoader<AbstractMetricManager> metricManagers =\n ServiceLoader.load(AbstractMetricManager.class);\n int size = 0;\n for (AbstractMetricManager mf : metricManagers) {\n size++;\n if (mf.getClass()\n .getName()\n .toLowerCase()\n .contains(METRIC_CONFIG.getMetricFrameType().name().toLowerCase())) {\n metricManager = mf;\n break;\n }\n }\n\n // if no more implementations, we use nothingManager.\n if (size == 0 || metricManager == null) {\n metricManager = new DoNothingMetricManager();\n } else if (size > 1) {\n LOGGER.info(\n \"Detect more than one MetricManager, will use {}\", metricManager.getClass().getName());\n }\n }", "public void registerCoreExtensions() {\n if (extensionsRegistered) {\n throw H2O.fail(\"Extensions already registered\");\n }\n\n long before = System.currentTimeMillis();\n ServiceLoader<AbstractH2OExtension> extensionsLoader = ServiceLoader.load(AbstractH2OExtension.class);\n for (AbstractH2OExtension ext : extensionsLoader) {\n if (isEnabled(ext)) {\n ext.init();\n coreExtensions.put(ext.getExtensionName(), ext);\n }\n }\n extensionsRegistered = true;\n registerCoreExtensionsMillis = System.currentTimeMillis() - before;\n }", "private void loadClasses() {\n\t\tString[] classes = new String[] { \"com.sssprog.delicious.api.ApiAsyncTask\" };\n\t\tfor (String c : classes) {\n\t\t\ttry {\n\t\t\t\tClass.forName(c);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void loadHandlers(String namespace, ObjectFactory objectFactory)\r\n throws CockpitConfigurationException {\r\n // gets 'handlers' property\r\n Property handlersProp = getHandlersPropertyObject(namespace);\r\n\r\n // iterates all sub-properties\r\n for (Iterator<?> iter = handlersProp.list().iterator(); iter.hasNext();) {\r\n Property handlerProp = (Property) iter.next();\r\n\r\n // creates the HandlerRegistryInfo based on property name\r\n String handlerPropName = handlerProp.getName();\r\n HandlerRegistryInfo info = createHandlerRegistryInfo(handlerPropName);\r\n\r\n // creates the PhaseHandler based on property value.\r\n String handlerPropValue = handlerProp.getValue();\r\n\r\n if (handlerPropValue.trim().length() == 0) {\r\n throw new CockpitConfigurationException(\"The value of '\" + handlerPropName\r\n + \"' should not be empty\");\r\n }\r\n\r\n PhaseHandler phaseHandler = (PhaseHandler) createObject(objectFactory, handlerPropValue,\r\n PhaseHandler.class);\r\n\r\n // put the mapping to the handlers.\r\n this.delegate.registerHandler(phaseHandler, info.getType(), info.getOperation());\r\n }\r\n }", "private void init() {\n\t\tMvcs.scanPackagePath = analyseScanPath();\n\t\tif(StringHandler.isEmpty(Mvcs.scanPackagePath))\n\t\t\tthrow new RuntimeException(\"No scan path has been set! you need to setup ScanPackage annotation\");\n\t\t\n\t\t//put all class into the list\n\t\tList<String> allClassNames = scanAllClassNames();\n\t\tif(StringHandler.isEmpty(allClassNames)) //some loader may have no return value \n\t\t\treturn ;\n\t\t\n\t\tfor(String pkgPath : allClassNames){\n\t\t\tlist.add(ClassUtil.getClass(pkgPath));\n\t\t}\n\t}", "public static void registerModules()\n {\n // Mystcraft is pushed in through the backdoor so it can't be disabled.\n moduleLoader.registerUncheckedModule(Mystcraft.class);\n\n // Register the remaining plugin classes normally\n moduleLoader.registerModule(AppEng.class);\n moduleLoader.registerModule(BuildcraftTransport.class);\n moduleLoader.registerModule(IC2.class);\n moduleLoader.registerModule(Thaumcraft.class);\n moduleLoader.registerModule(NotEnoughItems.class);\n moduleLoader.registerModule(Waila.class);\n moduleLoader.registerModule(ThermalExpansion.class);\n }", "private void loadPluginsJar(String jarname){\r\n\t\tURL[] urlList = new URL[1];\r\n\t\ttry{\r\n\t\t\tURL jarUrl = new URL(\"file:\"+jarname+\".jar\");\r\n\t\t\turlList[0] = jarUrl;\r\n\t\t}catch(MalformedURLException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+jarname+\"' could not be loaded (invalid path)\");\r\n\t\t}\r\n\t\t\r\n\t\tURLClassLoader classLoader = new URLClassLoader(urlList);\r\n\t\ttry{\r\n\t\t\tJarFile jfile = new JarFile(jarname+\".jar\");\r\n\t\t\t\r\n\t\t\t// walk through all files of the jar\r\n\t\t\tEnumeration<JarEntry> entries = jfile.entries();\r\n\t\t\twhile(entries.hasMoreElements()){\r\n\t\t\t\tJarEntry entry = entries.nextElement();\r\n\t\t\t\tif(entry.isDirectory() || !entry.getName().endsWith(\".class\")){\r\n\t\t\t\t\tcontinue; // we only care for classes\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tString className = entry.getName().substring(0,entry.getName().length()-6).replace('/', '.');\r\n\t\t\t\t\r\n\t\t\t\tClass<IKomorebiPlugin> pluginClass = null;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tClass<?> cl = classLoader.loadClass(className);\r\n\t\t\t\t\tif(!IKomorebiPlugin.class.isAssignableFrom(cl)){\r\n\t\t\t\t\t\tcontinue; // only care about PlugIn classes\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tpluginClass = (Class<IKomorebiPlugin>) cl;\r\n\t\t\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Error while registering PlugIns of '\"+jarname+\"': \"+\r\n\t\t\t\t className+\" could not be loaded\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttryRegisterPlugin(jarname, pluginClass);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tjfile.close();\r\n\t\t}catch(IOException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+jarname+\"' could not be loaded (does not exist)\");\r\n\t\t}finally{\r\n\t\t\tif(classLoader != null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tclassLoader.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Potential resource leak: class loader could not be closed (reason: \"+e.getMessage()+\")\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@PostConstruct\n\tprivate void registerAllAnalyser() {\n\n\t\t// Get configuration for analysers\n\t\tMap<String, Map<String, String>> analyserProperties = analysisConfiguration.getAnalyserConfig();\n\n\t\t//get all analyser class\n\t\tReflections reflections = new Reflections(\"eu.ill.puma.analysis.analyser\");\n\n\t\t//iterate\n\t\tfor (Class analyserClass : reflections.getTypesAnnotatedWith(Analyser.class)) {\n\n\t\t\t//get annotation\n\t\t\tAnalyser analyser = (Analyser) analyserClass.getAnnotation(Analyser.class);\n\n\t\t\t// create new pool for analyser\n\t\t\tif (analyser != null) {\n\t\t\t\tthis.analyserPools.put(analyser.name(), new AnalyserPool(analyser, analyserClass, analyserProperties.get(analyser.name())));\n\n\t\t\t\tif (analyser.enabled()) {\n\t\t\t\t\tthis.enabledAnalysers.add(analyser.name());\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tlog.error(\"Failed to get instance of analyser with class \" + analyserClass);\n\t\t\t}\n\t\t}\n\t}", "protected void loadAll() {\n\t\ttry {\n\t\t\tloadGroups(this.folder, this.cls, this.cachedOnes);\n\t\t\t/*\n\t\t\t * we have to initialize the components\n\t\t\t */\n\t\t\tfor (Object obj : this.cachedOnes.values()) {\n\t\t\t\t((Component) obj).getReady();\n\t\t\t}\n\t\t\tTracer.trace(this.cachedOnes.size() + \" \" + this + \" loaded.\");\n\t\t} catch (Exception e) {\n\t\t\tthis.cachedOnes.clear();\n\t\t\tTracer.trace(\n\t\t\t\t\te,\n\t\t\t\t\tthis\n\t\t\t\t\t\t\t+ \" pre-loading failed. No component of this type is available till we successfully pre-load them again.\");\n\t\t}\n\t}", "@Override\n\tpublic void loadExtraConfigs(Configuration config)\n\t{\n\n\t}", "void loadMyDogPluginParams(MyDogPluginsParams myDogPluginsParams);", "public abstract void loaded() throws ConfigurationException;", "public void reInitialize() {\n lock.writeLock().lock();\n try {\n extensionPointPluginMap = HashBasedTable.create();\n final PluginRegistry registry = PluginRegistry.getInstance();\n List<IPlugin> extensionPointPlugins = registry.getPlugins(ExtensionPointPluginType.class);\n for (IPlugin extensionPointPlugin : extensionPointPlugins) {\n addExtensionPoint(extensionPointPlugin);\n }\n } finally {\n lock.writeLock().unlock();\n }\n }", "private void loadProviders() {\n synchronized (mLocationListeners) {\n if (sProvidersLoaded) {\n return;\n }\n\n // Load providers\n loadProvidersLocked();\n sProvidersLoaded = true;\n }\n }", "private void getPlugInsConfig(WebSocketConnector aConnector, Token aToken) {\n\t\tif (mService == null) {\n\t\t\tmService = new AdminPlugInService(NS_ADMIN, mNumberOfDays, getServer());\n\t\t}\n\n\t\tif (mLog.isDebugEnabled()) {\n\t\t\tmLog.debug(\"Processing 'getPlugInsConfig'...\");\n\t\t}\n\n\t\tgetServer().sendToken(aConnector, mService.getPlugInsConfig(aConnector, aToken));\n\t}", "private void loadJarsFromClasspath() {\n\n loadedJarsMap.clear();\n\n ClassLoader classLoader = getClass().getClassLoader();\n URL[] urls = null;\n do {\n //check if the class loader is instance of URL and cast it\n if (classLoader instanceof URLClassLoader) {\n urls = ((URLClassLoader) classLoader).getURLs();\n } else {\n // if the ClassLoader is not instance of URLClassLoader we will break the cycle and log a message\n log.info(\"ClassLoader \" + classLoader\n + \" is not instance of URLClassLoader, so it will skip it.\");\n\n // if the ClassLoader is from JBoss, it is instance of BaseClassLoader,\n // we can take the ClassPath from a public method -> listResourceCache(), from JBoss-classloader.jar\n // this ClassLoader is empty, we will get the parent\n classLoader = classLoader.getParent();\n continue;\n }\n try {\n loadJarsFromManifestFile(classLoader);\n } catch (IOException ioe) {\n log.warn(\"MANIFEST.MF is loaded, so we will not search for duplicated jars!\");\n }\n\n // add all jars from ClassPath to the map\n for (int i = 0; i < urls.length; i++) {\n addJarToMap(urls[i].getFile());\n }\n\n // get the parent classLoader\n classLoader = classLoader.getParent();\n } while (classLoader != null);\n\n if (loadedJarsMap.isEmpty()) {\n // jars are not found, so probably no URL ClassLoaders are found\n throw new RuntimeException(\"Most probrably specific server is used without URLClassLoader instances!\");\n }\n }", "@Override\r\n\tpublic void configPlugin(Plugins me) {\n\r\n\t}", "private void getPlugInsByJar(WebSocketConnector aConnector, Token aToken) {\n\t\tif (mService == null) {\n\t\t\tmService = new AdminPlugInService(NS_ADMIN, mNumberOfDays, getServer());\n\t\t}\n\n\t\tif (mLog.isDebugEnabled()) {\n\t\t\tmLog.debug(\"Processing 'getPlugInsByJar'...\");\n\t\t}\n\n\t\tgetServer().sendToken(aConnector, mService.getPlugInsByJar(aConnector, aToken));\n\t}", "private synchronized void loadProvider() {\n\t\tif (provider != null) {\n\t\t\t// Prevents loading by two thread in parallel\n\t\t\treturn;\n\t\t}\n\t\tfinal IExtensionRegistry xRegistry = Platform.getExtensionRegistry();\n\t\tfinal IExtensionPoint xPoint = xRegistry\n\t\t\t\t.getExtensionPoint(PROVIDERS_ID);\n\t\tfor (IConfigurationElement element : xPoint.getConfigurationElements()) {\n\t\t\ttry {\n\t\t\t\tfinal String id = element.getAttribute(\"id\");\n\t\t\t\tif (provider != null) {\n\t\t\t\t\tlog(null, \"Only one extension provider allowed. Provider\"\n\t\t\t\t\t\t\t+ id + \" ignored\");\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tprovider = (IFormulaExtensionProvider) element\n\t\t\t\t\t\t\t.createExecutableExtension(\"class\");\n\t\t\t\t}\n\t\t\t\tif (DEBUG)\n\t\t\t\t\tSystem.out.println(\"Registered provider extension \" + id);\n\t\t\t} catch (CoreException e) {\n\t\t\t\tlog(e, \"while loading extension provider\");\n\t\t\t}\n\t\t}\n\t}", "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initialize(DefaultPluginsCollector collector);", "@Override\n public void loadRequestHandlers(List<String> list) {\n\n this.requestHandlers.add(\n new SoletDispatcher(\n this.workingDir,\n new ApplicationLoadingServiceImpl(\n new EmbeddedApplicationScanningService(configService, workingDir),\n this.configService,\n this.workingDir + configService.getConfigParam(ConfigConstants.ASSETS_DIR_NAME, String.class)\n ),\n this.configService\n ));\n\n this.requestHandlers.add(new ResourceHandler(workingDir, s -> Collections.singletonList(\"\"), this.configService));\n }", "private FilterChain loadFilters() {\n\t\ttry {\n\t\t\tAnnotation.scan(\"src/main/java/com/qa/app\");\n\t\t} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException\n\t\t\t\t| InvocationTargetException | NoSuchMethodException | SecurityException | IOException 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 final static List<KaranteeniPlugin> getPluginInstances() {\r\n\t\treturn new ArrayList<KaranteeniPlugin>(kPluginInstances.values());\r\n\t}", "private void initConfigServices() {\n List<ServiceDTO> customizedConfigServices = getCustomizedConfigService();\n\n if (customizedConfigServices != null) {\n setConfigServices(customizedConfigServices);\n return;\n }\n\n // update from meta service\n this.tryUpdateConfigServices();\n this.schedulePeriodicRefresh();\n }", "protected void loadReporter() {\n LOGGER.info(\"Load metric reporters, type: {}\", METRIC_CONFIG.getMetricReporterList());\n compositeReporter.clearReporter();\n if (METRIC_CONFIG.getMetricReporterList() == null) {\n return;\n }\n for (ReporterType reporterType : METRIC_CONFIG.getMetricReporterList()) {\n Reporter reporter = null;\n switch (reporterType) {\n case JMX:\n ServiceLoader<JmxReporter> reporters = ServiceLoader.load(JmxReporter.class);\n for (JmxReporter jmxReporter : reporters) {\n if (jmxReporter\n .getClass()\n .getName()\n .toLowerCase()\n .contains(METRIC_CONFIG.getMetricFrameType().name().toLowerCase())) {\n jmxReporter.setMetricManager(metricManager);\n reporter = jmxReporter;\n }\n }\n break;\n case PROMETHEUS:\n reporter = new PrometheusReporter(metricManager);\n break;\n case IOTDB:\n reporter = new IoTDBSessionReporter(metricManager);\n break;\n default:\n break;\n }\n if (reporter == null) {\n LOGGER.warn(\"Failed to load reporter which type is {}\", reporterType);\n continue;\n }\n compositeReporter.addReporter(reporter);\n }\n }", "void firePluginsMonitored()\n {\n // Set that at least one iteration was done. That means that \"all available\" plugins\n // have been loaded by now.\n if ( !XMPPServer.getInstance().isSetupMode() )\n {\n executed = true;\n }\n\n for ( final PluginManagerListener listener : pluginManagerListeners )\n {\n firePluginsMonitored(listener);\n }\n }", "private void manageLoaders() {\n\n // note: null is used in place of a Bundle object since all additional\n // parameters for Loader are global variables\n\n // get LoaderManager and initialise the loader\n if (getSupportLoaderManager().getLoader(LOADER_ID_01) == null) {\n getSupportLoaderManager().initLoader(LOADER_ID_01, null, this);\n } else {\n getSupportLoaderManager().restartLoader(LOADER_ID_01, null, this);\n }\n }", "public static void reload() {\n\t\tif (getConfigManager() != null) {\n\t\t\tgetConfigManager().reload();\n\t\t}\n\t\tfor (Iterator i = getInstance().configGroups.keySet().iterator(); i.hasNext(); ) {\n\t\t\tString group = (String) i.next();\n\t\t\tif (getConfigManager(group) != null) {\n\t\t\t\tgetConfigManager(group).reload();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override\n public void onEnable() {\n spigotLogger = new SpigotLogger(\"Phantom\", ChatColor.WHITE, ChatColor.GRAY, LogLevel.DEBUG);\n\n // Load the configuration files.\n if (!setupConfigs(settingsConfig, messagesConfig)) {\n // If failed -> Stop enabling the plugin any further.\n spigotLogger.log(LogLevel.FATAL, \"Failed to load all config files.\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }\n\n // Set up all storage systems.\n if (!storageManager.setup()) {\n // If failed -> Stop enabling the plugin any further.\n spigotLogger.log(LogLevel.FATAL, \"Failed to set up storage systems.\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }\n\n // Load all (internal) modules.\n if (!moduleManager.loadAllModules()) {\n // If failed -> Stop enabling the plugin any further.\n spigotLogger.log(LogLevel.FATAL, \"Failed to load all internal modules.\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }\n\n // Now everything is loaded and we can start creating all prerequisites for the storage systems.\n // Of course we're running this async as they mostly involve IO operations.\n // Todo create server join states (OPEN, MAINTENANCE, BOOTING) for a minor update.\n Bukkit.getScheduler().runTaskAsynchronously(this, () -> {\n if (!storageManager.testSystems()) {\n // If failed -> Disable Phantom.\n }\n\n if (!storageManager.createPrerequisites()) {\n // If failed -> Disable Phantom.\n }\n });\n\n spigotLogger.log(LogLevel.SUCCESS, \"Enabled plugin.\");\n }", "public static void load() {\n tag = getPlugin().getConfig().getString(\"Tag\");\n hologram_prefix = getPlugin().getConfig().getString(\"Prefix\");\n hologram_time_fixed = getPlugin().getConfig().getBoolean(\"Hologram_time_fixed\");\n hologram_time = getPlugin().getConfig().getInt(\"Hologram_time\");\n hologram_height = getPlugin().getConfig().getInt(\"Hologram_height\");\n help_message = getPlugin().getConfig().getStringList(\"Help_message\");\n hologram_text_lines = getPlugin().getConfig().getInt(\"Max_lines\");\n special_chat = getPlugin().getConfig().getBoolean(\"Special_chat\");\n radius = getPlugin().getConfig().getBoolean(\"Radius\");\n radius_distance = getPlugin().getConfig().getInt(\"Radius_distance\");\n chat_type = getPlugin().getConfig().getInt(\"Chat-type\");\n spectator_enabled = getPlugin().getConfig().getBoolean(\"Spectator-enabled\");\n dataType = getPlugin().getConfig().getInt(\"Data\");\n mySQLip = getPlugin().getConfig().getString(\"Server\");\n mySQLDatabase = getPlugin().getConfig().getString(\"Database\");\n mySQLUsername = getPlugin().getConfig().getString(\"Username\");\n mySQLPassword = getPlugin().getConfig().getString(\"Password\");\n\n }", "private void initPluginComponents()\n {\n // Make sure that we don't miss any event.\n GuiActivator.getUIService().addPluginComponentListener(this);\n\n pluginPanelEast.setLayout(\n new BoxLayout(pluginPanelEast, BoxLayout.Y_AXIS));\n pluginPanelSouth.setLayout(\n new BoxLayout(pluginPanelSouth, BoxLayout.Y_AXIS));\n pluginPanelWest.setLayout(\n new BoxLayout(pluginPanelWest, BoxLayout.Y_AXIS));\n\n this.getContentPane().add(pluginPanelEast, BorderLayout.EAST);\n this.getContentPane().add(pluginPanelWest, BorderLayout.WEST);\n this.mainPanel.add(pluginPanelSouth, BorderLayout.SOUTH);\n\n // Search for plugin components registered through the OSGI bundle\n // context.\n Collection<ServiceReference<PluginComponentFactory>> serRefs;\n String osgiFilter\n = \"(|(\" + Container.CONTAINER_ID + \"=\"\n + Container.CONTAINER_CHAT_WINDOW.getID() + \")(\"\n + Container.CONTAINER_ID + \"=\"\n + Container.CONTAINER_CHAT_STATUS_BAR.getID() + \"))\";\n\n try\n {\n serRefs\n = GuiActivator.bundleContext.getServiceReferences(\n PluginComponentFactory.class,\n osgiFilter);\n }\n catch (InvalidSyntaxException ex)\n {\n serRefs = null;\n logger.error(\"Could not obtain plugin component reference.\", ex);\n }\n\n if ((serRefs != null) && !serRefs.isEmpty())\n {\n for (ServiceReference<PluginComponentFactory> serRef : serRefs)\n {\n PluginComponentFactory factory\n = GuiActivator.bundleContext.getService(serRef);\n Component comp\n = (Component)\n factory\n .getPluginComponentInstance(ChatWindow.this)\n .getComponent();\n\n // If this component has been already added, we have nothing\n // more to do here.\n if (comp.getParent() != null)\n return;\n\n Object borderLayoutConstraints\n = UIServiceImpl.getBorderLayoutConstraintsFromContainer(\n factory.getConstraints());\n\n addPluginComponent(\n comp,\n factory.getContainer(),\n borderLayoutConstraints);\n }\n }\n }", "public void reload(){\n\t\tplugin_configuration.load();\n\t\tflarf_configuration.load();\n\t\tmessages_configuration.load();\n\t\tstadiumlisting.load();\n\t}", "private void load() {\n if (loaded) {\n return;\n }\n loaded = true;\n\n if(useDefault){\n ConfigFileLoader.setSource(\n new MhttpdBaseConfigurationSource(\n Bootstrap.getMhttpdBaseFile(), \"server-embed.xml\"));\n }else {\n ConfigFileLoader.setSource(\n new MhttpdBaseConfigurationSource(\n Bootstrap.getMhttpdBaseFile(), getConfigFile()));\n }\n Digester digester = createStartDigester();\n try (ConfigurationSource.Resource resource = ConfigFileLoader.getSource().getServerXml()) {\n InputStream inputStream = resource.getInputStream();\n InputSource inputSource = new InputSource(resource.getUri().toURL().toString());\n inputSource.setByteStream(inputStream);\n digester.push(this);\n digester.parse(inputSource);\n } catch (Exception e) {\n return;\n }\n\n }", "private void loadAggregationModules() {\n\t\tthis.aggregationModules = new ModuleLoader<IAggregate>(\"/Aggregation_Modules\", IAggregate.class).loadClasses();\n\t}", "@Override\n public void onEnable() {\n log.info(\"Loading players file\");\n try {\n players = this.load(PLAYERS_CONF_PATH);\n } catch (Exception e) {\n }\n if (players == null) {\n log.info(\"players == null, creating Map\");\n players = new HashMap<String, PlayerConfig>();\n }\n log.info(\"Enabling CanBadia Plugin\");\n\n PluginManager pm = this.getServer().getPluginManager();\n\n\n getCommand(\"trade\").setExecutor(tradeCommandExecutor);\n getCommand(\"god\").setExecutor(godCommandExecutor);\n getCommand(\"godsfullpower\").setExecutor(godCommandExecutor);\n getCommand(\"market\").setExecutor(marketCommandExecutor);\n getCommand(\"class\").setExecutor(godCommandExecutor);\n getCommand(\"wall\").setExecutor(wallCommandExecutor);\n\n\n /*Some other example listeners\n pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_EXPLODE, entityListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.CREATURE_SPAWN, spawnListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_EXPLODE, entityListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BURN, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_IGNITE, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Normal, this);\n */\n\n }", "public void load() {\n loadDisabledWorlds();\n chunks.clear();\n for (World world : ObsidianDestroyer.getInstance().getServer().getWorlds()) {\n for (Chunk chunk : world.getLoadedChunks()) {\n loadChunk(chunk);\n }\n }\n }", "public static void load() {\r\n\r\n log.info(\"Config : loading Listener info\"); //$NON-NLS-1$\r\n\r\n Collection children = Collections.EMPTY_LIST;\r\n\r\n try {\r\n\r\n Content startPage = ContentRepository.getHierarchyManager(ContentRepository.CONFIG).getContent(CONFIG_PAGE);\r\n Content configNode = startPage.getContent(\"IPConfig\");\r\n children = configNode.getChildren(ItemType.CONTENTNODE); //$NON-NLS-1$\r\n }\r\n catch (RepositoryException re) {\r\n log.error(\"Config : Failed to load Listener info\"); //$NON-NLS-1$\r\n log.error(re.getMessage(), re);\r\n }\r\n\r\n Listener.cachedContent.clear();\r\n Listener.cacheContent(children);\r\n log.info(\"Config : Listener info loaded\"); //$NON-NLS-1$\r\n }", "public static Map<String, DSEMergeConfigurator> initializeConfiguration() {\n try {\n configuratorMapping = Maps.newHashMap();\n IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(CONFIGURATION_POINT);\n for (IExtension ext : extensionPoint.getExtensions()) {\n\n for (IConfigurationElement conf : ext.getConfigurationElements()) {\n String uri = conf.getAttribute(URI_ATTRIBUTE);\n DSEMergeConfigurator configurator;\n configurator = (DSEMergeConfigurator) conf.createExecutableExtension(CLASS_ATTRIBUTE);\n if (uri != null && configurator != null)\n configuratorMapping.put(uri, configurator);\n }\n }\n } catch (InvalidRegistryObjectException | CoreException e) {\n logger.error(e.getMessage(),e);\n }\n return configuratorMapping;\n }", "protected void init() {\n eachModule(ModuleHandler.INSTANCE::depends);\n \n // init, only enabled modules are run\n eachEnabledModule(ModuleHandler.INSTANCE::init);\n \n // listen for server world loading events\n // LoadWorldCallback.EVENT.register(server -> eachEnabledModule(m ->\n // m.loadWorld(server)));\n }", "private void loadExtensionResources() {\n\n for (String extensionType : ExtensionMgtUtils.getExtensionTypes()) {\n Path path = ExtensionMgtUtils.getExtensionPath(extensionType);\n if (log.isDebugEnabled()) {\n log.debug(\"Loading default templates from: \" + path);\n }\n\n // Check whether the given extension type directory exists.\n if (!Files.exists(path) || !Files.isDirectory(path)) {\n if (log.isDebugEnabled()) {\n log.debug(\"Default templates directory does not exist: \" + path);\n }\n continue;\n }\n\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addExtensionType(extensionType);\n\n // Load extensions from the given extension type directory.\n try (Stream<Path> directories = Files.list(path).filter(Files::isDirectory)) {\n directories.forEach(extensionDirectory -> {\n try {\n // Load extension info.\n ExtensionInfo extensionInfo = loadExtensionInfo(extensionDirectory);\n if (extensionInfo == null) {\n throw new ExtensionManagementException(\"Error while loading extension info from: \"\n + extensionDirectory);\n }\n extensionInfo.setType(extensionType);\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addExtension(extensionType,\n extensionInfo.getId(), extensionInfo);\n // Load templates.\n JSONObject template = loadTemplate(extensionDirectory);\n if (template != null) {\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addTemplate(extensionType,\n extensionInfo.getId(), template);\n }\n // Load metadata.\n JSONObject metadata = loadMetadata(extensionDirectory);\n if (metadata != null) {\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addMetadata(extensionType,\n extensionInfo.getId(), metadata);\n }\n } catch (ExtensionManagementException e) {\n log.error(\"Error while loading resource files in: \" + extensionDirectory, e);\n }\n });\n } catch (IOException e) {\n log.error(\"Error while loading resource files in: \" + path, e);\n }\n }\n }", "private void scanAndRegisterTypes() throws Exception {\n ScannedClassLoader scl = ScannedClassLoader.getSystemScannedClassLoader();\n // search annotations\n Iterator<Metadata> it = scl.getAll(MetadataType.class, Metadata.class); //CellFactorySPI.class);\n logger.log(Level.INFO, \"[Metadata Service] about to search classloader\");\n while (it.hasNext()) {\n Metadata metadata = it.next();\n logger.log(Level.INFO, \"[Metadata Service] using system scl, scanned type:\" + metadata.simpleName());\n registerMetadataType(metadata);\n }\n }", "private void configurePhotoLoaders() {\n String themePhotosUrl = null;\n String myPhotosUrl = null;\n String friendPhotosUrl = null;\n\n if (mTheme != null) {\n themePhotosUrl = String.format(Endpoints.THEME_PHOTO_LIST, mTheme.id);\n\n if (!isAuthenticating() && mPhotoUser != null) {\n myPhotosUrl = String.format(Endpoints.USER_THEME_PHOTO_LIST, Endpoints.ME_ID,\n mTheme.id);\n\n friendPhotosUrl = String.format(Endpoints.FRIENDS_PHOTO_LIST, Endpoints.ME_ID,\n mTheme.id);\n }\n }\n\n mThemePhotosLoader = restartLoader(mLoaderMgr, THEME_PHOTOS_ID, mThemePhotosLoader,\n new PhotoCallbacks(THEME_PHOTOS_ID, mThemePhotos), themePhotosUrl);\n mMyPhotosLoader = restartLoader(mLoaderMgr, MY_PHOTOS_ID, mMyPhotosLoader,\n new PhotoCallbacks(MY_PHOTOS_ID, mMyPhotos), myPhotosUrl);\n mFriendPhotosLoader = restartLoader(mLoaderMgr, FRIEND_PHOTOS_ID, mFriendPhotosLoader,\n new PhotoCallbacks(FRIEND_PHOTOS_ID, mFriendPhotos), friendPhotosUrl);\n }", "private void loadConfiguration(String namespace)\r\n throws CockpitConfigurationException, CockpitPhaseManagementException {\r\n // gets 'objectFactoryNamespace' property value\r\n // and creates the ObjectFactory instance\r\n String objectFactoryNamespace = getPropertyValue(namespace, \"objectFactoryNamespace\", null);\r\n ObjectFactory objectFactory = createObjectFactory(objectFactoryNamespace);\r\n\r\n // gets 'contestManagerName' property value.\r\n String contestManagerName = getPropertyValue(namespace, \"contestManagerName\", \"\");\r\n\r\n // if it is specified, create ContestManager via JNDI\r\n if (contestManagerName.length() > 0) {\r\n String jndiUtilNamespace = getPropertyValue(namespace, \"jndiUtilNamespace\", JNDIUtils.NAMESPACE);\r\n createContestManager(contestManagerName, jndiUtilNamespace);\r\n } else {\r\n // otherwise, use ObjectFactory to create the ContestManager\r\n String contestManagerKey = getPropertyValue(namespace, \"contestManagerKey\", null);\r\n delegate = (CockpitPhaseManagerInterface) createObject(objectFactory, contestManagerKey, ContestManager.class);\r\n }\r\n\r\n // creates the Log if it is configured\r\n String logName = getPropertyValue(namespace, \"logName\", \"\");\r\n\r\n if (logName.length() > 0) {\r\n// this.delegate.setLog(LogManager.getLog(logName));\r\n }\r\n\r\n // creates the Cache if it is configured\r\n String cachedContestStatusesKey = getPropertyValue(namespace, \"cachedContestStatusesKey\", \"\");\r\n\r\n if (cachedContestStatusesKey.length() > 0) {\r\n// this.delegate.setCachedContestStatuses((Cache) createObject(objectFactory, cachedContestStatusesKey, Cache.class));\r\n }\r\n\r\n // loads phase handlers configuration values\r\n loadHandlers(namespace, objectFactory);\r\n }", "public void activate(Bundle bundle) {\n if (! m_enabled && Extender.getIPOJOBundleContext().getBundle().getBundleId() == bundle.getBundleId()) {\n // Fast return if the configuration tracking is disabled, or if we are iPOJO\n return;\n }\n\n // It's not required to process bundle not importing the configuration package.\n final String imports = bundle.getHeaders().get(Constants.IMPORT_PACKAGE);\n if (imports == null || ! imports.contains(\"org.apache.felix.ipojo.configuration\")) {\n // TODO Check dynamic imports to verify if the package is not imported lazily.\n return;\n }\n\n BundleWiring wiring = bundle.adapt(BundleWiring.class);\n if (wiring == null) {\n // Invalid state.\n m_logger.log(Log.ERROR, \"The bundle \" + bundle.getBundleId() + \" (\" + bundle.getSymbolicName() + \") \" +\n \"cannot be adapted to BundleWiring, state: \" + bundle.getState());\n return;\n }\n\n // Only lookup for local classes, parent classes will be analyzed on demand.\n Collection<String> resources = wiring.listResources(\"/\", \"*.class\",\n BundleWiring.FINDENTRIES_RECURSE + BundleWiring.LISTRESOURCES_LOCAL);\n if (resources == null) {\n m_logger.log(Log.ERROR, \"The bundle \" + bundle.getBundleId() + \" (\" + bundle.getSymbolicName() + \") \" +\n \" does not have any classes to be analyzed\");\n return;\n }\n m_logger.log(Log.DEBUG, resources.size() + \" classes found\");\n handleResources(bundle, resources, wiring.getClassLoader());\n }", "private void initList() {\n long now = System.nanoTime();\n loadConfig();\n SlogEx.d(TAG, \"load config use:\" + (System.nanoTime() - now));\n }", "List<QuestionPlugin> getQuestionPlugins();", "public static synchronized void init() {\n String registryClassName = System.getProperty(REGISTRY_CLASS_NAME,\n DefaultServiceRegistry.class.getName());\n String endpointProviderClassName = System.getProperty(ENDPOINT_PROVIDER_CLASS_NAME,\n DefaultEndpointProvider.class.getName());\n\n try {\n registry = getRegistry(registryClassName);\n endpointProvider = getEndpointProvider(endpointProviderClassName);\n transformers = new BaseTransformerRegistry();\n } catch (NullPointerException npe) {\n throw new RuntimeException(npe);\n }\n }", "public void initConfigurations() {\r\n for (int configId = 0; configId < savedConfigurations.length; configId++) {\r\n if (configId == InterfaceConfiguration.HD_TEXTURES.getId()) {\r\n continue;\r\n }\r\n int value = savedConfigurations[configId];\r\n if (value != 0) {\r\n set(configId, value, false);\r\n }\r\n }\r\n }", "public static void loadEndpoints(){\n\t\tStart.loadEndpoints();\n\t\t//add\t\t\n\t\t//e.g.: get(\"/my-endpoint\", (request, response) ->\t\tmyEndpointGet(request, response));\n\t\t//e.g.: post(\"/my-endpoint\", (request, response) ->\t\tmyEndpointPost(request, response));\n\t}", "public boolean arePluginsLoaded() {\n return pluginsLoaded.get();\n }", "public Configuration() {\n\t\tpackages(\"apiservice.services\");\n\t\tregister(CORSFilter.class);\n\t\tregister(AuthenticationFilter.class);\n\t}", "public void load(Maussentials plugin);", "private void initSingletons() {\n\t\tModel.getInstance();\n\t\tSocialManager.getInstance();\n\t\tMensaDataSource.getInstance();\n\t}", "public void init() {\n\t\tregisterBeanDefinitionParser(\"component-scan\", new AutoComponentScanBeanDefinitionParser());\n\t}", "public default void reloadAll() {\n\t\tBukkit.getConsoleSender().sendMessage(\"Reloading \" + getClass().getSimpleName() + \"'s Configs!\");\n\t\treload();\n\t\tBukkit.getConsoleSender().sendMessage(\"Finished \" + getClass().getSimpleName() + \"'s Configs!\");\n\t}", "public void reload() {\n FileConfiguration config = plugin.getConfig();\n\n // Set up answers\n answers = new HashMap<>();\n if(config.contains(\"answers\")) {\n Map<String, Object> answersConfig = config.getConfigurationSection(\"answers\").getValues(true);\n for (Map.Entry<String, Object> entry : answersConfig.entrySet()) {\n if(entry.getValue() instanceof String) {\n answers.put(entry.getKey(), (String) entry.getValue());\n } else {\n logger.info(\"Invalid value for answer ID \" + entry.getKey());\n }\n }\n } else {\n logger.info(\"The config does not have answers! Not even for your existence!\");\n }\n\n // Set up questions\n questions = new HashMap<>();\n if(config.contains(\"questions\")) {\n Map<String, Object> questionsConfig = config.getConfigurationSection(\"questions\").getValues(true);\n for (Map.Entry<String, Object> entry : questionsConfig.entrySet()) {\n String answerID = \"\";\n if(entry.getValue() instanceof Integer) {\n answerID = entry.getValue().toString();\n } else if(entry.getValue() instanceof String) {\n answerID = (String) entry.getValue();\n } else if(answerID.isEmpty()) {\n logger.info(\"Invalid value for question regex \" + entry.getKey());\n continue;\n }\n\n if(questions.containsKey(entry.getKey()) && !answers.containsKey(answerID)) {\n logger.warning(\"Answer ID \" + entry.getValue() + \" not found\");\n } else {\n questions.put(entry.getKey(), answerID);\n }\n }\n\n logger.info(\"Registered \" + questions.size() + \" questions\");\n } else {\n logger.info(\"The config does not have questions!\");\n }\n\n commands = new HashMap<>();\n if(config.contains(\"listen-commands\")) {\n Map<String, Object> cmdsConfig = config.getConfigurationSection(\"listen-commands\").getValues(false);\n for (Map.Entry<String, Object> entry : cmdsConfig.entrySet()) {\n String cmdName = entry.getKey().toLowerCase();\n if(commands.containsKey(cmdName)) continue;\n\n CommandConfig newCmd = new CommandConfig(cmdName);\n ConfigurationSection ms = config.getConfigurationSection(\"listen-commands\").getConfigurationSection(cmdName);\n if(ms == null) continue;\n\n if(ms.contains(\"cancel\")) newCmd.cancel = ms.getBoolean(\"cancel\");\n if(ms.contains(\"tell-staff\")) newCmd.tellStaff = ms.getBoolean(\"tell-staff\");\n if(ms.contains(\"args-offset\")) newCmd.offset = ms.getInt(\"args-offset\");\n commands.put(cmdName, newCmd);\n logger.info(\"Listening to command '\" + cmdName + \"'\");\n }\n }\n }", "public static void mainRegistry() {\n\t\tregisterTileEntity(TileEntityLightningCell.class);\n\t\tregisterTileEntity(TileEntityLightningFurnace.class);\n\t\tregisterTileEntity(TileEntityLightningCrusher.class);\n\t\tregisterTileEntity(TileEntityLightningInfuser.class);\n\t\tregisterTileEntity(TileEntityLightningBreaker.class);\n\t\tregisterTileEntity(TileEntityLightningMiner.class);\n\t\tregisterTileEntity(TileEntityStaticGenerator.class);\n\t\tregisterTileEntity(TileEntityChargingPlate.class);\n\t\tregisterTileEntity(TileEntityEnchReallocator.class);\n\t\tregisterTileEntity(TileEntityLightningCannon.class);\n\t\tregisterTileEntity(TileEntityLightningTransmitter.class);\n\t\tregisterTileEntity(TileEntityLightningReceiver.class);\n\t\tregisterTileEntity(TileEntityEnergyProvider.class);\n\t\tregisterTileEntity(TileEntityEnergyReceiver.class);\n\t}", "protected void initSingletons()\n {\n Singleton.initInstance();\n }", "public static void preLoad() {\n\t\tserviceClasses.clear();\n\t\tloadGroups(CLASS_FOLDER, null, serviceClasses);\n\t\tTracer.trace(serviceClasses.size()\n\t\t\t\t+ \" java class names loaded as services.\");\n\t\t/*\n\t\t * clean and pre-load if required\n\t\t */\n\t\tfor (ComponentType aType : ComponentType.values()) {\n\t\t\tif (aType.cachedOnes != null) {\n\t\t\t\taType.cachedOnes.clear();\n\t\t\t}\n\t\t\tif (aType.preLoaded) {\n\t\t\t\taType.loadAll();\n\t\t\t}\n\t\t}\n\t}", "private PluginRegistry(@Nonnull Config config,\n @Nonnull Map<String, PluginMap> pluginMapsByCategory,\n @Nonnull BiMap<Class<?>, PluginMap> pluginMapsByClass) {\n this.config = config;\n this.pluginMapsByCategory = pluginMapsByCategory;\n this.pluginMapsByClass = pluginMapsByClass;\n }", "public void reloadMsPlugins(String path);", "private void loadExtensions(final Class extensionClass, final ExtensionClassLoader extensionClassLoader) {\n final ServiceLoader<?> serviceLoader = ServiceLoader.load(extensionClass, extensionClassLoader);\n for (final Object o : serviceLoader) {\n final String extensionClassName = o.getClass().getCanonicalName();\n if (classLoaderMap.containsKey(extensionClassName)) {\n final String currDir = extensionClassLoader.getRootDir();\n final String existingDir = classLoaderMap.get(extensionClassName).getRootDir();\n LOGGER.warn(\"Skipping {} from {} which was already found in {}\", new Object[]{extensionClassName, currDir, existingDir});\n } else {\n classLoaderMap.put(o.getClass().getCanonicalName(), extensionClassLoader);\n }\n }\n }", "void injectorClassLoader() {\n\t\t//To get the package name\n\t\tString pkgName = context.getPackageName();\n\t\t//To get the context\n\t\tContext contextImpl = ((ContextWrapper) context).getBaseContext();\n\t\t//Access to the Activity of the main thread\n\t\tObject activityThread = null;\n\t\ttry {\n\t\t\tactivityThread = Reflection.getField(contextImpl, \"mMainThread\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//Get package container\n\t\tMap mPackages = null;\n\t\ttry {\n\t\t\tmPackages = (Map) Reflection.getField(activityThread, \"mPackages\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//To obtain a weak reference object, the standard reflection\n\t\tWeakReference weakReference = (WeakReference) mPackages.get(pkgName);\n\t\tif (weakReference == null) {\n\t\t\tlog.e(\"loadedApk is null\");\n\t\t} else {\n\t\t\t//Get apk need to be loaded\n\t\t\tObject loadedApk = weakReference.get();\n\t\t\t\n\t\t\tif (loadedApk == null) {\n\t\t\t\tlog.e(\"loadedApk is null\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (appClassLoader == null) {\n\t\t\t\t//Access to the original class loader\n\t\t\t\tClassLoader old = null;\n\t\t\t\ttry {\n\t\t\t\t\told = (ClassLoader) Reflection.getField(loadedApk,\n\t\t\t\t\t\t\t\"mClassLoader\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t//According to the default class loader instantiate a plug-in class loader\n\t\t\t\tappClassLoader = new SyknetAppClassLoader(old, this);\n\t\t\t}\n\t\t\t//Replace the new plug-in loader loader by default\n\t\t\ttry {\n\t\t\t\tReflection.setField(loadedApk, \"mClassLoader\", appClassLoader);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public interface PluginManager<P extends REIPlugin<?>> extends ParentReloadable<P> {\n @Environment(EnvType.CLIENT)\n static PluginManager<REIClientPlugin> getClientInstance() {\n return ClientInternals.getPluginManager();\n }\n \n static PluginManager<REIPlugin<?>> getInstance() {\n return Internals.getPluginManager();\n }\n \n static PluginManager<REIServerPlugin> getServerInstance() {\n return Internals.getServerPluginManager();\n }\n \n static List<PluginManager<? extends REIPlugin<?>>> getActiveInstances() {\n return EnvExecutor.getEnvSpecific(() -> () -> Arrays.asList(getInstance(), getClientInstance(), getServerInstance()),\n () -> () -> Arrays.asList(getInstance(), getServerInstance()));\n }\n \n static boolean areAnyReloading() {\n return CollectionUtils.anyMatch(getActiveInstances(), PluginManager::isReloading);\n }\n \n boolean isReloading();\n \n <T extends Reloadable<? super P>> T get(Class<T> reloadableClass);\n \n List<REIPluginProvider<P>> getPluginProviders();\n \n Iterable<P> getPlugins();\n \n @ApiStatus.Internal\n PluginView<P> view();\n}", "public void initialize() {\n final ConfigurationManager config = ConfigurationManager.getInstance();\n boolean overrideLog = System.getProperty(\"azureus.overridelog\") != null;\n\n for (int i = 0; i < ignoredComponents.length; i++) {\n ignoredComponents[i] = new ArrayList();\n }\n\n if (!overrideLog) {\n config.addListener(new COConfigurationListener() {\n public void configurationSaved() {\n checkLoggingConfig();\n }\n });\n }\n\n checkLoggingConfig();\n config.addParameterListener(CFG_ENABLELOGTOFILE, new ParameterListener() {\n public void parameterChanged(String parameterName) {\n FileLogging.this.reloadLogToFileParam();\n }\n });\n }", "private void loadOutputModules() {\n\t\tthis.outputModules = new ModuleLoader<IOutput>(\"/Output_Modules\", IOutput.class).loadClasses();\n\t}", "public static void init() {\n\t\tregisterRecipes();\n\t\tregisterShapelessRecipes();\n\t\tregisterSmeltingRecipes();\n\t}", "@Configuration\n public Option[] config() {\n String pathToTestClass = ServiceOneBundleTest.class.getClassLoader().getResource(\".\").getPath();\n String[] pathParts = pathToTestClass.split(\"OsgiBundleTest\");\n StringBuilder pathToBundle = new StringBuilder(pathParts[0]);\n pathToBundle.append(\"ServiceOneModule/target/ServiceOneModule-1.0-SNAPSHOT.jar\");\n return CoreOptions.options(\n mavenBundle(\"com.google.guava\", \"guava\", \"13.0.1\").startLevel(30),\n bundle(new File(pathToBundle.toString()).toURI().toString()),\n junitBundles()\n );\n }", "private void registerManagers() {\n registerProviders();\n\n // Cast Managers\n if (worldGuardManager.isEnabled()) castManagers.add(worldGuardManager);\n if (preciousStonesManager.isEnabled()) castManagers.add(preciousStonesManager);\n if (redProtectManager != null && redProtectManager.isFlagsEnabled()) castManagers.add(redProtectManager);\n\n // Entity Targeting Managers\n if (preciousStonesManager.isEnabled()) targetingProviders.add(preciousStonesManager);\n if (townyManager.isEnabled()) targetingProviders.add(townyManager);\n if (residenceManager != null) targetingProviders.add(residenceManager);\n if (redProtectManager != null) targetingProviders.add(redProtectManager);\n\n // PVP Managers\n if (worldGuardManager.isEnabled()) pvpManagers.add(worldGuardManager);\n if (pvpManager.isEnabled()) pvpManagers.add(pvpManager);\n if (multiverseManager.isEnabled()) pvpManagers.add(multiverseManager);\n if (preciousStonesManager.isEnabled()) pvpManagers.add(preciousStonesManager);\n if (townyManager.isEnabled()) pvpManagers.add(townyManager);\n if (griefPreventionManager.isEnabled()) pvpManagers.add(griefPreventionManager);\n if (factionsManager.isEnabled()) pvpManagers.add(factionsManager);\n if (residenceManager != null) pvpManagers.add(residenceManager);\n if (redProtectManager != null) pvpManagers.add(redProtectManager);\n\n // Build Managers\n if (worldGuardManager.isEnabled()) blockBuildManagers.add(worldGuardManager);\n if (factionsManager.isEnabled()) blockBuildManagers.add(factionsManager);\n if (locketteManager.isEnabled()) blockBuildManagers.add(locketteManager);\n if (preciousStonesManager.isEnabled()) blockBuildManagers.add(preciousStonesManager);\n if (townyManager.isEnabled()) blockBuildManagers.add(townyManager);\n if (griefPreventionManager.isEnabled()) blockBuildManagers.add(griefPreventionManager);\n if (mobArenaManager != null && mobArenaManager.isProtected()) blockBuildManagers.add(mobArenaManager);\n if (residenceManager != null) blockBuildManagers.add(residenceManager);\n if (redProtectManager != null) blockBuildManagers.add(redProtectManager);\n if (landsManager != null) blockBuildManagers.add(landsManager);\n\n // Break Managers\n if (worldGuardManager.isEnabled()) blockBreakManagers.add(worldGuardManager);\n if (factionsManager.isEnabled()) blockBreakManagers.add(factionsManager);\n if (locketteManager.isEnabled()) blockBreakManagers.add(locketteManager);\n if (preciousStonesManager.isEnabled()) blockBreakManagers.add(preciousStonesManager);\n if (townyManager.isEnabled()) blockBreakManagers.add(townyManager);\n if (griefPreventionManager.isEnabled()) blockBreakManagers.add(griefPreventionManager);\n if (mobArenaManager != null && mobArenaManager.isProtected()) blockBreakManagers.add(mobArenaManager);\n if (citadelManager != null) blockBreakManagers.add(citadelManager);\n if (residenceManager != null) blockBreakManagers.add(residenceManager);\n if (redProtectManager != null) blockBreakManagers.add(redProtectManager);\n if (landsManager != null) blockBreakManagers.add(landsManager);\n\n // Team providers\n if (heroesManager != null && heroesManager.useParties()) teamProviders.add(heroesManager);\n if (skillAPIManager != null && skillAPIManager.usesAllies()) teamProviders.add(skillAPIManager);\n if (useScoreboardTeams) teamProviders.add(new ScoreboardTeamProvider());\n if (permissionTeams != null && !permissionTeams.isEmpty()) {\n teamProviders.add(new PermissionsTeamProvider(permissionTeams));\n }\n if (factionsManager != null) teamProviders.add(factionsManager);\n if (battleArenaManager != null && useBattleArenaTeams) teamProviders.add(battleArenaManager);\n if (ultimateClansManager != null) teamProviders.add(ultimateClansManager);\n\n // Player warp providers\n if (preciousStonesManager != null && preciousStonesManager.isEnabled()) {\n playerWarpManagers.put(\"fields\", preciousStonesManager);\n }\n if (redProtectManager != null) playerWarpManagers.put(\"redprotect\", redProtectManager);\n if (residenceManager != null) playerWarpManagers.put(\"residence\", residenceManager);\n }", "public void loadTemplates()\n {\n for (PageTemplate template : templates.values())\n {\n template.load(pageDirectory);\n }\n }", "private void populateAvailableProviders() {\n allAvailableProviders = new HashSet<Provider>();\n\n DataType dataType = DataType.valueOfIgnoreCase(this.dataType);\n try {\n for (Provider provider : DataDeliveryHandlers.getProviderHandler()\n .getAll()) {\n\n ProviderType providerType = provider.getProviderType(dataType);\n if (providerType != null) {\n allAvailableProviders.add(provider);\n }\n }\n } catch (RegistryHandlerException e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Unable to retrieve the list of providers.\", e);\n }\n }" ]
[ "0.7052006", "0.70369846", "0.665047", "0.66090643", "0.6471978", "0.6301419", "0.62008303", "0.613506", "0.6064557", "0.6017721", "0.58908045", "0.5820764", "0.578887", "0.57455623", "0.5730993", "0.5716307", "0.57086813", "0.5695024", "0.56716365", "0.5668578", "0.565947", "0.5537673", "0.5517602", "0.55087984", "0.5463738", "0.5462815", "0.54491055", "0.5443735", "0.5405476", "0.5381039", "0.5364258", "0.53587353", "0.5341984", "0.53389734", "0.5336825", "0.53221434", "0.53199893", "0.530468", "0.5304253", "0.5287756", "0.52874696", "0.5284217", "0.5282946", "0.52717775", "0.52668154", "0.5266471", "0.5265236", "0.5262541", "0.52521884", "0.5242214", "0.5232755", "0.52194595", "0.5217123", "0.52070916", "0.51917505", "0.5166172", "0.51479256", "0.5137863", "0.513521", "0.5129819", "0.5129603", "0.5122859", "0.51137745", "0.5101515", "0.50899184", "0.50880563", "0.50821227", "0.50817776", "0.508064", "0.5078611", "0.5076183", "0.5070889", "0.50670505", "0.5063304", "0.50571394", "0.5052126", "0.5040909", "0.5030749", "0.5022396", "0.5004876", "0.4992715", "0.49884233", "0.49883193", "0.49865848", "0.49864528", "0.49777684", "0.497649", "0.49752596", "0.4968949", "0.49670756", "0.49635914", "0.49618673", "0.49571815", "0.4955043", "0.4946477", "0.49266803", "0.4924837", "0.49241385", "0.49211335", "0.4913682" ]
0.7161623
0
Scan a JAR for PlugIns and register them.
private void loadPluginsJar(String jarname){ URL[] urlList = new URL[1]; try{ URL jarUrl = new URL("file:"+jarname+".jar"); urlList[0] = jarUrl; }catch(MalformedURLException e){ Logger.getLogger(LOGGER_NAME).warning("Plugin '"+jarname+"' could not be loaded (invalid path)"); } URLClassLoader classLoader = new URLClassLoader(urlList); try{ JarFile jfile = new JarFile(jarname+".jar"); // walk through all files of the jar Enumeration<JarEntry> entries = jfile.entries(); while(entries.hasMoreElements()){ JarEntry entry = entries.nextElement(); if(entry.isDirectory() || !entry.getName().endsWith(".class")){ continue; // we only care for classes } String className = entry.getName().substring(0,entry.getName().length()-6).replace('/', '.'); Class<IKomorebiPlugin> pluginClass = null; try { Class<?> cl = classLoader.loadClass(className); if(!IKomorebiPlugin.class.isAssignableFrom(cl)){ continue; // only care about PlugIn classes } pluginClass = (Class<IKomorebiPlugin>) cl; } catch (ClassNotFoundException e) { Logger.getLogger(LOGGER_NAME).warning("Error while registering PlugIns of '"+jarname+"': "+ className+" could not be loaded"); continue; } tryRegisterPlugin(jarname, pluginClass); } jfile.close(); }catch(IOException e){ Logger.getLogger(LOGGER_NAME).warning("Plugin '"+jarname+"' could not be loaded (does not exist)"); }finally{ if(classLoader != null){ try { classLoader.close(); } catch (IOException e) { Logger.getLogger(LOGGER_NAME).warning("Potential resource leak: class loader could not be closed (reason: "+e.getMessage()+")"); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startPlugin() {\n classesDisponibles = new HashMap[types.length];\n try { // enregistrer le service d'acces aux depot de jars\n ServicesRegisterManager.registerService(Parameters.JAR_REPOSITORY_MANAGER, this);\n rescanRepository(); // creer les listes de classes disponibles a partir du depot\n }\n catch (ServiceInUseException mbiue) {\n System.err.println(\"Jar Repository Manager service created twice\");\n }\n }", "void bootPlugins() {\n\t\tList<List<String>>vals = (List<List<String>>)properties.get(\"PlugInConnectors\");\n\t\tif (vals != null && vals.size() > 0) {\n\t\t\tString name, path;\n\t\t\tIPluginConnector pc;\n\t\t\tList<String>cntr;\n\t\t\tIterator<List<String>>itr = vals.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tcntr = itr.next();\n\t\t\t\tname = cntr.get(0);\n\t\t\t\tpath = cntr.get(1);\n\t\t\t\ttry {\n\t\t\t\t\tpc = (IPluginConnector)Class.forName(path).newInstance();\n\t\t\t\t\tpc.init(this, name);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogError(e.getMessage(), e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void scanAndRegisterTypes() throws Exception {\n ScannedClassLoader scl = ScannedClassLoader.getSystemScannedClassLoader();\n // search annotations\n Iterator<Metadata> it = scl.getAll(MetadataType.class, Metadata.class); //CellFactorySPI.class);\n logger.log(Level.INFO, \"[Metadata Service] about to search classloader\");\n while (it.hasNext()) {\n Metadata metadata = it.next();\n logger.log(Level.INFO, \"[Metadata Service] using system scl, scanned type:\" + metadata.simpleName());\n registerMetadataType(metadata);\n }\n }", "private void loadPlugins(){\r\n\t\tKomorebiCoreConfig config = new KomorebiCoreConfig();\r\n\t\t\r\n\t\tif(config.getRootNode().getChildrenCount(\"plugins\") < 1){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tList<ConfigurationNode> pluginNodes = config.getRootNode().getChildren(\"plugins\").get(0).getChildren(\"plugin\");\r\n\t\tfor(int pos=0; pos<pluginNodes.size(); ++pos){\r\n\t\t\tString name = config.getString(\"plugins.plugin(\"+pos+\")[@name]\");\r\n\t\t\tString version = config.getString(\"plugins.plugin(\"+pos+\")[@version]\");\r\n\t\t\tif(version == null || name == null){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tloadPluginsJar(name+\"-\"+version); // check all classes in jar\r\n\t\t}\r\n\t}", "private void getPlugInsByJar(WebSocketConnector aConnector, Token aToken) {\n\t\tif (mService == null) {\n\t\t\tmService = new AdminPlugInService(NS_ADMIN, mNumberOfDays, getServer());\n\t\t}\n\n\t\tif (mLog.isDebugEnabled()) {\n\t\t\tmLog.debug(\"Processing 'getPlugInsByJar'...\");\n\t\t}\n\n\t\tgetServer().sendToken(aConnector, mService.getPlugInsByJar(aConnector, aToken));\n\t}", "private void init() {\n\t\tMvcs.scanPackagePath = analyseScanPath();\n\t\tif(StringHandler.isEmpty(Mvcs.scanPackagePath))\n\t\t\tthrow new RuntimeException(\"No scan path has been set! you need to setup ScanPackage annotation\");\n\t\t\n\t\t//put all class into the list\n\t\tList<String> allClassNames = scanAllClassNames();\n\t\tif(StringHandler.isEmpty(allClassNames)) //some loader may have no return value \n\t\t\treturn ;\n\t\t\n\t\tfor(String pkgPath : allClassNames){\n\t\t\tlist.add(ClassUtil.getClass(pkgPath));\n\t\t}\n\t}", "public void register() {\n\t\tloadCommandsFromPackage(\"net.frozenorb.Raven.CommandSystem.Commands\");\n\t}", "public void loadPluginsStartup();", "private static void initPlugins() {\n \tJSPFProperties props = new JSPFProperties();\n PluginManager pm = PluginManagerFactory.createPluginManager(props);\n pm.addPluginsFrom(new File(\"plugins/\").toURI());\n JavaBot.plugins = new PluginManagerUtil(pm).getPlugins(javaBotPlugin.class);\n }", "public static void scanPackage(String scanProviderPackage) throws Exception {\n\t\tproviders = AnnotationUtil.getAnnotations(scanProviderPackage, Controller.class, ServiceRegister.class);\n\t}", "public interface Registries {\n\n /***/\n ElementHandlerRegistry getElementHandlerRegistry();\n\n /***/\n AnnotationRegistry getAnnotationHandlerRegistry();\n\n /***/\n PainterRegistry getPaintRegistry();\n\n /**\n * Bundles up extension of each registry.\n */\n Registries createExtension();\n}", "public void loadPlugins()\n throws Exception\n {\n SecurityClassLoader securityClassLoader = new SecurityClassLoader(Plugin.class.getClassLoader(),\n ImmutableList.of(\"ideal.sylph.\", \"com.github.harbby.gadtry.\")); //raed only sylph-api deps\n this.loader = ModuleLoader.<Plugin>newScanner()\n .setPlugin(Plugin.class)\n .setScanDir(pluginDir)\n .setLoader(OperatorManager::serviceLoad)\n .setClassLoaderFactory(urls -> new VolatileClassLoader(urls, securityClassLoader)\n {\n @Override\n protected void finalize()\n throws Throwable\n {\n super.finalize();\n logger.warn(\"Jvm gc free ClassLoader: {}\", Arrays.toString(urls));\n }\n })\n .setLoadHandler(module -> {\n logger.info(\"loading module {} find {} Operator\", module.getName(), module.getPlugins().size());\n ModuleInfo moduleInfo = new ModuleInfo(module, new ArrayList<>());\n analyzeModulePlugins(moduleInfo);\n ModuleInfo old = userExtPlugins.put(module.getName(), moduleInfo);\n if (old != null) {\n Try.of(old::close).onFailure(e -> logger.warn(\"free old module failed\", e)).doTry();\n }\n }).load();\n }", "private void loadJarsFromManifestFile( ClassLoader classLoader ) throws IOException {\n\n Enumeration<URL> manifestUrls = ((URLClassLoader) classLoader).findResources(\"META-INF/MANIFEST.MF\");\n Manifest manifest = null;\n URL manifestElement = null;\n\n if (manifestUrls != null) {\n while (manifestUrls.hasMoreElements()) {\n manifestElement = manifestUrls.nextElement();\n try (InputStream is = manifestElement.openStream()) {\n manifest = new Manifest(is);\n\n // get the 'Class-Path' value from the MANIFEST.MF file\n String manifestClassPathValue = manifest.getMainAttributes().getValue(\"Class-Path\");\n if (manifestClassPathValue != null) {\n log.trace(\"Parsing MANIFEST file \\\"\" + manifestElement.getPath());\n String[] arr = manifestClassPathValue.split(\" \");\n for (int i = 0; i < arr.length; i++) {\n // add listed jars from MANIFEST file to the map\n String jarSimpleName = getJarSimpleName(arr[i]);\n String manifestFile = manifestElement.getFile();\n manifestFile = manifestFile.replace(\"\\\\\", \"/\");\n\n if (manifestFile.startsWith(\"file:/\")) {\n manifestFile = manifestFile.substring(\"file:/\".length());\n }\n\n manifestFile = manifestFile.substring(0,\n manifestFile.indexOf(\"!/META-INF/MANIFEST.MF\"));\n manifestFile = manifestFile.substring(0, manifestFile.lastIndexOf('/'));\n\n if (!StringUtils.isNullOrEmpty(jarSimpleName)) {\n String jarAbsolutePath = \"\";\n if (arr[i].startsWith(\"file\")) {\n jarAbsolutePath = arr[i].substring(6, arr[i].length());\n } else {\n jarAbsolutePath = manifestFile + \"/\" + arr[i];\n }\n if (new File(jarAbsolutePath).exists()) {\n addJarToMap(jarAbsolutePath);\n } else {\n log.trace(\"File \\\"\" + jarAbsolutePath\n + \"\\\" is defined in /META-INF/MANIFEST.MF \\\"\"\n + manifestElement.getPath() + \"\\\", but does not exist!\");\n }\n }\n }\n }\n } catch (IOException ioe) {\n log.error(\"Unable to read the MANIFEST.MF file\", ioe);\n }\n }\n }\n }", "synchronized private void tryRegisterPlugin(String name, Class<IKomorebiPlugin> pluginClass){\r\n\t\t\r\n\t\t// check status\r\n\t\tKomorebiPluginStatus pStatus = pluginClass.getAnnotation(KomorebiPluginStatus.class);\r\n\t\tif(pStatus != null){\r\n\t\t\tif(pStatus.disabled()){\r\n\t\t\t\tLogger.getLogger(LOGGER_NAME).info(\"Plugin '\"+pluginClass.getName()+\"' is disabled.\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// check if configuration consumer is correctly implemented\r\n\t\ttry{\r\n\t\t\tConstructor<IKomorebiPlugin> c = pluginClass.getConstructor();\r\n\t\t\tIKomorebiPlugin pi = c.newInstance();\r\n\t\t\tif(pi.isConfigConsumer() && !IKomorebiConfigurationConsumer.class.isAssignableFrom(pluginClass)){\r\n\t\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' does not adhere to defined standards (configuration consumer) and will be omitted.\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}catch(NoSuchMethodException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' does not adhere to defined standards (default constructor) and will be omitted.\");\r\n\t\t\treturn;\r\n\t\t}catch(InvocationTargetException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' caused an error (\"+e.getMessage()+\") and will be omitted.\");\r\n\t\t\treturn;\r\n\t\t}catch(IllegalAccessException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' caused an error (\"+e.getMessage()+\") and will be omitted.\");\r\n\t\t\treturn;\r\n\t\t}catch(InstantiationException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' caused an error (\"+e.getMessage()+\") and will be omitted.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(IKomorebiStorage.class.isAssignableFrom(pluginClass)){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).info(\"Registered storage PlugIn '\"+pluginClass.getName()+\"'\");\r\n\t\t\tif(!pluginRegister.containsKey(PluginType.STORAGE)){\r\n\t\t\t\t// if submap does not already exist it has to be created\r\n\t\t\t\tpluginRegister.put(PluginType.STORAGE, new HashMap<String, Class<IKomorebiPlugin>>());\r\n\t\t\t}\r\n\t\t\tpluginRegister.get(PluginType.STORAGE).put(name, pluginClass);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn;\r\n\t}", "private void scanClass(String scanPackage) {\n URL url = this.getClass().getClassLoader().getResource(\"/\" + scanPackage.replaceAll(\"\\\\.\", \"/\"));\n File dir = new File(url.getFile());\n for (File file : dir.listFiles()) {\n if (file.isDirectory()) {\n scanClass(scanPackage + \".\" + file.getName());\n } else {\n classNames.add(scanPackage + \".\" + file.getName().replaceAll(\".class\", \"\").trim());\n }\n }\n\n }", "public static void loadAnalyzerContributions() {\n\t\tIExtensionRegistry registry = Platform.getExtensionRegistry();\n\t\tIConfigurationElement[] config = registry.getConfigurationElementsFor(Activator.PLUGIN_ANALYZER_EXTENSION_ID);\n\t\ttry {\n\t\t\tfor (IConfigurationElement element : config) {\n\t\t\t\tfinal Object o = element.createExecutableExtension(\"class\");\n\t\t\t\tif (o instanceof Analyzer) {\n\t\t\t\t\tAnalyzer analyzer = (Analyzer) o;\n\t\t\t\t\tregisterAnalyzer(analyzer);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (CoreException e) {\n\t\t\tLog.error(\"Error loading analyzers.\", e);\n\t\t}\n\t}", "private void loadJarsFromClasspath() {\n\n loadedJarsMap.clear();\n\n ClassLoader classLoader = getClass().getClassLoader();\n URL[] urls = null;\n do {\n //check if the class loader is instance of URL and cast it\n if (classLoader instanceof URLClassLoader) {\n urls = ((URLClassLoader) classLoader).getURLs();\n } else {\n // if the ClassLoader is not instance of URLClassLoader we will break the cycle and log a message\n log.info(\"ClassLoader \" + classLoader\n + \" is not instance of URLClassLoader, so it will skip it.\");\n\n // if the ClassLoader is from JBoss, it is instance of BaseClassLoader,\n // we can take the ClassPath from a public method -> listResourceCache(), from JBoss-classloader.jar\n // this ClassLoader is empty, we will get the parent\n classLoader = classLoader.getParent();\n continue;\n }\n try {\n loadJarsFromManifestFile(classLoader);\n } catch (IOException ioe) {\n log.warn(\"MANIFEST.MF is loaded, so we will not search for duplicated jars!\");\n }\n\n // add all jars from ClassPath to the map\n for (int i = 0; i < urls.length; i++) {\n addJarToMap(urls[i].getFile());\n }\n\n // get the parent classLoader\n classLoader = classLoader.getParent();\n } while (classLoader != null);\n\n if (loadedJarsMap.isEmpty()) {\n // jars are not found, so probably no URL ClassLoaders are found\n throw new RuntimeException(\"Most probrably specific server is used without URLClassLoader instances!\");\n }\n }", "public List<Clazz> loadAndScanJar()\n\t\t\tthrows ClassNotFoundException, ZipException, IOException {\n\t\tsuper.addURL(new File(path).toURI().toURL());\n\t\tList<Clazz> representations=new ArrayList<Clazz>();\n\n\t\t// Count the classes loaded\n\t\t// Your jar file\n\t\tFile f = new File(path);\n\n\t\tJarFile jar = new JarFile(path);\n\t\t// Getting the files into the jar\n\t\tEnumeration<? extends JarEntry> enumeration = jar.entries();\n\n\t\t// Iterates into the files in the jar file\n\t\twhile (enumeration.hasMoreElements()) {\n\t\t\tZipEntry zipEntry = enumeration.nextElement();\n\t\t\t// Is this a class?\n\t\t\tif (zipEntry.getName().endsWith(\".class\")) {\n\t\t\t\t// Relative path of file into the jar.\n\t\t\t\tString className = zipEntry.getName();\n\t\t\t\t// Complete class name\n\t\t\t\tclassName = className.replace(\".class\", \"\").replace(\"/\", \".\");\n\t\t\t\t// Load class definition from JVM\n\t\t\t\tClass<?> clazz = this.loadClass(className);\n\t\t\t\ttry {\n\t\t\t\t\t\tClazz actual = new Clazz(clazz.getName());\n\t\t\t\t\t\tfor (java.lang.reflect.Method m : clazz.getMethods()) {\n\t\t\t\t\t\t\tactual.addMethod(m.getReturnType().getName(), m.getName(), getScope(m.getModifiers()),\n\t\t\t\t\t\t\t\t\tModifier.isAbstract(m.getModifiers()), Modifier.isStatic(m.getModifiers()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (java.lang.reflect.Field m : clazz.getFields()) {\n\t\t\t\t\t\t\tactual.addVariable(m.getType().getName(), m.getName(), getScope(m.getModifiers()),\n\t\t\t\t\t\t\t\t\tModifier.isStatic(m.getModifiers()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepresentations.add(actual);\n\n\t\t\t\t} catch (ClassCastException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tjar.close();\n\t\treturn representations;\n\t}", "void addClassLoader(ClassLoader cl);", "@Nonnull\n public List<Class<? extends PluginInterface>> loadPlugins(@Nonnull String pluginDirName) {\n\n List<Class<? extends PluginInterface>> plugins=new ArrayList<>();\n\n //Директория для просмотра файлов\n File pluginDirectory=new File(pluginDirName);\n File[] files=pluginDirectory.listFiles((dir, name) -> name.endsWith(PLUGIN_EXT));\n\n //Загрузка плагинов\n if(files!=null && files.length>0) {\n getPluginsClasses(files).forEach(className->{\n try {\n //Получим свой загрузчик файлов и загрузим с помощью него плагины\n Class cls=getClassLoaderByFilesURL(files)\n .loadClass(className\n .replaceAll(\"/\",\".\")\n .replace(\".class\",\"\"));\n\n //Если класс расширяет PluginInterface, то добавим этот класс в массив\n Class[] interfaces=cls.getInterfaces();\n for(Class intface:interfaces) {\n if(intface.equals(PluginInterface.class)) {\n plugins.add(cls);\n }\n }\n }\n catch (Exception e){\n e.printStackTrace();\n }\n });\n }\n\n return plugins;\n }", "public void addFromJAR() {\n btAddFromJAR().push();\n }", "private static void registerFromPackage(String packageName, String packageURL, FileFilter fileFilter) {\n File dir = new File(packageURL);\n if (!dir.exists() || !dir.isDirectory()) return;\n File[] dirFiles = dir.listFiles(fileFilter);\n for (File file : dirFiles)\n if (file.isDirectory()) {\n registerFromPackage(packageName + \".\" + file.getName(), file.getAbsolutePath(), fileFilter);\n } else {\n String className = file.getName().substring(0, file.getName().indexOf(\".\"));\n try {\n Class<?> aClass = Class.forName(packageName + \".\" + className);\n Annotation[] annotations = aClass.getAnnotations();\n //TODO 并不一定是按照顺序的,而且未来有可能不只是2个注解\n\n // 扫描注册 controller requestMapping\n if (annotations.length > 1 && annotations[0].annotationType().equals(Controller.class) && annotations[1].annotationType().equals(RequestMapping.class)) {\n String preUrl = aClass.getAnnotation(RequestMapping.class).value();\n Method[] methods = aClass.getMethods();\n for (Method method : methods) {\n Annotation requestMapping = method.getAnnotation(RequestMapping.class);\n if (requestMapping != null) {\n String pixUrl = ((RequestMapping) requestMapping).value();\n register(preUrl + pixUrl, new Service(aClass.asSubclass(ServiceInterface.class).getConstructor().newInstance(), method));\n System.out.println(((RequestMapping) requestMapping).value());\n }\n }\n\n }\n\n //放弃以下早期的扫描服务代码\n // 实现了注解,并且实现了接口\n// if (annotation != null && ServiceInterface.class.isAssignableFrom(aClass)) {\n//\n//// register(annotation.urlPattern(),aClass.asSubclass(ServiceInterface.class).getDeclaredConstructor().newInstance());\n//// System.out.println(\"成功注册服务: \" + annotation.urlPattern() + \" \" + className);\n// }\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n }", "public void loadAllPlugins(final String extPointId);", "void publishPlugin(byte[] jarFile);", "private void loadPlugin(File file) {\n JarFile jarFile;\n\n try {\n jarFile = new JarFile(file);\n } catch (IOException e) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_JARFILE_CREATE, e);\n return;\n }\n\n JarEntry pJson = jarFile.getJarEntry(\"plugin.json\");\n\n if (pJson == null)\n return;\n\n try {\n BufferedReader reader = new BufferedReader(new InputStreamReader(jarFile.getInputStream(pJson)));\n PluginInfo info = new GsonBuilder().setPrettyPrinting().create().fromJson(reader, PluginInfo.class);\n\n if (info != null) {\n ClassLoader classLoader = new URLClassLoader(new URL[] { file.toURI().toURL() }, this.getClass().getClassLoader());\n\n Plugin plugin;\n\n try {\n plugin = (Plugin) classLoader.loadClass(info.getMain()).newInstance();\n plugin.setInfo(info);\n plugins.add(plugin);\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_INSTANTIATION, e);\n return;\n }\n\n Enumeration<JarEntry> entries = jarFile.entries();\n while (entries.hasMoreElements()) {\n JarEntry e = entries.nextElement();\n String name = e.getName();\n\n if (name.endsWith(\".class\")) {\n try {\n Class clazz = Class.forName(name.substring(0, name.length() - 6).replace('/', '.'), true, classLoader);\n\n if (clazz != null && clazz.getSuperclass().equals(Module.class)) {\n try {\n plugin.loadModule((Module) clazz.newInstance());\n } catch (InstantiationException | IllegalAccessException exception) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_CANT_CREATE_MODULE, exception);\n }\n }\n } catch (ClassNotFoundException exception) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_CANT_LOAD_CLASS, name);\n }\n }\n }\n }\n } catch (IOException e) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_CANT_CREATE_INPUTSTREAM, file.getAbsolutePath());\n }\n }", "private void registerAll(final Path start) throws IOException {\n\t\t// register directory and sub-directories\n\t\tFiles.walkFileTree(start, new SimpleFileVisitor<Path>() {\n\t\t\t@Override\n\t\t\tpublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n\t\t\t\tregister(dir);\n\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t}\n\t\t});\n\t}", "public void scanClasspath() {\n List<String> classNames = new ArrayList<>(Collections.list(dexFile.entries()));\n\n ClassLoader classLoader = org.upacreekrobotics.dashboard.ClasspathScanner.class.getClassLoader();\n\n for (String className : classNames) {\n if (filter.shouldProcessClass(className)) {\n try {\n Class klass = Class.forName(className, false, classLoader);\n\n filter.processClass(klass);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (NoClassDefFoundError e) {\n e.printStackTrace();\n }\n }\n }\n }", "public void addScanner(final PluginScanner scanner) {\n getScanners().add(scanner);\n }", "public void registerPlugin(QuartzPlugin quartzPlugin) {\n this.quartzPlugin = quartzPlugin;\n for (Pair<String, Class<? extends Job>> pair : jobList) {\n String cronExp = pair.getKey();\n Class jobClass = pair.getValue();\n try {\n this.quartzPlugin.add(cronExp, jobClass);\n logger.info(\"registered job: \" + jobClass.getName());\n } catch (Exception ex) {\n logger.error(ex.getMessage());\n }\n\n }\n }", "ClasspathFinder(final ScanSpec scanSpec, final NestedJarHandler nestedJarHandler, final LogNode log) {\n // Get all classloaders, in classpath resolution order\n final AdditionOrderedSet<ClassLoader> allClassLoaders = new AdditionOrderedSet<>();\n for (final ClassLoader classLoader : scanSpec.classLoaders) {\n final ArrayList<ClassLoader> parentClassLoaders = new ArrayList<>();\n for (ClassLoader cl = classLoader; cl != null; cl = cl.getParent()) {\n parentClassLoaders.add(cl);\n }\n // OpenJDK calls classloaders in a top-down order\n for (int i = parentClassLoaders.size() - 1; i >= 0; --i) {\n allClassLoaders.add(parentClassLoaders.get(i));\n }\n }\n final List<ClassLoader> classLoaderOrder = allClassLoaders.getList();\n\n this.nestedJarHandler = nestedJarHandler;\n if (scanSpec.overrideClasspath != null) {\n // Manual classpath override\n if (scanSpec.overrideClassLoaders) {\n if (log != null) {\n log.log(\"It is not possible to override both the classpath and the ClassLoaders -- \"\n + \"ignoring the ClassLoader override\");\n }\n }\n final LogNode overrideLog = log == null ? null : log.log(\"Overriding classpath\");\n addClasspathElements(scanSpec.overrideClasspath, classLoaderOrder, overrideLog);\n if (overrideLog != null) {\n log.log(\"WARNING: when the classpath is overridden, there is no guarantee that the classes \"\n + \"found by classpath scanning will be the same as the classes loaded by the context \"\n + \"classloader\");\n }\n } else {\n // If system jars are not blacklisted, need to manually add rt.jar at the beginning of the classpath,\n // because it is included implicitly by the JVM.\n if (!scanSpec.blacklistSystemJars()) {\n // There should only be zero or one of these.\n final String rtJarPath = JarUtils.getRtJarPath();\n if (rtJarPath != null) {\n // Insert rt.jar as the first entry in the classpath.\n addClasspathElement(rtJarPath, classLoaderOrder, log);\n }\n }\n // Get all manually-added ClassLoaderHandlers\n final List<ClassLoaderHandler> classLoaderHandlers = new ArrayList<>();\n for (final Class<? extends ClassLoaderHandler> classLoaderHandler : scanSpec.extraClassLoaderHandlers) {\n try {\n classLoaderHandlers.add(classLoaderHandler.newInstance());\n } catch (InstantiationException | IllegalAccessException e) {\n if (log != null) {\n log.log(\"Could not instantiate \" + classLoaderHandler.getName(), e);\n }\n }\n }\n // Add all default ClassLoaderHandlers after manually-added ClassLoaderHandlers\n for (final Class<? extends ClassLoaderHandler> classLoaderHandlerClass : //\n ClassLoaderHandlerRegistry.DEFAULT_CLASS_LOADER_HANDLERS) {\n try {\n classLoaderHandlers.add(classLoaderHandlerClass.newInstance());\n } catch (InstantiationException | IllegalAccessException e) {\n if (log != null) {\n log.log(\"Could not instantiate \" + classLoaderHandlerClass.getName(), e);\n }\n }\n }\n if (log != null) {\n final LogNode classLoaderHandlerLog = log.log(\"ClassLoaderHandlers loaded:\");\n for (final ClassLoaderHandler classLoaderHandler : classLoaderHandlers) {\n classLoaderHandlerLog.log(classLoaderHandler.getClass().getName());\n }\n }\n\n // Try finding a handler for each of the classloaders discovered above\n for (final ClassLoader classLoader : classLoaderOrder) {\n // Skip system classloaders for efficiency if system jars are not going to be scanned.\n // TODO: Update to include JDK9 system classloader names.\n if (!scanSpec.blacklistSystemJars()\n || !classLoader.getClass().getName().startsWith(\"sun.misc.Launcher$ExtClassLoader\")) {\n final LogNode classLoaderLog = log == null ? null\n : log.log(\"Finding classpath elements in ClassLoader \" + classLoader);\n // Iterate through registered ClassLoaderHandlers\n boolean classloaderFound = false;\n for (final ClassLoaderHandler handler : classLoaderHandlers) {\n try {\n if (handler.handle(classLoader, this, classLoaderLog)) {\n classloaderFound = true;\n break;\n }\n } catch (final Exception e) {\n if (classLoaderLog != null) {\n classLoaderLog.log(\"Exception in ClassLoaderHandler\", e);\n }\n }\n }\n if (!classloaderFound) {\n if (classLoaderLog != null) {\n classLoaderLog.log(\"Unknown ClassLoader type, cannot scan classes\");\n }\n }\n }\n }\n\n if (!scanSpec.overrideClassLoaders) {\n // Add entries found in java.class.path, in case those entries were missed above due to some\n // non-standard classloader that uses this property\n final LogNode sysPropLog = log == null ? null\n : log.log(\"Getting classpath entries from java.class.path\");\n addClasspathElements(System.getProperty(\"java.class.path\"), classLoaderOrder, sysPropLog);\n }\n }\n }", "private void scanRepository(String type, HashMap<String, String> liste) {\n String chemin = new String(Parameters.COMPONENTS_REPOSITORY+\"/\"+type);\n//System.out.println(\"explore : \"+chemin);\n File depot = new File(chemin);\n File[] fichiers = depot.listFiles(); // liste des fichiers contenus dans ce repertoire\n for (int i = 0; i<fichiers.length; i++) { // explorer ces fichiers\n if (fichiers[i].isFile()) { // c'est un fichier\n if (fichiers[i].getName().endsWith(\".jar\")) { // c'est un fichier .jar\n try {\n JarFile accesJar = new JarFile(fichiers[i]);\n Manifest manifest = accesJar.getManifest(); // recuperer le manifest de ce fichier\n // Recuperer le nom de la classe du composant metier (dans ce manifest)\n String classeCM = manifest.getMainAttributes().getValue(KalimuchoClassLoader.BC_CLASS);\n liste.put(classeCM, fichiers[i].getName());\n//System.out.println(\"ajoute : (\"+classeCM+\" , \"+fichiers[i].getName()+\")\");\n }\n catch (IOException ioe) {\n System.err.println(\"Can't access to jar file \"+fichiers[i].getName()+\" in \"+chemin);\n }\n }\n }\n }\n }", "private void addJarClasses(final Path location) {\n try (final JarFile jarFile = new JarFile(location.toFile())) {\n final Enumeration<JarEntry> entries = jarFile.entries();\n while (entries.hasMoreElements()) {\n final String entryName = entries.nextElement().getName();\n if (entryName.endsWith(\".class\"))\n classes.add(convertToQualifiedName(entryName));\n }\n } catch (IOException e) {\n throw new IllegalArgumentException(\"Could not read jar-file '\" + location + \"', reason: \" + e.getMessage());\n }\n }", "public interface IPluginManager {\n\tpublic BasePluginPackage initPlugin(String pluginPath);\n\n\tpublic BasePluginPackage getPluginPackage(String packageName);\n\n\tpublic Class loadPluginClass(BasePluginPackage basePluginPackage, String className);\n}", "public static Set<InstalledPlugin> collectPlugins(ClassLoaderLifeCycle classLoaderLifeCycle,\n Path directory)\n throws IOException\n {\n PluginProcessor processor = new PluginProcessor(classLoaderLifeCycle, directory);\n\n return processor.collectPlugins(classLoaderLifeCycle.getBootstrapClassLoader());\n }", "public void addClasspathPatternToScan(String classpathPatternToScan) {\n\t\tclasspathPatternsToScan.add(classpathPatternToScan);\n\t}", "public void addJARFolder() {\n btAddJARFolder().push();\n }", "private boolean registerBundleInternal(\n\t\t\tfinal Bundle bundle) throws Exception {\n\t\tfinal Iterator pathIter = PathEntry.getContentPaths(bundle);\n\t\tif (pathIter == null) {\n\t\t\tservices.debug(\"Bundle \"+bundle.getSymbolicName()+\" has no initial configuration\");\n\t\t\treturn true;\n\t\t}\n\n\t\twhile (pathIter.hasNext()) {\n\t\t\tPathEntry path = (PathEntry)pathIter.next();\n\t\t\tEnumeration entries = bundle.getEntryPaths(path.getPath());\n\n\t\t\tif (entries != null) {\n\t\t\t\twhile (entries.hasMoreElements()) {\n\t\t\t\t\tURL url = bundle.getEntry((String)entries.nextElement());\n\t\t\t\t\tif (canHandle(url)) {\n\t\t\t\t\t\tinstall(url);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "private void locateDefaultPlugins() {\n \t\tHashMap runtimeImport = getRuntimeImport();\n \n \t\t// locate runtime plugin matching the import from boot\n \t\tURL runtimePluginPath = getPluginPath(runtimeImport);\n \t\tif (runtimePluginPath == null)\n \t\t\tthrow new RuntimeException(Policy.bind(\"error.runtime\")); //$NON-NLS-1$\n \n \t\t// get boot descriptor for runtime plugin\n \t\truntimeDescriptor = createPluginBootDescriptor(runtimePluginPath);\n \n \t\t// determine the xml plugin for the selected runtime\n \t\tHashMap xmlImport = getImport(runtimePluginPath, XML_PLUGIN_ID);\n \n \t\t// locate xml plugin matching the import from runtime plugin\n \t\tURL xmlPluginPath = getPluginPath(xmlImport);\n \t\tif (xmlPluginPath == null)\n \t\t\tthrow new RuntimeException(Policy.bind(\"error.xerces\")); //$NON-NLS-1$\n \n \t\t// get boot descriptor for xml plugin\n \t\txmlDescriptor = createPluginBootDescriptor(xmlPluginPath);\n \t}", "public void loadPlugins() {\n\n ServiceLoader<Pump> serviceLoader = ServiceLoader.load(Pump.class);\n for (Pump pump : serviceLoader) {\n availablePumps.put(pump.getPumpName(), pump);\n }\n\n Pump dummy = new DummyControl();\n availablePumps.put(dummy.getName(), dummy);\n\n Pump lego = new LegoControl();\n availablePumps.put(lego.getName(), lego);\n }", "public void addPlugin(String key, T pluginClass);", "@Override\n public void initialize() {\n for (final PluginInfo<AbstractVolumeManagerPlugin> info : getPlugins()) {\n String name = info.getName();\n if (name == null || name.isEmpty()) {\n name = info.getClassName();\n }\n // Add the plugin to the list of known animals.\n plugins.put(name, info);\n }\n }", "public void registerCachedFile(\n String factoryIdentifier, ClassLoader classLoader, String dirName) {\n Set<URL> urlSet =\n PluginUtil.getJarFileDirPath(\n factoryIdentifier, this.localPluginPath, this.remotePluginPath, dirName);\n try {\n Method add = URLClassLoader.class.getDeclaredMethod(\"addURL\", URL.class);\n add.setAccessible(true);\n List<String> urlList = new ArrayList<>(urlSet.size());\n for (URL jarUrl : urlSet) {\n add.invoke(classLoader, jarUrl);\n if (!this.classPathSet.contains(jarUrl)) {\n urlList.add(jarUrl.toString());\n this.classPathSet.add(jarUrl);\n String classFileName =\n String.format(\n CLASS_FILE_NAME_FMT.defaultValue(), this.classFileNameIndex);\n this.env.registerCachedFile(jarUrl.getPath(), classFileName, true);\n this.classFileNameIndex++;\n }\n }\n PluginUtil.setPipelineOptionsToEnvConfig(this.env, urlList, executionMode);\n } catch (Exception e) {\n log.warn(\"can't add jar in {} to cachedFile, e = {}\", urlSet, e.getMessage());\n }\n }", "static void register() {\n }", "private List<IUserLoginPlugin> getLoginPlugins()\n/* */ {\n/* 341 */ if (this.plugins == null)\n/* 342 */ this.plugins = PluginManager.newIns().getExtInstances(\"loginplugin\", IUserLoginPlugin.class);\n/* 343 */ return this.plugins;\n/* */ }", "public static void registerModules()\n {\n // Mystcraft is pushed in through the backdoor so it can't be disabled.\n moduleLoader.registerUncheckedModule(Mystcraft.class);\n\n // Register the remaining plugin classes normally\n moduleLoader.registerModule(AppEng.class);\n moduleLoader.registerModule(BuildcraftTransport.class);\n moduleLoader.registerModule(IC2.class);\n moduleLoader.registerModule(Thaumcraft.class);\n moduleLoader.registerModule(NotEnoughItems.class);\n moduleLoader.registerModule(Waila.class);\n moduleLoader.registerModule(ThermalExpansion.class);\n }", "public void activate(Bundle bundle) {\n if (! m_enabled && Extender.getIPOJOBundleContext().getBundle().getBundleId() == bundle.getBundleId()) {\n // Fast return if the configuration tracking is disabled, or if we are iPOJO\n return;\n }\n\n // It's not required to process bundle not importing the configuration package.\n final String imports = bundle.getHeaders().get(Constants.IMPORT_PACKAGE);\n if (imports == null || ! imports.contains(\"org.apache.felix.ipojo.configuration\")) {\n // TODO Check dynamic imports to verify if the package is not imported lazily.\n return;\n }\n\n BundleWiring wiring = bundle.adapt(BundleWiring.class);\n if (wiring == null) {\n // Invalid state.\n m_logger.log(Log.ERROR, \"The bundle \" + bundle.getBundleId() + \" (\" + bundle.getSymbolicName() + \") \" +\n \"cannot be adapted to BundleWiring, state: \" + bundle.getState());\n return;\n }\n\n // Only lookup for local classes, parent classes will be analyzed on demand.\n Collection<String> resources = wiring.listResources(\"/\", \"*.class\",\n BundleWiring.FINDENTRIES_RECURSE + BundleWiring.LISTRESOURCES_LOCAL);\n if (resources == null) {\n m_logger.log(Log.ERROR, \"The bundle \" + bundle.getBundleId() + \" (\" + bundle.getSymbolicName() + \") \" +\n \" does not have any classes to be analyzed\");\n return;\n }\n m_logger.log(Log.DEBUG, resources.size() + \" classes found\");\n handleResources(bundle, resources, wiring.getClassLoader());\n }", "void registerQuestionPlugin(QuestionPlugin plugin);", "public static void setup()\n\t{\n\t\tregisterEvent(calico.plugins.events.clients.ClientConnect.class);\n\t\tregisterEvent(calico.plugins.events.clients.ClientDisconnect.class);\n\n\t\tregisterEvent(calico.plugins.events.scraps.ScrapCreate.class);\n\t\tregisterEvent(calico.plugins.events.scraps.ScrapDelete.class);\n\t\tregisterEvent(calico.plugins.events.scraps.ScrapReload.class);\n\t\t\n\t\t\n\t\t//System.out.println(\"LOAD PLUGINS: \"+COptions.server.plugins);\n\t\t\n\t\tlogger.debug(\"Loading plugins\");\n\t\t\n\t\ttry\n\t\t{\n\t\t\tPluginFinder pluginFinder = new PluginFinder();\n\t\t\tpluginFinder.search(\"plugins/\");\n\t\t\tList<Class<?>> pluginCollection = pluginFinder.getPluginCollection();\n\t\t\tfor (Class<?> plugin: pluginCollection)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Loading \" + plugin.getName());\n\t\t\t\tregisterPlugin(plugin);\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tString[] pluginsToLoad = COptions.server.plugins.split(\",\");\n\t\t\n//\t\tif(pluginsToLoad.length>0)\n//\t\t{\n//\t\t\tfor(int i=0;i<pluginsToLoad.length;i++)\n//\t\t\t{\n//\t\t\t\ttry\n//\t\t\t\t{\n//\t\t\t\t\tClass<?> pluginClass = Class.forName(pluginsToLoad[i].trim());\n//\t\t\t\t\tregisterPlugin(pluginClass);\n//\t\t\t\t}\n//\t\t\t\tcatch(Exception e)\n//\t\t\t\t{\n//\t\t\t\t\tlogger.error(\"Could not load plugin \"+pluginsToLoad[i].trim());\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t\t\n\t\n\t}", "protected void collectFrameworkJars(@Nonnull Collection<VirtualFile> jarFiles,\n @Nonnull FrameworkInstanceLibrarySourceFinder sourceFinder) {\n\n }", "Registries createExtension();", "public void register(){\n }", "private static URL[] findJARs() {\n\tFilenameFilter filter = new FilenameFilter() {\n\t\tpublic boolean accept(File dir, String name) {\n\t\t\tString lcname = name.toLowerCase();\n//System.out.println(lcname+\" => \"+(lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")));\n\t\t\treturn lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")/*no snapshots*/ && new File(dir, name).canRead();\n\t\t}\n\t};\n\n\t// look for JARs in same directory (or, during development, in c:/temp)\n//\tFile dir;\n\tString jar = URIs.decode/*in case space in path*/(Multivalent.class.getResource(\"Multivalent.class\").toString());\n//System.out.println(\"Bootstrap res = \"+jar);\n\tString top;\n\tif (jar.startsWith(\"jar:\")) { // deployment: e.g., \"jar:file:/C:/temp/Multivalent20011127.jar!/multivalent/Multivalent.class\"\n\t\tjar = jar.substring(\"jar:file:\".length(), jar.indexOf('!'));\n\t\ttop = jar.substring(0, jar.lastIndexOf('/')+1);\n\t//} else if (new File(\"/c:/temp\").exists()) { // my development => CLASSPATH\n\t//\ttop = \"/c:/temp\";\n\t\t// CLASSPATH is selfsame JAR -- ignore as ClassLoader gets anyhow\n\n\t} else { // others' development: e.g., \"file:/D:/prj/Multivalent/www/jar/multivalent/Multivalent.class\"\n\t\tint inx = jar.lastIndexOf('/'); // chop \"Multivalent.class\"\n\t\tinx = jar.lastIndexOf('/', inx-1); // chop \"multivalent\"\n\n\t\tjar = jar.substring(\"file:\".length(), inx+1);\n//System.out.println(\"jar = \"+jar);\n\t\ttop = jar;\n\t}\n\n\n\tList urls = new ArrayList(20);\n\n\tif (standalone_) System.out.println(\"Searching for JARs in \"+top);\n\ttry {\n\t\tFile[] f = new File(top).listFiles(filter);\n\t\tfor (int i=0,imax=f.length; i<imax; i++) {\n\t\t\turls.add(f[i].toURI().toURL());\n\t\t\tif (standalone_) System.out.println(\"\\t\"+f[i]);\n\t\t}\n\t} catch (MalformedURLException canthappen) { System.err.println(canthappen/*f[i]*/); System.err.println(\"Move to different directory\"); }\n\n\treturn (URL[])urls.toArray(new URL[0]);\n }", "public void registerEvents(Citizens plugin);", "public static void moduleClassScan(Consumer<? super Class> consumer, String packageName) {\n\n\n Set<Class<? extends Module>> allClasses = getModuleClasses(packageName);\n\n for (Class clazz : allClasses) {\n\n consumer.accept(clazz);\n }\n }", "public native void loadPlugin(final String plugin);", "public void registerCustomExtensions(HtmlTable table) throws ExtensionLoadingException {\n \n \t\tif (StringUtils.isNotBlank(table.getTableConfiguration().getBasePackage())) {\n \n \t\t\tlogger.debug(\"Scanning custom extensions...\");\n \n \t\t\t// Scanning custom extension based on the base.package property\n \t\t\tList<AbstractExtension> customExtensions = scanCustomExtensions(table.getTableConfiguration()\n \t\t\t\t\t.getBasePackage());\n \n \t\t\t// Load custom extension if enabled\n \t\t\tif (customExtensions != null && !customExtensions.isEmpty() && table.getTableConfiguration().getExtraCustomExtensions() != null) {\n \t\t\t\tfor (String extensionToRegister : table.getTableConfiguration().getExtraCustomExtensions()) {\n \t\t\t\t\tfor (AbstractExtension customExtension : customExtensions) {\n \t\t\t\t\t\tif (extensionToRegister.equals(customExtension.getName().toLowerCase())) {\n \t\t\t\t\t\t\ttable.getTableConfiguration().registerExtension(customExtension);\n \t\t\t\t\t\t\tlogger.debug(\"Extension {} (version: {}) registered\", customExtension.getName(),\n \t\t\t\t\t\t\t\t\tcustomExtension.getVersion());\n \t\t\t\t\t\t\tcontinue;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tlogger.warn(\"No custom extension found\");\n \t\t\t}\n \t\t}\n \t\telse{\n \t\t\tlogger.debug(\"The 'base.package' property is blank. Unable to scan any class.\");\n \t\t}\n \t}", "public void registerCoreExtensions() {\n if (extensionsRegistered) {\n throw H2O.fail(\"Extensions already registered\");\n }\n\n long before = System.currentTimeMillis();\n ServiceLoader<AbstractH2OExtension> extensionsLoader = ServiceLoader.load(AbstractH2OExtension.class);\n for (AbstractH2OExtension ext : extensionsLoader) {\n if (isEnabled(ext)) {\n ext.init();\n coreExtensions.put(ext.getExtensionName(), ext);\n }\n }\n extensionsRegistered = true;\n registerCoreExtensionsMillis = System.currentTimeMillis() - before;\n }", "public void installAllAddons(String installDir, String instanceRoot){\n \n String addonJar = \"\";\n //Properties registry = new Properties();\n Registry registry = null;\n FileInputStream in = null;\n FileOutputStream out = null;\n try {\n String addonDir = installDir + File.separator + AddonConstants.LIB + File.separator + AddonConstants.ADDONS;\n String domainConfigRoot = instanceRoot + File.separator + AddonConstants.CONFIG;\n //Logger.getAnonymousLogger().log(Level.FINE, \"domainConfigRoot===\"+domainConfigRoot);\n String domainRegistry = domainConfigRoot + File.separator + AddonConstants.DOMAIN_REGISTRY;\n File registryFile = new File(domainRegistry);\n registry = new Registry();\n registry.load(registryFile);\n File libAddonDirectory = new File(addonDir);\n File[] fileArray = libAddonDirectory.listFiles();\n \n for(int i = 0;i<fileArray.length;i++) {\n addonJar = fileArray[i].getName();\n String jarExtension = \"\";\n int dotLastIndex = addonJar.lastIndexOf(\".\");\n String jarNameWithoutExtension = addonJar;\n if(dotLastIndex != -1) {\n jarExtension = addonJar.substring(dotLastIndex + 1);\n jarNameWithoutExtension = addonJar.substring(0, dotLastIndex);\n }\n if(jarExtension.equalsIgnoreCase(\"jar\")) {\n //Logger.getAnonymousLogger().log(Level.INFO, \"fileArray[i].getName()=\"+fileArray[i].getName());\n //String key = domainName + \".\" + fileArray[i].getName() + \".\" + \"installed\";\n String key = jarNameWithoutExtension + \".\" + \"enabled\";\n String installed = registry.getProperty(key);\n if(installed != null && installed.equals(\"true\")) {\n Logger.getAnonymousLogger().log(Level.FINE, \"Addon \"+addonJar+\" is already installed\");\n continue;\n }\n Addon addon = new Addon(fileArray[i]);\n boolean install = addon.install(installDir,instanceRoot);\n if(install)\n registry.setProperty(key, \"true\");\n \n }\n }\n registry.store();\n \n }catch(Exception ex) {\n Logger.getAnonymousLogger().log(Level.WARNING, \"Error while installing the addon \"+addonJar, ex);\n }finally {\n try {\n if(registry != null)\n registry.close();\n }catch(Exception e) {\n \n }\n }\n \n }", "public void registerBundle(final Bundle bundle) throws Exception {\n\t\t// if this is an update, we have to uninstall the old content first\n\n\t\tservices.debug(\"Registering bundle \"+bundle.getSymbolicName()+\" for configuration loading.\");\n\n\n\t\tif (registerBundleInternal(bundle)) {\n\n\t\t\t// handle delayed bundles, might help now\n\t\t\tint currentSize = -1;\n\t\t\tfor (int i = delayedBundles.size(); i > 0\n\t\t\t\t\t&& currentSize != delayedBundles.size()\n\t\t\t\t\t&& !delayedBundles.isEmpty(); i--) {\n\n\t\t\t\tIterator di = delayedBundles.iterator();\n\t\t\t\twhile (di.hasNext()) {\n\t\t\t\t\tBundle delayed = (Bundle)di.next();\n\t\t\t\t\tif (registerBundleInternal(delayed)) {\n\t\t\t\t\t\tdi.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrentSize = delayedBundles.size();\n\t\t\t}\n\n\t\t} else {\n\t\t\t// add to delayed bundles - if this is not an update!\n\t\t\tdelayedBundles.add(bundle);\n\t\t}\n\t}", "public void registerPlugin(final DajlabExtension plugin) {\r\n\r\n\t\tif (plugin != null) {\r\n\t\t\tif (plugin instanceof DajlabControllerExtensionInterface) {\r\n\t\t\t\tcontrollers.add((DajlabControllerExtensionInterface<DajlabModelInterface>) plugin);\r\n\t\t\t}\r\n\t\t\tif (plugin instanceof TabExtensionInterface) {\r\n\t\t\t\ttabPlugins.add((TabExtensionInterface) plugin);\r\n\t\t\t}\r\n\t\t\tif (plugin instanceof MenuExtensionInterface) {\r\n\t\t\t\tmenuPlugins.add((MenuExtensionInterface) plugin);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void startPlugin() {\n\t\t// add a new ResourceChangeListener\n\t\tCheops.getInstance().addResourceChangeListener();\n\t}", "@Override\n public void register() {\n }", "public static void register() {\n // Registers the GUI Handler\n NetworkRegistry.instance().registerGuiHandler(Dendritis.instance, GUIHandler.instance());\n \n OreDictionaryRegistry.oreDictionary();\n BlockRegistry.registerBlocks();\n WorldRegistry.registerWorld();\n RecipeHandler.init();\n }", "private void registerIntentReceivers() {\n \n \t\tIntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);\n \t\tfilter.addAction(Intent.ACTION_PACKAGE_REMOVED);\n \t\tfilter.addAction(Intent.ACTION_PACKAGE_CHANGED);\n \t\tfilter.addDataScheme(\"package\");\n \t\tregisterReceiver(mApplicationsReceiver, filter);\n \t}", "private void process(final JarScannerCallback callback, final URL url) throws IOException {\n final URLConnection conn = url.openConnection();\n if (conn instanceof JarURLConnection) {\n\n callback.scan((JarURLConnection) conn);\n\n } else {\n\n final String urlStr = url.toString();\n\n if (urlStr.startsWith(\"file:\") || urlStr.startsWith(\"jndi:\")) {\n\n if (urlStr.endsWith(Constants.JAR_EXT)) {\n\n final URL jarURL = new URL(\"jar:\" + urlStr + \"!/\");\n callback.scan((JarURLConnection) jarURL.openConnection());\n\n } else {\n try {\n\n final File f = new File(url.toURI());\n\n if (f.isFile() && this.isScanAllFiles()) {\n\n // Treat this file as a JAR\n final URL jarURL = new URL(\"jar:\" + urlStr + \"!/\");\n callback.scan((JarURLConnection) jarURL.openConnection());\n\n } else if (f.isDirectory() && this.isScanAllDirectories()) {\n\n final File metainf = new File(f.getAbsoluteFile() + File.separator + \"META-INF\");\n\n if (metainf.isDirectory()) {\n callback.scan(f);\n }\n }\n } catch (URISyntaxException e) {\n // Wrap the exception and re-throw\n final IOException ioe = new IOException();\n ioe.initCause(e);\n throw ioe;\n }\n }\n }\n }\n }", "public static void registerWith(Registrar registrar) {\n final MicroblinkFlutterPlugin plugin = new MicroblinkFlutterPlugin();\n plugin.setupPlugin(registrar.activity(), registrar.messenger());\n registrar.addActivityResultListener(plugin);\n }", "@Override\r\n\tpublic void register() {\n\t\t\r\n\t}", "private void loadRegistratedResources() {\n \t\tFile kbPluginLocation = KbPlugin.getDefault().getLocation();\r\n \t\tif(kbPluginLocation!=null) {\r\n \t IExtensionRegistry registry = Platform.getExtensionRegistry();\r\n \t\t\tIExtensionPoint extensionPoint = registry.getExtensionPoint(\"org.jboss.tools.common.kb.tldResource\");\r\n \t\t\tIExtension[] extensions = extensionPoint.getExtensions();\r\n \t\t\tfor (int i=0; i<extensions.length; i++) {\r\n \t\t\t\tIExtension extension = extensions[i];\r\n \t\t\t\tIConfigurationElement[] elements = extension.getConfigurationElements();\r\n \t\t\t\tfor(int j=0; j<elements.length; j++) {\r\n \t\t\t\t\tString uri = elements[j].getAttribute(\"uri\");\r\n \t\t\t\t\tString location = elements[j].getAttribute(\"schema-location\");\r\n \t\t\t\t\tString version = elements[j].getAttribute(\"version\");\r\n \t\t\t\t\tString jsf = elements[j].getAttribute(\"jsf\");\r\n \t\t\t\t\tif(uri==null || uri.length()==0 || location==null || location.length()==0) {\r\n \t\t\t\t\t\tcontinue;\r\n \t\t\t\t\t}\r\n \t\t\t\t\tFile shemaLocation = new File(kbPluginLocation, location);\r\n \t\t\t\t\tif(shemaLocation.isFile()) {\r\n \t\t\t\t\t\tKbTldResource resource = new KbTldResource(uri, null, null, null);\r\n \t\t\t\t\t\tresource.setSchemaLocation(shemaLocation);\r\n \t\t\t\t\t\tif(version!=null && version.length()>0) {\r\n \t\t\t\t\t\t\tresource.setVersion(version);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tresource.setCustomTld(false);\r\n \t\t\t\t\t\tresource.setJsfResource(\"true\".equals(jsf));\r\n \t\t\t\t\t\tregistratedResources.put(resource, resource);\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tString message = \"Can't load KB schema: \" + shemaLocation;\r\n \t\t\t\t\t\tKbPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, KbPlugin.PLUGIN_ID, IStatus.WARNING, message, null));\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// Get custom schemas.\r\n \t\tFile schemaFolder = new File(schemaLocation); \r\n \t\tif(!schemaFolder.exists()) {\r\n \t\t\treturn;\r\n \t\t}\r\n \t\tFile[] schemas = schemaFolder.listFiles(new FileFilter(){\r\n \t\t\tpublic boolean accept(File file) {\r\n \t\t\t\tif(file.isFile()) {\r\n \t\t\t\t\treturn true;\r\n \t\t\t\t}\r\n \t\t\t\treturn false;\r\n \t\t\t}\r\n \t\t});\r\n \r\n \t\tfor(int i=0; i<schemas.length; i++) {\r\n \t\t\tDocument document = null;\r\n \t\t\ttry {\r\n \t\t\t\tdocument = KbDocumentBuilderFactory.createDocumentBuilder(false).parse(schemas[i]);\r\n \t\t\t} catch (Exception e) {\r\n \t\t\t\tKbPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, KbPlugin.PLUGIN_ID, IStatus.OK, \"Can't parse Schema (location: \" + schemas[i] + \")\", e));\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n //\t\t\tString tldLocation = schemas[i].getAbsolutePath();\r\n \t\t\tString tldLocation = document.getDocumentElement().getAttribute(SchemaNodeFactory.LOCATION_ATTRIBUTE);\r\n \t\t\tString tldUri = document.getDocumentElement().getAttribute(SchemaNodeFactory.URI_ATTRIBUTE);\r\n \t\t\tString tldVersion = document.getDocumentElement().getAttribute(SchemaNodeFactory.VERSION_ATTRIBUTE);\r\n \t\t\tString jsf = document.getDocumentElement().getAttribute(SchemaNodeFactory.JSF_ATTRIBUTE);\r\n \t\t\tString tldContent = null; \r\n \t\t\tNodeList children = document.getDocumentElement().getChildNodes();\r\n \t\t\tfor(int j=0; j<children.getLength(); j++) {\r\n \t\t\t\tNode node = children.item(j);\r\n \t\t\t\tif(node.getNodeName().equals(SchemaNodeFactory.TLD_CONTENT_NODE)) {\r\n \t\t\t\t\tNode child = node.getFirstChild();\r\n \t\t\t\t\tif(child instanceof CDATASection) {\r\n \t\t\t\t\t\ttldContent = ((CDATASection)child).getData();\r\n \t\t\t\t\t}\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tKbTldResource resource = new KbTldResource(tldUri, tldLocation, null, tldVersion);\r\n \t\t\tresource.setTldContent(tldContent);\r\n \t\t\tresource.setSchemaLocation(schemas[i]);\r\n \t\t\tresource.setCustomTld(true);\r\n \t\t\tresource.setJsfResource(\"true\".equals(jsf));\r\n \t\t\tregistratedResources.put(resource, resource);\r\n \t\t}\r\n \t}", "private void registerClassLoader(final ClassLoader classLoader) {\n try {\n for (final TraceInterceptor interceptor :\n ServiceLoader.load(TraceInterceptor.class, classLoader)) {\n addTraceInterceptor(interceptor);\n }\n } catch (final ServiceConfigurationError e) {\n log.warn(\"Problem loading TraceInterceptor for classLoader: \" + classLoader, e);\n }\n }", "public void setRegisterBlueprintsByPackage(String _package) throws RegisterBlueprintException {\n\n Set<Class<?>> annotated = null;\n try {\n annotated = new ClassesInPackageScanner().findAnnotatedClasses(_package, Blueprint.class);\n } catch (IOException e) {\n throw new RegisterBlueprintException(e);\n }\n\n logger.info(\"Scanned {} and found {}\", _package, annotated);\n\n this.setRegisterBlueprints(annotated);\n }", "public void onLoad() {\n // store jar path for plugin loader\n thisJar = this.getFile();\n }", "@Override\n\tpublic void addPlugin(ComponentPlugin plugin) throws Exception {\n\n\t}", "private void unregisterScanners() throws JMException {\n unregisterMBeans(scanmap);\n }", "private FilterChain loadFilters() {\n\t\ttry {\n\t\t\tAnnotation.scan(\"src/main/java/com/qa/app\");\n\t\t} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException\n\t\t\t\t| InvocationTargetException | NoSuchMethodException | SecurityException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "void implementJar(Class<?> token, Path jarFile) throws ImplerException;", "public Changes addBundle(Jnlp jnlp, Bundle bundle, Main main, boolean forceScanBundle, Changes bundleChanged, String pathToJars)\n \t{\n \t\tString name = getBundleProperty(bundle, Constants.BUNDLE_SYMBOLICNAME);\n \t\tString version = getBundleProperty(bundle, Constants.BUNDLE_VERSION);\n \t\tString activationPolicy = getBundleProperty(bundle, Constants.BUNDLE_ACTIVATIONPOLICY);\n \t\tDownload download = Constants.ACTIVATION_LAZY.equalsIgnoreCase(activationPolicy) ? Download.LAZY : Download.EAGER;\n \t\tString filename = name + '-' + version + \".jar\";\n \t\tString[] packages = moveBundleToJar(bundle, filename, forceScanBundle);\n \t\tif (packages == null) // No changes on this bundle\n \t return (bundleChanged == Changes.NONE || bundleChanged == Changes.UNKNOWN) ? Changes.NONE : Changes.PARTIAL;\n \t\tif (main == null)\n \t\t\tmain = Main.FALSE;\n \t\tif (pathToJars != null)\n \t\t filename = pathToJars + filename;\n \t\tJar jar = addJar(jnlp, filename, name, main, download);\n \t\tfor (String packageName : packages)\n \t\t{\n \t\t\taddPackage(jnlp, jar, packageName, Recursive.FALSE);\n \t\t}\n return (bundleChanged == Changes.ALL || bundleChanged == Changes.UNKNOWN) ? Changes.ALL : Changes.PARTIAL;\n \t}", "public void register() {\n\t\tPrettyEmailNotificator.templatePath = server.getServerRootPath()+ myPluginDescriptor.getPluginResourcesPath() + \"templates/\";\r\n\t\tPrettyEmailNotificator.attachmentPath = server.getServerRootPath()+ myPluginDescriptor.getPluginResourcesPath() + \"img/\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tinitVelocity();\r\n\t\t\tnotificatorRegistry.register(this);\r\n\t\t\tLoggers.SERVER.info(this.getClass().getSimpleName() + \" :: Registering\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tLoggers.SERVER.error(this.getClass().getSimpleName() + \" :: \" + PrettyEmailNotificator.TYPE + \" was NOT successfully registered. See DEBUG for Stacktrace\");\r\n\t\t\tLoggers.SERVER.debug(e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void addJarsToThisLocator(List<String> jarFullPaths, String[] groups) throws IOException {\n addJarsToThisLocator(getDeployedBy(), Instant.now().toString(), jarFullPaths, groups);\n }", "public AnnotationScanner() {\n File rootDir = this.getClassRootDirectory();\n\n if (rootDir != null) {\n this.allClass = getDirClassList(rootDir, null);\n } else {\n this.initJar();\n }\n }", "public void registerUIExtension(UIExtension extension)\n {\n synchronized (_scorersAndLafs)\n {\n if (!_extensions.contains(extension))\n {\n _extensions.add(extension);\n\n // Register the extension on all existing LookAndFeels\n int lafCount = _lafs.size();\n\n for (int i = 0; i < lafCount; i++)\n {\n LookAndFeel laf = _lafs.get(i);\n extension.registerSelf(laf);\n }\n }\n }\n }", "public interface IPluginLibrary {\n \n /*\n * Initializes the library\n */\n public void initialize(DefaultPluginsCollector collector);\n \n /*\n * Start the module and initialize components\n */\n public void startLibrary();\n \n /*\n * Fetches all extensions for the given extension point qualifiers.\n * \n * @param extPointId The extension point id to gather plugins for\n * \n * @return The gathered plugins in a LinkedList\n */\n public void loadAllPlugins(final String extPointId);\n \n /*\n * Fetches new extensions for the given extension point qualifiers.\n * \n * @param extPointId The extension point id to gather plugins for\n * \n * @return A human readable string\n */\n public String loadNewPlugin(final String extPointId); \n \n /**\n * Checks a plugin for validity.\n * \n * @param plugin The plugin to check\n * @param The level to test against, this method will return true if the result is greater or\n * equal than the testLevel\n * @return true or false\n */\n public boolean isValidPlugin(MartinPlugin plugin, MartinAPITestResult testLevel);\n\n /**\n * Answer a request by searching plugin-library for function and executing\n * them.\n * \n * @param req The {@link ExtendedQequest} to answer.\n * \n * @return The generated {@link MResponse}.\n */\n public MResponse executeRequest(ExtendedRequest req);\n\n \n public List<PluginInformation> getPluginInformation();\n \n /**\n * Returns a list of example calls read from the plugin database. Is usually\n * only called from the AI controller when the user first loads the MArtIn\n * frontend.\n * \n * @return a list of example calls\n */\n public List<MExampleCall> getExampleCalls();\n \n /**\n * Returns a list of 5 randomly choosen example calls read from the plugin database. Is usually\n * only called from the AI controller when the user first loads the MArtIn\n * frontend.\n * \n * @return a list of 5 randomly choosen example calls\n */\n public List<MExampleCall> getRandomExampleCalls();\n \n public Map<String, Pair<Boolean, MartinPlugin> > getPluginExtentions();\n}", "public void load(Maussentials plugin);", "public Set<Class<?>> getScanClasses();", "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 static void registerImageIOServices() {\n\t\tlogger.debug(\"Registering ImageIO readers / writers\");\n\t\tIIORegistry registry = IIORegistry.getDefaultInstance();\n\n\t\tfor (ImageReaderSpi spi : iioReaderList) {\n\t\t\tregisterImageIOService(registry, spi, javax.imageio.spi.ImageReaderSpi.class);\n\t\t}\n\n\t\tfor (ImageWriterSpi spi : iioWriterList) {\n\t\t\tregisterImageIOService(registry, spi, javax.imageio.spi.ImageWriterSpi.class);\n\t\t}\n\t}", "public void reInitialize() {\n lock.writeLock().lock();\n try {\n extensionPointPluginMap = HashBasedTable.create();\n final PluginRegistry registry = PluginRegistry.getInstance();\n List<IPlugin> extensionPointPlugins = registry.getPlugins(ExtensionPointPluginType.class);\n for (IPlugin extensionPointPlugin : extensionPointPlugins) {\n addExtensionPoint(extensionPointPlugin);\n }\n } finally {\n lock.writeLock().unlock();\n }\n }", "private void initPluginComponents()\n {\n // Make sure that we don't miss any event.\n GuiActivator.getUIService().addPluginComponentListener(this);\n\n pluginPanelEast.setLayout(\n new BoxLayout(pluginPanelEast, BoxLayout.Y_AXIS));\n pluginPanelSouth.setLayout(\n new BoxLayout(pluginPanelSouth, BoxLayout.Y_AXIS));\n pluginPanelWest.setLayout(\n new BoxLayout(pluginPanelWest, BoxLayout.Y_AXIS));\n\n this.getContentPane().add(pluginPanelEast, BorderLayout.EAST);\n this.getContentPane().add(pluginPanelWest, BorderLayout.WEST);\n this.mainPanel.add(pluginPanelSouth, BorderLayout.SOUTH);\n\n // Search for plugin components registered through the OSGI bundle\n // context.\n Collection<ServiceReference<PluginComponentFactory>> serRefs;\n String osgiFilter\n = \"(|(\" + Container.CONTAINER_ID + \"=\"\n + Container.CONTAINER_CHAT_WINDOW.getID() + \")(\"\n + Container.CONTAINER_ID + \"=\"\n + Container.CONTAINER_CHAT_STATUS_BAR.getID() + \"))\";\n\n try\n {\n serRefs\n = GuiActivator.bundleContext.getServiceReferences(\n PluginComponentFactory.class,\n osgiFilter);\n }\n catch (InvalidSyntaxException ex)\n {\n serRefs = null;\n logger.error(\"Could not obtain plugin component reference.\", ex);\n }\n\n if ((serRefs != null) && !serRefs.isEmpty())\n {\n for (ServiceReference<PluginComponentFactory> serRef : serRefs)\n {\n PluginComponentFactory factory\n = GuiActivator.bundleContext.getService(serRef);\n Component comp\n = (Component)\n factory\n .getPluginComponentInstance(ChatWindow.this)\n .getComponent();\n\n // If this component has been already added, we have nothing\n // more to do here.\n if (comp.getParent() != null)\n return;\n\n Object borderLayoutConstraints\n = UIServiceImpl.getBorderLayoutConstraintsFromContainer(\n factory.getConstraints());\n\n addPluginComponent(\n comp,\n factory.getContainer(),\n borderLayoutConstraints);\n }\n }\n }", "public void loadPluginFileBean(){\n\t\tthis.broadcastManager.registerBroadcastReceiver(new String[]{ACTION_PLUGIN_FILE_FINISHED}, this);\n\t\tfor(PluginFileBean pluginFileBean:this.pluginFileBeanList){\n\t\t\tif(pluginFileBean!=null){\n\t\t\t\tpluginFileBean.setBroadcastManager(this.broadcastManager);\n\t\t\t\tpluginFileBean.setJarClassLoader(this.jarClassLoader);\n\t\t\t\tif(pluginFileBean.getPluginDownloader()==null){\n\t\t\t\t\tpluginFileBean.setPluginDownloader(defaultPluginDownloader);\n\t\t\t\t}\n\t\t\t\tpluginFileBean.loadPluginBean();\n\t\t\t}\n\t\t}\n\t}", "InstallerRegistry() {\n this.lookup = Lookups.forPath(INSTALLER_REGISTRY_FOLDER);\n this.platformInstalls = null;\n }", "public String searchExportedPlugins()\n\t{\n\t\tFile parent = null;\n\t\tif (System.getProperty(\"eclipse.home.location\") != null)\n\t\t\tparent = new File(URI.create(System.getProperty(\"eclipse.home.location\").replaceAll(\" \", \"%20\")));\n\t\telse parent = new File(System.getProperty(\"user.dir\"));\n\n\t\tList<String> pluginLocations = exportModel.getPluginLocations();\n\t\tfor (String libName : NG_LIBS)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tboolean found = false;\n\t\t\twhile (!found && i < pluginLocations.size())\n\t\t\t{\n\t\t\t\tFile pluginLocation = new File(pluginLocations.get(i));\n\t\t\t\tif (!pluginLocation.isAbsolute())\n\t\t\t\t{\n\t\t\t\t\tpluginLocation = new File(parent, pluginLocations.get(i));\n\t\t\t\t}\n\t\t\t\tFileFilter filter = new WildcardFileFilter(libName);\n\t\t\t\tFile[] libs = pluginLocation.listFiles(filter);\n\t\t\t\tif (libs != null && libs.length > 0)\n\t\t\t\t{\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif (!found) return libName;\n\t\t}\n\t\treturn null;\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 }", "@Override\n public void apply(@Nonnull Project project) {\n project.getLogger().info(\"Applying API scanner to {}\", project.getName());\n if (GradleVersion.current().compareTo(GradleVersion.version(MINIMUM_GRADLE_VERSION)) < 0) {\n throw new GradleException(\"The API Scanner plugin requires Gradle \" + MINIMUM_GRADLE_VERSION + \" or newer.\");\n }\n project.getPluginManager().apply(JavaPlugin.class);\n\n // Do not type-cast to String because the property may be a Groovy GString.\n Object classifierValue = project.findProperty(CLASSIFIER_PROPERTY_NAME);\n final String targetClassifier = classifierValue == null ? DEFAULT_CLASSIFIER : classifierValue.toString();\n\n ScannerExtension extension = project.getExtensions().create(SCAN_TASK_NAME, ScannerExtension.class, targetClassifier);\n\n // Register the scanning task lazily, so that it will be configured after the project has been evaluated.\n project.getLogger().info(\"Adding {} task to {}\", SCAN_TASK_NAME, project.getName());\n TaskProvider<ScanApi> scanProvider = project.getTasks().register(SCAN_TASK_NAME, ScanApi.class, scanTask -> {\n TaskCollection<Jar> jarTasks = project.getTasks()\n .withType(Jar.class)\n .matching(Jar::isEnabled)\n .matching(jarTask ->\n matches(jarTask.getArchiveClassifier(), extension.getTargetClassifier())\n );\n\n scanTask.setClasspath(project.getConfigurations().getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME));\n // Automatically creates a dependency on jar tasks.\n scanTask.setSources(jarTasks);\n scanTask.setExcludePackages(extension.getExcludePackages());\n scanTask.setExcludeClasses(extension.getExcludeClasses());\n scanTask.setExcludeMethods(extension.getExcludeMethods());\n scanTask.setVerbose(extension.getVerbose());\n scanTask.setEnabled(extension.isEnabled());\n });\n\n // Declare this ScanApi task to be a dependency of any GenerateApi tasks belonging to any of our ancestors.\n Project target = project;\n while (target != null) {\n target.getTasks().withType(GenerateApi.class)\n .configureEach(generateTask -> generateTask.dependsOn(scanProvider));\n target = target.getParent();\n }\n }", "public PluginRegister getRegisterManager(){\n return pluginRegister;\n }", "public void scan() {\n Intent intentScan = new Intent(SCAN_INTENT);\n intentScan.addCategory(Intent.CATEGORY_DEFAULT);\n // avoid calling other phonegap apps\n intentScan.setPackage(this.cordova.getActivity().getApplicationContext().getPackageName());\n\n this.cordova.startActivityForResult((CordovaPlugin) this, intentScan, REQUEST_CODE);\n }", "public static void registerEvents(JavaPlugin instance) {\n PluginManager pm = instance.getServer().getPluginManager();\n }", "public void init() {\n\t\tregisterBeanDefinitionParser(\"component-scan\", new AutoComponentScanBeanDefinitionParser());\n\t}", "@SuppressWarnings(\"rawtypes\")\n\tprotected void scan() {\n\t\tLOGGER.info(\"Scanning database procedure mappers for packages: \"\n\t\t\t\t+ packageNames + \" ...\");\n\t\tfor (String scanPackageName : packageNames) {\n\t\t\tClass[] procedureConfigClasses = PackageUtils.getAnnotatedClasses(\n\t\t\t\t\tscanPackageName, Procedure.class);\n\t\t\tif (procedureConfigClasses != null) {\n\t\t\t\tfor (Class procedureConfigClass : procedureConfigClasses) {\n\t\t\t\t\thelper.initProcedureConfigCache(procedureConfigClass);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tLOGGER.info(\"Finished scanning database procedure mappers for packages.\");\n\t}", "private static URL[] expandWildcardClasspath() {\n List<URL> ret = new ArrayList<URL>();\n int numBaseXJars = 0;\n String classpath = System.getProperty(\"java.class.path\");\n String[] classpathEntries = classpath.split(System.getProperty(\"path.separator\"));\n for( String currCP : classpathEntries ) {\n File classpathFile = new File(currCP);\n URI uri = classpathFile.toURI();\n URL currURL = null;\n try {\n currURL = uri.toURL();\n } catch (MalformedURLException e) {\n System.out.println(\"Ignoring classpath entry: \" + currCP);\n }\n if( currCP.endsWith( \"*\" ) ) {\n // This URL needs to be expanded\n try {\n File currFile = new File( URLDecoder.decode( currURL.getFile(), \"UTF-8\" ) );\n // Search the parent path for any files that end in .jar\n File[] expandedJars = currFile.getParentFile().listFiles(\n new FilenameFilter() {\n public boolean accept( File aDir, String aName ) {\n return aName.endsWith( \".jar\" );\n }\n } );\n // Add the additional jars to the new search path\n if( expandedJars != null ) {\n for( File currJar : expandedJars ) {\n ret.add( currJar.toURI().toURL() );\n if( currJar.getName().matches(BASEX_LIB_MATCH) ) {\n ++numBaseXJars;\n }\n }\n } else {\n // could not expand due to some error, we can try to\n // proceed with out these jars\n System.out.println( \"WARNING: could not expand classpath at: \"+currFile.toString() );\n }\n } catch( Exception e ) {\n // could not expand due to some error, we can try to\n // proceed with out these jars\n e.printStackTrace();\n }\n }\n else {\n // Just use this unmodified\n ret.add( currURL );\n if( currURL.getFile().matches(BASEX_LIB_MATCH) ) {\n ++numBaseXJars;\n }\n }\n }\n // we've had trouble finding multiple jars of the BaseX of different versions\n // so if we find more than we will accept the one that matches the \"prefered\" version\n // which is hard coded to the version used when this workspace was created\n if( numBaseXJars > 1 ) {\n for( Iterator<URL> it = ret.iterator(); it.hasNext(); ) {\n URL currURL = it.next();\n if( currURL.getFile().matches(BASEX_LIB_MATCH) && !currURL.getFile().matches(PREFERED_BASEX_VER) ) {\n it.remove();\n --numBaseXJars;\n }\n }\n }\n if( numBaseXJars == 0 ) {\n System.out.println( \"WARNING: did not recongnize any BaseX jars in classpath. This may indicate missing jars or duplicate version mismatch.\");\n }\n return ret.toArray( new URL[ 0 ] );\n }", "public void addJAR(final String jar) {\n if(jar == null)\n throw new IllegalArgumentException(\"jar cannot be null\");\n if(!jarNames.contains(jar))\n jarNames.add(jar);\n }", "protected void register() {\r\n\t\tif ((audioFile != null) && (audioFile instanceof AudioFileURL)) {\r\n\t\t\t((AudioFileURL) audioFile).addListener(this);\r\n\t\t}\r\n\t}" ]
[ "0.6445545", "0.62021375", "0.6083604", "0.6021196", "0.5904794", "0.55471355", "0.5493594", "0.5458796", "0.53488106", "0.5329226", "0.5328251", "0.530759", "0.5299134", "0.5262593", "0.52569747", "0.52207106", "0.51982194", "0.5196893", "0.519646", "0.51880205", "0.51859236", "0.51780885", "0.5170678", "0.5117268", "0.5114236", "0.50589645", "0.50582534", "0.50402313", "0.5021751", "0.5021015", "0.5003692", "0.49938902", "0.497384", "0.4920052", "0.49169576", "0.49168342", "0.49045897", "0.48999155", "0.48942396", "0.4881573", "0.4858672", "0.48547894", "0.48471764", "0.48387492", "0.48260546", "0.48218033", "0.48114473", "0.479448", "0.47816792", "0.47788775", "0.47757584", "0.47662973", "0.47660342", "0.47644228", "0.4764297", "0.47514126", "0.4750781", "0.47487244", "0.47405154", "0.4738527", "0.47254503", "0.47229546", "0.47227028", "0.4715493", "0.471336", "0.4711725", "0.4702534", "0.46860436", "0.46763", "0.46735775", "0.46655118", "0.46653312", "0.46622398", "0.46587685", "0.46471822", "0.46468472", "0.46437204", "0.46434143", "0.46407062", "0.46095625", "0.46058923", "0.45867673", "0.4582818", "0.45819607", "0.45813257", "0.45811927", "0.45747048", "0.45742592", "0.45723918", "0.45620656", "0.45558184", "0.45543832", "0.45527804", "0.45494264", "0.45466146", "0.4541799", "0.4539092", "0.45387277", "0.45344415", "0.45175618" ]
0.67295957
0
This method tries to register a class as plugin. It will only be registered if it matches any of the supported PlugIn types else this method will do nothing.
synchronized private void tryRegisterPlugin(String name, Class<IKomorebiPlugin> pluginClass){ // check status KomorebiPluginStatus pStatus = pluginClass.getAnnotation(KomorebiPluginStatus.class); if(pStatus != null){ if(pStatus.disabled()){ Logger.getLogger(LOGGER_NAME).info("Plugin '"+pluginClass.getName()+"' is disabled."); return; } } // check if configuration consumer is correctly implemented try{ Constructor<IKomorebiPlugin> c = pluginClass.getConstructor(); IKomorebiPlugin pi = c.newInstance(); if(pi.isConfigConsumer() && !IKomorebiConfigurationConsumer.class.isAssignableFrom(pluginClass)){ Logger.getLogger(LOGGER_NAME).warning("Plugin '"+name+"' does not adhere to defined standards (configuration consumer) and will be omitted."); return; } }catch(NoSuchMethodException e){ Logger.getLogger(LOGGER_NAME).warning("Plugin '"+name+"' does not adhere to defined standards (default constructor) and will be omitted."); return; }catch(InvocationTargetException e){ Logger.getLogger(LOGGER_NAME).warning("Plugin '"+name+"' caused an error ("+e.getMessage()+") and will be omitted."); return; }catch(IllegalAccessException e){ Logger.getLogger(LOGGER_NAME).warning("Plugin '"+name+"' caused an error ("+e.getMessage()+") and will be omitted."); return; }catch(InstantiationException e){ Logger.getLogger(LOGGER_NAME).warning("Plugin '"+name+"' caused an error ("+e.getMessage()+") and will be omitted."); return; } if(IKomorebiStorage.class.isAssignableFrom(pluginClass)){ Logger.getLogger(LOGGER_NAME).info("Registered storage PlugIn '"+pluginClass.getName()+"'"); if(!pluginRegister.containsKey(PluginType.STORAGE)){ // if submap does not already exist it has to be created pluginRegister.put(PluginType.STORAGE, new HashMap<String, Class<IKomorebiPlugin>>()); } pluginRegister.get(PluginType.STORAGE).put(name, pluginClass); } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addPlugin(String key, T pluginClass);", "<T> T getPluginInstance(Class<T> type, String className, ClassLoader classLoader) throws PluginLoadingException;", "@Override\n public boolean setPlugin(IAuthorizationPlugin plugin) {\n if (!getName().equals(plugin.getClass().getCanonicalName())\n || !getName().equals(plugin.getClass().getName())) {\n return false;\n }\n if (hasPlugin()) {\n unload();\n }\n try {\n /**\n * The exception should not happen here as we already have an\n * instance of IAuthorizationPlugin. But it is required by the\n * compiler.\n *\n * NOTE: If we were to add a throws clause here we would interrupt\n * the whole stack walk through and prevent the other authorization\n * entities to work properly.\n */\n this.plugin = plugin.getClass().getDeclaredConstructor().newInstance();\n return true;\n } catch (InstantiationException ex) {\n LOGGER.log(Level.INFO, \"Class could not be instantiated: \", ex);\n } catch (IllegalAccessException ex) {\n LOGGER.log(Level.INFO, \"Class loader threw an exception: \", ex);\n } catch (Throwable ex) {\n LOGGER.log(Level.INFO, \"Class loader threw an unknown error: \", ex);\n }\n return false;\n }", "public interface PluginProvider {\n\n /**\n * Returns an instance of the specified plugin by loading the plugin class through the specified class loader.\n *\n * @param type plugin type class\n * @param className plugin class name\n * @param classLoader class loader to be used to load the plugin class\n * @param <T> plugin type\n * @return instance of the plugin\n * @throws PluginLoadingException if en error occurred when loading or instantiation of the plugin\n */\n <T> T getPluginInstance(Class<T> type, String className, ClassLoader classLoader) throws PluginLoadingException;\n}", "void registerQuestionPlugin(QuestionPlugin plugin);", "public static boolean loadPlugin(Class pluginClass, CytoscapeObj cytoscapeObj,\n CyWindow cyWindow) {\n if (pluginClass == null) {return false;}\n\n\n //System.out.println( \"AbstractPlugin loading: \"+pluginClass );\n\n //look for constructor with CyWindow argument\n if (cyWindow != null) {\n Constructor ctor = null;\n try {\n Class[] argClasses = new Class[1];\n argClasses[0] = CyWindow.class;//cyWindow.getClass();\n ctor = pluginClass.getConstructor(argClasses);\n } catch ( Exception e ) {\n e.printStackTrace();\n }\n\n\n// (SecurityException se) {\n// System.err.println(\"In AbstractPlugin.loadPlugin:\");\n// System.err.println(se.getMessage());\n// se.printStackTrace();\n// return false;\n// } catch (NoSuchMethodException nsme) {\n// //ignore, there are other constructors to look for\n// }\n\n \n\n if (ctor != null) {\n try {\n Object[] args = new Object[1];\n args[0] = cyWindow;\n return ctor.newInstance(args) != null;\n } catch (Exception e) {\n System.err.println(\"In AbstractPlugin.loadPlugin:\");\n System.err.println(\"Exception while constructing plugin instance:\");\n System.err.println(e.getMessage());\n e.printStackTrace();\n return false;\n }\n }\n }\n return false;\n }", "protected abstract void onPluginEnable();", "@Override\n\tpublic void addPlugin(ComponentPlugin plugin) throws Exception {\n\n\t}", "public void startPlugin() {\n classesDisponibles = new HashMap[types.length];\n try { // enregistrer le service d'acces aux depot de jars\n ServicesRegisterManager.registerService(Parameters.JAR_REPOSITORY_MANAGER, this);\n rescanRepository(); // creer les listes de classes disponibles a partir du depot\n }\n catch (ServiceInUseException mbiue) {\n System.err.println(\"Jar Repository Manager service created twice\");\n }\n }", "void bootPlugins() {\n\t\tList<List<String>>vals = (List<List<String>>)properties.get(\"PlugInConnectors\");\n\t\tif (vals != null && vals.size() > 0) {\n\t\t\tString name, path;\n\t\t\tIPluginConnector pc;\n\t\t\tList<String>cntr;\n\t\t\tIterator<List<String>>itr = vals.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tcntr = itr.next();\n\t\t\t\tname = cntr.get(0);\n\t\t\t\tpath = cntr.get(1);\n\t\t\t\ttry {\n\t\t\t\t\tpc = (IPluginConnector)Class.forName(path).newInstance();\n\t\t\t\t\tpc.init(this, name);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogError(e.getMessage(), e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public String getPluginClass() {\n return pluginClass;\n }", "public interface Plugin<T> {\n\t/**\n\t * Method returns the hashmap with loaded plugins. </p> Hashmap is inside\n\t * PluginManager class.\n\t * \n\t * @return hashmap with loaded plugins\n\t */\n\tpublic HashMap<String, T> getStorage();\n\n\t/**\n\t * Method adds the plugin specified in pluginClass param into hashmap with\n\t * param key. </p> Hashmap is inside PluginManager class.\n\t * \n\t * @param key\n\t * to hashmap with added plugin\n\t * @param pluginClass\n\t * of type class to save into hashmap\n\t */\n\tpublic void addPlugin(String key, T pluginClass);\n\n\t/**\n\t * Name of the plugin.\n\t * \n\t * @return name of plugin\n\t */\n\tpublic String getName();\n\n\t/**\n\t * Tests if the plugin has any error\n\t * \n\t * @return true if there is any error.\n\t */\n\tpublic boolean hasError();\n}", "protected static void register(Plugin plugin) {\n\t\tPlatform platform = PLATFORMS.get(plugin);\n\t\tif (platform != null)\n\t\t\treturn;\n\n\t\tplatform = new Platform(plugin);\n\t\tPLATFORMS.put(plugin, platform);\n\t}", "@Override\r\n public boolean isPluginEnabled()\r\n {\n return true;\r\n }", "@Override\n\tpublic boolean supports(Class<?> clazz) {\n\t\treturn RegistrationModel.class.isAssignableFrom(clazz);\n\t}", "@Override\n\tpublic void registerPrimaryTypes() {\n\t\tobjectType = registerJavaType(getBuilder().getName(), ClassType.CLASS);\n\t}", "public String getPluginClass() {\n return pluginClass;\n }", "public final <C extends IOpipePluginExecution> C plugin(Class<C> __cl)\n\t\tthrows ClassCastException, NoSuchPluginException, NullPointerException\n\t{\n\t\tC rv = this.optionalPlugin(__cl);\n\t\tif (rv == null)\n\t\t\tthrow new NoSuchPluginException(\"No plugin exists, it is disabled, \" +\n\t\t\t\t\"or it failed to initialize for execution class \" + __cl);\n\t\treturn rv;\n\t}", "public void enable(CommonPlugin plugin);", "public void setPluginClass(String pluginClass) {\n this.pluginClass = pluginClass == null ? null : pluginClass.trim();\n }", "void addPlugin(BaseComponentPlugin baseComponent);", "boolean registerMetric(Class<? extends Metric> metricType);", "@Override\n public boolean register() {\n Bukkit.getPluginManager().registerEvents(\n new MassiveCoreFactionsListener(),\n FactionsBridge.get().getDevelopmentPlugin()\n );\n return true;\n }", "Plugin getPlugin();", "private PluginLoader<Object> createPluginLoader() {\n return PluginLoader.forType(Object.class)\n .ifVersionGreaterOrEqualTo(JAVA_9).load(pluginTypeBetweenJava9AndJava13.getName())\n .ifVersionGreaterOrEqualTo(JAVA_14).load(pluginTypeAfterJava13.getName())\n .fallback(newInstance(pluginTypeBeforeJava9));\n }", "@Override\r\n\tpublic void configPlugin(Plugins me) {\n\r\n\t}", "@SuppressWarnings(\"unchecked\")\n public void register()\n {\n this.phpProcessor.registerProcessorExtension(this);\n \n // Register the node type if specified\n if (this.nodeType != null)\n {\n try\n {\n QName type = QName.createQName(this.nodeType);\n Class clazz = Class.forName(this.extensionClass); \n this.nodeFactory.addNodeType(type, clazz);\n }\n catch (ClassNotFoundException exception)\n {\n throw new PHPProcessorException(\"Unable to load node type (\" + this.extensionClass + \")\", exception);\n }\n }\n }", "public interface Plugin {\n\n /**************************************************************************\n * Method: starting\n * <p>\n * Starting a plugin requires this method.\n **************************************************************************/\n public void starting();\n\n /**************************************************************************\n * Method: stopping\n * <p>\n * Stopping a plugin will happen with this method. Be it an 'emergency-stopping'\n * or you just want to turn it off.\n **************************************************************************/\n public void stopping();\n\n /**************************************************************************\n * Method: setPluginManager\n * <p>\n * To let the Plugin interact with the program we need to give something\n * with what it can work. The PluginManager is the best 'something' because\n * it knows what kind of information the Plugins are allowed to get. And\n * with the plugin manager We have specified what information the plugins\n * are allowed to use.\n **************************************************************************/\n public void setPluginManager(PluginManager pluginManager);\n}", "public void registerPlugin(final DajlabExtension plugin) {\r\n\r\n\t\tif (plugin != null) {\r\n\t\t\tif (plugin instanceof DajlabControllerExtensionInterface) {\r\n\t\t\t\tcontrollers.add((DajlabControllerExtensionInterface<DajlabModelInterface>) plugin);\r\n\t\t\t}\r\n\t\t\tif (plugin instanceof TabExtensionInterface) {\r\n\t\t\t\ttabPlugins.add((TabExtensionInterface) plugin);\r\n\t\t\t}\r\n\t\t\tif (plugin instanceof MenuExtensionInterface) {\r\n\t\t\t\tmenuPlugins.add((MenuExtensionInterface) plugin);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void pluginInitialize() {}", "public interface IPluginLibrary {\n \n /*\n * Initializes the library\n */\n public void initialize(DefaultPluginsCollector collector);\n \n /*\n * Start the module and initialize components\n */\n public void startLibrary();\n \n /*\n * Fetches all extensions for the given extension point qualifiers.\n * \n * @param extPointId The extension point id to gather plugins for\n * \n * @return The gathered plugins in a LinkedList\n */\n public void loadAllPlugins(final String extPointId);\n \n /*\n * Fetches new extensions for the given extension point qualifiers.\n * \n * @param extPointId The extension point id to gather plugins for\n * \n * @return A human readable string\n */\n public String loadNewPlugin(final String extPointId); \n \n /**\n * Checks a plugin for validity.\n * \n * @param plugin The plugin to check\n * @param The level to test against, this method will return true if the result is greater or\n * equal than the testLevel\n * @return true or false\n */\n public boolean isValidPlugin(MartinPlugin plugin, MartinAPITestResult testLevel);\n\n /**\n * Answer a request by searching plugin-library for function and executing\n * them.\n * \n * @param req The {@link ExtendedQequest} to answer.\n * \n * @return The generated {@link MResponse}.\n */\n public MResponse executeRequest(ExtendedRequest req);\n\n \n public List<PluginInformation> getPluginInformation();\n \n /**\n * Returns a list of example calls read from the plugin database. Is usually\n * only called from the AI controller when the user first loads the MArtIn\n * frontend.\n * \n * @return a list of example calls\n */\n public List<MExampleCall> getExampleCalls();\n \n /**\n * Returns a list of 5 randomly choosen example calls read from the plugin database. Is usually\n * only called from the AI controller when the user first loads the MArtIn\n * frontend.\n * \n * @return a list of 5 randomly choosen example calls\n */\n public List<MExampleCall> getRandomExampleCalls();\n \n public Map<String, Pair<Boolean, MartinPlugin> > getPluginExtentions();\n}", "public void loadPluginsStartup();", "public interface Plugin {\n void doUsefil();\n}", "void registerInstantiating (ClassType c) {\r\n if (instantiating_classes == null) \r\n instantiating_classes = new ClassList ();\r\n else if (instantiating_classes.contains (c)) \r\n return;\r\n\r\n instantiating_classes.add (c);\r\n }", "@Nonnull\n public List<Class<? extends PluginInterface>> loadPlugins(@Nonnull String pluginDirName) {\n\n List<Class<? extends PluginInterface>> plugins=new ArrayList<>();\n\n //Директория для просмотра файлов\n File pluginDirectory=new File(pluginDirName);\n File[] files=pluginDirectory.listFiles((dir, name) -> name.endsWith(PLUGIN_EXT));\n\n //Загрузка плагинов\n if(files!=null && files.length>0) {\n getPluginsClasses(files).forEach(className->{\n try {\n //Получим свой загрузчик файлов и загрузим с помощью него плагины\n Class cls=getClassLoaderByFilesURL(files)\n .loadClass(className\n .replaceAll(\"/\",\".\")\n .replace(\".class\",\"\"));\n\n //Если класс расширяет PluginInterface, то добавим этот класс в массив\n Class[] interfaces=cls.getInterfaces();\n for(Class intface:interfaces) {\n if(intface.equals(PluginInterface.class)) {\n plugins.add(cls);\n }\n }\n }\n catch (Exception e){\n e.printStackTrace();\n }\n });\n }\n\n return plugins;\n }", "@Override\n\tpublic void addRolePlugin(ComponentPlugin plugin) throws Exception {\n\n\t}", "public interface Plugin {\n /**\n * What is the name of this plugin?\n *\n * The framework will use this name when storing the versions\n * (code version and schema version) in the database, and, if\n * this is the Application Plugin, in the help menu, main frame\n * title bar, and other displays wherever the application name\n * is shown.\n *\n * The column used to store this in the database is 40\n * characters wide.\n *\n * @return the name of this plugin\n */\n String getName();\n\n /**\n * What is the version number of this plugin's code?\n *\n * The framework will use this name when storing the versions\n * in the database.\n *\n * @return the code version of this plugin\n */\n String getVersion();\n\n /**\n * Allow a plugin to provide any plugin-specific application\n * context files.\n *\n * Can return null or an empty list if there are none.\n * The elements of the list are paths to resources inside the\n * plugin's jar, e.g. org/devzendo/myapp/app.xml\n *\n * @return a list of any application contexts that the plugin\n * needs to add to the SpringLoader, or null, or empty list.\n */\n List<String> getApplicationContextResourcePaths();\n\n /**\n * Give the SpringLoader to the plugin, after the\n * application contexts for all plugins have been loaded\n * @param springLoader the SpringLoader\n */\n void setSpringLoader(final SpringLoader springLoader);\n\n /**\n * Obtain the SpringLoader for plugin use\n * @return the SpringLoader\n */\n SpringLoader getSpringLoader();\n\n /**\n * What is the database schema version of this plugin?\n *\n * The framework will use this name when storing the versions\n * in the database.\n *\n * @return the database schema version of this plugin\n */\n String getSchemaVersion();\n\n /**\n * Shut down the plugin, freeing any resources. Called by the\n * framework upon system shutdown.\n */\n void shutdown();\n}", "public void registerClassMethods()\n {\n }", "public static void register(Class<?> c) {\r\n\t\tassert c != null;\t\t\r\n\t\tclasses.add(c);\t//appends c to the end of the list\r\n\t}", "public static Object getPluginInstance(String interfaceType, String name) \n throws Exception {\n if (PLUGINS.get(interfaceType) == null ||\n PLUGINS.get(interfaceType).size() == 0) {\n throw new Exception(\"No plugins of interface type: \" + interfaceType \n + \" available!!\");\n }\n \n Map<String, String> pluginsOfInterfaceType = \n PLUGINS.get(interfaceType);\n if (pluginsOfInterfaceType.get(name) == null) {\n throw new Exception(\"Can't find named plugin '\" + name + \"' of type '\" +\n \t\tinterfaceType + \"'!\");\n }\n \n String concreteImpl = pluginsOfInterfaceType.get(name);\n Object plugin = Class.forName(concreteImpl).newInstance();\n \n return plugin;\n }", "public void loadPlugins() {\n\n ServiceLoader<Pump> serviceLoader = ServiceLoader.load(Pump.class);\n for (Pump pump : serviceLoader) {\n availablePumps.put(pump.getPumpName(), pump);\n }\n\n Pump dummy = new DummyControl();\n availablePumps.put(dummy.getName(), dummy);\n\n Pump lego = new LegoControl();\n availablePumps.put(lego.getName(), lego);\n }", "@Override\n\tpublic void registerPrimaryTypes() {\n\t\tclassType = registerJavaType(getBean().getName(), CLASS);\n\t\tinterfaceType = registerJavaType(\"I\" + getBean().getName(), INTERFACE);\n\n\t\t// Provide lookup\n\t\tbean.setTypes(classType, interfaceType);\n\n\t\tsetExtends(classType, interfaceType);\n\t}", "@Override\n public void register(PluginAPI api){\n if(api instanceof VPluginAPI){\n VPluginAPI vapi = (VPluginAPI) api;\n vapi.addComponent(ODECreator.class);\n vapi.addComponent(ODESolver.class);\n }\n }", "@Override\r\n\tpublic void register() {\n\t\t\r\n\t}", "@Override\n public void onPluginEnable(PluginEnableEvent event) {\n if (!this.Methods.hasMethod()) {\n if(this.Methods.setMethod(event.getPlugin())) {\n // You might want to make this a public variable inside your MAIN class public Method Method = null;\n // then reference it through this.plugin.Method so that way you can use it in the rest of your plugin ;)\n ConnectFour.Method = this.Methods.getMethod();\n Log.info(\"Using: \" + ConnectFour.Method.getName() + \" - \" + ConnectFour.Method.getVersion());\n }\n }\n }", "public interface PluginBase {\n void init();\n void run();\n}", "public interface FJPluginInterface\r\n{\r\n\t/**\r\n\t * When the plugin is loaded, the pluin's implementation of this method\r\n\t * will be invoked. If nothing needs to be done on startup in a plugin,\r\n\t * keep the method empty. For instance you might do all the work in the\r\n\t * constructor, or you could wait for user input, which will make this\r\n\t * method unnecessary.\r\n\t */\r\n\tpublic void start();\r\n\t\r\n\t/**\r\n\t * Invoked when a plugin is unloaded and another plugin is loaded or when\r\n\t * Flask Jaws is terminated. Useful for shutting down sockets and readers\r\n\t * when you exit your plugin. If nothing needs to be done upon exit or no\r\n\t * cleaning needs to be done, this method may be left empty.\r\n\t * <p>\r\n\t * If a plugin supports networking of any kind, it should call\r\n\t * {@link se.mansehr.flaskjaws.pluginclasses.FJNetwork#close()} in this method.\r\n\t */\r\n\tpublic void stop();\r\n\t\r\n\t/**\r\n\t * Whenever there's a plugin loaded and you select a menu item from the\r\n\t * menu bar, this method will be called. It should pause the plugin\r\n\t * implementing this method. If no pausing is neccessary, it can be\r\n\t * implemented as an emtpy method.\r\n\t */\r\n\tpublic void pause();\r\n\t\r\n\t/**\r\n\t * Has the opposite function as {@link #pause()}, it resumes the plugin\r\n\t * once the actions invoked by selecting a menu item is done.\r\n\t */\r\n\tpublic void resume();\r\n}", "@Override\n protected void pluginInitialize() {\n // init();\n }", "public DemoPluginFactory() {}", "private void loadPlugin(File file) {\n JarFile jarFile;\n\n try {\n jarFile = new JarFile(file);\n } catch (IOException e) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_JARFILE_CREATE, e);\n return;\n }\n\n JarEntry pJson = jarFile.getJarEntry(\"plugin.json\");\n\n if (pJson == null)\n return;\n\n try {\n BufferedReader reader = new BufferedReader(new InputStreamReader(jarFile.getInputStream(pJson)));\n PluginInfo info = new GsonBuilder().setPrettyPrinting().create().fromJson(reader, PluginInfo.class);\n\n if (info != null) {\n ClassLoader classLoader = new URLClassLoader(new URL[] { file.toURI().toURL() }, this.getClass().getClassLoader());\n\n Plugin plugin;\n\n try {\n plugin = (Plugin) classLoader.loadClass(info.getMain()).newInstance();\n plugin.setInfo(info);\n plugins.add(plugin);\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_INSTANTIATION, e);\n return;\n }\n\n Enumeration<JarEntry> entries = jarFile.entries();\n while (entries.hasMoreElements()) {\n JarEntry e = entries.nextElement();\n String name = e.getName();\n\n if (name.endsWith(\".class\")) {\n try {\n Class clazz = Class.forName(name.substring(0, name.length() - 6).replace('/', '.'), true, classLoader);\n\n if (clazz != null && clazz.getSuperclass().equals(Module.class)) {\n try {\n plugin.loadModule((Module) clazz.newInstance());\n } catch (InstantiationException | IllegalAccessException exception) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_CANT_CREATE_MODULE, exception);\n }\n }\n } catch (ClassNotFoundException exception) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_CANT_LOAD_CLASS, name);\n }\n }\n }\n }\n } catch (IOException e) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_CANT_CREATE_INPUTSTREAM, file.getAbsolutePath());\n }\n }", "void registerPart(Object part, Class<?>... implementedInterfaces);", "public static void registerModules()\n {\n // Mystcraft is pushed in through the backdoor so it can't be disabled.\n moduleLoader.registerUncheckedModule(Mystcraft.class);\n\n // Register the remaining plugin classes normally\n moduleLoader.registerModule(AppEng.class);\n moduleLoader.registerModule(BuildcraftTransport.class);\n moduleLoader.registerModule(IC2.class);\n moduleLoader.registerModule(Thaumcraft.class);\n moduleLoader.registerModule(NotEnoughItems.class);\n moduleLoader.registerModule(Waila.class);\n moduleLoader.registerModule(ThermalExpansion.class);\n }", "public void register(GameObject gameObject) {\r\n\t\tsuper.register((Object)gameObject);\r\n\t}", "public PluginRegister getRegisterManager(){\n return pluginRegister;\n }", "private static void initPlugins() {\n \tJSPFProperties props = new JSPFProperties();\n PluginManager pm = PluginManagerFactory.createPluginManager(props);\n pm.addPluginsFrom(new File(\"plugins/\").toURI());\n JavaBot.plugins = new PluginManagerUtil(pm).getPlugins(javaBotPlugin.class);\n }", "public interface IPluginManager {\n\tpublic BasePluginPackage initPlugin(String pluginPath);\n\n\tpublic BasePluginPackage getPluginPackage(String packageName);\n\n\tpublic Class loadPluginClass(BasePluginPackage basePluginPackage, String className);\n}", "private void scanAndRegisterTypes() throws Exception {\n ScannedClassLoader scl = ScannedClassLoader.getSystemScannedClassLoader();\n // search annotations\n Iterator<Metadata> it = scl.getAll(MetadataType.class, Metadata.class); //CellFactorySPI.class);\n logger.log(Level.INFO, \"[Metadata Service] about to search classloader\");\n while (it.hasNext()) {\n Metadata metadata = it.next();\n logger.log(Level.INFO, \"[Metadata Service] using system scl, scanned type:\" + metadata.simpleName());\n registerMetadataType(metadata);\n }\n }", "public void registerEvents(Citizens plugin);", "@Override\n protected boolean supports(Class<?> type) {\n return true;\n }", "public Type getPluginType()\r\n\t{\r\n\t\treturn _pluginType; \r\n\t}", "Plugin getPlugin( );", "public interface Plugin\n{\n\tpublic String getPluginName();\n}", "public void startPlugin() {\n\t\t// add a new ResourceChangeListener\n\t\tCheops.getInstance().addResourceChangeListener();\n\t}", "@Override\r\n\tpublic boolean supports(Class<?> clazz) {\n\t\treturn true;\r\n\t}", "public void setPlugin(Plugin plugin)\r\n\t{\r\n\t\tthis.plugin = plugin;\r\n\t}", "@Override\n public void register() {\n }", "protected void __register()\n {\n }", "protected void __register()\n {\n }", "public boolean registerPlayer(Player p);", "public native void loadPlugin(final String plugin);", "@Override\r\n\tpublic boolean supports(Class<?> arg0) {\n\t\treturn false;\r\n\t}", "public void load(Maussentials plugin);", "private void initPluginComponents()\n {\n // Make sure that we don't miss any event.\n GuiActivator.getUIService().addPluginComponentListener(this);\n\n pluginPanelEast.setLayout(\n new BoxLayout(pluginPanelEast, BoxLayout.Y_AXIS));\n pluginPanelSouth.setLayout(\n new BoxLayout(pluginPanelSouth, BoxLayout.Y_AXIS));\n pluginPanelWest.setLayout(\n new BoxLayout(pluginPanelWest, BoxLayout.Y_AXIS));\n\n this.getContentPane().add(pluginPanelEast, BorderLayout.EAST);\n this.getContentPane().add(pluginPanelWest, BorderLayout.WEST);\n this.mainPanel.add(pluginPanelSouth, BorderLayout.SOUTH);\n\n // Search for plugin components registered through the OSGI bundle\n // context.\n Collection<ServiceReference<PluginComponentFactory>> serRefs;\n String osgiFilter\n = \"(|(\" + Container.CONTAINER_ID + \"=\"\n + Container.CONTAINER_CHAT_WINDOW.getID() + \")(\"\n + Container.CONTAINER_ID + \"=\"\n + Container.CONTAINER_CHAT_STATUS_BAR.getID() + \"))\";\n\n try\n {\n serRefs\n = GuiActivator.bundleContext.getServiceReferences(\n PluginComponentFactory.class,\n osgiFilter);\n }\n catch (InvalidSyntaxException ex)\n {\n serRefs = null;\n logger.error(\"Could not obtain plugin component reference.\", ex);\n }\n\n if ((serRefs != null) && !serRefs.isEmpty())\n {\n for (ServiceReference<PluginComponentFactory> serRef : serRefs)\n {\n PluginComponentFactory factory\n = GuiActivator.bundleContext.getService(serRef);\n Component comp\n = (Component)\n factory\n .getPluginComponentInstance(ChatWindow.this)\n .getComponent();\n\n // If this component has been already added, we have nothing\n // more to do here.\n if (comp.getParent() != null)\n return;\n\n Object borderLayoutConstraints\n = UIServiceImpl.getBorderLayoutConstraintsFromContainer(\n factory.getConstraints());\n\n addPluginComponent(\n comp,\n factory.getContainer(),\n borderLayoutConstraints);\n }\n }\n }", "protected abstract void registerSuperTypes();", "@Override\n\tpublic boolean supports(Class<?> arg0) {\n\t\treturn true;\n\t}", "@Override\n public boolean supports(Class<?> clazz) {\n return false;\n }", "@Override\n public boolean supports(Class<?> clazz) {\n return false;\n }", "QuestionPlugin getQuestionPlugin(String type);", "@Override\n\tpublic boolean supports(Class<?> clazz) {\n\t\treturn _ImageCarrier.class.isAssignableFrom(clazz);\n\t}", "public static void registerWith(Registrar registrar) {\n final MicroblinkFlutterPlugin plugin = new MicroblinkFlutterPlugin();\n plugin.setupPlugin(registrar.activity(), registrar.messenger());\n registrar.addActivityResultListener(plugin);\n }", "public void register() {\n\t\tPrettyEmailNotificator.templatePath = server.getServerRootPath()+ myPluginDescriptor.getPluginResourcesPath() + \"templates/\";\r\n\t\tPrettyEmailNotificator.attachmentPath = server.getServerRootPath()+ myPluginDescriptor.getPluginResourcesPath() + \"img/\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tinitVelocity();\r\n\t\t\tnotificatorRegistry.register(this);\r\n\t\t\tLoggers.SERVER.info(this.getClass().getSimpleName() + \" :: Registering\");\r\n\t\t} catch (Exception e) {\r\n\t\t\tLoggers.SERVER.error(this.getClass().getSimpleName() + \" :: \" + PrettyEmailNotificator.TYPE + \" was NOT successfully registered. See DEBUG for Stacktrace\");\r\n\t\t\tLoggers.SERVER.debug(e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void setPluginInstance(MusterCull pluginInstance) {\n\t\tthis.pluginInstance = pluginInstance;\n\t}", "public static void registerWith(Registrar registrar) {\n final MethodChannel channel = new MethodChannel(registrar.messenger(), FLUTTER_IM_NAME);\n channel.setMethodCallHandler(new FlutterLcImPlugin());\n\n }", "public static void registerWith(Registrar registrar) {\n final MethodChannel channel = new MethodChannel(registrar.messenger(), \"flutter_camerax\");\n channel.setMethodCallHandler(new FlutterCameraXPlugin());\n }", "boolean registerType(SpawnType spawnType);", "@Override\n\tpublic boolean supports(Class<?> arg0) {\n\t\treturn false;\n\t}", "@Override\n public void onDiscovery(String typeName, ClassLoader classLoader, JavaModule module, boolean loaded) {\n }", "public void register (java.lang.String userClass, java.lang.String udtClass) { throw new RuntimeException(); }", "public void loadPlugins()\n throws Exception\n {\n SecurityClassLoader securityClassLoader = new SecurityClassLoader(Plugin.class.getClassLoader(),\n ImmutableList.of(\"ideal.sylph.\", \"com.github.harbby.gadtry.\")); //raed only sylph-api deps\n this.loader = ModuleLoader.<Plugin>newScanner()\n .setPlugin(Plugin.class)\n .setScanDir(pluginDir)\n .setLoader(OperatorManager::serviceLoad)\n .setClassLoaderFactory(urls -> new VolatileClassLoader(urls, securityClassLoader)\n {\n @Override\n protected void finalize()\n throws Throwable\n {\n super.finalize();\n logger.warn(\"Jvm gc free ClassLoader: {}\", Arrays.toString(urls));\n }\n })\n .setLoadHandler(module -> {\n logger.info(\"loading module {} find {} Operator\", module.getName(), module.getPlugins().size());\n ModuleInfo moduleInfo = new ModuleInfo(module, new ArrayList<>());\n analyzeModulePlugins(moduleInfo);\n ModuleInfo old = userExtPlugins.put(module.getName(), moduleInfo);\n if (old != null) {\n Try.of(old::close).onFailure(e -> logger.warn(\"free old module failed\", e)).doTry();\n }\n }).load();\n }", "public static List<String> getPluginsByType(PluginType t){\r\n\t\tMap<String, Class<IKomorebiPlugin>> plugins = instance.pluginRegister.get(t);\r\n\t\tif(plugins == null){\r\n\t\t\treturn new ArrayList<String>();\r\n\t\t}\r\n\t\treturn new ArrayList<String>(plugins.keySet());\r\n\t}", "@Override\n public void initialize() {\n for (final PluginInfo<AbstractVolumeManagerPlugin> info : getPlugins()) {\n String name = info.getName();\n if (name == null || name.isEmpty()) {\n name = info.getClassName();\n }\n // Add the plugin to the list of known animals.\n plugins.put(name, info);\n }\n }", "public void register(){\n }", "private static void registerPacketClass(Object classInstance){\n\t\tWrappedFieldArray<PacketType> array = new WrappedFieldArray<>(classInstance, PacketType.class);\n\n\t\ttry{\n\t\t\tfor(Field f : array.getFields()){\n\t\t\t\tpacketLookup.add((PacketType) f.get(null));\n\t\t\t}\n\t\t}\n\t\tcatch(IllegalAccessException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public final KaranteeniPlugin getPluginInstance(String string) {\r\n\t\treturn (KaranteeniPlugin) kPluginInstances.get(string);\r\n\t}", "@Override\n\tpublic boolean supports(Class<?> clazz) {\n\t\treturn Voyage.class.equals(clazz);\n\t}", "protected void register(String widgetClass, Invoker creator) {\n creators.put(widgetClass, creator);\n }", "private PluginsInternal() {}", "@Override\r\n public <T> void registerService(Class<T> clazz, Object implementation) {\r\n synchronized (serviceRegistrations) {\r\n serviceRegistrations.add(bundleContext.registerService(clazz.getName(), implementation, null));\r\n }\r\n }", "static Plugin newInstance(String simpleClassName) throws Exception {\n final String className = Plugin.class.getPackageName() + \".\" + simpleClassName;\n return (Plugin) Class.forName(className).getDeclaredConstructor().newInstance();\n }", "@Override\n\tpublic boolean supports(Class<?> clazz) {\n\t\treturn false;\n\t}" ]
[ "0.67187953", "0.64251256", "0.63162345", "0.60206366", "0.5939854", "0.58769166", "0.58620584", "0.58381534", "0.5817713", "0.57069", "0.5623589", "0.5590355", "0.5552624", "0.554597", "0.54718924", "0.5470128", "0.5468362", "0.5447702", "0.5424236", "0.5422013", "0.5414093", "0.5375787", "0.5371962", "0.5363943", "0.5347931", "0.52955985", "0.5269108", "0.5267587", "0.52664465", "0.52632725", "0.5245948", "0.52287364", "0.51839095", "0.51832503", "0.5166774", "0.5161708", "0.5151883", "0.5136597", "0.5127697", "0.5127523", "0.512714", "0.51189685", "0.51051956", "0.51017225", "0.5092457", "0.50767183", "0.50745106", "0.5070119", "0.50657254", "0.5062524", "0.50606996", "0.50538236", "0.5051985", "0.50440884", "0.50294423", "0.5022518", "0.5020012", "0.5014045", "0.50129586", "0.5005675", "0.5005015", "0.50045866", "0.49809366", "0.49758178", "0.49705556", "0.49683192", "0.4966152", "0.4966152", "0.49656475", "0.49577507", "0.49559528", "0.4954594", "0.4946305", "0.49462208", "0.49428138", "0.49394935", "0.49394935", "0.4939388", "0.49389508", "0.493805", "0.4937977", "0.49208456", "0.4918144", "0.4917933", "0.49097794", "0.49029964", "0.4898116", "0.48804075", "0.4870514", "0.4868859", "0.48658463", "0.4861209", "0.4860167", "0.48587406", "0.48532522", "0.48503664", "0.48478338", "0.48475483", "0.48378038", "0.48205984" ]
0.75009906
0
Returns a list of the names of all PlugIns that are registered to the according type.
public static List<String> getPluginsByType(PluginType t){ Map<String, Class<IKomorebiPlugin>> plugins = instance.pluginRegister.get(t); if(plugins == null){ return new ArrayList<String>(); } return new ArrayList<String>(plugins.keySet()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<PluginInfo> getPluginsByType(String type) {\n List<PluginInfo> typeList = new ArrayList<PluginInfo>();\n for (int i = 0; i < pl.getPlugins().size(); i++) {\n PluginInfo pi = pl.getPlugins().get(i);\n if (type.endsWith(pi.getType())) {\n typeList.add(pi);\n }\n }\n return typeList;\n }", "public List<String> getPluginNames() {\n\t\tList<String> pluginNames = new ArrayList<String>();\n\t\tfor (Plugin plugin : pluginManager.getPlugins(Plugin.class)) {\n\t\t\tif (StringUtils.isEmpty(plugin.getName())) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpluginNames.add(plugin.getName().trim());\n\t\t}\n\t\treturn pluginNames;\n\t}", "public static Set<String> getPluginNamesOfType(String interfaceName) { \n if (PLUGINS.get(interfaceName) != null) {\n return PLUGINS.get(interfaceName).keySet();\n }\n \n return null;\n }", "@GET\n @Path(\"/typesByPlugin\")\n public Map<Long, List<PluginType>> getTypesByPlugin() {\n return definitionsService.getTypesByPlugin();\n }", "public List<String> getAllPluginNames() {\n\t\treturn allPluginNames;\n\t}", "public List getPluginInfoList(String pluginType) {\n\t\treturn (List) pluginTypeInfoMap.get(pluginType);\n\t}", "ISet<Class<?>> collectAllTypeWiredServices();", "public final static List<KaranteeniPlugin> getPluginInstances() {\r\n\t\treturn new ArrayList<KaranteeniPlugin>(kPluginInstances.values());\r\n\t}", "Iterable<String> getRegisteredNames();", "public String getRegistrationtypes() {\r\n\t\treturn registrationtypes;\r\n\t}", "public String[] getTypes() {\n return impl.getTypes();\n }", "private ArrayList<MapPlugin> listPlugins(String type) {\r\n System.out.println(\"===== HomeController.listPlugins() starting with type : \" + type);\r\n System.out.println(\"List plugins of type \" + type);\r\n ArrayList<MapPlugin> pluginList = new ArrayList();\r\n String plugins = env.getProperty(\"plugins.\" + type);\r\n if (plugins != null) {\r\n /* Unpick the value: <control_name>,<login|public>,<caption>,<tooltip>,<icon_class>,<js_filename>,<ext_css>,<ext_js> */\r\n String[] pluginArr = plugins.split(\",\");\r\n if (pluginArr.length % 8 == 0) {\r\n /* Plausible */ \r\n System.out.println(\"Properties file record is of plausible length\");\r\n for (int i = 0; i < pluginArr.length; i += 8) {\r\n MapPlugin mp = new MapPlugin();\r\n mp.setName(pluginArr[i]);\r\n mp.setAllowed_usage(pluginArr[i+1]);\r\n mp.setCaption(pluginArr[i+2]);\r\n mp.setTooltip(pluginArr[i+3]);\r\n mp.setIconclass(pluginArr[i+4]);\r\n mp.setJs_filename(pluginArr[i+5]);\r\n mp.setExt_css(pluginArr[i+6]);\r\n mp.setExt_js(pluginArr[i+7]);\r\n System.out.println(\"--> Name : \" + mp.getName());\r\n System.out.println(\"--> Icon class : \" + mp.getIconclass());\r\n System.out.println(\"--> JS file : \" + mp.getJs_filename());\r\n System.out.println(\"--> External CSS resources : \" + mp.getExt_css());\r\n System.out.println(\"--> External JS resources : \" + mp.getExt_js());\r\n pluginList.add(mp);\r\n } \r\n }\r\n }\r\n System.out.println(\"===== HomeController.listPlugins() complete\");\r\n return(pluginList.isEmpty() ? null : pluginList);\r\n }", "public abstract Class<?>[] getAddins();", "public java.util.List<String> getInstanceTypes() {\n if (instanceTypes == null) {\n instanceTypes = new com.amazonaws.internal.SdkInternalList<String>();\n }\n return instanceTypes;\n }", "public List<TypeInfo> getTypes() {\r\n return types;\r\n }", "public static List<RegisterModuleType> listAll() {\n return new ArrayList<RegisterModuleType>(Arrays.asList(values()));\n }", "public List<String> getAvailableDataTypes() {\n Set<String> typeSet = new TreeSet<String>();\n\n ITimer timer = TimeUtil.getTimer();\n timer.start();\n\n try {\n for (Provider provider : DataDeliveryHandlers.getProviderHandler()\n .getAll()) {\n\n for (ProviderType type : provider.getProviderType()) {\n typeSet.add(type.getDataType().toString());\n }\n }\n } catch (RegistryHandlerException e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Unable to retrieve the provider list.\", e);\n }\n\n List<String> typeList = new ArrayList<String>(typeSet);\n timer.stop();\n\n return typeList;\n }", "default List<TypeInfo> allTypes() {\n List<TypeInfo> allTypes = new LinkedList<>();\n allTypes.add(this);\n allTypes.addAll(Arrays.asList(interfaces()));\n allTypes.addAll(superClass().stream().flatMap(s -> s.allTypes().stream()).collect(Collectors.toList()));\n return allTypes;\n }", "public List<String> getMBeanTypes() {\n\n\t\treturn Collections.unmodifiableList(new ArrayList<String>(this.mbeanMap.keySet()));\n\t}", "List<String> getListenerTypes();", "public static String[] getBeanNamesForType(Class clazz) {\n return applicationContext.getBeanNamesForType(clazz);\n }", "public Collection getPersistedTypeNames() {\n return (_addClasses == null) ? Collections.EMPTY_LIST : _addClasses;\n }", "List<QuestionPlugin> getQuestionPlugins();", "public List<InstanceType> listInstanceTypes() throws IOException,\n\t\t\tClassNotFoundException {\n\t\treturn list(InstanceType.class);\n\t}", "public String[] getTypes() {\n/* 388 */ return getStringArray(\"type\");\n/* */ }", "public List<Class<?>> getKnownClasses();", "public Type[] types();", "private List<IUserLoginPlugin> getLoginPlugins()\n/* */ {\n/* 341 */ if (this.plugins == null)\n/* 342 */ this.plugins = PluginManager.newIns().getExtInstances(\"loginplugin\", IUserLoginPlugin.class);\n/* 343 */ return this.plugins;\n/* */ }", "public Set<Class<?>> getScanClasses();", "public String[] getAllDependencyExtensions();", "public Collection<Plugin> getPlugins()\n {\n final List<Plugin> plugins;\n synchronized ( this )\n {\n plugins = Arrays.asList(pluginsLoaded.values().toArray(new Plugin[0]));\n }\n return Collections.unmodifiableCollection( plugins );\n }", "public java.util.List<ServiceRegistry> getServiceRegistries() {\n if (serviceRegistries == null) {\n serviceRegistries = new com.amazonaws.internal.SdkInternalList<ServiceRegistry>();\n }\n return serviceRegistries;\n }", "public java.util.List<ServiceRegistry> getServiceRegistries() {\n if (serviceRegistries == null) {\n serviceRegistries = new com.amazonaws.internal.SdkInternalList<ServiceRegistry>();\n }\n return serviceRegistries;\n }", "public List<__Type> getTypes() {\n return (List<__Type>) get(\"types\");\n }", "public List getInterfaceExtensions();", "public static final String[] getSourceTypeList() {\n final SourceType[] types = SourceType.values();\n final String[] displayStrings = new String[types.length];\n for(int i = 0; i < types.length; i++) {\n displayStrings[i] = JMeterUtils.getResString(types[i].propertyName);\n }\n return displayStrings;\n }", "public String[] getAllOutputExtensions();", "List<ITypeDescriptor> getSubTypes(String type) throws StoreException;", "private ArrayList<String> getCritterOptionsMenu() {\n\t\tArrayList<String> items = new ArrayList<String>();\n\t\tArrayList<Class<Critter>> critters = getCritterClasses(this.getClass().getPackage());\n\t\tfor (Class<Critter> c:critters){\n\t\t\titems.add(c.getSimpleName());\n\t\t}\n\t\treturn items;\n\t}", "public Set<String> getRegisteredFunctions();", "public Collection<IRequestHandler<?>> getRegisteredValues() {\n return registry.values();\n }", "public static List<String> getPrinterServiceNameList() {\n\n // get list of all print services\n PrintService[] services = PrinterJob.lookupPrintServices();\n List<String> list = new ArrayList<>();\n\n for (PrintService service : services) {\n list.add(service.getName());\n }\n return list;\n }", "public synchronized static Set<String> getAvailableTypes() {\n populateCache();\n return Collections.unmodifiableSet(cache.keySet());\n }", "private List<Object> pluginPropertyDefinitions() {\n List<Object> extensions = new ArrayList<>();\n extensions.add(getProperty(Constants.ENABLED, \"Plugin enabled\",\n \"Are Teams notifications enabled in general?\",\n \"false\", PropertyType.BOOLEAN));\n extensions.add(getProperty(Constants.BYPASS_HTTPS_VALIDATION, \"Bypass HTTPS Validation\",\n \"Bypass SSL/TLS certificate validation on HTTPS requests (useful for proxies)\",\n \"false\", PropertyType.BOOLEAN));\n extensions.add(getProperty(Constants.PROXY_IP, \"Proxy Server\",\n \"Domain or IP address of proxy server to use\",\n \"\", PropertyType.STRING));\n extensions.add(getProperty(Constants.PROXY_PORT, \"Proxy Port\",\n \"Port for the proxy server\",\n \"8080\", PropertyType.INTEGER));\n extensions.add(getProperty(Constants.PROXY_USER, \"Proxy User\",\n \"User name for proxy authentication\",\n \"\", PropertyType.STRING));\n extensions.add(getProperty(Constants.PROXY_PASS, \"Proxy Password\",\n \"Password for proxy authentication\",\n \"\", PropertyType.PASSWORD));\n return extensions;\n }", "List<Type> getAllTypeList();", "List<Type> getTypeList(String type);", "public List<TypeMetadata> getTypeMetadata() {\n return types;\n }", "public String[] getRegisteredChannels()\n {\n int x = 0;\n String[] ret = new String[channelToHandlers.size()];\n \n for (String value : channelToHandlers.keySet())\n {\n ret[x++] = value;\n }\n return ret;\n }", "public Object[] getNameComponentKinds() {\n\t\tif (_nameComponentKinds != null)\n\t\t\treturn _nameComponentKinds.toArray();\n\t\telse\n\t\t\treturn null;\n\t}", "public PhaseType[] getAllPhaseTypes() throws PhaseManagementException {\r\n return this.delegate.getAllPhaseTypes();\r\n }", "public static List<LanguageInterpreterDescriptor> getRegisteredInterpreters() {\r\n\t\treturn new ArrayList<LanguageInterpreterDescriptor>(INTERPRETERS);\r\n\t}", "Iterable<String> getModuleNames();", "ExtensionsType getExtensions();", "public String[] getAllInputExtensions();", "public Set<String> enumerateRegisters() {\r\n\t\treturn this.registers.keySet();\r\n\t}", "private Vector<String> getSwingClassNames() {\n List<ClassLoader> classLoadersList = new LinkedList<>();\n classLoadersList.add(ClasspathHelper.contextClassLoader());\n classLoadersList.add(ClasspathHelper.staticClassLoader());\n\n Reflections reflections = new Reflections(new ConfigurationBuilder()\n .setScanners(new SubTypesScanner(false), new ResourcesScanner())\n .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[0])))\n .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(\"javax.swing\"))));\n\n Set<Class<? extends JComponent>> classes = reflections.getSubTypesOf(JComponent.class);\n\n Vector<String> classNames = new Vector<>();\n for (Class<?> cls : classes) {\n if (cls.getSimpleName().length() > 0 && cls.getSimpleName().charAt(0) == 'J') {\n classNames.add(cls.getSimpleName() + \" (\" + cls.getName() + \")\");\n }\n }\n\n return classNames;\n }", "public RuleSetInfo[] listRegistrations() throws RemoteException, RuleException;", "public static void listImageIOServices() {\n\t\tIIORegistry registry = IIORegistry.getDefaultInstance();\n\t\tlogger.info(\"ImageIO services:\");\n\t\tIterator<Class<?>> cats = registry.getCategories();\n\t\twhile (cats.hasNext()) {\n\t\t\tClass<?> cat = cats.next();\n\t\t\tlogger.info(\"ImageIO category = \" + cat);\n\n\t\t\tIterator<?> providers = registry.getServiceProviders(cat, true);\n\t\t\twhile (providers.hasNext()) {\n\t\t\t\tObject o = providers.next();\n\t\t\t\tlogger.debug(\"ImageIO provider of type \" + o.getClass().getCanonicalName() + \" in \"\n\t\t\t\t\t\t+ o.getClass().getClassLoader());\n\t\t\t}\n\t\t}\n\t}", "public List<ProgressConfigurationType> getConfigType(String type);", "List<SpawnType> getSpawnTypes();", "public List<String> getResourceTypes(){\n\t\treturn jtemp.queryForList(\"SELECT resource_type_id||' '||resource_type_name FROM resource_type\", String.class);\n\t}", "String [] getSupportedTypes();", "public Set<String> getAvailableTypes() {\n return ApiSpecificationFactory.getTypes();\n }", "public List<ServiceRegistry> getServiceRegistrys() {\n\t\treturn (new ServiceRegistryDAO()).getCloneList();\r\n\t}", "@Override\n public Set<String> getReadOnlyJavaNames(Class<?> type, SecurityContext securityContext) {\n if(type == Object.class || type == null)\n return Collections.EMPTY_SET;\n\n return new MetaDataAdapter(Console.MODULES.getApplicationMetaData())\n .getReadOnlyJavaNames(type, securityContext);\n }", "public String[] getInterfaces() {\n return m_classBuilder.getInterfaces();\n }", "@Nonnull\n public List<Class<? extends PluginInterface>> loadPlugins(@Nonnull String pluginDirName) {\n\n List<Class<? extends PluginInterface>> plugins=new ArrayList<>();\n\n //Директория для просмотра файлов\n File pluginDirectory=new File(pluginDirName);\n File[] files=pluginDirectory.listFiles((dir, name) -> name.endsWith(PLUGIN_EXT));\n\n //Загрузка плагинов\n if(files!=null && files.length>0) {\n getPluginsClasses(files).forEach(className->{\n try {\n //Получим свой загрузчик файлов и загрузим с помощью него плагины\n Class cls=getClassLoaderByFilesURL(files)\n .loadClass(className\n .replaceAll(\"/\",\".\")\n .replace(\".class\",\"\"));\n\n //Если класс расширяет PluginInterface, то добавим этот класс в массив\n Class[] interfaces=cls.getInterfaces();\n for(Class intface:interfaces) {\n if(intface.equals(PluginInterface.class)) {\n plugins.add(cls);\n }\n }\n }\n catch (Exception e){\n e.printStackTrace();\n }\n });\n }\n\n return plugins;\n }", "@Programmatic\n public List<Class<?>> allServiceClasses() {\n List<Class<?>> serviceClasses = Lists\n .transform(this.servicesInjector.getRegisteredServices(), new Function<Object, Class<?>>(){\n public Class<?> apply(Object o) {\n return o.getClass();\n }\n });\n // take a copy, to allow eg I18nFacetFactory to add in default implementations of missing services.\n return Collections.unmodifiableList(Lists.newArrayList(serviceClasses));\n }", "public abstract List<String> scanAllClassNames();", "List<ResourceType> resourceTypes();", "List<Class<?>> getManagedClasses();", "public List<ComponentType> getComponentsType() {\r\n\t\treturn ctDao.findAll();\r\n\t}", "public String[] getModuleNames() {\r\n String[] names = new String[modules.size()];\r\n Iterator it = modules.iterator();\r\n int i=0;\r\n while (it.hasNext()) {\r\n names[i++] = (String)it.next();\r\n }\r\n return names;\r\n }", "private String[] detectPlugins() {\n \t\t\tchangeStampIsValid = false;\n \t\t\tpluginsChangeStampIsValid = false;\n \t\t\tparent.changeStampIsValid = false;\n \t\t\tparent.pluginsChangeStampIsValid = false;\n \n \t\t\tplugins = new ArrayList();\n \n \t\t\tif (!supportsDetection(resolvedURL))\n \t\t\t\treturn new String[0];\n \n \t\t\t// locate plugin entries on site\n \t\t\tFile root = new File(resolvedURL.getFile().replace('/', File.separatorChar) + PLUGINS);\n \t\t\tString[] list = root.list();\n \t\t\tString path;\n \t\t\tFile plugin;\n \t\t\tfor (int i = 0; list != null && i < list.length; i++) {\n \t\t\t\tpath = list[i] + File.separator + PLUGIN_XML;\n \t\t\t\tplugin = new File(root, path);\n \t\t\t\tif (!plugin.exists()) {\n \t\t\t\t\tpath = list[i] + File.separator + FRAGMENT_XML;\n \t\t\t\t\tplugin = new File(root, path);\n \t\t\t\t\tif (!plugin.exists())\n \t\t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tplugins.add(PLUGINS + \"/\" + path.replace(File.separatorChar, '/')); //$NON-NLS-1$\n \t\t\t}\n \t\t\tif (DEBUG) {\n \t\t\t\tdebug(resolvedURL.toString() + \" located \" + plugins.size() + \" plugin(s)\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \n \t\t\treturn (String[]) plugins.toArray(new String[0]);\n \t\t}", "@Override\n public List<Module> getPluginModules(ServletContext context) {\n List<Module> modules = new ArrayList<>();\n\n modules.add(new PushLiquibaseModule(context));\n modules.add(new PushPersistenceModule(context));\n modules.add(new PushRestModule());\n\n return modules;\n }", "private void fillPluginList() {\n\t\tlesSitesPlugin = new ArrayList<HashMap<String, String>>();\n\t\tcategories = new ArrayList<String>();\n\t\tPackageManager packageManager = getPackageManager();\n\t\tIntent baseIntent = new Intent(ACTION_PICK_PLUGIN);\n\t\tbaseIntent.setFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION);\n\t\tList<ResolveInfo> list = packageManager.queryIntentServices(baseIntent, PackageManager.GET_RESOLVED_FILTER);\n\t\tfor (int i = 0; i < list.size(); ++i) {\n\t\t\tResolveInfo info = list.get(i);\n\t\t\tServiceInfo sinfo = info.serviceInfo;\n\t\t\t IntentFilter filter = info.filter;\n\t\t\tNotification.log(tag, \"taille de la liste de Plugin: \" + i + 1 + \"; sinfo: \" + sinfo);\n\t\t\tif (sinfo != null) {\n\t\t\t\t HashMap<String, String> item = new HashMap<String, String>();\n\t\t\t\t item.put(KEY_PKG, sinfo.packageName); // nom du package\n//\t\t\t\t item.put(KEY_SERVICENAME, StringLt.lastSegment(sinfo.name, '.')); // nom du plugin\n\t\t\t\t item.put(KEY_SERVICENAME, sinfo.name);\n\t\t\t\t String firstCategory = null;\n\t\t\t\t if (filter != null) {\n\t\t\t\t StringBuilder actions = new StringBuilder();\n\t\t\t\t for (Iterator<String> actionIterator = filter.actionsIterator(); actionIterator.hasNext();) {\n\t\t\t\t String action = actionIterator.next();\n\t\t\t\t if (actions.length() > 0)\n\t\t\t\t actions.append(\",\");\n\t\t\t\t actions.append(action);\n\t\t\t\t }\n\t\t\t\t StringBuilder categories = new StringBuilder();\n\t\t\t\t for (Iterator<String> categoryIterator = filter.categoriesIterator(); categoryIterator.hasNext();) {\n\t\t\t\t String category = categoryIterator.next();\n\t\t\t\t if (firstCategory == null)\n\t\t\t\t firstCategory = category;\n\t\t\t\t if (categories.length() > 0)\n\t\t\t\t categories.append(\",\");\n\t\t\t\t categories.append(category);\n\t\t\t\t }\n\t\t\t\t// item.put(KEY_ACTIONS, new\n\t\t\t\t// String(StringLt.lastSegment(actions.toString(), '.')));\n\t\t\t\t// item.put(KEY_CATEGORIES, new\n\t\t\t\t// String(StringLt.lastSegment(categories.toString(),\n\t\t\t\t// '.')));\n\t\t\t\t item.put(KEY_ACTIONS, new String(actions));\n\t\t\t\t item.put(KEY_CATEGORIES, new String(categories));\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t item.put(KEY_ACTIONS, \"<null>\");\n\t\t\t\t item.put(KEY_CATEGORIES, \"<null>\");\n\t\t\t\t }\n\t\t\t\t if (firstCategory == null)\n\t\t\t\t firstCategory = \"\";\n\t\t\t\t categories.add(firstCategory);\n\t\t\t\t lesSitesPlugin.add(item);\n\t\t\t\t// lesSitesPlugin.add(StringLt.lastSegment(sinfo.name, '.'));\n\t\t\t\tlesSites.add(StringLt.lastSegment(sinfo.name, '.'));\n\t\t\t}\n\t\t}\n\t}", "public List<String> getLoggerNames();", "UsedTypes getTypes();", "public List<Installation> serchInstPlaceType() {\r\n List<Installation> list = new ArrayList<Installation>();\r\n try {\r\n init();\r\n\r\n // Start UOC\r\n InstPlaceTypeDao dao = new InstPlaceTypeDao(conn);\r\n list = dao.getTypeList();\r\n // End UOC\r\n\r\n } catch (Exception e) {\r\n handleException(e);\r\n } finally {\r\n finish();\r\n }\r\n return list;\r\n }", "public static synchronized Set getDescriptorClasses() {\n\tHashSet set = new HashSet();\n\n for (Enumeration e = registryModes.elements(); e.hasMoreElements();) {\n RegistryMode mode = (RegistryMode)e.nextElement();\n\n\t set.add(mode.descriptorClass);\n\t}\n\n\treturn set;\n }", "public static Set<String> getJunctionNames() {\r\n return namedJunctionClasses.keySet();\r\n }", "java.util.List<com.google.wireless.android.sdk.stats.CriticalPathAnalyzerData.PluginBuildData>\n getPluginsCriticalPathList();", "public NotificationType[] getAllNotificationTypes() throws ResourceManagementException {\r\n return this.port.getAllNotificationTypes();\r\n }", "public Vector getServiceTypes() throws ServiceException {\n return namingService.getServiceTypes();\n }", "public List <String> getPropertyNames()\n{\n // Get list from PropertyNamesMap - load if not found\n List <String> list = _propertyNamesMap.get(getClass());\n if(list==null) {\n _propertyNamesMap.put(getClass(), list = new ArrayList()); addPropNames(); }\n return list;\n}", "@Override\n public ImmutableList<String> getTypeParts() {\n return types.toImmutable();\n }", "public Collection<AbstractFilterPlugin> getFilters();", "public Collection<String> getNamesOfPackagesInstalled() {\n\teval(\"cellfun(@(x) x.name, pkg('list'), 'UniformOutput', false);\");\n\treturn getStringCellFromAns();\n }", "static String[] getAllTypeNames()\n\t{\n\t\treturn new String[] {\"String\", \"int\", \"double\", \"long\", \"boolean\", \"String[]\", \"int[]\", \"double[]\", \"long[]\"};\n\t}", "public List<CWLType> getTypes() {\n return types;\n }", "public Map<HandlerRegistryInfo, PhaseHandler> getHandlers() {\r\n return this.delegate.getHandlers();\r\n }", "void bootPlugins() {\n\t\tList<List<String>>vals = (List<List<String>>)properties.get(\"PlugInConnectors\");\n\t\tif (vals != null && vals.size() > 0) {\n\t\t\tString name, path;\n\t\t\tIPluginConnector pc;\n\t\t\tList<String>cntr;\n\t\t\tIterator<List<String>>itr = vals.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tcntr = itr.next();\n\t\t\t\tname = cntr.get(0);\n\t\t\t\tpath = cntr.get(1);\n\t\t\t\ttry {\n\t\t\t\t\tpc = (IPluginConnector)Class.forName(path).newInstance();\n\t\t\t\t\tpc.init(this, name);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogError(e.getMessage(), e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "TypeInfo[] interfaces();", "private Set<ExecutableElement> getHookMethodsFromInterfaces() {\n return component\n .getInterfaces()\n .stream()\n .map(DeclaredType.class::cast)\n .map(DeclaredType::asElement)\n .map(TypeElement.class::cast)\n .flatMap(typeElement -> ElementFilter\n .methodsIn(typeElement.getEnclosedElements())\n .stream())\n .filter(method -> hasAnnotation(method, HookMethod.class))\n .peek(this::validateHookMethod)\n .collect(Collectors.toSet());\n }", "public Type getPluginType()\r\n\t{\r\n\t\treturn _pluginType; \r\n\t}", "char[][] getInterfaceNames();", "public ArrayList<String> getTypes(){\n return this.types;\n }", "String getInterfaces();", "public List<Class<? extends Resource>> getAvailableTypes(OgemaLocale locale);", "public static synchronized Set<Class<?>> keySet() {\n\t\treturn ClassRegistry.dictionary.keySet();\n\t}" ]
[ "0.7004902", "0.67499095", "0.667383", "0.6551082", "0.64962757", "0.6352797", "0.6282465", "0.624098", "0.6150461", "0.6039385", "0.6020549", "0.5980795", "0.5980213", "0.5969", "0.5809015", "0.5789623", "0.5770038", "0.5733872", "0.5733128", "0.5730239", "0.5717001", "0.5708933", "0.57030123", "0.5701962", "0.57016206", "0.5700599", "0.5693169", "0.5665463", "0.56541896", "0.56177956", "0.5617547", "0.55963385", "0.55963385", "0.5570414", "0.55633914", "0.5558193", "0.555518", "0.5551179", "0.5534974", "0.5528767", "0.55240554", "0.55208695", "0.5497644", "0.5493991", "0.5486711", "0.5484846", "0.54698986", "0.54637724", "0.5441406", "0.54345536", "0.5421109", "0.5420127", "0.5417431", "0.5397665", "0.5396398", "0.5394543", "0.53900146", "0.53867084", "0.5368488", "0.53570104", "0.53376335", "0.5330846", "0.5323028", "0.5317505", "0.53165853", "0.53054285", "0.5292495", "0.5270891", "0.5269952", "0.52631515", "0.52616245", "0.5259399", "0.52584976", "0.52551466", "0.5248728", "0.5241996", "0.52390563", "0.5237755", "0.52329355", "0.5232302", "0.52284795", "0.5225379", "0.5224574", "0.52160215", "0.5215737", "0.5214058", "0.520873", "0.51994735", "0.5198462", "0.51973665", "0.5187247", "0.5186355", "0.51848555", "0.51827073", "0.5172627", "0.51690346", "0.5168208", "0.51625055", "0.51619226", "0.51521826" ]
0.77908283
0
Writes status information to the log.
public static void logStatus(){ Logger log = Logger.getLogger(LOGGER_NAME); StringBuilder logString = new StringBuilder("\n*** PlugIn Status ***\n"); List<String> storagePlugins = getPluginsByType(PluginType.STORAGE); logString.append("Storage PlugIns: "+storagePlugins.size()+"\n"); log.info(logString.toString()); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void log(IStatus status) {\n\t getDefault().getLog().log(status);\n\t}", "protected void logStatusMessage(int status) {\n switch (status) {\n case EXIT_OK:\n logger.info(\"SCHEMA CHANGE: OK\");\n break;\n case EXIT_BAD_ARGS:\n logger.severe(\"SCHEMA CHANGE: BAD ARGS\");\n break;\n case EXIT_RUNTIME_ERROR:\n logger.severe(\"SCHEMA CHANGE: RUNTIME ERROR\");\n break;\n case EXIT_VALIDATION_FAILED:\n logger.warning(\"SCHEMA CHANGE: FAILED\");\n break;\n default:\n logger.severe(\"SCHEMA CHANGE: RUNTIME ERROR\");\n break;\n }\n }", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public static void log(IStatus status) {\n getDefault().getLog().log(status);\n switch (status.getCode()) {\n case IStatus.ERROR:\n IvyDEMessage.error(status.getMessage(), status.getException());\n break;\n case IStatus.CANCEL:\n case IStatus.WARNING:\n IvyDEMessage.warn(status.getMessage(), status.getException());\n break;\n case IStatus.OK:\n case IStatus.INFO:\n IvyDEMessage.info(status.getMessage(), status.getException());\n break;\n }\n }", "private void sendStatus() throws IOException {\n\t\tWriteStatus status = new WriteStatus.Builder().build();\n\t\tstatus.writeTo(out);\n\t\tout.flush();\n\t}", "public StatusLogger getStatusLogger();", "public void printStatus();", "@Override\n public void update(ActorRef actor, Status status) {\n try (Writer w = Files.newBufferedWriter(progressPath, Charset.defaultCharset(), StandardOpenOption.APPEND);\n ProgressWriter log = new ProgressWriter(w)) {\n log.write(actor, status);\n } catch (IOException e) {\n DebugUIFactory.log.error(\"IOError on appending to progress file\", e);\n }\n }", "protected String logStatus(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {\n StringBuilder msg = new StringBuilder();\n msg.append(\"< status: [\");\n if (responseContext.getStatusInfo() != null) {\n msg.append(responseContext.getStatusInfo().getStatusCode());\n msg.append(\"]; family: [\").append(responseContext.getStatusInfo().getFamily());\n msg.append(\"]; reasonPhrase: [\").append(responseContext.getStatusInfo().getReasonPhrase()).append(\"]\");\n }\n msg.append(\"]\\n\");\n return msg.toString();\n }", "protected void writeLog() {\r\n\r\n // get the current date/time\r\n DateFormat df1 = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);\r\n\r\n // write to the history area\r\n if (Preferences.is(Preferences.PREF_LOG) && completed) {\r\n\r\n if (destImage != null) {\r\n\r\n if (srcImage != null) {\r\n destImage.getHistoryArea().setText(srcImage.getHistoryArea().getText());\r\n }\r\n\r\n if (historyString != null) {\r\n destImage.getHistoryArea().append(\"[\" + df1.format(new Date()) + \"] \" + historyString);\r\n }\r\n } else if (srcImage != null) {\r\n\r\n if (historyString != null) {\r\n srcImage.getHistoryArea().append(\"[\" + df1.format(new Date()) + \"] \" + historyString);\r\n }\r\n }\r\n }\r\n }", "private void logCacheStatus() {\n if (!LOGGER.canLogAtLevel(LogLevel.VERBOSE)) {\n return;\n }\n\n final int size = cache.size();\n final int length = cache.getTotalLength();\n\n LOGGER.atVerbose()\n .addKeyValue(SIZE_KEY, size)\n .addKeyValue(TOTAL_LENGTH_KEY, length)\n .log(\"Cache entry added or updated. Total number of entries: {}; Total schema length: {}\",\n size, length);\n }", "public void writeStatus(String path, String data) throws Exception {\n\t\tupdateNode(path + STATUS, data.getBytes());\n\t}", "public void save(XmlWriter w) throws Throwable {\n w.add(\"status\", new String[] { \"time\", new SimpleDateFormat(DateTime.DATE_TIME_FORMAT).format(_time) },\n _state);\n }", "public void recordOverallStatus(int status) {\n mOverallStatusHistogram.put(status, mOverallStatusHistogram.get(status) + 1);\n }", "public void threadStatusLog() {\n LogUtils.logger(TAG, \"All Run Thread Size : \" + threadControl.size() +\n \"\\nAll Run Thread : \" + threadControl);\n\n }", "public void traceStatus() {\n logger.trace(\"jvmThread: {}, jvmMethod: {}\", jvmThread, jvmMethod);\n logger.trace(\"localVariables: {}\", localVariables);\n logger.trace(\"operandStacks: {}\", operandStacks);\n }", "public void writeLog(){\n\t\ttry\n\t\t{\n\t\t\tFileWriter writer = new FileWriter(\"toptrumps.log\");\n\t\t\twriter.write(log);\n\t\t\twriter.close();\n\t\t\tSystem.out.println(\"log saved to toptrumps.log\");\n\t\t\t\n\t\t\tDataBaseCon.gameInfo(winName, countRounds, roundWins);\n\t\t\tDataBaseCon.numGames();\n\t\t\tDataBaseCon.humanWins();\n\t\t\tDataBaseCon.aIWins();\n\t\t\tDataBaseCon.avgDraws();\n\t\t\tDataBaseCon.maxDraws();\n\t\t\t\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void report(int status, String message, BufferedImage image) {\r\n\t\t// update test status\r\n\t\tConf.setTestStatus(status);\r\n\t\t\r\n\t\t// get method name\r\n\t\tStackTraceElement[] thread = Thread.currentThread().getStackTrace();\r\n\t\tString methodName = thread[3].getMethodName();\r\n\t\t\r\n\t\t// report message\r\n\t\tif (Conf.isDbLog()) \r\n\t\t\tlogDatabaseMessage(methodName, status, message, image);\r\n\t\t\r\n\t\tif (Conf.isRobotLog()) \r\n\t\t\tlogLocalMessage(methodName, status, message, image);\r\n\t}", "public void appendStatusText(String msg) {\n status.append(msg);\n }", "private static void _logInfo ()\n {\n System.err.println (\"Logging is enabled using \" + log.getClass ().getName ());\n }", "public abstract WriteResult writeSystemLog(Log log);", "private void writeStatusLine(int statusCode) throws IOException {\n\t\tString statusLine = \"HTTP/1.1 \" + statusCode + \" \"\n\t\t\t\t+ getResponseCodeDescription(statusCode) + \"\\n\";\n\t\t_send(statusLine);\n\t}", "private static void write(String message) {\n\t\tFile log = new File(filePath);\t// File for the database log\n\t\tboolean isNew = false;\t\t\t// Stores if the file created is a new or an old one\n\t\t\n\t\ttry {\n\t\t\tif (!log.exists()) {\n\t\t\t\tisNew = log.createNewFile();\n\t\t\t} // End if\n\t\t\tPrintWriter pw = new PrintWriter(new FileWriter(log, true));\n\t\t\t\n\t\t\tif (Boolean.TRUE.equals(isNew)) {\n\t\t\t\tpw.append(\"Database operations log:\");\n\t\t\t} // End if\n\t\t\tpw.append(message);\n\t\t\tpw.close();\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void writeToLog(String log, LogLevelEnum logLevel, String className) {\n\t\tSystem.out.println(className + \" : \" + logLevel.toString() + \" : \" + log);\n\t}", "public void writeToLog(Level level, Object msg) {\n\t\tif(this.loggingFlag)\n\t\t\tthis.logger.log(level, \"MonitoringAgent\" + \": \" + msg);\n\t}", "protected void statusMessage(String message) {\n \n m_Log.statusMessage(message);\n }", "public void printStatus(){\n System.out.println();\n System.out.println(\"Status: \");\n System.out.println(currentRoom.getLongDescription());\n currentRoom.printItems();\n System.out.println(\"You have made \" + moves + \" moves so far.\");\n }", "private void updateStatus(boolean success) {\n if (success) {\n try {\n callSP(buildSPCall(MODIFY_STATUS_PROC));\n } catch (SQLException exception) {\n logger.error(\"Error updating dataset_system_log with modify entries. \", exception);\n }\n\n try {\n callSP(buildSPCall(COMPLETE_STATUS_PROC, success));\n } catch (SQLException exception) {\n logger.error(\"Error updating dataset_system_log with for merge completion. \",\n exception);\n }\n } else {\n try {\n callSP(buildSPCall(COMPLETE_STATUS_PROC, success));\n } catch (SQLException exception) {\n logger.error(\"Error updating dataset_system_log with for merge completion. \",\n exception);\n }\n }\n }", "public synchronized void log(String state, Transaction t) {\n\n String logContent = state + \" \" + t.toJSON() + \"\\n\"; \n \n try (FileWriter fw = new FileWriter(path, true)) {\n fw.write(logContent);\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n System.out.print(\"Logger::log Content: \" + logContent);\n }", "public void printStatus() {\n printBranches();\n printAllStages();\n printModified();\n printUntracked();\n }", "void log() {\n\t\tm_drivetrain.log();\n\t\tm_forklift.log();\n\t}", "public void printStatus() {\n\t\tSystem.out.println(\"Current : \"+current+\"\\n\"\n\t\t\t\t+ \"Tour restant : \"+nb_rounds+\"\\n\"\n\t\t\t\t\t\t+ \"Troupe restant : \"+nb_to_train);\n\t}", "Response<Void> logCustomStat(int index);", "private void writeLog(){\n\t\tStringBuilder str = new StringBuilder();\r\n\t\tstr.append(System.currentTimeMillis() + \", \");\r\n\t\tstr.append(fileInfo.getCreator() + \", \");\r\n\t\tstr.append(fileInfo.getFileName() + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(networkSize + \", \");\r\n\t\tstr.append(fileInfo.getN1() + \", \");\r\n\t\tstr.append(fileInfo.getK1() + \", \");\r\n\t\tstr.append(fileInfo.getN2() + \", \");\r\n\t\tstr.append(fileInfo.getK2() + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT)+ \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.encryStart, logger.encryStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \"\\n\");\r\n\t\t\r\n\t\tString tmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getKeyStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\r\n\t\t\r\n\t\ttmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getFileStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.FILE_CREATION, str.toString());\t\t\r\n\t\t\r\n\t\t// Topology Discovery\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"TopologyDisc, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.topStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT ) + \", \");\r\n\t\tstr.append(\"\\n\");\t\t\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\r\n\t\t\r\n\t\t// Optimization\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"Optimization, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.optStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(\"\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t\t\r\n\t\t\r\n\t\t// File Distribution\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"FileDistribution, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(logger.distStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \", \");\r\n\t\tstr.append(\"\\n\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t}", "public void save(XmlWriter w) throws Throwable {\n w.add(\"log\", new String[] { \"type\", type().toString(), \"time\",\n new SimpleDateFormat(DateTime.DATE_TIME_FORMAT).format(time()) }, message());\n }", "public static void dumpLog() {\n\t\t\n\t\tif (log == null) {\n\t\t\t// We have no log! We must be accessing this entirely statically. Create a new log. \n\t\t\tnew Auditor(); // This will create the log for us. \n\t\t}\n\n\t\t// Try to open the log for writing.\n\t\ttry {\n\t\t\tFileWriter logOut = new FileWriter(log);\n\n\t\t\t// Write to the log.\n\t\t\tlogOut.write( trail.toString() );\n\n\t\t\t// Close the log writer.\n\t\t\tlogOut.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Close the log file itself.\n\t\t// Apparently we can't? TODO: Look into this. \n\n\t}", "private void printLogCommandResult(Result result) {\n logger.info(\"Command status: \" + result.getStatus().toString());\n\n // In case command fails\n if (!result.hasSucceeded()) {\n logger.info(\"Command message: \" + result.getMessage());\n }\n }", "@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }", "@Override\n protected void process(List<String> chunks) {\n for (String message : chunks) {\n LOG.info(message);\n StatusDisplayer.getDefault().setStatusText(message);\n }\n\n }", "public synchronized void writeCheckpoint() {\n\t\tflush();\n\t\tpw.println(\"CHECKPOINT \" \n\t\t\t\t\t+ TransactionManager.instance().transactionList());\n\t\tflush();\n\t}", "private static void writeLog(Exception e) {\n if (logFile == null) createLogFile();\n LogTools.trace(e);\n LogTools.flush();\n }", "public void logResult() {\r\n resTime = resTime * 1000;\r\n int b = (int) Math.round(resTime);\r\n resTime = (double) b / 1000;\r\n double averageTime = resTime / countTESTS;\r\n averageTime = averageTime * 1000;\r\n int i = (int) Math.round(averageTime);\r\n averageTime = (double) i / 1000;\r\n try (FileWriter writer = new FileWriter(\".//result.txt\")) {\r\n writer.write(resultOpen);\r\n writer.write(resultTitle);\r\n writer.write(resultSource);\r\n writer.write(resultLinkByName);\r\n writer.write(resultLinkByHref);\r\n writer.write(\"Total tests: \" + countTESTS + \"\\n\");\r\n writer.write(\"Passed/Failed: \" + PASSED_TEST + \"/\" + FAILED_TEST + \"\\n\");\r\n writer.write(\"Total time: \" + resTime + \"\\n\");\r\n writer.write(\"Average time: \" + averageTime + \"\\n\");\r\n writer.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }", "private void logStatusMessage(String string) {\n if (m_log != null) {\n m_log.statusMessage(string);\n if (string.contains(\"WARNING\") || string.contains(\"ERROR\")) {\n m_log.logMessage(string);\n }\n }\n }", "public void logSystemInfo(boolean incremental) {\n final String inc = incremental ? \" (incremental)\" : \"\";\n core_.logMessage(\"***** BEGIN Problem Report System Info\" + inc + \" *****\");\n SystemInfo.dumpAllToCoreLog(!incremental);\n core_.logMessage(\"***** END Problem Report System Info\" + inc + \" *****\");\n }", "void completeLogs() throws IOException;", "public void setStatusMessage(IStatus status);", "private static void writeLog(String s) {\n if (logFile == null) createLogFile();\n LogTools.println(s);\n LogTools.flush();\n }", "public void setStatus(String newStatus)throws Exception{\n\t\t\n\t\tthis.status = newStatus;\n\t\toverWriteLine(\"Status\", newStatus);\n\t}", "public static void write() throws Exception {\r\n \tif (FTPManager.upload())\r\n \t\tSystem.out.println(\"Written.\");\r\n \telse\r\n \t\tSystem.out.println(\"Failed.\");\r\n }", "private void internalSetStatus(String status) {\n jStatusLine.setText(\"Status: \" + status);\n }", "public static void logEvent(boolean status, String PassDescription, String FailDescription) {\n\n\t\tif (status) {\n\t\t\tReports.logEvent(\"Pass\", PassDescription);\n\t\t\tSystem.out.println(\"\t\t<<>> \" + PassDescription + \" <<>>\");\n\n\t\t} else {\n\t\t\tReports.logEvent(\"Fail\", FailDescription);\n\t\t\tSystem.out.println(\"\t\t<<>> \" + FailDescription + \" <<>>\");\n\n\t\t}\n\n\t}", "public void logStoreAppendSuccess(AppendLogCommand cmd) {\r\n\r\n\r\n\r\n if (logger.isInfoEnabled())\r\n logger.info(\"LogStore call back MemberAppend {}\",\r\n new String(cmd.getTerm() + \" \" + cmd.getLastIndex()));\r\n\r\n\r\n\r\n // send to all follower and self\r\n\r\n\r\n\r\n }", "void write(LogBuffer lb) throws IOException\n {\n try {\n if (lb.rewind)\n {\n channel.position(0);\n ++rewindCounter;\n lb.rewind = false;\n }\n\n bytesWritten += channel.write(lb.buffer);\n position = channel.position();\n } catch (IOException e) {\n // BUG 303907 - add message to IOException\n IOException ioe = new IOException(\"LogFile.write(): attempting to write \" + \n file.getName() + \" [\" + e.getMessage() + \"]\");\n ioe.setStackTrace(e.getStackTrace());\n throw ioe;\n }\n }", "void printHellow() {\n logger.debug(\"hellow world begin....\");\n logger.info(\"it's a info message\");\n logger.warn(\"it's a warning message\");\n loggerTest.warn(\"from test1 :....\");\n loggerTest.info(\"info from test1 :....\");\n\n // print internal state\n LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n StatusPrinter.print(lc);\n }", "public void log(String message)\n {\n try \n {\n BufferedWriter errorLogWriter = new BufferedWriter(new FileWriter(this.errorLog));\n errorLogWriter.write(Logger.dateFormat.format(Calendar.getInstance().getTime()));\n errorLogWriter.write(message);\n errorLogWriter.close();\n }\n catch (IOException ex)\n {\n System.err.println(\"Cannot write into log : \" + ex.getMessage());\n }\n }", "@Override\n\tpublic void write() {\n\t\tSystem.out.println(\"Manager: Leave Approved\");\n\t}", "@Override\n public void log() {\n switch (this.level) {\n case trace: if (!this.logger.isTraceEnabled()) return;\n break;\n case debug: if (!this.logger.isDebugEnabled()) return;\n break;\n case info: if (!this.logger.isInfoEnabled()) return;\n break;\n case warn: if (!this.logger.isWarnEnabled()) return;\n break;\n case error: if (!this.logger.isErrorEnabled()) return;\n break;\n }\n\n if (this.logger.getClass().equals(ch.qos.logback.classic.Logger.class)) {\n if (!((ch.qos.logback.classic.Logger)this.logger).isAdditive()) {\n return;\n }\n }\n\n this.mdcWriters.forEach(MDCWriter::write);\n\n switch (this.level) {\n case trace:\n this.logger.trace(this.message, this.args.toJavaArray());\n break;\n case debug:\n this.logger.debug(this.message, this.args.toJavaArray());\n break;\n case info:\n this.logger.info(this.message, this.args.toJavaArray());\n break;\n case warn:\n this.logger.warn(this.message, this.args.toJavaArray());\n break;\n case error:\n this.logger.error(this.message, this.args.toJavaArray());\n break;\n }\n }", "Appendable getLog();", "private void logSummary(int migrationSuccessCount, long executionTime) {\n if (migrationSuccessCount == 0) {\n LOG.info(\"Mongo is up to date. No migration necessary.\");\n return;\n }\n\n if (migrationSuccessCount == 1) {\n LOG.info(\"Successfully applied 1 migration to MongoDB (execution time \" +\n TimeFormat.format(executionTime) + \").\");\n } else {\n LOG.info(\"Successfully applied \" + migrationSuccessCount +\n \" migrations to MongoDB (execution time \" +\n TimeFormat.format(executionTime) + \").\");\n }\n }", "@Test\n\tpublic void test() {\n\t\tLoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n\t\t// print logback's internal status\n\t\tStatusPrinter.print(lc);\n\t\t\n\t\tLOG.trace(\"this is a trace message\");\n\n\t\tLOG.debug(\"this is a debug message\");\n\n\t\tLOG.info(\"this is an info message\");\n\n\t\tLOG.warn(\"this is a warn message\");\n\n\t\tLOG.error(\"this is an error message\");\n\n\t}", "@Override\n\tpublic ReturnCode loggerWrite(byte[] buffer, int len) {\n\t\t\n\t\tSystem.out.println(new String(buffer));\n\t\treturn InstaMsg.ReturnCode.SUCCESS;\n\t}", "public void generateLogFile() {\n\t\tFileOperations operator = new FileOperations(path);\n\t\toperator.writeFile(buildLogContent());\n\t}", "@Override\n public void addStatusEvent(Status status) {\n }", "public void setStatus(String stat)\n {\n status = stat;\n }", "protected void log(String msg) {\n\t\tif(isLogging) {\n\t\t\tSystem.out.println(\"[TRACKER \" + id() + \"] \" + msg);\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 }", "private void write(StringBuilder result) {\r\n\t\tif (this.fileWriter != null){\r\n\t\t\ttry {\r\n\t\t\t\tfileWriter.write(result.toString());\r\n\t\t\t\tfileWriter.flush();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tlogger.error(\"Cannot write to file \"+this.myfilename+\" Logging the result at level INFO now. Cause: \"+e.getMessage());\r\n\t\t\t\tlogger.info(result.toString());\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlogger.info(result.toString());\r\n\t\t}\r\n\t}", "public void getSystemStatus() throws Exception\r\n\t{\r\n\t\tsystemDump.delete(0, systemDump.length());\r\n\r\n\t\tboolean needAlarm = memoryLogging();\r\n\r\n\t\tif (Database.appDatasource != null)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"Database connection status: \\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number database connection\\t\\t\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number busy database connection\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumBusyConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number idle database connection\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumIdleConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"\\t Number idle database connection\\t: \");\r\n\t\t\tsystemDump.append(Database.appDatasource.getNumUnclosedOrphanedConnections());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t}\r\n\r\n\t\tString queueWarningMessage = \"\";\r\n\r\n\t\tsystemDump.append(\"\\r\\n\");\r\n\t\tsystemDump.append(\"Local queue status: \\r\\n\");\r\n\r\n\t\tfor (String key : QueueFactory.localQueues.keySet())\r\n\t\t{\r\n\t\t\tLocalQueue localQueue = QueueFactory.getLocalQueue(key);\r\n\r\n\t\t\tsystemDump.append(\"Local queue (\");\r\n\t\t\tsystemDump.append(key);\r\n\t\t\tsystemDump.append(\"): \");\r\n\t\t\tsystemDump.append(localQueue.getSize());\r\n\r\n\t\t\tif (localQueue.getMaxSize() > 0)\r\n\t\t\t{\r\n\t\t\t\tsystemDump.append(\"/\");\r\n\t\t\t\tsystemDump.append(localQueue.getMaxSize());\r\n\t\t\t}\r\n\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t}\r\n\t\tif (QueueFactory.getTotalLocalPending() > 0)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"Total pending counter : \");\r\n\t\t\tsystemDump.append(QueueFactory.getTotalLocalPending());\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t}\r\n\r\n\t\tif (queueDispatcherEnable)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"\\r\\n\");\r\n\t\t\tsystemDump.append(\"Remote queue status: \\r\\n\");\r\n\r\n\t\t\tQueueSession session = null;\r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tsession = getQueueSession();\r\n\r\n\t\t\t\tfor (int j = 0; j < externalQueues.length; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (externalQueues[j].equals(\"\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tString queueName = externalQueues[j];\r\n\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tQueue checkQueue = QueueFactory.getQueue(queueName);\r\n\r\n\t\t\t\t\t\tint size = QueueFactory.getQueueSize(session, checkQueue);\r\n\r\n\t\t\t\t\t\tQueueFactory.queueSnapshot.put(queueName, new Integer(size));\r\n\r\n\t\t\t\t\t\tsystemDump.append(\"Total command request for \");\r\n\t\t\t\t\t\tsystemDump.append(queueName);\r\n\t\t\t\t\t\tsystemDump.append(\" : \");\r\n\t\t\t\t\t\tsystemDump.append(size);\r\n\t\t\t\t\t\tsystemDump.append(\"\\r\\n\");\r\n\r\n\t\t\t\t\t\tqueueWarningMessage += queueWarning(checkQueue, queueName, size);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsystemDump.append(\"Error occur when get size of queue \");\r\n\t\t\t\t\t\tsystemDump.append(queueName);\r\n\t\t\t\t\t\tsystemDump.append(\": \");\r\n\t\t\t\t\t\tsystemDump.append(e.getMessage());\r\n\r\n\t\t\t\t\t\tlogMonitor(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\t\t\t\tsystemDump.append(\"Can not get remote queue size: \");\r\n\t\t\t\tsystemDump.append(e.getMessage());\r\n\t\t\t\tsystemDump.append(\"\\r\\n\");\r\n\r\n\t\t\t\tlogMonitor(e);\r\n\t\t\t}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tQueueFactory.closeQueue(session);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (needAlarm)\r\n\t\t{\r\n\t\t\tsystemDump.append(\"WARNING: Disk space is running low\");\r\n\t\t}\r\n\t\tif (!queueWarningMessage.equals(\"\"))\r\n\t\t{\r\n\t\t\tneedAlarm = true;\r\n\t\t\tsystemDump.append(queueWarningMessage);\r\n\t\t}\r\n\r\n\t\tlogMonitor(systemDump);\r\n\r\n\t\tif (needAlarm)\r\n\t\t{\r\n\t\t\tsendInstanceAlarm(\"system-resource\", systemDump.toString());\r\n\t\t}\r\n\t}", "@Override\n\tpublic void svnLogFinish() {\n\t\tsendMailLogInfo();\n\t}", "private void writeToLogFile(String message)\r\n {\n try\r\n {\r\n logWriter.write(message);\r\n logWriter.newLine();\r\n }\r\n catch (Exception ex)\r\n {\r\n System.out.println(\"Error writing message '\" + message +\r\n \"' to log file : \" + ex.getMessage());\r\n System.exit(1);\r\n }\r\n }", "@Override\n\tpublic void doPostStatus(LoginDetails loginDetails) {\n\t\tSystem.out.println(\"Boomer post status\");\t\n\t\t\t\n\t}", "public static void log(String message) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\n Timestamp timestamp = new Timestamp(System.currentTimeMillis());\n String log = sdf.format(timestamp) + \" - \" + message;\n System.out.println(log);\n try {\n writeLogToFile(log, LOG_FILE_PATH);\n } catch (IOException e) {\n System.err.println(e.getMessage());\n }\n }", "private static void writeLog(String log) {\n\t\twriteLog(log, true);\n\t}", "@Override\n public void log()\n {\n }", "void saveLog(LogInfo logText);", "private void log(String msg) {\r\n\t\tif(this.out != null) {\r\n\t\t\tthis.out.println(msg);\r\n\t\t\tthis.out.flush();\r\n\t\t}\r\n\t}", "public abstract void updateStatus() throws Throwable;", "@Override\n\t\tpublic void flush() throws IOException {\n\t\t\twriteBlock(true);\n\t\t\tout.flush();\n\n\t\t\t// it's a bit nasty if an exception is thrown from the log,\n\t\t\t// but ignoring it can be nasty as well, so it is decided to\n\t\t\t// let it go so there is feedback about something going wrong\n\t\t\t// it's a bit nasty if an exception is thrown from the log,\n\t\t\t// but ignoring it can be nasty as well, so it is decided to\n\t\t\t// let it go so there is feedback about something going wrong\n\t\t\tif (debug) {\n\t\t\t\tlog.flush();\n\t\t\t}\n\t\t}", "protected void trackLoginStatus(String ipAddress, String username, int status) {\n\t\tJdbcTemplate template = new JdbcTemplate( dataSource);\n\t\tString sql = \"INSERT INTO login_track_tbl (ip_address, login_status, username) VALUES (?,?,?)\";\n\t\t\n\t\ttemplate.update(sql, new Object[] { ipAddress, status, username });\n\t}", "private static void addToLog(String message) {\n\t\ttry {\n\t\t\tDateFormat df = new SimpleDateFormat(\"dd/MM/yy HH:mm:ss:SS\");\n\t\t\tDate dateobj = new Date();\n\t\t\tlog.write(df.format(dateobj) + \": \" + message + \"\\n\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error With the Log File\");\n\t\t\tSystem.err.println(\"Exiting...\");\n\t\t\tSystem.exit(1);\n\t\t};\n\t}", "protected void writeLog(String text){\n File logFile = new File(logFilePath);\n try {\n FileWriter fr = new FileWriter(logFile, true);\n fr.write(String.format(\"%s:\\t%s\\n\", getCurrentDate(), text));\n fr.close();\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "private void log() {\n logger.error(\"insert queue (last {}, current {}, change {}/minute)\",\n insertQueueLast, insertQueueCurrent,\n insertQueueDelta);\n logger.error(\"commits (last {}, current {}, change {}/minute)\",\n commitLast, commitCurrent, commitDelta);\n logger.error(\"dropped (last {}, current {}, change {}/minute)\",\n droppedLast, droppedCurrent, droppedDelta);\n logger.error(\"total memory {}; free memory {}\",\n Runtime.getRuntime().totalMemory(),\n Runtime.getRuntime().freeMemory());\n }", "public abstract WriteResult writeUserLog(User user, Log log);", "public static void newLine()\r\n {\r\n logFile.println();\r\n logFile.flush();\r\n }", "@Override\n\tpublic void statusVomMenschen() {\n\t\tSystem.out.println(\"Sie wurden getroffen nun können Sie nicht mehr so schnell laufen!\");\n\t}", "private synchronized void updateLogCount() {\n this.logCount++;\n }", "public void writeToControllerGameLog(String message) {\n controller.getUIController().writeToLogBox(message);\n }", "private void write(String msg)\r\n {\r\n System.out.println(msg);\r\n if (report_ != null) {\r\n report_.write(msg);\r\n }\r\n }", "@Override\n public synchronized void jobProgress(JobProgress progress)\n {\n switch (progress.getJobStatusCode())\n {\n case QUEUED:\n logger.log(Level.INFO, \"Queued Job ID: {0}\", progress.getJobId());\n break;\n case RUNNING:\n logger.log(Level.INFO, \"Running Job ID: {0}\", progress.getJobId());\n break;\n case FINISHED_OK: \n logger.log(Level.INFO, \"Completed Succesfully Job ID: {0}\", progress.getJobId()); \n finished = true;\n break;\n case FINISHED_ERROR:\n logger.log(Level.INFO, \"Completed Unsuccesfully Job ID: {0}\", progress.getJobId());\n finished = true;\n break;\n case ABORTED:\n logger.log(Level.INFO, \"Aborted Job ID: {0}\", progress.getJobId());\n finished = true;\n break;\n }\n }", "public void info(String msg) {\n\t\tif (this.logLevel <= BackupLogger.INFO) {\n\t\t\twrite(\"INFO \" + msg);\n\t\t\tSystem.out.println(\"INFO \" + msg);\n\t\t}\n\t}", "private void printTestingStatus(final boolean status) {\n this.out.println();\n this.print(\n new If<Text>(\n () -> status,\n () -> new GreenText(\"Testing successful.\"),\n () -> new RedText(\"Testing failed.\")\n ).value().text()\n );\n this.out.println();\n }", "void logSystemDetails() throws CometApiException {\n sendSynchronously(restApiClient::logSystemDetails, SystemUtils.readSystemDetails());\n }", "@Override\n\tpublic void setStatus(int status);", "public void reportStatus(boolean success, final EndpointStatus status) {\n if (success) {\n reportSuccess(status);\n } else {\n reportFailure(status);\n }\n }", "public void status() {\n\t\tString bName;\n\t\tSystem.out.println(\"=== Branches ===\");\n\t\tIterator iter = myBranch.entrySet().iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tMap.Entry entry = (Map.Entry) iter.next();\n\t\t\tbName = (String) entry.getKey();\n\n\t\t\tif (currentBranch.equals(bName)) {\n\t\t\t\tSystem.out.println(\"*\" + bName);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(bName);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"=== Staged Files ===\");\n\t\tfor (int i = 0; i < stagedFiles.size(); i++) {\n\t\t\tSystem.out.println(stagedFiles.get(i));\n\t\t}\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"=== Files Marked for Untracking ===\");\n\t\tfor (int i = 0; i < untrackedFiles.size(); i++) {\n\t\t\tSystem.out.println(untrackedFiles.get(i));\n\t\t}\n\t}", "@Test\n public void testSendingData_platformStatusCodeIgnored_ifNotWaitingForResults()\n throws Throwable {\n mPlatformServiceBridge.setLogMetricsBlockingStatus(1);\n\n AwMetricsLogUploader uploader = new AwMetricsLogUploader(\n /* waitForResults= */ false, /* useDefaultUploadQos= */ false);\n int status = uploader.log(SAMPLE_TEST_METRICS_LOG.toByteArray());\n Assert.assertEquals(HttpURLConnection.HTTP_OK, status);\n }", "public void recordLog(){\r\n\t\tthis.finishLog(resourceFiles.getString(\"PathHepparIITestDirectory\") + \"/\" + TEST_FILE_NAME); \r\n\t}" ]
[ "0.6963533", "0.63378453", "0.63008416", "0.63008416", "0.63008416", "0.6219386", "0.6130937", "0.6075633", "0.5961762", "0.5865368", "0.57632273", "0.57483715", "0.57412815", "0.57333726", "0.5658837", "0.5602847", "0.55980706", "0.5569174", "0.5540287", "0.55039114", "0.54918706", "0.54761755", "0.54620224", "0.54417974", "0.5419141", "0.53969544", "0.5380935", "0.5372176", "0.5361889", "0.53197014", "0.53177774", "0.53113437", "0.5306716", "0.52809304", "0.52678615", "0.5201797", "0.5201024", "0.5187583", "0.51819915", "0.51785696", "0.51608527", "0.5149065", "0.5136433", "0.5130355", "0.5127479", "0.5117361", "0.51077193", "0.50735426", "0.5072893", "0.5062165", "0.5055645", "0.50536513", "0.5048241", "0.50414723", "0.5037845", "0.5032118", "0.5030058", "0.5007396", "0.5001398", "0.50000614", "0.49952796", "0.49938253", "0.49680603", "0.4966004", "0.4965047", "0.49562106", "0.49545345", "0.49401814", "0.49389514", "0.49358827", "0.493568", "0.4931145", "0.49197865", "0.49194553", "0.4918586", "0.49175453", "0.49132454", "0.49052507", "0.4905066", "0.49037156", "0.4902504", "0.49012896", "0.4901268", "0.49004218", "0.48923483", "0.48916095", "0.48828146", "0.48803857", "0.48801258", "0.48801255", "0.48736504", "0.48708153", "0.48630393", "0.48560616", "0.48544073", "0.48543102", "0.48537797", "0.4853737", "0.48497292", "0.48417637" ]
0.6276119
5
System.out.println(this.userRepository.findById(5l)); this.userRepository.findAllById(Arrays.asList(1l,2l,3l,4l)).forEach(System.out::print); this.userRepository.findByAgeBetween(19,22).forEach(System.out::println); this.userRepository.findNative(19,20).forEach(System.out::println);
@Test public void testQuery(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<UserEntity> findAll();", "List<User> findAll();", "List<User> findAll();", "List<User> findAll();", "List<User> findAll();", "List<Account> findAllByAgeBetween(Integer age1, Integer age2);", "List<T> findAllById(List<Object> ids) throws Exception;", "@Repository\npublic interface IJpaUserDAO extends JpaRepository<JpaUser,Long>{\n\n JpaUser findByName(String name);\n\n JpaUser findByNameAndAge(String name, Integer age);\n\n}", "List<Person> findByIdAndName(int id,String name);", "@Repository\npublic interface UserRepository extends CrudRepository<User, Integer>{\n User findByUserName(String userName);\n User findByToken(String token);\n User findByPartnerId(int id);\n User findByStudentId(int id);\n User findByStudentIdAndStatus(int id, String status);\n List<User> findByRole(Role role);\n}", "@Repository\npublic interface EmployeeDao {\n List<Employee> selectAllEmployees();\n\n Employee selectEmployeeById(int id);\n\n Employee test(int id);\n\n List<Employee> selectEmployeeByIds(List<Integer> ids);\n}", "@Test\n public void selectById(){\n User user=iUserDao.selectById(\"158271202\");\n System.out.println(user.toString());\n }", "@Repository\npublic interface IUserRepository extends JpaRepository<UserOB, Long> {\n\n @Query(\"SELECT u FROM UserOB u WHERE u.name = ?1 AND u.lastName = ?2\")\n List<UserOB> findByFullName(String aName, String aLastName);\n\n @Query(\"SELECT u FROM UserOB u WHERE u.email = ?1\")\n UserOB findByEmail(String email);\n\n @Query(\"SELECT u FROM UserOB u WHERE u.company.id = ?1\")\n List<UserOB> findByCompanyId(Long aId);\n\n @Query(\"SELECT u FROM UserOB u WHERE u.typUzytkownika =?1\")\n List<UserOB> findByUserType(ETypUzytkownika aType);\n\n}", "public void testFindByEstado() {\n// Iterable<Servico> servicos = repo.findByEstado(EstadoEspecificacao.INCOMPLETO, NrMecanografico.valueOf(\"1001\"));\n// servicos.forEach(s -> System.out.println(s.identity()));\n }", "public interface TidePlatformInternalUserRepository extends PagingAndSortingRepository<TidePlatformInternalUser, Long>, JpaSpecificationExecutor<TidePlatformInternalUser> {\n\n Iterable<TidePlatformInternalUser> findAllByInternalUserId(Long internalUserId);\n}", "@Repository\npublic interface IUserRepository extends JpaRepository<UserOB,Long> {\n @Query(\"SELECT u FROM UserOB u WHERE u.active = ?1\")\n List<UserOB> findUserByActivity (Boolean aActive);\n @Query(\"SELECT u FROM UserOB u WHERE u.login LIKE ?1\")\n UserOB findUserByLogin (String aLogin);\n @Query(\"SELECT u FROM UserOB u WHERE u.email LIKE ?1\")\n UserOB findUserByEmail (String aEmail);\n @Query(\"SELECT u FROM UserOB u WHERE u.name = ?1\")\n List<UserOB> findUserByName (String aName);\n @Query(\"SELECT u FROM UserOB u WHERE u.surname = ?1\")\n List<UserOB> findUserBySurname (String aSurname);\n @Query(\"SELECT u FROM UserOB u WHERE u.name = ?1 AND u.surname = ?2\")\n List<UserOB> findUserByNameAndSurname (String aName, String aSurname);\n @Query(\"SELECT u FROM UserOB u WHERE u.role.name = ?1\")\n List<UserOB> findUserByRole(String aRoleOB);\n\n\n}", "public List<User> findAll();", "public List<User> findAll();", "@Test\n void find() {\n UserEntity userEntity = new UserEntity();\n userEntity.setId(2);\n userEntity.setFirstName(\"pippo\");\n userEntity.setLastName(\"pluto\");\n UserEntity save = repository.save(userEntity);\n\n List<UserEntity> all = repository.findAll();\n Assert.isTrue(3 == all.size());\n }", "@Repository\npublic interface UserRepository extends JpaRepository<User,Long>{\n\n User findById(long id);\n\n\n //User findByUsername(String username);\n\n User findByWxOpenId(String wxOpenId);\n}", "public interface GirlRepository extends JpaRepository<Gril,Integer>{\n //根据年龄查询\n public List<Gril> findByAge(Integer age);\n}", "public static void main(String[] args) {\n\n AdvertRepositoryImpl ar = new AdvertRepositoryImpl();\n/* ar.save(advert1);\n ar.save(advert2);\n ar.save(advert3);*/\n/* ar.update(advert1);\n ar.update(advert2);\n ar.update(advert3);*/\n\n // ar.delete(2);\n\n // System.out.println(ar.findById(1));\n // System.out.println(ar.findAll());\n\n // UserService userService = new UserServiceImpl();\n // System.out.println(userService.findByLogin(\"mars@ukr.net\"));\n // System.out.println(userService.findAll());\n\n System.out.println(ar.findByGenre(AdvertGenre.DESIGN));\n\n }", "@Repository\npublic interface PaymentMeanRepository extends CrudRepository<PaymentMean, Long> {\n\n List<PaymentMean> findByOwner(User owner);\n\n @Query(\"select a from PaymentMean a where a.owner = ?1 and a.id IN ?2\")\n List<PaymentMean> findByOwnerAndId(User owner, Iterable<Long> ids);\n\n PaymentMean findOneByOwnerAndId(User owner, Long id);\n\n PaymentMean findOneByOwnerAndName(User owner, String name);\n}", "public interface PeopleRepository extends CrudRepository<People,Long> {\n\n People findPeopleByUserId(Long userId);\n\n @Override\n People findOne(Long aLong);\n}", "@Test\n public void findAll() {\n // SalesRep:\n List<SalesRep> salesRepList = salesRepRepository.findAll();\n assertEquals(2, salesRepList.size());\n assertEquals(\"Pepe\", salesRepList.get(0).getName());\n // Leads:\n List<Lead> leadList = leadRepository.findAll();\n assertEquals(3, leadList.size());\n assertEquals(\"María\", leadList.get(0).getName());\n // Opportunities:\n List<Opportunity> opportunityList = opportunityRepository.findAll();\n assertEquals(3, opportunityList.size());\n assertEquals(5, opportunityList.get(0).getQuantity());\n // Account:\n List<Account> accountList = accountRepository.findAll();\n assertEquals(2, accountList.size());\n assertEquals(20, accountList.get(0).getEmployeeCount());\n }", "List<UserDTO> findAll();", "public interface UrnaRepository extends JpaRepository<Urna, Long>{\r\n Urna findByCandidato(String id);\r\n Urna findByEleitor(String id);\r\n \r\n}", "@Test\n\tpublic void testFindAll() {\n\n\t\tList<UserInfo> result = this.userinfoDao.findAll();\n\n\t}", "List<T> findAll() ;", "@Query(\"name = ? and age = ?\")\n List<PersonDocument> findByNameAndAge(String name, Integer age);", "public interface UserDao extends JpaRepository<UserEntity,String> {\n\n default UserEntity findByAccount(String account)throws Exception{\n UserEntity exp=new UserEntity();\n exp.setAccount(account);\n return this.findOne(Example.of(exp)).orElse(null);\n }\n}", "public interface UserRepository extends CrudRepository<User,Integer> {\n\n User findByAccount(String account);\n}", "public interface UserJpaDao extends JpaRepository<User,Integer> {\n\n User findByIdAndName(int id,String name);\n\n User findTopByOrderByAgeDesc();\n\n List<User> findTop3ByOrderByAgeDesc();\n\n /**\n * 自定义SQL查询\n */\n @Transactional(timeout = 10)\n @Query(\"select u from User u where name = ?1\")\n User findByName(String name);\n\n @Query(\"select u from User u where u.age = :age\")\n User findByAge(@Param(\"age\") int age);\n}", "interface UserRepository extends JpaRepository<User, Long> {\n\n Collection<User> findByUserNumber(String userNumber);\n Collection<User> findByFirstName(String firstName);\n Collection<User> findByLastName(String value);\n Collection<User> findByFirstNameAndLastName(String firstName, String lastName);\n\n @Query(\"select u from #{#entityName} u where u.team = ?1\")\n List<User> findAllByTeam(String teamName);\n\n Collection<WorkItem> findByWorkItems(User user);\n}", "public interface UserRepository extends MongoRepository<User, String> {\n\n public List<User> findAll();\n\n}", "@Test\n public void queryUserList() {\n\n User user = new User();\n user.setName(\"lin\");\n\n List<User> users = userDao.queryUserList(user, 0, 5);\n assertEquals(1, users.size());\n\n }", "@Test\n @Transactional\n public void ManyToManyQuery() {\n SysRole role = roleDao.findOne(4l);\n role.getUsers().forEach(u-> System.out.println(u));\n }", "public interface AccountRepo extends JpaRepository<Account,Integer> {\n\n List<Account>findAccountByUser(User user);\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface FoodNutritionalValueRepository extends JpaRepository<FoodNutritionalValue, Long> {\n FoodNutritionalValue findFirstByIsProteinPowder(boolean isProteinPowder);\n\n List<FoodNutritionalValue> findByIdIn(Collection<Long> idList);\n}", "@Repository\npublic interface ReservationRepository extends CrudRepository<ReservEntity,Integer> {\n\n List<ReservEntity> findAll();\n List<ReservEntity> findByUserId(int userId);\n\n}", "public interface UserRepository extends JpaRepository<User, Integer>, JpaSpecificationExecutor<User> {\n User findByLogin(String login);\n\n User findByPhoneNumber(String phoneNumber);\n}", "List<T> findAll();", "List<T> findAll();", "List<T> findAll();", "public interface UserDao {\n public List<User> findAll();\n //新增\n public void insert(User user);\n //删除\n public void deleteById(Integer id);\n //修改\n public void update(User user);\n //根据id查询\n public User findById(Integer id);\n //模糊查询\n public List<User> findByName(String name);\n\n //根据username和sex查询\n public List<User> findByUsernameAdnSex(User user);\n\n //测试foreach标签\n public List<User> findByIds(User user);\n\n //测试foreach标签 in\n public List<User> findByIds1(User user);\n\n //一对多关联查询\n public List<User> findAlls();\n\n //多对多查询\n public List<User> findManyToMany();\n\n //一对多延迟加载\n public List<User> findAll1();\n\n //根据id查询测试2及缓存使用\n public User findById1(Integer id);\n}", "List<User> findAll() throws DataAccessException;", "public interface NoteRepository extends CrudRepository<Note, Integer> {\n Note findByIdAndUserId(Integer id, Integer userId);\n}", "@Repository\npublic interface UserRepository extends MongoRepository<User, String> {\n\n Optional<User> findOneByLogin(String login);\n\n Page<User> findAllByLoginNot(Pageable pageable, String login);\n\n Optional<User> findOneByCharacterId(Long characterId);\n\n List<User> findAllByTrackingStatus(TrackingStatus trackingStatus);\n\n List<User> findAllByCorporationIdIsNull();\n\n List<User> findAllByHideFromLeaderboard(boolean hide);\n\n User findByLogin(String login);\n}", "@Repository\npublic interface EmployeeRepository extends CrudRepository<Employee, UUID> {\n Page<Employee> findAll(Pageable pageable);\n\n List<Employee> findAll(Specification<Employee> filter);\n\n Optional<Employee> findById(UUID id);\n}", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface PaiementRepository extends JpaRepository<Paiement, Long> {\n\n public List<Paiement> findByUserId(Long userId);\n\n}", "public static void main(String[] args) {\n\t\tSessionFactory sf=HibernateUtility.getSessionFactory();\n\t\tSession s=sf.openSession();\n\t\tCriteria crt=s.createCriteria(Employee.class);\n\t\tcrt.add(Restrictions.between(\"id\", 200, 3000));\n\t\tcrt.add(Restrictions.gt(\"salary\", 40000));\n\t\tList list=crt.list();\n\t\tIterator it =list.iterator();\n\t\twhile(it.hasNext()){\n\t\t\tEmployee e=(Employee)it.next();\n\t\t\tSystem.out.println(\"id= \"+e.getId()+\"Salary = \"+e.getSalary());\n\t\t\t\n\t\t\n\n\t}\n\t\ts.close();\n\t\tsf.close();\n\t}", "@Test\n void findAllWithQuery() {\n DomainUser user0 = DomainUser.builder()\n .userName(\"user0\")\n .build();\n DomainUser user1 = DomainUser.builder()\n .userName(\"user1\")\n .groups(Collections.singletonList(\"group1\"))\n .build();\n when(ldaptiveTemplate.findAll(any(), any()))\n .thenAnswer((Answer<Stream<DomainUser>>) invocationOnMock -> Stream.of(user0, user1));\n assertFalse(userRepository.findAll(\"group1\")\n .anyMatch(user -> user0.getUserName().equals(user.getUserName())));\n assertTrue(userRepository.findAll(\"group1\")\n .anyMatch(user -> user1.getUserName().equals(user.getUserName())));\n }", "public interface StudentRepository extends JpaRepository<Student,Integer> {\n\n Student findAdminByNum(Long num);\n\n Student findAdminByName(String name);\n\n\n}", "@Test\n void getCollectedHouses() {\n Integer userId = 10001;\n System.out.println(houseService.getCollectedHouses(userId.toString()));\n }", "List<ROmUsers> selectByExample(ROmUsersExample example);", "public List findByExample(Object example);", "List<Employee> findAll();", "@SneakyThrows\n public static void main(String[] args) {\n List<Developer> all = new DeveloperServiceImpl().findAll();\n System.out.println(all.size());\n System.out.println(all.get(50));\n\n// Developer developerServiceByID = developerService.findByID(1L);\n// System.out.println(developerServiceByID);\n// GetQueryServiceImpl getQueryServiceImpl = new GetQueryServiceImpl();\n//\n// // Новый разработчик\n// DeveloperServiceImpl developerService = new DeveloperServiceImpl();\n// developerService.create(Developer.builder()\n// .developerID(14L)\n// .companyID(2L)\n// .age(23L)\n// .name(\"Рыжий\")\n// .email(\"asd@asd.asd\")\n// .gender(\"Male\")\n// .numberPhone(12345L)\n// .salary(1111L)\n// .build());\n\n // Новый проект\n// ProjectServiceImpl projectService = new ProjectServiceImpl();\n// projectService.create(Project.builder()\n// .id(4L)\n// .name(\"New Project\")\n// .cost(123456L)\n// .companyID(3L)\n// .customerID(1L)\n// .build());\n\n // Новый клиент\n// CustomerServiceImpl customerService = new CustomerServiceImpl();\n// customerService.create(Customer.builder()\n// .id(4L)\n// .name(\"Customer4\")\n// .budget(1000000L)\n// .companyID(2L)\n// .build());\n\n // изменить разработчика\n // default -(4,'Витя', 27, 'Male', 'abc3@com.ua', 8765434,1,5600),\n// developerService.update(4L, Developer.builder()\n// .name(\"newName\")\n// .age(33L)\n// .numberPhone(1234567L)\n// .companyID(1L)\n// .salary(600L)\n// .gender(\"Male\")\n// .email(\"abcder3@com.ua\")\n// .build());\n\n // удалить - разработчика/проект/клиента\n// developerService.delete(14L);\n// projectService.delete(4L);\n// customerService.delete(4L);\n\n // все юзеры 1-ого проекта по айди - done\n// System.out.println(getQueryServiceImpl.getDevelopersByProjectID(1L));\n// // сумма всех зарплат 1-ого проекта - done\n// System.out.println(getQueryServiceImpl.getSumSalariesByProjectID(1L));\n// // список всех Java - done\n// System.out.println(getQueryServiceImpl.getDevelopersByActivity(\"Java\"));\n// // список юзеров middle - done\n// System.out.println(getQueryServiceImpl.getDevelopersByLevel(\"middle\"));\n// //список проектов в формате: дата создания - название проекта - количество разработчиков на этом проекте.\n// System.out.println(getQueryServiceImpl.projectsWithCountDevelopers());\n\n\n// Map<Long, Developer> testMap = new HashMap<>();\n// Developer developer = Developer.builder()\n// .developerID(20L)\n// .name(\"User1\")\n// .age(10L)\n// .gender(\"Male\")\n// .email(\"abc1@a\")\n// .numberPhone(123345L)\n// .salary(1000L)\n// .companyID(1L)\n// .build();\n// testMap.put(developer.getDeveloperID(), developer);\n//\n// Developer developer1 = Developer.builder()\n// .developerID(21L)\n// .name(\"User2\")\n// .age(10L)\n// .gender(\"Male\")\n// .email(\"abc1@a\")\n// .numberPhone(123345L)\n// .salary(1000L)\n// .companyID(1L)\n// .build();\n// testMap.put(developer1.getDeveloperID(), developer1);\n//\n// Developer developer2 = Developer.builder()\n// .developerID(22L)\n// .name(\"User3\")\n// .age(10L)\n// .gender(\"Male\")\n// .email(\"abc1@a\")\n// .numberPhone(123345L)\n// .salary(1000L)\n// .companyID(1L)\n// .build();\n// testMap.put(developer2.getDeveloperID(), developer2);\n//\n// System.out.println(testMap);\n// Stream<Developer> developerStream = testMap.values().stream();\n// Stream<Developer> developerStream1 = developerStream.filter((testMap1) -> developer.getName().contains(\"1\"));\n// System.out.println(developerStream);\n// System.out.println(Arrays.toString(developerStream1.toArray()));\n\n }", "List<User> findAll() throws UserDaoException;", "List<Account> findAccountByAgeBetween(int age1, int age2);", "public interface StudentRespository extends JpaRepository<Student, Long> {\n List<Student> findAll();\n}", "List<AccountDetail> findAllByAgeLessThanEqual(Integer age);", "@Test\n public void testFindAll()\n {\n final List<Invoice> invoices = invoiceRepository.findAll();\n\n Assert.assertFalse(invoices.isEmpty());\n\n for (final Invoice invoice : invoices)\n {\n Assert.assertNotNull(invoice.getDate());\n Assert.assertNotNull(invoice.getID());\n Assert.assertNotNull(invoice.getTotal());\n }\n }", "@Repository\npublic interface UserRepository extends JpaRepository<User, Long> {\n Optional<User> findByEmail(String email);\n\n Optional<User> findByUsernameOrEmail(String username, String email);\n\n @Query(\"SELECT name, username, email FROM User WHERE Id = :userId\")\n Optional<User> findUserInfoById(@Param(\"userId\") Long userId);\n\n List<User> findByIdIn(List<Long> userIds);\n\n Optional<User> findByUsername(String email);\n\n Boolean existsByUsername(String username);\n\n Boolean existsByEmail(String email);\n\n}", "@Test\n public void test_getAll_2() throws Exception {\n User user1 = createUser(1, false);\n User user2 = createUser(2, false);\n createUser(3, true);\n\n List<User> res = instance.getAll();\n\n assertEquals(\"'getAll' should be correct.\", 2, res.size());\n\n User entity1 = res.get(0);\n User entity2 = res.get(1);\n if (entity1.getUsername().equals(user2.getUsername())) {\n entity1 = res.get(1);\n entity2 = res.get(0);\n }\n\n assertEquals(\"'getAll' should be correct.\", user1.getUsername(), entity1.getUsername());\n assertEquals(\"'getAll' should be correct.\", user1.getDefaultTab(), entity1.getDefaultTab());\n assertEquals(\"'getAll' should be correct.\", user1.getNetworkId(), entity1.getNetworkId());\n assertEquals(\"'getAll' should be correct.\", user1.getRole().getId(), entity1.getRole().getId());\n assertEquals(\"'getAll' should be correct.\", user1.getFirstName(), entity1.getFirstName());\n assertEquals(\"'getAll' should be correct.\", user1.getLastName(), entity1.getLastName());\n assertEquals(\"'getAll' should be correct.\", user1.getEmail(), entity1.getEmail());\n assertEquals(\"'getAll' should be correct.\", user1.getTelephone(), entity1.getTelephone());\n assertEquals(\"'getAll' should be correct.\", user1.getStatus().getId(), entity1.getStatus().getId());\n\n assertEquals(\"'getAll' should be correct.\", user2.getUsername(), entity2.getUsername());\n assertEquals(\"'getAll' should be correct.\", user2.getDefaultTab(), entity2.getDefaultTab());\n assertEquals(\"'getAll' should be correct.\", user2.getNetworkId(), entity2.getNetworkId());\n assertEquals(\"'getAll' should be correct.\", user2.getRole().getId(), entity2.getRole().getId());\n assertEquals(\"'getAll' should be correct.\", user2.getFirstName(), entity2.getFirstName());\n assertEquals(\"'getAll' should be correct.\", user2.getLastName(), entity2.getLastName());\n assertEquals(\"'getAll' should be correct.\", user2.getEmail(), entity2.getEmail());\n assertEquals(\"'getAll' should be correct.\", user2.getTelephone(), entity2.getTelephone());\n assertEquals(\"'getAll' should be correct.\", user2.getStatus().getId(), entity2.getStatus().getId());\n }", "public static void main(String[] args) {\n\r\n\t\tEntityManager em = PersistanceManager.INSTANCE.getEntityManager();\r\n\t\tSystem.out.println(\"Print ALL\");\r\n\t\tQuery query = em.createQuery(\"FROM Employee e\");\r\n\t\tArrayList<Employee> result = (ArrayList<Employee>) query.getResultList();\r\n\t\tfor (Employee current : result)\r\n\t\t\tSystem.out.println(current.toString());\r\n\t\tSystem.out.println(\"Print id = 3\");\r\n\t\tQuery query1 = em.createQuery(\"FROM Employee e where e.id=3\");\r\n\t\tArrayList<Employee> result1 = (ArrayList<Employee>) query1.getResultList();\r\n\t\tfor (Employee current : result1)\r\n\t\t\tSystem.out.println(current.toString());\r\n\t\tSystem.out.println(\"Print Named Query \");\r\n\t\tArrayList<Employee> result2 = (ArrayList<Employee>) em.createNamedQuery(\"Employee.searchAll\").setParameter(\"empName\", \"D%\")\r\n\t\t\t\t.getResultList();\r\n\t\tfor (Employee current : result2)\r\n\t\t\tSystem.out.println(current.toString());\r\n\t}", "public interface PersonRepository extends CrudRepository<Person, Long>{\n List<Person> findByFirstName(String firstName);\n}", "@Repository\npublic interface UserRepository extends JpaRepository<User, Integer> {\n Optional<User> findOneById(String userId);\n Optional<User> findOneByIdAndPassword(String userId, String password);\n Optional<User> findOneUserByName(String email);\n List<User> findAll();\n}", "@Repository\npublic interface ScoreRepository extends JpaRepository<ScoreEntity, ScoreKey> {\n List<ScoreEntity> findAllById_GameId(Long game_id);\n List<ScoreEntity> findAllById_UserId(Long user_id);\n}", "public interface InfoRepository extends JpaRepository<Info, String> {\n Info findTop1ByUserIdOrderByIdDesc(Long userId);\n List<Info> findTop5ByUserIdOrderByIdDesc(Long usedId);\n}", "Collection<T> findAll(Iterable<I> ids);", "public interface UserRepository extends CrudRepository<User, Long> {\n\n public User findAllByName(String name);\n\n}", "List<AccountDetail> findAllByAgeBetween(Integer minAge,Integer maxAge);", "public interface UserRepository extends JpaRepository<User, Long> {\n\n User findByNome(String nome);\n\n User findByLogin(String login);\n\n\n}", "List<E> findAll(Iterable<ID> identifiers);", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface EmEmpBankAccountsRepository extends JpaRepository<EmEmpBankAccounts, Long> {\n List<EmEmpBankAccounts> findByIdEmployeeId(long id);\n\n}", "public interface UserRepository extends CrudRepository<User, Long>\n{\n\n User findByEmail(String email);\n List<User> findAllByOrderByIdAsc();\n}", "List<Book> findAll();", "@Repository\npublic interface StatisticsRepository extends RDBRepository<Statistics, Long> {\n//\tList<Statistics> selectGroup();\n\t/*List<TotalStatistics> selectTotal();\n List<UserAgeStatistics> selectAge(Map dateMap);\n List<UserCountStatistics> selectUserCountMonth(Map dateMap);\n List<UserCountStatistics> selectUserCountYear(Map dateMap);\n List<UserCountStatistics> selectUserCountDay(Map dateMap);\n\n List<UserDeviceStatistics> selectDevice();\n List<UserModuleStatistics> selectModule();\n List<UserSexStatistics> selectSex();\n\n List<UserCountStatistics> selectActiveUser();\n List<UserCountStatistics> selectActiveModule();\n List<UserCountStatistics> selectActiveDevice();\n\n List<UserCountStatistics> selectUv();*/\n}", "List<E> findAll();", "List<E> findAll();", "List<E> findAll();", "java.util.List<AuditoriaUsuario> findAll();", "List<Account> findAllByAgeLessThanEqual(Integer age);", "public interface DemoRepositoryCustom {\n\n List<Demo> findInSet(Collection<Long> ids);\n}", "public interface DoctorService extends CrudRepository<Doctor, Integer>{\r\n\t\r\n\tIterable<Doctor> findByDocFirstName(String docFirstName);\r\n\tIterable<Doctor> findByDocLastName(String docLastName);\r\n\tIterable<Doctor> findByDocFirstNameAndDocLastName(String docFirstName,String docLastName);\r\n\r\n}", "public interface BlogRepository extends JpaRepository<Blog, Integer> {\n\n List<Blog> findByUser(User user);\n}", "public interface PersonDao {\n\n public List<Person> findAll();\n\n public Person find(MultiId multiId);\n\n public List<Person> find(List<MultiId> multiIds);\n\n public MultiId save(Person person);\n\n public void delete(Person person);\n\n public List<Person> findByProfession(Profession profession);\n\n public List<Person> findYoungerThen(Date birthDate);\n\n public List<Person> findYoungerOrEqualThen(Date birthDate);\n\n public List<Person> findOlderThen(Date birthDate);\n\n public List<Person> findOlderOrEqualThen(Date birthDate);\n\n public List<Person> findByProfessionName(String professionName);\n\n}", "@Repository\npublic interface UserRepository extends BaseRepository<User,Long> {\n\n User findByAccount(String account);\n}", "public interface ReviewRepository extends CrudRepository<Review,Integer> {\n public Iterable<Review> findByPublishid(int publishid);\n}", "Repository findById(Integer id);", "List<User> selectByExample(UserExample example);", "List<User> selectByExample(UserExample example);", "List<User> selectByExample(UserExample example);", "public interface NetworkRepository extends JpaRepository<Network, Long> {\n\n List<Network> findByUserId(Long userId);\n\n}", "public static void main(String[] args) {\n IStudentDao dao = SqlSessionUtil.getSqlSession().getMapper(IStudentDao.class);\n Student byId = dao.getById(1001);\n System.out.println(byId);\n }", "List<Patient> findAllPatients();", "public interface CarRepository extends JpaRepository<Car, Integer> {\n\n List<Car> findByUser(User user);\n List<Car> findByUserNot(User user);\n}", "@SuppressWarnings(\"unused\")\npublic interface PhotoRepository extends JpaRepository<Photo,Long> {\n\n @Query(\"select photo from Photo photo where photo.user.login = ?#{principal.username}\")\n List<Photo> findByUserIsCurrentUser();\n\n @Query(\"select photo from Photo photo\" +\n \" where photo.points > 2.9 AND photo.user.userExt.city = :city \" +\n \"ORDER BY photo.time desc \")\n List<Photo> findUserExtPopularGreaterThan(@Param(\"city\")String city);\n\n @Query(\"select photo from Photo photo\" +\n \" where :user member of photo.user.followedUsers \" +\n \"ORDER BY photo.time desc \")\n List<Photo> findUserExtFollowing(@Param(\"followedUsers\")String followedUsers);\n}", "@Repository\npublic interface UserCategoryDao extends JpaRepository<UserCategory, Long> {\n\n UserCategory findByUserIdAndCategory(long userId, String category);\n\n List<UserCategory> findByUserId(long userId);\n\n List<UserCategory> findByUserIdOrderBySortAsc(long userId);\n\n}", "List<UsersDTO> findAll();" ]
[ "0.6407367", "0.64039314", "0.64039314", "0.64039314", "0.64039314", "0.6349433", "0.63472104", "0.6289929", "0.6285712", "0.623977", "0.6225435", "0.6219923", "0.620961", "0.6199591", "0.61874926", "0.61870235", "0.61869794", "0.61869794", "0.61759293", "0.61694103", "0.61522967", "0.6137361", "0.6129068", "0.61096126", "0.60971", "0.60715735", "0.6060685", "0.6014661", "0.6009619", "0.6006588", "0.6003222", "0.59963226", "0.5981249", "0.5978862", "0.59748596", "0.59666574", "0.59567976", "0.59555477", "0.59495527", "0.5946945", "0.5945933", "0.5940952", "0.5940952", "0.5940952", "0.5940121", "0.592933", "0.59290624", "0.59286445", "0.5926781", "0.5925987", "0.59241277", "0.59146005", "0.5911083", "0.5909224", "0.5899953", "0.5895859", "0.5895039", "0.58881754", "0.58868957", "0.58834326", "0.58788556", "0.58745164", "0.5864516", "0.5860595", "0.5860112", "0.5857375", "0.58535457", "0.5852611", "0.5847981", "0.5847425", "0.5843446", "0.58332497", "0.5832551", "0.58287644", "0.58253264", "0.58250993", "0.5824438", "0.58210313", "0.5820681", "0.5816637", "0.5816637", "0.5816637", "0.5816366", "0.58163637", "0.5816281", "0.58158225", "0.58149236", "0.5814848", "0.5809549", "0.58085996", "0.58034724", "0.57988536", "0.57988536", "0.57988536", "0.57973635", "0.5795878", "0.57949275", "0.57939005", "0.57931954", "0.5792571", "0.57900214" ]
0.0
-1
this.userRepository.search(QueryBuilders.rangeQuery("age").gte(19).lte(22)).forEach(System.out::println); Page userPage = this.userRepository.search(QueryBuilders.rangeQuery("age").gte(19).lte(22), PageRequest.of(1, 2)); System.out.println(userPage.getTotalPages()); System.out.println(userPage.getTotalElements()); userPage.getContent().forEach(System.out::println);
@Test public void testPage(){ NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); nativeSearchQueryBuilder.withQuery(QueryBuilders.matchQuery("name","冰冰").operator(Operator.AND)); nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort("age").order(SortOrder.DESC)); nativeSearchQueryBuilder.withPageable(PageRequest.of(0,2)); nativeSearchQueryBuilder.withHighlightBuilder(new HighlightBuilder().field("name").preTags("<em>").postTags("</em>")); nativeSearchQueryBuilder.addAggregation(AggregationBuilders.terms("passwordAgg").field("password")); AggregatedPage<User> search = (AggregatedPage)this.userRepository.search(nativeSearchQueryBuilder.build()); System.out.println(search.getTotalElements()); System.out.println(search.getTotalPages()); search.getContent().forEach(System.out::println); ParsedStringTerms stringTerms = (ParsedStringTerms)search.getAggregation("passwordAgg"); stringTerms.getBuckets().forEach(bucket -> { System.out.println(bucket.getKeyAsString()); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Page<ServiceUserDTO> search(String query, Pageable pageable);", "public Page<User> findAll(Pageable pageable);", "Page<Person> findAll(Pageable pageable);", "Page<ParaUserDTO> search(String query, Pageable pageable);", "Page<T> search(Pageable pageable, QueryBuilder query);", "Page<User> getAll(Pageable pageable, String search);", "Page<Livre> findAll(Pageable pageable);", "Page<Research> findAll(Pageable pageable);", "public interface ArticleRepository extends ElasticsearchRepository<Article, String> {\n\n Page<Article> findByTitle(String title, Pageable pageable);\n\n @Query(\"{\\\"bool\\\": {\\\"must\\\": [{\\\"match\\\": {\\\"title\\\": \\\"?0\\\"}}]}}\")\n Page<Article> findByAuthorsNameUsingCustomQuery(String title, Pageable pageable);\n}", "@Test\n public void queryByPage() {\n List<Album> albums = albumDao.SelectByPage(1, 5);\n for (Album album : albums) {\n System.out.println(album);\n }\n }", "Page<T> findAll(Pageable pageable);", "SearchResponse search(Pageable pageable, QueryBuilder query, Collection<AggregationBuilder> aggregations);", "@Test\n\tpublic void testQueryPage() {\n\n\t}", "Page<ServiceUserDTO> findAll(Pageable pageable);", "Page<Visited> findAll(Pageable pageable);", "Page<Employee> findAll(Pageable page);", "Page<TypeBonDTO> search(String query, Pageable pageable);", "public interface BlogRepository extends ElasticsearchRepository<Blog, String>{\n\n /**\n * 分页查询博客(去重)\n * @param title\n * @param tag\n * @param content\n * @return\n */\n Page<Blog> findDistinctBlogByTitleContainingOrTagContainingOrContentContaining(String title, String tag, String content, Pageable pageable);\n\n}", "Page<UserPortfolioDTO> search(String query, Pageable pageable);", "public Page<LearningType> findAll(Pageable pageable);", "Page<PeopleDTO> findAll(Pageable pageable);", "public void testQueryDateRange() throws Exception {\n //db.expense.find({ date: { $gte:ISODate(\"2018-02-19T14:00:00Z\"), $lt: ISODate(\"2018-03-19T20:00:00Z\") } })\n /*BasicQuery query = new BasicQuery(\"{ date: { $gte:ISODate(\\\"2018-02-19T14:00:00Z\\\"), $lt: ISODate(\\\"2018-02-27T20:00:00Z\\\") } }\");\n List<Expense> expenses = mongoOperation.find(query, Expense.class);\n\n for(Expense e: expenses){\n System.out.println(e.toString());\n }*/\n // query.addCriteria(Criteria.where(\"age\").lt(50).gt(20));\n //List<User> users = mongoTemplate.find(query,User.class);\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n Date d1 = sdf.parse(\"01/01/2018\");\n Date d2 = sdf.parse(\"01/02/2018\");\n\n\n List<Expense> expenses = expenseRepository.findByDateBetween(d1, d2);\n\n for (Expense e : expenses) {\n System.out.println(e.toString());\n }\n\n }", "@Query(\"name = ? and age = ?\")\n List<PersonDocument> findByNameAndAge(String name, Integer age);", "Page<T> search(Pageable pageable, String query);", "public Result findByPage(Page page,String hql, Object... params) ;", "public Page<AccountDTO> findAllByGender(String gender, Pageable pageable);", "Page<Student> findAll(Pageable pageable);", "Page<AccountDTO> findAllByBirthday(LocalDate birthday, Pageable pageable);", "public interface UserRepository extends CrudRepository<User, Long> {\n Page<User> findAll(Pageable pageable);\n}", "Page<ParaUserDTO> findAll(Pageable pageable);", "Page<BaacDTO> findAll(Pageable pageable);", "public Page<AccountDTO> findAllByEmail(String gender, Pageable pageable);", "public interface CustomerRepository extends JpaRepository<Customer,Long> {\n\n @Query(\"select customer from Customer customer where customer.user.login = ?#{principal.username}\")\n List<Customer> findByUserIsCurrentUser();\n \n @Query(\"select customer from Customer customer where customer.user.login = ?#{principal.username}\")\n Page<Customer> findByUserIsCurrentUser(Pageable page);\n\n}", "@Query(value = \"SELECT user FROM User user WHERE user.active = :active\")\n Page<User> findByUserIsActive(Pageable pageable, @Param(\"active\") Integer active);", "public interface PagingRepository<E> extends CRUDRepository<E> {\n\n /**\n * Returns items on page\n *\n * @param page Page\n * @param params For custom implementations\n * @return Items on page\n */\n List<E> page(Page page, Long...params);\n\n /**\n * Returns number of pages by size\n *\n * @param pageSize Size of page\n * @param params For custom implementations\n * @return Number of pages\n */\n Long pageCount(Long pageSize, Long...params);\n\n}", "Page<Expert> findAll(Pageable pageable);", "@Test\n public void test2POJOWriteWithPojoPage() {\n PojoRepository<Artifact, Long> products = client.newPojoRepository(Artifact.class, Long.class);\n // Load more than 110 objects into different collections\n products.deleteAll();\n Long[] ids = new Long[111];\n int j = 0;\n for (int i = 222; i < 333; i++) {\n ids[j] = (long) i;\n j++;\n if (i % 2 == 0) {\n products.write(this.getArtifact(i), \"even\", \"numbers\");\n }\n else {\n products.write(this.getArtifact(i), \"odd\", \"numbers\");\n }\n }\n assertEquals(\"Total number of object recods\", 111, products.count(\"numbers\"));\n assertEquals(\"Collection even count\", 56, products.count(\"even\"));\n assertEquals(\"Collection odd count\", 55, products.count(\"odd\"));\n\n System.out.println(\"Default Page length setting on docMgr :\" + products.getPageLength());\n assertEquals(\"Default setting for page length\", 50, products.getPageLength());\n products.setPageLength(100);\n assertEquals(\"explicit setting for page length\", 100, products.getPageLength());\n PojoPage<Artifact> p = products.search(1, \"numbers\");\n // test for page methods\n assertEquals(\"Number of records\", 100, p.size());\n // System.out.println(\"Page size\"+p.size());\n assertEquals(\"Starting record in first page \", 1, p.getStart());\n // System.out.println(\"Starting record in first page \"+p.getStart());\n\n assertEquals(\"Total number of estimated results:\", 111, p.getTotalSize());\n // System.out.println(\"Total number of estimated results:\"+p.getTotalSize());\n assertEquals(\"Total number of estimated pages :\", 2, p.getTotalPages());\n // System.out.println(\"Total number of estimated pages :\"+p.getTotalPages());\n System.out.println(\"is this firstPage or LastPage:\" + p.isFirstPage() + \" \" + p.isLastPage() + \"has previous page\" + p.hasPreviousPage());\n assertTrue(\"Is this First page :\", p.isFirstPage());// this is bug\n assertFalse(\"Is this Last page :\", p.isLastPage());\n assertTrue(\"Is this First page has content:\", p.hasContent());\n // Need the Issue #75 to be fixed\n assertFalse(\"Is first page has previous page ?\", p.hasPreviousPage());\n long pageNo = 1, count = 0;\n do {\n count = 0;\n p = products.search(pageNo, \"numbers\");\n if (pageNo > 1) {\n assertFalse(\"Is this first Page\", p.isFirstPage());\n assertTrue(\"Is page has previous page ?\", p.hasPreviousPage());\n }\n Iterator<Artifact> itr = p.iterator();\n while (itr.hasNext()) {\n this.validateArtifact(p.iterator().next());\n count++;\n }\n // assertEquals(\"document count\", p.size(),count);\n System.out.println(\"Is this Last page :\" + p.hasContent() + p.isLastPage() + p.getPageNumber());\n pageNo = pageNo + p.getPageSize();\n } while (pageNo < p.getTotalSize());\n assertTrue(\"Page has previous page ?\", p.hasPreviousPage());\n assertEquals(\"page size\", 11, p.size());\n assertEquals(\"document count\", 111, p.getTotalSize());\n assertTrue(\"Page has any records ?\", p.hasContent());\n\n products.deleteAll();\n // see any document exists\n for (long i = 112; i < 222; i++) {\n assertFalse(\"Product id \" + i + \" exists ?\", products.exists(i));\n }\n // see if it complains when there are no records\n }", "@Test\n @Tag(\"CREATE\")\n @Tag(\"RESOURCE\")\n @DisplayName(\"Test HQL Query for Pagination with Address 02\")\n public void testHQLQueryForPaginationWithAddress02()\n {\n System.out.println(\"Programme Start\");\n long startTime = System.nanoTime();\n\n List<SBAddress02> addresses = null;\n\n try (Session session = HibernateUtil.getSessionFactory().openSession()) {\n Transaction transaction = null;\n try {\n transaction = session.beginTransaction();\n\n Query query = session.createQuery(\"from SBAddress02 order by address02Street asc\");\n query.setFirstResult(5);\n query.setMaxResults(10);\n\n addresses = query.list();\n\n transaction.commit();\n\n addresses.forEach(address -> System.out.println(\"Added Address : \" + address.getAddress02Street()));\n } catch (Exception e) {\n if (transaction != null) {\n transaction.rollback();\n }\n LOGGER.error(ExceptionUtils.getFullStackTrace(e));\n e.printStackTrace();\n }\n\n } catch (Throwable throwable) {\n LOGGER.error(ExceptionUtils.getFullStackTrace(throwable));\n throwable.printStackTrace();\n }\n\n System.out.println(\"Address : \" + addresses.size());\n\n long endTime = System.nanoTime();\n ELAPSED_TIME = endTime - startTime;\n System.out.println(\"Programme End\");\n\n }", "public interface DoctorSearchRepository extends ElasticsearchRepository<Doctor, Long> {\n\t @Query(\"{\\\"bool\\\" : {\\\"must\\\" : [{\\\"match\\\" : {\\\"doctorSessionInfos.sessionName\\\" : \\\"?0\\\"}}]}}\")\n\t Set<DoctorSessionInfo> findBySpec(String sessionName);\n\n\t/* @Query(\"{\\\"bool\\\": {\\\"must\\\": [{\\\"match\\\": {\\\"authors.name\\\": \\\"?0\\\"}}]}}\")\n\t Set<Doctor> findBySpeciay(String name, Pageable pageable);*/\n\n}", "Page<AccountDTO> findAllAccount(Pageable pageable);", "Page<RegionDTO> findAll(Pageable pageable);", "Page<Accessprofile> listAllByPage(Pageable pageable);", "Page<ConsultationInfoDTO> search(String query, Pageable pageable);", "Page<Product> findAll(Pageable pageable);", "SearchResponse search(Pageable pageable, QueryBuilder query, AggregationBuilder aggregation);", "@Test\n public void testSearchUsersByQueryPaging() throws Exception {\n TestSubscriber testSubscriber = new TestSubscriber();\n Observable<ApiSearchUser> searchRepositoryObservable = githubApi.getSearchUser(testedString, 0);\n searchRepositoryObservable.subscribe(testSubscriber);\n testSubscriber.awaitTerminalEvent();\n ApiSearchUser apiSearchUser = (ApiSearchUser) testSubscriber.getOnNextEvents().get(0);\n assertTrue(apiSearchUser.getItems().size() > 0);\n }", "List<E> findAll(int page, int size);", "@Override\r\n\tpublic List<TUsers> queryByPage(int page, QueryUser query) {\n\t\t\r\n\t\tint start=(page-1)*contests.PAGECONT+1;\r\n\t\tint end=page*contests.PAGECONT;\r\n\t\tquery.setStart(start);\r\n\t\tquery.setEnd(end);\r\n\t\treturn dao.queryByPage(query);\r\n\t}", "Integer countByExamplePages(T entity, Integer limit);", "public PageList<User> getUserPageList(User user, int pageSize, int pageNum) throws DataAccessException;", "Page<EtatOperation> findAll(Pageable pageable);", "Page<Catalog> findAll(Pageable pageable);", "Page<CounselorBiographyTempEntity> findAll(Integer page);", "Page<UserPortfolioDTO> findAll(Pageable pageable);", "@Test\n public void test1(){\n PageInfo<User> page = iUserService.selectWithPage(new User(),new Page(1,10,null));\n List<User> list = page.getList();\n\n System.out.println(list.toString());\n\n\n List<User> user = new ArrayList<User>();\n User user1 = new User();\n user1.setId(1);\n user.add(user1);\n System.out.println(user.toString());\n }", "public interface PagedAccountRepository {\n Page<Account> findAll(Pageable pageable);\n}", "@Repository\npublic interface TrafficMessageRepository extends MongoRepository<TrafficMessage, String> {\n //@Query(value = \"{}\", fields = \"{}\")\n //public List<TrafficMessage> findTrafficMessages(Pageable pageable);\n}", "@Test\n\tpublic void shouldReturnAllPagedDocumentsFilteredByDocumentNumberRange()\n\t{\n\t\tfinal SearchPageData<B2BDocumentModel> result = pagedB2BDocumentDao\n\t\t\t\t.getAllPagedDocuments(createPageableData(0, 15, StringUtils.EMPTY), Collections\n\t\t\t\t\t\t.singletonList(AccountSummaryAddonUtils.createRangeCriteriaObject(StringUtils.EMPTY, StringUtils.EMPTY,\n\t\t\t\t\t\t\t\tStringUtils.EMPTY, FILTER_BY_DOCUMENT_NUMBER)));\n\n\t\tTestCase.assertEquals(15, result.getResults().size());\n\t}", "@Test\n public void pageSizeTest() {\n // TODO: test pageSize\n }", "Page<UpWrongAnswer> findAll(Pageable pageable);", "List<E> page(Page page, Long...params);", "void findWithPagination(Pagination<Activity, Assignment> pagination);", "Page<TypeBonDTO> findAll(Pageable pageable);", "Page<ChatDTO> search(String query, Pageable pageable);", "private Page<ElasticCandidate> search(CandidateSearchModel model, Pageable pageable){\n Integer experienceDuration = model.getSkillPlaceholder()\n .getExperienceDuration();\n String title = model.getSkillPlaceholder()\n .getSkill()\n .getTitle();\n RangeModel<Integer> rangeExperience = model.getSkillExperienceRange();\n Integer experienceUpperLimit = rangeExperience.getUpperLimit();\n Integer experienceLowerLimit = rangeExperience.getLowerLimit();\n\n // Prepares location\n String location = model.getLocation();\n\n // Prepare hourly rate\n Integer hourlyRate = model.getHourlyRate();\n RangeModel<Integer> rangeHourlyRate = model.getHourlyRateRange();\n Integer hourlyRateUpperLimit = rangeHourlyRate.getUpperLimit();\n Integer hourlyRateLowerLimit = rangeHourlyRate.getLowerLimit();\n\n // Prepares certifications\n Set<String> certifications = model.getCertifications();\n if (certifications != null && certifications.size() != 0) {\n Iterator iterator = certifications.iterator();\n String[] certificationsArray = new String[certifications.size()];\n for (int i = 0; i < certificationsArray.length; i++) {\n certificationsArray[i] = (String) iterator.next();\n }\n }\n\n // Prepares Starting date postponed !!\n// Long startingDate = model.getStartingDate().getTime();\n// Long startingDateUpperLimit = model.getStartingDateUpperRange().getTime();\n\n // Prepares time period\n String timePeriod = model.getTimePeriod();\n // endregion\n\n // region Build query\n SearchQuery searchQuery;\n\n\n if (certifications != null && certifications.size() != 0)\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod))\n .must(queryForCertifications(certifications)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n .withFilter(queryForCertifications(certifications))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n else\n\n\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n // endregion\n\n // region Test\n Page<ElasticCandidate> queryForExactValueSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueSkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForExactValueHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzySkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzySkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzyHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzyHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForLocation = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForLocation(location))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForTimePeriod = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForTimePeriod(timePeriod))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForCertifications = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForCertifications(certifications))\n .build(), ElasticCandidate.class);\n // endregion\n\n\n Page<ElasticCandidate> sampleEntities = elasticsearchTemplate.queryForPage(searchQuery,\n ElasticCandidate.class);\n return sampleEntities;\n }", "@Query(\n \"Select t FROM Ticket t WHERE t.user.id = :userId \"\n + \"AND (LOWER(t.title) LIKE LOWER(CONCAT('%', :searchTerm, '%')) \"\n + \"OR LOWER(t.id) LIKE LOWER(CONCAT('%', :searchTerm, '%')) \"\n + \"OR LOWER(t.client.name) LIKE LOWER(CONCAT('%', :searchTerm, '%')) \"\n + \"OR LOWER(t.user.name) LIKE LOWER(CONCAT('%', :searchTerm, '%')) \"\n + \"OR LOWER(t.category.name) LIKE LOWER(CONCAT('%', :searchTerm, '%')) \"\n + \"OR DATE_FORMAT(t.lastInteration, '%d/%m/%Y') LIKE CONCAT('%', :searchTerm, '%')) \"\n )\n public Page<Ticket> searchType1(@Param(\"userId\") Long userId,@Param(\"searchTerm\") String searchTerm,Pageable pageable);", "List<Product>findAllBy(Pageable pageable);", "@Test\n\tpublic void testPaginate() throws Exception {\n\t}", "private void executeQuery1(PersistenceManager pm) {\n Query query = pm.newQuery(Book.class, \"pages > 300\");\n Collection results = (Collection)query.execute();\n printCollection(\"Books with more than 300 pages:\", results.iterator());\n query.closeAll();\n }", "Page<BalanceDTO> findAll(Pageable pageable);", "Page<BannerInfoDTO> findAll(Pageable pageable);", "@Test\n public void testSearchUsersByQueryPagingNextPage() throws Exception {\n TestSubscriber testSubscriber = new TestSubscriber();\n Observable<ApiSearchUser> searchRepositoryObservable = githubApi.getSearchUser(testedString, 1);\n searchRepositoryObservable.subscribe(testSubscriber);\n testSubscriber.awaitTerminalEvent();\n ApiSearchUser apiSearchUser = (ApiSearchUser) testSubscriber.getOnNextEvents().get(0);\n assertTrue(apiSearchUser.getItems().size() > 0);\n }", "Page<TenantSuperAdminDTO> findAll(Pageable pageable);", "public Page<HeritageRegionName> findAll(Pageable pageable);", "@SuppressWarnings(\"unused\")\n@Repository\npublic interface ActivityRepository extends JpaRepository<Activity,Long> {\n\n @Query(\"select activity from Activity activity where activity.user.login = ?#{principal.username}\")\n Page<Activity> findByUserIsCurrentUser(Pageable pageable)\n ;\n @Query(\"select activity from Activity activity where activity.user.login = ?#{principal.username}\")\n List<Activity> findByUserIsCurrentUserDateBetween(LocalDate fromDate, LocalDate toDate);\n\n //List<Activity> findAllDateBetween(LocalDate fromDate, LocalDate toDate);\n}", "public interface UserMongoRepository extends MongoRepository<User, String> {\n // Page<User> findByUserName(String userName, Pageable pageable);\n User findByUserName(String userName);\n}", "Page<DashboardDTO> findAll(Pageable pageable);", "Page<Accessprofile> listWithCriterasByPage(List<SearchCriteria> searchCriterias, Pageable pageable);", "public abstract Page<CustomerInfo> findAll(GlobalSearch globalSearch, Pageable pageable);", "@Test\n\tpublic void testGetAllElementsUsingPagination() throws Exception {\n\t\tint size = 3;\n\t\tIntStream.range(1, size + 1).mapToObj(i->new ElementEntity(\"demo\" + i))\n\t\t\t\t.forEach(this.elementDao::create);\n\n\t\t// WHEN I GET elements of size 10 and page 0\n\t\tElementBoundary[] response = this.restTemplate.getForObject(this.baseUrl + \"?page={page}&size={size}\",\n\t\t\t\tElementBoundary[].class, this.userEntity.getUserSmartspace(),\n\t\t\t\tthis.userEntity.getUserEmail(), 0, 10);\n\n\t\t// THEN I receive 3 elements\n\t\tassertThat(response).hasSize(size);\n\t}", "Page<PaperDTO> findAll(Pageable pageable);", "Page<Job> findAll(Pageable pageable);", "Page<LoginHistoryEntity> findAll(Integer page);", "@Repository\npublic interface UserMapper extends BaseMapper<User> {\n List<User> findAllStudentPage(Page<User> page);\n}", "Page<NoteDTO> search(String query, Pageable pageable);", "Page<BalanceSheetDTO> findAll(Pageable pageable);", "Page<UserPortfolioDTO> findGender(GenderEnum gender, Pageable pageable);", "@Test\n @Tag(\"CREATE\")\n @Tag(\"RESOURCE\")\n @DisplayName(\"Test HQL Query for Multiple Select and Pagination with Address 02\")\n public void testHQLQueryForMultipleSelectAndPaginationWithAddress02()\n {\n System.out.println(\"Programme Start\");\n long startTime = System.nanoTime();\n\n try (Session session = HibernateUtil.getSessionFactory().openSession()) {\n Transaction transaction = null;\n try {\n transaction = session.beginTransaction();\n\n Query query = session.createQuery(\n \"select address02Street, address02Zip from SBAddress02 order by address02Street asc\");\n query.setFirstResult(5);\n query.setMaxResults(10);\n\n List<Object[]> addressDetails = query.list();\n\n transaction.commit();\n\n addressDetails.forEach(address -> System.out.println(\"Added Address : \" + address[0]));\n\n System.out.println(addressDetails.size());\n } catch (Exception e) {\n if (transaction != null) {\n transaction.rollback();\n }\n LOGGER.error(ExceptionUtils.getFullStackTrace(e));\n e.printStackTrace();\n }\n\n } catch (Throwable throwable) {\n LOGGER.error(ExceptionUtils.getFullStackTrace(throwable));\n throwable.printStackTrace();\n }\n\n long endTime = System.nanoTime();\n ELAPSED_TIME = endTime - startTime;\n System.out.println(\"Programme End\");\n\n }", "Page<SpecimenStatusDTO> findAll(Pageable pageable);", "@Test\npublic void testCreateQueryForPageHql() throws Exception { \n//TODO: Test goes here... \n}", "public interface UserSearchRepository extends ElasticsearchRepository<User, Long> {\n}", "public List<AgtUser> findAllUserByPage(Map<String,Object> map);", "void findWithPagination(Pagination<Task, Project> pagination);", "Page<Goods> findAllByIsexamineAndIssale(Integer isexamine,Integer issale,Pageable pageable);", "Page<Student> findPaginated(int pageNo, int pageSize);", "@Test\r\n\tpublic void test_getAllEmployeesPage2() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(2))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\n\t}", "Page<ExamPackage> getPageByUsername(String username, int pageNo, int pageSize);", "public Page<CustomersListSearchConditionsDTO> findAll(Pageable pageable);", "public List<Register> testTimeQuery(){\n NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder();\n queryBuilder.withQuery(QueryBuilders.rangeQuery(\"order_time\").gt(\"2016-11-01T00:00:00.000Z\"));\n\n // 初始化分页参数\n int page =50;\n int size =3000;\n\n\n // 设置分页参数\n queryBuilder.withPageable(PageRequest.of(page, size));\n // 执行搜索,获取结果\n Page<OrderImes> Ot = this.orderImesRepository.search(queryBuilder.build());\n List<Register> Rt = new ArrayList<Register>();\n System.out.println(Ot.getTotalElements());\n // List<Page<Test>> Lt=new ArrayList<Page<Test> >();\n\n // Page<JtSelfRegisterDay> Jt = this.jtSelfRegisterDayRepository.search(queryBuilder.build());\n\n for (OrderImes O:Ot)\n {\n SearchQuery searchQuery1=new NativeSearchQueryBuilder().withQuery(QueryBuilders.matchQuery(\"meid\",O.getImes())).build();\n //System.out.println(J.getRow_id().getClass());\n List<Register> Te = elasticsearchTemplate.queryForList(searchQuery1, Register.class);\n //System.out.println(Te.size());\n for (int i = 0; i <Te.size() ; i++) {\n Rt.add(Te.get(i));\n }\n\n }\n System.out.println(Rt.size());\n\n\n return Rt;\n\n\n }", "Page<ItemPriceHistoryDTO> findAll(Pageable pageable);" ]
[ "0.67447", "0.67320234", "0.6712955", "0.66007483", "0.65606284", "0.6534981", "0.6473486", "0.63635594", "0.63630795", "0.63479286", "0.6325846", "0.631442", "0.6310567", "0.6290369", "0.62846553", "0.6270579", "0.6269879", "0.62698734", "0.6269687", "0.62586635", "0.62549067", "0.6232496", "0.62172294", "0.6205319", "0.617118", "0.6161273", "0.6160426", "0.6149014", "0.61415505", "0.61214554", "0.6118682", "0.6110742", "0.61065704", "0.60945034", "0.60649747", "0.606376", "0.60529375", "0.6052851", "0.60206306", "0.6017346", "0.60154057", "0.6009683", "0.6006941", "0.59990245", "0.5980959", "0.5978764", "0.59787154", "0.59780884", "0.59748304", "0.5969019", "0.5968562", "0.5962938", "0.5962067", "0.5957776", "0.5957427", "0.594468", "0.59358287", "0.59295243", "0.59195197", "0.591499", "0.59143364", "0.5913023", "0.59121203", "0.590989", "0.59022605", "0.5899643", "0.589407", "0.588732", "0.5884492", "0.5860537", "0.58592826", "0.58575606", "0.58564085", "0.58509916", "0.5849039", "0.584638", "0.58454996", "0.5842935", "0.58400995", "0.5834412", "0.5834072", "0.5832331", "0.5818492", "0.58180153", "0.5816032", "0.5810083", "0.5809435", "0.57989967", "0.57969934", "0.57945794", "0.57937264", "0.578199", "0.57752246", "0.57683146", "0.5762055", "0.5760288", "0.5758935", "0.5755395", "0.5752849", "0.5750194" ]
0.739319
0
Provides the first found element of a certain type from a collection.
public static <T> T getByClass(Collection<?> collection, Class<T> clazz) { for (Object elem : collection) { if (clazz.isInstance(elem)) return (T) elem; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <T> T getSingleElement(Collection<T> collection) {\n\t\tif (collection.size() != 1)\n\t\t\tthrow new IndexOutOfBoundsException(String.format(\n\t\t\t\t\t\"Expected collection to contain a single element, but observed %d elements: %s\", collection.size(),\n\t\t\t\t\tcollection.toString()));\n\t\treturn collection.iterator().next();\n\t}", "public static <T> T getFirstOrNull(final Collection<T> collection) {\n\n if (isEmpty(collection)) {\n return null;\n }\n if (collection instanceof List) {\n return ((List<T>) collection).get(0);\n } else {\n return collection.iterator().next();\n }\n }", "public T first() throws EmptyCollectionException;", "public T first() throws EmptyCollectionException;", "public static <T> T getFirstNotNullValue(final Collection<T> collection) {\n\n if (isNotEmpty(collection)) {\n for (T element : collection) {\n if (element != null) {\n return element;\n }\n }\n }\n return null;\n }", "public static IDescribable getFirst( Collection<? extends IDescribable> results )\r\n\t{\r\n\t if(( results == null ) || ( results.size() == 0 ))\r\n\t return null;\r\n\t return results.iterator().next();\r\n\t}", "String first(String collection);", "public T getFirst();", "public T getFirst();", "public T first(int x)throws EmptyCollectionException, \n InvalidArgumentException;", "public E getFirst();", "public Object firstElement();", "public static <T> T getFirstElement(final Iterable<T> elements) {\n\t\treturn elements.iterator().next();\n\t}", "T find(String collection, Class<T> tclass);", "public Item getFirst();", "public static <T extends Annotation> Optional<T> findFirst(TypeName annoTypeName,\n Collection<T> coll) {\n String name = annoTypeName.name();\n return coll.stream()\n .filter(it -> it.typeName().name().equals(name))\n .findFirst();\n }", "public E getFirst() {\r\n\t\t// element checks to see if the list is empty\r\n\t\treturn element();\r\n\t}", "public T first() throws EmptyCollectionException{\n if (front == null){\n throw new EmptyCollectionException(\"list\");\n }\n return front.getElement();\n }", "public Optional<T> getFirstItem() {\n return getData().stream().findFirst();\n }", "public static <T extends Annotation> Optional<T> findFirst(String annoTypeName,\n Collection<T> coll) {\n assert (!annoTypeName.isBlank());\n return coll.stream()\n .filter(it -> it.typeName().name().equals(annoTypeName))\n .findFirst();\n }", "public E first() {\n if (isEmpty()) return null;\n return first.item;\n }", "@Nullable\n public T firstOrNull() {\n return Query.firstOrNull(iterable);\n }", "public E queryFirst() {\n ValueHolder<E> result = ValueHolder.of(null);\n limit(1);\n doIterate(r -> {\n result.set(r);\n return false;\n });\n\n return result.get();\n }", "T first();", "public static <T> T oneThatSatisfy(Collection<T> collection, Condition<T> condition) {\n \tfor(T element : collection) {\n \t\tif(condition.isTrueFor(element)) return element;\n \t}\n \tthrow new NoSuchElementException(\"No element holds given condition\");\n }", "public static <T extends Annotation> Optional<T> findFirst(Class<? extends java.lang.annotation.Annotation> annoType,\n Collection<T> coll) {\n return findFirst(annoType.getTypeName(), coll);\n }", "public E first() \n throws NoSuchElementException {\n if (entries != null && \n size > 0 ) {\n position = 0;\n E element = entries[position]; \n position++;\n return element;\n } else {\n throw new NoSuchElementException();\n }\n }", "public Object getFirst()\n {\n if (first == null)\n {\n throw new NoSuchElementException();\n }\n else\n return first.getValue();\n }", "public Object getFirst() throws ListException {\r\n\t\tif (size() >= 1) {\r\n\t\t\treturn get(1);\r\n\t\t} else {\r\n\t\t\tthrow new ListException(\"getFirst on an empty list\");\r\n\t\t}\r\n\t}", "public T getFirst() {\n return this.getHelper(this.indexCorrespondingToTheFirstElement).data;\n }", "public Optional<E> first() {\n return Optional.ofNullable(queryFirst());\n }", "public O first()\r\n {\r\n if (isEmpty()) return null; \r\n return first.getObject();\r\n }", "public T find(T element);", "Optional<X> elem();", "public static <T> T findAdapter(Collection<?> collection, Class<T> klass)\n {\n for(Object o : collection)\n {\n T t = adapt(o, klass);\n if(t != null)\n {\n return t;\n }\n }\n return null;\n }", "public abstract Collection<T> getMatches(T first);", "public U getFirst(){\r\n\t \tif (getArraySize()==0)\r\n\t \t\tthrow new IndexOutOfBoundsException();\r\n\t \t//calls get\r\n\t \treturn get(0);\r\n\t }", "T find(String collection, String hkey, Class<T> tclass);", "public static <C> C FIRST(LIST<C> L) {\n if ( isNull( L ) ) {\n return null;\n }\n if ( L.iter != null ) {\n if ( L.iter.hasNext() ) {\n return L.iter.next();\n } else {\n L.iter = null;\n return null;\n }\n }\n return L.list.getFirst();\n }", "public Type getTypeFirstRep() {\n\t\tif (getType().isEmpty()) {\n\t\t\treturn addType();\n\t\t}\n\t\treturn getType().get(0); \n\t}", "public Unit firstOf(UnitType... unitTypes)\n\t{\n\t\tfor (UnitType type : unitTypes)\n\t\t{\n\t\t\tUnits subSet = whereType(type);\n\t\t\tif (subSet.size() > 0)\n\t\t\t{\n\t\t\t\treturn subSet.first();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public E first() {\n\r\n if (head == null) {\r\n return null;\r\n } else {\r\n return head.getItem();\r\n }\r\n\r\n }", "@Override\r\n\tpublic E getFirst() {\n\t\treturn null;\r\n\t}", "public Object getFirst() {\r\n if (size == 0)\r\n throw new NoSuchElementException();\r\n\r\n return header.next.element;\r\n }", "public static <T> T random(Collection<T> coll)\r\n\t{\r\n\t\tif (coll.size() == 0) return null;\r\n\t\tif (coll.size() == 1) return coll.iterator().next();\r\n\t\tint index = MCore.random.nextInt(coll.size());\r\n\t\treturn new ArrayList<T>(coll).get(index);\r\n\t}", "public Unit first()\n\t{\n\t\tif (size() == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\treturn iterator().next();\n\t}", "public static <T> T getSingleElement(Iterable<T> iterable) {\n\t\tList<T> list = createList(iterable.iterator());\n\t\treturn getSingleElement(list);\n\t}", "public VectorItem<O> firstVectorItem()\r\n {\r\n if (isEmpty()) return null; \r\n return first;\r\n }", "@Override\n public E getFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n return dequeue[head];\n }", "public E getFirst() {\n return peek();\n }", "public E getFirst() {\n\t\t// Bitte fertig ausprogrammieren:\n\t\treturn null;\n\t}", "Optional<ValueType> getSingle(KeyType key);", "public E first() {\n if (this.isEmpty()) return null;\r\n return this.head.getElement();\r\n }", "@Override\r\n\t\tpublic final E getFirst() {\n\t\t\treturn null;\r\n\t\t}", "private <T extends Element> T getNearestElement(Element element, Class<T> klass) {\n List elements = element.nearestDescendants(klass);\n if (elements == null || elements.isEmpty()) {\n return null;\n }\n\n return (T) elements.get(0);\n }", "public E choose() throws JMLNoSuchElementException {\n if (the_list != null) {\n E entry = the_list.val;\n if (entry == null) {\n //@ assume containsNull;\n return null;\n } else {\n E o = entry ;\n //@ assume o instanceof Object;\n //@ assume \\typeof(o) <: elementType;\n return o;\n }\n } else {\n throw new JMLNoSuchElementException(\"Tried to .choose() \"\n + \"with JMLObjectSet empty\");\n }\n }", "public T peek() throws EmptyCollectionException;", "public T peek() throws EmptyCollectionException;", "StackType getFirstItem();", "public int getFirst();", "public E first() {\n if(isEmpty()){\n return null;\n }else{\n return header.getNext().getElement();\n }\n }", "public AnyType findMin( ) throws Exception\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tthrow new Exception( );\r\n\t\treturn findMin( root ).element;\r\n\t}", "protected final T findFirstByQuery(String query, String sort, Object... params) {\n Find find = this.collection.find(query, params);\n if ((sort != null) && !sort.isEmpty()) {\n find.sort(sort);\n }\n Iterable<T> as = find.limit(1).as(this.getEntityClass());\n Iterator<T> iterator = as.iterator();\n if (iterator.hasNext()) {\n return iterator.next();\n }\n return null;\n }", "public static <T> T getFirst(List<T> list) {\n\t\treturn list != null && !list.isEmpty() ? list.get(0) : null;\n\t}", "Position<T> first();", "public <T extends BaseEntity> T findOne(T entity) {\n T resultEntity = null;\n List<T> results = select(entity);\n if (results != null && !results.isEmpty()) {\n resultEntity = results.get(0);\n }\n return resultEntity;\n }", "public Object getFirst()\n {\n if(first == null){\n throw new NoSuchElementException();}\n \n \n \n return first.data;\n }", "public <T extends Object> T one() throws DBException {\n List values = list();\n return values.size() > 0 ? (T) values.get(0) : null;\n }", "private Item getItem(Collection<Item> c, Position p) {\n for (Item i : c) {\n if (i.position.equals(p))\n return i;\n }\n return null;\n }", "public T peek() throws NoSuchElementException\n\t{\n\t\tcheckEmpty();\n\t\treturn list.get(0);\n\t}", "public Object getFirst() {\n\t\tcurrent = start;\n\t\treturn start == null ? null : start.item;\n\t}", "public E first(){\n if (isEmpty()) return null;\n return arrayQueue[front];\n }", "public E getFirst() {\n\t\tif (mSize == 0)\n\t\t\tthrow new NoSuchElementException();\n\t\treturn mHead.next.data;\n\t}", "public AnyType findMin() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new UnderflowException();\r\n\t\treturn findMin(root).element;\r\n\t}", "Food getByType(String type);", "public AnyType findMin() {\n if (isEmpty())\n throw new UnderflowException();\n return root.element;\n }", "public <T extends NameClass> T getObject(T[] elementList, String name) {\r\n for (T singleElement : elementList) {\r\n if (singleElement.getName().equalsIgnoreCase(name)) {\r\n return singleElement;\r\n }\r\n }\r\n return null;\r\n }", "public E peekFirst();", "public E queryOne() {\n limit(2);\n List<E> result = queryList();\n if (result.size() != 1) {\n return null;\n } else {\n return result.get(0);\n }\n }", "public T getNext() {\n\n // Create a new item to return\n T nextElement = getInstance();\n\n // Check if there are any more items from the list\n if (cursor <= arrayLimit) {\n nextElement = collection.get(cursor);\n cursor++;\n } else {\n // There are no more items - set to null\n nextElement = null;\n }\n\n // Return the derived item (will be null if not found)\n return nextElement;\n }", "public T getFirst( ){\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new NoSuchElementException(\"ChainedArrays are empty\");\r\n\t\t//first node\r\n\t\tArrayNode<T> first = beginMarker.next;\r\n\t\ttry{\r\n\t\t\t//first elem\r\n\t\t\treturn first.getFirst();\r\n\t\t}catch( IndexOutOfBoundsException e){\r\n\t\t\tthrow new NoSuchElementException(\"ChainedArrays are empty\");\r\n\t\t}\r\n\t\t\r\n\t}", "public A getFirst() { return first; }", "public Optional<E> one() {\n return Optional.ofNullable(queryOne());\n }", "public E peek() {\n E item;\n try {\n item = element();\n } catch (NoSuchElementException e) {\n return null;\n }\n return item;\n }", "public E findMin() {\n // TODO: YOUR CODE HERE\n return getElement(1);\n }", "public AnyType findMin() {\n\t\treturn elementAt(findMin(root));\n\t}", "@Override\n\tpublic NewsCollection findOne(Integer id) {\n\t\treturn newsCollectionMapper.findOne(id);\n\t}", "public Object firstElement() {\n return _queue.firstElement();\n }", "public T first(String attr, Object value) throws SQLException {\n\t\t\n\t\tPreparedStatement stmt = statement(\"`\"+ attr + \"` = ? \",\"1\");\n\t\tstmt.setObject(1, value);\n\t\tResultSet rs = stmt.executeQuery();\n\t\tResultSetMetaData meta = rs.getMetaData();\n\t\tif(rs.first()) {\n\t\t\tT obj = null;\n\t\t\ttry {\n\t\t\t\tobj = cls().newInstance();\n\t\t\t\tobj.set_from_db(meta, rs);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn obj;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "private <T extends Number> T computeMin(final Collection<T> inputCollection) {\n\r\n\t\tT res = null;\r\n\r\n\t\tif (!inputCollection.isEmpty())\r\n\t\t\tfor (final T t : inputCollection)\r\n\t\t\t\tif (res == null || t.longValue() < res.longValue())\r\n\t\t\t\t\tres = t;\r\n\r\n\t\treturn res;\r\n\t}", "@Override\n default @NotNull Option<E> find(@NotNull Predicate<? super E> predicate) {\n return firstOption(predicate);\n }", "Object find(String name);", "public Object getFirstObject()\n {\n \tcurrentObject = firstObject;\n\n if (firstObject == null)\n \treturn null;\n else\n \treturn AL.get(0);\n }", "@Override\n public Tile getFirst() {\n return tiles.iterator().next();\n }", "public T removeFirst() throws EmptyCollectionException;", "public T findOne(String arg0) {\n\t\treturn null;\n\t}", "<E> ProcessOperation<E> firstColumn(Class<E> elementType);", "public Object getFirst() {\n if (first == null)\n return null;\n return first.getInfo();\n }", "public SeleniumQueryObject first() {\n\t\treturn FirstFunction.first(this, this.elements);\n\t}", "public Object peek() {return collection.get(collection.size() - 1);}" ]
[ "0.7060451", "0.69894755", "0.6974605", "0.6974605", "0.68447804", "0.6839118", "0.67445207", "0.6669001", "0.6669001", "0.6661769", "0.6591728", "0.6435567", "0.64312536", "0.6427635", "0.6414767", "0.63999224", "0.63546443", "0.63505137", "0.6299822", "0.62908727", "0.628739", "0.61590225", "0.6157144", "0.6103995", "0.60879546", "0.6043774", "0.5985629", "0.5974096", "0.5973338", "0.5971313", "0.59561676", "0.5942887", "0.59328896", "0.5926186", "0.5881487", "0.58461124", "0.58203524", "0.58175075", "0.58160406", "0.57988554", "0.576863", "0.5765205", "0.5742641", "0.5738073", "0.5718724", "0.57154715", "0.5713201", "0.5710009", "0.5694501", "0.5684711", "0.56694525", "0.56602234", "0.56581056", "0.56528836", "0.5644638", "0.56299454", "0.56230074", "0.56230074", "0.56192285", "0.5615713", "0.56069106", "0.56026167", "0.5594636", "0.5571871", "0.55705035", "0.5563705", "0.55553675", "0.55463123", "0.5537416", "0.5531765", "0.55204356", "0.5497111", "0.5493008", "0.54847777", "0.5482147", "0.5478437", "0.54725033", "0.5448423", "0.54469043", "0.5435319", "0.54345155", "0.54167074", "0.5410024", "0.54047644", "0.54036766", "0.5387689", "0.5385836", "0.53834873", "0.53755337", "0.5337301", "0.5335601", "0.5333107", "0.5332886", "0.5323444", "0.5323194", "0.53105736", "0.5309552", "0.5302531", "0.5302528", "0.5302469" ]
0.6774727
6
replace dot with comma since firebase does not allow dot
private String cleanEmailAddress(String email) { return email.replace(".", "-"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void replaceCommaToDot(String contentString)\n {\n char[] charArray = contentString.toCharArray();\n \n for(int i = 0; i < charArray.length; i++)\n {\n //if comma, then replace to dot.\n if(charArray[i] == ',')\n {\n charArray[i] = '.'; \n }\n } \n //reconvert to String.\n contentString = charArray.toString();\n }", "@Override public String toDot() {\r\n return value.toDot(); \r\n }", "abstract String toDot();", "@Override\n\t\t\tprotected String formatValue(String text) {\n\t\t\t\treturn text.substring(0, text.lastIndexOf('.'));\n\t\t\t}", "private String commaDelimited(String strs[]) {\n StringBuffer sb = new StringBuffer();\n if (strs.length > 0) {\n sb.append(Utils.encToURL(strs[0]));\n for (int i=1;i<strs.length;i++) sb.append(\",\" + Utils.encToURL(strs[i]));\n }\n return sb.toString();\n }", "private String removeContainsDot(String amount) {\n if (amount != null && !TextUtils.isEmpty(amount)) {\n if (amount.contains(\".\")) {\n String result = amount.substring(0, amount.indexOf(\".\"));\n return result;\n } else {\n return amount;\n }\n }\n return \"0\";\n }", "private static String removeDigitGroupSeparators(final String input)\n {\n final String output = input.trim();\n\n // Replace one occurrence only, otherwise we will generate an incorrect result\n if (output.contains(\",\"))\n {\n return output.replace(\",\", \"\");\n }\n else\n {\n return output.replace(\".\", \"\");\n }\n }", "public static String toDotDecimalSeparator(String str) {\r\n return str.replaceAll(\",(?=[0-9]+,)\", \"\").replaceAll(\",\", \".\");\r\n }", "public void prueba(){\r\n //Float f = Float.parseFloat(jtfValor.getText());\r\n String s = \"100.000,5\";\r\n \r\n String d = s.replace(\".\",\"\");\r\n // s.replaceAll(\",\", \".\");\r\n // s.trim();\r\n System.out.println(d);\r\n \r\n }", "public static String formatG(BigDecimal b) {\n\t\tString s = format(b);\n\t\tchar[] charArray = s.toCharArray();\n\t\tStringBuffer sb = new StringBuffer();\n\t\tint cnt = -1;\n\t\tif (!s.contains(\".\")) {\n\t\t\tcnt = 0;\n\t\t}\n\t\tfor (int i = charArray.length - 1; i > -1; i--) {\n\t\t\tchar c = charArray[i];\n\t\t\tsb.append(c);\n\t\t\tif ('.' == c) {\n\t\t\t\tcnt = 0;\n\t\t\t} else if (cnt >= 0) {\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tif (cnt == 3 && i != 0) {\n\t\t\t\tsb.append(\",\");\n\t\t\t\tcnt = 0;\n\t\t\t}\n\t\t}\n\t\treturn sb.reverse().toString();\n\t}", "public String check_after_decimal_point(double decimal) {\n String result = null;\n String[] after_point = String.valueOf(decimal).split(\"[:.]\");\n if (after_point[after_point.length - 1].equals(\"0\")) {\n result = after_point[0];\n } else {\n result = String.valueOf(decimal).replace(\".\", \",\");\n }\n return result;\n }", "private StringBuffer removeCommasAtEnd(StringBuffer sql) {\r\n int i=sql.length()-3;\r\n while(i>0 && (sql.charAt(i)==' ' || sql.charAt(i)==','))\r\n i--;\r\n sql = sql.replace(i+1,sql.length()-2,\" \");\r\n\r\n return sql;\r\n }", "private String convertListToCommaDelimitedString(List<String> list) {\n\n\t\tString result = \"\";\n\t\tif (list != null) {\n\t\t\tresult = StringUtils.arrayToCommaDelimitedString(list.toArray());\n\t\t}\n\t\treturn result;\n\n\t}", "public String sanitizeNoCommas(String amount) {\n return amount.replaceAll(\"[^\\\\d.]\", \"\");\n }", "private String getDepartmentString() {\n String[] departments = contact.getDepartment().split(\"\\\\$\");\n String result = \"\";\n for (String dept : departments)\n result += dept.replace('~', ',') + \"\\n\";\n return result;\n }", "private String formatCSV(String value){\r\n\t\treturn value.replaceAll(\"\\\"\",\"\\\"\\\"\");\r\n\t}", "private String filterDecimalString(String string) {\n return string\n .replaceAll(\"[^0-9.]\", \"\")\n .replaceFirst(\"\\\\.\", \"@\")\n .replaceAll(\"\\\\.\", \"\")\n .replaceFirst(\"@\", \".\");\n }", "private static String removeFormatForNumberStr(String str){\n String result = str;\n if(result != null){\n if(result.contains(\",\")){\n result = result.replace(\",\", \"\");\n }\n if(result.contains(\" \")){\n result = result.replace(\" \", \"\");\n }\n }\n return result;\n }", "@Override\n public void afterTextChanged(Editable s) {\n String temp = s.toString();\n int d = temp.indexOf(\".\");\n if (d < 0) {\n return;\n }\n if (temp.length() - d - 1 > 2) {\n s.delete(d + 3, d + 4);\n } else if (d == 0) {\n s.delete(d, d + 1);\n }\n\n }", "private static String explode(Dictionary dictionary) {\n Enumeration keys = dictionary.keys();\n StringBuffer result = new StringBuffer();\n while (keys.hasMoreElements()) {\n Object key = keys.nextElement();\n result.append(String.format(\"%s=%s\", key, dictionary.get(key)));\n if (keys.hasMoreElements()) {\n result.append(\", \");\n }\n }\n return result.toString();\n }", "private void doublequote( String[] valeurs) {\n\t\t// TODO Auto-generated method stub\n\t\tint i = -1;\n\t\ttry{\n\t\t\tfor(i = 0; i < valeurs.length; i++)\n\t\t\t\tvaleurs[i] = valeurs[i].replaceAll(\"'\", \"''\");\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"IMPOSSIBLE D'ACCEDER A VALEURS \" + i);\n\t\t}\n\t}", "private String escape(String token) {\n return token.replace(\",\" , \"\");\n }", "private static String explode(Dictionary<?, ?> dictionary) {\n Enumeration<?> keys = dictionary.keys();\n StringBuilder result = new StringBuilder();\n while (keys.hasMoreElements()) {\n Object key = keys.nextElement();\n result.append(String.format(\"%s=%s\", key, dictionary.get(key)));\n if (keys.hasMoreElements()) {\n result.append(\", \");\n }\n }\n return result.toString();\n }", "public static String formatCommaString(String text){\r\n\t\tString[] arr = text.split(\",\");\r\n\t\tString result=\"\";\r\n\t\tfor(String s: arr){\r\n\t\t\tif(!\"\".equalsIgnoreCase(s.trim())){\r\n\t\t\t\tresult+=s+\",\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(result.endsWith(\",\")){\r\n\t\t\tresult=result.substring(0,result.length()-1);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public String puncRemoved(String payment){\n String result = \"\";\n for(int i = 0; i < payment.length(); i++){\n if(payment.charAt(i) != ','){\n result = result + payment.charAt(i);\n }\n }\n return result;\n }", "private double parseAmount(String amount){\n return Double.parseDouble(amount.replace(\",\", \".\"));\n }", "private String formatPropertyName(String property) {\r\n property = property.replace( '/', '.' );\r\n property = property.replace( '@', '.' );\r\n return StringExtend.validateString( property, \".\" );\r\n }", "@Override\n public void afterTextChanged(Editable s) {\n if (s.length() > 4) {\n if (s.charAt(s.length() - 4) == '.') {\n s.delete(s.length() - 1, s.length());\n }\n }\n }", "@Override\n\tprotected void handleComma() {\n\t\tif (isInClearText()) {\n\t\t\tsaveToken();\n\t\t}\n\t}", "public String smartDot(String s) {\n\t\t\t \ts = s.substring(0, (s.length() - 1)) + \"_\";\n\t\t\t \ts = s.replace(\"._\", \"s.\");\n\t s = s.replace(\" _\", \"s.\");\n\t s = s.replace(\"_\", \".\");\n\t return s;\n\t\t\t }", "public static String formatarBigDecimalParaStringComVirgula(BigDecimal valor) {\r\n\r\n\t\tString valorItemAnterior = \"\" + valor;\r\n\t\tvalorItemAnterior = valorItemAnterior.replace(\".\", \",\");\r\n\t\treturn valorItemAnterior;\r\n\t}", "private String collectionToString(Collection<String> terms) {\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"(\");\n\t\tint counter = 0;\n\t\tfor (String term : terms) {\n\t\t\t// Escape single quotes\n\t\t\tterm = term.replace(\"'\", \"''\");\n\t\t\tbuilder.append(\"'\" + term + \"'\");\n\t\t\tif (counter < terms.size() - 1) {\n\t\t\t\tbuilder.append(\",\");\n\t\t\t}\n\t\t\tcounter++;\n\t\t}\n\t\tbuilder.append(\")\");\n\t\treturn builder.toString();\n\t}", "public void numbersToString(Context ctx){\n\t\t\tboolean first = true;\t\t\t\t\t\t\t\t// if the first dont put a comma\n\t\t\tnamesText = \"\";\t\t\t\t\t\t\t\t\t\t// start of namestext\n\t\t\tfor(String n : numbers.keySet()){\t\t\t\t\t// for all the numbers\n\t\t\t\tString name = numberToString(n,ctx);\t\t\t// get the contact\n\t\t\t\tif(name == null)\t\t\t\t\t\t\t\t// if its null\n\t\t\t\t\tname = n;\t\t\t\t\t\t\t\t\t// name is number\n\t\t\t\tif(!first)\t\t\t\t\t\t\t\t\t\t// if it isnt the first\n\t\t\t\t\tnamesText = namesText + \",\" + name;\t\t\t// put a comma in between\n\t\t\t\telse{\t\t\t\t\t\t\t\t\t\t\t// if it is the fist\n\t\t\t\t\tnamesText = name;\t\t\t\t\t\t\t// put it with no comma\n\t\t\t\t\tfirst = false;\t\t\t\t\t\t\t\t// and say that its not the first\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private String escapeGraphiteMetricName(String metricName) {\n String metric = escape(metricName, \".\").replaceAll(\"%\", \"Percent\").replaceAll(\"-\", \".\").replaceAll(\"\\\\.+\", \".\").replaceAll(\"@\",\".\");\n\n if(metric.charAt(metric.length() -1 ) == '.'){\n metric = metric.substring(0, metric.length() - 1 );\n }\n if(metric.charAt(0) == '.'){\n metric = metric.substring(1, metric.length());\n }\n //String escapedMetric = (prefix + \".\" + metric).replaceAll(\"-\", \".\").replaceAll(\"\\\\.+\", \".\");\n return metric;\n }", "public static String formatLabel(String lbl){\n\t\t\n\t\t// XXX There is be a better way to do this...\n\t\tlbl = lbl.replaceAll(\",\", \"COMMA\");\n\t\tlbl = lbl.replaceAll(\"\\\\$\", \"DOL\");\n\t\tlbl = lbl.replaceAll(\"\\\\?\", \"QMARK\");\n\t\tlbl = lbl.replaceAll(\"\\\\!\", \"EXCMARK\");\n\t\tlbl = lbl.replaceAll(\"'\", \"\");\n\t\t\n\t\treturn lbl;\n\t}", "protected String createEmailString(Set emails) {\n StringBuffer commaDelimitedString = new StringBuffer();\n Iterator emailIterator = emails.iterator();\n \n while (emailIterator.hasNext()) {\n String mappedUser = (String) emailIterator.next();\n // append default suffix if need to\n if (mappedUser.indexOf(\"@\") < 0) {\n mappedUser += defaultSuffix;\n }\n \n commaDelimitedString.append(mappedUser);\n if (emailIterator.hasNext()) {\n commaDelimitedString.append(\",\");\n }\n } \n \n LOG.debug(\"List of emails: \" + commaDelimitedString);\n \n return commaDelimitedString.toString();\n }", "public static String getFormattedAmount(double amount) {\n DecimalFormat df = new DecimalFormat(\".00\");\n String formattedAmount = df.format(amount).replaceAll(\",\", \"\")\n .replaceAll(\"\\\\.\", \"\");\n return formattedAmount;\n }", "private String getCSVSeparator(){\n DecimalFormatSymbols s = new DecimalFormatSymbols(getLocale());\n if(s.getDecimalSeparator() == ',')\n return \";\";\n else\n return \",\";\n }", "public static String commas(Iterable<?> parts) {\n return join(\", \", parts);\n }", "private String collectionToString(Collection<String> terms) {\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"(\");\n\t\t\t\t\n\t\tint counter = 0;\n\t\tfor (String term : terms) {\n\t\t\tif (term != null) {\n\t\t\t\tif (counter > 0) {\n\t\t\t\t\tbuilder.append(\",\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Escape single quotes\n\t\t\t\tterm = term.replace(\"'\", \"''\");\n\t\t\t\tbuilder.append(\"'\" + term + \"'\");\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t\tbuilder.append(\")\");\n\t\treturn builder.toString();\n\t}", "static void initFieldWithDots(){\n // put values into the sField\n for(int i=0; i<ROWS; i++) {\n for(int j=0; j<COLS; j++) {\n sField[i][j] = \".\";\n }\n }\n }", "private String removeLastComma(String str) {\n if (str.length() > 0 && str.charAt(str.length()-1)==',') {\n str = str.substring(0, str.length()-1);\n }\n return str;\n }", "private String getValue(String s)\n {\n if(s.contains(\",\"))\n {\n return s.split(\",\")[0];\n }\n else\n {\n s = s.replaceAll(\"\\\\)\",\"\");\n return s;\n }\n }", "private static String escape(String s) {\n StringBuilder buf = new StringBuilder();\n int length = s.length();\n for (int i = 0; i < length; i++) {\n char c = s.charAt(i);\n if (c == ',') {\n buf.append(\"\\\\,\");\n } else {\n buf.append(c);\n }\n }\n\n return buf.toString();\n }", "private String moneyFormat(String money)\n {\n if(money.indexOf('.') == -1)\n {\n return \"$\" + money;\n }\n else\n {\n String dec = money.substring(money.indexOf('.')+1 , money.length());\n if(dec.length() == 1)\n {\n return \"$\" + money.substring(0, money.indexOf('.')+1) + dec + \"0\";\n }\n else\n {\n return \"$\" + money.substring(0, money.indexOf('.')+1) + dec.substring(0,2);\n }\n }\n }", "static String double2String (Double a){\n String s = \"\"+a;\n String[] arr = s.split(\"\\\\.\");\n if (arr[1].length()==1) s+=\"0\";\n return s;\n }", "public String[] camposDivididos(){\r\nString[] args=column().split(\"[,]\");\r\nreturn args;\r\n //return Arrays.toString(args);\r\n}", "public static String setToField(TreeSet<String> set) {\n StringBuilder sb = new StringBuilder();\n String sep = \"\";\n for (String s : set) {\n sb.append(sep).append(s);\n sep = \",\";\n }\n return sb.toString();\n }", "public static String commaDelimitedStringFromCollection(final Collection<?> set) {\n\t\treturn delimitedStringFromCollection(set, \",\");\n\t}", "public static String priceVNFormat(float price) {\r\n\t\tString prices = String.valueOf(new Float(price).intValue());\r\n\t\tString temp = \"\";\r\n\t\tint i;\r\n\t\tfor (i = prices.length(); i >= 3; i -= 3) {\r\n\t\t\ttemp = prices.substring(i - 3, i) + \".\" + temp;\r\n\r\n\t\t}\r\n\t\tif (i != 0) {\r\n\t\t\ttemp = prices.substring(0, i) + \".\" + temp;\r\n\r\n\t\t}\r\n\t\treturn temp.substring(0, temp.length() - 1);\r\n\t}", "public static String addDots(String s) {\n String out = \"\";\n for(Character c : s.toCharArray()) {\n out += addDot(c);\n }\n return out;\n }", "public static String getAll(){\n\t\tEntityType[] values = values();\n\t\tString readableString = \"\";\n\t\t\n\t\tfor (int i=0; i<values.length; i++){\n\t\t\treadableString += values[i].toString();\n\t\t\tif (i < values.length) {\n\t\t\t\treadableString += \", \";\n\t\t\t} else {\n\t\t\t\treadableString += \".\";\n\t\t\t}\n\t\t}\n\t\treturn readableString;\n\t}", "public static String ConvertExtension(String s,String dot) {\n\t\tif(!s.contains(dot)) {\n\t\t\treturn s+dot;\n\t\t}\n\t\treturn s;\n\t}", "String escapeFlatStorageColumn(String column);", "static double formatNumber(double d) {\n\tDecimalFormat df= new DecimalFormat(COMMA_SEPERATED);\n\tSystem.out.println(\"number \"+df.format(d));\n\treturn d;\n\t\n\t\n\t}", "public /*@ non_null @*/ StringBuffer toDot(){\n\n StringBuffer r = new StringBuffer();\n\n for(int i = 0; i <= sons.size() - 1; i++)\n\tr.append(getChildAt(i).toDot());\n \n return r;\n }", "public void ParcoursSuffixe() {\r\n if (getGauche() != null) {\r\n getGauche().ParcoursSuffixe();\r\n }\r\n if (getDroite() != null) {\r\n getDroite().ParcoursSuffixe();\r\n }\r\n System.out.print(getElement() + \",\");\r\n }", "public String delimitValue(String value){\n\t\tif(value==null)\n\t\t\tvalue=\"\";\n\t\tvalue = csvEscapeString(value);\n\t\treturn \"\\\"\" + value + \"\\\"\";\n\t}", "private String suffix(String name) {\n return hasComma(name) ? name.substring(name.indexOf(',')) : \"!\";\n }", "private static String fixLeadingBracketSugar( String dotNotaton ) {\n\n if ( dotNotaton == null || dotNotaton.length() == 0 ) {\n return \"\";\n }\n\n char prev = dotNotaton.charAt( 0 );\n StringBuilder sb = new StringBuilder();\n sb.append( prev );\n\n for ( int index = 1; index < dotNotaton.length(); index++ ) {\n char curr = dotNotaton.charAt( index );\n\n if ( curr == '[' && prev != '\\\\') {\n if ( prev == '@' || prev == '.' ) {\n // no need to add an extra '.'\n }\n else {\n sb.append( '.' );\n }\n }\n\n sb.append( curr );\n prev = curr;\n }\n\n return sb.toString();\n }", "public String getIndexesInDBFormat() {\n String servicesDBFormat = \"\";\n for(int i = 0; i < indexes.size(); i++) {\n //Add comma if not first:\n if(i != 0) {\n servicesDBFormat += \",\";\n }\n servicesDBFormat += indexes.get(i);\n }\n return servicesDBFormat;\n }", "public String sanitize(String amount) {\n return amount.replaceAll(\"[^\\\\d.,]\", \"\");\n }", "static public String nf(float num) {\n\t\tif (formatFloat==null) nfInitFormats();\n\t\tformatFloat.setMinimumIntegerDigits(1);\n\t\tformatFloat.setMaximumFractionDigits(3);\n\n\t\treturn formatFloat.format(num).replace(\",\", \".\");\n\t}", "@Override\n public void onClick(View v) {\n if(curr.isEmpty()){\n curr = \"0.\";\n dot_inserted=true;\n }\n /*check fr validation if dot_inserted is equals to false append \".\"*/\n /*Add it to the string*/\n if(dot_inserted == false){\n curr = curr + \".\";\n dot_inserted = true;\n }\n displayNum();\n }", "static String correctParagraph(String paragraph) {\n\n\t\t\tString newText = paragraph.replaceAll(\"\\\\s{2,}+\", \" \");\n\n\t\t\tnewText = newText.replaceAll(\"\\\\s+,\", \",\");\n\t\t\tnewText = newText.replaceAll(\"\\\\s+\\\\.\", \".\");\n\n\n\t\t\tString firstLetter = newText.substring(0, 1).toUpperCase();\n\t\t\tnewText = firstLetter + newText.substring(1);\n\n\t\t\tString[] sentences = newText.split(\"\\\\.\");\n\t\t\tfor(int i = 0; i < sentences.length; i++){\n\t\t\t\tString temp = sentences[i].trim();\n\t\t\t\tfirstLetter = temp.substring(0, 1).toUpperCase();\n\t\t\t\tsentences[i] = firstLetter + temp.substring(1);\n\t\t\t}\n\t\t\tStringBuilder newParagraph = new StringBuilder(sentences[0]);\n\t\t\tfor(int i = 1; i < sentences.length; i++){\n\t\t\t\tnewParagraph.append(\". \").append(sentences[i]);\n\t\t\t}\n\t\t\tnewText = newParagraph.append(\".\").toString();\n\n\t\t\treturn newText;\n\t\t}", "private String[] commaDelimited(String str) {\n StringTokenizer st = new StringTokenizer(str,\",\");\n String strs[] = new String[st.countTokens()];\n for (int i=0;i<strs.length;i++) strs[i] = Utils.decFmURL(st.nextToken());\n return strs;\n }", "public static String buildCommaSeperatedValues(ArrayList input) throws Exception{\r\n\t\tString retString = \"\";\r\n\t\tif(input != null){\r\n\t\tfor(int i=0; i<input.size(); i++){\r\n\t\t\tretString = retString + \",\" +input.get(i);\r\n\t\t}\r\n\t\tretString = retString.substring(1);\r\n\t\t}\r\n\t\treturn retString;\t\t\r\n\t}", "public void updateDiagnosisData() {\n\n SQLiteDatabase db = null;\n try {\n\n db = this.getWritableDatabase();\n\n db.execSQL(\"UPDATE diagnosis SET diagnosis_name = replace( diagnosis_name, ',', '-' ) \");\n db.execSQL(\"UPDATE diagnosis SET diagnosis_name = replace( diagnosis_name, '(', '( ' ) \");\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "private static String canonicalDecimalStr_X(BigDecimal d) {\n String x = d.toPlainString() ;\n\n // The part after the \".\"\n int dotIdx = x.indexOf('.') ;\n if ( dotIdx < 0 )\n // No DOT.\n return x+\".0\";\n\n // Has a DOT.\n int i = x.length() - 1 ;\n // dotIdx+1 to leave at least \".0\"\n while ((i > dotIdx + 1) && x.charAt(i) == '0')\n i-- ;\n if ( i < x.length() - 1 )\n // And trailing zeros.\n x = x.substring(0, i + 1) ;\n // Avoid replaceAll as it is expensive.\n // Leading zeros.\n int j = 0;\n for ( ; j < x.length() ; j++ ) {\n if ( x.charAt(j) != '0')\n break;\n }\n // At least one zero before dot.\n if ( j == dotIdx )\n j--;\n if ( j > 0 )\n x = x.substring(j, x.length());\n return x;\n }", "protected String convertModelOptionsToCommaDelimStr(List<ModelOption> modelOptions) {\n StringBuilder sb = new StringBuilder();\n int cnt = 0;\n for (ModelOption modelOption : modelOptions) {\n if (cnt > 0) {\n sb.append(\",\");\n }\n sb.append(modelOption.getModelId() + \"\");\n cnt++;\n }\n return sb.toString();\n }", "private static String asPropertyValue( List<?> values, boolean present ) {\n return values.isEmpty() ? String.valueOf( present ) : Joiner.on( \",\" ).join( values );\n }", "private final String stripDot(XMLElement e) {\n\t\tif ( e.getName().indexOf(\".\") == -1 ) {\n\t\t\treturn e.getName();\n\t\t}\n\t\tString value = e.getName().substring(e.getName().indexOf(\".\") + 1);\n\t\treturn value;\n\t}", "@Override\n\t\t\tpublic void onTextChanged(CharSequence s, int start, int before,\n\t\t\t\t\t\t\t\t\t int count) {\n\t\t\t\tif (priceView.getText().toString().indexOf(\".\") >= 0) {\n\t\t\t\t\tif (priceView.getText().toString().indexOf(\".\", priceView.getText().toString().indexOf(\".\") + 1) > 0) {\n\t\t\t\t\t\tLog.e(\"TAG\", \"onTextChanged: 已经输入\\\\\\\".\\\\\\\"不能重复输入\");\n\t\t\t\t\t\tpriceView.setText(priceView.getText().toString().substring(0, priceView.getText().toString().length() - 1));\n\t\t\t\t\t\tpriceView.setSelection(priceView.getText().toString().length());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private ArrayList<String> removeCommas(ArrayList<String> tokens) {\n ArrayList<String> newTokens = new ArrayList<>();\n for (String s : tokens) {\n if (s.contains(\",\")) {\n s = s.replace(\",\", \"\");\n }\n newTokens.add(s);\n }\n\n return newTokens;\n }", "public List<String> putDecimal(String p) {\n List<String> decCoordinates = new ArrayList<>();\n decCoordinates.add(p);\n\n //add a decimal point in between every index in s and add the value to the list of decimal coordinates\n for (int i = 1; i < p.length(); i++) {\n decCoordinates.add(p.substring(0, i) + \".\" + p.substring(i));\n }\n return decCoordinates;\n }", "private String locateToUsFormat(Location location) {\n\t\t\n\t\tString latitudeString = Location.convert(location.getLatitude(), Location.FORMAT_DEGREES);\n\t\tString longitudeString = Location.convert(location.getLongitude(), Location.FORMAT_DEGREES);\n\t\treturn latitudeString.replace(',', '.') + \",\" + longitudeString.replace(',', '.');\n\t}", "private static String format(String value) {\n String result = value;\n if (result.contains(\"\\\"\")) {\n result = result.replace(\"\\\"\", \"\\\"\\\"\");\n }\n return result;\n\n }", "private String regex() {\n final List<String> keys = new LinkedList<>();\n for (final String key : this.template.split(\"\\\\.\")) {\n if (key.equals(\"*\")) {\n keys.add(\"\\\\w+\");\n } else {\n keys.add(key);\n }\n }\n return String.join(\"\\\\.\", keys);\n }", "private String doubleChecker(String s) {\n\t\tString newS = \"\";\n\t\tfor(int i = 0; i < s.length(); i++) {\n\t\t\tif((s.charAt(i) > 47 && s.charAt(i) < 58) || s.charAt(i) == '.') {\n\t\t\t\tnewS += s.charAt(i);\n\t\t\t}\n\t\t}\n\t\treturn newS;\n\t}", "@Override String toDot() {\r\n switch ( operator ) {\r\n case EQUALS_PREFIX :\r\n case EQUALS :\r\n return left.toDot() + \" = \" + right.toDot();\r\n case NEQ :\r\n return left.toDot() + \" &ne; \" + right.toDot();\r\n case GE : \r\n return left.toDot() + \" &ge; \" + right.toDot();\r\n case GT : \r\n return left.toDot() + \" &gt; \" + right.toDot(); \r\n case LE :\r\n return left.toDot() + \" &le; \" + right.toDot();\r\n case LT : \r\n return left.toDot() + \" &lt; \" + right.toDot();\r\n }\r\n assert false:operator;\r\n return null;\r\n }", "protected static String getAmountFormat(String amount) {\n\t\tStringBuilder strBind = new StringBuilder(amount);\n\t\tstrBind.append(\".00\");\n\t\treturn strBind.toString();\n\t}", "public InvalidCommaException(String message){\n super(\"Content should be without comma. Your input: \" + message);\n }", "private static String toSQLFields(List<String> fields) {\n StringBuilder s = new StringBuilder();\n s.append(\"(\");\n for (String field : fields) {\n s.append(field);\n s.append(\",\");\n }\n s.replace(s.length() - 1, s.length(), \"\");\n s.append(\")\");\n return s.toString();\n }", "public static String removeLeadingDots(String dotPrefixedStr) {\n int pos = 0;\n while (pos < dotPrefixedStr.length() && dotPrefixedStr.charAt(pos) == Symbol.C_DOT) {\n pos++;\n }\n return pos < dotPrefixedStr.length() ? dotPrefixedStr.substring(pos) : Normal.EMPTY;\n }", "public static String formatAmountValue(String amount) {\r\n\t\tif(amount!=null){\r\n\t\t\t\t// Remove commas from the amount\r\n\t\t\t\tamount = amount.replaceAll(\",\", \"\");\r\n\t\t\t\t// Remove dollar sign from amount\r\n\t\t\t\tamount = amount.replaceAll(\"$\", \"\");\r\n\t\t\t\t\r\n\t\t\t\t// Remove double quotes\r\n\t\t\t\tamount = amount.replaceAll(\"\\\"\", \"\");\r\n\t\t\t\t// Remove single quotes\r\n\t\t\t\tamount = amount.replaceAll(\"\\'\", \"\");\r\n\t\t }\r\n\t\treturn amount;\r\n\t}", "private static String dottedExpressionToString(Expression e) {\n if (e instanceof Identifier) {\n return ((Identifier) e).getName();\n }\n if (e instanceof DotExpression) {\n String result = dottedExpressionToString(((DotExpression) e).getObject());\n if (!result.isEmpty()) {\n return result + \".\" + ((DotExpression) e).getField().getName();\n }\n }\n\n return \"\";\n }", "private String fixBattery(double voltage) {\n String volt = \"\" + voltage;\n String[] volts = volt.split(\"\\\\.\");\n String first = volts[0];\n String last = volts[1];\n if (volts[0].length() < 2) {\n first = \"0\" + volts[0];\n }\n if (volts[1].length() < 2) {\n last = volts[1] + \"0\";\n }\n return first + \".\" + last;\n }", "private String convertMapToString(Map<String,String> map){\r\n\t\tString str = \"\";\r\n\t\tSet<String> keySet = map.keySet();\r\n\t\tint count = 1;\r\n\t\tfor(String key : keySet){\r\n\t\t\tstr = str + key + \" \" + map.get(key);\r\n\t\t\tif(keySet.size() != count)\r\n\t\t\t\tstr = str + \",\";\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\treturn str;\r\n\t}", "private static String formStringFromList(List<Long> ids)\n {\n if (ids == null || ids.size() == 0)\n return null;\n\n StringBuilder idsBuffer = new StringBuilder();\n for (Long id : ids)\n {\n idsBuffer.append(id).append(\",\");\n }\n\n return idsBuffer.toString().substring(0, idsBuffer.length() - 1);\n }", "public String setDot() {\r\n\t\tif (getOperand().length() == Config.MAX_SIZE) {\r\n\t\t\treturn getOperand().toString();\r\n\t\t}\r\n\r\n\t\tif (getOperand().length() == 0) {\r\n\t\t\treturn \"0\";\r\n\t\t}\r\n\r\n\t\tif (getOperand().indexOf(\".\") == -1) {\r\n\t\t\tgetOperand().append(\".\");\r\n\t\t}\r\n\r\n\t\treturn getOperand().toString();\r\n\t}", "public static String replace(String number) {\n if (TextUtils.isEmpty(number)) { return \"0\"; }\n if (number.indexOf(\".\") > 0) {\n number = number.replaceAll(\"0+?$\", \"\"); //Remove the useless zero behind\n number = number.replaceAll(\"[.]$\", \"\"); //If the decimal point is all zero, remove the decimal point\n }\n return number;\n }", "public String csvEscapeString(String value){\n\t\tif(value==null)\n\t\t\tvalue=\"\";\n\t\treturn value.replaceAll(\"\\\"\", \"'\");\n\t}", "public String editBankName(String name) {\n return name.replaceFirst(\"[.][^.]+$\", \"\");\n }", "private String nanoFormat(String amount) {\n BigDecimal amountBigDecimal;\n try {\n amountBigDecimal = new BigDecimal(sanitizeNoCommas(amount));\n } catch(NumberFormatException e) {\n return amount;\n }\n\n if (amountBigDecimal.compareTo(new BigDecimal(0)) == 0) {\n return amount;\n } else {\n String decimal;\n String whole;\n String[] split = amount.split(\"\\\\.\");\n if (split.length > 1) {\n // keep decimal length at 10 total\n whole = split[0];\n decimal = split[1];\n decimal = decimal.substring(0, Math.min(decimal.length(), MAX_NANO_DISPLAY_LENGTH));\n\n // add commas to the whole amount\n if (whole.length() > 0) {\n DecimalFormat df = new DecimalFormat(\"#,###\");\n whole = df.format(new BigDecimal(sanitizeNoCommas(whole)));\n }\n\n amount = whole + \".\" + decimal;\n } else if (split.length == 1) {\n // no decimals yet, so just add commas\n DecimalFormat df = new DecimalFormat(\"#,###\");\n amount = df.format(new BigDecimal(sanitizeNoCommas(amount)));\n }\n return amount;\n }\n }", "public void set_post_comma(int val)\n {\n if(val <= this.raw_value.length)\n {\n this.post_comma_digits = val;\n }\n }", "private static ArrayList<String> convertToTags(String name) {\n String[] tags = name.split(\"@\");\n ArrayList<String> currTags = new ArrayList<>(Arrays.asList(tags));\n currTags.remove(0);\n String lastOne = currTags.remove(currTags.size() - 1);\n lastOne = lastOne.substring(0, lastOne.lastIndexOf(\".\"));\n currTags.add(lastOne);\n return currTags;\n }", "public static String unflatten(String s) {\n\t\tString unflattened=s.replace('_','.');\n\t\treturn unflattened;\n\t}", "public static String fixAuthor_nocomma(String in){\n \n\treturn fixAuthor(in);\n\t/*\n // Check if we have cached this particular name string before:\n Object old = Globals.nameCache.get(in);\n if (old != null)\n return (String)old;\n \n StringBuffer sb=new StringBuffer();\n String[] authors = in.split(\" and \");\n for(int i=0; i<authors.length; i++){\n //System.out.println(authors[i]);\n authors[i]=authors[i].trim();\n String[] t = authors[i].split(\" \");\n\tif (t.length > 1) {\n\t sb.append(t[t.length-1].trim());\n\t for (int cnt=0; cnt<=t.length-2; cnt++)\n\t\tsb.append(\" \" + t[cnt].trim());\n\t} else\n\t sb.append(t[0].trim());\n\tif(i==authors.length-1)\n\t sb.append(\".\");\n\telse\n\t sb.append(\" and \");\n\t\n }\n \n String fixed = sb.toString();\n \n // Add the fixed name string to the cache.\n Globals.nameCache.put(in, fixed);\n \n return fixed;*/\n }", "public static String implode(Collection<? extends Object> parts, String separator) {\r\n\t\t\tStringBuilder builder = new StringBuilder();\r\n\t\t\tfor (Object part : parts) {\r\n\t\t\t\tbuilder.append(separator + part);\r\n\t\t\t}\r\n\r\n\t\t\tif (builder.length() > separator.length()) {\r\n\t\t\t\treturn builder.substring(separator.length());\r\n\t\t\t}\r\n\r\n\t\t\treturn builder.toString();\r\n\t\t}", "static public String nf(float num, int lead, int decimal) {\n\t\tif (formatFloat==null) nfInitFormats();\n\t\tformatFloat.setMinimumIntegerDigits(lead);\n\t\tformatFloat.setMaximumFractionDigits(decimal);\n\t\tformatFloat.setMinimumFractionDigits(decimal);\n\n\t\treturn formatFloat.format(num).replace(\",\", \".\");\n\t}" ]
[ "0.6321642", "0.57459134", "0.5742308", "0.56202656", "0.5605517", "0.54564446", "0.54076016", "0.54030293", "0.53479946", "0.5344422", "0.53087926", "0.52375126", "0.52250916", "0.5199052", "0.5171083", "0.5142164", "0.51226753", "0.51131076", "0.5108256", "0.5084177", "0.5073587", "0.5058565", "0.5021612", "0.50132096", "0.5012151", "0.5011967", "0.49959046", "0.4994054", "0.49649656", "0.49293077", "0.49219137", "0.4916199", "0.49109536", "0.49028978", "0.48777956", "0.48515448", "0.48351753", "0.4833239", "0.48284099", "0.48202345", "0.4797791", "0.47975588", "0.47802004", "0.477228", "0.4771229", "0.47687975", "0.47673228", "0.47655532", "0.47575805", "0.47340006", "0.47184113", "0.47164494", "0.47093305", "0.46801654", "0.46796417", "0.46747643", "0.4672216", "0.46649897", "0.46628964", "0.46561772", "0.46548787", "0.46474648", "0.46447968", "0.4642929", "0.46412122", "0.4639568", "0.4625294", "0.46131518", "0.4608759", "0.4596452", "0.4591777", "0.45907786", "0.4575569", "0.45742622", "0.4560502", "0.4557877", "0.45557943", "0.45511216", "0.45470405", "0.45438212", "0.45412114", "0.45278308", "0.45126912", "0.45079905", "0.4497624", "0.44815734", "0.44655737", "0.44639945", "0.4460498", "0.44564193", "0.44550452", "0.44472072", "0.4444843", "0.44444296", "0.44284657", "0.44270787", "0.4421244", "0.4414369", "0.4410628", "0.44043428" ]
0.4418249
97
Methode die von aussen die Verabeitung startet.
public MachineValue eval(MachineValue [] params) { if (params[0].toList().isEmpty()) return new MVInt(1); else; return new MVInt(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void start() {\n\n\t}", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t}", "public void start() {\n\n\t}", "@Override\n\tpublic void start() {\n\n\t}", "public void start() {\n\t\t\n\t}", "public void start() {\n\t\t\n\t}", "@Override\r\n public void start() {\r\n }", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "public void sendeSpielStarten();", "protected void start() {\n }", "@Override\r\n\tpublic void start() {\n\t\tsuper.start();\r\n\t\t\r\n\t}", "public void start(){\n\t\tsuper.start();\n\t}", "@Override public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n\tpublic void start() {\n\t}", "@Override\n\tpublic void start() {\n\t}", "@Override\n public void start() { }", "public void start()\n {\n }", "@Override\n public void start() {\n\n }", "@Override\n public void start() {\n\n }", "@Override\n public void start() {\n\n }", "public void start( )\n {\n // Implemented by student.\n }", "@Override\n public void start() {\n }", "public void start()\r\n\t{\n\tSystem.out.println(\"normal start method\");\r\n\t}", "public start() {\n\t\tsuper();\n\t}", "@Override\n public void start() {}", "public void start() {\n }", "public void start(){\n }", "public void start(){\n return;\n }", "public void start() {\n\t\tSystem.out.println(\"parent method\");\n\t}", "public void start() {\n\n }", "@Override\n protected void Start() {\n }", "public void start() {}", "public void start() {}", "@Override\n public synchronized void start() {\n super.start(); //To change body of generated methods, choose Tools | Templates.\n }", "@Override\n public void startup() {\n }", "@Override\n protected void startUp() {\n }", "public void starting();", "@Override\r\n\tpublic synchronized void start() {\n\t\tsuper.start();\r\n\t}", "public void startup(){}", "public void start() {\n\n System.out.println(\"Esto no debe salir por consola al sobreescribirlo\");\n\n }", "@Override\n public void Start() {\n\n }", "@Override\n public void Start() {\n\n }", "@Override\n public void Start() {\n\n }", "@Override\n\tvoid start() {\n\t\tSystem.out.println(\"starts\");\n\t}", "@Override\n public synchronized void start() {\n init();\n }", "public void onStart() {\n\t\t\n\t}", "public void start(){ //overridden method\n System.out.println(\"BMW--Start\");\n }", "@Override\n\tpublic void start() {\n\t\t\tSystem.out.println(\"BMW --- strart\");\n\t}", "@Override\n\tpublic void start() throws Exception {\n\t\t\n\t}", "public void start() {\n\r\n }", "public void start()\n {}", "@Override\n\tprotected void onStart() {\n\t\tSystem.out.println(\"onStart\");\n\t}", "public void start() {\n\t\tSystem.out.println(\"BMW start method\");\n\t}", "@Override\r\n\tpublic void startEvent() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void startEvent() {\n\t\t\r\n\t}", "@Override\n\tpublic void start() {\n\t\tSystem.out.println(\"BMW -- start\");\n\t}", "public void start() {\n\t\tSystem.out.println(\"BMW Slef-----start\");\n\t}", "void start() {\n }", "public void startup() {\n\t\tstart();\n }", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\", \"onstart\");\n\n\t\t\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tSystem.out.println(\"Método onStart\");\n\t}", "public void start() {\n\t\tSystem.out.println(\"BMW.........start!!!.\");\n\t}", "@Override\n\t\t\t\t\tpublic void onStart() {\n\n\t\t\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n public void beforeStart() {\n \n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tSystem.out.println(\"onStart\");\n\t\t\t\tif(listener!=null) listener.onMessage(\"onStart\");\n\t\t\t\tisRun = true;\n\t\t\t}", "@Override\n public void onStart() {\n System.out.println(\"ONstart\");\n super.onStart();\n\n }", "public void start() {\n \tupdateHeader();\n }", "private void start() {\r\n\t\t// Clear the log file.\r\n\t\tBPCC_Logger.clearLogFile();\r\n\t\t\r\n\t\t// Initialize BPCC_Util static fields.\r\n\t\tBPCC_Util.initStaticFields();\r\n\t\t\r\n\t\t// Set logging level desired for test.\r\n\t\tBPCC_Util.setLogLevel(LogLevelEnum.DEBUG);\r\n\t\t\r\n\t\t// Initialize class global variables.\r\n\t\tinitVars();\r\n\t\t\r\n\t\tcreateAndShowGUI();\r\n\t}", "@Override\n public void onStart() {\n \n }", "@Override\n public void onStart() {\n \n }", "@Override\n\t\t\tpublic void onStart()\n\t\t\t{\n\t\t\t\tsuper.onStart();\n\t\t\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tSystem.out.println(\"onStart...\");\n\t}", "@Override\r\n\tprotected void doStart() throws Exception {\n\r\n\t}", "public abstract void started();", "public void start()\n {\n uploadDataFromFile();\n menu.home();\n home();\n }", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();", "public void start();" ]
[ "0.81506556", "0.80860794", "0.79952216", "0.7994885", "0.7987635", "0.7987635", "0.7959682", "0.7959409", "0.7959409", "0.7959409", "0.7959409", "0.7954273", "0.7934438", "0.79302377", "0.7903685", "0.78627497", "0.78619146", "0.78619146", "0.78619146", "0.78619146", "0.78619146", "0.78619146", "0.78619146", "0.7843161", "0.7843161", "0.78413767", "0.78309566", "0.7826912", "0.7826912", "0.7826912", "0.7825183", "0.78004354", "0.7758075", "0.77480024", "0.77239186", "0.772361", "0.7712666", "0.77063227", "0.76454514", "0.76069653", "0.75733304", "0.755716", "0.755716", "0.75067186", "0.75034446", "0.74607384", "0.7433069", "0.74270755", "0.7423551", "0.7423362", "0.74100626", "0.74100626", "0.74100626", "0.7389589", "0.7373636", "0.73680496", "0.735685", "0.73530614", "0.7344041", "0.7340271", "0.7335401", "0.73350114", "0.7330759", "0.73167914", "0.73167914", "0.731219", "0.7307103", "0.729434", "0.7285049", "0.7264725", "0.7249528", "0.72485507", "0.7239938", "0.72227514", "0.7213572", "0.7213572", "0.7213572", "0.7213572", "0.7213572", "0.7179688", "0.71742547", "0.7168525", "0.71617466", "0.7150116", "0.7149581", "0.7149581", "0.7145002", "0.7124344", "0.712103", "0.711858", "0.71116346", "0.7110376", "0.7110376", "0.7110376", "0.7110376", "0.7110376", "0.7110376", "0.7110376", "0.7110376", "0.7110376", "0.7110376" ]
0.0
-1
Konvertiert den OPCode in einen String
public String toString() { return "isemptyl"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getCode();", "java.lang.String getCode();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "Code getCode();", "void setCode(String code);", "public String getCode();", "public String getCode();", "public String getCode() {\t\t\t\t\t\t\t\t\treturn code;\t\t\t\t\t\t\t}", "@AutoEscape\n\tpublic String getDataCode();", "public abstract String getFullCode();", "public byte[] code();", "public String toCodeString() {\n return String.format(\"%s = %s;\\n\", this.identifier.toString(), this.exp.toCodeString());\n }", "protected String toStringAsCode() {\r\n \t\treturn \"<\"+toStringAsElement()+\">\";\r\n \t}", "public int set_code(String b);", "public interface Code {\n //运行结果编号\n Integer getCode();\n //运行结果描述\n String getDescription();\n String toString();\n\n}", "public String CodeInterpreter() {\n\n\t\tString timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(Calendar.getInstance().getTime());\n\t\treturn \"DA\" + \"_\" + timeStamp;\n\t}", "public String getCode() {\n\t\treturn codeText.getText().toString();\n\t}", "public String code() {\r\n return code == null ? String.format(\"%s%04d\", type, num) : code;\r\n }", "public CPCAdapter(String code) {\n super();\n operationCode = code;\n if (code.equalsIgnoreCase(COPY))\n codeIndex = 0;\n else if (code.equalsIgnoreCase(CUT))\n codeIndex = 1;\n else if (code.equalsIgnoreCase(PASTE))\n codeIndex = 2;\n else\n System.out.println(\"wrong specfication of operation\");\n }", "public String getCode(){\n\t\treturn code;\n\t}", "private static void translate2string(InstrCode instr, StringBuilder destStr) throws Exception {\r\n\t\tint idx = instr.instrIdx;\r\n\r\n\t\tif( idx < 10 ) {\r\n\t\t\tdestStr.append(idx);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tidx -= 10;\r\n\r\n\t\tif( idx < 26 ) {\r\n\t\t\tdestStr.append((char)(97 + idx)); // small letter\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tidx -= 26;\r\n\r\n\t\tif( idx < 26 ) {\r\n\t\t\tdestStr.append((char)(65 + idx)); // big letter\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tidx -= 26;\r\n\r\n\t\t// TODO< encode instruction with special signs >\r\n\t\tthrow new Exception(\"NOT IMPLEMENTED - TODO\");\r\n\t}", "Character getCode();", "public String getCode()\r\n\t{\r\n\t\treturn code;\r\n\t}", "public java.lang.String getCode() {\n java.lang.Object ref = code_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n code_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode(){\n\t\treturn new SmartAPIModel().getCpSourceCode(cp.getLocalName());\n\t}", "public BasicCode(String instruction) {\n\t\tsuper();\n\t\tthis.instruction = instruction;\n\t}", "public void opCode(String oc) throws NumberFormatException {\n\n\t\tCCR ccrFlagState = new CCR();\n\n\t\ttry {\n\n\t\t\t// parse hexadecimal codes to integers for page 0 instructions\n\t\t\tswitch (Integer.parseInt(oc, 16)) {\n\t\t\tcase 0x00:\n\t\t\t\tSystem.out.println(\"NEG, direct, 6 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Negate\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if original operand was 10000000\n\t\t\t\t// C Set if the operation did not cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x01:\n\t\t\t\tSystem.out.println(\"ILLEGAL, 1 cycle, 1 byte, uuuuu\");\n\t\t\t\tbreak;\n\t\t\tcase 0x02:\n\t\t\t\tSystem.out.println(\"ILLEGAL, 1 cycle, 1 byte, uuuuu\");\n\t\t\t\tbreak;\n\t\t\tcase 0x03:\n\t\t\t\tSystem.out.println(\"COM, direct, 6 cycles, 2 Bytes, -aa01\");\n\t\t\t\t// Complement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C set\n\t\t\t\tccrFlagState.setCBit(true);\n\t\t\t\tbreak;\n\t\t\tcase 0x04:\n\t\t\t\tSystem.out.println(\"LSR, direct, 6 cycles, 2 Bytes, -0a-s\");\n\t\t\t\t// Logical Shift Right\n\t\t\t\t// H not affected\n\t\t\t\t// N cleared\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V not affected\n\t\t\t\t// C Loaded with bit 0 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x06:\n\t\t\t\tSystem.out.println(\"ROR, direct, 6 cycles, 2 Bytes, -aa-s\");\n\t\t\t\t// Rotate Right\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Not affected\n\t\t\t\t// C Loaded with bit 0 of the previous operand\n\t\t\t\tbreak;\n\t\t\tcase 0x07:\n\t\t\t\tSystem.out.println(\"ASR, direct, 6 cycles, 2 Bytes, uaa-s\");\n\t\t\t\t// Arithmetic shift right\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V unaffected\n\t\t\t\t// C loaded with bit 0 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x08:\n\t\t\t\tSystem.out.println(\"LSL/ASL, dir, 6 cycles, 2 Bytes, naaas\");\n\t\t\t\t// Arithmetic shift left\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V loaded with result of (b7 XOR b6) of the original operand\n\t\t\t\t// C loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x09:\n\t\t\t\tSystem.out.println(\"ROL, direct, 6 cycles, 2 bytes, -aaas\");\n\t\t\t\t// Rotate Left\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Loaded with the result of (b7 XOR b6) of the original\n\t\t\t\t// operand\n\t\t\t\t// C Loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x0A:\n\t\t\t\tSystem.out.println(\"DEC, direct, 6 cycles, 2 Bytes, -aaa-\");\n\t\t\t\t// Decrement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 10000000\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x0C:\n\t\t\t\tSystem.out.println(\"INC, direct, 6 cycles, 2 Bytes, -aaa-\");\n\t\t\t\t// Increment\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 01111111\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x0D:\n\t\t\t\tSystem.out.println(\"TST, direct, 6 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Test\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x0E:\n\t\t\t\tSystem.out.println(\"JMP, direct, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Jump to effective address\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Program control transferred to location equivalent to EA\n\t\t\t\tbreak;\n\t\t\tcase 0x0F:\n\t\t\t\tSystem.out.println(\"CLR, direct, 6 cycles, 2 Bytes, -0100\");\n\t\t\t\t// sets Z flag\n\t\t\t\tccrFlagState.setZBit(true);\n\t\t\t\tSystem.out.println(ccrFlagState.zBit() + \" z bit\");\n\t\t\t\t// clears N, V & C\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// AACX or M is loaded with 00000000. C flag cleared for 6800\n\t\t\t\t// compatibility\n\t\t\t\tbreak;\n\t\t\tcase 0x10:\n\t\t\t\tSystem.out.println(\"PAGE1+, variant, 1 cycle, 1 Byte, +++++\");\n\t\t\t\tp1Codes(oc);\n\t\t\t\tbreak;\n\t\t\tcase 0x11:\n\t\t\t\tSystem.out.println(\"PAGE2+, variant, 1 cycle, 1 Byte, +++++\");\n\t\t\t\tp2Codes(oc);\n\t\t\t\tbreak;\n\t\t\tcase 0x12:\n\t\t\t\tSystem.out.println(\"NOP, inherent, 2 cycles, 1 Byte, -----\");\n\t\t\t\t// No operation\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Only PC incremented\n\t\t\t\tbreak;\n\t\t\tcase 0x13:\n\t\t\t\tSystem.out.println(\"SYNC, inherent, 2 cycles, 1 Byte, -----\");\n\t\t\t\t// Synchronise to External Event\n\t\t\t\t// CCR unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x16:\n\t\t\t\tSystem.out.println(\"LBRA, relative, 5 cycles, 3 Bytes, -----\");\n\t\t\t\t// Branch Always\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes an unconditional branch\n\t\t\t\tbreak;\n\t\t\tcase 0x17:\n\t\t\t\tSystem.out.println(\"LBSR, relative, 9 cycles, 3 Bytes, -----\");\n\t\t\t\t// Branch to Subroutine\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Program counter is pushed onto the stack. The PC is then\n\t\t\t\t// loaded with the sum of the PC and the memory immediate offset\n\t\t\t\tbreak;\n\t\t\tcase 0x19:\n\t\t\t\tSystem.out.println(\"DAA, inherent, 2 cycles, 1 Bytes, -aa0a\");\n\t\t\t\t// Decimal Addition Adjust\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if MSB of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V not defined\n\t\t\t\t// C set if the operation caused a carry from bit 7 in the ALU\n\t\t\t\t// or if the carry flag was set before the operation\n\t\t\t\tbreak;\n\t\t\tcase 0x1A:\n\t\t\t\tSystem.out.println(\"ORCC, immediate, 3 cycles, 2 Bytes, ddddd\");\n\t\t\t\t// Inclusive OR Memory-Immediate into Register\n\t\t\t\t// Performs an inclusive OR between contents of CCR & MI and the\n\t\t\t\t// result placed in the CCR\n\t\t\t\tbreak;\n\t\t\tcase 0x1C:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"ANDCC, immediate, 3 cycles, 2 Bytes, ddddd\\n\"\n\t\t\t\t\t\t\t\t+ \"Logical AND Immediate Memory into CCR\");\n\t\t\t\t// Performs a logical AND between the CCR and MI byte and\n\t\t\t\t// places the result into the CCR\n\t\t\t\tbreak;\n\t\t\tcase 0x1D:\n\t\t\t\tSystem.out.println(\"SEX, inherent, 2 cycles, 1 Bytes, -aa0-\");\n\t\t\t\t// Sign Extended\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if MSB of result set\n\t\t\t\t// Z Set if all bits of ACCD are clear\n\t\t\t\t// V Not affected\n\t\t\t\t// C Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0x1E:\n\t\t\t\tSystem.out.println(\"EXG, inherent, 8 cycles, 2 Bytes, ccccc\");\n\t\t\t\t// Exchange Registers\n\t\t\t\t// CCR unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x1F:\n\t\t\t\tSystem.out.println(\"TFR, inherent, 7 cycles, 2 Bytes, -aa0a\");\n\t\t\t\t// Transfer Register to Register\n\t\t\t\t// CCR unaffected (unless R2 = CCR)\n\t\t\t\tbreak;\n\t\t\tcase 0x20:\n\t\t\t\tSystem.out.println(\"BRA, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch Always\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes an unconditional branch\n\t\t\t\tbreak;\n\t\t\tcase 0x21:\n\t\t\t\tSystem.out.println(\"BRN, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch Never\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes no branch\n\t\t\t\tbreak;\n\t\t\tcase 0x22:\n\t\t\t\tSystem.out.println(\"BHI, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch if Higher\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes branch if previous operation caused neither a carry\n\t\t\t\t// nor a zero result\n\t\t\t\tbreak;\n\t\t\tcase 0x23:\n\t\t\t\tSystem.out.println(\"BLS, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Lower or Same\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes a branch if the previous operation caused either a\n\t\t\t\t// carry\n\t\t\t\t// or zero result\n\t\t\t\tbreak;\n\t\t\tcase 0x24:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"BHS/BCC, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// BHS\n\t\t\t\t// Branch if Higher or Same\n\t\t\t\t// CCR unaffected\n\t\t\t\t// BCC\n\t\t\t\t// Branch on Carry Clear\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Checks C bit and causes a branch if C is clear\n\t\t\t\tbreak;\n\t\t\tcase 0x25:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"BLO/BCS, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Lower\n\t\t\t\t// Branch on Carry Set\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Checks C bit and causes a branch if C is set\n\t\t\t\tbreak;\n\t\t\tcase 0x26:\n\t\t\t\tSystem.out.println(\"BNE, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch Not Equal\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes a branch if Z bit is clear\n\t\t\t\tbreak;\n\t\t\tcase 0x27:\n\t\t\t\tSystem.out.println(\"BEQ, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Equal\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Checks Z bit and causes a branch if Z is set\n\t\t\t\tbreak;\n\t\t\tcase 0x28:\n\t\t\t\tSystem.out.println(\"BVC, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Overflow Clear\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes a branch if the V bit is clear\n\t\t\t\tbreak;\n\t\t\tcase 0x29:\n\t\t\t\tSystem.out.println(\"BVS, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Overflow Set\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes a branch if the V bit is set\n\t\t\t\tbreak;\n\t\t\tcase 0x2A:\n\t\t\t\tSystem.out.println(\"BPL, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Plus\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes a branch if N bit is clear\n\t\t\t\tbreak;\n\t\t\tcase 0x2B:\n\t\t\t\tSystem.out.println(\"BMI, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Minus\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes a branch if N is set\n\t\t\t\tbreak;\n\t\t\tcase 0x2C:\n\t\t\t\tSystem.out.println(\"BGE, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Greater Than or Equal to Zero\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Checks N & V bits and causes a branch if both are either set\n\t\t\t\t// or clear\n\t\t\t\tbreak;\n\t\t\tcase 0x2D:\n\t\t\t\tSystem.out.println(\"BLT, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Less than Zero\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes a branch if either but not both of the N or V bits is\n\t\t\t\t// 1\n\t\t\t\tbreak;\n\t\t\tcase 0x2E:\n\t\t\t\tSystem.out.println(\"BGT, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Greater\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Checks N & V bits and causes a branch if both are either set\n\t\t\t\t// or clear and Z is clear\n\t\t\t\tbreak;\n\t\t\tcase 0x2F:\n\t\t\t\tSystem.out.println(\"BLE, relative, 3 cycles, 2 Bytes, -----\");\n\t\t\t\t// Branch on Less than or Equal to zero\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Causes branch if the XOR of the N & V bits is 1 or if Z = 1\n\t\t\t\tbreak;\n\t\t\tcase 0x30:\n\t\t\t\tSystem.out.println(\"LEAX, relative, 4 cycles, 2 Bytes, --a--\");\n\t\t\t\t// Load Effective Address\n\t\t\t\t// H unaffected\n\t\t\t\t// N unaffected\n\t\t\t\t// Z LEAX, LEAY - set if all bits of result are clear\n\t\t\t\t// LEAS, LEAU - unaffected\n\t\t\t\t// V unaffected\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x31:\n\t\t\t\tSystem.out.println(\"LEAY, indexed, 4 cycles, 2 Bytes, --a--\");\n\t\t\t\t// Load Effective Address\n\t\t\t\t// H unaffected\n\t\t\t\t// N unaffected\n\t\t\t\t// Z LEAX, LEAY - set if all bits of result are clear\n\t\t\t\t// LEAS, LEAU - unaffected\n\t\t\t\t// V unaffected\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x32:\n\t\t\t\tSystem.out.println(\"LEAS, indexed, 4 cycles, 2 Bytes, -----\");\n\t\t\t\t// Load Effective Address\n\t\t\t\t// H unaffected\n\t\t\t\t// N unaffected\n\t\t\t\t// Z LEAX, LEAY - set if all bits of result are clear\n\t\t\t\t// LEAS, LEAU - unaffected\n\t\t\t\t// V unaffected\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x33:\n\t\t\t\tSystem.out.println(\"LEAU, indexed, 4 cycles, 2 Bytes, -----\");\n\t\t\t\t// Load Effective Address\n\t\t\t\t// H unaffected\n\t\t\t\t// N unaffected\n\t\t\t\t// Z LEAX, LEAY - set if all bits of result are clear\n\t\t\t\t// LEAS, LEAU - unaffected\n\t\t\t\t// V unaffected\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x34:\n\t\t\t\tSystem.out.println(\"PSHS, inherent, 5 cycles, 2 Bytes, -----\");\n\t\t\t\t// Push Registers onto Hardware Stack\n\t\t\t\t// CCR not affected\n\t\t\t\tbreak;\n\t\t\tcase 0x35:\n\t\t\t\tSystem.out.println(\"PULS, inherent, 5 cycles, 2 Bytes, ccccc\");\n\t\t\t\t// Pull Registers from Hardware Stack\n\t\t\t\t// CCR may be pulled from stack, otherwise unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x36:\n\t\t\t\tSystem.out.println(\"PSHU, inherent, 5 cycles, 2 Bytes, -----\");\n\t\t\t\t// Push Registers onto User Stack\n\t\t\t\t// CCR Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0x37:\n\t\t\t\tSystem.out.println(\"PULU, inherent, 5 cycles, 2 Bytes, ccccc\");\n\t\t\t\t// Pull Registers from User Stack\n\t\t\t\t// CCR may be pulled from stack, otherwise unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x39:\n\t\t\t\tSystem.out.println(\"RTS, inherent, 5 cycles, 1 Bytes, -----\");\n\t\t\t\t// Return from Subroutine\n\t\t\t\t// CCR unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x3A:\n\t\t\t\tSystem.out.println(\"ABX, inherent, 3 cycles, 1 Bytes, -----\\n\"\n\t\t\t\t\t\t+ \"Add the 8 bit unsigned value in Accumulator B \"\n\t\t\t\t\t\t+ \"into the index register. Flags unaffected\");\n\t\t\t\t// Add the 8 bit unsigned value in Accumulator B into the index\n\t\t\t\t// register. Flags unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x3B:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"RTI, inherent, 6/15 cycles, 1 Bytes, -----\");\n\t\t\t\t// Return from Interrupt\n\t\t\t\t// CCR & saved machine state recovered from hardware stack\n\t\t\t\tbreak;\n\t\t\tcase 0x3C:\n\t\t\t\tSystem.out.println(\"CWAI, inherent, 21 cycles, 2 Bytes, ddddd\");\n\t\t\t\t// Clear and wait for interrupt\n\t\t\t\t// Entire state saved\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C set\n\t\t\t\tccrFlagState.setCBit(true);\n\t\t\t\tbreak;\n\t\t\tcase 0x3D:\n\t\t\t\tSystem.out.println(\"MUL, inherent, 11 cycles, 1 Bytes, --a-a\");\n\t\t\t\t// Multiply Accumulators\n\t\t\t\t// H not affected\n\t\t\t\t// N not affected\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V not affected\n\t\t\t\t// C Set if ACCB bit 7 of result is set\n\t\t\t\tbreak;\n\t\t\tcase 0x3E:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"RESET*, inherent, * cycles, 1 Bytes, *****\");\n\t\t\t\tbreak;\n\t\t\tcase 0x3F:\n\t\t\t\tSystem.out.println(\"SWI, inherent, 19 cycles, 1 Bytes, -----\");\n\t\t\t\t// Software Interrupt\n\t\t\t\t// CCR unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x40:\n\t\t\t\tSystem.out.println(\"NEGA, inherent, 2 cycles, 1 Bytes, uaaaa\");\n\t\t\t\t// Negate\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if original operand was 10000000\n\t\t\t\t// C Set if the operation did not cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x43:\n\t\t\t\tSystem.out.println(\"COMA, inherent, 2 cycles, 1 Bytes, -aa01\");\n\t\t\t\t// Complement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C set\n\t\t\t\tccrFlagState.setCBit(true);\n\t\t\t\tbreak;\n\t\t\tcase 0x44:\n\t\t\t\tSystem.out.println(\"LSRA, inherent, 2 cycles, 1 Bytes, -0a-s\");\n\t\t\t\t// Logical Shift Right\n\t\t\t\t// H not affected\n\t\t\t\t// N cleared\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V not affected\n\t\t\t\t// C Loaded with bit 0 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x46:\n\t\t\t\tSystem.out.println(\"RORA, inherent, 2 cycles, 1 Bytes, -aa-s\");\n\t\t\t\t// Rotate Right\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Not affected\n\t\t\t\t// C Loaded with bit 0 of the previous operand\n\t\t\t\tbreak;\n\t\t\tcase 0x47:\n\t\t\t\tSystem.out.println(\"ASRA, inherent, 2 cycles, 1 Bytes, uaa-s\");\n\t\t\t\t// Arithmetic shift right\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V unaffected\n\t\t\t\t// C loaded with bit 0 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x48:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"LSLA/ASLA, inherent, 2 cycles, 1 Bytes, naaas\\n\"\n\t\t\t\t\t\t\t\t+ \"Arithmetic shift left\");\n\t\t\t\t// Logical Shift Left\n\t\t\t\t// Arithmetic shift left\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V loaded with result of (b7 XOR b6) of the original operand\n\t\t\t\t// C loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x49:\n\t\t\t\tSystem.out.println(\"ROLA, inherent, 2 cycles, 1 Bytes, -aaas\");\n\t\t\t\t// Rotate Left\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Loaded with the result of (b7 XOR b6) of the original\n\t\t\t\t// operand\n\t\t\t\t// C Loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x4A:\n\t\t\t\tSystem.out.println(\"DECA, inherent, 2 cycles, 1 Bytes, -aaa-\");\n\t\t\t\t// Decrement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 10000000\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x4C:\n\t\t\t\tSystem.out.println(\"INCA, inherent, 2 cycles, 1 Bytes, -aaa-\");\n\t\t\t\t// Increment\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 01111111\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x4D:\n\t\t\t\tSystem.out.println(\"TSTA, inherent, 2 cycles, 1 Bytes, -aa0-\");\n\t\t\t\t// Test\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x4F:\n\t\t\t\tSystem.out.println(\"CLRA, inherent, 2 cycles, 1 Bytes, -0100\");\n\t\t\t\t// sets Z flag\n\t\t\t\tccrFlagState.setZBit(true);\n\t\t\t\tSystem.out.println(ccrFlagState.zBit() + \" z bit\");\n\t\t\t\t// clears N, V & C\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\tbreak;\n\t\t\tcase 0x50:\n\t\t\t\tSystem.out.println(\"NEGB, inherent, 2 cycles, 1 Bytes, uaaaa\");\n\t\t\t\t// Negate\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if original operand was 10000000\n\t\t\t\t// C Set if the operation did not cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x53:\n\t\t\t\tSystem.out.println(\"COMB, inherent, 2 cycles, 1 Bytes, -aa01\");\n\t\t\t\t// Complement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C set\n\t\t\t\tccrFlagState.setCBit(true);\n\t\t\t\tbreak;\n\t\t\tcase 0x54:\n\t\t\t\tSystem.out.println(\"LSRB, inherent, 2 cycles, 1 Bytes, -0a-s\");\n\t\t\t\t// Logical Shift Right\n\t\t\t\t// H not affected\n\t\t\t\t// N cleared\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V not affected\n\t\t\t\t// C Loaded with bit 0 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x56:\n\t\t\t\tSystem.out.println(\"RORB, inherent, 2 cycles, 1 Bytes, -aa-s\");\n\t\t\t\t// Rotate Right\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Not affected\n\t\t\t\t// C Loaded with bit 0 of the previous operand\n\t\t\t\tbreak;\n\t\t\tcase 0x57:\n\t\t\t\tSystem.out.println(\"ASRB, inherent, 2 cycles, 1 Bytes, uaa-s\");\n\t\t\t\t// Arithmetic shift right\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V unaffected\n\t\t\t\t// C loaded with bit 0 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x58:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"LSLB/ASLB, inherent, 2 cycles, 1 Bytes, naaas\");\n\t\t\t\t// Logical Shift Left\n\t\t\t\t// Arithmetic shift left\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V loaded with result of (b7 XOR b6) of the original operand\n\t\t\t\t// C loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x59:\n\t\t\t\tSystem.out.println(\"ROLB, inherent, 2 cycles, 1 Bytes, -aaas\");\n\t\t\t\t// Rotate Left\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Loaded with the result of (b7 XOR b6) of the original\n\t\t\t\t// operand\n\t\t\t\t// C Loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x5A:\n\t\t\t\tSystem.out.println(\"DECB, inherent, 2 cycles, 1 Bytes, -aaa-\");\n\t\t\t\t// Decrement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 10000000\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x5C:\n\t\t\t\tSystem.out.println(\"INCB, inherent, 2 cycles, 1 Bytes, -aaa-\");\n\t\t\t\t// Increment\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 01111111\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x5D:\n\t\t\t\tSystem.out.println(\"TSTB, inherent, 2 cycles, 1 Bytes, -aa0-\");\n\t\t\t\t// Test\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x5F:\n\t\t\t\tSystem.out.println(\"CLRB, inherent, 2 cycles, 1 Bytes, -0100\");\n\t\t\t\t// sets Z flag\n\t\t\t\tccrFlagState.setZBit(true);\n\t\t\t\tSystem.out.println(ccrFlagState.zBit() + \" z bit\");\n\t\t\t\t// clears N, V & C\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// AACX or M is loaded with 00000000. C flag cleared for 6800\n\t\t\t\t// compatibility\n\t\t\t\tbreak;\n\t\t\tcase 0x60:\n\t\t\t\tSystem.out.println(\"NEG, INDEXED, 6 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Negate\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if original operand was 10000000\n\t\t\t\t// C Set if the operation did not cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x63:\n\t\t\t\tSystem.out.println(\"COM, INDEXED, 6 cycles, 2 Bytes, -aa01\");\n\t\t\t\t// Complement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C set\n\t\t\t\tccrFlagState.setCBit(true);\n\t\t\t\tbreak;\n\t\t\tcase 0x64:\n\t\t\t\tSystem.out.println(\"LSR, INDEXED, 6 cycles, 2 Bytes, -0a-s\");\n\t\t\t\t// Logical Shift Right\n\t\t\t\t// H not affected\n\t\t\t\t// N cleared\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V not affected\n\t\t\t\t// C Loaded with bit 0 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x66:\n\t\t\t\tSystem.out.println(\"ROR, INDEXED, 6 cycles, 2 Bytes, -aa-s\");\n\t\t\t\t// Rotate Right\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Not affected\n\t\t\t\t// C Loaded with bit 0 of the previous operand\n\t\t\t\tbreak;\n\t\t\tcase 0x67:\n\t\t\t\tSystem.out.println(\"ASR, INDEXED, 6 cycles, 2 Bytes, uaa-s\");\n\t\t\t\t// Arithmetic shift right\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V unaffected\n\t\t\t\t// C loaded with bit 0 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x68:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"LSL/ASL, INDEXED, 6 cycles, 2 Bytes, naaas\");\n\t\t\t\t// Logical Shift Left\n\t\t\t\t// Arithmetic shift left\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V loaded with result of (b7 XOR b6) of the original operand\n\t\t\t\t// C loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x69:\n\t\t\t\tSystem.out.println(\"ROL, INDEXED, 6 cycles, 2 Bytes, -aaas\");\n\t\t\t\t// Rotate Left\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Loaded with the result of (b7 XOR b6) of the original\n\t\t\t\t// operand\n\t\t\t\t// C Loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x6A:\n\t\t\t\tSystem.out.println(\"DEC, INDEXED, 6 cycles, 2 Bytes, -aaa-\");\n\t\t\t\t// Decrement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 10000000\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x6C:\n\t\t\t\tSystem.out.println(\"INC, INDEXED, 6 cycles, 2 Bytes, -aaa-\");\n\t\t\t\t// Increment\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 01111111\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x6D:\n\t\t\t\t// TST\n\t\t\t\t// Test\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x6E:\n\t\t\t\t// Jump to effective address\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Program control transferred to location equivalent to EA\n\t\t\t\tbreak;\n\t\t\tcase 0x6F:\n\t\t\t\t// sets Z flag\n\t\t\t\tccrFlagState.setZBit(true);\n\t\t\t\tSystem.out.println(ccrFlagState.zBit() + \" z bit\");\n\t\t\t\t// clears N, V & C\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// AACX or M is loaded with 00000000. C flag cleared for 6800\n\t\t\t\t// compatibility\n\t\t\t\tbreak;\n\t\t\tcase 0x70:\n\t\t\t\t// NEG\n\t\t\t\t// Negate\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if original operand was 10000000\n\t\t\t\t// C Set if the operation did not cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x73:\n\t\t\t\t// Complement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C set\n\t\t\t\tccrFlagState.setCBit(true);\n\t\t\t\tbreak;\n\t\t\tcase 0x74:\n\t\t\t\t// LSR\n\t\t\t\t// Logical Shift Right\n\t\t\t\t// H not affected\n\t\t\t\t// N cleared\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V not affected\n\t\t\t\t// C Loaded with bit 0 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x76:\n\t\t\t\t// ROR\n\t\t\t\t// Rotate Right\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Not affected\n\t\t\t\t// C Loaded with bit 0 of the previous operand\n\t\t\t\tbreak;\n\t\t\tcase 0x77:\n\t\t\t\t// ASR\n\t\t\t\tbreak;\n\t\t\tcase 0x78:\n\t\t\t\t// LSL/ASL\n\t\t\t\t// Logical Shift Left\n\t\t\t\t// Arithmetic shift left\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V loaded with result of (b7 XOR b6) of the original operand\n\t\t\t\t// C loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x79:\n\t\t\t\t// ROL\n\t\t\t\t// Rotate Left\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Loaded with the result of (b7 XOR b6) of the original\n\t\t\t\t// operand\n\t\t\t\t// C Loaded with bit 7 of the original operand\n\t\t\t\tbreak;\n\t\t\tcase 0x7A:\n\t\t\t\t// Decrement\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 10000000\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x7C:\n\t\t\t\t// Increment\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if original operand was 01111111\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x7D:\n\t\t\t\t// TST\n\t\t\t\t// Test\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x7E:\n\t\t\t\t// Jump to effective address\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Program control transferred to location equivalent to EA\n\t\t\t\tbreak;\n\t\t\tcase 0x7F:\n\t\t\t\t// sets Z flag\n\t\t\t\tccrFlagState.setZBit(true);\n\t\t\t\tSystem.out.println(ccrFlagState.zBit() + \" z bit\");\n\t\t\t\t// clears N, V & C\n\t\t\t\tccrFlagState.setNBit(false);\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// AACX or M is loaded with 00000000. C flag cleared for 6800\n\t\t\t\t// compatibility\n\t\t\t\tbreak;\n\t\t\tcase 0x80:\n\t\t\t\t// SUBA\n\t\t\t\t// Subtract Memory from Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x81:\n\t\t\t\t// Compare memory from a Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 8 bit two's complement overflow\n\t\t\t\t// C set if subtraction did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x82:\n\t\t\t\t// SBCA\n\t\t\t\t// Subtract with Borrow\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if the operation causes an 8 bit 2's complement\n\t\t\t\t// overflow\n\t\t\t\t// C Set if the operation did NOT cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x83:\n\t\t\t\t// SUBD\n\t\t\t\t// Subtract Memory from Register - 16 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation on the MSB did NOT cause a carry from bit\n\t\t\t\t// 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x84:\n\t\t\t\t// ANDA\n\t\t\t\tbreak;\n\t\t\tcase 0x85:\n\t\t\t\t// BITA\n\t\t\t\tbreak;\n\t\t\tcase 0x86:\n\t\t\t\t// Load Register from memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x88:\n\t\t\t\t// Exclusive OR\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x89:\n\t\t\t\t// ADCA\n\t\t\t\tbreak;\n\t\t\tcase 0x8A:\n\t\t\t\t// ORA\n\t\t\t\t// Inclusive OR Memory into Register\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if high order bits of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0x8B: // immediate ADDA\n\t\t\t\tSystem.out.println(\"ADDA, immediate, 2 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x8C:\n\t\t\t\tSystem.out.println(\"CMPX, immediate, 4 cycles, 3 Bytes, -aaaa\");\n\t\t\t\t// Compare memory from a Register - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 16 bit two's complement overflow\n\t\t\t\t// C set if operation on the MSB did NOT cause a carry from bit\n\t\t\t\t// 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x8D:\n\t\t\t\tSystem.out.println(\"BSR, RELATIVE, 7 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Branch to Subroutine\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Program counter is pushed onto the stack. The PC is then\n\t\t\t\t// loaded with the sum of the PC and the memory immediate offset\n\t\t\t\tbreak;\n\t\t\tcase 0x8E:\n\t\t\t\tSystem.out.println(\"LDX, immediate, 3 cycles, 3 Bytes, aaaaa\");\n\t\t\t\tbreak;\n\t\t\tcase 0x90:\n\t\t\t\tSystem.out.println(\"SUBA, DIRECT, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// SUBA\n\t\t\t\t// Subtract Memory from Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x91:\n\t\t\t\tSystem.out.println(\"CMPA, DIRECT, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Compare memory from a Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 8 bit two's complement overflow\n\t\t\t\t// C set if subtraction did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x92:\n\t\t\t\tSystem.out.println(\"SBCA, DIRECT, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Subtract with Borrow\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if the operation causes an 8 bit 2's complement\n\t\t\t\t// overflow\n\t\t\t\t// C Set if the operation did NOT cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x93:\n\t\t\t\tSystem.out.println(\"SUBD, DIRECT, 6 cycles, 2 Bytes, -aaaa\");\n\t\t\t\t// Subtract Memory from Register - 16 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation on the MSB did NOT cause a carry from bit\n\t\t\t\t// 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x94:\n\t\t\t\tSystem.out.println(\"ANDA, DIRECT, 4 cycles, 2 Bytes, -aa0-\\n\"\n\t\t\t\t\t\t+ \"Logical AND memory into register\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V cleared\n\t\t\t\t// C unaffected\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\tbreak;\n\t\t\tcase 0x95:\n\t\t\t\tSystem.out.println(\"BITA, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Bit test\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x96:\n\t\t\t\tSystem.out.println(\"LDA, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x97:\n\t\t\t\tSystem.out.println(\"STA, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x98:\n\t\t\t\tSystem.out.println(\"EORA, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Exclusive OR\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x99:\n\t\t\t\tSystem.out.println(\"ADCA, DIRECT, 4 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x9A:\n\t\t\t\tSystem.out.println(\"ORA, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Inclusive OR Memory into Register\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if high order bits of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0x9B: // direct ADDA\n\t\t\t\tSystem.out.println(\"ADDA, direct, 4 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x9C:\n\t\t\t\tSystem.out.println(\"CMPX, DIRECT, 6 cycles, 2 Bytes, -aaaa\");\n\t\t\t\t// Compare memory from a Register - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 16 bit two's complement overflow\n\t\t\t\t// C set if operation on the MSB did NOT cause a carry from bit\n\t\t\t\t// 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0x9D:\n\t\t\t\tSystem.out.println(\"JSR, DIRECT, 7 cycles, 2 Bytes, -----\");\n\t\t\t\t// Jump to Subroutine at effective address\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Program control transferred to location equivalent to EA\n\t\t\t\t// after storing return address on the hardware stack\n\t\t\t\tbreak;\n\t\t\tcase 0x9E:\n\t\t\t\tSystem.out.println(\"LDX, DIRECT, 5 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0x9F:\n\t\t\t\tSystem.out.println(\"STX, DIRECT, 5 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xA0:\n\t\t\t\tSystem.out.println(\"SUBA, INDEXED, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// SUBA\n\t\t\t\t// Subtract Memory from Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xA1:\n\t\t\t\tSystem.out.println(\"CMPA, INDEXED, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Compare memory from a Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 8 bit two's complement overflow\n\t\t\t\t// C set if subtraction did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xA2:\n\t\t\t\tSystem.out.println(\"SBCA, INDEXED, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Subtract with Borrow\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if the operation causes an 8 bit 2's complement\n\t\t\t\t// overflow\n\t\t\t\t// C Set if the operation did NOT cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xA3:\n\t\t\t\tSystem.out.println(\"SUBD, INDEXED, 6 cycles, 2 Bytes, -aaaa\");\n\t\t\t\t// Subtract Memory from Register - 16 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation on the MSB did NOT cause a carry from bit\n\t\t\t\t// 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xA4:\n\t\t\t\tSystem.out.println(\"ANDA, DIRECT, 4 cycles, 2 Bytes, -aa0-\\n\"\n\t\t\t\t\t\t+ \"Logical AND memory into register\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xA5:\n\t\t\t\tSystem.out.println(\"BITA, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Bit test\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xA6:\n\t\t\t\tSystem.out.println(\"LDA, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xA7:\n\t\t\t\tSystem.out.println(\"STA, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xA8:\n\t\t\t\tSystem.out.println(\"EORA, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Exclusive OR\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xA9:\n\t\t\t\tSystem.out.println(\"ADCA, INDEXED, 4 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xAA:\n\t\t\t\tSystem.out.println(\"ORA, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Inclusive OR Memory into Register\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if high order bits of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0xAB: // indexed ADDA\n\t\t\t\tSystem.out.println(\"ADAA, INDEXED, 4 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xAC:\n\t\t\t\tSystem.out.println(\"CMPX, INDEXED, 6 cycles, 2 Bytes, -aaaa\");\n\t\t\t\t// Compare memory from a Register - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 16 bit two's complement overflow\n\t\t\t\t// C set if operation on the MSB did NOT cause a carry from bit\n\t\t\t\t// 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xAD:\n\t\t\t\tSystem.out.println(\"JSR, INDEXED, 7 cycles, 2 Bytes, -----\");\n\t\t\t\t// Jump to Subroutine at effective address\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Program control transferred to location equivalent to EA\n\t\t\t\t// after storing return address on the hardware stack\n\t\t\t\tbreak;\n\t\t\tcase 0xAE:\n\t\t\t\tSystem.out.println(\"LDX, INDEXED, 5 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xAF:\n\t\t\t\tSystem.out.println(\"STX, INDEXED, 5 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xB0:\n\t\t\t\tSystem.out.println(\"SUBA, EXTENDED, 5 cycles, 3 Bytes, uaaaa\");\n\t\t\t\t// SUBA\n\t\t\t\t// Subtract Memory from Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xB1:\n\t\t\t\tSystem.out.println(\"CMPA, EXTENDED, 5 cycles, 3 Bytes, uaaaa\");\n\t\t\t\t// Compare memory from a Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 8 bit two's complement overflow\n\t\t\t\t// C set if subtraction did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xB2:\n\t\t\t\tSystem.out.println(\"SBCA, EXTENDED, 5 cycles, 3 Bytes, uaaaa\");\n\t\t\t\t// Subtract with Borrow\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if the operation causes an 8 bit 2's complement\n\t\t\t\t// overflow\n\t\t\t\t// C Set if the operation did NOT cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xB3:\n\t\t\t\tSystem.out.println(\"SUBD, EXTENDED, 7 cycles, 3 Bytes, -aaaa\");\n\t\t\t\t// Subtract Memory from Register - 16 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation on the MSB did NOT cause a carry from bit\n\t\t\t\t// 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xB4:\n\t\t\t\tSystem.out.println(\"ANDA, DIRECT, 4 cycles, 2 Bytes, -aa0-\\n\"\n\t\t\t\t\t\t+ \"Logical AND memory into register\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xB5:\n\t\t\t\tSystem.out.println(\"BITA, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Bit test\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xB6:\n\t\t\t\tSystem.out.println(\"LDA, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xB7:\n\t\t\t\tSystem.out.println(\"STA, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xB8:\n\t\t\t\tSystem.out.println(\"EORA, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Exclusive OR\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xB9:\n\t\t\t\tSystem.out.println(\"ADCA, EXTENDED, 5 cycles, 3 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xBA:\n\t\t\t\tSystem.out.println(\"ORA, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Inclusive OR Memory into Register\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if high order bits of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0xBB: // extended ADDA\n\t\t\t\tSystem.out.println(\"DAA, EXTENDED, 2 cycles, 1 Bytes, -aa0a\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xBC:\n\t\t\t\tSystem.out.println(\"CMPX, EXTENDED, 7 cycles, 3 Bytes, -aaaa\");\n\t\t\t\t// Compare memory from a Register - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 16 bit two's complement overflow\n\t\t\t\t// C set if operation on the MSB did NOT cause a carry from bit\n\t\t\t\t// 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xBD:\n\t\t\t\tSystem.out.println(\"JSR, EXTENDED, 8 cycles, 3 Bytes, -----\");\n\t\t\t\t// Jump to Subroutine at effective address\n\t\t\t\t// CCR unaffected\n\t\t\t\t// Program control transferred to location equivalent to EA\n\t\t\t\t// after storing return address on the hardware stack\n\t\t\t\tbreak;\n\t\t\tcase 0xBE:\n\t\t\t\tSystem.out.println(\"LDX, EXTENDED, 6 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xBF:\n\t\t\t\tSystem.out.println(\"STX, EXTENDED, 6 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xC0:\n\t\t\t\tSystem.out.println(\"SUBB, IMMEDIATE, 2 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// SUBA\n\t\t\t\t// Subtract Memory from Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xC1:\n\t\t\t\tSystem.out.println(\"CMPB, IMMEDIATE, 2 cycles, 2 Bytes, uaaaa\");\n\t\t\t\tbreak;\n\t\t\tcase 0xC2:\n\t\t\t\tSystem.out.println(\"SBCB, IMMEDIATE, 2 cycles, 2 Bytes, uaaaa\");\n\t\t\t\tbreak;\n\t\t\tcase 0xC3: // immediate ADDD\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"ADDD, IMMEDIATE, 4 cycles, 3 Bytes, -aaaa\\n\"\n\t\t\t\t\t\t\t\t+ \"Add memory into register - 16 bits\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 16 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused by MSB from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xC4:\n\t\t\t\tSystem.out.println(\"ANDA, DIRECT, 4 cycles, 2 Bytes, -aa0-\\n\"\n\t\t\t\t\t\t+ \"Logical AND memory into register\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xC5:\n\t\t\t\tSystem.out.println(\"BITB, IMMEDIATE, 2 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Bit test\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xC6:\n\t\t\t\tSystem.out.println(\"LDB, IMMEDIATE, 2 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xC8:\n\t\t\t\tSystem.out.println(\"EORB, IMMEDIATE, 2 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Exclusive OR\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xC9:\n\t\t\t\tSystem.out.println(\"ADCB, IMMEDIATE, 2 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xCA:\n\t\t\t\tSystem.out.println(\"ORB, IMMEDIATE, 2 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Inclusive OR Memory into Register\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if high order bits of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0xCB: // immediate ADDB\n\t\t\t\tSystem.out.println(\"ADDB, IMMEDIATE, 2 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xCC:\n\t\t\t\tSystem.out.println(\"LDD, IMMEDIATE, 3 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xCE:\n\t\t\t\tSystem.out.println(\"LDU, IMMEDIATE, 3 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xD0:\n\t\t\t\tSystem.out.println(\"SUBB, DIRECT, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// SUBA\n\t\t\t\t// Subtract Memory from Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xD1:\n\t\t\t\tSystem.out.println(\"CMPB, DIRECT, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Compare memory from a Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 8 bit two's complement overflow\n\t\t\t\t// C set if subtraction did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xD2:\n\t\t\t\tSystem.out.println(\"SBCB, DIRECT, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Subtract with Borrow\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if the operation causes an 8 bit 2's complement\n\t\t\t\t// overflow\n\t\t\t\t// C Set if the operation did NOT cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xD3:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"ADDD, IMMEDIATE, 4 cycles, 3 Bytes, -aaaa\\n\"\n\t\t\t\t\t\t\t\t+ \"Add memory into register - 16 bits\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 16 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused by MSB from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xD4:\n\t\t\t\tSystem.out.println(\"ANDA, DIRECT, 4 cycles, 2 Bytes, -aa0-\\n\"\n\t\t\t\t\t\t+ \"Logical AND memory into register\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xD5:\n\t\t\t\tSystem.out.println(\"BITB, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Bit test\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xD6:\n\t\t\t\tSystem.out.println(\"LDB, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xD7:\n\t\t\t\tSystem.out.println(\"STB, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xD8:\n\t\t\t\tSystem.out.println(\"EORB, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Exclusive OR\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xD9:\n\t\t\t\tSystem.out.println(\"ADCB, DIRECT, 4 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xDA:\n\t\t\t\tSystem.out.println(\"ORB, DIRECT, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Inclusive OR Memory into Register\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if high order bits of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0xDB: // direct ADDB\n\t\t\t\tSystem.out.println(\"ADDB, DIRECT, 4 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xDC:\n\t\t\t\tSystem.out.println(\"LDD, DIRECT, 5 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xDD:\n\t\t\t\tSystem.out.println(\"STD, DIRECT, 5 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xDE:\n\t\t\t\tSystem.out.println(\"LDU, DIRECT, 5 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xDF:\n\t\t\t\tSystem.out.println(\"STU, DIRECT, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Store Register Into Memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xE0:\n\t\t\t\tSystem.out.println(\"SUBB, INDEXED, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// SUBA\n\t\t\t\t// Subtract Memory from Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xE1:\n\t\t\t\tSystem.out.println(\"CMPB, INDEXED, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Compare memory from a Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 8 bit two's complement overflow\n\t\t\t\t// C set if subtraction did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xE2:\n\t\t\t\tSystem.out.println(\"SBCB, INDEXED, 4 cycles, 2 Bytes, uaaaa\");\n\t\t\t\t// Subtract with Borrow\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if the operation causes an 8 bit 2's complement\n\t\t\t\t// overflow\n\t\t\t\t// C Set if the operation did NOT cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xE3:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"ADDD, IMMEDIATE, 4 cycles, 3 Bytes, -aaaa\\n\"\n\t\t\t\t\t\t\t\t+ \"Add memory into register - 16 bits\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 16 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused by MSB from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xE4:\n\t\t\t\tSystem.out.println(\"ANDA, DIRECT, 4 cycles, 2 Bytes, -aa0-\\n\"\n\t\t\t\t\t\t+ \"Logical AND memory into register\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xE5:\n\t\t\t\tSystem.out.println(\"BITB, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Bit test\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xE6:\n\t\t\t\tSystem.out.println(\"LDB, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xE7:\n\t\t\t\tSystem.out.println(\"STB, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xE8:\n\t\t\t\tSystem.out.println(\"EORB, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Exclusive OR\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xE9:\n\t\t\t\tSystem.out.println(\"ADCB, INDEXED, 4 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xEA:\n\t\t\t\tSystem.out.println(\"ORB, INDEXED, 4 cycles, 2 Bytes, -aa0-\");\n\t\t\t\t// Inclusive OR Memory into Register\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if high order bits of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0xEB:\n\t\t\t\tSystem.out.println(\"ADDB, INDEXED, 4 cycles, 2 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xEC:\n\t\t\t\tSystem.out.println(\"DAA, INDEXED, 5 cycles, 2 Bytes, -aa0a\");\n\t\t\t\t// Decimal Addition Adjust\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if MSB of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V not defined\n\t\t\t\t// C set if the operation caused a carry from bit 7 in the ALU\n\t\t\t\t// or if the carry flag was set before the operation\n\t\t\t\tbreak;\n\t\t\tcase 0xED:\n\t\t\t\tSystem.out.println(\"STD, INDEXED, 5 cycles, 2 Bytes, -aa0a\");\n\t\t\t\t// Store Register Into Memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xEE:\n\t\t\t\tSystem.out.println(\"LDU, INDEXED, 5 cycles, 2 Bytes, -aa0a\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xEF:\n\t\t\t\tSystem.out.println(\"STU, INDEXED, 5 cycles, 2 Bytes, -aa0a\");\n\t\t\t\t// Store Register Into Memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xF0:\n\t\t\t\tSystem.out.println(\"SUBB, EXTENDED, 5 cycles, 3 Bytes, uaaaa\");\n\t\t\t\t// SUBA\n\t\t\t\t// Subtract Memory from Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V Set if the operation caused an 8 bit two's complement\n\t\t\t\t// overflow\n\t\t\t\t// C set if operation did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xF1:\n\t\t\t\tSystem.out.println(\"CMPB, EXTENDED, 5 cycles, 3 Bytes, uaaaa\");\n\t\t\t\t// Compare memory from a Register - 8 bits\n\t\t\t\t// H undefined\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if operation caused 8 bit two's complement overflow\n\t\t\t\t// C set if subtraction did NOT cause a carry from bit 7 in the\n\t\t\t\t// ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xF2:\n\t\t\t\tSystem.out.println(\"SBCB, EXTENDED, 5 cycles, 3 Bytes, uaaaa\");\n\t\t\t\t// Subtract with Borrow\n\t\t\t\t// H undefined\n\t\t\t\t// N Set if bit 7 of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Set if the operation causes an 8 bit 2's complement\n\t\t\t\t// overflow\n\t\t\t\t// C Set if the operation did NOT cause a carry from bit 7 in\n\t\t\t\t// the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xF3:\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"ADDD, IMMEDIATE, 4 cycles, 3 Bytes, -aaaa\\n\"\n\t\t\t\t\t\t\t\t+ \"Add memory into register - 16 bits\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 16 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused by MSB from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xF4:\n\t\t\t\tSystem.out.println(\"ANDA, DIRECT, 4 cycles, 2 Bytes, -aa0-\\n\"\n\t\t\t\t\t\t+ \"Logical AND memory into register\");\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of the result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xF5:\n\t\t\t\tSystem.out.println(\"BITB, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Bit test\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z Set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xF6:\n\t\t\t\tSystem.out.println(\"LDB, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xF7:\n\t\t\t\tSystem.out.println(\"STB, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 8 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 7 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xF8:\n\t\t\t\tSystem.out.println(\"EORB, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Exclusive OR\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 7 of result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xF9:\n\t\t\t\tSystem.out.println(\"ADCB, EXTENDED, 5 cycles, 3 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xFA:\n\t\t\t\tSystem.out.println(\"ORB, EXTENDED, 5 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Inclusive OR Memory into Register\n\t\t\t\t// H not affected\n\t\t\t\t// N Set if high order bits of result set\n\t\t\t\t// Z Set if all bits of the result are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Not affected\n\t\t\t\tbreak;\n\t\t\tcase 0xFB: // extended ADDB\n\t\t\t\tSystem.out.println(\"ADDB, EXTENDED, 5 cycles, 3 Bytes, aaaaa\");\n\t\t\t\t// H set if carry caused from bit 3 in the ALU\n\t\t\t\t// N set if bit 7 of the result is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V set if 8 bit two's compliment arithmetic overflow caused\n\t\t\t\t// C set if carry caused from bit 7 in the ALU\n\t\t\t\tbreak;\n\t\t\tcase 0xFC:\n\t\t\t\tSystem.out.println(\"LDD, EXTENDED, 6 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xFD:\n\t\t\t\tSystem.out.println(\"STD, EXTENDED, 6 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xFE:\n\t\t\t\tSystem.out.println(\"LDU, EXTENDED, 6 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Load Register from memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N set if bit 15 of loaded data is set\n\t\t\t\t// Z set if all bits of result are clear\n\t\t\t\t// V cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C unaffected\n\t\t\t\tbreak;\n\t\t\tcase 0xFF:\n\t\t\t\tSystem.out.println(\"STU, EXTENDED, 6 cycles, 3 Bytes, -aa0-\");\n\t\t\t\t// Store Register Into Memory - 16 bits\n\t\t\t\t// H unaffected\n\t\t\t\t// N Set if bit 15 of stored data was set\n\t\t\t\t// Z Set if all bits of stored data are clear\n\t\t\t\t// V Cleared\n\t\t\t\tccrFlagState.setVBit(false);\n\t\t\t\t// C Unaffected\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Not a valid Op Code\");\n\n\t\t\t}\n\n\t\t} catch (NumberFormatException e) {\n\n\t\t\tJOptionPane\n\t\t\t\t\t.showMessageDialog(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"Incorrect syntax. Please enter only decimal or hexadecimal values.\",\n\t\t\t\t\t\t\t\"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\tSystem.out.println(\"incorrect syntax entered\");\n\t\t}\n\t}", "public void setDataCode(String dataCode);", "public String getCode () {\r\n\t\treturn code;\r\n\t}", "public byte getCode();", "private void printCodeProcedure(String code, BinaryTreeInterface<HuffmanData> tree) {\n\t\t\t\tif (tree == null) {\n\n\t\t\t\t} else {\n\t\t\t\t\tprintCodeProcedure(code + \"0\", tree.getLeftSubtree());\n\t\t\t\t\tprintCodeProcedure(code + \"1\", tree.getRightSubtree());\n\t\t\t\t\tif (tree.getRootData().getSymbol() != '\\u0000') {\n\t\t\t\t\t\tSystem.out.println(tree.getRootData().getSymbol() + \": \" + code);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t}", "@Override\r\n\tpublic String getCode() {\n\t\treturn code;\r\n\t}", "String getMapCode();", "C8325a mo21498a(String str);", "@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}", "public String getCode() {\r\n\t\treturn code;\r\n\t}", "public String getCode() {\r\n\t\treturn code;\r\n\t}", "public void addcode(String code){//להחליף את סטרינג למחלקה קוד או מזהה מספרי של קוד\r\n mycods.add(code);\r\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "@Test\r\n\t\tpublic void testTokenizeOperation() {\r\n\t\t\t\t\t\t\t\r\n\t\t\tdriver.findElement(By.id(\"code_code\")).sendKeys(\"a = 5\\nb = 6\\nc = a + (b * 4)\");;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\tWebElement submitButton = driver.findElement(By.name(\"commit\"));\r\n\t\t\tsubmitButton.click();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tWebElement e = driver.findElement(By.tagName(\"code\"));\r\n\t\t\t\tString elementText = e.getText();\r\n\t\t\t\tassertTrue(elementText.contains(\":on_op\"));\r\n\t\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\t\tfail();\r\n\t\t\t}\r\n\t\t}", "public String getCode() {\n\t\treturn code;\n\t}", "public String getCode() {\n\t\treturn code;\n\t}", "public String getCode() {\n\t\treturn code;\n\t}", "public String getCode() {\n\t\treturn code;\n\t}", "public String getCode() {\n\t\treturn code;\n\t}", "public String getCode() {\n\t\treturn code;\n\t}", "public java.lang.String getCode() {\r\n return code;\r\n }", "private String identingCode(int offset, String codeSnippet) {\n\t\tStringBuilder code = new StringBuilder();\n\t\tString[] lineBroken = codeSnippet.split(\"\\n\");\n\t\tfor(int index=0; index < lineBroken.length; index++) {\n\t\t\tString line = lineBroken[index];\n\t\t\tStringBuilder tmpLine = new StringBuilder();\n\t\t\tif(index != 0) {\n\t\t\t\tfor(int i=0; i<offset; i++) {\n\t\t\t\t\ttmpLine.append(\"\");\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmpLine.append(line.replace(\"\\t\", \"\")).append(\"\\n\");\n\t\t\tcode.append(tmpLine);\n\t\t}\n\t\treturn code.toString();\n\t}", "public java.lang.String getCode() {\n java.lang.Object ref = code_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n code_ = s;\n return s;\n }\n }", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "public String getCode()\n {\n return code;\n }", "public void addToCode(String code){\r\n\t\tiCode+=getTabs()+code+\"\\n\";\r\n\t}", "String getAdditionalCode();", "String getAdditionalCode();", "String getAdditionalCode();", "void mo1582a(String str, C1329do c1329do);", "@AutoEscape\n\tpublic String getCodProvincia();", "public MathEquation(char opCode) {\n this.opCode = opCode;\n }", "public void setCode(java.lang.String code) {\r\n this.code = code;\r\n }", "public String getCode() { \n\t\treturn getCodeElement().getValue();\n\t}", "private static String interpret(int code, String id) {\n\t\tStringBuilder sb = new StringBuilder();\t// String that contains the interpreted message\n\t\t\n\t\tsb.append(\"\\n-=-=-= \").append(DTF.format(LocalDateTime.now())).append(\" =-=-=-\");\n\t\tsb.append('\\n').append((code % 2 == 0) ? \"Successful\" : \"Failed\").append(\" attempt to \");\n\t\tcode /= 2;\n\t\t\n\t\tswitch(code) {\n\t\t\tcase 0:\n\t\t\t\tsb.append(\"register\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 1:\n\t\t\t\tsb.append(\"login\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 2:\n\t\t\t\tsb.append(\"create new topic\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 3:\n\t\t\t\tsb.append(\"post new comment\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 4:\n\t\t\t\tsb.append(\"edit topic\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 5:\n\t\t\t\tsb.append(\"display topics\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 6:\n\t\t\t\tsb.append(\"display user ranking\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 7:\n\t\t\t\tsb.append(\"unable to get user\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tsb.append(\"\\nFailed to interpret message\");\n\t\t}\n\t\t\n\t\tsb.append('\\n').append(\"by: \").append(id);\n\t\tsb.append('\\n').append(\"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\").append('\\n');\n\t\treturn sb.toString();\n\t}", "public abstract int code();", "public void generateCode() {\n\t\tthis.setCharacter();\n\t}", "public void setCode(String code){\n\t\tthis.code = code;\n\t}", "public void setCode(byte[] code);", "public String getCode() {\n\t\treturn Code;\n\t}", "public String getIntermidiateCode(){\r\n\t\treturn iCode;\r\n\t}" ]
[ "0.6439298", "0.6439298", "0.62384254", "0.62384254", "0.62384254", "0.62384254", "0.62384254", "0.59621876", "0.5923648", "0.58538926", "0.58538926", "0.58236796", "0.58187664", "0.5817088", "0.5814269", "0.57879955", "0.57846785", "0.57373583", "0.5682941", "0.5660437", "0.56588346", "0.56439734", "0.5623939", "0.56161493", "0.5609033", "0.5601104", "0.55786043", "0.5560909", "0.5523345", "0.5523345", "0.5523345", "0.5523345", "0.5523345", "0.5523345", "0.5523345", "0.5517771", "0.55169153", "0.55082196", "0.55067974", "0.5500493", "0.5492136", "0.5486289", "0.5476876", "0.54759026", "0.54737574", "0.5468224", "0.5466734", "0.5466734", "0.5462195", "0.5454002", "0.5454002", "0.5454002", "0.5454002", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.5431078", "0.542684", "0.5421896", "0.5421896", "0.5421896", "0.5421896", "0.5421896", "0.5421896", "0.54184115", "0.54159266", "0.5415307", "0.5405385", "0.5398912", "0.5397701", "0.53811705", "0.53811705", "0.53811705", "0.5380984", "0.5367773", "0.5352013", "0.5346016", "0.53431976", "0.53349614", "0.53151166", "0.53133845", "0.53030825", "0.5292445", "0.528145", "0.52781296" ]
0.0
-1
Overridden toString with custom formatting
@Override public String toString() { return super.toString() + "\nChemical Name: " + chemicalName + "\nHazards: " + hazards + "\nPrecautions: " + precautions + "\nFirst Aid: " + firstAid + "\nUses: " + uses; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override String toString();", "public String toString(){\n return \"Format: \" + format +\", \" + super.toString(); \n }", "public String toString()\n {\n return toString((Format) null);\n }", "@Override public String toString();", "protected abstract String format();", "@Override\n\tpublic String toString()\n\t{\n\t\treturn toString(Locale.getDefault(Locale.Category.FORMAT));\n\t}", "@Override\r\n String toString();", "@Override\n String toString();", "@Override\n String toString();", "protected String getToStringFormat()\n {\n return getClass().getSimpleName() + \"@\"\n + Integer.toHexString(hashCode()) + \": { \"\n + \"offset = 0x\" + Integer.toHexString(offset) + \"; \"\n + \"size = \" + size + \"; \"\n + \"%s\"\n + \"value = \" + getValue() + \"; \"\n + \"isAccessible = \" + isAccessible() + \"; \"\n + \"checksum = 0x\" + Integer.toHexString(checksum()) + \"; \"\n + \"}\";\n }", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "public String toString() { return stringify(this, true); }", "@Override\n\tpublic abstract String toString();", "@Override\n\tpublic String toString() {\n\t\tString str_a, str_b, str_c, str_d;\n\t\tstr_a = (a==null)?\"\":a.toString();\n\t\tstr_b = (b==null)?\"\":b.toString();\n\t\tstr_c = (c==null)?\"\":c.toString();\n\t\tstr_d = (d==null)?\"\":d.toString();\n\t\t\n\t\treturn String.format(\"%d(%s)(%s)(%s)(%s)\", this.color, str_a, str_b, str_c, str_d);\n\t}", "@Override\r\n\tpublic String toString();", "@GwtIncompatible(\"String.format()\")\n/* */ public String toString() {\n/* 171 */ return toString(4);\n/* */ }", "@Override\n\tString toString();", "@Override\r\n public String toString();", "@Override\n public final String toString() {\n return asString(0, 4);\n }", "@Override\n\tpublic abstract String toString ();", "@Override\n\tpublic String toString();", "@Override\n public String toString() {\n return toString(false, true, true, null);\n }", "@Override\n public String toString()\n {\n\n String str = String.format(\"%5d %-20s %2c %11.2f\",id,name,rarity,value);\n\n return str;\n }", "@Override\n public String toString();", "@Override\n public String toString();", "public String toString()\r\n\t{\r\n\t\treturn String.format(\"%6d \" + super.getDescription() + \" \" +\r\n\t\t\t\tsuper.getPriority() + \" \" + \"%5d \" + super.getStatus() + \r\n\t\t\t\tdate, super.getIDNumber(), super.getOrder()); //make the Strings both a set length somehow\r\n\t}", "public String toString() ;", "@Override\n String toString();", "@Override\n public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public String toString() {\r\n return ToStringBuilder.reflectionToString(this,\r\n ToStringStyle.MULTI_LINE_STYLE);\r\n }", "@Override()\n public String toString()\n {\n final StringBuilder buffer = new StringBuilder();\n toString(buffer);\n return buffer.toString();\n }", "@Override\n\tpublic String toString() {\n\t\tif (repr == null)\n\t\t\trepr = toString(null);\n\n\t\treturn repr;\n\t}", "@Override\n public final String toString() {\n \t\n \treturn String.format(\"[%1$s [%2$s\\t%3$s\\t%4$s]%1$s [%5$s\\t%6$s\\t%7$s]%1$s [%8$s\\t%9$s\\t%10$s] ]\", System.getProperty(\"line.separator\"), this.m00, this.m01, this.m02,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t this.m10, this.m11, this.m12,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t this.m20, this.m21, this.m22);\n }", "@Override\n public String toString() {\n return new Gson().toJson(this);\n }", "@Override\n public synchronized String toString() {\n return super.toString();\n }", "@Override\n public String toString(){\n return toString(false);\n }", "public String toString(){\r\n\t\tString superString = super.toString();\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\t//Add the object to the string\r\n\t\tbuilder.append(\". \");\r\n\t\tif (this.error != null) {\r\n\t\t\tbuilder.append(error.toString());\r\n\t\t\tbuilder.append(\". \");\r\n\t\t}\r\n\t\tbuilder.append(\"Object: \");\r\n\t\tbuilder.append(object.toString());\r\n\t\tif (this.recordRoute)\r\n\t\t\tbuilder.append(\", [RECORD_ROUTE]\");\r\n\t\tif (this.reRouting) \r\n\t\t\tbuilder.append(\", [RE-ROUTING]\");\r\n\t\t//Add the masks to the string\r\n\t\tif (this.mask != null) {\r\n\t\t\tbuilder.append(\", label set: \");\r\n\t\t\tbuilder.append(mask.toString());\r\n\t\t}\r\n\t\treturn superString.concat(builder.toString());\r\n\t}", "public String toString(){\r\n\t\tString output=\"\";\r\n\t\toutput+=super.toString();\r\n\t\treturn output;\r\n\t}", "@Override\n public String toString() {\n final Map<String, Object> augmentedToStringFields = Reflect.getStringInstanceVarEntries(this);\n augmentToStringFields(augmentedToStringFields);\n return Reflect.joinStringMap(augmentedToStringFields, this);\n }", "public String toString()\n\t{\n\t\treturn Printer.stringify(this, false);\n\t}", "@Override\r\n\t\tpublic String toString() {\n\t\t\treturn super.toString();\r\n\t\t}", "@Override\n public String toString(Object value, String formatString, Locale locale) {\n return toString((String) value, formatString, locale);\n }", "@Override //indicates that this method overrides a superclass method\n public String toString(){\n\n return String.format(\"%s: %s %s%n%s : %s%n%s: %.2f%n%s: %.2f\",\"commission employee\",firstName,lastName,\n \"pan number\",panCardNumber,\"gross sales\",grossSales,\"commission rate\",commissionRate);\n }", "@Override\n\tpublic String toString() {\n\t\treturn toText();\n\t}", "@Override\n public String toString() {\n return (this.str);\n }", "public String toString() {\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"%s with p=%.2f, r=%.2f and f=%.2f\", this.getClass().getSimpleName(), this.p, this.r, this.f);\n\t}", "public String toString() {\n\t\t\tStringBuilder sb = new StringBuilder(\"%\");\n\t\t\t// Flags.UPPERCASE is set internally for legal conversions.\n\t\t\tFlags dupFlag = flag.dup().remove(Flags.UPPERCASE);\n\t\t\tsb.append(dupFlag.toString());\n\t\t\tif (index > 0) {\n\t\t\t\tsb.append(index).append('$');\n\t\t\t}\n\t\t\tif (width != -1) {\n\t\t\t\tsb.append(width);\n\t\t\t}\n\t\t\tif (precision != -1) {\n\t\t\t\tsb.append('.').append(precision);\n\t\t\t}\n\t\t\tif (isDateConversion) {\n\t\t\t\tsb.append(flag.contains(Flags.UPPERCASE) ? 'T' : 't');\n\t\t\t}\n\t\t\tsb.append(flag.contains(Flags.UPPERCASE)\n\t\t\t\t\t? Character.toUpperCase(conversionChar) : conversionChar);\n\t\t\treturn sb.toString();\n\t\t}", "@Override\n public String toString() {\n return new JSONSerializer().serialize(this);\n }", "public String toString() {\r\n\t\t\r\n\t\treturn super.toString();\r\n\t\t\r\n\t}", "@Override\r\n public String toString() {\n return super.toString();\r\n }", "public String toString() {\n \t\treturn super.toString();\n \t}", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString() {\n\t\treturn String.format( \"%s: %s\\n%s: $%,.2f; %s:%.2f\",\r\n\t\t\t\t \"commission employee\", super.toString(),\r\n\t\t\t\t \"gross sales\", getGrossSales(),\r\n\t\t\t\t \"commission rate\", getCommissionRate() );\r\n\t}", "@Override\n public String toString(){\n \n return String.format(\"%-8d%-10s%-10s%-10s %.2f\\t%-6b\", getCustNumber(), getFirstName(), getSurname(),\n getPhoneNum(), getCredit(), canRent);\n }", "public String toString()\r\n\t{\r\n\t\tString output = \" \";\r\n\t\tString specialModifier = \" \";\r\n\t\tif(this.isSpecial())\r\n\t\t{\r\n\t\t\tspecialModifier = \" *\";\r\n\t\t}\r\n\t\t\t\r\n\t\toutput = String.format(\"%-9s%-5s%-19s%s%.2f\",getType(), specialModifier, this.getName(),\"$ \", this.getPrice());\r\n\t\t//code to be done here\r\n\t\t\r\n\t\t\r\n\t\treturn output;\r\n\t}", "@Override\r\n public String toString() {\n return super.toString();\r\n }", "@Override\n public String toString() {\n String str = \"\";\n\n //TODO: Complete Method\n\n return str;\n }" ]
[ "0.82111955", "0.80174524", "0.7761873", "0.7754214", "0.7731923", "0.764004", "0.76247734", "0.75563073", "0.75563073", "0.75260395", "0.7495729", "0.7495729", "0.7495729", "0.7495729", "0.7495729", "0.7495729", "0.7495729", "0.7483466", "0.74798393", "0.7469623", "0.7464333", "0.746343", "0.74390244", "0.7428636", "0.74060893", "0.73733157", "0.734347", "0.73363644", "0.73223823", "0.7321258", "0.7321258", "0.7294403", "0.7289546", "0.72747105", "0.7269199", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7258996", "0.7188685", "0.7183269", "0.715971", "0.7159578", "0.7158368", "0.71483505", "0.71274096", "0.7122965", "0.71174926", "0.7102765", "0.7089041", "0.70882756", "0.7082109", "0.7080906", "0.7070998", "0.70695555", "0.70654553", "0.7064493", "0.7061894", "0.7057712", "0.70526546", "0.7049618", "0.7047262", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.70417666", "0.704049", "0.7036225", "0.7030525", "0.70223844", "0.70213085" ]
0.0
-1
Gets the "colleagues" element
public andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues getColleagues() { synchronized (monitor()) { check_orphaned(); andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues target = null; target = (andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues)get_store().find_element_user(COLLEAGUES$0, 0); if (target == null) { return null; } return target; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Profile[] getColleagues(Profile profile) {\n\t\treturn getColleagues(profile,null);\n\t}", "public Profile[] getColleagues(Profile profile, Map<String, String> parameters){\n\t\tif (logger.isLoggable(Level.FINEST)) {\n\t\t\tlogger.entering(sourceClass, \"getColleagues\", parameters);\n\t\t}\n\t\tDocument data = null;\n\t\tProfile[] colleagues = null;\n\t\tif(parameters == null)\n\t\t\tparameters = new HashMap<String, String>();\n\t\ttry {\n\t\t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n\t\t\t\t\tProfileType.GETCOLLEAGUES.getProfileType());\n\t\t\tif (isEmail(profile.getReqId())) {\n\t\t\t\tparameters.put(\"email\", profile.getReqId());\n\t\t\t} else {\n\t\t\t\tparameters.put(\"userid\", profile.getReqId());\n\t\t\t}\n\t\t\t\n\t\t\tif(parameters.get(\"connectionType\") != null)// this is to remove any other values put in by sample user in following\n\t\t\t\tparameters.remove(\"connectionType\");\t// mandatory parameters\n\t\t\tif(parameters.get(\"outputType\") != null)\n\t\t\t\tparameters.remove(\"outputType\");\n\t\t\tparameters.put(\"connectionType\",\"colleague\");\n\t\t\tparameters.put(\"outputType\",\"profile\");\n\t\t\t\n\t\t\tdata = (Document)getClientService().get(url, parameters);\n\t\t\tcolleagues = Converter.convertToProfiles(this, data);\n\t\t} catch (ClientServicesException e) {\n\t\t\tif (logger.isLoggable(Level.SEVERE)) {\n\t\t\t\tlogger.log(Level.SEVERE, \"Error encountered while getting colleagues information\", e);\n\t\t\t}\n\t\t}\n\t\tif (logger.isLoggable(Level.FINEST)) {\n\t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n\t\t}\n\t\treturn colleagues;\n\n\t}", "public Profile[] getColleagues(Profile profile) throws ProfileServiceException{\n \t\treturn getColleagues(profile,null);\n \t}", "public andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues addNewColleagues()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues target = null;\r\n target = (andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues)get_store().add_element_user(COLLEAGUES$0);\r\n return target;\r\n }\r\n }", "public Profile[] getColleagues(Profile profile, Map<String, String> parameters)\n \tthrows ProfileServiceException{\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"getColleagues\", parameters);\n \t\t}\n \t\tif (profile == null) {\n \t\t\tthrow new IllegalArgumentException(StringUtil.format(\"A null profile was passed\"));\n \t\t}\n \t\tDocument data = null;\n \t\tProfile[] colleagues = null;\n \t\tif(parameters == null)\n \t\t\tparameters = new HashMap<String, String>();\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTIONS.getProfileType());\n \t\tif (isEmail(profile.getReqId())) {\n \t\t\tparameters.put(ProfileRequestParams.EMAIL, profile.getReqId());\n \t\t} else {\n \t\t\tparameters.put(ProfileRequestParams.USERID, profile.getReqId());\n \t\t}\n \n \t\tif(parameters.get(\"connectionType\") != null)// this is to remove any other values put in by sample user in following\n \t\t\tparameters.remove(\"connectionType\");\t// mandatory parameters\n \t\tif(parameters.get(\"outputType\") != null)\n \t\t\tparameters.remove(\"outputType\");\n \t\tparameters.put(\"connectionType\",\"colleague\");\n \t\tparameters.put(\"outputType\",\"profile\");\n \n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tcolleagues = Converter.convertToProfiles(this, data);\n \n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n \t\t}\n \t\treturn colleagues;\n \n \t}", "public String getColl(){\n return this.college;\n }", "public void setColleagues(andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues colleagues)\r\n {\r\n generatedSetterHelperImpl(colleagues, COLLEAGUES$0, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);\r\n }", "public League getLeague()\n\t{\n\t\treturn league;\n\t}", "private Element traverse_collaborative(Element element) {\n \ttry {\n\t \tString userid = profile.getAttributeValue(\"personal\", \"id\");\n\t \tString course = profile.getAttributeValue(\"personal\", \"course\");\n\t \tString context = WOWStatic.config.Get(\"CONTEXTPATH\");\n\n\t \tElement a = doc.createElement(\"a\");\n\t \ta.setAttribute(\"href\", context + \"/Get?wndName=Collaborative\");\n\t \ta.setAttribute(\"target\", userid + \"$\" + course);\n\t \ta.appendChild(doc.createTextNode(\"Collaborative\"));\n\t \treturn (Element)replaceNode(element, a);\n \t}\n \tcatch(Throwable e) {\n \t\te.printStackTrace();\n \t\treturn (Element)replaceNode(element, createErrorElement(\"Error!\"));\n \t}\n }", "public League getLeagueName() {\n return leagueName;\n }", "private Collection<ConnectionEntry> getColleaguesInCommon(String sourceId, String targetId, Map<String, String> parameters) throws ProfileServiceException{\n \t\t\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"checkColleague\");\n \t\t}\n \t\tif (StringUtil.isEmpty(sourceId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_4);\n \t\t}\n \t\tif (StringUtil.isEmpty(targetId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_5);\n \t\t}\n \t\tDocument data = null;\n \t\tif(parameters == null){\n \t\t\tparameters = new HashMap<String, String>();\n \t\t}\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTIONS_IN_COMMON.getProfileType());\n \t\tif (isEmail(sourceId)) {\n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.EMAIL, value.toString());\n \t\t} else {\n \n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.USERID, value.toString());\n \t\t}\n \t\tparameters.put(\"connectionType\",\"colleague\");\n \n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tCollection<ConnectionEntry> colleaguesInCommon = Converter.returnConnectionEntries(data, \"connectionEntry\");\n \n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n \t\t}\n \t\treturn colleaguesInCommon;\n \t\t\n \t}", "public ArrayList<String> getColaboradores() {\n return colaboradores;\n }", "public String getCollegeName() {\n return collegeName;\n }", "public String getCollegeName() {\n return collegeName;\n }", "Collection getCommunities();", "public ArrayList getLecturers();", "Lecturer getLecturerWhoOfers(Project proj)\n {\n for(Lecturer lecturer :lectors)\n {\n for(Project project :lecturer.getProjectOfered())\n {\n if(proj.equals(project))\n {\n return lecturer;\n }\n }\n }\n return null;\n }", "public Colour getWinner(){\n\t\treturn winner;\n\t}", "public Rogue getRogue() {\n return (gameRoomBelongsTo);\n }", "public ArrayList<CollegeFootballTeam> getTeamList();", "public Board getOpponentsBoard() {\n return opponentsBoard;\n }", "public Lobby getLobbyFrame() {\r\n return lobbyFrame;\r\n }", "public String getOpponentName() {\n return opponentName;\n }", "public static Lecturer getLecturers() {\n HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create(\"http://localhost:8080/lecturers/findFirstLecturer/\" + MainApp.getCurrentUser().getRoomId())).build();\n HttpResponse<String> response = null;\n try {\n response = client.send(request, HttpResponse.BodyHandlers.ofString());\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n if (response.statusCode() != 200) {\n System.out.println(\"Status: \" + response.statusCode());\n }\n return gson.fromJson(response.body(), new TypeToken<Lecturer>() {\n }.getType());\n }", "public String[] getContributors() {\n/* 82 */ return getStringArray(\"contributor\");\n/* */ }", "public Player getOpponent() {\n\t\treturn opponent;\n\t}", "void findOpponent() {\n\t\tif(gameHelper == null){return;}\n\t\tif (gameHelper.isSignedIn()) {\n\t\t\tIntent intent = Games.TurnBasedMultiplayer\n\t\t\t\t\t.getSelectOpponentsIntent(gameHelper.getApiClient(), 1, 1);\n\t\t\tstartActivityForResult(intent, RC_SELECT_PLAYERS);\n\t\t} else if (gameHelper.isConnecting()) {\n\t\t\tToast.makeText(getActivity(), R.string.wait_connecting_to_google,\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t}\n\t}", "public CaseRecherchee getCheminEnCours() {\n int index = listeOuverte.indexOf(caseArrivee);\n return index != -1 ? listeOuverte.get(index) : null;\n }", "public Lecturers getLecTable();", "Match getTeam1LooserOfMatch();", "Match getTeam2LooserOfMatch();", "private ConnectionEntry checkColleague(String sourceId, String targetId, Map<String, String> parameters) throws ProfileServiceException{\n \t\t\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"checkColleague\");\n \t\t}\n \t\tif (StringUtil.isEmpty(sourceId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_4);\n \t\t}\n \t\tif (StringUtil.isEmpty(targetId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_5);\n \t\t}\n \t\tDocument data = null;\n \t\tif(parameters == null){\n \t\t\tparameters = new HashMap<String, String>();\n \t\t}\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTION.getProfileType());\n \t\tif (isEmail(sourceId)) {\n \t\t\tparameters.put(ProfileRequestParams.SOURCEEMAIL, sourceId);\n \t\t} else {\n \t\t\tparameters.put(ProfileRequestParams.SOURCEUSERID, sourceId);\n \t\t}\n \t\tif (isEmail(targetId)) {\n \t\t\tparameters.put(ProfileRequestParams.TARGETEMAIL, targetId);\n \t\t} else {\n \t\t\tparameters.put(ProfileRequestParams.TARGETUSERID, targetId);\n \t\t}\n \t\tparameters.put(\"connectionType\",\"colleague\");\n \n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tConnectionEntry connection = Converter.returnConnectionEntries(data, \"connectionEntry\").iterator().next();\n \n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n \t\t}\n \t\treturn connection;\n \t\t\n \t}", "public String getAwayTeam();", "public POGOProtos.Rpc.CombatProto.CombatPlayerProto getOpponent() {\n if (opponentBuilder_ == null) {\n return opponent_ == null ? POGOProtos.Rpc.CombatProto.CombatPlayerProto.getDefaultInstance() : opponent_;\n } else {\n return opponentBuilder_.getMessage();\n }\n }", "public String getLecturer() {\n return lecturer;\n }", "public Iterator getLobbies() {\n rrwl_lobbylist.readLock().lock();\n try {\n return lobbyList.iterator();\n } finally {\n rrwl_lobbylist.readLock().unlock();\n }\n }", "public String getHomeTeam();", "public ArrayList<Casella> getGrup()\n\t{\n\t\treturn grup;\n\t}", "private JComboBox getOrgCmb() {\r\n cmbOrganization = new JComboBox();\r\n \r\n vOrganizations = getProposalSubOrgs();\r\n\r\n CoeusVector cvOrgs = new CoeusVector();\r\n \tcvOrgs.add(0, \"\");\r\n\r\n HashMap mapRow = new HashMap();\r\n \tfor (int c=0;c<vOrganizations.size();c++) {\r\n mapRow = (HashMap) vOrganizations.elementAt(c);\r\n \tcvOrgs.add(c+1,(String)mapRow.get(\"LOCATION_NAME\"));\r\n \t}\r\n \t\r\n \tcmbOrganization.setModel(new DefaultComboBoxModel(cvOrgs));\r\n return cmbOrganization;\r\n }", "public String getCommunity() {\n return this.community;\n }", "public String[][] getRoster(){\r\n\t\treturn roster;\r\n\t}", "public ArrayList<String> collegeList() throws Exception {\n\t\tConnection con = null;\n\t\tcon = DBConnector.dbConnection();\n\t\tArrayList<String> colleges = new ArrayList<String>();\n\t\ttry {\n\t\t\tPreparedStatement st = con.prepareStatement(\"select college_name from college\");\n\n\t\t\tResultSet rs = st.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tcolleges.add(rs.getString(1));\n\t\t\t}\n\t\t\tcon.close();\n\t\t} catch (SQLSyntaxErrorException e) {\n\t\t\tthrow new SQLSyntaxErrorException(\"Error in SQL syntax\");\n\t\t} catch (SQLException e) {\n\t\t\tthrow new SQLException(\"Connection with database failed\");\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(\"Some error occured\");\n\t\t}\n\n\t\treturn colleges;\n\t}", "public LobbyList getLobbyList()\r\n\t{\r\n\t\treturn receiver.getList();\r\n\t}", "public String getClubname() {\n\t\treturn clubname;\r\n\t}", "@java.lang.Override\n public POGOProtos.Rpc.CombatProto.CombatPlayerProto getOpponent() {\n return opponent_ == null ? POGOProtos.Rpc.CombatProto.CombatPlayerProto.getDefaultInstance() : opponent_;\n }", "@java.lang.Override\n public POGOProtos.Rpc.CombatProto.CombatPlayerProtoOrBuilder getOpponentOrBuilder() {\n return getOpponent();\n }", "public CommunityDetection getLeung() {\n return leung;\n }", "public persona getContribuyente() {\n return contribuyente;\n }", "public Color getColor()\n {\n return mTeam.getColor();\n }", "public static Team getSecondPlace() {\n\t\tif (matches != null && matches.length > 0 && matches[0] != null)\n\t\t\treturn matches[0].getLoser();\n\t\treturn null;\n\t}", "public int getLeagueId() {\n return leagueId;\n }", "public int getCollegeNum() {\r\n\t\treturn collegeNum;\r\n\t}", "public Room getRoom(Color col){\n for(Room room: rooms){\n if(room.getColor() == col)\n return room;\n }\n return null; //TODO add exception\n }", "public ArrayList<Scholar> getCommitteeMembers(){\r\n\t\treturn committeeMembers;\r\n\t}", "public Couleurs getCouleursChoisies() {\n if (couleursPreferees.isEmpty()) {\n return Couleurs.BLEUBLANC;\n }\n return (Couleurs) (couleursPreferees.toArray())[couleursChoisies];\n }", "java.lang.String getParticipants(int index);", "public Integer getCollege_id() {\n\t\treturn college_id;\n\t}", "public Team getTeamBlue() {\r\n return teamBlue;\r\n }", "public String getGovernor()\n\t{\n\t\tassert this.cursor != null;\n\t\treturn this.cursor.getString(2);\n\t}", "public Battleable getOpponent()\n\t{\n\t\t/* TODO: Inherited function from Character Interface, requires implementation! */\n\t\treturn null;\n\t}", "private void getCommunity() {\n DatabaseReference ref = FirebaseDatabase.getInstance()\n .getReference(\"Communities\").child(communityId);\n\n ref.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n Community community = snapshot.getValue(Community.class);\n communityName = community.getName();\n getSupportActionBar().setTitle(communityName);\n Glide.with(getBaseContext()).load(community.getImage()).into(communityProfile);\n description.setText(community.getDescription());\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n }", "public List<String> getParticipantsCollections() {\n try {\n List<String> colNames = new ArrayList<>();\n MongoIterable<String> collections = database.listCollectionNames();\n for (String collection : collections) {\n if (collection.startsWith(\"PARTICIPANTS\")) {\n colNames.add(collection);\n }\n }\n return colNames;\n } catch (MongoException e) {\n System.err.println(e.getCode() + \" \" + e.getMessage());\n return null;\n }\n }", "@Override\n public String toString() {\n return bestCommunity + \"\";\n }", "public List<Contact> getParticipants()\n {\n return new LinkedList<Contact>(participants.values());\n }", "ConferenceMember getConferenceMember(CallPeer peer, Component visualComponent);", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getConsortium() {\n return (java.lang.String)__getInternalInterface().getFieldValueForCodegen(CONSORTIUM_PROP.get());\n }", "@GET(\"v1/competitions/\")\n Call<List<Leagues>> getAllData();", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getConsortium() {\n return (java.lang.String)__getInternalInterface().getFieldValueForCodegen(CONSORTIUM_PROP.get());\n }", "public List<Currcycnct> getCurrcycnct()\n/* */ {\n/* 68 */ return this.currcycnct;\n/* */ }", "public String getCommunityName() {\n return communityName;\n }", "public com.besixplus.sii.objects.Cgg_jur_anticipo getCgg_jur_anticipo(){\n\t\treturn this.myCgg_jur_anticipo;\n\t}", "public Club employeur() {\n Embauche dernierEmbauche = myEmployees.get(myEmployees.size()-1);\n if(dernierEmbauche.estTerminee()){\n return null;\n }\n return dernierEmbauche.getEmployeur();\n }", "@Override\n\tpublic College getModel() {\n\t\treturn college;\n\t}", "public Clue getClue(String clue)\n {\n return clues.get(clue);\n }", "public POGOProtos.Rpc.CombatProto.CombatPlayerProto.Builder getOpponentBuilder() {\n \n onChanged();\n return getOpponentFieldBuilder().getBuilder();\n }", "public Set<Colour> getWinningPlayers();", "public WebElement Col() {\r\n\t\treturn SeleniumUtil.getVisibileWebElement(d, \"Col_T\", \"CashFlow\", null);\r\n\t}", "ArrayList<String> getLeaderboardUsers() {\r\n return leaderboardUsers;\r\n }", "public Long getCollegeId() {\n return collegeId;\n }", "public Integer getgOtherPeople() {\n return gOtherPeople;\n }", "public POGOProtos.Rpc.CombatProto.CombatPlayerProtoOrBuilder getOpponentOrBuilder() {\n if (opponentBuilder_ != null) {\n return opponentBuilder_.getMessageOrBuilder();\n } else {\n return opponent_ == null ?\n POGOProtos.Rpc.CombatProto.CombatPlayerProto.getDefaultInstance() : opponent_;\n }\n }", "private static CIty chaxunguanjunguo(String guanjunguo, ArrayList<CIty> citys) {\n\t\tIterator it=citys.iterator();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tCIty c=(CIty)it.next();\r\n\t\t\tif(c.winner.equals(guanjunguo))\r\n\t\t\t\treturn c;\r\n\t\t}\r\n\t\treturn null;\r\n\t\t\r\n\t}", "public ConcurrentHashMap<String, Color> getCouleurs() {\n return couleurs;\n }", "public String getClubName(){\n\t\tInteger clubid = 0;\r\n\t\tString clubname = \"\";\r\n\t\t\r\n\t\tScahaDatabase db = (ScahaDatabase) ContextManager.getDatabase(\"ScahaDatabase\");\r\n\t\t\r\n\t\ttry{\r\n\r\n \t\t\t\r\n\t\t\tVector<Integer> v = new Vector<Integer>();\r\n\t\t\tv.add(this.getProfid());\r\n\t\t\tdb.getData(\"CALL scaha.getClubforPerson(?)\", v);\r\n\t\t \r\n\t\t\tif (db.getResultSet() != null){\r\n\t\t\t\t//need to add to an array\r\n\t\t\t\trs = db.getResultSet();\r\n\t\t\t\t\r\n\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\tthis.clubid = rs.getInt(\"idclub\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\tLOGGER.info(\"We have results for club for a profile\");\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\tdb.cleanup();\r\n \t\t\r\n\t\t\t//now lets retrieve club name\r\n\t\t\tv = new Vector<Integer>();\r\n\t\t\tv.add(this.clubid);\r\n\t\t\tdb.getData(\"CALL scaha.getClubNamebyId(?)\", v);\r\n\t\t \r\n\t\t\tif (db.getResultSet() != null){\r\n\t\t\t\t//need to add to an array\r\n\t\t\t\trs = db.getResultSet();\r\n\t\t\t\t\r\n\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\tclubname = rs.getString(\"clubname\");\r\n\t\t\t\t}\r\n\t\t\t\tLOGGER.info(\"We have results for club name\");\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\tdb.cleanup();\r\n\t\t\t\r\n \t} catch (SQLException e) {\r\n \t\t// TODO Auto-generated catch block\r\n \t\tLOGGER.info(\"ERROR IN loading club by profile\");\r\n \t\te.printStackTrace();\r\n \t\tdb.rollback();\r\n \t} finally {\r\n \t\t//\r\n \t\t// always clean up after yourself..\r\n \t\t//\r\n \t\tdb.free();\r\n \t}\r\n\t\t\r\n\t\treturn clubname;\r\n\t}", "@Override\n public Map<String,String> getMapGloablCommunityColor(){\n return icommunityColors.getMapGloablCommunityColor();\n }", "public String toStr() {\n\t\treturn getCollege();\n\t}", "public ArrayList<Collective> getMemberCollectives() { return this.memberCollectives;}", "public static ArrayList<Player> getWinners(){return winners;}", "public SoccerTeam getLoser() {\n SoccerTeam loser = null;\n\n if (this.scoreOne < this.scoreTwo) {\n loser = this.teamOne;\n }\n else if (this.scoreOne > this.scoreTwo) {\n loser = this.teamTwo;\n }\n\n return loser;\n }", "public Location getLobbyLocation() {\n return gameLocations.get(GameLocation.LOBBY);\n }", "public String getPlayerWithGamePiece(GamePiece gamePiece)\n\t{\n\t\tSet<String> player = playerPieces.keySet();\n\t\tfor (String name : player)\n\t\t{\n\t\t\tif(playerPieces.get(name) == gamePiece) \n\t\t\t{\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static List<String> getSpainCoach() throws URISyntaxException, IOException {\n\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/77\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Team66Pojo team66Pojo =objectMapper.readValue(response.getEntity().getContent(),Team66Pojo.class);\n List<Squad> squad = team66Pojo.getSquad();\n List<String> nameOfSpainTeamCoach= new ArrayList<>();\n for (int i = 0; i <squad.size() ; i++) {\n try {\n if(squad.get(i).getRole().equals(\"COACH\")){\n\n nameOfSpainTeamCoach.add(squad.get(i).getName());\n }\n }catch (NullPointerException e){\n continue;\n }\n\n }\n return nameOfSpainTeamCoach;\n }", "public ArrayList<Cella> getCelle() {\n\t\treturn celle;\n\t}", "public String getClothesnames() {\n return clothesnames;\n }", "String[] getCommunitiesAsArray();", "public String getVenuesName() {\n return venuesName;\n }", "public String getWinner() {\n return winner;\n }", "public List<String> getAdjacentCountries() {\n return adjacentCountries;\n }", "public String getCouleur() {\n return this.COULEUR;\n }", "public String getCouleur() {\n return this.COULEUR;\n }" ]
[ "0.61559963", "0.61390907", "0.6036743", "0.5939412", "0.58987147", "0.5790524", "0.5444706", "0.53787124", "0.52511287", "0.5249534", "0.5246457", "0.52305216", "0.52119386", "0.52119386", "0.5205828", "0.52045316", "0.51030433", "0.5089587", "0.508364", "0.503131", "0.5017312", "0.501138", "0.49781516", "0.49446675", "0.49412847", "0.49336553", "0.48943618", "0.48825344", "0.48759654", "0.4857539", "0.48517734", "0.4838189", "0.4829395", "0.4828642", "0.4815048", "0.48149818", "0.481298", "0.4812537", "0.48074275", "0.4802614", "0.47996855", "0.47866762", "0.47798863", "0.47774577", "0.4767667", "0.47636035", "0.47613886", "0.47558203", "0.47491342", "0.47328296", "0.4722602", "0.47119647", "0.4708909", "0.47066164", "0.47034734", "0.46833012", "0.46816087", "0.46797153", "0.4678203", "0.46715817", "0.46679106", "0.46629608", "0.4662462", "0.46442357", "0.4642708", "0.4641093", "0.4620645", "0.46095344", "0.4605063", "0.45998165", "0.45970592", "0.45905772", "0.45871845", "0.45856842", "0.4583513", "0.4582529", "0.45810273", "0.45803127", "0.45788094", "0.45748264", "0.4570134", "0.45613188", "0.45599806", "0.4558723", "0.45545578", "0.45415512", "0.4541124", "0.45365316", "0.4532645", "0.4524234", "0.45236498", "0.45209968", "0.45150536", "0.45116678", "0.45081386", "0.45079467", "0.4506993", "0.45037687", "0.4501006", "0.4501006" ]
0.7599507
0
Sets the "colleagues" element
public void setColleagues(andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues colleagues) { generatedSetterHelperImpl(colleagues, COLLEAGUES$0, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues getColleagues()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues target = null;\r\n target = (andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues)get_store().find_element_user(COLLEAGUES$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "public void setLecturers(ArrayList value);", "public andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues addNewColleagues()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues target = null;\r\n target = (andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues)get_store().add_element_user(COLLEAGUES$0);\r\n return target;\r\n }\r\n }", "static public void set_team_data(String league){\n\n\t\tEdit_row_window.attrs = new String[]{\"team name:\", \"rating:\", \"release year:\"};\n\t\tEdit_row_window.attr_vals = new String[]\n\t\t\t\t{Edit_row_window.selected[0].getText(1), Edit_row_window.selected[0].getText(2), \n\t\t\t\tEdit_row_window.selected[0].getText(3)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct p.id, p.name, p.links_to_player, p.birth_year \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_\"+league+\"_players p, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_\"+league+\"_player_team pt \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where pt.player_id=p.id and pt.team_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by links_to_player desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct p.id, p.name, p.links_to_player, p.birth_year \" +\n\t\t\t\t\" from curr_\"+league+\"_players p \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"player name\", \"rating\", \"birth year\"};\n\t\tEdit_row_window.label_min_parameter=\"min. birth year:\";\n\t\tEdit_row_window.linked_category_name = \"PLAYERS\";\n\t}", "public void setLecTable(Lecturers value);", "public void setCollaboratorsInCheckComboBox()\r\n throws DatabaseException, ConnectionFailedException {\r\n List<User> listOfCollaboratorsToCheck =\r\n application.getCollaboratorsInvitedByProject(this.project);\r\n this.viewController.selectCollaboratorCheckComboBox(listOfCollaboratorsToCheck);\r\n }", "@Override\n public void update(ArrayList<League> leagues) {\n\n }", "static public void set_player_data(String league){\n\t\t\n\t\tEdit_row_window.attrs = new String[]{\"player name:\", \"rating:\", \"birth year:\"};\n\t\tEdit_row_window.attr_vals = new String[]\n\t\t\t\t{Edit_row_window.selected[0].getText(1), Edit_row_window.selected[0].getText(2), \n\t\t\t\tEdit_row_window.selected[0].getText(3)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct t.id, t.name, t.links_to_team, t.creation_year \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_\"+league+\"_teams t, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_\"+league+\"_player_team pt\" +\n\t\t\t\t\t\t\t\t\t\t\t\" where pt.team_id=t.id and pt.player_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by links_to_team desc \";\n\t\t\n\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct t.id, t.name, t.links_to_team, t.creation_year \" +\n\t\t\t\t\" from curr_\"+league+\"_teams t \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"team name\", \"rating\", \"creation year\"};\n\t\tEdit_row_window.label_min_parameter=\"min. creation year:\";\n\t\tEdit_row_window.linked_category_name = \"TEAMS\";\n\t}", "public void setColaboradores(ArrayList<String> colaboradores) {\n this.colaboradores = colaboradores;\n }", "public Profile[] getColleagues(Profile profile) {\n\t\treturn getColleagues(profile,null);\n\t}", "public void setRogue(Rogue newRogue) {\n gameRoomBelongsTo = newRogue;\n }", "public Profile[] getColleagues(Profile profile, Map<String, String> parameters){\n\t\tif (logger.isLoggable(Level.FINEST)) {\n\t\t\tlogger.entering(sourceClass, \"getColleagues\", parameters);\n\t\t}\n\t\tDocument data = null;\n\t\tProfile[] colleagues = null;\n\t\tif(parameters == null)\n\t\t\tparameters = new HashMap<String, String>();\n\t\ttry {\n\t\t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n\t\t\t\t\tProfileType.GETCOLLEAGUES.getProfileType());\n\t\t\tif (isEmail(profile.getReqId())) {\n\t\t\t\tparameters.put(\"email\", profile.getReqId());\n\t\t\t} else {\n\t\t\t\tparameters.put(\"userid\", profile.getReqId());\n\t\t\t}\n\t\t\t\n\t\t\tif(parameters.get(\"connectionType\") != null)// this is to remove any other values put in by sample user in following\n\t\t\t\tparameters.remove(\"connectionType\");\t// mandatory parameters\n\t\t\tif(parameters.get(\"outputType\") != null)\n\t\t\t\tparameters.remove(\"outputType\");\n\t\t\tparameters.put(\"connectionType\",\"colleague\");\n\t\t\tparameters.put(\"outputType\",\"profile\");\n\t\t\t\n\t\t\tdata = (Document)getClientService().get(url, parameters);\n\t\t\tcolleagues = Converter.convertToProfiles(this, data);\n\t\t} catch (ClientServicesException e) {\n\t\t\tif (logger.isLoggable(Level.SEVERE)) {\n\t\t\t\tlogger.log(Level.SEVERE, \"Error encountered while getting colleagues information\", e);\n\t\t\t}\n\t\t}\n\t\tif (logger.isLoggable(Level.FINEST)) {\n\t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n\t\t}\n\t\treturn colleagues;\n\n\t}", "public void setLobby(Lobby l){\r\n\t\tthis.lobby = l;\r\n\t}", "public void setCourses(ArrayList value);", "public void setSchools(ArrayList value);", "public Profile[] getColleagues(Profile profile) throws ProfileServiceException{\n \t\treturn getColleagues(profile,null);\n \t}", "public void setOptions(String col, String dif)\n {\n difficult = dif;\n color = col;\n }", "public Profile[] getColleagues(Profile profile, Map<String, String> parameters)\n \tthrows ProfileServiceException{\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"getColleagues\", parameters);\n \t\t}\n \t\tif (profile == null) {\n \t\t\tthrow new IllegalArgumentException(StringUtil.format(\"A null profile was passed\"));\n \t\t}\n \t\tDocument data = null;\n \t\tProfile[] colleagues = null;\n \t\tif(parameters == null)\n \t\t\tparameters = new HashMap<String, String>();\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTIONS.getProfileType());\n \t\tif (isEmail(profile.getReqId())) {\n \t\t\tparameters.put(ProfileRequestParams.EMAIL, profile.getReqId());\n \t\t} else {\n \t\t\tparameters.put(ProfileRequestParams.USERID, profile.getReqId());\n \t\t}\n \n \t\tif(parameters.get(\"connectionType\") != null)// this is to remove any other values put in by sample user in following\n \t\t\tparameters.remove(\"connectionType\");\t// mandatory parameters\n \t\tif(parameters.get(\"outputType\") != null)\n \t\t\tparameters.remove(\"outputType\");\n \t\tparameters.put(\"connectionType\",\"colleague\");\n \t\tparameters.put(\"outputType\",\"profile\");\n \n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tcolleagues = Converter.convertToProfiles(this, data);\n \n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n \t\t}\n \t\treturn colleagues;\n \n \t}", "protected void addOpponentsToInitiativeTable ()\n {\n\tTerm.echo(\" Opponents \\n\");\n\tjava.util.Iterator it = \n\t CombatSession.getInstance().getOpponents().iterator();\n\twhile (it.hasNext())\n\t{\n\t Being b = (Being)it.next();\n\t Term.echo(\" '\"+b.getName()+\"'\");\n\n\t int dRoll = burningbox.org.dsh.Utils.throwD20();\n\t Term.echo(\" rolls a \"+dRoll);\n\n\t int initiativeScore = dRoll + b.computeInitiativeModifier();\n\t Term.echo(\" that makes a\\t\\t\"+initiativeScore+\"\\n\");\n\n\t b.setCurrentInitiative(initiativeScore);\n\n\t CombatSession.getInstance().getInitiativeTable().add(b);\n\n\t log.info(b.getName()+\" ini \"+initiativeScore);\n\t}\n }", "public void setOpponent(Player opponent) {\n\t\tthis.opponent = opponent;\n\t}", "public void setRoster(String[][] roster){\r\n\t\tthis.roster = roster;\r\n\t}", "public void updateColourInfo(String col) {\n /**\n * Handles a few special cases where the colour is not set or where the\n * colouring would class with the black background.\n *\n */\n switch (col) {\n case \"LIGHTBLACK\":\n selectedCol.setText(\"Selected Ball Colour: BLACK\");\n selectedCol.setColour(\"GREY\");\n break;\n case \"NONE\":\n selectedCol.setText(\"Selected Ball Colour: NONE\");\n selectedCol.setColour(\"WHITE\");\n break;\n default:\n selectedCol.setText(\"Selected Ball Colour: \" + col);\n selectedCol.setColour(col);\n break;\n }\n }", "public void set(Lobby lobby) {\n Firebase.setDocument(\"lobbies/\" + lobby.getGameCode(), LobbyDTO.fromModel(lobby));\n }", "void setWinningTeam(TeamId winner) {\n winningTeam.set(winner);\n }", "public void addClubSelector() {\n\n if (clubSelectorTour == null) {\n clubSelectorTour = calendarMenu.addItem(\"Set Club\", command -> {\n\n Window window = new Window(\"Select Club for Calendar Events\");\n window.setWidth(\"400px\");\n window.setHeight(\"200px\");\n getUI().addWindow(window);\n window.center();\n window.setModal(true);\n C<Club> cs = new C<>(Club.class);\n ComboBox clubs = new ComboBox(\"Club\", cs.c());\n clubs.setItemCaptionMode(ItemCaptionMode.ITEM);\n clubs.setNullSelectionAllowed(false);\n\n clubs.setFilteringMode(FilteringMode.CONTAINS);\n Button done = new Button(\"Done\");\n done.addClickListener(listener -> {\n window.close();\n Object id = clubs.getValue();\n if (id != null) {\n calendar.filterEventOwnerId(id);\n setClubName(id);\n calendar.markAsDirty();\n }\n });\n\n EVerticalLayout l = new EVerticalLayout(clubs, done);\n\n window.setContent(l);\n });\n }\n }", "public void setCollided(boolean collided) {\n this.collided = collided;\n }", "private static void setGalaxyNeighbours(ArrayList<Galaxy> galaxies, JSONArray jsongalaxies) {\n for(int i = 0; i<jsongalaxies.length(); i++) {\n JSONArray neighbours = jsongalaxies.getJSONObject(i).getJSONArray(\"neighbours\");\n // System.out.println(\"galaxy \" + galaxies.get(i).getName() + \" has neighbours: \");\n for(int y = 0; y<neighbours.length(); y++) {\n char galaxyname = neighbours.get(y).toString().charAt(0);\n //System.out.println(galaxyname);\n for(Galaxy galaxy : galaxies) {\n if(galaxy.getName() == galaxyname) {\n galaxies.get(i).addNeighbour(galaxy);\n }\n }\n }\n }\n }", "public void setColl(){\n System.out.println(\"Enter the student's college: \");\n this.college = input.nextLine();\n }", "public void setCurrcycnct(List<Currcycnct> currcycnct)\n/* */ {\n/* 76 */ this.currcycnct = currcycnct;\n/* */ }", "public void updateLobby(Set<String> players) {\r\n lobbyFrame.updateList(players);\r\n }", "public void setOpponent(Player p) {\n\t\tthis.opponent = p;\n\t}", "@Override\n public void setPlayerBrainList(Player player, ArrayList<Brain> brains) {\n DatabaseReference currentRef = database.getReference(gameCodeRef).child(\"Players\").child(player.getUsername());\n currentRef.child(\"BrainList\").setValue(brains);\n }", "public void changeSquarePlayer(int row, int col, String name){\n board[row][col].setName(name);\n }", "@Test\n\tpublic void testCourseSetMembersReconciled() throws Exception {\n\t\tMembership member = (Membership)cmService.getCourseSetMemberships(\"ucb\").iterator().next();\n\t\tAssert.assertEquals(\"birgeneau\", member.getUserId());\n\t\tAssert.assertEquals(\"president\", member.getRole());\n\t\t\n\t\t// Add a new membership\n\t\tMembership newMember = cmAdmin.addOrUpdateCourseSetMembership(\"foo\", \"bar\", \"ucb\", \"active\");\n\t\t\n\t\t// Ensure it was added\n\t\tAssert.assertTrue(cmService.getCourseSetMemberships(\"ucb\").contains(newMember));\n\t\t\n\t\t// Reconcile again\n\t\tjob.syncAllCmObjects();\n\t\t\n\t\t// Ensure that the new member was removed\n\t\tAssert.assertFalse(cmService.getCourseSetMemberships(\"ucb\").contains(newMember));\n\t}", "void setAddListener(AddNeededCollaborationListener addNeededCollaborationListener);", "public String getColl(){\n return this.college;\n }", "private void setFigureAtPlayerBattleground(int row, int col) {\n if (currentPlayer.isInPlayerBattlefield(row) && fields[row][col].isFieldFree()) {\n\n currentField.getCurrentFigure().setOwner(currentPlayer);\n currentPlayer.addFigure(currentField.getCurrentFigure());\n fields[row][col].setCurrentFigure(currentField.getCurrentFigure());\n\n } else {\n showMessageOnScreen(\"Invalid position!\");\n }\n }", "public void setPeople(People people,String id)\n {\n myCamp = people;\n this.id = id;\n }", "public void setHost(LobbyPlayer player) {\n DocumentReference doc = Firebase.docRefFromPath(\"lobbies/\" + player.getLobbyCode());\n doc.update(FieldPath.of(\"players\", player.getUsername(), \"host\"), true);\n }", "public static void set_players(){\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\tbat1=PlayBrain1.myteam[0];\n\t\t\tbat2=PlayBrain1.myteam[1];\n\t\t\tStriker=bat1;\n\t\t\tNonStriker=bat2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tbat1=PlayBrain1.oppteam[0];\n\t\t\t\tbat2=PlayBrain1.oppteam[1];\n\t\t\t\tStriker=bat1;\n\t\t\t\tNonStriker=bat2;\n\n\t\t\t\t}\n\t}", "private void setPairs() {\r\n\t\tif (this.gragraNames.getSelectedValue() != null) {\r\n\t\t\tString nameStr = (String) this.gragraNames.getSelectedValue();\r\n\t\t\tboolean found = false;\r\n\t\t\tfor (int i = 0; i < this.treeView.getGraGras().size() && !found; i++) {\r\n\t\t\t\tEdGraGra gragra = this.treeView.getGraGras().elementAt(i);\r\n\t\t\t\tString name = nameStr;\r\n\t\t\t\tint indx = nameStr.indexOf(\"(\");\r\n\t\t\t\tif (indx != -1)\r\n\t\t\t\t\tname = nameStr.substring(0, indx);\r\n\t\t\t\t// System.out.println(nameStr+\" \"+name);\r\n\t\t\t\tif (name.equals(gragra.getName())) {\r\n\t\t\t\t\tthis.criticalPairGraGra = gragra;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (this.criticalPairGraGra == null && this.stopGraph != null)\r\n\t\t\t\tthis.criticalPairGraGra = this.stopGraph;\r\n\t\t} else if (this.stopGraph != null) {\r\n\t\t\tthis.criticalPairGraGra = this.stopGraph;\r\n\t\t}\r\n\t}", "@Test\r\n public void testSetUserHobbies()\r\n {\r\n System.out.println(\"setUserHobbies\");\r\n String[] userHobbies = {\"Football\", \"Rugby\"};\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.setUserHobbies(userHobbies);\r\n Assert.assertArrayEquals(userHobbies, instance.getUserHobbies());\r\n }", "public Lobby(long triviaSetId, String name, int code, List<User> connectedUsers, User lobbyOwner) {\n this.triviaSetId = triviaSetId;\n this.name = name;\n this.code = code;\n this.connectedUsers = connectedUsers;\n this.lobbyOwner = lobbyOwner;\n this.lobbyUpdates = new TreeMap<Integer, LobbyUpdateBase>();\n }", "public void setWinner(Player winner) {\n this.winner = winner;\n }", "@Override\n\t\tpublic Community set(int index, Community element) {\n\t\t\treturn null;\n\t\t}", "@Override\n public void initializeListOfCompaniesWithoutParticipants() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"initializeListOfCompaniesWithoutParticipants\");\n }\n\n EntityManager em = EntityManagerService.provideEntityManager();\n companiesWithoutParticipants = new ArrayList<Institution>();\n List<ConnectathonParticipant> foundParticipantsPerCompany;\n TestingSession ts = TestingSession.getSelectedTestingSession();\n List<Institution> companiesParticipating = TestingSession.getListOfInstitutionsParticipatingInSession(ts);\n\n for (Institution inst : companiesParticipating) {\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, ts);\n query.setParameter(IN_INSTITUTION, inst);\n foundParticipantsPerCompany = query.getResultList();\n\n if (foundParticipantsPerCompany.size() == 0) {\n companiesWithoutParticipants.add(inst);\n }\n }\n }", "public void setTeams(Collection<Team> teams) {\r\n this.teams = teams;\r\n }", "public void setLobby(Lobby lobby)\r\n\t{\r\n\t\treceiver.setLobby(lobby);\t\r\n\t}", "private void initializeCollaboratorCheckComboBox()\r\n throws DatabaseException, ConnectionFailedException {\r\n List<User> listOfAllUsers = this.application.loadUsersFromDatabase();\r\n listOfAllUsers.remove(project.getAuthor());\r\n this.viewController.initCollaboratorCheckComboBox(listOfAllUsers);\r\n }", "public void setInvolvedPerson( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), INVOLVEDPERSON, value);\r\n\t}", "public void setPlayer(int row, int col, int value) {\n\t\tplayer[row][col] = value;\n\t}", "public void updateUserTeam() {\n\t\tUser user = users.get(userTurn);\n\t\tSystem.out.println(user.getName());\n\t\tSystem.out.println(tmpTeam.size());\n\t\tUserTeam roundTeam = new UserTeam();\n\t\troundTeam.putAll(tmpTeam.getPlayers());\n\t\tSystem.out.println(roundNumber);\n\t\tSystem.out.println(roundTeam.size());\n\t\tSystem.out.println(\"dfdfdfd\");\n\t\tuser.setUserTeam(roundTeam, roundNumber);\n\t\tSystem.out.println(\"dfdfdfd\");\n\t\ttmpTeam = new UserTeam();\n\t}", "@Test\n public void testSetElections() {\n System.out.println(\"setElections\");\n Collection<Election> elections = new ArrayList<Election>();\n Election mock = new Election();\n elections.add(mock);\n Commissioner instance = new Commissioner();\n instance.setElections(elections);\n assertEquals(instance.getElections(),elections);\n }", "public void setPlayers(ArrayList<String> players) {\n this.players = new ArrayList<>();\n this.nicknames = new ArrayList<>();\n for (int i = 0; i < players.size(); i++) {\n if (!players.get(i).equals(gui.getViewController().getNickName())){\n JMenuItem newPlayerItem = new JMenuItem(players.get(i));\n newPlayerItem.addActionListener(new OpponentItemListener(gui.getViewController(),i));\n this.players.add(newPlayerItem);\n }\n this.nicknames.add(new JLabel(players.get(i)));\n this.nicknames.get(i).setHorizontalAlignment(SwingConstants.CENTER);\n this.nicknames.get(i).setVerticalAlignment(SwingConstants.CENTER);\n }\n for(int i = 0; i<this.players.size();i++){\n this.playerMenu.add(this.players.get(i));\n }\n initTurnPanel();\n }", "protected void setCities(Vector<Site> cities){\n this.cities=cities;\n }", "void set(int c, int r, Piece v, Piece next) {\n if (v != BP && v != WP && v != EMP) {\n throw new IllegalArgumentException(\"no such starting piece.\");\n }\n if (next != BP && next != WP && next != EMP && next != null) {\n throw new IllegalArgumentException(\"no such ending piece.\");\n }\n this.boardArr[r - 1][c - 1] = v;\n if (next != null) {\n _turn = next;\n }\n }", "public void assign(int newVal, int r, int c) {\r\n\tboard[r][c].setGuess(newVal, true);\r\n\tmax--;\r\n\tremoveFromRow(newVal, r);\r\n\tremoveFromCol(newVal, c);\r\n\tremoveFromCollection(newVal, r, c);\r\n //remove from the collection\r\n }", "public void setCurrentClub() {\n Object id = BridgeUI.user.getCurrentClubId();\n if (id != null) {\n calendar.filterEventOwnerId(id);\n setClubName(id);\n }\n }", "public void updateConnectedPlayers(ArrayList<Player> connectedPlayers) throws RemoteException{\n match.setPlayers(connectedPlayers);\n for (int i=0;i<match.getPlayers().size();i++){\n System.out.println(\"[LOBBY]: Player \"+ match.getPlayers().get(i).getNickname()+ \" is in lobby\");\n }\n System.out.println(\"[LOBBY]: Refreshing Lobby..\");\n Platform.runLater(() -> firstPage.refreshPlayersInLobby());// Update on JavaFX Application Thread\n }", "public void setLeagueId(int value) {\n this.leagueId = value;\n }", "void setLocationCells(ArrayList<String> loc){\r\n locationCells = loc;\r\n }", "private Collection<ConnectionEntry> getColleaguesInCommon(String sourceId, String targetId, Map<String, String> parameters) throws ProfileServiceException{\n \t\t\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"checkColleague\");\n \t\t}\n \t\tif (StringUtil.isEmpty(sourceId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_4);\n \t\t}\n \t\tif (StringUtil.isEmpty(targetId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_5);\n \t\t}\n \t\tDocument data = null;\n \t\tif(parameters == null){\n \t\t\tparameters = new HashMap<String, String>();\n \t\t}\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTIONS_IN_COMMON.getProfileType());\n \t\tif (isEmail(sourceId)) {\n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.EMAIL, value.toString());\n \t\t} else {\n \n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.USERID, value.toString());\n \t\t}\n \t\tparameters.put(\"connectionType\",\"colleague\");\n \n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tCollection<ConnectionEntry> colleaguesInCommon = Converter.returnConnectionEntries(data, \"connectionEntry\");\n \n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n \t\t}\n \t\treturn colleaguesInCommon;\n \t\t\n \t}", "public Builder setOpponent(POGOProtos.Rpc.CombatProto.CombatPlayerProto value) {\n if (opponentBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n opponent_ = value;\n onChanged();\n } else {\n opponentBuilder_.setMessage(value);\n }\n\n return this;\n }", "public static void setInvolvedPerson( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, INVOLVEDPERSON, value);\r\n\t}", "public void setCollegeName(String collegeName) {\n this.collegeName = collegeName;\n }", "void set( couple ch)\r\n { \r\n \r\n //couple ch = itr.next();\r\n ch.g1.sethappy(ch.bucket);\r\n ch.b1.sethappy(ch.bucket);\r\n ch.happiness = ch.b1.happy + ch.g1.happy;\r\n ch.compatibility = (ch.b1.budget - ch.g1.getmaint()) + Math.abs(ch.b1.getintg() - ch.g1.getiq()) + Math.abs(ch.b1.getattr() - ch.g1.getb());\r\n // this sets the happiness n compatibility of the co \r\n \r\n }", "@Override\n public void setGlobalCommunityColorMap(Map<String, String> mapGloablCommunityColor) {\n icommunityColors.setGlobalCommunityColorMap(mapGloablCommunityColor);\n }", "public ExCubeGameTeamList(List<Player> redPlayers, List<Player> bluePlayers, int roomNumber) {\n\t\t_redPlayers = redPlayers;\n\t\t_bluePlayers = bluePlayers;\n\t\t_roomNumber = roomNumber - 1;\n\t}", "public void set_Mine_Count(int row,int col)\n{\n\tif(cell[row][col] != 9)\n\t{\n\t\tcell[row][col] += 1;\n\t}\n}", "void setLeader(Genome leader);", "public void setCollegeRank(int collegeRank)\r\n\t{\r\n\t\tthis.collegeRank = collegeRank;\r\n\t}", "public void setConsortium(java.lang.String value) {\n __getInternalInterface().setFieldValueForCodegen(CONSORTIUM_PROP.get(), value);\n }", "@Test\n public void testUpdateMayors() {\n System.out.println(\"updateMayors\");\n\n Set<City> cities1 = new HashSet<>();\n cities1.add(new City(new Pair(41.243345, -8.674084), \"city0\", 28));\n cities1.add(new City(new Pair(41.237364, -8.846746), \"city1\", 72));\n cities1.add(new City(new Pair(40.519841, -8.085113), \"city2\", 81));\n cities1.add(new City(new Pair(41.118700, -8.589700), \"city3\", 42));\n\n Set<City> cities2 = new HashSet<>();\n City city0 = (new City(new Pair(41.243345, -8.674084), \"city0\", 28));\n city0.setMayor(new User(\"nick2\", \"mail_2_@sapo.pt\"));\n cities2.add(city0);\n City city1 = (new City(new Pair(41.237364, -8.846746), \"city1\", 72));\n city1.setMayor(new User(\"nick6\", \"mail_6_@sapo.pt\"));\n cities2.add(city1);\n City city2 = (new City(new Pair(40.519841, -8.085113), \"city2\", 81));\n city2.setMayor(new User(\"nick2\", \"mail_2_@sapo.pt\"));\n cities2.add(city2);\n City city3 = (new City(new Pair(41.118700, -8.589700), \"city3\", 42));\n cities2.add(city3);\n city3.setMayor(new User(\"nick8\", \"mail_8_@sapo.pt\"));\n\n SocialNetwork sn = new SocialNetwork(sn10.getUsersList(), cities1);\n sn.updateMayors();\n\n List<User> result = new LinkedList<>();\n for (City city : sn.getCitiesList()) {\n result.add(city.getMayor());\n }\n List<User> expResult = new LinkedList<>();\n for (City city : cities2) {\n expResult.add(city.getMayor());\n }\n assertEquals(expResult, result);\n }", "public Leagues() {\n }", "public void setColor()\n {\n if(eyeL != null) // only if it's painted already...\n {\n eyeL.changeColor(\"yellow\");\n eyeR.changeColor(\"yellow\");\n nose.changeColor(\"green\");\n mouthM.changeColor(\"red\");\n mouthL.changeColor(\"red\");\n mouthR.changeColor(\"red\");\n }\n }", "public void setHobbies(Set<String> h){\n }", "private Element traverse_collaborative(Element element) {\n \ttry {\n\t \tString userid = profile.getAttributeValue(\"personal\", \"id\");\n\t \tString course = profile.getAttributeValue(\"personal\", \"course\");\n\t \tString context = WOWStatic.config.Get(\"CONTEXTPATH\");\n\n\t \tElement a = doc.createElement(\"a\");\n\t \ta.setAttribute(\"href\", context + \"/Get?wndName=Collaborative\");\n\t \ta.setAttribute(\"target\", userid + \"$\" + course);\n\t \ta.appendChild(doc.createTextNode(\"Collaborative\"));\n\t \treturn (Element)replaceNode(element, a);\n \t}\n \tcatch(Throwable e) {\n \t\te.printStackTrace();\n \t\treturn (Element)replaceNode(element, createErrorElement(\"Error!\"));\n \t}\n }", "void setLegs(int legs);", "@Override\r\n\tpublic void setForHobby(DriverVO driverVO) {\n\t\t\r\n\t}", "public void testAssignBlogContributors() {\n rootBlog.setProperty(SimpleBlog.BLOG_CONTRIBUTORS_KEY, \"user1\");\n assertEquals(\"user1\", rootBlog.getProperty(SimpleBlog.BLOG_CONTRIBUTORS_KEY));\n assertEquals(\"user1\", rootBlog.getBlogContributors());\n\n Collection users = rootBlog.getUsersInRole(Constants.BLOG_CONTRIBUTOR_ROLE);\n assertEquals(1, users.size());\n assertTrue(users.contains(\"user1\"));\n\n rootBlog.setProperty(SimpleBlog.BLOG_CONTRIBUTORS_KEY, \"user1,user2\");\n assertEquals(\"user1,user2\", rootBlog.getProperty(SimpleBlog.BLOG_CONTRIBUTORS_KEY));\n assertEquals(\"user1,user2\", rootBlog.getBlogContributors());\n\n users = rootBlog.getUsersInRole(Constants.BLOG_CONTRIBUTOR_ROLE);\n assertEquals(2, users.size());\n assertTrue(users.contains(\"user1\"));\n assertTrue(users.contains(\"user2\"));\n }", "public void setCoach(Coach coach) {\n this.coach = coach;\n }", "public void setPlayersAtGo()\n {\n for(int i = 0; i < m_numPlayers; i++)\n {\n m_gameBoard.addPlayerToSpace(i + 1, 0);\n }\n }", "public void setInvolvedPerson(InvolvedPerson value) {\r\n\t\tBase.set(this.model, this.getResource(), INVOLVEDPERSON, value);\r\n\t}", "public void setConsortium(java.lang.String value) {\n __getInternalInterface().setFieldValueForCodegen(CONSORTIUM_PROP.get(), value);\n }", "public void setActiveOpponent(long opponent) {\n\t\tm_Opponent = opponent;\n\t}", "public void join(LobbyPlayer player) {\n if (listener == null) listener = Firebase.registerListener(\"lobbies/\" + player.getLobbyCode(), onLobbyChange);\n DocumentReference doc = Firebase.docRefFromPath(\"lobbies/\" + player.getLobbyCode());\n ObjectMapper mapper = new ObjectMapper();\n Map<String, Object> kv = mapper.convertValue(LobbyPlayerDTO.fromModel(player), new TypeReference<Map<String, Object>>() {});\n doc.update(\"players.\" + player.getUsername(), kv);\n }", "@Override\r\n\tpublic void setOpponentName(String name) {\n\t\tmain.setOpponentUsername(name);\r\n\t}", "public static void changeColor(String username, int oldCol, int newCol){\n\t\t\n\t\t// change name in hashmap\n\t\tvisitorListMap.put(username, new Color(newCol));\n\t\t\n\t\t// trigger list model update\n\t\tvisitorList.repaint();\n\t}", "public void secondarySetPeople(com.hps.july.persistence.People aPeople) throws java.rmi.RemoteException {\n\tthis.getPeopleLink().secondarySet(aPeople);\n}", "public void setList() \n\t\t{\n\t\t\tVector<Course> items = client.ProfessorCourseList(prof.getID());\n\t\t\tmodel.removeAllElements();\n\t\t\tif(items == null)return;\n\t\t\tString s;\n\t\t\tfor(int i = 0; i < items.size(); i++)\n\t\t\t{\n\t\t\t\ts = items.get(i).getName();\n\t\t\t\tmodel.addElement(items.get(i));\n\t\t\t}\n\t\t}", "public final void setHullUpgrade(int hullUp){ hullUpgrade = hullUp;}", "public void updateRoleCard(LobbyPlayer player) {\n DocumentReference doc = Firebase.docRefFromPath(\"lobbies/\" + player.getLobbyCode());\n doc.update(FieldPath.of(\"players\", player.getUsername(), \"role\"), player.getRoleCard().getCardName());\n }", "private void setNeighbors() {\n\t\tfor (int i = 0; i < getNumRows(); i++) {\n\t\t\tfor (int j = 0; j < getNumCols(); j++) {\n\t\t\t\tCell c = getCurrentGrid()[i][j];\n\t\t\t\tsetNeighborsForCell(c);\n\t\t\t}\n\t\t}\n\t}", "public void setTurn(PieceColor color) {\n \tturn = color;\n }", "private void onSetColor() {\r\n\t Frame frame = JOptionPane.getFrameForComponent(getContentComponent());\r\n\t Color newColor = JColorChooser.showDialog(frame, \"Choose color\", DEF_CLUSTER_COLOR);\r\n\t if (newColor != null) {\r\n\t setClusterColor(newColor);\r\n\t }\r\n\t}", "public void setCollegeNum(int collegeNum) {\r\n\t\tthis.collegeNum = collegeNum;\r\n\t}", "public void setPlayers(int theCompPlayer) throws Exception {\r\n\t\tswitch(theCompPlayer) {\r\n\t\t\tcase 1:\r\n\t\t\t\tcompPlayer = 1;\r\n\t\t\t\totherPlayer = 2;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tcompPlayer = 2;\r\n\t\t\t\totherPlayer = 1;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Exception(\"That player number is invalid\");\r\n\t\t}\r\n\t}", "public void setMeilleursScores(MeilleursScores meilleursScores) {\r\n\t\tthis.meilleursScores = meilleursScores;\r\n\t}", "public void setCollaboratorTab(Tab newTab) {\r\n this.collaboratorTab = newTab;\r\n HomeController.enableTabsOnCloseRequest(this.collaboratorTab);\r\n }", "public void setColor(int gnum, Color col);" ]
[ "0.58523625", "0.5606382", "0.5586686", "0.53037465", "0.5249197", "0.518517", "0.5164798", "0.5099402", "0.50100046", "0.4989485", "0.49621752", "0.49373284", "0.4927988", "0.49082592", "0.48884976", "0.48226044", "0.48184055", "0.48060107", "0.4754288", "0.473305", "0.47326842", "0.46987373", "0.46890453", "0.46859124", "0.466884", "0.46578312", "0.46489012", "0.4637641", "0.46357825", "0.46302763", "0.46254864", "0.4615261", "0.46084005", "0.45866546", "0.45804107", "0.45688683", "0.4560197", "0.45596588", "0.45382154", "0.45306933", "0.45286363", "0.4522444", "0.4521729", "0.45161334", "0.45073047", "0.4504302", "0.4497061", "0.4483864", "0.4479303", "0.4474584", "0.44479433", "0.44428217", "0.44328168", "0.4430703", "0.44302836", "0.44243595", "0.44190773", "0.44139716", "0.44083387", "0.44012895", "0.4395665", "0.43932888", "0.43926173", "0.43709496", "0.4369365", "0.43688852", "0.4368121", "0.43649912", "0.43629175", "0.4362502", "0.4361177", "0.4352796", "0.43471602", "0.43462908", "0.43384048", "0.43383074", "0.43324015", "0.4324803", "0.43205944", "0.43135", "0.4312214", "0.43103227", "0.43090424", "0.43083566", "0.43081328", "0.43071225", "0.43009064", "0.42995265", "0.42891073", "0.42880872", "0.42766884", "0.4271335", "0.42709777", "0.42548034", "0.42515466", "0.42510852", "0.4250061", "0.42489612", "0.4247858", "0.42475882" ]
0.74390197
0
Appends and returns a new empty "colleagues" element
public andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues addNewColleagues() { synchronized (monitor()) { check_orphaned(); andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues target = null; target = (andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues)get_store().add_element_user(COLLEAGUES$0); return target; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues getColleagues()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues target = null;\r\n target = (andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues)get_store().find_element_user(COLLEAGUES$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "public void setColleagues(andrewNamespace.xsdconfig.ColleaguesDocument.Colleagues colleagues)\r\n {\r\n generatedSetterHelperImpl(colleagues, COLLEAGUES$0, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);\r\n }", "public Profile[] getColleagues(Profile profile) throws ProfileServiceException{\n \t\treturn getColleagues(profile,null);\n \t}", "public Profile[] getColleagues(Profile profile) {\n\t\treturn getColleagues(profile,null);\n\t}", "@Override\n public void initializeListOfCompaniesWithoutParticipants() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"initializeListOfCompaniesWithoutParticipants\");\n }\n\n EntityManager em = EntityManagerService.provideEntityManager();\n companiesWithoutParticipants = new ArrayList<Institution>();\n List<ConnectathonParticipant> foundParticipantsPerCompany;\n TestingSession ts = TestingSession.getSelectedTestingSession();\n List<Institution> companiesParticipating = TestingSession.getListOfInstitutionsParticipatingInSession(ts);\n\n for (Institution inst : companiesParticipating) {\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, ts);\n query.setParameter(IN_INSTITUTION, inst);\n foundParticipantsPerCompany = query.getResultList();\n\n if (foundParticipantsPerCompany.size() == 0) {\n companiesWithoutParticipants.add(inst);\n }\n }\n }", "public Profile[] getColleagues(Profile profile, Map<String, String> parameters){\n\t\tif (logger.isLoggable(Level.FINEST)) {\n\t\t\tlogger.entering(sourceClass, \"getColleagues\", parameters);\n\t\t}\n\t\tDocument data = null;\n\t\tProfile[] colleagues = null;\n\t\tif(parameters == null)\n\t\t\tparameters = new HashMap<String, String>();\n\t\ttry {\n\t\t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n\t\t\t\t\tProfileType.GETCOLLEAGUES.getProfileType());\n\t\t\tif (isEmail(profile.getReqId())) {\n\t\t\t\tparameters.put(\"email\", profile.getReqId());\n\t\t\t} else {\n\t\t\t\tparameters.put(\"userid\", profile.getReqId());\n\t\t\t}\n\t\t\t\n\t\t\tif(parameters.get(\"connectionType\") != null)// this is to remove any other values put in by sample user in following\n\t\t\t\tparameters.remove(\"connectionType\");\t// mandatory parameters\n\t\t\tif(parameters.get(\"outputType\") != null)\n\t\t\t\tparameters.remove(\"outputType\");\n\t\t\tparameters.put(\"connectionType\",\"colleague\");\n\t\t\tparameters.put(\"outputType\",\"profile\");\n\t\t\t\n\t\t\tdata = (Document)getClientService().get(url, parameters);\n\t\t\tcolleagues = Converter.convertToProfiles(this, data);\n\t\t} catch (ClientServicesException e) {\n\t\t\tif (logger.isLoggable(Level.SEVERE)) {\n\t\t\t\tlogger.log(Level.SEVERE, \"Error encountered while getting colleagues information\", e);\n\t\t\t}\n\t\t}\n\t\tif (logger.isLoggable(Level.FINEST)) {\n\t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n\t\t}\n\t\treturn colleagues;\n\n\t}", "protected void addOpponentsToInitiativeTable ()\n {\n\tTerm.echo(\" Opponents \\n\");\n\tjava.util.Iterator it = \n\t CombatSession.getInstance().getOpponents().iterator();\n\twhile (it.hasNext())\n\t{\n\t Being b = (Being)it.next();\n\t Term.echo(\" '\"+b.getName()+\"'\");\n\n\t int dRoll = burningbox.org.dsh.Utils.throwD20();\n\t Term.echo(\" rolls a \"+dRoll);\n\n\t int initiativeScore = dRoll + b.computeInitiativeModifier();\n\t Term.echo(\" that makes a\\t\\t\"+initiativeScore+\"\\n\");\n\n\t b.setCurrentInitiative(initiativeScore);\n\n\t CombatSession.getInstance().getInitiativeTable().add(b);\n\n\t log.info(b.getName()+\" ini \"+initiativeScore);\n\t}\n }", "@SuppressWarnings(\"unchecked\")\n private List createLeagueList() {\n ArrayList result = new ArrayList();\n for( int i = 0 ; i < leagues_array.size() ; ++i ) {\n HashMap m = new HashMap();\n m.put( \"League\", leagues_array.get(i)); // the key and it's value.\n result.add( m );\n }\n return (List)result;\n }", "@Override\n\t\tpublic void add(int index, Community element) {\n\t\t\t\n\t\t}", "public Profile[] getColleagues(Profile profile, Map<String, String> parameters)\n \tthrows ProfileServiceException{\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"getColleagues\", parameters);\n \t\t}\n \t\tif (profile == null) {\n \t\t\tthrow new IllegalArgumentException(StringUtil.format(\"A null profile was passed\"));\n \t\t}\n \t\tDocument data = null;\n \t\tProfile[] colleagues = null;\n \t\tif(parameters == null)\n \t\t\tparameters = new HashMap<String, String>();\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTIONS.getProfileType());\n \t\tif (isEmail(profile.getReqId())) {\n \t\t\tparameters.put(ProfileRequestParams.EMAIL, profile.getReqId());\n \t\t} else {\n \t\t\tparameters.put(ProfileRequestParams.USERID, profile.getReqId());\n \t\t}\n \n \t\tif(parameters.get(\"connectionType\") != null)// this is to remove any other values put in by sample user in following\n \t\t\tparameters.remove(\"connectionType\");\t// mandatory parameters\n \t\tif(parameters.get(\"outputType\") != null)\n \t\t\tparameters.remove(\"outputType\");\n \t\tparameters.put(\"connectionType\",\"colleague\");\n \t\tparameters.put(\"outputType\",\"profile\");\n \n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tcolleagues = Converter.convertToProfiles(this, data);\n \n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n \t\t}\n \t\treturn colleagues;\n \n \t}", "public void addClubSelector() {\n\n if (clubSelectorTour == null) {\n clubSelectorTour = calendarMenu.addItem(\"Set Club\", command -> {\n\n Window window = new Window(\"Select Club for Calendar Events\");\n window.setWidth(\"400px\");\n window.setHeight(\"200px\");\n getUI().addWindow(window);\n window.center();\n window.setModal(true);\n C<Club> cs = new C<>(Club.class);\n ComboBox clubs = new ComboBox(\"Club\", cs.c());\n clubs.setItemCaptionMode(ItemCaptionMode.ITEM);\n clubs.setNullSelectionAllowed(false);\n\n clubs.setFilteringMode(FilteringMode.CONTAINS);\n Button done = new Button(\"Done\");\n done.addClickListener(listener -> {\n window.close();\n Object id = clubs.getValue();\n if (id != null) {\n calendar.filterEventOwnerId(id);\n setClubName(id);\n calendar.markAsDirty();\n }\n });\n\n EVerticalLayout l = new EVerticalLayout(clubs, done);\n\n window.setContent(l);\n });\n }\n }", "public com.walgreens.rxit.ch.cda.StrucDocColgroup addNewColgroup()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocColgroup target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocColgroup)get_store().add_element_user(COLGROUP$4);\n return target;\n }\n }", "public Leagues() {\n }", "private void addGuess() {\n\t\tfor (int i = 0; i < NUM_OF_ROWS; i++) {\n\t\t\tif (guessList[i] == null) {\n\t\t\t\tguessList[i] = new Guess();\n\t\t\t\tlastMoveID = i;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If it gets here then we are full\n\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"No more spaces to add new moves, all posible moves exhausted\");\n\t}", "public Builder clearParticipants() {\n participants_ = com.google.protobuf.LazyStringArrayList.EMPTY;\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "@Override\n\t\tpublic boolean addAll(Collection<? extends Community> c) {\n\t\t\treturn false;\n\t\t}", "Collection getCommunities();", "public ScoreList append(ScoreContribution contribution)\n\t{\n\t\t// Won't stop all modifications to EMPTY, but helps.\n\t\t\n\t\tif (this == EMPTY)\n\t\t\tthrow new UnsupportedOperationException();\n\t\t\n\t\tsuper.add(contribution);\n\t\t\n\t\treturn this;\n\t}", "@Override\n public void update(ArrayList<League> leagues) {\n\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 }", "private Element traverse_collaborative(Element element) {\n \ttry {\n\t \tString userid = profile.getAttributeValue(\"personal\", \"id\");\n\t \tString course = profile.getAttributeValue(\"personal\", \"course\");\n\t \tString context = WOWStatic.config.Get(\"CONTEXTPATH\");\n\n\t \tElement a = doc.createElement(\"a\");\n\t \ta.setAttribute(\"href\", context + \"/Get?wndName=Collaborative\");\n\t \ta.setAttribute(\"target\", userid + \"$\" + course);\n\t \ta.appendChild(doc.createTextNode(\"Collaborative\"));\n\t \treturn (Element)replaceNode(element, a);\n \t}\n \tcatch(Throwable e) {\n \t\te.printStackTrace();\n \t\treturn (Element)replaceNode(element, createErrorElement(\"Error!\"));\n \t}\n }", "private JComboBox getOrgCmb() {\r\n cmbOrganization = new JComboBox();\r\n \r\n vOrganizations = getProposalSubOrgs();\r\n\r\n CoeusVector cvOrgs = new CoeusVector();\r\n \tcvOrgs.add(0, \"\");\r\n\r\n HashMap mapRow = new HashMap();\r\n \tfor (int c=0;c<vOrganizations.size();c++) {\r\n mapRow = (HashMap) vOrganizations.elementAt(c);\r\n \tcvOrgs.add(c+1,(String)mapRow.get(\"LOCATION_NAME\"));\r\n \t}\r\n \t\r\n \tcmbOrganization.setModel(new DefaultComboBoxModel(cvOrgs));\r\n return cmbOrganization;\r\n }", "private void populateRooms(){\n\n for(int i = 0; i<squares.size(); i++){\n for(int j = 0; j<squares.get(i).size(); j++){\n if(squares.get(i).get(j) != null) {\n getRoom(squares.get(i).get(j).getColor()).addSquare(squares.get(i).get(j));\n squares.get(i).get(j).setRoom(getRoom(squares.get(i).get(j).getColor()));\n\n }\n }\n }\n }", "public com.walgreens.rxit.ch.cda.StrucDocCol addNewCol()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocCol target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocCol)get_store().add_element_user(COL$2);\n return target;\n }\n }", "public Builder clearParticipants() {\n participants_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public void generateAdjList(int row, int col) {\n\t\tBoardCell originCell = this.getCell(row, col);\t\t\t\t\t\t\t\t\t\t// Creates a temporary cell called originCell for convenience\n\t\tBoardCell testCell;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// another temporary cell called testCell\n\t\tif(originCell.getInitial() != 'W' && !originCell.isRoomCenter()) {\t\t\t\t\t// Checks for cells that are in rooms and are not centers\n\t\t\treturn;\n\t\t}\n\t\tif(originCell.getInitial() != 'W' && originCell.isRoomCenter()) {\t\t\t\t\t// Checks for cells that are in rooms and are centers\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSet<BoardCell> doors = roomMap.get(originCell.getInitial()).getDoors();\t\t\t// grabs all the doors for a certain room\n\t\t\tSystem.out.println(doors.size());\n\t\t\tfor (Iterator<BoardCell> it = doors.iterator(); it.hasNext();) {\t\t\t\t// iterates through the set of doors\n\t\t\t\ttestCell = it.next();\t\t\t\t\t\t\t\t\t\t\t\t\t\t// sets test cell to be the next door in the set of doors\n\t\t\t\toriginCell.addAdj(this.getCell(testCell.getRow(),testCell.getCol()));\t\t// all doors are adjacent to the room center\n\t\t\t}\n\t\t\tif(roomMap.get(originCell.getInitial()).isSecretPassage()) {\t\t\t\t\t// determines if that room has a secret passage\n\t\t\t\tCharacter passage = roomMap.get(originCell.getInitial()).getSecretPassage();// creates a temporary char that is equal to the initial of the originCell's secret passage room\n\t\t\t\tBoardCell passageCell = roomMap.get(passage).getCenterCell();\t\t\t\t// creates a temporary cell that is equal to the center of the room \n\t\t\t\toriginCell.addAdj(this.getCell(passageCell.getRow(), passageCell.getCol()));// adds the corresponding cell from the board to the adjacency set\t\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\telse if(originCell.getInitial() == 'W' && !originCell.isDoorway()) {\t\t\t\t// checks if the originCell is a walkway but not a doorway\n\t\t\tif(row > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell above it to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row-1, col);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(testCell.getInitial() == 'W'){\t\t\t\t\t\t\t\t\t\t\t// Since non-door walkways can only be adjacent to walkways, if the test cell is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(col > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell to the left to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row, col-1);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(testCell.getInitial() == 'W'){\t\t\t\t\t\t\t\t\t\t\t// Since non-door walkways can only be adjacent to walkways, if the test cell is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(row < this.getNumRows()-1) {\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell below it to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row+1, col);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(testCell.getInitial() == 'W'){\t\t\t\t\t\t\t\t\t\t\t// Since non-door walkways can only be adjacent to walkways, if the test cell is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(col < this.getNumColumns()-1) {\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell to the right to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row, col+1);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(testCell.getInitial() == 'W'){\t\t\t\t\t\t\t\t\t\t\t// Since non-door walkways can only be adjacent to walkways, if the test cell is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\t\n\t\t}\n\t\telse if(originCell.getInitial() == 'W' && originCell.isDoorway()) {\t\t\t\t\t// checks to see if the cell is a doorway\n\t\t\tif(row > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell above it to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row-1, col);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(originCell.getDoorDirection() == DoorDirection.UP)\t\t\t\t\t\t// checks to see if the door direction is up\n\t\t\t\t\toriginCell.addAdj(roomMap.get(testCell.getInitial()).getCenterCell());\t// adds the center of the room corresponding to the character of the test cell to the adjacency list\n\t\t\t\telse if(testCell.getInitial() == 'W')\t\t\t\t\t\t\t\t\t\t// otherwise, if the test cell above is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t}\n\t\t\tif(col > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell top the left to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row, col-1);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(originCell.getDoorDirection() == DoorDirection.LEFT)\t\t\t\t\t\t// checks to see if the door direction is left\n\t\t\t\t\toriginCell.addAdj(roomMap.get(testCell.getInitial()).getCenterCell());\t// adds the center of the room corresponding to the character of the test cell to the adjacency list\n\t\t\t\telse if(testCell.getInitial() == 'W')\t\t\t\t\t\t\t\t\t\t// otherwise, if the test cell above is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t}\n\t\t\tif(row < this.getNumRows()-1) {\t\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell below it to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row+1, col);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(originCell.getDoorDirection() == DoorDirection.DOWN)\t\t\t\t\t\t// checks to see if the door direction is down\n\t\t\t\t\toriginCell.addAdj(roomMap.get(testCell.getInitial()).getCenterCell());\t// adds the center of the room corresponding to the character of the test cell to the adjacency list\n\t\t\t\telse if(testCell.getInitial() == 'W')\t\t\t\t\t\t\t\t\t\t// otherwise, if the test cell above is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t}\n\t\t\tif(col < this.getNumColumns()-1) {\t\t\t\t\t\t\t\t\t\t\t\t// Makes sure the cell has a cell to the right to avoid null pointer exceptions\n\t\t\t\ttestCell = this.getCell(row, col+1);\t\t\t\t\t\t\t\t\t\t// initializes the test cell to the cell in that location\n\t\t\t\tif(originCell.getDoorDirection() == DoorDirection.RIGHT)\t\t\t\t\t// checks to see if the door direction is right\n\t\t\t\t\toriginCell.addAdj(roomMap.get(testCell.getInitial()).getCenterCell());\t// adds the center of the room corresponding to the character of the test cell to the adjacency list\n\t\t\t\telse if(testCell.getInitial() == 'W')\t\t\t\t\t\t\t\t\t\t// otherwise, if the test cell above is a walkway...\n\t\t\t\t\toriginCell.addAdj(testCell);\t\t\t\t\t\t\t\t\t\t\t// add it to the adjacency set\n\t\t\t}\n\t\t\treturn;\t\n\t\t}\n\t\treturn;\n\t}", "private void addCardsToCommunalPile() {\n for (int i = 0; i < playersInGame.size(); i++) {\n Player playerToPopCard = playersInGame.get(i);\n communalPile.add(playerToPopCard.popCard());\n }\n }", "private void fillConversationList()\n\t{\n\t\tbasicConversations.add(\"how are you?\");\n\t\tbasicConversations.add(\"how do you do?\");\n\t\tbasicConversations.add(\"how are you feeling?\");\n\t\tbasicConversations.add(\"what is your current status?\");\n\t\tbasicConversations.add(\"how are you feeling?\");\n\t\tbasicConversations.add(\"are you feeling well?\");\n\t\tbasicConversations.add(\"how's life?\");\n\t\tbasicConversations.add(\"how's it going?\");\n\t\tbasicConversations.add(\"how art thou?\");\n\t}", "public org.landxml.schema.landXML11.CurbDocument.Curb addNewCurb()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.CurbDocument.Curb target = null;\r\n target = (org.landxml.schema.landXML11.CurbDocument.Curb)get_store().add_element_user(CURB$10);\r\n return target;\r\n }\r\n }", "public void clearLobbies() {\n\t\tlobbies.clear();\n\t}", "public POGOProtos.Rpc.CombatProto.CombatPlayerProto.Builder getOpponentBuilder() {\n \n onChanged();\n return getOpponentFieldBuilder().getBuilder();\n }", "private void insertPiece(Piece opponentPiece) {\r\n\t\tif (opponentPiece == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (opponentPiece.getPlayer().color == Color.WHITE) {\r\n\t\t\twhite.addElement(opponentPiece);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tblack.addElement(opponentPiece);\r\n\t\t}\r\n\t}", "public JWebResult\r\n addOngoingParticipantsToConference(final String userToken,\r\n final String confId,\r\n final List<ExternalCmaOngoingParticipant> ongoingParts) {\r\n System.out.println(\"Invoking addOngoingParticipantsToConference...\");\r\n logger.info(\"Invoking addOngoingParticipantsToConference...\");\r\n final JCredentials _addOngoingParticipantsToConference_credentials = new JCredentials();\r\n _addOngoingParticipantsToConference_credentials.setUserToken(userToken);\r\n final List<ExternalCmaOngoingParticipant> _addOngoingParticipantsToConference_ongoingParts = ongoingParts;\r\n final String _addOngoingParticipantsToConference_confId = confId;\r\n final JWebResult _addOngoingParticipantsToConference__return = port\r\n .addOngoingParticipantsToConference(_addOngoingParticipantsToConference_credentials,\r\n _addOngoingParticipantsToConference_ongoingParts,\r\n _addOngoingParticipantsToConference_confId);\r\n System.out.println(\"addOngoingParticipantsToConference.result=\"\r\n + _addOngoingParticipantsToConference__return);\r\n return _addOngoingParticipantsToConference__return;\r\n }", "org.landxml.schema.landXML11.LanesDocument.Lanes addNewLanes();", "public DefaultComboBoxModel llenarCombo() {\n DefaultComboBoxModel comboFut = new DefaultComboBoxModel();\n comboFut.addElement(\"Seleccione un club\");\n ResultSet res = this.consulta(\"SELECT * FROM Clubs\");\n try {\n while (res.next()) {\n // se inserta en el combo el nombre del club\n comboFut.addElement(res.getString(\"nombre\"));\n }\n close(res);\n } catch (SQLException e) {\n System.err.println(e.getMessage());\n }\n return comboFut;\n }", "public static ArrayList<Neighbourhood> generateNeighbourhoods() {\n People p1 = new People(\"Peter\", \"Smith\");\n People p2 = new People(\"Anna\", \"Hunter\");\n ArrayList<People> people = new ArrayList<People>();\n people.add(p1); people.add(p2);\n\n Post post1 = new Post(p1,\"Babysitter needed\",\"Hi we need a Babysitter for next Friday. Please send me a private message if you are interested. Pay is 5 pound per hour\");\n Post post2 = new Post(p1,\"Car for sale\");\n Post post3 = new Post(p2,\"Looking for plumber\");\n Post post4 = new Post(p2,\"Free beer\");\n\n ArrayList<Post> posts = new ArrayList<Post>();\n posts.add(post1);posts.add(post2);posts.add(post3);posts.add(post4);\n\n\n Neighbourhood n1 = new Neighbourhood(\"Partick\");\n n1.setPosts(posts);\n n1.setMembers(people);\n Neighbourhood n2 = new Neighbourhood(\"West End\");\n n2.setPosts(posts);\n n2.setMembers(people);\n ArrayList<Neighbourhood> neighbourhoods = new ArrayList<Neighbourhood>();\n neighbourhoods.add(n1);\n neighbourhoods.add(n2);\n return neighbourhoods;\n }", "private static void addNewlyArrivedUsersAsPlayers(Match match, boolean hasTheGameStarted) {\n LinkedList<Player> playersInGame = match.getGame().listOfAllPlayersAndDealer_LastPosition();\n LinkedList<User> allUsers = match.getUsers();\n List<User> newUsers = getUsersWhoAreNotRegisteredAsPlayers(playersInGame, allUsers);\n\n for (User newUser : newUsers) {\n Player newPlayer = new Player(newUser);\n match.getGame().preparePlayerForNextRound(newPlayer, hasTheGameStarted);\n match.getGame().addPlayer(newPlayer);\n }\n }", "private void addList(){\n boolean unique = true;\n String name =this.stringPopUp(\"List name:\");\n do {\n if(name == null){\n return;\n }\n if(!unique){\n unique = true;\n name = this.stringPopUp(\"List with this name already exists\");\n }\n for (Component p : window.getComponents()) {\n if (p.getName().equals(name)) {\n unique = false;\n }\n }\n }while (!unique);\n numberOfLists++;\n\n Users user = new Users();\n user.setEmail(agenda.getUsername());\n ColorPicker colorPicker = ColorPicker.createColorPicker(4);\n JOptionPane.showConfirmDialog(null, colorPicker, \"Chose default priority\", JOptionPane.OK_CANCEL_OPTION);\n Items item = new Items(name,ColorPicker.getColorName(colorPicker.getColor()),\"list\",user);\n agenda.getConnector().addItem(item,user);\n comboBox.addItem(name);\n currentList = agenda.getConnector().getItem(agenda.getUsername(),\"list\",name);\n JPanel panel = new JPanel();\n setUpList(panel);\n setup.put(name,true);\n comboBox.setSelectedItem(name);\n panel.setName(name);\n window.add(name, panel);\n this.showPanel(name);\n this.updateComponent(panel);\n comboBox.setSelectedIndex(numberOfLists-1);\n\n if(numberOfLists==1){\n setUpHeader();\n }\n }", "public void addCourseName(String courseName) {\r\n\tCoursesList = new ArrayList<String>();\r\n\tCoursesList.add(courseName);\r\n}", "public com.microsoft.schemas.xrm._2014.contracts.EndpointCollection addNewEndpoints()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.microsoft.schemas.xrm._2014.contracts.EndpointCollection target = null;\r\n target = (com.microsoft.schemas.xrm._2014.contracts.EndpointCollection)get_store().add_element_user(ENDPOINTS$0);\r\n return target;\r\n }\r\n }", "@Override\n\t\tpublic boolean addAll(int index, Collection<? extends Community> c) {\n\t\t\treturn false;\n\t\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}", "QueryElement addEmpty(String collectionProperty);", "private void addMissingWobblyScores(ArrayList<MatchStats> matches) {\n ArrayList<WobblyScore> scores = new ArrayList<>();\n\n for(MatchStats matchStats : matches) {\n MatchPlayer player = matchStats.getMainPlayer();\n\n WobblyScore wobblyScore = new WobblyScore(\n player.getWobblies(),\n player.getMetres(),\n player.getName(),\n matchStats.getStart().getTime(),\n matchStats.getMap(),\n matchStats.getMode(),\n matchStats.getId(),\n codManager.getGameId()\n );\n\n if(leaderboardSeen.contains(wobblyScore.getKey())) {\n continue;\n }\n\n scores.add(wobblyScore);\n leaderboardSeen.add(wobblyScore.getKey());\n leaderboard.add(wobblyScore);\n }\n\n // No new scores to add\n if(scores.isEmpty()) {\n return;\n }\n\n DiscordUser.addWobbliesToLeaderboard(scores);\n WobblyScore.sortLeaderboard(leaderboard, true);\n }", "@Override\n\t\tpublic boolean add(Community e) {\n\t\t\treturn false;\n\t\t}", "public PanelNewCollective getNewCollective(){\n return nuevoColectivo;\n }", "org.landxml.schema.landXML11.BridgeElementDocument.BridgeElement addNewBridgeElement();", "@Override\n\tpublic ArrayList<Community> findAll() {\n\t\treturn null;\n\t}", "@Override\n\t\tpublic ListIterator<Community> listIterator() {\n\t\t\treturn null;\n\t\t}", "public void loadLecturer2(){ \n\t\t try {\n\n\t\t\t\tConnection con = DBConnection.connect();\n\n\t\t\t\tString query=\"select * from Lecturers \";\n\t\t\t\tPreparedStatement pst=con.prepareStatement(query);\n\t\t\t\tResultSet rs=pst.executeQuery();\n\t\t\t\t\n\t\t\t\twhile(rs.next())\n\t\t\t\t{\n\t\t\t\t\tString name =rs.getString(\"LecturerName\");\n\t\t\t\t\tlec2.addItem(name);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tcon.close();\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n}", "void setAddListener(AddNeededCollaborationListener addNeededCollaborationListener);", "private List<Games> findAllInitialWerewolvesFromDB(Games games) {\n List<Games> werewolves = new ArrayList<>();\n werewolves.addAll(gamesRepository.findByGameIDAndRoomIDAndPlayerInitialRole(games.getGameID(), games.getRoomID(), \"WEREWOLF\"));\n werewolves.addAll(gamesRepository.findByGameIDAndRoomIDAndPlayerInitialRole(games.getGameID(), games.getRoomID(), \"MYSTICWOLF\"));\n werewolves.removeIf(werewolf -> werewolf.getPlayerID().length() == 1);\n return werewolves;\n }", "private void fillLeaderboard() {\n highscore_flwPane.getChildren().clear();\n List<HighScore> hList = mainController.getJSONHighScores();\n\n for(int i = 0; i < hList.size(); i++){\n HighscoreController hc = new HighscoreController(this, String.valueOf(i+1), hList.get(i).getName(),hList.get(i).getMode(),hList.get(i).getScore());\n highscore_flwPane.getChildren().add(hc);\n }\n\n }", "public Builder clearOpponent() {\n if (opponentBuilder_ == null) {\n opponent_ = null;\n onChanged();\n } else {\n opponent_ = null;\n opponentBuilder_ = null;\n }\n\n return this;\n }", "public String getColl(){\n return this.college;\n }", "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}", "public void addToList() {\n loadClubList();\n\n Intent intent = getIntent();\n String name = intent.getStringExtra(AddClub.NAME);\n String description = intent.getStringExtra(AddClub.DESCRIPTION);\n int image = intent.getIntExtra(AddClub.IMAGE, 0);\n\n if (name != null & description != null & image != 0) {\n clubList.add(new Club(name, description, image));\n }\n\n saveClubList();\n }", "private ColNode constructDancingLinks()\n {\n ColNode head = new ColNode(\"H\");\n ArrayList<ColNode> colNodes = new ArrayList<>();\n\n ColNode lastNode = head;\n //Iterate through the columns of exact cover to add columns to DLX structure\n for(int c = 0; c < dimSquared * CONSTRAINTS; c++)\n {\n //If not covered already create a new column node for it\n if(!ecmCoveredCols[c])\n {\n ColNode nextColNode = new ColNode(Integer.toString(c));\n colNodes.add(nextColNode);\n lastNode.linkNewRight(nextColNode);\n head.size++;\n lastNode = nextColNode;\n }\n \n }\n\n //Create all row nodes\n for(int r = 0; r < dimCubed; r++)\n {\n ECMNode lastNodeAdded = null;\n for(int c = 0; c < dimSquared * CONSTRAINTS; c++)\n {\n //If there is a 1 at the current pos in the ECM and it is not covered...\n if(ecMatrix[r][c] && (!ecmCoveredRows[r] && !ecmCoveredCols[c]))\n {\n ColNode colOfNewNode = null;\n for(int i = 0; i < colNodes.size(); i++)\n {\n //Find the column it is to be added to...\n String name = Integer.toString(c);\n if(name.equals(colNodes.get(i).name))\n {\n colOfNewNode = colNodes.get(i);\n break;\n }\n }\n //...and add it to the structure\n ECMNode newNode = new ECMNode(colOfNewNode);\n if(lastNodeAdded == null)\n {\n lastNodeAdded = newNode;\n }\n\n //Link with all relevant nodes and increase column size\n colOfNewNode.up.linkNewDown(newNode);\n lastNodeAdded = lastNodeAdded.linkNewRight(newNode);\n colOfNewNode.size++;\n }\n } \n }\n \n return head;\n }", "public void initialiseGodList() {\n PlayerCreator playerCreator = new PlayerCreator();\n for (int i = 0; i < playerCreator.getArrayGods().size(); i++)\n godListNames.add(playerCreator.getArrayGods().get(i).getGodName());\n }", "@Override\n public String toString() {\n return bestCommunity + \"\";\n }", "private void populatePersonalBoardList() {\n final DatabaseReference database;\n database = FirebaseDatabase.getInstance().getReference();\n\n database.child(\"PersonalBoard\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n DatabaseReference personalBoardDBRef = null;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n if(snapshot.hasChild(email.split(\"@\")[0])){\n dataSnapshot = snapshot.child(email.split(\"@\")[0]);\n personalBoardDBRef = database.child(\"PersonalBoard\").child(snapshot.getKey()).child(email.split(\"@\")[0]);\n break;\n }\n }\n\n if(personalBoardDBRef != null) {\n for(DataSnapshot snapshot : dataSnapshot.getChildren()) {\n for(DataSnapshot subsnapshot : snapshot.getChildren()) {\n personalBoardList.add(subsnapshot.getKey().toString());\n }\n }\n } else {\n personalBoardList.add(\"My Board\");\n }\n arrayAdapterPersonalBoard.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(DatabaseError d) {\n Log.d(\"Login DbError Msg ->\", d.getMessage());\n Log.d(\"Login DbError Detail ->\", d.getDetails());\n }\n });\n }", "public void addConcullor(Councillor c) {\r\n\t\tthis.councillors.add(c);\r\n\t}", "public ArrayList getLecturers();", "private void addActiveCourseListToCourseList() {\n courseList.addCoursesToList(activeCourseList);\n activeCourseList = new ArrayList<>();\n System.out.println(\"Added and Cleared!\");\n }", "private Collection<ConnectionEntry> getColleaguesInCommon(String sourceId, String targetId, Map<String, String> parameters) throws ProfileServiceException{\n \t\t\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"checkColleague\");\n \t\t}\n \t\tif (StringUtil.isEmpty(sourceId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_4);\n \t\t}\n \t\tif (StringUtil.isEmpty(targetId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_5);\n \t\t}\n \t\tDocument data = null;\n \t\tif(parameters == null){\n \t\t\tparameters = new HashMap<String, String>();\n \t\t}\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTIONS_IN_COMMON.getProfileType());\n \t\tif (isEmail(sourceId)) {\n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.EMAIL, value.toString());\n \t\t} else {\n \n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.USERID, value.toString());\n \t\t}\n \t\tparameters.put(\"connectionType\",\"colleague\");\n \n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tCollection<ConnectionEntry> colleaguesInCommon = Converter.returnConnectionEntries(data, \"connectionEntry\");\n \n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n \t\t}\n \t\treturn colleaguesInCommon;\n \t\t\n \t}", "private int createAndAddLobby(int maxPlayers, String lobbyName, int trackID){\n\n\t\tDebugOutputHandler.printDebug(\"A new Lobby has been created\");\n\t\tLobby newLobby = new Lobby(++lobbyIdCounter, maxPlayers, lobbyName, trackID, this);\n\t\tif(lobbyMap.get(lobbyIdCounter) == null){\n\t\t\tlobbyMap.put(lobbyIdCounter, newLobby);\n\t\t\treturn lobbyIdCounter;\n\t\t}else{\n\t\t\treturn -1;\n\t\t}\n\t}", "public ArrayList<CollegeFootballTeam> getTeamList();", "public static void fillComboBox() {\r\n\t\ttry {\r\n\t\t\tStatement statement = connection.createStatement();\r\n\t\t\tresults = statement.executeQuery(\"Select PeopleName from people \");\r\n\t\t\twhile (results.next()) {\r\n\t\t\t\tString peopleName = results.getString(\"PeopleName\");\r\n\t\t\t\tcomboBox.addItem(peopleName);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t \te.printStackTrace();\r\n\t\t}\r\n\t}", "GameBoardVertex(ArrayList<GameBoardVertex> neighbors){this.neighbors = neighbors;}", "public void refreshGameSearchList() {\n gamesSearchListModel.clear();\n List<String> games = dbMgr.getAllGameTitles(username);\n List<String> gamesOwned = dbMgr.getGameTitles(username);\n\n // fill list with games user does not own\n for (int i = 0; i < games.size(); i++) {\n if(!gamesOwned.contains(games.get(i)))\n gamesSearchListModel.addElement(games.get(i)); \n }\n\n gamesSearchList.setModel(gamesSearchListModel);\n\n }", "private void addDefaultPerson() {\n personNames.add(\"you\");\n personIds.add(STConstants.PERSON_NULL_ID);\n personPhotos.add(null);\n personSelections.add(new HashSet<Integer>()); \n }", "private Element generateEmptyOutboundElem(XmlProcessor hqmfXmlProcessor) {\n\t\tElement outboundRelElem = hqmfXmlProcessor.getOriginalDoc().createElement(OUTBOUND_RELATIONSHIP);\n\t\toutboundRelElem.setAttribute(TYPE_CODE, \"COMP\");\n\t\treturn outboundRelElem;\n\t}", "@Override\n\t\tpublic Iterator<Community> iterator() {\n\t\t\treturn null;\n\t\t}", "QueryElement addOrEmpty(String collectionProperty);", "public void addParticipants(Player rating) {\n\t\tparticipants.add(rating);\n\t}", "public WorldUps.UFinished.Builder addCompletionsBuilder() {\n return getCompletionsFieldBuilder().addBuilder(\n WorldUps.UFinished.getDefaultInstance());\n }", "public void loadLecturer1(){ \n\t\t try {\n\n\t\t\t\tConnection con = DBConnection.connect();\n\n\t\t\t\tString query=\"select * from Lecturers \";\n\t\t\t\tPreparedStatement pst=con.prepareStatement(query);\n\t\t\t\tResultSet rs=pst.executeQuery();\n\t\t\t\t\n\t\t\t\twhile(rs.next())\n\t\t\t\t{\n\t\t\t\t\tString name =rs.getString(\"LecturerName\");\n\t\t\t\t\tlec1.addItem(name);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tcon.close();\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\n}", "PersonGroupListAdapter() {\n personGroupIdList = new ArrayList<>();\n\n Set<String> personGroupIds\n = StorageHelper.getAllPersonGroupIds(MainActivity.this);\n\n for (String personGroupId: personGroupIds) {\n personGroupIdList.add(personGroupId);\n if (mPersonGroupId != null && personGroupId.equals(mPersonGroupId)) {\n personGroupIdList.set(\n personGroupIdList.size() - 1,\n mPersonGroupListAdapter.personGroupIdList.get(0));\n mPersonGroupListAdapter.personGroupIdList.set(0, personGroupId);\n }\n }\n }", "private void addFriendList(People value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureFriendListIsMutable();\n friendList_.add(value);\n }", "public Builder clearLobbyId() {\n bitField0_ = (bitField0_ & ~0x00000001);\n lobbyId_ = getDefaultInstance().getLobbyId();\n onChanged();\n return this;\n }", "private void append_chat_conversation(DataSnapshot dataSnapshot) {\n Vibrator mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);\n Iterator i = dataSnapshot.getChildren().iterator();\n while (i.hasNext()) {\n String chat_msg = (String) ((DataSnapshot) i.next()).getValue();\n String chat_user_name = (String) ((DataSnapshot) i.next()).getValue();\n if (chat_user_name.equals( ad.getName())) {\n Spannable Chatme = new SpannableString(chat_user_name + \" : \" + chat_msg + \" \\n\");\n Chatme.setSpan(new ForegroundColorSpan(Color.BLUE), 0, chat_user_name.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n chat_conversation.append(Chatme);\n\n } else {\n chat_conversation.append( chat_user_name + \" : \" + chat_msg + \" \\n\");\n mVibrator.vibrate(200);\n }\n }\n }", "public void addCombo(Combo newCombo){\n ComboList.add(newCombo);\n\n }", "public ArrayList<String> getColaboradores() {\n return colaboradores;\n }", "public Championship()\n {\n drivers = new ListOfDrivers();\n venues = new ListOfVenues();\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.OrganizationPositionList addNewOrganizationPositionList();", "GameBoardVertex(GameBoardVertex neighbor){this.neighbors.add(neighbor);}", "static void addToWinnings(Card[] winnings, Card... cards) {\n //Find the first null position in the winnings array and place\n //each card in that position.\n for (int i = 0; i < cards.length; i++)\n for (int j = 0; j < winnings.length; j++)\n if (winnings[j] == null) {\n winnings[j] = new Card(cards[i]);\n break;\n }\n }", "public CommunityBuilder community() {\n return new CommunityBuilder(this);\n }", "private ArrayList<WobblyScore> getWobblyLeaderboard() {\n ArrayList<WobblyScore> wobblyScores = new ArrayList<>();\n String json = DiscordUser.getWobbliesLeaderboard(codManager.getGameId());\n if(json == null) {\n return wobblyScores;\n }\n JSONArray scores = new JSONArray(json);\n for(int i = 0; i < scores.length(); i++) {\n wobblyScores.add(WobblyScore.fromJSON(scores.getJSONObject(i), codManager));\n }\n WobblyScore.sortLeaderboard(wobblyScores, true);\n return wobblyScores;\n }", "@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 }", "public void createChallenger() {\n\n Random random = new Random();\n if(currentTurn.getActivePlayers().size() != 1) {\n currentTurn.setCurrentPlayer(currentTurn.getActivePlayers().get(random.nextInt(currentTurn.getActivePlayers().size() - 1)));\n } else {\n currentTurn.setCurrentPlayer(currentTurn.getActivePlayers().get(0));\n }\n int i = onlinePlayers.indexOf(currentTurn.getCurrentPlayer());\n stateList.set(i, new Initialized(getCurrentTurn().getCurrentPlayer(), this));\n\n }", "public void newClubEvent() {\n \n // Capture current category selection, if any\n String selectedTags = \"\";\n TagsNode tags = (TagsNode)tagsTree.getLastSelectedPathComponent();\n if (tags != null) {\n selectedTags = tags.getTagsAsString();\n } \n \n boolean modOK = modIfChanged();\n \n if (modOK) {\n position = new ClubEventPositioned();\n position.setIndex (clubEventList.size());\n localPath = \"\";\n display();\n clubEventPanel1.getStatusTextSelector().setText (selectedTags);\n }\n }", "public ArrayList<Olive> addOlive(int numOlive) {\n\t\tOlive olive;\n\t\tArrayList<Olive> olives = new ArrayList<Olive>();\n\n\t\tfor (int j = 0; j < numOlive; j++) {\n\t\t\tolive = new Ligurian();\n\t\t\t\n\t\t\tif (j > 2 && j < 5) {\n\t\t\t\tolive = new Kalamata();\n\n\t\t\t} else if (j > 5) {\n\t\t\t\tolive = new Olive(j);\n\t\t\t}\n\t\t\tolives.add(olive);\n\t\t}\n\t\treturn olives;\n\t\t\n\t}", "public JPanel createRoomGuessPanel() {\n\t\tJPanel panel = new JPanel();\n\t\tJComboBox<String> comboBox = new JComboBox<String>();\n\t\tpanel.setBorder(new TitledBorder(new EtchedBorder(), \"Room Guess\"));\n\t\tcomboBox.addItem(\"Unsure\");\n\t\tcomboBox.addItem(\"Conservatory\");\n\t\tcomboBox.addItem(\"Kitchen\");\n\t\tcomboBox.addItem(\"Ballroom\");\n\t\tcomboBox.addItem(\"Library\");\n\t\tcomboBox.addItem(\"Arcade room\");\n\t\tcomboBox.addItem(\"Gun room\");\n\t\tcomboBox.addItem(\"Trophy room\");\n\t\tcomboBox.addItem(\"Pantry\");\n\t\tcomboBox.addItem(\"Sauna\");\t\n\t\tpanel.add(comboBox);\n\t\treturn panel;\n\t}", "public JPanel createPersonGuessPanel() {\n\t\tJPanel panel = new JPanel();\n\t\tJComboBox<String> comboBox = new JComboBox<String>();\n\t\tpanel.setBorder(new TitledBorder(new EtchedBorder(), \"Person Guess\"));\n\t\tcomboBox.addItem(\"Unsure\");\n\t\tcomboBox.addItem(\"Miss Scarlet\");\n\t\tcomboBox.addItem(\"Colonel Mustard\");\n\t\tcomboBox.addItem(\"Mr. Green\");\n\t\tcomboBox.addItem(\"Mrs. White\");\n\t\tcomboBox.addItem(\"Mrs. Peacock\");\n\t\tcomboBox.addItem(\"Professor Plum\");\n\t\tpanel.add(comboBox);\n\t\treturn panel;\n\t}", "private void addFriendList(\n People.Builder builderForValue) {\n ensureFriendListIsMutable();\n friendList_.add(builderForValue.build());\n }", "@Test\n\tpublic void testCourseSetMembersReconciled() throws Exception {\n\t\tMembership member = (Membership)cmService.getCourseSetMemberships(\"ucb\").iterator().next();\n\t\tAssert.assertEquals(\"birgeneau\", member.getUserId());\n\t\tAssert.assertEquals(\"president\", member.getRole());\n\t\t\n\t\t// Add a new membership\n\t\tMembership newMember = cmAdmin.addOrUpdateCourseSetMembership(\"foo\", \"bar\", \"ucb\", \"active\");\n\t\t\n\t\t// Ensure it was added\n\t\tAssert.assertTrue(cmService.getCourseSetMemberships(\"ucb\").contains(newMember));\n\t\t\n\t\t// Reconcile again\n\t\tjob.syncAllCmObjects();\n\t\t\n\t\t// Ensure that the new member was removed\n\t\tAssert.assertFalse(cmService.getCourseSetMemberships(\"ucb\").contains(newMember));\n\t}", "public Neighborhood()\n\t{\n\t\tlistOfNeighborhoods = new ArrayList<ArrayList<Pokemon>>(numberOfNeighborhoods);\n\t\tfor (int i=0; i<numberOfNeighborhoods; i++)\n\t\t{\n\t\t\tlistOfNeighborhoods.add(i, new ArrayList<Pokemon>());\n\t\t}\n\t}", "ImmutableList<SchemaOrgType> getContributorList();", "public void addCastCrew() {\n ResultSet result = null;\n try {\n result = server.executeStatement(\"SELECT * FROM castandcrew INNER JOIN Person ON castandcrew.personID = person.personID WHERE castandcrew.prodID = \" + \"'\" + getId() + \"'\" + \";\");\n while(result.next()) {\n String name = result.getString(\"primaryName\");\n String id = result.getString(\"personID\");\n String jobID = result.getString(\"jobID\");\n String characterPlayed = result.getString(\"characterPlayed\");\n String jobTitle = result.getString(\"jobTitle\");\n int birthYear = result.getInt(\"birthYear\");\n int deathYear = result.getInt(\"deathYear\");\n PersonResult newResult = new PersonResult(id, \"Person\", name, jobTitle, characterPlayed, jobID, birthYear, deathYear, server);\n castCrew.add(newResult);\n }\n } catch (SQLException e) {\n\n }\n }" ]
[ "0.6157593", "0.5224465", "0.4934677", "0.49014658", "0.48734924", "0.47705543", "0.47200954", "0.46745977", "0.46465138", "0.46232134", "0.45994034", "0.45814013", "0.45807508", "0.45602456", "0.454714", "0.45121264", "0.44937575", "0.44427234", "0.44345015", "0.4424256", "0.44241112", "0.44128647", "0.44031292", "0.4385964", "0.43699443", "0.43575716", "0.43533167", "0.43420178", "0.4338362", "0.43258974", "0.43221515", "0.43159786", "0.43032196", "0.43014598", "0.4296527", "0.42873883", "0.4267208", "0.42531267", "0.425241", "0.425192", "0.42346364", "0.42346352", "0.42304838", "0.4230292", "0.42204553", "0.42190963", "0.42162147", "0.42122918", "0.4206046", "0.42010778", "0.41882375", "0.41806364", "0.41782743", "0.41725272", "0.41699675", "0.41691053", "0.41676405", "0.41594586", "0.414884", "0.41456413", "0.41395473", "0.41237074", "0.4122759", "0.41202122", "0.41201407", "0.41157794", "0.4112875", "0.41042653", "0.40947545", "0.40942952", "0.40942162", "0.40904438", "0.40904224", "0.40896392", "0.40870872", "0.4081046", "0.4079928", "0.40780276", "0.40747112", "0.40720457", "0.40645373", "0.40625912", "0.40624505", "0.4053059", "0.40424854", "0.4036429", "0.40293002", "0.40275043", "0.40267387", "0.40173775", "0.40171784", "0.40155312", "0.40136826", "0.40040022", "0.39994246", "0.39969856", "0.3994929", "0.39865255", "0.3986519", "0.398619" ]
0.70910114
0
Gets a List of "employee" elements
public java.util.List<andrewNamespace.xsdconfig.EmployeeDocument.Employee> getEmployeeList() { final class EmployeeList extends java.util.AbstractList<andrewNamespace.xsdconfig.EmployeeDocument.Employee> { @Override public andrewNamespace.xsdconfig.EmployeeDocument.Employee get(int i) { return ColleaguesImpl.this.getEmployeeArray(i); } @Override public andrewNamespace.xsdconfig.EmployeeDocument.Employee set(int i, andrewNamespace.xsdconfig.EmployeeDocument.Employee o) { andrewNamespace.xsdconfig.EmployeeDocument.Employee old = ColleaguesImpl.this.getEmployeeArray(i); ColleaguesImpl.this.setEmployeeArray(i, o); return old; } @Override public void add(int i, andrewNamespace.xsdconfig.EmployeeDocument.Employee o) { ColleaguesImpl.this.insertNewEmployee(i).set(o); } @Override public andrewNamespace.xsdconfig.EmployeeDocument.Employee remove(int i) { andrewNamespace.xsdconfig.EmployeeDocument.Employee old = ColleaguesImpl.this.getEmployeeArray(i); ColleaguesImpl.this.removeEmployee(i); return old; } @Override public int size() { return ColleaguesImpl.this.sizeOfEmployeeArray(); } } synchronized (monitor()) { check_orphaned(); return new EmployeeList(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Employee> getEmployees();", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employees;\r\n\t}", "List<Employee> allEmpInfo();", "public Employee[] getEmployeesList() {\n\t\treturn employees;\n\t}", "public List<Employee> list() {\n\t\t\treturn employees;\n\t\t}", "public static List<Employee> getListEmployee() throws ParserConfigurationException {\n List<Employee> listEmployees = new ArrayList<>();\n String filePath = \"src/task2/employee.xml\";\n File file = new File(filePath);\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder;\n\n try {\n docBuilder = docFactory.newDocumentBuilder();\n Document doc = docBuilder.parse(file);\n doc.getDocumentElement().normalize();\n NodeList nodeList = doc.getElementsByTagName(\"employee\");\n for (int i = 0; i < nodeList.getLength(); i++) {\n listEmployees.add(getEmployee(nodeList.item(i)));\n }\n return listEmployees;\n } catch (ParserConfigurationException | SAXException | IOException e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n return null;\n }", "public List<Employee> getAllEmployees() {\n\t\tList<Employee> list = new ArrayList<Employee>();\n\t\tlist = template.loadAll(Employee.class);\n\t\treturn list;\n\t}", "@Override\r\n\tpublic List<Employe> getEmployes() {\n\t\treturn dao.getEmployes();\r\n\t}", "@Override\n\tpublic List<Map<String, String>> employeeList() throws Exception {\n\t\treturn null;\n\t}", "public String getEmployees(){\n return employees;\n }", "public List<Employee> getEmployeesOnly() {\n\t\treturn edao.listEmployeOnly();\n\t}", "public Employee[] getAll() {\n\t\tEmployee[] empArray = new Employee[list.size()];\n\t\tfor (int i = 0; i < list.size(); i++) \n\t\t\tempArray[i] = list.get(i);\n\t\t\t\n\t\treturn empArray;\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\ttry {\n\t\t\tList<Employee> empList = new ArrayList<Employee>();\n\t\t\tList<Map<String, Object>> rows = template.queryForList(\"select * from employee\");\n\t\t\tfor(Map<?, ?> rowNum : rows) {\n\t\t\t\tEmployee emp = new Employee();\n\t\t\t\temp.setEmployeeId((Integer)rowNum.get(\"empid\"));\n\t\t\t\temp.setFirstName((String)rowNum.get(\"fname\"));\n\t\t\t\temp.setLastName((String)rowNum.get(\"lname\"));\n\t\t\t\temp.setEmail((String)rowNum.get(\"email\"));\n\t\t\t\temp.setDesignation((String)rowNum.get(\"desig\"));\n\t\t\t\temp.setLocation((String)rowNum.get(\"location\"));\n\t\t\t\temp.setSalary((Integer)rowNum.get(\"salary\"));\n\t\t\t\tempList.add(emp);\n\t\t\t}\n\t\t\treturn empList;\n\t\t} catch (DataAccessException excep) {\n\t\t\treturn null;\n\t\t}\n\t}", "public List<Employee> getAllEmployees(){\n\t\tFaker faker = new Faker();\n\t\tList<Employee> employeeList = new ArrayList<Employee>();\n\t\tfor(int i=101; i<=110; i++) {\n\t\t\tEmployee myEmployee = new Employee();\n\t\t\tmyEmployee.setId(i);\n\t\t\tmyEmployee.setName(faker.name().fullName());\n\t\t\tmyEmployee.setMobile(faker.phoneNumber().cellPhone());\n\t\t\tmyEmployee.setAddress(faker.address().streetAddress());\n\t\t\tmyEmployee.setCompanyLogo(faker.company().logo());\n\t\t\temployeeList.add(myEmployee);\n\t\t}\n\t\treturn employeeList;\n\t}", "public ArrayList<Employee> getEmployeeList()\r\n\t{\r\n\t\treturn new ArrayList<Employee>(empList);\r\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\r\n\t}", "public List<Employee> getListOfAllEmployees() {\n\t\tlista = employeeDao.findAll();\r\n\r\n\t\treturn lista;\r\n\t}", "public List<Employee> getAllEmployee(){\n List<Employee> employee = new ArrayList<Employee>();\n employeeRepository.findAll().forEach(employee::add);\n return employee;\n }", "public List<EmployeeDetails> getEmployeeDetails();", "public List<Employee> getAllEmployees(){\n\t\tList<Employee> employees = employeeDao.findAll();\n\t\tif(employees != null)\n\t\t\treturn employees;\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> getEmpList() throws EmpException {\n\t\treturn dao.getEmpList();\n\t}", "@Override\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> getEmpleados() {\n\t\treturn repositorioEmployee.findAll();\n\t}", "@Override\n\tpublic List<EmployeeBean> getEmployeeList() throws Exception {\n\t\treturn employeeDao.getEmployeeList();\n\t}", "@Override\r\n\tpublic List<Employee> findAllEMployees() {\n\t\tList<Employee> employees = new ArrayList<Employee>();\r\n\t\tString findData = \"select * from employee\";\r\n\r\n\t\ttry {\r\n\t\t\tStatement s = dataSource.getConnection().createStatement();\r\n\r\n\t\t\tResultSet set = s.executeQuery(findData);\r\n\r\n\t\t\twhile (set.next()) {\r\n\t\t\t\tString name = set.getString(1);\r\n\t\t\t\tint id = set.getInt(\"empId\");\r\n\t\t\t\tint sal = set.getInt(\"salary\");\r\n\t\t\t\tString tech = set.getString(\"technology\");\r\n\t\t\t\tEmployee employee = new Employee(id, sal, name, tech);\r\n\t\t\t\temployees.add(employee);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn employees;\r\n\r\n\t}", "public List<EmployeeTO> getAllEmployees() {\n\t\t\r\n\t\treturn EmployeeService.getInstance().getAllEmployees();\r\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\n\t}", "public Vector<Employees> getEmployees() {\n\t\t\tVector<Employees> v = new Vector<Employees>();\n\t\t\ttry {\n\t\t\t\tStatement stmt = conn.createStatement();\n\t\t\t\tResultSet rs = stmt\n\t\t\t\t\t\t.executeQuery(\"select * from employees_details order by employees_pf\");\n\t\t\t\twhile (rs.next()) {\n\t\t\t\t\tint file_num = rs.getInt(1);\n\t\t\t\t\tString name = rs.getString(2);\n\t\t\t\t\tint drive = rs.getInt(3);\n\t\t\t\t\tEmployees employee = new Employees(file_num, name, drive);\n//\t\t\t\t\tCars cars = new Truck(reg, model, drive);\n\t\t\t\t\tv.add(employee);\n\t\t\t\t}\n\t\t\t}\n\t\tcatch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn v;\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\t\n\t\tlog.debug(\"EmplyeeService.getAllEmployee() return list of employees\");\n\t\treturn repositary.findAll();\n\t}", "public List<Employee> getAll() {\n\t\treturn edao.listEmploye();\n\t}", "public List<Employe> findAllEmployees() {\n\t\treturn null;\n\t}", "@Override\n @Transactional\n public List<Employee> getlistEmployee() {\n \tList<Employee> employees = entityManager.createQuery(\"SELECT e FROM Employee e\", Employee.class).getResultList();\n \tfor(Employee p : employees)\n \t\tLOGGER.info(\"employee list::\" + p);\n \treturn employees;\n }", "public List<Employee> getAllEmployeeDetail() {\n\t\treturn dao.getAllEmployeeDetail();\n\t}", "@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}", "@Override\n\tpublic com.ssaga.human.service.List<EmployeeDto> empList() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Emp> findAll() {\n\t\treturn eb.findAll();\n\t}", "public com.example.nettyserver.protobuf.Employee.EmployeeInfo getEmployeelist() {\n return employeelist_ == null ? com.example.nettyserver.protobuf.Employee.EmployeeInfo.getDefaultInstance() : employeelist_;\n }", "@Override\n\tpublic List<Employee> getAllEmployee() {\n\t\tList<Employee> employee = new ArrayList<>();\n\t\tlogger.info(\"Getting all employee\");\n\t\ttry {\n\t\t\temployee = employeeDao.getAllEmployee();\n\t\t\tlogger.info(\"Getting all employee = {}\",employee.toString());\n\t\t} catch (Exception exception) {\n\t\t\tlogger.error(exception.getMessage());\n\t\t}\n\t\treturn employee;\n\t}", "@SuppressWarnings(\"unchecked\")\n\t\t\n\t\tpublic List<Employee> listEmployee() throws SQLException {\n\t\t\treturn (List<Employee>) employeeDAO.listEmployee();\n\t\t}", "@Override\r\n\tpublic List<Employee> selectAllEmployee() {\n\t\treturn null;\r\n\t}", "public List<Employee> getEmployees() {\n\n\t\tList<Employee> employees = new ArrayList<Employee>();\n\t\t\n\t\t/*Sample data begins\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tEmployee employee = new Employee();\n\t\t\temployee.setEmail(\"shiyong@cs.sunysb.edu\");\n\t\t\temployee.setFirstName(\"Shiyong\");\n\t\t\temployee.setLastName(\"Lu\");\n\t\t\temployee.setAddress(\"123 Success Street\");\n\t\t\temployee.setCity(\"Stony Brook\");\n\t\t\temployee.setStartDate(\"2006-10-17\");\n\t\t\temployee.setState(\"NY\");\n\t\t\temployee.setZipCode(11790);\n\t\t\temployee.setTelephone(\"5166328959\");\n\t\t\temployee.setEmployeeID(\"631-413-5555\");\n\t\t\temployee.setHourlyRate(100);\n\t\t\temployees.add(employee);\n\t\t}\n\t\tSample data ends*/\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tConnection con = DriverManager.getConnection(\"jdbc:mysql://mysql3.cs.stonybrook.edu:3306/mwcoulter?useSSL=false\",\"mwcoulter\",\"111030721\");\n\t\t\tStatement st = con.createStatement();\n\t\t\tResultSet rs = st.executeQuery(\"SELECT P.*, E.StartDate, E.HourlyRate, E.Email, E.ID, L.* \"\n\t\t\t\t\t+ \"FROM Employee E, Person P, Location L\"\n\t\t\t\t\t+ \" WHERE P.SSN = E.SSN AND L.ZipCode = P.ZipCode\");\n\t\t\twhile(rs.next()) {\n\t\t\t\tEmployee employee = new Employee();\n\t\t\t\temployee.setEmail(rs.getString(\"Email\"));\n\t\t\t\temployee.setFirstName(rs.getString(\"FirstName\"));\n\t\t\t\temployee.setLastName(rs.getString(\"LastName\"));\n\t\t\t\temployee.setAddress(rs.getString(\"Address\"));\n\t\t\t\temployee.setCity(rs.getString(\"City\"));\n\t\t\t\temployee.setStartDate(String.valueOf(rs.getDate(\"StartDate\")));\n\t\t\t\temployee.setState(rs.getString(\"State\"));\n\t\t\t\temployee.setZipCode(rs.getInt(\"ZipCode\"));\n\t\t\t\temployee.setTelephone(String.valueOf(rs.getLong(\"Telephone\")));\n\t\t\t\temployee.setEmployeeID(String.valueOf(rs.getInt(\"SSN\")));\n\t\t\t\temployee.setHourlyRate(rs.getInt(\"HourlyRate\"));\n\t\t\t\temployees.add(employee);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t\treturn employees;\n\t}", "@GetMapping(value=\"/employes\")\n\tpublic List<Employee> getEmployeeDetails(){\n\t\t\n\t\tList<Employee> employeeList = employeeService.fetchEmployeeDetails();\n\t\treturn employeeList;\t\t\t\t\t\t\n\t}", "public List<Employees> getEmployeesList()\n {\n return employeesRepo.findAll();\n }", "@Override\n public List<Employee> getAllEmployees() {\n return null;\n }", "@Override\n\tpublic List<Empdetails> getemplist() {\n\t\treturn empDAO.getemplist();\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employeeDao.getAllEmployee();\r\n\t}", "@Override\n\tpublic List<Employee> queryEmp() {\n\t\treturn null;\n\t}", "@Override\n\tpublic ArrayList<Employee> getEmpList() throws HrExceptions {\n\t\tSystem.out.println(\"In getEmpList() of Dao\");\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> findAllEmployee() {\n\t\treturn null;\n\t}", "public static Map<Integer,Employee1> getEmployeeList(){\r\n\t return employees;\r\n\t \r\n }", "public List<Employee> selectAllEmployee() {\n\n\t\t// using try-with-resources to avoid closing resources (boiler plate code)\n\t\tList<Employee> emp = new ArrayList<>();\n\t\t// Step 1: Establishing a Connection\n\t\ttry (Connection connection = dbconnection.getConnection();\n\n\t\t\t\t// Step 2:Create a statement using connection object\n\t\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(SELECT_ALL_employe);) {\n\t\t\tSystem.out.println(preparedStatement);\n\t\t\t// Step 3: Execute the query or update query\n\t\t\tResultSet rs = preparedStatement.executeQuery();\n\n\t\t\t// Step 4: Process the ResultSet object.\n\t\t\twhile (rs.next()) {\n\t\t\t\tint id = rs.getInt(\"id\");\n\t\t\t\tString employeename = rs.getString(\"employeename\");\n\t\t\t\tString address = rs.getString(\"address\");\n\t\t\t\tint mobile = rs.getInt(\"mobile\");\n\t\t\t\tString position = rs.getString(\"position\");\n\t\t\t\tint Salary = rs.getInt(\"Salary\");\n\t\t\t\tString joineddate = rs.getString(\"joineddate\");\n\t\t\t\tString filename =rs.getString(\"filename\");\n\t\t\t\tString path = rs.getString(\"path\");\n\t\t\t\temp.add(new Employee(id, employeename, address, mobile, position, Salary, joineddate,filename,path));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tdbconnection.printSQLException(e);\n\t\t}\n\t\treturn emp;\n\t}", "@Override\r\n\tpublic List<Emp> getAll() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployeeList() throws Exception {\n\t\t\r\n\t\treturn (List<Employee>) employeeRepository.findAll();\r\n\t}", "@Override\n\tpublic List<Employee> getEmpInfo() {\n\t\treturn null;\n\t}", "@RequestMapping(value = \"/v2/employees\", method = RequestMethod.GET)\r\n\tpublic List<Employee> employeev2() {\r\n JPAQuery<?> query = new JPAQuery<Void>(em);\r\n QEmployee qemployee = QEmployee.employee;\r\n List<Employee> employees = (List<Employee>) query.from(qemployee).fetch();\r\n // Employee oneEmp = employees.get(0);\r\n\t\treturn employees;\r\n }", "@Override\n\tpublic List<Employee> findAllEmployees() {\n\t\treturn employeeRepository.findAllEmployess();\n\t}", "public List<Employee> getAllEmployees() {\n return employeeRepository.findAll();\n }", "@Override\r\n\tpublic List<Employee> getdetails() {\n\t\treturn empdao.findAll();\r\n\t}", "@Override\n\tpublic List<EmployeeBean> getAllEmployees() {\n\t\tLOGGER.info(\"starts getAllEmployees method\");\n\t\tLOGGER.info(\"Ends getAllEmployees method\");\n\t\t\n\t\treturn adminEmployeeDao.getAllEmployees();\n\t}", "@SuppressWarnings( \"unchecked\" )\n public List<Employment> getEmployments() {\n return (List<Employment>) CollectionUtils.select(\n getQueryService().findAllEmploymentsWithKnownActors(),\n new Predicate() {\n public boolean evaluate( Object obj ) {\n return !isFilteredOut( (Employment) obj ) && isInNameRange( (Employment) obj );\n }\n }\n );\n\n }", "public Map<String, Person> getEmployees() {\n return employees;\n }", "public List<Emp> getAllEmps() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn employeeDao.getAllEmployees();\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\tfinal Session session = sessionFactory.getCurrentSession();\t\t\r\n\t\tfinal Query query = session.createQuery(\"from Employee e order by id desc\");\r\n\t\t//Query q = session.createQuery(\"select NAME from Customer\");\r\n\t\t//final List<Employee> employeeList = query.list(); \r\n\t\treturn (List<Employee>) query.list();\r\n\t}", "public static ArrayList<Employee> getAllEmployee() throws SQLException {\n\t\tConnection connection = DatabaseConnection.getConnection();\n\t\tArrayList<Employee> employee = new ArrayList<>();\n\t\tString query = \"SELECT * FROM EMPLOYEE\";\n\t\tPreparedStatement pStatement = connection.prepareStatement(query);\n\t\tResultSet resultSet = pStatement.executeQuery();\n\t\twhile (resultSet.next()) {\n\t\t\temployee.add(new Employee(resultSet.getString(\"empId\"), resultSet\n\t\t\t\t\t.getString(\"ename\")));\n\t\t}\n\t\treturn employee;\n\t}", "public List<String> getAll() {\n\treturn employeeService.getAll();\n }", "@RequestMapping(\"/employee\")\n\tpublic List<Employee> getAllEmplyee() {\n\t\treturn service.getAllEmplyee();\n\t}", "@Override\r\n\tpublic List<Employee> findAll() {\n\t\treturn null;\r\n\t}", "public void listEmployees()\n\t{\n\t\tString str = \"Name\\tSurname\\tMail\\tPassword\\tBranchId\\tId\\n\";\n\t\t\n\t\tList<Employee> employees = this.company.getEmployees();\n\n\t\tfor(int i=0; i<employees.length(); i++)\n\t\t{\n\t\t\tstr += employees.get(i).getName() + \"\\t\" + employees.get(i).getSurname() + \"\\t\" + employees.get(i).getMail() + \"\\t\" + employees.get(i).getPassword() + \"\\t\\t\" + employees.get(i).getBranchId() + \"\\t\\t\" + employees.get(i).getId() + \"\\n\";\n\t\t}\n\n\t\tSystem.out.println(str);\n\n\t}", "public List<Employees>getEMPMenaning() {\n\tString sql = \"SELECT Id_employees, Name_and_surname, Password, Work_role FROM employees \";\n\t\n\tList<Employees>list = new ArrayList<Employees>();\n\t\n\ttry {\n\t\tPreparedStatement preparedStatement = ConnectionToTheBase.getConnectionToTheBase().getConnection().prepareStatement(sql);\n\t\tResultSet resultSet = preparedStatement.executeQuery();\n\t\t\n\t\twhile(resultSet.next()) {\n\t\t\tEmployees getEMPMenaning = new Employees();\n\t\t\tgetEMPMenaning.setIdEmployees(resultSet.getInt(\"Id_employees\"));\n\t\t getEMPMenaning.setNameAndSurname(resultSet.getString(\"Name_and_surname\"));\n\t\t getEMPMenaning.setPassword(resultSet.getString(\"Password\"));\n\t\t getEMPMenaning.setWorkRole(resultSet.getInt(\"Work_role\"));\n\t\t \n\t\t\tlist.add(getEMPMenaning);\n\t\t}\n\t} catch (SQLException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t\n\treturn list;\n\n\n\t\n}", "public com.example.nettyserver.protobuf.Employee.EmployeeInfo getEmployeelist() {\n if (employeelistBuilder_ == null) {\n return employeelist_ == null ? com.example.nettyserver.protobuf.Employee.EmployeeInfo.getDefaultInstance() : employeelist_;\n } else {\n return employeelistBuilder_.getMessage();\n }\n }", "@RequestMapping(value = \"/listEmployees\", method = RequestMethod.GET)\r\n\tpublic Employee employees() {\r\n System.out.println(\"---BEGIN\");\r\n List<Employee> allEmployees = employeeData.findAll();\r\n \r\n System.out.println(\"size of emp == \"+allEmployees.size());\r\n System.out.println(\"---END\");\r\n Employee oneEmployee = allEmployees.get(0);\r\n\t\treturn oneEmployee;\r\n }", "@Transactional(readOnly = true)\r\n\t@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\treturn em.createQuery(\"select e from Employee e order by e.office_idoffice\").getResultList();\r\n\t}", "public List<User> getAllEmployees(String companyShortName);", "public ViewObjectImpl getEmployees() {\n return (ViewObjectImpl)findViewObject(\"Employees\");\n }", "public com.example.nettyserver.protobuf.Employee.EmployeeInfoOrBuilder getEmployeelistOrBuilder() {\n return getEmployeelist();\n }", "public Employee[] getAllEmployees() {\n List<Employee> emps = new ArrayList<>();\n // Iterate through the memory array and find Employee objects\n for (Employee e : employeeArray) {\n if (e != null) {\n emps.add(e);\n }\n }\n return emps.toArray(new Employee[0]);\n }", "public List<Employee> findAll() {\n return employeeRepository.findAll();\n }", "public LinkedListOfEmployees getEmployees(String g) {\n\t}", "@GetMapping(\"/employees\")\r\n\tpublic List<Employee> getEmployees(){\r\n\t\t\r\n\t\treturn employeeService.getEmployees();\r\n\t\t\r\n\t}", "public static List<Employee> getAllEmployees(){\n\t\t// Get the Datastore Service\n\t\tlog.severe(\"datastoremanager-\" + 366);\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\t\tlog.severe(\"datastoremanager-\" + 368);\n\t\tQuery q = buildAQuery(null);\n\t\tlog.severe(\"datastoremanager-\" + 370);\n\t\t// Use PreparedQuery interface to retrieve results\n\t\tPreparedQuery pq = datastore.prepare(q);\n\t\tlog.severe(\"datastoremanager-\" + 373);\n\t\t//List for returning\n\t\tList<Employee> returnedList = new ArrayList<>();\n\t\tlog.severe(\"datastoremanager-\" + 376);\n\t\t//Loops through all results and add them to the returning list \n\t\tfor (Entity result : pq.asIterable()) {\n\t\t\tlog.severe(\"datastoremanager-\" + 379);\n\t\t\t//Vars to use\n\t\t\tString actualFirstName = null;\n\t\t\tString actualLastName = null;\n\t\t\tBoolean attendedHrTraining = null;\n\t\t\tDate hireDate = null;\n\t\t\tBlob blob = null;\n\t\t\tbyte[] photo = null;\n\t\t\t\n\t\t\t//Get results via the properties\n\t\t\ttry {\n\t\t\t\tactualFirstName = (String) result.getProperty(\"firstName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tactualLastName = (String) result.getProperty(\"lastName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tattendedHrTraining = (Boolean) result.getProperty(\"attendedHrTraining\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\thireDate = (Date) result.getProperty(\"hireDate\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tblob = (Blob) result.getProperty(\"picture\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tphoto = blob.getBytes();\n\t\t\t} catch (Exception e){}\n\t\t\tlog.severe(\"datastoremanager-\" + 387);\n\t\t\t\n\t\t\t//Build an employee (If conditionals for nulls)\n\t\t\tEmployee emp = new Employee();\n\t\t \temp.setFirstName((actualFirstName != null) ? actualFirstName : null);\n\t\t \temp.setLastName((actualLastName != null) ? actualLastName : null);\n\t\t \temp.setAttendedHrTraining((attendedHrTraining != null) ? attendedHrTraining : null);\n\t\t \temp.setHireDate((hireDate != null) ? hireDate : null);\n\t\t \temp.setPicture((photo != null) ? photo : null);\n\t\t \tlog.severe(\"datastoremanager-\" + 395);\n\t\t \treturnedList.add(emp);\n\t\t}\n\t\tlog.severe(\"datastoremanager-\" + 398);\n\t\treturn returnedList;\n\t}", "public String getEmployees() {\n\t\tString s = \"\";\n\t\tfor (Employee e : employees) {\n\t\t\ts = s + e.getName() + \", \";\n\t\t}\n\t\ts = s.substring(0, s.length() - 2);\n\t\treturn s;\n\t}", "public andrewNamespace.xsdconfig.EmployeeDocument.Employee getEmployeeArray(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n andrewNamespace.xsdconfig.EmployeeDocument.Employee target = null;\r\n target = (andrewNamespace.xsdconfig.EmployeeDocument.Employee)get_store().find_element_user(EMPLOYEE$0, i);\r\n if (target == null)\r\n {\r\n throw new IndexOutOfBoundsException();\r\n }\r\n return target;\r\n }\r\n }", "@SuppressWarnings({ \"unchecked\", \"static-access\" })\n\t@Override\n\t/**\n\t * Leo todos los empleados.\n\t */\n\tpublic List<Employees> readAll() {\n\t\tList<Employees> ls = null;\n\n\t\tls = ((SQLQuery) sm.obtenerSesionNueva().createQuery(\n\t\t\t\tInstruccionesSQL.CONSULTAR_TODOS)).addEntity(Employees.class)\n\t\t\t\t.list();// no creo que funcione, revisar\n\n\t\treturn ls;\n\t}", "@GetMapping(\"/my-employee\")\n\t@Secured(Roles.BOSS)\n\tpublic ResponseEntity<EmployeeCollectionDto> getAllMyEmployees() {\n\t\tLogStepIn();\n\n\t\t// Gets the currently logged in user's name\n\t\tString username = SecurityContextHolder.getContext().getAuthentication().getName();\n\t\tLong bossId = userRepository.findByName(username).getEmployee().getId();\n\n\t\t// Adds the employees that directly belongs to this boss\n\t\tEmployeeCollectionDto employeeCollectionDto = new EmployeeCollectionDto();\n\t\tList<Employee> employeeList = employeeRepository.findAll();\n\t\tfor(Employee employee : employeeList) {\n\t\t\tif(employee.getBossId().equals(bossId))\n\t\t\t\temployeeCollectionDto.collection.add(toDto(employee));\n\t\t}\n\n\t\treturn LogStepOut(ResponseEntity.ok(employeeCollectionDto));\n\t}", "@Override\n\tpublic void getAllEmployee() {\n\t\t\n\t}", "@Transactional\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn accountDao.getAllEmployee();\n\t}", "@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}", "@Override\n\tpublic List<Employee> getAll() {\n\t\tList<Employee> list =null;\n\t\tEmployeeDAO employeeDAO = DAOFactory.getEmployeeDAO();\n\t\ttry {\n\t\t\tlist=employeeDAO.getAll();\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\treturn list;\n\t}", "protected List<Employee> parseDocumentForEmployees(Document xmlDocument) \n\t\t\tthrows ParseEmployeeXmlException {\n\t\t\n\t\tList<Employee> employeesFromXml = new ArrayList<Employee>();\t\t\t\t\t\t\t///NOTE: Return var is separate and declared first.\n\t\t\n\t\tElement rootElement = xmlDocument.getDocumentElement();\t\t\t\t\t\t\t\t\t///NOTE: Should we have done these two lines on one line?\n\t\tNodeList nodesInRoot = rootElement.getElementsByTagName(\"Employee\");\n\t\t\n\t\tif (nodesInRoot == null || nodesInRoot.getLength() == 0) {\t\t\t\t\t\t\t\t///NOTE: Guard statement.\n\t\t\tthrow new ParseEmployeeXmlException(\"No nodes in root.\");\t\t\t\t\t\t\t///NOTE: Custom exception.\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < nodesInRoot.getLength(); i++) {\t\t\t\t\t\t\t\t\t\t///NOTE: Too bad NodeList is not iterable... \n\t\t\tNode nodeFromXml = nodesInRoot.item(i);\t\t\t\t\t\t\t\t\t\t\t\t///NOTE: Should we make this method one line?\n\t\t\tEmployee employeeFromXml = buildEmployeeFromXmlNode(nodeFromXml);\n\t\t\temployeesFromXml.add(employeeFromXml);\t\t\t\t\t\t\t\t\t\t\t\t///NOTE: Are these var names confusing?\n\t\t}\n\t\t\n\t\treturn employeesFromXml;\n\t}", "@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public final List<EmployeeDTO> findAllEmployees() {\n LOGGER.info(\"getting all employees\");\n return employeeFacade.findAllEmployees();\n }", "@Logging\n\tprivate List<Employee> getEmployee(List<String> aFileList) {\n\t\t\n\t\tList<Employee> aEmployeList = aFileList.stream()\n\t\t\t\t.skip(1) // skip the header line\n\t\t\t\t.map(line -> line.split(\",\")) // transform each line to an array\n\t\t\t\t.map(employeeData -> new Employee(Long.parseLong(employeeData[0]), employeeData[1], employeeData[2],\n\t\t\t\t\t\temployeeData[3], employeeData[4])) // transform each array to an entity\n\t\t\t\t.collect(Collectors.toList());\n\t\t\n\t\treturn aEmployeList;\n\t\t\n\t}", "public String getAllEmployees() {\n\t\t\n\t\tString allEmployees = \"\\n\";\n\t\t\n\t\tfor(AbsStaffMember staffMember : repository.getAllMembers())\n\t\t{\n\t\t\tallEmployees += \"\\t- \" + staffMember.getName() + \"\\n\";\n\t\t}\n\t\t\n\t\treturn allEmployees;\n\t}", "@Cacheable(cacheNames = \"allEmployeesCache\")\n\tpublic List<Employee> getAllEmployees() throws Exception {\n\t\tIterable<Employee> iterable = employeeRepository.findAll();\n\t List<Employee> result = new ArrayList<>();\n\t iterable.forEach(result::add);\n\t\treturn result;\n\t}", "@GetMapping(\"/findAllEmployees\")\n\tpublic List<Employee> getAll() {\n\t\treturn testService.getAll();\n\t}", "@Deprecated\r\n public andrewNamespace.xsdconfig.EmployeeDocument.Employee[] getEmployeeArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List<andrewNamespace.xsdconfig.EmployeeDocument.Employee> targetList = new java.util.ArrayList<andrewNamespace.xsdconfig.EmployeeDocument.Employee>();\r\n get_store().find_all_element_users(EMPLOYEE$0, targetList);\r\n andrewNamespace.xsdconfig.EmployeeDocument.Employee[] result = new andrewNamespace.xsdconfig.EmployeeDocument.Employee[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "@GetMapping(\"/employee\")\r\n\tpublic List<Employee> getAllEmployees()\r\n\t{\r\n\t\treturn empdao.findAll();\r\n\t}", "public List<EmployeeDto> retrieveEmployees();", "public List<EmployeeEntity> retrieveAllEmployeeData(StorageContext context) throws PragmaticBookSelfException {\n\t\tList<EmployeeEntity> listOfEmployeeData = null;\n\n\t\tSession hibernateSession = context.getHibernateSession();\n\n\t\tString queryString = \"FROM EmployeeEntity\"; // select * from employee;//\n\t\ttry {\n\t\t\tQuery query = hibernateSession.createQuery(queryString);\n\t\t\tlistOfEmployeeData = query.list();\n\t\t} catch (HibernateException he) {\n\t\t\tthrow new PragmaticBookSelfException(he);\n\t\t}\n\t\treturn listOfEmployeeData;\n\t}" ]
[ "0.77808845", "0.7762067", "0.7681368", "0.7623686", "0.7574688", "0.75682265", "0.7537249", "0.7475257", "0.7458302", "0.7447166", "0.74420977", "0.74334264", "0.7427447", "0.73853105", "0.7377672", "0.73526543", "0.735087", "0.73446363", "0.73391664", "0.73349226", "0.73337275", "0.7312158", "0.72926193", "0.727071", "0.7248562", "0.7243469", "0.7230787", "0.7230787", "0.72291154", "0.71818984", "0.71782756", "0.7158301", "0.7138143", "0.71363866", "0.71335155", "0.7132831", "0.7131775", "0.71307117", "0.71252155", "0.711936", "0.71174026", "0.7099486", "0.70962316", "0.70558053", "0.70499665", "0.7043864", "0.70378315", "0.70354384", "0.70214385", "0.7002215", "0.69955206", "0.6994675", "0.6980226", "0.6978235", "0.6975309", "0.69719344", "0.697028", "0.69209075", "0.6903659", "0.69032156", "0.689148", "0.6872452", "0.68673897", "0.6854842", "0.6847", "0.68346936", "0.6834059", "0.6832484", "0.6825189", "0.6821225", "0.6805144", "0.678994", "0.67825764", "0.6732611", "0.67221427", "0.6709876", "0.6706618", "0.6703641", "0.66563815", "0.6641108", "0.66299945", "0.66285264", "0.66265947", "0.6626269", "0.66135794", "0.6588689", "0.658752", "0.6584676", "0.6575882", "0.6569153", "0.65655816", "0.65569156", "0.6554954", "0.65485376", "0.65484625", "0.65330666", "0.6527464", "0.6519763", "0.6517814", "0.6510472" ]
0.7572702
5