javanpst.data.structures.sequence
Class Sequence
- java.lang.Object
-
- javanpst.data.structures.sequence.Sequence
-
- Direct Known Subclasses:
- NumericSequence, StringSequence
public abstract class Sequence extends java.lang.ObjectAn abstract class representing sequences of data
-
-
Field Summary
Fields Modifier and Type Field and Description static intDOWNstatic intNUMERICConstants identifying kind of datastatic intSTRINGstatic intUPType of trends in sequences
-
Constructor Summary
Constructors Constructor and Description Sequence()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description abstract voidappend(java.lang.Object value)Adds a new element to the end of the sequenceabstract voidclear()Clears the sequenceabstract voidprepend(java.lang.Object value)Adds a new element to the start of the sequenceabstract voidreadCSV(java.lang.String file)Loads a sequence from a CSV fileabstract voidreadTXT(java.lang.String file)Loads a sequence from a TXT fileabstract voidreadXML(java.lang.String file)Loads a sequence from a XML fileabstract intsize()Get size of the sequenceabstract java.lang.StringtoString()To String methodabstract voidwriteCSV(java.lang.String file, boolean useComma)Writes a sequence to a CSV fileabstract voidwriteTXT(java.lang.String file)Writes a sequence to a TXT fileabstract voidwriteXML(java.lang.String file)Writes a sequence to a XML file
-
-
-
Field Detail
-
NUMERIC
public static final int NUMERIC
Constants identifying kind of data- See Also:
- Constant Field Values
-
STRING
public static final int STRING
- See Also:
- Constant Field Values
-
UP
public static final int UP
Type of trends in sequences- See Also:
- Constant Field Values
-
DOWN
public static final int DOWN
- See Also:
- Constant Field Values
-
-
Method Detail
-
size
public abstract int size()
Get size of the sequence- Returns:
- size of the sequence
-
clear
public abstract void clear()
Clears the sequence
-
append
public abstract void append(java.lang.Object value)
Adds a new element to the end of the sequence- Parameters:
value- value to add
-
prepend
public abstract void prepend(java.lang.Object value)
Adds a new element to the start of the sequence- Parameters:
value- value to add
-
toString
public abstract java.lang.String toString()
To String method- Overrides:
toStringin classjava.lang.Object
-
readXML
public abstract void readXML(java.lang.String file)
Loads a sequence from a XML file- Parameters:
file- path of the file
-
writeXML
public abstract void writeXML(java.lang.String file)
Writes a sequence to a XML file- Parameters:
file- path of the file
-
readCSV
public abstract void readCSV(java.lang.String file)
Loads a sequence from a CSV file- Parameters:
file- path of the file
-
writeCSV
public abstract void writeCSV(java.lang.String file, boolean useComma)Writes a sequence to a CSV file- Parameters:
file- path of the fileuseComma- true true if "," is used as separator, false if ";" is used instead
-
readTXT
public abstract void readTXT(java.lang.String file)
Loads a sequence from a TXT file- Parameters:
file- path of the file
-
writeTXT
public abstract void writeTXT(java.lang.String file)
Writes a sequence to a TXT file- Parameters:
file- path of the file
-
-
DMelt 3.0 © DataMelt by jWork.ORG