| java.lang.Object oscript.data.Value oscript.data.OObject oscript.data.OString
All known Subclasses: oscript.data.Symbol,
OString | public class OString extends OObject implements java.io.Externalizable(Code) | | A string class. An OString is immutable, once the instance is
constructed, it won't change.
author: Rob Clark (rob@ti.com) |
Method Summary | |
public static Value | _bopCast(Value val) | public Value | bopEquals(Value val) Perform the "==" operation. | public Value | bopEqualsR(Value val, PackagedScriptObjectException e) | public Value | bopGreaterThan(Value val) Perform the ">" operation. | public Value | bopGreaterThanOrEquals(Value val) Perform the ">=" operation. | public Value | bopGreaterThanOrEqualsR(Value val, PackagedScriptObjectException e) | public Value | bopGreaterThanR(Value val, PackagedScriptObjectException e) | public Value | bopLessThan(Value val) Perform the "<" operation. | public Value | bopLessThanOrEquals(Value val) Perform the "<=" operation. | public Value | bopLessThanOrEqualsR(Value val, PackagedScriptObjectException e) | public Value | bopLessThanR(Value val, PackagedScriptObjectException e) | public Value | bopNotEquals(Value val) Perform the "!=" operation. | public Value | bopNotEqualsR(Value val, PackagedScriptObjectException e) | public Value | bopPlus(Value val) Perform the "+" operation. | public Value | bopPlusR(Value val, PackagedScriptObjectException e) | public boolean | castToBoolean() Convert this object to a native java boolean value. | public long | castToExactNumber() Convert this object to a native java long value. | public double | castToInexactNumber() Convert this object to a native java double value. | public Object | castToJavaObject() Convert this object to a native java Object value. | public String | castToString() Convert this object to a native java String value. | final public static String | chop(String str) | public Value | elementAt(Value oidx) Get the specified index of this object. | public Value | elementsAt(Value idx1, Value idx2) Get the specified range of this object, if this object is an array. | public boolean | endsWith(String str) | public boolean | equals(Object obj) Compare two objects for equality. | protected Value | getTypeImpl() Get the type of this object. | public int | hashCode() Return a hash code value for this object. | public int | indexOf(String str) | public int | indexOf(String str, int fromIdx) | public OString | intern() Return a canonical representation of this OString object. | public int | lastIndexOf(String str) | public int | lastIndexOf(String str, int fromIdx) | public int | length() For types that implement elementAt , this returns the
number of elements. | final public static OString | makeString(String str) Return an intern'd OString.... | public Value | match(Value regexp) Returns the same thing as regexp.exec(this) . | public void | readExternal(java.io.ObjectInput in) Derived class that implements
java.io.Externalizable must
call this if it overrides it. | public Value | replace(Value regexp, Value strOrFxn) Finds a match between a regular expression and this string object, and
replaces the matched substring with a new substring. | public Value | search(Value regexp) Executes the search for a match between a regular expression and this
string object. | public String[] | split(String regex) | public String[] | split(String regex, int limit) | public boolean | startsWith(String str) | public String | substring(int begIdx) | public String | substring(int begIdx, int endIdx) | public String | toLowerCase() | public String | toUpperCase() | public String | trim() | final public String | value() Get the value of this string. | public void | writeExternal(java.io.ObjectOutput out) Derived class that implements
java.io.Externalizable must
call this if it overrides it. |
PARENT_TYPE_NAME | final public static String PARENT_TYPE_NAME(Code) | | |
TYPE | final public static Value TYPE(Code) | | The type object for an instance of String.
|
OString | public OString(String stringVal)(Code) | | Construct a new string.
Parameters: stringVal - the value of the string |
castToExactNumber | public long castToExactNumber() throws PackagedScriptObjectException(Code) | | Convert this object to a native java long value. In order
for a string to be converted to an exact number, it must be of the
form:
STRING ::== ("-")? (HEX_STRING | OCTAL_STRING | DEC_STRING)
HEX_STRING ::== ("0x" | "0X") ([0-9] | [a-f] | [A-F])+
OCTAL_STRING ::== "0" ([0-7])+
DEC_STRING ::== ([0-9])+
a long value throws: PackagedScriptObjectException - (NoSuchMethodException) |
castToInexactNumber | public double castToInexactNumber() throws PackagedScriptObjectException(Code) | | Convert this object to a native java double value. In
order for a string to be converted to an inexact number, it must be
of the form:
STRING ::== ("+" | "-")? EXACT_NUMBER ("." EXACT_NUMBER)? (("e" | "E") EXACT_NUMBER)?
EXACT_NUMBER ::==
a double value throws: PackagedScriptObjectException - (NoSuchMethodException) |
getTypeImpl | protected Value getTypeImpl()(Code) | | Get the type of this object. The returned type doesn't have to take
into account the possibility of a script type extending a built-in
type, since that is handled by
OString.getType .
the object's type |
intern | public OString intern()(Code) | | Return a canonical representation of this OString object. This has the
result that x.intern() == y.intern() (for x
and y that are OString objects).
a OString that has the same value (in the sense of equals ) but is guaraneed to be from a unique pool of OStrings |
lastIndexOf | public int lastIndexOf(String str, int fromIdx)(Code) | | |
makeString | final public static OString makeString(String str)(Code) | | Return an intern'd OString.... document this better!
|
match | public Value match(Value regexp)(Code) | | Returns the same thing as regexp.exec(this) . The
regexp should either be a RegExp object
or a string that can be compiled to a RegExp object.
Note: this API is modeled after the JavaScript RegExp API, for the
benefit of users already familiar with JavaScript.
Parameters: regexp - the regular expression the result of regexp.exec . |
replace | public Value replace(Value regexp, Value strOrFxn)(Code) | | Finds a match between a regular expression and this string object, and
replaces the matched substring with a new substring. The second
parameter can be either a replacement string, or a function called to
determine the replacement string.
If the second parameter is a string, the following replacement patterns
are evaluated and replaced with the appropriate value:
pattern | Description |
$$ | Inserts a $ |
$& | Inserts the matched substring |
$` | Inserts the portion of the string that precedes the matched substring |
$' | Inserts the portion of the string that follows the matched substring |
$ n | Inserts the nth parenthesized submatch string |
If the second parameter is a function, it is called with the following
parameters:
param | Description |
0 | the matched string |
1-n | zero or more parameters for parenthetical matches |
n+1 | offset of match |
n+2 | the original string |
Note: this API is modeled after the JavaScript RegExp API, for the
benefit of users already familiar with JavaScript.
Parameters: regexp - the regular expression Parameters: strOrFxn - replacement string or function the resulting string |
search | public Value search(Value regexp)(Code) | | Executes the search for a match between a regular expression and this
string object.
Note: this API is modeled after the JavaScript RegExp API, for the
benefit of users already familiar with JavaScript.
Parameters: regexp - the regular expression the index of the match, or -1 if none |
substring | public String substring(int begIdx, int endIdx)(Code) | | |
value | final public String value()(Code) | | Get the value of this string.
the string as a java.lang.String |
Methods inherited from oscript.data.Value | public static Value _getTypeMember(Value type, Value obj, int id)(Code)(Java Doc) public static void _populateTypeMemberSet(Value type, java.util.Set s, boolean d)(Code)(Java Doc) public Value bopBitwiseAnd(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseAndR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseOr(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseOrR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseXor(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopBitwiseXorR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopCast(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopCastR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopDivide(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopDivideR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopGreaterThan(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopGreaterThanOrEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopGreaterThanOrEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopGreaterThanR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopInstanceOf(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopInstanceOfR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLeftShift(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLeftShiftR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLessThan(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLessThanOrEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLessThanOrEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLessThanR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLogicalAnd(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLogicalAndR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLogicalOr(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopLogicalOrR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopMinus(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopMinusR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopMultiply(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopMultiplyR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopNotEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopNotEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopPlus(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopPlusR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopRemainder(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopRemainderR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopSignedRightShift(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopSignedRightShiftR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopUnsignedRightShift(Value val) throws PackagedScriptObjectException(Code)(Java Doc) public Value bopUnsignedRightShiftR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc) public Value callAsConstructor(StackFrame sf, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsConstructor(Value[] args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsConstructor(StackFrame sf, Value[] args)(Code)(Java Doc) public Value callAsExtends(StackFrame sf, Scope scope, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsExtends(Scope scope, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsExtends(StackFrame sf, Scope scope, Value[] args)(Code)(Java Doc) public Value callAsFunction(StackFrame sf, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsFunction(Value[] args) throws PackagedScriptObjectException(Code)(Java Doc) final public Value callAsFunction(StackFrame sf, Value[] args)(Code)(Java Doc) public boolean castToBoolean() throws PackagedScriptObjectException(Code)(Java Doc) public long castToExactNumber() throws PackagedScriptObjectException(Code)(Java Doc) public double castToInexactNumber() throws PackagedScriptObjectException(Code)(Java Doc) public Object castToJavaObject() throws PackagedScriptObjectException(Code)(Java Doc) public String castToString() throws PackagedScriptObjectException(Code)(Java Doc) public Value elementAt(Value idx) throws PackagedScriptObjectException(Code)(Java Doc) public Value elementsAt(Value idx1, Value idx2) throws PackagedScriptObjectException(Code)(Java Doc) final public Value getMember(String name) throws PackagedScriptObjectException(Code)(Java Doc) public Value getMember(Value name) throws PackagedScriptObjectException(Code)(Java Doc) final public Value getMember(int id) throws PackagedScriptObjectException(Code)(Java Doc) final public Value getMember(String name, boolean exception) throws PackagedScriptObjectException(Code)(Java Doc) final public Value getMember(Value name, boolean exception) throws PackagedScriptObjectException(Code)(Java Doc) public Value getMember(int id, boolean exception) throws PackagedScriptObjectException(Code)(Java Doc) public Object getMonitor()(Code)(Java Doc) public Value getType()(Code)(Java Doc) abstract protected Value getTypeImpl()(Code)(Java Doc) protected Value getTypeMember(Value obj, int id)(Code)(Java Doc) final protected Value getTypeMember(Value obj, Value name)(Code)(Java Doc) public boolean isA(Value type)(Code)(Java Doc) public int length() throws PackagedScriptObjectException(Code)(Java Doc) public java.util.Set memberSet()(Code)(Java Doc) protected PackagedScriptObjectException noSuchMember(String member)(Code)(Java Doc) public void opAssign(Value val) throws PackagedScriptObjectException(Code)(Java Doc) protected void populateMemberSet(java.util.Set s, boolean debugger)(Code)(Java Doc) protected void populateTypeMemberSet(java.util.Set s, boolean debugger)(Code)(Java Doc) public void readExternal(java.io.ObjectInput in) throws ClassNotFoundException, java.io.IOException(Code)(Java Doc) public String toString()(Code)(Java Doc) public Value unhand()(Code)(Java Doc) public Value uopBitwiseNot() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopDecrement() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopIncrement() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopLogicalNot() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopMinus() throws PackagedScriptObjectException(Code)(Java Doc) public Value uopPlus() throws PackagedScriptObjectException(Code)(Java Doc) public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException(Code)(Java Doc)
|
|
|