org.elasticsearch.common.unit
Class ByteSizeValue

java.lang.Object
  extended by org.elasticsearch.common.unit.ByteSizeValue
All Implemented Interfaces:
Serializable, Streamable

public class ByteSizeValue
extends Object
implements Serializable, Streamable

See Also:
Serialized Form

Constructor Summary
ByteSizeValue(long bytes)
           
ByteSizeValue(long size, ByteSizeUnit sizeUnit)
           
 
Method Summary
 long bytes()
           
 int bytesAsInt()
           
 boolean equals(Object o)
           
 long gb()
           
 double gbFrac()
           
 long getBytes()
           
 long getGb()
           
 double getGbFrac()
           
 long getKb()
           
 double getKbFrac()
           
 long getMb()
           
 double getMbFrac()
           
 int hashCode()
           
 long kb()
           
 double kbFrac()
           
 long mb()
           
 double mbFrac()
           
static ByteSizeValue parseBytesSizeValue(String sValue)
           
static ByteSizeValue parseBytesSizeValue(String sValue, ByteSizeValue defaultValue)
           
static ByteSizeValue readBytesSizeValue(StreamInput in)
           
 void readFrom(StreamInput in)
           
 String toString()
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteSizeValue

public ByteSizeValue(long bytes)

ByteSizeValue

public ByteSizeValue(long size,
                     ByteSizeUnit sizeUnit)
Method Detail

bytesAsInt

public int bytesAsInt()
               throws ElasticSearchIllegalArgumentException
Throws:
ElasticSearchIllegalArgumentException

bytes

public long bytes()

getBytes

public long getBytes()

kb

public long kb()

getKb

public long getKb()

mb

public long mb()

getMb

public long getMb()

gb

public long gb()

getGb

public long getGb()

kbFrac

public double kbFrac()

getKbFrac

public double getKbFrac()

mbFrac

public double mbFrac()

getMbFrac

public double getMbFrac()

gbFrac

public double gbFrac()

getGbFrac

public double getGbFrac()

toString

public String toString()
Overrides:
toString in class Object

parseBytesSizeValue

public static ByteSizeValue parseBytesSizeValue(String sValue)
                                         throws ElasticSearchParseException
Throws:
ElasticSearchParseException

parseBytesSizeValue

public static ByteSizeValue parseBytesSizeValue(String sValue,
                                                ByteSizeValue defaultValue)
                                         throws ElasticSearchParseException
Throws:
ElasticSearchParseException

readBytesSizeValue

public static ByteSizeValue readBytesSizeValue(StreamInput in)
                                        throws IOException
Throws:
IOException

readFrom

public void readFrom(StreamInput in)
              throws IOException
Specified by:
readFrom in interface Streamable
Throws:
IOException

writeTo

public void writeTo(StreamOutput out)
             throws IOException
Specified by:
writeTo in interface Streamable
Throws:
IOException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009-2012. All Rights Reserved.