text
stringlengths
14
410k
label
int32
0
9
public String toString() { String output = "webOS " + version + "\n"; if(wallpaper!=null) { output += "\tWallpaper: " + wallpaper.getPath() + "\n"; } output += "\tFiles:\n"; for(int i=0; i<files.size(); i++) { output += "\t\t" + files.get(i) + "\n"; ...
4
public static void deleteSkin(String filename) { Path skinPath; if (!filename.endsWith(Constants.SKINFILE_SUFFIX)) { skinPath = Constants.PROGRAM_SKINS_PATH.resolve(filename + Constants.SKINFILE_SUFFIX); } else { skinPath = Constants.PROGRAM_SKINS_PATH.resolve(filename); ...
2
private void viewManagementPlan() { //save original order of Stakeholders OriginalStakeholders.clear(); for(Stakeholder s : Stakeholders) { OriginalStakeholders.add(s); } //sort Stakeholders by Influence value Collections.sort(Stakeholders, new Comparator<Stakeholder>(){ ...
2
private void updateDisplay() { need = getWhatNeedsDone(); boolean done = need.length == 0; convertAction.setEnabled(!done); doAllAction.setEnabled(!done); highlightAction.setEnabled(!done); exportAction.setEnabled(done); if (done) directionLabel .setText("Conversion done. Press \"Export\" to use....
1
public E pred(E e) { DoublyLinkedNode node = search(e); if (node != null) { if (node.getPred() != null) { final E returnValue = (E) node.getPred().getKey(); return returnValue; } } return null; }
2
public static void MutePlayer( String sender, String target, boolean command ) throws SQLException { BSPlayer p = PlayerManager.getPlayer( sender ); if ( !PlayerManager.playerExists( target ) ) { p.sendMessage( Messages.PLAYER_DOES_NOT_EXIST ); return; } BSPlayer ...
5
public ImageIcon[][] getColorGrid() { Piece piece; ImageIcon[][] tab = new ImageIcon[plateau.getTailleX()][plateau.getTailleY()]; for (int i = 0; i < plateau.getTailleX(); i++) { for (int j = 0; j < plateau.getTailleY(); j++) { piece=new Piece(plateau.getPlateau()[i][...
2
private Type zeroExtend(Type type) { if (type == Type.SHORT || type == Type.BYTE || type == Type.CHAR || type == Type.BOOLEAN) return Type.INTEGER; return type; }
4
@Override public void actionPerformed(ActionEvent e) { //Set ip address if (e.getSource() == ipSetButton) { serverAddress = new InetSocketAddress(ipField.getText().trim(), defaultPort); local.println("IP Address set to: " + serverAddress); log.setCaretPosition(log.getDocument().getLength()); } //Start...
7
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Variable)) { return false; } Variable other = (Variable) obj; if (name == null) { if (other.name != null) { return false; } } else if (!name.equal...
6
public String toString() { return actions.toString() + (loop ? " loop " : ""); }
1
@Override public void onDeleteFile(String arg0, DokanFileInfo arg1) throws DokanOperationException { try { if (DEBUG) System.out.println("DeleteFile: " + arg0); fileSystem.deleteFile(mapWinToUnixPath(arg0)); } catch (AccessDeniedException e) { throw new DokanOperationException(net.decasdev.dokan.Wi...
4
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
public Integer readUnicodeChar() throws IOException { int off = 0; int len = readInt(); byte[] s = new byte[len]; while (off < len) { off += read(s, off, len - off); } String charString = new String(s, "UTF-8"); int retval = (int) charString.charAt(0); // NOTE: When w...
2
void appendChild(XML xml) { if (xml.isAttribute()) { if (attributes == null) attributes = new TreeMap<String, XML>(); attributes.put(xml.getNodeName(), xml); } else { if (nodeValue != null) throw new IllegalStateException("only leaf node can contain text"); if (elements == null) { elements = new Tre...
6
@Override public void mark(int boardPosition, Cell[] cellBoard, int rows, int columns) throws IllegalMark { //Find the row. int boardPositionRow = boardPosition / columns; //Find the column. int boardPositionColumn = boardPosition % columns; //Position to ma...
2
public String prefCon() { nameList t=null; if(getScreen() == 1 || getScreen()==3 || getScreen()==4) { if(baseCon != null) t = baseCon.getSelected(); else if(remCon != null) t = remCon.getSelected(); if(t == null) return ";"; else if(t.getDeleted()) return ";"; else return ...
7
static boolean palindromenTest(String reeks) { boolean palindroom = true; int j = reeks.length() - 1; for(int i = 0; i <= j; i++, j--) { if(reeks.charAt(i) != reeks.charAt(j)) palindroom = false; } return palindroom; }
2
public String spellCheckConfusionMatrices(String wrong, DataSet testSet) { String correct; double probability = 0.0; //System.out.println("Calculating probabilites with all possible words..."); double max = 0.0; // Set<String> candidates = new HashSet<String>(); String candidate = ""; //iterate o...
8
public void service() throws IOException { //由serverSocketChannel向selector注册接受连接就绪事件,如果就绪,则将SelectionKey对象加入到Selected-keys集合中 serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT); while(selector.select()>0){ Set readyKeys = selector.selectedKeys(); Iterator it = readyKeys.iterator(); while (it....
8
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 int compare(TVC o1, TVC o2) { return o2.compareTo(o1); }
0
public boolean onHandshakeRecieved(WebSocket conn, String handshake, byte[] reply) throws IOException, NoSuchAlgorithmException { // TODO: Do some parsing of the returned handshake, and close connection // (return false) if we recieved anything unexpected. if(this.draft == WebSocketDraft.DRAFT76) { if (reply =...
4
public static void readConstantsFromFile() { DataInputStream constantsStream; FileConnection constantsFile; byte[] buffer = new byte[255]; String content = ""; try { // Read everything from the file into one string. constantsFile = (FileConnection)Connector.open("file:///" + CONSTANTS_F...
9
public long getLong(String key) { Object value = get(key); try { return value instanceof Number ? ((Number) value).longValue() : Long.parseLong((String) value); } catch (Exception exception) { return 0; } }
2
protected void drawShadow(mxGraphicsCanvas2D canvas, mxCellState state, double rotation, boolean flipH, boolean flipV, mxRectangle bounds, double alpha, boolean filled) { // Requires background in generic shape for shadow, looks like only one // fillAndStroke is allowed per current path, try working around that...
3
public Block block() { Node p = this; while (p != null) { if (p instanceof Tree) { return ((Tree) p).block(); } p = p.parent; } throw new RuntimeException(this + " is not in a block"); }
2
public Password(String pass) { try { this.setKey(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } try { this.setupCipher(); } catch (InvalidKeyException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (NoSuchPaddingException e) {...
4
public ParsingResult parse(List<String> strings) { List<double[]> matrix = new ArrayList<double[]>(); strings = InputExtensions.trimAll(strings); int start = strings.lastIndexOf("OUTC|" + section); if (start == -1) { throw new RuntimeException("Corrupted ChIPMunk output detected."); } for...
7
public static int rate(Point location) { WorldHash hash = GlobalGame.worldHash; Entity ent = hash.getEntity(location); if (ent != null) { if (!ent.is_passable) { playerTarget = ent; return Priority.MEDIUM.val(); } } return P...
2
public static void main(String[] args) { System.out.println("*******1st Example******"); int[] a = new int[5];// default initialization (all 0) for (int i : a) System.out.println(i);// print the array System.out.println("*******2nd Example******"); int[] b = new int[5];// initialize array for (int i ...
6
public void drawTree(Graphics g) { g.setColor(Color.red); int halfWidth = cellWidth / 2; if (showTree) { for (Edge e : this.maze.mst) { g.drawLine(e.from.x * cellWidth - halfWidth, e.from.y * cellWidth - halfWidth, e.to....
2
@Override public void run() { int frames = 0; long previousTime = System.nanoTime(); double ns = 1000000000.0 / 60.0; double delta = 0; int updates = 0; long timer = System.currentTimeMillis(); requestFocus(); //this is awesome! while (running) { ...
8
public static String parse(String startMonth, String startYear, String endMonth, String endYear, String isCurrent, String datePattern) throws ParseException { boolean current = Boolean.parseBoolean(isCurrent); SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy"); String startDateString; ...
5
public String getBookSource1to66(int book, int chapter) { StringBuilder sb = new StringBuilder(); String filename = "unv_" + TITLE_SHORT_EN_1TO66[book] + "_" + chapter + ".html"; Path file = Paths.get(CBOL_HOME + filename); Charset charset = Charset.forName("UTF-8"); try (Buffe...
2
public Jump removeJumps(FlowBlock dest) { if (dest != END_OF_METHOD) dest.predecessors.remove(this); return ((SuccessorInfo) successors.remove(dest)).jumps; }
1
public int getLastBlockChange(int x, int y) { if(chunkID < 0) { x = 15-x; } if(x < 0 || x >= blocks.length || y < 0 || y >= blocks[0].length) return 0; return blockChanges[x][y]; }
5
private void addOthers(int xGap, int yGap) { if (xGap < 20) xGap = 20; if (yGap < 20) yGap = 20; for (int x = 0; x < panel.getWidth(); x += xGap) { for (int y = 0; y < panel.getHeight(); y += yGap) { add(new Point(x, y)); } } }
4
protected Vector<Integer> fillChoices(Room R) { final Vector<Integer> choices=new Vector<Integer>(); for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--) { final Room room=R.getRoomInDir(d); final Exit exit=R.getExitInDir(d); final Exit opExit=R.getReverseExit(d); if((room!=null) &&((room.domainType(...
8
public void addClasa(Clasa cl, Node node) { NodeList childNodes = node.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node cNode = childNodes.item(i); if (cNode instanceof Element) { String content = cNode.getLastChild().getTextContent().trim(); switch (cNode.getNodeName()) { ...
6
static void doRun(Action action){ try { Var.pushThreadBindings(RT.map(RT.AGENT, action.agent)); nested.set(PersistentVector.EMPTY); Throwable error = null; try { Object oldval = action.agent.state; Object newval = action.fn.applyTo(RT.cons(action.agent.state, action.args)); action.age...
8
public ListNode mergeTwoLists(ListNode l1, ListNode l2) { if (l1 == null) return l2; if (l2 == null) return l1; ListNode mergedHead = null; if (l1.val > l2.val) { mergedHead = l2; l2 = l2.next; } else { mergedHead = l1; l1 = l1.next; } ListNode current = mergedHead; while (l1 != nu...
8
private static void improved_range_search_binary(finger_print fp, double dis, Data data) { //System.out.println(fp.id); ArrayList<Integer> lst1 = new ArrayList<Integer>(); HashMap<Integer, Integer> potent = new HashMap<Integer, Integer>(); ArrayList<Integer> lst2 = new ArrayList<Integer>(); // to be comme...
9
public void processBatch(MappedStatement ms, Statement stmt, List<Object> parameters) { ResultSet rs = null; try { rs = stmt.getGeneratedKeys(); final Configuration configuration = ms.getConfiguration(); final TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry(); ...
9
public synchronized AudioDevice createAudioDevice() throws JavaLayerException { if (!tested) { testAudioDevice(); tested = true; } try { return createAudioDeviceImpl(); } catch (Exception ex) { throw new JavaLayerException("unable to create JavaSound device: "+ex); } catch (L...
3
public boolean clickInRegion(int x1, int x2, int y1, int y2) { if (getScale() != 1) { x2 = (int) ((x2 - x1) * getScale()); x1 *= getScale(); x2 += x1; y2 = (int) ((y2 - y1) * getScale()); y1 *= getScale(); y2 += y1; x1 += Main.scaledX; x2 += Main.scaledX; y1 += Main.scaledY; y2 += Main.s...
5
public static char[] UsarComodin() throws Exception { //Buffer del diccionario que se esta usando BufferedReader Frd = new BufferedReader(new FileReader("archivos/diccionarios/"+Idioma()+".txt")); String PDiccionario; char[] nulo = "n".toCharArray(); int contador = 0; in...
9
private static void buildAndRunGui(final Alloy alloy, final String[] hn) { SwingUtilities.invokeLater(new Runnable() { // (dispatch thread code) @Override public void run() { Display display = new Display(alloy, hn, "Assignment 3: Alloy Simulation"); displ...
0
public void changeProfessor() { int actualRound = Sims_1._maingame.round; if (actualRound == 4) { lectorChanged4 = true; //shows that professor was changed on the beginning of the 2.Semester (4.Round) Sims_1._maingame.professor = (int) Math.round(Math.random() * 100 + 1); ...
6
public Set<Node> getNodesAt(Graphics2D g2, Rectangle rect) { Set<Node> nodes = new HashSet<Node>(); for (Node node : tree.getExternalNodes()) { Shape taxonLabelBound = tipLabelBounds.get(node); if (taxonLabelBound != null && g2.hit(rect, taxonLabelBound, false)) { nodes.add(node); } } for (Node n...
8
private void eating1310(int j) throws NoInputException { if (f < 5) { die3000(j); return; } do { print("Do you want to eat <b>(1)</b> poorly, <b>(2)</b> moderately or <b>(3)</b> well ?"); e = skb.inputInt(screen); if (e < 1 || e > 3) { print("Enter 1, 2, or 3, please."); break; } fina...
7
private static boolean isChildrenTree(TreeNode parent, TreeNode children) { // TODO Auto-generated method stub if(parent == null && children == null){ return true; } else if(parent == null){ return false; } else if(children == null){ return false; }else{ if(parent.data == children.data){ r...
6
public static Point pointAt( Point start, Point dir, double dist ) { if( dir.x == 0 && dir.y == 0 ){ return start; } double dirDist = Math.sqrt( dist2( 0, 0, dir.x, dir.y )); double factor = dist / dirDist; return new Point( round( start.x + factor * dir.x ), round( start.y + factor * dir.y ) ); }
2
public String showDiff(String s1, String s2) { StringBuilder diff = new StringBuilder(); String lines1[] = s1.split("\n"); String lines2[] = s2.split("\n"); diff.append("Number of lines: " + lines1.length + " vs " + lines2.length + "\n"); int min = Math.min(lines1.length, lines2.length); int countLinesDif...
3
public static String[] removeEmptyStrings(String[] data) { ArrayList<String> result = new ArrayList<String>(); for (int i = 0; i < data.length; i++) if (!data[i].equals("")) result.add(data[i]); String[] res = new String[result.size()]; result.toArray(res); return res; }
2
public static int compare(long lhs, long rhs) { return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1); }
2
public void doStep() { int i; for (i = 0; i != getPostCount(); i++) { Pin p = pins[i]; if (p.output && pins[9].value) { p.value = volts[i] > 2.5; } if (!p.output) { p.value = volts[i] > 2.5; } } e...
8
private static boolean validateMove(PGNMove move) { String strippedMove = move.getMove(); if (move.isCastle()) { return true; } else if (move.isEndGameMarked()) { return true; } else if (strippedMove.length() == MOVE_TYPE_1_LENGTH) { return strippedMove.matches(MOVE_TYPE_1_RE); } else if (stripped...
8
private boolean insertTime(Time newTime) { boolean saved = false; try { Connection conn = Dao.getConnection(); // Check that the fields are not null and that the duration is greater than 1 minute. if (newTime.isFullFilled() && newTime.getDuration() >= MINIMUM_TIME_DURATION) { int insertTime = timeDa...
5
private Component cycle(Component currentComponent, int delta) { int index = -1; loop : for (int i = 0; i < m_Components.length; i++) { Component component = m_Components[i]; for (Component c = currentComponent; c != null; c = c.getParent()) { if (component == c) { index = i; break loop; } ...
8
public static boolean deleteDirectory( File dir ) { if( dir.isDirectory() ) { String[] children = dir.list(); for( int i = 0; i < children.length; i++ ) { if( children[ i ] == "." || children[ i ] == ".." ) continue; boolean ok = delete...
5
public void draw(Graphics g){ for (int i = 0; i < 13; i++) { stripes[i].draw(g); } this.union.draw(g); for (int i = 0 ; i < this.wstars.length; i++){ for (int j = 0; j< 6; j++){ if (i%2 ==0){ this.wstars[i][j].draw(g); }else { if (j<5){ this.wstars[i][j].draw(g); } ...
5
public static void main(String[] args) { assert (args.length >= 3): "Must pass at least 3 arguments!"; String method = args[0]; // method is always the first argument String input = args[args.length-2]; // input is always 2nd last argument String output = args[args.len...
7
protected CoverTreeNode batch_insert(Integer p, int max_scale, // current // scale/level int top_scale, // max scale/level for this dataset Stack<DistanceNode> point_set, // set of points that are nearer to p ...
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; FeatureNode other = (FeatureNode)obj; if (index != other.index) return false; if (Double.doubleToLongBits(value) ...
5
@Override public void keyTyped(KeyEvent arg0) { // TODO Auto-generated method stub }
0
public void addCharacter(Character c){ if (hasCharacter()){ throw new UnsupportedOperationException("Can't add character to tile - there already is one"); } if (c instanceof Player){ setRoomAsVisited(); } character = c; setChanged(); notifyObservers(); }
2
@Override public boolean wipeTable(String table) throws MalformedURLException, InstantiationException, IllegalAccessException { //Connection connection = null; Statement statement = null; String query = null; try { if (!this.checkTable(table)) { this.write...
3
private void setupMouseListener( final IMouseListener mouseListener ) { addMouseMotionListener( new MouseMotionAdapter() { public void mouseDragged( MouseEvent e ) { Point p = e.getPoint(); onFakeMove( p ); } public void mouseMoved( MouseEven...
7
private void openBotFolderActionPerformed(ActionEvent e) { // TODO add your code here }
0
public List<Employee> getEmployeeInJoiningDateRange(String startDate, String endDate) { if (startDate == null || endDate == null) throw new IllegalArgumentException(); DateFormat df = new SimpleDateFormat("MM/dd/yyyy"); List<Employee> employeesInDate = new ArrayList<Employee>(); try { Date start = df.par...
7
public static double[][] add(double A[][], double B[][]){ if(A.length != B.length || A[0].length != B[0].length) return null; double T[][] = new double[A.length][A[0].length]; for(int i = 0; i<T.length; i++){ for(int j = 0; j<T[0].length; j++){ T[i][j] = A[i][j]+B[i][j]; } } return T; } //end ad...
4
private void bl(String label) { if (verbose) System.out.println("(Branch? " + (acc < 0 ? "YES" : "NO") + ")"); if (acc < 0) index = branches.get(label) - 1; }
3
private static String RemoveSpecialCharacters(String str) { char[] buffer = new char[str.length()]; int idx = 0; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == '.') || (c == '_')) { buffer[idx] = ...
9
@Override public String getParent(FakeFile fake) { String path = fake.getPath(); int length = path.length(), firstInPath = 0; if (getSeparatorChar() == '\\' && length > 2 && path.charAt(1) == ':') { firstInPath = 2; } int index = path.lastIndexOf(getSeparatorChar()); if (index == -1 && firstInPath > 0) ...
9
public void addNotify() { super.addNotify(); // Create BackBuffer... createBufferStrategy( 2 ); buffer = getBufferStrategy(); // Create off-screen drawing surface bi = gc.createCompatibleImage( WIDTH, HEIGHT ); if (animator == null) { try { animator = new Thread(this, "GameLoop"); animator.sta...
2
private void fireDisconnectEvent(DisconnectEvent evt) { fireClientDisconnectEvent(evt); }
0
public String[] getTerminalsOnLHS() { ArrayList list = new ArrayList(); for (int i = 0; i < myLHS.length(); i++) { char c = myLHS.charAt(i); if (ProductionChecker.isTerminal(c)) list.add(myLHS.substring(i, i + 1)); } return (String[]) list.toArray(new String[0]); }
2
public int geti(int i){ int k=i; int j; for(j =-1; k!=0 ; ){ j++; if ( !r[j] ) k--; } r[j]=true; return j+1; }
2
@Override public void setGUITreeComponentID(String id) {this.id = id;}
0
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ServletPrinter sp = null; PreparedStatement stmt = null; Connection conn = null; String nickname, password, storyId, parent, userIdstring, subject, body; String co...
9
@Override public void setReceiveQuery(IReceiveQuery receiveQuery) { this.receiveQuery = receiveQuery; }
0
private int getRand(String[] nr) { int ret = -1; int tries = 3; int rand = LangCoach.RANDOM.nextInt(nr.length + 1); for (int i = 0; i < tries; i ++) { if (rand == nr.length) break; if (nr[rand].equals("-")) { rand = LangCoach.RANDOM.nextInt(nr.length); continue; } ret = rand; ...
3
public PolicyType createPolicyType() { return new PolicyType(); }
0
protected void connect() { try { boolean received = false; for (int rounds = 0; !received && rounds < MAX_ROUNDS; ++rounds) { int transaction_id = random.nextInt(); DatagramPacket sentPacket = url.makePacket(getRawConnectMessage(transaction_id).array()); try { this.socket.send(sentPacket);...
7
private void generate(){ Queue<Integer> q = new Queue<Integer>(); for (int v = 0; v < g.V(); v++) numOfPaths[v] = -1; numOfPaths[base] = 1; q.enqueue(base); levels[base] = 0; while (!q.isEmpty()) { int v = q.dequeue(); for (int w : g.adj(v...
8
@Override public void actionPerformed(ActionEvent e) { String action = e.getActionCommand(); if (opdrCreatieView.getCategorie().getSelectedItem().toString() == "Opsomming") { opdrCreatieView.getOpsommingPanel().setVisible(true); opdrCreatieView.getMeerKeuzePanel().setVisible(false); opdrCreatieView.getRep...
4
@SuppressWarnings("unchecked") public static void main(String[] args) throws ScriptException { ScriptEngineManager manager = new ScriptEngineManager(); List<ScriptEngineFactory> factories = manager.getEngineFactories(); for (ScriptEngineFactory f : factories) { System.out.pr...
1
private void setConsoleCaretPosition() { int caretLocation = inputControl.getInputRangeStart(); if (!ignoreInput) { if (caretLocation > -1) consolePane.setCaretPosition(caretLocation); else consolePane.setCaretPosition(consoleStyledDocument.getLeng...
7
@Override public int hashCode() { int hc = 0; for (Field f : Database.getDBFields(getClass())) try { if (f.get(this) != null) hc += f.get(this).hashCode(); } catch (IllegalArgumentException e) { } catch (IllegalAccessException e...
4
public String eval(final String messageTemplate, final Object problem) { try { final JexlContext ctx = JexlHelper.createContext(); final Map<String, Object> values = new TreeMap<String, Object>(); values.put("problem", problem); ctx.setVars(values); final StringBuilder results = new StringBuilde...
8
public void destroy(String id) throws NonexistentEntityException, RollbackFailureException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); Depto depto; try { depto = em.getReference(Depto.cl...
5
private void field_codigoFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_field_codigoFocusLost if (field_codigo.isEditable() && (lab_modo.getText().equals("Alta"))){ if ((evt.getOppositeComponent()!=null)&&(!evt.getOppositeComponent().equals(btn_cancelar))){ if (!field_co...
6
private static boolean isInteger(String s) { if (s == null || s.length() == 0) { return false; } char c = s.charAt(0); if (s.length() == 1) { return c >= '0' && c <= '9'; } return (c == '-' || c >= '0' && c <= '9') && onlyDigits(s.substring(1)); ...
7
public String getFechaRecogida() { return fechaRecogida; }
0
public void checkForHardLinks() { List<SceneNode> sectors = getAllRegionsAsList(masterSector); int shouldBeSix = Direction.values().length; for (SceneNode s1 : sectors) { if ( !( s1 instanceof Sector ) ) { continue; } for ( int c = 0; c < shouldBeSix; ++c ) { ((Sector)s1).links[ c ] = ...
6
public double rawPersonMean(int index){ if(!this.dataPreprocessed)this.preprocessData(); if(index<1 || index>this.nPersons)throw new IllegalArgumentException("The person index, " + index + ", must lie between 1 and the number of persons," + this.nPersons + ", inclusive"); if(!this.variancesCalcu...
4
public BagAttribute(URI type, Collection bag) { super(type); if (type == null) throw new IllegalArgumentException("Bags require a non-null " + "type be provided"); // see if the bag is empty/null if ((bag == null) || (bag.size(...
6
public void addPathFromRoot(List<String> pathFromRoot){ String[] newPathFromRoot = new String[pathFromRoot.size()]; int i=0; for (String idRef: pathFromRoot) { newPathFromRoot[i] = idRef; i++; } pathsFromRoot.add(newPathFromRoot); }
1
public void addItem(final StockItem stockItem) { try { StockItem item = getItemById(stockItem.getId()); item.setQuantity(item.getQuantity() + stockItem.getQuantity()); log.debug("Found existing item " + stockItem.getName() + " increased quantity by " + stockItem.getQuantity()); } catch (NoSuchElemen...
1