i-net Clear Reports

com.inet.viewer
Class PromptValue

java.lang.Object
  extended by com.inet.viewer.PromptValue
All Implemented Interfaces:
java.io.Serializable

public abstract class PromptValue
extends java.lang.Object
implements java.io.Serializable

Abstract super class of a prompt value

See Also:
Serialized Form

Field Summary
static com.inet.viewer.FallbackFormatter DATEFORMAT
          formatter to use for dates (will use multiple fall backs)
static com.inet.viewer.FallbackFormatter DATETIMEFORMAT
          formatter to use for datetimes (will use multiple fall backs)
static java.text.Format DATETIME_FOUR_DIGIT_YEAR_NO_SECONDS
          formatter to use for datetimes with 4-digit years but without showing seconds
static java.text.Format DATETIME_FOUR_DIGIT_YEAR_WITH_SECONDS
          formatter to use for datetimes with 4-digit years and seconds
static java.text.NumberFormat NUMBERFORMAT
          formatter to use for numbers
static com.inet.viewer.FallbackFormatter TIMEFORMAT
          formatter to use for times (will use multiple fall backs)
 
Constructor Summary
PromptValue(int type)
          Creates a prompt values of the given type initialized with the default value of its type
PromptValue(java.lang.String description, int type)
          Creates a prompt values of the given type initialized with the default value of its type
 
Method Summary
 java.lang.String getDescription()
          Get decription of the prompt value
abstract  java.lang.Object getSQLTypedValue()
          this method returns the value of this promptvalue using an sql compatible type.
abstract  java.lang.String getStringRepresentation()
          Returns a string representation of the value of this prompt.
 int getType()
          Get value type of the prompt, see the value type constants in PromptData
abstract  java.lang.Object getValue()
          Returns the value of this prompt - its type will depend on which value type this PromptValue has: String for STRING
Double for NUMBER and CURRENCY
Boolean for BOOLEAN
Date for DATE and DATETIME
Time for TIME
byte[] for BINARY
 boolean isOnlyDescription()
          If true only the decription will be displayed in the report dialog.
 void setDescription(java.lang.String description)
          Set decription of the prompt value
 void setOnlyDescription(boolean onlyDescription)
          Sets the appearance of this value in the prompt dialog.
 java.lang.String toString()
          Creates a formated string representation of this prompt value with its decription and value.
 

Field Detail

NUMBERFORMAT

public static java.text.NumberFormat NUMBERFORMAT
formatter to use for numbers


DATEFORMAT

public static final com.inet.viewer.FallbackFormatter DATEFORMAT
formatter to use for dates (will use multiple fall backs)


DATETIME_FOUR_DIGIT_YEAR_WITH_SECONDS

public static final java.text.Format DATETIME_FOUR_DIGIT_YEAR_WITH_SECONDS
formatter to use for datetimes with 4-digit years and seconds


DATETIME_FOUR_DIGIT_YEAR_NO_SECONDS

public static final java.text.Format DATETIME_FOUR_DIGIT_YEAR_NO_SECONDS
formatter to use for datetimes with 4-digit years but without showing seconds


DATETIMEFORMAT

public static final com.inet.viewer.FallbackFormatter DATETIMEFORMAT
formatter to use for datetimes (will use multiple fall backs)


TIMEFORMAT

public static final com.inet.viewer.FallbackFormatter TIMEFORMAT
formatter to use for times (will use multiple fall backs)

Constructor Detail

PromptValue

public PromptValue(int type)
Creates a prompt values of the given type initialized with the default value of its type

Parameters:
type - type of this default value.

PromptValue

public PromptValue(java.lang.String description,
                   int type)
Creates a prompt values of the given type initialized with the default value of its type

Parameters:
type - type of this default value.
description - decription of this promt
Method Detail

getStringRepresentation

public abstract java.lang.String getStringRepresentation()
Returns a string representation of the value of this prompt.

Returns:
a string representation of the value of this prompt.

getValue

public abstract java.lang.Object getValue()
Returns the value of this prompt - its type will depend on which value type this PromptValue has: String for STRING
Double for NUMBER and CURRENCY
Boolean for BOOLEAN
Date for DATE and DATETIME
Time for TIME
byte[] for BINARY

Returns:
the value of this prompt - its type will depend on which value type this PromptValue has.

toString

public java.lang.String toString()
Creates a formated string representation of this prompt value with its decription and value.

Overrides:
toString in class java.lang.Object
Returns:
String representation

getDescription

public java.lang.String getDescription()
Get decription of the prompt value

Returns:
decription of the prompt value

setDescription

public void setDescription(java.lang.String description)
Set decription of the prompt value

Parameters:
description - of the prompt value

getType

public int getType()
Get value type of the prompt, see the value type constants in PromptData

Returns:
value type of the prompt, see the value type constants in PromptData

isOnlyDescription

public boolean isOnlyDescription()
If true only the decription will be displayed in the report dialog. (only necessary if this prompt value represents a default value)

Returns:
whether only description is displayed

setOnlyDescription

public void setOnlyDescription(boolean onlyDescription)
Sets the appearance of this value in the prompt dialog. (only necessary if this promtvalue represents a default value)

Parameters:
onlyDescription - whether only description shall be displayed

getSQLTypedValue

public abstract java.lang.Object getSQLTypedValue()
this method returns the value of this promptvalue using an sql compatible type. The returned type could be.

Returns:
value of this promptvalue using an sql compatible type.

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH