Made ClassRecord and ColorRecord comparable on name.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@1064 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -58,7 +58,7 @@ public class ColorPository implements Serializable
|
|||||||
* Used to store information on a class of colors. These are public to simplify the XML
|
* Used to store information on a class of colors. These are public to simplify the XML
|
||||||
* parsing process, so pay them no mind.
|
* parsing process, so pay them no mind.
|
||||||
*/
|
*/
|
||||||
public static class ClassRecord implements Serializable
|
public static class ClassRecord implements Serializable, Comparable<ClassRecord>
|
||||||
{
|
{
|
||||||
/** An integer identifier for this class. */
|
/** An integer identifier for this class. */
|
||||||
public int classId;
|
public int classId;
|
||||||
@@ -172,6 +172,12 @@ public class ColorPository implements Serializable
|
|||||||
return colors.get(defaultId);
|
return colors.get(defaultId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// from interface Comparable<ClassRecord>
|
||||||
|
public int compareTo (ClassRecord other)
|
||||||
|
{
|
||||||
|
return name.compareTo(other.name);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
@@ -193,7 +199,7 @@ public class ColorPository implements Serializable
|
|||||||
* Used to store information on a particular color. These are public to simplify the XML
|
* Used to store information on a particular color. These are public to simplify the XML
|
||||||
* parsing process, so pay them no mind.
|
* parsing process, so pay them no mind.
|
||||||
*/
|
*/
|
||||||
public static class ColorRecord implements Serializable
|
public static class ColorRecord implements Serializable, Comparable<ColorRecord>
|
||||||
{
|
{
|
||||||
/** The colorization class to which we belong. */
|
/** The colorization class to which we belong. */
|
||||||
public ClassRecord cclass;
|
public ClassRecord cclass;
|
||||||
@@ -235,6 +241,12 @@ public class ColorPository implements Serializable
|
|||||||
return new Colorization(getColorPrint(), cclass.source, cclass.range, offsets);
|
return new Colorization(getColorPrint(), cclass.source, cclass.range, offsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// from interface Comparable<ColorRecord>
|
||||||
|
public int compareTo (ColorRecord other)
|
||||||
|
{
|
||||||
|
return name.compareTo(other.name);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user