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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? valuerecordsaggregate.java

?? java 報表 to office文檔: 本包由java語言開發
?? JAVA
字號:

/* ====================================================================
   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.*;

import java.util.Iterator;
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;


/**
 *
 * Aggregate value records together.  Things are easier to handle that way.
 *
 * @author  andy
 * @author  Glen Stampoultzis (glens at apache.org)
 * @author Jason Height (jheight at chariot dot net dot au)
 */

public class ValueRecordsAggregate
    extends Record
{
    public final static short sid       = -1000;
    int                       firstcell = -1;
    int                       lastcell  = -1;
    TreeMap                   records   = null;

   /** This class is used to find a row in the TreeMap.
    *  
    * This instance of which is used by the rowHasCells method as the key.
    */
   private class RowComparator implements CellValueRecordInterface, Comparable {
     private int row;
     
     public void setRow(int row) {
       this.row = row;
     }
     
     public int compareTo(Object obj) {
         CellValueRecordInterface cell = (CellValueRecordInterface) obj;
 
         if (row == cell.getRow()) {
           return 0;
         }
         else if (row < cell.getRow()) {
           return -1;
         }
         else if (row > cell.getRow()){
           return 1;
         }
         return -1;         
     }
     public int getRow() { return row;}     
     public short getColumn() { return 0;}
     public void setColumn(short col){}
     public void setXFIndex(short xf){}
     public short getXFIndex(){return 0;}
     public boolean isBefore(CellValueRecordInterface i){ return false; }
     public boolean isAfter(CellValueRecordInterface i){ return false; }
     public boolean isEqual(CellValueRecordInterface i){ return false; }
     public Object clone(){ return null;}     
   }
   
   /**
    * Iterates the cell records that exist between the startRow and endRow (inclusive).
    * 
    * User must ensure that hasNext & next are called insequence for correct
    * operation. Could fix, but since this is only used internally to the
    * ValueRecordsAggregate class there doesnt seem much point.
    */   
   private class RowCellIterator implements Iterator {
     private int startRow;
     private int endRow;
     private Iterator internalIterator;
     private CellValueRecordInterface atCell;
     
     public class RowCellComparator extends RowComparator {
       public int compareTo(Object obj) {
           CellValueRecordInterface cell = (CellValueRecordInterface) obj;
  
           if (getRow() == cell.getRow() && cell.getColumn() == 0) {
             return 0;
           }
           else if (getRow() < cell.getRow()) {
             return -1;
           }
           else if (getRow() > cell.getRow()){
             return 1;
           }
           if (cell.getColumn() > 0)
           {
               return -1;
           }
           if (cell.getColumn() < 0)
           {
               return 1;
           }
           return -1;         
       }
     }
     
     private RowCellComparator rowCellCompare;
     
     
     public RowCellIterator(int startRow, int endRow) {
       this.startRow = startRow;
       this.endRow = endRow;
       rowCellCompare = new RowCellComparator();
       rowCellCompare.setRow(startRow);
     }
     
     public boolean hasNext() {
       if (internalIterator == null) {
         internalIterator = records.tailMap(rowCellCompare).values().iterator();
       }
       if (internalIterator.hasNext()) {
         atCell = (CellValueRecordInterface) internalIterator.next();
         return (atCell.getRow() <= endRow);
       } else return false;
     }
     
     public Object next() {
       return atCell;
     }
     
     public void remove() {
       //Do Nothing (Not called)
     }
   }
   
   //Only need a single instance of this class, but the row fields
   //will probably change each use. Instance is only used in the rowHasCells method.
   public final RowComparator compareRow = new RowComparator();
   
    /** Creates a new instance of ValueRecordsAggregate */

    public ValueRecordsAggregate()
    {
        records = new TreeMap();
    }

    public void insertCell(CellValueRecordInterface cell)
    {
        Object o = records.put(cell, cell);

        if ((cell.getColumn() < firstcell) || (firstcell == -1))
        {
            firstcell = cell.getColumn();
        }
        if ((cell.getColumn() > lastcell) || (lastcell == -1))
        {
            lastcell = cell.getColumn();
        }
    }

    public void removeCell(CellValueRecordInterface cell)
    {
        records.remove(cell);
    }

    public int getPhysicalNumberOfCells()
    {
        return records.size();
    }

    public int getFirstCellNum()
    {
        return firstcell;
    }

    public int getLastCellNum()
    {
        return lastcell;
    }

    public int construct(int offset, List records)
    {
        int k = 0;

        FormulaRecordAggregate lastFormulaAggregate = null;

        for (k = offset; k < records.size(); k++)
        {
            Record rec = ( Record ) records.get(k);

            if (rec instanceof StringRecord == false && !rec.isInValueSection() && !(rec instanceof UnknownRecord))
            {
                break;
            }
            if (rec instanceof FormulaRecord)
            {
                lastFormulaAggregate = new FormulaRecordAggregate((FormulaRecord)rec, null);
                insertCell( lastFormulaAggregate );
            }
            else if (rec instanceof StringRecord)
            {
                lastFormulaAggregate.setStringRecord((StringRecord)rec);
            }
            else if (rec instanceof SharedFormulaRecord)
            {
            	//these follow the first formula in a group
            	lastFormulaAggregate.setSharedFormulaRecord((SharedFormulaRecord)rec);
            }
            else if (rec.isValue())
            {
                insertCell(( CellValueRecordInterface ) rec);
            }
        }
        return k;
    }

    /**
     * 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 to begin writing at
     * @param data byte array containing instance data
     * @return number of bytes written
     */

    public int serialize(int offset, byte [] data)
    {
      throw new RuntimeException("This method shouldnt be called. ValueRecordsAggregate.serializeCellRow() should be called from RowRecordsAggregate.");
    }
    
    /** Tallies a count of the size of the cell records
     *  that are attached to the rows in the range specified.
     */
    public int getRowCellBlockSize(int startRow, int endRow) {
      RowCellIterator itr = new RowCellIterator(startRow, endRow);
      int size = 0;
      while (itr.hasNext()) {
        CellValueRecordInterface cell = (CellValueRecordInterface)itr.next();
        int row = cell.getRow();
        if (row > endRow)
          break;
        if ((row >=startRow) && (row <= endRow))
          size += ((Record)cell).getRecordSize();
      }
      return size;
    }

    /** Returns true if the row has cells attached to it */
    public boolean rowHasCells(int row) {
      compareRow.setRow(row);
      return records.containsKey(compareRow);
    }

    /** Serializes the cells that are allocated to a certain row range*/
    public int serializeCellRow(final int row, int offset, byte [] data)
    {
        RowCellIterator itr = new RowCellIterator(row, row);      
        int      pos = offset;

        while (itr.hasNext())
        {
            CellValueRecordInterface cell = (CellValueRecordInterface)itr.next();
            if (cell.getRow() != row)
              break;
            pos += (( Record ) cell).serialize(pos, data);
        }
        return pos - offset;
    }

    
    /**
     * called by the constructor, should set class level fields.  Should throw
     * runtime exception for bad/icomplete 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 sid;
    }

    public int getRecordSize() {
    
        int size = 0;
        Iterator irecs = records.values().iterator();
        
        while (irecs.hasNext()) {
                size += (( Record ) irecs.next()).getRecordSize();
        }

        return size;
    }

    public Iterator getIterator()
    {
        return records.values().iterator();
    }

    /** Performs a deep clone of the record*/
    public Object clone() {
      ValueRecordsAggregate rec = new ValueRecordsAggregate();
      for (Iterator valIter = getIterator(); valIter.hasNext();) {
        CellValueRecordInterface val = (CellValueRecordInterface)((CellValueRecordInterface)valIter.next()).clone();
        rec.insertCell(val);
      }
      return rec;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲制服丝袜av| 不卡视频一二三| 日本成人在线一区| 日本亚洲三级在线| 青娱乐精品在线视频| 亚洲成人tv网| 日韩综合一区二区| 免费在线看一区| 久久精品国产99久久6| 韩国女主播一区二区三区| 国产真实精品久久二三区| 国产精品一级片在线观看| 国产美女主播视频一区| 粉嫩一区二区三区性色av| 国产宾馆实践打屁股91| 成人午夜视频网站| 99re这里都是精品| 91久久人澡人人添人人爽欧美| 色av综合在线| 欧美欧美午夜aⅴ在线观看| 欧美一区二区三区四区高清| 欧美不卡一区二区三区| 日本不卡一区二区三区| 蜜臀91精品一区二区三区| 国产一区欧美一区| 成人avav影音| 欧美男男青年gay1069videost| 91精品国模一区二区三区| 久久综合999| 亚洲欧洲成人自拍| 午夜电影网亚洲视频| 国产一区二区三区在线观看免费视频 | 欧美精品在线观看播放| 日韩一区二区在线看| 国产蜜臀av在线一区二区三区 | 国产成人精品免费| 91片黄在线观看| 欧美一区二区三区性视频| 久久亚洲精精品中文字幕早川悠里 | 国产精品久久久久7777按摩| 一区二区三区电影在线播| 天天色天天操综合| 国产成人午夜电影网| 在线观看国产91| 亚洲精品在线免费观看视频| 亚洲欧美日韩国产另类专区| 青青草91视频| av激情综合网| 精品国产一区二区三区忘忧草| 亚洲日本va午夜在线电影| 日韩中文字幕1| 成人激情av网| 日韩一区二区三区观看| 亚洲欧美国产毛片在线| 久久国产尿小便嘘嘘尿| 在线视频中文字幕一区二区| 精品久久久久久无| 亚洲综合丝袜美腿| 国产传媒一区在线| 欧美一级生活片| 亚洲色图欧洲色图| 国产一区二区三区久久悠悠色av| 欧美日韩中文一区| 国产精品美女久久久久av爽李琼| 日韩av一区二区三区四区| 91一区二区在线| 26uuu亚洲综合色| 亚洲综合在线视频| 成人午夜激情视频| 欧美mv日韩mv国产网站app| 亚洲一区中文日韩| 不卡的电视剧免费网站有什么| 欧美一级专区免费大片| 亚洲综合色自拍一区| 成av人片一区二区| 久久久精品免费免费| 日本网站在线观看一区二区三区| 一本久久综合亚洲鲁鲁五月天| 日韩欧美在线网站| 五月天久久比比资源色| 91成人在线免费观看| 国产精品久久一级| 国产成人亚洲综合a∨婷婷| 欧美成人精品高清在线播放| 亚洲成人一二三| 欧美曰成人黄网| 亚洲欧美另类图片小说| 波波电影院一区二区三区| 久久久99免费| 狠狠色丁香婷综合久久| 欧美成人艳星乳罩| 麻豆精品久久久| 日韩欧美电影一区| 久久精品二区亚洲w码| 在线成人免费观看| 午夜伦理一区二区| 欧美肥大bbwbbw高潮| 午夜影院久久久| 欧美精品乱码久久久久久按摩 | 久久se精品一区精品二区| 欧美一级片免费看| 日本中文字幕一区| 日韩欧美一区二区不卡| 琪琪久久久久日韩精品| 日韩免费看网站| 经典三级视频一区| 99国产精品国产精品毛片| 亚洲四区在线观看| 成人丝袜高跟foot| 精品少妇一区二区三区免费观看| 蜜臀久久久久久久| 日韩精品一区二区在线| 精品一区二区在线观看| 精品乱码亚洲一区二区不卡| 国产真实乱偷精品视频免| 欧美精品一区二区三区很污很色的| 日日噜噜夜夜狠狠视频欧美人 | 婷婷综合在线观看| 88在线观看91蜜桃国自产| 日本亚洲最大的色成网站www| 欧美二区三区91| 黄页视频在线91| 国产目拍亚洲精品99久久精品| 91丝袜呻吟高潮美腿白嫩在线观看| 最新国产成人在线观看| 欧美亚洲自拍偷拍| 秋霞电影网一区二区| 久久蜜臀中文字幕| 91亚洲男人天堂| 一区二区三区成人| 欧美一区二区三区四区五区| 国产精品一区久久久久| 最新久久zyz资源站| 欧美日韩视频一区二区| 久久成人羞羞网站| 国产亚洲一区二区三区在线观看| 成人国产视频在线观看| 亚洲午夜国产一区99re久久| 日韩欧美在线网站| 成人免费福利片| 亚洲国产cao| 久久久久久久久久久99999| 91在线观看一区二区| 三级精品在线观看| 欧美—级在线免费片| 欧美日韩三级一区| 国产精品1024| 亚洲国产精品嫩草影院| 久久久久99精品一区| 欧美亚州韩日在线看免费版国语版| 美美哒免费高清在线观看视频一区二区 | 亚洲精品日日夜夜| 精品免费日韩av| 色偷偷一区二区三区| 麻豆91在线观看| 亚洲黄色av一区| 国产视频一区二区三区在线观看| 日本韩国精品一区二区在线观看| 色综合中文字幕| 奇米精品一区二区三区在线观看| 国产精品网站导航| 欧美一区二区高清| 91免费观看视频在线| 韩国毛片一区二区三区| 亚洲成人精品一区| 国产精品九色蝌蚪自拍| 日韩精品一区二区三区在线播放 | 欧美一区二区三区四区久久| 91亚洲精品乱码久久久久久蜜桃| 久久99蜜桃精品| 亚洲小少妇裸体bbw| 欧美国产日韩一二三区| 555www色欧美视频| 91麻豆高清视频| 国产成人午夜精品5599| 捆绑调教美女网站视频一区| 夜夜夜精品看看| 亚洲欧洲精品成人久久奇米网| 欧美va亚洲va在线观看蝴蝶网| 欧美在线免费播放| 99免费精品在线| 国产麻豆精品在线观看| 麻豆精品精品国产自在97香蕉 | 色av一区二区| 99这里只有久久精品视频| 国产另类ts人妖一区二区| 日韩黄色一级片| 午夜精品福利一区二区蜜股av| 国产精品九色蝌蚪自拍| 久久久不卡网国产精品二区| 91精品国产综合久久精品麻豆| 在线观看欧美日本| 91女人视频在线观看| 丁香桃色午夜亚洲一区二区三区| 久久99久久99| 久久国产综合精品| 老司机免费视频一区二区| 另类小说色综合网站| 天天射综合影视| 首页欧美精品中文字幕|