method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
1bf8ff3a-56e2-43f4-929a-1bafcae444eb
9
private Feature getRandomFeature(Rarity rarity) { double whichFeature = (Math.random() * 4); // System.out.println("which feature " + whichFeature); if (whichFeature >= 0 && whichFeature < 1) { return itemBuilder.getRandomItem(rarity); } // creatures are more likely if (whichFeature >= 1 && whichFeature ...
fb448c86-64b8-47d6-82aa-ea34ba525e34
4
public static HSSFCellStyle getStyle(HSSFWorkbook wb,HSSFCellStyle style, Style htmlStyle,String [][]attr) { for(int x=0;x<attr.length;x++) { if("id".equals(attr[x][0])&&(!"".equals(attr[x][1]))) { String[][] idstyle = htmlStyle.getStyleMap().get("#"+...
93e246fb-1792-461c-a2b6-f6b9be561141
9
public JPanel makeSelector(){ JPanel selectorPane = new JPanel(new BorderLayout()); selectorPane.add(new JLabel("")); String[] names; switch(source){ case "editArtist": names = new String[IO.getInstance().getFestival().getArtists().size()]; for(int i = 0; i < names.length; i++){ names[i] = IO.getIns...
a4d6530e-2b69-49bd-bf83-781f72927970
2
public Object revealRandomProductions() { Iterator it = objectToProduction.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); Object key = entry.getKey(); if (alreadyDone.contains(key)) continue; Production[] p = (Production[]) objectToProduction.get(key); addP...
0462cbe9-b845-430e-8285-95831ebef1a6
8
public void toggleKey(int keyCode, boolean isPressed) { if (keyCode == KeyEvent.VK_W || keyCode == KeyEvent.VK_UP) { up.toggle(isPressed); } if (keyCode == KeyEvent.VK_S || keyCode == KeyEvent.VK_DOWN) { down.toggle(isPressed); } if (keyCode == KeyEven...
16d946c9-7027-4b33-a9e8-8d959f1657dd
6
public ImageAlgebraicOperations(String s, final PunctualOperationsMenu menu) { super(s); this.menu = menu; this.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Panel panel = (((Window) menu.getTopLevelAncestor()).getPanel()); if (panel.getImage() == null) { ...
49d91435-284d-48f3-8c22-ade41e31e93f
8
@Override public void run() { //System.err.println("going!"); try { client = new Socket(targetIP, port); //open connection InputStream reader = client.getInputStream(); byte[] headerBuff = new byte[4]; byte[] buff = null; boolean header = true; int dataLength = 0; while (client.isConnected()) ...
3155c542-ddaa-434f-a40c-169c3c809639
7
private void applyPatch(SinglePatch patch, boolean dryRun) throws IOException, PatchException { lastPatchedLine = 1; List<String> target; patch.targetFile = computeTargetFile(patch); if (patch.targetFile.exists() && !patch.binary) { target = readFile(patch.targetFile); ...
5ee5391e-9c32-4a56-a928-67a807352b38
9
@Override protected void done() { //when it have finish downloading try { errorCode=process.waitFor(); get(); } catch (InterruptedException e) { } catch (ExecutionException e) { } catch (CancellationException e){ errorCode=-1; } switch(errorCode){ case -1://cancel button //Help...
bdc450f8-7e48-4ec1-bdff-b686ae2c266b
9
@Override public void paintComponent(Graphics g){ super.paintComponent(g); setBackground(Color.black); if (bflag == 1) { for (int i = 0; i < bullet.size(); i++) { bullet.get(i).draw(g); } } square.draw(g); ufo.draw(g); for (int i = 0; i < shipr0.size(); i++) { shipr0.get(i).draw(g); ...
7948c7d8-f4c9-4483-8643-d1faf7239552
9
public static ArrayList<Tuple> correct(String input) throws FileNotFoundException { // System.out.println("TestData -- " + input); StringTokenizer tokenizer = new StringTokenizer(input, " !?.;,"); String misSpelt = ""; String misSpeltPPOS = ""; ArrayList<String> contextWord = new ArrayList<String>(); A...
fe4f6095-297d-4fe6-bc79-509a816c62b2
6
private void copyRGBtoABGR(ByteBuffer buffer, byte[] curLine) { if(transPixel != null) { byte tr = transPixel[1]; byte tg = transPixel[3]; byte tb = transPixel[5]; for(int i=1,n=curLine.length ; i<n ; i+=3) { byte r = curLine[i]; by...
b3733ab0-efc1-448c-b9d2-94eefc12b56e
8
public String stSendOrCancelEmail1(int dataId,int ExpVal,String flow ) { int actVal=1000; String returnVal=null; hm.clear(); hm=STFunctionLibrary.stMakeData(dataId, "Email"); String action = hm.get("Action"); String widgetType=hm.get("WidgetType"); STCommonLibrary comLib=new STCommonLibrar...
bd6e9aff-6149-4732-a18c-0ba050a395b2
5
@Override public void actionPerformed(ActionEvent a) { if(a.getSource() == TypeSel){ Clear(); switch(TypeSel.getSelectedIndex()){ case posCartLine: initCartesianLine(); break; case posVecLine: initVectorLine(); break; case posCartPlane: initCartesian(); break; case posVecPla...
14ae3e2b-093d-4272-bc8e-d6b38d227006
2
public Timestamp getBooktimeByOrdernumber(Statement statement,String ordernumber)//根据订单号获取下单时间 { Timestamp result = null; sql = "select booktime from ParkRelation where ordernumber = '" + ordernumber +"'"; try { ResultSet rs = statement.executeQuery(sql); while (rs.next()) { result = rs.getTimestamp...
6dd395e1-5551-49a7-abf2-b6a99dbc3209
1
public void Init(boolean solid) { if (!solid) { _streamPos = 0; _pos = 0; } }
b839515f-c6ed-440b-b16d-d9f2005095b8
8
public boolean equals(PixImage image) { int width = getWidth(); int height = getHeight(); if (image == null || width != image.getWidth() || height != image.getHeight()) { return false; } for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { if (! (getRed(...
05ed9b98-dfed-4760-ab14-d800cc741a47
5
private void sendCmdOutToAll(String data) throws TimeoutException { PooledBlockingClient pbc[] = blockingClientPool.getOneBlockingClientForAllActiveHosts(); if (pbc == null) { throw new TimeoutException("we do not have any client array [pbc] to connect to server!"); } for (int i = 0; i < pbc.length; i++) { ...
b0bca0af-8df1-480c-b1b2-0322b2dc5059
2
private Position getTertiaryPowerFailurePosition() { // Calculate T1 Position final int directionInt = parentPowerFailure.getDirectionInt(); final Direction direction = Direction.values()[directionInt]; final Position squareOne = direction.newPosition(parentPowerFailure.pos); // Calculate T2 Position fin...
7fd3d754-c675-4d11-9ca0-69feeee2e362
1
public void using(int usingTimeMillis) throws ParkingException { try { TimeUnit.MILLISECONDS.sleep(usingTimeMillis); } catch (InterruptedException e) { throw new ParkingException(e); } }
ddaa7bd3-cf8b-42c8-b4a4-e2f92c272190
7
@SuppressWarnings("static-access") void setupOutgoingCommand(OutgoingCommand command) throws EnetException { Channel channel = this.channels.get(command.command.channelID()); this.outgoingDataTotal += command.command.length() + (command.fragmentLength & 0xFFFF); if (command.command.chann...
56032d8b-d949-4300-bb6b-2de5179fff97
1
* @return the meeting with the requested ID, or null if it there is none. */ public Meeting getMeeting(int id) { if(id >= meetingList.size()) { return null; } return meetingList.get(id); }
3e7a6be5-4cc1-44c6-a613-8f0b27c9fb5c
5
public Missiletab(ConsoleApp theApplication, String launcherId, List<WarUIEventsListener> allListeners) { this.theApplication = theApplication; this.allListener = allListeners; this.launcherID=launcherId; missileID = new TextField(); destination = new TextField(); damage = new TextField(); flytime = new TextFiel...
7957d1d4-9a30-42fa-81fe-cf6ae056a588
0
public void save()throws IOException{ props.store(new FileOutputStream(file), des); }
5e9b96cf-42a0-49e9-a49a-febc905e1184
6
public static void main(String[] args) { SortVector sv = new SortVector(new StringCompare()); // Open the file which contains the words you want to add try { FileInputStream fstream = new FileInputStream("newoutput1.txt"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fst...
3e14f886-8aee-43f4-896e-0e2db06068b1
0
private static void printUsage() { System.out.println("FlowDroid (c) Secure Software Engineering Group @ EC SPRIDE"); System.out.println(); System.out.println("Incorrect arguments: [0] = apk-file, [1] = android-jar-directory"); System.out.println("Optional further parameters:"); System.out.println("\t--TIMEOU...
698754c0-b0f7-4624-9125-40be548aa225
4
public void notify(int ack, String fileName) { switch (ack) { case Global.READACK: masterLogger.logMessage("===> done reading " + fileName); break; case Global.WRITEACK: masterLogger.logMessage("===> done writing " + fileName + "in primary replica"); break; case Global.BROADCASTSTARTACK: mas...
99d2b8ca-5c9f-465f-93b1-a12a5ff9d946
3
private void readConstantPool(final DataInputStream in) throws IOException { final int count = in.readUnsignedShort(); constants = new ArrayList(count); // The first constant is reserved for internal use by the JVM. constants.add(0, null); // Read the constants. for (int i = 1; i < count; i++) { const...
01b23c95-3a6a-4298-94db-16bead6fd641
2
public static void main(String[] args) { try { String name = "MASTER"; if (args.length >= 1) { name = args[0]; } new MessagingNode(name); } catch (Exception e) { log.fatal("Toal failure to open a socket connection.", e); } }
35b64a07-e772-438a-9b7c-6b0ee840143f
9
public void selectionChanged() { NSRelation or; int i, oc; SObjectTableModel tm; oc = 0; for (i = 0; i < this.M.getSize(); i++) { if (this.M.getObjectAt(i).isSelected()) { oc++; this.o = (NSObject) this.M.getObjectAt(i); } ...
1c24ed91-07a2-4b4f-8fc6-df274f01a75e
1
@Override protected void parseInternal(Method method, Map<String, Integer> paramIndexes, Map<String, Integer> batchParamIndexes) throws DaoGenerateException { super.parseInternal(method, paramIndexes, batchParamIndexes); MongoUpdate updateShell = method.getAnnotation(MongoUpdate.class); upsert = updateShell....
c7d9cba7-16eb-4a42-a70d-d49cf95faca8
5
public int searchNumber(int search,String option) { int start = 0; int position = -1; int end = array.length - 1; while (start <= end) { int mid = (start + end) / 2; if (search == array[mid]) { position = mid; if(option.equalsIgnoreCase("first")){ end = mid-1; } else...
6185f73c-975f-4d3e-a16d-e134f475a6ec
8
private String isHyperlink(Point p) { if (getDocument() instanceof HTMLDocument) { int pos = viewToModel(p); if (pos >= 0) { try { HTMLDocument doc = (HTMLDocument) getDocument(); if (doc != null) { Element elem = doc.getCharacterElement(pos); if (elem != null) { AttributeSet a ...
a1108fc7-2c55-4316-a03a-181d687cc9b5
5
private HashMap<AbstractComponent, Integer> getWordMap( AbstractComponent component, HashMap<AbstractComponent, Integer> map) throws BookException { if (component.getType() == EComponentType.WORD) { Integer count = map.get(component); map.put(component, count == null ? 1 : ++count); } else if (component...
d8533917-32fb-4126-b35a-948d03551285
9
private void drawAlign(int x, int y, int w, int _h, Graphics2D g, String _type) { int N = _h / 2; int i; int stepH = (_h / N); int indent = (int) (w * 0.1); int rw = w - indent; if (stepH <= 1) { stepH = 1; } int h = y + (stepH / 2 + 1); int type; if (_type.equals("left")) { type = 0; }...
1cafa0b5-3a31-40d9-b353-551f928533ff
1
@Override protected void fireActionPerformed(ActionEvent event) { Container w = getWindow(); if (isSelected()) { adjustWindow(w); w.setVisible(true); w.requestFocus(); } else { w.setVisible(false); } }
9b1393bf-ca80-4e67-9891-dc9406fb9059
3
public final LogoParser.assignment_return assignment() throws RecognitionException { LogoParser.assignment_return retval = new LogoParser.assignment_return(); retval.start = input.LT(1); Object root_0 = null; Token MAKE30=null; Token ID31=null; LogoParser.expression_re...
ff770320-8775-4cac-bb4d-9cc0ea886be2
5
public void setPaused(boolean paused) { if(paused) { if(!this.paused) { for(final String key : currentClips.keySet()) { currentClips.get(key).stop(); } this.paused = true; } } else { if(this.paused) { for(final String key : currentClips.keySet()) { currentClips.get(key).start();...
fe514ff1-c970-4883-858a-f6fcecf91849
1
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { stack.push(qName); for(int i = 0; i < attributes.getLength(); i ++) { String attrname = attributes.getQName(i); String attrvalue = attributes.getValue(i); System.out.printl...
2ff83299-fadc-4dd8-bdb6-3c02bcd9423a
1
@Override public boolean equals(Object object) { if (object instanceof Contact){ Contact contact = (Contact) object; return contact.id == id; } return false; }
22fceb00-daf7-4c7c-a64a-ae30836f5e20
4
public static List<Currency> formatOutputs(JSONArray results) { final List<Currency> ret = new ArrayList<Currency>(); for (int i = 0; i < results.length(); i++) { JSONObject r = null; if (results.get(i) instanceof JSONObject) r = (JSONObject) results.get(i); if (r != null) { final Currency c = new...
6ebe91a3-d6c7-4b90-8edb-f639810dcd2b
7
private void checkForPath(){ CollisionResults [] results = new CollisionResults [4]; for(int i = 0; i < results.length; i++){ results[i] = new CollisionResults(); } getStageNode().getChild("TerrainNode").collideWith(new Ray(Vector3f.ZERO, Vector3f.UNIT_X), r...
9edc4f5b-1d70-4894-8f33-c5e756552b77
7
static void addTab(final JTabbedPane tabPane) { if (!SwingUtilities.isEventDispatchThread()) { try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { addTab(tabPane); } }); } catch (InvocationTargetException | InterruptedException e1) { } return; ...
1fa7a0aa-8579-47e9-bd3d-5b01e240234d
7
@Override public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { String myCmd = cmd.getName().toLowerCase(); Commands c = new Commands((Player) sender); boolean ret = true; if (myCmd.equals("pmhelp")) { c.Help(); } else...
6105cc67-28b6-42f6-be35-b580300ae0c9
3
@Override public Sentence_tree bfs_function(String function){ LinkedList<Sentence_tree> queue = new LinkedList<Sentence_tree>(); queue.add(this); while(!queue.isEmpty()){ Sentence_tree current = queue.pop(); if(current.root.function.equals(function)){ return current; } for(int index = 0; index < ...
54cab30c-3904-4ba9-ab18-09f701ef2ade
7
public static Thread transformMissionTriggerThread(final String currentLang, final String outputPath, final String fileName, final String[][] commonContent) { Thread currentThread = new Thread(new Runnable() { @Override public void run() { StringBuilder allContent = new S...
325d62ce-d208-4034-a113-ac8b44906f76
2
public void setDir(String d) { dir = new File(d); if (!dir.exists()) { dir.mkdirs(); } if (!dir.isDirectory()) { throw new IllegalArgumentException("Not a directory " + dir); } }
ac78a6ac-ebc5-4fb1-9db2-ff7fae1f82c6
8
private int parseTimeStamps() throws MpegDecodeException, IOException { Statistics.startLog(PARSE_TIME_STAMPS); int pktLength = 0; long pts = -1, dts = -1; while( m_ioTool.nextBits( 0xFF, 8 ) ) { m_ioTool.skipBits(8); pktL...
63d4937a-11be-4c9b-84a1-7c4da0f60026
7
private void gameLoop() { try { init(); checkGLError("init"); resized(); checkGLError("resized"); long lastTime, lastFPS; lastTime = lastFPS = System.nanoTime(); int frames = 0; while (!Display.isCloseRequested() && !shouldStop()) { long deltaTime = System.nanoTime() - lastTime; l...
c8246b75-214a-47d7-9aa8-0a2688a71007
5
public void doTransformations() { if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_FLOW) != 0) GlobalOptions.err.println("before Transformation: " + this); while (lastModified instanceof SequentialBlock) { if (lastModified.getSubBlocks()[0].doTransformations()) continue; lastModified = lastModi...
516ae974-f473-41a4-9ec5-f07d6217dcf1
4
public boolean deleteMaster(String filename, int resID) { // check for errors first if (resID == -1 || filename == null) { return false; } Object[] packet = new Object[2]; packet[0] = filename; packet[1] = myID_; // send the event super.s...
94f50476-4aa1-43cf-8f5b-25173607a567
4
private void inviteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inviteActionPerformed // TODO add your handling code here: JComboBox cb = (JComboBox) evt.getSource(); String name = (String)cb.getSelectedItem(); if ( name.equals("invite") ) { //TO...
2d0a53b9-d962-47af-b4a5-029d98be5570
2
public static Vector add(Vector op1, Vector op2) throws DimensionMismatchException { if (op1.getDimension() != op2.getDimension()) { throw new DimensionMismatchException(); } Vector result = new Vector(op1.getDimension()); for (int i = 0; i < result.getDimension(); i++){ result.setComponent(i, op1.getComp...
d96d491c-c51c-4eaa-a06c-8b863783bf4b
5
public boolean testFr(LinkedList<String> dico, int[] alphabet, String test, String mot){ int bInf, bSup; ListIterator<String> i; if(!(test.length()!=7 || test.charAt(0)!=mot.charAt(0))){ bInf=alphabet[test.charAt(0)-'a']; bSup=dico.size(); if(test.charAt(0)!='z') bSup=alphabet[test.charAt(0)-('a'-1)...
f0b117dd-cf32-47db-ae06-17180a9dce78
1
int depth() { if (parent != null) { return 1 + parent.depth(); } return 1; }
8792e502-9793-4a84-b012-15e87f6ab390
0
public void actionPerformed(ActionEvent e) { //this. }
58f60686-69a9-4293-a38f-dc90e10945f4
7
public Widget createWidget(Composite parent, int style) { String tooltip = getTooltip(); GridData controlGD = new GridData( SWT.FILL, SWT.CENTER, false, false ); // label if ( control.getLabel() != null ) { label = new Label( parent, SWT.NONE ); label.setText( control.getLabel() ); if ( tooltip != ...
c171c116-59ba-4a4f-bf9d-fc3b010a62cc
4
@Override public String toString() { StringBuilder string = new StringBuilder(); string.append(super.toString()); if (this.journal != null) string.append("Journal: ").append(this.journal).append("\n"); if (this.volume != null) string.append("Volume: ").append(this.volume).append("\n...
5177ec3c-ccdf-46e3-a2fc-2f5d9baa0e97
6
public static boolean isCompressedPath(String path) { path = path.trim().toLowerCase(); return path.endsWith(DataConstants.CATALOGUE_COMPRESSED_FILE_EXTENSION) || path.endsWith(DataConstants.CATALOGUE_COMPRESSED_FILE_EXTENSION_OLD) || path.endsWith(DataConstants.GAME_SYST...
01c7ec13-836a-47c2-9c09-cef569b5a1b9
6
public void render(Graphics g) { g.setColor(Color.red); g.drawString(currentPlayer.name+"'s Turn", 30, 30); g.setColor(Color.blue); g.drawString("Playing State: "+playingStateNames[playingState], 30, 50); //g.drawString("Change State\nM = Moving\nS = Shooting\nB = Buying", 30, 50); // for (int x = 7; x < Ma...
39b12fc4-145e-4adb-970a-cee8409cb404
1
XmlWriter writeEntity(String name) throws IOException { closeOpeningTag(true); this.closed = false; for (int tabIndex = 0; tabIndex < stack.size() + indentingOffset; tabIndex++) this.writer.write(INDENT_STRING); this.writer.write("<"); this.writer.write(name); ...
1dc58560-e2e9-4bad-a36d-8edcd90d48f7
6
public void mouseMoved(int x, int y) { if ((x >= theComponent.getX()) && ((x <= (theComponent.getX() + buttonWidth)))) { if ((y >= theComponent.getY()) && (y <= (theComponent.getY() + buttonHeight))) { if ((y > theComponent.getY()) && (y < (theComponent.getY() + buttonHeight))) { ...
4a7f81e4-b718-4358-8c49-055e76f71db3
8
@Override public final IoBuffer compact() { int remaining = remaining(); int capacity = capacity(); if (capacity == 0) { return this; } if (isAutoShrink() && remaining <= capacity >>> 2 && capacity > minimumCapacity) { int newCapacity...
1d7a3812-c8a5-4404-9fb9-1b99ba3c8f5f
0
public void setName(String name) { Name = name; }
686867df-0c28-46d3-bea7-338f6ba6ff99
7
public void loadXML ( ) { JFileChooser chooser = new JFileChooser(); chooser.setFileSelectionMode( JFileChooser.FILES_ONLY ); chooser.setAcceptAllFileFilterUsed( false ); chooser.addChoosableFileFilter( new XMLFileFilter() ); int option = chooser.showOpenDialog( MenuApp.getFrame() ); if ( option == JFileCho...
8496b681-0dc7-42a0-a0d6-56adf2e6bfb9
9
public static void postorder(TreeNode root) { if (root == null) return; Stack<TreeNode> S = new Stack<TreeNode>(); S.push(root); TreeNode previous = null; while (!S.empty()) { //get the current node from the stack TreeNode current = S.peek(); //going down the tree if (previous == n...
03c1aceb-5319-41e2-8190-1879d6ff65cf
7
private void gameThread() { running = true; try { long beginTime = System.nanoTime(); double previousDelta = 0.0; boolean runningSlowly = false; while(running) { if(interval <= 0) throw new Error("GameTimer interval must be >= 0."); long frameStartTime = System.nanoTime(); double gi...
f454d330-12fa-4fae-8ea4-4fa30ba5d4ea
9
public static void main(String args[]){ String objectListPath = "/u/ml/mindseye/nlg_lm/LM/lesk_syns_purdue.txt"; int no_objects = readObjectList(objectListPath); String outputMatrixPath = "/u/ml/mindseye/nlg_lm/LM/object_count.txt"; int[] object_counts = new int[no_objects]; String ldcCorpusPath = "/scratc...
66a89c50-1226-4f6c-9662-b086bef15a58
1
private static void readFragmentsEnc(Stream buffer) { Censor.anIntArray620 = new int[buffer.getInt()]; for (int i = 0; i < Censor.anIntArray620.length; i++) { Censor.anIntArray620[i] = buffer.getUnsignedShort(); } }
60a91d23-9ce7-4f1e-b354-ab167c9fc191
9
public void tick(Input input, double delta) { if (isReady[0] && !isReady[1]) { delta = 0; isReady[1] = true; } physicHandler.tick(input, delta); for (int i = 0; i < entities.size(); i++) { AbstractEntity e = entities.get(i); for (int j = 0; j < entities.size() && e.isInteractsWithWorld() && ...
794c2d06-463f-4626-95cb-f469bb8bd9af
1
public void drawCollidableObjects(){ for(collidableObject tempObj : listWrecks){ tempObj.display(); } }
4aaa0418-35f4-4356-8456-9e7231545091
4
@SuppressWarnings("serial") public MyTable() { data = new Object[30][5]; for (int i = 0; i < 30; i++) { data[i][0] = new Boolean(false); data[i][1] = "Column " + i; data[i][2] = (Math.random() > 0.5) ? new ImageIcon( JTableRenderer.class.getResource(IMAGE_PATH + "preferences.gif")...
95ae86cf-9e4b-4541-8168-5fababa07071
8
public void cmdQuote(CommandSender sender, String[] args) { if(args.length != 3) { sender.sendMessage(Conf.colorMain + "Usage:"); sender.sendMessage(Conf.colorAccent + "/ee quote <quantity> <material name>"); return; } int quantity = 0; Material material; try { quantity = Integer.parseInt...
04c0df7f-21c3-45d2-ab3b-865736418d80
2
public void click(int mouseX, int mouseY) { for (MenuItem item : this.itemList) { if (item.check(mouseX, mouseY)) { item.action(); return; } } }
a2dfcfbd-5df8-4b60-a84c-d9be255e08b3
2
public void setOccupant(Peuple occupant) { this.occupant = occupant; int tour = Partie.getInstance().getTourEnCours(); List<Peuple> ls; if (tour < this.prisesDuTerritoire.size()) { ls = this.prisesDuTerritoire.get(tour); } else { ls = new ArrayList<Peuple>(); int s = this.prisesDuTerritoi...
6127fff4-c6b1-4eee-938c-514e7568795b
4
public void keyReleased(KeyEvent e) { int key = e.getKeyCode(); if (key == KeyEvent.VK_LEFT) { dx = 0; } if (key == KeyEvent.VK_RIGHT) { dx = 0; } if (key == KeyEvent.VK_UP) { dy = 0; } if (key == KeyEvent.VK_DOWN) {...
3657d81d-933b-4c27-b38c-bb4ac9c530a4
4
public static void render( float scale, float rotation, Vec3D offset, FloatBuffer vertBuffer, FloatBuffer normBuffer, FloatBuffer textBuffer, int numFacets ) { GL11.glMatrixMode(GL11.GL_MODELVIEW) ; GL11.glLoadIdentity() ; if (numFacets < 1) numFacets = vertBuffer.capacity() / ...
96bdea3f-8734-411c-ad2a-be573693ab2c
7
public void testNullForkStack() throws Exception { fc1=new ForkChannel(a, "stack", "fc1"); fc2=new ForkChannel(a, "stack", "fc2"); MyReceiver<Integer> r1=new MyReceiver<>(), r2=new MyReceiver<>(); fc1.setReceiver(r1); fc2.setReceiver(r2); a.connect(CLUSTER); fc1.connect("...
6c4169a3-05b4-46b9-847b-30f68afdfba4
0
public void setMaxFailedAttempts(Long value) { this.maxFailedAttempts = value; }
3a5deaae-ffb9-4bec-b077-c1643873d5b8
7
protected void rotateTurn() { if (currentTurn < playerCount) { currentTurn += 1; PrimaryController.generateNotification("Switching to Player " + currentTurn, 0); turnTimer.setRepeats(true); percent = 0; turnTimer.start(); } else { for (int r = 0; r < unitsP1.length; r++) { for (int c = 0; c ...
d666cc82-e786-4858-858c-be7e9973ce3a
3
@Override public void actionPerformed(ActionEvent e) { OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched(); OutlinerCellRendererImpl textArea = doc.panel.layout.getUIComponent(doc.tree.getEditingNode()); if (textArea == null) { return; } Node node = textArea.n...
1bc4f4e4-7643-4890-9bc3-8197fdac23d0
0
public void SetTicks(int ticks) { this.ticks = ticks; }
936813b3-9315-4a92-be1b-0d48c33cf63c
8
private void add(Method method) { // Check for annotation ICallbackEnum message = getMethodMessage(method); if(message == null) return; // Check Parameters Class<?>[] params = method.getParameterTypes(); Class<?> metaClass = message.getMetadataClass(); if(metaClass == null) metaClass = IJeTTSession.cl...
d7dd5594-102d-48d0-99fb-392337f4ecfa
1
public static double sum(double[] vals) { double sum = 0; for (double v : vals) { sum = sum + v; } return sum; }
32d8c856-b5fa-4117-b0c3-386edf6e3fdb
9
public Transition<ET, ?> nextChainedTransition(State<ET> inputState, Event<?> event, ET entity) throws FiniteStateException { if (!initialized) throw new FiniteStateException( "State map not yet initialized through call to build() method"); State matching...
f3de7222-c7e9-41cc-bad8-714374c5a261
5
@Override public void validate() { if (platform == null) { addActionError("Please Select Platorm"); } if (location == null) { addActionError("Please Select Location"); } if (iphone.equals("Please select")) { addActionError("Please Sele...
12da0b60-128a-42d4-bedb-5dea88d8c87c
2
public double[][] getComponents() { double[][] values = new double[3][3]; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) values[i][j] = m[i][j]; return values; }
f8bbee19-cbf7-4ec7-b37f-37993e4d351e
5
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Product product = (Product) o; return number == product.number && !(name != null ? !name.equals(product.name) : product.name != null); }
52005281-acd8-436b-99c5-e10ef288a52e
3
private void log( Level level, String msg, Throwable ex ) { if( getLogger().isLoggable(level) ) { LogRecord record = new LogRecord(level, msg); if( !classAndMethodFound ) { getClassAndMethod(); } record.setSourceClassName(sourceClassName); ...
bd864c1a-d9f1-4d89-93ff-58f6fb81c3a8
3
public static void loadPreset_HelpMenu_ComparePins(final Container mainFrame) { ArtAssets art = ArtAssets.getInstance(); PinLoader pinLoader = PinLoader.getInstance(); BackgroundPanel pane = new BackgroundPanel(art.getAsset(ArtAssets.IN_GAME_BACKGROUND)); //Set up the m...
fd1beaeb-8ac1-417f-9019-ac795d5043f8
0
public String getName() { return name; }
a94e1c39-d90d-41d8-8128-a3cd6dd3d416
7
@Override public void actionPerformed(ActionEvent e) { if(e.getSource() == logOff){ frameRef.setContentPane(new Login(frameRef)); } if(e.getSource() == searchItems){ contentPanelLayout.show(panel, "searchItems"); } if(e.getSource() == searchBooks){ contentPanelLayout.show(panel, "searchBooks"); } ...
84b09c28-79c9-4be6-9931-5b7664a4c6e4
7
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed String frek=jTextField8.getText(); String put="C:\\Users\\vhailor\\Documents\\NetBeansProjects\\JavaApplication10\\"; DecimalFormat f = new DecimalFormat("##"); ...
27327e6b-d3f1-4704-bc76-506a60187629
8
private boolean uhattuOikealta(int pelaajaNumero, int x, int y) { int i = 1; while(y+i < 8 && kentta[x][y+i].onTyhja()) i++; if(y+i == 8) return false; if(kentta[x][y+i].getNappula().omistajanPelinumero() != pelaajaNumero) { if(i == 1 && kentta[x][y+i].getNa...
218fc799-0236-4520-83c9-d6af480b3b8f
8
@Test public void test() { Imagem img; ImagemIterator iterator = new SuperiorDiagonalIterator(); // Teste com largura maior i = 0; img = new Imagem(4, 3); iterator.iterate(img, new ImageIteratorCallback() { @Override public void callback(int x,...
b686c9e9-63a5-4230-953e-2d51fb513336
7
public void extractFeature(List<Article> artList, boolean isTraining) { HashMap<Article, SentencePOS[]> allPos = new HashMap<Article, MophoFeatureExtractor.SentencePOS[]>(); // load all short article POS tags with article id for (int i = 0; i < artList.size(); i++) { System.out.println(i); Article art = a...
1de30ea3-ff55-4e3c-8e96-0020ac8ca4f7
8
private static String initialise(Token currentToken, int[][] expectedTokenSequences, String[] tokenImage) { String eol = System.getProperty("line.separator", "\n"); StringBuffer expected = new StringBuffer(); int maxSize = 0; for (int i = 0; i < expe...
554a7bd9-2d6e-415f-a7c7-45ce0c538068
3
private void processInventory() { ArrayList<InventoryListObject> inventoryLists; Iterator<InventoryListObject> inventoryListObjectsIter; InventoryListObject inventoryListObject; ArrayList<InventoryItemObject> inventoryItemList; String listName; InventoryPanel ...
8f30cc2e-464f-430a-9051-3a1315a073e1
5
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof DefaultSettings)) return false; DefaultSettings that = (DefaultSettings) o; if (!age.equals(that.age)) return false; if (!email.equals(that.email)) return false; if (!name.equ...
55089432-c511-471f-baf5-bf078c3684a4
3
public void pushWeights(Map<Object, Integer> weightedItems) { for (Map.Entry<Object, Integer> weightedItem : weightedItems.entrySet()) { String key = createKey(weightedItem.getKey()); if (sharedWeights.containsKey(key)) { // could add another heur...