亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rowrecordsaggregate.java

?? java 報(bào)表 to office文檔: 本包由java語(yǔ)言開發(fā)
?? JAVA
字號(hào):
/* ====================================================================   Copyright 2002-2004   Apache Software Foundation   Licensed under the Apache License, Version 2.0 (the "License");   you may not use this file except in compliance with the License.   You may obtain a copy of the License at       http://www.apache.org/licenses/LICENSE-2.0   Unless required by applicable law or agreed to in writing, software   distributed under the License is distributed on an "AS IS" BASIS,   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   See the License for the specific language governing permissions and   limitations under the License.==================================================================== */package org.apache.poi.hssf.record.aggregates;import org.apache.poi.hssf.record.DBCellRecord;import org.apache.poi.hssf.record.Record;import org.apache.poi.hssf.record.RowRecord;import java.util.Iterator;import java.util.Map;import java.util.TreeMap;/** * * @author  andy * @author Jason Height (jheight at chariot dot net dot au) */public class RowRecordsAggregate    extends Record{    int     firstrow = -1;    int     lastrow  = -1;    Map records  = null;    int     size     = 0;    /** Creates a new instance of ValueRecordsAggregate */    public RowRecordsAggregate()    {        records = new TreeMap();    }    public void insertRow(RowRecord row)    {        size += row.getRecordSize();        // Integer integer = new Integer(row.getRowNumber());        records.put(row, row);        if ((row.getRowNumber() < firstrow) || (firstrow == -1))        {            firstrow = row.getRowNumber();        }        if ((row.getRowNumber() > lastrow) || (lastrow == -1))        {            lastrow = row.getRowNumber();        }    }    public void removeRow(RowRecord row)    {        size -= row.getRecordSize();        // Integer integer = new Integer(row.getRowNumber());        records.remove(row);    }    public RowRecord getRow(int rownum)    {        // Integer integer = new Integer(rownum);        RowRecord row = new RowRecord();        row.setRowNumber(( short ) rownum);        return ( RowRecord ) records.get(row);    }    public int getPhysicalNumberOfRows()    {        return records.size();    }    public int getFirstRowNum()    {        return firstrow;    }    public int getLastRowNum()    {        return lastrow;    }        /** Returns the number of row blocks.     * <p/>The row blocks are goupings of rows that contain the DBCell record     * after them     */    public int getRowBlockCount() {      int size = records.size()/DBCellRecord.BLOCK_SIZE;      if ((records.size() % DBCellRecord.BLOCK_SIZE) != 0)          size++;      return size;    }    public int getRowBlockSize(int block) {      return 20 * getRowCountForBlock(block);    }    /** Returns the number of physical rows within a block*/    public int getRowCountForBlock(int block) {      int startIndex = block * DBCellRecord.BLOCK_SIZE;      int endIndex = startIndex + DBCellRecord.BLOCK_SIZE - 1;      if (endIndex >= records.size())        endIndex = records.size()-1;      return endIndex-startIndex+1;    }    /** Returns the physical row number of the first row in a block*/    public int getStartRowNumberForBlock(int block) {      //JMH Given that we basically iterate through the rows in order,       //For a performance improvement, it would be better to return an instance of      //an iterator and use that instance throughout, rather than recreating one and      //having to move it to the right position.      int startIndex = block * DBCellRecord.BLOCK_SIZE;      Iterator rowIter = records.values().iterator();      RowRecord row = null;      //Position the iterator at the start of the block      for (int i=0; i<=startIndex;i++) {        row = (RowRecord)rowIter.next();      }      return row.getRowNumber();    }    /** Returns the physical row number of the end row in a block*/    public int getEndRowNumberForBlock(int block) {      int endIndex = ((block + 1)*DBCellRecord.BLOCK_SIZE)-1;      if (endIndex >= records.size())        endIndex = records.size()-1;      Iterator rowIter = records.values().iterator();      RowRecord row = null;      for (int i=0; i<=endIndex;i++) {        row = (RowRecord)rowIter.next();      }      return row.getRowNumber();    }    /** Serializes a block of the rows */    private int serializeRowBlock(final int block, final int offset, byte[] data) {      final int startIndex = block*DBCellRecord.BLOCK_SIZE;      final int endIndex = startIndex + DBCellRecord.BLOCK_SIZE;      Iterator rowIterator = records.values().iterator();      int pos = offset;      //JMH Given that we basically iterate through the rows in order,       //For a performance improvement, it would be better to return an instance of      //an iterator and use that instance throughout, rather than recreating one and      //having to move it to the right position.      int i=0;      for (;i<startIndex;i++)        rowIterator.next();      while(rowIterator.hasNext() && (i++ < endIndex)) {        RowRecord row = (RowRecord)rowIterator.next();        pos += row.serialize(pos, data);      }      return pos - offset;    }    public int serialize(int offset, byte [] data) {      throw new RuntimeException("The serialize method that passes in cells should be used");    }        /**     * called by the class that is responsible for writing this sucker.     * Subclasses should implement this so that their data is passed back in a     * byte array.     *     * @param offset    offset to begin writing at     * @param data      byte array containing instance data     * @return number of bytes written     */    public int serialize(int offset, byte [] data, ValueRecordsAggregate cells)    {        int pos = offset;        //DBCells are serialized before row records.        final int blockCount = getRowBlockCount();        for (int block=0;block<blockCount;block++) {          //Serialize a block of rows.          //Hold onto the position of the first row in the block          final int rowStartPos = pos;          //Hold onto the size of this block that was serialized          final int rowBlockSize = serializeRowBlock(block, pos, data);          pos += rowBlockSize;          //Serialize a block of cells for those rows          final int startRowNumber = getStartRowNumberForBlock(block);          final int endRowNumber = getEndRowNumberForBlock(block);          DBCellRecord cellRecord = new DBCellRecord();          //Note: Cell references start from the second row...          int cellRefOffset = (rowBlockSize-20);          for (int row=startRowNumber;row<=endRowNumber;row++) {            if (cells.rowHasCells(row)) {              final int rowCellSize = cells.serializeCellRow(row, pos, data);              pos += rowCellSize;              //Add the offset to the first cell for the row into the DBCellRecord.              cellRecord.addCellOffset((short)cellRefOffset);              cellRefOffset = rowCellSize;            }          }          //Calculate Offset from the start of a DBCellRecord to the first Row          cellRecord.setRowOffset(pos - rowStartPos);          pos += cellRecord.serialize(pos, data);        }        return pos - offset;    }    /**     * called by the constructor, should set class level fields.  Should throw     * runtime exception for bad/incomplete data.     *     * @param data raw data     * @param size size of data     * @param offset of the record's data (provided a big array of the file)     */    protected void fillFields(byte [] data, short size, int offset)    {    }    /**     * called by constructor, should throw runtime exception in the event of a     * record passed with a differing ID.     *     * @param id alleged id for this record     */    protected void validateSid(short id)    {    }    /**     * return the non static version of the id for this record.     */    public short getSid()    {        return -1000;    }    public int getRecordSize()    {        return size;    }    public Iterator getIterator()    {        return records.values().iterator();    }        /**     * Performs a deep clone of the record     */    public Object clone()    {        RowRecordsAggregate rec = new RowRecordsAggregate();        for ( Iterator rowIter = getIterator(); rowIter.hasNext(); )        {            //return the cloned Row Record & insert            RowRecord row = (RowRecord) ( (RowRecord) rowIter.next() ).clone();            rec.insertRow( row );        }        return rec;    }    public int findStartOfRowOutlineGroup(int row)    {        // Find the start of the group.        RowRecord rowRecord = this.getRow( row );        int level = rowRecord.getOutlineLevel();        int currentRow = row;        while (this.getRow( currentRow ) != null)        {            rowRecord = this.getRow( currentRow );            if (rowRecord.getOutlineLevel() < level)                return currentRow + 1;            currentRow--;        }        return currentRow + 1;    }    public int findEndOfRowOutlineGroup( int row )    {        int level = getRow( row ).getOutlineLevel();        int currentRow;        for (currentRow = row; currentRow < this.getLastRowNum(); currentRow++)        {            if (getRow(currentRow) == null || getRow(currentRow).getOutlineLevel() < level)            {                break;            }        }        return currentRow-1;    }    public int writeHidden( RowRecord rowRecord, int row, boolean hidden )    {        int level = rowRecord.getOutlineLevel();        while (rowRecord != null && this.getRow(row).getOutlineLevel() >= level)        {            rowRecord.setZeroHeight( hidden );            row++;            rowRecord = this.getRow( row );        }        return row - 1;    }    public void collapseRow( int rowNumber )    {        // Find the start of the group.        int startRow = findStartOfRowOutlineGroup( rowNumber );        RowRecord rowRecord = (RowRecord) getRow( startRow );        // Hide all the columns until the end of the group        int lastRow = writeHidden( rowRecord, startRow, true );        // Write collapse field        if (getRow(lastRow + 1) != null)        {            getRow(lastRow + 1).setColapsed( true );        }        else        {            RowRecord row = createRow( lastRow + 1);            row.setColapsed( true );            insertRow( row );        }    }    /**     * Create a row record.     *     * @param row number     * @return RowRecord created for the passed in row number     * @see org.apache.poi.hssf.record.RowRecord     */    public static RowRecord createRow(int row)    {        RowRecord rowrec = new RowRecord();        //rowrec.setRowNumber(( short ) row);        rowrec.setRowNumber(row);        rowrec.setHeight(( short ) 0xff);        rowrec.setOptimize(( short ) 0x0);        rowrec.setOptionFlags(( short ) 0x100);  // seems necessary for outlining        rowrec.setXFIndex(( short ) 0xf);        return rowrec;    }    public boolean isRowGroupCollapsed( int row )    {        int collapseRow = findEndOfRowOutlineGroup( row ) + 1;        if (getRow(collapseRow) == null)            return false;        else            return getRow( collapseRow ).getColapsed();    }    public void expandRow( int rowNumber )    {        int idx = rowNumber;        if (idx == -1)            return;        // If it is already expanded do nothing.        if (!isRowGroupCollapsed(idx))            return;        // Find the start of the group.        int startIdx = findStartOfRowOutlineGroup( idx );        RowRecord row = getRow( startIdx );        // Find the end of the group.        int endIdx = findEndOfRowOutlineGroup( idx );        // expand:        // colapsed bit must be unset        // hidden bit gets unset _if_ surrounding groups are expanded you can determine        //   this by looking at the hidden bit of the enclosing group.  You will have        //   to look at the start and the end of the current group to determine which        //   is the enclosing group        // hidden bit only is altered for this outline level.  ie.  don't uncollapse contained groups        if ( !isRowGroupHiddenByParent( idx ) )        {            for ( int i = startIdx; i <= endIdx; i++ )            {                if ( row.getOutlineLevel() == getRow( i ).getOutlineLevel() )                    getRow( i ).setZeroHeight( false );                else if (!isRowGroupCollapsed(i))                    getRow( i ).setZeroHeight( false );            }        }        // Write collapse field        getRow( endIdx + 1 ).setColapsed( false );    }    public boolean isRowGroupHiddenByParent( int row )    {        // Look out outline details of end        int endLevel;        boolean endHidden;        int endOfOutlineGroupIdx = findEndOfRowOutlineGroup( row );        if (getRow( endOfOutlineGroupIdx + 1 ) == null)        {            endLevel = 0;            endHidden = false;        }        else        {            endLevel = getRow( endOfOutlineGroupIdx + 1).getOutlineLevel();            endHidden = getRow( endOfOutlineGroupIdx + 1).getZeroHeight();        }        // Look out outline details of start        int startLevel;        boolean startHidden;        int startOfOutlineGroupIdx = findStartOfRowOutlineGroup( row );        if (startOfOutlineGroupIdx - 1 < 0 || getRow(startOfOutlineGroupIdx - 1) == null)        {            startLevel = 0;            startHidden = false;        }        else        {            startLevel = getRow( startOfOutlineGroupIdx - 1).getOutlineLevel();            startHidden = getRow( startOfOutlineGroupIdx - 1 ).getZeroHeight();        }        if (endLevel > startLevel)        {            return endHidden;        }        else        {            return startHidden;        }    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影在线观看网站| 精品欧美乱码久久久久久1区2区| 国产三级精品视频| 捆绑调教一区二区三区| 欧美一区午夜视频在线观看 | 久久新电视剧免费观看| 蜜臀av一区二区在线观看| 欧美大片一区二区三区| 国内精品不卡在线| 国产精品久99| 欧美艳星brazzers| 亚洲mv在线观看| 日韩一级二级三级精品视频| 国产综合一区二区| 中文字幕欧美日本乱码一线二线| www.亚洲在线| 亚洲一二三区不卡| 亚洲精品一区二区三区四区高清 | fc2成人免费人成在线观看播放| 国产欧美在线观看一区| 91日韩一区二区三区| 婷婷国产v国产偷v亚洲高清| wwwwxxxxx欧美| av在线一区二区| 欧美tickle裸体挠脚心vk| 国产盗摄一区二区| 亚洲欧美一区二区三区极速播放 | 欧美人xxxx| 国产精品丝袜一区| 欧美日韩在线三级| 日韩和欧美一区二区三区| 欧美一级淫片007| 国产精品综合二区| 国产精品美女久久福利网站| 国产成都精品91一区二区三| 亚洲视频网在线直播| 在线中文字幕不卡| 日韩综合小视频| 欧美精品一区二区蜜臀亚洲| 成人国产精品免费观看动漫| 怡红院av一区二区三区| 欧美高清dvd| 国产精品88888| 亚洲欧美日韩国产综合在线| 欧美精品丝袜久久久中文字幕| 久久国内精品自在自线400部| 中文字幕av在线一区二区三区| 欧美在线短视频| 美女一区二区三区在线观看| 亚洲国产高清不卡| 欧美日本一区二区| 免费看黄色91| 国产拍欧美日韩视频二区| 在线观看日韩毛片| 精品一区二区综合| 一区二区三区鲁丝不卡| 日韩三级在线观看| 在线观看一区二区精品视频| 国产美女精品在线| 天天做天天摸天天爽国产一区| 精品国产成人系列| 欧洲精品在线观看| 国产精品一卡二卡| 五月激情综合婷婷| 国产成人午夜片在线观看高清观看| 亚洲国产高清在线| 色婷婷香蕉在线一区二区| 欧美成人性福生活免费看| 免费在线成人网| 99久久精品国产导航| 久久久www免费人成精品| 在线播放日韩导航| 韩国毛片一区二区三区| 国产成人精品网址| 日本三级亚洲精品| 精品制服美女久久| 97久久超碰国产精品| 色天使久久综合网天天| 欧美一级片在线观看| 国产人成一区二区三区影院| 亚洲免费av在线| 午夜欧美电影在线观看| 日韩中文字幕区一区有砖一区| 欧美一区二区日韩一区二区| 99久久er热在这里只有精品66| 日韩国产一区二| 欧美三级一区二区| 高清shemale亚洲人妖| 国产大陆亚洲精品国产| 国产一区二区不卡| 日日夜夜一区二区| 国产suv精品一区二区6| 日韩中文字幕91| 亚洲一区二区av在线| 精品国产99国产精品| 欧美一区二区黄色| 欧美精品xxxxbbbb| 在线不卡一区二区| 在线中文字幕不卡| 欧美午夜影院一区| 欧美在线高清视频| 精品视频在线免费观看| 欧美色图片你懂的| 欧美三级午夜理伦三级中视频| 在线免费观看不卡av| 色婷婷综合五月| 色婷婷综合久久久久中文一区二区| 处破女av一区二区| 99久久久免费精品国产一区二区| 粉嫩av一区二区三区在线播放 | 一个色综合网站| 亚洲免费视频中文字幕| 玉米视频成人免费看| 亚洲在线免费播放| 无码av中文一区二区三区桃花岛| 午夜电影网亚洲视频| 秋霞国产午夜精品免费视频| 美女任你摸久久| 国产一区在线观看视频| 麻豆精品久久久| 视频一区欧美日韩| 日韩成人免费电影| 亚洲卡通动漫在线| 亚洲成人福利片| 亚洲国产另类精品专区| 水野朝阳av一区二区三区| 久久电影网电视剧免费观看| 国产精品18久久久久久久久 | 中文字幕在线一区二区三区| 国产精品欧美久久久久一区二区 | 日本成人在线视频网站| 国产一区二区不卡| 色综合久久久久久久久| 欧美日韩国产小视频| 精品国精品国产| 中文字幕制服丝袜成人av| 久久影院视频免费| 国产伦精品一区二区三区免费 | 亚洲三级久久久| 日韩视频一区二区三区在线播放| 激情六月婷婷久久| 99视频有精品| 亚洲欧美另类久久久精品2019 | 亚洲午夜久久久久久久久久久| 色噜噜狠狠成人中文综合 | 国产精品女主播av| 欧美高清性hdvideosex| 国产精品一区二区三区网站| 亚洲精品伦理在线| 国产精品久久久久久久午夜片| 91精品国产乱码久久蜜臀| 国内精品久久久久影院薰衣草 | 亚洲一区二区三区在线看| 丁香婷婷综合五月| 国产精品日韩成人| 麻豆成人久久精品二区三区红| 日韩一级免费观看| 成人影视亚洲图片在线| 久久亚洲私人国产精品va媚药| 日韩免费高清av| 亚洲精品高清在线| 国产美女视频一区| 欧美日韩精品高清| 亚洲女人的天堂| 国产成人精品一区二| 欧美一级爆毛片| 亚洲黄色片在线观看| 国产高清成人在线| 日韩免费视频一区二区| 偷偷要91色婷婷| 色屁屁一区二区| 国产精品久久久久桃色tv| 狠狠色综合播放一区二区| 欧美精品视频www在线观看| 日韩毛片在线免费观看| 成人性生交大合| 国产日韩综合av| 国产精品资源网站| 欧美xxxxxxxx| 日本欧美在线观看| 欧美日韩国产中文| 亚洲bt欧美bt精品777| 色综合久久综合网97色综合| 国产精品卡一卡二卡三| 国产成人丝袜美腿| 国产亚洲成年网址在线观看| 狠狠色丁香婷婷综合| 日韩欧美久久一区| 精品一区免费av| 精品国产精品一区二区夜夜嗨| 美腿丝袜亚洲综合| 精品播放一区二区| 国产精品一区二区三区乱码| 精品国产乱码久久久久久牛牛| 激情综合网av| 国产精品乱人伦| 99久久精品免费精品国产| 国产精品三级电影| 91免费看片在线观看| 亚洲视频电影在线|