test_class.declarator: history
test_class.modifier: private
test_class.original_string: private SplitHistory history;
test_class.type: SplitHistory
test_class.var_name: history
test_class.declarator: historySplit
test_class.modifier: private
test_class.original_string: private SplitHistory[] historySplit;
test_class.type: SplitHistory[]
test_class.var_name: historySplit
test_class.file: commons/flow/src/test/java/org/openehealth/ipf/commons/flow/history/SplitHistoryTest.java
test_class.identifier: SplitHistoryTest
test_case.body: @Test
  	public void testIsPredecessor() {
  		// tests reflexivity
  		String id = "[(0/1),(0/2),(0/4),(0/2)]";
  		assertFalse(SplitHistory.parse(id)
  				.isPredecessor(SplitHistory.parse(id)));
  		assertFalse(SplitHistory.parse(id).isSuccessor(SplitHistory.parse(id)));
  		id = "[(0/1),(1/2),(0/1234)]";
  		assertFalse(SplitHistory.parse(id)
  				.isPredecessor(SplitHistory.parse(id)));
  		assertFalse(SplitHistory.parse(id).isSuccessor(SplitHistory.parse(id)));
  
  		// tests also symmetry for the immediate parts
  		String p1 = "[(0/1),(0/2),(1/3)]";
  		String p2 = "[(0/1),(0/2),(2/3)]";
  		assertTrue(SplitHistory.parse(p1).isPredecessor(SplitHistory.parse(p2)));
  		assertFalse(SplitHistory.parse(p2)
  				.isPredecessor(SplitHistory.parse(p1)));
  		p1 = "[(0/1),(0/2),(2/3)]";
  		p2 = "[(0/1),(1/2),(0/2),(0/4)]";
  		assertTrue(SplitHistory.parse(p1).isPredecessor(SplitHistory.parse(p2)));
  		assertFalse(SplitHistory.parse(p2)
  				.isPredecessor(SplitHistory.parse(p1)));
  		p1 = "[(0/1),(1/2),(0/2),(2/4)]";
  		p2 = "[(0/1),(1/2),(0/2),(3/4),(0/3)]";
  		assertTrue(SplitHistory.parse(p1).isPredecessor(SplitHistory.parse(p2)));
  		assertFalse(SplitHistory.parse(p2)
  				.isPredecessor(SplitHistory.parse(p1)));
  		p1 = "[(0/1),(1/2),(0/2),(2/4)]";
  		p2 = "[(0/1),(1/2),(0/2),(1/4),(0/3)]";
  		assertFalse(SplitHistory.parse(p1)
  				.isPredecessor(SplitHistory.parse(p2)));
  		assertFalse(SplitHistory.parse(p2)
  				.isPredecessor(SplitHistory.parse(p1)));
  		p1 = "[(0/1),(1/2),(0/2),(2/4)]";
  		p2 = "[(0/1),(1/2),(1/2),(0/4),(0/3)]";
  		assertFalse(SplitHistory.parse(p1)
  				.isPredecessor(SplitHistory.parse(p2)));
  		assertFalse(SplitHistory.parse(p2)
  				.isPredecessor(SplitHistory.parse(p1)));
  		p1 = "[(0/1),(1/2),(0/2),(3/4),(2/3)]";
  		p2 = "[(0/1),(1/2),(1/2)]";
  		assertTrue(SplitHistory.parse(p1).isPredecessor(SplitHistory.parse(p2)));
  		assertFalse(SplitHistory.parse(p2)
  				.isPredecessor(SplitHistory.parse(p1)));
  		p1 = "[(0/1)]";
  		p2 = "[(0/1)]";
  		assertFalse(SplitHistory.parse(p1)
  				.isPredecessor(SplitHistory.parse(p2)));
  		assertFalse(SplitHistory.parse(p2)
  				.isPredecessor(SplitHistory.parse(p1)));
  		p1 = "[(0/1),(0/2)]";
  		p2 = "[(0/1),(0/2)]";
  		assertFalse(SplitHistory.parse(p1)
  				.isPredecessor(SplitHistory.parse(p2)));
  		assertFalse(SplitHistory.parse(p2)
  				.isPredecessor(SplitHistory.parse(p1)));
  		p1 = "[(0/1),(0/2)]";
  		p2 = "[(0/1),(0/2),(0/2)]";
  		assertFalse(SplitHistory.parse(p1)
  				.isPredecessor(SplitHistory.parse(p2)));
  		assertFalse(SplitHistory.parse(p2)
  				.isPredecessor(SplitHistory.parse(p1)));
  	}
test_case.class_method_signature: SplitHistoryTest.testIsPredecessor()
test_case.full_signature: @Test public void testIsPredecessor()
test_case.identifier: testIsPredecessor
test_case.invocations: assertFalse isPredecessor parse parse assertFalse isSuccessor parse parse assertFalse isPredecessor parse parse assertFalse isSuccessor parse parse assertTrue isPredecessor parse parse assertFalse isPredecessor parse parse assertTrue isPredecessor parse parse assertFalse isPredecessor parse parse assertTrue isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse assertTrue isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse assertFalse isPredecessor parse parse
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIsPredecessor()
focal_class.declarator: ROOT = new SplitHistory()
focal_class.modifier: public static final
focal_class.original_string: public static final SplitHistory ROOT = new SplitHistory();
focal_class.type: SplitHistory
focal_class.var_name: ROOT
focal_class.declarator: PATH_OPEN = "["
focal_class.modifier: private static final
focal_class.original_string: private static final String PATH_OPEN = "[";
focal_class.type: String
focal_class.var_name: PATH_OPEN
focal_class.declarator: PATH_CLOSE = "]"
focal_class.modifier: private static final
focal_class.original_string: private static final String PATH_CLOSE = "]";
focal_class.type: String
focal_class.var_name: PATH_CLOSE
focal_class.declarator: PATH_SEP = ","
focal_class.modifier: private static final
focal_class.original_string: private static final String PATH_SEP = ",";
focal_class.type: String
focal_class.var_name: PATH_SEP
focal_class.declarator: PATTERN = "^\\" + PATH_OPEN + ".*\\" + PATH_CLOSE + "$"
focal_class.modifier: private static final
focal_class.original_string: private static final String PATTERN = "^\\" + PATH_OPEN + ".*\\" + PATH_CLOSE + "$";
focal_class.type: String
focal_class.var_name: PATTERN
focal_class.declarator: entries
focal_class.modifier: private final
focal_class.original_string: private final List<SplitHistoryEntry> entries;
focal_class.type: List<SplitHistoryEntry>
focal_class.var_name: entries
focal_class.file: commons/flow/src/main/java/org/openehealth/ipf/commons/flow/history/SplitHistory.java
focal_class.identifier: SplitHistory
focal_class.interfaces: implements Comparable<SplitHistory>, Serializable
focal_class.class_method_signature: SplitHistory.SplitHistory()
focal_class.full_signature: public  SplitHistory()
focal_class.identifier: SplitHistory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  SplitHistory()
focal_class.class_method_signature: SplitHistory.SplitHistory(int initialCapacity)
focal_class.full_signature: public  SplitHistory(int initialCapacity)
focal_class.identifier: SplitHistory
focal_class.modifiers: public
focal_class.parameters: (int initialCapacity)
focal_class.signature:  SplitHistory(int initialCapacity)
focal_class.class_method_signature: SplitHistory.SplitHistory(boolean addRoot)
focal_class.full_signature: private  SplitHistory(boolean addRoot)
focal_class.identifier: SplitHistory
focal_class.modifiers: private
focal_class.parameters: (boolean addRoot)
focal_class.signature:  SplitHistory(boolean addRoot)
focal_class.class_method_signature: SplitHistory.SplitHistory(int initialCapacity, boolean addRoot)
focal_class.full_signature: private  SplitHistory(int initialCapacity, boolean addRoot)
focal_class.identifier: SplitHistory
focal_class.modifiers: private
focal_class.parameters: (int initialCapacity, boolean addRoot)
focal_class.signature:  SplitHistory(int initialCapacity, boolean addRoot)
focal_class.class_method_signature: SplitHistory.size()
focal_class.full_signature: public int size()
focal_class.identifier: size
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int size()
focal_class.class_method_signature: SplitHistory.entries()
focal_class.full_signature: public List<SplitHistoryEntry> entries()
focal_class.identifier: entries
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<SplitHistoryEntry>
focal_class.signature: List<SplitHistoryEntry> entries()
focal_class.class_method_signature: SplitHistory.indexPath()
focal_class.full_signature: public int[] indexPath()
focal_class.identifier: indexPath
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int[]
focal_class.signature: int[] indexPath()
focal_class.class_method_signature: SplitHistory.indexPathString()
focal_class.full_signature: public String indexPathString()
focal_class.identifier: indexPathString
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String indexPathString()
focal_class.class_method_signature: SplitHistory.split(int num)
focal_class.full_signature: public SplitHistory[] split(int num)
focal_class.identifier: split
focal_class.modifiers: public
focal_class.parameters: (int num)
focal_class.return: SplitHistory[]
focal_class.signature: SplitHistory[] split(int num)
focal_class.class_method_signature: SplitHistory.split(int index, boolean last)
focal_class.full_signature: public SplitHistory split(int index, boolean last)
focal_class.identifier: split
focal_class.modifiers: public
focal_class.parameters: (int index, boolean last)
focal_class.return: SplitHistory
focal_class.signature: SplitHistory split(int index, boolean last)
focal_class.class_method_signature: SplitHistory.compareTo(SplitHistory history)
focal_class.full_signature: @Override public int compareTo(SplitHistory history)
focal_class.identifier: compareTo
focal_class.modifiers: @Override public
focal_class.parameters: (SplitHistory history)
focal_class.return: int
focal_class.signature: int compareTo(SplitHistory history)
focal_class.class_method_signature: SplitHistory.isPredecessor(SplitHistory history)
focal_class.full_signature: public boolean isPredecessor(SplitHistory history)
focal_class.identifier: isPredecessor
focal_class.modifiers: public
focal_class.parameters: (SplitHistory history)
focal_class.return: boolean
focal_class.signature: boolean isPredecessor(SplitHistory history)
focal_class.class_method_signature: SplitHistory.isSuccessor(SplitHistory history)
focal_class.full_signature: public boolean isSuccessor(SplitHistory history)
focal_class.identifier: isSuccessor
focal_class.modifiers: public
focal_class.parameters: (SplitHistory history)
focal_class.return: boolean
focal_class.signature: boolean isSuccessor(SplitHistory history)
focal_class.class_method_signature: SplitHistory.isFirstUpTo(int level)
focal_class.full_signature: public boolean isFirstUpTo(int level)
focal_class.identifier: isFirstUpTo
focal_class.modifiers: public
focal_class.parameters: (int level)
focal_class.return: boolean
focal_class.signature: boolean isFirstUpTo(int level)
focal_class.class_method_signature: SplitHistory.isLastUpTo(int level)
focal_class.full_signature: public boolean isLastUpTo(int level)
focal_class.identifier: isLastUpTo
focal_class.modifiers: public
focal_class.parameters: (int level)
focal_class.return: boolean
focal_class.signature: boolean isLastUpTo(int level)
focal_class.class_method_signature: SplitHistory.isFirst()
focal_class.full_signature: public boolean isFirst()
focal_class.identifier: isFirst
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isFirst()
focal_class.class_method_signature: SplitHistory.isLast()
focal_class.full_signature: public boolean isLast()
focal_class.identifier: isLast
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isLast()
focal_class.class_method_signature: SplitHistory.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_class.class_method_signature: SplitHistory.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: SplitHistory.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: SplitHistory.parse(String history)
focal_class.full_signature: public static SplitHistory parse(String history)
focal_class.identifier: parse
focal_class.modifiers: public static
focal_class.parameters: (String history)
focal_class.return: SplitHistory
focal_class.signature: SplitHistory parse(String history)
focal_class.class_method_signature: SplitHistory.validateRoot(SplitHistoryEntry node)
focal_class.full_signature: private static void validateRoot(SplitHistoryEntry node)
focal_class.identifier: validateRoot
focal_class.modifiers: private static
focal_class.parameters: (SplitHistoryEntry node)
focal_class.return: void
focal_class.signature: void validateRoot(SplitHistoryEntry node)
focal_method.body: public boolean isPredecessor(SplitHistory history) {
          int ts = size();
          int ps = history.size();
          int last = -1;
          SplitHistoryEntry tn = null;
          SplitHistoryEntry pn = null;
          // walk along common path from root
          for (int i = 0; i < Math.min(ts, ps); i++) {
              last = i;
              tn = entries.get(i);
              pn = history.entries.get(i);
              if (tn.getIndex() != pn.getIndex()) {
                  break;
              }
          }
          if (!tn.isPredecessor(pn)) {
              return false;
          }
          if (!isLastUpTo(last)) {
              return false;
          }
          if (!history.isFirstUpTo(last)) {
              return false;
          }
          return true;
  
      }
focal_method.class_method_signature: SplitHistory.isPredecessor(SplitHistory history)
focal_method.full_signature: public boolean isPredecessor(SplitHistory history)
focal_method.identifier: isPredecessor
focal_method.invocations: size size min get get getIndex getIndex isPredecessor isLastUpTo isFirstUpTo
focal_method.modifiers: public
focal_method.parameters: (SplitHistory history)
focal_method.return: boolean
focal_method.signature: boolean isPredecessor(SplitHistory history)