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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionShortString(Database db, char[] chars, boolean useBytes)ShortString(Database db, long offset) -
Method Summary
Modifier and TypeMethodDescriptionintcompare(char[] other, boolean caseSensitive)Compare this IString record and the specified character arraystatic intcompare(char[] chars, char[] other, boolean caseSensitive)intCompare this IString record and the specified String objectintCompare this IString record and the specified IString recordstatic intcompareChars(char a, char b, boolean caseSensitive)Compare characters case-sensitively, or case-insensitively.intcompareCompatibleWithIgnoreCase(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 intcompareCompatibleWithIgnoreCase(char[] chars, char[] other)intcompareCompatibleWithIgnoreCase(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.intcomparePrefix(char[] other, boolean caseSensitive)Compare this IString record and the specified character arraystatic intcomparePrefix(char[] chars, char[] other, boolean caseSensitive)voiddelete()Free the associated record in the Ndbooleanchar[]getChars()Get an equivalent character array to this IString recordlongGet the offset of this IString record in the NdGet an equivalent String object to this IString recordinthashCode()Compatible withString.hashCode()intlength()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:IStringGet the offset of this IString record in the Nd -
delete
Description copied from interface:IStringFree the associated record in the Nd- Specified by:
deletein interfaceIString- Throws:
IndexException
-
getChars
Description copied from interface:IStringGet 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:
getCharsin interfaceIString- Returns:
- an equivalent character array to this IString record
- Throws:
IndexException
-
getString
Description copied from interface:IStringGet 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:
getStringin 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:IStringCompare this IString record and the specified character array- Specified by:
comparein interfaceIStringcaseSensitive- 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:IStringCompare this IString record and the specified IString record- Specified by:
comparein interfaceIStringcaseSensitive- 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:IStringCompare this IString record and the specified String object- Specified by:
comparein interfaceIStringcaseSensitive- 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:IStringCompare this IString record and the specified IString record in a case sensitive manner such that it is compatible with case insensitive comparison.- Specified by:
compareCompatibleWithIgnoreCasein interfaceIString- Returns:
- -1 if this < string
- 0 if this == string
- 1 if this > string
- Throws:
IndexException
-
compareCompatibleWithIgnoreCase
Description copied from interface:IStringCompare this IString record and the specified char array in a case sensitive manner such that it is compatible with case insensitive comparison.- Specified by:
compareCompatibleWithIgnoreCasein 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:IStringCompare this IString record and the specified character array- Specified by:
comparePrefixin 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()
-