text
stringlengths
14
410k
label
int32
0
9
@Override public boolean matches(String inputExt, String outputExt) { return StringUtils.equalsIgnoreCase(inputExt, "xls") && StringUtils.endsWithIgnoreCase(outputExt, "properties"); }
1
public Map getRecordByID(String table, String primaryKeyField, Object keyValue, boolean closeConnection) throws SQLException, Exception { Statement stmt = null; ResultSet rs = null; ResultSetMetaData metaData = null; final Map record=new HashMap(); // do this in an excpetion handler so that we can depend o...
7
@Override public void run() { while(run){ System.out.println( String.format("[monitor] [%d/%d] Active: %d, Completed: %d, Task: %d, isShutdown: %s, isTerminated: %s", this.executor.getPoolSize(), this.executor.getCorePoo...
2
public void analyzeLine (String instr) { //clear the map for new input string tf_idf_map.clear(); core_words.removeAllElements(); non_core_words.removeAllElements(); System.out.println("analyzing..."); long start = System.currentTimeMillis(); //tokenization instr = getTokenized(instr); //regex ...
9
private void init() { for (int i = 0; i < CAPACITY; i++) { arr[i] = null; } topPtr = CAPACITY; }
1
private boolean startAlgorithm () { addToOpenedCells(startCell); while (true) { int selectedCellIndex = getNextCellIndex(); Point selectedCell = openedCells.get(selectedCellIndex); removeFromOpenedCells(selectedCellIndex); addToClosedCells(selectedCell); ...
3
@Override public void add(String word) { // char[] lWord = word.toLowerCase().toCharArray(); if (this.root == null) { this.root = new WordNode(); this.nodeCount++; } WordNode currentNode = root; // for (char c : lWord) { // boolean nodeAdd = c...
5
public void removeConstructor(CtConstructor m) throws NotFoundException { checkModify(); MethodInfo mi = m.getMethodInfo2(); ClassFile cf = getClassFile2(); if (cf.getMethods().remove(mi)) { getMembers().remove(m); gcConstPool = true; } else ...
1
private void setAttr(Attributes attr) { if (attr.getIndex("nome") >= 0) { this.nome = attr.getValue("nome"); } else { System.out.println("tabela: falta o atributo 'nome'"); } }
1
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } ConnectionEvent that = (ConnectionEven...
7
public void setNspgStats(IntVO gap) { int v=gap.val(); switch (v) { case 0: //gap 0, 1 nspg0++; break; case 1: //gap 0, 1 nspg1++; break; case 2: case 3: case 4: case 5: case 6: case 7: //gap 2,3,4,5,6,7 nspg2++; break; default: //gap 2,3,4,5,6,7 nspg3++; break;...
8
public static void main(String[] args) { System.out.println(getLongValue("queryTime")); }
0
public boolean getInput() { while(Keyboard.next()) { if(Keyboard.getEventKeyState()) { onKeyDown(Keyboard.getEventKey()); } else { onKeyUp(Keyboard.getEventKey()); } } // mouse input //float mDX = Mouse.getDX() * 2.5f; // mouse sensitivity 2.5, t...
7
public void wdgmsg(Widget sender, String msg, Object... args) { if(sender == y) { ui.sess.close(); } else if(sender == n) { ui.destroy(this); } else if(sender == this) { if(msg == "close") ui.destroy(this); if(msg == "activate") ui.sess.close(); } else { super.wdgmsg(sender, msg, args);...
5
public Scope getScope(Object obj, int scopeType) { int count = scopes.size(); for (int ptr = count; ptr-- > 0;) { Scope scope = (Scope) scopes.elementAt(ptr); if (scope.isScopeOf(obj, scopeType)) return scope; } return null; }
2
private static String getVal(String[] lines, String field) { for (String line : lines) { String[] part = line.split(":", 0); if (part[0].equalsIgnoreCase(field)) return part[1]; } return "No value set for "+field; }
2
public static GeneralNameValueConfig getVorbisConfigByField(String field) { return Registry.getConfigByField(field,vorbisFields); }
0
public void addButton(BasicAction action) { JButton button = new JButton(action) { /** * */ private static final long serialVersionUID = -8635984393664103035L; public void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D)g; ...
1
public void deleteMarkedEntities(){ for(Mob m:mobsToDelete) mobs.remove(m); for(Projectile p:projectilesToDelete) projectiles.remove(p); for(Explosion e:explosionsToDelete) explosions.remove(e); for(Particle p:particlesToDelete){ particles.remove(p); bgParticles.remove(p); } mobsToDelete.clear(); pr...
4
public static void seq_ief(CompList<?> t) throws Exception { for (Compound c : t) { ComponentAccess.callAnnotated(c, Initialize.class, true); c.execute(); ComponentAccess.callAnnotated(c, Finalize.class, true); } }
2
public void drawCard(PlayerClass pPlayer){ pPlayer.cout.printFerryClass(dobbelt); if(pPlayer.getPlayerPos() == 37 || pPlayer.getPlayerPos() == 3){ pPlayer.setPlayerPos(6); } else if(pPlayer.getPlayerPos() == 8){ pPlayer.setPlayerPos(16); } else if(pPlayer.getPlayerPos() == 18 || pPlayer.getPlayerPo...
7
@Override public boolean matches(List<Character> currentMatching) { if(currentMatching.size() > 1) return false; if(currentMatching.get(0).charValue() == '\n' || currentMatching.get(0).charValue() == '\r' || currentMatching.get(0).charValue() == '...
4
public void enableBottomBar(boolean b) { if (moviePanel != null) remove(moviePanel); if (runPanel != null) remove(runPanel); if (b) { if (model.getRecorderDisabled()) { if (runPanel == null) createRunPanel(); add(runPanel, BorderLayout.SOUTH); } else { add(moviePanel, BorderLayout....
7
private void renderScene(Scene scene) { long t = System.currentTimeMillis(); // HINT - always the getGraphics()-Method is called, // the background buffer will be cleared automatically Graphics2D g = canvas.getGraphics(); // enable anti aliasing g.ad...
8
public void delete() throws SQLException { Reminder.deleteByAppt(this.getId()); if (this.isJoint) { this.deleteArray("aWaitingId"); this.deleteArray("aRejectedId"); this.deleteArray("aAcceptedId"); } super.delete(); }
1
public static void main (String[] args) throws IOException, InterruptedException { final int port = 7000; final int writeBufferSize = 16384; final int objectBufferSize = 2048; final AtomicBoolean received = new AtomicBoolean(); // Creating server final Server server = new Server(writeBufferSize, objectBuff...
4
static public ParseException generateParseException() { jj_expentries.removeAllElements(); boolean[] la1tokens = new boolean[17]; for (int i = 0; i < 17; i++) { la1tokens[i] = false; } if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 2; i++...
9
public void valueChanged(TreeSelectionEvent e) { JTree tree = (JTree) e.getSource(); TreePath treepath = tree.getSelectionPath(); if (null == treepath) return; NamedDataSectionable parentDataSectionable = null; if (treepath.getPathCount()...
6
@Override public BufferedImage getImage(){ if(!running){ return images.get(0); }else{ long curTime = (System.currentTimeMillis() - startTime) ; for(int i=0; i<times.size(); i++){ if(curTime - times.get(i) <= 0){ return images.get(i); }else{ curTime -= times.get(i); } } } retur...
3
public void actionPerformed(ActionEvent e) { String nick = GUIMain.userList.getSelectedValue().toString(); if (nick.startsWith("@")) { nick = nick.replace("@", ""); } else if (nick.startsWith("$")) { nick = nick.replace("$",...
5
private void songEditMenu() { System.out.println(" Edit Menu "); System.out.println("1. |Create a song|"); System.out.println("2. |Delete a song|"); System.out.println("0. |Return|"); int option; option = new Scanner(System.in).nextInt(); switch (option) { ...
3
public Timer() { huidigeTijd = BEGIN_TIJD; timer = new javax.swing.Timer(10, new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { Date metingEindTijd = new Date(); long verschil = (metingEindTijd.getTime() - metingBeginTijd.getTime()) / 1000; if (verschil >= 1) { h...
1
public static String moveBlank(String string) { if (null == string || blankPattern.matcher(string).matches()) { return null; } return string.replaceAll("^[\\s ]*|[\\s ]*$", "").trim(); }
2
public String execute() throws Exception { User user = userService.getCurrentUser(); if (user == null) return "login"; job = this.userService.userJob(user.getUid(), Integer.parseInt(cid)); System.out.println("job:" + job); Map<String, Object> details = new HashMap<String, Object>(); if (job.e...
6
public void buttonClick(ClickEvent event) { final Button source = event.getButton(); String initialText = ""; PersonContainer pc = as.getDataSource(); SearchFilter sf = as.getSf(); if(source==generate){ if (sf != null) { pc.removeAllContainerFilters(); pc.addContainerFilter(sf.getPropertyId(), sf.g...
8
public static String expectedLocalPath(Case CASE) { String result = null; switch (CASE) { case CASE_1: result = "0000"; break; case CASE_2_3: result = "000"; break; case CASE_4: result = "...
5
private void assertBoardsSize(int size8, Chessboard chessboard, int expectedBoardsSize) { assertThat("all elements are not present on each board", chessboard.placeFiguresOnEmptyBoard() .parallel() .filter(board -> !board.contains(KING.getFigureAsSt...
6
public static void main(String args[]) { String filePath = "./b/c.txt"; File file = new File(filePath); try { boolean created = createFile(file); } catch (IOException e) { e.printStackTrace(); } }
1
public boolean skipPast(String to) throws JSONException { boolean b; char c; int i; int j; int offset = 0; int length = to.length(); char[] circle = new char[length]; /* * First fill the circle buffer with as many characters as are in the ...
9
public boolean isMovingDown() { return isMovingDown; }
0
@Override public void run() { try { //Keep a socket open to listen to all the UDP trafic that is destined for this port socket = new DatagramSocket(port, InetAddress.getByName("0.0.0.0")); socket.setBroadcast(true); while (true) { System.out.pr...
3
private int getIntFromElement(Element ele, SPSelector sel) { Elements els = subSelect(ele, sel.getSelector()); if(els.size() == 0) { return -1; } String text = els.get(0).outerHtml(); Modifier mod = sel.getModifier(); if(mod != null) { text = mod.getResult(text); } int res = -1; try { ...
3
public void testPropertySetSecond() { TimeOfDay test = new TimeOfDay(10, 20, 30, 40); TimeOfDay copy = test.secondOfMinute().setCopy(12); check(test, 10, 20, 30, 40); check(copy, 10, 20, 12, 40); try { test.secondOfMinute().setCopy(60); fail(); ...
2
public void setTime(int hhmmss) { if (!hiding && clockmode != MODE_TSET) { clocktime = hhmmss; } clkcanvas.repaint(); }
2
public ArrayList<Integer> ShuffleDeck(ArrayList<Integer> shuffledDeck){ for (int i=0;i<numOfCards;i++) { shuffledDeck.add(i);//populates arraylist with 0-51 //System.out.println(shuffledDeck.size()); Testing statement } shuffledDeck = Shuffle(shuffledDeck); //calls another shuffling method return ...
1
private boolean isMediumPriorityOperator(String o) { return o.equals(OPERATION_MULTIPLY) || o.equals(OPERATION_DIVISION); }
1
String sendSSAPMsg(String msg) { String ret=""; int err=0; deb_print("KpCore:message to send:_"+msg.replace("\n", "")+"_"); deb_print("KpCore:SSAP:Open connection..."); if((err = openConnect()) <0) {err_print("KpCore:SSAP:ERROR:"+ERR_MSG[(err*-1)] ); KP_ERROR_ID=err; return null;} else {deb_print("KpCore:SSA...
8
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final Item target=getTarget(mob,mob.location(),givenTarget,commands,Wearable.FILTER_ANY); if(target==null) return false; final List<DeadBody> DBs=CMLib.utensils().getDeadBodies(target); for(i...
9
@RequestMapping(value = {"/MovimientoBancario/{idMovimientoBancario}"}, method = RequestMethod.PUT) public void update(HttpServletRequest httpRequest, HttpServletResponse httpServletResponse, @PathVariable("idMovimientoBancario") int idMovimientoBancario, @RequestBody String json) { try { Object...
2
public boolean replace(int index, T newV) { if (index < 0 || index >= size) return false; T oldV = heap.get(index).element(); heap.get(index).setElement(newV); if (comp.compare(oldV, newV) < 0) trickleUp(index); else trickleDown(index); return true; }
3
public boolean spacesAvailable(Vehicle v) { // Test for Cars. if (v instanceof Car) { // Test for small cars. if (((Car) v).isSmall()) { if (smallCarsParked.size() < maxSmallCarSpaces) { return true; } else if (carsParked.size() < maxCarSpaces) { return true; } } // Test for norma...
9
public int sqrt(int x) { if (x == 0) return 0; if (x == 1) return 1; double value = x; int intvalue = x; while (intvalue > 46340 || intvalue * intvalue > x) { value = (value * value + x) / (2 * value); ...
4
private void completeAllEffects() { if(pendingEffects.isEmpty()) return; Collection<ForkJoinTask> receipts = new LinkedList<>(); //submit all actions. For each agent they happen in sequence for(Map.Entry<Agent,Collection<Effect>> effects : pendingEffects.asMap().entrySet()...
6
public void pickup(Item i, Player p){ if(id == 0.0f){ return; } scheduleRespawn(); ClassType ct = PluginData.getPlayerData(p).getPlayerClass(); if(ct == null) return; p.setHealth(ct.getMaxHealth()); i.setFireTicks(999); }
2
@Override public long read(T target) throws IOException { long totalRead = 0; while (target.remainingSpace() > 0) { if (buffer.remainingData() > 0) totalRead += buffer.read(target); else if (parentMightBeEmpty && totalRead > 0) break; else { long read = parent.read(buffer); if (buffer.r...
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; Predicate predicate = (Predicate) obj; if (!getArgs().equals(predicate.getArgs())) return false; if (!getName().equals(predicate.getNam...
5
public void DisPlayPic(String _title, int _x, int _y) { JFrame frame = new JFrame(); frame.setTitle(_title); frame.setLocation(_x, _y); JLabel label = new JLabel(new ImageIcon(img)); frame.getContentPane().add(label, BorderLayout.CENTER); frame.pack(); frame.s...
0
@Override public void send(String msg, User user) { for (User u : users) { if (!u.equals(user) && user instanceof PrivilegedUser && u instanceof PrivilegedUser) { // security workaround ((PrivilegedUser) u).handleSecret(msg); } else if (!u.equals(user) && !(user insta...
6
public Screen() { super(); paused = false; screen = new Square[22][10]; for (int row = 0; row < 20; ++row) { for (int col = 0; col < 10; ++col) { screen[row][col] = new Square(true, Color.BLUE); } } for(int i = 0; i < 10; ++i){ screen[20][i] = new Square(false, Color.BLACK); screen[21][i] = ...
3
private String createEventMessage(long time, String eventName, List<MMTFieldValueHeader> fieldValueElements) { String retval = ""; if(this.payloadFormat.equals(this.RFC2822)){ retval = createRequestLine(time, eventName); for (MMTFieldValueHeader fvh : fieldValueElements) { ...
3
public static Keyword invertUpdateMode(Keyword updatemode) { if (updatemode == Logic.KWD_ASSERT_TRUE) { return (Logic.KWD_ASSERT_FALSE); } else if (updatemode == Logic.KWD_PRESUME_TRUE) { return (Logic.KWD_PRESUME_FALSE); } else if (updatemode == Logic.KWD_RETRACT_TRUE) { return (L...
6
@Override public int compareTo(AstronomicalObject o) { return (this.mass < o.mass) ? -1 : (this.mass > o.mass) ? 1 : 0; }
2
@Override public void mouseClicked(MouseEvent e) { p = e.getPoint(); if(hideButton.contains(p) && hide == false){ hide = true; }else if(hideButton.contains(p) && hide == true){ hide = false; } }
4
public void run() { while (true) { if (server.quit) return; try { //System.out.println("Reading..."); PlayerCommand pc = (PlayerCommand) ois.readObject(); if (pc.command == PlayerCommand.MESSAGE) { String message = pc.message; if (p...
5
* @return the percent as a float */ public float getUniquePercentage( short version ) { int totalLen = 0; int uniqueLen = 0; if ( numVersions()==1 ) return 0.0f; else { for ( int i=0;i<pairs.size();i++ ) { Pair p = pairs.get( i ); if ( p.versions.nextSetBit(version)==version ) { ...
4
protected static Ptg calcLarge( Ptg[] operands ) throws CalculationException { if( operands.length != 2 ) { return new PtgErr( PtgErr.ERROR_VALUE ); } Ptg rng = operands[0]; Ptg[] array = PtgCalculator.getAllComponents( rng ); if( array.length == 0 ) { return new PtgErr( PtgErr.ERROR_NUM ); } i...
7
public boolean isAlive() { return this.health <=0 ; }
0
private String CharToPN(char c) { // binary format of ascii of char c String binaryStringShort = Integer.toBinaryString((int)c); // fill the 0s to get 8 bits StringBuffer paddingBuffer = new StringBuffer(); while(paddingBuffer.length() < 8 - binaryStringShort.length()) { paddingBuffer.append("0"); ...
3
public ModularityDetection(LinkedList<KeyWord> partKeywords, double[][] correlations, float startDay, float endDay, int window_, String nwtFolder_) throws Exception{ this.startDay = startDay; this.endDay = endDay; window = window_; nwtFolder = nwtFolder_; // instantiate structure NodeFactory<Node> node...
7
private static ArrayList<Branch> loadBranch(ArrayList<String> texts) { ArrayList<String> strings = new ArrayList<String>(); ArrayList<Branch> branches = new ArrayList<Branch>(); int startLine = 0; for(int lineNumber = 0;lineNumber < texts.size();lineNumber++){ String aString = texts.get(lineNumber); if(...
5
private void commenceTrade() { try { if(host) { Pokemon temp=new Pokemon(Pokemon.Species.BULBASAUR); //Strings temp.species=Pokemon.Species.valueOf(inTacular.readUTF()); outTacular.writeUTF(""+JokemonDriver.partyPokemon[JokemonDriver.offerIndex].species); o...
2
public void moveEntity(Entity e, int dx, int dy) { //move entity //attempt to animate the movement //if cursor... if (e==input.entity) { //if within the map boundaries (0,0) to (map[0].length, map.length)... if (! (e.x+dx < 0 || e.y+dy < 0 || e.x+dx >= map[0].length || e.y+dy >= map.length)) { ...
9
@Override public void run() { while (true) { try { // take next action and handle it DoItLater action = actionQueue.take(); action.doIt(); } catch (InterruptedException e) { } } }
2
public int available() throws IOException { if( this.isClosed ) return 0; if( this.currentReplacementBuffer != null ) return this.currentReplacementBuffer.available(); if( this.multiIn.eoiReached() ) return 0; else return 1; }
3
public int GetDeviceID(String deviceName, int userID) throws Exception { String s = "-8"; int id = -2; try { // This will load the MySQL driver, each DB has its own driver Class.forName("com.mysql.jdbc.Driver"); // Setup the connection with the DB _connect = DriverManager.getConnection(_url, _user, _p...
2
private void doViewAllXinWen(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String pageNum = StringUtil.toString(request.getParameter("pageNum")); if("".equals(pageNum)) { pageNum = "1"; } try { Pager<XinWen> page...
2
public void setMatrix(int rows, int columns){ if ((rows<1)||(columns<1)) { System.out.println("number of rows and columns must be positive integer"); } this.rows=rows; this.columns=columns; elements=new double[rows][columns]; if (columns==rows){ de...
3
public void criarEncarregado(Usuario Encarregado, Usuario userLogado) throws SQLException, excecaoEncarregadoExistente, excecaoControleAcesso { UsuarioDAO userDAO = new UsuarioDAO(); DepartamentoDAO DepDAO = new DepartamentoDAO(); Usuario EncarregadoExistente = userDAO.selectEncarregado(Encarre...
6
public ControlsFrame(String title, final CropScreen attatched) { super(title); this.attatched = attatched; ActionListener langChanged = new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { ControlsFrame.this.attatched.setLanguage(((JRadioButton)arg0.getSource()).get...
8
public void sortingPricesForRefrigirators() { getDriver().findElement(By.xpath(SortingLine.SORT_PRICE)).click(); List<Item> data = new ArrayList<Item>(); int pageCount = 0; while (true && pageCount++ < 3) { data.addAll(grabItems()); if (hasNext()) { next(); } else { break; } } System.ou...
5
public void RestoreOriginalPHPFile(DatabaseAccess JavaDBAccess, int TARGET_PHP_FILES_ID) { PreparedStatement ps = null; String PHPFileText; //The text of the PHP file where we want to inject the vulnerabilities String PATH = ""; Connection conn = null; try { if ((co...
6
private Player getPlayer(String name){ if(name == null) return null; for(Player p : allPlayers){ if(p.getName().equals(name)){ return p; } } return null; }
3
private Boolean checkForValidFile(File dataFile){ final JPanel frame = new JPanel(); if(!checkForCommas(dataFile)){ JOptionPane.showMessageDialog(frame, "File not compatible (contains no commas)", "File error", JOptionPane.ERROR_MESSAG...
3
public CommandParams addParam(Object value) { params.add(value); return this; }
0
public void startFadeOut() { if(transitionTime > 0.0f && getCurrentSong() != getNextSong(false) && !stopping) { EIError.debugMsg("startFadeOut"); hitFadeOutNext = true; startNextSong(); } }
3
public void processSaveAndExit() { // write to the RefereesOut.txt file writeRefereesOutFile(); // write to the MatchAllocs.txt file if (matchList != null) writeMatchAllocationsFile(matchList); System.exit(0); }
1
public CobolLine getCobolLine(final String sourceLine, final int lineNumber) { final Matcher m = sourceFormat.matcher(sourceLine); final boolean fixedLine = (m.matches() && sourceLine.startsWith("$")) ? false : fixedFormat; final int[] tabs = (fixedLine) ? CobolLineFixed.getTabs()...
6
public double getStrength() { return strength; }
0
public ResultSet BuscarFuncionarios(String Departamento) throws SQLException { Connection conexao = null; PreparedStatement comando = null; ResultSet resultado = null; try { conexao = BancoDadosUtil.getConnection(); comando = conexao.prepareStatement(SQL_SELEC...
6
public void handleError(Client source, Throwable t) { if (networkClient != null && !networkClient.isConnected()) { System.err.println("CLIENT: network error. Connection is closed"); } else { System.err.println("NETWORK ERROR: " + t.getMessage()); if (t instanceof Co...
4
public java.security.cert.X509Certificate[] getAcceptedIssuers() { java.security.cert.X509Certificate[] chain = null; try { TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); KeyStore tks = KeyStore.getInstance("JKS"); tks.load(this.getClas...
1
private char[][] build_sub_block(String setting, char[] key_alphabet, int[] key_block) { int set_len=setting.length(); char[][] result=new char[set_len+1][26]; char[] pt=read_pt(key_alphabet,key_block); for(int i=0;i<26;i++) { result[0][i]=pt[i]; } //create ct: set_len*26 String setting_u=setting.to...
4
* @return returns true if Thing is clicked, false otherwise. */ public boolean checkIfClicked(Point mousePos){ //Transparent color seems to give two different results depending on which program exported them int transparentColorID1 = 16777215; int transparentColorID2 = 0; System.out.println(img.getRGB(...
6
public boolean equals(Object obj) { if (obj == this) { return true; } if (obj != null && obj instanceof Point) { Point other = (Point)obj; if (other.x == x && other.y == y) { return true; } } return false; }
5
private boolean r_Step_1c() { int v_1; // (, line 51 // [, line 52 ket = cursor; // or, line 52 lab0: do { v_1 = limit - cursor; lab1: do { ...
8
public static void main(String[] args) throws InvalidPositionException, NoEmptyTreeException, InvalidKeyException, BoundaryViolationException, EmptyTreeException { // test binary tree AdvancedBinaryTree<Integer> tbt = new AdvancedBinaryTree<>( new Comparator<Integer>() { @Override public int c...
7
private ArrayList rewriteJListToArrayList(JList list) { ArrayList newList = new ArrayList(); for (int i = 0; i < list.getModel().getSize(); i++) { if (list.getModel().getElementAt(i) != null) newList.add(list.getModel().getElementAt(i)); } return newList; }
2
public String getMessage() { switch (reason) { case BAD_ARGS: return "Bad Arguments"; case BAD_TARGET: return "Bad Target Entity"; case BAD_COMMAND: return "Bad Command"; case BAD_STRING: return "Bad String"; default: return null; } }
4
public BufferedImage getBitmap(int id) { BufferedImage value; if(!low_memory && bmp_loaded != null && (value = bmp_loaded[id]) != null) { return value; } else { long offset = getBitmapOffset(id); if(offset == -1) throw new NXException("NX file does not this canvas."); lock(); try { Seek...
7
private void saveDependencies() throws ConfigurationChangeException { // Abhängigkeiten nur speichern, wenn mindestens Version 9 des Metamodells vorliegt if(!_storeDependencies) return; synchronized(_areasDependencies) { // Alle Aufrufe in diesem Block können zu Festplattenzugriffen führen. Das kann diese Me...
7