Documentation of 'javanpst.data.structures.sequence.StringSequence' Java class
StringSequence
javanpst.data.structures.sequence

Class StringSequence



  • public class StringSequence
    extends Sequence
    A class representing string sequences
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void append(java.lang.Object text)
      Adds an element to the end of the sequence
      void clear()
      Clear the sequence
      java.lang.String get(int index)
      Get an element of the sequence
      java.util.ArrayList<java.lang.String> getSequence()
      Returns the contents of the sequence as an array
      boolean isBinary()
      Checks is the sequence is binary
      void prepend(java.lang.Object text)
      Adds an element to the start of the sequence
      void readCSV(java.lang.String file)
      Loads a string sequence from a CSV file
      void readTXT(java.lang.String file)
      Loads a string sequence from a TXT file
      void readXML(java.lang.String file)
      Loads a string sequence from a XML file
      int size()
      Get the size of the sequence
      java.lang.String toString()
      To String method
      void writeCSV(java.lang.String file, boolean useComma)
      Writes a string sequence to a CSV file
      void writeTXT(java.lang.String file)
      Writes a string sequence to a TXT file
      void writeXML(java.lang.String file)
      Writes a string sequence to a XML file
      • Methods inherited from class java.lang.Object

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

      • StringSequence

        public StringSequence()
        Default builder
      • StringSequence

        public StringSequence(java.util.ArrayList<java.lang.String> contents)
        Builder. Creates a new string sequence from an ArrayList of elements.
        Parameters:
        contents - array of elements
      • StringSequence

        public StringSequence(java.lang.String[] contents)
        Builder. Creates a new numeric sequence from an array of elements.
        Parameters:
        contents - array of elements
      • StringSequence

        public StringSequence(StringSequence copy)
        Copy constructor
        Parameters:
        copy - sequence to copy
    • Method Detail

      • getSequence

        public java.util.ArrayList<java.lang.String> getSequence()
        Returns the contents of the sequence as an array
        Returns:
        contents of the sequence
      • append

        public void append(java.lang.Object text)
        Adds an element to the end of the sequence
        Specified by:
        append in class Sequence
        Parameters:
        text - value to add
      • prepend

        public void prepend(java.lang.Object text)
        Adds an element to the start of the sequence
        Specified by:
        prepend in class Sequence
        Parameters:
        text - value to add
      • get

        public java.lang.String get(int index)
        Get an element of the sequence
        Parameters:
        index - index of the element
        Returns:
        the element. "" if index out of range
      • size

        public int size()
        Get the size of the sequence
        Specified by:
        size in class Sequence
        Returns:
        size
      • clear

        public void clear()
        Clear the sequence
        Specified by:
        clear in class Sequence
      • toString

        public java.lang.String toString()
        To String method
        Specified by:
        toString in class Sequence
      • isBinary

        public boolean isBinary()
        Checks is the sequence is binary
        Returns:
        True if the sequence is binary.
      • readXML

        public void readXML(java.lang.String file)
        Loads a string sequence from a XML file
        Specified by:
        readXML in class Sequence
        Parameters:
        file - path of the file
      • writeXML

        public void writeXML(java.lang.String file)
        Writes a string sequence to a XML file
        Specified by:
        writeXML in class Sequence
        Parameters:
        file - path of the file
      • readCSV

        public void readCSV(java.lang.String file)
        Loads a string sequence from a CSV file
        Specified by:
        readCSV in class Sequence
        Parameters:
        file - path of the file
      • writeCSV

        public void writeCSV(java.lang.String file,
                             boolean useComma)
        Writes a string sequence to a CSV file
        Specified by:
        writeCSV in class Sequence
        Parameters:
        file - path of the file
        useComma - true true if "," is used as separator, false if ";" is used instead
      • readTXT

        public void readTXT(java.lang.String file)
        Loads a string sequence from a TXT file
        Specified by:
        readTXT in class Sequence
        Parameters:
        file - path of the file
      • writeTXT

        public void writeTXT(java.lang.String file)
        Writes a string sequence to a TXT file
        Specified by:
        writeTXT in class Sequence
        Parameters:
        file - path of the file

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.