📄 bigstring.java
字号:
return this.substr(start,StringLength);
}
/**
* Return the string representation of the char argument.
*/
public BigString valueOf(char c)
{
BigString bs=new BigString(""+c);
return bs;
}
/**
* Returns the string representation of the int argument.
*/
public BigString valueOf(int i)
{
BigString bs=new BigString(""+i);
return bs;
}
/**
* Returns the string representation of the long argument.
*/
public BigString valueOf(long l)
{
BigString bs=new BigString(""+l);
return bs;
}
/**
* Returns the string representation of the float argument.
*/
public BigString valueOf(float f)
{
BigString bs=new BigString(""+f);
return bs;
}
/**
* Returns the string representation of the bool argument.
*/
public BigString valueOf(boolean bool)
{
BigString bs=new BigString(""+bool);
return bs;
}
/**
* Returns the string representation of a specific subarray
* of the char array argument.
*/
public BigString valueOf(char[]value)
{
BigString bs=new BigString(value);
return bs;
}
/**
* Returns the string representation of the double argument.
*/
public BigString valueOf(double d)
{
BigString bs=new BigString(""+d);
return bs;
}
/**
* Returns the string representation of the Object argument.
*/
public BigString valueOf(Object obj)
{
BigString bs=new BigString(obj.toString());
return bs;
}
/**
* The method be used as the method at String.java.
* And the use can be hypothesize from the name.
* @return char
* <br>The charactor which you want to get at the
* Index of number index.
* @param index A long type value.
*/
public char charAt(long index)
{
//String str=this.toString();
return bt.charAt(index);
//charAt((int)index);
}
/**
* The get methods.
*/
/**
* Get the StringLength of the BigString, may equalsto treeLimit+1;
* @return long
* <br>the length of BigString.
*/
public long Length()
{
return this.StringLength;
}
/**
* A public get method.
* Get the start of the BigSting
* @return long
* the start index
*/
protected long getStart()
{
return start;
}
/**
* Get the container of the BigString, which contains nodes of the B+Tree.
* @return Vector
* @see java.util.Vector
* return the vec of the BigString.
*/
protected Vector getVect()
{
return vec;
}
/**
* Get the data structure of the BigString
* @return BTreeString
* <br>return the bt of the BigString
*/
protected BTreeString getMyBTree()
{
return bt;
}
/**
* Get the size of the char array which the actual BigString contains.
* @return long
* <br>the treeLimit of the actual BigString
*/
protected long getTreeLim()
{
return treeLimit;
}
/**
* Private method, return a string type substring.
*/
private String substr(long begin, long end) throws
StringIndexOutOfBoundsException //Exception to be thrown
{
//System.out.println(end-begin);
//solve exceptions
//when the start is great than begin
//or the from is smaller than end
//or the end is greater than StringLength.
if(!(start <= begin && begin <= end && end <= start + StringLength))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -