======================
LOOK! LICENSING TERMS
======================
look! is licensed under the BSD 3-Clause (also known as "BSD New" or
"BSD Simplified"), as follows:
Copyright (c) 2010-2012, Look...
If you think the Android project Look listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/**
*-----------------------------------------------------------------------------
* Copyright (c) 2012, Look! Development Team
* All rights reserved./*www.java2s.com*/
*
* Distributed under the terms of the BSD Simplified License.
*
* The full license is in the LICENSE file, distributed with this software.
*-----------------------------------------------------------------------------
*/package es.ucm.look.data.local;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import es.ucm.look.data.EntityData;
import es.ucm.look.data.LookData;
import es.ucm.look.data.interfaces.DataHandler;
/**
* A basic data getter
*
* @author ??ngel Serrano
*
*/publicclass BasicDataHandler implements DataHandler {
privatestaticint ID_GENERATOR = 1;
private List<EntityData> newDataList;
privateboolean clear = false;
public BasicDataHandler( ){
newDataList = new ArrayList<EntityData>();
}
@Override
public List<EntityData> getElementsUpdated(float x, float y, float z,
float radius, Date date) {
if ( clear ){
newDataList.clear();
}
clear = true;
return newDataList;
}
@Override
publicvoid addEntity(EntityData data) {
data.setId(ID_GENERATOR++);
if ( clear ){
newDataList.clear();
clear = false;
}
newDataList.add(data);
}
@Override
publicvoid updatePosition(EntityData data, float x, float y, float z) {
data.getLocation().set(x, y, z);
}
@Override
publicvoid updateProperty(EntityData data, String property, String newValue) {
data.setPropertyValue(property, newValue);
newDataList.add(data);
LookData.getInstance().updateData();
}
}