|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.fikin.pojostate.state.AbstractState
public abstract class AbstractState
Prototype implementation of State interface.
It provides with default handling for all methods.
Subclasses can modify any of them to suite their needs better. created on Mar 6, 2007
Nested Class Summary | |
---|---|
protected class |
AbstractState.PropertyNameComparator
This class is solely created to be used by getProperty(String)
to search in the Vector with Properties for given name. |
Field Summary |
---|
Fields inherited from interface net.sf.fikin.pojostate.State |
---|
SORT_ASC, SORT_BY_DESC, SORT_BY_NAME, SORT_BY_VALUE, SORT_DESC |
Constructor Summary | |
---|---|
AbstractState()
|
Method Summary | |
---|---|
boolean |
add(java.lang.Object arg0)
adds the given object to the collection with Properties |
void |
add(Property property)
|
boolean |
addAll(java.util.Collection arg0)
not implemented, dummy method |
void |
clear()
not implemented, dummy method |
java.lang.Object |
clone()
implements cloning |
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection arg0)
test if given collection is present in the Properties |
java.lang.ClassLoader |
getClassLoader()
|
StateFormat |
getFormat()
get state's formatting object Formatting object is responsible to convey this State
object to a string representation. |
java.util.Locale |
getLocale()
|
java.lang.Object |
getObject()
|
java.util.Vector |
getProperties()
|
Property |
getProperty(java.lang.String propertyName)
look for Property object with given UI name |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
boolean |
remove(java.lang.Object o)
not implemented, dummy method |
boolean |
removeAll(java.util.Collection arg0)
not implemented, dummy method |
boolean |
retainAll(java.util.Collection arg0)
not implemented, dummy method |
void |
setClassLoader(java.lang.ClassLoader loader)
|
void |
setFormat(StateFormat format)
assign the formating object |
void |
setLocale(java.util.Locale locale)
|
void |
setObject(java.lang.Object object)
assign the underlying POJO |
protected void |
setProperties(java.util.Vector properties)
|
int |
size()
|
void |
sort(int leadField,
int order)
sort the objects directly in the underlying collection |
protected java.lang.Object[] |
sortArray(int leadField,
int order)
implementation of the sorting subclasses can utilize it in their particular implementation of sort(int,int) method. |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] arg0)
|
java.lang.String |
toString()
print the State in its appropriate textual format. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.fikin.pojostate.StatePrototype |
---|
newProperty |
Methods inherited from interface net.sf.fikin.pojostate.State |
---|
update |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Constructor Detail |
---|
public AbstractState()
Method Detail |
---|
public java.lang.ClassLoader getClassLoader()
getClassLoader
in interface State
public void setClassLoader(java.lang.ClassLoader loader)
setClassLoader
in interface StatePrototype
loader
- The loader to set.public java.util.Locale getLocale()
getLocale
in interface State
public void setLocale(java.util.Locale locale)
setLocale
in interface StatePrototype
locale
- The locale to set.public java.util.Vector getProperties()
protected void setProperties(java.util.Vector properties)
public void add(Property property)
property
- to add the listpublic java.lang.Object getObject()
getObject
in interface State
public void setObject(java.lang.Object object)
setObject
in interface StatePrototype
object
- public StateFormat getFormat()
State
Formatting object is responsible to convey this State
object to a string representation. >Typical layout formats is to be
expected to be tabular text, XML, HTML or similar.
This object is used by State.toString()
too.
getFormat
in interface State
public void setFormat(StateFormat format)
setFormat
in interface StatePrototype
format
- public Property getProperty(java.lang.String propertyName)
Property
object with given UI name
getProperty
in interface State
propertyName
- to look for
Property
object with that UI name or null if no such
foundpublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface StatePrototype
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void sort(int leadField, int order)
sort
in interface State
leadField
- order
- protected java.lang.Object[] sortArray(int leadField, int order)
subclasses can utilize it in their particular implementation of
sort(int,int)
method.
leadField
- is the leading propertyorder
- is ascending or descending
public java.lang.String toString()
This implementation is a dynamic i.e. uses the assigned formatter object to generate the appearance upon each call.
toString
in interface State
toString
in class java.lang.Object
getFormat().format( this )
public int size()
size
in interface java.util.Collection
public boolean isEmpty()
isEmpty
in interface java.util.Collection
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
public java.lang.Object[] toArray(java.lang.Object[] arg0)
toArray
in interface java.util.Collection
public boolean add(java.lang.Object arg0)
add
in interface java.util.Collection
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
public boolean containsAll(java.util.Collection arg0)
containsAll
in interface java.util.Collection
arg0
-
public boolean addAll(java.util.Collection arg0)
addAll
in interface java.util.Collection
public boolean removeAll(java.util.Collection arg0)
removeAll
in interface java.util.Collection
public boolean retainAll(java.util.Collection arg0)
retainAll
in interface java.util.Collection
public void clear()
clear
in interface java.util.Collection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |