text
stringlengths
14
410k
label
int32
0
9
public Object nextValue() throws JSONException { char c = nextClean(); String s; switch (c) { case '"': case '\'': return nextString(c); case '{': back(); return new JSONObject(this); case '[': ...
8
@Override public boolean tick(Tickable ticking, int tickID) { if((tickID==Tickable.TICKID_TRAP_RESET)&&(getReset()>0)) { if((sprung) &&(affected!=null) &&(affected instanceof Room) &&(!disabled()) &&(tickDown>=0)) { final Room R=(Room)affected; if(tickDown>13) { R.showHappens(CM...
9
public static void triggerAR(String pin) { try { URL url; HttpURLConnection connection = null; String lResponseMessage = ""; String targetURL = "http://staging.webchat.a-cti.com:8082/js/action/eventToTalkAction.do?"; String urlParameters = "method=sendJSONRequest&open=submitClickToTalkForm&formN...
1
private BufferedImage createImage() { final int boldWidth = 3; final int sudoHeight = 9 * cellHeight + 2 * yOffset + boldWidth; final int sudoWidth = 9 * cellWidth + 2 * xOffset + boldWidth; final EmptyImageBuilder builder = new EmptyImageBuilder(sudoWidth, sudoHeight + textTotalHeight, Color.WHITE); final B...
7
private static int editDistanceTranspose(CharSequence cSeq1, CharSequence cSeq2) { // cSeq1.length >= cSeq2.length > 1 int xsLength = cSeq1.length() + 1; // > ysLength int ysLength = cSeq2.length() + 1; // > 2 int[] twoLastSlice = new int[ys...
9
private int select(int[] data, int start, int end, int k) { if (start == end) { return data[k-1]; } int t = data[start], i = start, j = end + 1; while (true) { do { i++; } while (i <= end && data[i] < t); do { ...
8
public static void cmd() { StringBuilder sb = new StringBuilder(); int c; System.out.print("SimPL> "); while(true) { try { c = System.in.read(); if(c=='$') { System.out.print("SimPL> "); System.out.println(run(sb.toString())); System.out.print("SimPL> "); sb = new String...
3
private void printItem(String itemName){ Item i = null; if (((i = bag.getItem(itemName)) != null) || ((i = rooms.get(currentRoom).getItem(itemName)) != null)){ try { i.printImage(); } catch (FileNotFoundException e) { System.out.println("Couldn't s...
3
public void run() { // watch dir try { watcher = FileSystems.getDefault().newWatchService(); textsPath = FileSystems.getDefault().getPath(Core.textsDir); key = textsPath.register(watcher, ENTRY_CREATE, ENTRY_MODIFY); } catch (IOException e) { e.pri...
6
public DirectoryTreePanel() { initDirectoryTree(); /*stop processing the tree if running in applet mode*/ //if(appletCheck()) // return; initComponents(); jList1.validate(); /*expand th...
7
@Override public void unInvoke() { // undo the affects of this spell if(!(affected instanceof MOB)) return; final MOB mob=(MOB)affected; super.unInvoke(); if(canBeUninvoked()) { if((!mob.amDead())&&(CMLib.flags().isInTheGame(mob,false))) { if(mob==invoker) { if(mob.location()!=null...
7
public String setNick(String nickname) { if (nickname.length() == 0 || nickname.equals(user.getUsername())) return null; if (nickname.length() > 20) return String.format("Invalid nickname: \"%s\"", nickname); nickname = nickname.replaceAll("\\s", "_"); getUser().setDisplayName(nickname); return String.f...
3
@POST @Timed @Path("getUserDetails") @Consumes("application/x-www-form-urlencoded") @Produces({"application/json"}) public Response verifyUserToken(@HeaderParam("serviceId") @NotNull String serviceToken, @HeaderParam("userSessionId") @NotNull String token) { String errorMessage = null; ...
5
private String classSignature() throws UnexpectedTokenException { StringBuilder signature = new StringBuilder(); this.expect(PLUS, MINUS, TILDE); signature.append(this.getToken().data); this.nextToken(); this.expect(CLASS, INTERFACE, ENUM); signature.append(this.getToken().data); this.nextToken(); this...
3
public void addSorted(PriorityPair pNew){ ListElement el = head; if(el == null){ addFirst(pNew); return; } else if (pNew.compareTo((PriorityPair)head.first())>0) { addFirst(pNew); } else { while(el.rest()!=null && pNew.compareTo((PriorityPair)el.rest().first())<=0){ el = el.rest()...
4
@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 SaleItem)) { return false; } SaleItem other = (SaleItem) object; if ((this.id == null && other.id != null) || (...
5
private void downloadVersionTable() { FileRequest mainRequest = requester.request(255, 255); while (!mainRequest.isComplete()) { requester.process(); } versionTable = new ReferenceTable(mainRequest.getBuffer()); }
1
@Override public void onKeyPress(KeyEvent e) { int key = e.getKeyCode(); if(key == KeyEvent.VK_ESCAPE){ GameMain.game.exit(); } if(key == KeyEvent.VK_ENTER || key == KeyEvent.VK_SPACE){ if(currentSelection == 0){ setCurrentState(new PlayState(...
7
@Override public boolean equals(Object other){ if (other instanceof Host){ Host o = (Host)other; return this.hostName.equals(o.getHostName()); } return false; }
1
public final boolean isPoison() { switch (sourceid) { case 2111003: case 2101005: case 2111006: case 2121003: case 2221003: case 12111005: // Flame gear return skill; } return false; }
6
public ArrayList<Integer> suffixTreeSearch(String pattern) { ArrayList<Integer> resultList = new ArrayList<Integer>(); boolean found = true; TreeNode currentNode=root; while(pattern.length()>0 && found) { if(currentNode.getChildHash().get(pattern.charAt(0))!=null) { Tree...
7
private boolean is_assigned(CPA cpa) throws Exception { boolean assignmets_constraied=false; int k=-1; for(int i=0 ; i<Domain.length ; i++){ k++; k = find_next_possible_assignment(k); if(k == -1){ emptyDomain(); return false; } Assignment assignment = new Assignment(ID , k); for(int j=0 ...
6
public void restoreHealth(int value){ health += value; if(health > maxHealth) health = maxHealth; }
1
public static boolean GetKeyUp(int keyCode) { return !GetKey(keyCode) && m_lastKeys[keyCode]; }
1
void breakWall(Coordinates actual, Coordinates target) { try { //Porte du haut if ((target.getX() == actual.getX()) && (target.getY() <= actual.getY())) { caseArray[actual.getX()][actual.getY()].breakTopWall(); caseArray[target.getX()][target.getY()].break...
9
public final ArrayList<Instruction> compileMacros(int offest){ ArrayList<Instruction> program = new ArrayList<>(); ArrayList<InputPin> inPins = new ArrayList<>(); ArrayList<OutputPin> outPins = new ArrayList<>(); macroSize = 0; for (AbstractUnit unit : units) { if(uni...
8
protected void FillBuff() throws java.io.IOException { if (maxNextCharInd == available) { if (available == bufsize) { if (tokenBegin > 2048) { bufpos = maxNextCharInd = 0; available = tokenBegin; } else if (tokenBegin < ...
9
@Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof GeoPoint)) { return false; } GeoPoint d = (GeoPoint) other; return this.referenceEllipsoid.equals(d.referenceEllipsoid) && this.latitude.equals(d.latitude) && this.longitude.equals(d.longitude); }
4
private void lu_solve(double a[][], int n, int ipvt[], double b[]) { int i; // find first nonzero b element for (i = 0; i != n; i++) { int row = ipvt[i]; double swap = b[row]; b[row] = b[i]; b[i] = swap; if (swap != 0) { ...
6
private void menuSetDifficulty(int difficultyLevel) { switch(difficultyLevel) { case DifficultyLevel.EASY: this.difficultyLevel = new DifficultyLevel(DifficultyLevel.EASY); break; case DifficultyLevel.MEDIUM: this.difficultyLevel = new DifficultyLevel(DifficultyLevel.MEDIUM); break; case DifficultyL...
8
private OBJIndex parseOBJIndex(String token) { String[] values = token.split("/"); OBJIndex result = new OBJIndex(); result.vertexIndex = Integer.parseInt(values[0]) - 1; if(values.length > 1) { hasTexCoords = true; result.texCoordIndex = Integer.par...
2
@Override public void tick(final EntityHandler caller) { super.tick(caller); double dx = Math.sin(rotationAngle) * speed; double dy = -Math.cos(rotationAngle) * speed; if (rotationAngle > 2 * Math.PI) rotationAngle -= 2 * Math.PI; if (rotationAngle < 0) rotationAngle += 2 * Math.PI; dir.x = dx; ...
6
public double[][] createLattice(int rows, int cols, double rate, double up, double down, double q) { double[][] lattice = new double[rows][cols]; for(int row = 0; row < rows; ++row) { for(int col = 0; col < cols; ++col) { /* ...
8
private static boolean isUnimportantSpot(BotState state, Region region, List<RegionAnnotations> regionAnnotationsSoFar) { if (regionAnnotationsSoFar.contains(RegionAnnotations.ENTRANCE_TO_OWN_SUPERREGION)) { return false; } if (regionAnnotationsSoFar.contains(RegionAnnotations.ENTRANCE_TO_OPPONENT_SUPERREGI...
8
protected boolean isElementoEnHechosInferidos(String elemento) { if (null != hechosInferidos) { for (String s : hechosInferidos) { if (elemento.equals(s)) { return true; } } } return false; }
3
public void dbData(String uName) { try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e) { System.out.println("Where is your MySQL JDBC Driver?"); e.printStackTrace(); } if (uName != null) { PreparedStatement ps ...
6
public void setY(byte[] value) { this.y = value; }
0
public boolean GetVerbose() { return verbose; }
0
public void move(int x, int y){ canAct = false; //Check for Map Collision if(map.tileExists(x, y)){ if(map.tileWalkable(x, y)){ if(!getEm().isCreatureAt(this, x,y)){ this.x = x; this.y = y; }else if(getEm().isCreatureAt(this, x,y)){ if(getEm().getEntityAt(this, x, y) instanceof Creature ...
8
public QueryHandler(SystemObject querySender, short simulationVariant, ConfigSimulationObject simulationObject) { _querySender = querySender; _isRequestFromApplication = _querySender instanceof ClientApplication; _debug.fine("QueryHandler für " + _querySender + ", isRequestFromApplication: " + _isRequestFromAp...
7
public XPathHelper(Node node) { _node = node; try { _xpath = newFactory().newXPath(); } catch(XPathFactoryConfigurationException xpfce) { throw new RuntimeException(xpfce); } }
1
public GenericObject loadFromString(String string) { final long startTime = System.nanoTime(); //notify about loading assert debug("Loading from string.", 2); openStringStream(string); GenericObject root = null; try { root =...
5
@Override public void getDataAttdReport(ClassInfo currentCourse, List<AttdCnt> acList) { if (acList == null) { return; } acList.clear(); //directory String crsDirName = getDirName(currentCourse); File dir = new File(crsDirName); if (dir.exists() && dir.isDirectory()) { //read every file in the ...
6
public String remover(){ for(int i=0;i<repositorio.atividades.size();i++){ if(atividadeaux.getCodigoatividade() == repositorio.atividades.get(i).getCodigoatividade()){ repositorio.atividades.remove(i); } } return "/atividade/lista?faces-redirect=true"; }
2
private void tick() { if (state == STATE.MENU) { menu.tick(); } if (state == STATE.GAME) { handler.tick(); cam.tick(handler.object); if (eventOn) { evt.tick(handler.object); } ui.tick(); } if...
4
private static SoftValueRef create(Object key, Object val, ReferenceQueue q) { if (val == null) return null; else return new SoftValueRef(key, val, q); }
1
public void showProfile() throws ProfileNotSetException { if (this.getEmail() == "" || this.getPhone() == "" || this.getDescription() == "") { System.out.println("User " + this.getName() + " does not have any info set."); } else { System.out.println("User " + this...
3
public void reset() { { QueryIterator self = this; if ((Stella.$TRACED_KEYWORDS$ != null) && Stella.$TRACED_KEYWORDS$.membP(Logic.KWD_GOAL_CACHES)) { System.out.println("------------- RESET -------------"); } { ControlFrame initialframe = self.baseControlFrame; if (init...
8
public static void copyCheck(HashMap<String, Integer> printed, HashMap<String, Integer> toPrint, File outFile) { try { FileWriter fw = new FileWriter(outFile); for(Map.Entry<String, Integer> pair : toPrint.entrySet()) { String key = pair.getKey(); Integer val = pair.getValue(); if (key.ma...
5
private static String getReducerLogUrl(String reduceTaskDetailsJsp, List<String> countersList) { Document reduceDetails = HtmlFetcher.getHtml(reduceTaskDetailsJsp); Element tr = null; for(Element elem : reduceDetails.getElementsByTag("tbody").first() .children()) { if(elem.child(2).text().equals("SUCCEEDED...
5
private static String getHexImageFile(HexType hexType) { switch (hexType) { case WOOD: return "images/land/forest.gif"; case BRICK: return "images/land/brick.gif"; case SHEEP: return "images/land/pasture.gif"; case WHEAT: return "images/land/wheat.gif"; case ORE: return "image...
7
public Key next() { count++; Key keyToReturn = null; while (currentNode != null && !currentNode.isKey1Visited) { nodeStack.push(currentNode); currentNode = currentNode.left; //We continue going left to reach the smallest key } //Now we c...
6
public static String[] addStringToArray(String[] array, String str) { if (SpringObjectUtils.isEmpty(array)) { return new String[] {str}; } String[] newArr = new String[array.length + 1]; System.arraycopy(array, 0, newArr, 0, array.length); newArr[array.length] = str; return newArr; }
1
public void body() { // wait for a little while for about 3 seconds. // This to give a time for GridResource entities to register their // services to GIS (GridInformationService) entity. super.gridSimHold(3.0); LinkedList resList = super.getGridResourceList(); // in...
6
@XmlTransient public Collection<Diagnostico> getDiagnosticoCollection() { return diagnosticoCollection; }
0
@Test public void shouldThrowErrorWhenFileIsEmpty() throws IOException { //given File tmpFile = folder.newFile(FILENAME); String filePathString = tmpFile.getAbsolutePath(); //when try { FileParser fileParser = new FileParser(filePathString); fileParser...
1
public void stop() { _motor.set(0); }
0
public static BasicToolbox getInstance() { if (instance_ == null) instance_ = new BasicToolbox(); return instance_; }
1
@Override public void run() { long previousTime = System.currentTimeMillis(); long currentTime = previousTime; if (soundSystem == null) { errorMessage("SoundSystem was null in method run().", 0); cleanup(); return; } // Start out asleep: snooze(3600000); while (!dying()) { // Perform user-...
5
public Node ceiling(int x){ Node cur = root; while(true){ if(cur.value==x) return cur; if(x<cur.value){ if(cur.left==null){ return cur; } cur = cur.left; } else{ ...
7
public void paint(Graphics g) { super.paint(g); /* *store information about current hour, minute and second. */ Date myDate = new Date(); currentHour = myDate.getHours(); currentMinute = myDate.getMinutes(); currentSecond = myDate.getSeconds(); ...
4
private void addVarOp(int op, int varIndex) { switch (op) { case Token.SETCONSTVAR: if (varIndex < 128) { addIcode(Icode_SETCONSTVAR1); addUint8(varIndex); return; } addIndexOp(Icode_SETCONSTVAR, varIndex); ...
7
private void setInitVar(MFStructOrig mforig, InfoSchema info) { lstVFVar = new ArrayList<Pair<String, String>>(); for(int i = 0; i != mforig.lst_FV.size(); i ++) { int i0 = 0; if(Character.isDigit(mforig.lst_FV.get(i).charAt(0))) { String tmp = mforig.lst_FV.get(i); for(int j = tmp.length(); j !...
5
public static void main(String[] args) { Scanner s = new Scanner(System.in); int numberToGuess = (int)Math.abs(1000 * Math.random()); int guessNumber; int guesses = 1; boolean guessed = false; System.out.print("Try to guess my number (int...
5
public EntityListener getEntityListener() { return entityListener; }
0
public void paintComponent(Graphics page) { //page.drawRect(0,0,50,50); for (int y1=0;y1<w.HEIGHT;y1++) for (int x1=0;x1<w.WIDTH;x1++) { if (w.map[x1][y1].z<=w.WATERLEVEL) page.setColor(new Color(0,0,64+DELTA*w.map[x1][y1].z)); else if (w.map[x1][y1].river!=-1) page.setColor(new Color(0,0,Math....
5
static private final void step6() { j = k; if (b[k] == 'e') { int a = m(); if (a > 1 || a == 1 && !cvc(k-1)) k--; } if (b[k] == 'l' && doublec(k) && m() > 1) k--; }
7
/* */ public void paint(Graphics g2) { /* 153 */ if (this.applet != null) return; /* */ /* 155 */ int w = getWidth() / 2; /* 156 */ int h = getHeight() / 2; /* 157 */ if ((this.img == null) || (this.img.getWidth() != w) || (this.img.getHeight() != h)) { /* 158 */ this.img = createVolati...
9
@AfterGroups("Insertion") @Test(groups = "Red Black Tree") public void testRedBlackTreeSearch() throws KeyNotFoundException, EmptyCollectionException { Integer count; Reporter.log("[ ** 2-3 Tree Search ** ]\n"); try { timeKeeper = System.currentTimeMillis(); for (Integer i = 0; i < seed; i++) { ...
5
private void advance() throws IOException { next = null; while((next==null)&&(reader!=null)) { final String line = getLine(); if(line!=null) { next = burster.parse(line); if(next!=null) { if(next.isEmpty()||((!allowPartials)&&(!burster.haveAllFields(next)))) { next = null; } ...
7
public int getNumberOfFilesInDirectory(DirectoryInfo info) { Iterable<EntityInfo> iterator = null; try { iterator = listDirectory(info.getFullPath()); } catch (NotADirectoryException e) { e.printStackTrace(); return 0; } catch (PathNotFoundException e) { e.printStackTrace(); return 0; } catch (...
4
public boolean jsFunction_waitEndMove(int timeout) { deprecated(); int curr = 0; if(timeout == 0) timeout = 10000; while(JSBotUtils.isMoving()) { if(curr > timeout) return false; Sleep(25); curr += 25; } return true; }
3
public UpdateTask(Region[][] array, int hij, int loj, int hii, int loi, int threshold, boolean irregular) { this.array = array; this.hij = hij; this.loj = loj; this.hii = hii; this.loi = loi; this.t = threshold; this.irregular = irregular; }
0
@Override public void paintComponent(Graphics g) { super.paintComponent(g); for(int i = 0; i < width;i++){ for(int j = 0; j < height;j++){ g.drawImage(backTile, i*cellPix, j*cellPix, null); } } for (MapObject obj : objects){ g.drawImage(obj.sprite, obj.x*cellPix, obj.y*cellPix, null); } }
3
@Override public Match find(int id) { Match found = null; PreparedStatement pst = null; ResultSet rs = null; try { pst=this.connect().prepareStatement("select * from Matches where id= ?"); pst.setInt(1, id); rs=pst.executeQuery();...
6
public ArrayList<String> load() throws IOException { ArrayList<String> words = new ArrayList<String>(); File file = new File(FILE_LOCATION); Reader r = null; BufferedReader br = null; try { r = new FileReader(file); br = new BufferedReader(r); String line = br.readLine(); while (line != null) { ...
3
@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (label.equalsIgnoreCase("ctf")) { if (sender instanceof Player) { Player p = (Player) sender; if (args.length==0) { p.sendMessage(CTF.TAG_...
7
public double weightedMean_as_double() { if (!weightsSupplied) { System.out.println("weightedMean_as_double: no weights supplied - unweighted mean returned"); return this.mean_as_double(); } else { boolean holdW = Stat.weightingOptionS; if (weightingReset) { if (weightingOptionI) { Stat.weighti...
6
@Override public void mouseReleased(MouseEvent e) { try { if (renderingColor.equals(Color.GREEN)) { System.out.println( inputImage.getContentOfSelectionAsBlock( mouseRect.x, mouseRect.y, mouseRect.height, mouseRect.width)); } else ...
4
private String getChar(int tone) { String out=""; final String C36A[]={"Q" , "X" , "W" , "V" , "E" , "K" , " " , "B" , "R" , "J" , "<*10>" , "G" , "T" ,"F" , "<fs>" , "M" , "Y" , "C" , "cr" , "Z" , "U" , "L" , "<*22>" , "D" , "I" , "H" , "<ls>" , "S" , "O" , "N" , "<*30>" , "A" , "P" , "<*33>"}; final String F36A...
7
@Before public void setUp() { }
0
public SimulationMenu(final Simulation model, final MainWindow mainWindow) { super(new BorderLayout()); setOpaque(false); this.model = model;// Assigns the model that this menu will control. this.mainWindow = mainWindow;// Assigns the window this is related to. // Get the reso...
5
public void actionPerformed(ActionEvent e) { if (e.getSource() == Next) { } else if (e.getSource() == Previous) { } }
2
private GuiceInjector() { }
0
@Override public void mousePresenceAt(double x, double y) { for (MenuButton but : _buttons) { if (but.isMouseWithin(x, y)) { if (_mouseLastAtButton != but) { if (_mouseLastAtButton != null) _mouseLastAtButton.actionOnExit(); but.actionOnEnter(); _mouseLastAtButton = but; } return; ...
5
public JargonCollection getParentCollection() throws IrodsException { IRODSFile p; try { if (irodsFile.getParent() == null || irodsFile.getParent().isEmpty()) { return null; } p = conn.irodsFileFactory.instanceIRODSFile(irodsFile.getParent()); } catch (JargonException ex) { throw new IrodsExceptio...
3
void accPhiStat(_Doc d) { double prob; for(int t=0; t<d.getSenetenceSize(); t++) { _Stn s = d.getSentence(t); for(_SparseFeature f:s.getFv()) { int wid = f.getIndex(); double v = f.getValue();//frequency for(int i=0; i<number_of_topics; i++) { prob = this.p_dwzpsi[t][i]; for(int...
4
public void searchAllClass(HttpServletRequest request) { if (bInit) return; try { // Tools.getClassesFromFileJarFile("jcore.jsonrpc.rpcobj", "/");// Class[]lst = Tools.getClasses("jcore.jsonrpc.rpcobj"); if(null == lst)return; String s; if(Tools.bDebug && 0 == lst.length)System.out.println("没有...
8
private void ConvertOld() { final File file = new File(extraauth.getDataFolder().getAbsolutePath() + File.separator + "PlayerStatusDB.db"); new File(extraauth.getDataFolder().getAbsolutePath() + File.separator + "PlayerStatusDB.db.bak"); playerstatus ps; int method; extraauth.Log.log...
5
public static Receipt getById(final String token, final String id) { JSONArray fetchById = null; try { fetchById = fetchById(token, object, id); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } List<Receipt> formatOutputs = formatOutputs(fetchById); if (formatOutp...
2
public JSInventory[] getInventories() { ArrayList<JSInventory> items = new ArrayList<JSInventory>(); try { for (Widget i = wdg().child; i != null; i = i.next) { if (i instanceof Inventory) { items.add(new JSInventory(UI.instance.getId(i))); } } } catch (Exception ex) { // Do nothing } JS...
4
private void saveLabels() { // Make sure any labels in the removed blocks are saved. boolean save = false; final Iterator iter = method.code().listIterator(); while (iter.hasNext()) { final Object obj = iter.next(); if (obj instanceof Label) { final Label label = (Label) obj; if (label.startsB...
5
private boolean stepInDirectionOfX(int xDestination) { if (x < xDestination) { x += Math.min(stepSize, xDestination - x); } else if (x > xDestination) { x -= Math.min(x - xDestination, stepSize); } return x == xDestination; }
2
public static boolean checkIfNoneMatchEtag(HttpServletRequest request, HttpServletResponse response, String etag) { String headerValue = request.getHeader("If-None-Match"); if (headerValue != null) { boolean conditionSatisfied = false; if (!"*".equals(headerValue)) { StringTokenizer commaTokenizer = new S...
6
public Object getLdcValue(int index) { ConstInfo constInfo = this.getItem(index); Object value = null; if (constInfo instanceof StringInfo) value = this.getStringInfo(index); else if (constInfo instanceof FloatInfo) value = new Float(getFloatInfo(index)); ...
5
private void growObstaclesPass() { // grow obstacles for (int i = 0; i < userObstacles.size(); i++) ((Obstacle) userObstacles.get(i)).growVertices(); // go through paths and test segments for (int i = 0; i < workingPaths.size(); i++) { Path path = (Path) workingPaths.get(i); for (int e = 0; e < path....
8
public void runAnimation(){ index++; if(index > speed){ index = 0; nextFrame(); } }
1
public boolean searchForElement(String value) { boolean isFound = false; ListElement index = head; if (index != null) { if (index.next == null && index.value == value) { isFound = true; } else { while (index.next != null) { ...
5
public void removeClass(String name){ DragAndDropClassObject obj; for (int i=0;i<components.size();i++){ obj = components.get(i); if (obj.name.equals(name)){ for (DragAndDropClassObject classObject:components){ for (int j = 0; j<classObject.links.size(); j++){ Link link = classObject.links.get(...
5
public boolean AreXItemsInBag(int ItemID, int Amount) { int ItemCount = 0; for (int i = 0; i < playerItems.length; i++) { if ((playerItems[i] - 1) == ItemID) { ItemCount++; } if (ItemCount == Amount) { return true; } } return false; }
3