text
stringlengths
14
410k
label
int32
0
9
void appendButtonsToReport(boolean submit) { Style style1 = null; String s = null; if (submit && !"true".equalsIgnoreCase(System.getProperty("mw.cd.mode"))) { style1 = page.addStyle(null, null); JButton button = new JButton(page.uploadReportAction); s = Modeler.getInternationalText("Submit"); button....
8
private void addMethods(CtClass proxy, Method[] ms) throws CannotCompileException, NotFoundException { CtMethod wmethod; for (int i = 0; i < ms.length; ++i) { Method m = ms[i]; int mod = m.getModifiers(); if (m.getDeclaringClass() != Object.class ...
7
public void saveTrace(String filename) { try { BufferedWriter writer = new BufferedWriter(new FileWriter(filename)); for (AgentState s : state){ if (s instanceof BacktrackingAgentState){ BacktrackingAgentState b = (BacktrackingAgentState)s; int touch = (b.isHasTouched()) ? 1 : 0; double sona...
4
public static String getMD5(File file) { DigestInputStream stream = null; try { stream = new DigestInputStream(new FileInputStream(file), MessageDigest.getInstance("MD5")); byte[] buffer = new byte[65536]; int read; read = stream.read(buffer); while (read >= 1) read = ...
2
public static void checkPoints(Form form) { if (form.getStart().x > form.getEnd().x && form.getStart().y > form.getEnd().y) { Point temp = form.getStart(); form.setStart(form.getEnd()); form.setEnd(temp); } else if (form.getStart().x < form.getEnd().x ...
6
private void addWrappedCall(ClassFile cf, CodeBuilder b, Method m) { // Special behavior for equals method boolean isEqualsMethod = false; if (m.getName().equals("equals") && m.getReturnType().equals(boolean.class)) { Class[] paramTypes = m.getParameterTypes(); isEqualsMe...
7
@Test public void rnfTest() { userInput.add("hello"); userInput.add("daniel"); userInput.add("can you help me with cooking"); userInput.add("apple"); userInput.add("yes"); runMainActivityWithTestInput(userInput); assertTrue(nlgResults.get(2).contains("what") || nlgResults.get(2).contains("What") && n...
3
public HashOperationException(Exception e, String name){ super(e, name); }
0
private static void initGuiConfig(JSONObject json, Gui gui) throws BadConfig { JSONObject guiConfig = toJSONObject("gui-config", json.get("gui-config"), false); try { if (guiConfig == null) { gui.setConfigLocation(null, null); return; } gui.setConfigSize(toInteger("width", guiConfig.get("width"), f...
2
public void playSound(Location location) { for (String sound : sounds) { Packet62NamedSoundEffect soundPacket = new Packet62NamedSoundEffect(sound, location.getX(), location.getY(), location.getZ(), volume, pitch); if (soundPacket != null) { for (Player player : location.getWorld().getPlayers...
4
public void loadOrdersWithDate(Date date) { orderlistWithDate.clear(); availableItems.clear(); itemlistReserved.clear(); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int h = 0; for (int j = -1; h < 2; j++) { if (j == ...
6
@Test public void testReporProduto() { try { Assert.assertEquals(10, facade.getQuantidadeProduto(1)); Assert.assertTrue(facade.buscarProduto(1).equals(this.p1)); } catch (FacadeException e) { Assert.fail(e.getMessage()); } try { facade.reporProduto(1, 5); Assert.assertEquals(15, facade.getQuanti...
9
public void setPassword(String password) { this.password = password; }
0
private void requestClose(boolean withSaving) { if (withSaving) { if (showConfirmDialog(this, res.get("i.confirm-save"), "", YES_NO_OPTION) != YES_OPTION) { return; } ConnectorMap m = new ConnectorMap(); for (Object o : listModel.toArray()) { ...
7
private static Type decodeType(int dataType) throws IOException { Type result; switch (dataType) { case 0: result = Type.U8 ; break; case 1: result = Type.STRING; break; case 2: result = Type.U16 ; break; case 3: result = Type.U32 ; break; case 4: result = Type.X8 ; break; cas...
7
public CompleteDownloadView(){ super(); this.mangaNameTF = new JTextField(); this.mangaUrlTF = new JTextField(); this.pathTF = new JTextField(); this.pathFC = new JFileChooser(); this.pathFC.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); this.startBT = new JButton("Start"); this.stopBT = new JB...
7
public void manageCollision(Sprite sprite1, Sprite sprite2, int countFaced) { if (oldSprite1 == null || (oldSprite1 != sprite2 || oldSprite2 != sprite1)) { ElementField first, second; first = Buffer.findElement(sprite1); second = Buffer.findElement(sprite2); TYPE ...
6
public String getName() { return name; }
0
public static int getHeadingDifference(int heading1, int heading2){ int result = heading1 - heading2; if(result < -180) return 360 + result; if(result > 180) return 0 - (360 - result); return result; }
2
private void renderProgressBar(Screen screen) { int lClear = linesCleared; if (lClear < 0) { lClear = 0; } int offset = HEIGHT/GOAL_LINES * lClear; if (offset > HEIGHT) { offset = HEIGHT; } screen.renderBlank(getX(), getY()+offset, WIDTH-PROGRESS_BAR_WIDTH, HEIGHT-of...
2
public String toString() { try { // Invoke the static toString() method of the player class Method displayNameField = playerClass.getMethod("getType", (Class[]) null); Player player = (Player) playerClass.newInstance(); return (String) displayNameField.invoke(player, (Object[]) null); }...
6
public String viewErros(TablaTrans tabla) { String result = ""; int estado_actual = 0; for (int i = 0; i < listaToken.size(); i++) { estado_actual = Math.abs(estado_actual); // estado anterior estado_actual = tabla.getEstadoSiguiente(estado_actual, listaToken.get(i).getVa...
6
public void addElement(ValueType value) { if (amount == 0) { SetElement<ValueType> current = new SetElement<>(value); head = current; tail = current; amount++; } else { if (!exist(value)) { SetElement<ValueType> current = new Se...
2
public static void acceptTeleportRequest( BSPlayer player ) { if ( pendingTeleportsTPA.containsKey( player ) ) { BSPlayer target = pendingTeleportsTPA.get( player ); target.sendMessage( Messages.TELEPORTED_TO_PLAYER.replace( "{player}", player.getDisplayingName() ) ); player....
2
public int GetSequence() { return sequence; }
0
protected void stateChange(AutomataStateEvent event) { if (event.isMove()) invalidate(); else invalidateBounds(); }
1
public static void main(String [] args) { display.CreateDisplay.frame(); // Model model = new Model("Glass"); // model.createModel(); while(!Display.isCloseRequested()) { switch(state){ case Main_Menu: Menu.startup(); Menu.loop(); Menu.stop(); break; case ThreeDeeTest: ...
6
@Override public void keyPressedHandler(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_1) { newWindow("A New Frame"); } else if (e.getKeyCode() == KeyEvent.VK_2) { newDialog("A New Dialog"); } else if (e.getKeyCode() == KeyEvent.VK_3) { newCombatVisualize...
3
private String consumeSubQuery() { StringBuilder sq = new StringBuilder(); while (!tq.isEmpty()) { if (tq.matches("(")) sq.append("(").append(tq.chompBalanced('(', ')')).append(")"); else if (tq.matches("[")) sq.append("[").append(tq.chompBalanced(...
4
private void inOrderRec(Position<T> node) throws InvalidPositionException { if (node != null) { BTPosition<T> BTnode = checkPosition(node); inOrderRec(BTnode.getLeft()); System.out.print(node.element() + " "); inOrderRec(BTnode.getRight()); } }
1
public void input() { level.input(); if(Input.getKey(Input.KEY_1)) System.exit(0); // if(Input.getKeyDown(Input.KEY_R)) // { // AudioUtil.playMidi(playlist.get(track)); // } }
1
@Test public void test() { Comment fetchedComment = (Comment) MongoHelper.fetch(comment, "comments"); if(fetchedComment == null) TestHelper.failed("comment not found"); fetchedComment.setText("Edited Text"); if(!MongoHelper.save(fetchedComment, "comments")...
2
public Map<String, String> ReadMsg(int msg_id) { Map<String, String> map = null; String query = String.format("select msg.msg_id as msg_id, u.user_id as user_id," + " aut.username as username, message_subject, message_text" + " from %1$sprivmsgs_to msgto" + " left join %1$susers aut on msgto.author_id =...
8
@Override public void onMessageReceived(Message message) { LOG.info(message.toString()); switch (message.getType()) { case ASK_FOR_LOCATION: String droneId = new String(message.getPayload()); if (droneId.equals(this.drone5937.getId())) { if(this.drone5937DispatcherThread != null){ this.dro...
6
protected void addMissing(Instances data, int level, boolean predictorMissing, boolean classMissing) { int classIndex = data.classIndex(); Random random = new Random(1); for (int i = 0; i < data.numInstances(); i++) { Instance current = data.instance(i); for (int j = 0; j < data.numAt...
7
public boolean debugCheckAssertOnly() { if ( ! (status == 'O' || status == 'F' || status == 'P') ) { return incoherenceOuTrucBizarre(); } if ( ligneDeCaisses.caisse(numeroMem) != this ) { return incoherenceOuTrucBizarre(); } return true; }
4
public SelectionDrawer getDrawer() { return drawer; }
0
public boolean validateString(String validationString, String valueName, String printName, int maxLength, boolean isRequired, boolean isEmail, boolean isName) { //muuttuja, joka lähetetään, validoinnin onnistuessa tai epäonnistuessa boolean success = true; //virheviesti String virhe; //jos ...
7
public Integer[] getLineWinningMove(Integer[] move, String type, int i, String line) { int j; if(checkLineNeedWinning(line)) { j = line.indexOf(" "); } else { return move; } if(type.equals("row")) { ...
5
private void updateThisPlayerMovement(PacketBuilder packet) { /* * Check if the player is teleporting. */ if (player.isTeleporting() || player.isMapRegionChanging()) { /* * They are, so an update is required. */ packet.putBits(1, 1); /* * This value indicates the player teleported. *...
9
public void mouseReleased(MouseEvent e) { if (e.isControlDown() || e.isAltDown()) { // eyedropper mode, similar to Alt-Click in PhotoShop and Corel Paint. updatePalettes(e); } else if (e.isMetaDown()) { // right-click updateCell(e);...
3
@Override public void spring(MOB target) { if((target!=invoker())&&(target.location()!=null)) { if((!invoker().mayIFight(target)) ||(isLocalExempt(target)) ||(invoker().getGroupMembers(new HashSet<MOB>()).contains(target)) ||(target==invoker()) ||(doesSaveVsTraps(target))) target.location().sho...
8
public boolean getMapVal(int i, int j) { if (i < 0) i = 0; if (i >= 480) i = 479; if (j < 0) j = 0; if (j >= 640) j = 639; return Map[i][j]; }
4
public DataItem searchItem(String key) { Node posNode = root; while (true) { if (posNode == null) { break; } int itemPos; System.out.println("================node :" + posNode.getCount()); for (itemPos = 0; itemPos < posNode....
8
public static boolean lockInstance(final String lockFile) { try { final File file = new File(lockFile); final RandomAccessFile randomAccessFile = new RandomAccessFile( file, "rw"); final FileLock fileLock = randomAccessFile.getChannel().tryLock(); if (fileLock != null) { Runtime.getRuntime().addS...
3
public void downImage(final String imgUrl, final String folderPath, final String fileName) { System.out.println("开始下载图片:" + imgUrl); File destDir = new File(folderPath); if (!destDir.exists()) { destDir.mkdirs(); } pool.execute(new Runnable() { @Override public void run() { HttpClient client ...
5
public static boolean maybeStraight(List<Card> sourceCards, HandCombinationSink handCombinationSink) { final Holder<Hand> bestHandHolder = new Holder<Hand>(); CardCombinator.iterate(sourceCards, new CardCombinationCallback() { @Override public boolean process(List<Card> cards) {...
9
protected byte[] getHeader() { byte[] header = new byte[MINIMUM_PAGE_SIZE + numLVs]; header[0] = (byte)'O'; header[1] = (byte)'g'; header[2] = (byte)'g'; header[3] = (byte)'S'; header[4] = 0; // Version byte flags = 0; if(isContinue) { flags ...
3
public void cancelMove() { if(canCancelMove()) willCancelMove = true; }
1
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((amount == null) ? 0 : amount.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((facility == null) ? 0 : facility.hashCode()); result = pr...
5
public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { //first goal is to be able to receive and process //a well formatted XML move piggybacked on a POST //this gives me a raw stream to payload of Post reque...
1
protected void onDisconnect() { int tries = 0; while (tries < 1000 && !isConnected()) { try { connect(ServerName, ServerPort, ServerPassword); } catch (Exception e) { this.log("Connection attempt " + tries + " failed."); tries++; if (tries >= 1000000) System.exit(0); } } // ...
4
public Content deprecatedTagOutput(Doc doc) { ContentBuilder result = new ContentBuilder(); Tag[] deprs = doc.tags("deprecated"); if (doc instanceof ClassDoc) { if (Util.isDeprecated((ProgramElementDoc) doc)) { result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel...
8
@Override public void onDeath() { if (Math.random() <= 0.35) // 35% prob. spawning ghost { boolean left = Math.random() < 0.5; Game.world.addEntity(new Ghost(left ? 0 : Game.world.width, Game.world.height / 2), false); } super.onDeath(); }
2
@Override public int hashCode() { int hash = 0; hash += (rolidRol != null ? rolidRol.hashCode() : 0); return hash; }
1
public void levelBuilder(){ if(Game.building){ if(input.mousePressed){ if(!input.isKeyDown(KeyEvent.VK_SHIFT)){ Tile t = new Tile((input.mouseX)/32, (input.mouseY-this.insets.top)/32, TileType.BRICK); tiles.add(t); t.Init(gh); }else{ ArrayList<Tile> toRemove = new ArrayList<Tile>(); f...
9
public boolean gridValid(char[][] board, int start_row, int start_column) { int[] countPerNumber = new int[9]; clearCounts(countPerNumber); for (int i = start_row; i < start_row + 3; i++) { for (int j = start_column; j < start_column + 3; j++) { if (board[i][j] != '.') { int curInt = (int) board[i][j]...
3
@Override public ServerModel buildCity(BuildCityRequest request, CookieParams cookie) throws InvalidMovesRequest, ClientModelException { if(request == null) { throw new InvalidMovesRequest("Error: invalid build city request"); } ServerModel serverGameModel = serverModels.get(cookie.getGameID()); //ex...
8
@Test public void testBook() throws Exception { //Create query arguments. TicketQueryArgs is used for external client with human readable parameters. TicketQueryArgs query = new TicketQueryArgs(); query.setDate(LocalDate.now()); query.setDepartureStation("北京南"); query.setDestinationStation("南京南"); query.se...
0
private void generateCallArgArray(Node node, Node argChild, boolean directCall) { int argCount = 0; for (Node child = argChild; child != null; child = child.getNext()) { ++argCount; } // load array object to set arguments if (argCount == 1 && itsOneArgArray >= 0) ...
9
public static int getPlatform() { String osName = System.getProperty("os.name").toLowerCase(); if(osName.contains("win")) return 2; if(osName.contains("mac")) return 3; if(osName.contains("solaris")) return 1; if(osName.contains("sunos")) return 1; if(osName.contains...
6
public void setAlstromeria(int alstromeria) { this.alstromeria = alstromeria; }
0
public static boolean cambiarLetrasOrden(char[] pActual, char[] pNueva) throws Exception { char [] abecedario = "abcdefghijklmnopqrstuvwxyz".toCharArray(); int [] comprobarPActual = new int[abecedario.length]; int [] comprobarPNueva = new int[abecedario.length]; int contador = 0; ...
9
@Override public boolean checkGrammarTree(GrammarTree grammarTree, SyntaxAnalyser syntaxAnalyser) throws GrammarCheckException { syntaxAnalyser.setOperionName("slice"); GrammarTree tree = grammarTree.getSubNode(0); if (tree == null || (tree.getSiblingAmount() != 1 && tree.getSiblingAmount() != 3)) { G...
4
public int compareTo(final ComparableNumber o) { if (number.getClass().equals(o.getNumber().getClass())) { return ((Comparable) number).compareTo((Comparable) o.getNumber()); } else { return new Double(number.doubleValue()).compareTo(o.getNumber().doubleValue()); } }
1
private static void readFromFile(String filename) throws IOException { BufferedReader br = null; String line; if(filename == null){ System.out.println("No file path specified!"); return; } File AddFile = new File(filename); if(!AddFile.exists()) { System.out.println("File " + filename + " not fou...
7
public void createMapping(Class<?> aClass) throws ClassValidationException { CSVEntity annotation = aClass.getAnnotation(CSVEntity.class); if (annotation == null) { logger.severe("Class " + aClass.getName() + " is not annotated with " + CSVEntity.class.getName() + " annotation"); return; } if (!classMap...
7
public void renderBackground() { for(int c = 0; c < 25; c++) { if(c == 0) { batch.draw(groundTiles[0], c * 32, 0); } else { batch.draw(groundTiles[1], c * 32, 0); } } for(int r = 1; r < 4; r++) { for(int c = 0; c < 25; c++) { batch.draw(backgroundLight, c * 32, r * 32); } } for(i...
7
@MethodAnnotation public void doNothing() { }
0
private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_aceptarActionPerformed if (lab_modo.getText().equals("Alta")){ if (camposCompletos()){ ocultar_Msj(); insertar(); menuDisponible(true); ...
9
public String saveOrder() throws Exception { String ret = ""; orderSQL = "INSERT INTO ORDERS(BUYER_NAME,"; orderSQL += " SHIPPING_ADRESS, SHIPPING_ZIPCODE, SHIPPING_CITY)"; orderSQL += " VALUES(?,?,?,?)"; try { // load the driver and get a connection Cla...
8
public void imprimeArbol(Nodo E){ if(E==null) return; ArrayDeque<Nodo> currentlevel,nextlevel; currentlevel=new ArrayDeque<Nodo>(); nextlevel=new ArrayDeque<Nodo>(); currentlevel.add(E); while(!currentlevel.isEmpty()){ Nodo currNode=currentlevel.poll(); if(currNode!=null){ for(int i=0;i<curr...
8
public static void main(String[] args) { CommandLineParser parser = new DefaultParser(); Options options = new Options(); final Logger logger = LoggerFactory.getLogger(Application.class); logger.info("Application for generating web-pages"); options.addOption("m", "metrics", fal...
8
public BigInteger getNumberOfTransactions() { return numberOfTransactions; }
0
static byte[] getImage(OP code) { int retID=code.resID; ClassFile cf=(ClassFile)cf_orig.clone(); // set return type int otsize=cf.tsize; cf.tsize=retID_patchback; cf.write((byte)retID); cf.tsize=otsize; String retName; if ((retID<8)) retName=OP.specialTypes[20+retID].getName...
2
@Test public void addBookingTest() { Student s = null; try { s = familyService.findStudent(3); } catch (InstanceNotFoundException e) { assertTrue("Student not found", false); } SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); Calendar cb = Calendar.getInstance(); try { cb.setTime(sdf.p...
5
private void placeNewOrderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_placeNewOrderButtonActionPerformed // TODO add your handling code here: // When place order button is pushed // Check if subtotal and totals have been changed if (!"£0.00".equals(...
8
static List<UnixTimeInterval> parseIntervals(Map<String, Object> params) { List<UnixTimeInterval> intervals = new ArrayList<UnixTimeInterval>(); Integer intervalIndex = null; Boolean isStart = null; UnixTimeInterval interval = null; for(String key : params.keySet()) { intervalIndex = null; interval =...
6
private void updateEnemies() { for (int i = 0; i < enemyList.size(); i++) { enemyList.get(i).update(); if (enemyList.get(i).isArrived() || enemyList.get(i).isDestroyed()) { if (enemyList.get(i).isDestroyed()) { GameInstance.credits += enemyList.get(i)....
5
protected void runLoop2() { int numKeys = 0; try { log.info("going into selector"); numKeys = selector.select(); log.info("coming out with keys="+numKeys); } catch (IOException e) { log.log(Level.WARNING, "Having trouble with a channel", e); } Set<SelectionKey> keySet = selector.selectedKeys(); ...
8
public Result combine(EvaluationCtx context, List parameters, List policyElements) { boolean atLeastOne = false; AbstractPolicy selectedPolicy = null; Iterator it = policyElements.iterator(); while (it.hasNext()) { AbstractPolicy policy = ...
5
private void installApplication_androidButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_installApplication_androidButtonActionPerformed if (selectedDevice != null) new InstallApplicationMenu(logger, debug, adbController, settings, parser, selectedDevice).setVisible(true); ...
1
public void deleteElement(String value) { int codeValue = Math.abs(value.hashCode() % length); if (exists(value)) { hashTable[codeValue].deleteElement(value); } }
1
private static boolean unitTestParseAssemble ( String test_url ) { MuteableURL m_url = new MuteableURL(test_url); String result = m_url.getURLString(); System.out.println("TEST URL: " + test_url); System.out.println(" RESULT: " + result); if (test_url == null) { System.out.println("INVALID TEST: NULL")...
2
private final void waitForButton( @SuppressWarnings("hiding") final String text) { try { synchronized (Button.class) { if (this.master.isInterrupted()) { return; } revalidate(true, true); this.pressed = null; if (Thread.currentThread() != this.master) { this.master.interrupt(); ...
5
public static Res cResultHelper(String expr) { // the helper function return number of true combination // as well as the number of false combination // do some string parsing int n = expr.length() / 2 + 1; // number of bit Res[][] s = new Res[n][n]; // initialize the table for ( int d = 0 ;...
5
private void remove(int i) { if (i == 1) { firstElement = firstElement.getNextElement(); } else if (i > 1) { Element tmpf = firstElement; Element tmps = firstElement.getNextElement(); Element tmpt = firstElement.getNextElement().getNextElement(); ...
5
public void act(){ if (show){ if (counter >= 2){ counter = 0; trans -= 30; if (trans >= 0){ bg.setTransparency (trans); } else{ m.removeObject (this); } ...
3
public int varianceLookback( int optInTimePeriod, double optInNbDev ) { if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) ) optInTimePeriod = 5; else if( ((int)optInTimePeriod < 1) || ((int)optInTimePeriod > 100000) ) return -1; if( optInNbDev == (-4e+37) ) optInNbD...
6
protected int partition(int attIdx, int[] index, int l, int r) { double pivot = m_Instances.instance(index[(l + r) / 2]).value(attIdx); int help; while (l < r) { while ((m_Instances.instance(index[l]).value(attIdx) < pivot) && (l < r)) { l++; } while ((m_Instances.instance(in...
8
public void refresh() { for (int iteration = 0; iteration < panes.size(); iteration++) { final Pane pane = panes.get(iteration); pane.refresh(); //need to fix issue with small panes (index out of range) for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { if (pane.buffer[x][y] !=...
4
public void compExecTime() { double newExeTime; double newCost; dEval = 0; dTime = 0; dCost = 0; for (int i = 0; i < iClass; i++) { newExeTime = 0; // System.out.print("Cost[" + i + "]"); for (int j = 0; j < iSite; j++) { if (dmAlloc[i][j] != -1) { if (dmAlloc[i][j] < 1) { newExeTime...
8
public void moveHuman(final Direction dir, final ActionListener terrifyHumanCallback, final ActionListener healHumanCallback) { if (maze.hasDoorAt(dir, location)) { location = new Location(location, dir); invader.pickupStrategy(maze.getStrategy(location)); maze.visit(location); ...
6
public void draw(Graphics g, boolean filled) { g.setColor(myColor); if (filled) { g.fillOval(getUpperLeftX(), getUpperLeftY(), getWidth(), getHeight()); } else { g.drawOval(getUpperLeftX(), getUpperLeftY(), getWidth(), getHeight()); } }
1
public Node getNode(String idRef) throws IDrefNotInSentenceException { if (terminals.containsKey(idRef)) return terminals.get(idRef); else if (nonterminals.containsKey(idRef)) return nonterminals.get(idRef); else throw new IDrefNotInSentenceException("idRef: " + idRef + " not in Sentence: " + getId()); }
2
@Override public void displayAllStates(List<GameState> AllStates){ final String newline = "<br>"; String output = "<html>"; for(GameState gameState: AllStates){ int[] PlayerRoles = gameState.AllPlayers(); for(int i = 0; i < PlayerRoles.length; i++){ output += "(" + (i+1) + " " + RunFileGame.getPlayerNa...
9
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
9
static void client_server_closes() { final TCPClientLoop client_loop = new TCPClientLoop(); client_loop.start(); Callback.TCPClient client = new Callback.TCPClient() { public void onConnect (TCPClientLoop l, SocketChannel sc) { assert(l == client_loop); byte [...
6
public int getValue() { return value; //You may need to change this }
0
public IrcMessage(IrcClient client, MessageTypes type, String rawmessage) { this.Client = client; this.Type = type; this.RawMessage = rawmessage; }
0