Package org.openl.meta
Class StringValue
- java.lang.Object
-
- org.openl.meta.StringValue
-
- All Implemented Interfaces:
CharSequence
,Comparable<StringValue>
,IMetaHolder
public class StringValue extends Object implements IMetaHolder, CharSequence, Comparable<StringValue>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StringValue.StringValueAdapter
-
Constructor Summary
Constructors Constructor Description StringValue(String value)
StringValue(String value, String shortName, String fullName, IOpenSourceCodeModule source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IOpenSourceCodeModule
asSourceCodeModule()
static StringValue
autocast(String x, StringValue y)
static String
cast(StringValue x, String y)
char
charAt(int index)
Returns a character at position 'index' of current StringValue variableint
compareTo(StringValue v)
Compares StringValue v with current StringValue variableboolean
equals(Object obj)
ValueMetaInfo
getMetaInfo()
Returns the metainfo of current StringValue variableString
getValue()
int
hashCode()
boolean
isEmpty()
int
length()
Return the length of the valuevoid
setMetaInfo(IMetaInfo metaInfo)
Sets the metainfo for the valuestatic StringValue[]
sort(StringValue[] values)
Sorts the StringValue arrayCharSequence
subSequence(int start, int end)
Returns a new character sequence that is a subsequence of this sequence.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Constructor Detail
-
StringValue
public StringValue(String value)
-
StringValue
public StringValue(String value, String shortName, String fullName, IOpenSourceCodeModule source)
-
-
Method Detail
-
asSourceCodeModule
public IOpenSourceCodeModule asSourceCodeModule()
-
charAt
public char charAt(int index)
Returns a character at position 'index' of current StringValue variable- Specified by:
charAt
in interfaceCharSequence
-
compareTo
public int compareTo(StringValue v)
Compares StringValue v with current StringValue variable- Specified by:
compareTo
in interfaceComparable<StringValue>
-
getMetaInfo
public ValueMetaInfo getMetaInfo()
Returns the metainfo of current StringValue variable- Specified by:
getMetaInfo
in interfaceIMetaHolder
-
getValue
public String getValue()
- Returns:
- the value of current StringValue variable
-
isEmpty
public boolean isEmpty()
- Returns:
- true if value is empty, and false if not
-
length
public int length()
Return the length of the value- Specified by:
length
in interfaceCharSequence
-
setMetaInfo
public void setMetaInfo(IMetaInfo metaInfo)
Sets the metainfo for the value- Specified by:
setMetaInfo
in interfaceIMetaHolder
-
subSequence
public CharSequence subSequence(int start, int end)
Returns a new character sequence that is a subsequence of this sequence.- Specified by:
subSequence
in interfaceCharSequence
-
toString
public String toString()
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
sort
public static StringValue[] sort(StringValue[] values)
Sorts the StringValue array- Parameters:
values
- array for sorting- Returns:
- the sorted array
-
autocast
public static StringValue autocast(String x, StringValue y)
-
cast
public static String cast(StringValue x, String y)
-
-