text
stringlengths
14
410k
label
int32
0
9
private void addAllAttributes(String shaderText) { final String ATTRIBUTE_KEYWORD = "attrib"; int attributeStartLocation = shaderText.indexOf(ATTRIBUTE_KEYWORD); int attribNumber = 0; while(attributeStartLocation != -1) { if(!(attributeStartLocation != 0 && Character.isWhitespace(shaderText.charAt(attribu...
5
@Override public void execute(Runnable command) { if (!_shutdown.get()) { Object serializeCheck; DistributedFuture<?> distFuture = null; // If it is wrapped by our future, then we have to make sure to // check the actual callable/runnable given to us for seri...
9
private void fillInventoryPoniesPanel(SimpleEditorTab inventoryPoniesTab, final List<String> ponies) { for(String pony : ponies) { // Sorry, no Derpy allowed here if(!("Pony_Derpy".equals(pony))) { // Princess Luna needs special treatment if("Pony_Princess_Lu...
3
@Override public List<T> sort(List<T> list) { int innerIndex; // The first element starts sorted (it may move later). // Iterate one by one up the list. for (int sortedIndex = 1; sortedIndex < list.size(); sortedIndex++) { innerIndex = sortedIndex; // At each phase as we move up the list, ...
3
public static void save(HashMap<Player, Boolean> map, String path) { try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(path)); oos.writeObject(UVampires.vampires); oos.flush(); oos.close(); } catch(Exception e) { e.printStackTrace(); for (Player p : Bukkit.getServ...
3
private static void dfs(Integer startNode) { // increment SCC size sccSize ++; // mark node i as explored nodes[startNode.intValue()] = 1; // find edges with start node as tail and another node as head in G List<Integer> heads = edges.get(startNode); if(heads != null) { Iterator<Integer> headsIterat...
4
public DatabaseConfiguration(String filePath) { try { configuration = new Properties(); InputStream input = DatabaseConfiguration.class .getResourceAsStream(filePath); configuration.load(input); } catch (IOException e) { throw new RuntimeException(e); } catch (NullPointerException e) { ...
2
private int lataaPelaajanTallennustiedosto() { try { Tiedostonlukija lukija = new Tiedostonlukija("src/tasot/save.txt"); TallennuksenKasittelija kasittelija = new TallennuksenKasittelija(); return kasittelija.etsiTasonNumero(lukija.getRivit()); } catch (Exception ex) ...
1
private String getBooleanString(boolean booleanValue) { switch (format) { case ONE_ZERO: return booleanValue?"1":"0"; case TRUE_FALSE: return booleanValue?"True":"False"; case YES_NO: return booleanValue?"Yes":"No"; ...
7
public void addResult(FindReplaceResult result) { results.add(result); }
0
public void close() { button.setEnabled(true); progressBar.setValue(0); dialog.setVisible(false); }
0
public int numOnLine(Move m) { int n, row0 = m.getRow0(), col0 = m.getCol0(), row1 = m.getRow1(), col1 = m.getCol1(); if (row0 + col0 == col1 + row1) { return numPiecesDownDiag[col0 + row0 - 2]; } else if (col1 - col0 == 0) { return numPiecesCol[col0 - 1];...
3
public UDPServer(Lobby lobbyPtr, boolean broadcastServer) { this.lobbyPtr = lobbyPtr; try { if(broadcastServer) socket = new DatagramSocket(udpServerPortNb); else socket = new DatagramSocket(); } catch(Exception e) { System.out....
2
private void modifyObjectClass(SootClass cl) { // TODO Auto-generated method stub //add 'implements' relation // cl.addInterface(poolObj); //add finalizePoolObject() method /* SootMethod finalize = new SootMethod("finalizePoolObject", new ArrayList<Type>(), VoidType.v(), Modifier.PUBLIC); cl.addMethod(fin...
2
private void buy(String[] commandString, Player player) throws CommandException { if (commandString.length >= 3) { CargoEnum cargoEnum = CargoEnum.toCargoEnum(commandString[2]); if (cargoEnum != null) { Station station = player.getCurrentStar().getStation(); ...
6
public void checkObjectSpawn(int objectId, int objectX, int objectY, int face, int objectType) { if (c.distanceToPoint(objectX, objectY) > 60) return; //synchronized(c) { if(c.getOutStream() != null && c != null) { c.getOutStream().createFrame(85); c.getOutStream().writeByteC(objectY - (c.getMapRegion...
4
public byte[] serialize(int size) throws IOException { ByteArrayOutputStream ba = new ByteArrayOutputStream(size); DataOutputStream index = new DataOutputStream(ba); index.writeShort(size); index.writeShort(MAGIC); index.writeInt(nodeWeight); if (subNodes != null) { ...
8
public static void main(String[] params) { String cp = System.getProperty("java.class.path", ""); cp = cp.replace(File.pathSeparatorChar, Decompiler.altPathSeparatorChar); String bootClassPath = System.getProperty("sun.boot.class.path"); if (bootClassPath != null) cp += Decompiler.altPathSeparatorChar +...
9
@Override public X509Certificate[] getAcceptedIssuers() { if (bootstrap) { // if bootstrap accept all issuers return null; } X509Certificate[] arrayOfX509Certificate = null; String str = MyProxyLogon.getExistingTrustRootPath(); if (st...
6
public static int solve(int[] power, int minimum, boolean[] used, int total) { if (total >= minimum) return 1; int sum = 0; for (int i = 0; i < power.length; ++i) sum += solve(power, minimum, used, power[i] + total); return sum; }
2
public void run(JGraphFacade graph) { // Set the facade to be non-directed, directed graphs produce incorrect // results. Store the directed state to reset it after this method boolean directed = graph.isDirected(); graph.setDirected(false); // Allocate memory for local cached arrays vertexArray = graph.ge...
9
public void removeDataFromEntity( final long someEntityId, Class<? extends Data> someDataType ) throws NoSuchEntityException, NoSuchDataException, NoSuchDataOnEntityException { // DataCore db = _dataCenter.getDataCore(); //check...
4
public static String escapeArgument(String argument) { logger.trace("Escaping argument: " + argument); String result = argument; if (result.contains("\"")) { Matcher matcher = escapePattern.matcher(result); int longestFound = 0; while (matcher.find()) ...
4
private void addStatus(UnitStatus.Type status, int remainingDuration) { JLabel statusLabel = new JLabel(); statusLabel.setText(status.toString()+" ("+remainingDuration+")"); statusLabel.setToolTipText(status.getDescription()); if (status.isPositive()) { statusLabel.setForeground(PropertiesLoader.getColo...
1
public void sbtAlgorithm() throws Exception { if (_isFirstAgent()) { // create cpa CPA cpa = generate_CPA(); // Assign CPA this._assign(cpa); } while (!this._done) { Message msg = this._mailer.receive_msg(this._id); switch (msg.type()) { case "Stop": this._done = true; break; case ...
5
public void prettyPrint() { for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[i].length; j++) { System.out.print(matrix[i][j]); if (j < matrix[i].length - 1) { System.out.print('\t'); } else { ...
3
private void doEnum(TextScanner sc, Writer output) throws IOException { parseHeaderArgs(sc); StringBuilder cs = null; int csc = 0; if (combinedStringsLabel != null) { cs = new StringBuilder(); cs.append(" "); cs.append(vis()); cs.append("static final String "); cs...
9
public String checkString(String s) { if(new File(Main.loc + "/Saves/Shortcuts/" + s).exists()) { return "Load"; } else { return "Save"; } }
1
public void testWithField_DateTimeFieldType_int_2() { LocalDate test = new LocalDate(2004, 6, 9); try { test.withField(null, 6); fail(); } catch (IllegalArgumentException ex) {} }
1
public void test_constructor() { BaseDateTimeField field = new MockBaseDateTimeField(); assertEquals(DateTimeFieldType.secondOfMinute(), field.getType()); try { field = new MockBaseDateTimeField(null); fail(); } catch (IllegalArgumentException ex) {} }
1
public void addObject(Placeable obj) { if (isValidPositions(obj)) { allObjects.add(0, obj); if (obj.isTower()) { allTowers.add(0, (Tower) obj); setPriority(obj); } } }
2
public static String trimLeadingCharacter(String str, char leadingCharacter) { if (!hasLength(str)) { return str; } StringBuilder sb = new StringBuilder(str); while (sb.length() > 0 && sb.charAt(0) == leadingCharacter) { sb.deleteCharAt(0); } return sb.toString(); ...
3
public String getNextStationName(int ID){ Block b; if(getLineColor() == 0) b = trackObject.getBlock((int)trainDistRed[ID-1][2]); else b = trackObject.getBlock((int)trainDistGreen[ID-1][2]); Block s, next; ...
5
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int numOfCases = sc.nextInt(); for(int i = 0; i < numOfCases;i++) { //Calculate the various variables we need int numerator = sc.nextInt(); int denominator = sc.nextInt(); int wholeValue = numerator / denominator; int...
4
@Override public boolean MoveDown() { undodata.addLast(dataClone()); undoscore.addLast(scoreClone()); initFlag(); win = false; noMoreMoves = false; boolean flag = true; int count = 0; while (flag == true) { flag = false; for(int i=N-2; i>-1; i--) { for(int j=0; j<N; j++) { if (d...
9
public String[] getOptions() { String [] options = new String [11]; int current = 0; if (!getResultsetKeyColumns().getRanges().equals("")) { options[current++] = "-G"; options[current++] = getResultsetKeyColumns().getRanges(); } if (!getDatasetKeyColumns().getRanges().equals("")) { ...
8
public void reloadPlayerInventoryConfig() { if (playerInventoryConfigFile == null) { playerInventoryConfigFile = new File(getDataFolder(), "PlayerInventory.yml"); } playerInventoryConfig = YamlConfiguration.loadConfiguration(playerInventoryConfigFile); // Look for defaults in t...
2
public Boolean createTable(String query) { try { if (query == null) { core.writeError("SQL Create Table query empty.", true); return false; } Statement statement = connection.createStatement(); statement.execute(query); return true; } catch (SQLException ex){ core.writeError(ex.getMessag...
2
private int fillFromStream() throws IOException { int oldVirtualSize = virtualSize; // If the physical buffer isn't full if (virtualSize < physicalSize) { // If the virtual buffer doesn't wrap if (head + virtualSize < physicalSize) { // streamIn.read may ...
3
public void launch(String[] args, String outArchive) { try ( FileOutputStream fOutStream = new FileOutputStream(new File(outArchive), false); ZipOutputStream zOutStream = new ZipOutputStream(fOutStream); ) { for (int a = 1; a <= Integer.parseInt(args[2]); a++)...
3
public Socket open() { EventThread.exec(new Runnable() { @Override public void run() { String transportName; if (Socket.this.rememberUpgrade && Socket.priorWebsocketSuccess && Socket.this.transports.contains(WebSocket.NAME)) { transport...
3
private void initialiseLabels() throws Exception { Collection<Object[]> parameterArrays = getParameterArrays(); labels = new ArrayList<String>(); for (Object[] parameterArray : parameterArrays) { String label = StringUtils.join(parameterArray, ", "); labels.add(label); ...
1
public int min(int hori, int verti, int dia) { if (hori <= verti && hori <= dia) { return hori; } else if (verti <= hori && verti <= dia) { return verti; } else { return dia; } }
4
private Move askAlienForMove() { // Get all possible nodes for the alien final Set<Edge> allPossibleEdges = Ship.getAll(ship.getAlienNode().getCoordinates(), ship, connectedShip); // Get the adjacent nodes for the predator final Set<Edge> adjacentEdges =...
9
public static int countRoots(int[] a){ int P1 = 0; int P0 = 0; for (int i = 0; i < a.length; i++) { P1 += a[i] * 1; P0 += a[i] * ( (i==0)? 1: 0 ); } if(P0 > 1) P0 %= 2; if(P1 > 1) P1 %=2; if(P1 == 0 && P0 == 0) return 2; else if( P1 == 0 || P0 == 0 ) return 1; return 0; }
8
private int checkThreeOfAKind(int player) { int[] hand = new int[players[player].cards.size()]; int i = 0; for (int card : players[player].cards) { hand[i++] = card % 13; } int matchCount = 0; for (int j = 0; j < hand.length; j++) { for (int k = 0; k < hand.length; k++) { if (j != k) { ...
6
private long computeFileSize(File file) { if (file.isFile()) { return file.length(); } else if (file.isDirectory()) { File subs[] = file.listFiles(); long s = 0; for (int i = 0; i < subs.length; i++) { s += computeFileSize(subs[i]); ...
3
public void create(Lenguaje lenguaje) throws PreexistingEntityException, RollbackFailureException, Exception { if (lenguaje.getEmpleadoCollection() == null) { lenguaje.setEmpleadoCollection(new ArrayList<Empleado>()); } EntityManager em = null; try { em = getEntit...
7
public SymbolDigraph(String filename, String delimiter) { st = new ST<String, Integer>(); // First pass builds the index by reading strings to associate // distinct strings with an index In in = new In(filename); while (in.hasNextLine()) { String[] a = in.readLine()....
6
private void setLookAndFeel(int theme) { switch (theme) { case 0: try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception exc) { System.err.println("ERROR - Themes: M...
6
public static void javaOutputStartupUnitsToFile(StringHashTable startupht, Cons keylist) { { String classoutputfile = null; Cons startupfunctions = null; { Object old$CurrentStream$000 = Stella.$CURRENT_STREAM$.get(); try { Native.setSpecial(Stella.$CURRENT_STREAM$, null); ...
6
public int stringY(String str) { if (str == null || str.length() == 0) return 0; int y = 0; int length = str.length(); for (int i = 0; i != length; ++i) { int y0 = charY(str.charAt(i)); if (y > y0) y = y0; } return y; }
4
@Override public void setType(int id, String type) { try { connection = getConnection(); ptmt = connection.prepareStatement("UPDATE User_types SET type=? WHERE id_user=?;"); ptmt.setInt(2, id); ptmt.setString(1, type); ptmt.executeUpdate(); ...
5
public boolean equals(Object other) { if ((this == other)) return true; if ((other == null)) return false; if (!(other instanceof TOObjectPropsId)) return false; TOObjectPropsId castOther = (TOObjectPropsId) other; return (this.getObjectPropsId() == castOther.getObjectPropsId())...
5
public String bubbleSort(String a) { char[] arr = a.toCharArray(); for (int i = arr.length - 1; i > 0; i--) { for (int j = 1; j <= i; j++) { // notice if (arr[j - 1] > arr[j]) { swap(arr, j, j - 1); } } } return new String(arr); }
3
@Override public void run() { try { DataInputStream dis = new DataInputStream(connection.getInputStream()); DataOutputStream dos = new DataOutputStream(connection.getOutputStream()); PacketInHandshake handshake = PacketInHandshake.read(dis); if (handshake == ...
6
public void testKeySetAdds() { int element_count = 20; int[] keys = new int[element_count]; String[] vals = new String[element_count]; TIntObjectMap<String> map = new TIntObjectHashMap<String>(); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; ...
6
private static String generateNDigitStringNumber(Integer n) { StringBuilder sb = new StringBuilder(n); sb.append('1'); // 1 is already given so lets minus n by 1 n -= 1; for (int i = 0; i < n; i++) { sb.append('0'); } return sb.toString(); }
1
public static void onVillageChanged(String newVillage) { Coord coords = villageCoords.get(newVillage); if (coords == null) return; if (!newVillage.equals(lastVillage)) { if (newVillage.length() == 0) { lastVillage = null; // Leaving } else { ...
5
public CardEditorScreen(Card card) { this.card = card; this.setLayout(new BorderLayout()); // URL fontURL; try { // fontURL = new URL("http://www.webpagepublicity.com/free-fonts/a/Airacobra%20Condensed.ttf"); font = Font.createFont(Font.TRUETYPE_FONT, new File("Amigo.ttf")); titleFont = Font.createFont(...
4
@Override public String stateStringSubject(Rider R) { switch(rideBasis) { case Rideable.RIDEABLE_AIR: case Rideable.RIDEABLE_LAND: case Rideable.RIDEABLE_WATER: case Rideable.RIDEABLE_WAGON: return "being ridden by"; case Rideable.RIDEABLE_TABLE: case Rideable.RIDEABLE_SIT: case Rideable.RIDEABLE...
9
public String getSongElementTypeAsString() { String result = "["; switch (type) { case BREAK: result += "BREAK"; break; case BRIDGE: result += "BRIDGE"; break; case CHORUS: result += "CHORUS"; break; case INTRO: result += "INTRO"; break; case OUTRO: result += "OUTR...
6
public int nthSuperUglyNumber(int n, int[] primes) { if(n==1) return 1; int[]ugly=new int[n]; ugly[0]=1; int[] index=new int[primes.length]; Arrays.fill(index,0); for (int pointer=1; pointer<n;pointer++){ int nextValue=Integer.MAX_VALUE,nextIndex=0; ...
5
public static ArrayList<UserAccount> readUserAccounts(String filename) { File file = new File(filename); if (file.exists()) { ObjectInputStream ois = null; try { // // Read the previously stored SecretKey. /...
7
protected Field getField() { return field; }
0
public static Map<String, BufferedImage> getDataFromDirPath(String dirPath) { Map<String, BufferedImage> res = new HashMap<>(); File dir = new File(dirPath); if (dir.isDirectory()) { try { ImagesIterator imagesIterator = new ImagesIterator(dir); while (imagesIterator.hasNext()) { File imgFile = images...
3
public static ArrayList<String> winner(ArrayList<String> playerOne, ArrayList<String> playerTwo) throws NoSuchStrategyError { if(verifyPlay(playerOne.get(1)) || verifyPlay(playerTwo.get(1))) throw new NoSuchStrategyError("Strategy must be one of R,P,S"); if(playerOne.get(1)==playerTwo.get(1)) return player...
8
@Override public void stateChanged(ChangeEvent e) { switch(((JTabbedPane)e.getSource()).getSelectedIndex()){ case MY_HISTORY: if(!changed[MY_HISTORY]){ changed[MY_HISTORY] = true; } break; ...
9
private void skipDeletedPredecessors(Node<E> x) { whileActive: do { Node<E> prev = x.prev; // assert prev != null; // assert x != NEXT_TERMINATOR; // assert x != PREV_TERMINATOR; Node<E> p = prev; findActive: for (;;) { ...
9
@Override public Descriptor compile(SymbolTable syms) { Descriptor descr = null; String identName = ((IdentNode)ident).getIdentName(); if (type instanceof IdentNode) { descr = syms.descriptorFor(identName); } else if (type instanceof ArrayTypeNode || type instanceof RecordTypeN...
3
public void setFesIdPos(Integer fesIdPos) { this.fesIdPos = fesIdPos; }
0
private boolean outsideBorder(double lat, double lon) { return (Double.compare(lat, MAX_LAT) > 0 || Double.compare(lat, MIN_LAT) < 0 || Double.compare(lon, MAX_LON) > 0 || Double.compare(lon, MIN_LON) < 0); }
3
public Role getRole() { return this.role; }
0
@Override public Double getElement(int row, int column) { int index = 0; boolean elementIsZero = true; if (row == column) { return diag.get(row); } else { ArrayList<String> rowInColIndexes = colIndexes.get(column); if (rowIndexes != null && colIndexes != null && rowInColIndexes != null) { for (...
7
public Lemonade() { this.setName("Lemonade"); this.setPrice(new BigDecimal(15)); }
0
public DnDTabbedPane() { super(); final DragSourceListener dsl = new DragSourceListener() { @Override public void dragEnter(DragSourceDragEvent e) { e.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop); } @Override public void dragExit(DragSourceEvent e) { e.getDragSourceContext() ...
9
public List<List<Integer>> zigzagLevelOrderDeque(TreeNode root) { if (root == null) { return null; } List<List<Integer>> result = new ArrayList<List<Integer>>(); Deque<TreeNode> deque = new LinkedList<TreeNode>(); deque.add(null); deque.add(root); while (deque.size() > 1) { TreeNode node = ...
7
public static boolean isStandardErrorParam(String accession) { return INTENSITY_STD_ERR_SUBSAMPLE1.getAccession().equals(accession) || INTENSITY_STD_ERR_SUBSAMPLE2.getAccession().equals(accession) || INTENSITY_STD_ERR_SUBSAMPLE3.getAccession().equals(accession) || ...
7
FileVersion(final String version) { this.original = version; if (this.original == null) { this.major = null; this.minor = null; this.revision = null; this.type = null; this.build = null; return; ...
3
public HBox getActionBox() { return actionBox; }
0
private static void copyFileFromFileSystem(String sourceFileName, File target) { try { File in = new File(sourceFileName); FileChannel inChannel = new FileInputStream(in).getChannel(); FileChannel outChannel = new FileOutputStream(target).getChannel(); try { ...
5
@Override public AUTOMATON initObj() { Class<AUTOMATON> classTypeDef = getClassTypeDef(); try { return classTypeDef.getConstructor(new Class[] { Class.forName("[C"), Integer.TYPE}).newInstance(new Object[] {alphabet, 2}); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printS...
7
public static Node minimum(Node root){ while(root.left != null) root = root.left; return root; }
1
public TripDBPanel() { super (new BorderLayout ()); targetDay = Calendar.getInstance(); targetDay.setTime(new Date ()); targetDay.add(Calendar.DATE, 1); Calendar startDay = Calendar.getInstance(); startDay.setTime(MainWindow.setupData.getEventStartDate()); if (targetDay.before(startDay)) targetDay =...
3
public static void main(String[] args) { FileIO loader = new FileIO(); BoardState startState=null, endState = null; if (args.length !=3) { System.out.println("Error: Invalid command line arguments." + newLine +"Arguments should be in the form of " + "< initial puzzle state file > < goal puzzle state file...
6
void fixNeighbors(NeighborFind<T> neighborStrategy, ProxyProvider<T> proxyProvider) { Collection<T> realNeighbors = neighborStrategy.getNeighborsFor(field); this.detailedCombinations = new double[realNeighbors.size() + 1]; for (T neighbor : realNeighbors) { if (neighborStrategy.isFoundAndisMine(neighbor)) { ...
6
public MediaWiki.InterwikiPrefixes getInterwikiPrefixes() throws IOException { preferenceLock.readLock().lock(); try { MediaWiki.InterwikiPrefixes result; if ((interwikiPrefixCache != null) && ((result = interwikiPrefixCache.get()) != null)) return result; } finally { preferenceLock.readLock().unlock...
6
public void setFrozen(Configuration configuration) { ConfigurationButton button = (ConfigurationButton) configurationToButtonMap .get(configuration); if (button == null) return; if (button.state == ConfigurationButton.NORMAL) button.setState(ConfigurationButton.FREEZE); button.doClick(); }
2
@Override public void buildFloralComposition(String fileName) throws DAOException { Document doc = null; try { doc = documentBuilder.parse(fileName); Element root = doc.getDocumentElement(); NodeList cutFlowerList = root.getElementsByTagName(TagConstants.CUT_FLOWE...
7
public static void main(String[] args) throws MalformedURLException { OpenCVImageDecoder imageDecoder = new OpenCVImageDecoder(); String searchString = null; URL url = null; WebPicture picture = null; ////////////////////////////////// // BEGIN Test 1: l...
4
public void replaceBytes(int offset, int len, byte[] bytes) { byte[] removed = null; if (len>0) { removed = new byte[len]; doc.remove(offset, len, removed); } byte[] added = null; if (bytes!=null && bytes.length>0) { doc.insertBytes(offset, bytes); added = (byte[])bytes.clone(); } if (remov...
7
public void buttonP() { if(bNew.contains(Main.mse)) { Main.soundPlayer.menuKlick(); Main.Screen = "modeSelection"; Main.renderer.startRenderer = null; } else if(bLoad.contains(Main.mse)) { try { Main.soundPlayer.menuKlick(); JFileChooser chooser = new JFileChooser(); chooser.setFile...
7
private void insert(char[] a, int i, int minIndex) {// O(n)+O(n) if (minIndex > i) { char tmp = a[minIndex]; System.arraycopy(a, i, a, i + 1, minIndex - i); a[i] = tmp; } }
1
private void addValidators() { quantityoutlet.setInputVerifier(new AbstractValidator(this, quantityoutlet, "Ongeldige waarde! Verwacht formaat: x.y, groter dan 0.0") { @Override protected boolean validationCriteria(JComponent c) { if (autobox.getSelectedIndex() == 0) { ...
8
public ItemStack addToItem(ItemStack item, int enchantLevel) { ItemMeta meta = item.getItemMeta(); List<String> metaLore = meta.getLore() == null ? new ArrayList<String>() : meta.getLore(); for (String lore : metaLore) { if (lore.contains(this.enchantName)) { // Con...
7
private String getUserList() { StringBuilder sb = new StringBuilder(); for (String name : clients.keySet()) { sb.append("\n\t"); sb.append(name); } return sb.toString(); }
1
@Override public int hashCode() { int hash = 7; hash = 29 * hash + (this.type != null ? this.type.hashCode() : 0); hash = 29 * hash + (int) (this.length ^ (this.length >>> 32)); hash = 29 * hash + (int) (this.sizeof ^ (this.sizeof >>> 32)); hash = 29 * hash + (this.isCons...
3
public void actionPerformed(ActionEvent e) { if (aliens.size()==0) { ingame = false; } ArrayList ms = craft.getMissiles(); for (int i = 0; i < ms.size(); i++) { Missile m = (Missile) ms.get(i); if (m.isVisible()) m.move(); ...
5
public static Method[] getUniqueDeclaredMethods(Class<?> leafClass) throws IllegalArgumentException { final List<Method> methods = new ArrayList<Method>(32); doWithMethods(leafClass, new MethodCallback() { public void doWith(Method method) { boolean knownSignature = false; Method methodBeingOverriddenWit...
9
@Override public void actionPerformed(ActionEvent e) { if(e.getSource() == createMatrix){ createMatrix(); } else if (e.getSource() == selectMatrix){ displayMatrix(); } else if (e.getSource() == deleteMatrix){ deleteSelectedMatrix(); } else if(e.getSource() == transposeButton){ function_transpose();...
8