text
stringlengths
14
410k
label
int32
0
9
private void remplirTournee(List<NoeudItineraire> noeuds) { int indexNoeuds = 0; //Entrepot List<Troncon> tronconsEntrepot = plan.getCheminlePlusCourt(noeuds.get(indexNoeuds).adresse,noeuds.get(indexNoeuds+1).adresse); indexNoeuds++; Trajet trajetEntrepot = new Trajet(tronconsEntrepot); entrepot.setTrajet(t...
3
@Test public void testWriteWriteDeadlock() throws Exception { System.out.println("testWriteWriteDeadlock constructing deadlock:"); LockGrabber lg1Write0 = startGrabber(tid1, p0, Permissions.READ_WRITE); LockGrabber lg2Write1 = startGrabber(tid2, p1, Permissions.READ_WRITE); // allow initial write lock...
8
private void appendRow(StringBuilder sb, Puzzle p, int r) { sb.append("|"); for (int c = 0; c < p.getSide(); c++) { if (c > 0 && c % p.getBoxSize() == 0) { sb.append(" |"); } sb.append(" "); sb.append(p.getValue(c + r * p.getSide())); } sb.append(" |\n"); }
3
@Override public boolean fill() throws IOException { boolean changed = false; BufferedReader reader = new BufferedReader(new FileReader(filePath)); while (reader.ready()) { String line = reader.readLine(); if (line == null) { break; } ...
9
@Override public Block.ExitStatus evaluate(IdentifierMap values) { for (int i = 0; i < conditions.size(); i++) { Value conditionValue = conditions.get(i).evaluate(values); if (conditionValue instanceof BooleanValue) { if (conditionValue == BooleanValue.TRUE) { if (blocks.get(i) == null) ...
7
public FTPFile parse(String serverString, String parentDirectory) throws ParseException { if(serverString.charAt(0) != '+') throw new ParseException("Not an EPLF LIST response (no '+' on line start)",0); serverString = serverString.substring(1); StringTokenizer st = new StringTokenizer(serverString,","); ...
8
public AlgorithmIdentifierType createAlgorithmIdentifierType() { return new AlgorithmIdentifierType(); }
0
private boolean endOfTerms(String ch, int i) { boolean end = true; char tabChar[] = ch.toCharArray(); for (int j = i + 1; j < ch.length(); j++) { if (tabChar[j] == '1' || tabChar[j] == '0') { end = false; break; } } return end; }
3
public void CheckChatHistory(String currentUser) { String path = "resources/"; String files; File folder = new File(path); File[] listOfFiles = folder.listFiles(); //list all the files for (int i = 0; i < listOfFiles.length; i++) { //check if it ...
7
public boolean checkCollision(BallModel ball) { if (ball.getPosX() + ball.getDiameter()/2 > this.getPaddleX() && ball.getPosX() + ball.getDiameter()/2 < this.getPaddleX() + this.getPaddleWidth() && ball.getPosY() > this.getPaddleY() && ball.getPosY() < this.getPaddleY() + this.getPaddleHeight()) ...
6
private Object select(PreparedStatement st, Class ret) throws SQLException { ResultSet result = st.executeQuery(); boolean castToArray = false; if (ret.isArray()) { ret = ret.getComponentType(); castToArray = true; } Mapper retMapper = Mapper.Registry.get(...
7
private void checkEvictionOrder(boolean lifo) throws Exception { SimpleFactory<Integer> factory = new SimpleFactory<Integer>(); GenericKeyedObjectPool<Integer, String> pool = new GenericKeyedObjectPool<Integer, String>(factory); pool.setNumTestsPerEvictionRun(2); pool.setMinEvictableIdle...
9
public String toString(){ String toRet="\n"; toRet+= ("\n 0 1 2 3 4\t 0 1 2 3 4"); for (int row = 0; row < 5; row++) { String rowStr = row + " "; for (int col = 0; col < 5; col++) { rowStr += board[row][col] + " "; } rowStr += "\t" + row + " "; for (int col = 0; col < 5; col++) { switch (...
8
protected void engineSetMode(String modeName) throws NoSuchAlgorithmException { if (modeName.length() >= 3 && modeName.substring(0, 3).equalsIgnoreCase("CFB")) { if (modeName.length() > 3) { try { int bs = Integer.parseInt(modeName.substring(3)); attr...
5
public Integer[] nextIntegerArray() throws Exception { String[] line = reader.readLine().trim().split(" "); Integer[] out = new Integer[line.length]; for (int i = 0; i < line.length; i++) { out[i] = Integer.valueOf(line[i]); } return out; ...
1
public static int startsWith(String text, String match) { return StringTools.startsWith(text, match); }
0
public void selectedChanged(GameContext context, String message) { if (context.getSelectedTower() == null) { return; } URL imageURL = this.getClass().getClassLoader().getResource("com/creeptd/client/resources/panel"); // show SelectTowerInfoPanel if (message.equals("t...
9
public FlowBlock getNextFlowBlock(StructuredBlock subBlock) { for (int i = 0; i < caseBlocks.length - 1; i++) { if (subBlock == caseBlocks[i]) { return null; } } return getNextFlowBlock(); }
2
public void shoot() { if(btmr < -10) { int dir; int bx; if(player) if(wrld.p2.x < x) dir = 0; else dir = 1; else if(wrld.p1.x < x) dir = 0; else dir = 1; if(dir == 0) bx = -13; else bx = 13; wrld.bullets.add(new Bullet(x+bx, y, dir)); btmr = 50; } }
5
private void pivot(int p, int q) { // everything but row p and column q for (int i = 0; i <= M; i++) for (int j = 0; j <= M + N; j++) if (i != p && j != q) a[i][j] -= a[p][j] * a[i][q] / a[p][q]; // zero out column q for (int i = 0; i <= M; i++) if (i != p) a[i][q] = 0.0; // scale row p ...
8
public static String getScrollBarUIClassName() { // Code switches on the platform and returns the appropriate // platform specific classname or else the default. if (isWindows()) { return "com.organic.maynard.outliner.MetalScrollBarUI"; } else { return "com.organic.maynard.outliner.BasicScrollBarUI"; } ...
1
private Instruction readInstruction(java.util.Scanner in) { Instruction inst = Instruction.ERROR; String instString = ""; //Start scanner System.out.print("Please enter a command: "); instString = in.nextLine(); instString = instString.toUpperCase(); if (instString.equals("MAKE A MOVE")) { instString...
4
public void validate_update(String dataBaseName, String tableName, ArrayList<Field> entries, Field entry) { boolean flag = true; if (check_dataBase(dataBaseName)) { if (check_table(dataBaseName, tableName)) { for (Field element : entries) { if (!check_type(dataBaseName, tableName, element.g...
6
public String getSerial (int language) { try { int id = getSerialStringId (); if (id > 0) return dev.getString (id, language); } catch (IOException e) { } return null; }
2
public var_type unaryMinus() throws SyntaxError{ var_type v = new var_type(); if(v_type==keyword.ARRAY){ sntx_err("Math operations on pointers have not been implemented"); } if(isNumber()){ if(v_type == keyword.DOUBLE){ v.v_type = keyword.DOUBLE; v.value = -value.doubleValue(); } else if(...
7
public List<Map<String, Object>> findMoreResult(String sql, List<Object> params) throws SQLException { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); int index = 1; pstmt = connection.prepareStatement(sql); if (params != null && !params.isEmpty()) { for (int i = 0; i < params.size(...
6
public static boolean isTestPlanEmpty() { boolean isTestPlanEmpty = true; @SuppressWarnings("deprecation") JMeterTreeModel jMeterTreeModel = new JMeterTreeModel(new Object());// Create non-GUI version to avoid headless problems if (JMeter.isNonGUI()) { try { ...
4
public void searchLinkAndAddToList(String str, String site) { String tmp; str = str.replace(" ", ""); int start = str.indexOf("<a"); if(start >= 0){ start = str.indexOf("href=\""); if(start >= 0){ str = str.substring(start+6, str.length()); start = str.indexOf("\""); tmp = str; if(start >=...
5
public void setCap(int cap) { this.cap = cap; }
0
public boolean setInitializer(Expression expr) { if (constant != null) return constant.equals(expr); /* * This should check for isFinal(), but sadly, sometimes jikes doesn't * make a val$ field final. I don't know when, or why, so I currently * ignore isFinal. */ if (isSynthetic && (fieldName....
7
public static void backupWorld() { if(System.getProperty("os.name").contains("Windows")) { System.err.println("[WARNING] The /backup command is unimplemented under Windows systems."); return; } try { if(!(new File("backups")).isDirectory()) Runtime.getRuntime().exec("mkdir backups"); } catch(Exception e) ...
8
public void findVertexCover() { //throw new RuntimeException("You have to implement it yourself..."); //The following code skeleton may be used, but not necessarily. //settings int populationSize = 200; //??? int iterations = 1000; //??? //best chromosome Chro...
6
private void setcmp(Comparator<Buddy> cmp) { bcmp = cmp; String val = ""; if (cmp == alphacmp) val = "alpha"; if (cmp == groupcmp) val = "group"; if (cmp == statuscmp) val = "status"; Utils.setpref("buddysort", val); synchronized (buddies) { Collections.sort(buddies, bcmp); } }
3
private void testAbstractMethods(ByteMatcher matcher) { // test methods from abstract superclass assertEquals("length is one", 1, matcher.length()); assertEquals("matcher for position 0 is this", matcher, matcher.getMatcherForPosition(0)); try { matcher.getMatcherForPositio...
9
@Override public List<Integer> update(Criteria beans, Criteria criteria, GenericUpdateQuery updateGeneric, Connection conn) throws DaoQueryException { List paramList1 = new ArrayList<>(); List paramList2 = new ArrayList<>(); StringBuilder sb = new StringBuilder(UPDATE_QUERY); String ...
1
public JsonObject save() { try { JsonValue v = JsonValue.readFrom(text.getText()); if(v.isObject()) { JsonObject o = JsonObject.readFrom(text.getText()); ArrayList<String> names = new ArrayList<String>(); names.addAll(loaded.names()); for(String s: names)loaded.remove(s); for(Member m:...
6
public void stop() { isRunning = false; }
0
public void setFieldLineIndex(int fieldLineIndex) { this.fieldLineIndex = fieldLineIndex; }
0
@Override public String getGUITreeComponentID() {return this.id;}
0
public CopyMonitorStarter(String quellPfad, List<String> targetPfade, HashMap<String, Boolean> parameters) { this.quellPfad = quellPfad; this.targetPfade = targetPfade; this.parameters = parameters; try { copyMonitor = new CopyMonitor(quellPfad, targetPfade,parameters); logger.info("creating source"); ...
2
public JTextField getOutput() { return output; }
0
public static void reset() { try { prefs.clear(); } catch (BackingStoreException e) { e.printStackTrace(); } }
1
@Override public void createElection(String name, String typeID, User owner) { // Check if there is another election with the same name and typeID // and if yes, return false Collection<Election> col = electionMap.values(); Iterator<Election> it = col.iterator(); while (it.hasNext()) { DnDElection el = (D...
4
public boolean onCommand(CommandSender commandSender, Command command, String label, String[] args) { HashMap<String, Integer> commandList = new HashMap<String, Integer>(); commandList.put("buy", 0); commandList.put("donate", 1); commandList.put("purchase", 2); commandList.put("store", 3); commandList....
7
private void draw() { if (pane != null) { coords = block.getCoords(); if (pane.insertAt().x != -1) { for (Point p : coords) { pane.cell(maxFall.y + p.y, location.x + p.x).Shadow(); } } for (Point p : coords) { pane.cell(location.y + p.y, location.x + p.x).Block(block.getName()); } } ...
4
public void readPropertyFile(File file){ DocumentBuilderFactory factory; DocumentBuilder builder; Document doc; try { System.out.println("学校のニュース取得開始"); factory = DocumentBuilderFactory.newInstance(); builder = factory.newDocumentBuilder(); doc = builder.parse(file); } catch(ParserConfigurationEx...
9
public String typeToString(DataType type){ switch(type){ case FLOAT: return "double"; // insalmo is looking for 'double' not 'float' in Experiment.Setup // eventually, all references to FLOAT here and in the metaprojectdata should be replaced case STRING: return "string"; case INFILENAME: case OUTFI...
8
public double getKiihtyvyys1X() { double res = 0; if(getNappaimenTila(VASEN1)){ res -= KIIHTYVYYS; } if(getNappaimenTila(OIKEA1)){ res += KIIHTYVYYS; } return res; }
2
@SuppressWarnings("unchecked") private List<Object> processDirectives() { yamlVersion = null; tagHandles = new HashMap<String, String>(); while (scanner.checkToken(Token.ID.Directive)) { DirectiveToken token = (DirectiveToken) scanner.getToken(); if (token.getName().e...
9
public static BufferedImage loadFace(String spriteFilename) { try { return ImageIO.read(new File("Resources/Faces/" + spriteFilename)); } catch (IOException e) { System.out.println("File not found"); e.printStackTrace(); } return null; }
1
public AudioSample(final File file) throws Exception { try { this.audioInputStream = AudioSystem .getAudioInputStream(new BufferedInputStream( new FileInputStream(file))); this.format = this.audioInputStream.getFormat(); // Support only mono and stereo audio files. if (this.getNumberOfChanne...
7
public static void aggiungiPedine(int n, int b) { // aggiunge le pedine appena mangiate alla griglia menuItem2.setEnabled(true); for (int i=0, x=0; i<4 && x<b; i++) // aggiunge pedine Bianche for (int j=0; j<3 && x<b; j++, x++) PedinePC[i][j].setIcon(new ImageIcon("images/Pedine/bianca_icon....
8
public static byte[] stringToBytes(String str) { if (str == null) { return null; } char[] chars = str.toCharArray(); int len = chars.length; byte[] buf = new byte[len]; for (int i = 0; i < len; i++) { buf[i] = (byte) chars[i]; } return buf; ...
2
private int[] sizeLargestComponent(ArrayList<Node> nw){ Set<Integer> Q = new HashSet<Integer>(); ArrayList<Integer> D = new ArrayList<Integer>(); for(Node N : nw) { Q.add(N.id); } Node N; int n; int q; int r; int maxS = 0; ...
7
public void updateGame(long gameTime, Point mousePosition) { currentLevel.upDate(gameTime); Statistique.update(currentLevel, gameTime); if (currentLevel.isCompleted()) currentLevel = levels.NextLevel(); }
1
public GenericList<E> concat(GenericList<E> that) { GenericList<E> res=this; if(that!=null) { for(int i=0;i<that.size();i++) { res.add(that.list.get(i)); } return res; } else { return res; } }
2
public static void incrementalFsqCrawl(String city, double[] point, String folder, String clientId, String clientSecret, int m) throws IOException{ JsonParser parser = new JsonParser(); // Creating the grid of points around the center of the city. double[][][] grid = createGridAround(point,m); Collection<String...
9
public static double getPerfectAim(GunWave wave, State state) { double distance = wave.distanceSq(state.targetPosition); /* * If the enemy is further away then 30 turns there is no way that * perfect targeting could ever hope to work, the upper limit is * likely much much lower. */ if(distance > wave....
3
public void keyPressed(KeyEvent e) { if (!dead) { int key = e.getKeyCode(); if (key == left_key) { t.start(); direction = "LEFT"; dx = -SPEED_PISTOLERO; } else if (key == right_key) { t.start(); direction = "RIGHT"; dx = SPEED_PISTOLERO; } else if (key == up_key) { t.sta...
8
public Causa ingresoImputadoPorTeclado(){ @SuppressWarnings("resource") Scanner scanner = new Scanner (System.in); String texto; int expediente; Long dni; Causa causa = new Causa(); try { System.out.println("Agregar Imputado a Causa"); System.out.println("------------------------"); while (true)...
9
public void testSetIntoPeriod_Object8() throws Exception { MutablePeriod m = new MutablePeriod(); try { StringConverter.INSTANCE.setInto(m, "", null); fail(); } catch (IllegalArgumentException ex) {} try { StringConverter.INSTANCE.setInto(m, "...
4
private static int partion(int[] n, int start, int end) { int tmp = n[start]; while (start < end) { while (n[end] >= tmp && start < end) { end--; } if (start < end) { n[start++] = n[end]; } while (n[start] < tmp && start < end) { start++; } if (start < end) { n[end--] = n[start]...
7
public void visitIntInsn(final int opcode, final int operand) { if (opcode == SIPUSH) { minSize += 3; maxSize += 3; } else { minSize += 2; maxSize += 2; } if (mv != null) { mv.visitIntInsn(opcode, operand); } }
2
@Override protected void calcCoordinates(GraphicForm gForm, Camera camera, PhysObject3D obj) { if(camera.isFixedOrientation() && !getName().equals("Looker")) setName("Looker"); else if(!camera.isFixedOrientation() && !getName().equals("Camera")) setName("Camera"); set...
4
public void quickSort(long[] arr, int left, int right) { if (left < right) { int l = left, r = right; long x = arr[left]; while (l < r) { while (l < r && arr[r] >= x) r --; if (l < r) arr[l ++] = arr[r]; while (l < r && arr[l] <= x) l ++; if (l < r) arr[r --] = arr[l]; } arr[l] = x; ...
8
@Override public String buscarDocumentoPorFechaVencimiento(String fechaven1, String fechaven2) { ArrayList<Compra> geResult= new ArrayList<Compra>(); ArrayList<Compra> dbCompras = tablaCompras(); String result=""; Date xfechaven1; Date xfechaven2; Date f; ...
8
public void paint(Graphics2D g) { g.setFont(getFont()); String[] lines = null; if (getText().indexOf("\n") > -1) lines = getText().split("\n"); else lines = new String[] {getText()}; if (textUpdated) { maxStrWidth = 0; for (int v = 0; v < lines.length; v++) { int m = g.getFontMetrics().stringW...
6
private void killButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_killButtonActionPerformed try { logger.log(Level.INFO, "Killing process: " + selectedProcess); logger.log(Level.INFO, "ADB Output: " + adbController.executeADBCommand(true, false, deviceManager.getS...
1
protected boolean decodeFrame() throws JavaLayerException { try { AudioDevice out = audio; if (out == null) return false; Header h = bitstream.readFrame(); if (h == null) return false; // sample buffer set when decoder constructed SampleBuffer output = (SampleBuffer) decoder.decodeFrame(h, bits...
4
private void setFloatValue(final Cursor cursor, final int index, final Field field, final Object object) { final Float value = (!cursor.isNull(index) ? cursor.getFloat(index) : null); Reflection.setFieldValue(field.getName(), object, value); }
1
protected int[] transmit(int[] in) throws Exception { //*deb*/System.out.println("transmit() length: " +in.length); //IO-Warrior 56 needs special handling if (iow.getId() == AbstractIowDevice.IOW56ID) { return transmit56(in); } int length = in.length; int rem...
8
* @return the new KB subset collection term * * @throws IOException if a communications error occurs * @throws CycApiException if the Cyc server returns an error */ public CycConstant createKbSubsetCollection(String constantName, String comment) throws IOException, CycApiException { ...
1
public synchronized boolean removeChild(GuiComponent child) { boolean removed = children.remove(child); if (removed) child.deactivate(); return removed; }
1
private String useAbondVariables(String s, int frame) { if (!(model instanceof MolecularModel)) return s; MolecularModel m = (MolecularModel) model; int n = m.bends.size(); if (n <= 0) return s; int lb = s.indexOf("%abond["); int rb = s.indexOf("].", lb); int lb0 = -1; String v; int i; Angular...
8
public void mousePressed(MouseEvent event) { if (event.getSource() instanceof JButton) { JButton btn = (JButton) event.getSource(); Territory territ = map.getTerritory(btn.getName()); boolean all = (event.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK; switch (state) { case PLACE...
7
public int compare(M meeting1, M meeting2) { MeetingImpl mImpl1 = (MeetingImpl) meeting1; MeetingImpl mImpl2 = (MeetingImpl) meeting2; if(mImpl1.meetingDate.before(mImpl2.meetingDate)) { return 1; }else{ return -1; } }
1
public Hand decyrptHand(EncryptedHand hand) throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException { Hand ret = new Hand(); for (int i = 0; i < Hand.NUM_CARDS; i++) { EncryptedCard tmp = hand.data.get(i); ret.data.add(decryptCard(tmp)); } return ret; }
1
private void drawByBresenchem(Point startPoint) { List<Point> drawedPoints = new ArrayList<Point>(); startPoint.draw(); drawedPoints.add(startPoint); Point firstPoint = startPoint; Point prePoint = startPoint; Point[] points = new Point[8]; Point bigPoint = new P...
7
public String[] getTerminals() { ArrayList list = new ArrayList(); String[] rhsTerminals = getTerminalsOnRHS(); for (int k = 0; k < rhsTerminals.length; k++) { if (!list.contains(rhsTerminals[k])) { list.add(rhsTerminals[k]); } } String[] lhsTerminals = getTerminalsOnLHS(); for (int i = 0; i < lh...
4
public boolean setBlock(int par1, int par2, int par3, int par4) { if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { if (par2 < 0) { return false; } else if (par2 >= 256) { re...
6
FlowBlock getSuccessor(int start, int end) { /* search successor with smallest addr. */ Iterator keys = successors.keySet().iterator(); FlowBlock succ = null; while (keys.hasNext()) { FlowBlock fb = (FlowBlock) keys.next(); if (fb.addr < start || fb.addr >= end || fb == this) continue; if (succ == ...
6
@Override public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { PresentationReconciler reconciler = new PresentationReconciler(); // Default { RGB c = new RGB(0, 0, 0); CoffeescriptScanner scanner = new CoffeescriptScanner(colorManager); scanner.setDefaultReturnToken( n...
0
public int partitionInt(int[] data, int length, int start, int end) { // TODO Auto-generated method stub if(data == null || length <=0 || start < 0 || end >= length){ throw new IndexOutOfBoundsException("argument error!"); } Random r = new Random(); //nextInt(0,n+1) create an int in [0, n+1) == [0, n]; i...
7
public String getDest(){ return this.dest; }
0
private void postEntityFileProcessing(Employee employee) throws IOException { StringWriter stringWriter = null; String newFileName; try { stringWriter = new StringWriter(); xmlManager.marshal(employee, stringWriter); newFileName = StringUtil.concatenateStrings(employee.getEntityFileName(), ValidatorProp...
2
private void checkStraightFlush() { int suit = hand[0].getSuit(); for (int i = 0; i < 5; i++) { Card card = hand[i]; if (card.getSuit() != suit) { break; } if (card.getValue() == (13 - i)) { if (i == 4 && card.getValue() < hand[3].getValue()) { myEvaluation[0] = 9; myEvaluation[1] = ha...
5
public static boolean isArrayByteBase64( byte[] arrayOctect ) { int length = arrayOctect.length; if (length == 0) { // shouldn't a 0 length array be valid base64 data? // return false; return true; } for (int i=0; i < length; i++) {...
3
private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_aceptarActionPerformed if (lab_modo.getText().equals("Alta")){ if (camposCompletos()){ ocultar_Msj(); insertar(); menuDisponible(true); ...
9
public void addUser(String name, String pass, int accType){ Statement stmt = null; try{ //Connection conn = DriverManager.getConnection(DB_URL, dbUser, dbPass); stmt = conn.createStatement(); if(accType==0){ try{ stmt.executeUpdate("CREATE USER '"+name+"'@'localhost' IDENTIFIED BY '"+pass+"';"); ...
7
private void initialize() { frame = new JFrame("Chat Client"); frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { disconnect(); } }); frame.setBounds(100, 100, 596, 533); frame.setDefaul...
7
public void sendAudioSocks(final SocketChannel chan, final boolean join, final int channel) { Runnable runner = new Runnable() { public void run() { Getoptions opt = new Getoptions(); if(Wuuii.DEBUG) { System.out.println("Send audio byte[] buffer join="+join +" transmission=" + opt.getTransmission()...
9
public void setQuestName(String qName) { QuestName = qName; }
0
@Test public void testEquals() { try { System.out.println("equals"); Port anotherPort = new Port(80, 50, 2); Port instance = new Port(80, 50, 2); boolean expResult = true; boolean result = instance.equals(anotherPort); assertEquals(expR...
1
private void addAll(FactoryOfPlays factory) { for (AbstractPlay play : factory) bestPlays.add(play); }
1
@Override public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) { if(!enabled) getServer().getPluginManager().enablePlugin(this); if(parentGen.equals("")) return new ChunkGen(); Plugin p = getServer().getPluginManager().getPlugin(parentGen); if(p == null) { getLogger().warning("Plug...
4
public MasterServerImpl(File metaData, TreeMap<String, ReplicaLoc> nameToLocMap) throws IOException { locMap = new ConcurrentHashMap<String, ReplicaLoc[]>(); fileLock = new ConcurrentHashMap<String, Lock>(); txnID = new AtomicInteger(0); timeStamp = new AtomicInteger(0); replicaServerAddresses = new Replic...
3
public DiceImage() { try { for(int i = 0; i < activeDiceImage.length; i++) { activeDiceImage[i] = ImageIO.read(new File(getClass().getResource("resource/" + (i + 1) + ".png").toURI())); inactiveDiceImage[i] = ImageIO.read(new File(getClass().getResource("resource/" + (i + 1) + "g.png").toURI()...
3
public void clear() { fill(null); }
0
private void addTileIfOutdated(Tile tile, AtomDelta delta) { // Make sure the turf actually exists if(tile != null) { // TODO: discriminate between the different outdated types if(tile.outdated != 0) { delta.updates.add(new FullAtomUpdate(tile)); } for(Atom content : tile.contents) { if...
4
private void toNote() { ItemDefinition item = ItemDefinition.forId(certTemplateId); groundModel = item.groundModel; modelZoom = item.modelZoom; rotationY = item.rotationY; rotationX = item.rotationX; scaleInventory = item.scaleInventory; offsetX = item.offsetX; offsetY = item.offsetY; destColors = ite...
5