Class MITListItem
- All Implemented Interfaces:
Cacheable,LocalizableOM,Serializable,Comparable<MITListItem>,ColumnAccessByName,ObjectModel,Persistent
A module and an iteme type. Wildcards are possible, so that a single MITListItem could represent all the item types in a module. A single item type in all modules (that have it defined). Or all modules and item types.
Parent 를 갖고 있으면 Parent 는 하나만 설정하여야 한다.
all --> id = 0, 0 ( MULTIPLE_MODULE_KEY GroupEnum.ALL, MULTIPLE_ITEM_TYPE_KEYItemTypeEnum.ALL )
M : 0 & T : 0 M : NULL & T : 0 모든 모듈, 아이템 유형 : M : 0 , T : 0
현재 모듈, 아이템 유형 : M : NULL & T : T
특정 모듈 모든 아이템 유형 : M : M & T : 0
특정 모듈 아래에 모든 모듈, 모든 아이템 유형 : M : 0 & T : 0 & P : P
특정 모듈 아래에 모든 모듈, 아이템 유형 : M : 0 & T : T & P : P
- Version:
- $Id: MITListItem.java,v 1.71 2008/12/25 04:03:45 youngho Exp $
- Author:
- Youngho Cho
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumtoExpression() 할 때 Human Readable 하게 처리하기 위하여 도입 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()clear this Serializable instance cacheintcompareTo(MITListItem otherItem) Comparable 구현, 이 MitListItem 이 표시하는 면적을 비교한다.주의 : CurrentModule, CurrentItemType 은 지원하지 않는다.getAttributeIds(boolean activeOnly, boolean commonOnly) 이 item 이 처리하는 BitMatrix 를 구한다.getBitMatrix(int moduleSize, int itemTypeSize) 주어진 크기로 이 item 이 처리하는 BitMatrix 를 구한다.Returns the associated ItemType object.static intBitMatrix 의 ItemType 크기 (y, height) : 현재 ItemType 의 최대 id + 1getLocalized(Locale locale) locale 에 해당하는 localized 정보를 구한다.Returns the method result cache for this object.getModuleAttribute(Attribute attribute) isSingleModuleItemType 일 경우 ModuleAttribute 을 구한다.isSingleModuleItemType 일 경우 ModuleItemType 을 구한다.static intBitMatrix 의 Module 크기 (x, width) : 현재 Module 의 최대 id + 1DOCUMENT ME!inthashCode()저장된 item 은 primary key 로, 저장되기 전에는 객체 자신으로 hashCode 를 구한다booleanDOCUMENT ME!boolean모든 ItemType 에 적용하는지 즉 ItemTypeId 가ItemTypeEnum.ALLboolean모든 Module 에 적용하는지 즉 ModuleId 가GroupEnum.ALLboolean대상이 SingleItemType 인지boolean대상이 SingleModule 인지booleanisSingleModuleItemType 을 확인한다. ( true 이면 대응하는 ModuleItemType 이 존재하여야 한다.)booleanwhere use CurrentItemTypebooleanwhere use CurrentModulevoidsave()Stores the object in the database.voidDOCUMENT ME!voidDOCUMENT ME!human readerble expressionP\dI\d+, M\d+I\d+ 의 Pattern 으로 문자열을 만든다. null 이면 Pnull, Mnull 등과 같이 표현한다.toString()toString()Methods inherited from class com.easydesk.om.BaseMITListItem
copy, copy, copy, copy, copyInto, copyInto, copyInto, copyInto, equals, getByName, getByPeerName, getByPosition, getEasyDeskModuleRelatedByModuleId, getEasyDeskModuleRelatedByModuleId, getEasyDeskModuleRelatedByParentId, getEasyDeskModuleRelatedByParentId, getFieldNames, getForeignKeyForEasyDeskModuleRelatedByModuleId, getForeignKeyForEasyDeskModuleRelatedByParentId, getForeignKeyForItemType, getForeignKeyForMITList, getItemId, getItemType, getItemTypeId, getListId, getMITList, getMITList, getModuleId, getParentId, getPeer, getPrimaryKey, getTableMap, isCacheOnSave, isDeleted, isLoading, isModified, isNew, isSaving, isSubstract, resetModified, save, save, setByName, setByPeerName, setByPosition, setDeleted, setEasyDeskModuleRelatedByModuleId, setEasyDeskModuleRelatedByModuleIdKey, setEasyDeskModuleRelatedByParentId, setEasyDeskModuleRelatedByParentIdKey, setItemId, setItemType, setItemTypeId, setItemTypeKey, setListId, setLoading, setMITList, setMITListKey, setModified, setModuleId, setNew, setParentId, setPrimaryKey, setPrimaryKey, setSaving, setSubstract, valueEqualsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.easydesk.cache.Cacheable
runResetMethods
-
Constructor Details
-
MITListItem
public MITListItem()
-
-
Method Details
-
save
Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed.- Specified by:
savein interfacePersistent- Overrides:
savein classBaseMITListItem- Throws:
Exception
-
setModule
DOCUMENT ME!- Parameters:
module- DOCUMENT ME!- Throws:
TorqueException- DOCUMENT ME!
-
getItemType
Description copied from class:BaseMITListItemReturns the associated ItemType object. If it was not retrieved before, the object is retrieved from the database- Overrides:
getItemTypein classBaseMITListItem- Returns:
- itemType or current itemType
- Throws:
TorqueException- DOCUMENT ME!
-
getModule
- Returns:
- module or current module
- Throws:
TorqueException- DOCUMENT ME!
-
setParent
DOCUMENT ME!- Parameters:
module- DOCUMENT ME!- Throws:
TorqueException- DOCUMENT ME!
-
getParent
DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
TorqueException- DOCUMENT ME!
-
hasParent
public boolean hasParent()DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
compareTo
Comparable 구현, 이 MitListItem 이 표시하는 면적을 비교한다. (m x t) 처리 보다 큰 범위이면 1, 동일한 범위이면 0, 보다 작은 범위이면 -1 먼저 itemType 을 비교한다. 그 다음 Module 범위를 구한다. Substract 는 비교하지 않는다.- Specified by:
compareToin interfaceComparable<MITListItem>- See Also:
-
isSingleModuleItemType
public boolean isSingleModuleItemType()isSingleModuleItemType 을 확인한다. ( true 이면 대응하는 ModuleItemType 이 존재하여야 한다.)- Returns:
- DOCUMENT ME!
-
isSingleModule
public boolean isSingleModule()대상이 SingleModule 인지- Returns:
-
isSingleItemType
public boolean isSingleItemType()대상이 SingleItemType 인지- Returns:
-
isUseCurrentModule
public boolean isUseCurrentModule()where use CurrentModule- Returns:
- true if moduleId is null
-
isUseCurrentItemType
public boolean isUseCurrentItemType()where use CurrentItemType- Returns:
- true if itemTypeId is null
-
isForAllItemTypes
public boolean isForAllItemTypes()모든 ItemType 에 적용하는지 즉 ItemTypeId 가ItemTypeEnum.ALL -
isForAllModule
public boolean isForAllModule()모든 Module 에 적용하는지 즉 ModuleId 가GroupEnum.ALL -
getModuleItemType
isSingleModuleItemType 일 경우 ModuleItemType 을 구한다. 그외는 null 을- Returns:
- moduleItemType or null
- Throws:
TorqueException
-
getModuleAttribute
isSingleModuleItemType 일 경우 ModuleAttribute 을 구한다.- Parameters:
attribute-- Returns:
- ma or null
- Throws:
TorqueException
-
hashCode
public int hashCode()저장된 item 은 primary key 로, 저장되기 전에는 객체 자신으로 hashCode 를 구한다. (BaseMITListItem.equals(Object)와 일치)BitMatrix 는 DB 조회와 TransactionContext 에 따라 달라지므로 hashCode 에 사용하지 않는다. Torque 의 기본 hashCode 는 primary key 가 없으면 호출할 때마다 값이 달라진다.
- Overrides:
hashCodein classBaseMITListItem- Returns:
- an
intvalue - See Also:
-
getModuleIds
- Returns:
- moduleIds collection for all 이면 null 을 return 한다.
- Throws:
TorqueException
-
getItemTypeIds
- Returns:
- ItemTypeIds collection
- Throws:
TorqueException
-
getAttributeIds
주의 : CurrentModule, CurrentItemType 은 지원하지 않는다.- Throws:
TorqueException
-
getAttributeIds
protected List<Integer> getAttributeIds(boolean activeOnly, boolean commonOnly) throws TorqueException - Parameters:
activeOnly-commonOnly-- Returns:
- attribute list
- Throws:
TorqueException
-
toKeyString
P\dI\d+, M\d+I\d+ 의 Pattern 으로 문자열을 만든다. null 이면 Pnull, Mnull 등과 같이 표현한다. 검색범위 문자열 TODO : expression language -
getModuleMatrixSize
BitMatrix 의 Module 크기 (x, width) : 현재 Module 의 최대 id + 1- Returns:
- module size
- Throws:
TorqueException- 조회 오류
-
getItemTypeMatrixSize
BitMatrix 의 ItemType 크기 (y, height) : 현재 ItemType 의 최대 id + 1- Returns:
- itemType size
- Throws:
TorqueException- 조회 오류
-
getBitMatrix
이 item 이 처리하는 BitMatrix 를 구한다. 크기는 현재 DB 의 Module / ItemType 최대 id 로 정한다.여러 item 의 BitMatrix 를 함께 연산할 때는 크기가 같아야 하므로
getBitMatrix(int, int)를 사용한다.- Returns:
- 이 item 이 처리하는 BitMatrix (x : Module id, y : ItemType id)
-
getBitMatrix
주어진 크기로 이 item 이 처리하는 BitMatrix 를 구한다.- 모든 ItemType (
ItemTypeEnum.ALL) : 모든 ItemType - 모든 Module (
GroupEnum.ALL) : Parent 가 없으면 모든 Module, Parent 가 있으면 Parent 아래의 모든 Module (자손) - Parent 가 있고 모든 Module 이 아니면 Parent 의 자식 Module
- Module / ItemType 이 null 이면 현재 (TransactionContext) Module / ItemType
- Parameters:
moduleSize- Module 크기 (x, width),getModuleMatrixSize()itemTypeSize- ItemType 크기 (y, height),getItemTypeMatrixSize()- Returns:
- 이 item 이 처리하는 BitMatrix (x : Module id, y : ItemType id)
- Throws:
TorqueException- 조회 오류IllegalArgumentException- id 가 크기를 벗어나는 경우IllegalStateException- 현재 Module / ItemType 을 구할 수 없는 경우
- 모든 ItemType (
-
toExpression
human readerble expression모든 모듈, 아이템 유형 : P M 0 T 0 P
현재 모듈, 아이템 유형 : P M T : T P
특정 모듈 모든 아이템 유형 : P M M T 0 P
특정 모듈 아래에 모든 모듈, 모든 아이템 유형 : P P M 0 T 0
특정 모듈 아래에 모든 모듈, 아이템 유형 : P P M 0 T T
- Returns:
- string representation
-
toString
toString()- Overrides:
toStringin classBaseMITListItem- Returns:
- string representation
-
getLocalized
Description copied from interface:LocalizableOMlocale 에 해당하는 localized 정보를 구한다.- Specified by:
getLocalizedin interfaceLocalizableOM- Parameters:
locale-- Returns:
- localized
- Throws:
TorqueException- 조회 중 오류가 발생한 경우
-
getMethodCache
Description copied from interface:CacheableReturns the method result cache for this object.- Specified by:
getMethodCachein interfaceCacheable- Returns:
- MethodResultCache
-
clear
public void clear()Description copied from interface:Cacheableclear this Serializable instance cache
-