Java Code Examples for org.joda.time.DurationFieldType#minutes()
The following examples show how to use
org.joda.time.DurationFieldType#minutes() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestScaledDurationField.java From astor with GNU General Public License v2.0 | 5 votes |
public void test_compareTo() { assertEquals(0, iField.compareTo(iField)); assertEquals(-1, iField.compareTo(ISOChronology.getInstance().minutes())); DurationField dummy = new PreciseDurationField(DurationFieldType.minutes(), 0); assertEquals(1, iField.compareTo(dummy)); // try { // iField.compareTo(""); // fail(); // } catch (ClassCastException ex) {} try { iField.compareTo(null); fail(); } catch (NullPointerException ex) {} }
Example 2
Source File: TestScaledDurationField.java From astor with GNU General Public License v2.0 | 5 votes |
public void test_hashCode() { assertEquals(iField.hashCode(), iField.hashCode()); assertEquals(false, iField.hashCode() == ISOChronology.getInstance().minutes().hashCode()); DurationField dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.minutes(), 2); assertEquals(false, iField.hashCode() == dummy.hashCode()); dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.minutes(), 90); assertEquals(true, iField.hashCode() == dummy.hashCode()); dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.millis(), 90); assertEquals(false, iField.hashCode() == dummy.hashCode()); }
Example 3
Source File: TestScaledDurationField.java From astor with GNU General Public License v2.0 | 5 votes |
public void test_equals() { assertEquals(true, iField.equals(iField)); assertEquals(false, iField.equals(ISOChronology.getInstance().minutes())); DurationField dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.minutes(), 2); assertEquals(false, iField.equals(dummy)); dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.minutes(), 90); assertEquals(true, iField.equals(dummy)); dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.millis(), 90); assertEquals(false, iField.equals(dummy)); assertEquals(false, iField.equals("")); assertEquals(false, iField.equals(null)); }
Example 4
Source File: TestScaledDurationField.java From astor with GNU General Public License v2.0 | 5 votes |
public void test_equals() { assertEquals(true, iField.equals(iField)); assertEquals(false, iField.equals(ISOChronology.getInstance().minutes())); DurationField dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.minutes(), 2); assertEquals(false, iField.equals(dummy)); dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.minutes(), 90); assertEquals(true, iField.equals(dummy)); dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.millis(), 90); assertEquals(false, iField.equals(dummy)); assertEquals(false, iField.equals("")); assertEquals(false, iField.equals(null)); }
Example 5
Source File: TestScaledDurationField.java From astor with GNU General Public License v2.0 | 5 votes |
public void test_hashCode() { assertEquals(iField.hashCode(), iField.hashCode()); assertEquals(false, iField.hashCode() == ISOChronology.getInstance().minutes().hashCode()); DurationField dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.minutes(), 2); assertEquals(false, iField.hashCode() == dummy.hashCode()); dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.minutes(), 90); assertEquals(true, iField.hashCode() == dummy.hashCode()); dummy = new ScaledDurationField(MillisDurationField.INSTANCE, DurationFieldType.millis(), 90); assertEquals(false, iField.hashCode() == dummy.hashCode()); }
Example 6
Source File: TestScaledDurationField.java From astor with GNU General Public License v2.0 | 5 votes |
public void test_compareTo() { assertEquals(0, iField.compareTo(iField)); assertEquals(-1, iField.compareTo(ISOChronology.getInstance().minutes())); DurationField dummy = new PreciseDurationField(DurationFieldType.minutes(), 0); assertEquals(1, iField.compareTo(dummy)); // try { // iField.compareTo(""); // fail(); // } catch (ClassCastException ex) {} try { iField.compareTo(null); fail(); } catch (NullPointerException ex) {} }
Example 7
Source File: SettingsViewHolder.java From BrainPhaser with GNU General Public License v3.0 | 5 votes |
/** * Creates a Joda duration/period object * * @param date object that represents the duration of the period through milisseconds */ private void initializeDuration(Date date) { // Get duration from Date mDuration = new Duration(date.getTime()); // Get period final DurationFieldType[] durationFields = new DurationFieldType[]{DurationFieldType.weeks(), DurationFieldType.days(), DurationFieldType.hours(), DurationFieldType.minutes()}; mPeriod = mDuration.toPeriod(PeriodType.forFields(durationFields)).normalizedStandard(); updatePeriod(); }
Example 8
Source File: TestBaseDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
public DurationField getRangeDurationField() { return new MockCountingDurationField(DurationFieldType.minutes()); }
Example 9
Source File: TestPreciseDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
protected MockPreciseDateTimeField() { super(DateTimeFieldType.secondOfMinute(), new MockCountingDurationField(DurationFieldType.seconds(), 60), new MockCountingDurationField(DurationFieldType.minutes(), 60 * 60)); }
Example 10
Source File: TestScaledDurationField.java From astor with GNU General Public License v2.0 | 4 votes |
protected void setUp() throws Exception { DurationField base = MillisDurationField.INSTANCE; iField = new ScaledDurationField(base, DurationFieldType.minutes(), 90); }
Example 11
Source File: TestPreciseDurationDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
public DurationField getRangeDurationField() { return new MockCountingDurationField(DurationFieldType.minutes()); }
Example 12
Source File: TestPreciseDurationDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
public void test_toString() { BaseDateTimeField field = new MockPreciseDurationDateTimeField( DateTimeFieldType.secondOfDay(), new MockCountingDurationField(DurationFieldType.minutes())); assertEquals("DateTimeField[secondOfDay]", field.toString()); }
Example 13
Source File: TestPreciseDurationDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
public void test_getName() { BaseDateTimeField field = new MockPreciseDurationDateTimeField( DateTimeFieldType.secondOfDay(), new MockCountingDurationField(DurationFieldType.minutes())); assertEquals("secondOfDay", field.getName()); }
Example 14
Source File: TestPreciseDurationDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
public void test_getType() { BaseDateTimeField field = new MockPreciseDurationDateTimeField( DateTimeFieldType.secondOfDay(), new MockCountingDurationField(DurationFieldType.minutes())); assertEquals(DateTimeFieldType.secondOfDay(), field.getType()); }
Example 15
Source File: TestPreciseDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
protected MockPreciseDateTimeField() { super(DateTimeFieldType.secondOfMinute(), new MockCountingDurationField(DurationFieldType.seconds(), 60), new MockCountingDurationField(DurationFieldType.minutes(), 60 * 60)); }
Example 16
Source File: TestScaledDurationField.java From astor with GNU General Public License v2.0 | 4 votes |
protected void setUp() throws Exception { DurationField base = MillisDurationField.INSTANCE; iField = new ScaledDurationField(base, DurationFieldType.minutes(), 90); }
Example 17
Source File: TestPreciseDurationDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
public DurationField getRangeDurationField() { return new MockCountingDurationField(DurationFieldType.minutes()); }
Example 18
Source File: TestPreciseDurationDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
public void test_toString() { BaseDateTimeField field = new MockPreciseDurationDateTimeField( DateTimeFieldType.secondOfDay(), new MockCountingDurationField(DurationFieldType.minutes())); assertEquals("DateTimeField[secondOfDay]", field.toString()); }
Example 19
Source File: TestPreciseDurationDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
public void test_getName() { BaseDateTimeField field = new MockPreciseDurationDateTimeField( DateTimeFieldType.secondOfDay(), new MockCountingDurationField(DurationFieldType.minutes())); assertEquals("secondOfDay", field.getName()); }
Example 20
Source File: TestBaseDateTimeField.java From astor with GNU General Public License v2.0 | 4 votes |
public DurationField getRangeDurationField() { return new MockCountingDurationField(DurationFieldType.minutes()); }