public int compareTo( Item item ) { if ( item == null ) { // 1-rc < 1, 1-ga > 1 return comparableQualifier( value ).compareTo( RELEASE_VERSION_INDEX ); } switch ( item.getType() ) { case INTEGER_ITEM: return -1; // 1.any < 1.1 ? case STRING_ITEM: return comparableQualifier( value ).compareTo( comparableQualifier( ( (StringItem) item ).value ) ); case LIST_ITEM: return -1; // 1.any < 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
public int compareTo( Item item ) { if ( item == null ) { // 1-rc < 1, 1-ga > 1 return comparableQualifier( value ).compareTo( RELEASE_VERSION_INDEX ); } switch ( item.getType() ) { case INTEGER_ITEM: return -1; // 1.any < 1.1 ? case STRING_ITEM: return comparableQualifier( value ).compareTo( comparableQualifier( ( (StringItem) item ).value ) ); case LIST_ITEM: return -1; // 1.any < 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
public int compareTo( Item item ) { if ( item == null ) { // 1-rc < 1, 1-ga > 1 return comparableQualifier( value ).compareTo( RELEASE_VERSION_INDEX ); } switch ( item.getType() ) { case INTEGER_ITEM: return -1; // 1.any < 1.1 ? case STRING_ITEM: return comparableQualifier( value ).compareTo( comparableQualifier( ( (StringItem) item ).value ) ); case LIST_ITEM: return -1; // 1.any < 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
public int compareTo( Item item ) { if ( item == null ) { return value == 0 ? 0 : 1; // 1.0 == 1, 1.1 > 1 } switch ( item.getType() ) { case INTEGER_ITEM: return value.compareTo( ( (IntegerItem) item ).value ); case STRING_ITEM: return 1; // 1.1 > 1-sp case LIST_ITEM: return 1; // 1.1 > 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
public int compareTo( Item item ) { if ( item == null ) { return BIG_INTEGER_ZERO.equals( value ) ? 0 : 1; // 1.0 == 1, 1.1 > 1 } switch ( item.getType() ) { case INTEGER_ITEM: return value.compareTo( ( (IntegerItem) item ).value ); case STRING_ITEM: return 1; // 1.1 > 1-sp case LIST_ITEM: return 1; // 1.1 > 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
void normalize() { for( ListIterator iterator = listIterator( size() ); iterator.hasPrevious(); ) { Item item = (Item) iterator.previous(); if ( item.isNull() ) { iterator.remove(); // remove null trailing items: 0, "", empty list } else { break; } } }
void normalize() { for ( ListIterator<Item> iterator = listIterator( size() ); iterator.hasPrevious(); ) { Item item = iterator.previous(); if ( item.isNull() ) { iterator.remove(); // remove null trailing items: 0, "", empty list } else { break; } } }
public int compareTo( Item item ) { if ( item == null ) { return BIG_INTEGER_ZERO.equals( value ) ? 0 : 1; // 1.0 == 1, 1.1 > 1 } switch ( item.getType() ) { case INTEGER_ITEM: return value.compareTo( ( (IntegerItem) item ).value ); case STRING_ITEM: return 1; // 1.1 > 1-sp case LIST_ITEM: return 1; // 1.1 > 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
void normalize() { for ( int i = size() - 1; i >= 0; i-- ) { Item lastItem = get( i ); if ( lastItem.isNull() ) { // remove null trailing items: 0, "", empty list remove( i ); } else if ( !( lastItem instanceof ListItem ) ) { break; } } }
public int compareTo( Item item ) { if ( item == null ) { // 1-rc < 1, 1-ga > 1 return comparableQualifier( value ).compareTo( RELEASE_VERSION_INDEX ); } switch ( item.getType() ) { case INTEGER_ITEM: return -1; // 1.any < 1.1 ? case STRING_ITEM: return comparableQualifier( value ).compareTo( comparableQualifier( ( (StringItem) item ).value ) ); case LIST_ITEM: return -1; // 1.any < 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
public int compareTo( Item item ) { if ( item == null ) { // 1-rc < 1, 1-ga > 1 return comparableQualifier( value ).compareTo( RELEASE_VERSION_INDEX ); } switch ( item.getType() ) { case INTEGER_ITEM: return -1; // 1.any < 1.1 ? case STRING_ITEM: return comparableQualifier( value ).compareTo( comparableQualifier( ( (StringItem) item ).value ) ); case LIST_ITEM: return -1; // 1.any < 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
public int compareTo( Item item ) { if ( item == null ) { return BIG_INTEGER_ZERO.equals( value ) ? 0 : 1; // 1.0 == 1, 1.1 > 1 } switch ( item.getType() ) { case INTEGER_ITEM: return value.compareTo( ( (IntegerItem) item ).value ); case STRING_ITEM: return 1; // 1.1 > 1-sp case LIST_ITEM: return 1; // 1.1 > 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
void normalize() { for ( int i = size() - 1; i >= 0; i-- ) { Item lastItem = get( i ); if ( lastItem.isNull() ) { // remove null trailing items: 0, "", empty list remove( i ); } else if ( !( lastItem instanceof ListItem ) ) { break; } } }
public int compareTo( Item item ) { if ( item == null ) { return BIG_INTEGER_ZERO.equals( value ) ? 0 : 1; // 1.0 == 1, 1.1 > 1 } switch ( item.getType() ) { case INTEGER_ITEM: return value.compareTo( ( (IntegerItem) item ).value ); case STRING_ITEM: return 1; // 1.1 > 1-sp case LIST_ITEM: return 1; // 1.1 > 1-1 default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }
void normalize() { for ( int i = size() - 1; i >= 0; i-- ) { Item lastItem = get( i ); if ( lastItem.isNull() ) { // remove null trailing items: 0, "", empty list remove( i ); } else if ( !( lastItem instanceof ListItem ) ) { break; } } }