be.SIRAPRISE.client
Class AbstractTuple

java.lang.Object
  extended by be.SIRAPRISE.client.AbstractTuple
All Implemented Interfaces:
Tuple
Direct Known Subclasses:
ClientTuple

public abstract class AbstractTuple
extends java.lang.Object
implements Tuple

AbstractTuple provides method implementations for the Tuple interface

Author:
Erwin Smout

Constructor Summary
AbstractTuple(Heading heading)
          Creates the Tuple object
 
Method Summary
abstract  java.lang.String escapedValue(java.lang.String attributeName)
          Gets The attribute value for the named attribute
 Heading getHeading()
          Gets the heading that the Tuple conforms to
 java.lang.String printBodyValueWithoutPossrepNames()
          Deprecated. replaced by printBodyValueWithoutTypeNames()
 java.lang.String printBodyValueWithoutTypeNames()
          Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2) with value1, value2, ...
 java.lang.String printBodyValueWithTypeNames()
          Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2) with value1, value2, ... naming the type (i.e.
 java.lang.String printBodyValueXML()
          Gets the tuple body value in textual XML-style format (i.e.
 java.lang.String printEscapedBodyValueWithoutPossrepNames()
          Deprecated. replaced by printEscapedBodyValueWithoutTypeNames();
 java.lang.String printEscapedBodyValueWithoutTypeNames()
          Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2), INCLUDING escape processing for the ()\ characters of the metalanguage that appear in a printed value
 java.lang.String printEscapedBodyValueWithTypeNames()
          Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2), INCLUDING escape processing for the ()\ characters of the metalanguage that appear in a printed value
 java.lang.String printEscapedValueWithoutPossrepNames()
          Deprecated. replaced by printValueEscapedWithoutTypeNames()
 java.lang.String printValueEscapedWithoutTypeNames()
          Gets the tuple value in textual format (i.e.
 java.lang.String printValueEscapedWithTypeNames()
          Gets the tuple value in textual format (i.e.
 java.lang.String printValueWithoutPossrepNames()
          Deprecated. replaced by printValueWithoutTypeNames()
 java.lang.String printValueWithoutTypeNames()
          Gets the tuple value in textual format (i.e.
 java.lang.String printValueWithTypeNames()
          Gets the tuple value in textual format (i.e.
 java.lang.String printValueXML()
          Gets the tuple value in textual XML-style format (i.e.
<C> C
toObject(java.lang.Class<C> objectClass)
          Deprecated. - replace by be.SIRAPRISE.client.jsba.DBObjectFactory.getObject(...) - e.g. by inlining the calls to this method
 java.util.Map<java.lang.Class<?>,java.lang.Object> toObjects(java.lang.Class<?>[] objectClass)
          Deprecated. - replace by be.SIRAPRISE.client.jsba.DBObjectFactory.getObjects(...) - e.g. by inlining the calls to this method
 java.lang.String toString()
           
abstract  java.lang.String value(java.lang.String attributeName)
          Gets The attribute value for the named attribute
abstract  IntersectableMap<?,?> values()
          Gets the map of attribute values
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface be.SIRAPRISE.client.Tuple
rvaValue
 

Constructor Detail

AbstractTuple

public AbstractTuple(Heading heading)
Creates the Tuple object

Parameters:
heading - the heading that the Tuple conforms to
Method Detail

escapedValue

public abstract java.lang.String escapedValue(java.lang.String attributeName)
Gets The attribute value for the named attribute

Specified by:
escapedValue in interface Tuple
Parameters:
attributeName - The name of the attribute whose value is to be obtained
Returns:
The attribute value including the SIRA_PRISE escape sequences

getHeading

public final Heading getHeading()
Gets the heading that the Tuple conforms to

Specified by:
getHeading in interface Tuple
Returns:
the heading that the Tuple conforms to

printBodyValueWithoutPossrepNames

public final java.lang.String printBodyValueWithoutPossrepNames()
Deprecated. replaced by printBodyValueWithoutTypeNames()

Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

Returns:
the tuple body value in textual format (i.e. attr1(value1)attr2(value2) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

printBodyValueWithoutTypeNames

public final java.lang.String printBodyValueWithoutTypeNames()
Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

Specified by:
printBodyValueWithoutTypeNames in interface Tuple
Returns:
the tuple body value in textual format (i.e. attr1(value1)attr2(value2) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

printBodyValueWithTypeNames

public final java.lang.String printBodyValueWithTypeNames()
Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2) with value1, value2, ... naming the type (i.e. INT(1) instead of 1)

Specified by:
printBodyValueWithTypeNames in interface Tuple
Returns:
the tuple body value in textual format (i.e. attr1(value1)attr2(value2) with value1, value2, ... naming the type (i.e. INT(1) instead of 1)

printBodyValueXML

public final java.lang.String printBodyValueXML()
Gets the tuple body value in textual XML-style format (i.e. value1 value2)

Specified by:
printBodyValueXML in interface Tuple
Returns:
The tuple body value in textual XML-style format (i.e. value1 value2)

printEscapedBodyValueWithoutPossrepNames

public final java.lang.String printEscapedBodyValueWithoutPossrepNames()
Deprecated. replaced by printEscapedBodyValueWithoutTypeNames();

Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2), INCLUDING escape processing for the ()\ characters of the metalanguage that appear in a printed value

Returns:
the tuple body value in textual format (i.e. attr1(value1)attr2(value2), INCLUDING escape processing for the ()\ characters of the metalanguage that appear in a printed value

printEscapedBodyValueWithoutTypeNames

public final java.lang.String printEscapedBodyValueWithoutTypeNames()
Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2), INCLUDING escape processing for the ()\ characters of the metalanguage that appear in a printed value

Specified by:
printEscapedBodyValueWithoutTypeNames in interface Tuple
Returns:
the tuple body value in textual format (i.e. attr1(value1)attr2(value2), INCLUDING escape processing for the ()\ characters of the metalanguage that appear in a printed value

printEscapedBodyValueWithTypeNames

public final java.lang.String printEscapedBodyValueWithTypeNames()
Gets the tuple body value in textual format (i.e. attr1(value1)attr2(value2), INCLUDING escape processing for the ()\ characters of the metalanguage that appear in a printed value

Specified by:
printEscapedBodyValueWithTypeNames in interface Tuple
Returns:
the tuple body value in textual format (i.e. attr1(value1)attr2(value2), INCLUDING escape processing for the ()\ characters of the metalanguage that appear in a printed value

printEscapedValueWithoutPossrepNames

public final java.lang.String printEscapedValueWithoutPossrepNames()
Deprecated. replaced by printValueEscapedWithoutTypeNames()

Gets the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) INCLUDING escape processing for the ()\ characters of the metalanguage

Returns:
the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) INCLUDING escape processing for the ()\ characters of the metalanguage

printValueEscapedWithoutTypeNames

public final java.lang.String printValueEscapedWithoutTypeNames()
Gets the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) INCLUDING escape processing for the ()\ characters of the metalanguage

Specified by:
printValueEscapedWithoutTypeNames in interface Tuple
Returns:
the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) INCLUDING escape processing for the ()\ characters of the metalanguage

printValueEscapedWithTypeNames

public final java.lang.String printValueEscapedWithTypeNames()
Gets the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) INCLUDING escape processing for the ()\ characters of the metalanguage

Specified by:
printValueEscapedWithTypeNames in interface Tuple
Returns:
the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) INCLUDING escape processing for the ()\ characters of the metalanguage

printValueWithoutPossrepNames

public final java.lang.String printValueWithoutPossrepNames()
Deprecated. replaced by printValueWithoutTypeNames()

Gets the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

Returns:
the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

printValueWithoutTypeNames

public final java.lang.String printValueWithoutTypeNames()
Gets the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

Specified by:
printValueWithoutTypeNames in interface Tuple
Returns:
the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

printValueWithTypeNames

public final java.lang.String printValueWithTypeNames()
Gets the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

Specified by:
printValueWithTypeNames in interface Tuple
Returns:
the tuple value in textual format (i.e. TUPLE(attr1(value1)attr2(value2)) with value1, value2, ... NOT naming the type (i.e. 1 instead of INT(1))

printValueXML

public final java.lang.String printValueXML()
Gets the tuple value in textual XML-style format (i.e. value1 value2

Specified by:
printValueXML in interface Tuple
Returns:
The tuple value in textual XML-style format (i.e. value1 value2

toObject

public final <C> C toObject(java.lang.Class<C> objectClass)
                 throws SettersMissingException,
                        ConstructorMissingException,
                        ClassDoesNotImplementDBObjectException
Deprecated. - replace by be.SIRAPRISE.client.jsba.DBObjectFactory.getObject(...) - e.g. by inlining the calls to this method

Get an objects holding the same information as that which is held in this tuple.

Type Parameters:
C -
Parameters:
objectClass - A Class object denoting the class of the objects to be returned. objectClass must denote a public, non-abstract class that has a public no-arg constructor, and that has a unique setter method for each attribute in the heading. The name of this unique method must be the concatenation of the word "set" (all lowercase), the attribute name (capitalized), and the suffix "FromDB". The argument list of this setter method must consist of excatly one java.lang.String argument.
Returns:
An array of objects of the given object Class.
Throws:
SettersMissingException - if a needed setter is missing in the class denoted by objectClass
ConstructorMissingException - if objectClass does not denote a public class, or it denotes an abstract class, or the class does not have a public no-arg constructor
ClassDoesNotImplementDBObjectException - if objectClass does not implement the required DBObject interface

toObjects

public final java.util.Map<java.lang.Class<?>,java.lang.Object> toObjects(java.lang.Class<?>[] objectClass)
                                                                   throws SettersMissingException,
                                                                          ConstructorMissingException,
                                                                          ClassDoesNotImplementDBObjectException
Deprecated. - replace by be.SIRAPRISE.client.jsba.DBObjectFactory.getObjects(...) - e.g. by inlining the calls to this method

Get a Map of objects holding the same information as that which is held in this Tuple. The entries in the map have one of the objectClass[] objects as their key, and an object of that class as their value. The object of that class holds the attribute values of the tuple for which a corresponding setter method was found in the class.

Parameters:
objectClass - An array of Class objects denoting the classes of the objects to be returned for each tuple. Each objectClass must denote a public, non-abstract class that has a public no-arg constructor, and that has a unique setter method for some attribute in the heading. The name of this unique method must be the concatenation of the word "set" (all lowercase), the attribute name (capitalized), and the suffix "FromDB". The argument list of this setter method must consist of excatly one java.lang.String argument.
Returns:
A map of objects holding the same information as this tuple. The key in each map entry is one of the objectClass objects given as an argument, the corresponding value in the map entry is the created object of that class.
Throws:
SettersMissingException - if some attribute in the heading exists for which no corresponding setter could be found in any of the classes denoted by objectClass[]
ConstructorMissingException - if objectClass[] contains any class that does not denote a public class, or denotes an abstract class, or does not have a public no-arg constructor
ClassDoesNotImplementDBObjectException - if objectClass[] contains any class that does not implement the required DBObject interface

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

value

public abstract java.lang.String value(java.lang.String attributeName)
Description copied from interface: Tuple
Gets The attribute value for the named attribute

Specified by:
value in interface Tuple
Parameters:
attributeName - The name of the attribute whose value is to be obtained
Returns:
The attribute value with SIRA_PRISE escape sequences removed

values

public abstract IntersectableMap<?,?> values()
Description copied from interface: Tuple
Gets the map of attribute values

Specified by:
values in interface Tuple
Returns:
the map of attribute values