SAP CC 1.0
API 4.2 (Core)

com.highdeal.pnr.hci
Class CounterModel

java.lang.Object
  extended by com.highdeal.pnr.hci.CounterModel
All Implemented Interfaces:
XMLMarshallable

public class CounterModel
extends java.lang.Object
implements XMLMarshallable

This class represents a counter in a business relationship. A counter has a name and a current value.


XML Schema Fragment
<xs:element name="counter">
   <xs:complexType>
     <xs:attribute name="name" type="xs:string" use="required"/>
     <xs:attribute name="value" type="xs:decimal"/>
   </xs:complexType>
 </xs:element>

Constructor Summary
CounterModel()
          Constructs an empty counter model.
CounterModel(CounterDescriptionModel counterDesc)
          Constructs a counter from a Counter description
CounterModel(java.lang.String name)
          Constructs a counter with a name.
CounterModel(java.lang.String name, java.math.BigDecimal value)
          Constructs a counter with a name and a current value.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String name, XMLMarshallable child)
          Adds a child to the objects, the child represents the marshallable object to be added into the content tree.
 boolean checkValidity()
          Returns true if the counter is valid.
 java.lang.String getName()
          Returns the name of the counter.
 java.math.BigDecimal getValue()
          Returns the value of the counter.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, and of its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the tag beeing processed.
 void setName(java.lang.String name)
          Sets the name of the counter.
 void setValue(java.math.BigDecimal value)
          Sets the value of the counter.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CounterModel

public CounterModel()
Constructs an empty counter model.


CounterModel

public CounterModel(java.lang.String name)
Constructs a counter with a name.

Parameters:
name - the name of the counter.

CounterModel

public CounterModel(java.lang.String name,
                    java.math.BigDecimal value)
Constructs a counter with a name and a current value.

Parameters:
name - the name of the counter.
value - the current value of the counter.

CounterModel

public CounterModel(CounterDescriptionModel counterDesc)
Constructs a counter from a Counter description

Parameters:
counterDesc - the description of the counter.
Method Detail

getName

public java.lang.String getName()
Returns the name of the counter.

Returns:
the name of the counter.

setName

public void setName(java.lang.String name)
Sets the name of the counter.

Parameters:
name - the name of the counter.

getValue

public java.math.BigDecimal getValue()
Returns the value of the counter.

Returns:
the value of the counter.

setValue

public void setValue(java.math.BigDecimal value)
Sets the value of the counter.

Parameters:
value - the value of the counter.

checkValidity

public boolean checkValidity()
Returns true if the counter is valid. Counter is valid if its name is not null or empty and if its current value is set to a non null value.

Returns:
true if the counter is valid, false otherwise.

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the tag beeing processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - the XML attributes of the current tag.

addChild

public void addChild(java.lang.String name,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the objects, the child represents the marshallable object to be added into the content tree.

Specified by:
addChild in interface XMLMarshallable
Parameters:
name - the name of tag for the child.
child - the child to be added.

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - the character data to be added.

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, and of its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - the XML output to marshall the object into.

toString

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

SAP CC 1.0
API 4.2 (Core)


API Reference - July 2009

SAP Convergent Charging 1.0 (build R4.2.1.35.0.0)
CONVERGENT CHARGING 4.2

(c) Copyright 2009 SAP AG. All rights reserved.