text
stringlengths
14
410k
label
int32
0
9
public Wizard(String password) throws IOException { // Netzwerk initialisieren LOG.debug("initializing ConnectionListener..."); cl = new ConnectionListener(Settings.getPortNumber(), password, packetqueue); LOG.debug("initializing done"); // Warten auf Start Kommando. bis dahin B...
5
public static String unobfuscatePasswd(byte[] obfuscated) { DesCipher des = new DesCipher(obfuscationKey); des.decrypt(obfuscated, 0, obfuscated, 0); int len; for (len = 0; len < 8; len++) { if (obfuscated[len] == 0) break; } char[] plain = new char[len]; for (int i = 0; i < len; i++) ...
3
public void write(int bits, int width) throws IOException { if (bits == 0 && width == 0) { return; } if (width <= 0 || width > 32) { throw new IOException("Bad write width."); } while (width > 0) { int actual = width; if (actual > t...
7
public static void main(JSONObject data) { String pr_string=""; payment = data; Service.WriteLog(payment.toString()); try { pr_string = payment.getString("params"); File fXmlFile = new File("/home/terminal/lib/print/print.xml"); DocumentBuilderFac...
7
public String encode(String plain) { int[] key_num=Cadenus.generate_order(key); // int last_digit=key_num[key_num.length-1]; char[][] trans_block=Gromark.build_trans_block(key_num,key); char[] keyed_alphabet=build_keyed_alphabet(trans_block,key_num); //int primer=get_num(key_num); //int[] num_k=generate_nu...
5
public void unloadDimension(){ current.removeFromParent(); current = null; }
0
private void string(String value) throws IOException { String[] replacements = htmlSafe ? HTML_SAFE_REPLACEMENT_CHARS : REPLACEMENT_CHARS; out.write("\""); int last = 0; int length = value.length(); for (int i = 0; i < length; i++) { char c = value.charAt(i); String replacement; if...
8
public void makeMuscles() { Mass one; Mass two; double restLength; double constant; double amplitude; NodeList nodes = myDoc.getElementsByTagName(MUSC); for (int i = 0; i < nodes.getLength(); i++) { restLength = -1; constant = 1; Node springItem = nodes.item(i); NamedNodeMap nodeMap = spring...
4
public void load(String fileLoc) { Scanner sc = null; try { File file = new File("src/res/maps/" + fileLoc); if (!file.exists()) { System.out.println("No File! " + fileLoc); return; } sc = new Scanner(file); { tileWidth = sc.nextInt(); tileHeight = sc.nextInt(); mapW...
9
public void movie(int level,int x,int y,int w,int h,char[][] board){ if(x-1>0){//can left // board[x-1][y]; movie(level+1,x-1,y,w,h,board); } if(x+1<w){//can right } if(y-1>0){//can up } if(y+1<h){//can down } }
4
public void startSimStepMode() { if (turn < 73000 && endSim == false) { year = turn / 3650; day = turn / 10; turnByDay = turn % 10; // Updates the time on the GUI time = "Turn: " + turnByDay + " Day: " + day + " Year: " + year; simGUI.setTime(time); // Colony ants take their turn first...
6
protected List<String> getHeaderBodyText(String type, List<String> text) { List<String> resultTextList = new ArrayList<String>(); boolean foundNonHeaderLine = false; int currentIndex = 0; String currentLine; while (currentIndex < text.size() && ((type.equals(G...
9
public static double chiSquareMode(int nu) { if (nu <= 0) throw new IllegalArgumentException("The degrees of freedom [nu], " + nu + ", must be greater than zero"); double mode = 0.0D; if (nu >= 2) mode = nu - 2.0D; return mode; }
2
private static void add_Iron_Dome(War war) { IronDome dome; Queue<IronDome> IronDomes = war.getIronDomes(); while (true) { dome = null; System.out.println("Enter Iron Dome ID: "); String id = scanner.next(); for (IronDome idome : IronDomes) { if (idome.getDomeId().equalsIgnoreCase(id)) { dome...
5
public static List<Integer> MergeTwoSortedLists(List<Integer> one, List<Integer> two) { List<Integer> mergedList = new ArrayList<Integer>(); int i1 = 0, i2 = 0, s1 = one.size(), s2 = two.size(); while (i1 < s1 || i2 < s2) { if (i1 < s1 && i2 < s2) { if (one.get(i1) < two.get(i2)) { mergedList.add(one....
7
private String formatTime(long millis){ String formattedTime; String hourFormat = ""; int hours = (int)(millis / 3600000); if(hours >= 1){ millis -= hours * 3600000; if(hours < 10){ hourFormat = "0" + hours; } else{ hourFormat = "" + hours; } hourFormat += ":"; } String minut...
8
public String toString(String input) { return name + calc(input); }
0
public ArrayList<String> anagrams(String[] strs) { ArrayList<String> rst = new ArrayList<String>(); Map<String, List<String>> classSet = new HashMap<String, List<String>>(); for (int i = 0; i < strs.length; i++) { String standard = getStandard(strs[i]); List<String> ele = classSet.get(standard); if (el...
5
public void addToManager(int workerId, int managerId) { boolean workerExists = false; boolean managerExists = false; Employee manager = null; for (Employee employee : staff) { if (employee.getId() == workerId) { workerExists = true; } i...
8
public VolumeID setDriveType(int n) throws ShellLinkException { if (n == DRIVE_UNKNOWN || n == DRIVE_NO_ROOT_DIR || n == DRIVE_REMOVABLE || n == DRIVE_FIXED || n == DRIVE_REMOTE || n == DRIVE_CDROM || n == DRIVE_RAMDISK) { dt = n; return this; } else throw new ShellLinkException("incorrect drive type...
7
@RequestMapping(value = {"/CuentaBancaria/id/{idCuentaBancaria}"}, method = RequestMethod.GET) public void read(HttpServletRequest httpRequest, HttpServletResponse httpServletResponse, @PathVariable("idCuentaBancaria") int idCuentaBancaria) { try { ObjectMapper jackson = new ObjectMapper(); ...
2
@Override public void add(T element) { // sorted insert LLNode<T> newNode = new LLNode<T>(element); current = head; while (current!=null){ if (current.compareTo(newNode)>0){ if (current==head){ //add to front newNode.setLink(head); head=newNode; break; } else { //add in middle...
5
public double getCurrentActivityFracComplete() { switch (this.currentStatus) { case NOT_STARTED: return 0.0; case RUNNING: case PAUSED: case CANCELLING: return this.taskMonitor.getCurrentActivityFractionComplete(); case ...
7
public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); Aplicacao aplicacao; try { aplicacao = em.getReference(Aplicaca...
9
public void countOut() { if (this.type != NodeType.INPUT) { double out = 0.0; for (int i = 0; i < getIncomingLinks().size(); i++) { out += getIncomingLinks().get(i).getWeight() * getIncomingLinks().get(i).getIn_node().getPotential(); } double newPo...
2
public void msgChannel (IRCMessage m) { // System.out.println("APP: chan"); if (m.getPrefixNick().startsWith("s-")) // server msg { int tableID = 0; String msg = m.params[1]; Scanner s = new Scanner(msg); if (s.hasNext(tablePattern)) { tableID = s.nextInt(); if ((tableID < 0) ...
8
@Override public boolean equals(Object o) { if (!(o instanceof TextureRegion)) return false; TextureRegion t = (TextureRegion) o; return file.equals(t.file) && x == t.x && y == t.y && width == t.width && height == t.height; }
5
boolean isValid() { return !(Double.isInfinite(x) || Double.isNaN(x) || Double.isInfinite(y) || Double.isNaN(y) ); }
3
public void downdload(String rep, String file){ System.out.println("Downloading file"); try{ ftp.downloadFile(rep, fileRep+file); System.out.println("File downloaded"); } catch(Exception e){ e.printStackTrace(); } }
1
public boolean findAtSW(int piece, int x, int y){ if(x==7 || y==0 || b.get(x+1,y-1)==EMPTY_PIECE) return false; else if(b.get(x+1,y-1)==piece) return true; else return findAtSW(piece,x+1,y-1); // there is an opponent } // end findAtSW
4
@Override public void setAddress(Address address) { super.setAddress(address); }
0
private void consolidate() { // Initialize array by making each entry NIL. int arraySize = ((int) Math.floor(Math.log(n) * oneOverLogPhi)) + 1; Entry array[] = new Entry[arraySize]; if (min != null) { for (Entry w : min.nodelist()) { // Find two roots x and y in the root list with the s...
8
public MyriadSocketReader(SocketReaderParameters parameters) { // read input parameters from job config this.nodePath = parameters.getDGenNodePath().getAbsolutePath(); this.outputBase = parameters.getOutputBase().getAbsolutePath(); this.datasetID = parameters.getDatasetID(); this.stage = parameters.getStage()...
5
protected void paintComponent(Graphics g) { super.paintComponent(g); if (ziel != null && player != null) { Rectangle zielRec = new Rectangle((int) ziel.getX() - 10, (int) ziel.getY() + 25, 20, 20); Rectangle playerRec = new Rectangle(spieler.playerx + 25, spieler.playery + 100, 25, 20); g.drawRec...
9
private void aceptSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptSelectActionPerformed boolean error = false; String errorString = ""; Object[] what = new Object[7]; what[0] = conectionBoolean.isSelected(); if (!userSelectData.getText().equalsIgnore...
8
public void miseAJourEtatsBateaux() { this.etatBateaux.setVisible(manuel || this._partie.isAutomatique()); this.etatBateaux.removeAll(); this.bateaux.setVisible(manuel || this._partie.isAutomatique()); this.bateaux.removeAll(); Iterator ite = this._partie.getCasesBateaux...
5
static String getModifiersText(int modifiers) { StringBuffer buf = new StringBuffer(); if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) { buf.append("Shift "); } if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) { buf.append("Ctrl "); } if ((modifiers & InputEvent.META_DOWN_MASK) != 0) { buf.app...
8
static String d(String s, String t) { int[][] b = new int[s.length()+1][t.length()+1]; for (int i = s.length() - 1; i >= 0; i--) { for (int j = t.length() - 1; j >= 0; j--) { if (s.charAt(i) == t.charAt(j)) { b[i][j] = b[i+1][j+1] + 1; } else { b[i][j] = Math.max(b[i+1][j], b[i][j+1]); }...
7
static private String getTypeFromUnit(String s){ for (int i = 0; i < weightUnits.length; i++) { if (weightUnits[i].unit.equalsIgnoreCase(s) || weightUnits[i].abrv.equalsIgnoreCase(s)) { return "weight"; } } for (int i = 0; i < volUnits.length; i++) { if (volUnits[i].unit.equalsIgnoreCase(s...
9
public boolean addUserToTopic(final String topicKey, final String userKey, final String userName, final String channelToken) throws TopicAccessException { assert topicKey != null && topicKey.trim().length() > 0...
7
public void setOption(String option, Collection values) { if (option.equals("or")) { isOr = true; matchers = (IdentifierMatcher[]) values .toArray(new IdentifierMatcher[values.size()]); } else if (option.equals("and")) { isOr = false; matchers = (IdentifierMatcher[]) values .toArray(new Identi...
2
public FileConfiguration get() { if (config == null) { reload(); } return config; }
1
public int read(int width) throws IOException { if (width == 0) { return 0; } if (width < 0 || width > 32) { throw new IOException("Bad read width."); } int result = 0; while (width > 0) { if (this.available == 0) { this...
7
public RemoteServer(final int port) { // check annotated functions LOG.info("Loading declared functions..."); Set<Method> methods = Classes.listAllAnnotatedMethods(Server.class, Function.class); methods.addAll(Classes.listAnnotatedMethods(getClass(), Function.class)); //add this one so that it is available out...
8
@Override public boolean onKeyUp(int key) { Iterator<IGameScreen> it = screens.iterator(); while(it.hasNext()) { IGameScreen screen = it.next(); if(screen.onKeyUp(key)) { return true; } } if(camera.onKeyUp(key)) { ...
3
public List<Message> DisplayAllMessagesSent (String S){ List<Message> listemsg = new ArrayList<>(); String requete = "select * from message where Sender ='"+S+"'"; try { Statement statement = MyConnection.getInstance() .createStatement(); ...
2
public static void startShell() { Listener listen = new Listener(); System.out.print(" >>"); Scanner in = new Scanner(System.in); String line = null; String response = null; Client client = null; while ((line = in.nextLine()).length() > 0) { try{ client = null; // for garbage collection if previous...
9
private boolean isDrawed(List<Point> points, Point p) { for (Point point : points) { if (p.x == point.x && p.y == point.y) { return true; } } return false; }
3
public final void setStoreNo(String storeNo) { if(storeNo.length() != 5){ throw new IllegalArgumentException(); } this.storeNo = storeNo; }
1
@Override public void testStarted(Description description) { resetCurrentFailure(); final Xpp3Dom testCase = new Xpp3Dom("testcase"); setCurrentTestCase(testCase); testCase.addChild(createTester(testerName)); testCase.addChild(createTimeStamp(new Date())); // This is ...
1
private void loadBackups() { new Thread() { @Override public void run() { DefaultListModel model = new DefaultListModel(); File backupDir = new File(System.getProperty("user.home") + "/.androidtoolkit/backups"); if (debug) ...
3
public void setShopUrl(String shopUrl) { this.shopUrl = shopUrl; }
0
public static boolean createSocket(String host, int port) { // Open socket on given host and port number try { clientSocket = new Socket(host, port); input = new BufferedReader(new InputStreamReader(System.in)); os = new PrintStream(clientSocket.getOutputStream()); is = new DataInputStream(client...
7
protected void cellsResized(Object[] cells) { if (cells != null) { mxIGraphModel model = this.getGraph().getModel(); model.beginUpdate(); try { // Finds the top-level swimlanes and adds offsets for (int i = 0; i < cells.length; i++) { if (!this.isSwimlaneIgnored(cells[i])) { ...
7
@Test public void removeTest() { final int n = 1_000; Array<Integer> seq = emptyArray(); for(int k = 0; k < n; k++) { assertEquals(k, seq.size()); for(int i = 0; i < k; i++) { final Array<Integer> seq2 = seq.remove(i); assertEquals(k - 1, seq2.size()); final Iterator<...
4
boolean isTaskStillValid(Task t) { if (t.px < px || t.px >= px + sx) return false; if (t.pz < pz || t.pz >= pz + sz) return false; return getChunk(t.px, t.pz) == beingPaintedChunk; }
4
private static void printBinaryFeature(Tagger tagger, HarvardInquirer harvardInquirer, String s) { List<TaggedToken> tagged = tagger.tokenizeAndTag(s); boolean containsHostileWord = false; boolean containsNegativeWord = false; boolean containsFailWord = false; // System.out.prin...
9
public Timestamp getOrdertimeByOrdernumber(Statement statement,String ordernumber)//根据订单号获取预定进入时间 { Timestamp result = null; sql = "select ordertime from ParkRelation where ordernumber = '" + ordernumber +"'"; try { ResultSet rs = statement.executeQuery(sql); while (rs.next()) { result = rs.getTimes...
2
public static boolean isContinuous(List<Location> l){ List<Location> copy = new ArrayList<Location>(l); sortLocation(copy); int dir = getDirection(copy); if(dir == INVALID_DIR) return false; Location prevLoc = null; for(int i=0;i<copy.size();i++){ Location curr = copy.get(i); if(prevLoc!=null){ ...
7
@Column(name = "CUE_NATURALEZA") @Id public String getCueNaturaleza() { return cueNaturaleza; }
0
public static boolean isScramble(String s1, String s2) { //if exactly the same if (s1 == s2) {return true;} int size = s1.length(); int value1 = 0; int value2 = 0; //compare if s1 and s2 contains the same chars for (int i = 0; i < size; i++) { value1 += (s1.charAt(i)) - 'a'; value2 += (s1.charAt(i) ...
8
public void add(String name, String ip, int port) { System.out.println(name + ":" + ip + ":" + port); ClientInfo a = new ClientInfo(name, ip, port); client_list.add(a); }
0
@Override public Message toMessage(Session session) throws JMSException { Message message = session.createMessage(); setMessageProperties(message); message.setJMSType(TYPE); return message; }
0
private Set<Trace> getTracesFromNode(ProcessNode node, int steps) { Set<Trace> traces = new HashSet<Trace>(); if (node instanceof EndNode || steps == 0) { Trace newTrace = new Trace(); traces.add(newTrace); return traces; } if (node instanceof ActivityNode) { return getTracesFromActivityNode((...
7
public static void enumCompareTo(opConstant constant) { System.out.println(constant); for(opConstant c : opConstant.values()) { System.out.println(constant.compareTo(c)); } }
1
private boolean isEquals(String str1, String str2, boolean ignoreCase) { if (ignoreCase) { return str1.equalsIgnoreCase(str2); } else { return str1.equals(str2); } }
1
private void download(final String id, final String title, final int lastRow) throws IOException, InterruptedException{ Runnable dl = new Runnable() { @Override public void run() { Result songURL = null; try { songURL = JGroovex.getSongURL(id).result; } catch (IOException e1) { model...
8
public void processPacket(OggPacket packet) { SkeletonPacket skel = SkeletonPacketFactory.create(packet); // First packet must be the head if (packet.isBeginningOfStream()) { fishead = (SkeletonFishead)skel; } else if (skel instanceof SkeletonFisbone) { SkeletonF...
4
public Server getServer(int port) { logMessage(LOGLEVEL_TRIVIAL, "Getting server at port " + port + "."); if (servers == null || servers.isEmpty()) return null; ListIterator<Server> it = servers.listIterator(); Server desiredServer; while (it.hasNext()) { desiredServer = it.next(); if (desiredServer....
4
public boolean skipPast(String to) throws JSONException { boolean b; char c; int i; int j; int offset = 0; int length = to.length(); char[] circle = new char[length]; /* * First fill the circle buffer with as many characters as are in the ...
9
private void loadItemTypes(String fn) { String line; String parts[]; try { InputStream in = getClass().getResourceAsStream(GameController.CONFIG_DIR + fn); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String name = ""; int c...
5
public static void deleteCarte(Carte carte) { Statement stat; try { stat = ConnexionDB.getConnection().createStatement(); stat.executeUpdate("delete from carte where id_carte="+ carte.getId_carte()); } catch (SQLException e) { while (e != null) { ...
2
@Override public WriteMsg write(FileContent data) throws RemoteException, IOException, NotBoundException { masterLogger.logMessage("===>> Write '" + data.fileName + "' request"); if (!files.contains(data.fileName)) { // create new file and set meta data files.add(data.fileName); filePrimReplica.put(da...
3
public void setCell(int x, int y, boolean isAlive) { setCellAt(x, y, isAlive); }
0
public static void main(String[] args) { int i = 1234567890; float f = i; System.out.println(i - (int) f); // -46 }
0
private static void spawn() { if(numOfMonsters > 0) { switch (monsterIndex) { case 0: @SuppressWarnings("unused") WaterBalloon waterballoon = new WaterBalloon(spawnLocation.getXVector() + random.nextInt(10), spawnLocation.getYVector() + random.nextInt(10)); break; case 1: @SuppressWarnings("un...
7
public void subsetsWithDupRec(int [] num, int start, Stack<Integer> stk){ for(int i = start; i < num.length; ++i){ // if(i > start && num[i] == num[i-1]) continue; stk.push(num[i]); res.add(new ArrayList<Integer>(stk)); // start from i+1 instead of "start+1", in certain level, start won't...
3
public Builder(String tilte, String auther) { this.title = tilte; this.auther = auther; }
0
void deleteSuccess(String s) { System.out.println("deleteSuccess"); if (this.selFile.exists()) { this.result.setText("<HTML><font color='red'>Error In Deleting \" " + this.selFile.getName() + " \" " + s + "</font></html>"); } else if (!this.selFile.exists()) { this.result.setText("<HTML><font color='green'...
2
public static String getNumOS() { return numOS; }
0
public static void main(final String[] args) throws Exception { String[] colNames = null; OrderBy orderby = null; // delimited by a comma // text qualified by double quotes // ignore first record final Parser pzparser = DefaultParserFactory.getInstance().newDelimitedPars...
5
public static ArrayList<Method> getSetters(Class theClass){ Method[] methods=theClass.getMethods(); ArrayList<Method> setters = new ArrayList<Method>(); if(methods==null) return setters; for(int i=0;i<methods.length;i++){ if(isSetter(methods[i].getName())) setters.add(methods[i]); } return setters...
3
protected Dimension getLargestCellSize(Container parent, boolean isPreferred) { int ncomponents = parent.getComponentCount(); Dimension maxCellSize = new Dimension(0,0); for ( int i = 0; i < ncomponents; i++ ) { Component c = parent.getCompo...
4
public void setName( String name ) { if( name == null ) throw new IllegalArgumentException( "name must not be null" ); this.name = name; }
1
public static List<TerritoireCase> createTerritoires(int nbPlayer) { List<TerritoireCase> terris = new LinkedList<TerritoireCase>(); try { // Creation des territoires PreparedStatement ps = conn.prepareStatement("SELECT * FROM territoire WHERE plateau = ?"); ps.setInt(1, nbPlayer); ResultSet rs =...
6
public void reproduction() { Stack<Case> casePossible = new Stack<>(); for (int x = Math.max(0, conteneur.getX() - famille.getSpecs().getPorteSpore()); x < Math.min(conteneur.getX() + famille.getSpecs().getPorteSpore(), conteneur.getContainer().getPlateau().length); x++) { for (int y = Math....
9
public void setEditBrush(int b){ brushtype = b; switch(brushtype){ // 1x1 case 1: sigmund = new onebrush(); break; //2x2 case 2: sigmund = new twobrush(); break; //3x3 case 3: sigmund = new threebrush(); break; //Glider case 4: sigmund = new gliderbrush();...
7
@Override public Processo updateProcesso(Processo newProc,Processo oldProc) throws Exception{ if(oldProc.getSituacao() == 0){ ColTramite colTramite = new ColTramite(); TramiteProcesso tramite = new TramiteProcesso(); tramite = colTramite.retrieveTramiteProcesso(oldProc.getDtAbertura()); if(tramit...
3
@Override public int hashCode() { int result = (int) (driverId ^ (driverId >>> 32)); result = 31 * result + (firstName != null ? firstName.hashCode() : 0); result = 31 * result + (lastName != null ? lastName.hashCode() : 0); result = 31 * result + (autoPlate != null ? autoPlate.hashC...
5
public EDTView(SingleFrameApplication app) { super(app); initComponents(); init(); this.donner1.setVisible(false); // status bar initialization - message timeout, idle icon and busy animation, etc ResourceMap resourceMap = getResourceMap(); int messageTimeout = ...
7
public AbstractBeanTreeNode generateNewDefaultArrayElementNode() { if (null == this.children) { this.children = new Vector<AbstractBeanTreeNode>(); } AbstractBeanTreeNode arrayChildNode = null; Class<?> componentType = this.getObjType().getComponentType(); Object arr...
8
public ProtocolKeepAlive(String username, String status) { mUserName = username; mStatus = status; }
0
public static void deleteRecursive(File dir) { if(dir.exists() && dir.isDirectory()) { for(File f : dir.listFiles()) { if(f.isDirectory()) { deleteRecursive(f); } else { f.delete(); } } } }
4
private int arg_list(String funcdef){ tokenActual = analizadorLexico.consumirToken(); Simbolo simb = analizadorSemantico.tablaDeSimbolos.obtenerSimbolo(funcdef, GLOBAL_SCOPE); int numParams; if(simb!=null){ if(simb.existePropiedad("numparams")){ numParams = In...
8
public boolean evaluateInput(MachineInput machineInput) { if(inputAdapter==null) { throw new IllegalStateException("No InputAdapter specified prior to calling evaluateInput()"); } boolean inputIgnored = false; inputAdapter.queueInput(machineInput); while(inputAdapter.hasNext()) { TransitionInput transi...
9
@Override public void validate() { if (uname == null) { addActionError("Please Enter User Name"); } if (email == null) { addActionError("Please Enter Email Address"); } if (pwd == null) { addActionError("Please Enter Password"); ...
6
public void update() { time++; if(time % (random.nextInt(50) + 30) == 0) { xa = random.nextInt(3) - 1; ya = random.nextInt(3) - 1; if(random.nextInt(4) == 0){ xa = 0; ya = 0; } } if(walking) animSprite.update(); else animSprite.setFrame(0); if (ya < 0) { animSprite = up; dir = Dire...
9
public void setServiceDate(String serviceDate) { this.serviceDate = serviceDate; setDirty(); }
0
@Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { // In this case, we use the instance of an event to trigger // the initial filling of the deck with cards, since, once // this object is capable of handling events, it must already // be "in the world" and ready to receive cards...
8
public void validate(Secao secao){ if (secao == null || secao.equals("")){ throw new SaveException("Seção não pode ser vazia."); } else { if(secao.getNome() == null || secao.getNome().equals("")){ throw new SaveException("Nome da seção não pode ser vazio."); ...
4