com.izforge.izpack
Class Pack

java.lang.Object
  extended by com.izforge.izpack.Pack
All Implemented Interfaces:
java.io.Serializable

public class Pack
extends java.lang.Object
implements java.io.Serializable

Represents a Pack.

Author:
Julien Ponge
See Also:
Serialized Form

Field Summary
static int BLACK
          black colour
 int color
          The color of the node.
 java.util.List dependencies
          The list of packs this pack depends on
 java.lang.String description
          The pack description.
private static java.text.DecimalFormat formatter
          Used of conversions.
private static double GIGABYTES
          Used of conversions.
static int GREY
          grey colour
 java.lang.String group
          The group the pack is associated with.
 java.lang.String id
          The langpack id
 java.util.Set installGroups
          An association of this pack to zero or more installation groups.
private static double KILOBYTES
          Used of conversions.
 boolean loose
           
private static double MEGABYTES
          Used of conversions.
 java.lang.String name
          The pack name.
 long nbytes
          The bumber of bytes contained in the pack.
 java.util.List osConstraints
          The target operation system of this pack
 boolean preselected
          Whether this pack is suggested (preselected for installation).
 boolean required
          True if the pack is required.
 java.util.List revDependencies
          Reverse dependencies(childs)
(package private) static long serialVersionUID
           
static int WHITE
          white colour
 
Constructor Summary
Pack(java.lang.String name, java.lang.String id, java.lang.String description, java.util.List osConstraints, java.util.List dependencies, boolean required, boolean preselected, boolean loose)
          The constructor.
 
Method Summary
 void addRevDep(java.lang.String name)
          This adds a reverse dependency.
 java.lang.String depString()
          Creates a text list of all the packs it depend on
 java.util.List getDependencies()
          getter method
static java.lang.String toByteUnitsString(int bytes)
          Convert bytes into appropiate mesaurements.
 java.lang.String toString()
          To a String (usefull for JLists).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

loose

public boolean loose

name

public java.lang.String name
The pack name.


id

public java.lang.String id
The langpack id


installGroups

public java.util.Set installGroups
An association of this pack to zero or more installation groups. An installation group is just a named collection of packs to allow for different pack collections to be selected, for example: minimal, default, all.


group

public java.lang.String group
The group the pack is associated with. The pack group identifies packs with common functionality to allow for grouping of packs in a tree in the TargetPanel for example.


description

public java.lang.String description
The pack description.


osConstraints

public java.util.List osConstraints
The target operation system of this pack


dependencies

public java.util.List dependencies
The list of packs this pack depends on


revDependencies

public java.util.List revDependencies
Reverse dependencies(childs)


required

public boolean required
True if the pack is required.


nbytes

public long nbytes
The bumber of bytes contained in the pack.


preselected

public boolean preselected
Whether this pack is suggested (preselected for installation).


color

public int color
The color of the node. This is used for the dependency graph algorithms


WHITE

public static final int WHITE
white colour

See Also:
Constant Field Values

GREY

public static final int GREY
grey colour

See Also:
Constant Field Values

BLACK

public static final int BLACK
black colour

See Also:
Constant Field Values

KILOBYTES

private static final double KILOBYTES
Used of conversions.

See Also:
Constant Field Values

MEGABYTES

private static final double MEGABYTES
Used of conversions.

See Also:
Constant Field Values

GIGABYTES

private static final double GIGABYTES
Used of conversions.

See Also:
Constant Field Values

formatter

private static final java.text.DecimalFormat formatter
Used of conversions.

Constructor Detail

Pack

public Pack(java.lang.String name,
            java.lang.String id,
            java.lang.String description,
            java.util.List osConstraints,
            java.util.List dependencies,
            boolean required,
            boolean preselected,
            boolean loose)
The constructor.

Parameters:
name - The pack name.
description - The pack description.
osConstraints - the OS constraint (or null for any OS)
required - Indicates wether the pack is required or not.
preselected - This pack will be selected automatically.
Method Detail

toString

public java.lang.String toString()
To a String (usefull for JLists).

Overrides:
toString in class java.lang.Object
Returns:
The String representation of the pack.

getDependencies

public java.util.List getDependencies()
getter method


addRevDep

public void addRevDep(java.lang.String name)
This adds a reverse dependency. With a reverse dependency we imply a child dependency or the dependents on this pack

Parameters:
name - The name of the pack that depents to this pack

depString

public java.lang.String depString()
Creates a text list of all the packs it depend on

Returns:
the created text

toByteUnitsString

public static java.lang.String toByteUnitsString(int bytes)
Convert bytes into appropiate mesaurements.

Parameters:
bytes - A number of bytes to convert to a String.
Returns:
The String-converted value.