示例#1
0
 /**
  * Tests whether two <code>Partition</code> objects are equal, based on their names and hosting
  * server.
  *
  * @param otherPartition the Partition to test
  * @return whether the specifed Partition is the same as this Partition
  */
 public boolean equals(Partition otherPartition) {
   return (name.equals(otherPartition.getName()))
       && (getServer().equals(otherPartition.getServer()));
 }
示例#2
0
 /**
  * Compares two Partition objects respective to their names and does not factor any other
  * attribute. Alphabetic case is significant in comparing names.
  *
  * @param partition The Partition object to be compared to this Partition instance
  * @return Zero if the argument is equal to this Partition's name, a value less than zero if this
  *     Partition's name is lexicographically less than the argument, or a value greater than zero
  *     if this Partition's name is lexicographically greater than the argument
  */
 public int compareTo(Partition partition) {
   return this.getName().compareTo(partition.getName());
 }