text
stringlengths
14
410k
label
int32
0
9
@Override protected void paintComponent(final Graphics pG) { super.paintComponent(pG); if (placeholder.length() == 0 || getText().length() > 0) { return; } final Graphics2D g = (Graphics2D) pG; g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALU...
2
public HUDMaster(HUDManager hm, Registry rg, int x, int y, int w, int h) { super(hm, rg, x, y, w, h); setImage("HUD/Master/BG"); //inventory slots int slotX, slotY = 0; HUDArea hudArea = null; for (int row = 0; row < INVENTORY_ROWS; row++) { for (int col = 0...
2
@Override public void onClose(WebSocket socket, int arg1, String arg2, boolean arg3) { Client c = Server.get().getClient(socket); if(c != null) { c.disconnect(); } if(socket != null) { Server.get().removeClient(socket); } }
2
private static void setup(final Player p) { api.clear(); ItemStack apple = new ItemStackBuilder(Material.APPLE) .setDisplayName(p.isOp() ? (ChatColor.GREEN + "You are op!") : (ChatColor.RED + "You are not op!")) .setLores("Depending if you are OP or not the name will change!", ChatColor.RED + (ChatColor.B...
3
public boolean executeLocalQuery(String keyRegExp, String valRegExp, String unitTestName) { System.out.println("Executing local query for unit test cast : " + unitTestName); ProcessBuilder pb = null; try { String outputFileName = "unit_tests/" + unitTestName + "/output_local.txt"; File testFile = new Fil...
9
public static void startupKifIn() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/LOGIC", Stella.$STARTUP_TIME_PHASE$ > 1)); Native.setSpecial(Stella.$CONTEXT$, ((Module...
7
public void render(int var1, int var2) { for(int var3 = 0; var3 < this.buttons.size(); ++var3) { Button var10000 = (Button)this.buttons.get(var3); Minecraft var7 = this.minecraft; Button var4 = var10000; if(var10000.visible) { FontRenderer var8 = var7.fontRenderer; ...
9
private void addLayers(Element parent, Layers layers) /*throws XMLStreamException*/ { if (layers == null || layers.getSize() == 0) return; //Check if there are non-empty layers boolean foundNonEmptyLayer = false; for (int i=0; i<layers.getSize(); i++) { if (layers.getLayer(i).getSize() != 0) { f...
7
@EventHandler public void EndermanRegeneration(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getEndermanConfig().getDouble("Ender...
6
public static DurationUnit durationUnitFromValue(int value) { if (value == DurationUnit.DAY.value) return DAY; if (value == DurationUnit.MONTH.value) return MONTH; throw new IllegalArgumentException("不支持的日期单位数值"); }
2
public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter Re: "); String name1 = reader.readLine(); System.out.print("Enter Im: "); String name2 = reader.readLine(); doub...
5
private Node getPersonsRootNode( GraphDatabaseService graphDb ){ Relationship rel = graphDb.getReferenceNode().getSingleRelationship( REF_PERSONS, Direction.OUTGOING ); if ( rel != null ){ return rel.getEndNode(); } else{ Transaction tx = this.graphDb.beginTx(); ...
1
public void update(){ if(Gdx.input.isTouched()){ cam.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0)); if(menu.check(touchPoint) == NEW_GAME) { game.setScreen(game_screen); } else if(menu.check(touchPoint) == SETTINGS) { game.s...
5
private boolean isCompatibleWith0(TypeBinding otherType) { if (otherType == this) return true; if (otherType.id == TypeIds.T_JavaLangObject) return true; // equivalence may allow compatibility with array type through wildcard // bound if (this.isEquivalentTo(otherType)) return true; switch (otherType.kind()...
9
private void splay(T element) { BinaryNode l, r, t, y; l = r = aux; t = root; aux.left = aux.right = null; while(true) { final int comp = element.compareTo((T)t.key); if (comp < 0) { if (t.left == null) break; if (element.compareTo((T)t.left.key) < 0) { y = t.left; ...
9
public JPanel addFuncButtons(){ //добавление кнопки Повтор final JButton RedialButton = new JButton("Повтор"); RedialButton.setPreferredSize(new Dimension(180,90)); RedialButton.setFont(ButtonsFont); RedialButton.setEnabled(false); RedialButton.addActionListener(new ActionListener() { public void action...
1
public List<Location> adjacentLocations(Location location) { assert location != null : "Null location passed to adjacentLocations"; // The list of locations to be returned. List<Location> locations = new LinkedList<Location>(); if(location != null) { int row = location.ge...
9
private void doModify(Task _task, Task t, boolean unredo, LocalDateTime newStartTime, LocalDateTime newEndTime, String newCategory, String newPriority, TaskData taskToModify, LocalDateTime oldStartTime, LocalDateTime oldEndTime, String oldCategory, String oldPriority) { if (newStartTime != null || unredo)...
8
private Token nextBinSelector(char ch) throws IOException { StringBuilder builder = new StringBuilder(); builder.append(ch); int ich = this.reader.read(); while (ich != -1) { ch = (char)ich; if (Character.isSpaceChar(ch) || Character.isISOControl(ch)) break; if (Character.isLetterOrDigit(ch))...
7
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // System.out.println(tabla.getSelectedRow()); if(tabla.getSelectedRow()==-1){ JOptionPane.showMessageDialog(null, "No hay cliente seleccionado."); }else{ ...
1
public boolean EliminarDetallePunto(DetallePunto p){ if (p!=null) { cx.Eliminar(p); return true; }else { return false; } }
1
public Transaction openRead(Transaction me) { // don't try read sharing if contention seems high if (me == null) { // restore object if latest writer aborted if (writer.isAborted()) { rVersion.recover(); writer = Transaction.COMMITTED; } return null; } if (me.attempts >...
8
static public String ALErrorCodeToString(int code) { switch (code) { case AL.AL_NO_ERROR: return "No Error"; case AL.AL_INVALID_NAME: return "Invalid Name"; case AL.AL_INVALID_ENUM: return "Invalid Enum"; case AL.AL_...
6
public static Interval fromIntervalNumber(int intervalNumber, boolean preferMajor) throws UnknownIntervalException { for (Interval interval : Interval.values()) { if (interval.intervalNumber != null && interval.intervalNumber == intervalNumber) { if (interval.intervalQual...
8
public double weightedVariance_as_Complex_ConjugateCalcn() { boolean hold = Stat.nFactorOptionS; if (nFactorReset) { if (nFactorOptionI) { Stat.nFactorOptionS = true; } else { Stat.nFactorOptionS = false; } } boolean hold2 = Stat.nEffOptionS; if (nEffReset) { if (nEffOptionI) { Stat.nE...
7
public Automato criaEquivalenteMinimizado() { EstadoImpl.reiniciarChave(); // elimina todos os estados inatingiveis this.retiraEstadosInatingiveis(); List<List<Estado>> conjuntoMinimizavel = null; List<List<Estado>> resultadoParcial;// cria S0 com dois conjuntos : nao-finais e f...
7
@Override public void mouseClicked(MouseEvent arg0) { if (arg0.getClickCount() == 2) { if (selectedSquare != null) { stockOverviewPanel.setStock(selectedSquare.getStock()); getOwner().navigateTo(stockOverviewPanel); } } }
2
private boolean createNewKeyexchange() { if (type == CLIENT) { try { // create new a crypto.createNewRandom(); // calc new A BigInteger A = crypto.calcA(g); // send A sendBytes(A.toByteArray()); // get B byte[] B = readBytes(); // create AES Key crypto.createAESKey(B...
4
public void setFileInformation( String name, int size ) { filename = name; filesize = size; }
0
private void parseXMLFile(File tempFile) { try { AFManager.processXML(tempFile); } catch (JAXBException ex) { invalidAFLoaded("Error parsing xml file."); } String error = AFManager.validateAF(); if(!error.isEmpty()){ invalidAF...
2
public V get(String row, String column) { if (row == null) { throw new IllegalArgumentException("row cannot be null!"); } if (column == null) { throw new IllegalArgumentException("column cannot be null!"); } for (TableEntry<V> entry : entries) { String r = entry.getRow(); String c = entry.getColu...
7
public IndexingCriterion createCriterion(String string) { if (string.equalsIgnoreCase("AboveBelow")) return new AboveBelowCriterion(); return new AboveBelowCriterion(); }
1
@Override public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { if (!(e.getMessage() instanceof ChannelBuffer)) return; Object sessionObject = ctx.getAttachment(); if (sessionObject != null && sessionObject instanceof Session) { Session session = (Session) sessionObject; if (session.g...
7
public void backtrack(Node u, Node v, Edge edge, int departureTimeFromU, int arrivalAtV) { //find time at which people can go from u to v int delay = 0; boolean change = true; while(change) { change = false; while(u.getNodeCapacityAtTime().size() < (departureTimeFromU + 1)) u.getNodeCapacityAtT...
8
public void loadMap(String s) { System.out.println("CLASSPATH = " + s); try { final InputStream in = getClass().getResourceAsStream(s); final BufferedReader br = new BufferedReader(new InputStreamReader(in)); mapXRows = Integer.parseInt(br.readLine()); mapYRows = Integer.parseInt(br.readLine()); ...
3
public boolean doT2(FlowBlock succ) { /* * check if this successor has only this block as predecessor. if the * predecessor is not unique, return false. */ if (succ.predecessors.size() != 1 || succ.predecessors.get(0) != this) return false; checkConsistent(); succ.checkConsistent(); if ((GlobalO...
6
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page ...
6
public void addSpeed(int speed){ this.speed += speed; }
0
public void mousePressed(MouseEvent event) { if (getDrawer().getAutomaton().getEnvironmentFrame() !=null) ((AutomatonEnvironment)getDrawer().getAutomaton().getEnvironmentFrame().getEnvironment()).saveStatus(); else EDebug.print("I cannot preserve what you ask"); initialPointClick.setLocati...
9
public String readit(String pattern) throws InterruptedException, IOException { cnt=0; char lastChar = pattern.charAt(pattern.length() - 1); StringBuffer buffer = new StringBuffer(); char ch = (char) dataIn.read(); while (runner==1) { buffer.append(ch); String msg=buf...
4
@SuppressWarnings("unchecked") public List<String> asStringArray(RuleContext ruleContext) { if (ruleContext.getEvents().isDebugEnabled()) { ruleContext.getEvents().debug(" " + TYPE + ".asStringArray: output model path=" + mPath); } Element collection = (Element) ruleContext.getInputModel().s...
6
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj == null || obj.getClass() != this.getClass()) { return false; } TurnCoordinate tc = (TurnCoordinate) obj; return x == tc.x && y == tc.y; ...
4
protected Object getMeta(Metadatable obj, String key) { List<MetadataValue> meta = obj.getMetadata(key); for (MetadataValue item : meta) { if (item.getOwningPlugin() == this) { return item.value(); } } return null; }
2
public boolean Buscar(String Elem){ NodosListaProceso aux= PrimerNodo; boolean result=false; while(aux!=null){ if (aux.nombreProceso.equals(Elem)){ result=true; return result; }else aux=aux.siguiente; } return result; ...
2
private Tour getTourDuPetit() { Tour petit = t1; int tailleT1,tailleT2,tailleT3; if(t1.getHauteur()>0) tailleT1 = t1.getTour().get(t1.getTour().size()-1).getTaille(); else tailleT1 = nbr+1; if(t1.getHauteur()>0) tailleT2 = t2.getTour().get(t2.getTour().siz...
5
private int getUnitCostForUnitType(String unitType){ if (unitType == GameConstants.ARCHER){ return GameConstants.ARCHER_COST; } else if (unitType == GameConstants.LEGION){ return GameConstants.LEGION_COST; } else if (unitType == GameConstants.SETTLER){ return ...
4
private Object makeUpdate(Object o, Connection connection) { StringBuilder query = new StringBuilder(); query.append("UPDATE `" + getTableName(o.getClass()) + "` SET "); Boolean first = true; for (Field objectField : o.getClass().getFields()) { if (Modifier.isVolatile(objectField.getModifiers())) cont...
8
public boolean equals( Object other ) { if ( _set.equals( other ) ) { return true; // comparing two trove sets } else if ( other instanceof Set ) { Set that = ( Set ) other; if ( that.size() != _set.size() ) { return false; // different sizes, no need ...
6
private void renderError(Graphics2D g) { if (ERROR != null) { g.setFont(new Font("TimesRoman", Font.PLAIN, 30)); FontMetrics fontMetrics = g.getFontMetrics(); float xLeft = (float) (CARD_WIDTH + CARD_X_GAP); float x = (getWidth() - xLeft - fontMetrics.stringWidth...
1
@Override public boolean onPointerMove(int mX, int mY, int mDX, int mDY) { if(super.onPointerMove(mX, mY, mDX, mDY)) { return true; } for(ResearchItemButton rib : itemSlots) { if(rib.onPointerMove(mX, mY, mDX, mDY)) { return true; } ...
3
private void DisplayInfo() { JTextPane InfoPane = new JTextPane(); InfoPane.setSize(500, 500); InfoPane.setLocation(10, 10); InfoPane.setEditable(false); InfoPane.setEnabled(false); InfoPane.setText("THIS IS A WARNING"); JButton StartB...
1
private static int search5(Cards[] hands, Cards board, int numhands, int[] wins, int[] ties, Cards remaining) { int total = 0; for (int i = 0; i < remaining.size() - 4; i++) { Card card1 = remaining.get(i); board.add(card1); for (int j = i + 1; j < remaining.size() - ...
5
public static boolean Paser(byte[] in) { List<String> addressList = new ArrayList<String>(); List<String> statusList = new ArrayList<String>(); ParkData data = new ParkData(); myPaser paser = new myPaser(); byte[] msg = ParserDataUtil.getMessage(in); if (msg == null) { return false; } msg = ParserDat...
7
public LaplacianDialog(final Panel panel) { setTitle("Laplacian filter"); setBounds(1, 1, 250, 140); Dimension size = getToolkit().getScreenSize(); setLocation(size.width / 3 - getWidth() / 3, size.height / 3 - getHeight() / 3); this.setResizable(false); setLayout(null); JPanel pan = new JPanel(); ...
2
private Simulator(){ try{ File settingsXML = new File("settings.xml"); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); dbFactory.setNamespaceAware(true); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(settingsXML); doc.getDocumentEl...
6
@Override public Response upload(UploadRequest request) throws IOException { Mac hmac=null; try { hmac = Mac.getInstance("HmacSHA256"); } catch (NoSuchAlgorithmException e) { System.err.println("NoSuchAlgorithmException (HmacSHA256 not valid): " + e.getMessage()); return new HmacErrorResponse("Integrity...
8
public int read( int lo, int hi ) { BufferedReader input = new BufferedReader( new InputStreamReader(System.in) ); int response = -1; while ( response < lo || response > hi ) { //************Reads input.************************** try { response = Integer.parseInt(input.readLine()); ...
6
private static void init() throws FileNotFoundException, IOException { File file = new File("data.gz"); if (WRITE_MODE) { if (file.exists()) // Let's make it hard to overwrite the data. throw new RuntimeException("Please delete " + file.getAbsolutePath()); os = new ObjectOutputStream(new GZIPOutputS...
2
@Override public String getMethodCallSyntax(String obj, String m, String... args) { int l = args.length; int size = 2 + m.length(); if (obj != null) { size += obj.length() + 1; } if (l > 0) { size += (l - 1) * 2; } for (String arg : args) { size += arg.length(); } StringBuilder sb = new Stri...
6
private void get(boolean countersOnly) { try { boolean recent = false; String owner = null; String type = null; System.out.print(" Lookup Key : "); String keyWord = bufReader.readLine(); System.out.print(" Type ...
7
public void mostrarTodo(){ if (Mina.this!=null){ Mina.this.conmutar(); } if(norte!=null){ norte.conmutar(); } if(noreste!=null){ noreste.conmutar(); } if(este!=null){ este.conmutar(); } if(sureste!=null){ sureste.conmutar(); } if(sur!=null){ sur.conmutar(); } if(suroeste!=nul...
9
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof MockTaxon)) { return false; } MockTaxon other = (MockTaxon) object; if ((this.id == null && other.id != null) |...
5
public static void main(String[] args) { // parse command line arguments for (String arg : args) { if ("-s".equals(arg)){ // skip the login username = "root"; permissions = 0; } } // temporary!!! ...
8
public static void main(String[] args) { // Create Display try { Display.setDisplayMode (new DisplayMode(800, 600)); Display.create (); Display.setTitle("Hello!!"); } catch (LWJGLException ex) { Logger.getLogger(LWJGL_Example1.cl...
6
public void Update(Ghost ghost, PCPanel panel) { if (Counter < 2) { int x = ghost.getLocation().x; int y = ghost.getLocation().y; int direction = ghost.getDirection(); int move[] = {0,0}; int ms; // Fix SpacesToMove ms =...
8
public Vector2 calculate(Vector2 target) { double distToClosest = Double.MAX_VALUE; Vector2 bestHidingSpot = null; Obstacle closest; for(Obstacle curObj : obstacles) { Vector2 hidingSpot = getHidingPosition(curObj.position, curObj.boundingRadius, target); float dist = Vector2.Vec2DistanceSq(h...
3
public static int getNumberRange() { return 1 << NUMBER_SIZE; }
0
public void update(int x, int y, boolean b0, boolean b1, boolean b2, boolean onScreen, boolean[] keysDown, String typed) { b0Clicked = !this.b0 && b0; b1Clicked = !this.b1 && b1; b2Clicked = !this.b2 && b2; b0Released = this.b0 && !b0; b1Released = this.b1 && !b1; b2Released = this.b2 && !b2; this.x...
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Status other = (Status) obj; if (jobs == null) { if (other.jobs != null) ...
9
public void loadObjects() { File levelFile = load(levelName); try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(levelFile); doc.getDocumentElement().normalize(); NodeList nodes = d...
7
public void findKing(int[][] board, int piece) { for (int i = 0; i < board.length; i++) { for (int j = 0; j < board.length; j++) { if (piece % 2 == 0 && board[i][j] == 11) { x = j; y = i; } ...
6
private boolean viewAccount(int accountID) { boolean contentPaneChanged = false; for (AccountRecord a : AccountRecord.accounts) { if (a.getID() == accountID) { switch (a.getType()) { case AccountRecord.BANK: activeAccount = a; ...
7
@RequestMapping("getClassTree") @ResponseBody public Object getClassTree() { List<Object> colleges = new ArrayList<>(); COLLEGE: for (College college : collegeService.getAll()) { Map<String, Object> c = new HashMap<>(); c.put("collegeId", college.getId()); ...
7
Node partition(int x) { Node less = null; Node more = null; Node current = this; while(current != null) { if(current.data < x) { if(less != null) { less.appendToTail(current.data); } else { ...
4
public void CreateSignSQLTables() throws SQLException { sql.initialise(); if(!sql.doesTableExist("BungeeSignType")){ System.out.println("Table 'BungeeSignType' does not exist! Creating table..."); sql.standardQuery("CREATE TABLE BungeeSignType (T_ID int NOT NULL AUTO_INCREMENT, Type VARCHAR(50) NOT NULL U...
4
public final Instruction[] getSuccs() { if (succs instanceof Instruction) return new Instruction[] { (Instruction) succs }; return (Instruction[]) succs; }
1
private Combination<Colors> generateAttemptCombination10() { List<Token<Colors>> attemptTokens = new ArrayList<Token<Colors>>(); attemptTokens.add(new Token<Colors>(Colors.W)); attemptTokens.add(new Token<Colors>(Colors.W)); attemptTokens.add(new Token<Colors>(Colors.W)); attemptTokens.add(new ...
0
public static boolean hasPathSum(TreeNode root, int sum) { if (null != root && null == root.left && null == root.right && sum == root.val) { return true; } else if (null != root) { if (null != root.left && hasPathSum(root.left, sum - root.val)) { return true; } else if (null != root.right && hasPathSum...
9
boolean isEmpty() { return (packSizes.isEmpty() && folders.isEmpty() && numUnPackStreamsVector.isEmpty() && files.isEmpty()); }
3
public void onResize() { int ch = max(getHeight() - textH * (component.length + 2), textH); int cw = max(getWidth(), textH); curve = new double[cw]; canvas = new BufferedImage(cw, ch, BufferedImage.TYPE_INT_RGB); graph.setBounds(0, 0, cw, ch); graph.setIcon(new ImageIcon(canvas)); for (int i = 0; i < com...
2
@POST @Path("/postGlobicData") public Response postGlobicData( @DefaultValue("2070_test") @QueryParam("componentName") String componentName, @DefaultValue("test") @QueryParam("partitionName") String partitionName, @DefaultValue("cngl1") @QueryParam("password") String password...
4
public float ms_per_frame() // E.B { if (h_vbr == true) { double tpf = h_vbr_time_per_frame[layer()] / frequency(); if ((h_version == MPEG2_LSF) || (h_version == MPEG25_LSF)) tpf /= 2; return ((float) (tpf * 1000)); } else { float ms_per_frame_array[][] = {{8.707483f, 8.0f, 12.0f}, ...
3
@Override public void deserialize(Buffer buf) { super.deserialize(buf); partyType = buf.readByte(); if (partyType < 0) throw new RuntimeException("Forbidden value on partyType = " + partyType + ", it doesn't respect the following condition : partyType < 0"); fromId = buf....
5
@Override public void add(ITraceEvent event) { if (this.m_requestStartFilter == null) throw new RuntimeException("Must indicate which event marks the 'start' of each 'request'. Use DefaultRequestSeparator.setRequestStartFilter(val)."); if (this.m_requestCompletionFilter == null) throw new RuntimeException(...
9
public PossibleConnection engageInsideParagraphs( int i, int j, int firstInParagraph, int positionInParagraph) { /* Inicijalizacija */ // Slucaj spoja mostProbable12.setconnectionCase(12); // Pretpostavimo da je to nemoguc spoj mostProbable12.setProbability(0.0); // Ocistimo listu elemen...
6
public String toString() { if (suit == JOKER) { if (value == 1) return "Joker"; else return "Joker #" + value; } else return getValueAsString() + " of " + getSuitAsString(); }
2
private void drawFiredBall() { if (firedBall != null && !simplifying) { if (difficulty > 1 && (checkArrayNumber(firedBall.getStrand()) || currentLevel > 3)) bufferGraphics.drawImage(imageMap.get("greyBall"), firedBall.getPosition().x, firedBall.getPosition().y, this); else bufferGraphics.drawImage(firedBall.get...
5
public boolean saveProject(Component parentComponent, NESModelListener listener){ if(projectFileName == null){ return saveAsProject(parentComponent, listener); } File selectedFile = new File(projectFileName); boolean ret = saveProjectToFile(selectedFile); if(ret) { projectFileName = selectedFile.getAb...
6
public static String inputStream2String(InputStream is, String charset) { BufferedReader reader = null; StringBuilder sb = new StringBuilder(); String line = null; if (null == charset) { charset = "utf-8"; } try { reader = new BufferedReader(new InputStreamReader(is, charset)); while ((line...
3
@Override public KeySelectorResult select(KeyInfo keyInfo, KeySelector.Purpose purpose, AlgorithmMethod method, XMLCryptoContext context) throws KeySelectorException { for(XMLStructure info : (List<XMLStructure>)keyInfo.getContent()) { if (!(info instanceo...
6
private String getTypes(int flags) { String types = ""; if ((flags & CRT_STATEMENT) != 0) types += " CRT_STATEMENT"; if ((flags & CRT_BLOCK) != 0) types += " CRT_BLOCK"; if ((flags & CRT_ASSIGNMENT) != 0) types += " CRT_ASSIGNMENT"; if ((flags & CRT_FLOW_CONT...
9
public void setLabelVisible(String labelName) { switch (labelName){ case "Top": topLabel.setVisible(true); leftLabel.setVisible(false); rightLabel.setVisible(false); centerLabel.setVisible(false); bottomLabel.setVisi...
5
public void clear() { synchronized(_queue) { _queue.removeAllElements(); } }
0
@Override public int doEndTag() { JspWriter writer = pageContext.getOut(); Predmet predmet = (Predmet) pageContext.getAttribute("predmet"); Student garant = (Student) pageContext.getAttribute("garant"); if(parameter.equals("id")) { try { writer...
8
public void getNextPosition(){ if(left){ dx -= moveSpeed; if(dx < -maxSpeed){ dx = -maxSpeed; } } else if(right){ dx += moveSpeed; if(dx > maxSpeed){ dx = maxSpeed; } } if(falling) { dy += fallSpeed; } }
5
private void actionDelete(HttpServletRequest request, RequestData rd, Class clazz){ try{ helper.deleteElement(clazz, rd.id); } catch(RuntimeException ex){ request.setAttribute("error", ex.getMessage()); } }
1
private static void toggleSpriteGroups(Human human, JointSprite sprite) { for (String groupName : ((JointModel) sprite.model()).groupNames()) { boolean valid = "Main Body".equals(groupName) ; final DeviceType DT = human.gear.deviceType() ; if (DT != null && DT.groupName.equals(groupName)) valid = ...
4
public void performActionForUnitAt( Position p, Game game ){ GameImpl gameImpl = (GameImpl) game; Unit u = game.getUnitAt( p ); if ( u == null ){return;} else if ( u.getTypeString() == GameConstants.SETTLER ){ performSettlerAction( p, gameImpl ); } else if ( u.getTyp...
3
public void stop_logging() { for (ConnectionProcessor pipe : pipes) { pipe.stop_logging(); } }
1
public String getExtension(File f) { if(f != null) { String filename = f.getName(); int i = filename.lastIndexOf('.'); if(i>0 && i<filename.length()-1) { return filename.substring(i+1).toLowerCase(); }; } return null; }
3