FileDocCategorySizeDatePackage
Parameter.javaAPI DocApache Lucene 1.91992Mon Feb 20 09:20:18 GMT 2006org.apache.lucene.util

Parameter

public abstract class Parameter extends Object implements Serializable
A serializable Enum class.

Fields Summary
static Map
allParameters
private String
name
Constructors Summary
private Parameter()

  
    
    // typesafe enum pattern, no public constructor
  
protected Parameter(String name)

    // typesafe enum pattern, no public constructor
    this.name = name;
    String key = makeKey(name);
    
    if(allParameters.containsKey(key))
      throw new IllegalArgumentException("Parameter name " + key + " already used!");
    
    allParameters.put(key, this);
  
Methods Summary
private java.lang.StringmakeKey(java.lang.String name)

    return getClass() + " " + name;
  
protected java.lang.ObjectreadResolve()
Resolves the deserialized instance to the local reference for accurate equals() and == comparisons.

return
a reference to Parameter as resolved in the local VM
throws
ObjectStreamException

    Object par = allParameters.get(makeKey(name));
    
    if(par == null)
      throw new StreamCorruptedException("Unknown parameter value: " + name);
      
    return par;
  
public java.lang.StringtoString()

    return name;