net.jini.lookup.ui.attribute
Class UIFactoryTypes

java.lang.Object
  |
  +--net.jini.lookup.ui.attribute.UIFactoryTypes
All Implemented Interfaces:
java.io.Serializable

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

UI attribute that lists UI factory interfaces of which a UI factory is an instance.

See Also:
Serialized Form

Constructor Summary
UIFactoryTypes(java.util.Set typeNames)
          Constructs a UIFactoryTypes attribute using the passed Set.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object (the Object passed in o) with this UIFactoryTypes object for equality.
 java.util.Set getTypeNames()
          Returns an unmodifiable Set of fully qualified type name Strings of which a UI factory is an instance in no particular order.
 int hashCode()
          Returns the hash code value for this UIFactoryTypes object.
 boolean isAssignableTo(java.lang.Class classObj)
          Returns true if the UI factory (contained in marshalled form in the same UIDescriptor) is an instance of the UI factory interface type passed in parameter classObj.
 java.util.Iterator iterator()
          Returns an iterator over the set of types of which a UI factory object is an instance in no particular order.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIFactoryTypes

public UIFactoryTypes(java.util.Set typeNames)
Constructs a UIFactoryTypes attribute using the passed Set. The Set can be mutable or immutable, and must contain only Strings. Each String should represent a fully qualified Java type name of a UI factory interface. This constructor copies the contents of the passed Set into a serializable read-only Set that has a consistent serialized form across all VMs.

The isAssignableTo method of this class will only return true for types whose names are passed explicitly to this constructor via the typeNames parameter. This constructor does not inspect the inheritance hierarchies of the types whose names are passed via the typeNames parameter. It is the client's responsibility to include the name of every UI factory interface of which the relevant UI factory (the UI factory being described by this class) is an instance.

Parameters:
typeNames - A Set of String objects. Each element must be non-null and an instance of java.lang.String.
Throws:
NullPointerException - if typeNames is null or any element of typeNames set is null.
java.lang.IllegalArgumentException - if any non-null element of typeNames set is not an instance of java.lang.String.
Method Detail

isAssignableTo

public boolean isAssignableTo(java.lang.Class classObj)
Returns true if the UI factory (contained in marshalled form in the same UIDescriptor) is an instance of the UI factory interface type passed in parameter classObj. Else, returns false.

This method compares the fully qualified name of the type represented by the passed Class with the fully qualified names of UI factory interfaces implemented by the UI factory's class. If an exact string match is found, this method returns true. If the UI factory is ultimately loaded with a class loader whose parent-delegation chain doesn't include the class loader that defined the passed class, a type with the same name would be loaded into a different namespace of the virtual machine. If so, the two types would be considered different by the virtual machine, even though they shared the same fully qualified name.

Parameters:
classObj - the type to check
Returns:
true if the UI factory object (once unmarshalled) can be cast to the type represented by the passed Class
Throws:
NullPointerException - if classObj is null

iterator

public java.util.Iterator iterator()
Returns an iterator over the set of types of which a UI factory object is an instance in no particular order. The returned Iterator does not support remove().
Returns:
an iterator over the set of factory types

getTypeNames

public java.util.Set getTypeNames()
Returns an unmodifiable Set of fully qualified type name Strings of which a UI factory is an instance in no particular order.
Returns:
an unmodifiable set of UI factory type names

equals

public boolean equals(java.lang.Object o)
Compares the specified object (the Object passed in o) with this UIFactoryTypes object for equality. Returns true if the specified object is not null, if the specified object's class is UIFactoryTypes, if the two sets of factory types are the same size, and if every factory type mentioned in the specified UIFactoryTypes object (passed in o) is also mentioned in this UIFactoryTypes object.
Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare against
Returns:
true if the objects are the same, false otherwise.

hashCode

public int hashCode()
Returns the hash code value for this UIFactoryTypes object.
Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode for this object