|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.di.compatibility.Row
public class Row
This class describes a single row in a stream of data. A row is a array/list of Value objects. Note that most methods in this class assume that a value with a certain name only occurs once in the Row.
Value
,
Serialized FormField Summary | |
---|---|
static long |
serialVersionUID
|
static String |
XML_TAG
|
Constructor Summary | |
---|---|
Row()
Create a new empty row (with 0 values) |
|
Row(DataInputStream dis)
Read a row of Values from an input-stream. |
|
Row(DataInputStream dis,
int size,
Row meta)
Read a number of Values without meta-data into a row. |
|
Row(DataInputStream dis,
Row meta)
Read a number of Values without meta-data into a row. |
|
Row(Node rowNode)
|
|
Row(Row r)
Creates a new row as a duplicate of the given row. |
Method Summary | |
---|---|
void |
add(Object obj)
Deprecated. |
void |
addRow(Row r)
Add all the values of row r to the Row. |
void |
addValue(int idx,
Value v)
Add a value on a certain location in the row. |
void |
addValue(Value v)
Add a value after the last value of the row |
void |
clear()
Removes all values from the row. |
Row |
Clone()
Returns an exact copy of this row. |
int |
compare(Row r)
Compare 2 complete rows of values with each other. |
int |
compare(Row r,
boolean caseInsensitive)
Compare 2 complete rows of values with each other |
int |
compare(Row r,
int[] fieldnrs,
boolean[] ascending)
Compare 2 rows with each other using certain values in the rows and also considering an ascending clause. |
int |
compare(Row r,
int[] fieldnrs,
boolean[] ascending,
boolean[] caseInsensitive)
|
int |
compare(Row r,
int[] fieldnrs1,
int[] fieldnrs2,
boolean[] ascending,
boolean[] caseInsensitive)
Compare 2 rows with each other using certain values in the rows and also considering an ascending clause. |
int |
compare(Row r,
int fieldnr,
boolean sort_desc)
Compare 2 rows with each other using one value in the rows and also considering an ascending clause. |
int |
compareTo(Row obj)
|
boolean |
equals(Object r)
|
static byte[] |
extractData(Row row)
|
Object |
get(int idx)
Deprecated. |
boolean |
getBoolean(String valuename,
boolean def)
Search for a value, if it doesn't occur in the row, return the default value. |
Date |
getDate(String valuename,
Date def)
Search for a value, if it doesn't occur in the row, return the default value. |
String[] |
getFieldNames()
Get an array of the names of all the Values in the Row. |
String[] |
getFieldNamesAndTypes(int maxlen)
Get an array of strings showing the name of the values in the row padded to a maximum length, followed by the types of the values. |
long |
getInteger(String valuename,
long def)
Search for a value, if it doesn't occur in the row, return the default value. |
double |
getNumber(String valuename,
double def)
Search for a value, if it doesn't occur in the row, return the default value. |
static Row |
getRow(byte[] data,
Row metadata)
|
long |
getShort(String valuename,
int def)
Search for a value, if it doesn't occur in the row, return the default value. |
String |
getString(String valuename,
String def)
Search for a value, if it doesn't occur in the row, return the default value. |
List<ValueUsedListener> |
getUsedValueListeners()
|
Value |
getValue(int index)
Get the value on a given position in the row. |
String |
getXML()
Return the XML representation of a row. |
int |
hashCode()
|
boolean |
isEmpty()
Checks whether or not the row is empty A row is empty if all the values in the row are null A row is empty if there are no values in the row. |
boolean |
isIgnored()
Check wether or not this row should be ignored... |
void |
mergeData(Row r)
Merge the data of row r to this Row. |
void |
mergeRow(Row r)
Merge the values of row r to this Row. |
void |
print()
Print the names and the String representations of the values of the Values in row to stdout. |
void |
remove(int idx)
Deprecated. |
void |
removeValue(int idx)
Remove a value on a certain index. |
boolean |
removeValue(String valname)
Remove a value with a given name from the row. |
Value |
searchValue(String name)
Search the Value by name in the row. |
int |
searchValueIndex(String name)
Search the Value by name in the row, return the Values index. |
void |
setIgnore()
Marks this row as to be ignored by the next steps. |
void |
setIgnore(boolean i)
Marks this row as to be ignored or not by the next steps. |
void |
setUsedValueListeners(List<ValueUsedListener> usedValueListeners)
|
void |
setValue(int idx,
Value v)
Set the value on index idx. |
int |
size()
Return number of Values in Row. |
static void |
sortRows(List<Row> rows,
int[] fieldNrs,
boolean[] ascDesc)
|
String |
toString()
Convert the row to a String representation. |
String |
toStringMeta()
Return the meta-data of a row as a String. |
void |
write(DataOutputStream dos)
Write the content of the row to a DataOutputStream. |
boolean |
writeData(DataOutputStream dos)
Write a row of Values to a DataOutputStream, without saving the meta-data. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String XML_TAG
public static final long serialVersionUID
Constructor Detail |
---|
public Row()
public Row(Row r)
r
- The row to be copied.public Row(DataInputStream dis) throws KettleFileException
dis
- The DataInputStream to read from
KettleFileException
public Row(DataInputStream dis, Row meta) throws KettleFileException
dis
- The DataInputStream to read frommeta
- The description (name, type, length, precision) of the values to be read (the same number of values are read)
KettleFileException
- if the row couldn't be created by reading from the data input stream.public Row(DataInputStream dis, int size, Row meta) throws KettleFileException
dis
- The DataInputStream to read fromsize
- the number or values to readmeta
- The description (name, type, length, precision) of the values to be read
KettleFileException
- if the row couldn't be created by reading from the data input stream.public Row(Node rowNode)
Method Detail |
---|
public Value getValue(int index)
index
- The position to look for
public void addValue(Value v)
v
- The value to add to the rowpublic void setValue(int idx, Value v)
idx
- The indexv
- The value to setpublic void addValue(int idx, Value v)
idx
- The index where the value needs to be put in the rowv
- The value to add to the rowpublic void add(Object obj)
obj
- the object to addpublic Object get(int idx)
idx
- the index to get the object from
public void remove(int idx)
idx
- The object to removepublic boolean removeValue(String valname)
valname
- The value name to remove from this row
public void removeValue(int idx)
idx
- the index to remove in the rowpublic void clear()
public void addRow(Row r)
r
- The row to be added to this row.public void mergeRow(Row r)
r
- The row to be merged with this rowpublic void mergeData(Row r)
r
- The row to be merged with this rowpublic int searchValueIndex(String name)
name
- the value name to search for.
public Value searchValue(String name)
name
- the value name to search for
public int size()
public void print()
public String toString()
toString
in class Object
public String toStringMeta()
public void setIgnore()
public void setIgnore(boolean i)
i
- true: ignore this row, false: don't ignore.public boolean isIgnored()
public void write(DataOutputStream dos) throws KettleFileException
dos
- The DataOutputStream to write to
KettleFileException
- if an error occurs.public boolean writeData(DataOutputStream dos) throws KettleFileException
dos
- The DataOutputStream to write to
KettleFileException
public int compare(Row r, int[] fieldnrs, boolean[] ascending)
r
- The row to compare withfieldnrs
- The indexes of the values to compareascending
- an entry for each value to compare where true means and normal compare, false the reverse.
public int compare(Row r, int[] fieldnrs, boolean[] ascending, boolean[] caseInsensitive)
public int compare(Row r, int[] fieldnrs1, int[] fieldnrs2, boolean[] ascending, boolean[] caseInsensitive)
r
- The row to compare withfieldnrs
- The indexes of the values to compare in the source row (this)fieldnrs2
- The indexes of the values to compare with.ascending
- an entry for each value to compare where true means and normal compare, false the reverse.
public int compare(Row r, int fieldnr, boolean sort_desc)
r
- The row to compare withfieldnr
- The indexe of the values to comparesort_desc
- true means and normal compare, false the reverse.
public int compare(Row r)
r
- the row to compare with
public int compare(Row r, boolean caseInsensitive)
r
- the row to compare with
public int compareTo(Row obj)
compareTo
in interface Comparable<Row>
public boolean equals(Object r)
equals
in class Object
public int hashCode()
hashCode
in class Object
public Row Clone()
public boolean isEmpty()
public String[] getFieldNames()
public String[] getFieldNamesAndTypes(int maxlen)
maxlen
- The length to which the name will be padded.
public boolean getBoolean(String valuename, boolean def)
valuename
- The valuename to look fordef
- The default value to return
public String getString(String valuename, String def)
valuename
- The valuename to look fordef
- The default value to return
public Date getDate(String valuename, Date def)
valuename
- The valuename to look fordef
- The default value to return
public double getNumber(String valuename, double def)
valuename
- The valuename to look fordef
- The default value to return
public long getInteger(String valuename, long def)
valuename
- The valuename to look fordef
- The default value to return
public long getShort(String valuename, int def)
valuename
- The valuename to look fordef
- The default value to return
public String getXML()
getXML
in interface XMLInterface
public static final void sortRows(List<Row> rows, int[] fieldNrs, boolean[] ascDesc)
public static final byte[] extractData(Row row)
public static final Row getRow(byte[] data, Row metadata)
public List<ValueUsedListener> getUsedValueListeners()
public void setUsedValueListeners(List<ValueUsedListener> usedValueListeners)
usedValueListeners
- the usedValueListeners to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |