text
stringlengths
14
410k
label
int32
0
9
@Override public final void addComment(String key, String... comment) { if (containsKey(key)) { if (comment != null && comment.length > 0) { List<String> the_comments = comments.containsKey(key) ? comments.get(key) : new LinkedList<String>(); for (int i = 0; i < c...
9
private boolean jj_3R_27() { if (jj_scan_token(RETURN)) return true; if (jj_3R_76()) return true; if (jj_scan_token(SEMICOLON)) return true; return false; }
3
private void overwriteCircleDefault(Attributes attrs) { // loop through all attributes, setting appropriate values for (int i = 0; i < attrs.getLength(); i++) { if (attrs.getQName(i).equals("color")) circleDef.setColor(new Color(Integer.valueOf(attrs.getValue(i), 16))); else if (attrs.getQName(i).eq...
6
public void saveEndereco() { switch (opcaoHeader) { case "cadastrar cidade": try { genericDAO.save(cidade); searchCidade(); } catch (Exception ex) { Logger.getLogger(UnidadeMB.class.getName()).log(Level.SEVERE, null, ex); } ...
6
public static void main(String[] args) { int numeroActual = -1; int num1; System.out.println(args[0]); num1 = Integer.parseInt(args[0].toString()); while (num1>numeroActual){ numeroActual++; System.out.println(numeroActual); } if (num1%3==0){ num1++; // si el numer...
5
public boolean searchFAT32Element() throws UnsupportedEncodingException { //получение корневого элемента FAT32 byte[] rootBytes = new byte[32]; for (int i = BPB_RootClus * BPB_BytsPerSec; i < (BPB_RootClus * BPB_BytsPerSec + 32); i++) { rootBytes[i - BPB_RootClus * BP...
1
private void lireFichier(String chemin_ficher) throws FileNotFoundException, IOException { contenu_fichier = new StringBuilder() ; f = new File(chemin_ficher) ; if(!f.getName().endsWith(".plic")) throw new ArrayIndexOutOfBoundsException() ; BufferedReader b = new BufferedRead...
2
public static boolean isNumericSpace(String str) { if (str == null) { return false; } int sz = str.length(); for (int i = 0; i < sz; i++) { if ((Character.isDigit(str.charAt(i)) == false) && (str.charAt(i) != ' ')) { ...
4
public boolean shouldExecute() { if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) { return false; } else { if (this.targetClass == EntityPlayer.class) { EntityPlayer var1 = this.taskOwner...
6
public void fillMemory(int[] memory) { int xDimSize = model.getPanelWidth(); int xStart = model.getXnull() + model.getX() - model.getSize()/2; int yStart = model.getYnull() - model.getY() + model.getSize()/2; int xStop = xStart + model.getSize(); int yStop = yStart - model.getS...
8
public ArraysDataBase getArraysDataBase(){ return arraysDataBase; }
0
private boolean isValidInput(final String s) { return s.matches("[!-+--~]+[,][!-+--~]+"); }
0
public void mouseMoved(MouseEvent me) { meX = me.getX(); meY = me.getY(); if(mouseOverTab(meX, meY)){ controlCursor(); tabbedPane.repaint(); } }
1
@Override public Types.MOVEMENT passiveMovement(VGDLSprite sprite) { if(sprite.isFirstTick) { sprite.isFirstTick = false; return Types.MOVEMENT.STILL; } double speed; if(sprite.speed == -1) speed = 1; else speed = s...
5
@DBCommand public boolean start(CommandSender sender, Iterator<String> args) { if(!sender.hasPermission("db.start")) { sender.sendMessage(RED + "You don't have permission to use this command!"); return true; } if(!args.hasNext()) { sender.sendMessage( ...
3
@Override public void valueChanged(ListSelectionEvent e) { if ( !e.getValueIsAdjusting() ) delete.setEnabled(true); }
1
private Person onCircle(double nx, double ny){ for (Person p : model.getPersons()){ Circle c = (Circle) p.getShape(); if(c.getCenterX()+2*c.getRadius()>nx && c.getCenterX()-2*c.getRadius()<nx && c.getCenterY()+2*c.getRadius()>ny && c.getCenterY()-2*c.ge...
5
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Lendable other = (Lendable) obj; if (file == null) { if (other.file != null) return false; } else if (!file.equals(other.file)) retur...
7
public void createEnemies(String mapName){ String thisLine; Path mapPath = Paths.get(MAP_FOLDER, (mapName + TXT_FILE_END)); File inFile = mapPath.toFile(); // open input stream test.txt for reading purpose. List<String> mapLines = new ArrayList<String>(); try { BufferedRea...
7
public Configuration[] getInitialConfigurations(String input) { Configuration[] configs = new Configuration[1]; configs[0] = new FSAConfiguration(myAutomaton.getInitialState(), null, input, input); return configs; }
0
final ObjectDefinition getObject(int i, int i_0_) { anInt3351++; ObjectDefinition class51; synchronized (aClass60_3350) { class51 = (ObjectDefinition) aClass60_3350.method583((long) i_0_, i ^ 0x32); } if (class51 != null) return class51; byte[] is; synchronized (aClass45_3343) { is = aClass45_3343...
6
public int[] getLeastNumbers(Integer[] data, int length , int k){ if(data == null || length <= 0 || k<=0 || k > k){ throw new IndexOutOfBoundsException("input error!"); } int[] result = new int[k]; int start = 0 , end = length -1 ; int index = s.partition(data, length, start, end); while(index != k...
7
@Override public Integer getNodeId(Integer playerId) { Integer Position = null; // loops through detectives and there is an ID match - returns the // detective position for (Detective a : listDetectives) { if (a.getID().equals(playerId)) { Position = a.getPosition(); } } // loops through Mr X's a...
4
public static List<Term> combineEntities(List<Term> sentence) { List<Term> newSentence = new ArrayList<Term>(); int idx = 0; StringBuilder builder = new StringBuilder(); while (idx < sentence.size()) { Term term = sentence.get(idx); if (isPerson(term)) { builder.append(term.getText()).append("_"); ...
9
protected boolean CheckMousePositionRegion(int posX, int posY, int width, int height, boolean checkInside) { //Defining the result variable boolean result = false; //External check if (checkInside == true) { //Checking inside the region if (game.objInputManager.shortMouseX >= posX && game.objInp...
9
private void processPlayer(int time) { // TODO player death player.tryRegen(); if (northPressed || southPressed || westPressed || eastPressed) { player.setIsMoving(true); Rectangle[] monsterBounds = new Rectangle[map.monsters.size()]; for (int i = 0; i < map.monsters.size(); i++) { monsterBounds[i] ...
9
public static int[] intersectTwoSortedArrays(int[] array1, int[] array2){ // create a new array having the smallest size between the two arrays final int newArraySize = (array1.length < array2.length) ? array1.length : array2.length; int[] newArray = new int[newArraySize]; int pos1 = 0; int pos2 ...
5
private void detectBlock() throws LangDetectException { cleaningText(); ArrayList<String> ngrams = extractNGrams(); if (ngrams.size()==0) throw new LangDetectException(ErrorCode.CantDetectError, "no features in text"); langprob = new double[langlist.size()]; ...
9
public void addRecords() { AccountRecord record = new AccountRecord(); Scanner input = new Scanner(System.in); System.out.println("To terminate input, type the end-of-file indicator" + "\nwhen you are promted to enter input." + "\nOn UNIX/Linux/Mac OS X type <ct...
4
public static void main(String... args) throws Exception { File file = new File("/Users/babyduncan/github/javanio/files/sourceFile.txt"); File disFile = new File("/Users/babyduncan/github/javanio/files/disFile.txt"); FileInputStream fileInputStream = new FileInputStream(file); FileChann...
2
private void initHandler() { mouseHandler = mouseEvent -> { final Object SOURCE = mouseEvent.getSource(); if (MouseEvent.MOUSE_PRESSED == mouseEvent.getEventType()) { MenuItem menuItem = items.get(SOURCE); if (menuItem.isSelectable()) { ...
3
public void run(){ synchronized(this){ this.runningThread = Thread.currentThread(); } openServerSocket(); while(! isStopped()){ Socket clientSocket = null; try { clientSocket = this.serverSocket.accept(); } catch (IOExceptio...
3
private void test(String testPath) throws IOException { int hit = 0; int total = 0; BufferedReader scanner = null; try { scanner = new BufferedReader(new FileReader(new File(testPath))); //new Scanner(new File(testPath)); } catch (FileNotFoundException e) { ...
7
public void setSelectionRange(SelectionRange selectionRange){ if (selectionRange != null){ this.selectionRange = selectionRange; } }
1
public static boolean isValid(File f) { if (f.isDirectory()) { return false; } String extension = FileTools.getExtension(f); if (extension != null) { if (extension.equals(".zip") || extension.equals(".tar") || extension.equals(".ra...
7
private static int Permutate(char[] workingSet, int workingIndex, HashSet<String> seenAlready, HashSet<String> toMatch) { int result = 0; if (workingSet.length - 1 < workingIndex) { String permutation = new String(workingSet); if (!seenAlready.contains(permutation) && toMatch.co...
5
private void addGame(Game game) { games.put(game.getGameId(), game); }
0
@Override public void paint(Graphics g) { super.paint(g); Graphics2D g2d = (Graphics2D)g; g2d.scale(scale, scale); int[] size = antWorld.getGridSize(); for(int i=0; i<size[0]; i++) { for(int j=0; j<size[1]; j++) { int x = (int) (i*64+(10*(1/scale))); if(j%2!=0) { x += 32; } int y = (...
7
public boolean SurviveSingleVision(int inSeer, int inTarget, byte inVision){ boolean output = true; if(this.playerTest(inSeer) == 2){ if(inTarget == 0) return true; // No vision was had, therefore no conflict. output = ((playerTest(inTarget) <= (-3)) || (playerTest(inTarget) >= 3)); // output is now // tr...
6
public SimpleDoubleProperty wrapWidthProperty() { return wrapWidth; }
0
protected void initView() { this.add(new TooltipAction("Step", "Moves existing valid " + "configurations to the next " + "configurations.") { public void actionPerformed(ActionEvent e) { controller.step(blockStep); } }); this.add(new TooltipAction("Reset", "Resets the simulation to " + "start c...
1
public void movePlayer(Point dir) { Point destination = Point.add(player.world_position, dir); int moveprior = Move.rate(destination); int attackprior = Attack.rate(destination); int entprior = Activate.rate(destination); double ap_val = 0; if (moveprior > attackprior && ...
6
@Override public void run() { while(repeat > 0){ ObjectOutputStream out = null; ObjectInputStream in = null; try { long time1 = System.currentTimeMillis(); Command[] commands = new Command[inputs.length]; for(int i=0; i!=inputs.length; ++i){ commands[i] = Command.parse(...
9
public void leaveState(MouseListenerHandler mouseListenerHandler) { BoardDisplay bd = mouseListenerHandler.getBoardDisplay(); // Remove all listeners, both MouseListener and MouseMoitionListener for (MouseListener ml : bd.getMouseListeners()) { bd.removeMouseListener(ml); } for (MarkDisplay md : bd.getMar...
4
public boolean isValidField (char row, byte column) { if(row >= 97 && row <= 104 && column <= 7 && column >= 0) { return true; } return false; }
4
private boolean callUpdateScore(String scheduleID) { if (scheduleID==null) return false; boolean result = false; int m=0; do { result = APIRequest.getInstance().updateGameBoxscore(Sport.NBA, scheduleID); } while (!result && ++m < tries); return result; }
3
public void importArchive(Archive archive) { dull = true; CacheIndice indice = cache.getIndice(0); try { byte[] data = null; String location = SwingUtils.getFilePath("Select Archive", Constants.getExportDirectory(), false, new JAGFileFilter()); if (location != null) { data = DataUtils.readFile(locati...
7
public static boolean isApplicable(Object object) { return object instanceof LSystem; }
0
private static String numberToString(int n) { if (n < 1 || n > 1000) { return ""; } if (n <= 20) { return numberMap.get(n); } if (n == 1000) { return "onethousand"; } String result = ""; if (n >= 100) { i...
7
public int minDistance(String word1, String word2) { int m = word1.length(); int n = word2.length(); int[][] distances = new int[m + 1][n + 1]; //insert for (int i = 0; i <= m; i++) { distances[i][0] = i; } //delete for (int i = 0; i <= n; i+...
5
public void handleBeingMobSniffed(CMMsg msg) { if(!(msg.target() instanceof MOB)) return; final MOB sniffingmob=msg.source(); final MOB sniffedmob=(MOB)msg.target(); if((sniffedmob.playerStats()!=null) &&(sniffedmob.soulMate()==null) &&(sniffedmob.playerStats().getHygiene()>=PlayerStats.HYGIENE_DELIMIT)...
8
public static void startupXml() { { Object old$Module$000 = Stella.$MODULE$.get(); Object old$Context$000 = Stella.$CONTEXT$.get(); try { Native.setSpecial(Stella.$MODULE$, Stella.$STELLA_MODULE$); Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get()))); if (Stell...
7
public static boolean isAnagrams(String s,String t){ if( s== null || t == null){ return false; } if(s.length() != t.length()){ return false; } char[] u = s.toCharArray(); Arrays.sort(u); char[] v = t.toCharArray(); Arrays.sort(v); if(new String(u).equals(new String(v))){ return true; } el...
4
public void onScrubGeo(long userId, long upToStatusId) { //System.out.println("Got scrub_geo event userId:" + userId + " upToStatusId:" + upToStatusId); }
0
public static void main(String[] args) { int n=10; PolyominoGenerator.generatePolyomino(n); ArrayList<boolean[][]> polys = new ArrayList<>(); boolean[][] poly = {{false,false,false},{false,false,false},{false,false,false}}; try { PolyominoInputStream...
5
@EventHandler public void onPlayerPickupItem(PlayerPickupItemEvent event) { if (HyperPVP.getSpectators().containsKey(event.getPlayer().getName()) || HyperPVP.isCycling() && !event.getPlayer().isOp()) { event.setCancelled(true); } }
3
public static void main(String[] args) throws Exception { System.out.println("Main Harness"); final int lowestPower = 1; final int highestPower = 7; for (int expon = lowestPower; expon <= highestPower; expon++) { final int rowCount = (int) Math.round(Math.pow(10, expon)); int[] source = readSource(rowCoun...
9
public JSONObject toJSONObject(JSONArray names) throws JSONException { if (names == null || names.length() == 0 || this.length() == 0) { return null; } JSONObject jo = new JSONObject(); for (int i = 0; i < names.length(); i += 1) { jo.put(names.getString(i), this....
4
private void process() { // Get the first command off the command queue and process it if (m_oCommandQueue != null && m_oCommandQueue.size() > 0) { // TODO: Optimise this method for (int i= this.getCommandProcessCount(); i>0 && m_oCommandQueue.size() > 0; i--) ...
9
static HashMap<IntPair, HashSet<AAAtom>> generateAll(int aCount, int archCount) { HashMap<IntPair, HashSet<AAAtom>> result = new HashMap<>(); result.put(new IntPair(0, 0), new HashSet<AAAtom>()); HashSet<AAAtom> aSet = new HashSet<>(); aSet.add(new AAAtom()); result.put(new In...
9
public static Tag<Map<String, Tag>> newCompound(Map<String, ?> data) throws ClassNotFoundException, IllegalAccessException, InvocationTargetException, NoSuchFieldException, NoSuchMethodException, NBTLibDisabledException, UnknownTagException { Map<String, Tag> map; try { for (final Object...
5
private void editSensorEx(){ Form form = new Form(); form.add("unity", "mm"); form.add("name", "Capteur_Pluie"); form.add("statementFrequency", -1); form.add("samplingFrenquency", 1234); try { ClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getFeatures().put(JSONConfiguration.FEAT...
2
public boolean isEmpty() { return size == 0; }
0
public static int[] getPosition(PositionQueue queue, int[] prevPosition){ Position p = queue.poll(); if (p == null) return prevPosition; else{ return p.getPosition(); } }
1
private void pushFile_fileManagerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pushFile_fileManagerButtonActionPerformed File source = null; String dest = directoryLabel_fileManagerLabel.getText(); JFileChooser fileChooser = new JFileChooser(); fileCho...
2
@Test public void testNoTestLinkAnnotationFailure() { assertTrue(false); }
0
public static void fillTable(ResultSet aResult, JTable aTable) throws SQLException { ((DefaultTableModel) aTable.getModel()).setRowCount(0); ((DefaultTableModel) aTable.getModel()).setColumnCount(0); ResultSet results = aResult; ResultSetMetaData metadata = results.getMetaData(); ...
6
public void calculate(FibonacciHeapNode source) { NotTreatedNodes = new FibonacciHeap(); distances = new HashMap<FibonacciHeapNode, Integer>(); predecessors = new HashMap<FibonacciHeapNode, FibonacciHeapNode>(); // set infinity to all other node than myself for (FibonacciHeapNode...
8
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof User)) { return false; } final User user = (User) o; return !(username != null ? !username.equals(user.getUsername()) : user.getUsername() != null); }
3
@Test public void testGetList() throws Exception { Set<Product> products = new HashSet<Product>(); products.add(new Product(0, "desc0", "cat0")); products.add(new Product(1, "desc1", "cat0")); products.add(new Product(2, "desc2", "cat1")); products.add(new Product(3, "desc3",...
3
@EventHandler public void WitherNightVision(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.getZombieConfig().getDouble("Wither.Nig...
7
@Override public BasicValue newValue(final Type type) { if (type == null) { return BasicValue.UNINITIALIZED_VALUE; } boolean isArray = type.getSort() == Type.ARRAY; if (isArray) { switch (type.getElementType().getSort()) { case Type.BOOLEAN: ...
9
public void addSample(String sampleReference, Distribution sampleDistribution, int sampleSize) { if ((sampleSize > 0) && (sampleDistribution != null)) { // if the sample is already contained in the list, we need to // remove it first and subtract its size from the sum of sizes prior // to replacing it. ...
9
public boolean colides(SchlangenKopf head) { return getBounds().intersects(head.getBounds()) && this != head; }
1
public void close() throws IOException { try { int bufferLength = this.buffer.length(); for (;;) { String str = ""; char ch; if (this.bufferIndex >= bufferLength) { str = XMLUtil.read(this.reader, '&'); ch = str.charAt(...
7
public void rMayusVerticesNoLocal() { Iterator elemFuente; Elemento entrada,salida; Iterator elemDestino = destino.listaElementos(); double sumaDistancias,sumaValores,distancia,ponderacion,rMayor; double dist[]; int count; while(elemDestino.hasNext())...
4
public Path2D drawablePath2D(Node to) { List<Node> nodes = dij.getRoute(to); Path2D path = new Path2D.Double(); for (Node n : nodes) { if (n.equals(nodes.get(0))) { path.moveTo(n.getxCoord(), n.getyCoord()); } else { path.lineTo(n.getxCoord(), n.getyCoord()); } System.out.println(n.g...
2
public void MarketCannotFulfill(Market market, Map<String, Integer> provided){ Do(market.getName()+" cannot fulfill"); synchronized(marketOrders){ for(MarketOrder mo : marketOrders){ if(mo.market.equals(market.getName())){ mo.provided = provided; } } } for(String food : foodToOrder.keySet()){ f...
6
protected void listAll() { if(myCases.size() == myLemma.numCasesTotal()) myMessage.setText("All cases for m = " + myLemma.getM() + " are already shown."); else { myLemma.doAll(); myMessage.setText("All cases for m = " + myLemma.getM() + " shown."); ...
1
public static void main(String[] args) throws Exception { int i; System.out.println("1: for train and predict"); System.out.println("2: for test"); System.out.println("3: for excute meta"); if (args.length == 0) { System.out.println("input a method"); System.exit(0); } else if (args.length == 1) {...
8
@Test public void recomTest1() { userInput.add("hello"); userInput.add("hi"); userInput.add("luiz"); userInput.add("what can i eat with pork today"); //Covering approval userInput.add("yes"); userInput.add("what can i eat with fish tomorrow"); //Covering different week days userInput.add("beef monday...
3
public void setjTextFieldLieux(JTextField jTextFieldLieux) { this.jTextFieldLieux = jTextFieldLieux; }
0
@Override public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException { //Special handling for Privateer classes when building with Maven //Maven does not set the classpath but instead uses a custom //classloade...
5
StunServerReceiverThread(DatagramSocket datagramSocket) { this.receiverSocket = datagramSocket; for (DatagramSocket socket : sockets) { if ((socket.getLocalPort() != receiverSocket.getLocalPort()) && (socket.getLocalAddress().equals(receiverSocket.getLocalAddress()))) changedPort = socket; if ((...
7
@Override protected Integer compute() { Integer ret = 0; MyWorkerThread thread = (MyWorkerThread) Thread.currentThread(); thread.addTask(); for(int i = start ; i < end;i ++){ ret += array[i]; } return ret; }
1
public Point minus(Point p) { if (!(p == null || p.properties == null || properties == null)) { for (int i = 0; i < properties.size(); i++) { set(i, get(i) - p.get(i)); } } return this; }
4
@Override public int reportFake(@Nonnull GamePlayer player, @Nonnull Status[] tweets) throws RemoteException { tweetsProvider.delay(); final GamePlayerData playerData = getGamePlayerData(player); try { if (tweets.length < MIN_FAKE_TWEETS_BATCH) throw new IllegalArgumentException("Invalid fake tweeets size");...
9
@Override public String encrypt(String plainText) { String text = processInput(plainText); int r = transpositionLevel; int length = text.length(); int c=length/transpositionLevel; char mat[][] = new char[r][c]; int k=0; String cipherText=""; for(int i=0;i< c;i++) { for(int j=0;j< r;j+...
5
public static void main(String[] args) { int max = Integer.MAX_VALUE; System.out.println("Overflow:"); System.out.println(max); // 2147483647 System.out.println(max + 1); // -2147483648 System.out.println(max + 2); // -2147483647 int min = Integer.MIN_VALUE; System.out.println("Unceerflow:"); System.out.printl...
0
public State(int id, Point point, Automaton automaton) { this.point = point; this.id = id; this.automaton = automaton; }
0
public ShapeElempun(SimpleFeature f, String tipo) { super(f, tipo); shapeId = "ELEMPUN" + super.newShapeId(); // Elempun trae la geometria en formato Point if ( f.getDefaultGeometry().getClass().getName().equals("com.vividsolutions.jts.geom.Point")){ Point p = (Point) f.getDefaultGeometry(); coor = p...
1
public Stub440 localise() { Class<? extends Stub440> c = null; try { c = (Class<? extends Stub440>) Class.forName(remoteInterfaceName + "_Stub").asSubclass(Stub440.class); } catch (ClassNotFoundException e) { //TODO: Download .class file from code base e.printStackTrace(); System.exit(-1); }...
5
@SuppressWarnings("unchecked") @Test public void testLastWeek() { SimpleValidator simpleValidator = new SimpleValidator(); DateRangeBean bean; Set<?> validations; for (int days = -2014; days <= -14; days += 100) { bean = new DateRangeBean(); bean.setDate4(util.add(new Date(), Calendar.DAY_OF_MONTH, day...
8
public void inferir(BaseReglas baseCon) throws IOException { baseCon.cargar(); Archivos a = new Archivos(); float min = 1,temp=1; int i; while(baseCon.tieneRegistros()) { //Obtener regla baseCon.siguienteRegla(); ...
5
public void parseFile() { LineNumberReader lnr = null; try { lnr = new LineNumberReader(new InputStreamReader(new FileInputStream(file))); String s; while ((s = lnr.readLine()) != null) { if (!s.startsWith("[")) { continue; } parseCell(s); } } catch (FileNotFoundException e) { e...
6
public void OperandBody(OperandTypeDecl td) throws ParseException { jj_consume_token(LBRACKET); label_8: while (true) { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case READ: case WRITE: case 81: break; ...
9
public TreeNode build(int[] A) { TreeNode root = new TreeNode(A[0]); TreeNode last = root; Stack<TreeNode> S = new Stack<>(); boolean left = false; for (int i = 1; i < A.length; i++) { if (last == null && S.isEmpty()) break; last = last == null ? S.pop() : last; if (A[i] != -1) { TreeNode nod...
8
public final void testFall() { DiscogParser parser = new DiscogParser(); try { Record r = parser.parseDiscogRelease(DISCOG_FALL); System.err.println("TRACKS = " + r.getTracks().size()); assert (r.getTracks().size() == 50); // Check the last track has a correct ...
3
public Enrolment(Student s, ClassGroup c) { if (s == null || c == null) throw new IllegalArgumentException(); this.enrolledStudent = s; this.enrolledClass = c; }
2
public String toString() { String s = ""; for (int i = 2; i < a.length; i++) s += (a[i] ? i + " " : ""); return s; }
2