Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jtemporal
Class AbstractTemporalUnaryMap  view AbstractTemporalUnaryMap download AbstractTemporalUnaryMap.java

java.lang.Object
  extended byjtemporal.AbstractTemporalUnaryMap
All Implemented Interfaces:
TemporalUnaryMap
Direct Known Subclasses:
TreeTemporalUnaryMap, TreeTemporalUnaryMap.SubMap

public abstract class AbstractTemporalUnaryMap
extends java.lang.Object
implements TemporalUnaryMap

Features common to the UnaryMaps.

Version:
$Id$

Constructor Summary
AbstractTemporalUnaryMap()
           
 
Method Summary
abstract  void clear()
          Removes all mappings from this map (optional operation).
abstract  boolean containsInstant(Instant instant)
          Returns true if this map contains a mapping for the specified Instant.
abstract  boolean containsValue(java.lang.Object value)
          Returns true if this map maps one or more Periods to the specified value.
 boolean equalContent(java.lang.Object o)
          Compares the specified object with this map for content equality.
 Period extent()
          Returns a period enclosing firstInstant() and lastInstant()
abstract  Instant firstInstant()
          Returns the first (lowest) instant currently in this temporal map.
abstract  Period firstPeriod()
          Returns the first (lowest) period currently in this temporal map.
abstract  java.lang.Object get(Instant instant)
          Returns the value to which this map maps the specified Instant.
abstract  Period getPeriod(Instant instant)
           
abstract  boolean isEmpty()
          Returns true if this map contains no Period-value mappings.
abstract  Instant lastInstant()
          Returns the last (highest) instant currently in this temporal map.
abstract  Period lastPeriod()
          Returns the last (highest) period currently in this temporal map.
abstract  java.util.Set periodSet()
          Returns a set view of the periods contained in this map.
abstract  boolean put(Period p, java.lang.Object value)
          Associates the specified value with the specified Period in this map (optional operation).
 boolean putAll(TemporalUnaryMap tm)
          Copies all of the mappings from the specified map to this map (optional operation).
abstract  boolean remove(Period p)
          Removes the mapping(s) for this period from this map if present (optional operation).
abstract  int size()
          Returns the number of Period-value mappings in this map.
abstract  TemporalUnaryMap subMap(Period p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTemporalUnaryMap

public AbstractTemporalUnaryMap()
Method Detail

clear

public abstract void clear()
Description copied from interface: TemporalUnaryMap
Removes all mappings from this map (optional operation).

Specified by:
clear in interface TemporalUnaryMap

size

public abstract int size()
Description copied from interface: TemporalUnaryMap
Returns the number of Period-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Specified by:
size in interface TemporalUnaryMap

isEmpty

public abstract boolean isEmpty()
Description copied from interface: TemporalUnaryMap
Returns true if this map contains no Period-value mappings.

Specified by:
isEmpty in interface TemporalUnaryMap

get

public abstract java.lang.Object get(Instant instant)
Description copied from interface: TemporalUnaryMap
Returns the value to which this map maps the specified Instant. Returns null if the map contains no mapping at this Instant. It is not possible to map to a null Instant.

Specified by:
get in interface TemporalUnaryMap

getPeriod

public abstract Period getPeriod(Instant instant)
Specified by:
getPeriod in interface TemporalUnaryMap

containsInstant

public abstract boolean containsInstant(Instant instant)
Description copied from interface: TemporalUnaryMap
Returns true if this map contains a mapping for the specified Instant.

Specified by:
containsInstant in interface TemporalUnaryMap

containsValue

public abstract boolean containsValue(java.lang.Object value)
Description copied from interface: TemporalUnaryMap
Returns true if this map maps one or more Periods to the specified value.

Specified by:
containsValue in interface TemporalUnaryMap

put

public abstract boolean put(Period p,
                            java.lang.Object value)
Description copied from interface: TemporalUnaryMap
Associates the specified value with the specified Period in this map (optional operation). If the map previously contained a mapping to a period overlapping this period, the old value is replaced for the current period.

Specified by:
put in interface TemporalUnaryMap

remove

public abstract boolean remove(Period p)
Description copied from interface: TemporalUnaryMap
Removes the mapping(s) for this period from this map if present (optional operation).

Specified by:
remove in interface TemporalUnaryMap

periodSet

public abstract java.util.Set periodSet()
Description copied from interface: TemporalUnaryMap
Returns a set view of the periods contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll retainAll, and clear operations. It does not support the add or addAll operations.

Specified by:
periodSet in interface TemporalUnaryMap

firstInstant

public abstract Instant firstInstant()
Description copied from interface: TemporalUnaryMap
Returns the first (lowest) instant currently in this temporal map.

Specified by:
firstInstant in interface TemporalUnaryMap

lastInstant

public abstract Instant lastInstant()
Description copied from interface: TemporalUnaryMap
Returns the last (highest) instant currently in this temporal map.

Specified by:
lastInstant in interface TemporalUnaryMap

firstPeriod

public abstract Period firstPeriod()
Description copied from interface: TemporalUnaryMap
Returns the first (lowest) period currently in this temporal map.

Specified by:
firstPeriod in interface TemporalUnaryMap

lastPeriod

public abstract Period lastPeriod()
Description copied from interface: TemporalUnaryMap
Returns the last (highest) period currently in this temporal map.

Specified by:
lastPeriod in interface TemporalUnaryMap

subMap

public abstract TemporalUnaryMap subMap(Period p)
Specified by:
subMap in interface TemporalUnaryMap

putAll

public boolean putAll(TemporalUnaryMap tm)
Description copied from interface: TemporalUnaryMap
Copies all of the mappings from the specified map to this map (optional operation). These mappings will replace any mappings that this map had for any of the periods currently in the specified map.

Specified by:
putAll in interface TemporalUnaryMap

extent

public Period extent()
Description copied from interface: TemporalUnaryMap
Returns a period enclosing firstInstant() and lastInstant()

Specified by:
extent in interface TemporalUnaryMap

equalContent

public boolean equalContent(java.lang.Object o)
Compares the specified object with this map for content equality. Returns true if the given object contains the same mappings.
This implementation first checks if the specified object is this map; if so it returns true. Then, it checks if the specified object is a map whose size is identical to the size of this set; if not, it it returns false. If so, it iterates over this map's Periods and Values, and checks them for equality.
The method equals is not overridden in order to keep the default hashcode() method. Overriding hashcode() would lead to poor performances when adding this map to a hashmap (which is done by the TemporalMultiMap).