net.jini.lookup.ui.attribute
Class UIFactoryTypes

java.lang.Object
  |
  +--net.jini.lookup.ui.attribute.UIFactoryTypes

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

UI attribute that lists all the types 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 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 must represent a fully qualified Java type name.
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 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 types appearing in the inheritance hierarchy defining the UI factory's class. If a 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.

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().

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. The returned Iterator does not support remove().

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

hashCode

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