com.bbn.swede.editor.contentassist
Class DefaultSuggestionCandidate

java.lang.Object
  extended bycom.bbn.swede.editor.contentassist.DefaultSuggestionCandidate
All Implemented Interfaces:
Comparable, ISuggestionCandidate

public class DefaultSuggestionCandidate
extends Object
implements ISuggestionCandidate

Default implementation of the ISuggestionCandidate interface. This class also implements Comparable, and the ordering imposed upon collections of this class is the same as the name value stored by this objects of this class.

Author:
aperezlo

Field Summary
protected  String _name
          The name of this suggestion candidate.
protected  int _type
          The type of the autocomplete suggestion.
 
Fields inherited from interface com.bbn.swede.editor.contentassist.ISuggestionCandidate
ATTRIBUTE, CLASS, ELEMENT, NAMESPACE, PROPERTY, UNKNOWN
 
Constructor Summary
DefaultSuggestionCandidate()
          Default constructor.
DefaultSuggestionCandidate(String name, int type)
          Creates a suggestion candidate with a specific name and type.
 
Method Summary
 int compareTo(Object arg0)
          As per the interface.
 boolean equals(Object o)
           
 String getName()
          Retrieves the name of the suggestion candidate.
 int getType()
          Retrieves the suggestion candidate's type.
 void setName(String sName)
          Sets the name of the suggestion candidate.
 void setType(int sType)
          Sets the type of the suggestion candidate.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_type

protected int _type
The type of the autocomplete suggestion. See ISuggestionCandidate for suggestion type constants.


_name

protected String _name
The name of this suggestion candidate.

Constructor Detail

DefaultSuggestionCandidate

public DefaultSuggestionCandidate()
Default constructor.


DefaultSuggestionCandidate

public DefaultSuggestionCandidate(String name,
                                  int type)
Creates a suggestion candidate with a specific name and type.

Parameters:
name - The name of the new candidate
type - The type of the new candidate. One of the values in the ISuggestionCandidate interface.
Method Detail

equals

public boolean equals(Object o)

compareTo

public int compareTo(Object arg0)
As per the interface.

Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

toString

public String toString()

getName

public String getName()
Retrieves the name of the suggestion candidate.

Specified by:
getName in interface ISuggestionCandidate
Returns:
The suggestion candidate's name.

setName

public void setName(String sName)
Sets the name of the suggestion candidate.

Parameters:
sName - The name to set.

getType

public int getType()
Retrieves the suggestion candidate's type.

Specified by:
getType in interface ISuggestionCandidate
Returns:
Returns the type of this suggestion candidate.

setType

public void setType(int sType)
Sets the type of the suggestion candidate.

Parameters:
sType - The type to set.


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.