All Known Implementing Classes:
EmptyString, LongString, ShortString

public interface IString
Interface for strings stored in the database. There is more than one string format. This interface hides that fact.
Author:
Doug Schaefer
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compare​(char[] chars, boolean caseSensitive)
    Compare this IString record and the specified character array
    int
    compare​(String string, boolean caseSensitive)
    Compare this IString record and the specified String object
    int
    compare​(IString string, boolean caseSensitive)
    Compare this IString record and the specified IString record
    int
    Compare this IString record and the specified char array in a case sensitive manner such that it is compatible with case insensitive comparison.
    int
    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[] name, boolean caseSensitive)
    Compare this IString record and the specified character array
    void
    Free the associated record in the Nd
    char[]
    Get an equivalent character array to this IString record
    long
    Get the offset of this IString record in the Nd
    Get an equivalent String object to this IString record
    int
     
  • Method Details

    • getRecord

      long getRecord()
      Get the offset of this IString record in the Nd
    • compare

      int compare(IString string, boolean caseSensitive) throws IndexException
      Compare this IString record and the specified IString record
      Parameters:
      string -
      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

      int compare(String string, boolean caseSensitive) throws IndexException
      Compare this IString record and the specified String object
      Parameters:
      string -
      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

      int compare(char[] chars, boolean caseSensitive) throws IndexException
      Compare this IString record and the specified character array
      Parameters:
      chars -
      caseSensitive - whether to compare in a case-sensitive way
      Returns:
      • -1 if this < chars
      • 0 if this == chars
      • 1 if this > chars
      Throws:
      IndexException
    • compareCompatibleWithIgnoreCase

      int compareCompatibleWithIgnoreCase(IString string) throws IndexException
      Compare this IString record and the specified IString record in a case sensitive manner such that it is compatible with case insensitive comparison.
      Parameters:
      string -
      Returns:
      • -1 if this < string
      • 0 if this == string
      • 1 if this > string
      Throws:
      IndexException
    • compareCompatibleWithIgnoreCase

      int compareCompatibleWithIgnoreCase(char[] chars) throws IndexException
      Compare this IString record and the specified char array in a case sensitive manner such that it is compatible with case insensitive comparison.
      Parameters:
      chars -
      Returns:
      • -1 if this < string
      • 0 if this == string
      • 1 if this > string
      Throws:
      IndexException
    • comparePrefix

      int comparePrefix(char[] name, boolean caseSensitive) throws IndexException
      Compare this IString record and the specified character array
      Parameters:
      name - the name to compare to
      caseSensitive - 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
    • getChars

      char[] getChars() throws IndexException
      Get an equivalent character array to this IString record

      N.B. This method can be expensive: compare and equals can be used for efficient comparisons

      Returns:
      an equivalent character array to this IString record
      Throws:
      IndexException
    • getString

      String getString() throws IndexException
      Get an equivalent String object to this IString record

      N.B. This method can be expensive: compare and equals can be used for efficient comparisons

      Returns:
      an equivalent String object to this IString record
      Throws:
      IndexException
    • delete

      void delete() throws IndexException
      Free the associated record in the Nd
      Throws:
      IndexException
    • length

      int length()
      Returns:
      the length of the string