Code example for Vector

Methods: add, lastElement, size

0
					try { 
						locationSem.acquire();
						checkDeadlock1 = true;
					 
					// If minimum change frequency granularity has passed, continue 
					if (!(locationTimestamps.size() != 0 && (readTime - locationFrequency) < locationTimestamps.lastElement()))
					{ 
						// Make sure mutex problems caused by multiple location listeners is not a problem. Discard any late entries. 
						if (!(locationTimestamps.size() > 0 && readTime < locationTimestamps.lastElement()))
						{ 
							// Avoid similar entries with very slight time discrepancy 
							if (!(locationTimestamps.size() > 0 && latitudes.lastElement() == location.getLatitude()
									&& longitudes.lastElement() == location.getLongitude()))
							{ 
								// Store latest data 
								latitudes.add(location.getLatitude());
								longitudes.add(location.getLongitude());
								locationAccuracy.add((double) location.getAccuracy());
								locationTimestamps.add(readTime);
							} 
						} 
					} 
					 
					// Send location to MenuTabActivity