|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectau.com.zip.cs.CachableAdaptor
au.com.zip.cs.AsyncObject
au.com.zip.cs.EntityAdaptor
public class EntityAdaptor
A basic implementation of Entity.
| Field Summary | |
|---|---|
static String |
DEFAULT_LONGNAME_ATTRIBUTENAME
The default attribute name for an Entity's long name: NAME_LONG. |
static String |
DEFAULT_SHORTNAME_ATTRIBUTENAME
The default attribute name for an Entity's short name: NAME_SHORT. |
| Fields inherited from class au.com.zip.cs.AsyncObject |
|---|
CLEAN, DELETED, MODIFIED, NEW |
| Fields inherited from interface au.com.zip.cs.Entity |
|---|
DEFAULT_ID_ATTRIBUTENAME, ID_NULL |
| Fields inherited from interface au.com.zip.cs.Dated |
|---|
DATE_NOW, DATE_NULL, DFLT_END_DATE_ATTRIBUTE, DFLT_START_DATE_ATTRIBUTE |
| Method Summary | |
|---|---|
Enumeration |
children()
|
void |
commit()
Apply any pending changes to the persistent store. |
static int |
compareIDTo(long id,
Object o)
Static access to the Comparable compareTo(Object) method. |
int |
compareTo(Object o)
|
static boolean |
currentAt(Entity e,
long when)
|
boolean |
currentAt(long when)
|
static long |
datedToLong(Object dated)
Convert a dated Object to a long time. |
boolean |
getAllowsChildren()
|
Object |
getAttribute(String name)
Return the named attribute value from this entity. |
Map |
getAttributes()
Return the attributes and values of this Entity. |
TreeNode |
getChildAt(int childIndex)
|
int |
getChildCount()
|
long |
getDatedAttribute(String name)
Return the milliseconds value corresponding to the named attribute value from this entity. |
long |
getEndDate()
Return the end date of this Entity
from its Dated.DFLT_START_DATE_ATTRIBUTE attribute. |
static long |
getEndDate(Entity e)
Return the end date of an Entity
obtained from its Dated.DFLT_START_DATE_ATTRIBUTE attribute. |
EntityTable |
getEntityTable()
Return this entity's enclosing EntityTable. |
long |
getID()
Return the unique numeric identifier of this Entity. |
int |
getIndex()
Return the index of this Entity in the enclosing EntityTable. |
int |
getIndex(TreeNode node)
|
String |
getLongName()
Return the long (descriptive) name for this entity. |
long |
getNumericAttribute(String name)
Return the numeric value of the named attribute value from this entity, which must be a Number. |
TreeNode |
getParent()
|
String |
getShortName()
Return the short name for this entity. |
long |
getStartDate()
Return the start date of this Entity
from the Dated.DFLT_START_DATE_ATTRIBUTE attribute. |
static long |
getStartDate(Entity e)
Return the start date of an Entity
from its Dated.DFLT_START_DATE_ATTRIBUTE attribute. |
static boolean |
isBetween(long when,
long start,
long end)
|
boolean |
isLeaf()
|
long |
longValue()
|
static long |
now()
Return the current date in milliseconds since midnight, January 1, 1970 UTC. |
static boolean |
overlaps(Entity e,
long start,
long end)
Check that the start and end dates for the supplied Entity
overlay the date range specified by the start and end parameters. |
static boolean |
overlaps(long start1,
long end1,
long start2,
long end2)
Check that the start and end dates for the supplied ranges overlap. |
void |
setAttribute(String name,
Object value)
Set the named attribute value from this entity. |
static void |
setEndDate(Entity e,
long when)
Set the end date of an Entity
stored in its Dated.DFLT_START_DATE_ATTRIBUTE attribute. |
void |
setEndDate(long when)
Set the end date of this Entity
stored in its Dated.DFLT_START_DATE_ATTRIBUTE attribute. |
void |
setLongName(String name)
Set the Entity's long name. |
void |
setShortName(String name)
Set the Entity's short name. |
static void |
setStartDate(Entity e,
long when)
Set the start date of an Entity
stored in its Dated.DFLT_START_DATE_ATTRIBUTE attribute. |
void |
setStartDate(long when)
Set the start date of this Entity
stored in its Dated.DFLT_START_DATE_ATTRIBUTE attribute. |
| Methods inherited from class au.com.zip.cs.AsyncObject |
|---|
bgCommit, cacheFlush, delete, getAsyncState, getBgCommitFIFO, setAsyncState, setBgCommitFIFO, setChanged |
| Methods inherited from class au.com.zip.cs.CachableAdaptor |
|---|
addSubCache, removeSubCache |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_SHORTNAME_ATTRIBUTENAME
NAME_SHORT.
public static final String DEFAULT_LONGNAME_ATTRIBUTENAME
NAME_LONG.
| Method Detail |
|---|
public EntityTable getEntityTable()
EntityEntityTable.
getEntityTable in interface Entitypublic long getID()
Entity.
getID in interface EntitygetID in interface HasIDpublic int getIndex()
EntityEntityTable.
getIndex in interface Entitypublic String getShortName()
Entity
getShortName in interface Entitypublic void setShortName(String name)
EntityEntityTables this may be unimplemented.
setShortName in interface Entityname - the new short namepublic String getLongName()
Entity
getLongName in interface Entitypublic void setLongName(String name)
Entity
setLongName in interface Entityname - the new long namepublic Map getAttributes()
EntityTable.
getAttributes in interface EntitygetEntityTable()public Object getAttribute(String name)
getAttribute in interface Entityname - the attribute name
public long getNumericAttribute(String name)
Number.
getNumericAttribute in interface Entityname - the attribute name
public void setAttribute(String name,
Object value)
setAttribute in interface Entityname - the attribute namevalue - the new valuepublic long getDatedAttribute(String name)
EntityNumber (if the date is stored as milliseconds)
or a Date.
getDatedAttribute in interface Entityname - the attribute name
public static long datedToLong(Object dated)
dated - the Object, which may be null
Datepublic long getStartDate()
Entity
from the Dated.DFLT_START_DATE_ATTRIBUTE attribute.
getStartDate in interface Datedpublic static long getStartDate(Entity e)
Entity
from its Dated.DFLT_START_DATE_ATTRIBUTE attribute.
e - the Entity to inspect
public void setStartDate(long when)
Entity
stored in its Dated.DFLT_START_DATE_ATTRIBUTE attribute.
setStartDate in interface Datedwhen - the start date
public static void setStartDate(Entity e,
long when)
Entity
stored in its Dated.DFLT_START_DATE_ATTRIBUTE attribute.
e - the Entity to inspectwhen - the start datepublic long getEndDate()
Entity
from its Dated.DFLT_START_DATE_ATTRIBUTE attribute.
getEndDate in interface Datedpublic static long getEndDate(Entity e)
Entity
obtained from its Dated.DFLT_START_DATE_ATTRIBUTE attribute.
e - the Entity to inspect
public void setEndDate(long when)
Entity
stored in its Dated.DFLT_START_DATE_ATTRIBUTE attribute.
setEndDate in interface Datedwhen - the end date
public static void setEndDate(Entity e,
long when)
Entity
stored in its Dated.DFLT_START_DATE_ATTRIBUTE attribute.
e - the Entity to inspectwhen - the end date
public static boolean currentAt(Entity e,
long when)
public boolean currentAt(long when)
public static long now()
System.currentTimeMillis()
public static boolean overlaps(Entity e,
long start,
long end)
Entity
overlay the date range specified by the start and end parameters.
e - the Entity to checkstart - the start dateend - the end date
public static boolean overlaps(long start1,
long end1,
long start2,
long end2)
start1 - the start date of the first rangeend1 - the end date of the first rangestart2 - the start date of the second rangeend2 - the end date of the second range
public static boolean isBetween(long when,
long start,
long end)
public void commit()
AsyncObjectAsyncObject.getAsyncState() returns AsyncObject.CLEAN
this method is normally a no-op.
commit in class AsyncObjectpublic Enumeration children()
children in interface TreeNodepublic boolean getAllowsChildren()
getAllowsChildren in interface TreeNodepublic TreeNode getChildAt(int childIndex)
getChildAt in interface TreeNodepublic int getChildCount()
getChildCount in interface TreeNodepublic int getIndex(TreeNode node)
getIndex in interface TreeNodepublic TreeNode getParent()
getParent in interface TreeNodepublic boolean isLeaf()
isLeaf in interface TreeNodepublic long longValue()
public int compareTo(Object o)
compareTo in interface Comparable
public static int compareIDTo(long id,
Object o)
Comparable compareTo(Object) method.
id - the source ido - the Object to which to compare
Comparable.compareTo(Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||