method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
d0cd2220-0dc2-4f03-af7b-fde3b2cf0b8a
4
@Override public void update(long elapsedTime) { checkForKeyPress(); if (getScreen() != null) { if (!screenShotAnimations.isEmpty()){ for (ScreenShotAnimation screenShotAnimation : screenShotAnimations){ screenShotAnimation.update(); ...
87ce301f-ff6f-4d77-bb17-efa56de91886
5
@Override public String toString() { switch(this) { case OK: return this.getCode() + " OK!"; case FORBIDDEN: return "" + this.getCode(); case INTERNAL_SERVER_ERROR: return "" + this.getCode(); case NOT_FOUND: return "" + this.getCode(); ...
d5ac761c-23e7-4f76-86d3-a3b72278fbb9
4
public String getClipboardContents() { String result = "" ; Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard() ; //odd: the Object param of getContents is not currently used Transferable contents = clipboard.getContents( null ) ; boolean hasTransferableText = ( contents != null...
8fa6453d-29af-4a8f-a4fb-6fed67bbd705
2
private void endType() { if (arrayStack % 2 == 0) { arrayStack /= 2; } else { while (arrayStack % 2 != 0) { arrayStack /= 2; declaration.append("[]"); } } }
baca8413-c5c2-47ee-944a-458c3f7dde14
2
public Char(String name, main main, float x, float y, int screenHeight, int screenWidth) { this.name = name; this.x = x; this.y = y; this.screenHeight = screenHeight; this.screenWidth = screenWidth; map = main.terrain.rects; genX = main.terrain.xGen; genY = main.terrain.yGen; blockSize = main.terrain....
f5e06b1b-a8de-457a-90b7-77fa7497b708
5
private void fileSave(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileSave // TODO add your handling code here: //wird ersetzt XML Parser JFileChooser filechooser = new JFileChooser(); SSDRFileFilter ssdfFiler = new SSDRFileFilter(); filechooser.addChoosableFileFilter(ssdf...
4b66e517-a481-404e-8a32-288f3c68a076
6
protected boolean canRollDiceThreeTimes() { int inHouseCounter = 0; boolean inDestination[] = {false,false,false,false}; for (GameFigure gameFigure : getGameFigures()) { if(gameFigure.getId() == GameFigure.IN_HOUSE_ID) { inHouseCounter++; } if...
7586a99e-8f6e-4baa-9b2d-4e222460a03f
9
public static LogicObject evaluatePredicate(GeneralizedSymbol name, Stella_Object firstargument) { { Surrogate surrogate = null; LogicObject predicatevalue = null; { Surrogate testValue000 = Stella_Object.safePrimaryType(name); if (Surrogate.subtypeOfSymbolP(testValue000)) { { Symbol...
5872269f-8d2c-46b0-9294-d0af69e60aac
1
@Test public void nameRemoveLikeAddress2() throws Exception { final NotebookDb notebookDb = facotry.create(dbFile.getAbsolutePath()); notebookDb.addRecord("name1 phone1 address1 19"); notebookDb.addRecord("name2 phone2 address2 20"); notebookDb.addRecord("name3 phone3 address3 21"); ...
a1d1a2de-9565-475b-ac50-fae96a359a4b
6
@SuppressWarnings("unchecked") private static List<Class> findClasses(File directory, String packageName) throws ClassNotFoundException { List<Class> classes = new ArrayList<Class>(); if (!directory.exists()) { return classes; } File[] files = directory.listFiles(); ...
a95347f5-a15c-491a-9f1f-b4d939d332af
4
int max_expand(int soff, int poff, int ep) { int i = 0; while (soff + i < s.length() && singlematch(s.luaByte(soff + i), poff, ep)) i++; while (i >= 0) { int res = match(soff + i, ep + 1); if (res != -1) return res; i--; } return -1; }
da1d9204-b9c5-4104-a996-2e6fa5fab4fb
3
@Override public synchronized void close() { if (isClosed()) { return; } setIsClosed(true); if (inferenceWorker != null) { try { inferenceWorker.releaseInferenceResources(MSECS_TO_WAIT_FOR_CLOSE); } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage()...
f3da0cd4-4008-4184-a09e-304921dec770
8
public void findCDSSplitLocations(){ //There are no split locations if there is only one/zero CDS if(CDS.size() < 2){ return; } //Forward strand //The CDS are in nucleic acid lengths, but the code needs the lengths in amino acids, so each length must be divided by 3. //Get the first CDS split locatio...
eb44bffd-f50c-4bcc-b598-e193fb6eb53d
3
@Test public void testProfileCardsCrud() throws BeanstreamApiException { String profileId = null; try { Address billing = getTestBillingAddress(); Card card = getTestCard(); // test create profile ProfileResponse createdProfile = beanstream.profiles() .createProfile(card, billing); profileId = ...
3ba63c9c-11bb-4055-9b93-2a1d291edaac
2
private void jPanelControlesComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jPanelControlesComponentShown if(rb1Jugador.isSelected()) newNNaves = 1; else newNNaves = 2; if(rbNave1.isSelected()) cargarNave(1); else cargarNave(2); }//GEN-LAST:event_jPanelControles...
a486c36a-3756-4abe-bcb4-8c9ec279fc4b
8
public static void main(String[] args) throws Exception { for( int x=1; x < NewRDPParserFileLine.TAXA_ARRAY.length; x++) { String level = NewRDPParserFileLine.TAXA_ARRAY[x]; OtuWrapper wrapper = new OtuWrapper( ConfigReader.getIanNov2015Dir() + File.separator + "spreadsheets" + File.separator...
40ed8b0f-2a9d-476e-ac22-96548a4493ae
9
public GUI() { setResizable(false); // Set the icon. icon = Toolkit.getDefaultToolkit().getImage(getClass().getResource("icon.png")); setIconImage(icon); // Boring stuff setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 400, 255); setLocationRelativeTo(null); contentPane = new JPa...
6c39fa75-076c-4fb3-9423-dde71b7bb384
1
public BoutonChargement(String name, int X, int Y, int width, int height, int high) { super(name, X, Y, width, height); _highscore = high; try { _star = ImageIO.read(new File("img/button/star.png")); } catch (IOException e) { e.printStackTrace(); } }
cb93b47a-9e0d-4ae9-b705-f24cd87d69fd
4
private void close() { try { if (rs != null) { rs.close(); } if (statement != null) { statement.close(); } if (conn != null) { conn.close(); } } catch (SQLException e) { th...
6e42ce94-1769-4203-9f54-1703deef02cc
4
private void addAllTranslators() { Reflections reflections = new Reflections("com.cortex.translators"); Set<Class<? extends Translator>> subTypesOf = reflections.getSubTypesOf(Translator.class); for (Class<? extends Translator> translatorClass : subTypesOf) { try { ...
a64a15d3-db61-42bd-b1f7-3643c849d15c
8
public GridLocation adjacentSpot(GridLocation g, int dir) { int x = g.getX(); int y = g.getY(); switch(dir){ case UP: if(isValid(x, y - 1)) return gl[x][y - 1]; //above case DOWN: if(isValid(x, y + 1)) return gl[x][y + 1]; //below case RIGHT: if(isValid(x + 1, y)) return gl[x + 1][y]; //right ...
611352b7-cfbc-491c-bd3c-f47fa95177e2
4
static void solve() { Queue<String> q = new LinkedList<String>(); int cont = 1; for (int i = 'a'; i <= 'z'; i++) q.add((char) i+""); while (!q.isEmpty()) { String c = q.poll(); map.put(c, cont++); if (c.length() < 5) { int start = (int) c.charAt(c.length() - 1) + 1; for (int i = start; i <=...
a420e925-6c20-4455-840c-7441c98026f1
1
private void refreshTable() throws NullPointerException { String[] columnNames = new String[] { "Id", "Name", "Quantity", "Price", "Description" }; Object[][] temp = Main.getTableData(); DefaultTableModel tableModel = new DefaultTableModel( temp, columnNames); summa=Main.getTotal(); sum.setText(summa....
0e8f0c27-7bcf-4f7b-8f95-de64b9c6fd8c
0
@Override public void documentAdded(DocumentRepositoryEvent e) {}
b1cff01d-0ba4-4ece-a8c9-058ed229a301
4
private void loadCustomConfig() { if (absoluteFolderPath.equals("")) { plugin.getLogger().log(Level.SEVERE, "No absolute path passed in to store information in."); return; } else if (target.equals("")) // If no target, then we are null and return no target. { plugin.getLogger().log(Level.SEVERE, "No...
6e0bd4fd-b03d-4185-9256-dd684d7df8c7
8
public int getTemperature() { if (!isConnected()) { error("Robot is not connected!", "RXTXRobot", "getTemperature"); return -1; } try { this.waitForResponse = t...
7cc12da8-f73b-418e-8cb9-156d30c8b660
2
private void saveButton_settingsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButton_settingsButtonActionPerformed try { if (debug) logger.log(Level.DEBUG, "Saving preferences..."); settings.setDeviceRefreshInterval(Integer.valueOf(refreshIn...
8e6b059c-c56e-4114-a7fa-463952debc6a
5
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { int action_perform=0; String acti...
f229e38b-efa2-4b8c-b7c9-20d941c75d6e
8
@Override public boolean sendDeath() { if(currentPart == DungeonPart.THRONE) { Dialogue.closeNoContinueDialogue(player); List<Integer> indexes = World.getRegion(player.getRegionId()).getNPCsIndexes(); if(indexes != null && indexes.size() >= 1) { NPC nomad = World.getNPCs().get(indexes.get(0)); if(no...
3ab73e18-1931-45dc-801f-44782ae0a29d
3
public void setLeft(PExp node) { if(this._left_ != null) { this._left_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } ...
b1826992-2449-4e50-97ee-18d12f9be537
4
public static void putIntUnsignedNullable(ByteBuffer out, Integer x) { if (x == null) { out.put( NULL ); } else { int value = x.intValue(); int a = (value & 0x3F); int more = (value >>= 6) != 0 ? BYTE_MORE : 0; ...
93647846-247e-4630-9f1f-d286b1c8388e
1
@Override public URL getDocumentBase() { try { return new URL("http://www.minecraft.net/game/"); }catch(MalformedURLException e){ e.printStackTrace(); } return null; }
844a16ae-3585-4cec-b848-094c5894a42f
1
public static boolean isKnown(String command){ try { IRCCommand.valueOf(command.toUpperCase()); } catch (IllegalArgumentException e){ return false; } return true; }
1ed9ea12-be72-4217-9fa8-09b6790675ac
2
public String counterToString(Counter counter) { String cell = " "; switch (counter) { case BLACK: cell = "X"; break; case WHITE: cell = "O"; break; default: cell = " "; } return cell; }
5a0f08f0-cd1e-4042-997f-4383b8956f3c
5
XML_adatok parse_in(String filenev) { SAXBuilder builder = new SAXBuilder(); File xmlFile = new File(filenev); try { Document document = builder.build(xmlFile); Element rootNode = document.getRootElement(); List list = rootNode.getChildren("type"); for (int i = 0; i < list.size(); i+...
a0f1a271-4f9f-49eb-a2d5-48ea68e185cf
4
public void setSenaoF(List<?> list) { for(PComando e : this._senaoF_) { e.parent(null); } this._senaoF_.clear(); for(Object obj_e : list) { PComando e = (PComando) obj_e; if(e.parent() != null) { e.paren...
c458ac87-6819-4d41-a209-5bc026a1a17e
8
static int checkStyle(Shell parent, int style) { style = Decorations.checkStyle(style); style &= ~SWT.TRANSPARENT; if ((style & SWT.ON_TOP) != 0) style &= ~(SWT.CLOSE | SWT.TITLE | SWT.MIN | SWT.MAX); int mask = SWT.SYSTEM_MODAL | SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL; if ((style & SWT.SHEET) != 0) { ...
67d78a89-dd1e-4738-96ef-ede3adc8e6e3
6
public boolean methodIsOverridden(final Type classType, final NameAndType nat) { final String methodName = nat.name(); final Type methodType = nat.type(); db("ClassHierarchy: Is " + classType + "." + methodName + methodType + " overridden?"); final Collection subclasses = this.subclasses(classType); ...
849f32e6-f731-43e6-a6fc-c94bbc9e1aea
8
public BufferedImage parseUserSkin(BufferedImage par1BufferedImage) { if (par1BufferedImage == null) { return null; } else { this.imageWidth = 64; this.imageHeight = 32; BufferedImage var2 = new BufferedImage(this.imageWidth, th...
761dbcd3-8963-465f-9a08-4c9212ee9c9b
2
public List<EventName> getEventNameById(String lang, String id) { List<EventName> eventNames = new ArrayList<EventName>(); List<EventName> result = new ArrayList<EventName>(); eventNames = sendRequest(lang); for(EventName eventName : eventNames) { if(eventName.getId().equals(id)) { result.add(eventName);...
7826bd8f-eb45-425a-8b4a-b0358017528f
0
public void calcScore(int frameNum) { calculator.calcScore(frame, accumScore, frameNum); }
210e02ef-f0ef-4651-b0f0-b6a221f1dd18
8
private SceneGraphPath[] pickGeomAll(int xpos, int ypos) { Node obj; int i, cnt=0; pickRay = (PickRay) generatePickRay(xpos, ypos); sceneGraphPathArr = pickRoot.pickAll(pickRay); if(sceneGraphPathArr == null) return null; boolean found[] = new boolean[sceneGraphPathArr.length...
683086bc-5469-479f-8512-c3d7630849a1
4
public void print(List<String> IdsToStrings,String pad) { Iterator<K1> triIter=TrigramCounts.keySet().iterator(); K1 myValue; UnigramCountsModel<BigramModel<K2,K3>> model; int getVal; if (pad==null) { pad=""; } while (triIter.hasNext()) { myValue=triIter.next(); model=Tri...
f2ebb7a3-cbe1-4e53-9830-de75973a5cd7
8
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { String targetVenue = req.getParameter("vid"); if (targetVenue != null) { PersistenceManager pm = Common.getPM(); try { FoursquareApi api = Common.getCurrentApi(pm); Checkin[] herenow = new ...
c9433c3d-d553-4529-bf23-003d2f721b99
2
public GameClient(Game game, String ipAddress){ this.game = game; try { this.socket = new DatagramSocket(); this.ipAddress = InetAddress.getByName(ipAddress); } catch (SocketException e) { e.printStackTrace(); } catch (UnknownHostException e) { e.printStackTrace(); } }
1c461155-ba2e-4691-9ce0-1643696f9824
2
private static int getEngines(JSONObject responseOptions) throws JSONException { Object numberOfEnginesObj = responseOptions.get("NUMBER_OF_ENGINES"); int numberOfEngines = 0; if (numberOfEnginesObj instanceof String) { numberOfEngines = Integer.parseInt((String) numberOfEnginesObj);...
244f7f2a-d9f9-4288-a462-fd28202ba64e
2
public static boolean isRightLinear(Production production) { if (isRightLinearProductionWithVariable(production) || isLinearProductionWithNoVariable(production)) return true; return false; }
440a6a38-c30d-4189-aed4-605cdd87089c
0
public void load(int[] aInt, float[] aFloat, String[] aString){ this.array = aInt; }
1dd4d21d-e121-4087-aed9-773b54b17647
7
int getSetType() throws Exception { int sum = 0; int type = -1; if (nominal) { sum ++; type = Attribute.NOMINAL; } if (numeric) { sum ++; type = Attribute.NUMERIC; } if (string) { sum ++; type = Attribute.STRING; } if (date) { sum ++; type = Attribute.DATE; } if (relational)...
e72d9776-9df3-4c49-8b3f-fa0ab1aaffdb
4
private Field getKingField(Player player) { // Field in which the king is located for (Field field : this.fields) { if (field.hasPiece() && field.getPiece() instanceof King && field.getPiece().isWhite == player.isWhite) { return field; } } return null; }
8db5f6e4-d01f-40cb-812f-9c88233a0225
9
public ImageRegistry(String textureDir){ initialize(); this.dir = textureDir; //open index file File indexFile = new File(textureDir + File.separator + INDEX_FILE); if (indexFile.exists() == false){ System.err.println("Warning! Cannot find the index file for the texture folder: " + textureDir + ". Tile s...
d7d4ea62-e5ab-4db6-b134-b245c17eb78a
6
public static String numberToString(Number number) throws JSONException { if (number == null) { throw new JSONException("Null pointer"); } testValidity(number); // Shave off trailing zeros and decimal point, if possible. String string = number.toString(); if (string...
d1433b92-14a7-4842-8119-970152948455
0
public Node getOldNodeSet() {return this.oldNodeSet;}
252bda4d-8e1d-4d23-a39d-f613d84201ff
4
public void set(String o) { if(nextCalled && o.length() <= maxLen){ nextShort = o; } else if(previousCalled && o.length() <= maxLen){ previousShort = o; } else{ System.out.println("Failed to set."); } }
fecb3c4d-da6f-4b64-b811-bc2116c0d436
1
@Override public void dragExit(DropTargetEvent dte) { if (mDragDockable != null) { clearDragState(); } }
5d0271de-79ea-4a84-842f-242587f0afdc
6
public boolean start() { synchronized (optOutLock) { // Did we opt out? /* * if (isOptOut()) { return false; } */ // Is metrics already running? if (task != null) { return true; } // Begin hitting the se...
37051bc5-f526-476f-b8a8-89e9649aeb4d
8
public void merge(int A[], int m, int B[], int n) { int[] list = new int[m + n]; int indexa = 0; int indexb = 0; int index = 0; while (indexa < m && indexb < n) { if (A[indexa] < B[indexb]) list[index++] = A[indexa++]; else ...
ca3d2c52-3d5b-45c3-b98c-e80d848d839d
8
public static void main(String[] args) { if (args.length < 2) { System.out.print("请指明文件路径,格式为\'准考证号,姓名\',独占一行。\n"); System.out.print("java setstatus <path-to-file> <status>\n"); return; } String url = "jdbc:mysql://" + "localhost:" + "3306/" + "adminsys?" + ...
ab788a5a-8494-47e2-aba5-85dfe49330db
6
private static boolean isFirstLong(List<MapleBuffStat> statups) { for (MapleBuffStat stat : statups) { if (stat.equals(MapleBuffStat.DASH) || stat.equals(MapleBuffStat.DASH2) || stat.equals(MapleBuffStat.SPEED_INFUSION) || stat.equals(Maple...
522a4f1d-8230-4d87-b3f5-55e88f3259bc
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...
4c08a536-8d68-4b22-8f24-ebfeec4b5eda
7
public static boolean isLegendary(Pokemon p) { switch(p.species) { case SNORLAX: case DRAGONITE: case ARTICUNO: case ZAPDOS: case MOLTRES: case MEWTWO: case MEW: return true; default: return false; } }
04ec33ec-2327-4b4e-99a7-355806ead923
5
public String getLitEndingFor(int num) { if (num % 10 == 1 && num % 100 != 11) return "ą"; else if (num % 10 == 0 || (num % 100 >= 11 && num % 100 <= 19)) return "ų"; else return "us"; }
3ecee897-2c99-40d7-bac0-216c495c280a
0
@Basic @Column(name = "last_activity") public int getLastActivity() { return lastActivity; }
d2549034-7942-4fb2-b178-38271a5aa35b
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Edge other = (Edge) obj; if (edgeLabel == null) { if (other.edgeLabel != null) return false; } else if (!edgeLabel.equals(other.edgeLabe...
ee33266e-ef58-4c36-b0ce-c379a4b0cd0d
0
private BinaryStdIn() { }
10cc6765-2393-49cf-9b37-18d600149890
0
public List findByRecordStatus(Object recordStatus) { return findByProperty(RECORD_STATUS, recordStatus); }
340fb045-b936-4e0d-82b6-0d9c2c1a6dec
4
public void runDepthFirstPass(Pass p) throws Exception { if(localPass == currentPass) { return; } localPass = currentPass; ListIterator<Instruction> i = instructions.listIterator(0); while(i.hasNext()) { p.run(i); } BasicBlock ch1 = getFall...
7b552dde-d6da-44c5-ab68-90c55ea65f25
3
public static Polygon hex(int x0, int y0) { int y = y0 + BORDERS; int x = x0 + BORDERS; // + (XYVertex ? t : 0); //Fix added for XYVertex = true. // NO! Done below in cx= section if (s == 0 || h == 0) { System.out.println("ERROR: size of hex has not been set"); r...
7dab7cca-cd5d-4ded-ba56-5831fe92c126
5
public Book book_search_lib() throws Exception{ int choice=0, y=0; //ִܿµ //ԷѴܾԵȸ絵 String newtitle; int ISBN = 0; Scanner scan = new Scanner(System.in); System.out.print("1. or 2.ISBN (ȣ ) : "); choice= scan.nextInt(); if(choice==1) { System.out.println("**************************************...
0285d0be-03ad-489c-8eed-3d0ec4cbe2d2
4
@Override public PastMeeting getPastMeeting(int id) { Meeting meeting = null; PastMeeting pastMeeting = null; for (Meeting curr : allMeetings) { if (curr.getId() == id) { meeting = curr; } } if (meeting instanceof PastMeeting) { ...
6bef3d3a-565d-4327-8e79-d320d00707a1
9
public static Command MakeCommand(String CommandStr,Integer parameter,Player player,MapBsc Map) { String command = CommandStr.toUpperCase(); if(command.equals(ROLL)) return new RollCommand(); else if(command.equals(BLOCK)) return new BlockCommand(parameter,player,Map); else if(command.equals(BOMB)) ret...
ddb6efff-d99f-43c9-9bd4-06cd3eeb9585
4
private int findMinimumValueAndReachCorner(int m, int n) { if (m == rows - 1 && n == columns - 1) { return num[m][n]; } if (m == rows - 1) { return num[m][n] + findMinimumValueAndReachCorner(m, n + 1); } if (n == columns - 1) { return num[m][n...
273d8794-32b2-44b2-a760-bb8cc160c3c7
3
public static Variable exist(final String idToSearch, final List<Variable> targetVariables) { Variable existingContextVariable = null; for (final Variable targetVariable : targetVariables) { if (targetVariable.getId() != null && targetVariable.getId().equals(idToSearch)) { existingContextVariable = targetVar...
8575698c-d409-4539-8237-2d90362c5f37
0
public void showUpgradeMenu(){ upgradeMenu.show(); }
f6407f85-6eae-4a05-8ec4-1b82e603fbdd
8
@Override public void update(GameContainer gc, StateBasedGame game, int delta) throws SlickException { if(p2TextField.hasFocus() && p2TextField.getText().equals("Player 2 Name")) { p2TextField.setText(""); } else if (!p2TextField.hasFocus() && p2TextField.getText().equals("")) { p2TextField.setText("Pl...
a18ebfcd-80d2-4c97-bb3b-4b15a00b7550
0
public static void main(String[] args) { new SpiderMask(); }
ebda73c6-4249-466c-afe8-c3065e36699d
2
private void updateParsedData(){ parsedData = "@" + name + "^"; for(DataBit db : dataBits){ parsedData = parsedData + db.getParsedString(); if(!db.equals(dataBits.get(dataBits.size() - 1))) parsedData += ":"; } }
eff1fafa-5ad5-4bff-9a1e-24af106935a0
4
protected void loadFilters() { filterArray = new BufferedImageOp[2]; // Create the different short arrays short[] straight = new short[256]; short[] added = new short[256]; short[] subtracted = new short[256]; short[] threshold = new short[256]; for (int ...
5bdee22b-4428-44a5-9e78-652f0584710a
3
public void addConstructors(JMenu menu, Collection<Class> classes) { boolean first = true; Iterator<Class> iter = classes.iterator(); while (iter.hasNext()) { if (first) first = false; else menu.addSeparator(); Class...
ac0ece5d-c355-48a0-87b6-89c412d9d61a
7
final public Rule ruleBase() throws ParseException { Token ruleLabel=null; Mode ruleMode=null; Temporal ruleTemporal=null; if (jj_2_53(7)) { ruleLabel = jj_consume_token(STRING); } else { ; } if (jj_2_54(7)) { ruleMode = modalOperator(); } else { ; } if (jj_2_55(7)...
ebfc7558-3103-4abc-af99-b2d62d6acba4
3
public static String getLibraryDescription( Class libraryClass ) { if( libraryClass == null ) { errorMessage( "Parameter 'libraryClass' null in method" + "'getLibrayDescription'" ); return null; } if( !Library.class.isAssignableFrom( ...
5c6aa2b4-d20f-4f45-8c1f-59eb2874ee48
4
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Library library = new Library(); ResultPage<Book> books = library.getBooks( request.getParameter("search"), request.getParameter("searchColumn"), request.getParameter("or...
4905a132-7390-45a4-a196-a7b0d2957431
5
public boolean generateFromTemplate(){ ArrayList<String> replaced = new ArrayList<String>(); ArrayList<ArrayList<String>> hugedata = new ArrayList<ArrayList<String>>(); File file = new File("data/GENERATED.txt"); openAndReadTemplate(); openAndReadData(); parseExpressions(); hugedata = parseData(content); ...
8a79841a-b922-4aa4-9037-ad22027beaf4
3
public void EliminaInicio() { if ( VaciaLista()) System.out.println ("No hay elementos"); else { if (PrimerNodo.siguiente==PrimerNodo) PrimerNodo = null; else { PrimerNodo = PrimerNodo.siguiente; NodosProcesos Aux = PrimerNodo; while (Aux.siguiente!=PrimerNodo) Au...
b7589c1e-4f8e-4859-815b-c94aaea01c65
3
private void positionPlayerThrowInTopForTeam(int i) { Random generator = new Random(); int throwInPlayerID = playmode.getTeams()[i].getUser()[generator.nextInt(playmode.getTeams()[i].getUser().length)].getID(); GameObject ball = gameObjects.get("BALL"); ball.setSpeed(0.0); ball.setViewDegree(90); ball.setY(...
bebb8212-b94d-4fb9-b0e6-287278cc598c
0
public void setCar(String value) { this._car = value; }
7435b979-18da-4fc2-b5ee-4a46bb136af9
3
@Override public void update(Staff obj) { PreparedStatement pst = null; try { pst = this.connect().prepareStatement("update Staff set fonction=?, nom=?, prenom=?, age=? where id=? ;"); pst.setString(1, obj.getFonction()); pst.setString(2, obj.getNom()); ...
128e0355-9071-43ca-abed-a0d73e635b30
8
public String [] getOptions() { String [] options = new String [9]; int current = 0; options[current++] = "-X"; options[current++] = "" + m_CVFolds; if (m_evaluationMeasure != EVAL_DEFAULT) { options[current++] = "-E"; switch (m_evaluationMeasure) { case EVAL_ACCURACY: options[curr...
247a8038-24a7-4c11-bea9-f0b50ec1184e
0
public void setParticipantOnline(String id) { participants.get(id).setOnline(); setChanged(); notifyObservers(ModelNotification.LIST_OF_PARTICIPANTS_CHANGED); }
418e0b90-8257-4679-a553-9740e161185a
8
public String componentToString(AbstractComponent component) throws BookException { switch (component.getType()) { case TEXT: return textToString(component); case PARAGRAPH: return paragraphToString(component); case LISTING: return listingToString(component); case SENTENCE: return sentenceToStr...
603a5412-b869-4d02-b42f-6f425154925b
1
protected Object getObject() { if(automaton != null)return automaton; else return gram; }
d96be819-a4e7-4831-a9ff-2a37d7378f09
1
public void run(){ int data; while(true){ data = buffer.consume(); } }
b69f7696-ac15-46c2-a7c1-eed061f70bc6
5
public LinkedList<Integer> searchForPattern(String pattern, String context){ LinkedList<Integer> foundPatternList = new LinkedList<Integer>(); int patternLength = pattern.length(); int contextLength = context.length(); int[] prefixFunction = this.computePrefix(pattern); int longestPrefix = 0; for(int contextI...
f3154049-3d1d-4ed5-946d-205438202f39
6
private Record searchingFile(final String data, final String mark) throws IOException { BufferedReader br = new BufferedReader(new FileReader(file)); try { String checkVar; while ((checkVar = br.readLine()) != null) { String line = checkVar + " "; ...
d5be5eff-5d98-47c8-9f06-3ddbc61f7b2f
6
private static List<Class<?>> getSuperClasses(Class<?> testClass) { ArrayList<Class<?>> results = new ArrayList<Class<?>>(); Class<?> current = testClass; while (current != null) { results.add(current); current = current.getSuperclass(); } return results; }
1eb70130-6c12-46c1-b03e-fa86240a2994
5
public static final void Heal(final SeekableLittleEndianAccessor slea, final MapleCharacter chr) { slea.skip(4); final int healHP = slea.readShort(); final int healMP = slea.readShort(); final PlayerStats stats = chr.getStat(); if (stats.getHp() <= 0) { return; ...
8bfce3ea-1a60-4607-ac5c-890f2f2b2cb1
6
public void unzipFiles() { GutenbergCrawlerHelper.unzipInit(); File zipFileDir = new File(GUTENBERG_ZIP_DIR); File[] zips = zipFileDir.listFiles(); List<File> files = new ArrayList<File>(); for (int i = 0; i < zips.length; i++) { if (!SparkUtils.isZipFile(zips[i].getName())) { SparkUtils.getLogg...
4422a21c-7e99-40c4-abf1-6146c538c5af
2
public DataModel<AgendaBean> listaAgendamentos() { AgendaDAO agendaDAO = new AgendaDAO(); System.out.println("Data inicial: " + dataInicio + "/ Data final: " + dataFinal); List<AgendaDAO> listaAgenda = agendaDAO.getAgendamentos(dataInicio, dataFinal); if (listaAgenda != null) { ...
c49781d7-271a-4ec5-89f9-829b494a2cc2
9
public boolean check(int[] data) { if (data == null || data.length == 0) { return false; } for (int i = 0, len = data.length; i < len - 1; i++) { if (data[i] == FIRST_VALUE && data[i + 1] == SECOND_VALUE || data[i + 1] == FIRST_VALUE && data[i] == SECO...
4362fd8f-3042-4b6f-8648-29c7ad447679
3
public boolean isWall() { return this == TL || this == TR || this == T || this == VOID; }