text
stringlengths
14
410k
label
int32
0
9
public boolean checkWaterHeight (World world, int x, int y) { Tile tile; tile = world.getTile(x, y+1); if (tile.id == Tile.water.id || tile.id == Tile.flowingWater.id) return false; int myheight = getHeight(world, x, y); tile = world.getTile(x+1, y); if (tile...
8
public String getNeuronName(Neuron neuron) { for (int i = 0; i < this.neurons.size(); i++) { for (int s = 0; s < this.neurons.get(i).size(); s++) { if (this.neurons.get(i).get(s) == neuron) { return "Neuron" + i + s; } } } throw new IllegalArgumentException( "The given Neuron is not Part of...
3
private static UserNotificationBuffer getMonitorFor(long uid) { UserNotificationBuffer rtn = null; if(monitors.containsKey(uid)) { return monitors.get(uid); } else { rtn = new UserNotificationBuffer(uid); monitors.put(uid, rtn); return rtn; } }
1
public void resetStepThrough() { stepThrough = ""; }
0
public static void logError(Exception e) { File dir = new File(System.getProperty("user.dir") + "/Errors"); if(!dir.exists()) { dir.mkdir(); } DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd HH_mm_ss"); Date date = new Date(); File file = new File(dir + "/Error " + dateFormat.format(date) ...
4
public List<Triangle> parse(String path) { List<Triangle> result = null; BufferedReader reader = null; try { if (path.startsWith("classpath:")) { path = path.substring("classpath:".length()); reader = new BufferedReader(new Inp...
5
private java.awt.image.BufferedImage create_EFFECT_Image(final int WIDTH, final int HEIGHT, final boolean CLICKED) { if (WIDTH <= 0 || HEIGHT <= 0) { return null; } final java.awt.GraphicsConfiguration GFX_CONF = java.awt.GraphicsEnvironment .getLocalGraphicsEnvironment().getDefaultScreenDevice() ....
7
public void openXML(ObjectManager manager, double scale) { manager.clear(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { //Using factory get an instance of document builder DocumentBuilder db = dbf.newDocumentBuilder(); //parse...
8
protected void previous() { ParseNode previous=myParser.getPreviousAnswer(); addAnswerToList(previous.getDerivation()); treePanel.setAnswer(previous); treePanel.repaint(); if (previous.getProductions().length>0) statusDisplay.setText("Derived current Strings using "+previous.getProductions()[0]+" producti...
2
public static final Position getByValue(int v) { switch (v) { case 0: return NORTH; case 1: return SOUTH; case 2: return EAST; case 3: return WEST; case 4: return CENTER; default: throw new Il...
5
public static ClientApp getClientApp() { if(instance == null) instance = new ClientApp(); return instance; }
1
private String readFromStream(InputStream stream) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(stream)); String line = null; boolean first = true; StringBuilder out = new StringBuilder(); while ((line = in.readLine()) != null) { if (first) { first = false; } else...
2
public void setScheduler( Scheduler scheduler ) { this.scheduler = scheduler; }
0
public List<Position> getDestinations(Position start, Player.Orientation orientation, Board board) { List<Position> destinations = new ArrayList<Position>(); int xDest, yDest; if (orientation == Player.Orientation.UP) { xDest = start.getX() + destination.getX(); yDest =...
7
public CadastroRevisoes(String entrada, Revista revista) throws FileNotFoundException { this.entrada = entrada; this.revista = revista; File arquivo = new File(entrada); Scanner scanner = new Scanner(arquivo); String cabecalho = scanner.nextLine(); while (scanner.hasNextLine(...
9
public int getTotalMovies(){ int movieCount = 0; //Count all movies for(Actor a : actors.values()){ for(Movie m : a.getMovieAppearances()){ if (!m.isVisited()){ movieCount++; m.setVisited(true); } } } //Reset all of the movie flags for(Actor a : actors.values()){ for(Movie m...
6
@SuppressWarnings("deprecation") void playExecution() { for(ThreadsInformation threadInfo : ThreadsAgent) threadInfo.threadInfo.resume(); }
1
public DirectedCycle(Digraph G) { marked = new boolean[G.V()]; onStack = new boolean[G.V()]; edgeTo = new int[G.V()]; for (int v = 0; v < G.V(); v++) if (!marked[v]) dfs(G, v); }
2
private void processAllParticipants() { user_messages = new HashMap<String,String>(); //reset checks room_bot.current_standup_user = null; room_bot.did_user_speak = false; room_bot.did_user_say_anything = false; HipchatUser next_user = null; StringBuilder sb = new StringBuilder(); while ( (next_user = ...
9
public final static int parseInt(String value) { if (isInt(value)) return Integer.parseInt(value); return 0; }
1
@Test public void reTest6() { userInput.add("hi"); userInput.add("my name is meng meng"); userInput.add("can you bring me something"); userInput.add("knife"); userInput.add("errorhandling"); userInput.add("errorhandling"); userInput.add("errorhandling"); userInput.add("errorhandling"); userInput.add(...
7
public void BudujTabele(){ current=0; //wysokosc jedenj ramki 22piks HLevel=22; for(int i=0 ; i<ILOSC_POL ; i++) pola[i].setVisible(false); for (int i=0 ; i<Posilek.ILOSC_SKLADNIKOW ; i++){ DeleteAction[i].setValue(0); } for (int i =0 ; i<pos.current ; i++){ skl = BazaObject.IteratorSkladni...
6
static public OutputChannels fromInt(int code) { switch (code) { case LEFT_CHANNEL: return LEFT; case RIGHT_CHANNEL: return RIGHT; case BOTH_CHANNELS: return BOTH; case DOWNMIX_CHANNELS: return DOWNMIX; default: throw new IllegalArgumentException("Invalid channel code: "+code); } }
4
@PostConstruct public void init() { httpHandler = new HttpHandler(); try { URL requestUrl = new URL("http://services.brics.dk/java4/cloud" + "/listItems?shopID=" + "195"); Element responseRoot = httpHandler.HttpRequest("GET", requestUrl) .getRootElement(); if (responseRoot == null) { ...
9
private void jComboBoxPaysItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBoxPaysItemStateChanged if (evt.getStateChange() == ItemEvent.SELECTED){ String test = ((Pays)this.jComboBoxPays.getSelectedItem()).getPays(); this.jTextFie...
2
@Override public Term parseTerm() throws IOException { Term term = new Term(); term.getFactorList().add(parseFactor()); while (curToken.type == DIVIDE || curToken.type == MULTIPLY) { switch (curToken.type) { case DIVIDE: curTok...
4
public List<Region> getRegions(RegionType type) { List<Region> regions = new ArrayList<Region>(); for (Region region : this.mapRegions) { if (region.getType() == type) { regions.add(region); } } return regions; }
2
@Test public void t_gd2gc() /** ** ** Test jauGd2gc function. ** ** Returned: ** status int TRUE = success, FALSE = fail ** ** Called: jauGd2gc, viv, vvd ** ** This revision: 2009 November 6 */ { double e = 3.1, p = -0.5, h = 2500.0; ...
5
public boolean reserve(int theaterID) throws RemoteException{ if(this.lastRequest == -1) this.lastRequest = System.currentTimeMillis(); if(connectionTimout()) return false; ReservationReplyMessage reply; reply = rmiServer.reservationRequest(this.ID, theaterID, reservation); if(reply != null)...
3
public String getSkillName() { return skillName; }
0
private void Traversal(TreeNode root,ArrayList<Integer> list) { if(root != null){ list.add(root.val); Traversal(root.left,list); Traversal(root.right,list); } }
1
private JButton generiereNeuenHandKartenKnopf(Karte neueKarte) { JButton handkarte = new JButton(neueKarte.getStadt().toString()); handkarte.setBackground(neueKarte.getStadt().getLand().getFarbe()); handkarte.setForeground(new Color(255, 255, 255)); handkarte.addActionListener(new Action...
9
public final JSONArray optJSONArray(String key) { Object o = opt(key); return o instanceof JSONArray ? (JSONArray)o : null; }
1
public boolean equalsExpr(final Expr other) { return (other != null) && (other instanceof FieldExpr) && ((FieldExpr) other).field.equals(field) && ((FieldExpr) other).object.equalsExpr(object); }
3
public void affiche () { int i = 0; int j = 0; while ( i < tableauDesCaisses.length ) { tableauDesCaisses[i].affiche(); i = i + 1; } System.out.print("Tous les ronchons: "); i = 0; int nbTotalRonchons = 0; int nbTotalRonchonnement = 0; if ( listeDesRonchons.size() == 0 ) { System.out.print("<...
7
@Override public Object getValueAt(int row, int col) { FSE theFSE = (FSE) theData.get(row); switch(col) { case 0: return theFSE.getCode(); case 1: return theFSE.getName(); case 2: return theFSE.getAddress().g...
4
public ConfigurationDialog(ClientMain parent) { super(parent, I18n.getInstance().getString("cfdTitle"), true); this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout(10,10)); panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); panel.setPr...
5
@Override public boolean isHygienicMessage(final CMMsg msg, final int minHygiene, final long adjHygiene) { if(CMSecurity.isDisabled(CMSecurity.DisFlag.HYGIENE)) return false; if((msg.sourceMajor(CMMsg.MASK_MOVE) &&((msg.tool()==null) ||(!(msg.tool() instanceof Ability)) ||((((Ability)msg.tool()).classi...
9
static void printSystem ( Fraction[][] matrix ) { int spaces; out.printf( "\n" ); for ( int i = 1; i <= rows; i++ ){ for ( int j =1; j <= columns; j++ ) { if ( j != columns ){ if ( matrix[i][j].getNumerator() != 0 ){ spaces = maxLength - matrix[i][...
7
public static boolean checking(String person){ String[] dataArray = null; String target; double numOfone = 0; boolean notOne = false; try { BufferedReader csvFile = new BufferedReader(new FileReader("parserResult/coauthor_degree.csv")); while((target = csvFile.readLine())!= null){ dataArray = targe...
7
private Point2D scalePoint(Point2D point, Dimension2D size) { Point2D scale = null; try { scale = (Point2D) point.getClass().newInstance(); if (inverted) scale.setLocation(point.getX() * size.getWidth(), (1.0 - point .getY()) * size.getHeight()); else scale.setLocation(point.getX() * si...
2
public boolean[] getThreadStates() { return threadStates; }
0
@Override public boolean insert(DataRow row) { Boolean flaga = false; try { con = DriverManager.getConnection(url, login, password); String stm; String tabelName = row.getTableName(); ...
5
private static SelectorMutableTreeNode generateTreeNode(Object obj){ SelectorMutableTreeNode node = new SelectorMutableTreeNode(obj); for(Method method : obj.getClass().getDeclaredMethods()){ if(method.isAnnotationPresent(CRRCSimEditorNode.class)){ try { ...
8
public boolean canStop() { return !(preStop || !isStarted); }
1
public static String edgeTypeToString(EdgeType type){ switch (type) { case NORMAL: return "N"; case ANTI_NORMAL: return "A"; case INNIE: return "I"; case OUTIE: return "O"; } return null; }
4
private BitSet selectABonds(String str) { int n = model.aBonds.size(); if (n == 0) return null; BitSet bs = new BitSet(n); if ("selected".equalsIgnoreCase(str)) { synchronized (model.aBonds) { for (int i = 0; i < n; i++) { if (model.getABond(i).isSelected()) bs.set(i); } } return ...
8
@Override public void processCas(CAS aCAS) throws ResourceProcessException { JCas jcas = null; try { jcas = aCAS.getJCas(); } catch (CASException e) { throw new ResourceProcessException(e); } String sentenceId = ""; FSIterator<TOP> sentenceIterator = jcas.getJFSIndexRepository...
4
@EventHandler public void SilverfishPoison(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getSilverfishConfig().getDouble("Silverf...
6
public void run() { System.out.println("启动消费者线程!"); Random r = new Random(); boolean isRunning = true; try { while (isRunning) { System.out.println("正从队列获取数据..."); String data = queue.poll(2, TimeUnit.SECONDS); if (null != data)...
3
public Iterator<Integer> getIDIterator() { return laenderMap.keySet().iterator(); }
0
public void moveLeft() { setDirection(-90); for (TetrisBug tb : blocks){ tb.setDirection(-90); } if (rotationPos==0){ if (blocks.get(0).canMove() && blocks.get(2).canMove()) { blocks.get(2).move(); move(); blocks.get(0).move(); blocks.get(1).move(); } } if (rotationPos == 1)...
8
private static String decodeRawWord(String rawWord) { if (rawWord == null || "".equals(rawWord)) { return rawWord; } char[] cs = rawWord.toCharArray(); boolean quoted = cs[0] == CHAR_QUOTE && cs[cs.length - 1] == CHAR_QUOTE; if (!quoted) { return rawWord; } boolean quoteOn = f...
7
@RequestMapping("/lishi") public String lishi(String cardno,String name,String pages,HttpServletRequest request) throws Exception{ Map<Object, Object> map = new HashMap<Object, Object>(); int curPage = 0; List<Logging> loggings= loggingService.findLoggingByNo(cardno); if(loggings != null && loggings.size()>0){...
6
public void testStreamTokenizer() { System.out.println("\n*** testStreamTokenizer ***"); try { String string = "()"; MyStreamTokenizer st = CycListParser.makeStreamTokenizer(string); assertEquals(40, st.nextToken()); assertEquals(41, st.nextToken()); assertEquals(st.TT_EOF, st.next...
1
public void testGet() { YearMonthDay test = new YearMonthDay(); assertEquals(1970, test.get(DateTimeFieldType.year())); assertEquals(6, test.get(DateTimeFieldType.monthOfYear())); assertEquals(9, test.get(DateTimeFieldType.dayOfMonth())); try { test.get(null); ...
2
public void method346(int i, int j) { i += anInt1442; j += anInt1443; int l = i + j * DrawingArea.width; int i1 = 0; int j1 = myHeight; int k1 = myWidth; int l1 = DrawingArea.width - k1; int i2 = 0; if(j < DrawingArea.topY) { int j2 = DrawingArea.topY - j; j1 -= j2; j = DrawingArea.topY; ...
6
private void findMinMaxX(int y) { xMin = Integer.MAX_VALUE; xMax = Integer.MIN_VALUE; for (int i = rasterCount; --i >= 0;) { if (yRaster[i] == y) { int x = xRaster[i]; if (x < xMin) { xMin = x; zXMin = zRaster[i]; } if (x > xMax) { xMax = x; zXMax = zRaster[i]; } // ...
7
@Override public boolean hasNext() { boolean hasNext = mIterator != null && mIterator.hasNext(); if (!hasNext) { mIterator = null; hasNext = mIndex < mRows.size(); } return hasNext; }
2
public static void main(String[] args) { int n = 200000; int result = 0; int iterations = 0; int counter = 0; boolean[] isPrime = new boolean[n]; Arrays.fill(isPrime, true); for (int i = 2; i * i < n; i++) { if (isPrime[i]) { for (int ...
6
private void debugAddNewUnitToTile(final Game serverGame, Tile tile) { Specification spec = serverGame.getSpecification(); List<ChoiceItem<UnitType>> uts = new ArrayList<ChoiceItem<UnitType>>(); for (UnitType t : spec.getUnitTypeList()) { uts.add(new ChoiceItem<UnitType>(Messages.mes...
9
public void keyTyped(KeyEvent e) { if (stage != null) { stage.keyTyped(e); } }
1
public void setTransient(Registry rg) { registry = rg; inventory = null; if(itemType != null) { itemType = rg.getItemManager().getItemType(itemType.getName()); if(itemType.getName().equals("ScrapHammer")) { int x = 9; } if(item == n...
6
private static <T extends Comparable<? super T>> void siftDown(T[] array, int start, int end) { int root = start; //While root has at least one child not past the end of the heap while (left_child(root) <= end) { //Find biggest child and swap up: //Start with left child ...
6
public JMenuBar createMenuBar() { menuBar = new JMenuBar(); JMenu file = new JMenu("File"); menuBar.add(file); JMenuItem newMenuItem = new JMenuItem( new AbstractAction("New") { @Override public void actionPerformed(ActionEvent actionEvent) ...
7
public static void nodesToString(Node[][] nodes,BufferedWriter out) throws IOException{ String s=""+NEWLINE; Node node=findConnectedNode(nodes); Node node2=node; s+=node.symbol.value+","+node.constraint.value+NEWLINE; out.write(s); s=""; do{ node2=node2.right; if (node2.connected) s+="\t"+node2....
6
@Override public int getHeight() { return height; }
0
public void setupGUI() { if(count > 2 && count <=4) frogx=6; if(count>4) frogx=7; // // run[1]=new ImageIcon("NERDY_BIKER.PNG").getImage(); run[2]=new ImageIcon("NERDY_BIKER.PNG").getImage(); run[3]=new ImageIcon("NERDY_BIKER.PNG").getImage(); run[4]=new ImageIcon("NERDY_BIKER.PNG").getImage();...
3
private boolean _jspx_meth_c_forEach_1(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // c:forEach org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_1 = (org.apache.taglibs.stand...
6
public void tick(){ if(blocksForeground != null){ for(int x = 0; x < blocksForeground.length; x++){ for(int y = 0; y < blocksForeground[x].length; y++){ if(blocksForeground[x][y] != null){ blocksForeground[x][y].tick(); } } } } if(blocksBackground != null){ for(int x = 0; x < bloc...
9
public static String doubleToString(double d) { if (Double.isInfinite(d) || Double.isNaN(d)) { return "null"; } // Shave off trailing zeros and decimal point, if possible. String string = Double.toString(d); if (string.indexOf('.') > 0 && string.indexOf('e') < 0 && ...
7
@Override public void add(E e){ int h = Math.abs(e.hashCode()) % table.length; Node<E> n = table[h]; while(n != null && !n.equals(e)){ n = n.next; } if(n == null){ // S'il n'existe pas, on l'ajoute table[h] = new Node<E>(table[h], e); size++; } // sinon, on ne fait rien puisque chaque élémen...
6
public static HashMap<String, Double> sortByValue(HashMap<String, Double> map) { List<Map.Entry<String, Double>> list = new LinkedList<Map.Entry<String, Double>>(map.entrySet()); Collections.sort(list, new Comparator<Map.Entry<String, Double>>() { public int compare(Map.Entry<Strin...
4
public ErrorSymbol(String message) { super(message); }
0
@Override public boolean branch() { Player player = ctx.players.local(); if (ctx.game.clientState() != Constants.GAME_MAP_LOADED) { return false; } if (player == null || !script.options.getAreaSmall().contains(player)) { return false; } if (!ctx.backpack.isFull()) { return false; } if (ctx...
9
public String getType () { switch (getAttributes () & 0x03) { case 0: return "control"; case 1: return "iso"; case 2: return "bulk"; case 3: return "interrupt"; } // "can't happen" return null; }
4
public boolean equals(Board b) { boolean val = true; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (this.board[i][j] != b.get(i, j)) return false; } } return val; }
3
private void processPolyLine(RdpPacket_Localised data, PolyLineOrder polyline, int present, boolean delta) { if ((present & 0x01) != 0) polyline.setX(setCoordinate(data, polyline.getX(), delta)); if ((present & 0x02) != 0) polyline.setY(setCoordinate(data, polyline.getY(), delta)); if ((present & 0x04) !...
7
public FSList getAnnotations() { // try reading it from disk String readpath = "/springfield/lisa/data/linkedtv/"+mediaResourceId+"/annotations.xml"; System.out.println("READPATH="+readpath); String body = readFile(readpath); if (body==null) { Response response = HttpHelper.sendRequest("GET", MAGGIE+"&id...
7
public void move(long time) { if (state == DeliverState.delivered) return; // upravime podla rychlosti modelu double speed = player.getSpeedBalance() * player.getSendSpeed() * time * 0.001 * force; position += speed; // paksametle okolo odosielania a nevyskocenia z ...
6
private long getOffset(Protocol.Section info, long until) { long sizeOfFirst = info.length; long timeDeltaFirst = info.endTime - info.startTime; long timeToSkipFirst = until - info.startTime; System.out.println(timeToSkipFirst + " " + timeDeltaFirst); // long exactStartingPlace ...
3
private static Map<Integer, Double> getRankedTagList(BookmarkReader reader, Map<Integer, Double> userMap, double userDenomVal, Map<Integer, Double> resMap, double resDenomVal, boolean sorting, boolean smoothing, boolean topicCreation) { Map<Integer, Double> resultMap = new LinkedHashMap<Integer, Double>(); i...
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) { ...
8
public void joinTeam(String userName, String teamName, String matchName){ try { cs = con.prepareCall("{call joinTeam(?,?,?)}"); cs.setString(1, userName); cs.setString(2, teamName); cs.setString(3, matchName); cs.execute(); } catch (SQLException e) { e.printStackTrace(); } }
1
public void onEnable() { // Create any required directories getDataFolder().mkdirs(); // Create/load configuration and customizable messages loadConfiguration(); // Disable plugin if auto-disable is set to true and server is running in online-mode if (getConfig().getBoolean("main.auto-disable") && getServ...
9
public void merge(int[] array, int p, int q, int r) { int n1 = q - p + 1; int n2 = r - q; int[] leftA = new int[n1]; int[] rightA = new int[n2]; for (int i = 0; i < n1; i++) { leftA[i] = array[p + i]; } for (int j = 0; j < n2; j++) { rightA[j] = array[q + j + 1]; } int i = 0; int j = 0; ...
7
public Grille (EnvironnementAbs env){ super(env); Border blackline = BorderFactory.createLineBorder(Color.black,1); for(int i= 0 ; i < env.taille_envi;i++){ for(int j= 0 ; j < env.taille_envi;j++){ agent[i][j].setBorder(blackline); } } pan.setBorder(blackline); }
2
public static void main(String args[]) { // Command line arguments if(args.length !=5) { System.out.println("Usage: <inputDataFileName> <NN> <searchFileName> <MM> <DEBUG_VALUE> "); System.exit(0); } try{ String readfile = args[0]; int NNread = Integer.parseInt(args[1]); String searchfile =...
9
@Override public boolean equals(Object other) { if (other == null || !(other instanceof MACByteArrayWrapper) || ((MACByteArrayWrapper)other).mac.length != this.mac.length) return false; for (int i = 0; i < this.mac.length; i++) if (((MACByteArrayWrapper)other).mac[i] != this.mac[i]) return fal...
5
public List<Long> sortNodes(){ List<Long> result = new ArrayList<Long>(); for (Long l : nodos) result.add(l); Collections.sort(result); return result; }
1
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 fe...
6
public String greetServer(String input) throws IllegalArgumentException { // Verify that the input is valid. if (!FieldVerifier.isValidName(input)) { // If the input is not valid, throw an IllegalArgumentException back to // the client. throw new IllegalArgumentException( "Name must be at least 4 cha...
1
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof DieselLocomotive)) return false; DieselLocomotive other = (DieselLocomotive) obj; if (tankVolume != other.tankVolume) return false; return true; }
4
public void update() { move(); if(walking) animSprite.update(); else animSprite.setFrame(0); if (ya < 0){ animSprite = up; dir = Direction.UP; } else if (ya > 0){ animSprite = down; dir = Direction.DOWN; } if (xa < 0){ animSprite = left; dir = Direction.LEFT; } else if (xa > 0){ an...
5
public boolean hitTank(Tank t){ if(this.isLive&& t.isLive() && this.getRect().intersects(t.getRect())&& (this.isMyMissile != t.isMytank())){ if(t.isMytank()){ t.setBlood(t.getBlood() - 20); if(t.getBlood() <= 0){ t.setLive(false); } }else t.setLive(false); this.setLive(false); tc.exp...
6
public Object nextValue() throws JSONException { char c = this.nextClean(); String string; switch (c) { case '"': case '\'': return this.nextString(c); case '{': this.back(); return new JSONObject(this); ...
7
public static boolean isInputPressed(String command) { int[] checked = inputs.get(command); if (checked == null) { return false; } for (int i = 0; i < checked.length; i++) { if (container.getInput().isKeyPre...
6
@Override public int posicionFichaY(int nivel) { return nivel == 1 ? 260 : nivel == 2 ? 233 : nivel == 3 ? 206 : nivel == 4 ? 179 : nivel == 5 ? 152 : nivel == 6 ? 125 : nivel == 7 ? 98 : nivel =...
8
private void insertTeam() { TeamBO teamBO = ServiceLocator.getBean(TeamBO.class); CountryBO countryBO = ServiceLocator.getBean(CountryBO.class); BufferedImage imBuff = null; InputStream is = InsertImageTest.class.getResourceAsStream("/flags/mexico_fmf.png"); try { imBuff = ImageIO.read(is); ...
2
public static ListNode reverseKGroup(ListNode head, int k) { ListNode H = new ListNode(-1); H.next = head; if(head == null) { return head; } if(head.next == null) { return head; } if(k < 2) { return head; } int count = 0; ListNode startNode = H; L...
6