⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bigstring.java

📁 简易模拟电梯系统
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
         *  return 1, if smaller, return -1;
         *  @param bigValue
         *  It is compared to this object. 
         */
        public int compareTo(BigString bigValue)
        {
            return this.bt.compareTo(bigValue.getMyBTree());
        }

        /**
         *  Compare two BigStrings whether they are the same.
         *  @return boolean
         *  <br>If they two are the same return true,else
         *  return false;
         *  @param bs
         *  It is a BigString value
         *  and itwill be compared to the actual object. 
         */
        public boolean contentEquals(BigString bs)
        {
            if(this.compareTo(bs)==-1||this.compareTo(bs)==-1)
            return false;
            else
            return true;
        }
        
        /**
         *  It is the method to change all the char of the actual 
         *  BigString into upcase.
         *  @return BigString
         *  <br>new BigString.
         */
        public BigString toUpcase()
        {
        	String str="";
        	for(long i=0;i<this.treeLimit;i++)
        	{
        	    if(this.charAt(i)<='z' && this.charAt(i)>='a')
        	    {
        	    	char ch=(char)(charAt(i)-32);
        	    	str+=ch;
        	    }	
        	    else
        	    {
        	    	str+=charAt(i);
        	    }
        	}
        	BigString bs=new BigString(str);
        	return bs;
        }
        
        /**
         *  It is the method to change all the char of the actual 
         *  BigString into low case.
         *  @return BigString 
         *  <br>new BigString.
         */
        public BigString toLowCase()
        {
        	String str="";
        	for(long i=0;i<this.treeLimit;i++)
        	{
        	    if(this.charAt(i)<='Z' && this.charAt(i)>='A')
        	    {
        	    	char ch=(char)(charAt(i)+32);
        	    	str+=ch;
        	    }	
        	    else
        	    {
        	    	str+=charAt(i);
        	    }
        	}
        	BigString bs=new BigString(str);
        	return bs;
        }
        
        /**
         *  This method used to get a substring from the whole tree.
	     *  The char to get should the the one before the end index.
	     *  @return String  
	     *  <br>The string with the first char at index 
	     *  beginIndex and the last char at endIndex;
	     *  @param beginIndex The start index, a long value
	     *  @param endIndex   The end index, a long value
	     */
        public String getChars(long beginIndex,long endIndex)
        {
        	String str=this.toString();
            return str.substring((int)beginIndex,(int)endIndex);
        }
        

        /**
         *  This method used to get a substring from the whole tree.
	     *  The char to get should the the one before the end index.
	     *  BigString value can't change.
	     *  @return BigString 
	     *  <br>The new BigString with the first char at 
	     *  beginIndex and the last char at endIndex;
	     *  @param beginIndex The start index, a long value
	     *  @param endIndex   The end index, a long value
	     */
        public BigString subString(long beginIndex,long endIndex)
        {
            String str=this.substr(beginIndex, endIndex);
            BigString bs =new BigString(str);
            return bs;
        }
        	

        /**
         *  This method used to get a substring from the whole tree.
	     *  The char to be got should be the last one.
	     *  @param beginIndex From the value to the end.
	     *  @return BigString  
	     *  <br>The string with the first char at 
	     *  beginIndex and the last char at MAX_LEAF_SIZE of the last leaf;
	     */
        public BigString subString(long beginIndex)
        {
        	String str=substr(beginIndex,StringLength);
        	BigString bs=new BigString(str);
        	return bs;
        }
        
        /**
         *  Add to BigString togeither
         *  The bigString value can't change.
         *  @param bigString Add this to the end of the actual BigString.
         *  @return BigString
         *  <br>Make a new BigString.
         */
        public BigString concat(BigString bigString) throws m_Exception 
        {
        	/*String str="";
        	str+=this.toString();
        	str+=bigString.toString();
        	BigString bs=new BigString(str);
        	return bs;*/
            BigString b;
            if(bigString.getVect().size() == 0)       //May the next BigString hava only a node
            {
                b = new BigString(this, bigString);
            }
            else                                      //If the size greater than one.
            {
                BigString x = new BigString(bigString);
                b = new BigString(this,x,bigString.getVect());
            }
            return b;
            
        }
        
    	/**
    	 * gets the String value of the entire BigString
    	 * @return	String
    	 * <br>Returns the String value of this BigString
    	 */
        public String toString()
        {
        	//return bt.toString();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -