java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.db.LongString
All Implemented Interfaces:
IString

public class LongString extends Object implements IString
This is for strings that take up more than on chunk. The string will need to be broken up into sections and then reassembled when necessary.
Author:
Doug Schaefer
  • Constructor Summary

    Constructors
    Constructor
    Description
    LongString​(Database db, char[] chars, boolean useBytes)
     
    LongString​(Database db, long record)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compare​(char[] other, boolean caseSensitive)
    Compare this IString record and the specified character array
    int
    compare​(String other, 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[] other, boolean caseSensitive)
    Compare this IString record and the specified character array
    void
    Free the associated record in the Nd
    boolean
    equals​(Object obj)
     
    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
    Compatible with String.hashCode()
    int
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getRecord

      public long getRecord()
      Description copied from interface: IString
      Get the offset of this IString record in the Nd
      Specified by:
      getRecord in interface IString
    • getChars

      public char[] getChars() throws IndexException
      Description copied from interface: IString
      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

      Specified by:
      getChars in interface IString
      Returns:
      an equivalent character array to this IString record
      Throws:
      IndexException
    • delete

      public void delete() throws IndexException
      Description copied from interface: IString
      Free the associated record in the Nd
      Specified by:
      delete in interface IString
      Throws:
      IndexException
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Compatible with String.hashCode()
      Overrides:
      hashCode in class Object
    • compare

      public int compare(IString string, boolean caseSensitive) throws IndexException
      Description copied from interface: IString
      Compare this IString record and the specified IString record
      Specified by:
      compare in interface IString
      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

      public int compare(String other, boolean caseSensitive) throws IndexException
      Description copied from interface: IString
      Compare this IString record and the specified String object
      Specified by:
      compare in interface IString
      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

      public int compare(char[] other, boolean caseSensitive) throws IndexException
      Description copied from interface: IString
      Compare this IString record and the specified character array
      Specified by:
      compare in interface IString
      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

      public int compareCompatibleWithIgnoreCase(IString string) throws IndexException
      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 interface IString
      Returns:
      • -1 if this < string
      • 0 if this == string
      • 1 if this > string
      Throws:
      IndexException
    • comparePrefix

      public int comparePrefix(char[] other, boolean caseSensitive) throws IndexException
      Description copied from interface: IString
      Compare this IString record and the specified character array
      Specified by:
      comparePrefix in interface IString
      Parameters:
      other - 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
    • getString

      public String getString() throws IndexException
      Description copied from interface: IString
      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

      Specified by:
      getString in interface IString
      Returns:
      an equivalent String object to this IString record
      Throws:
      IndexException
    • compareCompatibleWithIgnoreCase

      public int compareCompatibleWithIgnoreCase(char[] other) throws IndexException
      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 interface IString
      Returns:
      • -1 if this < string
      • 0 if this == string
      • 1 if this > string
      Throws:
      IndexException
    • length

      public int length()
      Specified by:
      length in interface IString
      Returns:
      the length of the string