text
stringlengths
14
410k
label
int32
0
9
public int getOrthoWidth() { return 800; }
0
@Override public void updateScreen() { if (isSlowLoad) { //TODO } else { manager.removeScreen(this); for (GameScreen g : screens) { manager.addScreen(g); } } }
2
@Override public void processing() throws IOException { DataInputStream reader = new DataInputStream(inputStream); PrintStream writer = new PrintStream(outputStream); String line = null; while(!suspending){ switch(step) { case 0: if((line = reade...
9
public static void main(String[] args) { SharedObject counter = new SharedObject(); System.out.println("Main thread started: " + Thread.currentThread().getName() + ", id=" + Thread.currentThread().getId()); // t.setDaemon(true); for (int i = 0; i < 10; i++) { Thread t = new Thread(new NamePrinter(cou...
1
public static double[][] readMatrix(Path path, HamaConfiguration conf, int rows, int columns, int blockSize) { int finalRows = getBlockMultiple(rows, blockSize); int finalCols = getBlockMultiple(columns, blockSize); double[][] matrix = new double[finalRows][finalCols]; SequenceFile.Reader reader = null; ...
8
private static void algorithmPrompt(Graph g) { String algorithmChoice; if (!g.hasNegativeWeights()) { while (true) { System.out.println("Which algorithm to use?"); System.out.println(" b - Breadth-first search"); System.out.println(" d - Dijk...
4
public Element writePropertyNode(Element parent, Object o, String name) throws Exception { Element node; PropertyNode pnode; Vector children; int i; Element child; // for debugging only if (DEBUG) trace(...
9
@Override public void execute(CommandSender sender, String worldName, List<String> args) { this.sender = sender; if (worldName == null) { error("No world given."); reply("Usage: /gworld timefrozen <worldname> <true|false>"); } else if (!hasWorld(worldName)) { reply("World not found: " + worldName); ...
5
public void validacion(String dni, String apellidoPaterno, String apellidoMaterno, String nombre, String email, String telefono, String celular, String fechaContacto ) throws BusinessException { String mensaje = ""; if (apellidoPaterno==null || apellidoPaterno.isEmpty()) mensaje += "\nEl...
7
public static Map<String, String> getAttirbutes(String str) { Map<String, String> result = new HashMap<String, String>(); StringTokenizer eTokens = new StringTokenizer(str, "="); if(!eTokens.hasMoreTokens()) { return result; } String rest = eTokens.nextToken(); while (eTokens.hasMoreTokens()) { if (re...
5
public boolean calculateChances(int p) { int percent=p; int r = numGen.nextInt(100); return r<=p; }
0
public static int minDepthOf(Node root) { if(root == null) return -1; if(root.left == null && root.right == null) return 0; else if(root.left == null) return 1+minDepthOf(root.right); else if(root.right == null) return 1+minDepthOf(root.left); else return (minDepthOf(root.left)>minDepthOf(ro...
6
@Override public String getBirth() { return super.getBirth(); }
0
public String toString() { if (Type.PRINT_TRUNCATED) { return (Type.truncatedName(this)); } else { return desc; } }
1
private int getDistanceToNearestOpponent() { nearestOpponent = null; int distance = LONGDISTANCE; Opponent[] opponents = getOpponents(); for (int i=0; i<opponents.length; i++) { int d = (int)Vector3D.getDistance(getLocation(), opponents[i].getLocation()); if (d < distance) { distance = d; nearestO...
2
public void crearInvasores(){ Invasor.setnTotalVivos(0); int colum = juego.getnColum(); int filas = juego.getnFilas(); int nivel = juego.getNivel(); //Aquí controlaremos que la velocidad nunca sea mayor a 20 <-~-> while(nivel >= 20){ nivel -= 20; } ...
3
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Pflanze other = (Pflanze) obj; if (bodenart != other.bodenart) return false; if (hoehe != other.hoehe) return false; if (name == null) ...
8
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onBorderTeleport(PlayerTeleportEvent event) { Player player = event.getPlayer(); User user = EdgeCoreAPI.userAPI().getUser(player.getName()); if (user == null) return; if (event.getCause().equals(TeleportCause.ENDER_...
3
public static String getMapName(int id) { switch(id) { case 1: return "Summoner's Rift (Summer)"; case 2: return "Summoner's Rift (Autumn)"; case 3: return "The Proving Grounds"; case 4: return "Twisted Treeline (Original)"; case 8: return "The Crystal Scar"; case 10: return ...
7
protected Replacer(BufMgr javamgr) { mgr = javamgr; int numbuf = javamgr.getNumBuffers(); state_bit = new STATE[numbuf]; for(int i=0; i<numbuf; i++) { state_bit[i] = new STATE(); // Original code forget to set state // state_bit[i].state = Available; } head = -1; }
1
private void downloadFile() { BufferedInputStream in = null; FileOutputStream fout = null; try { URL fileUrl = new URL(this.versionLink); final int fileLength = fileUrl.openConnection().getContentLength(); in = new BufferedInputStream(fileUrl.openStream()); ...
9
public Game(int gameSize, int winLength) { int rand; this.gameSize = gameSize; this.winLength = winLength; if (gameSize >= 3 && winLength >= 3) { field = new EField[gameSize][gameSize]; for (int i = 0; i < gameSize; i++) for (int j = 0; j < gameSi...
8
private static void readPairsTable( byte[] data, int p, int dataTableOffset, MVD mvd ) throws Exception { // record any pairs declaring themselves as parents HashMap<Integer,Pair> parents = new HashMap<Integer,Pair>(); HashMap<Integer,LinkedList<Pair>> orphans = new HashMap<Integer,LinkedList<Pair>>(); ...
8
public ServerHeartbeatManager() { logger.info("Loading ServerHeartbeatManager..."); config = Config.getInstance(); serverId = config.getInt("server.id"); // create server record if it doesn't exist Connection dbConnection = DbHelper.getMainDb().getConnection(); if (dbConnection == null) { throw(new Ru...
5
private void addBadColorToMap(TreeMap<Integer, TreeSet<Integer>> badColors, TreeMap<Integer, TreeSet<Integer>> newBadColors) { for(Map.Entry<Integer, TreeSet<Integer>> entry : newBadColors.entrySet()) { TreeSet<Integer> tmp = badColors.get(entry.getKey()); if(tmp == null) { tmp = new TreeSet<Integer>(...
3
private void restart() { try { String java = System.getProperty("java.home") + RestartDemo.SEPARATOR + "bin" + RestartDemo.SEPARATOR + "java"; List<String> args = ManagementFactory.getRuntimeMXBean().getInputArguments(); StringBuffer jvmArgs = new StringBuffer(); for (String arg : args) { // -agentli...
6
public boolean realizaMovimiento(HttpServletRequest request) { HttpSession sesion = request.getSession(); String movimiento = request.getParameter("movimiento"); System.out.println(movimiento); String fecha = request.getParameter("fecha"); String login = (String) sesion.getAttrib...
1
@SuppressWarnings("unchecked") public void print() { System.out.println("** Metadata **"); for (final Map<String, Object> m : _data) { System.out.println(" + ALBUM"); for (final String key : m.keySet()) { final Object o = m.get(key); // Most stuff is string, we can just dump that out. if (o inst...
6
private void initBuses(List<Bus> buses, String filePath) { try { File file = new File(filePath); if (file.isDirectory()) { System.out.println(file.getAbsolutePath()); String[] filelist = file.list(); for (int i = 0; i < filelist.length; i++) { File readfile = new File(filePath + "/" + filelist[...
5
public HashMap<Integer, Integer> selectPertinence(ArrayList<Integer> lint) { HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>(); if (lint.size() != 0) { Map<Integer, Integer> res = new HashMap<Integer, Integer>(); String listint = new String(); listint = "...
5
public String[] sortList(String[] names) { String tempName; boolean complete = false; while(complete) { complete = true; // assume that you done for (int i = 0; i < names.length-1; i++) { int compareResult = names[i].compareTo(name...
3
public ArrayList<Rectangle2D> getAllFlatBoxes() { if(noChildren()) { ArrayList<Rectangle2D> tempBoxes = new ArrayList<Rectangle2D>(); if(this.flat) tempBoxes.add(this.box); return tempBoxes; } else { ArrayList<Rectangle2D> tempBoxes = new ArrayList<Rectangle2D>(); for(int x = 0; x < this.chil...
3
public static void init(String[] args) { try { // Initial Parameter Check boolean dev_mode = false, log_mode = false; if (args != null) { for (String a : args) { if (a.equals("DEV_MODE")) dev_mode = true; if (a.equals("LOG_ENABLED")) log_mode = true; } } UtDebug debug = new UtDebug(d...
5
public boolean isComplete() { return (this.started) && (this.remainingFiles.isEmpty()) && (this.remainingThreads.get() == 0); }
2
private String[] inputParse(String string) { char lastChar = string.charAt(0); String s = string + " "; boolean insideString = false; String word = ""; LinkedList<String> input = new LinkedList<String>(); for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == '\"') { insideString = !insideString...
7
public void intArrayToLevel(int[][] array) { if(array.length < 1 || array[0].length < 1) return; if(array.length != width || array[0].length != height) { width = array.length; height = array[0].length; tiles = new Tile[width][height]; } width = array.length; height = array[0].length; for (int y = 0...
6
void removeChild (Node child) { if (_occurs_ == child) { _occurs_ = null; return; } if (_occursTo_ == child) { _occursTo_ = null; return; } if (_number_ == child) { _number_ = null; ...
7
public void buildComponents() throws IOException { initEffects(); makePaths(); makeParticle(); paths = new Group(path, path2, path3, path4, path5); paths.setOpacity(0.6); // progress.setFill(Color.WHITE); message = new Text(loadingMessage); message.setFont(Font.font("Arial", FontWeight.BOLD, 20)); ...
0
public Mobile pickedMobile(final HUD UI, final Viewport port, Base base) { // // You may want to use some pre-emptive culling here in future. Mobile nearest = null ; float minDist = Float.POSITIVE_INFINITY ; for (Mobile m : mobiles) { if (m.indoors() || ! (m instanceof Selectable)) continue ;...
6
private void computerVsComputerSetUp(int numberOfTimes){ int compOneScore = 0; int compTwoScore = 0; for(int i = 0; i < numberOfTimes; i++){ ComputerPlayer computer1 = new ComputerPlayer(stateValues, "1"); ComputerPlayer computer2 = new ComputerPlayer(stateValues, "2"); Random random = new Random(); P...
5
ConnectionLoggerImpl(final File log_dir, final String route_name, final Integer connection_id) { // System.out.debug("ConnectionLoggerImpl.<init>(" + log_dir + ", " + route_name + ", " + connection_id + ")"); if (!log_dir.exists()) { log_dir.mkdirs(); } if (!log_dir.exists()) { throw new E...
4
public void visit_invokeinterface(final Instruction inst) { final MemberRef method = (MemberRef) inst.operand(); final Type type = method.nameAndType().type(); pop(type.paramTypes().length); pop(); // Pop receiver if (type.returnType() != Type.VOID) { push(inst); } }
1
public boolean opEquals(Operator o) { return (o instanceof OuterLocalOperator && ((OuterLocalOperator) o).local .getSlot() == local.getSlot()); }
1
public static int task4() { int largest = 0; for (int i = 999; i >= 100; i--) { for (int j = 999; j >= 100; j--) { final int product = i * j; if ((product > largest) && (validPalindrome(product))) { largest = product; } } } r...
4
private void initonce() { if (initedonce) return; initedonce = true; try { Resource.addurl(new URL("https", getCodeBase().getHost(), 443, "/res/")); } catch (java.net.MalformedURLException e) { throw (new RuntimeException(e)); } if (!Co...
6
@Override public List<Projeto> Buscar(Projeto obj) { String sql = "select a from Projeto a"; String filtros = ""; if(obj != null){ if(obj.getId() != null){ filtros += "a.id = " + obj.getId(); } if(obj.getTitulo() != null){...
5
public void Debug(String data) { if (DebugEnabled) { logger.info("[BirthdayGift] DEBUG: " + data); } }
1
public void setEventEnabled(String event, boolean enabled) { String value = enabled ? "true" : "false"; rootElement.xpath("events/" + event).attr("value", value); }
1
public static void generateSchedule(LoanAccount loanAccount) throws Exception { if (loanAccount.getPlafond().compareTo(BigDecimal.ZERO) != 1) { throw new Exception("Plafond harus lebih besar dari 0."); } if (loanAccount.getTenure() <= 0) { throw new Exception("Tenure <= 0. Seharusnya > 0."); } if (...
7
public void renumber() { boolean[] used = new boolean[Settings.num_districts]; for( int i = 0; i < used.length; i++) { used[i] = false; } int[] renumbering = new int[Settings.num_districts]; for( int i = 0; i < renumbering.length; i++) { String s = JOptionPane.showInputDialog("Enter new district number ...
9
@Test public void testRapportagesMaken() throws Exception { File f = new File("C:/Users/Jacky/Dropbox/Themaopdracht 4/CSVTestdata/RapportagesMakenTest.csv"); if (f.exists() && f.isFile()) { String hoogstebtwperproduct; String gemiddeldebtwperproduct; String hoogstebtwpertransactie; String gemiddeldebtw...
4
public static boolean insideBounds(Tile[][] grid, Point start, Point end) { return (start.x < grid.length && start.y < grid[start.x].length && end.x < grid.length && end.y < grid[end.x].length); }
3
private static void printAngle(double x, DecimalFormat formatDegrees, DecimalFormat formatMinutes, DecimalFormat formatSeconds, PrintStream ps, boolean hasSign) { char signum = (x < 0.0) ? '-' : '+'; if (x < 0.0) x = -x; int xd = (int) x; x -= (double) xd; x *= 60.0; int xm = (int) x; ...
3
public static void main(String[] args) { Scanner in = new Scanner(System.in); int jarCount = in.nextInt(); int iterations = in.nextInt(); long sum = 0; while (iterations > 0) { long a = in.nextInt(); long b = in.nextInt(); long k = in.nextInt(); // As same amount is added, it is just simple m...
1
private synchronized void receiveAd(Sim_event ev) { if (super.reportWriter_ != null) { super.write("receive router ad from, " + GridSim.getEntityName(ev.get_src()) ); } // what to do when an ad is received FloodAdPack ad = (FloodAdPack) ev.get_data(); ...
7
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TabelProdSubCategory other = (TabelProdSubCategory) obj; if (!Objects.equals(this.subCategoryId, other.su...
3
public List<FieldVisitMeasurement> getFieldVisitMeasurement() { if (fieldVisitMeasurement == null) { fieldVisitMeasurement = new ArrayList<FieldVisitMeasurement>(); } return this.fieldVisitMeasurement; }
1
public static String[] askHashSet(String msg) { LinkedList<String> res = new LinkedList<String>(); boolean carryOn = true; System.out.println(msg + " (empty line to finish) :"); while (carryOn) { String aux = ask(); if (aux.equals("")) carryOn = false; else if ( Draft.isHash(aux) ) res.add( aux...
3
public final void gestionEtat(final Etat e) { switch (e) { case INIT_JSON_XML: jTextArea1.setText(""); jTextArea2.setText(""); jTextFieldPathIN.setText(""); jTextFieldPathOut.setText(""); jButtonParcourirIN.setEnabled(true); jButtonValider.setEnabled(true); jTextFieldPathIN.setEnabled(true); ...
7
public boolean checkObjective(UQuest plugin, Location point, String type, String name){ //system.out.println(type + " _____ " + name); //system.out.println(this.objectiveTypes.contains(type + ":" + name)); if(this.objectiveTypes.contains(type + ":" + name)){ Objective obj = this.getObjectiveFromTypes(type, nam...
2
public static String toString(int numPrev){ String retStr = ""; if (numPrev <= 0 || numPrev > history.size()){ // Prevent index out of range error numPrev = 1; } Object[][] deltaBoard = history.get(history.size() - numPrev); retStr += "History #: " + history.size() + "\n"; for (int y = 0;y < 8;y++) { ...
5
public void setCsaValorTotal(Double csaValorTotal) { this.csaValorTotal = csaValorTotal; }
0
private static void clipBoundary(final S2Polygon a, boolean reverseA, final S2Polygon b, boolean reverseB, boolean invertB, boolean addSharedEdges, S2PolygonBuilder builder) { S2PolygonIndex bIndex = new S2PolygonIndex(b, reverseB); bIndex.predictAdditionalCalls(a.getNumVerti...
7
private int initSpeed() { int resSpeed = 0; String vitesse = jTextField3.getText(); try { resSpeed = Integer.parseInt(vitesse); if (resSpeed < 300) { jTextField3.setText("300"); resSpeed = 300; } } catch (NumberFormatExc...
2
public int[] recoverMath(int level, int con, int inte, int wis, int str, boolean isHungry, boolean isThirsty, boolean isFatigued, boolean isSleeping, boolean isSittingOrRiding,boolean isFlying,boolean isSwimming) { /* # @x1=stat(con/str/int-wis), @x2=level, @x3=hungry?1:0, @x4=thirsty?1:0, @x5=fatigued?0:1 # @x6=asl...
7
private void setPieceToMove(ChessPiece p) { if ((p == null) || (p.getColor() != turn)) return; // if there was a previous set of moves, // reset the UI from it this.removeMoveHighlights(); moves_from = p.nextMoves(this); if (moves_from == null) { System.out.printf("No valid moves for piece a...
8
public RoundsLabel() { RoundManager.getInstance().addListener(this); setText(INIT_TEXT + 1); setFont(DefaultUIProvider.getQuestionPriceFont()); }
0
public static void startCast() { if (!skill && target == null) { target = getTarget(range); } if (skill && !aiming) { aiming = true; } if (stopAiming) aiming = false; if (!aiming) { if (!skill) { if (target != null) { isCasting = true; cast = 0; } } else { stopAiming ...
8
private void validarDatos(String nombre, String descripcion, String permisos) throws BusinessException { String mensaje = ""; if(nombre == null || nombre.isEmpty()) mensaje += "Identificacion no puede ser nula o vacia\n"; if(descripcion == null || descripcion.isEmpty()) m...
7
public static void main(String[] args) throws Exception { ObjectInput in = new ObjectInputStream(new FileInputStream(new File(".", "X.file"))); Object mystery = in.readObject(); in.close(); System.out.println(mystery.getClass()); //Reflection Method[] methods = mystery.g...
2
public static void main(String[] args) { // 驱动程序名 String driver = "com.mysql.jdbc.Driver"; // URL指向要访问的数据库名zjwdb_173271 String url = "jdbc:mysql://182.18.22.37:3306/Ak610152753"; // MySQL配置时用户名 String user = "Ak610152753"; // Java连接MySQL配置时的密码 String password = "Ak610152753"; try { // 加载驱动程序 ...
5
private void mainMenuBorrower() throws Exception { int input; Boolean valid = false; while (!valid) { System.out.println(""); System.out.println("==========================="); System.out.println("What do you want to do ?"); System.out.println(" ...
7
private void algorithmButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_algorithmButtonActionPerformed try{ double cool = Double.parseDouble(coolRateField.getText()); s = dc.MetropolisAlgorithm(s, cool, Integer.parseInt(maxStudentsField.getText())); fit...
1
public ArrayList<Human> array_query(LinkedList<Human> toCheck) { // Создадим массив для тех кто проходит фильтры ArrayList<Human> answer = new ArrayList<Human>(); // В исходном массиве перебираем все элементы и каждый проверям, если // подходит - добавляем в результирующий массив for (Human human : toCheck)...
8
public String getfirstStreamFromURL(String streamURL) { String url = ""; String tmp = ""; Boolean breakLook = false; try { // create URL URL stream = new URL(streamURL); // create Stream and open it to url readStream = stream.openStream(); // create an buffered reader bw = new BufferedReade...
7
public static void setBaseViewPath(String baseViewPath) { if (baseViewPath == null) throw new NullPointerException("the baseViewPath can not be null"); if ("".equals(baseViewPath)) { throw new IllegalArgumentException("the baseViewPath can not be blank"); } baseViewPath = baseViewPath.trim(); if (!ba...
4
public double variance_as_Complex_ConjugateCalcn() { boolean hold = Stat.nFactorOptionS; if (nFactorReset) { if (nFactorOptionI) { Stat.nFactorOptionS = true; } else { Stat.nFactorOptionS = false; } } Complex[] cc = this.getArray_as_Complex(); double variance = Stat.varianceConjugateCalcn(cc)...
2
public static int[] selectSort(int[] arr) { int swapCount = 0; for (int i = 0; i < arr.length; i++) { int temp = i; for (int j = i + 1; j < arr.length; j++) { if (arr[j] < arr[temp]) { temp = j; } } if (t...
4
public void update() { // 重力で下向きに加速度がかかる vy += Map.GRAVITY; // x方向の当たり判定 // 移動先座標を求める double newX = x + vx; // 移動先座標で衝突するタイルの位置を取得 // x方向だけ考えるのでy座標は変化しないと仮定 Point tile = map.getTileCollision(this, newX, y); if (tile == null) { // 衝突するタ...
6
public static OpenMRSDataProperties getInstance() throws IOException { if (instance == null) instance = new OpenMRSDataProperties(); String propertyFile = System.getenv("OPENMRS_PROP_FILE"); if (propertyFile == null) throw new IllegalArgumentException("Environment variable OPENMRS_PROP_FILE mis...
2
static void lsp_to_curve(float[] curve, int[] map, int n, int ln, float[] lsp, int m, float amp, float ampoffset){ int i; float wdel=M_PI/ln; for(i=0;i<m;i++)lsp[i]=Lookup.coslook(lsp[i]); int m2=(m/2)*2; i=0; while(i<n){ int k=map[i]; float p=.7071067812f; f...
9
public boolean InsertarArea(Area p){ if (p!=null) { cx.Insertar(p); return true; }else { return false; } }
1
public boolean search(int[] A, int target) { if (A == null) { return false; } int start = 0; int end = A.length; boolean result = false; while (start < end) { int mid = start + (end - start) / 2; if (A[mid] == target) { result = true; break; } if (A[start] < A[mid]) { if (A[start]...
8
public float[] fromCIEXYZ(float[] colorvalue) { float x = colorvalue[0]; float y = colorvalue[1]; float z = colorvalue[2]; float[] mask = new float[1]; if (Math.round(x) > 0 || Math.round(y) > 0 || Math.round(z) > 0) { mask[0] = 1; } else { ...
3
public static boolean isPrime(int n){ if(n<2 || (n>2 && n%2==0) || (n>3 && n%6%4!=1)) return false; for(int i=3; 1L*i*i<=n; i+=2) if(n%i==0) return false; return true; }
7
private void loadProperties() { InputStream is = new Object() { }.getClass().getEnclosingClass().getResourceAsStream(Constants.PROPERTIES_FILE.toString()); try { properties.load(is); LOG.info("Validator Properties are successfully loaded."); } catch (IOException e) { LOG.error("Failed to load Validator...
3
public void addStep() { StepCounter++; }
0
public int getY() { return y; }
0
public boolean isIntelligentCellAlive() { return getCellAt(intelligentX, intelligentY); }
0
public static Object getValueClass(char ch) { switch (ch) { case '@': return PatternOptionBuilder.OBJECT_VALUE; case ':': return PatternOptionBuilder.STRING_VALUE; case '%': return PatternOptionBuilder.NUMBER_VALUE; ...
9
public static Stella_Object accessStellaHashTableSlotValue(StellaHashTable self, Symbol slotname, Stella_Object value, boolean setvalueP) { if (slotname == Stella.SYM_STELLA_SIZE) { if (setvalueP) { self.size = ((IntegerWrapper)(value)).wrapperValue; } else { value = IntegerWrapper...
9
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
9
public String getServiceID() { return ServiceID; }
0
void combinationSum2Rec(int [] num, int target, int start, Deque<Integer> deque){ if(target == 0){ res.add(new ArrayList<Integer>(deque)); return; }else if(target < 0) return; for(int i = start; i < num.length; ++i){ // note that i > start makes sure the firs...
5
private void processPolyLine(RdpPacket_Localised data, PolyLineOrder polyline, int present, boolean delta) { if ((present & 0x01) != 0) polyline.setX(setCoordinate(data, polyline.getX(), delta)); if ((present & 0x02) != 0) polyline.setY(setCoordinate(data, polyline.ge...
7
@Override public String getMixedString(UnicodeSet localeAlphabet, int length) { if(length == 0) { return ""; } else if(length < 0) { throw new IllegalArgumentException("Length must be greater than 0."); } ArrayList<int[]> alphabets = this.getCharacterSetList(); if(localeAlphabet != null) { alpha...
7
@Override public void keyTyped(KeyEvent e) { JTextField f = (JTextField) e.getSource(); // Only accept numbers and decimals in the average mark JTextField if ( (!Character.isDigit( e.getKeyChar() )) && (e.getKeyChar() != '.') ) { e.consume(); // Set and display a helpful tooltip f....
6
private Node procedureCall() throws ParserException { enterRule(NonTerminal.PROCEDURE_CALL); expect(TokenKind.COLON); expect(TokenKind.COLON); Token functTok = expectRetrieve(TokenKind.IDENT); Symbol decSym = symbolTable.inParentScopes(functTok.getLexeme(), "procedure"); if (decSym == null) p...
8
final public void updateColumn() throws ParseException { /*@bgen(jjtree) updateColumn */ SimpleNode jjtn000 = new SimpleNode(JJTUPDATECOLUMN); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { columnAndAlias(); jj_consume_t...
8
private void printImage(int width, int height, PrintWriter outP) { // out = ""; if (width < height) { for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { if (i == width - 1 && j == height - 1) { // out += toString(image[j][i]); outP.print(toString(image[j][i])); } else ...
9