text
stringlengths
14
410k
label
int32
0
9
public void testApp() { // Create a map object TS3Map map = new TS3Map(); // Test the parseMapEntry() method Map.Entry<String, List<String>> entry = null; entry = map.parseMapEntry("name=value"); assertEquals(entry.getKey(), "name"); assertEquals(entry.getValue(...
6
private void setAutoSizeDimension() { if (!autoSize) { return; } if (image != null) { if (image.getHeight(null) == 0 || getHeight() == 0) { return; } if ((getWidth() / getHeight()) == (image.getWidth(null) / (image.getHeight(null)))...
5
public boolean kopt(Kswap2 kswap, int[] rightCuts, int i, int length,int k,int index, boolean first){ if(k==0){ // System.out.println("doing k swap on: "+Arrays.toString(rightCuts)); return kswap.startFindBestSolution(rightCuts); } int limit=length; boolean improved=false; for(int iters=0; iters<limit;...
5
public void moveLeft() { setDirection(-90); for (TetrisBug tb : blocks){ tb.setDirection(-90); } if (rotationPos==0){ if (canMove() && blocks.get(1).canMove()) { blocks.get(1).move(); move(); blocks.get(0).move(); blocks.get(2).move(); } } if (rotationPos == 1){ if (bloc...
8
private void rotateObject(PolygonObject toRotate, float x, float y) { int yRotate = 10; // maus koordinatensystem transformieren fuer rotation // sprich: verschiebe nach unten rechts x = x + 0.5f; y = y + 0.5f; if (toRotate != null) { // x-Rotation bewusst k...
5
private Data[] executeCommandsOnNodes(int commandType, final Command[] commands) throws InterruptedException{ final int maxCounterMsg; if(commandType == Command.INSERT_TABLE){ maxCounterMsg = 2; }else{ maxCounterMsg = numberOfNodes; } final CountDownLatch latch = new CountDownLatch(maxCounterMsg); fin...
9
public SeasonCreatePanel() { // ------instantiations------- lblWelcomeText = new JLabel("Welcome to SurvivorPool!"); lblInfoText = new JLabel( "Fill out the fields below to create a new season."); lblWeeks = new JLabel("Weeks:"); lblContestants = new JLabel("Contestants:"); lblTribe1 = new JLabel("Trib...
6
private void delete(int row) { if (!MyFactory.getResourceService().hasRight(MyFactory.getCurrentUser(), Resource.CONSUMPTION_W)) { return; } Consumption selectedRow = result == null ? null : result.get(row); if (selectedRow != null) { if (JOptionPane.showConfirmDi...
5
public synchronized boolean remover(int i) { try { new AreaFormacaoDAO().remover(list.get(i)); list = new AreaFormacaoDAO().listar(""); preencherTabela(); } catch (Exception e) { return false; } return true; }
1
public void addTelefone(Telefone t){ if(!telefones.contains(t)){ this.telefones.add(t); } }
1
private String executeCommand(String commandAsStr) { String response; try { response = client.sendRequestToServer(commandAsStr); } catch (HttpClientException e) { response = e.getMessage(); } return response; }
1
public static final boolean addClass(final CMObjectType type, final CMObject O) { final Object set=getClassSet(type); if(set==null) return false; CMClass.lastUpdateTime=System.currentTimeMillis(); if(set instanceof List) { ((List)set).add(O); if(set instanceof XVector) ((XVector)set).sort(); }...
7
public void remover(int codigo) throws ProdutoException { Produto prod = null; if(codigo < 0) throw new ProdutoException("CÛdigo inv·lido. Valor informado È menor que 0."); try { prod = buscarProduto(codigo); } catch (ProdutoException pe) { throw pe; } if(prod != null) produtos.remove(prod); ...
3
public boolean isFirstCharZero(String s) { if (s.length() < 1) { return false; } else { // 12:(00) is een uitzondering bij het detecteren van leading zero's if (s.length() > 1 && s.charAt(0) == '0' && s.charAt(1) != '0') { return true; } return false;...
4
private String adapter(String key) { String aRetourner=""; for(int i=0;i<key.length();i++) { if(key.charAt(i)>=65 && key.charAt(i)<=90) { aRetourner+=key.charAt(i); } if(key.charAt(i)>=97 && key.charAt(i)<=122) { aRetourner+=(char)(key.charAt(i)-32); } } return aRetourner; }
5
public void right() { if (mState != jumping && mState != beginJump && mState != ducking && mState != hardLanding) { facing = right; mState = running; if (heroxSpeed < 0) heroxSpeed = .5f; else if (heroxSpeed < 4) heroxSpeed += .5f; } else if (mState == hardLanding) heroxSpeed *= .9; ...
8
private boolean checkFront(int x, int y, int z){ int dx = x + 1; if(dx > CHUNK_WIDTH - 1){ return false; }else if(chunk[dx][y][z] != 0){ return true; }else{ return false; } }
2
@Override public void removeAttribute(String key) { if (attributes != null) { if (key == null) { key = ""; } this.attributes.remove(key); this.isReadOnly.remove(key); } }
2
public double AverageScore() { double sum = 0; for (QuizResult qr: quizResults) { sum += qr.PercentScore(); } double avg = sum / quizResults.size(); return avg; }
1
private void outputExcel(int orderChoice){ FileOutput fout = new FileOutput(this.outputFilename); fout.println(title[0]); fout.println((this.nItems)); fout.println(this.nPersons); for(int i=0; i<this.nItems; i++){ fout.printtab(this.itemNames[i]); } f...
6
public void calcBonusUnite() { // Calcul des gains d'unités si pouvoir spécial int bonusUnite = this.bonusUnite() + (hasPower() ? this.pouvoir.bonusUnite() : 0); bonusUnite = Math.min(this.nbUniteMax - this.nbUnite, bonusUnite); this.nbUnite += bonusUnite; this.nbUniteEnMain += bonusUnite; }
1
* * @return <tt>true</tt> iff the query is true in the knowledge base * * @throws IOException if a data communication error occurs * @throws CycApiException if the api request results in a cyc server error */ public boolean isQueryTrue_Cached(CycList query, CycObject mt) throws IOEx...
1
public void setShutdownmenuButtonPosition(Position position) { if (position == null) { this.buttonShutdownmenu_Position = UIPositionInits.SHDMENU_BTN.getPosition(); setShutdownframeBorderlayout(false); } else { if (!position.equals(Position.LEFT) && !position.equals(...
5
private void FindNodes() { if (current.loc.x-1>=0&&unit.PathCheck(current.loc.x-1, current.loc.y)) { AddNode(current.loc.x-1,current.loc.y); } if (current.loc.y-1>=0&&unit.PathCheck(current.loc.x, current.loc.y-1)) { AddNode(current.loc.x,current.loc.y-1); } if (current.loc.x+1<Game.map.width&&unit.Path...
8
private boolean areTriesLeft() { return gpm.getMaxTries() >= grid.getIntellingentMovementHistory() .size(); }
0
private void btnUploadSkinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadSkinActionPerformed if (fcSkin.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { File skinFile = fcSkin.getSelectedFile(); if (skinFile.exists() && skinFile.canRead()) { ...
3
public void generatePath(Vector2 bestStartPoint) { Segment2D prev = null; if (layer.skirt != null) { Polygon poly = layer.skirt.getLargestPolygon(); if (poly != null) { prev = poly.closestTo(bestStartPoint); layer.pathStart = prev; prev = poly.cutPoly(prev); } } for (int i = 0; i < l...
9
public SpecifiedActionListener(GUI gui, String text, boolean leaveZero) { this.gui = gui; this.text = text; this.leaveZero = leaveZero; }
0
@Action(name = "hcomponent.handler.onclick.invoke", args = { "undefined" }) public void onClickInvoke(Updates updates, String[] args, String param) { HComponent<?> html = (HComponent<?>) Session.getCurrent().get( "_hcomponent.object." + param); if (html.getOnClickListener() != null) Session.getCurrent() ...
3
public void testBinaryCycAccess16() { System.out.println("\n**** testBinaryCycAccess 16 ****"); CycAccess cycAccess = null; try { try { if (connectionMode == LOCAL_CYC_CONNECTION) { cycAccess = new CycAccess(testHostName, testBasePort); } else if (connectionMode == SOAP_CYC_...
8
private void copyBack(int[][] origin, int iStart, int iEnd, int jStart, int jEnd, int[][] subMatrix) { for (int i = iStart; i < iEnd; ++i) for (int j = jStart; j < jEnd; ++j) origin[i][j] = subMatrix[i-iStart][j-jStart]; }
2
@Test public void test_mult_skalar() { int a = 2; int b = 3; int skalar = -4; Matrix m1 = new MatrixArrayList(a, b); Matrix m2 = new MatrixArrayList(a, b); for (int i = 1; i <= a; i++) { for (int j = 1; j <= b; j++) m1.insert(i, j, (double) (2 * i - j)); } for (int i = 1; i <= a; i++) { for...
4
private void createHdr() { hdrData = new float[width * height * 3]; double[] relevances = new double[width * height]; int color; double red, green, blue; boolean isPixelSet; for (int i = 0; i < width * height; i++) { isPixelSet = false; for (MyIma...
5
public int getDirectionFacing(){ if( controller.getY() == 1 && !isOnGround ){ facingDown = true; } else if( controller.getY() == 1 ) { this.currentPosition.y--; this.oldPosition.y--; } else { facingDown = false; } if (controller.getX() < 0 && directionFacing != -1){ directionFacing = -1; ret...
7
public void load() { String line, lineBeforeComment; String[] tokens; try { BufferedReader fin = new BufferedReader(new FileReader(fileName)); try { while ((line = fin.readLine()) != null) { tokens = line.split("#"); if (tokens.length > 0) { lineBeforeComment = tokens[0]; tokens...
5
public static void main(String[] args) { String mango = "mango"; String s = "abc" + mango + "def" + 47; // StringBuilder sb = new StringBuilder(); // sb.append("abc"); // sb.append(mango); // sb.append("def"); // sb.append(47); // s = sb.toString(); System.out.println(s); }
0
private static void printGridletList(GridletList list, String name, boolean detail) { int size = list.size(); Gridlet gridlet = null; String indent = " "; System.out.println(); System.out.println("============= OUTPUT for " + name ...
3
public Map<Integer, Double> getRankedTagList(int userID, int resID) { Map<Integer, Double> resultMap = new LinkedHashMap<Integer, Double>(); if (this.userMaps != null && userID < this.userMaps.size()) { Map<Integer, Double> userMap = this.userMaps.get(userID); Map<Integer, Double> recMap = this.tagRecencies.g...
9
public void clearEmptyLines(Set<Entry<String, List<String>>> entrySet) { for (Entry<String, List<String>> entry : finalFiles.entrySet()) { ArrayList<String> tempArray = new ArrayList<>(); tempArray.addAll(entry.getValue()); for (ListIterator<String> itr = tempArray.listIterator(); itr.hasNext(); ) { ...
8
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!plugin.hasPerm(sender, "tp", false)) { sender.sendMessage(ChatColor.YELLOW + "You do not have permission to use /" + label); return true; } if (args.length == 0) { plugin.getServer().broadcastMess...
6
@Override public String execute() throws Exception { try { Map session = ActionContext.getContext().getSession(); setUser((User) session.get("User")); Date date = new Date(); System.out.println("--------------------------------------------------" + existrate);...
4
static Field getStaticField(Class<?> c,String key) throws DetectRightException { if (c == null) return null; if (Functions.isEmpty(key)) return null; Field f; try { f = c.getDeclaredField(key); return f; } catch (NoSuchFieldException e) { CheckPoint.checkPoint("Get Field 2" + key + " " + c.toString(...
8
@Override public boolean execute(CommandSender sender, String[] args) { if(!(sender instanceof Player)) { return true; } String username = sender.getName(); String name = args[0]; Group group = groupManager.getGroupByName(name); if(group == null) { sender.sendMessage("Group doesn't exist"); ...
7
private void findMiddle(String s) { ArrayList<Integer> operations = new ArrayList<Integer>(); // compile the index of each operator for(int i = 0; i < s.length(); i++) { if( s.charAt(i) == OR || s.charAt(i) == AND || s.charAt(i) == IMPLY) { operations.add(i); } } // if there is only one operat...
7
public Stability getLackingStabilityForType(DiscType discType){ LOGGER.log(Level.INFO, "Determining lacking stability rating for disc type " + discType); Bag tDiscs = getDiscsByType(discType); if (tDiscs.size() == 0) { return Stability.STABLE; } float stablePct = (float)(tDiscs.getDiscsWithStability(Stabi...
4
public Vector apply(Vector b, Vector x) { if (!(b instanceof DenseVector) || !(x instanceof DenseVector)) throw new IllegalArgumentException("Vectors must be a DenseVectors"); int[] rowptr = F.getRowPointers(); int[] colind = F.getColumnIndices(); double[] data = F.getData()...
9
private boolean isAlreadyExecuted() throws DomainToolsException{ boolean res = false; if(format.equals(DTConstants.JSON) && !responseJSON.isEmpty() || format.equals(DTConstants.HTML) && !responseHTML.isEmpty() || format.equals(DTConstants.XML) && !responseXML.isEmpty() || format.equals(DTConstants.OBJEC...
8
public void visitAttribute(final Attribute attr) { checkEndMethod(); if (attr == null) { throw new IllegalArgumentException( "Invalid attribute (must not be null)"); } mv.visitAttribute(attr); }
1
/*package*/ static void init() { defaultProperty = new Properties(); defaultProperty.setProperty("weibo4j.debug", "true"); // defaultProperty.setProperty("weibo4j.source", Weibo.CONSUMER_KEY); //defaultProperty.setProperty("weibo4j.clientVersion",""); defaultProperty.setProperty("...
3
public Polynomial monic() throws Exception { if (coeff.length == 0) return this; // 0 if (head() == 1L) return this; // already monic return mul(PF.inv(head())); }
2
@Override protected void initiate() { // Create a menu to add all of the input fields into menu = new TMenu(0, 0, Main.canvasWidth / 4, Main.canvasHeight, TMenu.VERTICAL); menu.setBorderSize(5); add(menu); // Simulation parameters depthNumberField = new TNumberField(0, 0, 125, 25, 4); // l...
8
public static void main(String Args[]) { int i = 0; long l = 0; for (i = 0; i < perfectarray.length; i++) { // l = i * i; // if (issquaredigitsquare(l)) { array[perfectarray[i]] = true; // System.out.println(perfectarray[i]); // System.out.print(","); // } } Scanner sr = new Scanner(Syste...
4
public static String getStackTrace(Exception ex) { if (ex == null) { return ""; } Object [] traces = ex.getStackTrace(); if (traces == null) { return ""; } String s = ""; for (Object trace : traces) { s += " " + trace.toString() + "\r\n"; } return s + "\r\n"; }
3
public static boolean isBetween(int value, int lowLimit, int highLimit) { boolean between = false; if (value >= lowLimit && value < highLimit) { between = true; } return between; }
2
public void writeCorpusToFile(String fileName) throws IOException { BufferedWriter out = new BufferedWriter(new FileWriter(new File(fileName))); out.write("<?xml version='1.0' encoding='UTF-8'?>"); out.write("\n<corpus corpusname=\"tagged-corpus\">"); out.write("\n\t<head>"); out.write("\n\t</head>"); out.w...
1
private void pickRandomQuote(MessageEvent<PircBotX> event) { try { if (!file.exists()) { System.out.println(file.createNewFile()); } FileReader fw = new FileReader(file); BufferedReader reader = new BufferedReader(fw); String line; Random random = ...
5
private boolean isBlocking(float _x, float _y, float xa, float ya) { int x = (int) (_x / 16); int y = (int) (_y / 16); if (x == (int) (this.x / 16) && y == (int) (this.y / 16)) return false; boolean blocking = world.level.isBlocking(x, y, xa, ya); byte block = world.level.g...
7
public void tableChanged(TableModelEvent e) { boolean dirty = !isSorted(); // Dirty bit to see if we should resort if (!dirty) { if (e.getType() == TableModelEvent.UPDATE) { if (e.getFirstRow() == TableModelEvent.HEADER_ROW) { // Table structure changed. Not supported for now! throw new UnsupportedOper...
7
@Override public final void run() { if (shutdown) { CTT.debug("Attempting to shutdown game " + getGameId() + " again"); plugin.getServer().getScheduler().cancelTask(taskID); return; } signTracker++; if (signTracker == 2) { signTracker =...
8
private void initialize() { int padding = 5; joinChatPressed = false; agent = new MenuAgent(this); double ratio = (1.0+Math.sqrt(5.0))/2.0; Dimension screenDims = Toolkit.getDefaultToolkit().getScreenSize(); joinAction = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ...
2
final int countIgnoredTests(final Xpp3Dom results) { final AtomicInteger ignored = new AtomicInteger(); new ForAllTestCases(results) { @Override void apply(Xpp3Dom each) { final String result = each.getChild("result").getValue(); ignored.addAndGet(...
1
@Override public boolean equals(Object obj) { if (obj instanceof Vector) { Vector v = (Vector) obj; return x == v.x && y == v.y; } return false; }
2
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled=true) private void onVehicleLeave(VehicleExitEvent event) { if(mResetTicksLived) event.getVehicle().setTicksLived(0); }
1
boolean performAndOrShortcut(Node a, Node b) { if (b.getInEdges().size() != 1) return false; if (b.block.getChildCount() > 0) { // Node b is not a mere conditional. return false; } ConditionalEdge aToC; ConditionalEdge bToC; bool...
7
public void addAssociation(Association a) { if(!associationsSet.contains(a)) { associationsList.add(a); associationsSet.add(a); } }
1
public void setValor(PValor node) { if(this._valor_ != null) { this._valor_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); ...
3
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 static void sort(int[] array) { printArray(array); int index = 0; int tmp = array[0]; int j; for (int i = 0; i < array.length - 1; i++) { index = 0; tmp = array[0]; for (j = 1; j < array.length - i; j++) { if(tmp < array[j]) { index = j; tmp = arr...
3
public JSONObject executeBasic() throws CloudflareError { try { HttpPost post = new HttpPost( CloudflareAccess.CF_API_LINK); post.setEntity(new UrlEncodedFormEntity(post_values)); HttpResponse response = api.getClient().execute(post); Buffered...
8
public void save() { SortedMap<String,String> sortedKeys = new TreeMap<String,String>(keys); try { BufferedWriter output = new BufferedWriter(new FileWriter(fileName)); try { for (String key : sortedKeys.keySet()) output.write(key.toLowerCase() + "=" + sortedKeys.get(key) + newLine); } catch (IOEx...
3
public long getLong(String key) throws JSONException { Object object = this.get(key); try { return object instanceof Number ? ((Number) object).longValue() : Long.parseLong((String) object); } catch (Exception e) { throw new JSONException("JSONObject["...
2
public void newProduct() { try { Database db = dbconnect(); String query = "INSERT INTO product (name, description) VALUES " + "(?,?)"; db.prepare(query); db.bind_param(1, this.name); db.bind_param(2, this.description); d...
1
*/ private boolean isInstDefault() { if (instCheck.size() == 0) { return false; } for (Iterator j=instCheck.keySet().iterator(); j.hasNext(); ) { String key = (String)j.next(); if ( isDefaultInst(key) ) { // デフォルト装置種別の場合 if ( !((JCheckBox)instCheck.get(key)).isSelected() ) { return...
5
public ArrayList<GradeItem> gradeItems(ResultSet rs) throws Exception { DBConnector db = new DBConnector(); ArrayList<GradeItem> data = new ArrayList<>(); while (rs.next()) { data.add(new GradeItem(db.getGradeItem(rs.getInt("gradeitemid")))); } return data; }
1
public static Utilisateur selectById(int id) throws SQLException { String query = null; Utilisateur util = new Utilisateur(); ResultSet resultat; try { query = "SELECT * from UTILISATEUR where ID_UTILISATEUR=? "; PreparedStatement pStatement = ConnectionBDD.get...
2
@Override public void mouseMoved(MouseEvent e) { Point p = e.getPoint(); Point imageOrigin = getImageLoc(); if(p != null && bufImage != null){ Point imagePixel = new Point(p); imagePixel.x -= imageOrigin.x; imagePixel.y -= imageOrigin.y; if(imagePixel.x >= bufImage.getWidth() || imagePixe...
6
public static PostingsList andMerge(PostingsList posting1, PostingsList posting2) { PostingsList merged = new PostingsList(); if (posting1 != null && posting2 != null && posting1.size() > 0 && posting2.size() > 0) { Node p1 = posting1.head; Node p2 = posting2.head; while (p1 != null && p2 != null...
8
public boolean collides(int x, int y){ //CHECKS IF PASSED X Y COORDS COLLIDE WITH THE BLOCK if(x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height){ return true; } return false; }
4
static void analyze(Object obj) { Class clazz = obj.getClass(); String name = clazz.getName(); System.out.println(name); Constructor[] constructors = clazz.getConstructors(); for (Constructor c : constructors) { System.out.println("Constructor name: " + c.getName()); } Field[] fields = clazz.getF...
5
private void processTextFile(File file) { BufferedReader is = null; PrintWriter pw = null; TextModes modes = new TextModes(); try { pw = new PrintWriter(file.getAbsolutePath().replace(REMOVE_FROM_PATH, "")); is = new BufferedReader(new FileReader(file)); String aline; List<String> lines = new ArrayL...
9
public String getResult(){ String display = new String(); int n = 0; display = ""; if(this.valorCliente>0){ this.valorTroco = this.valorCliente; if(this.valorTroco>=50){ n = (int)(this.valorTroco/50); this.valorTroco-= n*50; }//END IF display += n+" "; n = 0; if(this.valorTroco>=10){ ...
5
public static void delete(File src) throws IOException { if (!src.exists()) return; if (!src.isDirectory()) { src.delete(); return; } for (File f : src.listFiles()) { if (f.isDirectory()) delete(f); f.delete(); } }
4
public double olbStart() { sortResources(); sortClass(); calculateWeight(); System.out.println(iCPUMaxNum); dmMinminCost = new double[iSite][iCPUMaxNum]; dmMinminTime = new double[iSite][iCPUMaxNum]; double[] daMinminTimeBySite = new double[iSite]; // find the current cheapest site for the acitvities....
7
public static List<MeasureSite> findAllMeasureSite() { List<MeasureSite> measureSiteList = new ArrayList<MeasureSite>(); MeasureSite measureSite = null; ResultSet rs = null; Statement stmt = null; Connection conn = null; try { // new oracle.jdbc.driver.OracleDriver(); // jdbc.url=jdbc\:oracle\:thin\...
9
private void checkmappos() { if (cam == null) return; Coord sz = this.sz; SlenHud slen = ui.slenhud; if (slen != null) sz = sz.add(0, -slen.foldheight()); Gob player = glob.oc.getgob(playergob); if (player != null) cam.setpos(this, player, sz); }
3
public final void generateFiles(boolean internal) { // internal is true if called by onEnable and False if called by command if (internal && !generationFinished) { // 5 * 20 = 5 seconds (20 ticks per second) scheduler.scheduleSyncDelayedTask(this, new PermissionTask(this), 5 * 20L); } else if (!internal) { ...
3
private boolean replaceEvents(String key, Faction.FactionChangeEvent event, boolean strict) { final Faction.FactionChangeEvent[] events=changes.get(key); if(events==null) return false; final Faction.FactionChangeEvent[] nevents=new Faction.FactionChangeEvent[events.length-1]; int ne1=0; boolean done=false...
9
public void run() { try { SocketChannel socketChannel = SocketChannel.open(); socketChannel.socket().setReceiveBufferSize( m_socketBufferSize ); StreamDefragger streamDefragger = new StreamDefragger(4) { ...
9
public static void assertNotNull(Object value, String errorMessage) throws BeanstreamApiException { // could use StringUtils.assertNotNull(); if (value == null) { // TODO - do we need to supply category and code ids here? BeanstreamResponse response = BeanstreamRespon...
1
public SplashScreen() { setTitle("Board Games"); setResizable(false); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Set up the menu setJMenuBar(menuBar); menuBar.add(fileMenu); fileMenu.add(exit); menuBar.add(helpMenu); helpMenu.add(about); helpMenu.add(...
8
@Override public void applyCurrentToApplication() { // Apply any prefs to the app that won't be looked up directly from the preferences. }
0
private String join(String[] array, String separator) { if (array.length == 0) { return ""; } String ret = ""; for (int i = 0; i < array.length; i++) { ret += array[i] + separator; } return ret.substring(0, ret.length() - separator.length()); }
2
public static JsonNode merge(JsonNode mainNode, JsonNode updateNode) { Iterator<String> fieldNames = updateNode.fieldNames(); while (fieldNames.hasNext()) { String fieldName = fieldNames.next(); JsonNode jsonNode = mainNode.get(fieldName); // if field doesn't exist ...
4
public JButton getButton(int buttonType) { for (int a = 0; a < getComponentCount(); a++) { if (getComponent(a) instanceof JButton) { JButton button = (JButton) getComponent(a); Object value = button.getClientProperty(PROPERTY_OPTION); int intValue = -1...
4
public abstractPage(){ super(new BorderLayout()); if ( lang.equals("en")) { //static Button appLang = new JButton("Arabic"); //welcomePage //--------Labels-------- appNameLabel = new JLabel("Parking Permit Kiosk"); appInfoLabel = new JLabel("This application issues parking permits for ...
2
private static int[] portRangeToArray(int portMin, int portMax) { if (portMin > portMax) { int tmp = portMin; portMin = portMax; portMax = tmp; } int[] ports = new int[portMax - portMin + 1]; for (int i = 0; i < ports.length; i++) ports[i] = portMin + i; return ports; }
2
public void setBytes(byte[] bytes) { this.bytes = bytes; }
0
@Override public String getStat(String code) { if(CMLib.coffeeMaker().getGenMobCodeNum(code)>=0) return CMLib.coffeeMaker().getGenMobStat(this,code); switch(getCodeNum(code)) { case 0: return ""+getWhatIsSoldMask(); case 1: return prejudiceFactors(); case 2: return bankChain(); case 3: return ""+getC...
9
public boolean isDead() { if (age > esperancevie) return true; else if (age <= 5 && (loterie.nextInt(25) + 1) == 1) return true; else return false; }
3
private boolean r_mark_suffix_with_optional_n_consonant() { int v_1; int v_2; int v_3; int v_4; int v_5; int v_6; int v_7; // (, line 132 // or, line 134 lab0: do { ...
9