text
stringlengths
14
410k
label
int32
0
9
private void processArguments(final String[] args) throws CommandException { log.debug("processing arguments: " + Strings.join(args, ",")); if (args.length == 0) { throw new CommandException("Command requires arguments"); } String sopts = "-:dcl"; LongOpt[] ...
8
public void testGuid() { System.out.println("\n*** testGuid ***"); CycObjectFactory.resetGuidCache(); assertEquals(0, CycObjectFactory.getGuidCacheSize()); String guidString = "bd58c19d-9c29-11b1-9dad-c379636f7270"; Guid guid = CycObjectFactory.makeGuid(guidString); assertEquals(1, CycObjectFact...
1
private void getAuthTokenTest(String url, String usr, String pwd) { try { IAquariusPublishService client = AqWsFactory.newAqPubClient(url); Assert.assertTrue(client!=null); String token = client.getAuthToken(TestContext.User, TestContext.Pwd); Assert.assertTrue(token!=null && token.length()>0); ...
2
public void paint(Graphics2D g2, Node item, Justification justification, Rectangle2D bounds) { final Font oldFont = g2.getFont(); if (background != null) { g2.setPaint(background); g2.fill(bounds); } if (borderPaint != null && borderStroke != null) { ...
8
private void setSchedule(int userID) { String[] startTimes = new String[7]; String[] endTimes = new String[7]; String startDate = ""; String endDate = ""; int k = 0; DatabaseConnection db = new DatabaseConnection(); Connection conn = db.connectToDB();...
6
@Test public void getTopicsRatios() throws Exception { this.portfolio.openCorpus("MISS"); this.portfolio.openViewpoint("446d798e240d4dee5a552b902ae56c8d"); for (Portfolio.Viewpoint.Topic t : this.portfolio.getTopics()) { assertTrue(t.getRatio(0)<1); assertTrue(t.getRatio(1)==0); } this.portfolio.toggleTopic( ...
4
private void applyGravity() { for (int i = 0; i < planets.size(); i++) { for (int j = i + 1; j < planets.size(); j++) { planets.get(i).applyGravitationalAttraction(planets.get(j)); } planets.get(i).applyGravitationalAttraction(ship); for (int a =...
6
public void actualizarSeccion(String seccion, int index){ switch(index){ case 1: _LblGrupo1.setText(seccion); break; case 2: _LblGrupo2.setText(seccion); break; case 3: _LblGrupo3.setText(seccion)...
4
private static boolean isNativeMethod(String line) { line = line.trim(); // what if 'native' appears in a comment return !(line.startsWith("//") || line.startsWith("*")) && // comments? line.contains(" native ") && // native qualifier line.contains(";") && line.contains("(") && line.contains(")") && // ...
6
public static void LoadSpawn() { localFile = new File("spawn.dat"); String line; BufferedReader br; try { br = new BufferedReader(new FileReader(localFile)); try { // Read in spawn coordinates, only 3 numbers separated by spaces line = br.readLine(); ...
4
public int getNumberOfPoints(){ return numberOfPoints; }
0
public OSCPacket convert(byte[] byteArray, int bytesLength) { this.bytes = byteArray; this.bytesLength = bytesLength; this.streamPosition = 0; if (isBundle()) { return convertBundle(); } else { return convertMessage(); } }
1
public Integer getNumeroColegiado() { return numeroColegiado; }
0
public static void main(final String[] args) throws IOException, ServiceException, InterruptedException { if (args.length != 3) { System.err.println("arguments: picasaUser albumName freemapAuthKey"); System.exit(1); } final PicasawebService myService = new PicasawebService("freemapPhotoImporter"); final ...
5
private void processMoveToKingPile(MouseEvent e) { int index = (int) (e.getY() / (CARD_Y_GAP + CARD_HEIGHT)); if (index < 4) { activeMove.cardReleased(index, CardMoveImpl.MOVE_TYPE_TO.TO_KING_PILES); String result = activeMove.makeMove(game, this); processMoveResult(r...
1
public int getY() { if(this == DOWN) return 1; if(this == UP) return -1; return 0; }
2
@Override /** * Fügt dem Baum einen Wert hinzu * */ public void addValue(Integer value) throws BinarySearchTreeException { if (root == null) { //Wenn es noch keinen root Knoten gibt, erzeuge diesen mit dem hinzuzufügenen Wert root = new Node(value); //...
6
public static void loadFromFile() throws Exception{ String filename = "Girl.bin"; File file = new File(filename); FileInputStream fis = new FileInputStream(file); ObjectInputStream ois = new ObjectInputStream(fis); try{ Object temp = ois.readObject(); if(temp.getClass().getName().equals("Girl")){ he...
2
@Override public void redo() { // Insert the Node parent.insertChild(node, index); node.getTree().insertNode(node); node.getTree().addNodeToSelection(node); }
0
@Override public FTPResult handleResponse(FTPInterface inter, FTPResponse response) { if (response.getCode() == 211) { String[] features = response.getContent().split("\n"); if (features.length > 2) { int length = features.length - 1; for (int i = 1; i < length; i++) { String feature = features[i]...
9
public void setCost(double value) { this.cost = value; }
0
public int similarity(String s1, String s2) { int[][] d = new int[s1.length()][s2.length()]; for(int i=0;i<s1.length();i++) { d[i] = new int[s2.length()]; d[i][0] = i; for(int j=0;j<s2.length();j++) { try { d[0][j] = j; } catch ( Exception ae){} } } for(int j=0;j<s2.lengt...
8
public static void main(String[] args) { Scanner input = new Scanner(System.in); int start = input.nextInt(); int end = input.nextInt(); for (int i = start; i <= end; i++) { if (i < 10) { System.out.print(i + " "); } else if (i < 100) { if ((i / 10) == (i % 10)){ System.out.p...
5
public static Map<String, List<String>> prepareArgs(String[] args) { Map<String, List<String>> preparedArgs = new HashMap<String, List<String>>(); List<String> values = null; String key = null; for (String arg : args) { if (arg.startsWith("--")) { key = arg.su...
5
@Override public void run(CommandSender sender, String maincmd, String[] args) { if (sender instanceof Player && !sender.hasPermission("mobmanager.butcher")) { sender.sendMessage(ChatColor.DARK_RED + "You do not have permission to use /mm butcher"); return; } if (!MMComponent.getLimiter().isEnabled()...
9
public TruncateHelper setWordDelimeterPattern(Pattern wordDelimeterPattern) { Assert.notNull(wordDelimeterPattern); this._wordDelimeterPattern = wordDelimeterPattern; return this; }
0
@Override public ExpertiseDefinition findDefinition(String ID, boolean exactOnly) { ExpertiseDefinition D=getDefinition(ID); if(D!=null) return D; for(final Enumeration<ExpertiseDefinition> e=definitions();e.hasMoreElements();) { D=e.nextElement(); if(D.name().equalsIgnoreCase(ID)) return D; } ...
8
public void checkForLoginRequests(List<ServerWorker> w) throws IOException { ServerWorker wLogin = null; if (!pendingConnections.isEmpty()) { Iterator<Entry<NetworkStream, Long>> entrySetIterator = pendingConnections.entrySet().iterator(); while (entrySetIterator.hasNext()) { Entry<NetworkStream, Long> e...
9
public static Short stoShort(String str){ Short i=0; if(str!=null){ try{ i = Short.parseShort(str.trim()); }catch(Exception e){ i = null; } }else{ i = null; } return i; }
2
public static Cons yieldRelationParametersTree(NamedDescription self, boolean dropfunctionparameterP, boolean typedP) { { Cons parameterlist = Stella.NIL; Stella_Object parameter = null; { Symbol pname = null; Cons iter000 = self.ioVariableNames.theConsList; Surrogate ptype = null; ...
6
public int[] compile(String[] commandsArray) throws Exception { int commandNr = 0; int commandsIntArray[] = new int[MAX_CS_SIZE]; for (int i = 0; i < commandsArray.length; i++) { if (commandsArray[i].trim().equals("")) { continue; } else { CmdWithVar cmd = recognizeStringCommand(commandsArray[i], i)...
7
public int getTEAM() { return team; }
0
private String get(String id) { if (id.equals(UserColumn.ACCOUNT_ID)) { return account_id; } else if (id.equals(UserColumn.ROLE)) { return role; } else if (id.equals(UserColumn.LOGIN_ID)) { return login_id; } else if (id.equals(...
7
private void calcTime(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException { // Stores the current time. int secondsPlayedOld = secondsPlayed; // Increments the time based on delta. time += delta; secondsPlayed = time/1000; // If it's been one second. if (secondsPlayed - secondsPlay...
7
public ClassInfo getClassInfo() { if (classType instanceof ClassInterfacesType) return ((ClassInterfacesType) classType).getClassInfo(); return null; }
1
public List<ForeignKey> foreignKeys() throws SQLException { List<ForeignKey> result = new ArrayList<ForeignKey>(); ResultSet rs = statement.executeQuery(getFKStatement); while (rs.next()) { ForeignKey foreignKey = new ForeignKey( rs.getString(1), ...
1
public String GetPlayedWeek(String profileId) throws Exception { String gamesString = loadGames(profileId, "games?tab=recent"); List<String> games = parseGamesData(gamesString, "hours"); float total = 0; for (String str : games) { try { total += Float.parseFlo...
2
private Date getDOB() { Date DOB; int dayOfBirth = getDayOfBirth(); int monthOfBirth = getMonthOfBirth(); int yearOfBirth = getYearOfBirth(); String dateToValidate = String.format("%d.%d.%d", dayOfBirth, monthOfBirth, yearOfBirth); List<ValidateException> validateExcepti...
1
public Expr Add_Expr() throws ParseException { Expr e, et; Token tok; e = Mul_Expr(); label_24: while (true) { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ADD: case SUB: break; default: ...
7
public void send(Object oo){ try { if(this.running){ out.writeObject(oo); out.flush(); } } catch (IOException e) { e.printStackTrace(); } }
2
public void randomGrid() { Random rand = new Random(); /* resetGrid(); int b = rand.nextInt(dim*dim); barrierPositions = new boolean[dim*dim]; for(int i = 0; i < b; i++) { barrierPositions[rand.nextInt(barrierPositions.length)] = rand.nextBoolean(); } repaint(); */ resetGrid(); nodeMap = new Node[dim*dim];...
7
@Override public String notation() { return this.from.toString() + "x" + this.to.toString() + " e.p."; }
0
@Override public void setReceiveQuery(IReceiveQuery receiveQuery) { this.receiveQuery = receiveQuery; }
0
private void initView() { setGridColor(Color.lightGray); TableColumn column = getColumnModel().getColumn(0); // column.setCellRenderer(column.getHeaderRenderer()); DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); renderer.setBackground(new Color(200, 200, 200)); column.setCellRenderer(ren...
0
public SSLConnection(CM_Stream chanmon) { cm = chanmon; com.grey.naf.SSLConfig sslcfg = cm.getSSLConfig(); int peerport = (cm.iochan instanceof java.nio.channels.SocketChannel ? ((java.nio.channels.SocketChannel)cm.iochan).socket().getPort() : 0); engine = sslcfg.isClient ? sslcfg.ctx.createSSLEng...
8
private void movePieceCheck(Piece piece, int x1, int y1, int x2, int y2, Position start, Position end, String command, String startSpot, String endSpot) { String currentTurnColor = whitePlayerTurn() ? white : black; if(board.getChessBoardSquare(x2, y2).getPiece().getPieceColor() != (piece.getPieceColor())) {...
4
public static void refreshMarketOfferList(String serverID, String nymID) { Map marketList = null; Map offerList = null; try { // DEBUGGING: this is where the next step happens marketList = Market.loadMarketList(serverID, nymID); offerList = Market.getNymOfferL...
7
@Override public void run(ImageProcessor ip) { ImageStack stack = imp.getStack(); float[][] slicePixels; int dimension = ip.getWidth() * ip.getHeight(); int sx = ip.getWidth(); int sy = ip.getHeight(); int sc = imp.getNChannels(); int sz = stack.getSize()/sc; ...
8
private String calculateStringToSignV2(Map<String, String> parameters, String httpMethod, String hostHeader, String requestURI) throws SignatureException { StringBuffer stringToSign = new StringBuffer(""); if (httpMethod == null) throw new SignatureException("HttpMethod cannot be null"); stringToSign.ap...
7
public IrcException(String e) { super(e); }
0
private void defineStartSaveHistory() { saveHistory = new Thread(new Runnable() { @Override public void run() { while (true) { while (revising) { sleep(10); } String text = textLower.getText(); if (!TEXT_HISTORY.contains(text)) { TEXT_HISTORY.push(textLower.getText()); ...
4
public void die(){ if (actors != null) actors.remove(this); if(ParticleSystem.isEnabled()) for(ParticleGenerator<? extends Particle> particleGenerator : particleGenerators) ParticleSystem.removeGenerator(particleGenerator); }
4
@Override public GistUser deserializeUserFromJson(String json) { JSONObject userJO = null; try { userJO = (JSONObject) parser.parse(json); } catch (ParseException e) { return null; } GistUser user = new GistUser(); Object temp = null; ...
9
public void visitInsn(final int opcode) { buf.setLength(0); buf.append(tab2).append(OPCODES[opcode]).append('\n'); text.add(buf.toString()); if (mv != null) { mv.visitInsn(opcode); } }
1
@Override public Command receive() { System.out.println("Receive ..."); final byte[] buffer = new byte[K.SIZE]; DatagramPacket data = new DatagramPacket(buffer, buffer.length); Object o = null; try { m_multicastSocket.receive(data); o = Utils.toObject(data.getData()); } catch (ClassNotFoundException ...
2
@Override public void execute() throws ParseException { DBManager mng = DBManager.getDBManager(); Schema removeSchema = mng.getSchema(this.tableName); Table removeTable = mng.getTable(this.tableName); if (removeSchema == null || removeTable == null) { throw new ParseException("No table called "+this.table...
6
public Graph(String[] s, int[][] m){ int n = s.length; if(m.length != n || m[0].length != n){ System.out.println("Dimension does not match, exit!"); System.exit(0); } for(int i=0;i<s.length;i++){ vertexList.add(new Vertex(s[i])); } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(m[i][j...
6
public void viewExampleOProperties(String filename) { Document doc = (Document) session.getObjectByPath("/" + filename); List<Property<?>> properties = doc.getProperties(); for (Property<?> p : properties) { if (p.getFirstValue() == null) { Syste...
4
public String buscarClientePorApellidoPaterno(String surname1){ //##########################CARGA_BASE DE DATOS############# tablaDeClientes(); //##########################INGRESO_VACIO################### if(surname1.equals("")){ surname1 = "No busque nada";...
5
private void addQualifierSchemaNodes(Set<Class<? extends Enum<?>>> qualifiers, ObjectNode props) { for (Class<? extends Enum<?>> qualifier : qualifiers) { ObjectNode inner = JsonNodeFactory.instance.objectNode(); // inner.put("type", "string"); props.put(factory.getAttributeNa...
6
protected short[] union(short[] itemSet1, short[] itemSet2) { // check for null sets if (itemSet1 == null) { if (itemSet2 == null) return(null); else return(itemSet2); } if (itemSet2 == null) return(itemSet1); // determine size of union and dimension ...
9
public void setLocaleButtonPosition(Position position) { if (position == null) { this.localeBtn_Position = UIPositionInits.LOCALE_BTN.getPosition(); } else { if (position.equals(Position.NONE)) { IllegalArgumentException iae = new IllegalArgumentException("Positi...
2
public void setValueOfOutPut(int pData){ if (_logicaCompuerta == "IN") _ValorOutPut = pData; else System.out.println("Por seguridad solo es permitido cambiar el resultado de logica a las compuertas de InPut"); }
1
public static void dispose() { Iterator<String> it = resources.keySet().iterator(); while (it.hasNext()) { Object resource = resources.get(it.next()); if (resource instanceof Font) ((Font) resource).dispose(); else if (resource instanceof Color) ((Color) resource).dispose(); else if (resource ...
5
public static final int encryptMessage(int streamOffset, int messageDataLength, byte[] streamBuffer, int messageDataOffset, byte[] messageData) { int i = 0; messageDataLength += messageDataOffset; int i_19_ = streamOffset << 309760323; for (/**/; messageDataOffset < messageDataLength; messageDataOffset++)...
6
Parser(Converter converter) { if (converter == null) { throw new RuntimeException("cannot convert."); } this.converter = converter; }
1
private int findMinBinarySearch(int[] num, int start, int end) { if (start == end) return num[start]; if (end - start == 1) { return Math.min(num[start], num[end]); } else { // end - start > 1 int mid = (start + end) / 2; if (num[mid] < num[start]) { ...
4
public MazeMaker() { try { newMap = JOptionPane.showConfirmDialog(null, "Do you want to create a new map?", "New Map", JOptionPane.YES_NO_OPTION); } catch(Exception e) { System.exit(0); } if(newMap == JOptionPane.YES_OPTION) { try { borderedMap = JOptionPane.showConfirmDialog(null, "Do you want ...
4
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed String userName = txtFieldUserName.getText(); char[] pw = txtFieldPassword.getPassword(); String password = new String(pw); userName.trim(); password.trim(); if...
5
public void open( boolean readOnly ) throws ReadOnlyException, IOException { // Resource cann be double-opened! if( this.isOpen() ) throw new IOException( "Processable resources cannot be double opened." ); if( !readOnly ) throw new ReadOnlyException( "This BufferedResource implementation only ...
3
public static String newValue() { JOptionPane jp = new JOptionPane("Input"); String value = jp.showInputDialog(null, "Enter value (Type #D (Decimal), #B (Binary), #O (Octal), followed by a value.\n\tDefault base is Hex."); // If the user does not enter anything, returns "ERROR". if...
7
static public void awaitOn(Condition c) { MultithreadedTestCase thisTestCase = currentTestCase.get(); if (thisTestCase != null && thisTestCase.failed) throw new RuntimeException("Test case has failed"); if (skipNextWait.get()) { skipNextWait.set(false); return; } try { c.await(3, TimeUnit.SECONDS...
8
public Color lastStanding() { int size, i; Color last = null; for (size=0, i=0; i<playersNo; ++i) { if (players[i].isFinished() == false) { ++size; last = players[i].getColor(); } } if (size == 1) return last; return null; }
3
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { String elementName = localName; if ("".equals(elementName)) { elementName = qName; } System.out.println("element: " + elementName); if (elementName.equals("booklist")) { if (bookList ==...
7
public Infix2Postfix(String exp){ String str = ""; infixExp = exp; stack = new Stack<String>(); for (int i=0;i<infixExp.length();i++){ /* * If the character is a letter or a digit we append it to the postfix * expression directly. */ str = infixExp.substring(i,i+1); if(str.matches(...
8
public void visitSelector(Selector node, String args){ for (int i =0; i< node.getChain().size(); i++){ if(node.getChain().get(i).getClass().getName().compareTo("ast.IdentSelector")==0){ pp("."); ((IdentSelector) node.getChain().get(i)).getIdent().accept(this, args); } else if(node.getChain().get(i).g...
3
protected void moveRight() { if (this.posX < (BattleBotsGUI.instance.xDim-1) && !(this.posY == this.enemyPosY && (this.posX+1) == this.enemyPosX) && !(BattleBotsGUI.instance.obstacles[this.posX+1][this.posY])) { this.posX++; } }
4
public void setOptions(String[] options) throws Exception { String tmpStr; tmpStr = Utils.getOption('T', options); if (tmpStr.length() != 0) setAttributeType(new SelectedTag(tmpStr, TAGS_TYPE)); else setAttributeType(new SelectedTag(Attribute.NUMERIC, TAGS_TYPE)); tmpStr = Utils.ge...
7
public void matchSubscriptions(Message message) { try { List<Subscription> subscriptions = this.parent.getSubscriptionByTopic(message.getTopic()); for (Subscription subscription : subscriptions) { try { System.out.println("Enviando mensaje a: " + subs...
3
public List<Organism> GAstep_mutation() throws Exception { /* mutation */ List<Organism> mutatedOrganisms = new ArrayList<Organism>(); for (int i = 0; i < this.getSpeciesNumber(); i++) { mutatedOrganisms.addAll(species.get(i).mutation(getGenerationNumber())); } /** ...
2
private boolean checaTipoVariavelGlobal(String tipoDoRetorno) { if(!listaVariveisGlobais.isEmpty()){ for(int i = 0; i< listaVariveisGlobais.size();i++){ String tipoVariavel; String nomeVariavel; if(listaVariveisGlobais.get(i).split(":")[1].equals("vetor")){ ...
5
private int resolveDayUnit( String unit ) { if ( unit.equalsIgnoreCase("monday") ) { return TimeAxisUnit.MONDAY; } else if ( unit.equalsIgnoreCase("tuesday") ) { return TimeAxisUnit.TUESDAY; } else if ( unit.equalsIgnoreCase("wednesday") ) { return TimeAxisUnit.WEDNESDAY; } else if ( unit.equalsI...
7
public boolean isFullFilled() { boolean isFilled = true; boolean aId = idActivity >= 0; boolean sTime = startTime != null; boolean eTime = endTime != null; boolean dur = duration >= 0; if (!aId) isFilled = false; if (!sTime) isFilled = false; if (!eTime) isFilled = false; if (!dur) isFilled = fa...
4
public boolean equals( Object other ) { if ( ! ( other instanceof TObjectIntMap ) ) { return false; } TObjectIntMap that = ( TObjectIntMap ) other; if ( that.size() != this.size() ) { return false; } try { TObjectIntIterator iter = this...
8
static void combine_sort(int l,int m,int h,int num[]) { int i,j=m+1,k;int temp[]=new int[10]; for(i=l;i<=h;i++) { temp[i]=num[i]; } i=l;k=l; while(i<=m && j<=h) { if(temp[i]<=temp[j]) { num[k++]=temp[i++]; } else { num[k++]=temp[j++]; } } while(i<=m) { num[k++]=tem...
6
public static void updateSelectedRow(JTable table, Container controlsContainer) throws Exception { int selRow = table.getSelectedRow(); DefaultTableModel tableModel = ((DefaultTableModel)table.getModel()); if (selRow > -1) { int compCount = controlsContainer.getComponentCount(); ...
7
protected void onSaveKey() { File[] fileNames; FileDialog dlgSave = new FileDialog( this, "Save keystore...", FileDialog.SAVE ); dlgSave.setFile( "*.ks" ); try { this.readDataToKeyInfo(); this.lblStatus.setText( "Choose file name..." ); dl...
2
@Test public void testUnion() { assertThat(uf.connected(0, 1), is(not(true))); uf.union(0, 1); uf.union(0, 2); assertThat(uf.connected(0, 1), is(true)); assertThat(uf.connected(1, 2), is(true)); }
0
@Override public boolean activate() { return (!Inventory.isFull() && Settings.root.getRoot() == 3 && !Inventory.contains(Constants.INVENTORY_BURNED_ROOT_ID) && !validate(Constants.WAITFOR_WIDGET) && !validate(Constants.FLETCH_WIDGET) ); }
4
public void setPaused(boolean paused) { if (this.paused != paused && sequencer != null && sequencer.isOpen()) { this.paused = paused; if (paused) { sequencer.stop(); } else { sequencer.start(); } } }
4
@Override public boolean onMouseDown(int mX, int mY, int button) { if(button == 0 && mX > x && mX < x + width && mY > y && mY < y + height) { Application.get().getHumanView().addScreen(ShopScreenFactory.create()); return true; } return false; }
5
public boolean remove(int value) { // Knuth, v. 3, 527, Algorithm R. int i = indexOf(value); if (_values[i] == ndv) { return false; } --_size; for (; ;) { _values[i] = ndv; int j = i; int r; do { ...
9
private void form_keyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_form_keyPressed if (evt.getKeyCode() == KeyEvent.VK_F5) try { reload(); } catch (IOException ex) { logger.log(level.ERROR, "Error while loading devices! Stack trace will be printe...
2
private static void estEntourerDeMurs(Labyrinthe l) throws LabyMalEntoureException { for (int i = 0; i < l.Xsize(); i++) { if (l.getContenuCase(i, 0) != ContenuCase.MUR) throw new LabyMalEntoureException(new Point(i, 0)); if (l.getContenuCase(i, l.Ysize() - 1) != ContenuCase.MUR) throw new LabyMalEnt...
6
public void update(GameContainer gc, StateBasedGame sbg, GameplayState gs, int delta) throws SlickException { for (Entry<Long, Tower> entry : this.towers.entrySet()) { entry.getValue().update(gc, sbg, gs, delta); } for (Entry<Long, Bullet> bullet : this.bullets.entrySet()) { bullet.getValue().update(gc, ...
5
private int partition() { int center = (start + end) / 2; if (array[center] < array[start]) { swap(center, start); } if (array[end] < array[start]) { swap(start, end); } if (array[end] < array[center]) { swap(center, end); } ...
8
@Override public ArrayList<Short> get(Integer... a) { ArrayList<Short> r = new ArrayList<Short>(); for (Integer i : a) { Object[] plain = huff.decode(filter[i/rate]); int index = i-(i/rate)*rate; r.add((Short)plain[index]); } return r; }
1
public int length() { int len = 1; Node n = this; while(n.next != null) { len++; n = n.next; } return len; }
1
private void addPoint() throws NumberFormatException, IOException { double[] coordList = new double[dimensionList.length]; for (int count = 0; count < dimensionList.length; count++) { System.out.println("Enter " + dimensionList[count].toString() + "-coord:"); coordList[count] = Double.parseDouble(Wrapper.get...
1
@Override public void renameProductContainer(ProductContainerData renamedContainer, String newName, int newIndex) { boolean disabledEvents = disableEvents(); try { ProductContainerTreeNode renamedNode = _productContainers.get(renamedContainer); assert renamedNode != null; if (renamedNode...
7