ch.interlis.iom_j
Class Iom_jObject

java.lang.Object
  extended by ch.interlis.iom_j.Iom_jObject
All Implemented Interfaces:
IomObject

public class Iom_jObject
extends java.lang.Object
implements IomObject

This class provides a default implementation for the IomObject interface.

Author:
ceis

Constructor Summary
Iom_jObject(java.lang.String tag1, java.lang.String oid1)
          creates a new object.
 
Method Summary
 void addattrobj(java.lang.String attrName, IomObject obj)
          appends a new value to an indexed attribute with a structured type.
 IomObject addattrobj(java.lang.String attrName, java.lang.String type)
          Deprecated.  
 void changeattrobj(java.lang.String attrName, int index, IomObject obj)
          changes the value of an indexed attribute with a structured type.
 IomObject changeattrobj(java.lang.String attrName, int index, java.lang.String type)
          Deprecated.  
 void delete()
          disposes the underlying native object.
 void deleteattrobj(java.lang.String attrName, int index)
          removes a value from an indexed attibute with a structured type.
static java.lang.String dumpObject(IomObject obj)
          converts the contents of the given object for debuggung to a one line String.
 int getattrcount()
          gets the number of attributes of this object.
 java.lang.String getattrname(int index)
          gets an attribute name.
 IomObject getattrobj(java.lang.String attrName, int index)
          gets the value of an indexed attribute with a structured type.
 java.lang.String getattrprim(java.lang.String attrName, int index)
          gets the value of an indexed attribute with a primitive type.
 java.lang.String getattrvalue(java.lang.String attrName)
          gets the value of an attribute with a primitive type.
 int getattrvaluecount(java.lang.String attrName)
          gets the number of values of a given attribute.
 int getobjectcol()
          gets the column of the object in the file, if read from a file.
 int getobjectconsistency()
          gets the consistency (complete, incomplete, inconsistent, adapted) of this object.
 int getobjectline()
          gets the line of the object in the file, if read from a file.
 java.lang.String getobjectoid()
          gets the identifier of the object.
 int getobjectoperation()
          gets the operation mode (insert, update, delete) of this object.
 java.lang.String getobjectrefbid()
          gets the identifier of the basket containing the referenced object, if this object is a reference value.
 java.lang.String getobjectrefoid()
          gets the identifier of the referenced object, if this object is a reference value.
 long getobjectreforderpos()
          gets the ordering index, if this object is a reference value of an ordered relationship.
 java.lang.String getobjecttag()
          gets the type of the object.
 java.lang.String getxmleleattrname(int index)
          gets the name of the xml-element with the given xml-element index.
 int getxmlelecount()
          gets the number of xml-subelements.
 IomObject getxmleleobj(int index)
          gets the structured value of the xml-element with the given xml-element index.
 java.lang.String getxmleleprim(int index)
          gets the simple value of the xml-element with the given xml-element index.
 int getxmlelevalueidx(int index)
          gets the attribute value index of the xml-element with the given xml-element index.
 void insertattrobj(java.lang.String attrName, int index, IomObject obj)
          inserts a new value to an indexed attribute with a structured type.
 IomObject insertattrobj(java.lang.String attrName, int index, java.lang.String type)
          Deprecated.  
 void setattrundefined(java.lang.String attrName)
          Removes any values for a given attribute.
 void setattrvalue(java.lang.String attrName, java.lang.String value)
          sets the value of an attribute with a primitve type.
 void setobjectcol(int col)
          sets the column of the object in the file, if read from a file.
 void setobjectconsistency(int consistency1)
          sets the consistency (complete, incomplete, inconsistent, adapted) of this object.
 void setobjectline(int line)
          sets the line of the object in the file, if read from a file.
 void setobjectoid(java.lang.String oid1)
          sets the identifier of the object.
 void setobjectoperation(int operation)
          sets the operation mode (insert, update, delete) of this object.
 void setobjectrefbid(java.lang.String refbid1)
          sets the identifier of the basket containing the referenced object, if this object is a reference value.
 void setobjectrefoid(java.lang.String refoid1)
          sets the identifier of the referenced object, if this object is a reference value.
 void setobjectreforderpos(long orderpos1)
          sets the ordering index, if this object is a reference value of an ordered relationship.
 void setobjecttag(java.lang.String tag1)
          sets the type of the object.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Iom_jObject

public Iom_jObject(java.lang.String tag1,
                   java.lang.String oid1)
creates a new object. Do not use this function, unless you know what you do. Applications should use the factory method of the reader or writer.

Parameters:
tag1 - type of new object.
oid1 - oid of new object. May be null in case of a structure.
Method Detail

addattrobj

public IomObject addattrobj(java.lang.String attrName,
                            java.lang.String type)
Deprecated. 

Specified by:
addattrobj in interface IomObject

addattrobj

public void addattrobj(java.lang.String attrName,
                       IomObject obj)
Description copied from interface: IomObject
appends a new value to an indexed attribute with a structured type.

Specified by:
addattrobj in interface IomObject
Parameters:
attrName - name of attribute
obj - new value

changeattrobj

public IomObject changeattrobj(java.lang.String attrName,
                               int index,
                               java.lang.String type)
Deprecated. 

Specified by:
changeattrobj in interface IomObject

changeattrobj

public void changeattrobj(java.lang.String attrName,
                          int index,
                          IomObject obj)
Description copied from interface: IomObject
changes the value of an indexed attribute with a structured type.

Specified by:
changeattrobj in interface IomObject
Parameters:
attrName - name of attribute
index - index of value to change
obj - new value

delete

public void delete()
Description copied from interface: IomObject
disposes the underlying native object.

Specified by:
delete in interface IomObject

deleteattrobj

public void deleteattrobj(java.lang.String attrName,
                          int index)
Description copied from interface: IomObject
removes a value from an indexed attibute with a structured type.

Specified by:
deleteattrobj in interface IomObject
Parameters:
attrName - name of attribute
index - index ov value to remove

getattrcount

public int getattrcount()
Description copied from interface: IomObject
gets the number of attributes of this object. This is not the same as the number of attributes of the class of this object. Together with getttrname() this function enables to query an object without knowing the class definition.

 for(int i=0;i<obj.getattrcount();i++){
   String propName=obj.getattrname(i);
   String value=obj.getattrvalue(propName);
   if(value!=null){
      ...
   }
 }
 

Specified by:
getattrcount in interface IomObject
Returns:
gets the number of atrributes with at least one value.

getattrname

public java.lang.String getattrname(int index)
Description copied from interface: IomObject
gets an attribute name. Together with getttrcount() this function enables to query an object without knowing the class definition.

 for(int i=0;i<obj.getattrcount();i++){
   String propName=obj.getattrname(i);
   String value=obj.getattrvalue(propName);
   if(value!=null){
      ...
   }
 }
 

Specified by:
getattrname in interface IomObject
Parameters:
index - The index is opaque and only useable to enumerate all defined attributes of this object.
Returns:
the name of the attribute.

getattrobj

public IomObject getattrobj(java.lang.String attrName,
                            int index)
Description copied from interface: IomObject
gets the value of an indexed attribute with a structured type.

Specified by:
getattrobj in interface IomObject
Parameters:
attrName - name of attribute
index - index of value to retrieve
Returns:
structured value

getattrprim

public java.lang.String getattrprim(java.lang.String attrName,
                                    int index)
Description copied from interface: IomObject
gets the value of an indexed attribute with a primitive type.

Specified by:
getattrprim in interface IomObject
Parameters:
attrName - name of attribute
index - index of value to retrieve
Returns:
primitive value

getattrvalue

public java.lang.String getattrvalue(java.lang.String attrName)
Description copied from interface: IomObject
gets the value of an attribute with a primitive type.

Specified by:
getattrvalue in interface IomObject
Parameters:
attrName - name of attribute
Returns:
primitive value

getattrvaluecount

public int getattrvaluecount(java.lang.String attrName)
Description copied from interface: IomObject
gets the number of values of a given attribute.

Specified by:
getattrvaluecount in interface IomObject
Parameters:
attrName - name of attribute
Returns:
number of values

getobjectcol

public int getobjectcol()
Description copied from interface: IomObject
gets the column of the object in the file, if read from a file.

Specified by:
getobjectcol in interface IomObject

getobjectline

public int getobjectline()
Description copied from interface: IomObject
gets the line of the object in the file, if read from a file.

Specified by:
getobjectline in interface IomObject

setobjectcol

public void setobjectcol(int col)
Description copied from interface: IomObject
sets the column of the object in the file, if read from a file.

Specified by:
setobjectcol in interface IomObject

setobjectline

public void setobjectline(int line)
Description copied from interface: IomObject
sets the line of the object in the file, if read from a file.

Specified by:
setobjectline in interface IomObject

getxmleleattrname

public java.lang.String getxmleleattrname(int index)
Description copied from interface: IomObject
gets the name of the xml-element with the given xml-element index.

Specified by:
getxmleleattrname in interface IomObject

getxmlelecount

public int getxmlelecount()
Description copied from interface: IomObject
gets the number of xml-subelements.

Specified by:
getxmlelecount in interface IomObject

getxmleleobj

public IomObject getxmleleobj(int index)
Description copied from interface: IomObject
gets the structured value of the xml-element with the given xml-element index.

Specified by:
getxmleleobj in interface IomObject

getxmleleprim

public java.lang.String getxmleleprim(int index)
Description copied from interface: IomObject
gets the simple value of the xml-element with the given xml-element index.

Specified by:
getxmleleprim in interface IomObject
Returns:
the value or null if not a simple value.

getxmlelevalueidx

public int getxmlelevalueidx(int index)
Description copied from interface: IomObject
gets the attribute value index of the xml-element with the given xml-element index.

Specified by:
getxmlelevalueidx in interface IomObject

insertattrobj

public IomObject insertattrobj(java.lang.String attrName,
                               int index,
                               java.lang.String type)
Deprecated. 

Specified by:
insertattrobj in interface IomObject

insertattrobj

public void insertattrobj(java.lang.String attrName,
                          int index,
                          IomObject obj)
Description copied from interface: IomObject
inserts a new value to an indexed attribute with a structured type. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices).

Specified by:
insertattrobj in interface IomObject
Parameters:
attrName - name of attribute
index - index at which the specified value is to be inserted
obj - new value

setattrundefined

public void setattrundefined(java.lang.String attrName)
Description copied from interface: IomObject
Removes any values for a given attribute. Sets it to NULL, UNDEFINED.

Specified by:
setattrundefined in interface IomObject
Parameters:
attrName - name of attribute

setattrvalue

public void setattrvalue(java.lang.String attrName,
                         java.lang.String value)
Description copied from interface: IomObject
sets the value of an attribute with a primitve type.

Specified by:
setattrvalue in interface IomObject
Parameters:
attrName - name of attribute
value - new primitive value

getobjectconsistency

public int getobjectconsistency()
Description copied from interface: IomObject
gets the consistency (complete, incomplete, inconsistent, adapted) of this object.

Specified by:
getobjectconsistency in interface IomObject

setobjectconsistency

public void setobjectconsistency(int consistency1)
Description copied from interface: IomObject
sets the consistency (complete, incomplete, inconsistent, adapted) of this object.

Specified by:
setobjectconsistency in interface IomObject

getobjectoid

public java.lang.String getobjectoid()
Description copied from interface: IomObject
gets the identifier of the object.

Specified by:
getobjectoid in interface IomObject

setobjectoid

public void setobjectoid(java.lang.String oid1)
Description copied from interface: IomObject
sets the identifier of the object.

Specified by:
setobjectoid in interface IomObject

getobjectoperation

public int getobjectoperation()
Description copied from interface: IomObject
gets the operation mode (insert, update, delete) of this object.

Specified by:
getobjectoperation in interface IomObject

setobjectoperation

public void setobjectoperation(int operation)
Description copied from interface: IomObject
sets the operation mode (insert, update, delete) of this object.

Specified by:
setobjectoperation in interface IomObject

getobjectrefbid

public java.lang.String getobjectrefbid()
Description copied from interface: IomObject
gets the identifier of the basket containing the referenced object, if this object is a reference value.

Specified by:
getobjectrefbid in interface IomObject

setobjectrefbid

public void setobjectrefbid(java.lang.String refbid1)
Description copied from interface: IomObject
sets the identifier of the basket containing the referenced object, if this object is a reference value.

Specified by:
setobjectrefbid in interface IomObject

getobjectrefoid

public java.lang.String getobjectrefoid()
Description copied from interface: IomObject
gets the identifier of the referenced object, if this object is a reference value.

Specified by:
getobjectrefoid in interface IomObject

setobjectrefoid

public void setobjectrefoid(java.lang.String refoid1)
Description copied from interface: IomObject
sets the identifier of the referenced object, if this object is a reference value.

Specified by:
setobjectrefoid in interface IomObject

getobjectreforderpos

public long getobjectreforderpos()
Description copied from interface: IomObject
gets the ordering index, if this object is a reference value of an ordered relationship. In ordered relationships the attribute ORDER_POS (value > 0!) defines the absolute position of this reference in the ordered list of references that are part of this transfer basket.

Specified by:
getobjectreforderpos in interface IomObject

setobjectreforderpos

public void setobjectreforderpos(long orderpos1)
Description copied from interface: IomObject
sets the ordering index, if this object is a reference value of an ordered relationship.

Specified by:
setobjectreforderpos in interface IomObject

getobjecttag

public java.lang.String getobjecttag()
Description copied from interface: IomObject
gets the type of the object.

Specified by:
getobjecttag in interface IomObject

setobjecttag

public void setobjecttag(java.lang.String tag1)
Description copied from interface: IomObject
sets the type of the object.

Specified by:
setobjecttag in interface IomObject

toString

public java.lang.String toString()
Returns a string representation of the object. Same as dumpObject().

Overrides:
toString in class java.lang.Object

dumpObject

public static java.lang.String dumpObject(IomObject obj)
converts the contents of the given object for debuggung to a one line String.

Parameters:
obj - object to convert
Returns:
object as a String