org.codehaus.plexus.classworlds.realm

Class Entry

public class Entry extends Object implements Comparable

Import description entry.

Author: bob mcwhirter

Field Summary
StringpkgName
ClassRealmrealm
Constructor Summary
Entry(ClassRealm realm, String pkgName)
Method Summary
intcompareTo(Object thatObj)
Compare this entry to another for relative ordering.
booleanequals(Object thatObj)
Test this entry for equality to another.
StringgetPackageName()
Retrieve the package name.
ClassRealmgetRealm()
Retrieve the realm.
inthashCode()

Consistent with Entry, this method creates a hashCode based on the packagename.

booleanmatches(String classname)
Determine if the classname matches the package described by this entry.
StringtoString()

Field Detail

pkgName

private final String pkgName

realm

private final ClassRealm realm

Constructor Detail

Entry

Entry(ClassRealm realm, String pkgName)

Method Detail

compareTo

public int compareTo(Object thatObj)
Compare this entry to another for relative ordering.

The natural ordering of Entry objects is reverse-alphabetical based upon package name.

Parameters: thatObj The object to compare.

Returns: -1 if this object sorts before that object, 0 if they are equal, or 1 if this object sorts after that object.

equals

public boolean equals(Object thatObj)
Test this entry for equality to another.

Consistent with Entry, this method tests for equality purely on the package name.

Parameters: thatObj The object to compare

Returns: true if the two objects are semantically equivalent, otherwise false.

getPackageName

String getPackageName()
Retrieve the package name.

Returns: The package name.

getRealm

ClassRealm getRealm()
Retrieve the realm.

Returns: The realm.

hashCode

public int hashCode()

Consistent with Entry, this method creates a hashCode based on the packagename.

matches

boolean matches(String classname)
Determine if the classname matches the package described by this entry.

Parameters: classname The class name to test.

Returns: true if this entry matches the classname, otherwise false.

toString

public String toString()