|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Object>
com.accountingenhancements.common.SupportParameters
public class SupportParameters
Used to hand objects to functions within com.accountingenhancements.formula
and in
com.accountingenhancements.layouttools
to handle various components.
In com.accountingenhancements.formula
this class is used to pass objects, such
as SQL database connections, to custom functions. It is passed though the solve(...) methods
to the functions so that all functions have access to the required objects.
In com.accountingenhancements.layouttools
this class is used to handle the components
(Usually JComponents) that are to be layed out on panels.
This is a ConcurrentHashMap
of objects. Make sure objects don't share the same
key name! When used in custom functions, I suggest that you use the custom function as a portion of
the key name to avoid conflicts. If the object is destined for multiple functions, put the object in
here multiple times under the different key names. They doesn't take up that much memory compared
to the risks of confusion faced later.
This map is handed through, from user code, untouched, to all FormulaFunctions. Use this when creating
your own functions so that you can hand classes such as database connections, login info, or any
other information, to your custom functions. The built in funcitons do not require this class so you
can use null if this is not needed for your custom functions.
Both packages use upper case values of the key so that case doesn't matter
Example:
SqlQuery.function(String formula, FormulaVariableList variableList, int iteration, SupportParameters supportParameters, FormulaFunctionList functionList)
Where the supportParamters would have a java.sql.Connection class stored under a key name
such as FunctionSqlQuery_java.sql.Connection
.
In the layouttools package, the key names are used in the layout text.
Example:
String layout = "\"City/St/Zip\",{group0|{FName, MName, LName}";
This class should then have 3 JComponent
s with the key names FName, MName, and LName.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
SupportParameters()
Creates a new, empty map with a default initial capacity, load factor, and concurrencyLevel. |
|
SupportParameters(int initialCapacity)
Creates a new, empty map with the specified initial capacity, and with default load factor and concurrencyLevel. |
|
SupportParameters(int initialCapacity,
float loadFactor,
int concurrencyLevel)
Creates a new, empty map with the specified initial capacity, load factor, and concurrency level. |
Method Summary | |
---|---|
javax.swing.JComponent |
getJComponent(java.lang.String key)
Returns the Component value to which the specified upper case value of this key is mapped in this table. |
java.lang.Object |
getUpperCase(java.lang.String key)
Returns the value to which the upper case value of this key is mapped in this table |
javax.swing.JComponent |
getUpperCaseJComponent(java.lang.String key)
Returns the JComponent value to which the specified upper case value of this key is mapped in this table. |
java.lang.Object |
putUpperCase(java.lang.String key,
java.lang.Object value)
Maps the specified key to the specified value in this table. |
Methods inherited from class java.util.concurrent.ConcurrentHashMap |
---|
clear, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values |
Methods inherited from class java.util.AbstractMap |
---|
clone, equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public SupportParameters()
public SupportParameters(int initialCapacity) throws java.lang.IllegalArgumentException
initialCapacity
- the initial capacity. The implementation performs internal sizing to accommodate this many elements
java.lang.IllegalArgumentException
- if the initial capacity of elements is negativepublic SupportParameters(int initialCapacity, float loadFactor, int concurrencyLevel)
initialCapacity
- the initial capacity. The implementation performs internal sizing to accommodate this many elements.loadFactor
- the load factor threshhold, used to control resizing. Resizing may be performed when the average number of elements per bin exceeds this threshold.concurrencyLevel
- the estimated number of concurrently updating threads. The implementation performs internal sizing to try to accommodate this many threads.
java.lang.IllegalArgumentException
- if the initial capacity is negative or the load factor or concurrencyLevel are nonpositiveMethod Detail |
---|
public javax.swing.JComponent getJComponent(java.lang.String key) throws java.lang.NullPointerException
Component
value to which the specified upper case value of this key is mapped in this table.
key
- a key in the table
java.lang.NullPointerException
- if key is nullpublic javax.swing.JComponent getUpperCaseJComponent(java.lang.String key) throws java.lang.NullPointerException
JComponent
value to which the specified upper case value of this key is mapped in this table.
key
- a key in the table. This key will be converted to upper case
java.lang.NullPointerException
- if key is nullpublic java.lang.Object putUpperCase(java.lang.String key, java.lang.Object value) throws java.lang.NullPointerException
key
to the specified value
in this table. Neither the key nor the value can be nullget
method with a key that is equal to the original key.toUpperCase()
key
- the table key. This key will be converted to upper casevalue
- the value
null
if it did not have one.
java.lang.NullPointerException
- if key or value is null
public java.lang.Object getUpperCase(java.lang.String key) throws java.lang.NullPointerException
key
- a key in the table. This key will be converted to upper case
null
if the key is not mapped to any value in this table
java.lang.NullPointerException
- if the key is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |