text
stringlengths
14
410k
label
int32
0
9
public LogInConnect(String name,String pw){ user_name=name; pass_word=pw; try{ @SuppressWarnings("resource") Socket socket=new Socket("localhost",2553); BufferedWriter out=new BufferedWriter( new OutputStreamWriter(socket.getOutputS...
5
protected CtMember.Cache hasMemberCache() { if (memberCache != null) return (CtMember.Cache)memberCache.get(); else return null; }
1
private static Method checkForCreatorMethod(Method m) { if(m.getAnnotation(TestObjectCreate.class) == null) return null; if(!m.getReturnType().equals(testClass)) throw new RuntimeException("@TestObjectCreate " + "must return instance of Class to be tested"); if((m.getModifiers() & ...
3
@EventHandler public void onPlayerDeath(PlayerRespawnEvent evt){ if(evt.getPlayer() == warden){ evt.getPlayer().teleport(locwar); }else if(team.getPlayers().contains(evt.getPlayer())){ evt.getPlayer().teleport(cell1); } }
2
public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String host = ""; int port = 21025; System.out.print("Enter Host: "); try { host = br.readLine(); } catch (IOException e) { e.printStackTrace(); }...
3
public void visit_iadd(final Instruction inst) { stackHeight -= 2; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } stackHeight += 1; }
1
private void type() { expect(Token.Kind.IDENTIFIER); }
0
@Override public void write(int b) throws IOException { count++; if (count > MAX_BUFFER_SIZE) { StringBuilder newBuffer = new StringBuilder(MAX_BUFFER_SIZE); int brAfterPadding = buffer.indexOf("\n", BUFFER_PADDING); newBuffer.append(buffer.subSequence(brAfterPadding, buffer.length())); buffer =...
7
public void Shoot(Direction d){ setChanged(); if (d==Direction.UP || d==Direction.DOWN){ for(int row=0; row<grid.length; ++row) if (grid[row][currCol]==RoomState.WUMPUS){ setChanged(); this.notifyObservers(GameStatus.SHOTHIT); } this.notifyObservers(GameStatus.SHOTMISSED); } else i...
8
private void drawSimplification() { if (simplificationStep == -2) { bufferGraphics.drawImage(strips[simplificationList.size()], 401, stripYPos[simplificationList.size()-1], this); } if (simplificationStep == 0) { bufferGraphics.drawImage(strips[simplificationList.size()-1], 401, stripYPos[simplificationList...
6
public QuadTree[] getQuadTrees() { if (NW == null && NE == null && SW == null && SE == null) { return new QuadTree[0]; } else { return new QuadTree[] { NW, NE, SW, SE }; } }
4
public String[] getElementsUnbalanced() { return this.ELEMENTS_UNBALANCED; }
0
@Override public void update(int delta) { if (!hasMob && respawnTime >= respawnMax){ respawnTime = 0; createMob(); } else if (!hasMob){ respawnTime += delta; } else if (hasMob){ mob.update(delta); if (mob.isDead()){ tmx.runLootTable(mob); mob = null; hasMob = false; } else if...
6
public void setImage(Image image) { button.setIcon(image == null ? null : new ImageIcon(image)); }
1
public void propScoreAdd(int type){ if( type == PropType.star){ Game.propScore += 150 ; }else if( type == PropType.life){ Game.propScore += 500 ; }else if( type == PropType.hat){ Game.propScore += 200 ; }else if( type == PropType.mime){ Game.propScore += 100 ; } }
4
@SuppressWarnings("unchecked") private Behavior loadBehaviorClass(File compiledFile) { FileClassLoader fcl = new FileClassLoader(BehaviorLoader.class.getClassLoader()); Class<Behavior> behClass = null; // get the class try { behClass = fcl.loadClassFromFile(compiledFile); ...
8
private static void readInGrafo(Core output, Document xml, String updateId) { long source = Long.parseLong(xml.getElementsByTagName(SOURCE).item(HEAD).getTextContent()); long target = Long.parseLong(xml.getElementsByTagName(TARGET).item(HEAD).getTextContent()); NodeList dispositivos = xml.getEle...
2
private boolean convertYUV422toRGB(int[] y, int[] u, int[] v, int[] rgb) { if (this.upSampler != null) { // Requires u & v of same size as y this.upSampler.superSampleHorizontal(u, u); this.upSampler.superSampleHorizontal(v, v); return this.convertYUV444to...
9
private void height() { if (this.isEmpty()) this.height = 0; else if (this.isLeaf()) this.height = 1; else if (this.getLeft() == null) this.height = 1 + this.getRight().height; else if (this.getRight() == null) this.height = 1 + this.getLeft().height; else this.height =...
4
@Override public void unInvoke() { if(canBeUninvoked() && (!super.unInvoked)) { if((affected!=null)&&(affected instanceof MOB)&&(!helping)) { final MOB mob=(MOB)affected; if(!aborted) { if((messedUp)&&(room!=null)) { notifyMessUp(mob, recipe); } else { this.b...
8
private void handleMouseOverEvents(Input input) { int buttonIndex = 0; for (Button button : buttons) { if (!(button instanceof Button.BlankButton)) { // Don't want tooltip // for blank button if (button.isMouseOver(input)) { for (ButtonRowListener listener : listeners) { listener.bu...
4
public String toString() { if (name == null) { return "Local$" + index; } return name + "$" + index; }
1
public String[][] getConnectedPlayers() { String playerNamesList = ""; int ACTIVE_CONNECTIONS = 0; ACTIVE_CONNECTIONS = getActiveConnections(); // Now ask about their details: outToServer.println("FETCHPLAYERS"); String totalPlayerArray[][] = new String[(ACTIVE_CONNECTIONS +1)][5]; try { playerNam...
3
public article parseH5Introduction(selectObj selectObj, urlObj urlObj) throws IOException { Document doc = Jsoup.connect(urlObj.getUrl()).get(); Elements elements = doc.select(selectObj.getDocumentSelect()); System.out.println("Fetching : " + urlObj.getUrl()); article article = new art...
6
public About (JFrame parent) { super(parent,"\u00DCber das Programm"); setModalityType(ModalityType.APPLICATION_MODAL); setLayout(new BorderLayout()); JPanel p = new JPanel (new FlowLayout ()); p = new JPanel (new FlowLayout ()); p.add (new JLabel ("Camp Planer " + MainWindow.versionString)); add (p...
5
public void save() { String savePath = new Control_GetPath().getStreamRipStarPath(); XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); int[] intOptions = new int[5]; try { XMLEventWriter writer = outputFactory.createXMLEventWriter( new FileOutputStream(savePath+"/ScheduleManager.xml" ), ...
3
public int maxDonationsWrapper(int[] donations) { int[] T = new int[donations.length]; int[] P = new int[donations.length]; T[0] = donations[0]; P[0] = -1; for (int i = 1; i < T.length; i++) { int max = Integer.MIN_VALUE; for (int j = 0; j < i - 1; j++) { if (max < T[j] + donations[i]) { if (...
7
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ ConsolePlayerMessage send = new ConsolePlayerMessage(sender); if(cmd.getName().equalsIgnoreCase("clickless")){ ArrayList<ClicklessSign> signs = getClickless().getSigns...
7
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ImgPerson)) { return false; } ImgPerson other = (ImgPerson) obj; if (username == null) { if (other.username != null) { return false; } } else if (...
6
public EntityManager getEntityManager() { return em; }
0
public static String likePurviewCode(String alias,String puriveCode,String columnName){ if(puriveCode == null){ return ""; } if(isBlank(alias)){ alias = ""; }else{ alias += "."; } StringBuilder sb = new StringBuilder(); sb.append(" ( "); sb.append(alias).append(columnName).append(" like ...
2
public JFrame getFrame(){ return frame; }
0
public static double studentTCDF(double tValue, int df) { if (tValue != tValue) throw new IllegalArgumentException("argument tValue is not a number (NaN)"); if (tValue == Double.POSITIVE_INFINITY) { return 1.0; } else { if (tValue == Double.NEGATIVE_INFINITY) { return 0.0; } else { double ddf = ...
3
public SearchForGameThread(PongWindow window) throws SocketException { super("SearchForGameThread"); this.window = window; socket = new DatagramSocket(4445); }
0
@Override public int neighbourhoodBest(int particle) { int cubeRoot = getCubeRoot(); if(cubeRoot == 1){ return particle; }else if(particle < cubeRoot * cubeRoot){ Vector<Integer> temp = particlesOnPlane(particle, cubeRoot); temp.add(particle); temp.add(particle + cubeRoot * cubeRoot); return getfi...
3
@Override public void caseADeclEscrevaDefinicaoComando(ADeclEscrevaDefinicaoComando node) { inADeclEscrevaDefinicaoComando(node); if(node.getEscreva() != null) { node.getEscreva().apply(this); } if(node.getLPar() != null) { node.getLPar().a...
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Autore other = (Autore) obj; if (annoNascita != other.annoNascita) return false; if (nome == null) { if (other.nome != null) return f...
7
private STS transformCondition(Condition condition, int prevIndex) { init(); State initialState = createState(); logger.trace("Transforming condition " + condition); StateFormula condNoNegations = condition.getFormula().getEquivalentFormulaWithoutNegations(); Map<ObjectTransition, DomainObject> ...
8
private static boolean equal(Color[][] colors1, Color[][] colors2) { if (colors1.length != colors2.length || colors1[0].length != colors2[0].length) { return false; } for (int row = 0; row < colors1.length; row++) { for (int col = 0; col < colors1[row].length...
5
public Rectangle2D.Float getMediaBox() { // add all of the pages media box dimensions to a vector and process Vector boxDimensions = (Vector) (library.getObject(entries, "MediaBox")); if (boxDimensions != null) { mediaBox = new PRectangle(boxDimensions); // System.out.prin...
4
public static int dehexchar(char c) { if (c >= '0' && c <= '9') { return c - '0'; } if (c >= 'A' && c <= 'F') { return c - ('A' - 10); } if (c >= 'a' && c <= 'f') { return c - ('a' - 10); } return -1; }
6
private void updateTextureOffsets(Transform transform) { Vector4f textureOffsets = transform.textureOffsets; if(textureOffsets == null) { texXOffset = 0; texYOffset = 0; texWidth = texture.getWidth(); texHeight = texture.getHeight(); } else { texXOffset = textureOffsets.x; texYOffset = textureOf...
1
public BigDecimal calculaTaxa(Transferencia transferencia){ BigDecimal taxa = BigDecimal.ZERO; Date dt = transferencia.getDataTransferencia(); int dias = calculaPrazo(dt); try{ //maior que 30 dias da data de cadastro - 1.2% if(dias > 30){ ...
8
public void doTransformations() { if (GlobalOptions.verboseLevel > 0) GlobalOptions.err.println("Transforming " + this); info.setName(getFullAlias()); transformSuperIfaces(); transformInnerClasses(); Collection newFields = new ArrayList(fieldIdents.size()); Collection newMethods = new ArrayList(methodId...
7
public static void addPatientObservation( Patient patient, Observation obs, ObservationType ot, String observations ) { Connection conn = null; Connection conn2 = null; PreparedStatement ps = null; PreparedStatement ps2 = null; ResultSet rs = null; try { // Get a connection ...
9
@Override public boolean equals(Object o) { if(o instanceof Piece) { Piece p = (Piece)o; if(p.getX() == getX() && p.getY() == getY() && p.getColor() == getColor()) { return true; } } return false; }
4
public V put(K key, V value) { if (key == null) { key = (K) KeyFactory.NULL; } cleanup(); // Make sure the key is not already in the WeakIdentityMap. Entry[] tab = this.table; int hash = System.identityHashCode(key); int index = (hash & 0x7fffffff) %...
7
public int hashIntArray(int[] array) { int a = 0xdeadbeef + ((array.length)<<2); int[] tab = new int[3]; tab[0] = tab[1] = tab[2] = a; int pt = 0; int length = array.length; while(length>3){ tab[0] += array[pt]; tab[1] += array[pt+1]; tab[2] += array[pt+2]; mix(tab); length -= 3; pt += ...
5
public int getExpYear() { return expYear; }
0
@Override public void mouseEntered(MouseEvent e) {}
0
public int getID( int whichID ) { if( whichID < 0 && whichID > 3 ) return -1; try { ResultSet result = SQL_SEARCH[ whichID ].executeQuery(); if( result.first() ) { return result.getInt( 1 ); } else { return -1; } } catch ( Exception e ) { e.printStackTrace(); return -1; } }
4
private void displayHelp(String helpType) { String helpText = null; switch (helpType) { case HelpMenuView.BOARD: helpText = "\tThe game board for Sudoku. It consist of a grid of " + "\n\tlocations. Players type the numbers 1-9 on the different locatio...
5
private byte[] zeroCompressDataIntoTable(int imageWidth, int imageHeight, byte[] uncompactedData, byte[] zeroCompressionTableData) { byte pessimisticCompactedData[] = new byte[uncompactedData.length]; int lineDataOffset = 0; int uncompactedByteArrayIndex = 0; for (int row = 0; row < imageH...
7
private void declaraVariavel(String tipo, String nome, String valor) { Variavel var = null; if (! existeVariavel(nome)) { if (tipo.equals("inteiro")) { var = new Inteiro(nome, valor.equals("") ? 0 : Integer.parseInt(valor)); } else if (tipo.equals("real")) { var = new Real(nome, valor.equals("") ? 0.0...
9
public static void main(String[] args) { Scanner input = new Scanner(System.in); int cases = input.nextInt(); for (int q = 0; q < cases; ++q) { long p = input.nextInt(); int flips = 0; while (!isPalindrome(p)) { ...
2
public void notifyObservers(Event event) { if(observers != null) { synchronized (observers) { if(!observers.isEmpty()) { loopCounter++; for(EventListener obs : observers) { try { obs.eventOccured(event); } catch(Error err) { notifyFailure(err, obs); } ...
8
public Ball(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; }
0
public KeyListenerEvent(){ Key = KeyType.NULL; JFrame gui = new JFrame(); gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); gui.setTitle("Bomberman's KeyListenerEvent"); gui.setSize(700,200); gui.setLocationRelativeTo(null); DisplayKey = new JTextArea(); ReceiveKey = new JTextArea(); ...
9
private static void makeTet5(SquareColor[][] tet) { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { if ((i == 2 && j == 1) || (i == 3 && (j == 0 || j == 1 || j == 2))) { tet[i][j] = SquareColor.BLUE; } else tet[i][j] = null; ...
8
public TrackedPeer removePeer(String peerId) { return this.peers.remove(peerId); }
0
public void explosion(int x, int y, int hardness) { for (int xa = -(hardness / 2); xa <= (hardness / 2); xa++) { for (int ya = -(hardness / 2); ya <= (hardness / 2); ya++) { int distance = (int) Math.abs(Math.sqrt(xa*xa + ya*ya)); if (distance <= (hardness / 2)) {...
5
private final boolean cvc(int i) { if (i < 2 || !cons(i) || cons(i - 1) || !cons(i - 2)) return false; { int ch = b[i]; if (ch == 'w' || ch == 'x' || ch == 'y') return false; } return true; }
7
public ContinuousUniform(double low, double high) throws ParameterException { if (low >= high) { throw new ParameterException("ContinuousUniform parameters low < high."); } else { this.low = low; this.high = high; this.rand = new Random(); } }
1
public double interpolate(double xx){ double h=0.0D,b=0.0D,a=0.0D, yy=0.0D; int k=0; int klo=0; int khi=this.nPoints-1; while (khi-klo > 1){ k=(khi+klo) >> 1; if(this.x[k] > xx){ khi=k; } else{ klo=k; } } h=this.x[khi]-t...
3
final public void partition(ParseList list) throws ParseException { ParseArea area; ParseModifier modifier; ParseModifierGroup mGroup; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case AREA: area = area(); partition(list); list.addArea(area); break; case MODIFIER: modifier = modifier...
5
public JSONWriter key(String string) throws JSONException { if (string == null) { throw new JSONException("Null key."); } if (this.mode == 'k') { try { this.stack[this.top - 1].putOnce(string, Boolean.TRUE); if (this.comma) { ...
4
public void printComponent(Graphics g) { // boolean oldAdapt = adapt; // adapt = true; if (transformNeedsReform) reformTransform(g.getClipBounds()); g.setColor(java.awt.Color.white); g.fillRect(0, 0, g.getClipBounds().width, g.getClipBounds().height); Graphics2D g2 = (Graphics2D) g; g2.transfor...
2
public double[][] string_to_double_array(String[] lines) { double[][] temp=null; for(int i=0;i<lines.length;i++) { String[] part=lines[i].split(" "); int c=0; if(i==0) { c=0; for(int j=0;j<part.length;j++) { if(part[j].length()>0&&is_numeric(part[j])) { c++; } } ...
8
public void updateAsScheduled(int numUpdates) { super.updateAsScheduled(numUpdates) ; checkMeltdownAdvance() ; if (! structure.intact()) return ; // // Calculate output of power and consumption of fuel- float fuelConsumed = 0.01f, powerOutput = 5 ; fuelConsumed *= 2 / (2f + structure.upgrad...
7
public static void setTemplate(int template) throws UnsupportedLookAndFeelException, ClassNotFoundException, IllegalAccessException, InstantiationException, Exception { UIManager.put("Menu.font", templateFont); UIManager.put("MenuItem.font", templateFont); UIManager.put("Button.font", templateFont); UIManager.p...
4
public Queue<RouterPacket>[] GetInputBuffer() { return inputBuffer; }
0
public static void createStDevStats1(int n, int k, String... files) { try { int line_number=0; if(n==2) line_number = Ngrams2_lineNumber; else if(n==3) line_number = Ngrams3_lineNumber; else if(n==4) line_number = Ngrams4_lineNumber; else if(n==5) line_number = Ngrams5_lineNumber...
8
public void processQueries(String strInputFilePath, String strOutputFilePath) throws IOException { oBufferedReader = new BufferedReader(new FileReader(strInputFilePath)); oBufferedWriter = new BufferedWriter(new FileWriter(strOutputFilePath)); calcuateTFIDF(oBufferedReader); oBufferedReader.close(); oBuff...
9
public static Boolean isNullOrEmpty(Object object) { if (object == null) { return true; } else { if (object instanceof Collection) { if (((Collection) object).isEmpty()) { return true; } } else if (object instanceof ...
6
private static Class<?> getVirtualMachineClass() throws ClassNotFoundException { try { return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() { public Class<?> run() throws Exception { try { return ClassLoader.getSys...
9
private void alarm() { if (input.getAlarmFlag() && time == alarmTime) { alarmCounter = 20; } if (alarmCounter > 0) { alarmCounter -= 1; output.doAlarm(); } }
3
@Basic @Column(name = "CTR_ESTADO") public String getCtrEstado() { return ctrEstado; }
0
static final void method165(int i, int i_6_, int i_7_, int i_8_, int i_9_, int i_10_, int i_11_, byte i_12_, int i_13_, int i_14_) { anInt5194++; if (i_9_ < 512 || i_11_ < 512 || (i_9_ ^ 0xffffffff) < ((-2 + Class367_Sub4.mapSizeX) * 512 ^ 0xffffffff) || (-2 + Class348_Sub40_Sub3.mapSizeY)...
8
@EventHandler public void onPull(PlayerInteractEvent e) { Block b = e.getClickedBlock(); if(e.getAction() == Action.RIGHT_CLICK_BLOCK && b.getType() == Material.LEVER && SlotMachine.isSlotMachinePart(e.getClickedBlock())){ if(!e.getPlayer().hasPermission("slotmachines.use")) { e.getPlayer().sendMessage(Chat...
8
public void generateDOT(){ try{ File file = new File("calls.dot"); if (!file.exists()) { file.createNewFile(); } FileWriter fw = new FileWriter(file); BufferedWriter bw = new BufferedWriter(fw); bw.write("digraph calls {\n"); System.out.println(calls.toString()); for (String s1 : cal...
4
public void run() { Actions.count = false; System.out.println("СПИЧКИ:\n"); spichki = 15; engine(); while (spichki > 0) { if (!once) { System.out.println("Для начала игры:\n" + "1) нажмите ENTER\n" + "2) введите от любое число и нажмите ENTER"); sc.next(); } once = true; playerMove(); ...
6
public V remove(K key) { searchElement(key); if (_searchHolder == null) { return null; // Nothing was found } // Found a value V value = _searchHolder.value; // Deleting the entry if (buckets.getElement(_searchBucketIndex).getSize() ==...
4
public String checkYourself(String stringGuess) { int guess = Integer.parseInt(stringGuess); String result = "miss"; for (int cell: locationCells) { if (guess == cell) { result = "hit"; numOfHits++; break; } ...
3
public void runGroups(boolean includeManual) { for(GroupSettings settings : getGroups(includeManual)) runGroup(settings, mNoisy, includeManual); }
1
public DecoderPanel(int usableSize, int random) { super(); this.random = random; int cipherPanelSize = 400; int wrapamount = (usableSize / cipherPanelSize); //set LayoutMng this.setLayout(new MigLayout("wrap" + wrapamount, "[grow, center]", "")); this.setBackgro...
1
private static void calcNoOfNodes(Node node) { if (node instanceof Parent) { if (((Parent) node).getChildrenUnmodifiable().size() != 0) { ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable(); noOfNodes += tempChildren.size(); f...
3
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { Player player = (Player)sender; ChatColor blue = ChatColor.AQUA; ChatColor gold = ChatColor.GOLD; ChatColor green = ChatColor.GREEN; if(command.getName().equalsIgnoreCase("sm") && (player.isOp() |...
9
public void update(Vector3f plr) // Aux Thread { chunksLoaded = 0; Chunk.updatePlrPos(plr); playerPos = plr; for(int i = (int)plr.x / Chunk.size - viewRange; i < (int)plr.x / Chunk.size + viewRange; i++) for(int j = (int)plr.z/ Chunk.size - viewRange; j < (int)plr.z/ Chunk.size + viewRange; j++) if(w...
4
private static Map<String, String> getCurlParams(Node db) { try { ConfigParser cp = ConfigParser.getParser(db); HashMap<String, String> ret = new HashMap<String, String>(); try { ret.put("curl-url", cp.getElementAt("curl-url", 0) .getAttribute("url")); } catch (Exception e) { cp.setNode((Ele...
2
public int lookAhead() throws IOException { if (lookaheadChar == UNDEFINED) { lookaheadChar = super.read(); } return lookaheadChar; }
1
public static Host deserializeHost(PeerReference peer) { if (peer == null) { throw new NullPointerException("Cannot transform a null value to a Host object"); } Host host = null; try { host = new PGridHost(peer.address, peer.port); host.setHostPath(pe...
3
public void setDefault_(String default_) { this.default_ = default_; }
0
private void drawSecondSelectedCase(Graphics g) { if (swappedI != -1 && swappedJ != -1) { g.setColor(Color.YELLOW); g.fillRect(swappedI * caseWidth + 1, swappedJ * caseHeight + 1, caseWidth - 1, caseHeight - 1); } }
2
public T deleteMin() { int currentSize = heap.size() - 1; if (currentSize == 0) { return null; } // СԪ T x = heap.get(1); // һԪ T y = heap.remove(currentSize); // عӸʼΪyѰҺʵλ // ѵĵǰڵ int i = 1; // iĺ int ci = 2; currentSize = heap.size() - 1; try { Class<?> c = y.getClass(); Meth...
8
@Override public String toString() { // 現在の盤情報を文字列で取得する StringBuilder sb = new StringBuilder(); sb.append(" 01234567\r\n"); Pos workPos = new Pos(); for (int y = Common.Y_MIN_LEN; y < Common.Y_MAX_LEN; y++) { workPos.setY(y); sb.append(y+" "); for (int x = Common.X_MIN_LEN; x < Common.X_MAX_LEN; x+...
5
public void copyRegionVFlip(CPRect r, CPLayer source) { CPRect rect = new CPRect(0, 0, width, height); rect.clip(r); for (int j = rect.top, s = rect.bottom - 1; j < rect.bottom; j++, s--) { for (int i = rect.left; i < rect.right; i++) { data[i + j * width] = source.data[i + s * width]; } } }
2
@Override public boolean gainPassage(Oergi oergi) { Element element = oergi.getElement(); ElementMovability elementMovability = new ElementMovability(); Movability movability = elementMovability.getMovability(this.getBiotype(), element); if (movability == Movability.NO) { return false; } else if (mov...
3
public List<String> createReversePolishExpression(String subStr) { // 正实数的正则表达式; String regex = "\\d+\\.{0,1}\\d*"; // 将匹配的正实数保存在字符串数组numbers中; String[] numbers = matcher(regex, subStr); String changeStr = subStr.replaceAll(regex, "0") .replaceAll("E\\-0", "E1").replaceAll("\\^\\-0", "^1") .replaceAll...
9
private void setupBlock() throws IOException { if (this.data == null) { return; } final int[] cftab = this.data.cftab; final int[] tt = this.data.initTT(this.last + 1); final byte[] ll8 = this.data.ll8; cftab[0] = 0; System.arraycopy(this.data.unzftab...
6
@Override public Object getValueAt(int row, int column) { Consulta m = linhas.get(row); if (column == COL_ID) { return m.getCodigo(); } else if (column == COL_HORA) { return m.getHorario(); } else if (column == COL_DATA) { return m.getDataDaConsult...
5