|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.di.core.row.RowMeta
public class RowMeta
Field Summary | |
---|---|
static String |
XML_DATA_TAG
|
static String |
XML_META_TAG
|
Constructor Summary | |
---|---|
RowMeta()
|
|
RowMeta(DataInputStream inputStream)
|
|
RowMeta(Node node)
Create a new row metadata object from XML |
Method Summary | |
---|---|
void |
addRowMeta(RowMetaInterface rowMeta)
Add a number of fields from another row (append to the end) |
void |
addValueMeta(int index,
ValueMetaInterface meta)
Add a metadata value on a certain location in the row. |
void |
addValueMeta(ValueMetaInterface meta)
Add a metadata value. |
void |
clear()
Clear the row metadata |
RowMeta |
clone()
|
Object[] |
cloneRow(Object[] objects)
|
Object[] |
cloneRow(Object[] objects,
Object[] newObjects)
|
int |
compare(Object[] rowData1,
Object[] rowData2)
Compare 2 rows with each other using all values in the rows and also considering the specified ascending clauses of the value metadata. |
int |
compare(Object[] rowData1,
Object[] rowData2,
int[] fieldnrs)
Compare 2 rows with each other using certain values in the rows and also considering the specified ascending clauses of the value metadata. |
int |
compare(Object[] rowData1,
Object[] rowData2,
int[] fieldnrs1,
int[] fieldnrs2)
Compare 2 rows with each other using certain values in the rows and also considering the specified ascending clauses of the value metadata. |
int |
compare(Object[] rowData1,
RowMetaInterface rowMeta2,
Object[] rowData2,
int[] fieldnrs1,
int[] fieldnrs2)
Compare 2 rows with each other using certain values in the rows and also considering the specified ascending clauses of the value metadata. |
int |
convertedValuesHashCode(Object[] rowData)
Calculates a hashcode of the converted value of all objects in the supplied row. |
static Row |
createOriginalRow(RowMetaInterface rowMeta,
Object[] rowData)
|
boolean |
equals(Object[] rowData1,
Object[] rowData2,
int[] fieldnrs)
Compare 2 rows with each other for equality using certain values in the rows and also considering the case sensitivity flag. |
boolean |
exists(ValueMetaInterface meta)
Check if a value is already present in this row with the same name |
static byte[] |
extractData(RowMetaInterface metadata,
Object[] row)
Serialize a row of data to byte[] |
BigDecimal |
getBigNumber(Object[] dataRow,
int index)
Get a BigNumber value from a row of data. |
byte[] |
getBinary(Object[] dataRow,
int index)
Get a Binary value from a row of data. |
Boolean |
getBoolean(Object[] dataRow,
int index)
Get a Boolean value from a row of data. |
String |
getDataXML(Object[] rowData)
|
Date |
getDate(Object[] dataRow,
int index)
Get a Date value from a row of data. |
Date |
getDate(Object[] dataRow,
String valueName,
Date defaultValue)
|
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(Object[] dataRow,
int index)
Get an Integer value from a row of data. |
Long |
getInteger(Object[] dataRow,
String valueName,
Long defaultValue)
|
String |
getMetaXML()
|
Double |
getNumber(Object[] dataRow,
int index)
Get a Number value from a row of data. |
Object[] |
getRow(Node node)
Convert an XML node into binary data using the row metadata supplied. |
static Object[] |
getRow(RowMetaInterface metadata,
byte[] data)
Create a row of data bases on a serialized format (byte[]) |
String |
getString(Object[] row)
Get the string representation of the data in a row of data |
String |
getString(Object[] dataRow,
int index)
Get a String value from a row of data. |
String |
getString(Object[] dataRow,
String valueName,
String defaultValue)
|
ValueMetaInterface |
getValueMeta(int index)
Get the value metadata on the specified index. |
List<ValueMetaInterface> |
getValueMetaList()
|
int |
hashCode(Object[] rowData)
Calculates a simple hashCode of all the native data objects in the supplied row. |
int |
indexOfValue(String valueName)
Searches the index of a value meta with a given name |
boolean |
isEmpty()
|
boolean |
isNull(Object[] dataRow,
int index)
Determines whether a value in a row is null. |
void |
mergeRowMeta(RowMetaInterface r)
Merge the values of row r to this Row. |
int |
oldXORHashCode(Object[] rowData)
Deprecated. |
Object[] |
readData(DataInputStream inputStream)
De-serialize a row of data (no metadata is read) from an input stream |
void |
removeValueMeta(int index)
Remove a value metadata object on a certain index in the row |
void |
removeValueMeta(String valueName)
Remove a value with a certain name from the row metadata |
ValueMetaInterface |
searchValueMeta(String valueName)
Searches for a value with a certain name in the value meta list |
void |
setValueMeta(int index,
ValueMetaInterface valueMeta)
Replaces a value meta entry in the row metadata with another one |
void |
setValueMetaList(List<ValueMetaInterface> valueMetaList)
|
int |
size()
|
String |
toString()
|
String |
toStringMeta()
|
void |
writeData(DataOutputStream outputStream,
Object[] data)
Write ONLY the specified data to the outputStream |
void |
writeMeta(DataOutputStream outputStream)
Write ONLY the specified metadata to the outputStream |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String XML_META_TAG
public static final String XML_DATA_TAG
Constructor Detail |
---|
public RowMeta()
public RowMeta(DataInputStream inputStream) throws KettleFileException, KettleEOFException, SocketTimeoutException
KettleFileException
KettleEOFException
SocketTimeoutException
public RowMeta(Node node) throws KettleException
node
- the XML node to deserialize from
IOException
- Thrown in case there is an (Base64/GZip) decoding problem
KettleException
Method Detail |
---|
public RowMeta clone()
clone
in interface RowMetaInterface
clone
in class Object
public String toString()
toString
in class Object
public List<ValueMetaInterface> getValueMetaList()
getValueMetaList
in interface RowMetaInterface
public void setValueMetaList(List<ValueMetaInterface> valueMetaList)
setValueMetaList
in interface RowMetaInterface
valueMetaList
- the list of valueMeta to setpublic int size()
size
in interface RowMetaInterface
public boolean isEmpty()
isEmpty
in interface RowMetaInterface
public boolean exists(ValueMetaInterface meta)
RowMetaInterface
exists
in interface RowMetaInterface
meta
- the value to check for existence
public void addValueMeta(ValueMetaInterface meta)
addValueMeta
in interface RowMetaInterface
meta
- The metadata value to addpublic void addValueMeta(int index, ValueMetaInterface meta)
addValueMeta
in interface RowMetaInterface
index
- The index where the metadata value needs to be put in the rowmeta
- The metadata value to add to the rowpublic ValueMetaInterface getValueMeta(int index)
getValueMeta
in interface RowMetaInterface
index
- The index to get the value metadata from
public void setValueMeta(int index, ValueMetaInterface valueMeta)
setValueMeta
in interface RowMetaInterface
index
- The index in the row to replace atvalueMeta
- the metadata to replace withpublic String getString(Object[] dataRow, int index) throws KettleValueException
getString
in interface RowMetaInterface
rowRow
- the row of dataindex
- the index
KettleValueException
- in case there was a problem converting the data.public Long getInteger(Object[] dataRow, int index) throws KettleValueException
getInteger
in interface RowMetaInterface
rowRow
- the row of dataindex
- the index
KettleValueException
- in case there was a problem converting the data.public Double getNumber(Object[] dataRow, int index) throws KettleValueException
getNumber
in interface RowMetaInterface
rowRow
- the row of dataindex
- the index
KettleValueException
- in case there was a problem converting the data.public Date getDate(Object[] dataRow, int index) throws KettleValueException
getDate
in interface RowMetaInterface
rowRow
- the row of dataindex
- the index
KettleValueException
- in case there was a problem converting the data.public BigDecimal getBigNumber(Object[] dataRow, int index) throws KettleValueException
getBigNumber
in interface RowMetaInterface
rowRow
- the row of dataindex
- the index
KettleValueException
- in case there was a problem converting the data.public Boolean getBoolean(Object[] dataRow, int index) throws KettleValueException
getBoolean
in interface RowMetaInterface
rowRow
- the row of dataindex
- the index
KettleValueException
- in case there was a problem converting the data.public byte[] getBinary(Object[] dataRow, int index) throws KettleValueException
getBinary
in interface RowMetaInterface
rowRow
- the row of dataindex
- the index
KettleValueException
- in case there was a problem converting the data.public boolean isNull(Object[] dataRow, int index) throws KettleValueException
isNull
in interface RowMetaInterface
dataRow
- The row of dataindex
- the index to reference
KettleValueException
- in case there is a conversion error (only thrown in case of lazy conversion)public Object[] cloneRow(Object[] objects) throws KettleValueException
cloneRow
in interface RowMetaInterface
KettleValueException
- in case something is not quite right with the expected datapublic Object[] cloneRow(Object[] objects, Object[] newObjects) throws KettleValueException
cloneRow
in interface RowMetaInterface
KettleValueException
- in case something is not quite right with the expected datapublic String getString(Object[] dataRow, String valueName, String defaultValue) throws KettleValueException
getString
in interface RowMetaInterface
KettleValueException
public Long getInteger(Object[] dataRow, String valueName, Long defaultValue) throws KettleValueException
getInteger
in interface RowMetaInterface
KettleValueException
public Date getDate(Object[] dataRow, String valueName, Date defaultValue) throws KettleValueException
getDate
in interface RowMetaInterface
KettleValueException
public int indexOfValue(String valueName)
indexOfValue
in interface RowMetaInterface
valueName
- the name of the value metadata to look for
public ValueMetaInterface searchValueMeta(String valueName)
searchValueMeta
in interface RowMetaInterface
valueName
- The value name to search for
public void addRowMeta(RowMetaInterface rowMeta)
RowMetaInterface
addRowMeta
in interface RowMetaInterface
rowMeta
- The row of metadata values to addpublic void mergeRowMeta(RowMetaInterface r)
mergeRowMeta
in interface RowMetaInterface
r
- The row to be merged with this rowpublic String[] getFieldNames()
getFieldNames
in interface RowMetaInterface
public void writeData(DataOutputStream outputStream, Object[] data) throws KettleFileException
writeData
in interface RowMetaInterface
outputStream
- the outputstream to write todata
- the data to write after the metadata
KettleFileException
- in case things go awrypublic void writeMeta(DataOutputStream outputStream) throws KettleFileException
writeMeta
in interface RowMetaInterface
outputStream
- the outputstream to write to
KettleFileException
- in case things go awrypublic Object[] readData(DataInputStream inputStream) throws KettleFileException, KettleEOFException, SocketTimeoutException
RowMetaInterface
readData
in interface RowMetaInterface
inputStream
- the inputstream to read from
KettleFileException
- in case a I/O error occurs
SocketTimeoutException
- In case there is a timeout during reading.
KettleEOFException
public void clear()
RowMetaInterface
clear
in interface RowMetaInterface
public void removeValueMeta(String valueName) throws KettleValueException
RowMetaInterface
removeValueMeta
in interface RowMetaInterface
valueName
- the name of the value metadata to remove
KettleValueException
- in case the value couldn't be found in the row metadatapublic void removeValueMeta(int index)
RowMetaInterface
removeValueMeta
in interface RowMetaInterface
index
- the index to remove the value metadata frompublic String toStringMeta()
toStringMeta
in interface RowMetaInterface
public String getString(Object[] row) throws KettleValueException
getString
in interface RowMetaInterface
row
- the row of data to convert to string
KettleValueException
- in case of a conversion errorpublic String[] getFieldNamesAndTypes(int maxlen)
getFieldNamesAndTypes
in interface RowMetaInterface
maxlen
- The length to which the name will be padded.
public int compare(Object[] rowData1, Object[] rowData2, int[] fieldnrs) throws KettleValueException
compare
in interface RowMetaInterface
rowData1
- The first row of datarowData2
- The second row of datafieldnrs
- the fields to compare on (in that order)
KettleValueException
public boolean equals(Object[] rowData1, Object[] rowData2, int[] fieldnrs) throws KettleValueException
equals
in interface RowMetaInterface
rowData1
- The first row of datarowData2
- The second row of datafieldnrs
- the fields to compare on (in that order)
KettleValueException
public int compare(Object[] rowData1, Object[] rowData2, int[] fieldnrs1, int[] fieldnrs2) throws KettleValueException
compare
in interface RowMetaInterface
rowData1
- The first row of datarowData2
- The second row of datafieldnrs1
- The indexes of the values to compare in the first rowfieldnrs2
- The indexes of the values to compare with in the second row
KettleValueException
public int compare(Object[] rowData1, RowMetaInterface rowMeta2, Object[] rowData2, int[] fieldnrs1, int[] fieldnrs2) throws KettleValueException
compare
in interface RowMetaInterface
rowData1
- The first row of datarowMeta2
- the metadata of the second row of datarowData2
- The second row of datafieldnrs1
- The indexes of the values to compare in the first rowfieldnrs2
- The indexes of the values to compare with in the second row
KettleValueException
public int compare(Object[] rowData1, Object[] rowData2) throws KettleValueException
compare
in interface RowMetaInterface
rowData1
- The first row of datarowData2
- The second row of data
KettleValueException
public int oldXORHashCode(Object[] rowData) throws KettleValueException
oldXORHashCode
in interface RowMetaInterface
rowData
- The data to calculate a hashCode with
KettleValueException
- in case there is a data conversion errorpublic int hashCode(Object[] rowData) throws KettleValueException
hashCode
in interface RowMetaInterface
rowData
- The data to calculate a hashCode with
KettleValueException
- in case there is a data conversion errorpublic int convertedValuesHashCode(Object[] rowData) throws KettleValueException
convertedValuesHashCode
in interface RowMetaInterface
rowData
- The data to calculate a hashCode with
KettleValueException
- in case there is a data conversion errorpublic static final byte[] extractData(RowMetaInterface metadata, Object[] row)
metadata
- the metadata to userow
- the row of data
public static final Object[] getRow(RowMetaInterface metadata, byte[] data)
data
- the serialized datametadata
- the metadata to use
public static Row createOriginalRow(RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException
KettleValueException
public String getMetaXML() throws IOException
getMetaXML
in interface RowMetaInterface
IOException
- Thrown in case there is an (Base64/GZip) encoding problempublic String getDataXML(Object[] rowData) throws IOException
getDataXML
in interface RowMetaInterface
rowData
- the row of data to serialize as XML
IOException
- Thrown in case there is an (Base64/GZip) encoding problempublic Object[] getRow(Node node) throws KettleException
getRow
in interface RowMetaInterface
node
- The data row node
IOException
- Thrown in case there is an (Base64/GZip) decoding problem
KettleException
- Thrown in case there is an (Base64/GZip) decoding problem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |