text
stringlengths
14
410k
label
int32
0
9
@Test public void testDiv_Zero_Exception() { try { DecimalImpl.valueOf("1").divide(DecimalImpl.ZERO); Assert.fail("No exception was thrown for divide by 0"); } catch (Exception e) { } }
1
public Book viewBookbyTitle(final String title) { for (Book book : bookList.getBookList()) { if (title.equals(book.getTitle())) { return book; } } return null; }
2
public Position newPosition(Position position) { if (position == null) throw new IllegalArgumentException("The given arguments are invalid!"); return new Position(position.xCoordinate + newX, position.yCoordinate + newY); }
1
public void transform(int id) { if (vertexSkins == null) { return; } if (id == -1) { return; } Animation animation = Animation.forId(id); if (animation == null) { return; } SkinList skinList = animation.aSkinList_637; Model.vertexModX = 0; Model.vertexModY = 0; Model.vertexModZ = 0; for...
4
private static boolean shouldPrint(EIError.ErrorLevel level) { boolean ret = false; if (errorFilterLevel == EIError.ErrorLevel.Notice || (errorFilterLevel == EIError.ErrorLevel.Warning && level != EIError.ErrorLevel.Notice) || (errorFilterLevel == EIError.ErrorLevel.Error...
5
@Override public void update(Observable o, Object arg) { if (o instanceof Bibliotheque) { if (arg instanceof Bibliothecaire) { jLabelStatut.setText("<html><body><font color='green'>Accès autorisé !</font></body></html>"); tableauDeBord = new TableauDeBord(); ...
7
public static String numberToString(Number number) throws JSONException { if (number == null) { throw new JSONException("Null pointer"); } testValidity(number); // Shave off trailing zeros and decimal point, if possible. String string = number.toString(); if (string...
6
public String tradeFromMarkets() throws MonkeyTalkFailure { Application app=new ConnectClass().connect(); String results=null; try { app.tabBar().select("Markets"); app.button("Search").tap(); app.input("_searchField").enterText(cfdMarket, "enter", new Mods.Builder().thinktime(5000).build()); ap...
7
private void connect() { String key = Crawler.extractParameter(Crawler.downloadPage("http://world" + WORLD + ".runescape.com/g=runescape/,j0"), 32); if (key == null) { System.err.println("Couldn't find valid handshake key."); System.exit(1); } requester.connect("world" ...
2
@Test public void TestaaAlhaaltaYlosEste() { rakentaja = new Kartanrakentaja(10, 6); rakentaja.asetaEste(5, 3); rakentaja.asetaEste(5, 4); rakentaja.asetaEste(5, 2); char[][] kartta = rakentaja.getKartta(); Solmu aloitus = new Solmu(9, 3); Solmu maali = new So...
5
public void addAndPlay(String songID,String title){ addToQueue (songID,title); if (player.isPaused()||player.isPlaying()) player.stop(); player.setIndex(model.size()-1); player.play(); }
2
public boolean _setSpriteLabel(String label) { if(label != null) { this.label = label; this.setText(label); return true; } else { return false; } }
1
boolean isBasicType() { return ((type == TYPE_STRING) || (type == TYPE_LONG) || (type == TYPE_DOUBLE) || (type == TYPE_INTEGER) || (type == TYPE_LONG_WRAPPER) || (type == TYPE_DOUBLE_WRAPPER) || (type == TYPE_INTEGER...
7
public void setDAO(String daoLine) { if (daoLine.equals("Mock")) { dao = new MockDAO(); } else if (daoLine.equals("MySQL")) { dao = new MySQLDAO(); } }
2
public static void saveImageAsPng(String src, String dest, int formatWidth, int formatHeight) throws IOException { File saveFile = new File(dest); BufferedImage destImage = imageZoomOut(src, formatWidth, formatHeight); ImageIO.write(destImage, "PNG", saveFile); }
0
public Player(Animation left, Animation right, Animation deadLeft, Animation deadRight, Animation standingLeft, Animation standingRight, Animation jumpingLeft, Animation jumpingRight) { super(left, right, deadLeft, deadRight, standingLeft, standingRight, jumpingLeft, jumpingRight); ...
0
public void mouseClicked(MouseEvent e) { //Запоминаем событие для обработки кнопки ev = e; //Получаем выбраную строку в таблице int selectedRowIndex = tableClients.getSelectedRow(); //Получаем значения for (int i = 0; i < tableClients.getColumnCoun...
1
public Faculty addFaculty(Map<String, String[]> valuesOfFields, Long id){ Faculty f = new Faculty(); f.setName(valuesOfFields.get("name")[0]); if (id == null || id <= 0){ dao.addObject(f); } else{ f.setId(id); dao.updateObject(f); } ...
2
public void Solve() { int count = 0; for (int x1 = 0; x1 <= _max; x1++) { for (int y1 = 0; y1 <= _max; y1++) { for (int x2 = 0; x2 <= _max; x2++) { for (int y2 = 0; y2 <= _max; y2++) { if (x1 + y1 + x2 + y2 == 0) { ...
6
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final MOB target=this.getTarget(mob,commands,givenTarget); if(target==null) return false; int levelDiff=target.phyStats().level()-(mob.phyStats().level()+(2*getXLEVELLevel(mob))); if(levelDif...
9
public int getResult() { int multiplyResult = 2; do { if (multiplyResult < addResult) { increase(); } else { decrease(); } multiplyResult = 1; for (int i = 0; i <= addTwoIndex; i++) { int number = numbers[i]; log("" + number + "x"); multiplyResult *= number; } logln(""); ...
4
private LinkedHashMap<String,List<String>> ReturnNewRecordWithinBooklist(List<String> bookdate, LinkedHashMap<String,List<String>> borrowlistvalue){ List<String> newbooklist = new ArrayList<String>(); LinkedHashMap<String,List<String>> templinkedHashMap = new LinkedHashMap<String,List<String>>(); templinkedHa...
5
public static String formatBytes(long paramLong, boolean MB, boolean GB) { if (paramLong >= 1000000000L && GB) { return paramLong / 1000000000L + " GB"; } if (paramLong >= 10000000L && MB) { return paramLong / 1000000L + " MB"; } if (paramLong >= 1000L) { return paramLong / 1000L + " KB"; } retur...
5
private boolean compareParticles(Particle p1, Particle p2) { if(p1.mass == p2.mass && p1.speedX == p2.speedX && p1.speedY == p2.speedY && p1.x == p2.x && p1.y == p2.y) return true; return false; }
5
@Override public String toString() { StringBuilder sb = new StringBuilder(); if (getMinPasswordLength()>0) sb.append("length>=") .append(getMinPasswordLength()) .append(' '); if (getMinNumUpperCaseChars()>0) sb.append("upper>=") .append(getMinNumUpperCaseChars()) ...
9
public PDATransitionCreator(AutomatonPane parent) { super(parent); }
0
@Override public void deserialize(Buffer buf) { livingUID = buf.readInt(); if (livingUID < 0) throw new RuntimeException("Forbidden value on livingUID = " + livingUID + ", it doesn't respect the following condition : livingUID < 0"); livingPosition = buf.readUByte(); if (...
3
public void setSourceText(String sourceText) { if( !sourceText.equals(AlchemyAPI_CombinedParams.CLEANED) && !sourceText.equals(AlchemyAPI_CombinedParams.CLEANED_OR_RAW) && !sourceText.equals(AlchemyAPI_CombinedParams.RAW) && !sourceText.equals(AlchemyAPI_CombinedParams.CQUERY) && !sourceText.equals(Alchem...
5
public static int getMaxHealth( String race ) { if ( race.equals("crystal") ) return MAX_HEALTH_CRYSTAL; else if ( race.equals("engi") ) return MAX_HEALTH_ENGI; else if ( race.equals("energy") ) return MAX_HEALTH_ENERGY; else if ( race.equals("human") ) return MAX_HEALTH_HUMAN; else if ( race.equals("man...
9
public static void readLines(String file, ArrayList<String> lines) { BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(new File(file))); String line = null; while ((line = reader.readLine()) != null) { lines.add(line); } } catch (FileNotFoundException e) { e.pri...
5
public void removeEnderecos(Endereco e){ if(enderecos.contains(e)){ enderecos.remove(e); } }
1
private void addVenueResponses(Choice choice) { final World world = actor.world() ; final Batch <Employment> around = new Batch <Employment> () ; float numSampled = 5 + (actor.traits.traitLevel(INTELLECT) / 4) ; world.presences.sampleFromKey( actor, world, (int) numSampled, around, Venue.clas...
5
@SuppressWarnings("static-access") private void ROUND2() { enemises.clear(); System.out.println("Round2!!!!!!"); for (int i = 0; i < level.getWidth(); i++) { for (int j = 0; j < level.getHeight(); j++) { if ((level.getPixel(i, j) & 0x0000FF) == 2) { ...
3
@Override public boolean accept(File arg0) { String fName = arg0.getName(); String ext = ""; if (fName.contains(".")) { ext = fName.substring(fName.lastIndexOf(".")); } return ext.equalsIgnoreCase(".png") || ext.equalsIgnoreCase(".jpg") || ext .equalsIgnoreCase(".bmp") || arg0.isDirectory(); }
4
@Override public void documentAdded(DocumentRepositoryEvent e) {}
0
public static void saveAdventurer(Adventurer adventurer) throws IOException { try { List<Adventurer> adventurers = new ArrayList<>(); adventurers = getAllAdventurer(); boolean found = false; for (int i = 0, end = adventurers.size(); i < end; i++) { ...
4
protected void do_lblImage_mousePressed(MouseEvent e) { lastX = e.getX(); lastY = e.getY(); rect = lblImage.getRect(); if (e.getX() >= rect.getX() && e.getX() <= rect.getX() + rect.getWidth() && e.getY() == rect.getY()) { drag = true; } if ((e.getX() == rect.getX() + rect.getWidth() && e.getY(...
9
public JSONObject increment(String key) throws JSONException { Object value = this.opt(key); if (value == null) { this.put(key, 1); } else if (value instanceof Integer) { this.put(key, ((Integer) value).intValue() + 1); } else if (value instanceof Long) { ...
5
public Vector get_field_as_vector( String section, String field ) throws NoSuchKeyException, NoSuchSectionException { Hashtable s; if(section==null) { throw new NoSuchSectionException(); } if(field==null) { throw new NoSuchKeyException(); } s = (Hashtable) sections.get(section); if( s == null) { thr...
5
public static void main(String[] args) throws Exception { String inFile=null; if(args.length>0) inFile=args[0]; else inFile = "default.txt"; InputStream inStream = new FileInputStream(inFile); LizpLexer lexer = new LizpLexer(new ANTLRFileStream(inFile)); CommonTokenStream tokens = new CommonTokenStr...
1
public void dumpExpression(TabbedPrintWriter writer) throws java.io.IOException { /* * There are special cases where a cast isn't allowed. We must cast to * the common super type before. In these cases instanceof always return * false, but we want to decompile even bad programs. */ Type superType = i...
1
private void field_cta_nroFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_field_cta_nroFocusLost if (lab_modo.getText().equals("Baja") || (lab_modo.getText().equals("Modificación"))){ if (!field_cta_nro.getText().equals("")){ if(existeCta(Integer.parseInt(field_cta_nro.ge...
5
protected void interrupted() { end(); }
0
@Override public void startSetup(Attributes atts) { super.startSetup(atts); addActionListener(this); }
0
public static void main(String[] args) { List list = new ArrayList(); list.add("String"); list.add(new Integer(1)); list.add(new Boolean(false)); String str = (String)list.get(0); Integer in = (Integer)list.get(1); String b = (String)list.get(2); /** * Exception in thread "main" java.lang.C...
0
@Override public void paintComponents(Graphics g) { Graphics g2 = g.create(); int x, y; int w, h; Rectangle bounds = this.parent.getBounds(); if (this.skin.isChanged() || (this.ground == null) || (this.symbol == null)) { try { String p = this.ski...
5
@Bean public PlatformTransactionManager transactionManager() { return new JpaTransactionManager(); }
0
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { if(Arctica.debug) { if(event.getDamager() instanceof Player) { if(event.getEntityType() == EntityType.HORSE) { ...
3
@Override public void logicUpdate(GameTime gameTime) { if (currentState != GameLayerState.PAUSED) { // Call the start up of any methods that just registered, and add // them to the logic update list startUpLogicalQueue(gameTime); // for (int i = 0, length = gameLogicalQueue.size(); i < length && // !...
2
public static void main(String[] args) { try { AppGameContainer app = new AppGameContainer(new game()); app.setDisplayMode(400, 400, false); app.setVSync(true); app.start(); } catch (SlickException e) { e.printStackTrace(); } }
1
public int maxIndexLookback( int optInTimePeriod ) { if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) ) optInTimePeriod = 30; else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) ) return -1; return (optInTimePeriod-1); }
3
public static void modifyDefaultAmounts(List<Account> accountList, Accounts accounts){ if(!accountList.isEmpty()) { for(Account account : accountList){ BigDecimal defaultAmount = account.getDefaultAmount(); boolean retry = true; while(retry){ ...
5
public AbstractResource findResource(int resourceId) { ResourceId id = parseResourceId(resourceId); for (ResPackage resPackage : this.packages) if (resPackage.packageId == id.packageId) { for (ResType resType : resPackage.types) if (resType.id == id.typeId) { return resType.getFirstResource(resour...
4
public boolean hasVariableAttribute(Element root, String varName, String attributName){ Namespace ns = root.getNamespace(); Element variables = root.getChild("variables", ns); boolean exists = false; for (int i=0; i < variables.getChildren().size(); i++){ Element variable = (Element)variables.getChil...
3
public String getField() { return field; }
0
private String[] parseURL( String url ) { if (url == null) { return null; } String[] parts = new String[8]; // Remove leading and trailing whitespace url = url.trim(); // Fragment int fragment_index = url.indexOf(FRAGMENT_DELIM); if (fragment_index < 0) { parts[7] = null; } else { ...
7
@Override public void caseAVetorVar(AVetorVar node) { inAVetorVar(node); if(node.getColcheteD() != null) { node.getColcheteD().apply(this); } if(node.getNumeroInt() != null) { node.getNumeroInt().apply(this); } if(node.getCo...
4
public static void render() { //TODO might be laggy int[] resolution = {Display.getWidth(), Display.getHeight()}; float iconWidth = resolution[1] * 0.05f; float width = iconWidth * 12f + 13; float height = iconWidth + 1; float startX = resolution[0] * x - width * ancho...
5
private void updateCamPos() { final int marginX = (int) (getWidth() * 0.25); final int marginTop = (int) (getHeight() * 0.2); final int marginBottom = (int) (getHeight() * 0.2); Point pos = hero.getPos(); Dimension dim = hero.getSize(); // update x motion //...
4
public void setId(int id) { this.id = id; }
0
private String[] processCommand(String command) { String[] words; if (command.contains("->")) { words = command.split("->"); commandId = 1; return words; } else if (command.contains(" follows ")) { words = command.split(" follows "); co...
9
public boolean isPalindrome(int x) { if (x < 0) return false; if (x == 0) return true; int digits = 1; while (x / digits >= 10) digits = digits * 10; while (x > 0) { if (x / digits != x % 10) return false; ...
5
public void removeLayoutComponent(Component comp) { synchronized (comp.getTreeLock()) { if (comp == center) { center = null; } else if (comp == north) { north = null; } else if (comp == south) { south = null; } else if (comp == east) { east = null; } else if (comp == west) { west = ...
9
public Avatar( AvatarianTranceiver atc, InternalUpdater updater ) { super(updater); PatchCable<ObjectEthernetFrame<?>> headPortCable = new PatchCable<ObjectEthernetFrame<?>>(ConnectorTypes.rj45.male, ConnectorTypes.rj45.female, ObjectEthernetFrame.GENERIC_CLASS, 0, updater); PatchCable<ObjectEthernetFrame<?>> ...
7
public static Matrix read (BufferedReader input) throws java.io.IOException { StreamTokenizer tokenizer= new StreamTokenizer(input); // Although StreamTokenizer will parse numbers, it doesn't recognize // scientific notation (E or D); however, Double.valueOf does. // The strategy here is to dis...
8
@Override public Livro ListById(int id_livro) { Connection conn = null; PreparedStatement pstm = null; ResultSet rs = null; Livro l = new Livro(); try{ conn = ConnectionFactory.getConnection(); pstm = conn.prepareStatement(LISTBYID); rs = p...
3
static Point neighbour(Point p){ Point q = null; for(int i= p.x-1;i<= p.x+1;i++) for(int j= p.y-1; j<=p.y+1;j++) if(map[i][j] == 3 || map[i][j] == 8 || map[i][j] == 0 || map[i][j] == 7) q= new Point(i,j); return q; }
6
@Override public void read(Json json, JsonValue val) { this.ID = val.getString("ID"); this.sceneID = val.getInt("sceneID"); float posX = val.getFloat("posX"); float posY = val.getFloat("posY"); Vector2 pos = new Vector2(posX, posY); this.setPosition(pos); this.health = val.getDouble("health"); this.bur...
4
@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (sender.hasPermission("CreeperWarning.format")) { File saveTo = new File(plugin.getDataFolder(), "Warnlog.txt"); boolean b = true; try { if (saveTo.exists()) { saveTo.delete(); } saveTo.c...
4
private boolean canHaveAsTeleporter(Teleporter teleport) { if (teleport == null) return false; return grid.getElementsOnPosition(teleport.getPosition()).isEmpty(); }
1
public boolean Validate(kGraph g) { for(Iterator< Edge>i = g.edges.iterator();i.hasNext();) { Edge edge = i.next(); if( !validEdge(edge, 4, 7, 7)&& !validEdge(edge,2,8,8) && !validEdge(edge, 0, 1, 10) && !validEdge(edge, 0 ,5, 11) && !validEdge(edge, 1, 8, 12) && !validEdge(edge, 1, 6,...
9
public static HashSet<String> wordChecker(String IPString){ IPString = IPString.toUpperCase(); HashSet<String> dictionaryhashset = DictionaryImpl.dictionaryLoader("src/pocket-dic.txt");//le Dictionary HashSet<String> resultantHS = new HashSet<String>(); int index = 0; for(String s : dictionaryhashset){ for...
5
public String getTaggedSentence ( String stringToTag ) { String result = ""; List<List<HasWord>> sentences = tagger.tokenizeText(new StringReader(stringToTag)); for ( List<HasWord> sentence : sentences ) { ArrayList<TaggedWord> tSentence = tagger.tagSentence(sentence); re...
1
@Override public void onUpdate() { JButton button = mModel.getPressedButton(); Dimension size = button.getSize(); int labelX = mLabel.getX(); int labelY = mLabel.getY(); int buttonX = button.getX(); int buttonY = button.getY(); int buttonPosX = buttonX / size.width; int buttonPosY = buttonY / size.he...
9
public int onLoop() throws InterruptedException { if (canRun) { if (strategyTask == null && !strategyTask.hasNext()) strategyTask = strategyList.iterator(); else { final Strategy currentStrat = strategyTask.next(); if (currentStrat != null && currentStrat.canActivate()) currentStrat.execute(); ...
5
@Override protected boolean onCache(ByteBuffer buffer) { int size = buffer.capacity(); if (!buffer.isDirect() || size < minSize || size > maxSize) { return false; } ByteBufferStack stack = map.get(size); if (stack == null) { // Only acquire write lock when adding to map. synchronized (writeLoc...
4
public void setTimers() { this.timer = new Timer(); if (socketClient != null || (socketClient == null && socketServer == null)) { this.timer.scheduleAtFixedRate(new MovePlayers(), 0, speed); this.timer.scheduleAtFixedRate(new Repaint(), 0, speed); this.timer.scheduleAtFixedRate(new AnimatePlayers(), 0, spe...
3
public static SpeciePoolEvolution readTargetBehavior(String filePath) throws InvalidInputException { BufferedReader reader = null; SpeciePoolEvolution speciePoolEvolution = new SpeciePoolEvolution(); try { reader = new BufferedReader(new FileReader(new File(filePath))); readConcentrationsAtSpecificTimePoi...
3
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; HtmlCharToken other = (HtmlCharToken) obj; if (CHAR != other.CHAR) return false; return true; }
4
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ConnectionId) { ConnectionId that = (ConnectionId) obj; return isEqual(this.address, that.address) && this.maxIdleTime == that.maxIdleTime && this.maxRetries == that.maxRetries && ...
9
public static Matrix multiplyThread(Matrix matrixA, Matrix matrixB) throws IllegalSizesException, MatrixIndexOutOfBoundsException { Matrix matrixC = null; int rowsA = matrixA.getRowsCount(); int colsA = matrixA.getColsCount(); int rowsB = matrixB.getRowsCount(); int ...
8
public void close() { sendMessageToAll(new Message(MessageType.CLOSE)); if(accepter != null) accepter.close(); if(clients != null) { for(Client client: clients) { client.close(); } clients.clear(); } ...
3
protected void alterneigh(int rad, int i, int b, int g, int r) { int j, k, lo, hi, a, m; int[] p; lo = i - rad; if (lo < -1) lo = -1; hi = i + rad; if (hi > netsize) hi = netsize; j = i + 1; k = i - 1; m = 1; while ((j < hi) || (k > lo)) { a = radpower[m++]; if (j < hi) { p = netw...
8
public boolean validarFormato(String vIngreso){ if (vIngreso.isEmpty()){ return true; } for(int i = 0; i < vIngreso.length(); i++){ if(!((vIngreso.charAt(i) > 64 && vIngreso.charAt(i) < 91) || (vIngreso.charAt(i) > 96 && vIngreso.charAt(i) < 123))){ ...
6
void parsePI() throws java.lang.Exception { String name; name = readNmtoken(true); if (!tryRead("?>")) { requireWhitespace(); parseUntil("?>"); } if (handler != null) { handler.processingInstruction(name, dataBufferToString()); } ...
2
private static void svm_group_classes(svm_problem prob, int[] nr_class_ret, int[][] label_ret, int[][] start_ret, int[][] count_ret, int[] perm) { int l = prob.l; int max_nr_class = 16; int nr_class = 0; int[] label = new int[max_nr_class]; int[] count = new int[max_nr_class]; int[] data_label = new int[l]...
8
public HuffmanCountingBloomFilter(final Hashtable<Short,Integer> distribution, final Short[] cbf, final Short maxlen) { this.huff = new Huffman<Short>(distribution); this.rate = maxlen; this.maxlen = maxlen; this.filter = encodeFilter(cbf); }
0
* @param n * @param module * @param environment * @return Stella_Object */ public static Stella_Object getNthValue(Stella_Object sequence, int n, Module module, Environment environment) { if ((n >= PLI.getColumnCount(sequence)) || (n < 0)) { { OutputStringStream stream000 = OutputStringS...
9
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://download.ora...
6
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; for(int id = 0; id < shapes.size(); id++) { GradientPaint p = null; if(select+1 == id) p = new GradientPaint(0,0,Color.GREEN,900,0,Color.BLUE); else p = new GradientPaint(0,0,Color.LIGHT_GRAY,80...
8
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); while ((line = in.readLine()) != null && line.length() != 0) { v = retDoubles(line); if ((f(v, 0) * f(v, 1)) <= 0...
3
public void SelecionarArquivo(int posicao){ //SELECIONA IMAGEM int option = fc.showOpenDialog(jPanel1); if (option == JFileChooser.APPROVE_OPTION) { separator = System.getProperty("file.separator"); nomePasta = "an...
3
public static void requestProduct() throws IOException { if (getTextField().getText().length() > 0 && getTextField().getText().matches("[0-9]+")) { getTextArea().setText(ApiUtil.formatOutput(ApiUtil.fetchObject("products", getTextField().getText()))); ProductApiService.getByNumber(DbReader.getToken(), Long.val...
4
public void stop(String soundName) { Sound sound = sounds.get(soundName); if (sound != null) { sound.stop(); } }
1
public Image loadImage (String file) // this method reads and loads the image { try { InputStream m = this.getClass().getResourceAsStream(file); return ImageIO.read (m); } catch (IOException e) { System.out.println ("Error: File " +...
1
public int getTicks() { long i = Ticker.getTime(); if (i - s2 > rate) { int ticks = (int) ((i - s2) / (long) rate); s2 += (long) rate * ticks; return ticks; } return 0; }
1
private void jobJoin(Player play, String job) { String pLang = PlayerCache.getLang(play.getName()); String jobName = UpperCaseFirst.toUpperFirst(McJobs.getPlugin().getLanguage().getJobNameInLang(job, pLang).toLowerCase()); job = job.toLowerCase(); String sPlay = play.getName(); i...
9
public void update() { if (resumeGame.contains(MouseMotListener.mouse)) { hoveringResume = true; } else { hoveringResume = false; } if (options.contains(MouseMotListener.mouse)) { hoveringOptions = true; } else { hoveringOptions = false; } if (exitGame.contains(MouseMotListener.mouse)) {...
3
public Vector3f checkCollisions(Vector3f oldPos, Vector3f newPos, float objectWidth, float objectLength) { Vector2f collisionVector = new Vector2f(1,1); Vector3f movementVector = newPos.sub(oldPos); if(movementVector.length() > 0) { Vector2f blockSize = new Vector2f(SPOT_WIDTH, SPOT_LENGTH); Vector2f ...
5
private void make (String options) { char action, object = '\0'; int length; length = options.length(); if (length < 1 || (length < 2 && options.charAt(0) == 'c')) { System.out.println("Comando inválido."); return; } action = options.charAt(0); ...
8