|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jabb.util.col.ComparableArray
public class ComparableArray
Encapsulates multiple Comparable (implements Comparable Interface) values into one object, which
is suitable to be used as key object of Map.
把多个可比较(实现了Comparable)值封装在这一个对象里,适合用来作为Map的key。
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.
| Field Summary | |
|---|---|
protected Comparable[] |
values
|
| Constructor Summary | |
|---|---|
ComparableArray(Comparable... values)
Constructs an instance that encapsulates specified Comparable values. 创建一个包含这些可比较值的实例。 |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Comparable[] values
| Constructor Detail |
|---|
public ComparableArray(Comparable... values)
values - Comparable values that will be encapsulated.| Method Detail |
|---|
public Object[] getValues()
public Object getValue(int index)
index - position (position of the first one is 0)
public int hashCode()
hashCode in class Objectpublic int compareTo(Object obj)
compareTo in interface Comparable<Object>public boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||