Beispiel #1
0
 public static void Format(JwDuration d, String f)
 {
     System.Console.WriteLine(
         JwUtility.RightPad(f+":", 25) +
         d.Format(f));
 }
Beispiel #2
0
 //# __________ PROTOCOL :: ADDING __________ #//
 public void Add(JwDuration d)
 {
     _ordinal += d._ordinal;
 }
Beispiel #3
0
 //# __________ PROTOCOL :: SUBTRACTING __________ #//
 public void Subtract(JwDuration d)
 {
     _ordinal -= d._ordinal;
 }
Beispiel #4
0
 //# __________ PROTOCOL :: INSTANCE CREATION __________ #//
 public static JwDuration CreateDuration(int hh, int mm, int ss, int ms)
 {
     JwDuration d = new JwDuration();
     d.Set(hh, mm, ss, ms);
     return d;
 }
Beispiel #5
0
        public JwDuration Difference(JwDate d)
        {
            int a = GetOrdinal();
            int b = d.GetOrdinal();
            int c = Math.Abs(a-b);

            JwDuration e = new JwDuration();
            e.AddDays(c);
            return e;
        }
Beispiel #6
0
 public bool IsLessThanOrEqualTo( JwDuration d)
 {
     return CompareTo(d) <= 0;
 }
Beispiel #7
0
 public bool IsGreaterThan( JwDuration d)
 {
     return CompareTo(d) > 0;
 }
Beispiel #8
0
 public int SubtractDuration(JwDuration e)
 {
     return SetOrdinal(_ordinal - e.GetTotalMilliseconds());
 }
Beispiel #9
0
 public void SubtractDuration(JwDuration d)
 {
     int i = _time.SubtractMilliseconds(d.GetTotalMilliseconds());
     _date.SubtractDays(i);
 }
Beispiel #10
0
 //# __________ PROTOCOL :: COPY __________ #//
 public JwDuration GetDurationCopy()
 {
     JwDuration e = new JwDuration();
     e.SetOrdinal(_ordinal);
     return e;
 }
Beispiel #11
0
 //# __________ PROTOCOL :: UTILITY __________ #//
 public JwDuration Difference(JwTimestamp ts)
 {
     JwDuration dateDifference = ts.GetDate().Difference(_date);
     JwDuration timeDifference = ts.GetTime().Difference(_time);
     JwDuration d = new JwDuration();
     d.Add(dateDifference);
     d.Add(timeDifference);
     return d;
 }
Beispiel #12
0
 public void AddDuration(JwDuration d)
 {
     _date.AddDays(_time.AddMilliseconds(d.GetTotalMilliseconds()));
 }
Beispiel #13
0
 public void SubtractDuration(JwDuration e)
 {
     SetOrdinal(_ordinal - e.GetTotalDays());
 }
        public void MonitorTransmitDuration( JwDuration duration)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("...");
            sb.Append(duration.ToStringLong());

            Monitor(sb.ToString());
        }
Beispiel #15
0
 public bool IsGreaterThanOrEqualTo( JwDuration d)
 {
     return CompareTo(d) >= 0;
 }
Beispiel #16
0
 public JwDuration Difference(JwTime t)
 {
     long a = GetOrdinal();
     long b = t.GetOrdinal();
     long c = Math.Abs(a-b);
     JwDuration e = new JwDuration();
     e.SetOrdinal(c);
     return e;
 }
Beispiel #17
0
 public bool IsLessThan( JwDuration d)
 {
     return CompareTo(d) < 0;
 }
Beispiel #18
0
 public int AddDuration(JwDuration e)
 {
     return SetOrdinal(_ordinal + e.GetTotalMilliseconds());
 }
Beispiel #19
0
 public void AddDuration(JwDuration e)
 {
     SetOrdinal(_ordinal + e.GetTotalDays());
 }