public psidev.psi.mi.xml253.jaxb.PositionType toJaxb( psidev.psi.mi.xml.model.Position mPosition ) { if ( mPosition == null ) { throw new IllegalArgumentException( "You must give a non null model Position." ); } psidev.psi.mi.xml253.jaxb.PositionType jPosition = new psidev.psi.mi.xml253.jaxb.PositionType(); //Initialise the JAXB object reading the model //position jPosition.setPosition( BigInteger.valueOf( mPosition.getPosition() ) ); return jPosition; } }
public psidev.psi.mi.xml.model.Position fromJaxb( psidev.psi.mi.xml254.jaxb.Position jPosition ) { if ( jPosition == null ) { throw new IllegalArgumentException( "You must give a non null JAXB Position." ); } psidev.psi.mi.xml.model.Position mPosition = new psidev.psi.mi.xml.model.Position(); //Initialise the model reading the Jaxb object //position mPosition.setPosition( jPosition.getPosition().longValue() ); return mPosition; }
public Position( long position ) { setPosition( position ); }
@Override public boolean equals( Object o ) { if ( this == o ) return true; if ( o == null || getClass() != o.getClass() ) return false; final Range range = ( Range ) o; if ( begin != null ? !begin.equals( range.begin ) : range.begin != null ) return false; if ( beginInterval != null ? !beginInterval.equals( range.beginInterval ) : range.beginInterval != null ) return false; if ( end != null ? !end.equals( range.end ) : range.end != null ) return false; if ( endInterval != null ? !endInterval.equals( range.endInterval ) : range.endInterval != null ) return false; if ( !endStatus.equals( range.endStatus ) ) return false; if ( isLink != null ? !isLink.equals( range.isLink ) : range.isLink != null ) return false; if ( !startStatus.equals( range.startStatus ) ) return false; return true; }
@Override public int hashCode() { int result; result = startStatus.hashCode(); result = 29 * result + ( begin != null ? begin.hashCode() : 0 ); result = 29 * result + ( beginInterval != null ? beginInterval.hashCode() : 0 ); result = 29 * result + endStatus.hashCode(); result = 29 * result + ( end != null ? end.hashCode() : 0 ); result = 29 * result + ( endInterval != null ? endInterval.hashCode() : 0 ); result = 29 * result + ( isLink != null ? isLink.hashCode() : 0 ); return result; } }
public psidev.psi.mi.xml254.jaxb.Position toJaxb( psidev.psi.mi.xml.model.Position mPosition ) { if ( mPosition == null ) { throw new IllegalArgumentException( "You must give a non null model Position." ); } psidev.psi.mi.xml254.jaxb.Position jPosition = new psidev.psi.mi.xml254.jaxb.Position(); //Initialise the JAXB object reading the model //position jPosition.setPosition( BigInteger.valueOf( mPosition.getPosition() ) ); return jPosition; } }
public psidev.psi.mi.xml.model.Position fromJaxb( psidev.psi.mi.xml253.jaxb.PositionType jPosition ) { if ( jPosition == null ) { throw new IllegalArgumentException( "You must give a non null JAXB PositionType." ); } psidev.psi.mi.xml.model.Position mPosition = new psidev.psi.mi.xml.model.Position(); //Initialise the model reading the Jaxb object //position mPosition.setPosition( jPosition.getPosition().longValue() ); return mPosition; }
/** * It allows deleting the > or < char and create the Position * * @param stringPosition string to process * @return The new Position */ private static Position removeFirstCharAndConvert(String stringPosition) throws ConverterException { Position rangePosition; if (stringPosition.length() > 1) { String position = stringPosition.substring(1); if (!position.equals("")) { //We have a number no a empty String try { rangePosition = new Position(Long.valueOf(position)); } catch (Exception e) { throw new ConverterException("The range is bad formatted. Value:" + position); } } else throw new ConverterException("The range is bad formatted. Value:" + position); } else throw new ConverterException("The range is bad formatted. Value:" + stringPosition); return rangePosition; } }
private static String buildPosition(Range range, int startOrEnd) throws TabConversionException { String res; if (startOrEnd == START) { if (range.hasBegin()) { res = String.valueOf((range.getBegin().getPosition())); } else { throw new TabConversionException("The range must have a valid start position."); } } else {//if (startOrEnd == END) if (range.hasEnd()) { res = String.valueOf((range.getEnd().getPosition())); } else { throw new TabConversionException("The range must have a valid end position."); } } return res; }
value = new Position(Long.valueOf(position)); } catch (Exception e) { throw new ConverterException("The range is a certain sequence position but is bad formatted. Value:" + value);
final int begin = Long.valueOf(psiObject.getBegin().getPosition()).intValue(); beginIntervalFrom = begin; beginIntervalTo = beginIntervalFrom; final int end = Long.valueOf(psiObject.getEnd().getPosition()).intValue(); endIntervalFrom = end; endIntervalTo = endIntervalFrom;