All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Container.ContainerArray

java.lang.Object
   |
   +----Container.Implementation
           |
           +----Container.ContainerArray

public class ContainerArray
extends Implementation
implements Serializable
DescriptionThis class is derived from Implementation class .This is an Array Container .
You can Dynamically switch from Array Implementation to the Single linled linked
Implementation by the calling the Constructor .

Version:
1.0
Author:
Vicky Shiv

Variable Index

 o array
"array" is the Array of Containers .It can contains the Object of type Container
 o limit
"limit" varible is used to keep trace array Limit

Constructor Index

 o ContainerArray()
Default Constructor of the Array Container
 o ContainerArray(Object)
Constuctor used to called while switching from one implementation to other

Method Index

 o Append(Object)
This is the default Append function which will append the new container in the ArrayContainer.It will dynamically create an instance of the Container class
 o AppendImpl(Object)
This function is called when we change the implementation at run time This function copy reference the all containers of ContainerList to the ContainerArray.This will be called by the Constructor while changing the implementation at run time
 o Member(String)
This function tells that Employee with the "name" field is in the ContianerArray or not
 o PrintList()
PrintList will print the Whole ContainerArray
 o readObject(ObjectInputStream)
These are the default function to be include to Implement Serialization This will call the DefalutReadObject function for the ObjectInputStream
 o SetSalary(String, String)
SetSalary function set the Salary of the Employee (Searched by name ) by the String passed as Salary
 o writeObject(ObjectOutputStream)
These are the default function to be include to Implement Serialization This will call the DefalutWriteObject function for the ObjectOutputStream

Variables

 o limit
 private static int limit
"limit" varible is used to keep trace array Limit

 o array
 protected Container array[]
"array" is the Array of Containers .It can contains the Object of type Container

Constructors

 o ContainerArray
 public ContainerArray()
Default Constructor of the Array Container

 o ContainerArray
 public ContainerArray(Object Obj)
Constuctor used to called while switching from one implementation to other

Parameters:
Object - This is the Reference of ContainerArray
Throws: ArrayFullException
if "limit" > 10(Array exceed its boundary).

Methods

 o readObject
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
These are the default function to be include to Implement Serialization This will call the DefalutReadObject function for the ObjectInputStream

Overrides:
readObject in class Implementation
 o writeObject
 private void writeObject(ObjectOutputStream out) throws IOException
These are the default function to be include to Implement Serialization This will call the DefalutWriteObject function for the ObjectOutputStream

Overrides:
writeObject in class Implementation
 o AppendImpl
 private void AppendImpl(Object Obj) throws ArrayFullException
This function is called when we change the implementation at run time This function copy reference the all containers of ContainerList to the ContainerArray.This will be called by the Constructor while changing the implementation at run time

Parameters:
Object - This is the reference of the Container to be added
Throws: ArrayFullException
if The Array has reached the Limit this exceptionwill be thrown ie: "limit" >10
Overrides:
AppendImpl in class Implementation
 o Append
 public void Append(Object Obj)
This is the default Append function which will append the new container in the ArrayContainer.It will dynamically create an instance of the Container class

Parameters:
Object - This is the reference of the Container to be added
Throws: ArrayFullException
if The Array has reached the Limit this exception will be thrown ie: "limit" >10
Overrides:
Append in class Implementation
 o Member
 public void Member(String name) throws EmployeePresentException, EmployeeNotPresentException
This function tells that Employee with the "name" field is in the ContianerArray or not

Parameters:
String - the name which has to be match with the Employee "name"
Throws: EmployeePresentException
If Employee is Present with the same name
Throws: EmployeeNotPresentException
If Employee is not Present with the same name
Overrides:
Member in class Implementation
 o SetSalary
 public void SetSalary(String name,
                       String salary) throws VolunteerSalaryException
SetSalary function set the Salary of the Employee (Searched by name ) by the String passed as Salary

Parameters:
String - The name of the Employee whose salary is to be changed
String - The salary to be set as new salary
Throws: VolunteerSalaryException
throws this exception if the Employee is a volunter as you cannot set the salry of the Employee
Overrides:
SetSalary in class Implementation
 o PrintList
 public void PrintList() throws ListEmptyException
PrintList will print the Whole ContainerArray

Throws: ListEmptyException
if the Array is Empty
Overrides:
PrintList in class Implementation

All Packages  Class Hierarchy  This Package  Previous  Next  Index
1