loanfund
Class Register

java.lang.Object
  extended by loanfund.Register

public class Register
extends java.lang.Object

The Register class is used to access the services which are stored in an XML file. It only has one method which finds the service values for the current user.

Author:
Gunn Olaussen & Kirsti N. Torgersen

Field Summary
private  java.lang.String dbFile
           
private  java.lang.String id
           
private  java.lang.String[] values
           
 
Constructor Summary
Register(java.lang.String idnr)
          The constructor stores the username which should be used when looking for services.
 
Method Summary
private  java.lang.String getApplicationReceivedDate(org.w3c.dom.NodeList application)
          Finds the application date value from the NodeList
private  java.lang.String getApplicationStatus(org.w3c.dom.NodeList application)
          Finds the application status value from the NodeList
private  java.lang.String getApplicationSumGrant(org.w3c.dom.NodeList sum)
          Finds the application grant sum value from the NodeList
private  java.lang.String getApplicationSumLoan(org.w3c.dom.NodeList sum)
          Finds the application loan sum value from the NodeList
private  java.lang.String getDebt(org.w3c.dom.Element currentprofile)
          Finds the debt value from the NodeList
private  java.lang.String getInstalmentDate(org.w3c.dom.NodeList instalment)
          Finds the instalment date value from the NodeList
private  java.lang.String getInstalmentSum(org.w3c.dom.NodeList instalment)
          Finds the instalment sum value from the NodeList
private  boolean hasApplicationSumTag(org.w3c.dom.NodeList application)
          Used to check if the sum tag inside the application Node exists.
private  boolean hasApplicationTag(org.w3c.dom.Element currentprofile)
          Used to check if this user profile has an application tag
private  boolean hasLastInstalmentTag(org.w3c.dom.Element currentprofile)
          Used to check id this user profile has a lastinstalment tag
private  boolean hasNextInstalmentTag(org.w3c.dom.Element currentprofile)
          Used to check id this user profile has a nextinstalment tag
 java.lang.String[] readValues()
          This method reads the services from the XML file and returns the values for the user identified in the id variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbFile

private final java.lang.String dbFile
See Also:
Constant Field Values

values

private java.lang.String[] values

id

private java.lang.String id
Constructor Detail

Register

public Register(java.lang.String idnr)
The constructor stores the username which should be used when looking for services.

Parameters:
idnr - String The username/id for the user identified in the service request
Method Detail

readValues

public java.lang.String[] readValues()
This method reads the services from the XML file and returns the values for the user identified in the id variable.

Returns:
String[] The found services for the user

hasApplicationSumTag

private boolean hasApplicationSumTag(org.w3c.dom.NodeList application)
Used to check if the sum tag inside the application Node exists.


hasApplicationTag

private boolean hasApplicationTag(org.w3c.dom.Element currentprofile)
Used to check if this user profile has an application tag


hasNextInstalmentTag

private boolean hasNextInstalmentTag(org.w3c.dom.Element currentprofile)
Used to check id this user profile has a nextinstalment tag


hasLastInstalmentTag

private boolean hasLastInstalmentTag(org.w3c.dom.Element currentprofile)
Used to check id this user profile has a lastinstalment tag


getApplicationReceivedDate

private java.lang.String getApplicationReceivedDate(org.w3c.dom.NodeList application)
Finds the application date value from the NodeList


getApplicationStatus

private java.lang.String getApplicationStatus(org.w3c.dom.NodeList application)
Finds the application status value from the NodeList


getApplicationSumGrant

private java.lang.String getApplicationSumGrant(org.w3c.dom.NodeList sum)
Finds the application grant sum value from the NodeList


getApplicationSumLoan

private java.lang.String getApplicationSumLoan(org.w3c.dom.NodeList sum)
Finds the application loan sum value from the NodeList


getInstalmentSum

private java.lang.String getInstalmentSum(org.w3c.dom.NodeList instalment)
Finds the instalment sum value from the NodeList


getInstalmentDate

private java.lang.String getInstalmentDate(org.w3c.dom.NodeList instalment)
Finds the instalment date value from the NodeList


getDebt

private java.lang.String getDebt(org.w3c.dom.Element currentprofile)
Finds the debt value from the NodeList