app/src/main/java/com/pokevian/app/smartfleet/model/BlackboxMetadata.java
public void unflatten(String flattened) {
        String[] tokens = flattened.split(";");
        int index = 0;
        try {
            timestamp = Long.valueOf(tokens[index++]);
            drivingTime = Integer.valueOf(tokens[index++]);
            drivingDistance = Float.valueOf(tokens[index++]);
            index = locationData.unflatten(tokens, index);
            index = speedData.unflatten(tokens, index);
            index = engineData.unflatten(tokens, index);
            index = diagnosticData.unflatten(tokens, index);
            index = fuelData.unflatten(tokens, index);
        } catch (IndexOutOfBoundsException e) {
            Log.e("Metadata", "failed to unflatten", e);
        } catch (NumberFormatException e) {
            Log.e("Metadata", "failed to unflatten", e);
        }
    }
// NOTE: should be matched with flatten() method
should be matched with flatten() method
should be matched with flatten () method
public void unflatten(String flattened) {
        String[] tokens = flattened.split(";");
        int index = 0;
        try {
            timestamp = Long.valueOf(tokens[index++]);
            drivingTime = Integer.valueOf(tokens[index++]);
            drivingDistance = Float.valueOf(tokens[index++]);
            index = locationData.unflatten(tokens, index);
            index = speedData.unflatten(tokens, index);
            index = engineData.unflatten(tokens, index);
            index = diagnosticData.unflatten(tokens, index);
            index = fuelData.unflatten(tokens, index);
        } catch (IndexOutOfBoundsException e) {
            Log.e("Metadata", "failed to unflatten", e);
        } catch (NumberFormatException e) {
            Log.e("Metadata", "failed to unflatten", e);
        }
    }
public void unflatten ( String flattened ) { String [ ] tokens = flattened . split ( ";" ) ; int index = 0 ; try { timestamp = Long . valueOf ( tokens [ index ++ ] ) ; drivingTime = Integer . valueOf ( tokens [ index ++ ] ) ; drivingDistance = Float . valueOf ( tokens [ index ++ ] ) ; index = locationData . unflatten ( tokens , index ) ; index = speedData . unflatten ( tokens , index ) ; index = engineData . unflatten ( tokens , index ) ; index = diagnosticData . unflatten ( tokens , index ) ; index = fuelData . unflatten ( tokens , index ) ; } catch ( IndexOutOfBoundsException e ) { Log . e ( "Metadata" , "failed to unflatten" , e ) ; } catch ( NumberFormatException e ) { Log . e ( "Metadata" , "failed to unflatten" , e ) ; } }
NOTE: should be matched with flatten() method
NOTE : should be matched with flatten () method