*
Metamerge logo
Search

Advanced Search
*
*
*
* HOME DOCUMENTS & RESOURCES DOWNLOADS EARLY TECH ACCESS SUPPORT FAQ KNOWN ISSUES OLD VERSIONS

 

*

 


com.architech.entry
Class Entry

java.lang.Object
  |
  +--com.architech.entry.Entry
All Implemented Interfaces:
com.architech.entry.EntryInterface, Serializable

public class Entry
extends Object
implements com.architech.entry.EntryInterface, Serializable

The Entry class is widely used in the Metamerge product. The entry class is a container for attributes and their values. In the scripting environment you use the Entry and Attribute classes by accessing the object's methods.

JavaScript Example


 // List all attributes and their values
 var conn = connector.getNextEntry();
 var attrnames = conn.getAttributeNames();
 for ( i = 0; i < attrname.length; i++ ) {
 		var attr = conn.getAttribute ( attrnames[i] );
		task.logmsg ( "Attribute: name = " + attr.getName() + ", #values = " + attr.size() );
		for ( j = 0; j < attr.size(); j++ ) {
			task.logmsg ( "      Value " + j + ": " + attr.getValue ( j ) );
		}
 }
 

See Also:
Serialized Form

Field Summary
static char OP_ADD
          The entry contains an entry which is supposed to be added
static String OP_ADD2
           
static char OP_DEL
          The entry contains an entry which is supposed to be removed
static String OP_DEL2
           
static char OP_GEN
          The entry contains an entry with no explicit knowledge of operation
static String OP_GEN2
           
static char OP_MOD
          The entry contains an entry which is supposed to be modified
static String OP_MOD2
           
 
Constructor Summary
Entry()
           
Entry(Hashtable p1)
           
 
Method Summary
 void addAttributeValue(Object p1, Object p2)
          This method adds a value to an attribute.
 Entry clone(Entry p1)
          This method returns an Entry object which is a clone of the p1 Entry.
 Attribute get(Object p1)
          This method returns the Attribute object for a named attribute.
 Attribute getAttribute(Object p1)
          This method returns the Attribute object for a named attribute.
 Collection getAttributeCollection()
          This method returns a java.util.Collection containing attribute names in this entry.
 String[] getAttributeNames()
          This method returns an array of strings containing attribute names in this entry.
 Object getObject(Object p1)
          This method returns the first value in an attribute as an object.
 char getOp()
          This method returns the operation field of this entry.
 String getOperation()
          This method returns the operation field of this entry.
 Object getProperty(Object propertyName)
          This method returns a property value.
 String[] getPropertyNames()
          This method returns a string array of the property names contained in this entry.
 String getString(Object p1)
          This method returns the first value in an attribute as a String.
 boolean hasProperty(String propertyName)
          This method returns true if a property named by the propertyName parameter has a value.
 void merge(Entry e)
          This method merges the attributes and their values from another entry.
 void mergeAttributeValue(Object p1, com.architech.entry.AttributeInterface p2)
          This method merges the values in one attribute with the values from another attribute.
 Attribute newAttribute(String name)
          This methods returns an Attribute object from this entry's list of attributes.
 void removeAllAttributes()
          This method removes all attributes from this Entry.
 void removeAttribute(Object p1)
          This method removes an attribute from this Entry's list of attribute.
 void set(com.architech.entry.AttributeInterface p1)
          This methods adds or replaces an attribute in this entry's list of attributes.
 void setAttribute(com.architech.entry.AttributeInterface p1)
          This methods adds or replaces an attribute in this entry's list of attributes.
 void setAttribute(Object p1, Object p2)
          This methods adds or replaces an attribute in this entry's list of attributes.
 void setOp(char operation)
          This method sets the operation code for this entry.
 void setProperty(Object propertyName, Object propertyValue)
          This method sets/replace a property.
 int size()
          This method returns the number of attributes present in this entry.
 String toString()
          This method returns a string representation of this entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OP_ADD

public static final char OP_ADD
The entry contains an entry which is supposed to be added

OP_ADD2

public static final String OP_ADD2

OP_MOD

public static final char OP_MOD
The entry contains an entry which is supposed to be modified

OP_MOD2

public static final String OP_MOD2

OP_DEL

public static final char OP_DEL
The entry contains an entry which is supposed to be removed

OP_DEL2

public static final String OP_DEL2

OP_GEN

public static final char OP_GEN
The entry contains an entry with no explicit knowledge of operation

OP_GEN2

public static final String OP_GEN2
Constructor Detail

Entry

public Entry()

Entry

public Entry(Hashtable p1)
Method Detail

clone

public Entry clone(Entry p1)
This method returns an Entry object which is a clone of the p1 Entry. The cloning is shallow which means that only first-level cloning of data values is performed.
Parameters:
p1 - The Entry object to clone
Returns:
The cloned entry

getOp

public char getOp()
This method returns the operation field of this entry. The operation field signals to the user what it should do with this entry. See the OP_* codes for possible return values.
Returns:
This entry's operation code

setOp

public void setOp(char operation)
This method sets the operation code for this entry.
Parameters:
operation - The operation code

getOperation

public String getOperation()
This method returns the operation field of this entry. The operation field signals to the user what it should do with this entry. The method returns either add, modify, delete or generic..
Returns:
This entry's operation code as a string

set

public void set(com.architech.entry.AttributeInterface p1)
This methods adds or replaces an attribute in this entry's list of attributes.
Parameters:
p1 - An AttributeInterface object

setAttribute

public void setAttribute(com.architech.entry.AttributeInterface p1)
This methods adds or replaces an attribute in this entry's list of attributes.
Specified by:
setAttribute in interface com.architech.entry.EntryInterface
Parameters:
p1 - An AttributeInterface object

setAttribute

public void setAttribute(Object p1,
                         Object p2)
This methods adds or replaces an attribute in this entry's list of attributes.
Specified by:
setAttribute in interface com.architech.entry.EntryInterface
Parameters:
p1 - The attribute name. If this parameter is null then the attribute is removed.
p2 - The attribute value

newAttribute

public Attribute newAttribute(String name)
This methods returns an Attribute object from this entry's list of attributes. If the attribute does not exist a new one is created with no values.
Parameters:
name - The attribute name to create/return
Returns:
The Attribute object

addAttributeValue

public void addAttributeValue(Object p1,
                              Object p2)
This method adds a value to an attribute. If the attribute does not exist it is created with the new value. If the attribute exists the value is appended to the attribute's list of values. If the value already exists in the attribute (e.g. old.equals(new)) then nothing is changed.
Parameters:
p1 - The attribute name
p2 - The value to append

mergeAttributeValue

public void mergeAttributeValue(Object p1,
                                com.architech.entry.AttributeInterface p2)
This method merges the values in one attribute with the values from another attribute.
Parameters:
p1 - The name of the attribute into which values are merged
p2 - The attribute (e.g. entry.getAttribute("xxx")) from which values are collected

get

public Attribute get(Object p1)
This method returns the Attribute object for a named attribute.
Parameters:
p1 - The attribute name
Returns:
The Attribute object or null if the attribute does not exist

getAttribute

public Attribute getAttribute(Object p1)
This method returns the Attribute object for a named attribute.
Specified by:
getAttribute in interface com.architech.entry.EntryInterface
Parameters:
p1 - The attribute name
Returns:
The Attribute object or null if the attribute does not exist

getAttributeNames

public String[] getAttributeNames()
This method returns an array of strings containing attribute names in this entry.
Specified by:
getAttributeNames in interface com.architech.entry.EntryInterface
Returns:
The attribute names in this entry as an array

getAttributeCollection

public Collection getAttributeCollection()
This method returns a java.util.Collection containing attribute names in this entry.
Returns:
The attribute names in this entry as a java.util.Collection object

getString

public String getString(Object p1)
This method returns the first value in an attribute as a String. If the attribute does not exist or the attribute does not have any values then null is returned.
Specified by:
getString in interface com.architech.entry.EntryInterface
Parameters:
p1 - The attribute name
Returns:
The string value or null

getObject

public Object getObject(Object p1)
This method returns the first value in an attribute as an object. If the attribute does not exist or the attribute does not have any values then null is returned.
Parameters:
p1 - The attribute name
Returns:
The object value or null

removeAttribute

public void removeAttribute(Object p1)
This method removes an attribute from this Entry's list of attribute.
Specified by:
removeAttribute in interface com.architech.entry.EntryInterface
Parameters:
p1 - The name of the attribute to remove

removeAllAttributes

public void removeAllAttributes()
This method removes all attributes from this Entry.

size

public int size()
This method returns the number of attributes present in this entry.
Specified by:
size in interface com.architech.entry.EntryInterface
Returns:
Number of attributes contained in this entry

toString

public String toString()
This method returns a string representation of this entry.
Overrides:
toString in class Object
Returns:
All attribute names and values as a structured string

getProperty

public Object getProperty(Object propertyName)
This method returns a property value.
Parameters:
propertyName - The named property
Returns:
The property's value or null if no such property exists

setProperty

public void setProperty(Object propertyName,
                        Object propertyValue)
This method sets/replace a property.
Parameters:
propertyName - The named property
propertyValue - The named property's value

hasProperty

public boolean hasProperty(String propertyName)
This method returns true if a property named by the propertyName parameter has a value.
Returns:
True if such property exists

getPropertyNames

public String[] getPropertyNames()
This method returns a string array of the property names contained in this entry.
Returns:
Array of strings with property names

merge

public void merge(Entry e)
This method merges the attributes and their values from another entry. After the operation this entry contains all attributes and values combined.
Parameters:
e - The entry from which attributes are collected


Copyright © 1999-2001 Metamerge AS. All Rights Reserved.
*

 

  Metamerge Integrator version 4.6 ©Copyright Metamerge AS 2000-2002 Last edited 2002-05-07 contact us