text
stringlengths
14
410k
label
int32
0
9
@Override public boolean capturar(Posicao posicaoInicial, Posicao posicaoFinal) { for (int aux = 0; aux < 8; aux++) { if ((posicaoInicial.getColuna() + aux == posicaoFinal.getColuna()) && (posicaoInicial.getLinha() + aux == posicaoFinal.getLinha())) { return true; } ...
9
public static void main(String[] args) { // Working with Accessors and Mutators Rectangle rectangle = new Rectangle(20, 50); rectangle.grow(5, 10); System.out.println(rectangle.getWidth()); System.out.println(rectangle.getHeight()); }
0
public int computeArithmeticValue() { if (!isConstExpression()) { throw new IllegalStateException("not const expression"); } switch (op) { case ADD: return lValue + rValue; case SUB: return lValue - rValue; case MUL: return lValue * rValue; case DIV: return lValue / rValue; case NEG: r...
6
public boolean isOptOut() { synchronized (optOutLock) { try { // Reload the metrics file configuration.load(getConfigFile()); } catch (IOException ex) { if (debug) { Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g...
4
private void initialiseManagers() { if ( SQLManager.initialiseConnections() ) { DatabaseTableManager.createDefaultTables(); AnnouncementManager.loadAnnouncements(); // if ( MainConfig.UserSocketPort ) { // SocketManager.startServer(); ...
2
public void teach(double ordM, double invM) throws IOException{ double[] in; NeuronKoh lastWin = winner; while(!teached()){ in = ImageGenerator.getInstance().getRandLetterNoise(ordM,invM); neurons.get(0).trigger(in); winnerNET = neurons.get(3).lastResult; ...
9
public static short getSample(byte[] buffer, int position) { return (short)( ((buffer[position+1] & 0xff) << 8) | (buffer[position] & 0xff)); }
0
public static void show(JFrame parent) { createComponents(); JPanel conent = createGUI(); int choice = 0; while (true) { choice = JOptionPane.showOptionDialog(parent, conent, Main.TITLE_MED, JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, ...
9
public static void selectWordRightText(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) { Node currentNode = textArea.node; int currentPosition = textArea.getCaretPosition(); String text = textArea.getText(); int text_length = text.length(); if (currentPosition == text_length)...
7
@Override public void showDialog(DialogAction dialogAction, int row, String code) { if (DialogAction.UPDATE.equals(dialogAction) && (row == BAD_ROW || code == null)) { throw new UnsupportedOperationException("You can not perform this action"); } JDialogTeacher dialogTeacher = ne...
7
public void open() { FileNameExtensionFilter filter = new FileNameExtensionFilter( "Windows BMP file", "bmp"); FileNameExtensionFilter filter2 = new FileNameExtensionFilter( "JPEG file", "jpg", "jpeg"); FileNameExtensionFilter filter3 = new FileNameExtensionFilter("PNG", "png"); // TODO all img Fi...
2
@Override public List<Predicat> createPredicats(Request request, List<Predicat> predicats) throws Exception { DataSetApplication dsApplication = (DataSetApplication) getContext().getAttributes().get("DataSetApplication"); DataSet ds = dsApplication.getDataSet(); Form params = request.getResourceRef().ge...
8
public static boolean keyboardKeyState(int key) { return keyboardState[key]; }
0
protected void play() throws Exception { BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in)); tick = 0; printConfig(); printStep(); for (tick = 1; tick <= MAX_TICKS; tick++) { // step by step trace if (trace) { ...
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Coordinate other = (Coordinate) obj; if (x != other.x) return false; if (y != other.y) return false; return true; }
5
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PhpposSalesItemsTaxesEntity that = (PhpposSalesItemsTaxesEntity) o; if (itemId != that.itemId) return false; if (Double.compare(that.percent, p...
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CPU other = (CPU) obj; if (cacheSize != other.cacheSize) return false; if (frequency != other.frequency) return false; if (numberOfCore...
8
public void ih(String[] n) { for (int i = 0; i < n.length; i++) { System.out.println(n[i]); } }
1
private JCellule[][] getGrid() { WindowPrincipale window = (WindowPrincipale) this.getParent().getParent().getParent().getParent().getParent(); return window.getPanelGrid().getGrid(); }
0
private boolean isValidDiagonalMove(int r1, int c1, int r2, int c2) { if (Math.abs(r1 - r2) != Math.abs(c1 - c2)) { return false; } int stepR = r1 - r2 < 0 ? 1 : -1; int stepC = c1 - c2 < 0 ? 1 : -1; if (stepC > 0) { for (int r = r1 + stepR, c = c1 + step...
9
private void Flug ( int num, int lineNum, String str ) { //tOɂG[ switch ( num ) { case 1: System.out.print ( "Error: ̃}bvLqĂ܂Aǂꂩ‚ɓꂵĂ" ); break; case 2: System.out.print ( "Error: Õ|Cgłɑ݂Ă܂" ); break; case 3: System.out.print ( "Error: oH̓łɑ݂Ă܂" ); break; case 4: System.out.pri...
6
public int resolve(boolean enhancedVerbosity) { if (upper.equals(BigInteger.ZERO)) return 0; if (upper.equals(BigInteger.ONE)) return 1; int rightMostBit = upper.getLowestSetBit(); BigInteger oddDivisor = upper.shiftRight(rightMostBit); int first = resol...
7
public void clearSelectedTransitions() { selectedTransitions.clear(); }
0
private JFormattedTextField getTextField( JSpinner spinner ) { JComponent editor = spinner.getEditor(); if ( editor instanceof JSpinner.DefaultEditor ) { return ( ( JSpinner.DefaultEditor )editor ).getTextField(); } else { System.err.println( ...
1
public List<TreeNode> generateTrees(int n) { if(n<0) return null; myele []Trees =new myele[n+1]; if(n==0) {myele t= new myele();t.add(null);return t.value;} Trees[1] = new myele(1); if(n==1){return Trees[1].value;} TreeNode root; for(int i=2;i<=n;i++) { Trees[i] = new myele(); ...
8
protected synchronized String getLine(String prefix) throws IOException { long midpoint; String rightHalf; String leftHalf; String currentLine; int comparison; String match = null; long lower = 0; long upper = getFileSize(); long range = (upper - lower); long seekTarget = getFilePointer(); // L...
9
final public void run() { connectionEstablished(); // The message from the server Object msg; // Loop waiting for data try { while (!readyToStop) { // Get data from Server and send it to the handler // The thread waits indefinitely at the following // statement until something is received fr...
4
public void setExpLogica(PExpLogica node) { if(this._expLogica_ != null) { this._expLogica_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.par...
3
public GL_Mesh makeMeshObject(GL_OBJ_Reader objData) { ArrayList verts = objData.vertices; ArrayList txtrs = objData.textureCoords; ArrayList norms = objData.normals; ArrayList faces = objData.faces; // make a new mesh mesh = new GL_Mesh(); mesh.name = objData.fi...
9
public void connect() { if (username.length() == 0) { return; } if (portField.length() == 0) { return; } if (serverField.length() == 0) { return; } int port = 0; try { port = Integer.parseInt(portField);...
5
public void removeFromCW() { if (c.castleWarsTeam == 1) { if (c.inCwWait) { Server.castleWars.saradominWait.remove(Server.castleWars.saradominWait.indexOf(c.playerId)); } else { Server.castleWars.saradomin.remove(Server.castleWars.saradomin.indexOf(c.playerId)); } } else if (c.castleWarsTeam == 2) ...
4
public static boolean isValidDimension(double width, double height) { if (width < 0 || height < 0) return false; if (width > Double.MAX_VALUE || height > Double.MAX_VALUE) return false; if(Double.isNaN(width) || Double.isNaN(height)) return false; return true; }
6
@FXML private void handleBtnCancelAction(ActionEvent event) { userAction = UserAction.CANCEL; hide(); }
0
private void getSaisieCryptanalyse() { ISaisieCryptanalyse s=new SaisieCryptanalyse(this, this.menu); while(s.estEnCours() && !this.stop) { try { Thread.sleep(100); } catch (InterruptedException e) { } } s.masquer(); if(!this.stop) { if(s.getType()!=null) { IMessage m=s.getMessage(); I...
6
public void retry(String query) { boolean passed = false; Connection connection = open(); Statement statement = null; count = 0; while (!passed || count < timeout) { try { statement = connection.createStatement(); statement.executeQuery(query); statement.close(); connection.close(); pa...
6
public void update() { speedX = bg.getSpeedX() * 5; tileX += speedX; r.setBounds(tileX, tileY, 40, 40); if (r.intersects(Robot.yellowRed) && type != 0) { checkVerticalCollision(Robot.rect, Robot.rect2); checkSideCollision(Robot.rect3, Robot.rect4, Robot.footleft, Robot.footright); } }
2
@SuppressWarnings("unchecked") public synchronized Resource getResource(Object key){//How can I get the referent from the key? I'd like to check if the specified referent has been enqueued. if(shutdown) throw new IllegalStateException(); boolean keyAvailable = true; while(true){ PhantomReference<Obje...
6
public static void main(String[] args) throws PriceException { PropertyConfigurator.configure("src/resources/java/Log4J.properties"); Client cl = new Client("Jan", "Kowalski"); Client cl2 = new Client("Bartosz", "Posiakow"); try { cl.addMotorcycle(Brand.Honda, "CBR 600RR", 59000, 2003); cl.addMotorcycle...
5
public static SpriteID getSpriteID2(EntityType type) { switch (type) { case OBJ_TREE: return EnviroSprite.tree_dead_1; case OBJ_DOOR_WOOD: return EnviroSprite.door_wooden_open; case ENTR_DUNGEON: return EnviroSprite.stone_hatch...
3
private boolean execGetFeatureGroup(VectorMap queryParam, StringBuffer respBody, DBAccess dbAccess) throws SQLException { int clntIdx = queryParam.qpIndexOfKeyNoCase("clnt"); String clientName = (String) queryParam.getVal(clntIdx); int usrIdx = queryParam.qpIndexOfKeyNoCase("usr"); if (...
9
public JSONArray getJsonValue() throws Exception { List<Element> taskElementList = tasksElement.getChildren("Task"); JSONArray returnJsonArray = new JSONArray(); for (Element taskElement : taskElementList) { String taskUseVar = taskElement.getAttributeValue("var"); if...
7
@EventHandler(priority = EventPriority.NORMAL) public void onBlockBreak(BlockBreakEvent event){ Block block = event.getBlock(); if ((block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)) { Sign s = (Sign)block.getState(); if(!plugin.loc.containsKey(block.getLocation())){ for(in...
8
public String[] getVariablesOnRHS() { ProductionChecker pc = new ProductionChecker(); ArrayList list = new ArrayList(); for (int i = 0; i < myRHS.length(); i++) { char c = myRHS.charAt(i); if (ProductionChecker.isVariable(c)) list.add(myRHS.substring(i, i + 1)); } return (String[]) list.toArray(new ...
2
public void deleteUser(String username) { boolean active; String activeBoolean = null; try { String table = "users"; String[] fields = {"active"}; crs = qb.selectFrom(fields, table).where("username", "=", username).executeQuery(); if(crs.next()) { active = crs.getBoolean("active"); if(act...
7
protected EngineLog(String name, boolean displayOnConsole) { logger = Logger.getLogger(name); getLogger().setLevel(TRACE_LEVEL); if(displayOnConsole) { ConsoleHandler cLogger = new ConsoleHandler(); cLogger.setLevel(TRACE_LEVEL); getLogger().addHandler(cLogger); } //TODO Add a static path for log ...
1
public void deletePatient(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException{ log.debug("PatientManager deletePatient method called..."); int healthRecord=Integer.parseInt(request.getParameter("healthrec")); PatientService patientService=new PatientServiceImpl(); try{...
2
public DrawableComponent loadAsModel(boolean state) { if (!opaque) { this.loadAsModel = state; } else { this.loadAsModel = false; } return this; }
1
protected void readData() throws IOException { int index, r, g, b; switch (img.data.header.colorType) { case PngImage.COLOR_TYPE_PALETTE: if (length != 1) badLength(1); index = in_data.readUnsignedByte(); if (img.data.palette == null) t...
9
public void repaintTripleBuffer(Rectangle dirty) { if (tripleBuffered && tripleBufferGraphics != null) { if (dirty == null) { dirty = new Rectangle(tripleBuffer.getWidth(), tripleBuffer.getHeight()); } // Clears and repaints the dirty rectangle using the // graphics canvas as a renderer ...
3
public void writeLine(String line,Color col,Font font) { if (line!=null) { if (logging==true) fileWriteLine(line); if (pauseDisplay==false) display_view.addLine(line,col,font); } }
3
private void loadSegments() { File file = null; for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].getName().equals( "roadSeg-roadID-length-nodeID-nodeID-coords.tab")) { file = listOfFiles[i]; break; } } try { Scanner sc = new Scanner(file); sc.nextLine(); while (sc.h...
8
public Iterable<Key> levelOrderTraversal() { Queue<Key> q = new LinkedList<Key>(); if (root == null) return q; Queue<Node> tempQ = new LinkedList<Node>(); Node n = root; tempQ.add(n); while (!tempQ.isEmpty()) { n = tempQ.poll(); q.ad...
4
public static boolean arrayEquals(byte[] a, byte[] b) { if (a == null && b == null) { return true; } else if (a == null || b == null) { return false; } else if (a.length != b.length) { return false; } for (int i = 0; i < a.length; i++)...
7
private boolean isHeap(){ for (int i = 0; i<theHeap.size(); i++){ E toCompare = theHeap.get(i); if ( (hasLeftChild(i) && theHeap.get(leftChild(i))!=null && toCompare.compareTo(theHeap.get(leftChild(i)))*(isMax ? 1:-1)<0) || (hasRightChild(i) && theHeap.get(rightChild(i))!=null && toCompare.compar...
9
public static String optimizeText(String s) { for (int i = 0; i < s.length(); i++) { if (i == 0) { s = String.format( "%s%s", Character.toUpperCase(s.charAt(0)), s.substring(1) ); } if (!Character.isLetterOrDigit(s.charAt(i))) { if (i + 1 < s.length()...
4
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Node node = (Node) o; if (value != node.value) return false; if (left != null ? !left.equals(node.left) : node.left != null) return false; ...
8
private static void createReviewsOfPerson(ObjectBundle bundle, Person person, Integer reviewNr, Integer count, ValueGenerator valueGen, DateGenerator dateGen, NormalDistRangeGenerator prodNrGen, DateGenerator publishDateGen, RandomBucket true70) { for(int i=0;i<count;i++) { int product = prodNrGen.getValu...
6
private static List<NameAndType> getColumns(Class<?> bean) { List<NameAndType> columns = new ArrayList<NameAndType>(); Field[] fields = bean.getDeclaredFields(); if (fields != null) { for (int i = 0; i < fields.length; i++) { Field field = fields[i]; i...
9
@SuppressWarnings({ "unchecked", "rawtypes" }) public Hashtable getValues() { Hashtable table = new Hashtable(); for (int i = 0; i < textField.size(); i++) { if (!field[i].getClass().isAssignableFrom(ArrayList.class)) { table.put(text.get(i).getText(), textField.get(i).getText()); } else { String[]...
3
public String toString() { final String[] SUITS = {"CLUBS", "DIAMONDS", "HEARTS", "SPADES"}; if (value == 0) { return "A" + " " + SUITS[suit]; } else if (value == 12) { return "K" + " " + SUITS[suit]; } else if (value == 11) { return "Q" + " " + SUITS...
4
public Connection getConnection() { try { return DriverManager.getConnection(direccion, usuario, password); } catch (SQLException e) { System.out.println("Fallo la conexion con la base de datos"); e.printStackTrace(); } return null; }
1
private void onStartRun(){ logPanel.add("Started exposing on <strong>" + _postedTarget + "</strong>", LogPanel.OK, true); if(_dataFormat.hasChanged()) _unsavedSettings = true; if(_unsavedSettings && !EXPERT_MODE) _disableAll(); startRun_enabled = false; stopRun_enabled = true; postApp_enabled ...
7
@EventHandler( priority = EventPriority.MONITOR ) public void onPlayerInteractMonitor( PlayerInteractEvent event ) { if ( event.isCancelled() ) return; if ( event.getAction() == Action.RIGHT_CLICK_BLOCK && MyDoor.isDoor( event.getClickedBlock() ) ) { final MyDoor var1 = MyDoor.getDoor( event.getClicked...
7
public int countDirection(Board board, char token, int column) { int[][] direction = { { -1, 0 }, { -1, 1 }, { 0, 1 }, { 1, 1 }, { 1, 0 }, { 1, -1 }, { 0, -1 }, { -1, -1 }, { -1, 0 } }; int j = board.getTopPosition(column); int count = 0; for (int i = 0; i < 4; i++) { if (verifyIn(board, column + directi...
9
public static Map<Integer, Set<Integer>> getTestQueryAnswers(String queryAnswersPath) { Map<Integer, Set<Integer>> queryAnswers = new HashMap<Integer, Set<Integer>>(); int queryIdColumn = 0; int queryAnswersColumn = 1; BufferedReader reader = null; String line; String q...
7
public boolean findParticles(int ChNumber) { int i,TotCh; GenericDialog fpDial = new GenericDialog("Detect Particles"); //String [] DetectOptions = new String [] { // "1. Intensity maximum","2. Intensity shape"}; String [] sSensitivityOptions = new String [] { "Very dim particles (SNR=3)", "Dim particle...
8
@Override public void update(int id_task, int id_user, Boolean active) { try { connection = getConnection(); ptmt = connection.prepareStatement("UPDATE Task_executors SET id_task=? id_user=? active=?" + " WHERE id_task=? id_user=?;"); ptmt.setInt(1, id...
5
public Optional<Status> poll(URL url) { RestTemplate restTemplate = new RestTemplate(); return Optional. fromNullable( restTemplate.getForObject(url.toString(), Status.class)); }
0
@Override public void sayToBomberman(String message) throws IOException { serverSideWriter.append(message).append("\n").flush(); message = clientSideReader.readLine(); System.out.println("**************************************************"); System.out.println("To player " + this.num...
0
public synchronized T take() { while (elements.isEmpty()) { try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } T el = elements.removeFirst(); notify(); return el; }
2
public SpriterKeyFrame[] buildKeyFrameArray(Animation animation){ MainLine mainline = animation.getMainline(); List<TimeLine> timeLines = animation.getTimeline(); List<Key> keyFrames = mainline.getKey(); SpriterKeyFrame[] spriterKeyFrames = new SpriterKeyFrame[keyFrames.size()]; for(int k=0;k<keyFr...
5
public void enqueue(double waketime, Agent agent) throws IllegalArgumentException { if (waketime < _currentTime) throw new IllegalArgumentException(); _queue.add(new Node(waketime, agent)); }
1
protected void func_27260_a(int var1, int var2, Tessellator var3) { super.func_27260_a(var1, var2, var3); if (this.field_27268_b == 0) { GuiStats.drawSprite(this.field_27274_a, var1 + 115 - 18 + 1, var2 + 1 + 1, 18, 18); } else { GuiStats.drawSprite(this.field_27274_a, va...
3
@Override public boolean equals(Object o) { if (o instanceof Vector3D) { Vector3D p = (Vector3D) o; double xD = p.x - x, yD = p.y - y, zD = p.z - z; return xD == 0 && yD == 0 && zD == 0; } return false; }
3
public static int getWordEnd(RSyntaxTextArea textArea, int offs) throws BadLocationException { Document doc = textArea.getDocument(); int endOffs = textArea.getLineEndOffsetOfCurrentLine(); int lineEnd = Math.min(endOffs, doc.getLength()); if (offs == lineEnd) { // End of the line. return offs; ...
9
public static int discrete(double[] a) { double EPSILON = 1E-14; double sum = 0.0; for (int i = 0; i < a.length; i++) { if (a[i] < 0.0) throw new IllegalArgumentException("array entry " + i + " is negative: " + a[i]); sum = sum + a[i]; } if (sum > 1.0 + EP...
7
public void test_getDifferenceAsLong_long_long() { assertEquals(0L, iField.getDifferenceAsLong(1L, 0L)); assertEquals(567L, iField.getDifferenceAsLong(567L * 90L, 0L)); assertEquals(567L - 1234L, iField.getDifferenceAsLong(567L * 90L, 1234L * 90L)); assertEquals(567L + 1234L, iField.getD...
1
public void reorderIntegerKeys() { List<Object> keys = getOrderedKeys(); int numKeys = keys.size(); if (numKeys <= 0) return; if (!(getOrderedKey(0) instanceof Integer)) return; List<Object> newKeys = new ArrayList<Object>(); List<Object> newValues = new ArrayList<Object>(); for (int i = 0; i < n...
7
private int jjMoveStringLiteralDfa6_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(4, old0, 0L); try { curChar = input_stream.readChar(); } catch (java.io.IOException e) { jjStopStringLiteralDfa_0(5, active0, 0L); return 6; } switch (curChar) { case 91: if ((a...
5
private char validateUnusedLetter(char guess) { while(word.isLetterUsed(guess)) { System.out.println("This letter has already been guessed. Please enter a new, unused letter: "); String temp = sc.next(); validateGuessIsALetter(temp); guess = temp.charAt(0); } return guess; }
1
private void skipQuotedValue(char quote) throws IOException { // Like nextNonWhitespace, this uses locals 'p' and 'l' to save inner-loop field access. char[] buffer = this.buffer; do { int p = pos; int l = limit; /* the index of the first character not yet appended to the builder. */ ...
5
@Override public void Volum (double n) { this.volume=edge*edge*edge*0.707*n; this.edge = edge*Math.pow(n, 1/3); }
0
public String longestCommonPrefix(String[] strs) { if(strs.length == 0) return ""; if(strs.length == 1) return strs[0]; int p = 0; here: while(true){ if(p >= strs[0].length()) break; char c = strs[0].charAt(p); for(String str : strs) { if(str.length() <= p || str.charA...
7
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addressFirstLine == null) ? 0 : addressFirstLine.hashCode()); result = prime * result + ((addressSecondLine == null) ? 0 : addressSecondLine .hashCode()); result = prime * result + ((city...
9
private static int isSelfDescribing(String num) { int occurrences; for(int i = 0; i < num.length(); i++) { occurrences = 0; for(int j = 0; j < num.length(); j++) { int value = Character.getNumericValue(num.charAt(j)); if(value == i) { occurrences++; } } if(occurrences != Chara...
4
public Item targetItem(MOB target) { final Vector<Item> V=new Vector<Item>(); for(int i=0;i<target.numItems();i++) { final Item I2=target.getItem(i); if((!I2.amWearingAt(Wearable.IN_INVENTORY)) &&(((I2 instanceof Weapon)&&(I2.basePhyStats().damage()>1)) ||((I2 instanceof Armor)&&(I2.basePhyStats()...
8
public void run() { try { Transaction workerTrans = transQueue.take(); while (!workerTrans.equals(nullTrans)) { // get relevant information from each account int fromAcct = workerTrans.getFrom(); int toAcct = workerTrans.getTo(); int transAmt = workerTrans.getAmt(); // ...
2
public int readBits(int howManyBits) throws IOException { int retval = 0; if (myInput == null){ return -1; } while (howManyBits > myBitCount){ retval |= ( myBuffer << (howManyBits - myBitCount) ); howManyBits -= myBitCount; try...
5
final boolean method353(byte byte0, int i) { if (i == -1) { return false; } if (byte0 != -53) { anInt599 = 63; } if (i == anInt612) { return true; } if (anIntArray610 != null) { for (int j = 0; ~j > ~anIntArray610.le...
6
@Override public void setDef(String value) {this.def = parseColor(value);}
0
public static String getC_FineCommandName(int _findCommand){ switch(_findCommand){ case C_FIND_TOTAL: return "FIND_TOTAL"; case C_FIND_ELEMENT: return "FIND_ELEMENT"; case C_FIND_ELEMENT_VALUE: return "FIND_ELEMENT_VALUE"; case C_FIND_SORTED: ...
8
@Override public void run() { this.window.setNetworkStatus(NetworkStatus.WAITING_CONNECTION); this.openSocket(); this.networkUI.setVisible(true); this.networkUI.addMessageListener(this); this.addMessageListener(this.networkUI); this.window.setNetworkStatus(Netwo...
7
public void toggle() { if(hidden == false) { setVisible(false); } if(hidden == true) { setVisible(true); requestFocusInWindow(); } if(hidden == true) { hidden = false; } if(hidden == false) { hidden = true; } }
4
private void resetScenario() { forceList.clear(); addAllForcesToList(); for (Force force: forceList) { for (City city: force.getCityList()) { city.getCharacterList().clear(); } force.getCityList().clear(); } forceList.clear(); ...
2
static public ParseException generateParseException() { jj_expentries.clear(); boolean[] la1tokens = new boolean[28]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 0; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { ...
8
private void print(int[][] a) { for (int i = 0; i < a.length; i++) { for (int j = 0; j < a[0].length; j++) { System.out.print(a[i][j] + " "); } System.out.println(); } System.out.println("------------"); }
2
public Collection<Route> getRoutes() { return this._routes; }
0
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == closeBtn) { this.setVisible(false); } else if (e.getSource() == addBtn) { ParameterEditor pe = new ParameterEditor(); if (pe.isOk()) { try { model.add(new Parameter(pe.getName(), pe.getFormula())); } catch (Exception ...
6
public static int getDelimiterOffset(final String line, final int start, final char delimiter) { int idx = line.indexOf(delimiter, start); if (idx >= 0) { idx -= start - 1; } return idx; }
1
@Override public String toString(){ StringBuffer sb = new StringBuffer(); Node temp = first; while (temp!=null){ sb.append(temp.e).append(","); temp=temp.next; } return sb.toString(); }
1