ConForM.CoopnTools.CoKer.PackageMgr
Class PackageHeader

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.PackageMgr.PackageElement
        |
        +--ConForM.CoopnTools.CoKer.PackageMgr.PackageHeader
All Implemented Interfaces:
java.lang.Cloneable, CoopnSyntacticElement, CoopnSyntacticHeaderSection, CoopnSyntacticSection, java.io.Serializable

public final class PackageHeader
extends PackageElement
implements CoopnSyntacticHeaderSection

Package file header.

See Also:
PackageElement, Serialized Form

Constructor Summary
PackageHeader(java.lang.String version, java.lang.String date)
          Simple constructor.
 
Method Summary
 void addAuthors(PackageAuthorField field)
           
 void addUses(PackageUseField field)
           
 PackageAuthorField authors()
           
 java.lang.String basedUpon()
          Get the module upon which this section is based.
 int basedUponKind()
          Get the module kind (in the sense of the package manager) of the module upon which this section is based, for instance COOPNSOURCE, COALASOURCE, PACKAGE, and so on).
 java.lang.Object clone()
          Cloning method.
 java.lang.String date()
           
 boolean equals(java.lang.Object obj)
          Equality method.
 CoopnSyntacticField[] fields()
          Get the fields of this section.
 boolean hasBasedUpon()
          Test if this section is based upon another module.
 boolean hasDate()
           
 int hashCode()
          Hashcode method.
 boolean hasVersion()
           
 java.lang.String kind()
          Kind retrieving method.
 void setDate(java.lang.String date)
          Set the date.
 void setVersion(java.lang.String version)
          Set the version.
 java.lang.String toString(CoopnEnv env, int indent)
          String conversion method.
 java.lang.Object unmodifiableCopy()
          Copy the element into an unmodifiable structure.
 PackageUseField uses()
           
 java.lang.String version()
           
 
Methods inherited from class ConForM.CoopnTools.CoKer.PackageMgr.PackageElement
clonePackageElement, toCompleteString, toCompleteString, toCompleteString, toString, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ConForM.CoopnTools.CoKer.CoopnSyntacticElement
toCompleteString, toCompleteString, toCompleteString, toString, toString
 

Constructor Detail

PackageHeader

public PackageHeader(java.lang.String version,
                     java.lang.String date)
Simple constructor.
Method Detail

kind

public java.lang.String kind()
Description copied from interface: CoopnSyntacticSection
Kind retrieving method. This method must be defined in the inherited classes for returning a string allowing the user to know what kind of section this is.
Specified by:
kind in interface CoopnSyntacticSection
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticSection
Returns:
a string defining the section kind.

fields

public CoopnSyntacticField[] fields()
Description copied from interface: CoopnSyntacticSection
Get the fields of this section.
Specified by:
fields in interface CoopnSyntacticSection
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticSection
Returns:
The fields defined by this section.

hasBasedUpon

public final boolean hasBasedUpon()
Test if this section is based upon another module.
Specified by:
hasBasedUpon in interface CoopnSyntacticHeaderSection
Returns:
true iff this section is based upon anither module.

basedUpon

public final java.lang.String basedUpon()
Get the module upon which this section is based.
Specified by:
basedUpon in interface CoopnSyntacticHeaderSection
Returns:
The name of the module upon which this section is based, or null.

basedUponKind

public int basedUponKind()
Get the module kind (in the sense of the package manager) of the module upon which this section is based, for instance COOPNSOURCE, COALASOURCE, PACKAGE, and so on).
Specified by:
basedUponKind in interface CoopnSyntacticHeaderSection
Returns:
the module kind of the module upon which this section is based, iff this section is based upon a module; a meaningless value else.

hasVersion

public boolean hasVersion()

version

public java.lang.String version()

setVersion

public void setVersion(java.lang.String version)
                throws java.lang.UnsupportedOperationException
Set the version.
Parameters:
version - the new version
Throws:
java.lang.UnsupportedOperationException - the header is not modifiable.

hasDate

public boolean hasDate()

date

public java.lang.String date()

setDate

public void setDate(java.lang.String date)
             throws java.lang.UnsupportedOperationException
Set the date.
Parameters:
date - the new date
Throws:
java.lang.UnsupportedOperationException - the header is not modifiable.

addAuthors

public void addAuthors(PackageAuthorField field)

authors

public PackageAuthorField authors()

addUses

public void addUses(PackageUseField field)

uses

public PackageUseField uses()

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: CoopnSyntacticElement
Equality method. Must be defined in the inherited classes.
Specified by:
equals in interface CoopnSyntacticElement
Overrides:
equals in class PackageElement
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticElement
Parameters:
obj - the object to compare
Returns:
true iff this object and the parameter are equals.

hashCode

public int hashCode()
Description copied from interface: CoopnSyntacticElement
Hashcode method. Must be defined in the inherited classes.
Specified by:
hashCode in interface CoopnSyntacticElement
Overrides:
hashCode in class PackageElement
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticElement
Returns:
the hash code.

toString

public java.lang.String toString(CoopnEnv env,
                                 int indent)
Description copied from interface: CoopnSyntacticElement
String conversion method. This routine converts an element into a string representing it. The string representation is intended to be readable from users. The string representation is not required to include the comments associated to the element, if any.
Specified by:
toString in interface CoopnSyntacticElement
Overrides:
toString in class PackageElement
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticElement
Parameters:
env - the environment deciding the form of the display. A null values indicates a default form.
indent - the identation factor. A zero value indicates no indentation at all.
Returns:
a String image of the element.

unmodifiableCopy

public java.lang.Object unmodifiableCopy()
Description copied from class: PackageElement
Copy the element into an unmodifiable structure.
Overrides:
unmodifiableCopy in class PackageElement
Following copied from class: ConForM.CoopnTools.CoKer.PackageMgr.PackageElement
Returns:
an unmodififable clone of the element.

clone

public java.lang.Object clone()
Description copied from interface: CoopnSyntacticElement
Cloning method. Must be defined in the inherited classes.
Specified by:
clone in interface CoopnSyntacticElement
Overrides:
clone in class PackageElement
Following copied from interface: ConForM.CoopnTools.CoKer.CoopnSyntacticElement
Returns:
a clone object.