public class ComparableArray extends Object implements Comparable<Object>, Serializable
It supports hashCode(), toString(), equals(), compareTo() methods.
它支持hashCode(), toString(), equals(), compareTo()方法。
Classes that are Comparable include:
可比较(实现了Comparable)的类包括:
Authenticator.RequestorType, BigDecimal, BigInteger, Boolean, Byte, ByteBuffer, Calendar, Character, CharBuffer, Charset, ClientInfoStatus, CollationKey, Component.BaselineResizeBehavior, CompositeName, CompoundName, Date, Date, Desktop.Action, Diagnostic.Kind, Dialog.ModalExclusionType, Dialog.ModalityType, Double, DoubleBuffer, DropMode, ElementKind, ElementType, Enum, File, Float, FloatBuffer, Formatter.BigDecimalLayoutForm, FormSubmitEvent.MethodType, GregorianCalendar, GroupLayout.Alignment, IntBuffer, Integer, JavaFileObject.Kind, JTable.PrintMode, KeyRep.Type, LayoutStyle.ComponentPlacement, LdapName, Long, LongBuffer, MappedByteBuffer, MemoryType, MessageContext.Scope, Modifier, MultipleGradientPaint.ColorSpaceType, MultipleGradientPaint.CycleMethod, NestingKind, Normalizer.Form, ObjectName, ObjectStreamField, Proxy.Type, Rdn, Resource.AuthenticationType, RetentionPolicy, RoundingMode, RowFilter.ComparisonType, RowIdLifetime, RowSorterEvent.Type, Service.Mode, Short, ShortBuffer, SOAPBinding.ParameterStyle, SOAPBinding.Style, SOAPBinding.Use, SortOrder, SourceVersion, SSLEngineResult.HandshakeStatus, SSLEngineResult.Status, StandardLocation, String, SwingWorker.StateValue, Thread.State, Time, Timestamp, TimeUnit, TrayIcon.MessageType, TypeKind, URI, UUID, WebParam.Mode, XmlAccessOrder, XmlAccessType, XmlNsForm
and IntegerArray
, LongArray
, NumberArray
.
Modifier and Type | Field and Description |
---|---|
protected Comparable[] |
values |
Constructor and Description |
---|
ComparableArray(Comparable... values)
Constructs an instance that encapsulates specified Comparable values.
创建一个包含这些可比较值的实例。 |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object obj) |
boolean |
equals(Object obj) |
Object |
getValue(int index)
Gets the value in specified position.
获得指定位置的值。 |
Object[] |
getValues()
Gets all the values encapsulated in this object.
获得所有值。 |
int |
hashCode()
Gets the calculated hash code.
获得计算得到的hash值。 |
String |
toString() |
protected Comparable[] values
public ComparableArray(Comparable... values)
values
- Comparable values that will be encapsulated.public Object[] getValues()
public Object getValue(int index)
index
- position (position of the first one is 0)public int hashCode()
public int compareTo(Object obj)
compareTo
in interface Comparable<Object>
Copyright © 2014. All Rights Reserved.