text
stringlengths
14
410k
label
int32
0
9
private static String escapeJSON(String text) { StringBuilder builder = new StringBuilder(); builder.append('"'); for (int index = 0; index < text.length(); index++) { char chr = text.charAt(index); switch (chr) { case '"': case '\\': ...
8
private void addCardElementsToList(NodeList nList, String type) { for (int temp = 0; temp < nList.getLength(); temp++) { Node nNode = nList.item(temp); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; if ( type == "CommunityChest" ) { cardElements.add(createCommu...
5
public void checkProjectileCollisions() { for (Projectile p : projectiles) { //projectile to wall collisions boolean tmp[] = check.checkWallCollisions(p); for (int i = 0; i < 4; i++) { //mahdollista muuta käyttöä myöhemmin if(tmp[i...
6
public Tex rendered() { if(rnm == null) { boolean hv = (type & 2) != 0; BufferedImage nm = null; if(name.length() > 0) nm = Utils.outline2(nfnd.render(name, BuddyWnd.gc[group]).img, Utils.contrast(BuddyWnd.gc[group])); int w = 0, h = 0; if(nm != null) { w += nm.getWidth(); if(nm.getHeigh...
9
private double parseLevel1() throws ParsingException { if (tipoTokenActual == TOKEN_TYPE.VARIABLE) { TOKEN_TYPE tokenTemp = tipoTokenActual; String tokenNow = token;/*new String(token);*/ int temp_index = i; getToken(); if (token.equals("=")) { ...
9
public void updateCustomer(Customer customer) { this.em.merge(customer); }
0
static int calculate(int x, int y) { if (y == 0) throw new ArithmeticException(); return x / y; }
1
private void writeHeader() throws IOException { byte FileLangId = dbfConfig.getLanguageID(); int HeaderSize = 0; int RecordHeaderSize = 0; byte[] header = null; if (dbfConfig.getDbfVersion() == ru.nyrk.util.jdbf.DBFConfig.DbfVersion.xBaseVII) { HeaderSize = 68; ...
5
@Override public void run() { while (true) { if (!pause) { Log.i("TaskClearing!!!"); try { Set<String> keys = runningTasks.keySet(); Iterator<String> iterator = keys.iterator(); while (iterator.hasNext()) { String key = iterator.next(); ServerTask task = runningTasks....
8
public boolean isCellEditable(int row, int col) { if (col == ID || col == USE || col == ENTITY) return false; return true; }
3
public static void main(String ... a) throws Exception { Options options = new Options(); options.addOption("i", "input", true, "input path. Required"); options.addOption("o", "output", true, "output path. Required"); options.addOption("b", "block-size", true, "size in bytes of i/o block...
8
private void waterFlow() { float flowRate = Globals.getSetting("Flow rate", "Water");//0.04f; float flowThreshold = Globals.getSetting("Flow threshold", "Water");//0.1f; for(int x = 1; x < Globals.width-1; x++){ for(int y = 1; y < Globals.height-1; y++){ if(groundWaterLevel[x][y] >= flowRate){ float h...
6
void gotoNextLiftSource() { if (!demoMode) return; Hill hill = null; Cloud cloud = null; if (app.landscape != null) { hill = app.landscape.nextHill(new Vector3d(p.x, p.y + 2, p.z)); } if (app.sky != null) { cloud = app.sky.ne...
7
public static String composeWhereForNum(String sql, String fieldName, String fieldValue, int action) { // String sTmp = String.valueOf(fieldValue); if (fieldValue == null || fieldValue.trim().compareTo("") == 0) return sql; String sTmp = fieldName + " = " + fieldValue; switch (action) { case EQUAL: b...
9
private void btnEkleMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnEkleMousePressed if(!btnEkle.isEnabled()) return ; HashMap<String, String> values = new HashMap<>(); values.put("ad", txtAd.getText().trim()); values.put("soyad", txtSoyad.getText...
3
public void setScale(double scale){ scaleBy = scale; // drawer.setScale(scale); }
0
public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter number of rows for a matrix operation"); int rows = Integer.parseInt(reader.readLine()); System.out.println("Please enter number of columns f...
8
public static void download(final String from, final String to) { try { final URL url = new URL(from); out = new BufferedOutputStream(new FileOutputStream(to)); in = url.openConnection().getInputStream(); while ((read = in.read(buffer)) != -1) out.write(buffer, 0, read); System.out.println("The fil...
4
public void process(){ for(Entity e : getEntities()){ Velocity v = (Velocity) e.getComponent(velocityID); if(v.isEnabled()){ v.x += v.dx; //v.y += v.dy; if(v.x > 450 || v.x < 0) v.dx *= -1; //if(v.y > 450 || v.y < 0) v.dy *= -1; } } }
4
@Override public int getIndexOfChild(Object parent, Object child) { int count = 0; Class<?> type = parent.getClass(); if (type == Schema.class) { TreeMap<String, Table> tables = ((Schema)parent).getTables(); for (Map.Entry<String, Table> t : tables.entrySet()) { if (t.getKey().compareTo(child.toString(...
8
public static int kadaneAlgo (int[] seq) { int curr_max_sum = seq[0]; int max_sum = 0xFFFFFFFF; int temp_start = 0; for (int i = 1; i < seq.length; i++) { if (curr_max_sum < 0) { temp_start = i; curr_max_sum = seq[i]; } else {...
3
int getInfluencer(boolean[][] followingMatrix){ if(followingMatrix == null || followingMatrix.length != followingMatrix[0].length) return -1; Queue<Integer> queue = new LinkedList<Integer>(); boolean[] checked = new boolean[followingMatrix.length]; queue.offer(0); ...
8
public static void mobSpawner() { // int mobSpawnGoal1; // int mobSpawnGoal2; // int mobSpawnGoal3; // mobSpawnGoal1 = 1; if(spawnFrameMob1 >= spawnTimeMob1){ // && mobSpawnCount1 < mobSpawnGoal1 for(int i = 0; i < Screen.mobs.length; i++){ if(!Screen.mobs[i].inGame){ Screen.mobs[i].spawnMob(Value....
9
@EventHandler(priority=EventPriority.LOW) public void getEnchantments(EnchantItemEvent event) { if(event.isCancelled()) return; Player play = event.getEnchanter(); Map<Enchantment, Integer> enchantments = event.getEnchantsToAdd(); if(MCListeners.isMultiWorld() && !play.h...
6
static final boolean method989(int i, int i_92_, int i_93_) { anInt8401++; if (Class156.method1241(i_93_, i, i_92_ ^ 0x1fe) | (0x10000 & i) != 0 || BufferedPacket.method3325(i, i_93_, true)) return true; if (i_92_ != -385) return false; if ((i_93_ & 0x37) != 0 || !Class273.method2056(i, 120, i_93_)) ...
5
private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList1ValueChanged if (editor == jTextField1) { if (jList1.getSelectedValue() == null) jTextField1.setText(""); else jTextField1.setText(jList1.getSelectedValue().toString()); } ...
9
@Override public void handleWindow(final Window window, int eventID) { if (!firstTradesWindowOpened) { showAllTrades = Settings.settings().getBoolean("ShowAllTrades", false); } if (!showAllTrades) { firstTradesWindowOpened = true; return; } ...
9
public String getImie() { return imie; }
0
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
public Point2D getLocation() { return this; }
0
public int getUnsignedSmart() { // method421 int i = payload[offset] & 0xff; if (i < 0x80) { return getUnsignedByte() - 0x40; } else { return getUnsignedShort() - 0xC000; } }
1
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } Position other = (Position) obj; return this.x == other.x && this.y == other.y; }
4
private void setID(String num){ switch(num){ case "A": id = 1; break; case "J": id = 11; break; case "Q": id = 12; break; case "K": id = 13; break; default: id = In...
4
public ResultPage<Book> getBooks(String search, String searchColumn, String orderColumn, int offset) throws SQLException { openBooksDatabase(); StringBuilder query = new StringBuilder("SELECT * FROM Titles WHERE "); if (searchColumn.equals("Title")) { query.append("Title"); } else { query.append(...
6
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
private static String getNumberEncoding(String characters) { if ("ABC".contains(characters)) { return "2"; } else if ("DEF".contains(characters)) { return "3"; } else if ("GHI".contains(characters)) { return "4"; } else if ("JKL".contains(characters)) { return "5"; } else if ("MNO".contains(chara...
8
public static void removeVarObject(int objectType, int objectX, int objectY, int objectHeight) { for (int index = 0; index < varObjects.size(); index++) { VariableObject vo = varObjects.get(index); if(vo == null) continue; if(vo.getType() == objectType && vo.getX() == objectX && vo.getY() == objectY &...
6
public ArrayList<FrameSet> partition(String partitionType, int partitionOption){ //System.out.println("Partitioning."); // Generate set number of partitions. int itemsPerPartition = 0; int numberOfPartitions = 0; if (partitionType.equalsIgnoreCase("numberPartitions")){ itemsPerPartition = this...
6
public ArrayList<Integer> cluster(){ int number_of_clusters = 3;//(int)Math.ceil(this.p.len/4); int its = 100; Dataset data = new DefaultDataset(); data.addAll(Arrays.asList(instances)); Dataset[] best_clusters = null; double best_score = 999999999999.0; for (i...
8
public void receivePose(SimplePose pose) { if (markerTransGroup == null){ return; } double[] trans = new double[3]; double[] rot = new double[4]; trans[0] = pose.getTx(); trans[1] = pose.getTy(); trans[2] = pose.getTz(); rot[0] = pose.getRx(); rot[1] = pose.getRy(); rot[2] = pose.getRz(); rot[...
4
public int compareTo(InvalidOperation other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; InvalidOperation typedOther = (InvalidOperation)other; lastComparison = Boolean.valueOf(isSetWhat()).compare...
7
@Override public boolean hasNext() { while (count < vortexSpaces.length && vortexSpaces[count] == null) { count++; } if (count < vortexSpaces.length) { return true; } count = 0; return false; }
3
@Override public int compareTo(Oriented<S> o) { return orientation ? item.compareTo(o.item) : o.item.compareTo(item); }
1
public BufHashTbl() { // initializes all entries in the Page Table to null for (int i=0; i < HTSIZE; i++) ht[i] = null; } // end constructor
1
private void RightButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RightButtonActionPerformed if (FocusOwnerIndex == 1) { if (NumberField1.getCaretPosition() >= NumberField1.getText().length()) { // jump to next textfield FocusOwnerIndex += 1; ...
8
public List<T> DFS() { List<T> dfsTraversalElements = new ArrayList<T>(); Stack<BinaryTree<T>> nodes = new Stack<BinaryTree<T>>(); nodes.push(this); while (!nodes.isEmpty()) { BinaryTree<T> node = nodes.pop(); if(node != null) { nodes.push(node); ...
8
public static void openURL(String url) { try { //attempt to use Desktop library from JDK 1.6+ Class<?> d = Class.forName("java.awt.Desktop"); d.getDeclaredMethod("browse", new Class[] {java.net.URI.class}).invoke( d.getDeclaredMethod("getDesktop").invoke(null), new Objec...
9
public void execute() { try { while( !terminated ) { final List commandList = getCommandList(); final Map resultMap = getCommandResult( commandList ); List[] lists = getCommandResultAsLists( commandList, resultMap ); info( lists[ 0 ].size() + "/" + ipList.size() + " servers alive." ); info( lists[ 1 ].si...
4
@Override public void start() { Logger l = plugin.getLogger(); try { if (socket == null) { socket = new ServerSocket(port); running = true; } if (running) { try { l.log(Level.INFO, "Waiting for connection.."); Socket client = socket.accept(); ClientHandler handler = ...
4
private void synchronizeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_synchronizeButtonActionPerformed synchronizeButton.setEnabled(false); this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); try { final String sourceDir = sourceDirecto...
4
public static void main(String[] args) { FileMerger app = new FileMerger(); app.getFileName(); if (!app.createFileList()) { System.exit(0); } try { app.mergeFiles(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
2
private void ssInsertionSort (int PA, int first, int last, int depth) { final int[] SA = this.SA; int i, j; // pointer within SA int t; int r; for (i = last - 2; first <= i; --i) { for (t = SA[i], j = i + 1; 0 < (r = ssCompare (PA + t, PA + SA[j], depth));) { do { SA[j - 1] = SA[j]; } while...
6
public Processor(Privilege privilege, int numPhysPages) { System.out.print(" processor"); // Sets the pagesize if(Config.getString("Processor.pageSize")!= null) { pageSize = Config.getInteger("Processor.pageSize"); } else { // default pagesize ...
5
public static int runToAddressLimit(int baseKeys, int startKeys, int stepLimit, int... addresses) { if (!curGb.onFrameBoundaries) { int add = curGb.step(0, addresses); if (add != 0) return add; } int steps = 0; while (steps < stepLimit) { int add = curGb.step(steps == 0 ?...
5
@Override public void run() { Thread.currentThread().setName("FileDeleter-" + getName()); Logger.log("Running FileDeleter on " + getAbsolutePath()); while (!done && isFile()) { if (System.currentTimeMillis() >= killTime) { Logger.log("Removing TemporaryFile " + getAbsolutePath()); try { r...
5
public void map() { //points is start, controls, end double[][][] V = new double[points.length-1][intervals+1][2]; for (int c = 0; c < V.length; c++) { for (int i = 0; i < V[c].length; i++) { V[c][i][0] = (1 - (double)i/intervals)*points[c][0] + ((double)i/intervals)*points[c+1][0]; V[c][i][1] = ...
6
public String getColumnName(int columnIndex) { switch (columnIndex) { case 0: return "Name"; case 1: return "Level"; case 2: return "Teacher"; case 3: return "Quantity"; case 4: return "Schedule"; } return ""; }
5
private final void push(int ch) { if (ch != 0) { if (mTextPos == mTextBuffer.length) { char[] bigger = new char[mTextPos * 4 / 3 + 4]; System.arraycopy(mTextBuffer, 0, bigger, 0, mTextPos); mTextBuffer = bigger; } mTextBuffer[mTextPos++] = (char) ch; } }
2
public static boolean saveImage(Image img, String filename) { String extension = null; try { int index_of_extension = filename.lastIndexOf("."); extension = filename.substring(index_of_extension); if(extension.equalsIgnoreCase(".gif") ) { ...
7
public void executeCommand(CommandType userCommand) throws IOException, ParseException { CommandTypesEnum commandType = determineCommandType(userCommand); switch (commandType) { case ADD: AddCommandType addUserCommand = (AddCommandType) userCommand; add(addUserCommand.getDescription(), addUserCommand.ge...
9
public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName());...
6
public String getNotationSystemId(String nname) { Object notation[] = (Object[]) notationInfo.get(nname); if (notation == null) { return null; } else { return (String) notation[1]; } }
1
GameLoader(String[] classNames) throws Exception{ Arrays.sort(classNames); for(String s:classNames){ Class<?> c = classLoader.loadClass(s); if(Scene.class.isAssignableFrom(c)){ scenes.put(s, (Scene) c.newInstance()); System.out.println("Found scene " + s); continue; } ...
7
public void testSubtractDays() { // This is a test for a bug in version 1.0. The dayOfMonth range // duration field did not match the monthOfYear duration field. This // caused an exception to be thrown when subtracting days. DateTime dt = new DateTime (1112306400000L, GJChro...
1
public int getNonNullPropertyCount() { int res = 0; for (Object o : values) { if (o != null) { res++; } } return res; }
2
public void setPassiveActivities(PassiveActivities passiveActivities) { this.passiveActivity = passiveActivities; }
0
public int compare(Instance s1, Instance s2) { double d = s2.predict - s1.predict; if(d > 0) return 1; if(d < 0) return -1; return 0; }
2
@Override public void run() { // TODO Auto-generated method stub try{ while(run){ Socket socket = socketListen.accept(); ComingRequestChatHandler handleRequest = new ComingRequestChatHandler(socket, myUserName); handleRequest.start(); } } catch( IOException e){ } }
2
private Point findSpawnLocation(LayeredMap map) { for(int y=3; y<map.getHeight(); y++) { for(int x=3; x<map.getWidth(); x++) { boolean ok = true; for(int j=0; j<4; j++) { for(int i=0; i<4; i++) { int ground = map.get(0, ...
7
private static void createAndShowGUI() { // http://docs.oracle.com/javase/tutorial/uiswing/examples/start/HelloWorldSwingProject/src/start/HelloWorldSwing.java //Create and set up the window. JFrame frame = new JFrame("VennMesh"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // capture glo...
4
private void simulate() { // Prepare the model for the iteration earthModel.begin(); // Submit the sim iteration to the thread pool. // Wait on the Future objects returned to block the current // thread until the iteration is complete across the whole surface. // Inspired...
7
public ListNode sort(ListNode p, int len) { if (len == 1) { return p; } ListNode a = p; ListNode b = p; ListNode atail = null; for (int i = 0; i < len / 2; i++) { atail = b; b = b.next; } atail.next = null; a = sort(a, len / 2); // don't forget renew a&b b = sort(b, len - len / 2); List...
8
@Override public Success<Type[]> parse(String s, int p) { // Parse the '['. if (s.charAt(p) != '[') return null; ++p; p = optWS(s, p); // Parse the first type. List<Type> genericArgs = new ArrayList<Type>(); Success<Type> resArg = TypeParser.singl...
7
@Override public void run() { try { long startTime = System.currentTimeMillis(); long currentTime = startTime; Random r = new Random(); double amount = 1000.0; while(isRunning()){ switch(operations){ case deposit: myBank.deposit(Account.DEFAULT_ACCOUNT_ID, amount); break; case wi...
7
public int addLeaf(Node root, Node leaf) { Node node = this.leafs.get(leaf.getInfo()); if (node!=null) { return -1; } if (root==null && this.head==null) { // no se el padre y no hay head -> head = leaf this.head = leaf; this.leafs.put(leaf.getInfo(), leaf); } else if (root==null && this.hea...
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final ObjectPropertyIdentifier other = (ObjectPropertyIdentifier) obj; if (objectType...
9
public void setRef2(String ref) { if (ref != null && ref.length() > 256) throw new IllegalArgumentException("Ref cannot be longer than 256 characters!"); this.ref2 = ref; }
2
public void removeLaser(Object player){ for(int i = 0; i < lasers.size(); i++){ if(lasers.get(i).getParent() == player){ lasers.remove(i); } } }
2
@Override public void paintComponent(Graphics g){ boolean[][] tiles = next.getTiles(); int count = 0; int width = next.getTiles()[0].length == 9 ? 3 : 4; // get width (3 or 4) of piece width = next.getTiles()[0].length == 4 ? 2 : width; for(int row = 0; row < width; ++row) { for(int col = 0; col < width; ...
5
public static List<BoundaryBox> getBoundaries(ImageProcessor im, List<Point> maximPoints){ List<BoundaryBox> result = new ArrayList<BoundaryBox>(); for(int i = 0; i < maximPoints.size(); i++){ result.add(new BoundaryBox(maximPoints.get(i), im)); } return result; }
1
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component cellComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); setHorizontalAlignment( JLabel.CENTER ); if ...
2
public void move(Direction d) { this.lastInspected = ""; Direction up = boardState.getDirection(); d = Direction.values()[(d.ordinal() - up.ordinal() + 4) % 4]; if (!player.isFrozen() && System.currentTimeMillis() - lastMovedTime > player.getStepDelay()) { if (player.getDirection() == d) { Location newLo...
8
public static Color contrastColor(Color color, Constrast type) { if (type == Constrast.invert) { return new Color(255 - color.getRed(), 255 - color.getGreen(), 255 - color.getBlue()); } if (type == Constrast.textbw) { // nasledovne konstanty nie su nahodne, neodporucam me...
5
public void publish(ApplicationEvent event) { applicationEventPublisher.publishEvent(event); }
0
boolean siOuvert(int case1, int case2) { boolean ouvert = true; for (int i=0; i<aretes.size(); i++) { if (aretes.get(i).s1.num == case1) { if (aretes.get(i).s2.num == case2) ouvert = false; } else if (aretes.get(i).s1.num == case2) { if (aretes.get(i).s2.num == case1) ouvert = false; ...
5
public boolean isOnPF(int marginx,int marginy) { if (!getTileBBox(temp_bbox_copy)) { temp_bbox_copy.x = (int)x; temp_bbox_copy.y = (int)y; temp_bbox_copy.width = 0; temp_bbox_copy.height = 0; } if (!pfwrapx) { if (temp_bbox_copy.x+temp_bbox_copy.width < -marginx) return false; if (temp_bbox_cop...
7
private void validateCustomerInfo(HttpServletRequest request, Customer customer) { if (!customer.isValid()) request.setAttribute("error", "true"); if (!customer.isValidGivenName()) request.setAttribute("invalidGivenName", "Given Name must not be empty and number"); if (!customer.isValidSurname()) requ...
9
public int moveUp(boolean findChange) { int total = 0; for (int y = 3; y > 0; y--) { for (int x = 0; x < 4; x++) { if (next.grid[x][y] != 0 && next.grid[x][y] == grid[x][y-1]) { next.grid[x][y] *= 2; next.grid[x][y-1] = 0; ...
7
public String command(CommandSender sender, Command command, String[] args) { if (args.length < 1) return plugin.getString(Language.LOCKDOWN_ARGUMENTS); String admin = Ultrabans.DEFAULT_ADMIN; if (sender instanceof Player) admin = sender.getName(); boolean locked ...
7
public static void parse_str(String string, Map<String, Object> results) { // parse a string that's URL encoded into an array if (results == null) return; if (string == null) return; String[] stuff; if (string.contains("&amp;")) { stuff = string.split("&amp;"); } else { stuff = string.split("&"); }...
6
protected void configFromAdjacent(boolean[] near, int numNear) { final Tile o = origin() ; type = TYPE_SOLAR ; if (numNear > 0 && numNear <= 2) { if (near[N] || near[S]) { facing = Y_AXIS ; if (o.y % 8 == 0) { type = TYPE_WIND ; attachModel(MODEL_TRAP_RIGHT) ; ...
8
public static double binomialCoefficientLog(final int n, final int k) { ArithmeticUtils.checkBinomial(n, k); if ((n == k) || (k == 0)) { return 0; } if ((k == 1) || (k == n - 1)) { return FastMath.log(n); } /* * For values small enough to...
9
@Test public void testSpeicherVerwaltung() { Speicher speicher = new Speicher(); int anz = speicher.getAnzZellen(); //Kompletter Speicher erstellt? if (anz != Speicher.SPEICHERGROESSE) assertFalse(true); //Speicher richtig initialisiert? for (int i = 0; i < Speicher.SPEICHERGROESSE; i++) { if(spei...
5
public void removeEventListener(IGameEventListener listener) { if (listener != null) { Iterator<Entry<GameEventType, Map<Integer, Set<IGameEventListener>>>> iterator = eventListeners.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<GameEventType, Map<Integer, Set<IGameEventListener>>> entry = i...
8
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Segmento)) { return false; } Segmento other = (Segmento) object; if ((this.codsegmento == null && other.codsegm...
5
public HostManifest(String file) throws Exception { Properties p=read(file); host=p.getProperty("host"); if(host==null) throw new RuntimeException("host name is required in "+file); for(Object x:p.keySet()) { String name=(String)x; if(!reservedName(n...
8
public static void updateAccountView() { Investor inv = (Investor) userList.get(userIndex); investorGUI.getBrokerNameText().setText(inv.getBroker().getFname() .concat(" ").concat(inv.getBroker().getLname())); investorGUI.getBalanceText().setText(Double.toString( i...
9
public static void main(String[] args) { Scanner scanner=new Scanner(System.in); HDOJ1070 hdoj1070=new HDOJ1070(); int cases=scanner.nextInt(); while (cases-->0){ int milkCnt=scanner.nextInt(); List<Milk> milks=new ArrayList<>(); while (milkCnt-->0) { ...
3
public static void main(String[] args) { Locale.setDefault(Locale.US); Scanner s = new Scanner(System.in); String op = s.nextLine(); double sum = 0; for(int i = 0; i < 5; i++){ int pad = i+1; for(int j = 0; j < pad; j++){ s.nextDouble...
5
protected void ensureOpen(String methodName) { if (isClosed) { throw new RuntimeException(methodName + "() called on a closed AbstractResultSet."); } }
1