/** * Returns an instance representing the specified value in KHz. * * @param value frequency in KHz * @return instance representing the given frequency */ public static Frequency ofKHz(long value) { return new Frequency(value * KHZ); }
/** * Returns an instance representing the specified value in GHz. * * @param value frequency in GHz * @return instance representing the given frequency */ public static Frequency ofGHz(long value) { return new Frequency(value * GHZ); }
/** * Returns an instance representing the specified value in MHz. * * @param value frequency in MHz * @return instance representing the given frequency */ public static Frequency ofMHz(double value) { return new Frequency((long) (value * MHZ)); }
/** * Returns an instance representing the specified value in THz. * * @param value frequency in THz * @return instance representing the given frequency */ public static Frequency ofTHz(long value) { return new Frequency(value * THZ); }
/** * Returns a Frequency whose value is (this + value). * * @param value value to be added to this Frequency * @return this + value */ public Frequency add(Frequency value) { return new Frequency(this.frequency + value.frequency); }
/** * Returns an instance representing the specified value in Hz. * * @param value frequency in Hz * @return instance representing the given frequency */ public static Frequency ofHz(long value) { return new Frequency(value); }
/** * Returns an instance representing the specified value in KHz. * * @param value frequency in KHz * @return instance representing the given frequency */ public static Frequency ofKHz(double value) { return new Frequency((long) (value * KHZ)); }
/** * Returns an instance representing the specified value in GHz. * * @param value frequency in GHz * @return instance representing the given frequency */ public static Frequency ofGHz(double value) { return new Frequency((long) (value * GHZ)); }
/** * Returns a Frequency whose value is (this * value). * * @param value value to be multiplied by this Frequency * @return this * value */ public Frequency multiply(long value) { return new Frequency(this.frequency * value); }
/** * Returns an instance representing the specified value in MHz. * * @param value frequency in MHz * @return instance representing the given frequency */ public static Frequency ofMHz(long value) { return new Frequency(value * MHZ); }
/** * Returns an instance representing the specified value in THz. * * @param value frequency in THz * @return instance representing the given frequency */ public static Frequency ofTHz(double value) { return new Frequency((long) (value * THZ)); }
/** * Returns a Frequency whose value is (this - value). * * @param value value to be subtracted from this Frequency * @return this - value */ public Frequency subtract(Frequency value) { return new Frequency(this.frequency - value.frequency); }
/** * Returns a Frequency whose value is Math.floorDiv(this, value). * * @param value value to be divided by this Frequency * @return Math.floorDiv(this, value) */ public Frequency floorDivision(long value) { return new Frequency(Math.floorDiv(this.frequency, value)); }