Linked Lists by Lookup/ Retrieve value in workflow
I have two lists linked by a look-up.
Genere List has title of genres and a Radio button named Active selectable values Yes/No.
Track list has a lookup field to Genere List and displays the title of the Genere.
I have a List Workflow on Track that starts on new track item. At some point in the workflow, I want to get the Active field from the Genere of the current track.I have been trying but doesn't work and my workflow just get stuck on that stage.
I am not finding anywhere how to do this step by step to identify what I am doing wrong. Or perhaps I'm not using the right search queries/terminology
Hi Stephan,
While creating Lookup column in Track list to show Genere title from Genere list, you have the option to select 'Add a column to show each of these additional fields:' You can select your column 'Active' there.
When you select Genere for a new Track, it also pulls the value for Active field. You should be able to easily access Active field through Designer workflow running for a new Track item.
Thanks.
Similar Messages
-
Hi,
I want to add numbers in a linked list. For example when i pass in the string 123456789, i reverse it so that it appears as 987654321 in the linked list. If i add this to the string 954 which appears as 459 in the linked list, i am supposed to get 123457743 but i get 1743. How do i rectify this from my code.
import java.util.LinkedList;
import java.util.ListIterator;
public class LargeInteger {
/** Constructs a new LargeInteger object from the specified String.
* The String parameter will contain the digits comprising the number
* to be represented by this LargeInteger object. The number may be
* either positive or negative, so be sure to check for a sign.
* You should throw an IllegalArgumentException if the string which is
* passed in does not contain a valid number. An invalid String would
* be one which contains any character other than a digit (however the
* first character may be a negative sign).
* @param value A String representing the number to be represented.
&nbs! p; * @throws IllegalArgumentException This exception is thrown if the
* parameter doesn't contain a valid number.
LinkedList digits = new LinkedList();
public LargeInteger(String value) throws IllegalArgumentException {
//Declare variables
boolean neg = false;
int num = 0;
int start = 0;
char ch = ' ';
Integer tempObj = new Integer(num);
//If the first character is not a - sign or it is less than the character 0
//or it is greater than the character zero, then throw
//IllegalArgumentException
//else add digits into linked list as integers
if(value.startsWith("-")) {
neg = true;
start = 1;
} else if ( !Character.isDigit(value.charAt(0)) ) {
throw new IllegalArgumentException();
for (int j = value.length()-1; j >= start; j--) {
ch = value.charAt(j);
if (Character.isDigit(ch)) {
num = Character.getNumericValue(ch);
tempObj = new Integer(num);
digits.add(tempObj);
} else {
throw new IllegalArgumentException();
} // end Constructor
public static void main(String[] args) {
LargeInteger a = new LargeInteger("954");
LargeInteger b = new LargeInteger("123456789");
LargeInteger c = a.plus(b);
System.out.println( c.toString() );
System.out.println( a.toString() );
System.out.println( b.toString() );
/** Calculates the sum of this LargeInteger object with the one passed
* as a parameter.
* @param other The number to add to the current value.
* @return The sum of this LargeInteger and the value passed as a
* parameter.
public LargeInteger plus(LargeInteger other) {
int i = 0;
LargeInteger result = new LargeInteger("0");
int carry = 0;
ListIterator onfiltered = digits.listIterator();
ListIterator two = other.digits.listIterator();
//Add digits in linked list
for (; i < digits.size() && i < other.digits.size(); i++) {
result.digits.addFirst(
new Integer(
(((Integer) digits.get(i)).intValue()
+ ((Integer) other.digits.get(i)).intValue()
+ carry)
% 10));
carry =
(((Integer) digits.get(i)).intValue()
+ ((Integer) other.digits.get(i)).intValue()
+ carry)
/ 10;
onfiltered.next();
two.next();
//Append any remaining digits from this value to the result's
//left
for(; i < digits.size();i++){
result.digits.addFirst(new Integer((((Integer)digits.get(i)).intValue() + carry) % 10));
carry = (((Integer)digits.get(i)).intValue() + carry) / 10;
onfiltered.next();
//Append any remaining digits from the other value to the result's
//left
for(; i < digits.size();i++){
result.digits.addFirst(new Integer((((Integer)other.digits.get(i)).intValue() + carry) % 10));
carry = (((Integer)other.digits.get(i)).intValue() + carry) / 10;
two.next();
if(carry != 0){
result.digits.addFirst(new Integer(carry));
return result;
} // end plusUse a debugger.
Or put in some debugging statements. -
Hi,
I'm Palanivel , In my site collection , I have 2 lists , In 1st list , i have id,name and Total Annual leave . In 2nd List i have ID,No of Days(taking leave),Balance Annual Leave.
My first task is,In List 2, get the value from list 1.total annual leave to list 2.balance annual leave. Next , i do some calculation ,that is (balance annual leave - no of days = balance annual leave) .
Now my updates working correctly . and the calculation also working but when next time applying leave , again the update process working , so balance annual leave becomes my total annual leave .
my question is how to do a update process only first time , next time only calculation task has to be performed .
how to do 2 task in a single workflow , the 1st task must run only one time .
please help ....
thanks in advanceAnyway-hopefully I am not talking to myself here.
The database i am using is Oracle 10 g version 1 and using vb2005 express.
As mentioned above the problem is the value of the parameter does not go into the query statement.
The same logic with changes made works for other major databases. So I do not think it is the logic.
Any suggestions? -
Reading values from lookup columns through custom workflow in SharePoint 2013
We are able to read the values of text, number columns through custom workflow (via coding) in SharePoint 2013. However, we are not able to read values from lookup columns. So, request anyone to provide help on this.
Thanks & regards,
AdityaHi,
According to your post, my understanding is that you want to read values from lookup columns through custom workflow in SharePoint 2013.
Since the workflow just doesn't get lookup fields, let's give it something static to work with instead. If we can capture the ID of the lookup field and store that as a static value in our list, the workflow can happily use that to look up our related.
For more information, you can refer to:
SharePoint 2013 Workflows and Lookup Columns
Thanks,
Linda Li
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Linda Li
TechNet Community Support -
In summary, I have created 3 document libraries and one issues list in a site collection.
The issues list has a form that has mainly been created in SharePoint 2010 but tweaked in InfoPath 2007 and one of the fields links to the title of a document in the first document library (so an issue can be linked/referenced to a particular document).
This all works great until I want to move a document (using the workflow that I built) from document library 1, to document library 2 or 3 as this is what I've set up to move documents through the business process we are taking it through.
When this happens, the link between the issue that was raised originally against the document is broken and therefore you can no longer tell which document the issue is linked with.
Does anyone know a way of 'setting' the field that is linked to data in another document library on original selection/creation of the issue, so that when the link is broken the original data remains.
Any ideas welcome as I am stomped!!!
Cheers!!
Louis Maxwell
Hi Louis,
According to your description, my understanding is that you want to keep the link field of the issue list working after moving the linked document.
Whether the link field is a lookup column or not ?
If so, due to the information source of lookup column cannot be changed, you need to add other lookup fields for document library 2 and document library 3. Just one lookup column corresponds one document
library. Then you can update the lookup column in the workflow when move the linked document. Such as when a document is moved to document library 2, you need to clear the lookup1 field (corresponding document library 1) and update the lookup2 field (corresponding
document library 2).
For updating the lookup column, you can refer to the following actions:
Best Regards,
Eric
Eric Tao
TechNet Community Support -
Retrieving lookup field values from a main table using MDM JAVA APIs
Hi all,
am trying to retrieve the main table data...., i could able to retrieve all the data except lookup field values..., iam facing some runtime exceptions and i dont know why exactly it is throwing this exception..., i pasted piece of code where exactly the error is and the exception also.
in the below sode i set some result set definitions and passing them to retrieveLimitedRecordsCommand. it is showing some exception at retrieveLimitedRecordsCommand.execute(); command.
//*** Code ***//
supportingMainResultDefinitions = new ResultDefinition[] { rdQual ,rdFlat, rdqFlat };
retrieveLimitedRecordsCommand.setResultDefinition(rd);
retrieveLimitedRecordsCommand.setSearch(new Search(tableId));
retrieveLimitedRecordsCommand.setSession(sessionId);
retrieveLimitedRecordsCommand.setSupportingResultDefinitions(supportingMainResultDefinitions);
try {
retrieveLimitedRecordsCommand.execute();
PrintRecords.toConsole(retrieveLimitedRecordsCommand.getRecords());
} catch (CommandException e) {
e.printStackTrace();
//*** Below is the Exception raised ***//
java.lang.UnsupportedOperationException: Unexpected field type -1
at com.sap.mdm.internal.schema.PropertiesHelper.createField(PropertiesHelper.java:274)
at com.sap.mdm.internal.schema.PropertiesHelper.convertFrom(PropertiesHelper.java:281)
at com.sap.mdm.internal.data.RecordMetadata.<init>(Unknown Source)
at com.sap.mdm.internal.data.RecordsLoader.<init>(Unknown Source)
at com.sap.mdm.internal.data.RecordsLoader.<init>(Unknown Source)
at com.sap.mdm.internal.data.RecordResultSetHelper.convertFrom(Unknown Source)
at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.execute(Unknown Source)
at com.sap.mdm.apitutorial.lesson2.RecordsDisplay.getDisplayRecords(RecordsDisplay.java:303)
at org.apache.jsp.Sample_jsp._jspService(Sample_jsp.java:190)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
If anyonw worked on this concept..., please provide me the solution
Regards
Praveen kWhich version are you using? Can you please try and narrow down to the offending field? You can do this by limiting the fields you provide to ResultDefinition.
-
Recursion:returning the largest value in a linked list
import java.io.*;
import java.util.*;
class Node{
int num;
Node next;
Node(int n){
num = n;
next = null;
class RecursivePrint{
public static void main(String[] args){
Node np, last;
Node top = null;
last = null;
for(int i = 1; i <11; i++){
np = new Node(i);
if(top==null)top = np;
else
last.next = np;
last = np;
int x =Largest(top);
System.out.println("large is "+ x);
}//end main
public static int Largest(Node top){
int large = 0;
if(top==null){
return 0;
while(top!=null){
if(top.num > large){
large = top.num;
//top = top.next;
Largest(top.next);
}//while
return large;
}//end class
I am trying to return the largest value in a linked list (10) in this case. when I do it withour recurrsion it works ok, but when I try it with recurrsion it dies. The logic seems ok to me, cannot figure why it dies.chetah wrote:
public static int Largest(Node top){
int large = 0;
if(top==null){
return 0;
if(top.num > large){
large = top.num;
//top = top.next;
Largest(top.next);
return large;
Initially I had the above, it return only 1 that was the reason for puting the loop.You don't seem to understand recursion or variable scope.
int large = 0;large is a different variable inside each instance of the method.
So when you get back up to the value 1 from the recursive calls its just comparing 1 to 0
Here's a solution...
public static int Largest(Node top){
if(top.next != null){
if(Largest(top.next) > top.num)
return Largest(top.next);}
return top.num;
} -
Values of data in a linked-list
hello.
i declare a small linked list of elemets (about 10), everything is fine and dandy but i need to assign an int value to every one of those elements as a counter whenever a certain action is performed on the element in the list.
LinkedList mylist = new Linkedlist();
int value=0;
//i need to assign a unique int value to every element in the list as a counter to keep track of how many times [whatever element] is accessed, moved around, ect.
is this possible?If your linked list contains a specific type of object, add a counter to it. This may mean extending whatever the class the element is.
If you want to do theis generically, you are probably going to have to extend LinkedList and inside that class encapsulate another collection (maybe a linked list). The encapsulated collection will contain the set of counters. You will have to override all of LinkedLists methods so that you can maintain the counters. -
Change the value of a SharePoint List lookup control value using javascript
hi,
could you please help in changing the value of a SharePoint List lookup control value using javascript.
Please note that i have to change the lookup value which is in the form of a drop down from the infopath form.
Thankshttps://stackoverflow.com/questions/5678210/select-dropdown-menu-option-with-javascript
Does that help? -
Based on select list, i need to retrieve values in other select list
Hi,
am new to apex using apex3.2, i need to retrieve values in select list based on the other select list vale with out refreshing page.
ie i have region select list and country select list,in country corresponding region country must be display but with out refreshing page.
can you please any body guide me.
Regards
shashidhar
Edited by: 871140 on Jul 7, 2011 10:34 PMHi,
you can use cascading LOV for that, i which the other LOV field will be changing depending upon the selection of other value(which is in LOV).
http://www.inside-oracle-apex.com/oracle-apex-4-0-cascading-lovsselect-lists/
Regards,
Mini
Mark Answers Promptly -
Append Lookup Column Values using SharePoint Designer Workflow
Hi all,
I can set the value of a lookup column using number;#itemname (ex. 1;#MyValue), but I need to add a value to a lookup column that has existing values. I have tried setting the lookup column to the current value plus the new value, but it fails. Please assist.
Regards,
Kelly
Personal Blog: http://thebitsthatbyte.comThis would fail because when using a lookup, that value must exist. The lookup creates a reference and if it can't find the reference in the list it's looking up to, it will fail. If you want to set it to something that is not in that list, then you'd
either need to add it to the list first (run a loop through the list and check to see if it's there, Yes=set the field, No=create new item in list and then set field) or use a single line of text field.
Andy Wessendorf SharePoint Developer II | Rackspace [email protected] -
Help needed in linked lists...
I have been working on this computer assignment lately but I still don't understand linked lists yet..I did an assignment on array based implementation and now I am supposed to do the same thing in linked list implementation..
I need help on how to change this into a linked list implementation..any help would be appreciated. Thank you..below is the code for the array based implementation..the only thing that needs change here is after where is says Array-based implementation of the ADT list.
public class ListArrayBasedDriver {
public static void main(String [] args) {
ListArrayBased myGroceryList = new ListArrayBased();
myGroceryList.add(1,"milk");
myGroceryList.add(2,"eggs");
myGroceryList.add(3,"butter");
myGroceryList.add(4,"pecans");
myGroceryList.add(5,"apples");
myGroceryList.add(6,"bread");
myGroceryList.add(7,"chicken");
myGroceryList.add(8,"rice");
myGroceryList.add(9,"red beans");
myGroceryList.add(10,"sausage");
myGroceryList.add(11,"flour");
printList(myGroceryList); //print out original List
System.out.print("numItems is now: " + myGroceryList.size() + "\n");
System.out.println("adding juice for 5th item...");
myGroceryList.add (5, (Object) "juice"); //add juice
System.out.println("item 5 is: " + myGroceryList.get(5)); //get position 5
printList(myGroceryList);
System.out.print("numItems is now: " + myGroceryList.size() + "\n");
System.out.println("removing juice...");
myGroceryList.remove (5); //remove item at position 5
printList(myGroceryList);
System.out.print("numItems is now: " + myGroceryList.size() + "\n");
public static void printList(ListArrayBased myList)
//method prints a list, numbering the values, e.g, "1. milk" .... "5. juice".... etc.
int i;
for(i=1; i <= myList.size(); i++)
String tempString = new String((String)myList.get(i));
System.out.println(i+" "+ tempString);
// Array-based implementation of the ADT list.
class ListArrayBased {
private static final int MAX_LIST = 50;
private Object items[]; // an array of list items
private int numItems; // number of items in list
public ListArrayBased()
// creates an empty list
items = new Object[MAX_LIST];
numItems = 0;
} // end default constructor
public boolean isEmpty()
return (numItems == 0);
} // end isEmpty
public int size()
return numItems;
} // end size
public void removeAll()
// Creates a new array; marks old array for
// garbage collection.
items = new Object[MAX_LIST];
numItems = 0;
} // end removeAll
public void add(int index, Object item) throws ListIndexOutOfBoundsException
if (numItems > MAX_LIST)
throw new ListException("ListException on add");
} // end if
if (index >= 1 && index <= numItems+1)
// make room for new element by shifting all items at
// positions >= index toward the end of the
// list (no shift if index == numItems+1)
for (int pos = numItems; pos >= index; pos--) {
items[translate(pos+1)] = items[translate(pos)];
} // end for
// insert new item
items[translate(index)] = item;
numItems++;
else
{ // index out of range
throw new ListIndexOutOfBoundsException(
"ListIndexOutOfBoundsException on add");
} // end if
} //end add
public Object get(int index) throws ListIndexOutOfBoundsException
if (index >= 1 && index <= numItems)
return items[translate(index)];
else
{ // index out of range
throw new ListIndexOutOfBoundsException(
"ListIndexOutOfBoundsException on get");
} // end if
} // end get
public void remove(int index) throws ListIndexOutOfBoundsException
if (index >= 1 && index <= numItems)
// delete item by shifting all items at
// positions > index toward the beginning of the list
// (no shift if index == size)
for (int pos = index+1; pos <= size(); pos++) {
items[translate(pos-1)] = items[translate(pos)];
} // end for
numItems--;
else
{ // index out of range
throw new ListIndexOutOfBoundsException("ListIndexOutOfBoundsException on remove");
} // end if
} // end remove
private int translate(int position) {
return position - 1;
} // end translate
} // end ListArrayBased
class ListException extends RuntimeException
public ListException(String s)
super(s);
} // end constructor
} // end ListException
class ListIndexOutOfBoundsException
extends IndexOutOfBoundsException {
public ListIndexOutOfBoundsException(String s) {
super(s);
} // end constructor
} // end ListIndexOutOfBoundsExceptionCould someone check for me if this will work and if it doesn't what I need to do to make it work..Thanks...
public class ListArrayBasedDriver {
public static void main(String [] args) {
ListArrayBased myGroceryList = new ListArrayBased();
myGroceryList.add(1,"milk");
myGroceryList.add(2,"eggs");
myGroceryList.add(3,"butter");
myGroceryList.add(4,"pecans");
myGroceryList.add(5,"apples");
myGroceryList.add(6,"bread");
myGroceryList.add(7,"chicken");
myGroceryList.add(8,"rice");
myGroceryList.add(9,"red beans");
myGroceryList.add(10,"sausage");
myGroceryList.add(11,"flour");
printList(myGroceryList); //print out original List
System.out.print("numItems is now: " + myGroceryList.size() + "\n");
System.out.println("adding juice for 5th item...");
myGroceryList.add (5, (Object) "juice"); //add juice
System.out.println("item 5 is: " + myGroceryList.get(5)); //get position 5
printList(myGroceryList);
System.out.print("numItems is now: " + myGroceryList.size() + "\n");
System.out.println("removing juice...");
myGroceryList.remove (5); //remove item at position 5
printList(myGroceryList);
System.out.print("numItems is now: " + myGroceryList.size() + "\n");
public static void printList(ListArrayBased myList)
//method prints a list, numbering the values, e.g, "1. milk" .... "5. juice".... etc.
int i;
for(i=1; i <= myList.size(); i++)
String tempString = new String((String)myList.get(i));
System.out.println(i+" "+ tempString);
// Linked List-based implementation of the ADT list.
class ListNode
//class to represent one node in a list
class ListNode
//package access members; List can access these directly
Object data;
ListNode nextNode;
//contructor creates a ListNode that refers to object
ListNode( Object object)
this( object, null );
} //end ListNode one-argument constructor
//constructor creates ListNode that refers to
// Object and to the next ListNode
ListNode ( Object object, ListNode node)
data = object;
nextNode = node;
// end ListNode two-argument contructor
//return reference to data in node
Object getObject()
return data; // return Object in this mode
//return reference to next node in list
ListNode getNext()
return nextNode; // get next node
} // end method getNext
} //end class ListNode
//class List Definition
public class List
private ListNode firstNode;
private ListNode lastNode;
private String name; // string like " list " used in printing
//contructor creates empty List with " list " as the name
public List()
this(" list ");
} //end List no-arguement constructor
//contructor creates an empty list with a name
public List( String listName )
name = listname;
firstNode = lastNode = null;
} //end List no-arguement contructor
//insert Object at front of List
public void insertAtFront ( object insertItem )
if ( isEmpty() ) //firstNode and lastNode refer to same object
firstNode = lastNode = newListNode( insertItem );
else // firstNode refers to new node
firstNode = new ListNode ( insertItem, firstNode );
} // end method insertAtFront
// insert Object at end of List
public void insert AtBack ( Object insertItem )
if ( isEmpty() ) //firstNode and lastNode refer to same object
firstNode = new ListNode ( insertItem );
else // firstNode refers to new node
firstNode = new ListNode (insertItem, firstNode );
} // end method insertAtFront
// insert Object at end of List
public void insertAtBack ( Object insertItem )
if ( isEmpty() ) //firstNode and LastNode refer to same Object
firstNode = lastNode = new ListNode ( insertItem );
else // lastNode = lastNode.nextNode = new ListNode ( insertItem );
} // end method insertAtBack
//remove first node from List
public Object removeFromFront() throws EmptyListException
if( isEmpty() ) //throw exception if list is empty
throw new EmptyListException( name );
object removedItem = firstNode.data; //retrieve data being removed
// update references firstNode and lastNode
if (firstNode == lastNode )
firstNode =lastNode = null;
else
firstNode = firstNode.nextNode;
return removedItem; // return removed node data
} //end method removeFromFront
//remove last node from List
Public Object removeFromBack() throws EmptyListException
If ( isEmpty() ) // throw exception if list is empty
throw new EmptyListException( name );
Object removedItem = lastNode.data; // retrieve data being removed
// update references firstNode and lastNode
If ( firstNode == lastNode )
firstNode = lastNode = null;
else // locate new last node
ListNode current = firstNode;
// loop while current node does not refer to lastNode
while ( current.nextNode != lastNode )
current = current.nextNode;
lastNode = current; // current is new lastNode
current.nextNode = null;
} // end else
return removedItem; // return removed node data
} // end method removeFromBack
// determine whether list is empty
public boolean isEmpty()
return firstNode == null; // return true if list is empty
} // end method isEmpty
//output List contents
public void print()
if (isEmpty() )
System.out.printf(�Empty %s\n�, name );
return;
System.out.printf(�The %s is: �, name );
ListNode current = firstNode;
//while (current != null )
System.out,printf(�%s �, current.data );
current = current.nextNode;
} //end while
System.out.println( �\n� );
} //end method print
} end class List -
Changing data in a linked list object.
hi,
i'm still pretty new to java, so bear with me if i am making stupid mistakes, heh.
i'm having trouble with changing data in an object stored in a singly-linked list. i've created a class that will store polynomials in sorted order (descending) in a singly-linked list. each linked list is one polynomial, and each node references to a polynomial object that stores two ints: the coefficient and the exponent of that term.
i'm having trouble when it comes to 'collecting like terms,' though. here's a rough skeleton of my code:
public class Polynomial
private LinkedList polynoList;
private LinkedListItr Itr;
private int coeff;
private int exponent;
public Polynomial()
zeroPolynomial();
} // this constructor sets up an empty linked list
public Polynomial( int c, int e )
coeff = c;
exponent = e;
} // this creates a Polynomial object storing the two ints
public void zeroPolynomial()
polynoList = new LinkedList();
theItr = polynoList.zeroth();
} // this method creates the empty linked list and sets the
//iterator on the zeroth node.
//various other methods are here, not relevant to my post
//this next method is the one i am having trouble with.
//it takes two ints as parameters, the coefficient
//and the exponent.
public void insertTerm( int c, int e )
//...i have a few if/then statements here
//so that the terms can be inserted in descending order.
LinkedListItr tester = polynoList.first();
//the 'tester' iterator is set on the first node
//this following if statement retrieves the exponent
//in the current node by casting the information
//retrieved from the LinkedList retrieve() method
//into Polynomial, then compares it to the current
//exponent. if they are equal, i want to add the
//coefficients.
if( e == ((Polynomial)tester.retrieve()).getExp() )
this.coeff = ((Polynomial)tester.retrieve()).getCoeff() + c;
//a main method goes here wherein the user can insert
//terms, print the polynomial, etc.
}//end Polynomial class
can anyone help me out? the code i'm using compiles correctly, but it does not change the value of the current coeff variable as i'd like to think it should. any input would be GREATLY appreciated, thanks!hey,
thanks for the reply...
i am sure that ((Polynomial)tester.retrieve()).getExp() will return an int equal to 'e.' i tried this:
System.out.println("e="+e);
System.out.println((Polynomial)tester.retrieve()).getExp());
if( e == ((Polynomial)tester.retrieve()).getExp() ){
this.coeff = ((Polynomial)tester.retrieve()).getCoeff() + c;
System.out.println( "this.coeff = " + this.coeff );
with that, the output showed that e and the getExp() output were the same. it also showed (as output) that this.coeff did change in value, but when i tried this:
System.out.println( ((Polynomial)tester.retrieve()).getCoeff() )
to check if the value changed within the object, it didn't. this.coeff changed, but the actual coeff variable in the object didn't.
any ideas? -
Can we set List View Lookup Threshold at site collection level ?
Hello,
Presently, we have requirement to set the List View Lookup Threshold at Site Collection/Sub-Site level instead of web application level.
Could you please let me know, are there any ways to set
List View Lookup Threshold setting at Site Collection/Sub-Site level
in SharePoint 2010 using Powershell/Object Model
Also, it would be helpful if you colud let me know, upto what extent , we can drill down List View Lookup Threshold setting i.e. SubSite/List/Library-Folder.
Thanks in advance !
Regards,
Sagar Acharya
Email - [email protected]Hi Sagar,
We cannot set list view threshold value at sitecollection/subsite level. It can only be set at web application level.
However we can bypass the 5000 limit using PowerShell command by setting “Enable Throttling”= false for particular list.
Reference link:
http://pravahaminfo.blogspot.in/2012/10/how-to-increase-list-view-threshold.html
Thanks,
Somnath Matere -
Linked List - deleeting nodes - HELP!
How do I delete all occurences of the nodes with the same parameters in the linked list ?
example:
Node1-> Node2 ->Node3->Node4->Node5
Node1, Node4, and Node5 have the same String value, how do I delete them in one method without breaking the linked list ?
thanksHi,
You have iterate thru the linked list remove one by one. Also have look at other collection classes like HashSet or HashMap for fast retrieval.
Maybe you are looking for
-
Error encountered while trying to use EJB control in a Platform Domain
Hi, I've configured a Weblogic Platform domain and installed all the application EJB's thru a JAR file. When I try to access these EJB's from within Web Logic Workshop using the EJB Control, I am able to find the Home and the Remote interfaces and th
-
Multiple Problems with MSI 890FXA-GD65
I am having problems getting a clean build of new components to work. The components are: motherboard is MSI 890FXA-GD65 processor is AMD Phenom II X2 565 Callisto memory is 2x 4Gb G.Skill Ripjaws X model F2-12800CL9D (CAS 9, Unbuffered DDR3 1600) d
-
Is there a way I can view texts I have deleted
I need to access texts I have deleted and I am not sure how to do that or if I can.
-
Can anyone offer any advice on how to debug a font problem? I am using a (shareware) symbol font on my Windows XP system. It works great in FrameMaker, and comes out perfectly in Frame-generated PDF files. Unfortunately, I also have to convert Excel
-
I want to upgrade to version ios 7, but that requires at least 5 gb of available space and my device says I've only got 1.2 gb available. My music, photos and apps add up to about 6.5 gb, so I presume the operating system and other pre installed soft