Copyright 2011-01-06 Werner Randelshofer

ch.randelshofer.media.tiff
Class SetValueFormatter

java.lang.Object
  extended by ch.randelshofer.media.tiff.SetValueFormatter
All Implemented Interfaces:
ValueFormatter

public class SetValueFormatter
extends java.lang.Object
implements ValueFormatter

Formats integer values as a set.

Version:
1.0 2010-03-22 Created.
Author:
Werner Randelshofer

Constructor Summary
SetValueFormatter(java.lang.Object... set)
          Creates a new enumeration.
 
Method Summary
 java.lang.String descriptionFormat(java.lang.Object value)
          Describes the data.
 java.lang.Object format(java.lang.Object value)
          Formats the specified value.
 java.lang.Object prettyFormat(java.lang.Object value)
          Formats the specified value in a human readable format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetValueFormatter

public SetValueFormatter(java.lang.Object... set)
Creates a new enumeration. The enumeration consists of a list of String=Integer or String=Integer Integer pairs.

If only one integer is provided, it specifies the bits which must be set. If two integers are provided, the second value specifies a bit mask.

Method Detail

format

public java.lang.Object format(java.lang.Object value)
Description copied from interface: ValueFormatter
Formats the specified value. If the value is of the desired type, it is replaced by an object which can be handled easier. For example, an integer value by a descriptive String.

Specified by:
format in interface ValueFormatter

prettyFormat

public java.lang.Object prettyFormat(java.lang.Object value)
Description copied from interface: ValueFormatter
Formats the specified value in a human readable format.

Specified by:
prettyFormat in interface ValueFormatter

descriptionFormat

public java.lang.String descriptionFormat(java.lang.Object value)
Description copied from interface: ValueFormatter
Describes the data. Returns null if no description is available.

Specified by:
descriptionFormat in interface ValueFormatter

Copyright 2011-01-06 Werner Randelshofer