Example usage for org.joda.time LocalDate getValues

List of usage examples for org.joda.time LocalDate getValues

Introduction

In this page you can find the example usage for org.joda.time LocalDate getValues.

Prototype

public int[] getValues() 

Source Link

Document

Gets an array of the value of each of the fields that this partial supports.

Usage

From source file:de.jpaw.bonaparte.core.AppendableComposer.java

License:Apache License

@Override
public void addField(TemporalElementaryDataItem di, LocalDate t) throws IOException {
    if (t != null) {
        int[] values = t.getValues(); // 3 values: year, month, day
        int tmpValue = (10000 * values[0]) + (100 * values[1]) + values[2];
        // int tmpValue = 10000 * t.getYear() + 100 * t.getMonthOfYear() + t.getDayOfMonth();
        work.append(Integer.toString(tmpValue));
        terminateField();/*  ww  w .j  ava  2  s  . com*/
    } else {
        writeNull();
    }
}

From source file:de.jpaw.bonaparte.core.ByteArrayComposer.java

License:Apache License

@Override
public void addField(TemporalElementaryDataItem di, LocalDate t) {
    if (t != null) {
        int[] values = t.getValues(); // 3 values: year, month, day
        int tmpValue = (10000 * values[0]) + (100 * values[1]) + values[2];
        // int tmpValue = 10000 * t.getYear() + 100 * t.getMonthOfYear() + t.getDayOfMonth();
        work.appendAscii(Integer.toString(tmpValue));
        terminateField();/*ww  w. j  a va  2  s . c o m*/
    } else {
        writeNull();
    }
}

From source file:de.jpaw.bonaparte.core.ExternalizableComposer.java

License:Apache License

@Override
public void addField(TemporalElementaryDataItem di, LocalDate t) throws IOException {
    if (t == null) {
        out.writeByte(NULL_FIELD);// w ww  .  j  ava2  s .co m
    } else {
        int[] values = t.getValues(); // 3 values: year, month, day
        writeVarInt((10000 * values[0]) + (100 * values[1]) + values[2]);
    }
}