tauZaman
v0.1

tauzaman.calendar
Class IrregularMapping

java.lang.Object
  |
  +--tauzaman.calendar.mapping.Mapping
        |
        +--tauzaman.calendar.IrregularMapping

public class IrregularMapping
extends Mapping

IrregularMapping class represents the irregular granularity mapping information of a Calendar. For example;

   < granularity name = "month" >
      < irregularMapping from = "day" url = ".../classname.class" >
         < method name = "gregCastMonthToDay" />
         < method name = "gregCastDayToMonth" />
         < method name = "gregScaleMonthToDay" />
      < /irregularmapping >
   < /granularity >
 

See Also:
Calendar, Mapping, Granularity
Status:
design complete, implementation complete

Field Summary
 
Fields inherited from class tauzaman.calendar.mapping.Mapping
COARSER_TO_FINER, CONGRUENT, FINER_TO_COARSER
 
Constructor Summary
IrregularMapping(Granularity to, Granularity from, int relationship, java.net.URL url, org.w3c.dom.Element root)
          Constructs an IrregularMapping object, which allocates memory for method names and urls.
 
Method Summary
 java.net.URL getUrl()
          Returns irregular mapping implementation url.
 long performAnchoredCast(long point)
          Casts a given anchored point.
 long[] performAnchoredScale(long point)
          Scales a given anchored point.
 long performUnanchoredCast(long point)
          Casts a given unanchored point.
 long[] performUnanchoredScale(long point)
          Scales a given unanchored point.
 java.lang.String toString()
          Returns a String representing this IrregularMapping object.
 
Methods inherited from class tauzaman.calendar.mapping.Mapping
equals, fetchRelationship, getFrom, getRelationship, getTo
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IrregularMapping

public IrregularMapping(Granularity to,
                        Granularity from,
                        int relationship,
                        java.net.URL url,
                        org.w3c.dom.Element root)
                 throws IrregularMappingFormationException
Constructs an IrregularMapping object, which allocates memory for method names and urls.

Parameters:
to - Granularity, which IrregularMapping is declared to
from - Granularity, which IrregularMapping is declared from
relationship - int between the Granularities of this IrregularMapping
url - URL of irregular method implementations
root - DOM Element, which points to IrregularMapping information of corresponding xml specification file.
Throws:
IrregularMappingFormationException - if any abnormal condition occurs when parsing a IrregularMapping
Method Detail

performAnchoredCast

public long performAnchoredCast(long point)
Casts a given anchored point.

Specified by:
performAnchoredCast in class Mapping
Parameters:
point - point in time to be casted
Returns:
long casted point

performAnchoredScale

public long[] performAnchoredScale(long point)
Scales a given anchored point.

Specified by:
performAnchoredScale in class Mapping
Parameters:
point - point in time to be scaled
Returns:
long value(s) of scaled point

performUnanchoredCast

public long performUnanchoredCast(long point)
Casts a given unanchored point.

Specified by:
performUnanchoredCast in class Mapping
Parameters:
point - point in time to be casted
Returns:
long casted point

performUnanchoredScale

public long[] performUnanchoredScale(long point)
Scales a given unanchored point.

Specified by:
performUnanchoredScale in class Mapping
Parameters:
point - point in time to be scaled
Returns:
long value(s) of scaled point

getUrl

public java.net.URL getUrl()
Returns irregular mapping implementation url.

Returns:
Url of this irregular mapping implementation

toString

public java.lang.String toString()
Returns a String representing this IrregularMapping object.

Overrides:
toString in class Mapping
Returns:
string URL of this IrregularMapping

tauZaman
v0.1

Submit a bug or feature

tauZaman is an open-source, publicly avaliable project