Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 package org.ros.rosjava_geometry;
00018
00019 import java.lang.String;
00020
00028 public class FrameName {
00029 private static final String LEGACY_SEPARATOR = "/";
00030 private String name;
00031
00032 public static FrameName of(String name) {
00033 return new FrameName(name);
00034 }
00035
00036 private FrameName(String name) {
00037 this.name = stripLeadingSlash(name);
00038 }
00039
00043 private static String stripLeadingSlash(String name) {
00044 return name.replaceFirst("^/", "");
00045 }
00046
00047 public String toString() {
00048 return name;
00049 }
00050
00051 public int hashCode() {
00052 return name.hashCode();
00053 }
00054
00055 public boolean equals(Object obj) {
00056 if (this == obj)
00057 return true;
00058 if (obj == null)
00059 return false;
00060 if (getClass() != obj.getClass())
00061 return false;
00062 FrameName other = (FrameName) obj;
00063 if (name == null) {
00064 if (other.name != null)
00065 return false;
00066 } else if (!name.equals(other.name)) {
00067 return false;
00068 }
00069 return true;
00070 }
00071
00072 }