Package sig.engine

Class String


  • public class String
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      String()  
      String​(double d)  
      String​(java.lang.Object obj)  
      String​(java.lang.String str)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String append​(char c)  
      String append​(double d)  
      String append​(java.lang.Object... obj)  
      void clear()  
      Point<java.lang.Integer> getBounds​(Font f)  
      java.lang.StringBuilder getBuilder()  
      int indexOf​(java.lang.String str)
      Returns the index within this string of the first occurrence of the specified substring.
      int indexOf​(java.lang.String str, int fromIndex)
      Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
      int length()  
      String replace​(int start, int end, java.lang.String str)
      Replaces the characters in a substring of this sequence with characters in the specified String.
      String substring​(int start)
      Returns a new String that contains a subsequence of characters currently contained in this character sequence.
      String substring​(int start, int end)
      Returns a new String that contains a subsequence of characters currently contained in this sequence.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • String

        public String()
      • String

        public String​(java.lang.String str)
      • String

        public String​(java.lang.Object obj)
      • String

        public String​(double d)
    • Method Detail

      • append

        public String append​(double d)
      • append

        public String append​(char c)
      • append

        public String append​(java.lang.Object... obj)
      • getBuilder

        public java.lang.StringBuilder getBuilder()
      • indexOf

        public int indexOf​(java.lang.String str)
        Returns the index within this string of the first occurrence of the specified substring.

        The returned index is the smallest value k for which:

        
         this.toString().startsWith(str, k)
         
        If no such value of k exists, then -1 is returned.
        Parameters:
        str - the substring to search for.
        Returns:
        the index of the first occurrence of the specified substring, or -1 if there is no such occurrence.
      • clear

        public void clear()
      • indexOf

        public int indexOf​(java.lang.String str,
                           int fromIndex)
        Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.

        The returned index is the smallest value k for which:

        
             k >= Math.min(fromIndex, this.length()) &&
                           this.toString().startsWith(str, k)
         
        If no such value of k exists, then -1 is returned.
        Parameters:
        str - the substring to search for.
        fromIndex - the index from which to start the search.
        Returns:
        the index of the first occurrence of the specified substring, starting at the specified index, or -1 if there is no such occurrence.
      • replace

        public String replace​(int start,
                              int end,
                              java.lang.String str)
        Replaces the characters in a substring of this sequence with characters in the specified String. The substring begins at the specified start and extends to the character at index end - 1 or to the end of the sequence if no such character exists. First the characters in the substring are removed and then the specified String is inserted at start. (This sequence will be lengthened to accommodate the specified String if necessary.)
        Parameters:
        start - The beginning index, inclusive.
        end - The ending index, exclusive.
        str - String that will replace previous contents.
        Returns:
        This object.
        Throws:
        java.lang.StringIndexOutOfBoundsException - if start is negative, greater than length(), or greater than end.
      • substring

        public String substring​(int start)
        Returns a new String that contains a subsequence of characters currently contained in this character sequence. The substring begins at the specified index and extends to the end of this sequence.
        Parameters:
        start - The beginning index, inclusive.
        Returns:
        The new string.
        Throws:
        java.lang.StringIndexOutOfBoundsException - if start is less than zero, or greater than the length of this object.
      • substring

        public String substring​(int start,
                                int end)
        Returns a new String that contains a subsequence of characters currently contained in this sequence. The substring begins at the specified start and extends to the character at index end - 1.
        Parameters:
        start - The beginning index, inclusive.
        end - The ending index, exclusive.
        Returns:
        The new string.
        Throws:
        java.lang.StringIndexOutOfBoundsException - if start or end are negative or greater than length(), or start is greater than end.
      • length

        public int length()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getBounds

        public Point<java.lang.Integer> getBounds​(Font f)