com.anasoft.os.daofusion.bitemporal
Class BitemporalProperty<V,T extends Bitemporal>

java.lang.Object
  extended by com.anasoft.os.daofusion.bitemporal.BitemporalProperty<V,T>
Type Parameters:
V - Value wrapped by the Bitemporal object.
T - Bitemporal object implementation that wraps the given value type.
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
WrappedBitemporalProperty

public class BitemporalProperty<V,T extends Bitemporal>
extends java.lang.Object
implements java.io.Serializable

Represents a bitemporally tracked property of a class (for instance the name of a person).

The BitemporalProperty class provides a high-level API expressed in terms of actual value classes (e.g. String), layered on top of low-level constructs such as the BitemporalTrace and Bitemporal objects. To be able to provide an API at the level of actual value classes, the BitemporalProperty uses a ValueAccessor to extract actual values from Bitemporal objects.

Author:
Erwin Vervaet, Christophe Vanfleteren
See Also:
BitemporalTrace, ValueAccessor, Serialized Form

Constructor Summary
BitemporalProperty(BitemporalTrace trace, ValueAccessor<V,T> accessor)
          Create a new bitemporal property wrapping the given trace and using the given value accessor.
BitemporalProperty(java.util.Collection<? extends Bitemporal> data, ValueAccessor<V,T> accessor)
          Create a new bitemporal property on top of given data collection and using the given value accessor.
 
Method Summary
 void end()
          Forget the currently valid value.
 void end(org.joda.time.DateTime validOn)
          Forget the valid valid on given date.
 T get()
          Returns the Bitemporal object valid now as currently known.
 T get(org.joda.time.DateTime validOn)
          Returns the Bitemporal object valid on specified date as currently known.
 T get(org.joda.time.DateTime validOn, org.joda.time.DateTime knownOn)
          Returns the Bitemporal object valid on specified date as known on given date.
 java.util.Collection<T> getData()
          Returns the Bitemporal object collection contained within the trace.
 java.util.List<T> getEvolution()
          Returns the evolution of the value currently valid.
 java.util.List<T> getEvolution(org.joda.time.DateTime validOn)
          Returns the evolution of the value valid on given date.
 java.util.List<T> getHistory()
          Returns the history of the value as currently known.
 java.util.List<T> getHistory(org.joda.time.DateTime knownOn)
          Returns the history of the value as known on given date.
 BitemporalTrace getTrace()
          Returns the wrapped bitemporal trace.
 boolean hasValue()
          Returns whether or not this property has a known value currently valid.
 boolean hasValueOn(org.joda.time.DateTime validOn)
          Returns whether or not this property has a value valid on given date.
 boolean hasValueOn(org.joda.time.DateTime validOn, org.joda.time.DateTime knownOn)
          Returns whether or not this property had a value valid on given date as known on specified date.
 V now()
          Returns the value valid now as currently known.
 V on(org.joda.time.DateTime validOn)
          Returns the value valid on specified date as currently known.
 V on(org.joda.time.DateTime validOn, org.joda.time.DateTime knownOn)
          Returns the value valid on specified date as known on given date.
 void set(V value)
          Set the value of this bitemporal property.
 void set(V value, org.joda.time.Interval validityInterval)
          Set the value of this bitemporal property for specified validity interval.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitemporalProperty

public BitemporalProperty(java.util.Collection<? extends Bitemporal> data,
                          ValueAccessor<V,T> accessor)
Create a new bitemporal property on top of given data collection and using the given value accessor.


BitemporalProperty

public BitemporalProperty(BitemporalTrace trace,
                          ValueAccessor<V,T> accessor)
Create a new bitemporal property wrapping the given trace and using the given value accessor.

Method Detail

getTrace

public BitemporalTrace getTrace()
Returns the wrapped bitemporal trace.


now

public V now()
Returns the value valid now as currently known.


on

public V on(org.joda.time.DateTime validOn)
Returns the value valid on specified date as currently known.


on

public V on(org.joda.time.DateTime validOn,
            org.joda.time.DateTime knownOn)
Returns the value valid on specified date as known on given date.


get

public T get()
Returns the Bitemporal object valid now as currently known.


get

public T get(org.joda.time.DateTime validOn)
Returns the Bitemporal object valid on specified date as currently known.


get

public T get(org.joda.time.DateTime validOn,
             org.joda.time.DateTime knownOn)
Returns the Bitemporal object valid on specified date as known on given date.


getHistory

public java.util.List<T> getHistory()
Returns the history of the value as currently known. This informs you about how the valid value changed, as we currently know it.


getHistory

public java.util.List<T> getHistory(org.joda.time.DateTime knownOn)
Returns the history of the value as known on given date. This informs you about how the valid value changed, as known on given date.


getEvolution

public java.util.List<T> getEvolution()
Returns the evolution of the value currently valid. This informs you about how our knowledge about the value currently valid evolved.


getEvolution

public java.util.List<T> getEvolution(org.joda.time.DateTime validOn)
Returns the evolution of the value valid on given date. This informs you about how our knowledge about the value valid on given date evolved.


getData

public java.util.Collection<T> getData()
Returns the Bitemporal object collection contained within the trace.


set

public void set(V value)
Set the value of this bitemporal property. The new value will be valid from now on.


set

public void set(V value,
                org.joda.time.Interval validityInterval)
Set the value of this bitemporal property for specified validity interval.


end

public void end()
Forget the currently valid value.


end

public void end(org.joda.time.DateTime validOn)
Forget the valid valid on given date.


hasValue

public boolean hasValue()
Returns whether or not this property has a known value currently valid.


hasValueOn

public boolean hasValueOn(org.joda.time.DateTime validOn)
Returns whether or not this property has a value valid on given date.


hasValueOn

public boolean hasValueOn(org.joda.time.DateTime validOn,
                          org.joda.time.DateTime knownOn)
Returns whether or not this property had a value valid on given date as known on specified date.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2008-2009 ANASOFT and contributors. All Rights Reserved.