Example #1
0
 @Override
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof VirtualDisk)) {
     return false;
   }
   VirtualDisk other = (VirtualDisk) obj;
   if (obj == null) {
     return false;
   }
   if (this == obj) {
     return true;
   }
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       super.equals(obj)
           && this.capacityInKB == other.getCapacityInKB()
           && ((this.shares == null && other.getShares() == null)
               || (this.shares != null && this.shares.equals(other.getShares())));
   __equalsCalc = null;
   return _equals;
 }
Example #2
0
 public int getReserved() {
   if (containsReservedZone()) {
     int reservedSize =
         (int)
             (((4.0
                     * (double) precedingDataSegment.parent.getAllocatedSize()
                     * (double) containingDisk.getFreeSpace()))
                 / ((double) containingDisk.getSize()));
     int zoneSize = getSize();
     return ((float) reservedSize / (float) zoneSize < .5) ? reservedSize : zoneSize;
   } else {
     return 0;
   }
 }
Example #3
0
 protected static FreeSpaceMarker generateRoot(VirtualDisk containingDisk) {
   return new FreeSpaceMarker(1024, containingDisk.getSize() - 1, containingDisk);
 }