Back to project page RUflow.
The source code is released under:
GNU General Public License
If you think the Android project RUflow listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package is.ru.app; /*w ww . java 2s. com*/ import android.util.Log; import java.util.ArrayList; import java.util.List; /** * Created by olafurn on 9.9.2014. */ public class Cellpath { private ArrayList<Coordinate> m_path = new ArrayList<Coordinate>(); private int color; public void append( Coordinate co ) { int idx = m_path.indexOf( co ); if ( idx >= 0 ) { for ( int i=m_path.size()-1; i > idx; --i ) { m_path.remove(i); } } else { m_path.add(co); } } public void trim(Coordinate co) { int idx = m_path.indexOf(co); if(idx >= 0) { for(int i = m_path.size()-1; i > idx; --i) { m_path.remove(i); } } } public void conflict(Coordinate co) { int idx = m_path.indexOf(co); if(idx >= 0) { for(int i = m_path.size()-1; i > idx; --i) { m_path.remove(i); } } if(m_path.size() > 1) { m_path.remove(m_path.size()-1); } else { reset(); } } public List<Coordinate> getCoordinates() { return m_path; } public void reset() { m_path.clear(); } public boolean isEmpty() { return m_path.isEmpty(); } //Btti essu vi hrna en g held a a urfi a tfra etta annarstaar. public void setColor(int color){this.color = color;} public int getColor(){ return color; } }