net.sf.fikin.pojostate.state
Class EmptyState

java.lang.Object
  extended by net.sf.fikin.pojostate.state.AbstractState
      extended by net.sf.fikin.pojostate.state.EmptyState
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable, java.util.Collection, State, StatePrototype

public class EmptyState
extends AbstractState

An empty state without any backing POJO and Properties. created on Mar 6, 2007

Since:
Version:
$Revision: 1.1 $
Author:
fiykov

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.fikin.pojostate.state.AbstractState
AbstractState.PropertyNameComparator
 
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
EmptyState()
           
 
Method Summary
 Property newProperty(MethodMeta mm)
          instantiate new Property for given MethodMeta This is a factory method used by Decorator during instantiation of new State object
 void sort(int leadField, int order)
          sort the objects directly in the underlying collection
 void update()
          Update the state of the object.
 
Methods inherited from class net.sf.fikin.pojostate.state.AbstractState
add, add, addAll, clear, clone, contains, containsAll, getClassLoader, getFormat, getLocale, getObject, getProperties, getProperty, isEmpty, iterator, remove, removeAll, retainAll, setClassLoader, setFormat, setLocale, setObject, setProperties, size, sortArray, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

EmptyState

public EmptyState()
Method Detail

newProperty

public Property newProperty(MethodMeta mm)
                     throws DecorationException
Description copied from interface: StatePrototype
instantiate new Property for given MethodMeta

This is a factory method used by Decorator during instantiation of new State object

Parameters:
mm - to be used as underlying MethodMeta for that Property
Throws:
DecorationException - in case of internal error

sort

public void sort(int leadField,
                 int order)
Description copied from class: AbstractState
sort the objects directly in the underlying collection

Specified by:
sort in interface State
Overrides:
sort in class AbstractState
Parameters:
leadField - is one of State.SORT_BY_NAME,State.SORT_BY_DESC or State.SORT_BY_VALUE
order - is one of State.SORT_ASC or State.SORT_DESC

update

public void update()
            throws DecorationException
Description copied from interface: State
Update the state of the object.

The idea of this method is to allow for state update is that is possible. This way State objects became reusable.

This method is subject to different implementation variations. For example, snapshot type of States might be able to refresh state but dynamic generally do not need this.

Throws:
DecorationException


Copyright © 2005 Nikolay Fiykov. All Rights Reserved.