Пример #1
0
 @Override
 public boolean equals(Object obj) {
   if (obj instanceof AudioFormat) {
     AudioFormat format = (AudioFormat) obj;
     if (format.getCodec() != getCodec()) {
       return false;
     }
     if (format.getContainer() != getContainer()) {
       return false;
     }
     if (format.isBigEndian() != isBigEndian()) {
       return false;
     }
     if (format.getBitDepth() != getBitDepth()) {
       return false;
     }
     if (format.getBitRate() != getBitRate()) {
       return false;
     }
     if (format.getFrequency() != getFrequency()) {
       return false;
     }
     return true;
   }
   return super.equals(obj);
 }
Пример #2
0
 /**
  * Determines if the passed AudioFormat is compatable with this AudioFormat.
  *
  * <p>This AudioFormat is compatible with the passed AudioFormat if both have the same value for
  * all non-null members of this instance.
  */
 boolean isCompatible(AudioFormat audioFormat) {
   if (audioFormat == null) {
     return false;
   }
   if ((null != getContainer()) && (getContainer() != audioFormat.getContainer())) {
     return false;
   }
   if ((null != getCodec()) && (getCodec() != audioFormat.getCodec())) {
     return false;
   }
   if ((null != isBigEndian()) && (isBigEndian() != audioFormat.isBigEndian())) {
     return false;
   }
   if ((null != getBitDepth()) && (getBitDepth() != audioFormat.getBitDepth())) {
     return false;
   }
   if ((null != getBitRate()) && (getBitRate() != audioFormat.getBitRate())) {
     return false;
   }
   if ((null != getFrequency()) && (getFrequency() != audioFormat.getFrequency())) {
     return false;
   }
   return true;
 }