Compiere 3.1

org.compiere.model
Class NaturalAccountMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.concurrent.ConcurrentHashMap<K,V>
          extended by org.compiere.util.CCache<String,MElementValue>
              extended by org.compiere.model.NaturalAccountMap
Type Parameters:
K - key
V - value
All Implemented Interfaces:
Serializable, ConcurrentMap<String,MElementValue>, Map<String,MElementValue>, CacheInterface

public final class NaturalAccountMap
extends CCache<String,MElementValue>

Natural Account (HashMap) Management.

  The key is a String of the column name (e.g. SUSPENSEBALANCING_ACCT)
  The value is an NaturalAccount

  a) Account information are loaded via the parse functions
  b) Accounts are created via the createAccounts function
  c) retrieve the C_ElementValue_ID for the given key
  

Version:
$Id: NaturalAccountMap.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
NaturalAccountMap(Ctx ctx, String trxName)
          Constructor.
 
Method Summary
 int getC_ElementValue_ID(String key)
          Get ElementValue
 String parseFile(File file)
          Read and Parse File
 String parseLine(String line)
          Create Account Entry for Default Accounts only.
 boolean saveAccounts(int AD_Client_ID, int AD_Org_ID, int C_Element_ID)
          Save all Accounts
 
Methods inherited from class org.compiere.util.CCache
addVetoableChangeListener, clear, containsKey, containsValue, entrySet, get, get, getExpireMinutes, getName, isEmpty, isReset, keySet, put, putAll, removeVetoableChangeListener, reset, setExpireMinutes, setUsed, size, sizeNoExpire, toString, values
 
Methods inherited from class java.util.concurrent.ConcurrentHashMap
contains, elements, keys, putIfAbsent, remove, remove, replace, replace
 
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode
 
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

NaturalAccountMap

public NaturalAccountMap(Ctx ctx,
                         String trxName)
Constructor. Parse File does the processing

Parameters:
ctx - context
trxName - transaction
Method Detail

parseFile

public String parseFile(File file)
Read and Parse File

Parameters:
file - Accounts file
Returns:
error message or "" if OK

parseLine

public String parseLine(String line)
                 throws Exception
Create Account Entry for Default Accounts only.

Parameters:
line - line with info Line format (9 fields) 1 A [Account Value] 2 B [Account Name] 3 C [Description] 4 D [Account Type] 5 E [Account Sign] 6 F [Document Controlled] 7 G [Summary Account] 8 H [Default_Account] 9 I [Parent Value] - ignored
Returns:
error message or "" if OK
Throws:
Exception

saveAccounts

public boolean saveAccounts(int AD_Client_ID,
                            int AD_Org_ID,
                            int C_Element_ID)
Save all Accounts

Parameters:
AD_Client_ID - client
AD_Org_ID - org
C_Element_ID - element
Returns:
true if created

getC_ElementValue_ID

public int getC_ElementValue_ID(String key)
Get ElementValue

Parameters:
key - key
Returns:
0 if error

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.