text
stringlengths
14
410k
label
int32
0
9
private void handle(Resource res) { InputStream in = null; try { res.error = null; res.source = src; try { try { in = src.get(res.name); res.load(in); res.loading = false; res.notifyAll(); return; } catch (IOException e) { throw (new LoadException(e, res))...
6
public static String GetDzienNoc() { String dziennoc; Calendar cal = Calendar.getInstance(); int s = cal.get(Calendar.HOUR_OF_DAY); int p; int dn; dn = 0; if (s>=19) { p = 5; dn = 0; } else { ...
7
@Override public void execute() { SceneObject rock = SceneEntities.getNearest(Main.getRockIDs()); if (Inventory.isFull()) { if (BANK_AREA.contains(Players.getLocal().getLocation())) { if (Bank.isOpen()) { Bank.deposit(Main.oreID, 28); } else { Bank.open(); } } else if (MINE_AREA.contain...
8
public boolean insert(int index, E newItem) { if (index < 0 || index > size) return false; Node newNode = new Node(newItem); size++; if (index == 0) { // insert node at head newNode.next = head; head = newNode; if (end == null) // if only item end = newNode; return true; } if (in...
6
public boolean addLink(Link l) { if (this.classes.containsKey(l.getField()) && this == l.getGroup() && this.links.getLinks(l.getField()).size() == 0) { this.links.add(l); l.getTeacher().addLink(l); return true; } return false; }
3
@Transactional public Task getById(Integer taskId) { return tasksDao.getById(taskId); }
0
public void supprimeCombiImp(Ligne proposition, LigneMarqueur marqueurVerif){ Iterator<Ligne> it = listeCombi.iterator(); Ligne tmpLigne; // Variable tempororaire qui récupèra une lgne pour la comparée for(int i=0; it.hasNext(); i++){ tmpLigne = it.next(); if(!ma...
2
@SuppressWarnings({ "unchecked", "rawtypes" }) public Combo_Box_View_All_Groups() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { //MAIN FRAME super("Team J's Scheduler | View All Groups"); setBounds(50,50,500,300); setResizable(false); setDefaultCloseOperation(...
3
private void acao114Declaracao(Token token) throws SemanticError { try { Identificador idVariavel = new Identificador(token.getLexeme()); tabela.add(idVariavel, nivelAtual); if (analisandoRegistro) listaIdsCamposRegistroTemp.add(idVariavel); else listaIdsVariaveis.add(idVariavel); } catch (Ide...
2
public Player GetPlayer1() { boolean test = false; if (test || m_test) { System.out.println("GameBoardGraphics :: GetPlayer1() BEGIN"); } if (test || m_test) { System.out.println("GameBoardGraphics :: GetPlayer1() END"); } return m_player1; }
4
private void loadState(int state) { if(state == MENUSTATE) gameStates[state] = new MenuState(this); if(state == LEVEL1STATE) try { gameStates[state] = new Level1State(this); } catch (IOException e) { e.printStackTrace(); } if(state == MPSTATE){ try { gameStates[state] = new MPState(this...
5
public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); //This is the line that makes the hadoop run locally //conf.set("mapred.job.tracker", "local"); String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); if (...
2
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; JDK other = (JDK) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; ...
9
private AppenderDto parseAppender(String initLine, BufferedReader br) throws IOException { AppenderDto appenderDto = new AppenderDto(); Parameter param = new Parameter(); Matcher matcher; String currentLine = initLine; while ((currentLine = br.readLine()) != null && ...
7
public static void question12() { /* QUESTION PANEL SETUP */ questionLabel.setText("What about the music volume?"); questionNumberLabel.setText("12"); /* ANSWERS PANEL SETUP */ //resetting radioButton1.setSelected(false); radioButto...
0
private void setXAxis(int type) { switch (type) { case BookData.TITLE: xAxisLabel = searchMatch.getTitleAxis(); return; case BookData.AUTHOR: xAxisLabel = searchMatch.getAuthorAxis(); return; case BookData.PAGES: xAxisLabel = searchMatch.getPageAxis(); return; case BookData.YEAR: xAxisLab...
5
public int getRows() { return rows; }
0
private static boolean containsFuncCode(int[] funcCodeClass) { assert(_opCode == 0 || _opCode == 28 || _opCode == 16 || _opCode == 17); for (int i = 0; i < funcCodeClass.length; i++) { if (_funcCode == funcCodeClass[i]) { return true; } } return false; }
5
void sortSequence() { if (size() < 3) return; Atom[] end = getTermini(); if (end.length != 2) return; clear(); addAtom(end[0]); Atom[] at = model.bonds.getBondedPartners(end[0], true); boolean b; while (at.length == 1 || at.length == 2) { b = false; if (!contains(at[0])) { addAtom(at[0])...
8
private PreparedStatement buildDeleteStatement(Connection conn_loc, String tableName, String whereField) throws SQLException { final StringBuffer sql = new StringBuffer("DELETE FROM "); sql.append(tableName); // delete all records if whereField is null if (whereField != null...
1
public Cardapio getCardapioDoDiaGson(){ Cardapio cardapio = null; URL serverAddress; try { serverAddress = new URL(ServiceResources.URL_RESOURCE+"/cardapio/hoje"); HttpURLConnection connection = (HttpURLConnection) serverAddress.openConnection(); connection.setRequestMethod("GET"); connection.connec...
4
public static int tensionUnitStringToIndex(String unit) { switch (unit) { case "N": return 0; case "lbf": return 1; case "kgf": return 2; case "daN": return 3; default: ret...
4
public Object get() { size--; return super.get(); }
0
public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof SecurityHeader)) return false; SecurityHeader other = (SecurityHeader) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc ==...
8
public beansAdministrador buscarAdmin(String nick){ for(beansAdministrador admin : admins){ if(admin.getNick().equals(nick)) return admin; } return null; }
2
public void actionPerformed(ActionEvent e) { ArrayList b = craft.getBullets(); for (int i = 0; i < b.size(); i++) { PlayerBullet m = (PlayerBullet) b.get(i); if (m.isVisible()) m.move(); else b.remove(i); } for (int i = 0; i < invaders.size...
4
public String process(HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); //Validate the Input //for(String name: new String[] {"name", "manufacturer_name", "manufacturer_part_id", "tag", "location_name", "depreciation", "installdate", "note"}){ //if...
0
public Menu(){ // Set up areas setBounds(0,0,Main.WIDTH,Main.HEIGHT); setLayout(null); this.setBackground(new Color(30,30,30)); // Load in graphics ImageIcon loginTextField = new ImageIcon("res/Images/loginTextField.png"); ImageIcon loginButtonImg = new ImageIcon("res/Images/loginButton.png"); Imag...
6
public static void main(String args[]) throws IOException{ // String studentName = Compiler.studentName; String studentID = Compiler.studentID; String uciNetID = Compiler.uciNetID; int publicTestcaseNum = 15; int privateTestcaseNum = 5; int publicPass = 0; for (int i=1; i<=publicTestcaseNum; ++i){...
6
private boolean needshift() { if (parent instanceof Window) { Window wnd = (Window) parent; if (wnd.cap != null) { String str = wnd.cap.text; if (str.equals("Oven") || str.equals("Finery Forge") || str.equals("Steel Crucible")) { ...
5
@Override public void mountSharedFolder(VirtualMachine virtualMachine, String shareName, String hostPath, String guestPath) throws Exception { if (status(virtualMachine) == VirtualMachineStatus.POWERED_OFF) { throw new Exception("Unable to mount shared folder. Machine is not started."); } if (guestP...
6
public void insertEdge(String startKey, String endKey, int weight) { Vertex startVertex = getVertex(startKey); Vertex endVertex = getVertex(endKey); if (startVertex == null) { insertVertex(startKey); startVertex = getVertex(startKey); } if (endVertex == null) { insertVertex(endKey); endVertex = g...
8
private void updateFalling() { int nextPlayerPositionY = theModel.getPlayerPositionY() + theModel.getVerticalStep(); int nextPlayerPositionX = theModel.getPlayerPositionX() + theModel.getHorizontalStep(); if (boardController.collidesWith(nextPlayerPositionX, nextPlayerPositionY, theModel.getPlayerHeight())) { ...
4
public Encoder getEncoder() { return encoder; }
0
@Override public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (isVisible() && (e.getSource() == optionPane) && (JOptionPane.VALUE_PROPERTY.equals(prop) || JOptionPane.INPUT_VALUE_PROPERTY.equals(prop))) { ...
7
static private float[] load_d() { String s = "0,-0.000442504999227821826934814453125,0.0032501220703125,-0.0070037841796875,0.0310821533203125,-0.0786285400390625,0.100311279296875,-0.5720367431640625,1.144989013671875,0.5720367431640625,0.100311279296875,0.0786285400390625,0.0310821533203125,0.0070037841796875,0.0...
1
public E getElement(int index) { if (indexOK(index)) { return (E) array[index]; } return null; }
1
public static Boolean save(Entry entry, String collectionName) { if(entry == null) return false; MongoCollection collection = getJongo().getCollection(collectionName); Boolean dirty = false; Integer id = entry.getId(); IdTracker tracke...
4
*/ public void setPayload(byte[] payload) { this.payload = new byte[payload.length]; this.payload = payload; //if protocols used, get additional information if(protocols){ //check dispatch header for any 6lowpan-type packet //if 10xxxxxxxx or 11000xxx or 11100xxx or 011xxxxx ---> create a 6lowpan-Pack...
5
private boolean read() { try { final URLConnection conn = this.url.openConnection(); conn.setConnectTimeout(5000); if (this.apiKey != null) { conn.addRequestProperty("X-API-Key", this.apiKey); } conn.addRequestProperty("User-Agent", "Updater (by Gravity)"); conn.setDoOutput(true); final Bu...
4
@Test public void insertLastHandlesTailCorrectly() { l.insertLast(a); for (int i = 1; i < 10; i++) { l.insertLast(new Vertex(i)); } int i = 0; Vertex test = l.min(); while (test != null) { test = l.succ(test); i++; if (i...
3
final int[][] method1094(byte i) { anInt1864++; int[] is = new int[256]; int i_10_ = 0; for (int i_11_ = 0; i_11_ < ((Model) this).triangles; i_11_++) { int i_12_ = ((Model) this).anIntArray1824[i_11_]; if ((i_12_ ^ 0xffffffff) <= -1) { if (i_10_ < i_12_) i_10_ = i_12_; is[i_12_]++; } } i...
7
private String getDowJones () { String dowJones = "0"; try (final Scanner dowJonesWebPage = new Scanner (new URL (FieldGoogleFinance.URL.toString()).openStream())) { boolean lastPriceHasFind = false; boolean changePercentHasFind = false; while (dowJonesWebPage.hasNext() && ((! lastPriceHasFind) |...
7
@Override public void addAgent() { Random rand = new Random(); int x; int y; lab(environment); do { x = rand.nextInt(environment.taille_envi); y = rand.nextInt(environment.taille_envi); } while (environment.grille[x][y] != null); pacMan = new Point(x, y); environment.grille[x][y] = new PacMan("Pa...
3
private void stop() { try { for (Clip c : clips) { c.stop(); c.setFramePosition(0); } } catch (Exception e) { e.printStackTrace(); } }
2
Power(String name, int properties, String imgFile, String helpInfo) { this.name = name ; this.helpInfo = helpInfo ; this.buttonTex = Texture.loadTexture(IMG_DIR+imgFile) ; this.properties = properties ; }
4
public byte getValueAsByte() throws IllegalArgumentException { if (!isOptionAsByte(code)) { throw new IllegalArgumentException("DHCP option type (" + this.code + ") is not byte"); } if (this.value == null) { throw new IllegalStateException("value is null"); } ...
3
private void performOpen() { JFileChooser chooser = new JFileChooser(lastSave); chooser.setFileFilter(getFileFilter()); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.showOpenDialog(this); File file = chooser.getSelectedFile(); String errorMessage = null; if (file != null && file.isFile() ...
7
public void applyPrefixes(LinkedList<Prefix> pre){ //Apply prefix in graph name if (name.startsWith("<")){ //Apply prefix for (Prefix p:pre){ if (name.startsWith("<"+p.getIriContent())){ name=p.getPrefix()+name.substring(p.getIriContent().length()+1,name.length()-1); break; } } } //Ap...
8
public synchronized void receive (Message m) { long t__recv, dt; double rate; long d; double average, deviation; count += 1; if (count == 1) _t_recv = System.currentTimeMillis(); d = (System.currentTimeMillis() - Long.parseLong(m.getPayload())); /* Accumulate */ delay += d; delaysquared += (doubl...
3
public void preencherTabela() throws Exception { ArrayList<String> colunas = new ArrayList<String>(); colunas.add("id"); colunas.add("nome"); colunas.add("nomeCientifico"); colunas.add("email"); colunas.add("sexo"); colunas.add("classe"); colunas.add("titulacao"); colunas.add("cursoVinculado"); col...
3
protected static String processUnicode(String text) { boolean big = false; text = text.replace("|הגדלה=ללא", ""); text = text.replace("|הגדלה=לא", ""); text = text.replace("יוניקוד|", ""); if (text.contains("הגדלה")) { big = true; } if (text.contains("...
3
public CheckResultMessage check34(int day) { int r = get(47, 5); int c = get(48, 5); if (checkVersion(file).equals("2003")) { try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); if (0 != getValue(r + day, c, 12).compareTo( getValue(r + day - 1, c + 5, 12))) { return e...
5
@Override public List<WeightedEdge<N, W>> edgesFrom(N... fromList) { LinkedList<WeightedEdge<N, W>> list = new LinkedList<WeightedEdge<N, W>>(); if(fromList.length == 1) { N from = fromList[0]; if(containsNode(from)) { list.addAll(nodes.get(from)); } } else if(fromList.length > 1) { for(int i = 0...
4
@Override public HashMap<String, Sprite> loadAll() { //First get a hashmap of all images ImageLoader loader = new ImageLoader(); HashMap<String, BufferedImage> imageMap = loader.loadAll(); //Create a hashmap of sprites HashMap<String, Sprite> spriteMap = new HashMap<String, Sprite>(); //Declare a buf...
4
private void checkCollision() { if (r.intersects(StartingClass.hb.r)){ visible = false; if (StartingClass.hb.health > 0){ StartingClass.hb.health -= 1; } if (StartingClass.hb.health == 0){ StartingClass.hb.setCenterX(-100); StartingClass.score += 5; } } if (r.intersects(StartingClass.hb...
6
public void openAlgorithm() { int value = programLoader.showOpenDialog(null); if (value == JFileChooser.APPROVE_OPTION) { File file = programLoader.getSelectedFile(); AlgReader algReader = null; try { algReader = new AlgReader(file); } cat...
3
void loadProfile(int profile) { try { switch (profile) { case 1: { String text = openFile(TextEditor.class.getResourceAsStream("text.txt")); //$NON-NLS-1$ StyleRange[] styles = getStyles(TextEditor.class.getResourceAsStream("styles.txt")); //$NON-NLS-1$ styledText.setText(text); if (style...
6
protected void createFrame() { MyInternalFrame frame = new MyInternalFrame(); frame.setVisible(true); desktop.add(frame); try { frame.setSelected(true); } catch (java.beans.PropertyVetoException e) {} }
1
public void setUsertilePosition(Position position) { if (position == null) { this.usertilePosition = UIPositionInits.USERTILE.getPosition(); } else { if (position.equals(Position.NONE)) { IllegalArgumentException iae = new IllegalArgumentException("Position none ...
2
private String individualMonsterDetails() { String string = ""; string = string.concat("Monster HP:"); for (int i = 0; i < stage.getMonsters().size(); i++) { string = string.concat(" " + stage.getMonsters().get(i).getHealth()); } string = string.concat("\nMonster AP:"); for (int i = 0; i < stage.getMonst...
9
@Override public Token getToken(MPFile file) { Token t = null; int state = 1; String lexeme = ""; char current = 0; while (state != 3) { if (!file.hasNextChar() && state == 2) { state = 3; } else { switch (state) { ...
7
public BSTNode getRoot() { return root; }
0
@Override public boolean getPoint(int mouseX, int mouseY){ int newX = -1; int newY = -1; if (mouseX < 800){ int cx = Boot.getPlayer().getX(); int cy = Boot.getPlayer().getY(); newX = cx + (mouseX / Standards.TILE_SIZE) - 12; newY = cy + ((Standards.W_HEIGHT - mouseY) / Standards.TILE_SIZE) - 12; ...
8
@Override public String toString(){ String s = "List of Buttons\n"; for (int i=0;i<bHandler.length;i++){ if (bHandler[i] != null) s += bHandler[i].getEntity().getName() + "\n"; } s += "END OF LIST\n-----------------\n\n"; return s; }
2
@Override public void actionPerformed(InputEvent event) { super.actionPerformed(event); if (event.key.id == input.down.id && event.type == InputEventType.PRESSED) { selectedEntry++; } if (event.key.id == input.up.id && event.type == InputEventType.PRESSED) { selectedEntry--; } if (selectedEntry ...
8
public boolean PieceNotInWay(int targetX, int targetY, boolean color, Board chessBoard, Game game) { int incrementX = 0, incrementY = 0; int curX = this.curX, curY = this.curY; if (targetX == this.curX) { if (targetY > this.curY) { incrementY = 1; } else { incrementY = -1; } } else if (targ...
8
public static void enviarMensajes(String factoriaConexiones, String colaMensajes, String nombreProductor, int numMensajes) { Context contextoInicial; ConnectionFactory factoria; Connection conexion = null; Session sesion = null; Queue cola; ...
9
@Test public void testGetCuenta() { System.out.println("getCuenta"); Cuenta instance = new Cuenta(); String expResult = ""; String result = instance.getCuenta(); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fai...
0
public Map<RedisBigTableKey, byte[]> getAll(byte[] table) throws RedisForemanException { if (tableExists(table)) { Map<byte[], byte[]> map = instance.hgetAll(table); Map<RedisBigTableKey, byte[]> toReturn = new HashMap<RedisBigTableKey, byte[]>(); for (Entry<byte[], byte[]> ent : map.entrySet()) { ...
2
@Override public String getToolTipText(MouseEvent event, Rectangle bounds, Row row, Column column) { if (getPreferredWidth(row, column) - H_MARGIN > column.getWidth() - row.getOwner().getIndentWidth(row, column)) { return getData(row, column, true); } return null; }
1
public CycSymbol getIntermediateStepValidationLevel() { Object rawValue = get(INTERMEDIATE_STEP_VALIDATION_LEVEL); if (rawValue instanceof CycSymbol) { return (CycSymbol) rawValue; } else { rawValue = getDefaultInferenceParameterDescriptions().getDefaultInferenceParameters().get(INTERMEDIATE_STE...
2
private static void postProcessConfig() { createDirAtHome(); normalizeVariableContent("UrbanoSHPPath"); normalizeVariableContent("RusticoSHPPath"); try { CatExtractor.extract(Config.get("UrbanoSHPPath")); CatExtractor.extract(Config.get("RusticoSHPPath")); } catch (IOException ioe){ ioe.printStackT...
5
public int binarySearchPredictable(T[] a, int from, int limit, T query, BSTYPE type) { if (from >= limit) { return from; } int mid = (from + limit) / 2; int compared = comparator == null ? query.compareTo(a[mid]) : comparator.compare(query, a[mid...
8
public void initTableau() { tableau = new ArrayList<>(); for(int i=0 ; i<256 ; i++) tableau.add(i); }
1
private void jButtonSourceNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSourceNextActionPerformed try{ MultiSyntaxDocument syntax = new MultiSyntaxDocument(); if(sourceCurrentPosition==(sourceMatchOffsets.length-1)){ JOptionPane optionPane ...
3
public static int doSevenLoop(Deck deck, PlayerHuman playerHuman, PlayerCPU playerCPU, int plCount) { Card card; int n = 2; // number of cards will be pulled int cp; // current player while (true) { cp = plCount % 2...
6
public static void countWithStateless() throws NamingException, InterruptedException { int i, lostTimes = 0; long threadId = Thread.currentThread().getId(); RemoteSLSB slb = lookupRemoteSLSB(); boolean lost = false; System.out.println(threadId + ": Obtained a remote stateless bean for invocation."); l...
6
public static boolean getChoice () { String message = ""; boolean chosen = false; Scanner sc = new Scanner (System.in); boolean inputOK = false; while (! inputOK) { String choice = sc.nextLine(); choice = choice.toUpperCase(); if (choice != null) { if ( choice.equals("Y") || choice.equals("N")) {...
6
public void drawEdges(Graphics2D g, Edge[] edges) { if (edges == null) return; for (Edge e : edges) { if (e != null) g.drawLine(e.from.x, e.from.y, e.to.x, e.to.y); } }
3
private static void test2_1() throws FileNotFoundException { String test1 = "new game\n"+"examine cell key\n"+"quit\n"+"yes\n"; HashMap<Integer, String> output = new HashMap<Integer, String>(); boolean passed = true; try { in = new ByteArrayInputStream(test1.getBytes()); System.setIn(in); out = ne...
7
private static void inputCustomerChoice() { if (scanner.hasNext()) { beverageChoice = scanner.nextLine(); } }
1
public boolean equals(Object other) { if ( (this == other ) ) return true; if ( (other == null ) ) return false; if ( !(other instanceof TrabajaderaId) ) return false; TrabajaderaId castOther = ( TrabajaderaId ) other; return (this.getIdtrabajadera()==castOther.getIdtrabajadera()) && (t...
4
public void setInOut(String[] command) { int id = Integer.parseInt(command[0]); boolean bool = Boolean.parseBoolean(command[1]); for (int i = 0; i < entradas.getLength(); i++) { Entrada entrada = entradas.get(i); if (entrada.equals(id)) entrada.change(bool); } ...
2
public static Right get(String value) throws IllegalArgumentException { if (value.equalsIgnoreCase("read")) { return read; } else if (value.equalsIgnoreCase("write")) { return write; } else if (value.equalsIgnoreCase("exec")) { return exec; } ...
4
protected void showContent(String name) { toolBarName = ""; TitledBorder nameBorder = BorderFactory.createTitledBorder( name); MainView.contentPanel.setBorder(nameBorder); mainView.getCardLayout().show(mainView.getContentPanel(), name); // refresh visible card panel JPanel card = null; for (Component...
9
public static void main(String[] args) { final int length = 10; int intArray[] = new int[length]; Random generator; generator = new Random(); for (int i = 0; i < intArray.length; i++) { intArray[i] = generator.nextInt(9) + 1; } System.out.print("Origin...
4
public void clickChooseCharacters(Scanner scanchoice, ArrayList<MainMenuHeroSlot> heroies) { state.clickChooseCharacters(scanchoice, heroies); }
0
public Object next() { Object o = null; // Block if the Queue is empty. synchronized (_queue) { if (_queue.size() == 0) { try { _queue.wait(); ...
3
public static void decompressFile(String input, String output){ byte[] data = new byte[0];//All the bytes from the input //Read the input try{ data = Files.readAllBytes(Paths.get(input)); }catch(Exception e){ e.printStackTrace(); } ArrayList<Character> unique = new ArrayList<Character>();//Local uniq...
8
@Test public void testSubClauses() throws Exception { PersistenceManager pm = new PersistenceManager(driver,database,login,password); ConnectionWrapper cw = pm.getConnectionWrapper(); //add data with two sortable fields for(int x = 0;x<100;x++) { long dec = x/10; double rem = x%10; SimpleObject so ...
5
@Override public void input( float delta ) { Vector2f centerPosition = new Vector2f( Window.getWidth() / 2, Window.getHeight() / 2 ); if ( Input.getKey( unlockMouseKey ) ) { Input.setCursor( true ); mouseLocked = false; } if ( Input.getMouseDown( 0 ) ) { Input.setMousePosition( centerPosition );...
7
private void toggleRemoveSelection(TreePath path){ Stack<TreePath> stack = new Stack<TreePath>(); TreePath parent = path.getParentPath(); while(parent!=null && !isPathSelected(parent)){ stack.push(parent); parent = parent.getParentPath(); } if(parent!=null...
7
public static void main(String[] args) throws Exception { Document document = new Document(); //同时修改多个变量 Alt + shift + r Element root = new Element("学生手册"); document.addContent(root); Attribute attr = new Attribute("班级","2"); Element student = new Element("学生").setAttribute("学号", "1...
0
static public jlp createInstance(String[] args) { jlp player = new jlp(); if (!player.parseArgs(args)) player = null; return player; }
1
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, org.codehaus.classworlds.ClassRealm containerRealm) throws ComponentConfigurationException { Set<String> runtimeClasspathElements = new HashSet<String>(); try { runtimeClasspathElements.addAl...
2
public int largestRectangleArea(int[] height) { int len = height.length; if( len <= 0){ return 0; } if( len == 1){ return height[0]; } Comparator<Integer> OrderIsdn = new Comparator<Integer>(){ public int compare(Integer o1, Integer ...
8
public NoClaimReason canClaimForSettlementReason(Tile tile) { int price; NoClaimReason reason = canOwnTileReason(tile); return (reason != NoClaimReason.NONE) ? reason : (tile.getSettlement() != null) ? NoClaimReason.SETTLEMENT : (tile.getOwner() == null) ? NoClaimReason.N...
7
public void shift(Direction direction, int i) { switch (direction) { case UP: pos1 = pos1.addY(-1); pos2 = pos2.addY(-1); break; case DOWN: pos1 = pos1.addY(1); pos2 = pos2.addY(1); break; ...
4
public final void switchStmt() throws RecognitionException { AST ast1 = null, ast2 = null; try { // CPP.g:415:3: ( 'switch' '(' expr ')' stmt ) // CPP.g:415:5: 'switch' '(' expr ')' stmt { this.match(this.input, 50, FOLLOW_50_in_s...
9