text
stringlengths
14
410k
label
int32
0
9
@Override public void mouseDragged(MouseEvent arg0) { //Deplacement du plateau if(arg0.getSource() == this.board && isBoardSelected) { arg0.translatePoint(arg0.getComponent().getLocation().x-cX, arg0.getComponent().getLocation().y-cY); //On ne change la position du plateau que si il ne sort pas de l'ecran ...
6
public void genererFichierResultat(String JsonFichier) { JSONArray jsonerreurs = new JSONArray(); JSONObject jsonsortie = new JSONObject(); for (int i = 0; i < erreurs.size(); i++) { jsonerreurs.add(erreurs.get(i)); } jsonsortie.put("complet",...
2
public void init() { if (book == null && bookId != 0) { book = bookService.findBook(bookId); } else if (book == null && bookId == 0) { if (comics) { book = new Comics(); } else { book = new Book(); } } if (bo...
7
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 void fillMatrix() { Random generator = new Random(); for (int i = 0; i < column.length; i++) { for (int j = 0; j <column.length; j++) { column[i].push(generator.nextInt(9) + 1); } } }
2
public static void keyPressed(KeyEvent e) { key.set(e.getKeyCode()); if (key.get(KeyEvent.VK_SPACE)) { AudioManager.shooting(); setFire(true); } if (key.get(KeyEvent.VK_LEFT)) { setX(-1); } if (key.get(KeyEvent.VK_RIGHT)) { ...
5
public void paint(Graphics g) { if (cellStates != null && cellStates.size() > 0) { mxGraphics2DCanvas canvas = graphComponent.getCanvas(); // Sets antialiasing if (graphComponent.isAntiAlias()) { mxUtils.setAntiAlias((Graphics2D) g, true, true); } Graphics2D previousGraphics = canvas.getGra...
3
public Move(int s1, int s2) { this.state1 = s1; this.state2 = s2; }
0
public ThetaEquation(String equation, double tstart, double tend, double dt){ this.tstart = tstart; this.tend = tend; this.dt = dt; equ = new Equation(equation); Vector<Variable> variables = equ.getVariables(); if(variables.size()==0){ theta = new Variable("t"); } else{ if(variables.size()!=1) ...
3
@Override public final void sendSpawnData(final MapleClient client) { if (target.getId() == client.getPlayer().getMapId() || owner == client.getPlayer() && owner.getParty() == null) { client.getSession().write(MaplePacketCreator.spawnDoor(owner.getId(), town.getId() == client.getPlayer().getMapId() ? townPort...
7
public Socket makeConnection(String ipAddress, int port) { //The socket used to connect to the server socket=null; //The PrintWriter out = null; //The BufferedReader in = null; //The string that represents the messages coming from this class/from the cleint machine String fromPlayer=null; //The string...
8
public void riichi(String[] split, String command) { if (split.length != 3) { PrintMessage("Syntax:!riichi [game] [player]"); return; } TournyGame m = (TournyGame) games.get(split[1]); if (m == null) { PrintMessage(split[1] + "is not a game"); return; } String p = split[2]; if (!m.exists...
4
private static <E> Result<E> isPalindrome_Recurse_Internal(Node<E> head, int length) { if (head == null || length == 0) { //empty list is considered to be true; return new Result<>(true, null); } else if (length == 1) { return new Result<>(true, head); } else ...
6
protected Object invokeReadFromXML(Element node) throws Exception { Method method; Class[] methodClasses; Object[] methodArgs; boolean array; boolean useDefault; useDefault = false; method = null; m_CurrentNode = node; ...
9
private SingleTypeFactory(Object typeAdapter, TypeToken<?> exactType, boolean matchRawType, Class<?> hierarchyType) { serializer = typeAdapter instanceof JsonSerializer ? (JsonSerializer<?>) typeAdapter : null; deserializer = typeAdapter instanceof JsonDeserializer ? (J...
7
private static ArrayList<MapEdge> createTree(int type, MapEdge start, MapEdge end) throws NullPointerException { MapNode fn1 = DataLoader.nodes.get(start.getFNode()); Point2D.Double xy1 = new Point2D.Double(fn1.getX(), fn1.getY()); MapNode tn2 = DataLoader.nodes.get(end.getTNode()); Poin...
4
public String getInChat(String chat){ String inChat = ""; List<Player> list = getPlayersInChat(Bukkit.getWorld(chat).getPlayers(), chat); for (Player playeren : list){ inChat += playeren.getName() + ", "; } return inChat; }
1
public void run() { System.out.println("Server Starting..") ; synchronized(this){ this.runningThread = Thread.currentThread(); } try { this.serverSocket = new ServerSocket(this.serverPort); System.out.println("Server Started."); System.out.println("This Machin...
5
@Override public void focusGained(FocusEvent e) { handleUpdate(); }
0
public int sumNumbers(TreeNode root) { int sum = 0; if(root == null){ return 0; } Stack<TreeNode> nextNode = new Stack<TreeNode>(); Stack<String> nextPath = new Stack<String>(); nextNode.push(root); nextPath.push(""); while...
6
@Test public void testIntersectSingleStep() { System.out.println(abcde); for (char c : "abcde".toCharArray()) { Assert.assertTrue(abcde.acceptIn(fstP,c)); } System.out.println(cdefg); for (char c : "cdefg".toCharArray()) { Assert.assertTrue(cdefg.acceptIn(fstP,c)); } Fst<Pair<Character, Characte...
3
private void processArguments(final String[] args) throws CommandException { log.debug("processing arguments: " + Strings.join(args, ",")); if (args.length == 0) { throw new CommandException("Command requires arguments"); } String sopts = "-:c"; LongOpt[] lopts = ...
7
public Node getParent() {return parent;}
0
@Test public void testMap() { ExecutorService threadPool = Executors.newSingleThreadExecutor(); Map<String, Integer> _map = new HashMap<>(); _map.put("1", 1); _map.put("22", 22); map = _map; threadPool.execute(new Runnable() { @Override public void run() { for (Map.Entry<String, Integer>...
4
public Col(HtmlMidNode parent, HtmlAttributeToken[] attrs){ super(parent, attrs); for(HtmlAttributeToken attr:attrs){ String v = attr.getAttrValue(); switch(attr.getAttrName()){ case "align": align = Align.parse(this, v); break; case "char": charr = Char.parse(this, v); break; ...
7
@Override public GameObject getGame(int gameID) { switch (gameID) { case 0: // Intro Menu return new IntroMenu(this); case 1: // Level 1 return new GameFrame1(this); case 2: // Level 2 return new GameFrame2(this); case 3: // Level 3 return new GameFrame3(this); case 4: // Level 4 return new ...
6
public static double[] add( double[] vec1, double[] vec2 ) { int m = vec1.length; double[] res = new double[m]; for ( int i = 0; i < m; ++i ) { res[i] = vec1[i] + vec2[i]; } return(res); }
1
@Override public void keyPressed(KeyEvent e) { if(e.isControlDown() && e.getKeyChar() != 's' && e.getKeyCode() == KeyEvent.VK_S) createScreenShot(); else if(e.isControlDown() && e.getKeyChar() != 'c' && e.getKeyCode() == KeyEvent.VK_C) copyScreenShot(); }
6
public CheckResultMessage check1(int day) { return checkReport.check1(day); }
0
@Override public CMObject newInstance() { if(!ID().equals("Sword")) { try { return this.getClass().newInstance(); } catch(final Exception e) { } return new Sword(); } final Random randomizer = new Random(System.currentTimeMillis()); final int swordType = Math.abs(randomizer.nextInt(...
9
void setStateOfComboBox(JComboBox cb, int index) { Action a = cb.getAction(); ActionListener[] al = cb.getActionListeners(); ItemListener[] il = cb.getItemListeners(); cb.setAction(null); if (al != null) { for (ActionListener x : al) cb.removeActionListener(x); } if (il != null) { for (ItemLis...
8
public void run() { try { byte[] byteBuf = new byte[20000]; boolean tryAgain = false; // Keep going while the manager thread says so while (manager.notifyThreadReady(this, (int) (currentPosition - startPosition))) { do ...
7
private void parseInterNodeConnection ( Node currentNode ) { if (null != this.nodeInfo) { for (int i = 0; i < currentNode.getAttributes().getLength(); i++) { if ("type".equals(currentNode.getAttributes().item(i).getNodeName())) { ...
7
public void updateSubTypes() { argType = (type instanceof ArrayType) ? Type .tSubType(((ArrayType) type).getElementType()) : Type.tError; for (int i = 0; i < subExpressions.length; i++) if (subExpressions[i] != null) subExpressions[i].setType(argType); }
3
private byte[] wrapCommandAPDU(byte[] capdu, int len) throws GeneralSecurityException, IOException { if (capdu == null || capdu.length < 4 || len < 4) { throw new IllegalArgumentException("Invalid type"); } /* Determine lc and le... */ int lc = 0; int le = capdu[len - 1] & 0x000000FF; if (len == 4) {...
9
public List<Integer> getProvsWithBuilding(String building) { final List<Integer> provs = new ArrayList<Integer>(); final String tag = getTag(); for (int i = 1; /* loop until broken */; i++) { GenericObject prov = dataSource.getProvince(i); if (prov == null) ...
4
public void addPath(List<Position> coords, String tooltip) { Path shape = new Path(coords); shape.setAttributes(attrPoly); shape.setAltitudeMode(WorldWind.CLAMP_TO_GROUND); shape.setPathType(AVKey.GREAT_CIRCLE); shape.setFollowTerrain(true); shape.setTerrainConformance(40...
1
public void renderManyLines(String text, int lineLength, int line) { if(text.length() <= lineLength) { Renderer.get().drawText(text, x+38, y+40+line*26, 0.75f); } else { int cut = findSpace(text, lineLength); Renderer.get().drawText(text.substring(0, cut+1), x...
1
@Override public void mousePressed(MouseEvent e) { // Iterate through all of the objects that are registered with the // system and check if the mouse has been clicked within the bounds of // the IMouseEventable synchronized (registeredListeningObjects) { for (IMouseEventable eventable : registeredListening...
5
void transpose(char c1, char c2, State state, StateQueue nextQ, double positionalEditPenalty) { double transposeWeight = mEditDistance.transposeWeight(c1,c2); if (transposeWeight == Double.NEGATIVE_INFINITY) return; if (c2 == ' ' && !state.tokenComplete()) return; Toke...
9
public QRDecomposition(Matrix A) { // Initialize. QR = A.getArrayCopy(); m = A.getRowDimension(); n = A.getColumnDimension(); Rdiag = new double[n]; // Main loop. for (int k = 0; k < n; k++) { // Compute 2-norm of k-th column without under/overflow. double nrm = 0; for (in...
8
public int callProbLogicEval(boolean addRules, boolean poTypedWD, Report report, int numberPo, String parameters, String goalExpression) { exitVal = 0; try { Runtime rt = Runtime.getRuntime(); String tmpPath = System.getProperty("java.io.tmpdir"); String tmpFileName = tmpPath + File.separator + modul...
7
public void testWithField_unknownField() { YearMonth test = new YearMonth(2004, 6); try { test.withField(DateTimeFieldType.hourOfDay(), 6); fail(); } catch (IllegalArgumentException ex) {} }
1
public Debug() { if (GameApplet.thisApplet != null) { debugFlag = Debug.AWT_DEBUG = GameApplet.thisApplet.getParameter("AWT_DEBUG") == null ? false : true; if (!debugFlag) debugFlag = GameApplet.thisApplet.getParameter("DEBUG") != null; } else { try { debugFlag = ...
8
public float[] getNormals( float x, float y, float z ) { switch( this ) { case LEFT: return new float[] { x - 1, y, z }; case RIGHT: return new float[] { x + 1, y, z }; case BOTTOM: return new float[] { x, y - 1, ...
6
public String getExpression() { String collector = "("; collector += function; for (String arg : arguments) collector += arg + " "; collector += ")"; return collector; }
1
protected void renderScreen(Graphics renderer, IScreen screen, GameContainer window) { if (screen.getBackColor() != null) renderer.setBackground(screen.getBackColor()); RenderImage backImage = screen.getBackImage(); if (backImage != null) { if (screen.tileBackground()) { for (int x = 0; x < windo...
6
public static Achievement getAchievementByID(int aid) { String statement = new String("SELECT * FROM " + DBTable + " WHERE aid = ?"); PreparedStatement stmt; try { stmt = DBConnection.con.prepareStatement(statement); stmt.setInt(1, aid); ResultSet rs = stmt.executeQuery(); Achievement achievement = nu...
2
public void setExp(PExp node) { if(this._exp_ != null) { this._exp_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } ...
3
public final boolean subIDEqualsAndNewer(Object obj) { if (obj == this) { return true; } if (obj instanceof UniqueID) { UniqueID other = (UniqueID) obj; return mSubID == other.mSubID && mTimeStamp < other.mTimeStamp; } return false; }
3
public void onPrivateMessage(String sender, String login, String hostname, String message) { // check if exist if (sender.equalsIgnoreCase(DarkIRC.currentChan.name)) { GUIMain.add_line("<" + sender + ">:" + message); } else { ...
4
public MainMenu(RoomDisplay rd) { super(rd); // Material 0, Blank materials.addElement(new Material(true, false)); // Material 1, White Wall materials.addElement(new Material(new Color(255, 255, 255), false, true)); // Material 2, Green Wall materials.addElement(...
6
public void fitAABB(AABB other) { if (aabb == null) { aabb = other; } else { aabb = aabb.combine(other); } getEntity().fitAABB(aabb); }
1
@Override public void run() { ArrayList<ArrayList<String>> arreglos = null; try { DataInputStream ois = new DataInputStream( socketCliente.getInputStream()); DataOutputStream oos = new DataOutputStream( socketCliente.getOutputStream()); System.out.println("DEBUG: A punto de leer la consulta!"); ...
6
private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed if (estaModoEdicao() && exclusaoConfirmada()) { try { excluir(); } catch (ValidacaoException ex) { _unitOfWork.rollback(); J...
3
public List<cheque> retriveChequeinfo() throws SQLException{ List<cheque> chequeInfo=new ArrayList(); try{ databaseConnector=myConnector.getConnection(); stmnt=(Statement) databaseConnector.createStatement(); SQLQuery="SELECT * FROM familydoctor....
4
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final PeopleCP other = (PeopleCP) obj; if (this.id != other.id && (this.id == null || !this.id.equals(other.id)...
5
public static Map<String,String> parseDigestAuthorizationChallenge( String line ) { Map<String,String> map = new TreeMap<String,String>( CaseInsensitiveComparator.sharedInstance ); // This regex works but includes the quotes in the final result. // The line will be splitted into the single '<key>=<value>' elements...
4
protected File getPreviousOutputDirectory() { File dir = previousOutputDirectory; if (dir == null && !IOSImageUtil.isNullOrWhiteSpace(subdir.getText())) { dir = new File(subdir.getText()); if (!dir.isAbsolute()) { dir = null; } } if (dir == null && previousTargetDirectory != null) { dir = previo...
8
public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); switch (keyCode) { case KeyEvent.VK_LEFT : left = true; break; case KeyEvent.VK_RIGHT : right = true; break; case KeyEvent.VK_UP : up = true; break; case KeyEvent.VK_DOWN : down = true; break; c...
8
public static void main(String[] args) { boolean sortir = false; int opcio; while (!sortir) { menu(); opcio = llegirNum("\n\n\tInserir opció: "); switch (opcio) { case 1: FitxerJugadorsOut jugador = new FitxerJugadorsOut("fi...
8
@Override public void clicked(final int x, final int z) { for(int i = -dr; i <= dr; ++i) { final int isq = i * i; for(int j = -dr; j <= dr; ++j) { if(circle && (isq + j * j > 4 * r2)) { continue; } final int posX = x + i; final int posZ = z + j; viewer...
4
@Override protected void paintComponent(Graphics g1) { super.paintComponent(g1); Graphics2D g = (Graphics2D) g1; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); ...
9
private Vector2f lineIntersects(Vector2f lineStart1, Vector2f lineEnd1, Vector2f lineStart2, Vector2f lineEnd2) { Vector2f line1 = lineEnd1.sub(lineStart1); Vector2f line2 = lineEnd2.sub(lineStart2); float cross = crossVector(line1, line2); if(cross == 0) { ret...
5
public CheckResultMessage check25(int day) { int r1 = get(6, 5); int c1 = get(7, 5); int r2 = get(39, 5); int c2 = get(40, 5); BigDecimal b = new BigDecimal(0); if (checkVersion(file).equals("2003")) { try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); b = getValue(r1 + d...
5
@SuppressWarnings("rawtypes") @Override public Class getObjectType() { return Blog.class; }
0
private ArrayList<FilmBean> createListOfFilmBeans(ResultSet rs) { try { if (rs == null || rs.getFetchSize() < 0) { return null; } else { ArrayList<FilmBean> films = new ArrayList<FilmBean>(); FilmBean film = new FilmBean(); ...
4
public static boolean isNumero(String valor) { final String NUMEROS = "0123456789"; for (int i = 0; i < valor.length(); i++) { char caracter = valor.charAt(i); if (NUMEROS.indexOf(caracter) == -1) { return false; } } return true; }
2
public RemoteController() { //Misc Intializers serverAddress = null; intPort = 5252; dicernType = 0; charCount = 0; autoSave = 0; selected = null; conv = new byteConvertor(this); control = new RCControls(); strName = "null"; //Initializes the name list head = null; tail = head; //Generat...
6
private URL getURL(String filename) { URL url = null; try { url = this.getClass().getResource(filename); } catch (Exception e) { } return url; }
1
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Course other = (Course) obj; if (!Objects.equals(this.name, other.name)) { return false; ...
3
public void testConstructor_ObjectStringEx3() throws Throwable { try { new YearMonthDay("10:20:30.040"); fail(); } catch (IllegalArgumentException ex) { // expected } }
1
private void appendShapeInternal(StringBuilder sb) { if (type == ShapeType.RECTANGLE && shield > 0) { throw new UnsupportedOperationException(); } else if (type == ShapeType.RECTANGLE) { sb.append("shape=rect"); } else if (type == ShapeType.DIAMOND) { sb.append("shape=diamond"); } else if (type == Shap...
8
public void mouseEntered(MouseEvent e) // not used { }
0
@EventHandler(ignoreCancelled = true) public void onBlockBreak(final BlockBreakEvent broken) { if (broken instanceof KioskRemove) return; if (!Kiosk.SIGN_BLOCKS.contains(broken.getBlock().getTypeId())) return; final Sign state = (Sign) broken.getBlock().getState(); if (!this.hasTitl...
3
private MoveResult dealWithSpecialCases(StrategyBoard gameBoard, PlayerColor currentTurn, PieceType pieceMoving, Location fromLocation, Location toLocation) { final MoveResult result; if(gameBoard.getPieceAt(fromLocation) == null && gameBoard.getPieceAt(toLocation) == null){ return new MoveResult(currentTur...
8
@Override public void unInvoke() { // undo the affects of this spell if(!(affected instanceof MOB)) return; final MOB mob=(MOB)affected; super.unInvoke(); if((canBeUninvoked())&&(!mob.amDead())&&(mob.location()!=null)) { if(mob.amFollowing()!=null) CMLib.commands().postFollow(mob,null,false); ...
7
public static void makeUnbreakable(ItemStack stack) { if (stack == null) return; try { Object craft = getHandle(stack); if (craft == null) return; Object tagObject = getTag(craft); if (tagObject == null) return; Object unbreakableFlag = null;...
5
public UndoTool(AutomatonPane view, AutomatonDrawer drawer) { super(view, drawer); }
0
public Stmts() { // while (true) { /* The program may have already reach it's end. */ int lexResult = 0; boolean breakLoop = false; if (Lexer.nextToken == Token.KEY_END || GlobalAttributes.braceEncounteredPreviously) { lexResult = Lexer.nextToken; GlobalAttributes.braceEncounteredPreviously = false; ...
7
public void setNextCell(ProcessedCell c){ nextCell = c; if(c != null && c.getPrevCell() != this){ c.setPrevCell(this); } }
2
public String getTaytteetString() { String tayteStr = ""; for (int i = 0; i < this.taytteet.size(); i++) { if(tayteStr.isEmpty()) { tayteStr = this.taytteet.get(i).toString(); } else { tayteStr = tayteStr + ", " + this.taytteet.get(i); } } return tayteStr; }
2
public void deplacer(int orig, int dest, int nbrCartes) { orig--; dest--; if (orig < 0 || orig >= this.table.size()) throw new IllegalArgumentException( "Pile d'origine invalide: " + (orig + 1)); else if (dest < 0 || dest >= this.table.size()) throw new IllegalArgumentException( "Pile de destinat...
5
public void handleReleasedKeys(ArrayList<KeyButtons> keyReleased) { if (keyReleased.contains(KeyButtons.LEFT)) { left = false; } if (keyReleased.contains(KeyButtons.RIGHT)) { right = false; } if (keyReleased.contains(KeyButtons.UP)) ...
5
public boolean login() { boolean loggedIn = false; try { while(loggedIn == false) { System.out.println("Username: "); _username = _scanner.next(); System.out.println("Password: "); _password = _scanner.next(); loggedIn = _remoteObj.login(_username, _password, new Client(), ServerInterface....
3
@XmlAttribute public String getClient() { return client; }
0
public void loop() { if (!MUSIC_ON && (name.equals("music1") || name.equals("music2"))) return; if (!SOUND_ON && !name.equals("music1") && !name.equals("music2")) return; new Thread() { public void run() { clip.loop(); } }.start(); }
6
public void boostMessage(String pokeString,String stat,String amounts, String from) { int which = getStatIndex(stat); int amount = Integer.parseInt(amounts); Pokemon pokemon = getPokemon(pokeString); String level = ""; //sharply for 2, drastically for 3-6, nothing for 1 if(amount == 2 || amount == -2) ...
9
public void setJump(String[] src) { charJump = new Image[src.length]; for (int i = 0; i < src.length; i++) { try { charJump[i] = new Image(src[i]); } catch (SlickException e) { System.out.println(e); } } }
2
private void setupGui() { setTitle("Enter Password!"); setModal(true); setSize(324, 91); setResizable(false); setUndecorated(true); close.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent e) { ...
8
public String getEmail() { return email; }
0
public SecurityEditDialog(JDialog parent, String title, DBElementListModel listModel, SecurityRecord security) { super(parent, title, Dialog.ModalityType.DOCUMENT_MODAL); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); // // Save the security information // t...
5
private void parsePacket(byte[] data, InetAddress address, int port) { String message = new String(data).trim(); Packets type = PacketUtils.getPacketByID(Integer.parseInt((message.substring(0, 2)))); Packets packet = null; switch (type) { case INXPAMOUNT: packet ...
3
public int[] getOneFileLines(File file) { int codeSum = 0;// 代码行数 int blankSum = 0;// 空白行数 int commentSum = 0;// 注释行数 BufferedReader br = null; try { br = new BufferedReader(new FileReader(file)); String line = null; while((line = br.readLine()) != null) { line = line.trim(); if (line.matches...
7
private boolean isValid(String s) { if (s.length() == 3 && s.charAt(0) == '0') return false; if (s.length() == 3 && (Integer.valueOf(s) > 255 || Integer.valueOf(s) == 0)) return false; if (s.length() == 2 && s.charAt(0) == '0') return false; if (s.length() == 2 && Integer.valueOf(s) == 0) return fal...
9
public void execute() { clearConsole(); Deck deck = new Deck(); // TURNO PLAYER1 Player player1 = new Player(); player1.setScore(0); do { Card card = deck.getCard(); //dai carta System.out.println(deck.getCardsList().size()); player1.setScore( player1.getScore() + deck.calcValue(c...
9
public boolean isTall() { switch (eType) { case ENDERMAN: case ENDER_DRAGON: case GHAST: case GIANT: case HORSE: case IRON_GOLEM: case MAGMA_CUBE: case SLIME: case WITHER: return true; default: return false; } }
9
private static Map<Integer, Double> getRankedTagList(BookmarkReader reader, Map<Integer, Double> userMap, double userDenomVal, Map<Integer, Double> resMap, double resDenomVal, boolean sorting, boolean smoothing, boolean topicCreation) { Map<Integer, Double> resultMap = new LinkedHashMap<Integer, Double>(); i...
8
public void shutdown() { // System.out.println("trying to shut down"); synchronized (accptsoc) { if (!listen) { return; } listen = false; try { accptsoc.close(); this.closeall(); } catch (IOException e) { System.err.println("ajserver: could not shutdown properly"); } } }
2
private String fixBadChars(String s) { if (s == null || s.length() == 0) return s; Pattern p = Pattern.compile("[<>\"&]"); Matcher m = p.matcher(s); StringBuffer b = null; while (m.find()) { if (b == null) b = new StringBuffer(); switch (s.charAt(m.start(...
9