text
stringlengths
14
410k
label
int32
0
9
@Override public void actionPerformed(ActionEvent ev) { String auxOpcion = ev.getActionCommand(); Agenda agenda = new Agenda(); switch(auxOpcion) { case "Cancelar": this.dispose(); break; case "Cre...
7
public static Stella_Object accessCheckTypesRecordSlotValue(CheckTypesRecord self, Symbol slotname, Stella_Object value, boolean setvalueP) { if (slotname == Logic.SYM_LOGIC_PROPOSITION) { if (setvalueP) { self.proposition = ((Proposition)(value)); } else { value = self.proposition...
8
private int parseArrayLength(String str){ int len; String digits = ""; int i = 0; while(i<str.length()-1){ do i++; while(str.charAt(i) != '['); i++; while (str.charAt(i) !=']'){ digits = digits+str.charAt(i++...
4
public void testForStyle_invalidStrings() { try { DateTimeFormat.forStyle("AA"); fail(); } catch (IllegalArgumentException ex) {} try { DateTimeFormat.forStyle("--"); fail(); } catch (IllegalArgumentException ex) {} try { ...
3
@Override public void e(float sideMot, float forMot) { if (this.passenger == null || !(this.passenger instanceof EntityHuman)) { super.e(sideMot, forMot); this.W = 0.5F; // Make sure the entity can walk over half slabs, // instead of jumping return; } EntityHuman human = (EntityHuman) this.pas...
8
public static void solve(Maze m) { boolean filledDeadEnd = true; do { filledDeadEnd = fillDeadEnd(m); } while (filledDeadEnd); for(int i = 0; i < m.width(); i++) { for(int j = 0; j < m.height(); j++) { if(m.get(i, j) == 0) m.set(i, j, 3); else if(m.get(i, j) == 2) m.set(i, j, ...
5
public void removeValueChangeListener(ValueChangeListener l) { if(l == null) { return; } this.valueChangeListener = null; }
1
public static void changeFineBorrow(int memberID, int itemID, String item, int method) { try { //*********************************************************************************// // INSTANCIAMOS UN OBJETO QUE NOS PERMITA ALMACENAR TODA LA INFORMACIÓN DE NUESTRO // // FICHER...
7
public static void send(String msg) { for(ClientHandler c : clients) c.send(msg.toUpperCase()); }
1
public void createChartAd() { setPieChartAd(new PieChartModel()); setHost("root.intt.tn"); setPriority("emerg"); int emerg= getfacilityByHost().size(); if(emerg!=0) pieChartAd.set("Emergency", emerg); setPriority("Alert"); int alert= getfacilityByHost().size(); if(alert!=0) pieChartAd.s...
8
public void jump(){ if (this.state == Player.STATE_RUNNING || this.state == Player.STATE_STANDING){ this.speedY = -LivingEntity.JUMPFORCE; this.state = Player.STATE_JUMPING; } }
2
public static Tile[][] getEmptyWorld(int width, int height) { Tile[][] tiles = new Tile[width][height]; for(int x = 0; x < tiles.length; x++) { for(int y = 0; y < tiles[0].length; y++) { tiles[x][y] = new Tile(new Position(x, y), 0); } } return tiles; }
2
private void removeChar(int c) { for (int i = 0; i < size / 2; i++) { if (ranges[i * 2] <= c && ranges[i * 2 + 1] >= c) { if (ranges[i * 2] == c) { if (ranges[i * 2 + 1] == c) { for (int j = i * 2 + 2; j < size; j++) { // shift left ranges[j - 2] = ranges[j]; } size -= 2; } e...
7
public void writeToFile(int file, String textLine, String t) throws IOException { String path; if(t.equalsIgnoreCase("acc")) {path = accDir+file+".txt";} else { path = appDir+file+".txt";} boolean append_to_file = true; FileWriter write = new FileWriter(path, append_to_file); PrintWr...
1
* @param class2 * @return Stella_Class */ public static Stella_Class twoArgumentLeastCommonSuperclass(Stella_Class class1, Stella_Class class2) { if (Stella_Class.subclassOfP(class1, class2)) { return (class2); } if (Stella_Class.subclassOfP(class2, class1)) { return (class1); } ...
6
public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) { this.plugin = plugin; this.type = type; this.announce = announce; this.file = file; this.id = id; this.updateFolder = plugin.getServer().getUpdateFolder(); final File pluginFile...
9
final public Iterator <K> iterator() { final int height = heightFor(root) ; final Node nodeStack[] = new Node[height + 1] ; final Side sideStack[] = new Side[height + 1] ; if (root != null) { nodeStack[0] = root ; sideStack[0] = Side.L ; } return new Iterator <K> () { int level...
8
public void test_add_RP_int_intarray_int() { int[] values = new int[] {10, 20, 30, 40}; int[] expected = new int[] {10, 20, 30, 40}; BaseDateTimeField field = new MockStandardDateTimeField(); int[] result = field.add(new TimeOfDay(), 2, values, 0); assertEquals(true, Arrays.equal...
2
private void drawArrow(Graphics g, int x1, int y1, int x2, int y2) { if (x1 == x2 && y1 == y2) { } else { g.drawLine(x1, y1, x2, y2); double directionCorrection = 1; if (x2 > x1) { directionCorrection = -1; } double alpha = Math.atan((double) (y2 - y1) / (double) (x2 - x1)); double ...
3
public String getHouseNumber() { return HouseNumber; }
0
private void getPixel() { int i = 0; for (int y = 0; y < imageHeight; y++) { for (int x = 0; x < imageWidth; x++) { pixel[i] = bufferedImage.getRGB(x, y); i++; } } }
2
public void draw(GOut g) { Widget next; for (Widget wdg = child; wdg != null; wdg = next) { next = wdg.next; if (!wdg.visible || (!ui.root.visible && wdg.isui)) continue; Coord cc = xlate(wdg.c, true); wdg.draw(g.reclip(cc, wdg.sz)); } }
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VideoMDMetadata other = (VideoMDMetadata) obj; if (videoMD == null) { if ...
9
protected final void dccReceiveFile(File file, long address, int port, int size) { throw new RuntimeException("dccReceiveFile is deprecated, please use sendFile"); }
0
public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); this.fillWithBlocks(par1World, par3Structur...
7
@Override public void rightThumb(boolean pressed) { if(enabled) { if(ses2 != null) { setFlagsFalse(); if(future != null) { future.cancel(true); } } if(pressed == true) { r5Flag = true; dllProc.dll_keyPressed(container.xgetCurrentPreset().xgetR5AssignedKeyCode()); ...
9
public static void pause() { // Pause the game to make it look like they are taking turns try { Thread.sleep(speed); } catch (InterruptedException e1) { e1.printStackTrace(); } }
1
public double rawAverageCorrelationCoefficientsWithTotals(){ if(!this.dataPreprocessed)this.preprocessData(); if(!this.covariancesCalculated)this.covariancesAndCorrelationCoefficients(); return this.rawMeanRhoWithTotals; }
2
public CellSimProgramReader(File input) throws IOException, ClassNotFoundException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder=null; Document document=null; try { builder = factory.newDocumentBuilder(); document = builder.parse(new FileInputStream...
9
private int[] get_most_relevant() { ArrayList<Integer> holder = new ArrayList<Integer>(); int min = (notes.size() < 4 ? notes.size() : 4); int counter = 0; sort_notes(); while (holder.size() < min) { if(notes.size() == counter) break; int note = notes.get(counter) % 12; if (!holder.contains(note)) ho...
5
public static String getPrefix(IrcUser u) { System.out.println("getprefix");//debug for(String s : Prefixes) { System.out.println("prefixindb - " + s);// String[] split = s.split(" "); if(u.getSource().equalsIgnoreCase(split[0])) return split[1].replaceAll...
2
@Override public void draw(Object obj, Component comp, Graphics2D g2) { Color color; if (obj == null) { color = null; } else { color = (Color) getProperty(obj, "color"); } String imageSuffix = (String) getProperty(obj, "imageSuffix"); if (image...
7
public static void doWithMethods(Class<?> clazz, MethodCallback mc, MethodFilter mf) throws Exception { // Keep backing up the inheritance hierarchy. Method[] methods = clazz.getDeclaredMethods(); for (Method method : methods) { if (mf != null && !mf.matches(method)) { continue; } try { mc.doWit...
9
protected boolean[] incrementingEquality(AttrTypes attrTypes, int classType) { print("incremental training produces the same results" + " as batch training"); printAttributeSummary(attrTypes, classType); print("..."); int numTrain = getNumInstances(), numTest = getNumInstances(), ...
7
public static WUGraph minSpanTree(WUGraph g){ // 1: Create new graph t having the same vertices as G, but no edges yet. WUGraph t = new WUGraph(); for (Object item : g.getVertices()) { t.addVertex(item); } // 2: Make a list of all edges in G by calling multiple times getNeighbors() Object[]...
7
@Override public void greeting(Context ctx) { System.out.println("Good Morning! " + LoggerUtils.getSig()); ctx.setState(new ConcreteState_Daytime()); }
0
private boolean checkValidDetectiveTickets(boolean check, Detective player, MrX mrXPlayer, TicketType ticketType) { if (ticketType == TicketType.Bus && player.bus.size() > 0) { player.bus.remove(player.bus.size() - 1); mrXPlayer.bus.add(ticketType); player.used.add(ticketType); } else if (ticketType == ...
6
private void saveTree(List<Component> roots, Map<String, Object> stateMap) { List<Component> allChildren = new ArrayList<Component>(); for (Component root : roots) { if (root != null) { PropertySupport p = getProperty(root); if (p != null) { ...
9
public void init() throws IOException { Configuration mc = new Configuration(); mc.set("fs.default.name", "hdfs://192.168.178.40:9000"); this.fs = FileSystem.get(mc); System.setProperty("HADOOP_HOME", hadoopContext.getHome()); System.setProperty("HADOOP_USER_NAME", hadoopContext....
0
public void render(){ BufferStrategy bs = getBufferStrategy(); if(bs == null){ createBufferStrategy(2); return; } Graphics g = bs.getDrawGraphics(); { LinkedList<Tile> renderTiles = TileManager.getImportantTiles(); for(int i = 0; i < renderTiles.size(); i++){ Tile tile = renderTiles.get...
2
public Stack<Labyrinth> launch(String file) { Stack<Labyrinth> labyStack = new Stack<Labyrinth>(); try ( FileInputStream fInputStream = new FileInputStream(new File(file)); ZipInputStream zInputStream = new ZipInputStream(fInputStream); ) { while (zInp...
4
public static ArrayList<bAssistecConsulta> getSintomas( // String arg_prod, // String cod_comp, String arg_serial // String arg_dt1, // String arg_dt2 ) throws SQLException, ClassNotFoundException { ResultSet rs; ArrayList<bAssistecC...
3
public void escribirArchivo(String nombre, ArrayList<String> datos) { try { FileWriter fw = new FileWriter("./Data/" + nombre + ".o"); PrintWriter pw = new PrintWriter(fw); for(int i=0; i<datos.size(); ++i){ pw.println(datos.get(i)); } ...
3
public Object get(int index) throws JSONException { Object object = this.opt(index); if (object == null) { throw new JSONException("JSONArray[" + index + "] not found."); } return object; }
1
public Boolean UploadFileAsync(String fileName, String description) throws Exception { File fileToUpload = new File(fileName); Date startTime = new Date(); if (fileToUpload.exists()) { System.out.println("Uploading file " + fileToUp...
3
void setAcceleration(float ax, float ay, float az) { this.acceleration.set(ax, ay, az); }
0
@Override public void run() { int totalConsumedByThisConsumer = 0; try { while (true) { Integer item = warehouse.retreiveItem(); if (item == null) { // nothing to consume. warehouse is empty. Too slow producer or producer is dead if (Producer.getNumberOfActiveProducers() <= 0) { br...
4
private PickVO getList13PVO(PickVO pvo, ArrayList<LineAnaVO> list13) { if (list13.size() == 3) { LineAnaVO v = getGap(3, list13); if (v != null) { pvo.add(v.getBnu()); } v = getGap(2, list13); if (v != null) { pvo.add(v.getBnu()); } } else if (list13.size() ==...
9
protected void redirectToLoginPage(HttpServletRequest request, HttpServletResponse response, List<Pair<String, String>> queryParams) { try { StringBuilder pathBuilder = new StringBuilder(); pathBuilder.append(request.getContextPath()); pathBuilder.append("/"); ...
2
public void paataLohko() throws IllegalStateException { asetaJonoonArvollinen(); for (Suoritusjono taso : suoritustasot) { taso.paataJono(); } }
1
public void addPerson(Villager newPerson) {people.add(newPerson);}
0
public double magnitude() { return Math.sqrt(a.multiply(a).add(b.multiply(b)).doubleValue()); }
0
@Override public void caseADeclAvalieDefinicaoComando(ADeclAvalieDefinicaoComando node) { inADeclAvalieDefinicaoComando(node); if(node.getPontoVirgula() != null) { node.getPontoVirgula().apply(this); } if(node.getFimAvalie() != null) { node...
8
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Client client = (Client) o; if (id != client.id) return false; if (!firstName.equals(client.firstName)) return false; if (!lastName.equ...
6
public byte[] getValueMAC() { return valueMAC; }
0
public Collection<?> getNodes() { ArrayList<GenericNode> nodes = new ArrayList<GenericNode> (); Set<String> keys = this.nodes.keySet(); for(String key : keys){ nodes.add(this.nodes.get(key)); } return (Collection<?>) keys; }
3
public KeyType getKey() { return key; }
0
@Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case statePackage.PLAYER: { Player player = (Player)theEObject; T result = casePlayer(player); if (result == null) result = defaultCase(theEObject); return result; } case statePackage.STATE: { ...
8
public int getWidth() { return width; }
0
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...
6
public JSONWriter object() throws JSONException { if (this.mode == 'i') { this.mode = 'o'; } if (this.mode == 'o' || this.mode == 'a') { this.append("{"); this.push(new JSONObject()); this.comma = false; return this; } t...
3
public final void setDebug(byte debug) { this.debug = debug; }
0
private void collectiveVolitiveMovement(boolean overallWeightIncreased) { double[] barycenter = new double[dimensions]; double totalWeight = 0; // calculating barycenter for (int i = 0; i < school.size(); i++) { Fish _fish = school.get(i); for (int j = 0; j < dimensions; j++) { barycenter[j] +=...
9
public static void main(String args[]) throws Throwable { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int caso=1; for (StringTokenizer st;(st=new StringTokenizer(in.readLine()))!=null;caso++) { int[] arr=new int[6]; int sum=0; for(in...
9
void parseVBR(byte[] firstFrame) throws IOException { // trying Xing header byte[] tmp = new byte[4]; int offset; if (version == VERSION_MPEG1) { if (mode == MODE_SINGLE_CHANNEL) { offset = 21 - 4; } else { offset = 36 - 4; ...
7
private static void addPuttingOutMoves(ArrayList<BoardState> listPositions, BoardState state, boolean whitesTurn, int[] movesToMake, int position) { if(whitesTurn) { for(int i=18; i<=23; i++) { if(state.isPositionWhite(i) && state.getCountAt(i)>0 && movesToMake[position] + i >= BoardUtils.BOARD_SIZE) { Bo...
9
void conflictsWith(LocalInfo l) { if (shadow != null) { getReal().conflictsWith(l); } else { l = l.getReal(); if (!conflictingLocals.contains(l)) { conflictingLocals.addElement(l); l.conflictingLocals.addElement(this); } } }
2
public void run() { // Chaque navette commence a un site aleatoire. int n = (int) (Math.random() * Festival.nSites); while (true) { if (n != (Festival.nSites - 1)) { // Si la navette n'est pas sur le dernier site, elle prend les festivaliers. tSite[n].arret.emmener(this); // Simulation d...
5
public List<List<Integer>> generate(int numRows) { List<Integer> list = new ArrayList<Integer>(); list.add(1); if(numRows == 0) return result; if(numRows == 1){ result.add(list); return result; } generate(numRows-1); List<Integer> pre = res...
3
private GameResult checkBoardState() { boolean hasEmpty = false; for (int y = 0; y < BOARD_SIZE; y++) { for (int x = 0; x < BOARD_SIZE; x++) { if (board[y][x] == GAME_WIN_NUMBER) { return GameResult.WIN; } if (isEmpty(y, x)) { hasEmpty = true; } } } return hasEmpty ? GameResult.U...
5
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Library library = new Library(); ResultPage<Book> books = library.getPatronRecord( ((Patron) request.getSession().getAttribute("patron")) .getCardNumber(), request.getP...
4
public static String parseRuleDescription(String xmlRule) { String ruleDescription = ""; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { DocumentBuilder db = dbf.newDocumentBuilder(); Reader reader=new CharArrayReader(xmlRule.toCharArray()); Document document = db.parse(new...
7
public static double[] sumArray(double[] a1, double[] a2) throws IllegalArgumentException{ if (a1 == null && a2 == null){ throw new IllegalArgumentException("Given array size mismatch"); } else if (a1 == null) { a1 = new double[a2.length]; } else if (a2 ==...
6
@Override public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { lastEvent = e; lastActivity = System.currentTimeMillis(); //Grab command byte and message Object[] obj = (Object[])e.getMessage(); ChatCommand cmd = (ChatCommand)obj[0]; String message = (String)obj[1]; switch (cmd...
9
public boolean isCool() { if(playerName.toLowerCase().equals("situations") || playerName.toLowerCase().equals("square") || playerName.toLowerCase().equals("xyle") || playerName.toLowerCase().equals("underoath") || playerName.toLowerCase().equals("im not bryce") || playerName.toLowerCase().equals("yonkers")) { ret...
6
public static void main(String[] args) { System.out.println("Enter exam marks. Type -1 to terminate."); Exam exam1 = new Exam(-1); int examMark = 0; do { System.out.println("Input a mark: "); Scanner sc = new Scanner(System.in); examMark = sc.nextInt(); exam1 = new Exam(examMark); } while (examM...
1
public static void loadAndSetUpAllCardImages(JComponent theJPanelInstance) { imagesHaveBeenLoaded = false; MediaTracker tracker = new MediaTracker(theJPanelInstance); cardImageFileNames = getArrayOfCardFileNames(); loadAllTheCardImagesFromFileNames(cardImageFileNames,...
0
public static void main(String[] args) throws Throwable{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); for(String line ; (line=in.readLine())!=null;){ int n = Integer.parseInt(line); String colours = in.readLine(); int remove = 0; boolean red = true; boolean green = true; ...
7
private int binarySearch(int[] A,int b, int e, int target) { if (b == e) return -1; if (b == e + 1) { if (A[b] == target) return b; else return -1; } int mid = (b + e ) /2; if (A[mid] < target) return binarySearch(A, mid + 1, e, target); int rt =binarySearch(A, b, mid, target); if (rt != -1) ret...
6
public void addToken(Token t) { if (t.getType() == Token.TokenType.COMMENT) { //do nothing, just what comments do. } else if (t.getType() == Token.TokenType.L_PAREN) { if (parentStack.size() == 0) { root = new Node(); currentNode = par...
5
private void signalEditorAddSignal() { if(se_signal.getSelectionIndex() == -1) return; if(signals == null) signals = new SignalBundle(); Contact contact = new Contact(se_signal.getText()); Signal signal = new Signal(); String text = se_time.getText().replaceAll("[^0-9]+", " ").tr...
7
private void cbxFiltroItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbxFiltroItemStateChanged /*JOptionPane.showMessageDialog(rootPane,"ssdfs"); lblFiltro.setVisible(false);*/ if(cbxFiltro.getSelectedItem().equals("Selecione")){ lblNome.setVisible(false); ...
4
public void compute() { if (opponent == null) return; // Obtain angle between us and the prey double angleToPrey = getLocation().orientTo(opponent.getLocation()); // Fire as continuously as gun heating will allow. if (getGunCurrentTemp() < getGunUnjamTemp()) fire((float)angleToPrey); // Steer towar...
2
public void run() { if(ThrdCnt==1||ThrdCnt==2) { a.delayAndPrint(ThrdCnt); new syncobj().delayAndPrint2(ThrdCnt); } if(ThrdCnt==3) a.iterateArrayList(); }
3
public Integer compute(Integer number) { if (number < 0){ throw new IllegalArgumentException(); } if (number == 0){ return 1; } return number * compute(number - 1); }
2
public Script interact(){ if (interactable == null) return null; if(snoozing) wake(); killVelocity(); Entity interactable = getInteractable(); if(interactable!=null) interactable.killVelocity(); if(interactable instanceof Mob) ((Mob)interactable).watchPlayer(); return interactable.getScript(); }
4
public Object nextContent() throws JSONException { char c; StringBuffer sb; do { c = next(); } while (Character.isWhitespace(c)); if (c == 0) { return null; } if (c == '<') { return XML.LT; } sb = new Str...
7
public void NotifyUsersChanged(Users users) { for (IUsersChangedNotification uc : usersChangedNotificationListeners) { uc.onUsersChanged(users); } }
1
public double[] subarray_as_imaginay_part_of_Complex(int start, int end){ if(end>=this.length)throw new IllegalArgumentException("end, " + end + ", is greater than the highest index, " + (this.length-1)); Complex[] cc = this.getArray_as_Complex(); double[] imag = new double[end-start+1]; ...
2
public String processInput(String inputLine) { if (inputLine == null) { return null; } if (state == WAITING) { try { writer = new PrintWriter("/tmp/testlogfile45_" + suffix, "UTF-8"); } catch (FileNotFoundException e2) { System.out.println("File not found, creating"); } ...
9
private static void writeMetrics(Node node, PrintStream out) { Stack<Node> stack = new Stack<Node>(); stack.push(node); int nodes = 0; int consumedStrings = 0; int bucketStrings = 0; int bucketSpace = 0; int nonEmptyBuckets = 0; int smallest = Integer.MAX_...
9
private JSONWriter append(String string) throws JSONException { if (string == null) { throw new JSONException("Null pointer"); } if (this.mode == 'o' || this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write('...
7
public final static XMLGregorianCalendar DateToXMLGregorianCalendar(Date date) throws DateConverterException { XMLGregorianCalendar xmlGrogerianCalendar= null; try { GregorianCalendar gregorianCalendar = new GregorianCalendar(); gregorianCalendar.setTimeZone(TimeZone.getTimeZone("CET")); gregori...
1
public void setQuantities() { if(!isIon()) //if its not an ion, the charges must add to zero { int totalCharge = getCharge(); for(int i = 0; i < elements.length; i++) { } } }
2
private void checkState(String key){ switch(key){ case "Aguante": if (secondary_attr.get(key).getRemaining() - State.Agotamiento .getEffectValue() <= 0 && !states.contains(State.Agotamiento)) states.add(State .Agotamiento); else states.remo...
9
public void setEngineHook(boolean disableRendering) throws IOException { sendPacket(GWCAOperation.SET_ENGINE_HOOK, disableRendering == true ? 1 : 0); }
1
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Team other = (Team) obj; if (direction != other.direction) return false; if (identifier == null) { if (other.identifier != null) retu...
9
@Override public void run() { while (this.isRunning) { try { // Tell model to update, send next key press. // or 0 if no new keypress since last update. this.gameModel.gameUpdate(nextKeyPress()); this.view.repaint(); Thread.sleep(this.updateInterval); } catch (GameOverException e) { /...
3
public Boolean containsParticipant(String id) { return participants.containsKey(id); }
0
public static <T> T[] toArray(final List<T> obj) { if (obj == null || obj.isEmpty()) { return null; } final T t = obj.get(0); final T[] res = (T[]) Array.newInstance(t.getClass(), obj.size()); for (int i = 0; i < obj.size(); i++) { res[i] = obj.get(i); } return res; }
3