}
- public String toString(){
+ public String toString(boolean includeEmptySeconds){
String result;
result = String.valueOf(CdmUtils.Nz(degree)) + "°";
if (seconds != null || minutes != null){
result += String.valueOf(CdmUtils.Nz(minutes)) + "'";
}
- if (seconds != null){
- result += String.valueOf(CdmUtils.Nz(seconds)) + "\"";
+ if (seconds != null ){
+ if (seconds != 0 || includeEmptySeconds){
+ result += String.valueOf(CdmUtils.Nz(seconds)) + "\"";
+ }
}
result += direction;
return result;
@Transient
public Sexagesimal getLongitudeSexagesimal (){
boolean isLatitude = false;
- return Sexagesimal.valueOf(longitude, isLatitude);
+ return Sexagesimal.valueOf(latitude, isLatitude);
}
@Transient
this.errorRadius = errorRadius;
}
+// **************** toString *************************/
+
+
+ /**
+ * Returns a string representation in sexagesimal coordinates.
+ * @return
+ */
+ public String toSexagesimalString(boolean includeEmptySeconds, boolean includeReferenceSystem){
+ String result = "";
+ result += getLatitudeSexagesimal() == null ? "" : getLatitudeSexagesimal().toString(includeEmptySeconds);
+ result = CdmUtils.concat(", ", result, getLongitudeSexagesimal() == null ? "" : getLongitudeSexagesimal().toString(includeEmptySeconds));
+ if (includeReferenceSystem && getReferenceSystem() != null){
+ String refSys = CdmUtils.isEmpty(getReferenceSystem().getLabel()) ? "" : "(" + getReferenceSystem().getLabel() + ")";
+ result = CdmUtils.concat(" ", result, refSys);
+ }
+ return result;
+ }
+
+
//*********** CLONE **********************************/
/**
* @see #getDescriptions()
* @return
*/
+ @Transient
public Set<SpecimenDescription> getSpecimenDescriptions(boolean includeImageGallery) {
Set<SpecimenDescription> specimenDescriptions = new HashSet<SpecimenDescription>();
for (DescriptionBase descriptionBase : getDescriptions()){
}
return specimenDescriptions;
}
+ /**
+ * Returns the {@link SpecimenDescription specimen descriptions} this specimen is part of.
+ * @see #getDescriptions()
+ * @return
+ */
+ @Transient
+ public Set<SpecimenDescription> getSpecimenDescriptionImageGallery() {
+ Set<SpecimenDescription> specimenDescriptions = new HashSet<SpecimenDescription>();
+ for (DescriptionBase descriptionBase : getDescriptions()){
+ if (descriptionBase.isInstanceOf(SpecimenDescription.class)){
+ if (descriptionBase.isImageGallery() == true){
+ specimenDescriptions.add(descriptionBase.deproxy(descriptionBase, SpecimenDescription.class));
+ }
+ }
+ }
+ return specimenDescriptions;
+ }
/**
* Adds a new description to this specimen or observation