Class HWDiskStore
- All Implemented Interfaces:
java.lang.Comparable<HWDiskStore>
public class HWDiskStore extends java.lang.Object implements java.lang.Comparable<HWDiskStore>
-
Constructor Summary
Constructors Constructor Description HWDiskStore()Create an object with empty/default valuesHWDiskStore(HWDiskStore diskStore)Copy constructor -
Method Summary
Modifier and Type Method Description intcompareTo(HWDiskStore store)booleanequals(java.lang.Object obj)longgetCurrentQueueLength()Getter for the fieldcurrentQueueLength.java.lang.StringgetModel()Getter for the fieldmodel.java.lang.StringgetName()Getter for the fieldname.HWPartition[]getPartitions()Getter for the fieldpartitions.longgetReadBytes()Getter for the fieldreadBytes.longgetReads()Getter for the fieldreads.java.lang.StringgetSerial()Getter for the fieldserial.longgetSize()Getter for the fieldsize.longgetTimeStamp()Getter for the fieldtimeStamp.longgetTransferTime()Getter for the fieldtransferTime.longgetWriteBytes()Getter for the fieldwriteBytes.longgetWrites()Getter for the fieldwrites.inthashCode()voidsetCurrentQueueLength(long currentQueueLength)Setter for the fieldcurrentQueueLength.voidsetModel(java.lang.String model)Setter for the fieldmodel.voidsetName(java.lang.String name)Setter for the fieldname.voidsetPartitions(HWPartition[] partitions)Setter for the fieldpartitions.voidsetReadBytes(long readBytes)Setter for the fieldreadBytes.voidsetReads(long reads)Setter for the fieldreads.voidsetSerial(java.lang.String serial)Setter for the fieldserial.voidsetSize(long size)Setter for the fieldsize.voidsetTimeStamp(long timeStamp)Setter for the fieldtimeStamp.voidsetTransferTime(long transferTime)Setter for the fieldtransferTime.voidsetWriteBytes(long writeBytes)Setter for the fieldwriteBytes.voidsetWrites(long writes)Setter for the fieldwrites.java.lang.StringtoString()booleanupdateAtrributes()Make a best effort to update all the statistics about the drive without needing to recreate the drive list.
-
Constructor Details
-
HWDiskStore
public HWDiskStore()Create an object with empty/default values -
HWDiskStore
Copy constructor- Parameters:
diskStore- The object to copy
-
-
Method Details
-
updateAtrributes
public boolean updateAtrributes()Make a best effort to update all the statistics about the drive without needing to recreate the drive list. This method provides for more frequent periodic updates of drive statistics. It will not detect if a removable drive has been removed and replaced by a different drive in between method calls.- Returns:
- True if the update was (probably) successful, false if the disk was not found
-
getName
public java.lang.String getName()Getter for the field
name.- Returns:
- the name
-
getModel
public java.lang.String getModel()Getter for the field
model.- Returns:
- the model
-
getSerial
public java.lang.String getSerial()Getter for the field
serial.- Returns:
- the serial
-
getSize
public long getSize()Getter for the field
size.- Returns:
- Get size of disk (in bytes)
-
getReads
public long getReads()Getter for the field
reads.- Returns:
- the reads
-
getReadBytes
public long getReadBytes()Getter for the field
readBytes.- Returns:
- the bytes read
-
getWrites
public long getWrites()Getter for the field
writes.- Returns:
- the writes
-
getWriteBytes
public long getWriteBytes()Getter for the field
writeBytes.- Returns:
- the bytes written
-
getCurrentQueueLength
public long getCurrentQueueLength()Getter for the field
currentQueueLength.- Returns:
- the length of the disk queue (#I/O's in progress). Includes I/O requests that have been issued to the device driver but have not yet completed. Not supported on macOS.
-
getTransferTime
public long getTransferTime()Getter for the field
transferTime.- Returns:
- the milliseconds spent reading or writing
-
getPartitions
Getter for the field
partitions.- Returns:
- Returns the partitions on this drive.
-
getTimeStamp
public long getTimeStamp()Getter for the field
timeStamp.- Returns:
- Returns the timeStamp.
-
setName
public void setName(java.lang.String name)Setter for the field
name.- Parameters:
name- the name to set
-
setModel
public void setModel(java.lang.String model)Setter for the field
model.- Parameters:
model- the model to set
-
setSerial
public void setSerial(java.lang.String serial)Setter for the field
serial.- Parameters:
serial- the serial to set
-
setSize
public void setSize(long size)Setter for the field
size.- Parameters:
size- Set size of disk (in bytes)
-
setReads
public void setReads(long reads)Setter for the field
reads.- Parameters:
reads- the reads to set
-
setReadBytes
public void setReadBytes(long readBytes)Setter for the field
readBytes.- Parameters:
readBytes- the bytes read to set
-
setWrites
public void setWrites(long writes)Setter for the field
writes.- Parameters:
writes- the writes to set
-
setWriteBytes
public void setWriteBytes(long writeBytes)Setter for the field
writeBytes.- Parameters:
writeBytes- the bytes written to set
-
setCurrentQueueLength
public void setCurrentQueueLength(long currentQueueLength)Setter for the field
currentQueueLength.- Parameters:
currentQueueLength- the length of the disk queue (#I/O's in progress) to set
-
setTransferTime
public void setTransferTime(long transferTime)Setter for the field
transferTime.- Parameters:
transferTime- milliseconds spent reading or writing to set
-
setPartitions
Setter for the field
partitions.- Parameters:
partitions- The partitions to set.
-
setTimeStamp
public void setTimeStamp(long timeStamp)Setter for the field
timeStamp.- Parameters:
timeStamp- The timeStamp to set.
-
compareTo
- Specified by:
compareToin interfacejava.lang.Comparable<HWDiskStore>
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-