Package org.codehaus.classworlds
Class Entry
- java.lang.Object
-
- org.codehaus.classworlds.Entry
-
- All Implemented Interfaces:
java.lang.Comparable
class Entry extends java.lang.Object implements java.lang.Comparable
Import description entry.- Author:
- bob mcwhirter
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
pkgName
private ClassRealm
realm
-
Constructor Summary
Constructors Constructor Description Entry(ClassRealm realm, java.lang.String pkgName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(java.lang.Object thatObj)
Compare this entry to another for relative ordering.boolean
equals(java.lang.Object thatObj)
Test this entry for equality to another.(package private) java.lang.String
getPackageName()
Retrieve the page name.(package private) ClassRealm
getRealm()
Retrieve the realm.int
hashCode()
Consistent withequals(java.lang.Object)
, this method creates a hashCode based on the packagename.(package private) boolean
matches(java.lang.String classname)
Determine if the classname matches the package described by this entry.
-
-
-
Field Detail
-
realm
private final ClassRealm realm
-
pkgName
private final java.lang.String pkgName
-
-
Constructor Detail
-
Entry
Entry(ClassRealm realm, java.lang.String pkgName)
-
-
Method Detail
-
getRealm
ClassRealm getRealm()
Retrieve the realm.- Returns:
- The realm.
-
getPackageName
java.lang.String getPackageName()
Retrieve the page name.- Returns:
- The package name.
-
matches
boolean matches(java.lang.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, otherwisefalse
.
-
compareTo
public int compareTo(java.lang.Object thatObj)
Compare this entry to another for relative ordering. The natural ordering of Entry objects is reverse-alphabetical based upon package name.- Specified by:
compareTo
in interfacejava.lang.Comparable
- 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(java.lang.Object thatObj)
Test this entry for equality to another. Consistent withcompareTo(java.lang.Object)
, this method tests for equality purely on the package name.- Overrides:
equals
in classjava.lang.Object
- Parameters:
thatObj
- The object to compare- Returns:
true
if the two objects are semantically equivalent, otherwisefalse
.
-
hashCode
public int hashCode()
Consistent withequals(java.lang.Object)
, this method creates a hashCode based on the packagename.- Overrides:
hashCode
in classjava.lang.Object
-
-