text
stringlengths
14
410k
label
int32
0
9
public BigDecimal getValue(int row, int clums, int sheetat) { BigDecimal value = new BigDecimal(0); String s = null; try { hSheet = hWorkbook.getSheetAt(sheetat - 1); hRow = hSheet.getRow(row - 1); hCell = hRow.getCell(clums - 1); hCell.setCellType(Cell.CELL_TYPE_STRING); s = hCell.getStringCellVal...
1
private void fixup() { // The trie has changed since we last // found our toKey / fromKey if(modCount != keyModCount) { Iterator<Map.Entry<K, V>> iter = entrySet().iterator(); size = 0; Map.Entry<K, V> entry = null; ...
9
public static String convert(String coreNLPTag) { if (coreNLPTag.startsWith("NN")) { return "noun"; } else if (coreNLPTag.startsWith("VB")) { return "verb"; } else if (coreNLPTag.startsWith("JJ")) { return "adjective"; } else if (coreNLPTag.startsWith("RB")) { return "adverb"; } else if (coreNLPTa...
7
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...
3
private static boolean isDeclarationTarget(AnnotationDesc targetAnno) { // The error recovery steps here are analogous to TypeAnnotations ElementValuePair[] elems = targetAnno.elementValues(); if (elems == null || elems.length != 1 || !"value".equals(elems[0].element().na...
7
public boolean getBoolean(String key) throws JSONException { Object o = get(key); if (o.equals(Boolean.FALSE) || (o instanceof String && ((String)o).equalsIgnoreCase("false"))) { return false; } else if (o.equals(Boolean.TRUE) || (o ins...
6
@AfterClass public static void tearDownClass() { }
0
@Override public void die(){ if (sound.Manager.enabled) { sound.Event effect = new sound.Event(getPosition(), getVelocity(),sound.Library.findByName(SOUND_EFFECT)); // make bigger asteroids explode bigger effect.gain = EFFECT_VOLUME * scale.magnitude2(); effec...
3
public void findRepetingElementsMethodOne(int[] a) { /* Keep the aggregate XOR operation */ int xor = 0; for (int i = 0; i < a.length; i++) { xor ^= a[i]; } for (int i = 0; i < a.length - 1; i++) { xor ^= i; } /* Isolate the right-most bit set in xor */ int rightMostBitSet = xor & ~(xor...
6
public ChatClient () { client = new Client(); client.start(); // For consistency, the classes to be sent over the network are // registered by the same method for both the client and server. Network.register(client); client.addListener(new Listener() { public void connected (Connection connection) { ...
7
public static void main(String[] args) { Random r = new Random(); ArrayList<Integer> lista = new ArrayList<>(); BufferedReader buffer; try { File file = new File("numeroRandom"); buffer = new BufferedReader(new FileReader(file)); String line; while ((line = buffer.readLine()) != null) { lista.ad...
7
@Override public void deserialize(Buffer buf) { mountUid = buf.readDouble(); if (mountUid < 0) throw new RuntimeException("Forbidden value on mountUid = " + mountUid + ", it doesn't respect the following condition : mountUid < 0"); mountLocation = buf.readByte(); mountFoo...
3
@SuppressWarnings("unchecked") public void loadCache() { if (!this.cacheEnabled) return; final String cacheFile = (this.cachePath == null) ? DEFAULT_CACHE_FILE : this.cachePath; try { // lock the lockfile final FileInputStream fis = new FileInputStream(cacheFile); final ObjectInputStream ois = new ...
7
public static void resolve(Tasks[] tasks, int currentTask, boolean[] used, int[] order, int orderPos) { for (int i = 0; i < tasks[currentTask].reqs.size(); ++i) { if (!used[tasks[currentTask].reqs.get(i)]) { resolve(tasks, i, used, order, orderPos); used[i] = true; order[orderPos] = tasks[currentTask]....
2
protected static Integer parseID(String string) { try { int num = Integer.parseInt(string); return new Integer(num); } catch (NumberFormatException e) { return new Integer(-1); } }
1
public static void reset() { log.clear(); if (debug) System.out.println("Clearing all intel"); }
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 feel. * For details see http://down...
6
public boolean hasError() { return error; // Return error status }
0
@Override public void handleInput() { InputUpdate i = new InputUpdate(); i.input =-1; if(Keys.isDown(Keys.W)){i.input = Keys.W;client.sendTCP(i);} else if(Keys.isDown(Keys.S)){i.input = Keys.S;client.sendTCP(i);} else if(Keys.isDown(Keys.A)){i.input = Keys.A;client.sendT...
4
public void parseInfoLines() { chromLine = header.indexOf("#CHROM") >= 0; if (vcfInfoById == null) { vcfInfoById = new HashMap<String, VcfInfo>(); // Add standard fields vcfInfoById.put("CHROM", new VcfInfo("CHROM", VcfInfoType.String, "1", "Chromosome name")); vcfInfoById.put("POS", new VcfInfo("POS...
5
public boolean add(Object li) { if (contains(li)) return false; grow(1); locals[count++] = (LocalInfo) li; return true; }
1
@Override public void processWalks(final WalkArray walks, final int[] atVertices) throws RemoteException { try { pendingQueue.put(new WalkSubmission(walks, atVertices)); int pending = pendingQueue.size(); if (pending > 50 && pending % 20 == 0) { logger.inf...
3
public boolean movesremaining() { for (int i = 0; i < bricks.length; i++) { for (int j = 0; j < bricks[0].length; j++) { if (bricks[i][j].state == true) { boolean playing = remaining(i, j, 1); if (bricks[i][j].color >= 6 && bricks[i][j].color <= 8) playing = true; if (playing) return...
6
public String salvar() { try { if (tarefa.getId() == null) { tarefa.setStatus("1"); tarefaDao.salvar(tarefa); mensagem = "Tarefa Salva com Sucesso!"; tarefa = new Tarefa(); } else { // setando esses atributos,...
4
private void setupFrame() { _defaultFont = new FontUIResource("Dialog", Font.PLAIN, 12); _boldFont = new FontUIResource("Dialog", Font.BOLD, 12); _fixedFont = new FontUIResource("Monospaced", Font.PLAIN, 12); _persistitAccentColor = new Color(119, 17, 34); String lnfClassName =...
9
private void btnAjouterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAjouterActionPerformed // TODO add your handling code here: if(!taAdresse.getText().equals("") && !tbfax.getText().equals("") && !tbtel.getText().equals("")) { PharmacieDAO pdao= new Pha...
5
public boolean userName_IsValid(String user) { Connection con = null; Statement stmt = null; try { DBconnection dbCon = new DBconnection(); Class.forName(dbCon.getJDBC_DRIVER()); con = DriverManager.getConnection(dbCon.getDATABASE_URL(), ...
5
protected void txtFilterKeyPressEvent(KeyEvent arg0) { Vector<Account> res = null; if( txtFilter.getText().length() == 0 ) { res=FkManager.getInstance().getList(); txtFilter.setBackground( defaultBgColor ); } else { res = FkManager.getInstance().getList(txtFilter.getText()); if( res.size() < 1 ) ...
8
final void method3049(ByteBuffer class348_sub49, int i, int i_72_) { while_146_: do { try { anInt9146++; if (i_72_ == 31015) { int i_73_ = i; do { if (i_73_ != 0) { if ((i_73_ ^ 0xffffffff) != -2) { if (i_73_ == 2) break; break while_146_; } } else { ...
8
public String getValue(String varName) throws VariableException { String result = null; if (gate == null) throw new VariableException("cannot get var's value since no gate is currently loaded", varName); if (varName.equals(VAR_TIME)) result = String.valueOf(time) + (clo...
8
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 boolean authenticate() throws SessionException, IOException, GatewayValidationException { if (!session_mode) { throw new SessionException("This function can only be called when Session Mode is enabled."); } URL obj = new URL(URL + "auth?api_id=" + api_id + "&user=" + user + "...
3
@Override public void update(final int delta) { PlayerEntity player = game.getPlayer(); if (collisionBox.intersects(player.getCollisionBox()) && Math.abs(player.pos.y - pos.y - SIZE) < 3) { collideWithPlayer(player, delta); } }
2
private boolean _jspx_meth_c_import_0(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // c:import org.apache.taglibs.standard.tag.rt.core.ImportTag _jspx_th_c_import_0 = (org.apache.taglibs.standard....
3
private String getWest(char a) { if ('0' == a) return "1, W"; if ('1' == a) return "0, halt"; if ('2' == a) return "3, W"; return "2, halt"; }
3
private void readLines(final MyObjects myObjects, final BufferedReader reader) throws IOException { String line; try { while ((line = reader.readLine()) != null) { myObjects.addLine(line); } } finally { reader.close(); } }
1
public void Clear(){ num=0; if(Composer instanceof FreeMMC) Composer.setNotes(null); else if(Composer instanceof AtonalMMC) Composer =new AtonalMMC(compName,composer); else if((Composer instanceof AlgorithmicMMC)) ((AlgorithmicMMC) Composer).setNum(num); }
3
@Override public boolean equals(Object o){ if(o instanceof Peer){ return ip.equals(((Peer) o).ip)?true:false; //Love the Trinary Operations } return false; }
2
public void run() { a = new Vector3D[bodies.size()]; for (int i = 0; i < bodies.size(); i++) { // Necessary to preload // accelerations for // leapfrog integration. a[i] = getAcceleration(bodies.get(i)); } aCraft = new Vector3D[ships.size()]; for (int p = 0; p < ships.size(); p++)...
5
public static byte[] decodeBase64(String source) { // Clean string source = source.replaceAll("[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/_-]+", ""); int decodedLength = ((source.length() / 4) * 3) + (source.length() % 4 > 0 ? ((source.length() % 4) - 1) : 0); byte...
6
public void SRC(){ pcIncrease(); int number = Integer.parseInt(getCOUNT().get(), 2); getALU().OP1.set(SelectRegister().get()); if (getI().get().equals("0")&&getT().get().equals("0")){ getALU().arithShiftRight(number); SelectRegister().set(getALU().RES.get(...
6
public int getFacingNPC() { TiledMap map = World.getWorld().getMap(); int layerIndex = map.getLayerIndex("npc"); Vector2 diff = getGridPosition().copy(); switch(getDirection()) { case Direction.NORTH: diff.addY(-1); break; case Direction.EAST: diff.addX(2); break; case Direction.SOUTH: diff...
5
protected void setRootPane(RootPane rootPane) throws SlickException { if (!guiInitialized) { guiInitialized = true; initGUI(); } if (gui != null) { gui.setRootPane(rootPane); } }
2
private boolean fillBuffer(int minimum) throws IOException { char[] buffer = this.buffer; lineStart -= pos; if (limit != pos) { limit -= pos; System.arraycopy(buffer, pos, buffer, 0, limit); } else { limit = 0; } pos = 0; int total; while ((total = in.read(buffer, limi...
7
public void addChilds(final HTML...childsToAdd) { if ( childsToAdd == null ) return; for (final HTML child : childsToAdd) if ( !this.hasChild(child) ) { child.setParent(this); this.childs.add(child); } }
3
private static int createOldStyleMask(StdImage image, List<byte[]> imageData, List<Integer> imageType, int type) { int size = image.getWidth(); byte[] bytes = new byte[size * size]; int i = 0; for (int y = 0; y < size; y++) { for (int x = 0; x < size; x++) { bytes[i++] = (byte) (image.getRGB(x, y) >>> 24...
2
public void update(Level level, int x, int y, int z, Random rand) { boolean var7 = false; z = z; y = y; x = x; level = level; boolean var8 = false; boolean var6; do { --y; if(level.getTile(x, y, z) != 0 || !this.canFlow(level, x, y, z)) { br...
8
private void constructJson(JSONObject json) throws WeiboException { try { createdAt = parseDate(json.getString("created_at"), "EEE MMM dd HH:mm:ss z yyyy"); id = json.getString("id"); mid=json.getString("mid"); idstr = json.getLong("idstr"); text = json.getString("text"); if(!json.getString("source"...
8
@Override public double distribute(TVC newCon) { TVC con = null; // We cloned connections to environment before, so we have to find our environment specific connection in our list. :( for (TVC c: environment.getConnectionsSortedUp()) { if (c.equals(newCon)) { con = c; } } ...
3
@Override public void actionPerformed(ActionEvent e) { switch(e.getActionCommand()){ case "search": LibrarianActionsControl.searchForBooks(this, new String[]{isbnField.getText(), (String) comboBox.getSelectedItem(), authorField.getText(), titleField.getText()}); break; case "edit": CardLayout layout = (...
5
public static void loadHats() { ConfigManager.reload(plugin, "hats.yml"); FileConfiguration config = ConfigManager.get("hats.yml"); ConfigurationSection configurationSection = config.getConfigurationSection("hats"); loadedHats.clear(); for (String name : configurationSection.getKeys(false)) { if (loadedHat...
4
public static char[] getResult(char[] state, Action action) { for (int i=0; i<state.length; i++) { if (state[i] == Puzzle.BLANK) { char[] result = new char[state.length]; int boardSize = (int) Math.sqrt(state.length); int iNew = i; if ...
9
@Override public ArrayList<Excel> getColoredExes() { // TODO Auto-generated method stub return coloredEx; }
0
public static void generation() { addToTable(constructers); int start = 0; while (true) { if (Config.verbose >= 1) { System.out.print("Generation : " + start + " ->"); } ArrayList<Node> newList = new ArrayList<Node>(); ArrayList<Node> list = mainList.get(start); int taille = list.size(); in...
6
private int getMinChildHeuristic(TrieNode node) { int min = 0; for (TrieNode child : node.getChildren().values()) { if (child.getHeuristic() > min) { min = child.getHeuristic(); } } return min; }
2
public boolean dispatch(CommandSender sender, Command command, String label, String[] args) { if (!this.commands.containsKey(label)) { return false; } boolean handled = true; CommandExecutor ce = (CommandExecutor) this.commands.get(label); handled = ce.onCommand(sende...
1
@Override public void update() { logger.trace("update: " + stateMachine.getState()); switch (stateMachine.getState()) { case INGAME: start.dispose(); game = new Game(penController, stateMachine); break; case MENU: start = new StartMenu(stateMachine); if (options != null) { options.dispose();...
7
public String toString() { int totalOutdegree = 0; int totalIndegree = 0; int totalNodes = 0; int maxIndegree = 0; int maxOutdegree = 0; StringBuilder sb = new StringBuilder(); HashSet<Node> printed = new HashSet<Node>(); try { SimpleQueue<Node> queue = new SimpleQueue<Node>(); queue.add( start...
8
public void sortSccsBySize() { Iterator<Integer> it = sccsOfLeader.keySet().iterator(); int i = 0; while (it.hasNext()) { int leaderVertex = it.next(); int sizeOfSccs = sccsOfLeader.get(leaderVertex).size(); sortedSCCsSize[i] = sizeOfSccs; i++; } // sorting the array int length = i; System.ou...
1
public static String decrypt(String strToDecrypt, int ikey){ byte[] key = null; if(ikey == 0){ key = thekey; if(thekey == null){ return "ERROR: NO KEY"; } }else if(ikey == 1){ key = the2ndkey; if(the2ndkey == null){ return "ERROR: NO KEY2"; } }else if(ikey == 2){ key = the3rdkey; ...
9
private void removeSongButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeSongButtonActionPerformed List<Song> selected = ownedList.getSelectedValuesList(); for (Song s : selected) { if(currUser.getLibrary().hasWaitingList(s)) { Queue<User> users = currUser.getLibrary().getWaitingLi...
9
public int getY(){ return y; }
0
void setSpeed(int speed) { switch (speed) { case -2: factor = 0; break; case -1: factor = 0.5; break; case 0: factor = 1.2; break; case 1: factor = 2.5; break; case 2: ...
5
private void initCostsByCoordinates() { for(int i = 0;i<coordinates.length;i++){ for(int j = 0;j<coordinates.length;j++){ costs[i][j] = calculateTravelCostsBetweenCities(i,j); } } }
2
public void breadthFirstTraversal(){ LinkedQueueClass<Integer> queue = new LinkedQueueClass<Integer>(); boolean[] visited; visited = new boolean[gSize]; for (int ind = 0; ind < gSize; ind++) visited[ind] = false; //initialize the array ...
6
protected void inCloseTag(final char c) { switch(c) { case ' ': case '\t': case '\r': case '\n': changedTagState(State.AFTERCLOSETAG); return; case '<': changeTagState(State.BEFORETAG); return; case '>': changeTagState(State.START); closePiece(bufDex-1); return; case '/': changedTagState(Sta...
7
public PanelOptions getPanelSettings() { return pnlSettings; }
0
public static void shiftSubArray(int[] arr, int from, int to, int offset){ int iters=0; if(from>to){ iters=((arr.length-from)+to); } else { iters=(to-from)+1; } if(offset>0){ for(int i=0;i<iters;i++){ arr[Help.mod2(to+offset, arr.length)]=arr[to]; to = circleDecrement(to, arr.length); } ...
4
public static void main(String[] args) { PriorityQueue<Integer> priorityQueue = new PriorityQueue<Integer>(); Random rand = new Random(47); for (int i = 0; i < 10; i++) priorityQueue.offer(rand.nextInt(i + 10)); QueueDemo.printQ(priorityQueue); List<Integer> ints = Arrays.asList(25, 22, 20, 18, 14, 9, 3, ...
2
public static void initialiser_phase2(Vector<Vector<String>> data) { data.set(data.size()-1, z_initial); z_type_courant = z_type; System.out.println("Probleme de base : "+z_type_courant); for(int i=1;i<data.size()-1;i++) { for(int j=1;j<data.lastElement().size(...
8
public final void incremental(double value,int type){ double y=0.,yl=0.,yr=0.; switch(type){ case 1: nl += 1; nr -= 1; sl += value; sr -= value; s2l += value*value; s2r -= value*value; break; case -1: nl -= 1; nr += 1; sl -= value; sr +...
9
public long skip(long n) throws IOException { long totalSkipped = 0; long skipped; // loop until bytes are really skipped. while (totalSkipped < n) { skipped = in.skip(n-totalSkipped); if (totalSkipped ==-1) throw new IOException("skip not supported"); else if(skipped =...
4
public double normalAttack() { return weaponSlot.increaseDamage((double)hero.fight()); }
0
public void bingoClientGui() { JFrame f = new JFrame("Bingo Law"); f.getContentPane().add(this); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.pack(); f.setVisible(true); Dimension tela = Toolkit.getDefaultToolkit().getScreenSize(); setSize(tela.width, tela.height); botoes = new ArrayLi...
6
public boolean Exist(String Stu_ID, String PassCode) { try { StringBuffer sql = new StringBuffer(); sql.append(" select * from student where"); sql.append(" stu_ID='"); sql.append(Stu_ID); sql.append("' && stu_Passcode='"); sql.append(PassC...
2
private void ParseTable() throws IOException{ List<String> symbols = new ArrayList<String>(); List<Integer> synchronizationSymbols = new ArrayList<Integer>(); // Symbols BufferedReader br = new BufferedReader(new FileReader("src/hr/unizg/fer/labComplete/symbols.txt")); String line; while ((li...
7
protected Map<String,String> getProperties(final Object obj) { HashMap<String,String> map = new HashMap<String,String>(); map.putAll(getMapProperties(obj)); try { BeanInfo info = Introspector.getBeanInfo(obj.getClass()); PropertyDescriptor[] pds = info.getPropertyDescriptors(); if(pds!=null) { ...
8
public ShortcutableComponent(Component comp){ comp.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { if(shortcutRepeated){ return; ...
4
protected IToken doEvaluate(ICharacterScanner scanner, boolean resume) { System.out.println("[doEvaluate]"); //System.out.println("[scanner]"+(char)scanner.read()); //System.out.println("[Column]"+scanner.getColumn()); if (resume) { if (endSequenceDetected(scanner)) return fToken; } else { int c=...
5
private void start() { thePlayer.currentLocation = location.MainMenu; //The main menu is actually a special location while(running == false) { System.out.println("--- P A R A S I T E ---\n- New Game\n- Help\n- Quit Game"); input.waitForCommand(); //wait for command r...
1
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
9
public static void main(String[] args) { int larger, smaller; /*InputStreamReader isr = null; BufferedReader br = null; isr = new InputStreamReader(System.in); br = new BufferedReader(isr); */ String str ="1,2,3"; String[] s = str.split(","); List<Integer> list = new Ar...
1
@Override public void onCombatTick(int x, int y, Game game) { SinglePlayerGame spg = (SinglePlayerGame) game; List<Entity> zombies = filterByID(spg .getSquareNeighbors(x, y, 1), zombie.id); for (Entity entity : zombies) { if (((MortalEntity) entity).damage(3)) { ...
2
public DoublyLinkedListNode<T> deleteNode(int index) { // Check for out of bounds insertion. if (index > size) { return null; } DoublyLinkedListNode<T> deleteNode = null; DoublyLinkedListNode<T> newNextNode = null; // Find the node before the node we want to delete. DoublyLinkedL...
5
public boolean isInsideBoard(Position pos){ boolean inside = false; if (pos.getX()<this.getSize().getWidth() && pos.getX()>=0 && pos.getY()<this.getSize().getHeight() && pos.getY()>=0) inside=true; return inside; }
4
public MNSASpi(Object param) { try { Connection c = USBConnectionFactory.getConnection(); if(c == null){ throw new IOException("No CardReader found."); } this.terminals = new MNSACardTerminals(c); } catch (PortInUseException | UnsupportedCommOperationException | IOException e) { throw new Runtime...
2
public void dumpExpression(TabbedPrintWriter writer) throws java.io.IOException { if (!subExpressions[0].getType().isOfType(Type.tString) && !subExpressions[1].getType().isOfType(Type.tString)) { writer.print("\"\""); writer.breakOp(); writer.print(getOperatorString()); } subExpressions[0].dumpE...
2
public static void main(String[] args) throws Throwable { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int cases = parseInt(in.readLine()); for (int casos = 0; casos < cases; casos++) { int n = parseInt(in.readLine().split(" ")[2]); mat...
9
private void parseBaseLevel(Node node) throws TemplateException { if (node.getNodeName().equals("dc:title")) { template.setTitle(node.getTextContent()); template.getDcAttributes().add(new DCAttribute("dcterms.title", node.getTextContent())); } else if (node.getNodeName().substring(0, 3).equals("dc:")) { St...
5
public void visitForceChildren(final TreeVisitor visitor) { if (visitor.reverse()) { target.visit(visitor); } final Iterator e = operands().iterator(); while (e.hasNext()) { final Expr operand = (Expr) e.next(); operand.visit(visitor); } if (!visitor.reverse()) { target.visit(visitor); } }
3
public int calculateState(int n) { if (dp[n] != 0) return dp[n]; for (int i = 2; i < n; i++) { if (n % i == 0) { if (calculateState(n - i) == -1) { dp[n] = 1; break; } } } if (dp[n] == 0) dp[n] = -1; return dp[n]; }
5
public void sendObjectToServer (String outType, Object outObj) { try { createSocketAndSend(outType, outObj); } catch (Exception e) { System.out.println("Something went wrong trying to send the object..."); } }
1
public double coutAttaque(Peuple attaquant) { double cout = this.nbUnite; Iterator<Element> it = this.elements.iterator(); while (it.hasNext()) { cout += it.next().bonusDefense(attaquant); } if (this.occupant != null) { cout += this.occupant.bonusDefense(this, attaquant); } return cout <...
3
public static String[] buildRicListFromFile(String ricFileName, int maxCount) { RandomAccessFile dataFile = null; try { int i = 0; dataFile = new RandomAccessFile(ricFileName, "r"); String line = dataFile.readLine(); ArrayList<String> itemList ...
8
public T remove(long seqno) { lock.lock(); try { if(seqno < low || seqno > high) return null; int index=index(seqno); T retval=buffer[index]; if(retval != null && removes_till_compaction > 0) num_removes++; buffe...
7
public EventObject getEvent() { return event; }
0
@Override public int castingQuality(MOB mob, Physical target) { if(mob!=null) { final Room R=mob.location(); if((R!=null)&&(!R.getArea().getClimateObj().canSeeTheMoon(R,null))) { if((R.getArea().getTimeObj().getTODCode()!=TimeClock.TimeOfDay.DAWN) &&(R.getArea().getTimeObj().getTODCode()!=TimeClo...
7
public Person GetPerson() { //first person in line Person tmp = null; if(Count() != 0) { //pickup priority person tmp = busStop.poll(); if(Count() == 0) { //reset priority priority = 0; ...
2
public void run() { if (DEBUG) log("Attempting to run TaskRemoval"); ArrayList<Task> tasks = TaskCommander.getTasks(); if (DEBUG) log("Remove the task contained in this command from the existing tasks list"); tasks.remove(task); if (taskViewsToUpdate != null) { if (DEBUG) log("Remove tas...
6
private void anothing() { System.out.println("功能C"); }
0