text
stringlengths
14
410k
label
int32
0
9
public XmlWriter endEntity() throws IOException { if (this.stack.empty()) { throw new InvalidObjectException("Called endEntity too many times. "); } String name = this.stack.pop(); if (name != null) { if (this.empty) { writeAttributes(); ...
5
public DaoGenerator( Table table ) { super( table ); this.table = table; daoName = table.getDomName() + "Dao"; filePath = "src/main/java/" + packageToPath() + "/dao/" + daoName + ".java"; for ( Column column : table.getColumns() ) { if ( column.isKey() ) { ...
2
@Override public void run(){ try{ PrintWriter out=new PrintWriter( socket.getOutputStream(),true); BufferedReader in=new BufferedReader(new InputStreamReader(socket.getInputStream())); synchronized(this){ int count; ...
9
@SuppressWarnings("unchecked") public static void main(String[] args) { int len = 10; List<Holder<Integer>> lst = new ArrayList<Holder<Integer>>(len); System.out.println("List size: " + lst.size()); Random rand = new Random(); int num; System.out.print("Adding:"); ...
5
public int send(Map<String, String> record) { String[] emails = record.get("email").split("[|]"); String[] telnos = record.get("telno").split("[|]"); String[] pernrs = record.get("pernr").split("[|]"); // 获得并设置接收人 Map<String, String> recieversMap = service.getRecievers(emails, telnos, pernrs); telMap ...
8
public boolean check_Authors(){ boolean nameValid = false; int counter = 0; for (int i =0; i<authors.size(); i++){ if (!authors.get(i).getName().isEmpty() && authors.get(i).getName() != null){ counter ++; } } if (authors.size()==0){ n...
5
private void leftRotate(RBNode x) { RBNode y = x.getRightChild(); x.setRightChild(y.getLeftChild()); if (y.hasLeftChild()) { y.getLeftChild().setParent(x); } y.setParent(x.getParent()); if (!x.hasParent()) { setRoot(y); } else if (x == x...
3
static void RenderSprite(osd_bitmap bitmap, int spr_number) { int SprX, SprY, Col, Row, Height, src; int bank; UBytePtr SprReg = new UBytePtr();//unsigned char *SprReg; UBytePtr SprPalette = new UBytePtr();//unsigned short *SprPalette; short skip; /* bytes to skip before drawing ...
9
private int handleStringConstant(int pos, String operand) { char c = operand.charAt(0); int num = 0; if (c == '"') { // What is the stuffing method here? for (int i = 1, n = operand.length(); i < n; i++) { c = operand.charAt(i); if (c != '"') { memory[pos] = c; pos++; num++; } } ...
7
public boolean parse(String text) { int n = 0; lex = new CompoLexical(text); LinkedList<LinkedList<Vector<Utils.Identifier>> > Table = new LinkedList<LinkedList<Vector<Utils.Identifier>>>(); LinkedList<Vector<Utils.Identifier>> row = new Li...
7
static public String purefilename (String filename) { char a[]=filename.toCharArray(); int i=a.length-1; char fs=File.separatorChar; while (i>=0) { if (a[i]==fs || a[i]=='/' || i==0) { if (i==0) i=-1; if (i<a.length-1) { int j=a.length-1; while (j>i && a[j]!='.') j--; if (j>i+1) retu...
9
private void readValues(Stream stream) { do { int i = stream.readUnsignedByte(); boolean dummy; if(i == 0) return; else if(i == 1) { anInt390 = stream.read3Bytes(); method262(anInt390); } else if(i == 2) anInt391 = stream.readUnsignedByte(); else if(i == 3) dummy =...
8
public List<Entity> getNearestEntities(final Entity ent, double radius) { List<Entity> nearestEntities = new ArrayList<Entity>(); List<Entity> entList = core.getEntityList(); for(Entity entN : entList) { if(!entN.equals(ent) && entN.getLocation().distanceTo(ent.getLocation())<radius) { nearestEntities.add...
6
@Override public void draw(Graphics g) { // If alive, draw the fighter jet if (Alive) { g.drawImage(img1, pos_x, pos_y, width, height, null); } // If dead, draw blood else { g.drawImage(img2, pos_x, pos_y, width, height, null); } }
1
public double getDefaultVolume(String soundName) { Sound sound = sounds.get(soundName); if (sound != null) { return sound.getDefaultVolume(); } return -1.0; }
1
double findTSval(String[] s){ double TSval=0; boolean find=false; int i=0; while(find ==false && i<s.length){ String tmp = s[i]; if(tmp.contains("TSval")){ find=true; TSval=Double.parseDouble(tmp.substring(6)); } i++; } return TSval; }
3
public ListNode mergeTwoLists(ListNode l1, ListNode l2) { ListNode head = new ListNode(-1); ListNode p = head; while (l1 != null && l2 != null) { if (l1.val > l2.val) { p.next = l2; l2 = l2.next; } else { p.next = l1; ...
5
private boolean shouldAddInstance(RelationInstance instance) { if(filterRelations == false){ return true; } if(instance.getArguments().size() >= 1){ for(Argument arg : instance.getArguments()){ if(arg.getArgumentType().equals("SUBJ") || arg.getArgumentType().equals("DOBJ")){ return true; } ...
5
private boolean testValidProtocol(Element el, Attribute attr, Set<Protocol> protocols) { // try to resolve relative urls to abs, and optionally update the attribute so output html has abs. // rels without a baseuri get removed String value = el.absUrl(attr.getKey()); if (value.length() =...
4
@SuppressWarnings("unchecked") public List<Osoba> getWszystkieOsoby() { return em.createNamedQuery("osoba.all").getResultList(); }
0
public void mouseMoved(MouseEvent Event) { boolean needRepaint = false; if (null != this.vertexToDelete) { this.deleteVertex(this.vertexToDelete); this.selectedVertex = null; } if (null != this.movingVertex) { this.selectedVertex = null; th...
9
public void freePackets(){ activePacket = null; if(packetList != null) { Iterator<Packet> packetIter = packetList.iterator(); while(packetIter.hasNext()){ Packet.free(packetIter.next()); } packetList.clear(); } else { if(singlePacket != null) { Packet.free(singlePacket); singlePacket = ...
3
public void newGame() { InitializeRandomProblem(40); lastAction = new int[6]; lastAction[ID] = -1; lastAction[TYPE] = NO_TYPE; // NO CASE. Voting Finished. lastAction[ACTION] = NEW_GAME; lastAction[X] = -1; lastAction[Y] = -1; lastAction[VALUE] = -1; lastActionsList.add(0, lastAction...
7
public static void main(String[] args) throws IOException { FileReaderStrategy frs = new ReadFromTextFile(6); FormatStrategy format = new PipeSeparatorFormat(frs); // Shows formatted list for (String s : format.getFormattedList()) { System.out.println(s); } Sy...
5
@Override public boolean onCommand(CommandSender sender, Command command, String lable, String[] args) { Player player = null; Player toPlayer = null; if (!(sender instanceof Player)) { master.getLogManager().info( "You cannot do this from the server console."); return true; } player = ...
5
public void stopPlayer() { status = STOP; if (player != null) { player.close(); } player = null; }
1
@Override public void mousePressed(MouseEvent e) { isMouseDown = true; mouseY = e.getY(); }
0
public boolean heeftMonteur(String kt){ boolean b = false; for (Gebruiker m: alleMonteurs){ if (m.getNaam().equals(kt)){ b = true; } } return b; }
2
public void jsFunction_setSpeed(int speed) { deprecated(); if(speed < 0) speed = 0; else if(speed > 3) speed = 3; JSBotUtils.setSpeed(speed); }
2
private JScrollPane getScrollBar(Element e) throws IOException { Element scrollPaneElt = e.getChild("ScrollPane"); if( scrollPaneElt != null ) { int horizontal = JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED; int vertical = JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED; String s = scrollPaneElt.getAttributeValue...
9
public long discreteLogarithmFromExpectedRange(BigInteger value, long expectedResult, long searchRadius) { if(expectedResult - searchRadius < 0 || searchRadius == 0) { throw new IllegalArgumentException(); } long start = expectedResult - searchRadius; long end = expectedResult + searchRadius; boolea...
6
@Override public int attack(double agility, double luck) { if(random.nextInt(100) < luck) { System.out.println("I just did a soul strike!"); return random.nextInt((int) agility) * 2; } return 0; }
1
public static void main(String[] args) { int count = 0; char[] faces = { '2', '3', '4', '5', '6', '7', '8', '9', '\10', 'J', 'Q', 'K', 'A' }; char[] suits = { '♣', '♦', '♥', '♠' }; for (int i = 0; i < faces.length; i++) { for (int j = 0; j < faces.length; j++) { for (int k = 0; k < suits.le...
8
public ShutdownPreview(SkinPropertiesVO skin, JPanel parent) { if (skin == null) { IllegalArgumentException iae = new IllegalArgumentException("Wrong parameter!"); throw iae; } this.skin = skin; this.parent = parent; }
1
Object[] parameterForType(String typeName, String value, Widget widget) { if (value.equals("")) return new Object[] {new TableItem[0]}; // bug in Table? if (typeName.equals("org.eclipse.swt.widgets.TableItem")) { TableItem item = findItem(value, ((Table) widget).getItems()); if (item != null) return new Objec...
5
public void visitTypeInsn(final int opcode, final String type) { mv.visitTypeInsn(opcode, type); // ANEWARRAY, CHECKCAST or INSTANCEOF don't change stack if (constructor && opcode == NEW) { pushValue(OTHER); } }
2
public List<Transition> getTransitionsByStateAndSymbol(String state, String symbol) throws Exception{ List<Transition> result = new ArrayList<Transition>(); for(Transition tran: transitions){ if(tran.matchByStateAndSymbol(state, symbol, getSymbolByAlter(tran.getSymbolRef()))) ...
2
static boolean processWith(StringBuffer sb) { int i = find(sb, "with"); if (i < 0) { return false; } int j = find(sb, "do", i); if (j < 0) { return false; } int k = find(sb, "begin", j); if (k < 0) { return false; } int l = find(sb, "end", k); if (l < 0) { return false; } Strin...
9
public void testStartSeleniumServer() throws Exception { //passing a method Print callCommand(TestSteps2(), "hello world"); }
0
public CheckResultMessage check18(int day) { int r1 = get(33, 5); int c1 = get(34, 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 +...
5
public int getHeadRulePriority(String category, String edgeLabel, String childCategory) { if (!headRules.containsKey(category) || !headRules.get(category).containsKey(edgeLabel)) return Integer.MAX_VALUE; if (headRules.get(category).get(edgeLabel).containsKey("")) return headRules.get(category).get(edgeLa...
4
public void addPattern(Pattern<?,?> pair) throws NNException { if (pair.inputAdapter.numberOfSignals() != network.numberOfInputs()) { throw new NNException("Incorrect number of inputs in pattern. " + "Network expected " + network.numberOfInputs() + ", but was " + pair.inputAdapter.numberOfSignals()); }...
4
public void draw(Graphics g, Dimension d, Camera cam){ //Draw background drawBackground(g, d, cam); //Draw Player if (player != null){ player.draw(g,cam); } //Draw the world for (Tile items: map){ items.draw(g,cam); } //Draw the characters for (Entity entity: entities){ entity.draw(g,cam); ...
4
@Override public void setWatchKey(Object assignedWatchKey) { this.watchKey = (Integer) assignedWatchKey; }
0
public String value_string(Object x) { if (x == null ) return "''"; else if(x instanceof String ) return "'" + x.toString() + "'"; else if(x instanceof java.util.Date) return sql_date((java.util.Date)x); else return x.toString(); }
3
public static void main(String args[]) { Scanner sc = new Scanner(System.in); int T=sc.nextInt(); while(T>0) { T--; String s = sc.next(); if(s.length()>3) System.out.println(3); else { int cnt...
6
public int getBlue(int row, int col) { if (row >=0 && row < rows && col >= 0 && col < columns && grid[row][col] != null) return grid[row][col].getBlue(); else return defaultColor.getBlue(); }
5
public String findSmallestWindow(String str1, String str2) { // table with counter for another string's characters int[] needsToFind = new int[256]; // variable for begin index int begin = 0; // table with counter for first string's characters int[] hasToFind = new int[256]; // variable for counting simil...
9
private void inject(Player player) { boolean injected = false; if (player.getClass().isAssignableFrom(this.craftPlayer)) { try { final Object entPlayer = this.getHandle.invoke(player); if (entPlayer.getClass().isAssignableFrom(this.entityPlayerClass)) { ...
7
public static void unpackConfig(Archive archive) { Stream stream = new Stream(archive.get("flo.dat")); int cacheSize = stream.getUnsignedShort(); if (Floor.cachedFloors == null) { Floor.cachedFloors = new Floor[cacheSize]; } for (int i = 0; i < cacheSize; i++) { if (Floor.cachedFloors[i] == null) { ...
3
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == hero1) { whoIsHero = "Crazy Dave"; } if (e.getSource() == hero2) { whoIsHero = "Pea Shooter"; } if (e.getSource() == hero3) { whoIsHero = "Ice Plant"; } ...
5
public static Connection getConnection() { if (connection == null) { try { Properties properties = new Properties(); properties.load(DatabaseHelper.class.getResourceAsStream("/com/dnx/multi/database/database.properties")); MysqlDataSource dataSource = ...
2
public int moveLeft(boolean findChange) { int total = 0; for (int y = 0; y < 4; y++) { for (int x = 3; x > 0; x--) { if (next.grid[x][y] != 0 && next.grid[x][y] == next.grid[x-1][y]) { next.grid[x-1][y] *= 2; next.grid[x][y] = 0; ...
7
public void removeElement(GraphElement ge) { if (GraphLine.class.isInstance(ge)) { removeLine((GraphLine) ge); } else if (GraphPoint.class.isInstance(ge)) { removePoint((GraphPoint)ge); } }
2
private void btn_saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_saveActionPerformed // TODO add your handling code here: String nomeprod, qtdprod, codprod, dataped; nomeprod = txt_nomeprod.getText(); qtdprod = txt_qtdprod.getText(); codprod = ...
4
private void initialize() { this.setBounds(100, 100, 800, 600); sourceImagePanel = new JPanel(); sourceImagePanel.setBounds(10, 30, 293, 447); getContentPane().add(sourceImagePanel); imageSourceLabel = new JLabel(""); sourceImagePanel.add(imageSourceLabel); imageSourceLabel.setIcon(new ImageIcon(IMAGE_S...
1
public static void main(String args[]) { List<Integer> lists = new LinkedList<Integer>(); // list store all the // left numbers, big // at first for (int i = 9; i >= 0; i--) { lists.add(i); } System.out.println(lists.get(0)); int remain = pos; // 0 as the upper digits for ...
9
@Override public void tickClient() { super.tickClient(); if (SignalTools.effectManager != null && SignalTools.effectManager.isTuningAuraActive()) { for (WorldCoordinate coord : getPairs()) { SignalReceiver receiver = getReceiverAt(coord); if (receiver != n...
4
public static CtMethod setter(String methodName, CtField field) throws CannotCompileException { FieldInfo finfo = field.getFieldInfo2(); String fieldType = finfo.getDescriptor(); String desc = "(" + fieldType + ")V"; ConstPool cp = finfo.getConstPool(); MethodInfo min...
2
public synchronized void stopNotification() { this.aNotification.clear(); this.notifyAll(); }
0
public void setStrength(double strength) { this.strength = strength; }
0
public static HashMap<String, HashMap<String, Integer>> getMap(String filePath) throws Exception { HashMap<String, HashMap<String, Integer>> map = new HashMap<String, HashMap<String,Integer>>(); BufferedReader reader = filePath.toLowerCase().endsWith("gz") ? new BufferedReader(new InputStreamReader( ...
6
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) resp; if(request.getSession().getAttribute("USER_NAME") != null){ } ...
1
@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if(args.length == 0) { return noArgs(sender, command, label); } else { final String subcmd = args[0].toLowerCase(); // Check known handlers first a...
4
public void turnTaking(Move theMove) { Piece pieceToMove = getPiece(theMove.getSource()); String color = isLightTurn ? "light" : "dark"; if (pieceToMove.getPieceColor().equals(color) && pieceToMove != null) { makeMove(theMove); if (pieceToMove.isValid) { ...
5
public Enemy(boolean side, int color, int movePattern, int bulletPattern, int bullets, double direction, int bulletSpeed) { super("sprites/fairyG_1.png"); if(color > 4 || color < 1) { color = 1; } if(color == 2) { setImage("sprite...
6
protected final void move(byte dir) { if (distanceToTravel == 0) { if (dir == NORTH) { facing = NORTH; if (!hub.game.region.isTileOccupied(mapX, mapY - 1)) distanceToTravel = 50; } else if (dir == SOUTH) { facing = SOUTH; if (!hub.gam...
9
public static double getAngleOfEllipseAtAngle(double angleFromCenter, double horizontalAxis, double verticalAxis) { if (horizontalAxis == verticalAxis) { return angleFromCenter; } //System.out.println(angleFromCenter); double axisLengths = Math.pow(horizontalAxis ...
9
public void setDesc(String desc) { this.desc = desc; }
0
public void delete(Key key) { if(key == null) { throw new NullPointerException("Key may not be null"); } if(!membershipTest(key)) { throw new IllegalArgumentException("Key is not a member"); } int[] h = hash.hash(key); hash.clear(); for(int i = 0; i < nbHash; i++) { ...
9
public boolean asyncRequest(String url, String httpMethod, OauthKey key, List<QParameter> listParam, List<QParameter> listFile, QAsyncHandler asyncHandler, Object cookie) { OAuth oauth = new OAuth(); StringBuffer sbQueryString = new StringBuffer(); String oauthUrl = oauth.getOauthUrl(url, httpMethod, ke...
3
public int[] fix45(int[] nums) { for (int i = 0; i < nums.length; i++) { if (nums[i] == 4) { for (int j = i+1; j < nums.length; j++) { if (nums[j] == 5) { int temp = nums[i+1]; nums[i+1] = nums[j]; ...
8
public static void save(String filename) { File file = new File(filename); String suffix = filename.substring(filename.lastIndexOf('.') + 1); // png files if (suffix.toLowerCase().equals("png")) { try { ImageIO.write(onscreenImage, suffix, file); } catch (IOExcep...
4
public static int parseColor(String colorString) throws IllegalArgumentException { if (colorString.charAt(0) == '#') { // Use a long to avoid rollovers on #ffXXXXXX long color = Long.parseLong(colorString.substring(1), 16); if (colorString.length() == 7) { // ...
3
public static boolean isAllUpperCase(String cs) { if (cs == null || StringUtil.isEmpty(cs)) { return false; } int sz = cs.length(); for (int i = 0; i < sz; i++) { if (Character.isUpperCase(cs.charAt(i)) == false) { return false; } } return true; }
4
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { super.loadFields(__in, __typeMapper); __in.peekTag(); if (__typeMapper.isElement(__in, CreatedBy__typeInfo)) { ...
9
private MapLayer unmarshalObjectGroup(Node t) throws Exception { ObjectGroup og = null; try { og = (ObjectGroup)unmarshalClass(ObjectGroup.class, t); } catch (Exception e) { e.printStackTrace(); return og; } final int offsetX = getAttribute(t,...
3
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
@Override public void addComponent(Component component, LayoutParameter... parameters) { if(parameters.length == 0) { parameters = new LayoutParameter[] { CENTER }; } else if(parameters.length > 1) { throw new IllegalArgumentException("Calling BorderLayout.addComponen...
4
private static Method getMethod(Class<?> cl, String method) { for(Method m : cl.getMethods()) { if(m.getName().equals(method)) { return m; } } return null; }
3
public GamesFolder(ZipFile file, String path) throws IOException { this.path = path; JsonReader reader = ZIPHelper.getJsonReader(file, path + "info.json"); reader.beginObject(); while (reader.peek() == JsonToken.NAME) { String name = reader.nextName(); if ("game_folders".equals(name)) { Strin...
7
public void compile() { errs.clear(); int n = 0; int max = links.getHighestDep(); //System.out.println("* MAX "+max); while (n<=max) { ArrayList<Import> imps = links.getLinksWithDepsOf(n); //System.out.println("* N "+n); //System.out.println("* IMPS "+imps); if (imps.isEmpty()) { n++; } ...
9
public static S3Object downloadObject(RestS3Service ss, String testBucknetName, String testObjectName) { S3Object s3objectRes = null; try { s3objectRes = ss.getObject(testBucknetName, testObjectName); } catch (S3ServiceException e) { e.printStackTrace(); } return s3objectRes; }
1
public static BuildingTag getName(char tag) { if (mapping == null) { mapping = new HashMap<Character, BuildingTag>(); for (BuildingTag ut : values()) { mapping.put(ut.tag, ut); } } return mapping.get(tag); }
2
private int partition(int start, int end) { SortingUtils.swap(array, start, new Random().nextInt(end-start+1)+start); int i = start; int j = end; int pivotV = array[i]; while(i<j) { while(i<j && array[j]>=pivotV) {j--;} if(i<j) { array[i++] = array[j]; } while(i<j && array[i]<pivotV) {i++;}...
7
public static <D> D getInstance(Class<D> _class) { try { return _class.newInstance(); } catch (Exception _ex) { _ex.printStackTrace(); } return null; }
1
public static int[][] multiply(int[][] f, int[][] s) { int f_rows = f.length; int s_rows = s.length; if(f_rows == 0) { return s; } if(s_rows == 0) { return f; } int f_cols = f[0].length; if (f_cols != s_rows) { ...
7
public void testDataDependance2() { try { TreeNode label = new TreeNode("label"); TreeNode result = contains(new TreeNode(label), mkChain(new TreeNode[]{ label })); assertTrue(null, "Failed to locate the only node of a leaf!", result != null &...
8
* @return Returns the style of the cell. */ public Map<String, Object> getCellStyle(Object cell) { Map<String, Object> style = (model.isEdge(cell)) ? stylesheet .getDefaultEdgeStyle() : stylesheet.getDefaultVertexStyle(); String name = model.getStyle(cell); if (name != null) { style = postProcessCe...
3
public static Long valueOf(Object o) { if (o == null) { return null; } else if (o instanceof Byte) { return (long)(Byte)o; } else if (o instanceof Integer) { return (long)(Integer)o; } else if (o instanceof Double) { return (long)(double)(D...
6
public Double getAvb() { return avb; }
0
public static Matrix random(int M, int N) { Matrix A = new Matrix(M, N); for (int i = 0; i < M; i++) for (int j = 0; j < N; j++) A.data[i][j] = Math.random(); return A; }
2
private boolean checkFieldInclineWinn(char cellValue){ if(checkInclineDownWinn(cellValue) || checkInclineUpWinn(cellValue)){ return true; } return false; }
2
private final static String[] buildFileForName(String filename, String contents) { String[] result = new String[contents.length()]; result[0] = null; int resultCount = 1; StringBuffer buffer = new StringBuffer(); int start = contents.indexOf("name[]"); //$NON-NLS-1$ start = contents.indexOf('\"', start); int e...
9
public int[] getOID(byte type) throws ASN1DecoderFail { if(data[offset]!=type) throw new ASN1DecoderFail("OCTET STR: "+type+" != "+data[offset]); byte[] b_value = new byte[contentLength()]; Encoder.copyBytes(b_value, 0, data, contentLength(),offset+typeLen()+lenLen()); int len=2; for(int k=1;k<b_value.length;...
5
public void onBlockAdded(World var1, int var2, int var3, int var4) { super.onBlockAdded(var1, var2, var3, var4); if(!var1.multiplayerWorld) { this.updateAndPropagateCurrentStrength(var1, var2, var3, var4); var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); var1...
5
@Override public void mouseClicked(MouseEvent e) { //if (spawnMenuItem.isEnabled()) { int newX = (int) Math.round(e.getX() / (double) game.getPixelSize()); int newY = (int) Math.round(e.getY() / (double) game.getPixelSize()); if (game.isInBounds(newX, newY)) { if (erase) ...
2
public static void main(String[] args) { for(int i = 1; i <= (10/2+1); i++) { for (int j = i; j <= 10/2; j++) { System.out.printf(" "); } for (int j = 1; j <= (i*2-1); j++) { System.out.printf("*"); } System.out.printf("\n"); } }
3
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; TextComponent other = (TextComponent) obj; if (components == null) { if (other.components != null) return false; } else if (!comp...
6
public void setGameOption(int token){ if( token == 0){ if( gameOptionCursor < gameOption.length - 1) gameOptionCursor ++ ; else gameOptionCursor = 0 ; }else if( token == 1){ if( gameOptionCursor > 0) gameOptionCursor -- ; else gameOptionCursor = gameOption.length - 1 ; } }
4