text
stringlengths
14
410k
label
int32
0
9
@EventHandler(priority=EventPriority.HIGH) public void onPlayerMove(PlayerMoveEvent e) { Player p = e.getPlayer(); Fruit f = null; if(FruitManager.getInstance().checkIfPlayerIsDFUser(p)) //Drown Devil Fruit users { f = FruitManager.getInstance().getFruitByPlayer(p); switch(f.getId()) { ...
9
public static void Inspect(String item) { Random number = new Random(); int i = number.nextInt(3); i = i+1; boolean shownInspection = false; for(int k=0; k<Items.itemDesc.length; k++) { if(item.equalsIgnoreCase(Items.itemDesc[k][0])) { GUI.log(Items.itemDesc[k][i]); shownInspection = true;...
3
public void execute() throws Exception { Number amount; Currency currency; String input = ""; while (true) { try { input = readAmount(reader); amount = Number.valueOf(input); currencyDialog.execute("Introduzca la divisa origen: ...
3
public void play(){ int mode = mode(); if(mode == 1){ setup(_player1, _grid1); setup(_player2, _grid2); } else if(mode == 2){ setup(_player1, _grid1); setup(_comp1, _grid2); } else{ setup(_comp1, _grid1); setup(_comp2, _grid2); } while(!(_grid1.deathCount()==17 || _grid2.deathCou...
8
public String getText() { if (content.size() == 0) { return ""; } // If we hold only a Text or CDATA, return it directly if (content.size() == 1) { final Object obj = content.get(0); if (obj instanceof Text) { return ((Text) obj).getTe...
6
@Override public boolean equals(Object obj){ if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof deltaQ)) return false; deltaQ another = (deltaQ)obj; if (another.i.u_id.equals(this.i.u_id) && another.j.u_id.equals(this.j.u_id) && another.dQ == this.dQ) return true; ...
6
public static boolean isTypeMap(Class<?> type) { return (type != null && isAssignable(type, Map.class)); }
2
public Instruction findMatchingPush() { int count = 0; Instruction instr = this; int poppush[] = new int[2]; while (true) { if (instr.preds != null) return null; instr = instr.prevByAddr; if (instr == null || instr.succs != null || instr.doesAlwaysJump()) return null; instr.getStackPopPush(...
7
public void keyPressed(KeyEvent e) { int code = e.getKeyCode(); if (code > 0 && code < keys.length) { keys[code] = true; isMovingWithKey = true; } }
2
@Override public synchronized void close() { if (isClosed) { return; } isClosed = true; }
1
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.l...
6
@Test public void testValorTotalEmEstoque() { try { Assert.assertEquals(25653.1f, facade.getValorTotalEmEstoque(), 0.1); } catch (FacadeException e) { Assert.fail(e.getMessage()); } Produto p5 = new Produto(5,"Smartphone Samsung Galaxy Ace Preto, Desbloqueado Vivo, GSM, Android, C‚mera de 5MP, Tela Touch...
7
public MoveSet getValidMoves(int player) { Move empty_move = new Move(); MoveSet rtn_mset = null; int[] dice; int dice_left; if ((dc1==dc2)&&(use_doubles)) { dice_left = 4; dice = new int[4]; dice[0]=dc1; dice[1]=dc1; dice[2]=d...
8
@Override public String toString() { return "ModelClassDesc [packgeName=" + packgeName + ", className=" + className + ", fileds=" + fileds + "]"; }
0
public InputEvent removeEvent() { return unprocessedEvents.remove(); }
0
private void sink(int k){ while(2*k <= N){ int j = 2*k; if(j < N && less(j, j+1)) ++j; if(!less(k,j)) break; exch(k, j); k = j; } }
4
private int getNrBlacks(int x, int y) { int number = 0; for (int i=(x>0?x-1:0); i<=x+1 && i<width; i++) { for (int j=(y>0?y-1:0); j<=y+1 && j<height; j++) { if (black[i][j] != null) number += black[i][j] ? 1 : 0; } } return number; }
8
public JSONObject toJSONObject(JSONArray names) throws JSONException { if (names == null || names.length() == 0 || this.length() == 0) { return null; } JSONObject jo = new JSONObject(); for (int i = 0; i < names.length(); i += 1) { jo.put(names.getString(i), this....
4
public Model createNarfModelFromPDB(String aPdbId, NucleicAcid aNucleicAcid, List<Cycle<Nucleotide, InteractionEdge>> acycleList, boolean basepaironly) throws IOException { aPdbId = aPdbId.toUpperCase(); Random r_i = new Random(); int rand_i = r_i.nextInt()+1; Model rm = ModelFactory.createDefaultModel();...
9
@Override public void render(GameContainer gc, Graphics g) { //our current y offset from the top int ypos = 0; Color reset = g.getColor(); for (Message m : messages) { switch(m.getType()) { case IMPORTANT: g.setColor(new HexColor(getImportantColor())); break; case ERROR: g...
7
private static ActionListener makeDBLoadButtonListener( final String buttonTitle, final JRadioButton yes) { return new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { if (yes.isSelected()) startLoadingDataBase(); else return; yes.setSelected(false); yes....
1
private String createColumnsSqLite(List<Columns> listColumns) { String columnString = ""; int index = 0; for (Columns columns : listColumns) { columnString += "'" + columns.getColomnName() + "'"; columnString += " " + columns.getTypeData().getTypeInString(); columnString += (!columns.isAutoIncremented()?...
7
private int countResults(ResultSet result) { if (result == null) { return -1; } int noof = 0; try { while (result.next()) { noof++; } } catch (Exception ex) {} return noof; }
3
public PowerUp(Animation anim) { super(anim); }
0
public static String composeDateWhere(String sql, String fieldName, String fieldValue, int action) { if (fieldValue == null || fieldValue.trim().compareTo("") == 0) return sql; String sTmp = fieldValue; String sOper = "="; switch (action) { case EQUAL: sTmp = "'" + sTmp + "'"; break; case LIKE: ...
9
private ByteBuffer convertImageData(BufferedImage bufferedImage) { ByteBuffer imageBuffer; WritableRaster raster; BufferedImage texImage; int texWidth = bufferedImage.getWidth(); int texHeight = bufferedImage.getHeight(); // create a raster that can be used by OpenGL as a source // for a texture ...
1
private Map<String, Double> extractAdditionalFeatures(Map<String, Double> additionalFeatures, Document d, Query q, Map<String, Double> idfs) { Map<String, Double> newAdditionalFeatures = new HashMap<String, Double>(); if (additionalFeatures.containsKey("bm25")) { try { newAdditionalFeatures.put("bm25"...
9
private boolean jj_3R_83() { if (jj_scan_token(INTEGER)) return true; return false; }
1
public Object getValueAt(int rowIndex, int columnIndex) { Schedule schedule = scheduleList.get(rowIndex); switch (columnIndex) { case 0: return schedule.getName(); case 1: return schedule.getWeekDay(); case -1: return schedule; } return ""; }
3
public static <T> boolean isNominal(Class<T> classdef) { Class<?> classdef2 = getWrapper(classdef); return (classdef2 != null && (classdef2.isEnum() || classdef2 == Character.class || classdef2 == Boolean.class || classdef2 == Byte.class)); }
5
static boolean isThereAThree(Hand hand) { for(int x = 1;x < hand.size(); x++){ if(hand.get(x).getValue() < hand.get(x-1).getValue()) { Card card1 = hand.get(x); Card card2 = hand.get(x-1); hand.setElementAt(card2, x); hand.setElementAt(card1, ...
6
private Set beginTry() { final Set beginTry = new HashSet(); final Iterator blocks = cfg.catchBlocks().iterator(); while (blocks.hasNext()) { final Block block = (Block) blocks.next(); final Handler handler = (Handler) cfg.handlersMap().get(block); if (handler != null) { final HashSet p = new Has...
4
@Override public Recipe getRecipeById(int recipeId) { try (Connection connection = DriverManager.getConnection(connectionString)) { Recipe recipe = new Recipe(); /* TODO: check the impact of fetching everything in one query */ PreparedStatement statement = connection.prepareStatement("select id, name, numPe...
3
@Override public void mouseTouched(Actor actor, GGMouse mouse, Point spot) { if (enabled && isRunning()) { boolean last = hover; boolean lastP = pressed; switch (mouse.getEvent()) { case GGMouse.enter: hover = true; break; case GGMouse.leave: hover = false; break; case GGMouse...
9
public static Supervisor getSupervisor(){ return instance; }
0
private int get(final int local) { if (outputLocals == null || local >= outputLocals.length) { // this local has never been assigned in this basic block, // so it is still equal to its value in the input frame return LOCAL | local; } else { int type = outp...
3
private boolean jj_3R_50() { if (jj_3R_86()) return true; return false; }
1
@Override public void run() { while (m_blnRunning) { if (m_plugin.economyInstance.isEnabled()) { Player[] vPlayers = m_plugin.getServer().getOnlinePlayers(); if (vPlayers.length > 0) { m_plugin.log(Level...
6
public boolean update(int mx,int my){ if(mbi==null) return false; boolean go = (mx>x && mx<x+sx && my>y && my<y+sy && parent.isVisible() && visible); if(go){ if(data!=null) mbi.clicked(name+data,parent); if(data==null) mbi.clicked(name,parent); } return (g...
9
public ArrayList<String> getWords() { // Create a list to return ArrayList<String> list = new ArrayList<String>(); //If this node represents a word, add it if (isWord) { list.add(getPathWord()); } // If any children if (!isLeaf) { // Add any words belonging to any children for (int i =...
4
public void clear() { exceptions.clear(); }
0
public void addInterface(String name) { cachedInterfaces = null; int info = constPool.addClassInfo(name); if (interfaces == null) { interfaces = new int[1]; interfaces[0] = info; } else { int n = interfaces.length; int[] newarray = ...
1
public void mouseClicked(int par1, int par2, int par3) { boolean var4 = par1 >= this.xPos && par1 < this.xPos + this.width && par2 >= this.yPos && par2 < this.yPos + this.height; if (this.canLoseFocus) { this.setFocused(this.isEnabled && var4); } if (this.isFocu...
8
private void apply( DefaultConnectionLabelConfiguration config ) { DefaultConnectionLabelConfiguration.RESET.applyTo( this ); if( config != null ) { config.applyTo( this ); } }
1
protected void performGradientDescent(Pattern<?,?> pattern) throws NNException { try { network.process(pattern.getInputSignal()); // Calculate derivatives for the final layer: for (int i = 0; i < network.numberOfOutputs(); i++) { Neuron neuron = network.outputLayer.get(i); Double correctValue = p...
9
public void testGetFieldType_int() { LocalDate test = new LocalDate(COPTIC_PARIS); assertSame(DateTimeFieldType.year(), test.getFieldType(0)); assertSame(DateTimeFieldType.monthOfYear(), test.getFieldType(1)); assertSame(DateTimeFieldType.dayOfMonth(), test.getFieldType(2)); try ...
2
private void createFeedbackTypes(Group parent) { parent.setLayout(new RowLayout(SWT.VERTICAL)); Button b = new Button(parent, SWT.CHECK); b.setText("FEEDBACK_SELECT"); b.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { Button b = (Button)e.widget; if (b.getSelecti...
5
public void backToMenu() { int reply = JOptionPane.showConfirmDialog(null, "Would you like to return to the Main Menu?"); if(reply == JOptionPane.YES_OPTION) { timer.stop(); reply = JOptionPane.showConfirmDialog(null, "Would you like to save your progress before quiting?"); if(reply == JOptionPane.YES_OPTI...
6
public void loadConfig(final boolean initialLoad) throws Exception { // create directories FileStructure.createDir(pluginDir); // get config.yml path File file = new File(pluginDir, "config.yml"); if (!file.exists()) { FileStructure.extractResource("/config.yml", plu...
5
protected int getCorrectDirToOriginRoom(Room R, int v) { if(v<0) return -1; int dir=-1; Room R2=null; Exit E2=null; int lowest=v; for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--) { R2=R.getRoomInDir(d); E2=R.getExitInDir(d); if((R2!=null)&&(E2!=null)&&(E2.isOpen())) { final int dx=com...
7
public void create(){ init = true; //hitbox if(this.shape.equals("circle")){ CircleShape shape = new CircleShape(); shape.setRadius((rw)/PPM); fdef.shape = shape; }else{ PolygonShape shape = new PolygonShape(); shape.setAsBox((rw)/PPM, (rh)/PPM); fdef.shape = shape; } bdef.position.se...
6
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
9
public int maxProfit(int[] prices) { if(prices == null || prices.length == 0){ return 0; } int res = 0; for(int i = 1; i <= prices.length-1 ;i++){ if(prices[i-1] < prices[i]){ res += prices[i]-prices[i-1]; } } return res; }
4
public static boolean trashSlot(final int slot) { return getSlotType(slot) == ActionSlotType.NOTHING || (checkIndex(slot) && setLocked(false) && makeReadyForInteract() && dragBetween(getMainChild(slot), getTrashButton()) && new TimedCondition(2000) { @Override public boolean isDone() { retu...
5
public static final String getASCIIStr(byte[] bs, int index, int len) { StringBuffer ascii = new StringBuffer(); if ((bs == null) || (index > bs.length) || (index < 0) || (len <= 0) || (index + len > bs.length)) { return ascii.toString(); } for (int i = 0; i < len; i++) { ascii.append((char) bs[(i + index...
6
@Override public int[] getInts(int par1, int par2, int par3, int par4) { int i1 = par1 - 1; int j1 = par2 - 1; int k1 = par3 + 2; int l1 = par4 + 2; int[] aint = this.parent.getInts(i1, j1, k1, l1); int[] aint1 = IntCache.getIntCache(par3 * par4); for (in...
8
public static <T> CycList<T> construct(final T object1, final Object object2) { final CycList<T> cycList = new CycList<T>(object1); if (object2.equals(CycObjectFactory.nil)) { return cycList; } if (object2 instanceof CycList) { final CycList cycList2 = (CycList) object2; cycList.addAll...
2
public void updateScoreboard() { if(scoreboard == null) return; OfflinePlayer target = getServer().getOfflinePlayer(scoreboardText); objective.getScore(target).setScore((int) getTimeFromType(scoreboardScoreType)); for(Player player : getServer().getOnlinePlayers()) player.setScoreboard(scoreboard); }
2
public MalayansClient() { settingManager = SettingManager.getInstance(); settingManager.init(); logger = Logger.getLogger(MalayansClient.class.toString()); if (moduleInfo == null) { moduleInfo = new ModuleInfo(); moduleInfo.setDescription(Setting.str_ModuleDescription); moduleInfo.setId(Setting.s...
5
@Test public void test_get_int() { Assert.assertEquals(8989, getInt("b_local_port")); }
0
public Object[] selectRegion(Rectangle rect, MouseEvent e) { Object[] cells = getCells(rect); if (cells.length > 0) { selectCellsForEvent(cells, e); } else if (!graph.isSelectionEmpty() && !e.isConsumed()) { graph.clearSelection(); } return cells; }
3
public void actionPerformed(ActionEvent e) { String act = e.getActionCommand(); if (act.equals("BLUR")) { Integer integer = IntegerDialog.getInteger(Resources.getString("EffectsMenu.BLUR_AMOUNT"),1,9,3,3); if (integer != null) applyAction(new Blur(integer)); return; } if (act.equals("SATURATION")...
9
public void fromJSONObject(JSONObject o) throws ParseException { setPrompt((String)o.get(KEY_PROMPT)); setAnswer((String)o.get(KEY_ANSWER)); String type = (String)o.get(KEY_TYPE); setBonusType(BONUS_TYPE.valueOf(type)); JSONArray jChoices = (JSONArray)o.get(KEY_CHOICES); if (jChoices == null) { setC...
2
public Annotation getParentAnnotation() { Annotation parent = null; Object ob = getObject("Parent"); if (ob instanceof Reference) ob = library.getObject((Reference) ob); if (ob instanceof Annotation) parent = (Annotation) ob; else if (ob instanceof Hashta...
3
@Override public boolean equals(final Object obj) { if (obj == this) { return true; } if (PreciseDecimal.class.isInstance(obj)) { final PreciseDecimal other = (PreciseDecimal) obj; return this.base == other.base && this.factor == other.factor; } else { return false; } }
3
void applyBoundary(float[][] t) { if (boundary instanceof DirichletThermalBoundary) { DirichletThermalBoundary b = (DirichletThermalBoundary) boundary; float tUpper = b.getTemperatureAtBorder(Boundary.UPPER); float tLower = b.getTemperatureAtBorder(Boundary.LOWER); float tLeft = b.getTemperatureAtBorder(...
9
static final Class142_Sub27_Sub6 method562(boolean flag) { if (Class26.aNodeChildList_471 == null) { return null; } Class142_Sub18.aClass38_3546.method396((byte) -16, Class26.aNodeChildList_471); Class142_Sub27_Sub6 class142_sub27_sub6 = (Class142_Sub27_Sub6) Class142_Sub18.a...
5
private void loadSpelprojekt() { try { ArrayList<String> games = DB.fetchColumn("select sid from spelprojekt"); ArrayList<Spelprojekt> sp = new ArrayList<>(); cbAvalibleSpelprojekt.removeAllItems(); for (String st : games) { sp.add(new Spelprojekt(...
3
public Msg readMsg(Socket socket, ObjectInputStream in) { try { if (!socket.isConnected()) { return null; } Msg msg = (Msg) in.readObject(); while (msg == null) { } return msg; } catch (IOException | ClassNotFoundException e) { e.printStackTrace(); } return null; }
3
@Override protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); if (kirjaudutaankoUlos(request)) { kirjauduUlos(request, response); } else if (...
5
private String getResponse(HttpURLConnection connection) throws Exception { InputStream in = null; // Load stream if(status != 200) { in = connection.getErrorStream(); } else { in = connection.getInputStream(); } BufferedInputStream input = new BufferedInputStream(in); StringBuffer sb = new Str...
2
static public void main(String[] args){ //efficiency comparison Vector<Integer> container = new Vector<Integer>(); Random rand = new Random(); for(int i=0; i<2000000; i++) container.add(rand.nextInt()); //Testing my priority queue long time = System.currentTimeMillis(); MyPriorityQueue<Integer> tes...
5
private void removeOld() { double[] location = this.locationStack.removeFirst(); KdTree<T> cursor = this; // Find the node where the point is while (cursor.locations == null) { if (location[cursor.splitDimension] > cursor.splitValue) { cursor = cursor.right; } else { cursor = cursor.left; } }...
5
public static Long getMaxDiagonal2Product(int[][] data, int numbers) { int max = Integer.MIN_VALUE; for (int x = 0; x + numbers <= DATA.length; x++) { for (int y = 0; y + numbers <= DATA.length; y++) { int sum = 1; for (int offset = 0; offset < numbers; offset...
3
final public void Class_declaration() throws ParseException { /*@bgen(jjtree) Class_declaration */ SimpleNode jjtn000 = new SimpleNode(JJTCLASS_DECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { Class_head(); ...
8
protected void printTopChild4Stn(String filePrefix){ String topChild4StnFile = filePrefix + "/topChild4Stn.txt"; try{ PrintWriter pw = new PrintWriter(new File(topChild4StnFile)); for(_Doc d:m_corpus.getCollection()){ if(d instanceof _ParentDoc){ _ParentDoc pDoc = (_ParentDoc)d; pw.pri...
5
@Column(name = "module_id") @Id public String getModuleId() { return moduleId; }
0
public void businessScoreDist() { double totalScore = 0; int totalBusinessCnt = 0; Map<Double, Integer> businessScoreMap = new TreeMap<Double, Integer>(); for (Business business:businessMap.values()) { //System.out.println("hello"); totalBusinessCnt += 1; double star = business.stars; totalScore += ...
4
public void start() throws IllegalStateException { if (instructions == null || endgamewindow == null || gameboard == null || lobby == null || loginsingup == null || newgame == null) throw new IllegalStateException(); done = false; // Start Socket connection attempConnection(); setState(ModelStates.log...
6
public List getEntitiesWithinAABBExcludingEntity(Entity var1, AxisAlignedBB var2) { this.field_1012_M.clear(); int var3 = MathHelper.floor_double((var2.minX - 2.0D) / 16.0D); int var4 = MathHelper.floor_double((var2.maxX + 2.0D) / 16.0D); int var5 = MathHelper.floor_double((var2.minZ - 2...
3
public static Image rayleighNoise(Image original, double psi, double p) { if (original == null) return null; Image rayleigh = original.shallowClone(); for (int x = 0; x < original.getWidth(); x++) { for (int y = 0; y < original.getHeight(); y++) { double rand = Math.random(); double noise = 1; i...
4
public static String[] getFirstNums(String str) { if(str.length() == 1) if(Character.isDigit(str.charAt(0))) return new String[] { str, str.charAt(0) + "" }; // if there is a specified quantity, set quantity to that number int quantity = 1; if (Character.isDigit(str.charAt(0))) { int end = 0; ...
5
public AnnotationVisitor visitAnnotation( final String desc, final boolean visible) { return new SAXAnnotationAdapter(getContentHandler(), "annotation", visible ? 1 : -1, null, desc); }
1
public static <T extends DC> Equality getPhiEqu(Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>> done) { if(done!=null) { if(done.getNext()!=null) { return new Equality(done.getFst().fst().fst().delta(done.getFst().snd().fst()).equa().getValue()&&getPhiEqu(done.getNext()).getValue()); } else ...
3
private static PathNode findTargetPath(AIUnit aiUnit, boolean deferOK) { if (invalidAIUnitReason(aiUnit) != null) return null; final Unit unit = aiUnit.getUnit(); final Tile startTile = unit.getPathStartTile(); if (startTile == null) return null; // Not on the map? Euro...
6
public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int[] comp = new int[n]; for(int i=0;i<n;i++){ comp[i]=in.nextInt(); } Arrays.sort(comp); int count = 0; for(int i=comp.length-1;i>=0;i--){ count++; if(count==k...
3
public static float getFovY() { return fovY; }
0
public static int allocateSchools(String id[]) { String schoolid=id[0]; System.out.println("in DAO school award"); System.out.println(schoolid); String testid="",awardid="",awardname=""; try{ con=DBConnection.getConnection(); System.out.println("in try"); String query1="select count(schoolid) from ...
4
@Override public Card chooseCard(Player player, Card[] cards, GameState state) { //If there's only one choice, we have no choice but to do it if(cards.length == 1) { return cards[0]; } int alpha = Integer.MIN_VALUE; int beta = Integer.MAX_VALUE; Card choice = null; ArrayList<Color> playerLi...
4
public double minValue(KrakenState state, String player, double alpha, double beta) { if (expandedNodes==maxNodesExpand || game.isTerminal(state)){ if (heuristics==null) return heuristic.h(state); else return getHeuristicFusion(state); } expandedNodes++; double value = Double.POSITIVE_INFINITY;...
5
public Transition getTransitionForUnitProduction(Production production, VariableDependencyGraph graph) { ProductionChecker pc = new ProductionChecker(); if (!ProductionChecker.isUnitProduction(production)) return null; String lhs = production.getLHS(); String rhs = production.getRHS(); State from = getS...
1
public void setChefVente(String chefVente) { this.chefVente = chefVente; }
0
@Override public boolean equals(Object other) { if(other instanceof Board) { Board board = (Board) other; if(deck.equals(board.deck)) { if(shipLoot.length == board.shipLoot.length) { for(int i = 0; i < shipLoot.length; i++) { if(!shipLoot[i].equals(board.shipLoot[i])) { ...
5
@Test public void smallBoardSize2WithBishopAndRook() { Map<String, Integer> figureQuantityMap = new HashMap<>(); figureQuantityMap.put(BISHOP.toString(), 1); figureQuantityMap.put(ROOK.toString(), 1); int dimension = 2; Set<String> boards = prepareBoardsWithBishopAndRook(fig...
5
public boolean isBinaryTreeABST(Node head) { if (head != null) { if (head.left != null) { if ((Integer) head.left.value > (Integer) head.value) return false; } if (head.right != null) { if ((Integer) head.right.value < (Integer) head.value) ret...
7
protected void printSubMenuText(Integer number){ switch (number){ case 0: {System.out.print(MENU_TEXT_BACK_ANY);break;} case 1: {System.out.print(MENU_TEXT_411_ISBN);break;} case 2: {System.out.print(MENU_TEXT_411);break;} case 3: {System.out.print(MENU_TEXT_411_C...
7
public static void updateFolders(){ try { registerFont(); GraphicsConfiguration.load(); } catch (FontFormatException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } if(!MAP_FOLDER.exists()){ MAP_FOLDER.mkdir(); FileTools.extract(new File(MAP_FOLDER_PATH+"default.sm...
6
protected boolean isFinished() { if(_goal < 0) { return _dist <= _goal; } else { return _dist >= _goal; } }
1
public static Records getQueryResults(PreparedStatement preparedStatement, Set<Column> selectedColumns, BaseDatabaseConnection dbConnection) throws SQLException { ResultSet resultSet = null; try { resultSet = preparedStatement.executeQuery(); Records results = new Records(); while (resultSet....
6
public void build(File exportFile) throws TaskIOException { if (exportFile == null) { throw new TaskIOException(ApplicationSettings.getInstance().getLocalizedMessage("log.err.file")); } log.info(ApplicationSettings.getInstance().getLocalizedMessage("log.create.file")); m_taskList.setName(exportFile.getName...
4