method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
f741d24c-18a6-4fdd-b9c8-313ac8524adb
1
public SpellEditor(int ID) { this.ID = ID; setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setTitle("Spell Editor"); setBounds(100, 100, 450, 300); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTE...
d525e89c-9550-499d-93ba-61b41267f386
8
private static void allocateNodeLengthsWithRelocation (final int[] array, final int nodesToMove, final int insertDepth) { int firstNode = array.length - 2; int nextNode = array.length - 1; int currentDepth = (insertDepth == 1) ? 2 : 1; int nodesLeftToMove = (insertDepth == 1) ? nodesToMove - 2 : nodesToMove; ...
694dcb83-dcbf-4f29-9ac4-5fece5a0c7f5
6
public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException{ for(int i = 0; i < characterButton.length; i++){ if(characterButton[i].isClicked()){ System.out.println("Character button clicked!"); if(p1Character == null){ p1Character = characters[i]; } else{ ...
ac191074-534c-4c9d-b341-5e7cb2b89d53
1
public String toString() { if (e == null) return super.toString(); else return e.toString(); }
2f8f5d9f-eff1-4075-9afe-44753be2bd04
9
public void initialize(Object[] arguments) throws MaltChainedException { if (arguments.length != 2) { throw new FeatureException("Could not initialize MergeFeature: number of arguments are not correct. "); } if (!(arguments[0] instanceof FeatureFunction)) { throw new FeatureException("Could not initialize M...
e2fe0fd1-dd38-4d8d-9e31-37a23d60a08d
4
public String nextTerm(StringReader reader) throws IncorrectQueryException { String STOP_SYMBOLS = ".,;:()!@#$%^&*[]{}\'\"`~"; try { buffer.delete(0, buffer.length()); int c = 0; while ((c = reader.read()) != -1) { if (STOP_SYM...
01eabe42-3161-4f70-b1bd-ca76975f5fba
6
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Roles that = (Roles) o; if (idRole != that.idRole) return false; if (name != null ? !name.equals(that.name) : that.name != null) re...
596ded7b-675e-4b67-ab4d-df350920e2d4
2
public static void WriteFile(byte[] fileContent, String filePath) { FileOutputStream out = null; try { out = new FileOutputStream(folderPath+filePath+".cry"); out.write(fileContent); } catch (Exception ex) { Logger.getLogger(File...
2fd89b2c-4ac0-497c-b9c7-4029d08604cb
3
private void readFlag(String flag) { switch (flag) { case "lex": flagLexerOutput = true; break; case "par": flagParserOutput = true; break; case "genc": flagGeneratedCOutput = true; break; default: System.out.println("Error -" + flag + " is an unrecognised flag"); break; } }
1dbe0435-16cc-4fe7-b9cf-0ef44763fc53
8
private void fillGroup(Field[] fields, int groupsLeft) { /* Determine how much Svetovids should be inserted * in group. There always must be at least one and * less than svLeft - groupsLeft. Value is random * generated in this scope unless it is last group, * than all left Svetovids should be inserted. ...
d67d2039-0658-4e20-8942-a47392564c7b
2
public String removeFront(String[] params) { String retString = ""; int n = 0; for(String string : params) { if(n > 0) { retString += string; } n++; } return retString; }
a1c422b4-26f5-4e49-9378-d98377b9d635
0
public void add(Target t) { getList().add(t); }
c80f70e5-1b87-4064-add8-abdb6db9c688
5
@Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { for (int i = 0; i < developments.length; i++) { if (e.getItemSelectable() != developments[i] && developments[i].isSelected() && developments[i].isEnabled()) { developments[i].setSelected(fal...
74159cc9-829f-40df-9b76-b580e6651954
4
protected Node<T> getNode(T value) { Node<T> node = root; while (node != null && node.id != null) { if (value.compareTo(node.id) == 0) { return node; } else if (value.compareTo(node.id) < 0) { node = node.lesser; } else { ...
6827687f-38f0-4963-9507-0abc45d520b2
9
protected void FillBuff() throws java.io.IOException { if (maxNextCharInd == available) { if (available == bufsize) { if (tokenBegin > 2048) { bufpos = maxNextCharInd = 0; available = tokenBegin; } else if (tokenBegin < 0) bufpos = maxN...
13e8fea0-c8d7-4a07-a160-57456b42e866
0
@Override public void onKey(int keycode) { System.out.println("key: " + keycode); }
f30a8f6b-0cd6-43ea-b0ce-982f4bdf8234
7
@Test public void testIterator() { RedBlackTree<Integer> tree = new RedBlackTree<Integer>(); for (int j = 0; j < 100; j++) { tree.insert(j); } Iterator<Integer> i = tree.iterator(); try { i.remove(); Assert.fail(); } catch (NoSuchElementException e) { } Assert.assert...
d149d41f-beb6-4504-aa58-67707728bd93
2
private void handleInputText() { String inputText = getText(); if ( inputText.trim().isEmpty() ) return; if ( inputText.startsWith("/") ) handleCommand(); else handleMessage(); }
d7526098-2aa3-4953-ad32-2e32ffc18778
5
protected Tuple populateListOfAllSpaces(List<Tuple> admins) { Tuple identifyAdmin = new Tuple(3,"identifyadminquery"); identifyAdmin.hasAnswered = Boolean.FALSE; space.write(identifyAdmin, SemiSpace.ONE_DAY); Tuple iaq = new Tuple(3,"identifyadminquery"); iaq.hasAnswered = Boole...
e2dedc08-142b-4193-aeef-53d1f74a05e9
3
public AnnotationVisitor visitAnnotation( final String desc, final boolean visible) { AnnotationNode an = new AnnotationNode(desc); if (visible) { if (visibleAnnotations == null) { visibleAnnotations = new ArrayList(1); } visibleAnn...
c6bfd1cb-a757-419e-b067-df043b35fe40
3
public static int d(char char1, char char2){ if( (char1 == 'h' || char1 == 'w') && char1 != char2){ return 1; } else { return r(char1, char2); } }
4bca33d6-0c49-4bb8-9830-88159d10b2e4
2
public static void callCommand(String label, CommandSender s, String[] args){ label = label.toLowerCase(); if(!commands.containsKey(label)){ Broadcast.error("That command does not exist", s); return; }Command c = commands.get(label); if(c == null){ Broadcast.error("That command does not exist", s); ...
59645dc0-6c28-4e22-992f-8a0042c25e02
3
private void etsiActionPerformed() { String kayttajanimi = kayttajatunnusField.getText().trim(); String etunimi = etunimiField.getText().trim(); String sukunimi = sukunimiField.getText().trim(); List<Kayttajatunnus> kayttajatunnukset; if ("".equals(etunimi) && "".equals(sukunimi)) { kayttajatunnukset...
ccd34122-5ffa-4dd2-a5cd-146d9d8f26d1
8
@SuppressWarnings("deprecation") public static void main(String[] args) { HashMap<String, ArrayList<Integer>> finalMap = new HashMap<String, ArrayList<Integer>>(); HashMap<String, HashMap<Integer,Integer>> dayCountForStnMap = new HashMap<String, HashMap<Integer,Integer>>(); HashMap<Integer, String> stationIdName...
702ee750-2afc-4109-b3a2-5455ed0cd6f1
3
@Override public void caseAIntLitHexp(AIntLitHexp node) { for(int i=0;i<indent;i++) System.out.print(" "); indent++; System.out.println("(IntegerLiteral[ " + node.getIntLit() + " ]"); inAIntLitHexp(node); if(node.getIntLit() != null) { node.getIntLit().ap...
8c55f508-db71-437e-be85-c07a934f4d92
4
public ArrayList PrikazNarucenihProizvoda(KorisnikBean kb) throws Exception{ ArrayList korpe=new ArrayList(); try{ stmt=con.createStatement(); String query1 = "SELECT * FROM potrosackakorpa WHERE status = "+0+" AND korisnikID="+kb.getKorisnikId(); RS=stmt.execut...
ccd484f2-7c36-4c1b-ae5c-dc64fb0de532
0
public static Image loadImage(String name) { String filename = "/images/" + name; URL urlImg = ResourceManager.class.getResource(filename); return new ImageIcon(urlImg).getImage(); }
d667e69e-ad34-4330-bc5d-092adcfe420e
9
private void gather(double[] z, SparseVector v, double taui, int d) { // Number of entries in the lower and upper part of the original matrix int nl = 0, nu = 0; for (VectorEntry e : v) { if (e.index() < d) nl++; else if (e.index() > d) nu+...
a8fee64b-514a-41c4-a08b-c147f1913f73
0
public void earnPaycheck() { this.addPayment(); }
497d3599-d3bd-4a8c-8bbf-d7af51e2b55c
5
public static void muteMusic() { if (!isMusicMuted) { stopMusic(); isMusicMuted = true; } else { try { switch (Game.getInstance().getCurrentLevel().getLevelType()) { case Level.LEVEL_SIMPLE: SoundEffect.MUSIC_1.loop(); break; case Level.LEVEL_MID: SoundEffect.MUSIC_2.loop(); ...
3d83aa9f-0f42-49c1-958e-34ea0f579203
6
public void updateHeader() { //String s; Double s,max,min,avg; if (chart.showAbsoluteRatios) { //s = headerString(heightRatio * heightScale); s = heightRatio * heightScale; } else { //s = headerString(heightRatio); s = heightRatio; ...
dcd19331-342a-4ee0-a070-f71730e103fa
5
public void displayString(String text){ Object[] buttons = {"Continue", "Quit"}; int userInput = JOptionPane.showOptionDialog(null, text, "Quantum Werewolves", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, null, buttons, buttons[0]); s...
df8a1204-5a2b-4435-9014-090241dd8972
5
private boolean FindCommon(String type, int x, int y) { if (x < 0 || y < 0) {return true;} if (x >= width || y >= height) {return true;} if (type.equals(map[y][x].name)) {return true;} return false; }
9227fdb2-1664-4b39-a417-cfd5f550f788
0
public void addAdmin(Admin admin){ this.admin.add(admin); }
1e60d6a6-647e-4d84-b9bc-5bbafb1b26df
5
protected void drawChildren(Object cell, boolean edges, boolean others) { mxIGraphModel model = graph.getModel(); int childCount = model.getChildCount(cell); for (int i = 0; i < childCount; i++) { Object child = model.getChildAt(cell, i); boolean isEdge = model.isEdge(child); if ((others && ...
15b40be8-4344-4864-b6c0-b7ea6b2f8b89
1
public void update() { follow(); centerX += speedX; speedX = bg.getSpeedX() * 5 + movementSpeed; r.setBounds(centerX - 25, centerY - 25, 50, 60); if (r.intersects(Robot.yellowRed)) { checkCollision(); } }
cb61e8e5-b257-4a86-bd19-f5ee545c833a
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...
b96d8e63-fc99-496f-8939-4c043f7aac7a
4
public ArrayList getRooms(String x, String y) { System.out.println(x); System.out.println(y); ledig_id.clear(); String SQLString = " SELECT BOOKING_ID, LEJLIGHED_ID, to_char(CHECK_IN_DATO, 'DD-MM-YYYY'), to_char(CHECK_OUT_DATO, 'DD-MM-YYYY') from BOOKEDE_LEJLIGHE...
00d467d1-8708-4a1f-b7c7-0fd8c304a526
4
public static void filledEllipse(double x, double y, double semiMajorAxis, double semiMinorAxis) { if (semiMajorAxis < 0) throw new RuntimeException("ellipse semimajor axis can't be negative"); if (semiMinorAxis < 0) throw new RuntimeException("ellipse semiminor axis can't be negative"); double ...
2c0ef1b8-3576-4385-bcc9-df6373c13a26
4
private void loadWaves(int level) { Scanner scanner = null; try { scanner = new Scanner(new FileInputStream("res" + File.separator +"levels" + File.separator +"level"+level+File.separator +"waves.txt")); } catch (FileNotFoundException e) { e.printStackTrace(); } String currentLine; String[] currentL...
db93eb87-3e55-4635-9842-a4259ac52164
6
public static String strCapitalize(String s) { StringBuilder result = new StringBuilder(s.length()); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if ((i + 1 < s.length()) && (c == ' ' || c == '-' || c == '_')) { result.append(c); result.append(Character.toUpperCase(s.charAt(++i))); ...
a9ea858c-0ed3-476f-8982-22621fd0d723
6
public void processConnection() { if (first != null && second != null) { for (Entity e : first.getEntList() ) { for (Entity en : second.getEntList() ) { if (e != en) { if (e.intersect(en.getRect() ) ) { report(e,...
dc444f26-0986-4f1f-a28c-bcee17a4b4ab
4
public MainMenuState() { if (ChristmasCrashers.isDebugModeEnabled()) System.out.println("Loading textures for the MainMenu state."); try { textures.put(2, TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("files" + File.separator + "CCStartGameButton.PNG"))); textures.put(1, TextureLoader....
bec0be69-541e-4b4d-a5ac-525bbb98775f
6
public static double critchi(double p, int df) { if (p <= 0.0) { return CHI_MAX; } else { if (p >= 1.0) { return 0.0; } } /* double chisqval = 0.5 * df / Math.sqrt(p); // fair first value double minchisq...
cfc6ac83-cb3f-4643-992f-51db4728a5f7
3
public static void renderColored(String msg, int x, int y, int scale, float r, float g, float b){ int size = 8; if(size > 0) size = size*scale; for(int i = 0; i < msg.length(); i++){ int charIndex = chars.indexOf(msg.charAt(i)); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, ...
9c6c85ef-8338-47ea-86f9-6bbc77da8587
2
public void testHalfdayNames() { DateTimeFormatter printer = DateTimeFormat.forPattern("a"); for (int i=0; i<ZONES.length; i++) { Chronology chrono = ISOChronology.getInstance(ZONES[i]); MutableDateTime mdt = new MutableDateTime(2004, 5, 30, 0, 20, 30, 40, chrono); fo...
5cb300ba-c848-45a3-9824-66dd74fd8f61
9
public void fillRect(short colix, int x, int y, int z, int zSlab, int widthFill, int heightFill) { // hover and labels only -- slab at atom or front -- simple Z/window clip if (isClippedZ(zSlab)) return; if (x < 0) { widthFill += x; if (widthFill <= 0) return; x = 0; } if (x + widthFill > widt...
eb2c2139-c044-4a08-960e-8660f618abe0
1
@Override public void print() { for(Integer iObj:list) { System.out.println(iObj); } }
b3037082-c715-4baa-ae5e-4faaff62549c
5
@Override public String generateCode() { if (optionalInit.getType() != Type.NIL_TYPE) { if(typeId.getType().isArray()) { for(String id: idList.getIds()) for(int i = 0; i < typeId.getType().getLinearSize(); i++) emit("array_store, " + id + ", " + i + ", " + optionalInit.getValue())...
c93b3f24-fa55-4381-89e5-960de2f1731d
0
public void runMainFrame(){ mainFrame = MainFrame.getInstance(); mainFrame.setVisible(true); }
5ba13ec1-6eba-47f6-b39a-798279e1c7f6
9
public boolean containsValue(Object value, boolean identity) { V[] valueTable = this.valueTable; if (value == null) { K[] keyTable = this.keyTable; for (int i = capacity + stashSize; i-- > 0;) { if (keyTable[i] != null && valueTable[i] == null) { ...
64aa712e-d66f-44d4-84c1-4a933e78ce2e
2
public int getANTextWidth(String text) { // method384 if (text == null) { return 0; } int width = 0; for (int i = 0; i < text.length(); i++) { width += charWidths[text.charAt(i)]; } return width; }
fb22b3cc-2890-416d-b265-5738b1dcbba4
2
public long getTestSetId(String testSetFolderPath, String testsetName) throws Exception { long testSetId = 0; Map<Long, String> testsets = getTestSets(testSetFolderPath); log.info("Retrieved TestSets :" + testsets); if (testsets != null)...
88c8433d-1812-41a8-b69f-90c0e26614db
3
private double calcDerivative(double point) { double value = 0; for (int i = 0; i < equationCoef.length; i++) { if (equationPower[i] != 0) { if (equationPower[i] == 1) { value = value + equationCoef[i]; } else { value ...
a4674f88-9acf-467b-85ef-ea1fd2596e9f
0
public void destroy(){ }
3125078e-243d-48bf-ba59-10fa710820f9
5
static String getPlatformFontFace(int index) { if(SWT.getPlatform() == "win32" || SWT.getPlatform() == "wpf") { return new String [] {"Bookman Old Style", "Century Gothic", "Comic Sans MS", "Impact", "Garamond", "Lucida Console", "Monotype Corsiva"} [index]; } else if (SWT.getPlatform() == "motif") { return new ...
24e72b6a-fa98-4e07-b1d3-e06eb8489e24
3
static long Third(long a) { long tmp; for (long i = 2; i < a; i++) { if (a % i == 0) { tmp = a / i; if (Prime(tmp)) { return tmp; } } } return 0; }
5e5d9e70-9239-43ed-a891-e9691f81eed5
2
@Override public void drop(DropTargetDropEvent dtde) { if (mDragDockable != null) { if (mDragOverNode != null) { dock(mDragDockable, mDragOverNode, mDragOverLocation); revalidate(); } dtde.acceptDrop(DnDConstants.ACTION_MOVE); dtde.dropComplete(true); } else { dtde.dropComplete(false); } ...
a9933439-7946-4dca-a2b9-865db6816b6d
1
public Tile create(String name, Material mat) throws TileAlreadyExistsException { if(!tileMap.containsKey(name)){ return new Tile(name, mat); } else { throw new TileAlreadyExistsException(); //TODO: evtl. verschieben zu save(Tile) } }
ec9722cc-ce91-44df-a06a-150328664df5
7
public CuttingResult getReward(Tilia x){ if(quality == null){ quality = x.getCollection().get_tilias(); } int side = x.getSide(); ArrayList<Integer> pieces = new ArrayList<Integer>(); long sum=0; float maxratio= 0; int bestside = 0; //Determine side with best ratio for(int i = 0;i<=sid...
04d16df4-cf70-4353-867c-fc7173696699
5
private ActivityEvent createActivityEvent() { final String eventName = getPanel().getProcess().getNameGenerator().nextEventName(); if (this.eventType == StateType.MESSAGE_ACTIVITY_EVENT) { return new MessageActivityEvent(eventName); } if (this.eventType == StateType.TIMER_ACT...
d098d88b-eb23-4d2d-8ec7-5ff765ebceed
1
public String postToServlet(String xmlMove) throws Exception { URL url = new URL("http://localhost:8080/Servlet"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "text/xml"); //conn.setRequ...
b9dfa655-54e6-4dd7-abaf-8b8220485473
0
public static List<Element> shuffleList(List<Element> items) { long seed = System.nanoTime(); Collections.shuffle(items, new Random(seed)); return items; }
61958495-5dbe-47fc-8854-ed021f437f65
3
public JPanel getGui() { if(state == State.Login) return (JPanel)login; if(state == State.Lobby) return (JPanel)lobby; if(state == State.Game) return (JPanel)game; ServerHelper.log(LogType.GUI, "Fehler im GuiManager: state ist " + state); r...
dd169157-d9bc-48f5-ad61-ad50618ec6e7
4
public static void packFilesInFolder(File csvFile) { String name = csvFile.getName().substring(0, csvFile.getName().lastIndexOf(".")); if (csvFile.getParentFile().getName().equals(name)) { CFG.p(" > already sorted"); return; } File dir = new File(csvFile.getParentFile(), name); dir.mkdir(); int so...
184013f2-b3e5-4aa1-be8d-06a3189b635d
4
public boolean equals(Object o){ if(o != null && o.getClass() == o.getClass()){ RecipeSection other = (RecipeSection)o; return headline.equals(other.getHeadline()) && text.equals(other.getText()) && ingredients.equals(other.getIngredients()); } else { return false; } }
21cb944f-fc84-41db-8818-bd517fd4f327
0
public static java.io.Serializable readFileAndCodecs(File file) { OpenAction.setOpenOrRead(true); Codec[] codecs = null; codecs = makeFilters(); openFile(file, codecs); OpenAction.setOpenOrRead(false); return OpenAction.getLastObjectOpened(); }
f769ea14-fbf8-49ba-b3ee-064c0e21c353
2
static public void setScreenDimension(JFrame frame, Dimension dm) { Dimension prevDimension = frame.getSize(); //keep prev dimension Dimension newComponentSize; //if frame increased, component size increased to by delta width & height double deltaWidth, deltaHeight; //delta of dimensions ...
442b1ccc-8ed3-4ef3-bbbd-4911cf21e9e1
5
public BotManager() { try { icon = ImageIO.read(new File("./images/", "icon.png")); TrayIcon tray = new TrayIcon(icon); tray.setImageAutoSize(true); tray.setToolTip("Turntable Bot Manager"); tray.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent arg0) { if (!isVisible()...
21bb80eb-7717-4e04-abd8-5ace86439f96
3
private void checkUpgradePawn(Piece thePiece) { if(thePiece instanceof Pawn) { if(thePiece.getY()==7||thePiece.getY()==0)//then the piece is at the end of the board and needs to be updated { this.upgradePawn(thePiece); } } }
389bbc86-1444-460e-8230-7167e24fc01c
0
private int parseStringPoolHeader (ResStringPool_Header stringPoolHeader, byte[] data, int offset) throws IOException { stringPoolHeader.stringCount = readUInt32(data, offset); stringPoolHeader.styleCount = readUInt32(data, offset + 4); int flags = readUInt32(data, offset + 8); stringPoolHeader.flag...
6ff3f74d-73ea-4856-af9a-235e3fbb515a
4
public void calculateNextDirection(int row, int column) { if (isAtHome) { calculateToExit(); } else if (isCrossroad()) { calculateNextRandomDirection(); } else { int newDirection = getDirection(); while (!isAValidDirection(newDirection) || newD...
58728097-272b-44c6-a5ef-8f87c109a93e
2
@Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) { component_stack.push(component); component = null; elements_stack.push(qName); attributes_stack.push(new AttributesImpl(atts)); characters_stack.push(new StringBuffer()); if (isVerboseEnough(VERBOS...
304e15aa-766b-450e-8f3a-541c2ceb9187
8
public static void main(String[] args) { if (args.length>0) { String file = args[0]; int scale = new Integer(args[1]); int factorF0 = new Integer(args[2]); System.out.println("file="+file); Analyze analyze = new Analyze(); try{ // Open the file that is the first // command line parameter ...
f69d0ff5-99c0-4ef6-bd2d-0e5108703e10
1
@Test(expected = PersistencyException.class) public void WhenLoadingFromFileWithInvalidUUID_ExpectIllegalArgumentException() throws PersistencyException { RoutingTable routingTable = new RoutingTable(); try { persistenceDelegate_.load(INVALID_UUID_FILE, routingTable); } catch (Fi...
9ab32fd9-3894-4d29-a4bd-2450ada8a4cf
3
public List<Vertex<T>> getNeighbors( Vertex<T> v ) { int pos = getVerticesIndexFor( v ); if ( pos == -1 ) { throw new IllegalArgumentException( "vertex not found" ); } List<Vertex<T>> neighbors = new ArrayList<Vertex<T>> (); for ( int i = 0; i < vertices.length; i++ ) { if ( this.adjMat...
ef4663e8-4c98-4825-89bf-02df2c0258cb
9
private void readMixedObjectSetObjects() throws IOException, NoSuchVersionException { System.out.println("==== Block mit aktuellen und zukünftigen Objekten ===="); final long startingPosition; startingPosition = (_configFileHeaderInfo.getStartMixedSet() + _configFileHeaderInfo.getHeaderEnd()); // Datei öff...
7d4302bf-357f-4c75-81d3-9108f1674975
2
public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals(info.getActionCommand())){ new EdgeInfoDialog(parent, edge); } else if(e.getActionCommand().equals(delete.getActionCommand())){ Runtime.removeEdge(edge); parent.redrawGUINow(); } }
22710430-0a50-409f-b20b-db27df590dfc
0
public String getType() { return "grammar"; }
89c958d0-3f14-4de4-8115-37a3735bb405
9
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { try { if (skip) { return; } if ("BIBLEBOOK".equals(qName)) { int bnumber = Integer.parseInt(attributes.getValue("bnumber")); if (bnumber > maxBooks) { skip = tru...
83c76a0c-49b1-4152-b3f4-020ced48301e
8
public int characterAt(int at) throws JSONException { int c = get(at); if ((c & 0x80) == 0) { return c; } int character; int c1 = get(at + 1); if ((c1 & 0x80) == 0) { character = ((c & 0x7F) << 7) | c1; if (character > 0x7F) { ...
02b906f9-13ff-4cda-a046-5f6c440c8bb3
1
protected void setFlow(EasyFlow<? extends StatefulContext> flow) { this.flow = flow; }
de45e98e-4457-4a54-97fb-02123c20632c
7
@Override public List<Point> findWay(Node<Point> start, Node<Point> goal, ListGraph<Point> graph) { this.closedList = new HashSet<Node<Point>>(); // Min-Heap based on the F values this.openList = new PriorityQueue<>((n1, n2) -> { return (int) (n1.getF() - n2.getF()); });...
6f173828-cce4-4f79-a60e-773263dd290e
6
private void depositOre(final int oreId) { final Item item = ctx.backpack.select().id(oreId).poll(); options.isSmithing = false; //ArtisanArmourer.setStatus("Searching for smelter"); final GameObject smelter = ctx.objects.select().id(options.mode == Mode.BURIAL_ARMOUR ? LogArtisanWorkshop.ID_SMELTER : LogArti...
d2c7e123-fc47-49dd-a1ef-0555c37bdcfb
2
static double[][] transpose(double[][] A){ double[][] B = new double[A[0].length][A.length]; for(int i = 0; i < A.length; i++){ for(int j = 0; j < A[i].length; j++){ B[j][i] = A[i][j]; } } return B; }
fa282877-7700-4aa2-907b-318ad64c23cc
6
protected char[] formattedValue(final Object val, final ColumnMetaData element) { Object value = val; if (value == null) { // TODO DO: maybe have a way to substitute default values here? value = ""; } String stringValue; if (value instanceof BigDecimal) {...
ad678be8-635c-472b-9ad5-9caaa48bab14
7
public byte[] next() throws IOException { if (!init) { key1 = result1.next(); key2 = result2.next(); init = true; } if (key1 == null && key2 == null) { return null; } else if (key1 == null) { byte[] result = key2; c...
bce6b1be-da73-4d32-9007-620052404821
2
@Override public List<City> load(Criteria criteria, GenericLoadQuery loadGeneric, Connection conn) throws DaoQueryException { int pageSize = 50; List paramList = new ArrayList<>(); StringBuilder sb = new StringBuilder(WHERE); String queryStr = new QueryMapper() { @Overri...
5184cc09-5c59-4138-8d50-e14b6dd876d9
4
private void replaceElement(MouseEvent e) { final Panel screen = (Panel) e.getSource(); final double xMax = screen.getWidth() - 1; final double yMax = screen.getHeight() - 1; double x = e.getX(); double y = e.getY(); x = x > xMax ? xMax : x < 0 ? 0 : x; y = y > yM...
5f9b184b-176f-4a9a-b2d2-279a5c021043
0
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton4ActionPerformed {//GEN-HEADEREND:event_jButton4ActionPerformed world.choiceMade("go"); }//GEN-LAST:event_jButton4ActionPerformed
7a3431f4-6693-4983-bdbb-a6632e651c71
6
public void run() { String line = ""; while (line != null) { try { line = this.connection.waitForResponse(); this.logger.debug("Read Line: {}", line); for(ReceiverHandler r: this.handlers) { try { r.handle(line); } catch (InvalidLine e) { // still not sure how to h...
3a7bfec3-43ba-4db0-bde6-3c9c2b2f1dd1
8
private Statement statement() { // skip any semicolons if(currentToken.type() == Token.Type.Semicolon) return new Skip(); // if statement else if(currentToken.type() == Token.Type.If) return ifStatement(); // while loop else if(currentToken.type() == Token.Type.While) return whileStatement();...
05ebf1b9-330c-4c3c-98a9-bf071c50bf92
9
private void setupResources(List<ResourceType> resources) throws ParsingException { if (resources.size() != 1) { // TODO throw new ParsingException( "XACML 2.0 support for multiple resources not yet supported"); } ResourceType resource = resources.get(0); mapAttributes(resource.getAttribute(), res...
0fd5146b-57ef-4dd6-8947-5dd09de86a3a
4
public void ExecuteAttach(CommandSender cs, String[] args){ try { //Is the player already in there? FCReborn plugin = FCReborn.getPlugin(); if(plugin.getChatters().containsKey(cs.getName())){ plugin.getChatters().remove(cs.getName()); } if(Bukkit.getServer().getPlayer(args[0]) != null){ String...
75d67154-eef8-458a-90e1-ce387bbdc751
0
private void exchange(int i, int j) { int temp = numbers[i]; numbers[i] = numbers[j]; numbers[j] = temp; }
3943f3e1-ae3e-41c6-b9d4-bf84d04d6f10
8
public static Surrogate computeRelationTermSurrogate(Skolem skolem, Proposition proposition) { { Proposition functionprop = skolem.definingProposition; String string = Native.stringify(Proposition.generateFunctionAsTerm(functionprop)); Surrogate surrogate = null; int arity = 0; List argument...
65a5399d-e647-4192-9467-939f8bc21057
2
protected static List<String> readFile(Path file) { assert FileUtil.control(file); List<String> sb = new LinkedList<>(); String line = null; Charset charset = Charset.defaultCharset(); try (BufferedReader reader = Files.newBufferedReader(file, charset)) { while ((lin...
da1ae06e-c31c-4b8b-a462-ce20e94e2ff3
9
public ResultsComputer(String cf, String tf) { clustersFile = cf; topicsFile = tf; clusterToDocs = new HashMap<Integer,ArrayList<Integer>>(); docToTopics = new HashMap<Integer,ArrayList<String>>(); /** Populate cluster to document mapping **/ try { BufferedReader br = new BufferedReader(new FileReader...
4f5c1e34-96ea-4e7e-a41f-9a687b95b50d
3
public void InsertaMedio (int ElemInser,int Posicion) { if (VaciaLista()) { PrimerNodo = new NodosProcesos (ElemInser); PrimerNodo.siguiente = PrimerNodo; } else { if (Posicion<=1) InsertaInicio(ElemInser); else { NodosProcesos Aux = PrimerNodo; int i = 2; ...
2d36120c-d648-4a4c-b99a-2edb3ff0b7f9
0
@Override public String toString(){ return String.format("%d/%d", numerator, denominator); }