method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
142b0f34-6026-4f6e-8b68-f75e3e008abd
9
public void initiate(){ //Reset the boolean chosen of the other starters sprites Iterator<Sprite> it = starters.iterator(); while (it.hasNext()) { Sprite element = it.next(); ((StarterSprite) element).setChosen(false); } //Remove all components jCheck1.setSelected(false); jCheck2.setSelected(fals...
51613e61-04c9-4d9f-b097-dc95e475ecee
6
public static void main(String args[]){ int mapSize = 5; //Creating a colour scheme to test the renderer with Colour[] colours = new Colour[mapSize]; for (int i=0; i<5; i++) { switch (i) { case 0: Colour black = new Colour("#000000"); colours[i] = black; ...
e951c43e-6526-4d8e-923c-b8d9da07ee7d
7
public static String doubleToString(double d) { if (Double.isInfinite(d) || Double.isNaN(d)) { return "null"; } // Shave off trailing zeros and decimal point, if possible. String string = Double.toString(d); if (string.indexOf('.') > 0 && string.indexOf('e') < 0 && string.indexOf('E') < 0) { while...
f4b7ed3e-12c2-447d-bbcc-84ac09728148
7
public void testValidEdge2() { try { TreeNode tree = new TreeNode("tree", 2); TreeNode subtree = new TreeNode("spare-subtree"); tree.setBranch(new TreeNode[]{ new TreeNode("subtree"), subtree }); setTree(tree); TreeNode realTree = ((Question1)answer); ...
0b358ee3-9978-4228-8617-1eb75713e01f
5
protected void assertDecodedSourcesEqual(DecodedSource a, DecodedSource b) { try { int idx = 0; while (true) { boolean aHasData = true; double aData = 0.0f; try { aData = a.getSample(idx); } catch (NoMoreDataException e) { aHasData = false; } boolea...
250efb4d-c420-4401-93e2-b53072f87016
0
@Override public boolean supportsEditability() {return true;}
fc50d735-ce65-4b50-b358-f30d8538b80e
2
public GameWorld(WorldDescriptor descr) throws WeigthNumberNotMatchException { stepCount = 0; conf = descr.configuration(); entities = Collections.synchronizedList(new LinkedList<Entity>()); dead = Collections.synchronizedList(new LinkedList<Entity>()); Random rng = new Random(); // adding agents for (...
bb67a02f-3882-4ebe-8a0a-a33dc220778b
0
@Test public void getTest() throws Exception { mockMvc.perform(get("/get.json")) .andExpect(status().isOk()) .andExpect(view().name("jsonView")).andExpect(model().size(1)); }
fc3a2bbd-aab5-4de0-92db-d5c2ccbf523d
0
public int grab() { Random rand = new Random(); int randNumber = 0; return randNumber = data[rand.nextInt(manyItems)]; }
af8ffca5-35a5-43f9-9405-87a36793e1f1
4
public boolean nextChunk() { if (!this.hasNext()) { return false; } int len = vsize.length -1; int tmp = len; while (tmp >= 0 && this.start[tmp] + this.chunkStep[tmp] >= this.vsize[tmp]) { tmp--; } this.start[tmp] += this.chunkStep[tmp]; for (int i = len; i > tmp; i--) { this.start[i] = 0; ...
b1ec503b-dffb-47ca-aa52-a53229ce711a
2
private CreaturePluginFactory(double inMaxSpeed) { try { pluginLoader = new PluginLoader(pluginDir,ICreature.class); } catch (MalformedURLException ex) { } maxSpeed=inMaxSpeed; constructorMap = new HashMap<String,Constructor<? extends ICreature>>(); load(); }
82de118f-3e98-4fdf-92ef-b7c76bdc1b39
3
public String leerLog(String path){ File f = new File(path); if(f.exists()) { try { BufferedReader br = new BufferedReader(new FileReader(path)); StringBuilder sb = new StringBuilder(); String line = br.readLine(); ...
beccce8e-d2e4-473f-bb09-ee46f54e7505
0
public double distToExit(Point pos){ return (Math.abs(pos.x - exitP.x) + Math.abs(pos.y - exitP.y)); }
f07198ec-09d8-4d7b-9d12-2faa5a03930f
5
public static int check(String aWord, String bWord) { char[] a = aWord.toCharArray(); char[] b = bWord.toCharArray(); int curSum = 0, sum = 0, aSize = a.length, bSize = b.length, ia; for (int i = 0; i < aSize + bSize - 1; i++) { ia = i - (bSize - 1); curSum = 0; for (int j = 0; j < b.length; j++, ia++)...
0d91ef3b-6ecc-4962-9464-beb777376eb9
3
public void operate(Iqueue platformQueue, int phase){ if(!this.sellerQueue.isEmpty()){ int beforMoveCount = platformQueue.getSize(); moveCustomerToPlatformQueue(platformQueue,phase); int afterMoveCount = platformQueue.getSize(); if( !this.sellerQueue.isEmpty() && afterMoveCount != beforMoveCount){...
e55fa66d-e7a7-4d75-b1e8-8ff501aea7e2
4
protected void standardTransform(int kc) { if (kc == forwardKey) { moveForward(); } else { if (kc == backKey) { moveBackward(); } else { if (kc == leftKey) { rotateLeft(); } else { if (kc == rightKey) { rotateRight(); } } } } }
cf8b7dc0-2ef4-4130-9d2c-caeb04da3731
4
public Behaviour getNextStep() { final float demand = venue.stocks.demandFor(made.type) ; if (demand > 0) made = Item.withAmount(made, demand + 5) ; if (venue.stocks.hasItem(made)) { return null ; } if (GameSettings.hardCore && ! hasNeeded()) return null ; return new Action( actor, v...
54f87db4-10f3-40a5-91a9-138272bf7d4b
8
public void setUserSavedGame(String true_false) { File file = new File("Users.txt"); String line = ""; FileWriter writer; ArrayList<String> userData= new ArrayList<String>(); ListIterator<String> iterator; try { Scanner s = new Scanner(file); while(s.hasNextLine()) { userData.add(s.nextLine()); ...
dbb215ec-bea8-444e-b360-2485427c384f
6
public static boolean isAnagrams1(String s,String t){ if( s== null || t == null){ return false; } if(s.length() != t.length()){ return false; } int[] map = new int[256]; char[] u = s.toCharArray(); char[] v = t.toCharArray(); int len = u.length; for(int i=0;i<len;i++){ map[(int)u[i]]++; ma...
97c13622-ec7e-4ce7-91b4-81d38befe302
7
public void keyReleased(KeyEvent e) { //System.out.println("Key = " + e); key = e.getKeyCode(); if (key == 32) space = false; else if (key == 38) up = false; else if (key == 37) left = false; else if (key == 39) ...
f809426d-1e68-47fc-b3a0-4304845ab56d
9
private StringVector getNodesByID(XPathContext xctxt, int docContext, String refval, StringVector usedrefs, NodeSetDTM nodeSet, boolean mayBeMore) { if (null != refval) { String ref = null; // DOMHelper dh = xctxt.getDOMHelper...
6437c010-6c5f-47c2-ab64-e6394d3f28f9
5
private static String describeSupport(Property p, List<GeneralNameValueConfig> fieldSet) { String supp=""; for(GeneralNameValueConfig cfg : fieldSet) { if(cfg.fieldProperty==p) { if(supp.length()>0) supp+=", "; supp+=cfg.fieldName ...
9fdd442e-c545-488a-8442-1704fe68cd31
3
public int compute() { subSequence[0] = 0; backPointers[0] = -1; len = 1; for (int i = 1; i < seq.length; i++) { if (seq[i] > seq[subSequence[len-1]]) { backPointers[i] = subSequence[len-1]; subSequence[len++] = i; } else if (se...
dba051c6-a5da-47fc-a156-3ec63bf69d66
9
@Override public void loadFromFile(String trainFile, String testFile, String quizFile, String featureFile) { System.out.print("Loading dataset... "); try { if(trainFile != null && trainFile.length() > 0); loadDataFromFile(trainFile, InstanceType.Train); if(testFile != null && testFile.length() > 0) ...
a64afcc1-d573-4885-850e-c91de9dc7ad6
6
FlowBlock getSuccessor(int start, int end) { /* search successor with smallest addr. */ Iterator keys = successors.keySet().iterator(); FlowBlock succ = null; while (keys.hasNext()) { FlowBlock fb = (FlowBlock) keys.next(); if (fb.addr < start || fb.addr >= end || fb == this) continue; if (succ == ...
8a440b78-44b0-44af-bbc8-d3aa794ef5e6
0
public Ifrit(int room) { super(new Earthquake(), new SonicBlow(), 180.0*room, 199.0*room, 190.00*room, 2.0*room, 120.0*room, 25.0*room, "Ifrit"); } // End DVC
d4499fb9-1b7e-44ac-a2cd-f38fa7a1e5b8
8
public void setTriArrows(CellElement current, boolean showNotChoosen) { m_arrowList.clear(); int cCol, cRow; cCol = current.getColumn(); cRow = current.getRow(); this.setGridCircle(cCol, cRow); if (((NussinovCellElement)current).isEndCell()) { return; ...
3be0ecec-37b3-4555-831a-b855bbe3ead8
9
private MoveAndCost findBestMoveInternal(int[][] board, int depth) { int n = board.length; int m = board[0].length; double minCost = Double.POSITIVE_INFINITY; int[][] bestBoard = null; Move bestMove = null; for (Move move : Move.ALL) { int[][] newBoard = makeM...
be651577-564d-4d3c-957a-94cd81c5dcdc
1
private boolean jj_3R_36() { if (jj_3R_82()) return true; return false; }
70bacf19-75ca-44ae-a895-c7c2e704f0b1
4
private static void receive() { LOG.debug("Receiving packet"); String parameterType = (String) cbType.getSelectedItem(); LOG.debug("Parameter types: {}", parameterType); try { GWCAPacket gwcaPacket = gwcaConnection.receivePacket(); byte[] w = null, l = null; ...
be66f7eb-615d-4f69-a2d0-0be64a54038a
6
@Override public void run() { int skippedFrames; long runTime = 0; ticksClock.start(); framesClock.start(); while (game.isRunning()) { long nsPerTick = Clock.NS_PER_SEC / game.ups; long nsPerFrame = Clock.NS_PER_SEC / game.fps; ticksCl...
d80f5a4a-af8a-4cbd-8b84-3a755675b208
2
public Vector<TestRecord> getRecordList(ResultSet rs) { Vector<TestRecord> records = new Vector<TestRecord>(); try { while (rs.next()) { TestRecord record = new TestRecord(); record.setTest_id(rs.getInt("test_id")); record.setType_id(rs.getInt("type_id")); record.setPatient_no(rs.getInt("patient_...
d7f619c2-eed4-4001-804c-12fc8626dbcc
7
private String createResultMessage() { StringBuffer message = new StringBuffer(); message.append(TextUserInterface.HORIZENTAL_LINE). append(TextUserInterface.NEW_LINE). append(TextUserInterface.HORIZENTAL_LINE). append(TextUserInterface.NEW_LINE). append("You "); switch ...
53994fb6-09ca-4277-b077-24bd91be643d
0
public static void add(long uid, Notification notification) { UserNotificationBuffer buffer = getMonitorFor(uid); buffer.addNotification(notification); }
976f7758-dd8a-4d73-8e8c-4c6307e3da10
3
public static void initiate(JavaPlugin plugin, String name, String prefix) { logPrefix = prefix; fileName = name; File folder = plugin.getDataFolder(); if (!folder.exists()) { folder.mkdir(); } File log = new File(plugin.getDataFolder(), fileName + ".log"); ...
0ae34b72-6ad3-48e1-857e-bc1726d6472c
5
private static Component getFirstFocusableField(Object comp) { if (comp instanceof JTextComponent || comp instanceof KeyStrokeDisplay) { return (Component) comp; } if (comp instanceof Container) { for (Component child : ((Container) comp).getComponents()) { Component field = getFirstFocusableField(child...
35cd1250-11ea-4f25-8bbf-0183ceb48dff
6
@Override public Value run(CodeBlock i) { try { __return = false; if (body_ == null) { body_ = parseForRun(); } while (!__end && !__return && condition_.run(i).getBoolean()) { Value v = runBlock(body_, this); if ...
b385796b-7f81-421a-a2e1-d3052eddb1ea
3
@Override public void execute() { Inventory.getItem(Constants.INVENTORY_BURNED_ROOT_ID).getWidgetChild().interact("Fletch"); final Timer timeout = new Timer(2000); while(timeout.isRunning() && !validate(Constants.FLETCH_WIDGET)) { Task.sleep(50); } if (validate(Constants.FLETCH_WIDGET)) { Widgets.ge...
3cddcd51-8142-4251-9a98-c77b7f30c519
2
public static List<Record> getRecords(String baseformat, int num) throws SQLException { String cd_extra = "AND riploc IS NOT NULL"; if (!baseformat.equalsIgnoreCase("cd")) cd_extra = ""; String sql = "select recordnumber,count(score_value) as cnt,avg(score_value) AS mean from records,scor...
61f2bb6b-dcbd-4ad1-934b-1bf0c4a29711
6
public static void startupArithmetic() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/PL-KERNEL-KB", Stella.$STARTUP_TIME_PHASE$ > 1)); Native.setSpecial(Stella.$CONTEX...
6dbeb9b1-62ad-4649-b3c9-c1e207ac0e0f
6
private String generateMIPSCode(String irCode) { String[] lines = irCode.split("\n"); ArrayList<String> newLines = new ArrayList<String>(); newLines.add(model.getDataHeader()); newLines.add(".text\n"); newLines.add(".globl main\n"); for(int i = 0; i < lines.length; i++) { if(lines[i].contains(":") && ...
79961d3d-979c-448f-af7f-8380b5bcd350
1
public String getOutput() { int nextBlank = buffer.indexOf("" + BLANK, getTapeHead()); if (nextBlank == -1) nextBlank = buffer.length(); return buffer.substring(getTapeHead(), nextBlank); }
145ebe2b-c269-457b-8ff2-c6a1ad12cd97
9
public ConfigTextParser(String filePath){ textFilePath = filePath; //lecture du fichier texte try{ InputStream ips=new FileInputStream(textFilePath); InputStreamReader ipsr=new InputStreamReader(ips); BufferedReader br=new BufferedReader...
98fc8300-6cb9-4e0b-ab7b-87780da15fc4
3
public void and(BitSet set) { if (this == set) return; while (wordsInUse > set.wordsInUse) words[--wordsInUse] = 0; // Perform logical AND on words in common for (int i = 0; i < wordsInUse; i++) words[i] &= set.words[i]; ...
5b2eb364-d910-4c0c-94ba-3509040cbc40
5
private void loadConfig() { saveDefaultConfig(); FileConfiguration cfg = getConfig(); // Add defaults if (cfg.getConfigurationSection("global-settings") == null) { cfg.createSection("global-settings"); cfg.set("global-settings.enabled", true); cfg.set("global-settings.check-for-updates", true); ...
6b00567e-5061-4aa2-9c61-738a2f7099bd
4
public void doPrintSchnitt() { for (int i = 0; i < this.inspectedVertices.size(); i++) { boolean isSchnitt = false; String schnittTarget = ""; String node = this.inspectedVertices.get(i); List<String> edges = this.graph.getIncident(node); for (String edge : edges) { String target = this.graph.ge...
370101dd-2271-4d5c-a611-54e0001f384e
4
private void jButtonCalcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCalcActionPerformed /**This method calculates Monthly Mortgage Payment**/ /**Get Input**/ //Get the vlaue of the text fiels sPrinciple = jTextFieldPrincipal.getText(); ...
5ad9ae97-4225-4d55-8758-b791a2212782
8
private boolean initConnections(StringBuffer msg) { JnnLayer currentLayer; JnnLayer testLayer; JnnUnit currentUnit; JnnUnit testUnit; JnnConnection currentConnection; int layerIndex; int unitIndex; for (JnnLayer layer : layers) { currentLayer...
42c96852-67d5-4176-bd4d-ca580f98c962
2
private void siirryTunnuksenLoppuun() { while (true) { if (!merkkiOsaTunnusta()) { break; } paikka++; } }
6360ef36-0ffc-451c-be96-d4fd25f3f0ea
8
public boolean isSameTree(TreeNode p, TreeNode q) { if((p == null && q != null) || (p != null && q == null)) return false; if(p == null && q == null) return true; if(p.val != q.val) return false; return isSameTree(p.left, q.left) && isSameTree(p.right, q.right); }
eb7bfb39-29d7-4d9c-b33e-17dd21959323
4
public Query retryResult(String query) { boolean passed = false; Connection connection = open(); Statement statement = null; ResultSet result = null; while (!passed) { try { statement = connection.createStatement(); result = statement.executeQuery(query); passed = true; return new Query(co...
3b9246ed-e18e-40ab-82d2-505c65021ce6
1
public void UpdateAll(float delta) { Update(delta); for(GameObject child : m_children) child.UpdateAll(delta); }
204c0375-a1f0-41ac-acaa-b66b48ebb2be
6
public void init(String n,int id){ if(n.equals("Creneau")) etat = Etat.Creneau; else if (n.equals("Creneau1")){ etat = Etat.Creneau1; try { this.creneau = new Seance(id); } catch (SQLException ex) { Logger.getLogger(New_Etud...
0ac32138-85ec-48e0-8082-b2fd28b209ec
5
private static void printGroup(ContactGroupEntry groupEntry) { System.err.println("Id: " + groupEntry.getId()); System.err.println("Group Name: " + groupEntry.getTitle().getPlainText()); System.err.println("Last Updated: " + groupEntry.getUpdated()); System.err.println("Extended Properties:"); for (...
8187f1ac-306d-4f93-8b2b-0a4566229274
7
public final void loadMonsterRate(final boolean first) { final int spawnSize = monsterSpawn.size(); /* if (spawnSize >= 25 || monsterRate > 1.5) { maxRegularSpawn = Math.round(spawnSize / monsterRate); } else { maxRegularSpawn = Math.round(spawnSize * monsterRate); }*/ ...
d8f53bc7-ba3f-4d17-a3e9-77d02a01cdff
5
public static void sort(double[] a) { int N = a.length; // Sentinel for (int i = N - 1; i > 0; i--) { if (a[i] < a[i - 1]) { double t = a[i]; a[i] = a[i - 1]; a[i - 1] = t; } } // Sort a[] into increasing order. for (int i = 2; i < N; i++) { // Insert a[i] among a[i-1], a[i-2], ...
c56c0809-af6f-4c9b-b108-b4fbf9371829
6
private double[][] enlarge(double[][] small, int factor){ int smallXSize = small.length; int smallYSize = small[0].length; int largeXSize = smallXSize*factor; int largeYSize = smallYSize*factor; double[][] large = new double[largeXSize][largeYSize]; for(int y=0; y<large...
1004e114-9094-4d00-bf3b-f56a636527d7
7
public Snapshot validate() { if(f_0 != null || s_0 != null || v2_0 != null || (v3_0 != null && v3_0.len() > 0) || c_0 != null || d_0 != null) return this; return null; }
24634eb8-4e75-496c-9830-453d367440f2
4
public void start() { // crawl through all pages and grab every link you can get System.out.print("CRAWLING #" + pagesCrawled); crawlPage(ROOT_URL); if (GUI != null) GUI.notifyCrawlingFinished(); // Print results System.out.println("\n\nINTERNAL LINKS:"); int i =...
64b74cfd-f2d1-466f-9d7e-37b319419a76
9
public void writeReducedOtuSpreadsheetsWithTaxaAsColumns( File newFilePath, int numTaxaToInclude) throws Exception { HashSet<String> toInclude = new LinkedHashSet<String>(); HashMap<String, Double> taxaSorted = getTaxaListSortedByNumberOfCounts(); numTaxaToInclude = Math.min(numTaxaToInclude, taxaSort...
501d3d98-008c-487b-b2ea-03d8c41d86da
5
private void realput(URL loc, byte[] data) { FileContents file; try { try { file = back.get(loc); } catch(FileNotFoundException e) { back.create(loc, data.length); file = back.get(loc); } if(file.getMaxLength() < data.length) { if(file.setMaxLength(data.length) < data.length) { back....
51c6c9c4-01bd-4102-962d-9fe26fff563b
7
private void performSecurityOperation(APDU apdu) { byte[] buffer = apdu.getBuffer(); short p1p2 = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]); short len; switch (p1p2) { case (short)0x9e9a: byte[] counter = signCount.getData(); ...
50682019-c4da-45dd-9cae-0e1429a9a9ba
8
public boolean isMatchHelp(String s, String p) { if (p.length() == 0) { if (s.length() == 0) return true; return false; } if (s.length() == 0) { if (p.equals("*")) return true; return false; } if (p...
deb6c8d3-cf99-46ea-becc-f330d6759541
4
public Map<String, UUID> call() throws Exception { Map<String, UUID> uuidMap = new HashMap<String, UUID>(); int requests = (int) Math.ceil(names.size() / PROFILES_PER_REQUEST); for (int i = 0; i < requests; i++) { HttpURLConnection connection = createConnection(); String ...
2e7c6bcd-22b5-4ea8-ab5e-1b38b73045fe
1
public static double showSign (double value) { if (value == 0.0) { return 0.0; } else { return (value / Math.abs(value)); } }
92974723-57cd-4b5f-9ffc-df4d26d5a7ed
1
public Float getFloatItem(String... names) throws ReaderException { try { return Float.parseFloat(getItem(names).toString()); } catch (NumberFormatException e) { throw new ReaderException("No key exists with this type, keys: " + _parseMessage(names) + ". In file: " + ConfigurationManager.config_file_path); ...
1f92dd8e-c878-4331-8fad-fee029f11ed5
4
public Environment<K,V> locateChild( Path<String> path ) { if( path == null ) throw new NullPointerException( "Cannot locate children by null-paths." ); if( path.getLength() == 0 ) return this; Environment<K,V> child = this.getChild( path.getFirstElement() ); if( child == null || path.getLength() ==...
92a0a1fa-79fe-4943-8e34-486c21e1d1c1
7
public LibraryBean[] showByTags(String[] tags){ //Get all idlibrary that have tags LinkedList<Integer> list = new LinkedList<>(); TagListDAO tagListDAO = new TagListDAO(connection); for(int i = 0; i < tags.length; i++){ list.addAll(tagListDAO.getAllLibraryIdByTag(tags[i])); } Collections.sort(lis...
661fc10b-65de-4109-9368-987ca57e1683
7
public void updateCheck() { //check to make sure we have a base folder system to work out of //Normally will generate files it need if not something is wrong addToConsole("Checking File System"); Boolean fileExist = FileManager.rootFileCheck(); if(fileExist) { if(FileManager.errors...
bdea73f2-96d6-4c6b-9d0b-d6ac934f41e4
7
public void mousePressed(MouseEvent e) { if (scrollableTabLayoutEnabled()) { MouseListener[] ml = tabPane.getMouseListeners(); for (int i = 0; i < ml.length; i++) { ml[i].mousePressed(e); } } if (!tabPane.isEnabled()...
0285fae5-f48c-49e8-ab17-3d1070c38d8f
3
public Position getRandomPassablePos(double radius) { Position middlePos = new Position(this.getWidth() / 2, this.getHeight() / 2); Position pos = new Position(this.random.nextDouble() * this.getWidth(), this.random.nextDouble() * this.getHeight()); for (int attempt = 0; attempt < 5; attempt++) { if(!...
705cb93e-8af7-4c0e-93a0-bfb8836c4c2a
2
private boolean testaaPiste(Piste piste) { if(this.osuikoJohonkin == EsteenTyyppi.QUIT) { return false; } EsteenTyyppi este = taso.onkoPisteessaEste(piste); if (este != null) { this.osuikoJohonkin = este; return true; } return false; ...
97080377-4014-4e18-b0f9-61f89eb76ff8
0
@Override public void resetProperty(String key) { this.current_values.put(key, this.default_values.get(key)); }
386f8149-9a4e-4c95-ae70-47a750d63f64
6
protected void populateResults(int year, boolean wantPrev) { colName.setCellValueFactory(new PropertyValueFactory<SgaPOJO,String>("Name")); colCat.setCellValueFactory(new PropertyValueFactory<SgaPOJO,String>("Category")); colPyReq.setCellValueFactory(new PropertyValueFactory<SgaPOJO,...
a9b4d34a-a140-406d-a035-4e1bd2b0c0a5
2
public String join(String separator) throws JSONException { int len = length(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < len; i += 1) { if (i > 0) { sb.append(separator); } sb.append(JSONObject.valueToString(this.myArrayList.g...
f2b2e87a-04aa-4284-b071-2cde14702116
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
234d9fbe-4dc8-4214-84db-936452a4e036
2
public void changeWidth(int width) { for(int i=0;i<markers;i++) { if(marker[i].isSelectedWidth()) { marker[i].changeWidth(width); // break; } } }
8ff7ebc1-ebe0-4672-ad47-dc06b8742e0e
7
public boolean blocksColor(Point p, int x, int y, int i, int a, ArrayList<Integer> list) { Point[] arr = { new Point(x + 1, y), new Point(x, y + 1), new Point(x - 1, y), new Point(x, y - 1) }; return board.getCell(p.x, p.y).isFull() // Cell is full && i != (player.getColor()) // the color being ...
4ad414f6-5b10-43ce-a10a-ea45cda4ce5b
6
private void createTablePage() { Composite parent = getContainer(); // XXX move all the creation into its own component Canvas canvas = new Canvas(parent, SWT.None); GridLayout layout = new GridLayout(6, false); canvas.setLayout(layout); // create the header part with the search function and Add/Delete r...
32bf494f-6ca1-4075-946a-38fbbac3d6d2
6
private void btnCalcCoinageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalcCoinageActionPerformed // TODO add your handling code here: //validation for number entry; resets form if entry is not a numerical value boolean floatTest = (MyUtils.isFloat(txt...
d6f312bb-2702-4cd8-9dc9-c65c12a1ad8e
1
public Dimension getViewSize() { return (viewIsUnbounded() ? getView().getPreferredSize() : super.getViewSize()); }
4b8a7e50-2486-4aef-94ad-b4c76fb3a333
5
public void weaponSwing(Arc2D.Double arc, Point p) { boolean projectileHit = false; Projectile projectile = null; try { for (String key : projectiles.keySet()) { projectile = (Projectile) projectiles.get(key); if (projectile != null) { ...
520a273c-a17f-433d-8527-676c084cc62b
0
@Override public String execute() throws Exception { memberDAO.save(member); return SUCCESS; }
67efb8e0-df3a-46c9-ac8a-6a4dbbdcd369
0
public List<String> getMcEcho_ActiveChannels(){ return McEcho_ActiveChannels; }
b2227844-3e9b-489d-a5b6-fd08114206f7
2
public int reduceHealth(int damage) { health = health - damage; if(health <= 0) { health = 0; } if(health > 200) { health = 200; } return health; }
0f71a968-4d7a-4116-83ab-0e3eba4d046e
5
final AbstractFontRasterizer createFontRasterizer(BitmapFont class143, ImageSprite[] class207s, boolean bool) { int[] is = new int[class207s.length]; int[] is_60_ = new int[class207s.length]; boolean bool_61_ = false; for (int i = 0; i < class207s.length; i++) { is[i] = ((ImageSprite) class207s[i]).indexW...
f78ea5fa-750a-4348-832c-bb25baf2b2bf
3
public boolean esta(Recorrido x){ if(recorridos.isEmpty()) return false; for(Recorrido r:recorridos) if(r.equals(x)) return true; return false; }
f249c885-bc9c-4000-abc5-3913d25f4b92
3
public static void resetTextures() { if (Rasterizer.textureStore == null) { Rasterizer.textureStoreCount = 20; if (Rasterizer.lowMem) { Rasterizer.textureStore = new int[Rasterizer.textureStoreCount][16384]; } else { Rasterizer.textureStore = new int[Rasterizer.textureStoreCount][0x10000]; } fo...
33de8771-e1d0-422d-b222-77bba3e0836f
6
public void esborraRest(int tipus,int numRest){ switch (tipus){ case 1: cgen.getCjtResGA().remove(numRest); break; case 2: cgen.getCjtRestGS().remove(numRest); break; case 3: c...
bc0d3912-54e2-4cec-a038-1fb5802e64e4
8
void splitExp(Entity thnStore, int CUR_EXP) { if (thnStore.BLN_POPUP) { thnStore.send(""+(char)33+"You have lost "+CUR_EXP+" CUR_EXP\n"); } else { thnStore.chatMessage("You have lost "+CUR_EXP+" CUR_EXP\n"); } thnStore.CUR_EXP -= CUR_EXP; Vector vctStore; double tp, sidepoints=0; Entity thn...
09a8eff4-25b6-46dc-b6d6-eebf2d1e2510
7
public Color getColor(int index, int c) { if (blastCounter > 0) { c = 255 - c; return new Color(c, c, c); } if (index == 0) return new Color(c, c / 2, c / 2); if (index == 1) return new Color(c / 2, c, c / 2); if (index == 2) return new Color(c / 2, c / 2, c); if ...
21257602-ddde-4453-b8b7-c3c0859ebc90
1
public static PlayerMovementServer getInstance() { if(instance == null) instance = new PlayerMovementServer(); return instance; }
f5a5d8a9-2dc9-402a-bd63-350c2b4bf5ae
2
public ArrayList<Action> readData(String path2File) throws IOException { logger.debug("Reading actions."); ArrayList<Action> actions = new ArrayList<Action>(); BufferedReader br = new BufferedReader( new FileReader( path2File ) ); String line; while ((line...
1ee28013-3b51-4ba4-8d3a-32d178c38ea4
5
static void criaAreaNotificacao() { //Verifica se n�o � poss�vel trabalhar com "TrayIcon" if (!SystemTray.isSupported()) { System.out.println("Não da pra fazer, nem tenta!"); return; } //Instancia��o de um objeto java.awt.PopupMenu final PopupMenu pop = ...
33e06ef2-9856-4cb2-a3ae-50d9f223f555
9
protected void updatePaving(boolean inWorld) { if (! inWorld) { base().paving.updatePerimeter(this, null, false) ; return ; } final Batch <Tile> toPave = new Batch <Tile> () ; for (Tile t : Spacing.perimeter(area(), world)) { if (t.blocked()) continue ; boolean between = fal...
1148a769-032a-4403-93a3-fd870b42a6c4
5
public int readIdfTable(String file_name) throws SQLException, IOException{ //creating a hashmap which will have all tokens int total_records =0; String line_read; Runtime runtime = Runtime.getRuntime(); BufferedReader buffReader_obj = new BufferedReader(new FileReader(file_name)); long time = System.cur...
75e93dd2-0ce3-4e71-9341-dbfd07908254
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof StatusPessoa)) { return false; } StatusPessoa other = (StatusPessoa) object; if ((this.codstatuspessoa == null ...
6ec15b8a-64c0-458e-99c0-56ffbe660851
0
protected Automaton getAutomaton() { return automaton; }
854bea69-4b1e-406a-8eea-6fd56a7ce291
1
private void saveList() { int serverCount = servers.size(); for (int i = 0; i < serverCount; ++i) storeDetails(i); storage.store(servers); MainWindow.getInstance().getMainMenu().loadFavoriteServersList(servers); }
aefe20c5-7bc2-4bdc-b09d-805f61f95c93
2
public static void hangup() { try { if (rxSock != null) { rxSock.close(); } } catch (IOException ex) { Alerter.getHandler().warning("Message Listener", "Unable to correctly hang up - some sockets may not have been closed."); } listener.interrupt(); }