com.astroshare.astroonline.core
Class Lib

java.lang.Object
  extended by com.astroshare.astroonline.core.Lib

public class Lib
extends java.lang.Object

Class lib contains several static functions used throughout Astro-Online as library functions.

Library class which contains only static methods. The methods in this class implement commonly used functions throughout the project.


Constructor Summary
Lib()
           
 
Method Summary
static boolean aspectIsHarmonic(int a)
           Function checks if an aspect is harmonic.
static boolean checkDate(int year, int month, int day, int hour, int min, int sec)
           Check if a datetime is valid.
static boolean checkUScity(int pYear, int pMonth, int pDay, int pHour, int pMin)
           Check US city.
static java.lang.String EscapeURLParam(java.lang.String pText)
           Rewrite URL string.
static int findAspect(double p_grad1, double p_grad2)
           Check whether there is an aspect between two objects with default orb.
static int findAspect(double p_grad1, double p_grad2, int pOrb)
           Check whether there is an aspect between two objects.
static int firstSunday(int pYear, int pMonth)
           Calculates first Sunday of the month.
static boolean isSummer(int day, int month)
           Check if date is during the summer.
static java.lang.String toDir(java.lang.String location)
           Grab dir part from geographical position.
static int toGrad(java.lang.String location)
           Grab grad part from geographical position.
static int toMin(java.lang.String location)
           Grab min part from geographical position.
static int toSec(java.lang.String location)
           Grab sec part from geographical position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lib

public Lib()
Method Detail

findAspect

public static int findAspect(double p_grad1,
                             double p_grad2)

Check whether there is an aspect between two objects with default orb.

Parameters:
p_grad1 - Position of the first object
p_grad2 - Position of the second object
Returns:
Aspec or -1 if no aspect found
See Also:
findAspect(double, double, int)

findAspect

public static int findAspect(double p_grad1,
                             double p_grad2,
                             int pOrb)

Check whether there is an aspect between two objects.

Parameters:
p_grad1 - Position of the first object
p_grad2 - Position of the second object
pOrb - Orb used when searching for aspects, -1 = use default
Returns:
-1=no aspect found, (returnvalue>=0)=aspect found

toGrad

public static int toGrad(java.lang.String location)
                  throws java.lang.Exception

Grab grad part from geographical position.

Parameters:
location - Geographical position as a string
Returns:
Grad Location converted to grad
Throws:
java.lang.Exception - An Exception is thrown if the location specified is invalid

toMin

public static int toMin(java.lang.String location)
                 throws java.lang.Exception

Grab min part from geographical position.

Parameters:
location - Geographical position as a string
Returns:
Min Location converted to min
Throws:
java.lang.Exception - An Exception is thrown if the location specified is invalid

toSec

public static int toSec(java.lang.String location)
                 throws java.lang.Exception

Grab sec part from geographical position.

Parameters:
location - Geographical position as a string
Returns:
Sec Location converted to sec
Throws:
java.lang.Exception - An Exception is thrown if the location specified is invalid

toDir

public static java.lang.String toDir(java.lang.String location)
                              throws java.lang.Exception

Grab dir part from geographical position.

Parameters:
location - Geographical position as a string
Returns:
Dir Location converted to dir
Throws:
java.lang.Exception - An Exception is thrown if the location specified is invalid

checkDate

public static boolean checkDate(int year,
                                int month,
                                int day,
                                int hour,
                                int min,
                                int sec)

Check if a datetime is valid.

Parameters:
year - Year
month - Month of the year
day - Day of the month
hour - Hour of the day
min - Minute of the day
sec - Second of the day
Returns:
TRUE = datetime is valid, FALSE = datetime is invalid

EscapeURLParam

public static java.lang.String EscapeURLParam(java.lang.String pText)

Rewrite URL string.

Parameters:
pText - URL input
Returns:
URL output

checkUScity

public static boolean checkUScity(int pYear,
                                  int pMonth,
                                  int pDay,
                                  int pHour,
                                  int pMin)

Check US city.

Parameters:
pYear - Year
pMonth - Month
pDay - Day
pHour - Hour
pMin - Min
Returns:
TRUE = set type to 0; FALSE = set type to 1

firstSunday

public static int firstSunday(int pYear,
                              int pMonth)

Calculates first Sunday of the month.

Parameters:
pYear - Year
pMonth - Month
Returns:
First Sunday of the month

isSummer

public static boolean isSummer(int day,
                               int month)

Check if date is during the summer.

Parameters:
day - Day
month - Month
Returns:
IF Summer: true; ELSE false

aspectIsHarmonic

public static boolean aspectIsHarmonic(int a)

Function checks if an aspect is harmonic.

Parameters:
a - Aspect
Returns:
TRUE: Aspect is harmonic; FALSE: Aspect is disharmonic


Astro-Online © 2001 − 2008 Astro Share
Documentation generated on: Thursday August 12th 2008 (PS)