Class ShortString
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.db.ShortString
- All Implemented Interfaces:
IString
This is for strings that fit inside a single chunk.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionShortString(Database db, char[] chars, boolean useBytes)
ShortString(Database db, long offset)
-
Method Summary
Modifier and TypeMethodDescriptionint
compare(char[] other, boolean caseSensitive)
Compare this IString record and the specified character arraystatic int
compare(char[] chars, char[] other, boolean caseSensitive)
int
Compare this IString record and the specified String objectint
Compare this IString record and the specified IString recordstatic int
compareChars(char a, char b, boolean caseSensitive)
Compare characters case-sensitively, or case-insensitively.int
compareCompatibleWithIgnoreCase(char[] other)
Compare this IString record and the specified char array in a case sensitive manner such that it is compatible with case insensitive comparison.static int
compareCompatibleWithIgnoreCase(char[] chars, char[] other)
int
compareCompatibleWithIgnoreCase(IString string)
Compare this IString record and the specified IString record in a case sensitive manner such that it is compatible with case insensitive comparison.int
comparePrefix(char[] other, boolean caseSensitive)
Compare this IString record and the specified character arraystatic int
comparePrefix(char[] chars, char[] other, boolean caseSensitive)
void
delete()
Free the associated record in the Ndboolean
char[]
getChars()
Get an equivalent character array to this IString recordlong
Get the offset of this IString record in the NdGet an equivalent String object to this IString recordint
hashCode()
Compatible withString.hashCode()
int
length()
toString()
-
Field Details
-
MAX_BYTE_LENGTH
public static final int MAX_BYTE_LENGTH
-
-
Constructor Details
-
ShortString
-
ShortString
- Throws:
IndexException
-
-
Method Details
-
getRecord
public long getRecord()Description copied from interface:IString
Get the offset of this IString record in the Nd -
delete
Description copied from interface:IString
Free the associated record in the Nd- Specified by:
delete
in interfaceIString
- Throws:
IndexException
-
getChars
Description copied from interface:IString
Get an equivalent character array to this IString recordN.B. This method can be expensive: compare and equals can be used for efficient comparisons
- Specified by:
getChars
in interfaceIString
- Returns:
- an equivalent character array to this IString record
- Throws:
IndexException
-
getString
Description copied from interface:IString
Get an equivalent String object to this IString recordN.B. This method can be expensive: compare and equals can be used for efficient comparisons
- Specified by:
getString
in interfaceIString
- Returns:
- an equivalent String object to this IString record
- Throws:
IndexException
-
equals
-
hashCode
public int hashCode()Compatible withString.hashCode()
-
compare
public static int compare(char[] chars, char[] other, boolean caseSensitive) -
compare
Description copied from interface:IString
Compare this IString record and the specified character array- Specified by:
compare
in interfaceIString
caseSensitive
- whether to compare in a case-sensitive way- Returns:
- -1 if this < chars
- 0 if this == chars
- 1 if this > chars
- Throws:
IndexException
-
compare
Description copied from interface:IString
Compare this IString record and the specified IString record- Specified by:
compare
in interfaceIString
caseSensitive
- whether to compare in a case-sensitive way- Returns:
- -1 if this < string
- 0 if this == string
- 1 if this > string
- Throws:
IndexException
-
compare
Description copied from interface:IString
Compare this IString record and the specified String object- Specified by:
compare
in interfaceIString
caseSensitive
- whether to compare in a case-sensitive way- Returns:
- -1 if this < string
- 0 if this == string
- 1 if this > string
- Throws:
IndexException
-
compareCompatibleWithIgnoreCase
Description copied from interface:IString
Compare this IString record and the specified IString record in a case sensitive manner such that it is compatible with case insensitive comparison.- Specified by:
compareCompatibleWithIgnoreCase
in interfaceIString
- Returns:
- -1 if this < string
- 0 if this == string
- 1 if this > string
- Throws:
IndexException
-
compareCompatibleWithIgnoreCase
Description copied from interface:IString
Compare this IString record and the specified char array in a case sensitive manner such that it is compatible with case insensitive comparison.- Specified by:
compareCompatibleWithIgnoreCase
in interfaceIString
- Returns:
- -1 if this < string
- 0 if this == string
- 1 if this > string
- Throws:
IndexException
-
compareCompatibleWithIgnoreCase
public static int compareCompatibleWithIgnoreCase(char[] chars, char[] other) -
comparePrefix
Description copied from interface:IString
Compare this IString record and the specified character array- Specified by:
comparePrefix
in interfaceIString
- Parameters:
other
- the name to compare tocaseSensitive
- whether to compare in a case-sensitive way- Returns:
- -1 if this < chars
- 0 if this has a prefix chars
- 1 if this > chars and does not have the prefix
- Throws:
IndexException
-
comparePrefix
public static int comparePrefix(char[] chars, char[] other, boolean caseSensitive) -
compareChars
public static int compareChars(char a, char b, boolean caseSensitive)Compare characters case-sensitively, or case-insensitively. Limitation This only maps the range a-z,A-Z onto each other- Parameters:
a
- a characterb
- a charactercaseSensitive
- whether to compare case-sensitively- Returns:
- -1 if a < b
- 0 if a == b
- 1 if a > b
-
toString
-
length
public int length()
-