ru.mfd.api
Interface Row


public interface Row

Data representation class provides various methods to access the values of different types by catalog field number or by acronym name. Fields numeration is 0-based. e.g., 0 for the first field.

User: MMarkelov Date: 15.10.12 Time: 11:13


Method Summary
 void clear()
          Removes all of the keys and values from this row.
 boolean containsAcronym(java.lang.String key)
          Returns true if this row contains value for the specified field acronym.
 boolean containsNum(int key)
          Returns true if this row contains value for the specified field number.
 Row getCopy()
          Returns a copy of this row.
 java.lang.Double getDoubleByAcronym(java.lang.String key)
          Searches for the value with the specified field acronym in this row.
 java.lang.Double getDoubleByAcronym(java.lang.String key, java.lang.Double defaultValue)
          Searches for the value with the specified field acronym in this row.
 java.lang.Double getDoubleByNum(int key)
          Searches for the value with the specified field number in this row.
 java.lang.Double getDoubleByNum(int key, java.lang.Double defaultValue)
          Searches for the value with the specified field number in this row.
 java.lang.Integer getIntByAcronym(java.lang.String key)
          Searches for the value with the specified field acronym in this row.
 java.lang.Integer getIntByAcronym(java.lang.String key, java.lang.Integer defaultValue)
          Searches for the value with the specified field acronym in this row.
 java.lang.Integer getIntByNum(int key)
          Searches for the value with the specified field number in this row.
 java.lang.Integer getIntByNum(int key, java.lang.Integer defaultValue)
          Searches for the value with the specified field number in this row.
 java.lang.Long getLongByAcronym(java.lang.String key)
          Searches for the value with the specified field acronym in this row.
 java.lang.Long getLongByAcronym(java.lang.String key, java.lang.Long defaultValue)
          Searches for the value with the specified field acronym in this row.
 java.lang.Long getLongByNum(int key)
          Searches for the value with the specified field number in this row.
 java.lang.Long getLongByNum(int key, java.lang.Long defaultValue)
          Searches for the value with the specified field number in this row.
 java.lang.String getStringByAcronym(java.lang.String key)
          Searches for the value with the specified field acronym in this row.
 java.lang.String getStringByAcronym(java.lang.String key, java.lang.String defaultValue)
          Searches for the value with the specified field acronym in this row.
 java.lang.String getStringByNum(int key)
          Searches for the value with the specified field number in this row.
 java.lang.String getStringByNum(int key, java.lang.String defaultValue)
          Searches for the value with the specified field number in this row.
 java.util.Set<java.lang.Integer> keySet()
          Returns a Set view of the keys contained in this row.
 void setDoubleByAcronym(java.lang.String key, double value)
          Adds the specified double value with the specified key to this row.
 void setDoubleByNum(int key, double value)
          Adds the specified double value with the specified key to this row.
 void setIntByAcronym(java.lang.String key, int value)
          Adds the specified int value with the specified key to this row.
 void setIntByNum(int key, int value)
          Adds the specified int value with the specified key to this row.
 void setLongByAcronym(java.lang.String key, long value)
          Adds the specified long value with the specified key to this row.
 void setLongByNum(int key, long value)
          Adds the specified long value with the specified key to this row.
 void setStringByAcronym(java.lang.String key, java.lang.String value)
          Adds the specified String value with the specified key to this row.
 void setStringByNum(int key, java.lang.String value)
          Adds the specified String value with the specified key to this row.
 int size()
          Returns the number of values in this row.
 

Method Detail

getCopy

Row getCopy()
Returns a copy of this row.


keySet

java.util.Set<java.lang.Integer> keySet()
Returns a Set view of the keys contained in this row. This set is unmodifiable. Keys of this set represent catalog fields numeration.

Returns:
a set view of the keys contained in this row

containsNum

boolean containsNum(int key)
Returns true if this row contains value for the specified field number.

Parameters:
key - key whose presence in this row is to be tested
Returns:
true if this row contains value for the specified field number

containsAcronym

boolean containsAcronym(java.lang.String key)
Returns true if this row contains value for the specified field acronym.

Parameters:
key - key whose presence in this row is to be tested
Returns:
true if this row contains value for the specified field acronym

size

int size()
Returns the number of values in this row.

Returns:
the number of values in this row

clear

void clear()
Removes all of the keys and values from this row. The row will be empty after this call returns.


getIntByNum

java.lang.Integer getIntByNum(int key)
                              throws java.lang.Exception
Searches for the value with the specified field number in this row. The result is an Integer object.

Parameters:
key - the row field number.
Returns:
the Integer value from this row with the specified field number.
Throws:
java.lang.Exception - if this row does not contain value for the specified field number or if the value is not valid integer number.

getIntByNum

java.lang.Integer getIntByNum(int key,
                              java.lang.Integer defaultValue)
                              throws java.lang.Exception
Searches for the value with the specified field number in this row. The method returns the default value argument if the field number is not found. The result is an Integer object.

Parameters:
key - the row field number.
defaultValue - a default Integer value.
Returns:
the Integer value from this row with the specified field number.
Throws:
java.lang.Exception - if the value is not valid integer number.

getIntByAcronym

java.lang.Integer getIntByAcronym(java.lang.String key)
                                  throws java.lang.Exception
Searches for the value with the specified field acronym in this row. The result is an Integer object.

Parameters:
key - the row field acronym.
Returns:
the Integer value from this row with the specified field acronym.
Throws:
java.lang.Exception - if this row does not contain value for the specified field acronym or if the value is not valid integer number.

getIntByAcronym

java.lang.Integer getIntByAcronym(java.lang.String key,
                                  java.lang.Integer defaultValue)
                                  throws java.lang.Exception
Searches for the value with the specified field acronym in this row. The method returns the default value argument if the field acronym is not found. The result is an Integer object.

Parameters:
key - the row field acronym.
defaultValue - a default Integer value.
Returns:
the Integer value from this row with the specified field acronym.
Throws:
java.lang.Exception - if the value is not valid integer number.

getLongByNum

java.lang.Long getLongByNum(int key)
                            throws java.lang.Exception
Searches for the value with the specified field number in this row. The result is a Long object.

Parameters:
key - the row field number.
Returns:
the Long value from this row with the specified field number.
Throws:
java.lang.Exception - if this row does not contain value for the specified field number or if the value is not valid long number.

getLongByNum

java.lang.Long getLongByNum(int key,
                            java.lang.Long defaultValue)
                            throws java.lang.Exception
Searches for the value with the specified field number in this row. The method returns the default value argument if the field number is not found. The result is a Long object.

Parameters:
key - the row field number.
defaultValue - a default Long value.
Returns:
the Long value from this row with the specified field number.
Throws:
java.lang.Exception - if the value is not valid long number.

getLongByAcronym

java.lang.Long getLongByAcronym(java.lang.String key)
                                throws java.lang.Exception
Searches for the value with the specified field acronym in this row. The result is a Long object.

Parameters:
key - the row field acronym.
Returns:
the Long value from this row with the specified field acronym.
Throws:
java.lang.Exception - if this row does not contain value for the specified field acronym or if the value is not valid long number.

getLongByAcronym

java.lang.Long getLongByAcronym(java.lang.String key,
                                java.lang.Long defaultValue)
                                throws java.lang.Exception
Searches for the value with the specified field acronym in this row. The method returns the default value argument if the field acronym is not found. The result is a Long object.

Parameters:
key - the row field acronym.
defaultValue - a default Long value.
Returns:
the Long value from this row with the specified field acronym.
Throws:
java.lang.Exception - if the value is not valid long number.

getDoubleByNum

java.lang.Double getDoubleByNum(int key)
                                throws java.lang.Exception
Searches for the value with the specified field number in this row. The result is a Double object.

Parameters:
key - the row field number.
Returns:
the Double value from this row with the specified field number.
Throws:
java.lang.Exception - if this row does not contain value for the specified field number or if the value is not valid double number.

getDoubleByNum

java.lang.Double getDoubleByNum(int key,
                                java.lang.Double defaultValue)
                                throws java.lang.Exception
Searches for the value with the specified field number in this row. The method returns the default value argument if the field number is not found. The result is a Double object.

Parameters:
key - the row field number.
defaultValue - a default Double value.
Returns:
the Double value from this row with the specified field number.
Throws:
java.lang.Exception - if the value is not valid double number.

getDoubleByAcronym

java.lang.Double getDoubleByAcronym(java.lang.String key)
                                    throws java.lang.Exception
Searches for the value with the specified field acronym in this row. The result is a Double object.

Parameters:
key - the row field acronym.
Returns:
the Double value from this row with the specified field acronym.
Throws:
java.lang.Exception - if this row does not contain value for the specified field acronym or if the value is not valid double number.

getDoubleByAcronym

java.lang.Double getDoubleByAcronym(java.lang.String key,
                                    java.lang.Double defaultValue)
                                    throws java.lang.Exception
Searches for the value with the specified field acronym in this row. The method returns the default value argument if the field acronym is not found. The result is a Double object.

Parameters:
key - the row field acronym.
defaultValue - a default Double value.
Returns:
the Double value from this row with the specified field acronym.
Throws:
java.lang.Exception - if the value is not valid double number.

getStringByNum

java.lang.String getStringByNum(int key)
Searches for the value with the specified field number in this row.

Parameters:
key - the row field number.
Returns:
the String value from this row with the specified field number, or null if the field number is not found in this row.

getStringByNum

java.lang.String getStringByNum(int key,
                                java.lang.String defaultValue)
Searches for the value with the specified field number in this row. The method returns the default value argument if the field number is not found. The result is a String object.

Parameters:
key - the row field number.
defaultValue - a default String value.
Returns:
the String value from this row with the specified field number.

getStringByAcronym

java.lang.String getStringByAcronym(java.lang.String key)
Searches for the value with the specified field acronym in this row.

Parameters:
key - the row field acronym.
Returns:
the String value from this row with the specified field acronym, or null if the field acronym is not found in this row.

getStringByAcronym

java.lang.String getStringByAcronym(java.lang.String key,
                                    java.lang.String defaultValue)
Searches for the value with the specified field acronym in this row. The method returns the default value argument if the field acronym is not found. The result is a String object.

Parameters:
key - the row field acronym.
defaultValue - a default String value.
Returns:
the String value from this row with the specified field acronym.

setStringByNum

void setStringByNum(int key,
                    java.lang.String value)
Adds the specified String value with the specified key to this row. If the row previously contained a value for the key, the old value is replaced by the specified value.

Parameters:
key - the row field number.
value - String value.

setStringByAcronym

void setStringByAcronym(java.lang.String key,
                        java.lang.String value)
Adds the specified String value with the specified key to this row. If the row previously contained a value for the key, the old value is replaced by the specified value.

Parameters:
key - the row field acronym.
value - String value.

setIntByNum

void setIntByNum(int key,
                 int value)
Adds the specified int value with the specified key to this row. If the row previously contained a value for the key, the old value is replaced by the specified value.

Parameters:
key - the row field number.
value - int value.

setIntByAcronym

void setIntByAcronym(java.lang.String key,
                     int value)
Adds the specified int value with the specified key to this row. If the row previously contained a value for the key, the old value is replaced by the specified value.

Parameters:
key - the row field acronym.
value - int value.

setLongByNum

void setLongByNum(int key,
                  long value)
Adds the specified long value with the specified key to this row. If the row previously contained a value for the key, the old value is replaced by the specified value.

Parameters:
key - the row field number.
value - long value.

setLongByAcronym

void setLongByAcronym(java.lang.String key,
                      long value)
Adds the specified long value with the specified key to this row. If the row previously contained a value for the key, the old value is replaced by the specified value.

Parameters:
key - the row field acronym.
value - long value.

setDoubleByNum

void setDoubleByNum(int key,
                    double value)
Adds the specified double value with the specified key to this row. If the row previously contained a value for the key, the old value is replaced by the specified value.

Parameters:
key - the row field number.
value - double value.

setDoubleByAcronym

void setDoubleByAcronym(java.lang.String key,
                        double value)
Adds the specified double value with the specified key to this row. If the row previously contained a value for the key, the old value is replaced by the specified value.

Parameters:
key - the row field acronym.
value - double value.


Copyright 2015 IFH-InfoCentre, Ltd.