Package com.ibm.di.UpdateInstaller
Class InstalledComponent
- java.lang.Object
-
- com.ibm.di.UpdateInstaller.InstalledComponent
-
- Direct Known Subclasses:
AMCInstalledComponent
,LWIInstalledComponent
public class InstalledComponent extends java.lang.Object
Represents an installed component in TDI. The only other information in this object is a list of fixes that have been applied to the component.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Vector<java.lang.String>
fixes
Fixes that have been applied to this component
-
Constructor Summary
Constructors Constructor Description InstalledComponent(java.lang.String name)
Creates a InstalledComponent with the given name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFix(int pos, java.lang.String fixName)
Adds the name of a fix to the specified position in the list of fixes that have been applied to this component.void
addFix(java.lang.String fixName)
Adds the name of a fix to the end of the list of fixes that have been applied to this component.boolean
equals(java.lang.Object obj)
Tells if two InstalledComponents are equal by comparing their names.boolean
equals(java.lang.String name)
Tells if two InstalledComponents are equal by comparing their names.java.lang.Object[]
getFixes()
Gets the list of fixes applied to this component as an array.java.lang.String
getName()
Gets the name of this component.int
hashCode()
Computes this InstalledComponent's hash code.boolean
isFirstFix(java.lang.String fixname)
Determines if the given fix is the most recently applied.boolean
isFixInstalled(java.lang.String fixname)
Determines if the given fixname has been applied.int
posOfFixInstalled(java.lang.String fixname)
Determines if and where the given fixname has been applied.int
remove(java.lang.String fixName)
Removes a fix from this component's list.void
removeAll()
Clears the list of applied fixes for this component.void
setName(java.lang.String name)
Sets the name of this component.java.lang.String
toString()
Converts the current object to a String for printing.void
writeFixes(java.io.PrintWriter outfile)
Write this component's information in the appropriate format to specified open file.
-
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Sets the name of this component.- Parameters:
name
- Name of the component
-
getName
public java.lang.String getName()
Gets the name of this component.- Returns:
- The name of this component
-
addFix
public void addFix(int pos, java.lang.String fixName)
Adds the name of a fix to the specified position in the list of fixes that have been applied to this component.- Parameters:
pos
- Position to add this fix in the listfixName
- Name of the fix
-
addFix
public void addFix(java.lang.String fixName)
Adds the name of a fix to the end of the list of fixes that have been applied to this component.- Parameters:
fixName
- Name of the fix
-
getFixes
public java.lang.Object[] getFixes()
Gets the list of fixes applied to this component as an array.- Returns:
- The list of fixes
-
remove
public int remove(java.lang.String fixName)
Removes a fix from this component's list.- Parameters:
fixName
- The name of the fix to remove- Returns:
- The position at which the fix was located before removal, -1 if not found
-
removeAll
public void removeAll()
Clears the list of applied fixes for this component.
-
posOfFixInstalled
public int posOfFixInstalled(java.lang.String fixname)
Determines if and where the given fixname has been applied.- Parameters:
fixname
- Name of the fix- Returns:
- The location in the list of applied fixes or -1 if not found
-
isFixInstalled
public boolean isFixInstalled(java.lang.String fixname)
Determines if the given fixname has been applied.- Parameters:
fixname
- Name of the fix- Returns:
- true if installed, false otherwise
-
isFirstFix
public boolean isFirstFix(java.lang.String fixname)
Determines if the given fix is the most recently applied.- Parameters:
fixname
- Name of the fix- Returns:
- true if this fix was the most recently applied, false otherwise
-
equals
public boolean equals(java.lang.String name)
Tells if two InstalledComponents are equal by comparing their names.- Parameters:
name
- A String with the name of the component to compare- Returns:
- true if the names are equal, false otherwise
-
equals
public boolean equals(java.lang.Object obj)
Tells if two InstalledComponents are equal by comparing their names.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- An InstalledComponent to compare- Returns:
- true if the objects have the same name, false otherwise
-
hashCode
public int hashCode()
Computes this InstalledComponent's hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hashcode of the component's name
-
writeFixes
public void writeFixes(java.io.PrintWriter outfile)
Write this component's information in the appropriate format to specified open file.- Parameters:
outfile
- The file that is being created
-
toString
public java.lang.String toString()
Converts the current object to a String for printing.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of this object
-
-