text
stringlengths
14
410k
label
int32
0
9
private void setUpPrettyFullBuffers(final int type, final int valueLength, boolean discontinuous) throws PersistitException { b1.init(type); b2.init(type); final boolean isData = type == Buffer.PAGE_TYPE_DATA; int a, b; // load page A with keys of increasing length ...
9
@Test public void testContactIDs() { testSetUp(); cmInst.addNewContact("new contact", "new contact notes"); Set<Contact> thisSet = cmInst.getContacts(2, 8); Set<Contact> thatSet = cmInst.getContacts("Syd"); // IDs 2 and 8 are two contacts Assert.assertEquals(2, thisSet.size()); // two contacts con...
1
public static boolean downloadPage(String path)throws HttpException,IOException{ InputStream input=null; OutputStream output=null; //õpost PostMethod postMethod=new PostMethod(path); //postIJ NameValuePair[] postData=new NameValuePair[2]; postData[0]=new NameValuePair("name","lietu"); postData[1]=n...
4
public static <T extends Number> T toNumber(Number number, Class<T> target) { if (number == null) { return null; } try { return target.getConstructor(String.class).newInstance(number.toString()); } catch (Exception e) { throw new RuntimeException(e); } }
2
public SummaryRanges() { }
0
private OutRec GetLowermostRec(OutRec outRec1, OutRec outRec2) { // work out which polygon fragment has the correct hole state ... if(outRec1.bottomPt == null) outRec1.bottomPt = GetBottomPt(outRec1.pts); if(outRec2.bottomPt == null) outRec2.bottomPt = GetBottomPt(outRec2.pts); OutPt bPt1 = outRec1.bottom...
9
public int[][] init() { int[][] binds = new int[17][9]; for (int[] row : binds) Arrays.fill(row, Engine.INVALID); for(int i = 0; i < hexList.size(); i++) { Hex h = hexList.get(i); int code = Engine.BLANK; if(i == 0 || i == 32 || i == 53 ) code = Engine.RED; else if( i == 4 || i == 25 || i ==...
8
public static void main(String[] args) { // Colection of CreditCards ArrayList<CreditCard> cards = new ArrayList<CreditCard>(); // Our CreditCard objects CreditCard card1 = new CreditCard("Madalin Ignisca", 2500); CreditCard card2 = new CreditCard("John Doe", 1400); CreditCard card3 = new CreditCard("Jane...
1
public static String getVariableThatBelongsInUsefulVariableSet( Grammar grammar, Set set) { String[] variables = grammar.getVariables(); for (int k = 0; k < variables.length; k++) { if (belongsInUsefulVariableSet(variables[k], grammar, set) && !set.contains(variables[k])) return variables[k]; } r...
3
void run(){ Scanner sc = new Scanner(System.in); h = sc.nextInt(); w = sc.nextInt(); N = sc.nextInt(); char[][] m = new char[h][], t = new char[h][w]; for(int i=0;i<h;i++)m[i]=sc.next().toCharArray(); boolean ok = false; for(int i=0;i<h&&!ok;i++)for(int j=0;j<w-1&&!ok;j++){ if(m[i][j]!=m[i][j+1]){ fo...
9
private static String guessNested(String mvcName) { StringBuffer result = new StringBuffer(mvcName.length()); char[] source = mvcName.toCharArray(); for (int i =0; i < source.length; i++) { char ch = source[i]; if (Character.isUpperCase(ch)) { // customerName -> customer.name result.append("." + Cha...
7
public Object getVariable(String name) { if(variables.containsKey(name)) { return variables.get(name); } else if(parent!=null) { return parent.getVariable(name); } else throw new RuntimeException("Variable <" + name + "> undefined"); }
2
public void display() { // Instantiate an Entry BufHTEntry cur; System.out.println("HASH Table contents :FrameNo[PageNo]"); // Interate through the Page Table array for (int i = 0; i < HTSIZE; i++) { System.out.println("Array Index: " + i); if (ht[i] != null) { // ...
3
public void add(final LocalExpr use, final Instruction inst) { final Node def = use.def(); if (def != null) { map.put(inst, def); } }
1
public void merge (int[] array, int a, int b, int x, int y, int w) { int i = a, j = x; int temp = 0; while (i<=b && j <= y) { if (array[i] < array[j]) { temp = array[i]; array[i] = array[w]; array[w] = temp; ...
5
private int evalFunctions(List<Token> formula, int offset, int length) { for (int i = offset + length - 2; i >= offset; i--) { for (Function function : Tokens.function(formula.get(i))) { if (i == offset || (!(formula.get(i - 1) instanceof NumberToken) && ...
9
public DiagnosticoFacade() { super(Diagnostico.class); }
0
private void processSuperClazzes(Class<?> clazz) { List<Class<?>> superClazzes; superClazzes = new ArrayList<Class<?>>(); while (clazz != null && clazz != this.getUpToClass()) { superClazzes.add(clazz); clazz = clazz.getSuperclass(); } for (int i = superClazzes.size() - 1; i >= ...
6
public static void main(String[] args) throws UnknownHostException, IOException { int localVersion = getLocalVersion(); if (localVersion == -1 || !InetAddress.getByName(SERVER).isReachable(5000) || (args.length > 1 && args[1].equals("ultraulf"))) { System.out.println("Starting local version."); st...
5
protected void saveFile() { List<Variable> variableList = obfuscator.getProjectVariableList(); if (variableList != null) { String fileName = saveFileDialog(); if (fileName != null) { int fileSize = McbcFileUtils.saveVariableList(fileName, variableList); MessageDialog.displayMessageDialog(this, "INFORM...
2
@Test public void validateBudgetBreakdownThrowExceptionIfNull() { Budget budget = createAnnualBudget("Annual Budget", new BigDecimal("2000")); try { calculateBudgetBreakdown.calculateBreakdown(budget, null); fail("BudgetBreakdown Object Is Null."); } catch(Exception...
1
private static Method getMethod (Class<?> clazz, String method) { for (Method m : clazz.getMethods()) { if (m.getName().equals(method)) { return m; } } return null; }
3
public static boolean checkInterrupts() { if (NMIEnable && intVBlank) { if (!Settings.isTrue(Settings.CPU_ALT_DEBUG)) { Log.debug("Running vblank handler: " + Integer.toHexString(Core.mem.get(Size.SHORT, 0, 0xFFEA))); } else { Log.instruction("*** NMI"); } stackPush(Size.BYTE, pbr.getValue())...
8
public List findByPassword(Object password) { return findByProperty(PASSWORD, password); }
0
public Metrics(final Plugin plugin) throws IOException { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); } this.plugin = plugin; // load the config configurationFile = new File(CONFIG_FILE); configuration = YamlConfiguratio...
2
private void showStorage (StringBuffer buf, boolean external) throws IOException { int temp = rio.getFreeMemory (external); MemoryStatus mem = rio.getMemoryStatus (external); // basic memory statistics buf.append ("<em>"); buf.append (external ? "SmartMedia" : "Built-in Memory"); buf.append ("</em>"); ...
4
@Override public void setBoard (Board board){ field=board; }
0
*/ private static int randomDirection() { return (int) (Math.random() * Direction.values().length); }
0
public double target(double[] x, double[][] X, int rowpos, double[] Y){ double y = Y[rowpos], result=0; for(int i=0; i < X.length; i++){ if((i != rowpos) && (X[i] != null)){ double var = (y==Y[i]) ? 0.0 : Math.sqrt((double)m_Dimension - 1); double f=0; for(int j=0; j < m_Dimension...
7
public static void loadAllAchievements() { String statement = new String("SELECT * FROM " + DBTable + " WHERE type = ?"); PreparedStatement stmt; try { stmt = DBConnection.con.prepareStatement(statement); stmt.setInt(1, QUIZ_TAKEN_TYPE); ResultSet rs = stmt.executeQuery(); while (rs.next()) { Quiz...
2
private void updateTitle(){ File file = getProgram().getFile(); String title; if (file != null){ title = file.getName(); } else { title = "Unsaved Program"; } if (getProgram().isDirty()){ title+=" *"; } setTitle("LOGO - "+title); }
2
public void setAppliedVoltage(double voltage){ this.appliedVoltage = new Complex(voltage, 0.0D); this.appliedVoltageError = new Complex(0.0D, 0.0D); this.appliedVoltageSet = true; if(this.referenceSet && this.frequenciesSet)this.calculateExperimentalImpedances(); }
2
public static String substringBeforeLast(String sourceStr, String expr) { if (isEmpty(sourceStr) || expr == null) { return sourceStr; } if (expr.length() == 0) { return sourceStr; } int pos = sourceStr.lastIndexOf(expr); if (pos == -1) { return sourceStr; } return sourceStr.substring(0, pos); ...
4
public void actionPerformed(ActionEvent e) { Grammar grammar = environment.getGrammar(); if (grammar == null) return; if (grammar.getProductions().length == 0) { JOptionPane.showMessageDialog(Universe .frameForEnvironment(environment), "The grammar should exist."); return; } // Create the i...
3
public Game build() { if (rolls_list.isEmpty()) { throw new AnyRollToPlay(); } if (player_list.size() < 2) { throw new NotEnoughtPlayersToPlay(); } return new Game(this); }
2
public static boolean nodeEquals(Node<Integer, String> a, Node<Integer, String> b) { Deque<Tuple<Node<Integer, String>, Node<Integer, String>>> nodesToVisit = new ArrayDeque<Tuple<Node<Integer, String>, Node<Integer, String>>>(); nodesToVisit.addLast(new Tuple<Node<Integer, String>, Node<Integer, ...
7
public static GUIAbsTemplate getInstance(){ switch(showGUITypeAsk()){ case 0: return GUIAbsTemplate.getChainInstance(GUIImplCommandLine.getInstance()); case 1: return GUIAbsTemplate.getChainInstance(GUIImplGPopupWindow.getInstance()); default: ...
2
private String[] getNameFromCookie(Cookie[] cookies){ String name = ""; if(cookies != null){ for (Cookie ck : cookies) { if ("CILOGON-USER_NAME".equals(ck.getName()) && !ck.getValue().equals("")) { name = (String)ck.getValue(); } } return name.split(" "); } return null; }
4
boolean validateMove(movePair movepr, Pair pr) { // This is also from dumbPlayer, and seems like something we won't have to use Point src = movepr.src; Point target = movepr.target; boolean rightposition = false; if (Math.abs(target.x-src.x)==Math.abs(pr.p) && Math.abs(target.y-src.y)==Math.abs(pr.q)) { ri...
7
public static void playSound(String path){ try { Clip clip = AudioSystem.getClip(); InputStream is = GameManager.class.getResourceAsStream(path); BufferedInputStream bIs = new BufferedInputStream(is); AudioInputStream aIs = AudioSystem.getAudioInputStream(bIs); clip.open(aIs); clip.start(); } ca...
1
private <T> T[] ensureIndex( T[] array, int index, T ... emptyArray ) { if (array == null) { array = Arrays.copyOf( emptyArray, index + 1 ); } else if (index >= array.length) { array = Arrays.copyOf( array, index + 1 ); } return array;...
2
public boolean deplacementPossible(Point2D point) { Path2D p = _bateau.boundingsPosition(point); boolean dansEau = false; boolean dansShape = false; for(Forme forme:_formes) { if(forme.getPathOriginal().intersects(p.getBounds2D())) { if (forme.getTypeForme()==...
6
private RdpPacket_Localised receiveMessage(int[] type, Options option, Rdp rdpLayer) throws IOException, RdesktopException, OrderException, CryptoException { // logger.debug("ISO.receiveMessage"); RdpPacket_Localised s = null; int length, version; next_packet: while (true) { // logger.debug("next_pack...
7
public static float[] normalize(float[] arr){ float sum = sum(arr); for (int i = 0 ; i < arr.length; i++){ arr[i] = arr[i] / sum; } return arr; }
1
@Override public void caseADeclSeDefinicaoComando(ADeclSeDefinicaoComando node) { inADeclSeDefinicaoComando(node); if(node.getSe() != null) { node.getSe().apply(this); } if(node.getLPar() != null) { node.getLPar().apply(this); } ...
9
private boolean binarySearch(int[] A, int start, int end, int target) { if (start > end) { return false; } int middle = start + (end - start) / 2; if (A[middle] == target) { return true; } // Find the correct sequenc...
9
private boolean checkLineForm(String line, int parameterNumber) { switch(parameterNumber) { case 0: if(line.indexOf(FIRST_PARAMETER) == 0) return true; else return false; case 1: if(line.indexOf(SECOND_PARAMETER) == 0) return true; else return false; default: return false; }...
4
public static long getSize(Object object) { if (object == null) { return 0; } else if (object instanceof SizeObject) { return ((SizeObject) object).getSize(); } else if (object instanceof Boolean) { return 1; } else if (object instanceof String) { ...
8
private DragSource createTableDragSource(final Table table) { DragSource dragSource = new DragSource(table, DND.DROP_MOVE | DND.DROP_COPY); dragSource.setTransfer(new Transfer[] { FileTransfer.getInstance() }); dragSource.addDragListener(new DragSourceListener() { TableItem[] dndSelection = null; String[] s...
4
static public short getCRC(byte[] buf, int len) { short i; short crc = 0x7fff; boolean isNeg = true; for(int j = 0; j < len; j++) { crc ^= buf[j] & 0xff; for (i = 0; i < 8; i++) { if ((crc & 1) == 0) { crc >>= 1; if (isNeg) { isNeg = false; crc |= 0x4000; } } else { ...
6
public ArrayList<Node> extractComponent(ArrayList<Node> in, int n){ Set<Integer> S = new HashSet<>(); ArrayList<Integer> D = new ArrayList<>(); int d; D.add(n); Node N; int p; while(!D.isEmpty()) { d = D.remove(0); S.add(d); ...
6
public FunctionalList rest() { FunctionalArrayList output = new FunctionalArrayList(); for (int i = 0; i < size(); i++) { Object currentElementValue = array[i]; output.add(currentElementValue); } output.remove(0); return output; }
1
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final Parameter that = (Parameter) obj; i...
9
protected void take(Player winner, Player loser, int amount,boolean ron) { if (amount % 100 != 0) amount = amount + 100 - (amount % 100); String claimer=winner.name; if(!winner.in || !ron){ claimer=Console.POT; } if(winner.score < 0){ if(amount+winner.score <=0){ claimer=Console.POT; } ...
5
public static List<List<Integer>> levelOrder(TreeNode root) { List<List<Integer>> res = new ArrayList<List<Integer>>(); List<TreeNode> stack = new ArrayList<TreeNode>(); int start = 0; int end = 0; if (null != root) {stack.add(root);end = 1;} while (end > start) { L...
5
public HashMap<Integer, Integer[]> countOfPassengerOnEveryStation(Train train) { log.debug("Start countOfPassengerOnEveryStation select"); List stationFrom = em.createQuery("select station.id, 0, count(ticket.id), schedule.seqNumber " + "from Train train " + "left join tr...
4
private void loadDomain(String domaine_selection) { try { ObjectInputStream input_domain = new ObjectInputStream(new FileInputStream(domaine_selection+FILE_EXTENSION)); domaine = (Domaine) input_domain.readObject(); input_domain.close(); } catch (FileNotFoundException e) { javax.swing.JOptionPane.showMe...
3
public int minX() { int m = coords[0][0]; for (int i = 0; i < 4; i++) { m = Math.min(m, coords[i][0]); } return m; }
1
@Override public void getUsernameFromUI(String username) { this.username = username; ClientFinder.init(username, interfaceName); }
0
private boolean jj_scan_token(int kind) { if (jj_scanpos == jj_lastpos) { jj_la--; if (jj_scanpos.next == null) { jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); } else { jj_lastpos = jj_scanpos = jj_scanpos.next; } } else { jj_scanpos = jj_...
9
public void print() { // prints the BigInt as a integer int len = this.length(); if(len == 0) { System.out.println("0"); return; } for(int i = len - 1; i >= 0; i--) { String zfill = ""; for(int j = power_ - 1; j > 0; j--) { if(getDigit(i).value() < (long)Math.pow(10, ...
5
private static HashMap<Integer, HashMap<Color, Integer>> createSilverMap() { HashMap<Integer, HashMap<Color, Integer>> map = new HashMap<Integer, HashMap<Color, Integer>>(); map.put(1, new HashMap<Color, Integer>()); map.get(1).put(Faction.YELLOW, 1); map.get(1).put(Faction.RED, 2); map.get(1).put(Fact...
5
private boolean r_prelude() { int among_var; int v_1; // repeat, line 36 replab0: while(true) { v_1 = cursor; lab1: do { // (, line 36 ...
8
private boolean withinBounds(int pointer, ArrayList<Rod> rodList) { int currentLength = 0; for(int i = 0; i < pointer; i++) { currentLength += rodList.get(i).getLength(); } return currentLength <= totalLength && pointer < rodList.size(); }
2
public static RelationTableInfo getRelationTableInfo(NamedDescription tablerelation) { { MemoizationTable memoTable000 = null; Cons memoizedEntry000 = null; Stella_Object memoizedValue000 = null; if (Stella.$MEMOIZATION_ENABLEDp$) { memoTable000 = ((MemoizationTable)(RDBMS.SGT_RDBMS_F_GET...
6
public QRDecomposition (Matrix A) { // Initialize. QR = A.getArrayCopy(); m = A.getRowDimension(); n = A.getColumnDimension(); Rdiag = new double[n]; // Main loop. for (int k = 0; k < n; k++) { // Compute 2-norm of k-th column without under/overflow. double n...
8
public String getName() { return name; }
0
public void paintComponent(Graphics g) { // base g.setColor(Color.black); g.drawLine(centerX - width/2, centerY, centerX + width/2, centerY); g.drawLine(centerX, centerY, centerX, centerY - height); g.drawString(name, centerX - 5, centerY + 15); for (int i = 0; i < d...
2
@EventHandler public void CaveSpiderHunger(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getCaveSpiderConfig().getDouble("CaveSpi...
6
String change2str(ChangeEffect change) { String str = effTranslate(change.getEffectType()); if (change.getCodonsOld().isEmpty() && change.getCodonsNew().isEmpty()) str += " -"; else str += " " + change.getCodonsOld() + "/" + change.getCodonsNew(); if (change.getAaOld().isEmpty() && change.getAaNew().isEmpty()...
5
public void printObjectState(){ for(Map.Entry<String, Object> entry : objectManager.objects.entrySet()){ Object object = entry.getValue(); System.out.println(object.name + "has value: " + object.value); } }
1
protected void validateBasicAuthentication(OAuth2Message message, OAuth2Accessor accessor) throws IOException,OAuth2Exception { String authz = message.getHeader("Authorization"); if (authz != null) { if(authz.substring(0,5).equals("Basic")){ String userPass = new String(B...
7
private int alphabetaCardPicking(GameState state, ArrayList<Color> playerList, ArrayList<Card> choiceList, int alpha, int beta, Color faction, int depth) { //Base case, if there aren't any more players we go to the first action if(playerList.size() == 0) { GameState tempState = new GameState(state); fo...
9
private void estimateDistribution(int[] bowl, int bowlId, int round, int bowlSize){ // Initially, create a uniform distribution for (int i=0; i < NUM_FRUITS ; i++) { originalDistribution[i] = Math.round(n_fruits/NUM_FRUITS); // Assign uniform probability if (bowls_seen[0] == 0 || bowls_seen...
8
public List<String> fetchCategories(String userId, String type){ List<String> unsubCat = new ArrayList<String>(); ResultSet rs=null; Connection con=null; PreparedStatement ps=null; List<String> result=new ArrayList<String>(); try{ String sql; if(type.equals("NotSubscribed")){ sql="SELECT DISTI...
9
private static Color getColor(int selection) { switch (selection) { case RED: return Color.RED; case WHITE: return Color.WHITE; case YELLOW: return Color.YELLOW; case GREEN: return Color.GREEN; ...
5
private void key(byte key[]) { int i; int koffp[] = { 0 }; int lr[] = { 0, 0 }; int plen = P.length, slen = S.length; for (i = 0; i < plen; i++) P[i] = P[i] ^ streamtoword(key, koffp); for (i = 0; i < plen; i += 2) { encipher(lr, 0); P[i] = lr[0]; P[i + 1] = lr[1]; } for (i = 0; i < slen;...
3
private void setFlag(State s, StateFlag flag) { switch (flag) { case INITIAL: initialStates.add(s); break; case ACCEPT: acceptStates.add(s); } }
2
@SuppressWarnings("unchecked") public void init() throws Exception { RecorderServlet.recording = Boolean.parseBoolean(server.prop .getProperty("homecam.Capturer.recording")); RecorderServlet.maxRecord = Integer.parseInt(server.prop .getProperty("homecam.Capturer.maxRecord")); RecorderServlet.recordedDire...
8
public int getLength() { return this.length; }
0
public ProbChar[] determineCharaterProbability(Individual[] fitIndividuals) { //keep track of the most probable character in each index of the individuals ProbChar[] mostProbableChars = new ProbChar[TARGET_STRING.length()]; //keep track of the fitness of each character that we might have in each index //chang...
6
public void insertAbove(String filter) { gui.addToHistory(filter); if (filter != null && !filter.trim().equals("")) { JList list = (JList) filterLists.elementAt(currentFilterIndex); int i = list.getSelectedIndex(); if (i < 0) { i = 0; } ...
4
public static void main(String[] args){ Document doc = null; try { doc = Jsoup.connect("http://lyrics.wikia.com/Adele:Rolling_In_The_Deep").get(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } Cleaner cleaner = new Cleaner(new Whitelist().simpleText()); ...
5
AboutDialog( JDialog parent ) { super( parent, Utils.getResource( "about" ), true ); Utils.setDialogIcon( this ); setDefaultCloseOperation( JDialog.DISPOSE_ON_CLOSE ); Container content = getContentPane(); content.setLayout( new GridBagLayout() ); GridBagConstraints gbc =...
6
public String getCharSet() { return charSet; }
0
public boolean execute(CommandSender sender, String identifier, String[] args) { List<Command> sortCommands = plugin.getCommandHandler().getCommands(); List<Command> commands = new ArrayList<Command>(); for (Command command : sortCommands) { if (command.isShownOnHelpMenu() && DonorTitles.perms.has(se...
4
public void clipSourceDest(CPRect srcRect, CPRect dstRect) { // FIXME: // /!\ dstRect bottom and right are ignored and instead we clip // against the width, height of the layer. :/ // // this version would be enough in most cases (when we don't need // srcRect bottom and right to be clipped) // it's left...
4
@Override public void huolehdi(){ h1.kiihdyta(tila.getKiihtyvyys1X(), tila.getKiihtyvyys1Y()); h2.kiihdyta(tila.getKiihtyvyys2X(), tila.getKiihtyvyys2Y()); for (Raaja raaja : h1.getRaajat()){ raaja.setLiikkuuko(tila.getKulmankasvatus(h1)); } for (Raaja raaja : h2...
2
public int[] selectRandom(){ calculateMoleculeID(0,0, new int[0]); ArrayList<Molecule> arr = new ArrayList<Molecule>(); Molecule selected = new Molecule(); int n; double rand; //Sorts THIS molecule into an array arr = sortIntoArray(arr); for(int i=0; i<arr.size(); i++){ /...
2
public void setCaracter(TCaracter node) { if(this._caracter_ != null) { this._caracter_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(...
3
public String getServerVersion(String serverPropertyType, String serverVersionPath) throws Exception { final Properties prop = new Properties(); URL svp = new URL(serverVersionPath); InputStream input = svp.openStream(); try { prop.loadFromXML(input); } catch (IOException ex) { ex.printStackTrace(); ...
3
@Override public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp) { final java.util.Map<String,String> parms=parseParms(parm); final String last=httpReq.getUrlParameter("BEHAVIOR"); if(last==null) return " @break@"; if(last.length()>0) { final Behavior B=CMClass.getBehavior(las...
7
public static void main(String[] args){ int total = 0; for(int i=1;i<10000;i++){ if(isAmicable(i)){ total += i; System.out.println(i); } } System.out.println(total); }
2
private static char[] removeFrontZero(char[] number, boolean minus) { int i=0; for(;i<number.length;i++) { if(number[i]!='0' && number[i]!='\u0000') { break; } } if(i==number.length) { return "0".toCharArray(); } number = Arrays.copyOfRange(number, i, number.length); if(minus){ numb...
6
private double painoArvo(int x, int y) { if((x == 3 || x == 4) && (y == 3 || y == 4)) return 0.5; if((x <= 5 && x >= 2) && (y <= 5 && y >= 2)) return 0.25; return 0.0; }
8
public void run() { this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { saver.savePref(Width, Height, winZoom); System.exit(0); } }); long before; long after; long start; init(); befo...
7
public static int getRow(int selection) { int row = 100; // Calculates if (selection == 1 || selection == 2 || selection == 3) { row = 0; } if (selection == 4 || selection == 5 || selection == 6) { row = 1; } if (selection == 7 || selection == 8 || selection == 9) { row = 2; } return row; }
9
public void setShowColumnDivider(boolean visible) { if (visible != mShowColumnDivider) { mShowColumnDivider = visible; notify(TreeNotificationKeys.COLUMN_DIVIDER, Boolean.valueOf(mShowColumnDivider)); } }
1
@Override public void actionPerformed(ActionEvent e) { JMenuItem menuItem = (JMenuItem)e.getSource(); if(menuItem == exitItem){ System.exit(0); } else if(menuItem == aboutItem){ JOptionPane.showMessageDialog(this, "Java PE reader v1.0."); ...
5
public int getJaar() { return jaar; }
0