Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   *        JacORB - a free Java ORB
   *
   *   Copyright (C) 1999-2012 Gerald Brose / The JacORB Team.
   *
   *   This library is free software; you can redistribute it and/or
   *   modify it under the terms of the GNU Library General Public
   *   License as published by the Free Software Foundation; either
   *   version 2 of the License, or (at your option) any later version.
  *
  *   This library is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *   Library General Public License for more details.
  *
  *   You should have received a copy of the GNU Library General Public
  *   License along with this library; if not, write to the Free
  *   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
 package org.jacorb.collection;
 
 
                           implements OrderedIteratorOperations {
 /* ========================================================================= */
     protected boolean reverse// reverse now not supperted
 /* ========================================================================= */
     OrderedIteratorImplOrderedCollectionImpl collection ){
         supercollection );
          = false;
     };
 /* ------------------------------------------------------------------------- */
     OrderedIteratorImplOrderedCollectionImpl collectionboolean read_only ){
         supercollectionread_only );
          = false;
     };
 /* ------------------------------------------------------------------------- */
     OrderedIteratorImplOrderedCollectionImpl collectionboolean read_onlyboolean reverse ){
         supercollectionread_only );
         ifreverse ){
             throw new org.omg.CORBA.NO_IMPLEMENT();
         }
         this. = reverse;
     };
 /* ========================================================================= */
     public boolean set_to_last_element(){
         synchronized ){
             set_pos..size()-1 );
             set_in_betweenfalse );
             return is_valid();
         }
     };
 /* ------------------------------------------------------------------------- */
     public boolean set_to_previous_element() throws IteratorInvalid{
         return set_to_nth_previous_element( 1 );
     };
 /* ------------------------------------------------------------------------- */
     public boolean set_to_nth_previous_element(int nthrows IteratorInvalid{
         synchronized ) {
             check_invalid();
             int new_pos = get_pos()-n;
             if.number_of_elements() > new_pos && new_pos >= 0 ){
                 set_posnew_pos );
             } else {
                 invalidate();
                 throw new IteratorInvalid. );
             }
             set_in_betweenfalse );
             return is_valid();
         }
     };
 /* ------------------------------------------------------------------------- */
     public void set_to_position(int positionthrows PositionInvalid{
         synchronized ){
             ifposition <0 || position >= ..size() ){
                 throw new PositionInvalid();
             }
             set_posposition );
             set_in_betweenfalse );
         };
     };
 /* ------------------------------------------------------------------------- */
     public int position() throws IteratorInvalid{
         synchronized ){
             check_invalid();
             return get_pos();
         }
    }
/* ------------------------------------------------------------------------- */
        synchronized ){
            check_iterator();
            try {
                element.value = .element_retrieve );
            } catch ( PositionInvalid e ){
                invalidate();
                throw new IteratorInvalid. );
            };
            more.value = (get_pos() > 0);
            return set_to_previous_element();
        }
    };
/* ------------------------------------------------------------------------- */
    public boolean retrieve_previous_n_elements(int nAnySequenceHolder resultBooleanHolder morethrows IteratorInvalid,IteratorInBetween{
        synchronized ) {
            check_iterator();
            Vector v = new Vector(n);
            AnyHolder a = new AnyHolder();
            forint i=0; ( i<n || n==0 ) && is_valid(); i++ ){
                 try {
                     a.value = .element_retrieveget_pos() );
                     set_posget_pos()-1 );
                 } catch ( PositionInvalid e ){
                     invalidate();
                     throw new IteratorInvalid. );
                 };
                 v.addElementa.value );
                 a.value = null;
            }
            more.value = (get_pos() > 0);
            ifv.size() > 0 ){
                result.value = new Anyv.size() ];
                v.copyInto( (java.lang.Object []) result.value );
                return true;
            } else {
                return false;
            }
        }
    };
/* ------------------------------------------------------------------------- */
							      AnyHolder element
    {
        synchronized ) {
            check_iterator();
            PositionalIteratorImpl iter = .check_iteratortest );
            iter.check_iterator();
            ifis_equaltest ) ){
                retrieve_elementelement );
                return false;
            } else {
                retrieve_element_set_to_previouselementnew org.omg.CORBA.BooleanHolder() );
                return true;
            }
        }
    };
/* ------------------------------------------------------------------------- */
        synchronized ) {
            remove_element();
            return set_to_previous_element();
        }
    };
/* ------------------------------------------------------------------------- */
    public boolean remove_previous_n_elements(int norg.omg.CORBA.IntHolder actual_numberthrows IteratorInvalid,IteratorInBetween{
        synchronized ) {
            actual_number.value = 0;
            forint i = 0; ( i<n || n == 0 ) && is_valid(); i++, actual_number.value++ ){
                remove_element_set_to_previous();
            }
            return is_valid();
        }
    };
/* ------------------------------------------------------------------------- */
    {
        synchronized ) {
            check_iterator();
            PositionalIteratorImpl iter = .check_iteratortest );
            iter.check_iterator();
            ifis_equaltest ) ){
                remove_element();
                return false;
            } else {
                remove_element_set_to_previous();
                return true;
            }
        }
    };
/* ------------------------------------------------------------------------- */
        synchronized ) {
            replace_elementelement );
            return set_to_previous_element();
        }
    };
/* ------------------------------------------------------------------------- */
    public boolean replace_previous_n_elements(org.omg.CORBA.Any[] elementsorg.omg.CORBA.IntHolder actual_numberthrows IteratorInvalid,IteratorInBetween,ElementInvalid{
        synchronized ) {
            actual_number.value = 0;
            forint i=0; i<elements.length && is_valid(); i++,actual_number.value++ ){
                replace_element_set_to_previouselements[i] );
            }
            return is_valid();
        }
    };
/* ------------------------------------------------------------------------- */
        synchronized ) {
            check_iterator();
            PositionalIteratorImpl iter = .check_iteratortest );
            iter.check_iterator();
            ifis_equaltest ) ){
                replace_elementelement );
                return false;
            } else {
                replace_element_set_to_previouselement );
                return true;
            }
        }
    };
/* ------------------------------------------------------------------------- */
    public boolean is_first(){
        return get_pos() == 0;
    };
/* ------------------------------------------------------------------------- */
    public boolean is_last(){
        synchronized ){
            return ..size()-1 == get_pos();
        }
    };
/* ------------------------------------------------------------------------- */
    public boolean is_for_same(org.omg.CosCollection.Iterator test){
        synchronized ){
            try {
                .check_iteratortest );
                return true;
            } catch ( IteratorInvalid e ){
                return false;
            }
        }
    };
/* ------------------------------------------------------------------------- */
    public synchronized boolean is_reverse(){
        return ;
    };
/* ========================================================================= */
};






New to GrepCode? Check out our FAQ X