method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
542439c2-2eb7-4a82-96fa-2703aca1e5bd
7
private boolean setCategory(int index) { final String currentCategory = getCategory(); final String[] categorys = getCategorys(); if (categorys.length > index) { final String target = categorys[index]; if (currentCategory.equalsIgnoreCase(target)) { return true; } Component child = ctx.widgets.c...
1dcf2307-5088-435c-a464-f9b561709423
9
@Override protected void parseSelf(Document doc) throws ProblemsReadingDocumentException { List<Element> scriptList = queryXPathList(SCRIPT_DESC_XPATH, doc); for (Element el: scriptList) { String rawData = el.getText(); // clear JavaScript escaping: "\/" --> "/", etc. rawData = rawData.replaceAll("\\...
7d664db7-9d98-4d01-9d49-88e8243cf310
1
public Matrix[] invPsvd () { Matrix[] residueMat = residue.getMatrix(); Matrix[] diagMat = diag.getMatrix(); Matrix[] decStackedToOneColMat = new Matrix[3]; decStackedToOneColMat[0] = reshapedProductUVBaseMat[0].times(diagMat[0]).plus(residueMat[0]).timesEquals(255.0); if (codeC...
8c7665a5-3064-4dd3-a76d-400ec3da0229
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...
82fccda4-35df-4ec3-9616-3cb795e2dda4
4
private boolean AddIncomingTab(InetAddress ip) { LinkedList<User> clients = this.client.getUsers(); for (User user : clients) { if (user.getIP().equals(ip)) { if (nextKeyEvents > (keyEvents.length - 1)) { new Popup( user.getName() + " tried to start a private chat with you. However you r...
b1382c65-0c9e-44d5-883d-ecb47e0888d7
7
@Override public void executeMsg(final Environmental myHost, final CMMsg msg) { super.executeMsg(myHost,msg); if((affected!=null) &&(affected instanceof MOB) &&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker())) &&(msg.sourceMinor()==CMMsg.TYP_QUIT)) { ...
f8fc90ac-0268-4c87-afa3-8632e6b01302
8
public MainToolBar() { // Format those buttons to look natural (no background, border, etc) upButton.setMargin(new Insets(0, 0, 0, 0)); upButton.setBorder(null); upButton.setOpaque(false); upButton.setContentAreaFilled(false); upButton.setBorderPainted(false); upButton.setEnabled(false); upButton.setFo...
991dbe7a-4661-4b39-9ac8-6d17f2eee0d3
6
public BTnode postOrderTraversal(BTnode root) { BTnode left, right; if(root == null) return null; if(root.left == null && root.right == null) return root; left = postOrderTraversal(root.left); right = postOrderTraversal(root.right); //if(right != null) //{ //for(;right.left != n...
783b1990-b975-4eb6-8d1b-912c97e98191
1
public BufferedImage loadImage(String fnm) { BufferedImage im = null; try { im = ImageIO.read(ImageLoader.class.getResource(fnm)); } catch (IOException e) { //System.out.println("Load Image error for " + fnm + ":\n" + e); } return im; }
ccf6447d-9d53-45c3-92f9-6e89404e4192
1
@Override public void init(ServletConfig config) throws ServletException { ServletContext sc = config.getServletContext(); String log4jLocation = config.getInitParameter("log4j-properties-location"); File propFile = new File(sc.getRealPath("/") + log4jLocation); if (propFile.exists()...
cdb6d569-965f-41b9-9662-ae16ac331b80
5
private void createT(String in1, String out) { TFlipFlop t = new TFlipFlop(); // Connect the first input // Check if the in wire is an input if (stringToInput.containsKey(in1)) { Wire inWire = new Wire(); stringToInput.get(in1).connectOutput(inWire); t.connectInput(inWire); } // Check if the in...
5229ebe3-b4d4-4cd1-8532-037ba58e9b71
0
void swap(ArrayList<Item> al,int item1, int item2) { Item temp = al.get(item1); al.set(item1, al.get(item2)); al.set(item2, temp); }
bf5db85f-62dd-49ff-b7e8-c2cde62eb743
1
private JLabel getJLabel0() { if (jLabel0 == null) { jLabel0 = new JLabel(); jLabel0.setText("DATABASE TOOL"); } return jLabel0; }
e0cd73a9-34dc-40c4-893e-ba2113095241
1
private void openServerSocket() { try { this.serverSocket = new ServerSocket(this.serverPort, 0, address); isRunning = true; } catch (IOException e) { isRunning = false; this.serverSocket = null; isStopped = true; Setup.println("[Fo...
4c397e53-bc0c-457c-b791-2d2e255e1aa2
4
public static void printObjectType(Object o) { if (o instanceof Cat) { System.out.println("Кошка"); } else if (o instanceof Dog) { System.out.println("Собака"); } else if (o instanceof Bird) { System.out.println("Птица"); } ...
332aea4a-fec9-4515-ab37-e57ad189b0d1
0
public void setTwitterModel(TwitterModel twitterModel) { this.twitterModel = twitterModel; }
98db98d8-ce93-41d3-88fc-288ff4e8cc8b
3
public boolean stopTransaction() throws DatabaseManagerException { if( inTransaction ) { if( conn == null ) { throw new IllegalStateException("Connection closed!"); } try { conn.setAutoCommit(originalCommit); inTransaction = false; } catch(SQLException e) { throw new DatabaseManagerExcept...
afa7124d-77b8-4cf1-b175-560fdcd1a593
0
public Map<String, SubCommand> getCommandList() { return commands; }
b7d97fc1-cdbf-4385-9bcb-b811c2f1a26e
3
public static int maxPathSum(TreeNode root) { if (null == root) return 0; List<Integer> max = new ArrayList<Integer>(); maxSinglePathSum(root, max); int res = root.val; for (Integer i : max) { if (i > res) res = i; } return res; }
7cefe386-cff6-4303-aaa1-aaeac0ffbc4a
9
private final String lock2key(String lock) { String key_return; int len = lock.length(); char[] key = new char[len]; for (int i = 1; i < len; i++) key[i] = (char) (lock.charAt(i) ^ lock.charAt(i - 1)); key[0] = (char) (lock.charAt(0) ^ lock.charAt(len - 1) ^ lock.charAt(len - 2) ^ 5); for (int i = 0; i <...
0f5c40dc-8e89-4bd8-b782-c528eff2e8ee
3
private String printTree(ClassifierTreeNode parent) { String line = "\n|"; for (int i = 0; i < parent.getLevel(); i++) { line += "-"; } line += parent.getFeature().getName(); if (!parent.getChildren().isEmpty()) { for (ClassifierTreeNode node : parent.getC...
62d6a748-3d61-4b3b-bd3e-858285fdb2d0
3
public Nodo getObjetivo() { ArrayList<Nodo> nodos = estado.getAdyacentes(estado.getActual()); int max = 0; Nodo dest = null; for (Nodo n : nodos) { if (max < memoria.getNode(n.id).score) { max = (int) memoria.getNode(n.id).score; dest = n; } } if (dest == null) {// No deberia hacerse esto, pe...
789d5e16-d692-406d-8b77-e388a6b19803
5
public String addBinary(String a, String b) { StringBuilder builder = new StringBuilder(); int ia = a.length() - 1; int ib = b.length() - 1; int carry = 0; while (ia >= 0 || ib >= 0) { int d1, d2; if (ia >= 0) { d1 = a.charAt(ia) - '0'; ...
15de86b2-7e22-4e3c-856e-ad53817df63f
9
public void paint(Graphics g) { if (g == null) return; if (image == null) { image = canvas.createImage(IMG_TOTWIDTH, IMG_TOTHEIGHT); g2 = image.getGraphics(); g2.setFont(new Font("Monospaced", Font.PLAIN, 11)); } if (crtImage == null) { crtImage = new BufferedImage(displa...
f03a1927-999c-4a6e-80ca-f83917a3d562
4
public Line(String type, Level l) { this.level = l; this.line = type; if (line.contains("|")) { String connect = line.split("\\|")[1]; String[] parameter = connect.split(","); if (parameter[0].equals("ACTIVATE")) { level.connect(parameter[1]).active = false; } } try { TextureImpl.unbind(); ...
98ae4713-877c-4ac8-8b8d-6b03e2321b88
7
AES256v2HeaderData(byte[] data) throws InvalidDataException { Validate.notNull(data, "Data cannot be null."); // Need the header to be able to determine the length if (data.length < AES256v3Ciphertext.HEADER_SIZE) { throw new InvalidDataException("Not enough data to read header."); } int ind...
c7c01e1f-9d59-4eb5-9559-db7740d78ad2
4
public static <R> ImmutableGrid<R> copyOfDeriveCounts(Iterable<? extends Cell<R>> cells) { if (cells == null) { throw new IllegalArgumentException("Cells must not be null"); } if (cells.iterator().hasNext() == false) { return new EmptyGrid<R>(); } int rowC...
8c8768ff-8376-42ff-b265-edb39b27aaa5
4
public void setName(String name) { if(!name.equals("") || name != null) { synchronized (Person.class) { if (!name.equals("") || name != null) { this.name = name; System.out.println(name); } } } }
07860583-3cb3-4a4d-b2df-cc3048acc690
2
public long getLong(String key) throws JSONException { Object object = this.get(key); try { return object instanceof Number ? ((Number)object).longValue() : Long.parseLong((String)object); } catch (Exception e) { throw new JSONException("JS...
15a3f030-e49c-47d9-a692-93dd65f99972
5
private static Number appropriateParseFor(String text, Class<? extends Number> numberFormat) throws NumberFormatException { if(numberFormat == Long.class){ return Long.parseLong(text); } else if(numberFormat == Integer.class){ return Integer.parseInt(text); } ...
b03b3f23-c844-43e1-a5b5-24453935d8f1
8
@Override public Parameter getParameter(final int parameterIndex) { Parameter parameter; switch (parameterIndex) { case 0: case 1: parameter = super.getParameter(parameterIndex); break; case 2: parameter = rate; ...
1f381d6d-a86f-497f-889c-3cd125778296
7
private void followingItem(T infix, int degree) throws ShouldNotBeHereException, BadNextValueException { switch(degree) { case 0: if(((String)infix).matches(OPERAND) || ((String)infix).matches(PARA1)) // no number or parenthesis {throw new BadNextValueException("Opening parenthesis or number following ...
591ffc1b-9145-4e62-ad42-2ccea57dc466
1
protected void setSingleReachable() { if (getParent() != null) getParent().setReachable(); }
4775b8fe-0f70-4fe5-b563-d0a85687565e
1
public String toString() { if (uninitialized()) { return "NO SUCH ROUTE"; } return Integer.toString(length); }
9b513405-1c28-4be5-9e4b-17d7ac203beb
5
private void handleUpdate() { // We can simplify this when we move more methods into the Preference Interface. if (pref instanceof PreferenceHashMap) { // Update pref PreferenceHashMap prefHashMap = (PreferenceHashMap) pref; DefaultTableModel model = (DefaultTableModel) table.getModel(); HashMap...
6ca229b2-f2ad-4115-a754-8b9e924d99a1
0
public static String js(){ return "<script type=\"text/javascript\">\n" + "\n" + " $(document).ready(function() {\n" + " $('table')\n" + " .bind('filterEnd', function () {\n" + " var f = $.tablesorter.getFilters( $(this)...
59fa9f97-a82a-4f5d-a2ca-3d11efbb6cb7
7
int getPositive(int i){ int octaveOffset = i/ Constants.NOTES_IN_SCALE; int mod = i% Constants.NOTES_IN_SCALE; int noteOffset = 0; if(mod > 0){ switch(mod){ case 6: noteOffset += steps[5]; case 5: noteOffset += steps[4]; case 4...
dbfa6e6d-c7b3-453d-9ccb-a4ccb3642c7d
5
private long removeRefAskData(long lIndex) { // // loop through the elements in the actual container, in order to find the one // at lIndex. Once it is found, then loop through the reference list and remove // the corresponding reference for that element. // AskData refActualElement = GetAskData(lIndex); if (r...
c8ce9275-8393-4a3c-9110-9fa7df2d8f82
5
public void sort(int [] intArray,int sequenceflag){ System.out.println("您调用的是选择排序算法"); int flag=0; int max=intArray[0]; long startTime=System.nanoTime(); for(int i=intArray.length-1;i>0;i--) { //寻找最值放在最后 for(int j=0;j<i;j++){ if(intArray[j] > max) { max=intArray[j]; flag=j; } ...
53bce10c-d73f-4593-8aff-e9a6c2238333
4
private List<Integer> quicksort(List<Integer> input) { if(input.size() <= 1) { return input; } int middle = (int) Math.ceil((double)input.size() / 2); int pivot = input.get(middle); List<Integer> less = new ArrayList<Integer>(); List<Integer> greater = new ArrayList<Integer>(); for (int i = 0; i...
6229a0e4-4a49-4211-88bd-4b22d1f85a0a
0
public int[][] getBlockSheet() { return blockSheet; }
5b0236dd-71f1-4651-af6f-db0dceb16206
2
String represent(String s) { if (s.length() == 1) return s; String s1 = represent(s.substring(0, s.length() / 2)); String s2 = represent(s.substring(s.length() / 2 + 1)); if (s1.compareTo(s2) > 0) return s2 + s1; return s1 + s2; }
fbe712be-9e6e-4256-bb73-81ddbfa91dad
1
public boolean canHaveAsCreditLimit(BigInteger creditLimit) { return (creditLimit != null) && (creditLimit.compareTo(BigInteger.ZERO) <= 0); }
a99dd0e0-b8c1-4d19-9a16-f4b802153540
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...
4f0ff9a6-ea16-4768-8fe4-4adf343a9261
9
private BigInteger findFactor(){ BigInteger sq = BigInteger.ONE.add(BigInteger.ONE); while(!limit.mod(sq).equals(BigInteger.ZERO) && (sq.compareTo(limit)<=0)){ sq = sq.add(BigInteger.ONE); } System.out.println("Found 1st factor "+sq); if (sq.compareTo(limit)>0) return sq; BigInteger lq = limit.di...
32e3706b-f375-4e88-82c3-29c2a8756f5c
6
private void checkForErrors() { // Retrieve the type of error from OpenGL. int error = glGetError(); switch (error) { case GL_NO_ERROR: break; case GL_INVALID_ENUM: gameWorld.error(RenderingSystem.class, "OpenGL error: GL_INVALID_ENUM"); ...
5b90546c-36ea-4113-8e67-57b598a0bfcd
0
@Test public void testPlus(){ //ReversePolishNotationCalculator calculator = new ReversePolishNotationCalculator(); calculator.pushOperand(3.0); calculator.pushOperand(2); System.out.println(calculator.operandsToString()); calculator.pushPlusOperator(); System.out.println(calculator.operatorsToString())...
54a089df-24cc-4cab-a288-696a13325bd9
0
@Basic @Column(name = "FES_USUARIO") public String getFesUsuario() { return fesUsuario; }
8b67efad-ba10-4f1b-bd60-3d100afd4950
2
public int getNextBlock() { for(int i = 0; i < this.blocks.length; i++){ if(blocks[i] == null) return i; } return -1; }
5cab4ffe-e118-47d1-8ba2-d266c1a146c2
9
private boolean addGroupsFrame(){ boolean ret = false; try { // Создадим поле ввода JTextField num = new JTextField(); // загрузим данные для комбобокса Faculty[] facultys = ua.edu.odeku.pet.database.data.GetDataTable.getFacultys(); // создадим...
efa56b81-2801-4d55-bc06-c4dad5e24d16
3
public RseqVNode(AbsValueNode n1, AbsValueNode n2, AbsValueNode n3, int line) { super(line); if (n1 != null && n2 != null && n3 != null) setChildren(n1, n2, n3); }
45c7d4a1-9ab4-4ca1-a606-43491e84e202
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 Sale)) { return false; } Sale other = (Sale) object; if ((this.id == null && other.id != null) || (this.id != n...
7ce67327-7f57-4a2c-a119-9d083c734e2b
3
private synchronized void sendInfoPacket(Sim_event ev) { IO_data data = (IO_data) ev.get_data(); Object obj = data.getData(); // gets all the relevant info long size = data.getByteSize(); int destId = data.getDestID(); int netServiceType = data.getNetServiceLevel(); ...
332798af-184e-407e-ab3b-d0496ddca40a
2
@Override public boolean validaEscalao(int anoNascimento, int epoca) { if ((epoca-anoNascimento) ==14 || (epoca-anoNascimento) == 15) return true; else return false; }
07c9969e-e736-4819-bdd7-fb7fee18225d
4
private void fillTechnicalData(float[][] dailyData, float[] rawData) { // construct technical data // 82 - 171 // 82 = month // 83 = day // 84 = year // 85-90 = 6 daily data points // repeats 10 times // System.out.println(" -------------- --------------------- -----"); for (int x ...
62546d6f-7a9f-44aa-9ab3-d0707fd949b9
0
public void appendBall(Ball ball) { balls.add(ball); }
096b8228-f076-4109-8189-484fea32ee33
4
public void printVlootStatus(Board board) { StringBuffer sunken = new StringBuffer(); StringBuffer notSunken = new StringBuffer(); for (Boat b : fleet) { if (b.getSunken(board)) { sunken.append(b.toString() + "\n"); } else { notSunken.append(b.toString() + "\n"); } } if (!notSunken.toSt...
ce4caea1-2254-45fc-8b6f-3a60ad112a56
0
public New(){ //create a ProcessList or queue }
b0162b86-1134-4f4c-babe-13a7fe04c263
4
private byte[][] GenerateCollisionMap(boolean[][]Map) { byte[][] CollisionMap = new byte[this.GrabModel().MapSizeX][this.GrabModel().MapSizeY]; for(int x = 0; x < this.GrabModel().MapSizeX; x++) //Loopception courtesy of Cobe & Cecer { for(int y = 0; y < this.GrabModel().MapSizeY; y++) { if (FurniC...
9e88fe35-b144-4317-85e0-36bcaf7e6672
8
public void printMaxMin() throws Exception { if (inFile==null) throw new Exception("bad"); String sBuf=inFile.readLine(); int iNum=Integer.valueOf(sBuf); System.out.println("number of members: " + iNum); HashMap<String, Integer> map=new HashMap<String, Integer>(iNum); while (true) { try { // read ...
bfb1e036-2ec4-4d32-8b30-1a2f232c65c1
0
public EditWindow(Box box) { Font used = new Font ("Segoe UI", Font.PLAIN, 20); Font other = new Font ("Segoe UI", Font.PLAIN, 14); JPanel content = new JPanel (new GridBagLayout());//panel to display the information GridBagConstraints c = new GridBagConstraints();//layout Box b = box; d = b.getDayStored()...
df5840ed-58bc-4811-bf06-d61840d42b01
9
public static AHCGraph getGraphFromImageCSVFile(String path){ AHCGraph graph = null; BufferedReader br = null; String line = ""; String cvsSplitBy = ","; double max = -1000; try { br = new BufferedReader(new FileReader(path)); int rowNum = 0; boolean isFirst = true; while ((line = br.readLine()) != null...
6bc649b9-bf09-471a-8e79-080674013f5c
7
private static void writeWatchableObject(DataOutputStream par0DataOutputStream, WatchableObject par1WatchableObject) throws IOException { int i = (par1WatchableObject.getObjectType() << 5 | par1WatchableObject.getDataValueId() & 0x1f) & 0xff; par0DataOutputStream.writeByte(i); switch (par1W...
6252ea00-155d-45f2-b7d2-ad2531933891
5
public boolean merge(Frame frame) { boolean changed = false; // Local variable table for (int i = 0; i < locals.length; i++) { if (locals[i] != null) { Type prev = locals[i]; Type merged = prev.merge(frame.locals[i]); // always replace...
5e7f0806-f656-4ab6-8982-b5a66e6e2d78
2
public boolean ignoreMethod(final MemberRef method) { if (ignoreMethods.contains(method)) { return (true); } else if (ignoreClass(method.declaringClass())) { addIgnoreMethod(method); return (true); } return (false); }
b159d577-2d74-4b7a-8ab4-0062000ca843
2
private int defense(State s){ int def = 10; int natk = 0; State ns; MyList moves = s.findMoves(); Iterator it = moves.iterator(); Move m;// = (Move) it.next(); //ns = s.tryMove((Move) m); //natk = attack(ns, s); while (it.hasNext()){ m = (Move) it.next(); ns =...
409e6725-4cf7-4406-9a9c-54731e143703
9
@Test public void testEqualsAndHashCode() { final List<Node> nodes = new ArrayList<Node>(); final DCRGraph graph = new DCRGraph(); final Random random = new Random(); for (int i = 0; i < 10; ++i) { final Node node = new Node(); node.setGtCluster(new OrdinaryCluster(graph, random.nextDouble())); nod...
9aa24152-d116-45a9-992f-b7f654df0c25
5
@Override public void handleIt(Object... args) { while (!authentication) { Scanner input = new Scanner(System.in); // Getting authentication information from user System.out.print("Please enter your username: "); userName = input.next(); System.out.print("Please enter your password: "); userPass...
e4c893e2-d657-4db0-91e4-35b2347035f8
5
@Override public void ejecutar(Stack<Valor> st, MemoriaDatos md, Cp cp) throws Exception { if (st.size() < 2) throw new Exception("IGUAL: faltan operandos"); Valor op1 = st.pop(); Valor op2 = st.pop(); if (op1 instanceof Booleano && op2 instanceof Booleano) { st.push(new Booleano(((boolean) op1.get...
4833dfc5-8ea3-44cd-a579-9634631bbc2d
6
private void shift(int delta) { double[] old = new double[values.length]; System.arraycopy(values, 0, old, 0, values.length); int oldIndex = delta; for (int i = 0; i < values.length; i ++) { if (oldIndex >= 0 && oldIndex < values.length) { values[i] = old[oldIndex]; } oldIndex ++; } i...
d8c920d1-9232-4885-a2aa-5325a5b79bb9
5
public City getCityAt(Position p) { if ( p.getRow() == 1 && p.getColumn() == 1 ) { return new City() { public Player getOwner() { return Player.RED; } public int getSize() { return 1; } public String getProduction() {return null;} public String getWorkforceFocus() {return null;} public int getP...
79d89424-7417-4477-ae08-d2d2a2f49add
4
@Override public int hashCode() { int hash = 0; hash += (name != null ? name.hashCode() : 0) + (releaseForm != null ? releaseForm.hashCode() : 0) + (ages != null ? ages.hashCode() : 0) + (quantityPerPack != null ? quantityPerPack.hashCode() : 0); ...
c4332800-32f3-4b61-9fd3-d78a1fb53a61
1
@Override public void render(GameContainer gc, Graphics g) { // TODO Auto-generated method stub if(isHealthy) { //g.drawString("Rendering " + facing + " - " + position.getX() + ", " + position.getY(), 10, 60); _animation[facing].draw(position.getX(), position.getY()); } }
10c19710-ac68-4702-91c3-c5e50bb6e11c
3
public void createPiece (Piece _piece, int n){ Vecteur<Integer> points[] = _piece.getForme().getPoints(); for (int i = n*4; i<n*4+4;i++){ for (int j=0; j<4;j++){ this.setValueAt(new ImageIcon (getClass().getResource("/images/Frames/vide.png")), i, j); } } ...
6d7acb94-f731-40f4-9ddb-e6910acad767
0
public Priority(){}
3bd5c6bd-70b6-403e-8684-4af19644a384
7
public void inserir(Cliente c) { Statement st; Connection con; try { Class.forName("org.postgresql.Driver"); } catch (ClassNotFoundException ex) { Logger.getLogger(JanelaLogin.class.getName()).log(Level.SEVERE, null, ex); } try { con = ...
88446f7f-4f82-4bfe-9362-0a8b6687071b
9
public void CreateDirectory(Message message, int opID) { String filepath = message.filePath; System.out.println("Trying to create file path: "+ message.filePath); if (!NamespaceMap.containsKey(filepath)) { // directory doesn't exist if(AddExclusiveParentLocks(filepath, opID)) { File path = new File(file...
8493eedd-f1fc-4ec8-b11d-b63a1695a9c9
5
private void updateBuyOption() { if(model.getBuyOptionState() == Model.BuyOptionState.DEACTIVATED) { buyOption.setEnabled(false); } else { buyOption.setEnabled(true); } switch(model.getBuyOptionState()) { case PURCHASABLE: buyOptionText = "Feld kaufen (" + model.getPurchasablePrice() + ")"; br...
0a5452de-57cd-4487-bc20-ff007d5fbd58
8
private void initPageAnnotations() throws InterruptedException { // find annotations in main library for our pages dictionary Object annots = library.getObject(entries, ANNOTS_KEY.getName()); if (annots != null && annots instanceof Vector) { Vector v = (Vector) annots; an...
57e7b573-9bd5-46a2-98a8-41b96816a8ca
3
public int get(int key){ LinkedNode root = this; if(root == null){ return -1; } while(root!=null){ if(root.getKey() == key){ return root.getValue(); } root = root.getNext(); } return -1; }
95541798-5857-4d92-837f-0a3c07840b48
1
public CommandGroup getCurrentGroup() { return activeChild == null ? this : activeChild.getCurrentGroup(); }
7357d3f2-12da-4e1e-b4db-2452f6762287
7
public int rootState_dispatchEvent(short id) { int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED; switch (rootState_active) { case EmergencyStopped: { res = EmergencyStopped_takeEvent(id); } break; ...
7a0d23c2-abe3-4fbc-9689-a549fd0f533c
0
public void setCantCompany(int cantCompany) { CantCompany = cantCompany; }
31d71d6d-2bbf-4547-9c10-87ed43df8bf6
8
public boolean stateEquals(Object o) { if (o==this) return true; if (o == null || !(o instanceof MersenneTwister)) return false; MersenneTwister other = (MersenneTwister) o; if (mti != other.mti) return false; for(int x=0;x<mag01.length;x++) if (ma...
98a7307f-0abe-47f2-861b-68c84982749c
7
public final void method70(int i, int i_42_, byte i_43_, int i_44_, int i_45_, int i_46_, int i_47_, byte[] is, Class304 class304) { try { ((Class14) this).aClass377_5082.method3850((byte) -39, this); anInt8647++; if ((i_44_ ^ 0xffffffff) == -1) i_44_ = i_46_; OpenGL.glPixelSt...
595b30d2-fb6e-4fae-9bfa-835d906f9c57
4
public Boolean produceFrom(ResultSet result) throws SQLException { String s = result.getString(1); if (s.equalsIgnoreCase(T)) return true; if (s.equalsIgnoreCase(F)) return false; int i = result.getInt(1); if (i == 1) return true; if (i == 0) retur...
c0f5a5ea-5701-4824-bcc7-df51e2c5b18e
8
@Override public Void doInBackground() throws Exception { for (Hero h : lcm.heroes) { if (jpegMode) lcm.exportHeroToJpeg(h, folder); else lcm.exportHeroToPng(h, folder); frame.setTitle("Exporting (" + (getCurrentValue()+1) + "/" + ...
4470fb20-0aa1-410d-81e5-1fd6fb3d5257
8
public static void kMeansClustering(int k,List<Vector> dataset){ Cluster[] clusters = new Cluster[k]; Collections.shuffle(dataset); for(int i = 0;i<k;i++){ Vector randomVector = dataset.get(i); clusters[i] = new Cluster(randomVector); clusters[i].addVector(randomVector); } DistanceMeasure dm = new ...
34c546d6-5a04-4083-b499-e2a54c8b1782
5
public Clip loadSound(String fileName) { Clip clip = null; URL url; // file directory relative to the file structure of the class url = frame.getClass().getResource(fileName); System.out.println(url); AudioInputStream audioIn = null; try { audioIn = A...
05142c75-8c56-4cd6-a777-fa665f88abd8
6
public void addTime(String showName, String dei, String roomName, Time time){ Days day = Days.valueOf(dei); int d = day.ordinal(); for (Show show : days[d].getShows()) { //iter the show array if (!show.getName().equals(showName)){ //see if there is a show with tha correct name ...
a517b70f-7afa-43bf-9195-f1be28187d4c
1
void overzicht() { for(int i = 0; i < kamer.length; i++) { System.out.println("Kamer " + kamer[i].kamernummer + ": " + kamer[i].voornaam + " " + kamer[i].achternaam); } System.out.println(""); }
38a68110-3f16-4673-af3d-b06f7a801149
4
public static String doEntityReference (String text) { StringBuffer result = new StringBuffer(); for (int i = 0; i < text.length(); i++) { char ch = text.charAt(i); if (ch == '<') result.append("&lt;"); else if (ch == '&') result.append...
252fcf07-070c-4b44-bcec-71b7e6ae300c
0
@BeforeClass public static void setUpClass() throws Exception { ctx = new AnnotationConfigApplicationContext(ConnectionConfig.class); }
fe622cd6-8ef0-490f-9b68-08c6f7f537c2
5
@EventHandler(priority = EventPriority.LOWEST) public void onPlayerInteract(PlayerInteractEvent event) { if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) { if (event.getMaterial() == Material.ENDER_PEARL) { if (plugin.isInCombat(event.getPlayer().getUniqueId())...
8c7eaff2-ebac-45e3-8333-ede018041298
7
public final void addRow(String row) { if (rowCount < dimension && row.length() == dimension) { char[] values = row.toCharArray(); Entry[] tempRow = new Entry[dimension]; int tCountTemp = tCount; boolean containsEmpty = false; for (int i = 0; i < dimen...
714a0e18-f926-4518-bdea-3d2e92597617
8
@Override public FileInfo getAttr(String server, String user, String dir) throws ServerOfflineException, NoPermissionsException, NoSuchFileException, NoSuchPathException { String path = Domains.parsePath(dir); if (server == null) { FileInfo fi = this.fileSystem.getAttr(path); if (fi != null) { ret...
9e298fcf-2404-4aa2-bcae-12dc2b91242f
4
@Override public boolean select (Viewer viewer, Object parentElement, Object element) { if (searchString == null || searchString.length() == 0) { return true; } // loop on all column of the current row to find matches CSVRow row = (CSVRow) element; for (String s...
83cb2dd0-2c59-44ee-b90b-b6ea11a41492
1
@Override public void changedMostRecentDocumentTouched(DocumentRepositoryEvent e) { if (e.getDocument() == null) { setEnabled(false); } else { setEnabled(true); } }
67d510cf-cffe-4878-8d1b-0980d2fe3ee1
9
public boolean similar(Object other) { try { if (!(other instanceof JSONObject)) { return false; } Set<String> set = this.keySet(); if (!set.equals(((JSONObject)other).keySet())) { return false; } Iterator<St...
fb8914a5-1d02-4f8c-8f6b-e192a19dd666
2
public Operator getOperator(String literal) { int operatorCount = this.operatorList.size(); for(int i = 0;i<operatorCount;i++) { Operator currentOperator = this.operatorList.get(i); String currentText = currentOperator.getLiteral(); boolean isMatchingExpression = literal.equals(currentText); if (isMat...