asgaard.lang
Class Word

java.lang.Object
  |
  +--asgaard.skid.LightBean
        |
        +--asgaard.lang.Def
              |
              +--asgaard.lang.Word
Direct Known Subclasses:
Unit

public class Word
extends Def

Same as Definition, but supporting multi-languages for a given word (vocabulary). Is Def used for system settings and basic values, Word is designed for user-access. It's index will be values given by Def's.

Remark: To inherit this kind of SkidBean modifications within the code of the BeanBroker are nessecary (look for the BEANTYPE pattern).

See Also:
Serialized Form

Fields inherited from class asgaard.lang.Def
longName, shortName
 
Fields inherited from class asgaard.skid.LightBean
broker, cKey, debug, history_policy, key, tsCreated, tsModified, update_policy
 
Constructor Summary
Word()
          Instanciates a new Word Do not use manually.
Word(java.lang.String sName, java.lang.String lName)
          Generates a new Word with the Default-Values
 
Method Summary
 java.lang.Object[] getArgs(int index)
          Returns all Objects stored concerned to an searched key.
 java.lang.String getLongName(int index)
          Returns the word in long form and the asked language if available, if not the default-word is returned.
 java.lang.String getName(int index)
          Returns the word in short form and the asked language if available, if not the default-word is returned.
 java.lang.Object getObject()
          Returns the wrapped Object, in this case it's the collection of word's
 void init(java.lang.String name, java.lang.Object content, long tsC, long tsM)
          Inits a new Word with a given Collection Do not use manually.
protected  void setName(int index, java.lang.Object[] word)
          Adds a word to the collection, using index to differ between different languages/context keys.
 void setName(int index, java.lang.String sWord)
          Adds a word to the collection, using index to differ between different languages/context keys.
 void setName(int index, java.lang.String sWord, java.lang.String lWord)
          Adds a word to the collection, using index to differ between different languages/context keys.
 
Methods inherited from class asgaard.lang.Def
getLongname, getName, init, setLongname, setName
 
Methods inherited from class asgaard.skid.LightBean
addEvent, cloneBean, flush, getAge, getBeanType, getBroker, getChangeHistory, getClassKey, getCreated, getEvent, getFilter, getIdentifier, getKey, getLink, getMethods, getModified, getUpdatePolicy, init, invoke, isChanged, isNew, isReadOnly, modify, putLink, setAge, setObject, suscribeEvent, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Word

public Word()
Instanciates a new Word Do not use manually.

Word

public Word(java.lang.String sName,
            java.lang.String lName)
     throws asgaard.skid.SkidException
Generates a new Word with the Default-Values
Parameters:
sName - the identifying (common) Name of the Word
lName - the default vocabulary
Throws:
asgaard.skid.SkidException -  
Method Detail

init

public void init(java.lang.String name,
                 java.lang.Object content,
                 long tsC,
                 long tsM)
          throws asgaard.skid.SkidException
Inits a new Word with a given Collection Do not use manually. Only use by the BeanBroker.
Parameters:
content - collection of Words indized by other Def's
tsC - created - timestamp
tsM - modified - timestamp
Throws:
asgaard.skid.SkidException - if the given Object is no valid Hashtable

setName

public void setName(int index,
                    java.lang.String sWord)
             throws asgaard.skid.SkidException
Adds a word to the collection, using index to differ between different languages/context keys.
Parameters:
index - is the key of an other Definition-Bean
sWord - is the default (short) version of the word
Throws:
asgaard.skid.SkidException - if entry is not valid (null)

setName

public void setName(int index,
                    java.lang.String sWord,
                    java.lang.String lWord)
             throws asgaard.skid.SkidException
Adds a word to the collection, using index to differ between different languages/context keys.
Parameters:
index - is the key of an other Definition-Bean
sWord - is the default (short) version of the word
lWord - is the long version of the word
Throws:
asgaard.skid.SkidException - if entry is not valid (null)

setName

protected void setName(int index,
                       java.lang.Object[] word)
                throws asgaard.skid.SkidException
Adds a word to the collection, using index to differ between different languages/context keys.
Parameters:
index - is the key of an other Definition-Bean
word - is an array of 2 Entry: Short- and Long version of the word
Throws:
asgaard.skid.SkidException - if the array is not valid (<1 Strings)

getName

public java.lang.String getName(int index)
Returns the word in short form and the asked language if available, if not the default-word is returned.
Parameters:
index - is the key of an other Definition-Bean

getLongName

public java.lang.String getLongName(int index)
Returns the word in long form and the asked language if available, if not the default-word is returned.
Parameters:
index - is the key of an other Definition-Bean

getArgs

public java.lang.Object[] getArgs(int index)
Returns all Objects stored concerned to an searched key.
Parameters:
index - is the key of an other Definition-Bean

getObject

public java.lang.Object getObject()
Returns the wrapped Object, in this case it's the collection of word's
Returns:
a Hashtable
Overrides:
getObject in class Def