jet.controls
Class JetEnumeration

java.lang.Object
  extended by jet.controls.JetProperty
      extended by jet.controls.JetEnumeration
All Implemented Interfaces:
jet.convert.EnumerationInfo, jet.convert.PropInfo, jet.util.Propertiable

public class JetEnumeration
extends JetProperty
implements jet.convert.EnumerationInfo

JetEnumeration, for saving/retrieving a entry(name and value).
This JetProperty :
1) can not set 'another object' in ChangeBy value by default
2) can not set 'on the fly formula' in ChangeBy value by default
4) contains a table(called as "entry-table") stored all possible entries for property choice


Zhiliang.liu note for developer
It does no different with JetString(if value is String) or JetNumber(if value is Integer), except it has property choice


Field Summary
 
Fields inherited from class jet.controls.JetProperty
CHART_BACKGROUND_EDITOR, CHART_FILLPATTERN_EDITOR, CHART_FILTER_EDITOR, CHART_FILTER_EDITOR_NO_DATE, CHART_ICON_STYLE, CHART_PATTERN_LIST_EDITOR, CHART_PENSTYLE_EDITOR, CHART_TEXTSTYLE_EDITOR, CHOICE_EDITOR, COLOR_EDITOR, COMBO_EDITOR, COMMAND_EDITOR, CONTROL_SELECT_ITEMS, DATASOURCE_EDITOR, DBCOL_EDITOR, DETAIL_REPORT_EDITOR, EDIT_FORBIDDEN, EDIT_FORBIDDEN_INIT, EDITABLE_ALLTIME, INTERNAL, LINK_EDITOR, MULSEL_EDITOR, PARAMCOL_EDITOR, QUERY_EDITOR, RECORDDB_EDITOR, SECURITY_EDITOR, TEXT_EDITOR
 
Fields inherited from interface jet.util.Propertiable
BIGSTRING, BOOLEAN, CHG_FMTTINGBLNAME, CHG_FMTTINGFORMULA, CHG_OTHER, COLOR, COMPFML_RESOURCE, CUSTOMER, CUSTOMERLINK, DELIM, DELIMCHAR, DOUBLE, ENUMERATION, IGNORED, IMAGE, IMGVECTOR, MAPPINGTBL, NORMAL_RESOURCE, NUMBER, REFERENCE, STRING, SUB1_DELIM, UNIT, VAL_NORMALLENGTH, VAL_NORMALSTART, VECTOR
 
Constructor Summary
JetEnumeration()
           
JetEnumeration(jet.controls.JetObject parent, java.lang.String name)
          Create a JetEnumeration instance with no value
JetEnumeration(jet.controls.JetObject parent, java.lang.String name, int enumType)
          Create a JetEnumeration instance with specified entries-set id but no value
 
Method Summary
 java.lang.Object add(java.lang.String key, java.lang.Object value)
          Adds/Overwrites an entry to/in entry-table.
 java.lang.Object get()
          Effective if JetProperty.isCurrentAutoValue() is false.
 java.lang.String getCurKey()
          Effective if JetProperty.isCurrentAutoValue() is false.
 java.util.Hashtable getEnumerationSet()
           
 int getEnumerationType()
           
 java.lang.String getKeyByValue(int value)
          Notice:
1) before call it, please make sure that all entries' value are Integer
2) Before call it, please make sure that this instance is constructed by entries-set id, and no any operation about entry-table after construct
 int[] getMatchingSqlType()
          Now, this API only for designer UI : get Matching SQL Type of this property
Usage in UI : list all the (normal-)formula whose data-type in returned array
 java.lang.Object getObject()
          Effective if JetProperty.isCurrentAutoValue() is false;returns normal value's value, or last entry(hash order)'s value in entry-table if not set
 java.util.Vector getPropertyChoice()
          Effective if JetProperty.isCurrentAutoValue() is false.
 int getValue(java.lang.Object key)
          Notice:
1) before call it, please make sure that all entries' value are Integer
2) It has not been deleted because it is an API in EnumerationInfo
 int intValue()
          Notice1: before call it, please make sure that all entries' value are Integer
Notice2: effective if JetProperty.isCurrentAutoValue() is false.
 java.lang.Object remove(java.lang.String key)
          Removes the an entry from entry-table.
 void removeAll()
          Clears so that entry-table contains no enumeration items
 void set(java.lang.Object obj)
          Sets normal value specified entry's value.
 void set(java.lang.String key)
          Sets normal value via specified entry's name if can found mapping in
 void setEnumerationSet(java.util.Hashtable enumerationSet)
          Sets entry-table, notice : it would not change normal value.
 void setValue(java.lang.Object obj)
          Sets normal value via specified entry's value.
 void setValue(java.lang.String key)
          Sets normal value via specified entry's name if can found mapping in
 java.lang.String toString()
          Effective if JetProperty.isCurrentAutoValue() is false.
 
Methods inherited from class jet.controls.JetProperty
canChangeByBL, canChangeByFmtt, canChangeByOthers, enableAllChangeBys, getChangeBy, getChangeByBL, getChangeByBLName, getChangeByBLType, getChangeByFmtt, getChangeByFmttName, getChangeByObject, getChangeByObjectName, getChangeByOtherType, getCurrentValue, getCurrentValue, getEditFlag, getEditorType, getInspValue, getInspValue, getName, getNormalObject, getParent, getPropType, getRuntimeChangeBy, getUnifiedObject, getValue, isChagneByFmtt, isChangeByBL, isChangeByOther, isCurrentAutoValue, isEnableAutoValue, isNull, isSetAnyChangeBy, isSetRuntimeChgBy, isTransient, loadFullChangeBy, propertyChanged, saveFullChangeBy, setAsAutoValue, setCanChangeByBL, setCanChangeByFmtt, setCanChangeByOthers, setChangeByBL, setChangeByBL, setChangeByFmtt, setChangeByObject, setChangeByObject, setEditFlag, setEditorType, setEnableAutoValue, setObject, setRuntimeChangeBy, setTransient, setUnitValue, toUnitString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jet.convert.PropInfo
getChangeByObjectName, getInspValue, getName, getValue, isChangeByOther, isNull, toUnitString
 

Constructor Detail

JetEnumeration

public JetEnumeration()

JetEnumeration

public JetEnumeration(jet.controls.JetObject parent,
                      java.lang.String name)
Create a JetEnumeration instance with no value

Parameters:
parent - owner
name - name

JetEnumeration

public JetEnumeration(jet.controls.JetObject parent,
                      java.lang.String name,
                      int enumType)
Create a JetEnumeration instance with specified entries-set id but no value

Parameters:
parent - owner
name - name
enumType - the entries-set defined in EnumerationConstant
Since:
V8
See Also:
EnumerationConstant
Method Detail

add

public java.lang.Object add(java.lang.String key,
                            java.lang.Object value)
Adds/Overwrites an entry to/in entry-table.

Parameters:
key - the entry's name, can not empty-string and null.
value - the entry's value
Returns:
the previous value of the specified key or null if it did not have one
Throws:
java.lang.NullPointerException - if the key or value is null

remove

public java.lang.Object remove(java.lang.String key)
Removes the an entry from entry-table. This method does nothing if the key is not in.

Parameters:
key - the item's name that needs to be removed, can not empty-string and null.
Returns:
the the item value to which the key had been mapped in, null if the key did not have a mapping
Throws:
java.lang.NullPointerException - if the key is null

set

public void set(java.lang.Object obj)
Sets normal value specified entry's value.

Parameters:
obj - : the value
See Also:
setValue(Object)

set

public void set(java.lang.String key)
Sets normal value via specified entry's name if can found mapping in

Specified by:
set in interface jet.util.Propertiable
Overrides:
set in class JetProperty
Parameters:
key - the item's name, can not empty-string and null.
See Also:
setValue(String)

setValue

public void setValue(java.lang.Object obj)
Sets normal value via specified entry's value.

Parameters:
obj - the value

setValue

public void setValue(java.lang.String key)
Sets normal value via specified entry's name if can found mapping in

Parameters:
key - the item's name, can not empty string and null.

get

public java.lang.Object get()
Effective if JetProperty.isCurrentAutoValue() is false.

Returns:
the normal value.
See Also:
JetProperty.isCurrentAutoValue()

getCurKey

public java.lang.String getCurKey()
Effective if JetProperty.isCurrentAutoValue() is false.

Specified by:
getCurKey in interface jet.convert.EnumerationInfo
Returns:
the normal value's name or empty-string if not set
See Also:
set(Object), set(String), setValue(Object), setValue(String), get(), toString(), JetProperty.isCurrentAutoValue()

toString

public java.lang.String toString()
Effective if JetProperty.isCurrentAutoValue() is false.

Specified by:
toString in interface jet.convert.PropInfo
Overrides:
toString in class java.lang.Object
Returns:
normal value's name or empty-string if not set
See Also:
set(Object), set(String), setValue(Object), setValue(String), get(), getCurKey(), JetProperty.isCurrentAutoValue()

intValue

public int intValue()
Notice1: before call it, please make sure that all entries' value are Integer
Notice2: effective if JetProperty.isCurrentAutoValue() is false.

Specified by:
intValue in interface jet.convert.EnumerationInfo
Returns:
the integer that current normal value's value converted. or -1 if can not convert to.
See Also:
getValue(Object), JetProperty.isCurrentAutoValue()

removeAll

public void removeAll()
Clears so that entry-table contains no enumeration items


getValue

public int getValue(java.lang.Object key)
Notice:
1) before call it, please make sure that all entries' value are Integer
2) It has not been deleted because it is an API in EnumerationInfo

Specified by:
getValue in interface jet.convert.EnumerationInfo
Parameters:
key - the enumeration item's name whose associated value is to be returned
Returns:
the enumeration item's value to which the specified key is mapped,
Throws:
java.lang.NullPointerException - if no mapping for the key
java.lang.ClassCastException - if not all enumeration item's value is Integer.
See Also:
intValue()

getKeyByValue

public java.lang.String getKeyByValue(int value)
Notice:
1) before call it, please make sure that all entries' value are Integer
2) Before call it, please make sure that this instance is constructed by entries-set id, and no any operation about entry-table after construct

Parameters:
value - the value whose associated name is to be returned
Returns:
the enumeration item's name to which the specified value is mapped, or null if no mapping for the value.
Since:
V8

getPropertyChoice

public java.util.Vector getPropertyChoice()
Effective if JetProperty.isCurrentAutoValue() is false.

Overrides:
getPropertyChoice in class JetProperty
Returns:
a String Vector contains names of all entries in entry-table or in entries-set specified by entries set id.
See Also:
JetProperty.isEnableAutoValue()

getObject

public java.lang.Object getObject()
Effective if JetProperty.isCurrentAutoValue() is false;returns normal value's value, or last entry(hash order)'s value in entry-table if not set

Specified by:
getObject in interface jet.util.Propertiable
Overrides:
getObject in class JetProperty
Returns:
the enumeration item's value
See Also:
get(), JetProperty.isCurrentAutoValue()

getEnumerationSet

public java.util.Hashtable getEnumerationSet()
Returns:
entry-table

setEnumerationSet

public void setEnumerationSet(java.util.Hashtable enumerationSet)
Sets entry-table, notice : it would not change normal value.

Parameters:
enumerationSet - a Hashtable, DO NOT null.

getEnumerationType

public int getEnumerationType()
Returns:
the entry-set id if constructed by.
Since:
V8.

getMatchingSqlType

public int[] getMatchingSqlType()
Description copied from class: JetProperty
Now, this API only for designer UI : get Matching SQL Type of this property
Usage in UI : list all the (normal-)formula whose data-type in returned array

Overrides:
getMatchingSqlType in class JetProperty
See Also:
Db