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
-
array
- "array" is the Array of Containers .It can contains the Object of type Container
-
limit
- "limit" varible is used to keep trace array Limit
-
ContainerArray()
- Default Constructor of the Array Container
-
ContainerArray(Object)
- Constuctor used to called while switching from one implementation to other
-
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
-
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
-
Member(String)
- This function tells that Employee with the "name" field is in the
ContianerArray or not
-
PrintList()
- PrintList will print the Whole ContainerArray
-
readObject(ObjectInputStream)
- These are the default function to be include to Implement Serialization
This will call the DefalutReadObject function for the ObjectInputStream
-
SetSalary(String, String)
- SetSalary function set the Salary of the Employee (Searched by name ) by the
String passed as Salary
-
writeObject(ObjectOutputStream)
- These are the default function to be include to Implement Serialization
This will call the DefalutWriteObject function for the ObjectOutputStream
limit
private static int limit
- "limit" varible is used to keep trace array Limit
array
protected Container array[]
- "array" is the Array of Containers .It can contains the Object of type Container
ContainerArray
public ContainerArray()
- Default Constructor of the Array Container
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).
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
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
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
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
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
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
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