站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.0.0

Lookup.Template (NetBeans Utilities API) - NetBeans API Javadoc 5.0.0

 

org.openide.util
Class Lookup.Template

java.lang.Object
  extended byorg.openide.util.Lookup.Template
Enclosing class:
Lookup

public static final class Lookup.Template
extends Object

Template defining a pattern to filter instances by.


Constructor Summary
Lookup.Template()
          Deprecated. Use new Template (Object.class) which is going to be better typed with JDK1.5 templates and should produce the same result.
Lookup.Template(Class type)
          Create a simple template matching by class.
Lookup.Template(Class type, String id, Object instance)
          Constructor to create new template.
 
Method Summary
 boolean equals(Object obj)
           
 String getId()
          Get the persistent identifier being searched for, if any.
 Object getInstance()
          Get the specific instance being searched for, if any.
 Class getType()
          Get the class (or superclass or interface) to search for.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Lookup.Template

public Lookup.Template()
Deprecated. Use new Template (Object.class) which is going to be better typed with JDK1.5 templates and should produce the same result.

General template to find all possible instances.


Lookup.Template

public Lookup.Template(Class type)
Create a simple template matching by class.

Parameters:
type - the class of service we are looking for (subclasses will match)

Lookup.Template

public Lookup.Template(Class type,
                       String id,
                       Object instance)
Constructor to create new template.

Parameters:
type - the class of service we are looking for or null to leave unspecified
id - the ID of the item/service we are looking for or null to leave unspecified
instance - a specific known instance to look for or null to leave unspecified
Method Detail

getType

public Class getType()
Get the class (or superclass or interface) to search for. If it was not specified in the constructor, Object is used as this will match any instance.

Returns:
the class to search for

getId

public String getId()
Get the persistent identifier being searched for, if any.

Returns:
the ID or null
Since:
1.8
See Also:
Lookup.Item.getId()

getInstance

public Object getInstance()
Get the specific instance being searched for, if any. Most useful for finding an Item when the instance is already known.

Returns:
the object to find or null
Since:
1.8

hashCode

public int hashCode()

equals

public boolean equals(Object obj)

toString

public String toString()

 

Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.