Class Strings

java.lang.Object
it.ramecera.salad.everyday.Strings

public class Strings
extends java.lang.Object

Static methods of various utility.

Company: Rameceraâ„¢
Creation date: 2020-04-09
Last updated: 2020-04-09

Changes:

Since:
1.2.3
Author:
M. Maglioni
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String[] tokenE
    entities to convert
    static java.lang.String[] tradE
    converted entities
  • Constructor Summary

    Constructors 
    Constructor Description
    Strings()  
  • Method Summary

    Modifier and Type Method Description
    static Point2D cercaStringa_A​(java.util.List<java.lang.String> z, java.lang.String s)
    Search for a string within a list-array of strings.
    static Point2D cercaStringa_A​(java.util.List<java.lang.String> z, java.lang.String s, int occo)
    Searches for a specific occurrence of a string within an array list of strings.
    static Point2D cercaStringa_A​(java.util.List<java.lang.String> z, java.lang.String s0, java.lang.String s1)
    Search for two ordered strings within an array list of strings.
    static Point2D cercaStringa_A​(java.util.List<java.lang.String> z, java.lang.String s0, java.lang.String s1, java.lang.String s2)
    Searches for three strings sorted within a list-array of strings.
    static java.lang.String compact_A​(java.lang.String s)
    Starting from a sentence, compact the multiple spaces between words by replacing them with a single space; it also eliminates head and tail spaces.
    static java.lang.String compatta_B​(java.lang.String s)
    Starting from a sentence, compact the multiple spaces between words by replacing them with a single space; it also eliminates head and tail spaces.
    static java.lang.String[] gettoni_A​(java.lang.String t, java.lang.String pv, java.lang.String v2)
    Extracts tokens from a line of CSV files.
    static java.lang.String normalizzaTestoTaggato​(java.lang.String s)
    Clear all tags and spaces; therefore all words are sewn together.
    static java.lang.String[] parole_A​(java.lang.String s)
    Starting from a sentence, it produces the detached words and packed in an array.
    static java.lang.String replaceFirst​(java.lang.String s, java.lang.String target, java.lang.String replace)
    Searches for the first occurrence of a substring in a string and replaces it with something else.
    static java.lang.String sostituisciEntities​(java.lang.String s)
    Replaces the entities with what is indicated in the second table.
    static java.lang.String[] tokens_B​(java.lang.String t, java.lang.String pv, java.lang.String v2)
    Extracts the tokens from a line of CSV files, but (assuming that the characters are the semicolon and the double quotation mark) it takes into account the possibility that inside a token delimited by quotes there is a semicolon, which therefore should not be considered a delimiter.
    static java.util.List<java.util.List<java.lang.String>> tokens_C​(java.lang.String g, java.lang.String pv, java.lang.String v2, Dynamics din)
    Extracts the tokens from a line of CSV files, but (assuming that the characters are the semicolon and the double quotation mark) it takes into account the possibility that inside a token delimited by quotes there must be a semicolon, which therefore should not be considered a delimiter

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • tokenE

      public static final java.lang.String[] tokenE
      entities to convert
    • tradE

      public static final java.lang.String[] tradE
      converted entities
  • Constructor Details

  • Method Details

    • sostituisciEntities

      public static java.lang.String sostituisciEntities​(java.lang.String s)

      Replaces the entities with what is indicated in the second table. array

      version: 1.0.0
      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      s - the sentence to be treated
      Returns:
      the array of words
    • parole_A

      public static java.lang.String[] parole_A​(java.lang.String s)

      Starting from a sentence, it produces the detached words and packed in an array.

      version: 1.0.0
      Creation date: 2020-04-09
      last modified date : 2020-04-09

      Changes:

      Parameters:
      s - the sentence to be treated
      Returns:
      the array of words
    • compact_A

      public static java.lang.String compact_A​(java.lang.String s)

      Starting from a sentence, compact the multiple spaces between words by replacing them with a single space; it also eliminates head and tail spaces.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      s - the sentence to be treated
      Returns:
      the compacted sentence
    • compatta_B

      public static java.lang.String compatta_B​(java.lang.String s)

      Starting from a sentence, compact the multiple spaces between words by replacing them with a single space; it also eliminates head and tail spaces.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      s - the sentence to be treated
      Returns:
      the compacted sentence
    • cercaStringa_A

      public static Point2D cercaStringa_A​(java.util.List<java.lang.String> z, java.lang.String s)

      Search for a string within a list-array of strings. If it finds it, it gives the row-column coordinates; if it does not find it, it gives coordinates -1 and -1.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      z - the array list to search for
      s - the string to search for
      Returns:
      the coordinates of the found string, or the pair of values ​​(-1, -1)
    • cercaStringa_A

      public static Point2D cercaStringa_A​(java.util.List<java.lang.String> z, java.lang.String s0, java.lang.String s1)

      Search for two ordered strings within an array list of strings. If it finds them, it gives the row-column coordinates of the first string; if it does not find it, it gives coordinates -1 and -1. Variant of the previous one.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      z - the array list to search for
      s0 - the 1st string to search
      s1 - the 2nd string to search
      Returns:
      the coordinates of the string found, or the pair of values ​​(-1, -1)
    • cercaStringa_A

      public static Point2D cercaStringa_A​(java.util.List<java.lang.String> z, java.lang.String s0, java.lang.String s1, java.lang.String s2)

      Searches for three strings sorted within a list-array of strings. If it finds them, it gives the row-column coordinates of the first string; if it does not find it, it gives coordinates -1 and -1. Variant of the previous one.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      z - the array list to search for
      s0 - the 1st string to search
      s1 - the 2nd string to search
      s2 - the 3rd string to search
      Returns:
      the coordinates of the found string, or the pair of values (-1, -1)
    • cercaStringa_A

      public static Point2D cercaStringa_A​(java.util.List<java.lang.String> z, java.lang.String s, int occo)

      Searches for a specific occurrence of a string within an array list of strings. If it finds it, it gives the row-column coordinates; if it does not find it, it gives coordinates -1 and -1. Variant of the previous one.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      z - the array list to search for
      s - the string to search for
      occo - occurrence of the string to search for
      Returns:
      the coordinates of the found string, or the pair of values ​​(-1, -1)
    • gettoni_A

      public static java.lang.String[] gettoni_A​(java.lang.String t, java.lang.String pv, java.lang.String v2)

      Extracts tokens from a line of CSV files. If the line ends with the delimiting character, the delimiting character is not taken into account.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      t - the line to be processed
      pv - the separation character, usually;
      v2 - the delimiting character, usually "
      Returns:
      the resulting string array
    • tokens_B

      public static java.lang.String[] tokens_B​(java.lang.String t, java.lang.String pv, java.lang.String v2) throws ExactException

      Extracts the tokens from a line of CSV files, but (assuming that the characters are the semicolon and the double quotation mark) it takes into account the possibility that inside a token delimited by quotes there is a semicolon, which therefore should not be considered a delimiter. If a line ends with the delimiting character, the delimiting character is not taken into account.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      t - the line to be processed
      pv - the separation character, usually;
      v2 - the delimitation character, usually "
      Returns:
      the resulting string array
      Throws:
      ExactException - standard exception
    • tokens_C

      public static java.util.List<java.util.List<java.lang.String>> tokens_C​(java.lang.String g, java.lang.String pv, java.lang.String v2, Dynamics din) throws ExactException, java.io.FileNotFoundException, java.io.IOException

      Extracts the tokens from a line of CSV files, but (assuming that the characters are the semicolon and the double quotation mark) it takes into account the possibility that inside a token delimited by quotes there must be a semicolon, which therefore should not be considered a delimiter

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Parameters:
      g - the file input
      pv - the separation character, usually;
      v2 - the delimitation character, usually "
      din - the progress bar with its neighboring labels
      Returns:
      the resulting string array
      Throws:
      ExactException - standard exception
      java.io.IOException - standard exception
      java.io.FileNotFoundException - standard exception
    • normalizzaTestoTaggato

      public static java.lang.String normalizzaTestoTaggato​(java.lang.String s)

      Clear all tags and spaces; therefore all words are sewn together.

      Parameters:
      s - my text
      Returns:
      the normalized string
    • replaceFirst

      public static java.lang.String replaceFirst​(java.lang.String s, java.lang.String target, java.lang.String replace)

      Searches for the first occurrence of a substring in a string and replaces it with something else.

      Creation date: 2020-04-09
      Last updated: 2020-04-09

      Changes:

      Parameters:
      s - the starting string
      target - the substring to search for
      replace - the string to replace
      Returns:
      the resulting string