コード例 #1
0
 /**
  * Two ResourcePath objects are considered to be equal if they represent the same leaf path and if
  * their parents are equal. Note that currently the name matching is case-sensitive, even when
  * this is being called on a case-insensitive file system.
  *
  * @param obj the other object
  * @return true if the objects are equal, false otherwise
  */
 @Override
 public boolean equals(Object obj) {
   if (obj instanceof ResourcePath) {
     ResourcePath otherPath = (ResourcePath) obj;
     return otherPath.getName().equals(getName())
         && GosuObjectUtil.equals(getParent(), otherPath.getParent());
   } else {
     return false;
   }
 }
コード例 #2
0
 public boolean isChild(ResourcePath path) {
   return GosuObjectUtil.equals(this, path.getParent());
 }