method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
1b8dc8bc-6338-429a-a26c-05d19d6909b2
9
public void push(int stackId, int data){ if(stackId == 1){ if(topleft+1 == basemiddle){ if(stack3RightShiftable()){ shiftStack3Right(); array[++topleft] = data; }else return; }else{ ...
ffc03de8-3f2c-4abd-9365-c568c39f8823
8
public void sendFirst() { System.out.println("-- Alice --"); if (betray) { System.out.println("ACHTUNG: Betrugsmodus aktiv!!!"); } int n = 2; // n in {1,...,10} // Part 0 --------------------------------------------------------------- // Hard coded ElGamal BigInteger El_p_A = new Bi...
7b0aa608-b7b6-4d59-9740-67680ac76d19
6
public void testValueCollectionToArray() { int element_count = 20; String[] keys = new String[element_count]; int[] vals = new int[element_count]; TObjectIntMap<String> raw_map = new TObjectIntHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); Map<String,...
30ed39f4-dbae-4d44-a168-f604768198e1
0
public int getIdProducto() { return idProducto; }
6d608b4e-10fd-48f8-bc60-d98fef460ffa
0
public File getFile(){ return file; }
8003d99b-72cc-476d-b097-576e2c178899
6
@Test public void testContinueVisit() { System.out.println("DocumentVisitorTest: continueVisit(String ...)"); Person person = new Person("Bill","Smith", new Date(), 1); Order order = new Order(125L, 12345); person.setOrder(order); Order exporder = new Order(125L, 12345); ...
14f7b5bc-30e9-4bd2-8ca4-68c0c3604d07
6
public NSMBRom(Filesystem fs) throws AlreadyEditingException { super(fs); Overlay ov0 = arm9ovs[0]; ov0.decompress(); File ovFile = ov0.getFile(); switch (gamecode) { case "A2DE": region = Region.US; break; cas...
4ccbc971-3397-4b88-a64d-3e7dbcd2253a
8
public void start() { if(getState() ==GameState.INGAME || getState() == GameState.STARTING || getState() == GameState.STOPPING){ return; } this.counter = this.plugin.getConfig().getInt(getName() + ".Countdown"); this.id = Bukkit.getScheduler().scheduleSyncRepeatingTask(this.plugin...
8bd03934-fe1a-43ac-b760-3dbc724c2b64
0
public RunTimeStack() { framePointers.push(0); }
e9f3eb8a-4c0a-4210-9087-9f01a4d4dc47
5
protected void writeBignum(long v) throws IOException { if (trace == API_TRACE_DETAILED) { Log.current.println("* writeBignum(long " + v + ")"); } // Determine the sign, transmit the opcode, and take the absolute value if (v < 0) { write(CFASL_N_BIGNUM); v = -v; ...
627e387a-94e8-4f86-be0f-69d1826aec12
3
@Test public void testGetClasses() throws Exception { PersistenceManager persist = new PersistenceManager(driver, database, login, password); persist.saveObject(new SimpleObject()); List<Class<?>> classList = persist.getClasses(); for (Class<?> c : classList) { System.out.println(NameGenerator.getSystemi...
91799081-97cf-4566-9cb3-a664c383e865
0
@Override public void documentAdded(DocumentRepositoryEvent e) {}
441c77e1-3423-46ce-bb93-b8228afb6f9e
5
public final void method79(int i, int i_13_, byte i_14_) throws Exception { if (anInt5158 == 0 || aDirectSoundBufferArray5153[i_13_] != null) throw new IllegalStateException(); int i_15_ = anInt5161 * 65536; if (aByteArrayArray5159[i_13_] == null || i_15_ != aByteArrayArray5159[i_13_].length) { aByteA...
a7626579-b448-4296-832c-ee68e316067e
9
protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) { Raster source = sources[0]; Rectangle srcRect = mapDestRect(destRect, 0); int formatTag = MediaLibAccessor.findCompatibleTag(sources,dest); ...
68fd7866-9faa-436c-981a-11e2af7abfa6
7
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj instanceof MarketClock) { MarketClock other = (MarketClock) obj; for (MarketClockField f : MarketClockField.values()) { if (this.hasField(f) == other.hasField(f) && this.hasField(f)) { this.getF...
7c027958-5ea4-46b5-bc63-190474554871
9
public static void decode(Question decodedQuestion, String encodedQuestion) throws DecodeException { if (encodedQuestion.charAt(0) == '<') { int i = 1; while (encodedQuestion.charAt(i) != '>') { i++; } if (i > 1) { decodedQuestion.s...
4fc03eb8-2026-4d66-9a9d-0b2c2318083c
9
public void analyze(BufferedReader br, BufferedWriter bw, String[] keywords, String[] actions) throws IOException{ String line; int count = 0, i = 0; String time; double start = 0, end = 0, elapse_time = 0; DecimalFormat df = new DecimalFormat("#0.000"); while((line = br.readLine())!=null && count<key...
d3f8fe25-6534-451f-9756-c811252c7617
4
public void parseAllElement(String path) throws IOException { String[] items = path.split("/"); boolean first = true; for (String item : items) { item = item.trim(); if (item.length() > 0) { if (SPECIAL.indexOf(item.charAt(0)) != -1) { ...
9eab38fd-73e3-4fc7-a5b3-e21a7188d803
5
public int init(String file) { try { FileInputStream fstream = new FileInputStream(file); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine = ""; while ((strLine = br.readLine()) != null) { if('#' == strLine.cha...
62faeaf0-3169-45d0-88a8-c62f1d90aecc
0
public void loseHealth(double damage){ monster.defend(damage); }
175a2b98-1989-4651-aa1e-a88214b35e48
6
private static void start() { BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in)); int amountOfClients = 1; boolean crashRecoveryEnabled = false; System.out.print("This is the database builder. \n\nHow many clients do you want to create (min 1, max 10)?\n-> "); try { amoun...
f88bfc63-647a-4120-8e27-5a8ce591998a
6
private void drawWalls(Graphics g) { for(int i=0; i<grid.length; i++){ for(int j=0; j<grid[0].length; j++){ if(grid[i][j].getNorth()!=null) { g.setColor(Color.decode("#CC3300"));//Brown g.drawLine(j*widthBlock+padding+doorX, i*heightBlock+padding, j*widthBlock+padding+doorWidth, i*heightBlock+padding...
d409d424-cac3-4361-a3d6-825a29dbf067
2
public void pushSolution (pgrid.service.corba.repair.RepairSolution solution) { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("pushSolution", true); pgrid.service.corba.repair.RepairSolutionHelper.write...
a36b488f-a177-475b-92e1-d503cdadec09
7
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final MOB target=this.getTarget(mob,commands,givenTarget); if(target==null) return false; if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; boolean success=proficienc...
5fbe2f3b-099f-4062-a3ac-144ca909f21a
5
public void resizeSplit(){ if(myObjects != null && this.tabbed != null){ if(myObjects.size() > 0 && this.tabbed.getTabCount() == 1){ Component cur = this.getActive(); if(cur instanceof MultiplePane){ MultiplePane mult = (MultiplePane)cur; mult.mySplit.setDividerLocation(.5); } } } }
0d3dc281-9e91-485d-803d-3b63edd10725
3
public Professor pesquisaProfessorPelaMatricula(String matricula) throws ProfessorInexistenteException { Professor professorAchado = null; for (Professor e : professores) { if (e.getMatricula().equals(matricula)) { professorAchado = e; break; } } if (professorAchado != null) { return profes...
3d68a4fa-8d4a-4880-a7bf-f0cde5abb5cb
9
public static List<News> parse(String html) { String[] newsArray = html.split("</table><div class=\"wall_post_text\">"); List<News> newsList = new LinkedList<News>(); for (int i = 1; i < newsArray.length; ++i) { System.out.println("i=" + i); String news = newsArray[i]; int divIndex = news.indexOf("</div>...
ba46a98f-fa92-4bc0-9ecd-1ac4cea4f1ee
3
public void startElement(String namespaceURI, String localName, String rawName, Attributes as) { if(Debug.debugLevel() >= 5) { Debug.println("Start of element received:", 5); Debug.println(" Namespace URI: " + namespaceURI, 5); Debug.println(" Local Name: " + localName, 5); Debug.println(" Raw Name...
1f27ace3-1815-43c2-a884-480190e3c8cc
0
@After public void tearDown() { }
314586be-4b48-4cc0-b564-d582be4a7e06
5
public String getFlush() { //if it was already computed, return result if (flush != null) { return flush; } flush = "0"; //check for flush if (cards[0].getColor() == cards[1].getColor() && cards[1].getColor() == cards[2].getColor() ...
b8c25749-1b31-4a2a-a727-2e28fc58594f
7
private static void computeSplitMap(int[] splitMBs, Configuration fConf, String jobNameDir, Boolean hasSplitFile) { if(hasSplitFile) { try { BufferedReader reader = new BufferedReader(new FileReader(jobNameDir + File.separator + "splits.txt")); String line; int splitMB; long splitByte; whi...
1891c005-f20c-4f03-a293-f84d58ae9be4
6
public int doStartTag() throws JspException { OutputStream os = null; ImageOutputStream ios = null; try { try { JspWriter out = pageContext.getOut(); if (text == null) { out.println("<b>Error: text not set"); } ServletContext application = pageContext.getServletContext(); File fileFo...
ee6d00ab-4718-4a04-a6bf-350eea22433d
9
public static void showInput() throws LWJGLException { if (Mouse.isButtonDown(0)) { int x = Mouse.getX(); int y = Mouse.getY(); int gridX = (int) (x / Main.TILE_SIZE);//TODO: take into account where we are in relation to what we are clicking. int gridY = (int) (y / Main.TILE_SIZE); Camera.x = (gridX * ...
cd856088-99fa-4228-a4f5-26d865e07819
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...
1d6a9017-380d-4982-b44a-9ff400ca5cfc
9
public static Type fromVerificationTypeInfo(StackMapTable.VerificationTypeInfo info) throws ResolveException, FormatException { switch (info.getKind()) { case TOP_VARIABLE_INFO: throw new RuntimeException(); case INTEGER_VARIABLE_INFO: return ScalarType.sc...
2f0a3e25-7626-4945-8710-6482d0483726
7
public void go() { answer = userAnswer.getText(); if(answer.equals("0")){ }else{ answer = answer.replaceAll("^0*", "").replaceAll(" ", "").toLowerCase(); } String regex = "^" + answer +".*$"; String correctAnswer = currentQuestion.getAnswer(); if(correctAnswer.matches(regex) || answer == ...
d9305e3b-4f6f-47ea-b1b8-d8cffe53d383
2
private boolean jj_3R_85() { Token xsp; while (true) { xsp = jj_scanpos; if (jj_3_21()) { jj_scanpos = xsp; break; } } return false; }
cc012f33-74d1-4226-bc0d-abd4a83cad6f
4
public void run() { String response; sTrace.debug("TCP Server Thread " + name + " is running until QUIT is received!"); try { /* Socket-Basisstreams durch spezielle Streams filtern */ inFromClient = new BufferedReader(new InputStreamReader( socket.getInputStream())); outToClient = new DataOutp...
5ed1186b-8aab-4522-9c22-df86b96940c7
4
public List<Position> getPositionsAround(Position position) { if (position == null) throw new IllegalArgumentException("Position can't be null!"); final Set<Position> positions = new HashSet<Position>(); if (validPosition(position)) positions.add(position); for (Direction move : Direction.values()) { ...
ecebc08b-6e73-452c-8e95-f8f308a32211
5
private void initFileFilter(String mode) { AnalyseFilter af; FileChooserFilter cf; chooser.resetChoosableFileFilters(); for (Iterator<FiltreASI> e = filtres.iterator(); e.hasNext();) { af = (AnalyseFilter) e.next(); if ( ( mode.equals ( Constantes.OPEN ) && af...
5229e9f8-6940-4f79-99a2-b243128fa3ca
0
public LEDStrip() { _red = new LED(6); _green = new LED(8); _blue = new LED(7); LiveWindow.addActuator("LED", "Red", _red); LiveWindow.addActuator("LED", "Green", _green); LiveWindow.addActuator("LED", "Blue", _blue); }
51833ec8-2772-4549-b2ea-28c61b96ae9c
1
public ArrayList<BESong> getAllByPlaylist(int searchWord) throws SQLException { ArrayList<BESong> result = new ArrayList<BESong>(); Statement stm = DBConnection.getConnection().createStatement(); stm.execute("select * from Song inner join PlayListSong on PlayListSong.SongID = Song.ID inner join...
71d04765-5b92-4b4b-b80e-262eb2fd7b5f
8
public static List<Element> getAllChilds(Element parent, WsdlSchema schema) { List<Element> children = new ArrayList<Element>(); if (parent != null) { NodeList nodes = parent.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node.getNodeType() == Node.ELEMEN...
8fa2e08f-cea5-4d38-aa40-97e51adfcf01
8
public void moveInwardsBy(float offset){ int type = this.getType(); if(type == TYPE_SLOPED) throw new RuntimeException("Cannot move a sloped egde inwards: "+this); float xOffset = 0; float yOffset = 0; ShapePoint middle = getMiddle(); GeneralPath path = owner.makeIntoPath(); if(type == TYPE_HORIZ...
0dd5a6ef-a9c5-48df-be13-509f5df6b17a
7
private static Map<String, CharNgramLanguageModel> getModelsFromDir(File dir, boolean compressed) throws IOException { Map<String, CharNgramLanguageModel> map = Maps.newHashMap(); if (!dir.exists()) throw new IllegalArgumentException("Training data directory does not exist:" + dir); ...
20045329-8cec-482c-a6d1-e6be5000debf
4
public static void main(String[] args) { /** * 通过一个对象获得完整的包名和类名 */ System.out.println("--------------------通过一个对象获得完整的包名和类名------------------"); Demo demo = new Demo(); System.out.println("demo.getClass().getName()---->"+demo.getClass().getName()); /** * 实例化Class类对象 */ System.out.printl...
c18c3b79-7b6f-416b-986d-36b4b2bdfb46
0
public void addInvalidComponent(JComponent c) { // do nothing }
1f8608ca-2406-4472-8122-71ed2d3b7e95
3
public final boolean updateFromNet(ProgressReporter reporter) throws ProblemsReadingDocumentException, InterruptedException { AbstractPage tempPage; try { tempPage = createSameClassPage(); } catch (Exception e) { throw new ProblemsReadingDocumentException(e); } tempPage.downloadPage(reporter); sy...
a90a54fc-c12d-45ad-92ae-d45ce1924dcf
3
private void refreshInputs() { System.out.println("Searching for input devices..."); refreshing = true; //get the available midi devices from MidiSystem synth.availableInputDevices = new ArrayList(Arrays.asList(MidiSystem.getMidiDeviceInfo())); //try to create a new transmitter ...
aef2aea3-7fd1-4020-8600-7bcb6b9bf38a
8
@Override public void run() { try { try{ String status; String commandResponse = Protocol.UP_CS_RESPONSE; String[] tokens = _message.getStrParams(); byte[] data = _message.getData(); String filename = tokens[1]; int filesize = Integer.parseInt(tokens[2]); File file = new File(LocalP...
5aa2b973-f5f2-42e8-b450-673f901733af
4
private void retireRefsetMember(RefexChronicleBI<?> memberChron) throws IOException, ContradictionException, InvalidCAB { RefexVersionBI<?> mem = memberChron.getVersion(vc); RefexCAB bp = mem.makeBlueprint(vc, IdDirective.PRESERVE, RefexDirective.INCLUDE); if (bp.getMemberUUID() == null) { bp.setMemberUuid(me...
ede132e2-ce06-41fd-8af6-b6c46cc2fd60
5
public void init(boolean flag) { int i; int a, b, c, d, e, f, g, h; a = b = c = d = e = f = g = h = RATIO; for(i = 0; i < 4; ++i) { a ^= b << 11; d += a; b += c; b ^= c >>> 2; e += b; c += d; c ^= d << 8; f += c; d += e; d ^= e >>> 16; g += d; e += f; e ^= f << 10; h +=...
1e287d3f-f0df-4d48-ac4d-da500bea5762
5
public boolean CheckForCollisionByName(String name) { //Checking for collisions with objects that have the name boolean check = false; for (int num = 0; num < game.AL_GameObjects.size(); num++) { if (game.AL_GameObjects.get(num).stringName == name && CheckForCollisionByRectangle(game.AL_GameObjects.get(...
73a070d8-eb6d-41b2-9150-4aa733fd4cad
6
public void updateClients() { SwingUtilities.invokeLater( new Runnable() { public void run() { synchronized (getClients()) { DefaultListModel listModel = view.getListModel(); listModel.clear(); i...
794696fb-91e2-4dd4-8e2e-b150cd3f4e57
5
public void processEscape() throws IOException { byte c = getByte(); switch (c) { case 'R': remoteServerOut.write((console.readLine() + "\n").getBytes()); remoteServerOut.flush(); break; case 'P': remoteServerOut.write((console.readPass...
93570f56-3cb3-4a55-bed3-377daa9fee17
1
@Override public Person addPersonFromGson(String json) { EntityManager em = emf.createEntityManager(); Person person = gson.fromJson(json, Person.class); em.getTransaction().begin(); try { em.persist(person); em.getTransaction().commit(); } catch (Exce...
0ce76d25-2592-4af6-a166-dd5f722af19d
5
final public V get(final K key) { int index = computeHash(keyData(key)) % size ; if (index < 0) index += size ; if (table[index] == null) return null ; Entry <K, V> link = table[index] ; if (link.next == null) return link.value ; for (; link != null ; link = link.next) if (equals(lin...
0d7eed0c-bf2c-4817-9acb-f555416bdc28
5
public void setNeighbors( int[] truckdrivin){ for(int g = 0; g <= truckdrivin.length-1; g++){ switch(inmode){ case 0: neighborstate[g] = 0; break; case 1: if(truckdrivin[g] > 0){neighborstate[g] = 1;} else{neighborstate[g] = 0;} break; case 2: neighborstate[g] = truckdrivin[g]; break; default:...
dbbb4ad2-078b-40c6-913d-7a20fc86da8a
9
public static void convertDataToBinary (int [][] ref_areas, String input_file_name) { Workbook wrk1; String input_file_short = input_file_name.substring(4,9); try { wrk1 = Workbook.getWorkbook(new File(input_file_name)); Sheet sheet1 = wrk1.getSheet(0); int rows=sheet1.getRows(); binary_data = new d...
5c352e8a-8334-49a3-badd-d083566d9e2c
1
@Override public void mouseDragged(MouseEvent event) { boolean wasPressed = mPressed; mPressed = isOver(event.getX(), event.getY()); if (mPressed != wasPressed) { repaint(); } }
4047c406-381d-4c75-9259-960add40b45e
5
public boolean isValidSelection(DateModel<?> model) { boolean result = true; if (model.isSelected() && after != null) { Calendar value = Calendar.getInstance(); value.set(model.getYear(), model.getMonth(), model.getDay()); value.set(Calendar.HOUR, 0); val...
e20f8344-531e-4e1a-870c-3c0501ba4ccf
4
private String createCol() { StringBuilder sb = new StringBuilder(); sb.append( "\n" ); sb.append( "<mapper namespace=\"" + table.getPackage() + ".dao." + table.getDomName() + "Dao\">\n" ); sb.append( "\n" + TAB + "<resultMap id=\"" + table.getDomName() + "Mapper\" type=\"" + table.get...
552b3084-37ce-4254-8146-d3eae3983ed8
8
protected boolean checkJump(short instruction) throws ProgramException { boolean jumpNegative = (instruction & 0x0004) > 0; boolean jumpEqual = (instruction & 0x0002) > 0; boolean jumpPositive = (instruction & 0x0001) > 0; boolean changed = false; short exp = alu.getValueAt(2); ...
8f7735d3-ee58-4958-a651-fa9124b5fe5c
6
public static Rectangle union(Rectangle first, Rectangle second) { boolean firstEmpty = first.width < 1 || first.height < 1; boolean secondEmpty = second.width < 1 || second.height < 1; if (firstEmpty && secondEmpty) { return new Rectangle(); } if (firstEmpty) { return new Rectangle(second); } if (s...
03880491-391d-4398-8d9b-9bff2803f1b1
8
@Override public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o instanceof JComboBox) { if (((JComboBox) o).equals(clasa)) { fillBoxElev(); } else if (((JComboBox) o).equals(elev)) { } } else if (o instanceof JButton) { if (((JButton) o).equals(note)) { String nume_pren...
99c55e77-a2ba-4ad6-8782-5700bb03d6db
1
public static void main(String[] args) { Properties p = System.getProperties(); Set set = p.keySet(); for(Iterator iter = set.iterator();iter.hasNext();) { String key = (String)iter.next(); String value = p.getProperty(key); System.out.println(key + "=" + value); } }
68007b01-fa8a-4e43-bc2b-e78f34a15fbc
3
public boolean formulerAccusation(Suspect meurtrier, Arme armeMeurtrier, Lieu lieuMeurtre) { Suspect suspectAccusation = null; Arme armeAccusation = null; Lieu lieuAccusation = null; // TODO Demander une accusation au joueur (lieu, arme, suspect) if (suspectAccusation.equals(meurtrier) && armeAccusation.equ...
f4482792-513c-4176-8e3b-c789801d71d8
3
public static JSONObject toJSONObject(String string) throws JSONException { String n; JSONObject o = new JSONObject(); Object v; JSONTokener x = new JSONTokener(string); o.put("name", x.nextTo('=')); x.next('='); o.put("value", x.nextTo(';')); ...
d8ad22cc-ba1e-4d88-8124-93370df6bd68
0
public SimpleStringProperty middleNameProperty() { return middleName; }
6f6c2dad-5f60-4a24-bdc4-efb4783c23db
4
public void loadAGame() { storyMode = true; // Create a file chooser JFileChooser fc = new JFileChooser(basePath); FileNameExtensionFilter sokfilter = new FileNameExtensionFilter( "Sokoban game files (*.sok)", "sok"); // set the filter to only allow sok files fc.setFileFilter(sokfilter); fc.setDialogT...
15aaed0d-033e-4225-90c8-86f4f3332a93
6
@SuppressWarnings("serial") @Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { if(tags.containsKey(qName)){ tags.put(qName, true); if(qName.equals("beginSave")){ saveV = atts.getValue("version"); patch = atts.getValue("patch"); ...
92778672-72cf-44fd-9389-a952639db2b8
7
public ClusterPair getClusterPair(HierarchGridCluster cluster1, HierarchGridCluster cluster2){ HierarchGridCluster bigCluster, smallCluster; if (cluster1.compareTo(cluster2) >= 0){ bigCluster = cluster1; smallCluster = cluster2; } else { bigCluster = cluster2; smallCluster = cluster1; } ClusterPai...
0bbaf73d-2faf-4506-bc26-599e833546a0
7
@Override public void doAction (String o) { Global.notewindow(this, "matchdialog"); if (Global.resourceString("Close").equals(o)) { setVisible(false); dispose(); } else if (Global.resourceString("Send_Command").equals(o)) { if ( !Answer.getText().equals("")) { CF.command(Answer.getText());...
9bbe22c9-534b-4f54-b145-edf9be77762a
0
public String getUrl() { return url; }
11efc8cb-0ce4-406b-88ca-6a3d961fd822
2
private String getChar_code(String str) { myDataList mytable = (myDataList) arrList.get(0); for (int i = 0; i < mytable.size(); i++) { if (((data) mytable.get(i)).getChar().equals(str)) { return (((data) mytable.get(i)).getBinary_Code()); } } retu...
c21b5f38-b3be-45d3-afdb-f6d0dc2ca47e
8
private void drawInternal(UGraphic ug, int size, final HtmlColor foregroundColor, final HtmlColor backgoundColor, double x, double y) { ug.getParam().setBackcolor(backgoundColor); ug.getParam().setColor(foregroundColor); size = ensureEven(size); switch (this) { case PACKAGE_PRIVATE_FIELD: drawTriangle(u...
5e8fd13a-fa81-4769-8e68-38d1f1be6853
9
@Test public void MultiANDTest() { int num_bits = 4; Node reg = new MultiAND(num_bits); ConstantNode in1[] = new ConstantNode[num_bits]; ConstantNode in2[] = new ConstantNode[num_bits]; for (int i = 0; i < num_bits; i++) { in1[i] = new ConstantNode(true); in1[i].connectDst(0, reg, i); in2[i] = new C...
6b6303f4-a8e1-4f5b-901d-f995017feef6
0
public String getName(){ return args[0] = Character.toUpperCase(args[0].charAt(0)) + args[0].substring(1); }
8f6b9de6-1fef-48c2-8e51-ba28e095fffc
0
@MyTarget("targetTest") public void target() { System.out.println("This is Target Test!"); }
91462bfe-b424-4efd-9d4e-d8824990cfb7
7
public void fillTable(List<String> headers, List<String[]> content){ for (int i = 0; i < headers.size(); i++) { final TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.LEFT); column.getColumn().setText(headers.get(i)); column.getColumn().setWidth(200); column.getColumn().setResiza...
5e16c48e-53f0-4a32-b099-3dd8aa9a154b
7
public static CoordinateMatrix plane( Coordinate p, Coordinate d1, Double uStart, Double uEnd, Double uStep, Coordinate d2, Double vStart, Double vEnd, Double vStep) throws LengthException { assert uEnd > uStart; assert vEnd > vStart; assert uSt...
ab5e9dee-b250-435c-b35c-3600cd896a35
7
@Override public void run() { try { String s; RequestHandler requester = new RequestHandler(conf); while((s = in.readLine()) != null) { if(s.isEmpty()) break; requester.read(s); } requester.handl...
ea4d669c-e6d0-4196-abf8-52a8449c4be4
9
public boolean pointIsOnArc(final Point point) { if (getStartPoint().equals(point) || getEndPoint().equals(point)) { return true; } double difference = Math.abs(getCircle().getCenter().distanceSq(point) - Math.pow(getCircle().getRadius(), 2.0)); if (difference <= 0.5) { double ah = Math.abs(point.getX() -...
04dfb8a0-c592-435e-b6c5-65413f0765cf
7
@Override public void yourMove (boolean notinpos) { if (Dis == null || !Dis.started()) return; if (notinpos) { if (Dis.wantsmove()) JagoSound.play("yourmove", "stone", true); else JagoSound.play("stone", "click", false); } else if (Global.getParameter("sound.everymove", true)) JagoSound.play("s...
da96d309-4814-4bcb-b9fc-6dc89532666d
5
private boolean isPlayerKingInCheckFromPieceVerticallyUp() { for (int i=playerKingPiece.pieceLine+1; i<=8; i++){ BoardSquare boardSquare = chessBoard.getBoardSquare(i, playerKingPiece.pieceColumn); if (boardSquare.containsBoardPiece()){ if (i==playerKingPiece.pieceLine+1){ if (boardSquare.containsOppon...
9bc0370d-c099-4dcf-9b56-f033b232dbc8
5
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed try { JFileChooser choose = new JFileChooser(); choose.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); FileNameExtensionFilter filtre = new FileNameExtensionFi...
0f7375fb-cc36-4256-98ef-6e838ac87f55
6
@Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof ByteString)) { return false; } if (size() != ((ByteString) other).size()) { return false; } if (size() == 0) { return true; } if (other instanceof Li...
ef44850f-8dde-4661-beaa-c3d1a852c257
6
@Override public boolean isReady() { for (Node n : opNOPs) if (!n.isReady()) return false; for (Node n : inNOPs_A) if (!n.isReady()) return false; for (Node n : inNOPs_B) if (!n.isReady()) return false; return clock.isReady(); }
46892222-8f75-48b7-a591-3e6c597b10e3
2
@Override public String toString() { if (isInteger) { return "#" + intOperand; //Return int as String } if (isFloatingPoint) { return floatingPointOperand + ""; } return null; }
8ddf0ff6-c268-42e9-84bb-9c5432a2726a
1
public CheckedFrequencyTable(FrequencyTable freq) { if (freq == null) throw new NullPointerException(); freqTable = freq; }
2abb4bbf-bc38-4b21-b9d3-d09fb0170230
6
public Image getImage() { if (type == 1) return Assets.FENCE; else if (type == 2) return Assets.TORCH; else if (type == 3) return Assets.ROCK; else if (type == 4) return Assets.FENCE; else if (type == 5) return Assets.KEY; else if (type == 6) return Assets.DOOR; else return Assets.TIL...
1d11887a-ebcd-4d22-9250-401b166273a0
7
@Override public boolean checkSearchObject(Field t) { if (getSearchingClass() == Drunkard.class) { return !t.isEmpty() && t.isLighted() && t.getGameObject() instanceof Drunkard && (((Drunkard) t.getGameObject()).isLaying() || ((Drunkard) t.getGameObject()).isSleeping()); ...
ca29c65a-a2e4-40eb-a2d7-1f043536abd9
0
public void setNumero_rap(String string) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
7ca5ca7b-793c-49ce-bda2-0b1d4c09c092
1
public static void main(String[] args) { // 下面是需要解析的xml字符串例子 String xmlString = "<html>" +"<head>" +"<title>domj解析一个例子</title>" + "<script>" + "<username>yangrong</username>" + "<password>123456</password>" + "</script>" + "</head>" + "<body>" ...
1161611c-2964-4858-b08f-9dd2a011455a
2
@Override public FactoryExecute execute() throws Exception { /* 1. dto를 설정했는지 체크 2. 파일이 실제 있는것인지 체크 */ if(filedto == null){ throw new SetNOtResourceInfoException(); } String path = filedto.getUri().getPath(); if(new File(path).isF...
5a6531a9-17f9-4dd3-ae90-deac6cf7a395
5
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((gainAlbum_dB == null) ? 0 : gainAlbum_dB.hashCode()); result = prime * result + ((gainReference_dB == null) ? 0 : gainReference_dB.hashCode()); result = prime * result + ((gainTrack_dB == null)...
92b5b23c-cc97-4ad7-81af-50dda406683d
7
public boolean isLegal(IMove iMove) { if (isGameOver()) return false; if (iMove instanceof Move) { Move move = (Move)iMove; Piece startPiece = getPiece(move.getStart()); if (startPiece.isNone()) return false; else if (currentTurnColor != null && startPiece.getColor() != currentTurnColor) retu...
65baf332-9ec1-4bc4-ab79-4616cb65ec2f
2
public boolean deletePatient(Patient patient) { if (this.nextPatient == null) { return false; } else if (this.nextPatient.name.equals(patient.name)) { this.nextPatient = nextPatient.nextPatient; return true; } else { return this.nextPatient.deletePatient(patient); } }
fd368367-7d69-4273-a32c-c80eef6ffa6f
0
public String getReplace(int i) { return (String) this.replaces.get(i); }
c3674ad7-966b-41f2-9c56-f59d132a7f26
6
public List<Recurso> buscarRecurso(String descricao){ List<Recurso> retorno = new ArrayList<Recurso>(); if(descricao.equals("") || descricao == null) for (TipoRecurso tipoRec : depto.listarTipoRecurso(new TipoRecurso(null))) { retorno.addAll(tipoRec.listarRecursos()); } else{ for (TipoRecurso tipoRec...