text
stringlengths
14
410k
label
int32
0
9
public void onEnable() { this.file = new File(getDataFolder(), "config.yml"); ruChat.cfg = YamlConfiguration.loadConfiguration(file); this.loadCfg(); ruChat.modes = new HashMap<Player, ChatMode>(); this.log = Logger.getLogger("Minecraft"); this.plugin = getServer().getPlu...
2
private void registerService() throws Exception { ServiceManager .getServices() .initializeServices(new Object[] { new TestRailwayRepository(), new TestTicketPoolManager()}); }
0
public static void main(String[] args) { if (args.length < 1) { System.out.println("Usage: java Parser [input]"); System.exit(0); } Parser p = new Parser(args[0]); }
1
@RequestMapping(value = "/saveCustomer", method = RequestMethod.POST) public String saveCustomer(@ModelAttribute("customer") Customer customer, BindingResult result) { System.out.println("customer id:" + customer.getCustomerId()+ "name" + customer.getName()); if (customer.getCustomerId() == null) ...
1
@Override public void delete(Staff obj) { PreparedStatement pst = null; try { pst = this.connect().prepareStatement("DELETE FROM Staff where id=?;"); pst.setInt(1, obj.getId()); pst.executeUpdate(); System.out.println("suppression...
3
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NeuronPair that = (NeuronPair) o; if (n2.equals(that.n2) && n1.equals(that.n1)) return true; if (n2.equals(that.n1) && n1.equals(that.n2)) retur...
7
* @return True, if the contents of this statement list changed. */ public boolean removeAll(final Collection c) { boolean changed = false; if (c == this) { changed = size() > 0; clear(); } else { final Iterator iter = c.iterator(); while (iter.hasNext()) { changed = remove(iter.next...
3
public int getSearchNumLinks() { return _searchNumLinks; }
0
@Before public void setUp(){ d = new DataArrays<int[]>(); for(int i = 0; i<5; i++){ int[] a = new int[10]; Arrays.fill(a, i); d.addToKit(a); } }
1
public void filtroClientes(String dni, String apellidoPaterno, String apellidoMaterno, String nombre, String email, String telefono, String celular, String fechaContacto) { // Busqueda secuencial por strings falta comparar mas campos. for(Cliente cliente : clientes) { if(clie...
5
public void placeNumbers(BoardModel boardModel) { for (Cell[] cells : boardModel.getBoard()) { for (Cell cell : cells) { cell.setContent(checkNeighborsForMines(boardModel, cell.getPosition())); } } }
2
public void move() { Random generator = new Random(); double a = generator.nextDouble(); if (a < 0.25) { xCoordinate -= 25; if (isOutOfBounds()) { xCoordinate += 25; } } else if (a < 0.5) { xCoordinate += 25; if ...
8
public static Config readDefaultArchive() throws ZipException, IOException, JSONException { loadNetworkShapes(); Config c = new Config(new JSONObject(new JSONTokener(new InputStreamReader(NetworkIO.class.getResourceAsStream("data/source.json"), "UTF-8")))); HashSet<String> taken = new HashSet<String>(); for (Co...
6
public static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double) o).isInfinite() || ((Double) o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers."); ...
7
public Object[][] getData() { try { MCQ_DAO mcq_DAO = new MCQ_DAO(); FIB_DAO fib_DAO = new FIB_DAO(); Essay_DAO essay_DAO = new Essay_DAO(); //get question //get question ArrayList<MCQ> mcqs = mcq_DAO.getList("question_ID not in (select que...
5
private boolean isAuthenticated(HttpServletRequest paramHttpServletRequest) { Object result = paramHttpServletRequest.getSession().getAttribute(SESSION_ATTR_IS_AUTHENTICATED); if (result != null) { return (Boolean)result; } return false; }
1
public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); System.out.println("Value of n is"+n); for (int count=0;count<n;count++){ for(int i=n-1;i>count;i--){ System.out.print(" "); } for(int j=0;j<=...
3
public static void sortNumBubble(int[] num) { int j; boolean flag = true; // set flag to true to begin first pass int temp; //holding variable while(flag) { flag = false; //set flag to false awaiting a possible swap for(j = 0; j < num.length -...
3
public static void main(String[] args) { HashMap map = new HashMap(); map.put("a","zhangsan"); map.put("b","zhangsan"); System.out.println(map); System.out.println("-------------"); String str = new String("lisi"); map.put("a",str); map.put("b",str); System.out.println(map); }
0
public void focusGained(FocusEvent e) { JTextField textField = (JTextField)e.getComponent(); String text = textField.getText(); double value; try { NumberFormat format = NumberFormat.getInstance(Locale.getDefault()); Number number = format.parse(text.toString().trim()); value = number.doubleValue()...
3
public void startMinecraft(String player, String server, String mppass, int port, String skinServer, boolean fullscreen) { // Set up Minecraft instance MCraftApplet applet = new MCraftApplet(); MinecraftCanvas canvas = new MinecraftCanvas(); minecraft = new Minecraft(canvas, applet, ful...
7
public static void cleanUp() throws IncorrectUsageException { Throwable t = new Throwable(); StackTraceElement[] elements = t.getStackTrace(); String className = elements[1].getClassName(); String methodName = elements[1].getMethodName(); //@formatter:off if (!className.e...
2
@Override protected int drawUnselectedText(final Graphics g, int x, int y, int p0, int p1) throws BadLocationException { // Copied, with a few changes final Font boldFont = g.getFont().deriveFont(Font.BOLD); final Font plainFont = g.getFont().d...
7
public void dumpInstruction(TabbedPrintWriter writer) throws java.io.IOException { writer.print("return"); if (instr != null) { writer.print(" "); instr.dumpExpression(writer.IMPL_PAREN, writer); } writer.println(";"); }
1
private static List<Temporal> generateTemporalSegments(Collection<Long> timestamps, Collection<Long> instances) { List<Temporal> segments = new ArrayList<Temporal>(); if (null == timestamps) return segments; if (null == instances) instances = new TreeSet<Long>(); int c = 0; long timeIntervalStart = 0; for (...
5
public static void registerDirectory(File directory) { // ensures that the specified File is a directory and that it isn't // currently registered if (directory.isDirectory() && !registeredDirectories.contains(directory)) { if (!running) start(); ...
7
public boolean removeUser(String firstName, String lastName, String concordiaID){ int index = 0; for(ConcordiaMembers member: concordiaMembers){ if(member!=null){ if(member.getFirstName().equals(firstName) && member.getLastName().equals(lastName) && member.getConcordiaID().equals(concordiaID)){ conc...
5
@Override public Car driverCar() { return new BmwCar(); }
0
public Piece computeNextRotation() { // arraylist of TPoints to hold the rotated blocks TPoint[] rotatedPts = new TPoint[body.length]; for (int i = 0; i < body.length; i++) { int x = body[i].x; int y = body[i].y; // apply CC rotation matrix to [x, y] vector: R = [0 -1; 1 0] int x_p = x * 0 + y * (...
5
public static String getCoastlineCoding(Game game, Position center) { char[] coding = {'0','0','0','0' }; int row = center.getRow(), col = center.getColumn(); Position p; int offsetRow[] = { -1,0,+1,0 }; int offsetCol[] = { 0,+1,0,-1 }; // iterate over the four compas directions // for...
6
public Object nextValue() throws JSONException { char c = this.nextClean(); String string; switch (c) { case '"': case '\'': return this.nextString(c); case '{': this.back(); return new JSONObject(this); ...
7
public final static void evaluateStats() { logger.info( "[ " + System.currentTimeMillis() + " ] evaluating stats on " + stats.name + " ..." ) ; sentenceMap.entrySet().stream().parallel().map((entry) -> entry.getValue()).forEach((s) -> { final int _tokenCount = s.tokens.length; st...
9
@EventHandler(priority = EventPriority.HIGHEST) public void onBlockDamage(BlockDamageEvent event) { Sign sign; if (!event.isCancelled() && event.getBlock() != null && (event.getBlock().getType() == Material.WALL_SIGN || event .getBlock().getType() == Material.SIGN_POST)) { si...
6
@Override public Visiteur getOne(Integer idVisiteur) throws DaoException { Visiteur result = null; ResultSet rs = null; // préparer la requête String requete = "SELECT * FROM VISITEUR WHERE ID_VISITEUR=?"; try { PreparedStatement ps = Jdbc.getInstance().getConnexi...
2
public void drawMap() { for (int i = 0; i <= width; i++) { print(" _"); // boarder of map } print("\n"); for (int j = higth; j >= 0; j--) { print("|"); // boarder of map for (int i = 0; i <= width; i++) { if (nodes[i][j].isWalkable...
5
public User signup(String mail, String name, String username, String pass, String forumId) { for (int i = 0; i < forums.size(); i++) { if (forums.get(i).getId().equals(forumId)) return forums.get(i).signup(mail, name, username, pass); } return null; }
2
public static GUI getGUIById(String id){ for (GUI gui: Engine.getScreen().getGUILayer()){ if (gui.getId().equals(id)) return gui; } new RugieError(new Object(),"could not find a GUI with id: " + id + ", will return an empty gui").show(); return new GUI("ERROR_...
2
public boolean isTriangular(int[][] matrix){ for(int i = 0; i < matrix.length-1; i++){ for(int j = 0; j < matrix[0].length-1; j++){ if(i > j){ if(matrix[i][j] != 0){ return false; } } } ...
4
public double getTotal() { double ret = 0; if(items != null) for(Item i : items) ret += i.getCount() * i.getPrice(); return total == 0 ? ret : total; }
3
public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte) { ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks( this, par1, par2, par3ArrayOfByte, null); MinecraftForge.EVENT_BUS.post(event); if (event.getResult() == Resul...
8
public static String getPluginParams(String jarFileName) { String params = ""; try { JarFile jarFile = new JarFile(jarFileName); JarEntry je = jarFile.getJarEntry("plugin.conf"); InputStream in = jarFile.getInputStream(je); BufferedReader reader = new BufferedReader(new In...
8
public void autonomousInit() { isAuton = true; //autonMode = (String) autoChooser.getSelected(); //postMode = (String) postChooser.getSelected(); // schedule the autonomous command (example) if (autonomousCommand != null && auton == "Left") autonomousCommand.start(); else if (secondAuton != null && auto...
4
public static void copyFromTopicQueueToTopicQueue(RabbitMQRequestParams rabbitMQRequestParams) throws Exception { RabbitMQTopicQueueConsumer consumer = new RabbitMQTopicQueueConsumer( rabbitMQRequestParams.getSourceHost(), rabbitMQRequestParams.getSourcePort() , rabbitMQRequestParams.getSourceUsername(), rabb...
3
private boolean isCellOutOfField (Point adjoiningCell) { return adjoiningCell.x < 0 || adjoiningCell.y < 0 || adjoiningCell.x >= width || adjoiningCell.y >= height; }
3
private CtBehavior compileMethod(Parser p, MethodDecl md) throws CompileError { int mod = MemberResolver.getModifiers(md.getModifiers()); CtClass[] plist = gen.makeParamList(md); CtClass[] tlist = gen.makeThrowsList(md); recordParams(plist, Modifier.isStatic(mod)); md...
3
public Hashtable<String,Neo4jCluster> perform(DatasetLoader datasetHandler, Neo4jHandler neo4jHandler, double similairtyThreshold, int softClusteringThreshold) throws Exception { Hashtable<String,Neo4jCluster> clustersList = new Hashtable<String,Neo4jCluster>(); Hashtable<String, Document> docsHash = datasetHandler...
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Person other = (Person) obj; if (Double.doubleToLongBits(height) != Double .doubleToLongBits(other.height)) return false; if (id != othe...
8
public AddFile(java.awt.Frame parent, FileEntry curr, String currVersion, List<String> versions, String currCategory) { super(parent); initComponents(); if(curr!=null) { setTitle("Edit Entry"); jButton2.setText("OK"); item = curr; jTextField1.setTe...
6
public static HashMap<String, HashMap<String, Integer>> getMap(String filePath) throws Exception { HashMap<String, HashMap<String, Integer>> map = new HashMap<String, HashMap<String,Integer>>(); BufferedReader reader = filePath.toLowerCase().endsWith("gz") ? new BufferedReader(new InputStreamReader( ...
6
@Override public void findClasses() { try { InputStream inputStream = new FileInputStream(classFile); byte[] buffer = new byte[1024]; int count; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); while ((count = inputStream.read(buffer)) != -1) byteArrayOutputStream.wr...
2
public static Object escape(Object original) { if (original instanceof Character) { char u = (char) ((Character)original); int idx = "\b\t\n\f\r\"\'\\".indexOf(u); if (idx >= 0) return "\\"+"btnfr\"\'\\".charAt(idx); if (u < 32) re...
8
private boolean checkPropertyFile(File propertieFile) { boolean properFileFlag = true; Properties props = new Properties(); String reqKey = ""; boolean foundConversionPattern=false; try { FileInputStream fis = new FileInputStream(propertieFile); // read th...
9
@Override public Object getValueAt(int row, int col) { User user = (User) globalData.get(row); switch (col) { case INDEX_ID: return user.getID(); case INDEX_FIRSTNAME: return user.getFirstName(); case INDEX_LASTNAME: return user.getLastName(); case INDEX_POINTS: return user.getPoints(); ...
6
public String iterativeWay(String[] strs) { if (strs == null || strs.length == 0) return ""; StringBuilder result = new StringBuilder(); int index = 0; while (true) { if (strs[0].length() <= index) break; char global = strs[0].charAt(index); for (int i = 1; i < strs.lengt...
7
public JSONObject putOnce(String key, Object value) throws JSONException { if (key != null && value != null) { if (opt(key) != null) { throw new JSONException("Duplicate key \"" + key + "\""); } put(key, value); } return this; }
3
public static boolean startsWithIgnoreCase(String s,String w) { if (w==null) return true; if (s==null || s.length()<w.length()) return false; for (int i=0;i<w.length();i++) { char c1=s.charAt(i); char c2=w.charAt(i); ...
8
@EventHandler(priority = EventPriority.HIGHEST) private void onAdministratorCommand(PlayerCommandPreprocessEvent e) { Player sender = (Player) e.getPlayer(); if (isOpen()) { String cmd = e.getMessage().toLowerCase(); if (cmd.startsWith("/stop")) { sender.sendM...
4
public void resetId() { quizTriggerId=0; }
0
private int[] getNeighborsFor(AsciiImage img, int x, int y) { int[] neighbours = new int[9]; int current = 0; --x; --y; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { if (!img.isInsideBounds(x + i, y + j)) neighbour...
3
static double[] train(int steps) { Random rand = new Random(); double[] w = new double[28 * 28]; for (int step = 0; step < steps;) { step++; while(test(w)>0.1){ int r = rand.nextInt(5000); double[] x = I.get(r).vec; double ...
9
@Test public void testRemoveAllPreferencesClient() { List<Product> productAux = null; Product book = new Product("Book", 1234, 2.30, 100); Product table = new Product("Table", 4321, 3.00, 100); facade.addProduct(book); facade.addProduct(table); Client client1 = new Client("Diego", "111", "diego.sousa@d...
3
private Token matchNumber() { SourcePosition pos = new SourcePosition(lineNo, columnNo); StringBuilder sb = new StringBuilder(); boolean decimal = false; int character = lookAhead(1); while ((character >= '0' && character <= '9') || character == '.') { if (decimal && ...
6
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target.fetchEffect(ID())!=null) { mob.tell(target,null,null,L("<S-NAME> already <S...
8
private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked if(jButton3.isEnabled()){ jButton3.setEnabled(false); if(evt.getButton() == 1){ System.out.println("im clicked"); try{ System.out.p...
7
public static HashMap login(String userID, String password) { MessageLogger.logSecurityLoggingMessage(userID + " : LoginService -> login \r\n"); HashMap map = new HashMap(); String message = null; try{ Timestamp currdateTime = new Timestamp(Calendar.getInstance().getTime().getTime()); // for de...
9
private boolean checkField() { IPlayer player = game.getCurrentPlayer(); IField field = game.getMap().getField(player.getCoordinates()); if (field == null) { return false; } if (field.getZombie() != null) { game.setState(new FightState(window)); ...
6
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed String type = txtFieldType.getText(); lblError.setText(""); boolean dbResult = false; int capacity = -1; int planeNumber = -1; String ErrorMessage = ""; t...
8
private void initialize() { frmSearchEngine = new JFrame(); frmSearchEngine.setTitle("Search Engine"); frmSearchEngine.setBounds(100, 100, 550, 500); frmSearchEngine.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.rowWeights = new double...
7
@Override public void mouseMoved (MouseEvent e) { if (index != -1) { int newIndex = locationToIndex (e.getPoint()); if (newIndex != index) { setIndexHovered (index, false); index = newIndex; setIndexHovered (index, true); } } }
2
private static String escapeChar(char input, char usedQuote) { if (input == usedQuote) return "\\" + usedQuote; switch (input) { case '\\': return "\\\\"; case '\b': return "\\b"; case '\f': return "\\f"; case '\n': return "\\n"; case '\r': return "\\r"; case '\t': return "\\t"; ...
7
public void sendText(String text){ try { if(this.sendAllJson){ if(text.length() >= 3 && text.substring(0, 3).equals("ERR")){ text = "{\"ok\":false,\"message\":\"" + text + "\"}"; } else if(text.equals("Welcome to Bukkit, please authenticate.")){ text = "{\"ready_for_auth\":true}"; } e...
8
private void createConfigs(){ if(!jobsfile.exists()){ this.saveResource("jobs.yml", false); } saveDefaultConfig(); }
1
public void setPersonId(int personId) { this.personId = personId; }
0
private void linearize_recursive(ArrayList<LUSTree> seq, boolean use_combos){ if (card != 0){ //If getting all combinations, recurse without adding if (use_combos) linearize_recursive_single(new ArrayList(seq), use_combos); seq.add(this); } linearize_recursive_single(seq, use_combos); }
2
@Test public void addingEdgesWorks() { Vertex a = new Vertex(0); Vertex b = new Vertex(1); Edge e = new Edge(a, b); g.addVertex(a); g.addVertex(b); g.addEdge(a, b, 1); assertTrue(g.getEdges().get(0).equals(e)); }
0
private static <T extends Comparable<? super T>> void quicksort(T[] a, int lo, int hi) { if (hi <= lo) return; int i = lo; int j = hi; T partitionItem = a[lo + (hi-lo)/2]; while (i<=j) { while (isLess(a[i], partitionItem)) i++; while (isLess(partitionItem...
8
public boolean search(File file) { try { Scanner in = new Scanner(new FileInputStream(file)); boolean found = false; while (!found && in.hasNextLine()) { String line = in.nextLine(); if (line.contains(keyword)) found = true; } ...
4
public static void main (String[] arg) { // start server on port 1500 new GameServer (1500); }
0
public void accounts(MOB mob, List<String> commands) throws IOException { mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around the heavens.")); PlayerAccount theAccount = null; String oldName = null; if(commands.size()==2) { theAccount=mob.playerStats().get...
8
static public boolean openFile(Object obj) { File f = coerceFile(obj); if (f == null) { return false; } else if (WIN && f.isDirectory()) { try { Process proc = Runtime.getRuntime().exec("explorer /root," + f.getAbsolutePath()); try { ...
6
public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) { this.plugin = plugin; this.type = type; this.announce = announce; this.file = file; this.id = id; this.updateFolder = plugin.getServer().getUpdateFolder(); final File pluginFile = plugin.getDataFolder().getParentFile();...
8
@Override public String buscarDocumentoPorFechaPago(String fechapago1, String fechapago2) { ArrayList<Compra> geResult= new ArrayList<Compra>(); ArrayList<Compra> dbCompras = tablaCompras(); String result=""; Date xfechapago1; Date xfechapago2; Date f; ...
8
public static String decodeTPCI(final int tpci, final KNXAddress dst) { final int ctrl = tpci & 0xff; if ((ctrl & 0xFC) == 0) { if (dst == null) return "T-broadcast/group/ind"; if (dst.getRawAddress() == 0) return "T-broadcast"; if (dst instanceof GroupAddress) return "T-group"; return "T-i...
9
public Rational root(BigInteger r) throws NumberFormatException { /* test for overflow */ if ( r.compareTo(MAX_INT) == 1 ) throw new NumberFormatException("Root "+r.toString()+" too large.") ; if ( r.compareTo(MIN_INT) == -1 ) ...
7
public Location getAdjacentLocation(int direction) { // reduce mod 360 and round to closest multiple of 45 int adjustedDirection = (direction + HALF_RIGHT / 2) % FULL_CIRCLE; if (adjustedDirection < 0) adjustedDirection += FULL_CIRCLE; adjustedDirection = (adjustedDirect...
9
public void actionPerformed(ActionEvent e) { if (e.getSource().getClass() == MenuView.MenuButton.class) { ChangeState( (((MenuView.MenuButton)e.getSource())).getState() ); } }
1
public static void init() { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder; try { dBuilder = dbFactory.newDocumentBuilder(); doc = dBuilder.parse(Set.class.getResourceAsStream("/sets.xml")); } catch (SAXException | IOException | ParserConfigurationExce...
2
public String toString() { if (this == UNINITIALIZED_VALUE) { return "."; } else if (this == RETURNADDRESS_VALUE) { return "A"; } else if (this == REFERENCE_VALUE) { return "R"; } else { return type.getDescriptor(); } }
3
private static void put(HandTypesMap map, HandTypesKeyImpl key, HandTypesImpl value, int i, boolean flag) { final int k = i; key.setBoolean(flag); key.setInt(k); value.setBoolean(flag); value.setInt(k); int size = map.size(); map.put(key, value); if (size + 1 != map.size()) { map.p...
3
public ASTList sublist(int nth) { ASTList list = this; while (nth-- > 0) list = list.right; return list; }
1
public static void add(Quest q){ if(!isFull()) questLog.add(q); }
1
protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.enabled) { if (par1GuiButton.id < 100 && par1GuiButton instanceof GuiSmallButton) { this.options.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); ...
7
public void sort(double[] input) { int n = input.length; boolean swapped = true; for (int end = n; swapped; end--) { swapped = false; for (int i = 1; i < end; i++) { if (!Helper.less(input, i - 1, i)) { Helper.exch(input, i - 1, i); swapped = true; } } } }
3
public Color getDefaultRowForeground(int position, boolean selected, boolean active) { if (selected) { Color color = UIManager.getColor("List.selectionForeground"); //$NON-NLS-1$ if (!active) { Color background = getDefaultRowBackground(position, selected, active); boolean isBright = Colors.isBright(col...
4
public boolean validate(String str) throws Exception { if (str == "") { throw new Exception("login is not found"); } str = str.toLowerCase(); String pattern = "^[a-z][a-z0-9\\.,\\-_]{5,31}$"; // Create a Pattern object Pattern r = Pattern.compile(pattern); ...
3
public String translateStateFormula(StateFormula formula) { String translation = ""; if (!formula.isEmpty()) { for (StateLiteralClause cl : formula.getClauses()) { if (translation != "") { translation += "& ("; } else { translation = "("; } Iterator<StateLiteral> iterator = cl.getL...
8
private void textNombreKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_textNombreKeyTyped // TODO add your handling code here: if (!Character.isLetter(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()) && !Character.isWhitespace(evt.getKeyChar())) { ...
4
public void setTroup(Troop newTroup){ //we remove the territory to the old owner if the troups is not its if(troop!=null && (newTroup==null || newTroup.getFamily()!=troop.getFamily())){ troop.getFamily().removeTerritory(this); } this.troop=newTroup; if(newTroup!=null){ owner=newTroup.getFamily(); own...
6
public void messages(){ int numMessages = Integer.parseInt(outputFromServer()); System.out.println(outputFromServer()); //Show the messages that this account has received for(int i = 0; i < numMessages; i++){ System.out.println(outputFromServer()); System.out.println(outputFromServer());...
8
private void reload() throws IOException { try { Properties properties = new Properties(); File propFile = new File(PROPERTIES_NAME); if (propFile.exists()) { properties.load(new FileInputStream(propFile)); } else { InputStream propFileStream = Thread.currentThread() .getContextClassLoade...
3