text
stringlengths
14
410k
label
int32
0
9
public Set<Map.Entry<Float,Character>> entrySet() { return new AbstractSet<Map.Entry<Float,Character>>() { public int size() { return _map.size(); } public boolean isEmpty() { return TFloatCharMapDecorator.this.isEmpty(); } ...
8
public JSONArray getJSONArray(String key) throws JSONException { Object object = this.get(key); if (object instanceof JSONArray) { return (JSONArray) object; } throw new JSONException("JSONObject[" + quote(key) + "] is not a JSONArray."); }
1
public void setName(String name) { this.name = name; setDirty(); }
0
public void secureDatabase() { logger.debug("<<<< DatabasePasswordSecurerBean is running!!! >>>>>"); getJdbcTemplate().query("select username, password, password_encrypted from r_user", new RowCallbackHandler() { @Override public void processRow(ResultSet rs) throws SQLExceptio...
3
public int compare(String o1, String o2) { String s1 = (String)o1; String s2 = (String)o2; int thisMarker = 0; int thatMarker = 0; int s1Length = s1.length(); int s2Length = s2.length(); while (thisMarker < s1Length && thatMarker < s2Length) { ...
8
public String echoIP(ClientInterface client) { this.client = client; //System.out.println(client.name); try { System.out.println("The score on the client is " + client.findScore()); } catch (RemoteException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } String remoteClient = null;...
2
public Collection<Category> getCategories() { if (categories == null) try { execute(); } catch (SQLException e) { e.printStackTrace(); } TreeSet<Category> ret = new TreeSet<Category>(); if (categories != null) ret.addAll(categories.values()); return ret; }
3
public boolean hasCycle(ListNode head) { if (head == null) { return false; } ListNode fast = head, slow = head; do { if (fast.next == null || fast.next.next == null) { return false; } fast = fast.next.next; slow...
4
@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 Teacher)) { return false; } Teacher other = (Teacher) object; if ((this.id == null && other.id != null) || (thi...
5
private boolean handleMaintenance() { if (plugin.maintenanceEnabled != true) { plugin.maintenanceEnabled = true; plugin.config.set("maintenancemode", true); for (ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) { if (!player.hasPermission("bungee...
3
private static List<String> compactLines(List<String> srcLines, int requiredLineNumber) { if (srcLines.size() < 2 || srcLines.size() <= requiredLineNumber) { return srcLines; } List<String> res = new LinkedList<>(srcLines); // first join lines with a single { or } for (int i = res.size()-1; i ...
9
private boolean hasEveryLightGrenadePositionOnlyOneLightGrenade(Grid grid) { List<LightGrenade> lightGrenades = getLightGrenadesOfGrid(grid); for (LightGrenade lg : lightGrenades) { final Position lgPos = grid.getElementPosition(lg); for (Element e : grid.getElementsOnPosition(lgPos)) if (e instanc...
4
public static void readFileTest(){ List<String> list = new LinkedList<String>(); while(true){ list.add(java.util.UUID.randomUUID().toString()); } }
1
private void run(){ int frames = 0; double frameCounter = 0; double lastTime = Time.getTime(); double unprocessedTime = 0; while (running){ boolean render = false; double startTime = Time.getTime(); double passedTime = startTime - lastTime...
6
public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); ArrayList<Integer> numList = new ArrayList<Integer>(); do { numList.add(input.nextInt()); } while (numList.get(numList.size()-1) != 0); numList.remove(numList.size()-1); for (int i = 0...
8
@Override public void doChangeContrast(int contrastAmountNum) { if (imageManager.getBufferedImage() == null) return; double c = contrastAmountNum; double q = (c + 100) / 100; WritableRaster raster = imageManager.getBufferedImage().getRaster(); double[][] newPixels = new double[raster.getWidth()][raster.ge...
7
public ResultSet ExecuteQuery(String query) { Statement st; if (!IsConnected) { return null; } try { st = Conn.createStatement(); plugin.Debug("SQL Query: " + query); return st.executeQuery(query); } catch (SQLException e) { plugin.Warn("Query execution failed!"); plugin.Log("SQL: " + query...
2
private static void readMagicItemsFromFileToArray(String fileName, Items[] items) { File myFile = new File(fileName); try { int itemCount = 0; Scanner input = new Scanner(myFile); while (input.hasNext() && itemCou...
3
@SuppressWarnings("unchecked") @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Pair other = (Pair) obj; if (first == null) { if (other.first != null) return false; } else if (!firs...
9
public List<String> databaseMedicineInfo(String columnName) throws SQLException{ List<String> medicineName=new ArrayList(); List<Float> medicinePrice=new ArrayList(); try{ databaseConnector=myConnector.getConnection(); stmnt=(Statement) databaseConnector.createSt...
4
public int minDistance(String word1, String word2) { // Start typing your Java solution below // DO NOT write main() function int m = word1.length(); int n = word2.length(); int[][] res = new int[m + 1][]; int i = 0, j = 0; for (i = 0; i < m + 1; i++) res[i] = new int[n + 1]; for (i = 0; i < m + 1; i...
6
public static SoundManager getInstance() { return ourInstance; }
0
protected void prepare_sample_reading(Header header, int allocation, //float[][] groupingtable, int channel, float[] factor, int[] codelength, float[] c, float[] d) { int channel_bitrate = header.bitra...
7
private boolean convertYUV422toRGB(int[] y, int[] u, int[] v, int[] rgb) { if (this.upSampler != null) { // Requires u & v of same size as y this.upSampler.superSampleHorizontal(u, u); this.upSampler.superSampleHorizontal(v, v); return this.convertYUV444to...
9
public static void initCommandLineParameters(String[] args, LinkedList<Option> specified_options, String[] manditory_args) { Options options = new Options(); if (specified_options != null) for (Option option : specified_options) options.addOption(option); Option option = null; OptionBuilder.with...
9
public String toLongString() { if (flagsMap.isEmpty()) return Language.NO_PERMISSIONS_SET.getString(); String sFlags = ""; for (Map.Entry<PermissionFlag, Boolean> flag : flagsMap.entrySet()) { if (!sFlags.isEmpty()) sFlags += " | "; sFlags += flag.getKey().getName() + ": ...
4
public static int[] getLineLabels(double latitude, double longitude, int date, int dstFlag) { int[] lineLabels = new int[13]; for(int i = 0; i <= 12; i++) { lineLabels[i] = i + 6; //go from 6 am to 6 pm if(isDayLightSavings(latitude, longitude, date, dstFlag)) lineLabels[i]++; //just increase labels b...
3
@Override public List<String> getPermissions(String world) { List<String> perms = super.getPermissions(world); TotalPermissions plugin = (TotalPermissions) Bukkit.getPluginManager().getPlugin("TotalPermissions"); for (String group : inheritence) { try { Permissio...
3
public void actionPerformed(ActionEvent e) { //String cmd = e.getActionCommand(); for(ConvertOption o : this.gui.options){ if(e.equals("option_" + o.toString().toLowerCase().replace(" ", "_"))){ if(this.gui.activeOptions.contains(o)) this.gui.activeOptions.remove(o); else this.gui.active...
3
public ArrayList<Librarian> searchLibrarian(String columnName, String cond) { Connection conn = null; Statement st=null; ResultSet rs=null; ArrayList<Librarian> Librarians = null; try { conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/librarysystem?user=admin&password=123456"); String qu...
9
protected void move( GameObject obj, Location l1 ) { Location l0 = obj.getLocation(); boolean movedBetweenContainers = l0.container != l1.container; if( movedBetweenContainers ) { // Disconnect anything attached to the exterior! for( GameObject o : obj.getExterior().getContents() ) { if( o instanc...
6
public void keyPressed(KeyEvent e) { setTitle(""+ KeyEvent.getKeyText(e.getKeyCode())); System.out.println("hit + "+ KeyEvent.getKeyText(e.getKeyCode())); switch(e.getKeyCode()) { case KeyEvent.VK_DOWN :player.setVelocityY( player.getSpeed()); player.setVelocityX(0); ...
6
@Override public User build() { try { User record = new User(); record.names = fieldSetFlags()[0] ? this.names : (java.util.Map<java.lang.CharSequence,java.lang.CharSequence>) defaultValue(fields()[0]); record.name = fieldSetFlags()[1] ? this.name : (java.lang.CharSequence) defaultValu...
5
@SuppressWarnings("unchecked") private IElement decorateElement(final ClassLoader loader, final Field field) { final WebElement wrappedElement = proxyForLocator(loader, createLocator(field)); return elementFactory.create( (Class<? extends IElement>) field.getType(), wrappedElement); }
1
private static int[] addBinary(int[] aa, int[] bb){ int n = aa.length; int m = bb.length; int lenMax = n; int lenMin = m; if(m>n){ lenMax = m; lenMin = n; } int[] addition = new int[lenMax]; int carry = 0; int sum = 0; ...
6
private static List<Region> calculateBestRegionsToTransferTo(BotState state, Region transferRegion) { List<Region> closestNeighborsToBorder = DistanceToBorderCalculator.getClosestOwnedNeighborsToBorder(state, transferRegion); Region closestNeighborToOpponent = transferRegion.getClosestOwnedNeighborToOpponentBor...
5
@Override public void update(long deltaMs) { super.update(deltaMs); // cool! if we have bought an update, we first flag that as done and at the next update, when the research event has been triggered, we update the tree! if(updateResearch) { itemSlots.clear(); ...
4
@Override public synchronized boolean equals(Object obj) { if (obj == null) return false; if (this == obj) return true; if (getClass() != obj.getClass()) return false; WayOsm other = (WayOsm) obj; if (nodos == null) { if (other.nodos != null) return false; } else if (this.sortNodes().size...
8
public SQLResult process() throws Exception { Matcher createTable = Pattern.compile("[cC][rR][eE][aA][tT][eE][\\s\\t]+[tT][aA][bB][lL][eE][\\s\\t]+(\\w+)[\\s\\t]+\\([\\s\\t]*(.*)[\\s\\t]*;").matcher(command); if (createTable.find()) { // TABLENAME String tableName = createTable.group(1); Tabl...
8
public int compare(Person p1,Person p2) { int result = p1.getName().compareTo(p2.getName()); if( 0 == result) { return p1.getId() - p2.getId(); //若姓名相同则按id排序 } return result; }
1
private static boolean formQueryCity(Criteria crit, List params, StringBuilder sb, StringBuilder sbw, Boolean f23) { List list = new ArrayList<>(); StringBuilder str = new StringBuilder(" ( "); String qu = new QueryMapper() { @Override public String mapQuery() { ...
3
public boolean isMetal() { int row = getRow(), col = getCol(); if(getOrbitalLetter() == 'p' && col <= 6 && row >= col-11) return true; return false; }
3
public void shakeComponent(final JComponent component) { if(t == null || !t.isAlive()) { t = new Thread(this); t.start(); } }
2
public static void handleButtons(Player player, int buttonId, int packetId, InputStream stream) { String username = player.getDisplayName(); String clanName = "Feather"; if (buttonId == 85 && packetId == 61) { player.getPackets().sendJoinClanChat(username, clanName); } if (buttonId == 80 && packetId =...
6
private void decremDealCounter(){ dealCounter--; }
0
private void processLabors(int year, List<Man> mankind, List<Woman> womankind) { List<Man> fathers = calculateFathers(mankind); List<Human> children = new ArrayList<Human>(); for (Iterator<Woman> it = womankind.iterator(); it.hasNext(); ) { Woman woman = it.next(); if (wo...
8
@Override public void run() { //TODO collect statistics on users for fun: //1. # of standups attended/missed //2. speed of response after called on //3. avg length of standup response? //4. # of out of turn comments //2 ways in: //1. is a poll check and the user spoke //2. is not a poll, timer expi...
8
static boolean check_lon_overlap( Double arg_min_lon, Double arg_max_lon, Double min_lon, Double max_lon ) { boolean return_value = false; if ( arg_min_lon < min_lon ) { if ( arg_max_lon > min_lon ) { if ( arg_debug >= Log_Informational_2 ) { System.out.prin...
7
private int compareSync (String comp) { // Inverse sync 0x82ED4F19 final String INVSYNC="10000010111011010100111100011001"; // Sync 0x7D12B0E6 final String SYNC="01111101000100101011000011100110"; // If the input String isn't the same length as the SYNC String then we have a serious problem ! if (comp.lengt...
6
public void testSafeAddInt() { assertEquals(0, FieldUtils.safeAdd(0, 0)); assertEquals(5, FieldUtils.safeAdd(2, 3)); assertEquals(-1, FieldUtils.safeAdd(2, -3)); assertEquals(1, FieldUtils.safeAdd(-2, 3)); assertEquals(-5, FieldUtils.safeAdd(-2, -3)); assertEquals(Integ...
6
public LifeFrame nextFrame() { LifeFrame next = new LifeFrame(new String[frame.height()][frame.width()]); for (int i = 0; i < frame.height(); i++) { for (int j = 0; j < frame.width(); j++) { LifePosition lifePosition = new LifePosition(i, j); if (shouldALive(l...
3
private void writeAssociativeArray(List<Byte> ret, Map<String, Object> val) throws EncodingException, NotImplementedException { ret.add((byte)0x01); for (String key : val.keySet()) { writeString(ret, key); encode(ret, val.get(key)); } ret.add((byte)0x01); }
1
public double calculateSalary() { double salary = 0; if (paymentType == "Base") { if (paymentCurrency == "Dollar") { salary = baseRate * dollarRate; } if (paymentCurrency == "British Pound") { salary = baseRate * gbpRate; }...
8
@RequestMapping("/{id}") public String view(@PathVariable String id, Model model) { model.addAttribute("model", userRepository.findOne(id)); return "users/form"; }
0
public SchlangenKopf(Rectangle masse, IntHolder unit, Color color) { super(masse, unit, color); direction = DIRECTION_START; }
0
public void dash() { }
0
public void bannir(String _loginBan, boolean banni, String _login) throws UserAlreadyBannedException, IncompatibleUserLevelException, RemoteException { if(!_login.equals(this.getAuteur()) || !GestionnaireUtilisateurs.getUtilisateur(_login).isAdmin()) throw new IncompatibleUserLevelException(); ...
5
private int ways(int currentVal, int add, int goal) { if(currentVal == goal) { return 1; } else if(currentVal > goal) { return 0; } else { int sum = 0; for(Integer m : money) { if(m >= add) sum += ways(currentVal + m, m, goal); } return sum; } }
4
public static int pushAdjacent(Queue<Pair<Integer, Integer>> myQueue, int[][] canTravel, Pair<Integer, Integer> curr, Map<String, String> myMap){ int currX = curr.getFirst(); int currY = curr.getSecond(); if(currX+1<canTravel.length && canTravel[currX+1][currY]==0){ Pair<Integer, Integer> rightChil...
8
@Test public void testDeregisterWorkers() throws LuaScriptException { String jid = addJob(); popJob(); List<Map<String, Object>> workers = _client.Workers().counts(); for (Map<String, Object> worker : workers) { if (worker.get("name").equals(TEST_WORKER)) { assertEquals("1", worker.get("jobs").toStri...
2
private HashSet<String> getMatchesOutputSet(Vector<String> tagSet, String baseURL) { HashSet<String> retSet=new HashSet<String>(); Iterator<String> vIter=tagSet.iterator(); while (vIter.hasNext()) { String thisCheckPiece=vIter.next(); Iterator<Pattern> pIter=patternSet.iterator(); boo...
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; Employee other = (Employee) obj; if (divisionName == null) { if (o...
9
public boolean subsumes(Object general, Object specific) { HGRelType grel = (HGRelType)general; HGRelType srel = (HGRelType)specific; if (general == null || specific == null) return general == specific; if (!grel.getName().equals(srel.getName()) || grel.getArity() != srel.getArity()) return false; for ...
8
private static String loadShader( String fileName ) { StringBuilder shaderSource = new StringBuilder(); BufferedReader shaderReader = null; final String INCLUDE_DIRECTIVE = "#include"; try { shaderReader = new BufferedReader( new FileReader( "./res/shaders/" + fileName ) ); String line; while ( ( ...
3
private void buildStatsPerDay(HashMap<Component, DayStats> to, HashMap<Component, List<Interval> > from){ Iterator componentsIterator = from.entrySet().iterator(); while (componentsIterator.hasNext()) { Map.Entry pairs = (Map.Entry)componentsIterator.next(); Component node = (Component)pa...
8
@Override public EntidadBancaria read(Integer idEntidadBancaria) { try { EntidadBancaria entidadBancaria; Connection conexion = connectionFactory.getConnection(); String selectSQL = "SELECT * FROM entidadbancaria WHERE idEntidadBancaria = ?"; PreparedStatemen...
3
public void gameUpdated(GameUpdateType type) { switch (type) { case GAMEOVER: finalTime = engine.getCurrentRound(); finalN = engine.getBoard().mosquitosCaught; break; case MOVEPROCESSED: break; case STARTING: break; case MOUSEMOVED: default: // nothing. } }
4
public static boolean shouldBuild() { int starports = UnitCounter.getNumberOfUnits(buildingType); if (TerranFactory.getNumberOfUnitsCompleted() >= 3 && starports == 0 && TerranSiegeTank.getNumberOfUnits() >= 5 && !TechnologyManager.isSiegeModeResearchPossible()) { return ShouldBuildCache.cacheShouldBuil...
6
public void tire(int x, int y) { for (int i = 0; i < flotte.size(); i++) { vaisseau tmp = flotte.get(i); if (tmp.isSelected && tmp.isAlive()) { tmp.nbTir++; if (tmp.nbTir < 10) { tir.add(new laser((int) tmp.posx + tmp.milieuX, (int) tmp...
4
@Override public boolean valid() { if (ctx.players.local().animation() == -1 && (!ctx.players.local().inMotion() || ctx.movement.distance(ctx.players.local(), ctx.movement.destination()) < 4)) { if (npc().valid()) { return true; } final GameObject rock = rock(TIN_FILTER); if (rock.valid()) { Log...
5
@Override public void update(GameContainer gc, StateBasedGame sbg, int Delta) throws SlickException { if(handle.Up() == true) { System.out.println("test"); gc.exit(); System.exit(0); } }
1
private void runServer() throws IOException { // pre startup message ServerSocket serverSocket = new ServerSocket(PORTNUM); serverSocket.setSoTimeout(TIMEOUT); serverDirectoryCheck(); System.out.println("Server: Server has started broadcast on port " + PORTNUM + " and is waiting for connections..."); Sys...
5
public boolean authenticate(String username, String password) throws LoginException { if (debug) { LOG.debug("Trying to authenticate user: " + username); } boolean authenticated = false; UserData result = authenticationDao.loadUserData(username); if (res...
4
public static ArrayList<int[]> getGoalLocations(State state) { ArrayList<int[]> goalList = new ArrayList<int[]>(); int[] goalPosition = {0, 0}; ArrayList<ArrayList<String>> temp; temp = copy(state.getData()); for (int k = 0; k < temp.size(); k++) { for(int m = 0; m < temp.get(k).size(); m++) { if (temp...
5
@Override public void getOptions() { for (Component p : getParent().getComponents()) { if (p instanceof OptionsPanel) { fixedSpeed = ((OptionsPanel) p).isFixedSpeed(); player1.setLives(((OptionsPanel) p).getLives()); player2.setLives(((OptionsPanel...
2
private void trierDocuments(ArrayList<Document> documents, ArrayList<Critere> criteres, ArrayList<MotClef> motClefs, FileListModel flm) { for (Document d : documents) { if (d.matches(criteres, motClefs)) { flm.add(d); } } }
2
public Attribute getAttribute(String name) { for( int n = 0; n< attributes.size(); n++ ) { Attribute item = attributes.get(n); if( item.getName().equals(name) ) { return item; } } Attribute attribute = new Attribute(); attribute.setName(name); attributes.add(attribute); return attribute; ...
2
public boolean containsAtLeast(Inventory inventory, int minimumAmount) { int foundItems = 0; if (inventory instanceof PlayerInventory) { PlayerInventory playerInventory = (PlayerInventory) inventory; if (equals(playerInventory.getBoots()) || equals(playerInventory.getLeggings()...
7
@Override public void run() { while (serverIsRaning) { try { clientSocket = socket.accept(); ClientList.add(new Client(clientSocket)); Frame.println("Client connected."); } catch (Exception e) { serverIsRaning = false; e.printStackTrace(); } } }
2
public void updateStats(){ int totalArmor = 0; int minDmg = 0; int maxDmg = 0; int totalHealth = 0; ArrayList<InventoryBox> equipped = inv.getEquipment(); InventoryBox weapon = equipped.get(0); //weapon InventoryBox ring = equipped.get(1); //ring InventoryBox neck = equipped.get(2); //necklace if (w...
5
void processChemCompLoopBlock() throws Exception { parseLoopParameters(chemCompFields); while (tokenizer.getData()) { String groupName = null; String hetName = null; for (int i = 0; i < fieldCount; ++i) { String field = loopData[i]; if (field.length() == 0) continue; ...
9
public void tick() { peersManager.tick(); choker.tick(); Long waitTime = activeTracker.getInterval(); if (incomingPeerListener.getReceivedConnection() == 0 || peersManager.getActivePeersNumber() < 4) { waitTime = activeTracker.getMinInterval() != null ? activeTracker.getMi...
7
public String toString() { Object obj; String result = "[ "; SListNode cur = getHead(); while (cur != null) { obj = cur.red; result += "{"; result = result + obj.toString() + ","; obj = cur.green; result = result + obj.toString() + ","; obj = cur.blue; result = result + obj.toString() + ","...
1
public void writeTermList(Expression list) { boolean first = true; for (Term t : list.list) { if (first) { writer.print((t.constant == 1f ? "" : (t.constant == -1f ? "-" : t.constant == Math.ceil(t.constant) ? Integer .toString((int) t.constant) : t.constant)) + " " + t.variable + " "); ...
8
public static UserSettingsClient getInstance(){ if(instance == null){ instance = new UserSettingsClient(); } return instance; }
1
public static boolean cambioUnaLetra(char[] pActual, char[] pNueva) throws Exception { boolean [] comprobar = new boolean[pActual.length]; int contador = 0; for (int i = 0; i < pActual.length; i++) { if (pActual[i] == pNueva[i]) { comprobar[i] = true; } ...
5
private Point getRowColOfSelectedCard(Point pressPt) { Point p; for(int i =0; i < A1Constants.NUMBER_OF_ROWS; i++){ for(int j = 0; j < A1Constants.NUMBER_OF_COLS; j++){ if(cards[i][j] != null){ if(cards[i][j].getCardArea().contains(pressPt) && cards[i...
5
@SuppressWarnings("unchecked") public List<OfficeSpace> seachOfficeSpace(HashMap<String, Object> criteria){ Criteria c = new Criteria(); List<OfficeSpace> finalList = new ArrayList<OfficeSpace>(); // Create instance of Criteria object. try { if(criteria.containsKey("searchCriteria")){ c.poppulateCriter...
6
@Override public void logout(String username, int sentBy) { _userStore.remove(username); notifyUserListChanged(); if((sentBy == ServerInterface.CLIENT) && (backupServer != null)) { try { backupServer.ping(); backupServer.logout(username, ServerInterface.SERVER); } catch(Exception ex) { S...
3
private Type createArray(Type rootComponent, int dims) { if (rootComponent instanceof MultiType) return new MultiArrayType((MultiType) rootComponent, dims); String name = arrayName(rootComponent.clazz.getName(), dims); Type type; try { type = Type.get(getClassPo...
2
public char nextClean() throws JSONException { for (;;) { char c = next(); if (c == 0 || c > ' ') { return c; } } }
3
private static boolean modifyDrug(Drug bean, PreparedStatement stmt, String field) throws SQLException{ String sql = "UPDATE drugs SET "+field+"= ? WHERE drugname = ?"; stmt = conn.prepareStatement(sql); if(field.toLowerCase().equals("description")) stmt.setString(1, bean.getDescription()); if(field.toLo...
4
*/ private int[] getWhatNeedsDone() { ArrayList list = new ArrayList(); for (int i = 0; i < editingGrammarModel.getRowCount() - 1; i++) if (!converter.isChomsky(editingGrammarModel.getProduction(i))) list.add(new Integer(i)); int[] ret = new int[list.size()]; for (int i = 0; i < ret.length; i++) ret[...
3
public void transmitTextFile(final File file, final LoggedDataOutputStream dos) throws IOException { if ((file == null) || !file.exists()) { throw new IllegalArgumentException("File is either null or " + "does not exist. Cannot transmit."); } File fileToSend = file; final T...
9
public boolean objectEqualP(Stella_Object y) { { Set x = this; if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(y), Stella.SGT_STELLA_SET)) { { Set y000 = ((Set)(y)); { boolean testValue000 = false; testValue000 = x.length() == y000.length(); if (testValue000...
6
public static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double)o).isInfinite() || ((Double)o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers."); ...
7
public static int countNeighbours(boolean[][] world, int col, int row) { int c = 0; if (getCell(world, col - 1, row - 1) == true) { c += 1; } if (getCell(world, col, row - 1) == true) { c += 1; } if (getCell(world, col + 1, row - 1) == true) { c += 1; } if (getCell(world, col - 1, row) == tr...
8
public boolean fichierRename(File ancien_nom, File nouveau_nom) { if (ancien_nom.renameTo(nouveau_nom)) return true; else return false; }
1
public void setHasBackground(boolean hasBackground) { if(hasBackground && !this.hasBackground) this.setColor(this.backgroundColor); else if(!hasBackground && this.hasBackground) this.setColor(Colors.TRANSPARENT.getGlColor()); this.hasBackground = hasBackground; if(!this.hasBackground && !this.hasBor...
6
public double augmentFrontEndCharges(double capacity, int reactor_type, int year_count, PrintWriter output_writer) { // front end cost calculation int i; double charge=0; double pvf; if (year_count > FRONTENDREFYEAR[0] - START_YEAR) { // if past the reference date, total NU use must be calculat...
7