Package org.compiere.model
Class MUOM
- java.lang.Object
-
- org.compiere.model.PO
-
- org.compiere.model.X_C_UOM
-
- org.compiere.model.MUOM
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_C_UOM
,I_Persistent
,Evaluatee
,ImmutablePOSupport
public class MUOM extends X_C_UOM implements ImmutablePOSupport
Unit Of Measure Model- Version:
- $Id: MUOM.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static ImmutableIntPOCache<Integer,MUOM>
s_cache
UOM Cachestatic String
X12_DAY
X12 Element 355 Code Daystatic String
X12_DAY_WORK
X12 Element 355 Code Work Day (8 hours / 5days)static String
X12_HOUR
X12 Element 355 Code Hourstatic String
X12_MINUTE
X12 Element 355 Code Minutestatic String
X12_MONTH
X12 Element 355 Code Monthstatic String
X12_MONTH_WORK
X12 Element 355 Code Work Month (20 days / 4 weeks)static String
X12_SECOND
X12 Element 355 Code Secondstatic String
X12_WEEK
X12 Element 355 Code Weekstatic String
X12_YEAR
X12 Element 355 Code Year-
Fields inherited from class org.compiere.model.X_C_UOM
UOMTYPE_AD_Reference_ID, UOMTYPE_Angle, UOMTYPE_Area, UOMTYPE_Currency, UOMTYPE_DataSpeed, UOMTYPE_DataStorage, UOMTYPE_Density, UOMTYPE_Energy, UOMTYPE_Force, UOMTYPE_Frequency, UOMTYPE_KitchenMeasures, UOMTYPE_Length, UOMTYPE_Other, UOMTYPE_Power, UOMTYPE_Pressure, UOMTYPE_Temperature, UOMTYPE_Time, UOMTYPE_Torque, UOMTYPE_Velocity, UOMTYPE_VolumeDry, UOMTYPE_VolumeLiquid, UOMTYPE_Weight
-
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
-
Fields inherited from interface org.compiere.model.I_C_UOM
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_C_UOM_ID, COLUMNNAME_C_UOM_UU, COLUMNNAME_CostingPrecision, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_IsActive, COLUMNNAME_IsDefault, COLUMNNAME_Name, COLUMNNAME_StdPrecision, COLUMNNAME_UOMSymbol, COLUMNNAME_UOMType, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_X12DE355, Model, Table_ID, Table_Name
-
-
Constructor Summary
Constructors Constructor Description MUOM(Properties ctx, int C_UOM_ID, String trxName)
Constructor.MUOM(Properties ctx, ResultSet rs, String trxName)
Load Constructor.MUOM(Properties ctx, MUOM copy)
MUOM(Properties ctx, MUOM copy, String trxName)
MUOM(MUOM copy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MUOM
get(int C_UOM_ID)
Get UOM from Cache (immutable)static MUOM
get(Properties ctx, int C_UOM_ID)
Get UOM from Cache (immutable)static MUOM
get(Properties ctx, String name, String trxName)
Get UOM by namestatic int
getDefault_UOM_ID(Properties ctx)
Get Default C_UOM_IDstatic int
getMinute_UOM_ID(Properties ctx)
Get Minute C_UOM_IDstatic int
getPrecision(Properties ctx, int C_UOM_ID)
Get Precisionboolean
isDay()
Dayboolean
isHour()
Hourboolean
isMinute()
Minuteboolean
isMonth()
Monthboolean
isSecond()
Secondboolean
isWeek()
Weekboolean
isWorkDay()
WorkDayboolean
isWorkMonth()
WorkMonthboolean
isYear()
Yearprotected static void
loadUOMs(Properties ctx)
Load All UOMsMUOM
markImmutable()
mark PO as immutableBigDecimal
round(BigDecimal qty, boolean stdPrecision)
Round qtyString
toString()
String Representation-
Methods inherited from class org.compiere.model.X_C_UOM
get_AccessLevel, getC_UOM_ID, getC_UOM_UU, getCostingPrecision, getDescription, getKeyNamePair, getName, getStdPrecision, getUOMSymbol, getUOMType, getX12DE355, initPO, isDefault, setC_UOM_ID, setC_UOM_UU, setCostingPrecision, setDescription, setIsDefault, setName, setStdPrecision, setUOMSymbol, setUOMType, setX12DE355
-
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, beforeSave, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock, update_Tree, validForeignKeys
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface org.compiere.model.I_C_UOM
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
-
Methods inherited from interface org.compiere.model.I_Persistent
save
-
-
-
-
Field Detail
-
X12_SECOND
public static final String X12_SECOND
X12 Element 355 Code Second- See Also:
- Constant Field Values
-
X12_MINUTE
public static final String X12_MINUTE
X12 Element 355 Code Minute- See Also:
- Constant Field Values
-
X12_HOUR
public static final String X12_HOUR
X12 Element 355 Code Hour- See Also:
- Constant Field Values
-
X12_DAY
public static final String X12_DAY
X12 Element 355 Code Day- See Also:
- Constant Field Values
-
X12_DAY_WORK
public static final String X12_DAY_WORK
X12 Element 355 Code Work Day (8 hours / 5days)- See Also:
- Constant Field Values
-
X12_WEEK
public static final String X12_WEEK
X12 Element 355 Code Week- See Also:
- Constant Field Values
-
X12_MONTH
public static final String X12_MONTH
X12 Element 355 Code Month- See Also:
- Constant Field Values
-
X12_MONTH_WORK
public static final String X12_MONTH_WORK
X12 Element 355 Code Work Month (20 days / 4 weeks)- See Also:
- Constant Field Values
-
X12_YEAR
public static final String X12_YEAR
X12 Element 355 Code Year- See Also:
- Constant Field Values
-
s_cache
protected static ImmutableIntPOCache<Integer,MUOM> s_cache
UOM Cache
-
-
Constructor Detail
-
MUOM
public MUOM(Properties ctx, int C_UOM_ID, String trxName)
Constructor.- Parameters:
ctx
- contextC_UOM_ID
- UOM IDtrxName
- transaction
-
MUOM
public MUOM(Properties ctx, ResultSet rs, String trxName)
Load Constructor.- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MUOM
public MUOM(MUOM copy)
- Parameters:
copy
-
-
MUOM
public MUOM(Properties ctx, MUOM copy)
- Parameters:
ctx
-copy
-
-
MUOM
public MUOM(Properties ctx, MUOM copy, String trxName)
- Parameters:
ctx
-copy
-trxName
-
-
-
Method Detail
-
getMinute_UOM_ID
public static int getMinute_UOM_ID(Properties ctx)
Get Minute C_UOM_ID- Parameters:
ctx
- context- Returns:
- C_UOM_ID for Minute
-
getDefault_UOM_ID
public static int getDefault_UOM_ID(Properties ctx)
Get Default C_UOM_ID- Parameters:
ctx
- context for AD_Client- Returns:
- C_UOM_ID
-
get
public static MUOM get(int C_UOM_ID)
Get UOM from Cache (immutable)- Parameters:
C_UOM_ID
- ID- Returns:
- UOM
-
get
public static MUOM get(Properties ctx, int C_UOM_ID)
Get UOM from Cache (immutable)- Parameters:
ctx
- contextC_UOM_ID
- ID- Returns:
- UOM
-
get
public static MUOM get(Properties ctx, String name, String trxName)
Get UOM by name- Parameters:
ctx
-name
-trxName
-- Returns:
- MUOM if found, null if not found
-
getPrecision
public static int getPrecision(Properties ctx, int C_UOM_ID)
Get Precision- Parameters:
ctx
- contextC_UOM_ID
- ID- Returns:
- Precision
-
loadUOMs
protected static void loadUOMs(Properties ctx)
Load All UOMs- Parameters:
ctx
- context
-
toString
public String toString()
String Representation
-
round
public BigDecimal round(BigDecimal qty, boolean stdPrecision)
Round qty- Parameters:
qty
- quantitystdPrecision
- true if std precisison- Returns:
- rounded quantity
-
isSecond
public boolean isSecond()
Second- Returns:
- true if UOM is second
-
isMinute
public boolean isMinute()
Minute- Returns:
- true if UOM is minute
-
isHour
public boolean isHour()
Hour- Returns:
- true if UOM is hour
-
isDay
public boolean isDay()
Day- Returns:
- true if UOM is Day
-
isWorkDay
public boolean isWorkDay()
WorkDay- Returns:
- true if UOM is work day
-
isWeek
public boolean isWeek()
Week- Returns:
- true if UOM is Week
-
isMonth
public boolean isMonth()
Month- Returns:
- true if UOM is Month
-
isWorkMonth
public boolean isWorkMonth()
WorkMonth- Returns:
- true if UOM is Work Month
-
isYear
public boolean isYear()
Year- Returns:
- true if UOM is year
-
markImmutable
public MUOM markImmutable()
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-
-