Fields Summary |
---|
private final String | nameStores the external name of this instance, by which it can be retrieved. |
private final transient String | descriptionStores the human-readable description of this instance, by which it is
identified in the user interface. |
private static final Map | instancesByNameKeeps track of all instances by name, for efficient lookup. |
public static final SourceMedia | CASSETTEThe instance that represents music obtained from cassette tape. |
public static final SourceMedia | VINYLThe instance that represents music obtained from vinyl. |
public static final SourceMedia | VHSThe instance that represents music obtained from VHS tapes. |
public static final SourceMedia | CDThe instance that represents music obtained from a compact disc. |
public static final SourceMedia | BROADCASTThe instance that represents music obtained from a broadcast. |
public static final SourceMedia | DOWNLOADThe instance that represents music obtained as an Internet download. |
public static final SourceMedia | STREAMThe instance that represents music from a digital audio stream. |
Methods Summary |
---|
public static java.util.Collection | getAllValues()Obtain the collection of all legal enumeration values.
return Collections.unmodifiableCollection(instancesByName.values());
|
public java.lang.String | getDescription()Return the description associated with this instance.
return description;
|
public static com.oreilly.hh.SourceMedia | getInstanceByName(java.lang.String name)Look up an instance by name.
SourceMedia result = (SourceMedia)instancesByName.get(name);
if (result == null) {
throw new NoSuchElementException(name);
}
return result;
|
public java.lang.String | getName()Return the external name associated with this instance.
return name;
|
private java.lang.Object | readResolve()Insure that deserialization preserves the signleton property.
return getInstanceByName(name);
|
public java.lang.String | toString()Return a string representation of this object.
return description;
|